Virtualbox WDDM之DxgkDdiCreateAllocation

来源:互联网 发布:红蜘蛛教学软件怎么退 编辑:程序博客网 时间:2024/05/19 02:29


/*The DxgkDdiOpenAllocation function binds non-device-specific allocations that the DxgkDdiCreateAllocation function created to allocations that are specific to the specified graphics context device.hDeviceSpecificAllocation[out] A handle to the device-specific allocation that corresponds to the non device-specific allocation that hAllocation specifies. The display miniport driver must set hDeviceSpecificAllocation to a handle value that it can use to refer to its private tracking structure for the allocation.typedef struct VBOXWDDM_OPENALLOCATION{    D3DKMT_HANDLE  hAllocation;} VBOXWDDM_OPENALLOCATION, *PVBOXWDDM_OPENALLOCATION;typedef struct _DXGK_OPENALLOCATIONINFO {  D3DKMT_HANDLE hAllocation;  ...};*/NTSTATUSAPIENTRYDxgkDdiOpenAllocation(    CONST HANDLE  hDevice,    CONST DXGKARG_OPENALLOCATION  *pOpenAllocation){    /* DxgkDdiOpenAllocation should be made pageable. */    PAGED_CODE();    NTSTATUS Status = STATUS_SUCCESS;    for (UINT i = 0; i < pOpenAllocation->NumAllocations; ++i)    {        DXGK_OPENALLOCATIONINFO* pInfo = &pOpenAllocation->pOpenAllocation[i];        PVBOXWDDM_OPENALLOCATION pOa = (PVBOXWDDM_OPENALLOCATION)vboxWddmMemAllocZero(sizeof (VBOXWDDM_OPENALLOCATION));        pOa->hAllocation = pInfo->hAllocation;        pInfo->hDeviceSpecificAllocation = pOa;    }    return Status;}


0 0
原创粉丝点击