Changeset 49244 in vbox for trunk/src/VBox/Additions/WINNT
- Timestamp:
- Oct 22, 2013 8:08:34 PM (11 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/common/wddm/VBoxMPIf.h
r48070 r49244 478 478 uint64_t hAlloc; 479 479 } VBOXDISPIFESCAPE_SHRC_REF, *PVBOXDISPIFESCAPE_SHRC_REF; 480 481 typedef struct VBOXDISPIFESCAPE_SETALLOCHOSTID 482 { 483 VBOXDISPIFESCAPE EscapeHdr; 484 int32_t rc; 485 uint32_t hostID; 486 uint64_t hAlloc; 487 488 } VBOXDISPIFESCAPE_SETALLOCHOSTID, *PVBOXDISPIFESCAPE_SETALLOCHOSTID; 480 489 481 490 typedef struct VBOXDISPIFESCAPE_CRHGSMICTLCON_CALL -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxD3DIf.cpp
r46966 r49244 868 868 } 869 869 870 int vboxD3DIfSetHostId(PVBOXWDDMDISP_ALLOCATION pAlloc, uint32_t hostID, uint32_t *pHostID) 871 { 872 struct VBOXWDDMDISP_RESOURCE *pRc = pAlloc->pRc; 873 PVBOXWDDMDISP_DEVICE pDevice = pRc->pDevice; 874 875 VBOXDISPIFESCAPE_SETALLOCHOSTID SetHostID = {0}; 876 SetHostID.EscapeHdr.escapeCode = VBOXESC_SETALLOCHOSTID; 877 SetHostID.hostID = hostID; 878 SetHostID.hAlloc = pAlloc->hAllocation; 879 880 D3DDDICB_ESCAPE DdiEscape = {0}; 881 DdiEscape.hContext = pDevice->DefaultContext.ContextInfo.hContext; 882 DdiEscape.hDevice = pDevice->hDevice; 883 // DdiEscape.Flags.Value = 0; 884 DdiEscape.pPrivateDriverData = &SetHostID; 885 DdiEscape.PrivateDriverDataSize = sizeof (SetHostID); 886 HRESULT hr = pDevice->RtCallbacks.pfnEscapeCb(pDevice->pAdapter->hAdapter, &DdiEscape); 887 if (SUCCEEDED(hr)) 888 { 889 if (pHostID) 890 *pHostID = SetHostID.EscapeHdr.u32CmdSpecific; 891 892 return SetHostID.rc; 893 } 894 else 895 WARN(("pfnEscapeCb VBOXESC_SETALLOCHOSTID failed hr 0x%x", hr)); 896 897 return VERR_GENERAL_FAILURE; 898 } 899 900 IUnknown* vboxD3DIfCreateSharedPrimary(PVBOXWDDMDISP_ALLOCATION pAlloc) 901 { 902 IDirect3DSurface9 *pSurfIf; 903 struct VBOXWDDMDISP_RESOURCE *pRc = pAlloc->pRc; 904 PVBOXWDDMDISP_DEVICE pDevice = pRc->pDevice; 905 906 HRESULT hr = VBoxD3DIfCreateForRc(pRc); 907 if (!SUCCEEDED(hr)) 908 { 909 WARN(("VBoxD3DIfCreateForRc failed, hr 0x%x", hr)); 910 return NULL; 911 } 912 913 Assert(pAlloc->pD3DIf); 914 Assert(pAlloc->enmD3DIfType == VBOXDISP_D3DIFTYPE_SURFACE); 915 Assert(pAlloc->pRc->RcDesc.fFlags.SharedResource); 916 917 hr = VBoxD3DIfSurfGet(pRc, pAlloc->iAlloc, &pSurfIf); 918 if (!SUCCEEDED(hr)) 919 { 920 WARN(("VBoxD3DIfSurfGet failed hr %#x", hr)); 921 return NULL; 922 } 923 924 uint32_t hostID, usedHostId; 925 hr = pDevice->pAdapter->D3D.D3D.pfnVBoxWineExD3DSurf9GetHostId(pSurfIf, &hostID); 926 if (SUCCEEDED(hr)) 927 { 928 Assert(hostID); 929 int rc = vboxD3DIfSetHostId(pAlloc, hostID, &usedHostId); 930 if (!RT_SUCCESS(rc)) 931 { 932 if (rc == VERR_NOT_EQUAL) 933 { 934 WARN(("another hostId % is in use, using it instead", usedHostId)); 935 Assert(hostID != usedHostId); 936 Assert(usedHostId); 937 pSurfIf->Release(); 938 pSurfIf = NULL; 939 for (UINT i = 0; i < pRc->cAllocations; ++i) 940 { 941 PVBOXWDDMDISP_ALLOCATION pCurAlloc = &pRc->aAllocations[i]; 942 if (pCurAlloc->pD3DIf) 943 { 944 pCurAlloc->pD3DIf->Release(); 945 pCurAlloc->pD3DIf = NULL; 946 } 947 } 948 949 pAlloc->hSharedHandle = (HANDLE)usedHostId; 950 951 hr = VBoxD3DIfCreateForRc(pRc); 952 if (!SUCCEEDED(hr)) 953 { 954 WARN(("VBoxD3DIfCreateForRc failed, hr 0x%x", hr)); 955 return NULL; 956 } 957 958 hr = VBoxD3DIfSurfGet(pRc, pAlloc->iAlloc, &pSurfIf); 959 if (!SUCCEEDED(hr)) 960 { 961 WARN(("VBoxD3DIfSurfGet failed hr %#x", hr)); 962 return NULL; 963 } 964 } 965 else 966 { 967 WARN(("vboxD3DIfSetHostId failed %#x, ignoring", hr)); 968 hr = S_OK; 969 hostID = 0; 970 usedHostId = 0; 971 } 972 } 973 else 974 { 975 Assert(hostID == usedHostId); 976 } 977 978 pSurfIf->Release(); 979 pSurfIf = NULL; 980 } 981 else 982 WARN(("pfnVBoxWineExD3DSurf9GetHostId failed, hr 0x%x", hr)); 983 984 return pAlloc->pD3DIf; 985 } -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxD3DIf.h
r43360 r49244 41 41 void VBoxD3DIfLockUnlockMemSynch(struct VBOXWDDMDISP_ALLOCATION *pAlloc, D3DLOCKED_RECT *pLockInfo, RECT *pRect, bool bToLockInfo); 42 42 43 IUnknown* vboxD3DIfCreateSharedPrimary(PVBOXWDDMDISP_ALLOCATION pAlloc); 44 45 43 46 /* NOTE: does NOT increment a ref counter! NO Release needed!! */ 44 DECLINLINE(IUnknown*) VBoxD3DIfGet(PVBOXWDDMDISP_ALLOCATION pAlloc)47 DECLINLINE(IUnknown*) vboxD3DIfGet(PVBOXWDDMDISP_ALLOCATION pAlloc) 45 48 { 46 49 if (pAlloc->pD3DIf) … … 53 56 } 54 57 55 HRESULT hr = VBoxD3DIfCreateForRc(pAlloc->pRc); 56 if (!SUCCEEDED(hr)) 57 { 58 WARN(("VBoxD3DIfCreateForRc failed, hr 0x%x", hr)); 59 return NULL; 60 } 61 62 Assert(pAlloc->pD3DIf); 63 Assert(pAlloc->enmD3DIfType == VBOXDISP_D3DIFTYPE_SURFACE); 64 65 return pAlloc->pD3DIf; 58 return vboxD3DIfCreateSharedPrimary(pAlloc); 66 59 } 67 60 … … 73 66 Assert(pRc->cAllocations > iAlloc); 74 67 *ppSurf = NULL; 75 IUnknown* pD3DIf = VBoxD3DIfGet(&pRc->aAllocations[iAlloc]);68 IUnknown* pD3DIf = vboxD3DIfGet(&pRc->aAllocations[iAlloc]); 76 69 77 70 switch (pRc->aAllocations[0].enmD3DIfType) -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp
r49220 r49244 5748 5748 pRc->RcDesc.MultisampleQuality = 0; 5749 5749 pRc->RcDesc.MipLevels = 0; 5750 pRc->RcDesc.Fvf; 5750 /*pRc->RcDesc.Fvf;*/ 5751 pRc->RcDesc.fFlags.SharedResource = 1; 5751 5752 5752 5753 if (pData->NumAllocations != 1) -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPCr.h
r47070 r49244 236 236 237 237 #define VBOXMP_CRCMD_HEADER_SIZE sizeof (CRMessageOpcodes) 238 /* last +4 below is 4-aligned com and opcode size (i.e. ((1 + 3) & ~3)) */238 /* last +4 below is 4-aligned command opcode size (i.e. ((1 + 3) & ~3)) */ 239 239 #define VBOXMP_CRCMD_SIZE_WINDOWPOSITION (20 + 4) 240 240 #define VBOXMP_CRCMD_SIZE_WINDOWVISIBLEREGIONS(_cRects) (16 + (_cRects) * 4 * sizeof (GLint) + 4) … … 243 243 #define VBOXMP_CRCMD_SIZE_WINDOWSIZE (20 + 4) 244 244 #define VBOXMP_CRCMD_SIZE_GETCHROMIUMPARAMETERVCR (36 + 4) 245 #define VBOXMP_CRCMD_SIZE_CHROMIUMPARAMETERICR (16 + 4) 246 #define VBOXMP_CRCMD_SIZE_WINDOWCREATE (256 + 28 + 4) 247 #define VBOXMP_CRCMD_SIZE_WINDOWDESTROY (12 + 4) 248 #define VBOXMP_CRCMD_SIZE_CREATECONTEXT (256 + 32 + 4) 249 #define VBOXMP_CRCMD_SIZE_DESTROYCONTEXT (12 + 4) 245 250 246 251 #endif /* #ifndef ___VBoxMPCr_h__ */ -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPTypes.h
r48070 r49244 108 108 VBOXWDDM_ADDR Addr; 109 109 uint32_t hostID; 110 uint32_t cHostIDRefs; 110 111 struct VBOXWDDM_SWAPCHAIN *pSwapchain; 111 112 } VBOXWDDM_ALLOC_DATA, *PVBOXWDDM_ALLOC_DATA; … … 320 321 uint32_t cShRcRefs; 321 322 uint32_t cOpens; 323 uint32_t cHostIDRefs; 322 324 } VBOXWDDM_OPENALLOCATION, *PVBOXWDDM_OPENALLOCATION; 323 325 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.cpp
r47566 r49244 897 897 } 898 898 899 typedef struct VBOXMP_CRHGSMIMGR 900 { 901 VBOXMP_CRPACKER CrPacker; 902 void *pvCommandBuffer; 903 } VBOXMP_CRHGSMIMGR; 904 905 DECLINLINE(CRPackContext*) vboxVdmaCrHmGetPackContext(VBOXMP_CRHGSMIMGR *pMgr) 906 { 907 return &pMgr->CrPacker.CrPacker; 908 } 909 910 NTSTATUS vboxVdmaCrHmCreate(PVBOXMP_DEVEXT pDevExt, VBOXMP_CRHGSMIMGR *pMgr, uint32_t cbCommandBuffer, uint32_t cCommands) 911 { 912 pMgr->pvCommandBuffer = VBoxMpCrShgsmiTransportBufAlloc(&pDevExt->CrHgsmiTransport, cbCommandBuffer); 913 if (!pMgr->pvCommandBuffer) 914 { 915 WARN(("VBoxMpCrShgsmiTransportBufAlloc failed!")); 916 return VERR_OUT_OF_RESOURCES; 917 } 918 919 VBoxMpCrPackerInit(&pMgr->CrPacker); 920 921 VBoxMpCrPackerTxBufferInit(&pMgr->CrPacker, pMgr->pvCommandBuffer, cbCommandBuffer, cCommands); 922 923 return STATUS_SUCCESS; 924 } 925 926 NTSTATUS vboxVdmaCrHmSubmitWrSync(PVBOXMP_DEVEXT pDevExt, VBOXMP_CRHGSMIMGR *pMgr, uint32_t u32CrConClientID) 927 { 928 NTSTATUS Status = vboxVdmaCrRxGenericSync(pDevExt, &pMgr->CrPacker, u32CrConClientID); 929 if (!NT_SUCCESS(Status)) 930 { 931 WARN(("vboxVdmaCrRxGenericSync failed Status 0x%x", Status)); 932 VBoxMpCrShgsmiTransportBufFree(&pDevExt->CrHgsmiTransport, pMgr->pvCommandBuffer); 933 return Status; 934 } 935 936 return STATUS_SUCCESS; 937 } 899 938 #if 0 900 939 NTSTATUS vboxVdmaCrCmdGetChromiumParametervCR(PVBOXMP_DEVEXT pDevExt, uint32_t u32CrConClientID, GLenum target, GLuint index, GLenum type, GLsizei count, GLvoid * values) … … 902 941 uint32_t cbCommandBuffer = VBOXMP_CRCMD_HEADER_SIZE + VBOXMP_CRCMD_SIZE_GETCHROMIUMPARAMETERVCR; 903 942 uint32_t cCommands = 1; 904 void *pvCommandBuffer = VBoxMpCrShgsmiTransportBufAlloc(&pDevExt->CrHgsmiTransport, cbCommandBuffer); 905 if (!pvCommandBuffer) 906 { 907 WARN(("VBoxMpCrShgsmiTransportBufAlloc failed!")); 908 return VERR_OUT_OF_RESOURCES; 909 } 910 911 VBOXMP_CRPACKER CrPacker; 912 VBoxMpCrPackerInit(&CrPacker); 913 914 VBoxMpCrPackerTxBufferInit(&CrPacker, pvCommandBuffer, cbCommandBuffer, cCommands); 943 944 VBOXMP_CRHGSMIMGR Mgr; 945 NTSTATUS Status = vboxVdmaCrHmCreate(pDevExt, &Mgr, cbCommandBuffer, cCommands); 946 if (!NT_SUCCESS(Status)) 947 { 948 WARN(("vboxVdmaCrHmCreate failed Status 0x%x", Status)); 949 return Status; 950 } 915 951 916 952 int dummy = 1; 917 953 918 crPackGetChromiumParametervCR(&CrPacker.CrPacker, target, index, type, count, values, &dummy); 919 920 921 NTSTATUS Status = vboxVdmaCrRxGenericSync(pDevExt, &CrPacker, u32CrConClientID); 954 crPackGetChromiumParametervCR(vboxVdmaCrHmGetPackContext(&Mgr), target, index, type, count, values, &dummy); 955 956 Status = vboxVdmaCrHmSubmitWrSync(pDevExt, &Mgr, u32CrConClientID); 922 957 if (!NT_SUCCESS(Status)) 923 958 { 924 WARN(("vboxVdmaCrRxGenericSync failed Status 0x%x", Status)); 925 VBoxMpCrShgsmiTransportBufFree(&pDevExt->CrHgsmiTransport, pvCommandBuffer); 959 WARN(("vboxVdmaCrHmSubmitWrSync failed Status 0x%x", Status)); 926 960 return Status; 927 961 } 928 962 929 963 return STATUS_SUCCESS; 964 } 965 966 static NTSTATUS vboxVdmaCrCmdCreateContext(PVBOXMP_DEVEXT pDevExt, int32_t visualBits, int32_t *pi32CtxID) 967 { 968 uint32_t cbCommandBuffer = VBOXMP_CRCMD_HEADER_SIZE + VBOXMP_CRCMD_SIZE_CREATECONTEXT; 969 uint32_t cCommands = 1; 970 971 VBOXMP_CRHGSMIMGR Mgr; 972 NTSTATUS Status = vboxVdmaCrHmCreate(pDevExt, &Mgr, cbCommandBuffer, cCommands); 973 if (!NT_SUCCESS(Status)) 974 { 975 WARN(("vboxVdmaCrHmCreate failed Status 0x%x", Status)); 976 return Status; 977 } 978 979 int dummy = 1; 980 981 crPackCreateContext(&CrPacker.CrPacker, "", visualBits, 0, &pi32CtxID, &dummy); 982 983 Status = vboxVdmaCrHmSubmitWrSync(pDevExt, &Mgr, u32CrConClientID); 984 if (!NT_SUCCESS(Status)) 985 { 986 WARN(("vboxVdmaCrHmSubmitWrSync failed Status 0x%x", Status)); 987 return Status; 988 } 989 990 return STATUS_SUCCESS; 991 } 992 993 static NTSTATUS vboxVdmaCrCmdWindowCreate(PVBOXMP_DEVEXT pDevExt, int32_t visualBits, int32_t *pi32WinID) 994 { 995 uint32_t cbCommandBuffer = VBOXMP_CRCMD_HEADER_SIZE + VBOXMP_CRCMD_SIZE_WINDOWCREATE; 996 uint32_t cCommands = 1; 997 998 VBOXMP_CRHGSMIMGR Mgr; 999 NTSTATUS Status = vboxVdmaCrHmCreate(pDevExt, &Mgr, cbCommandBuffer, cCommands); 1000 if (!NT_SUCCESS(Status)) 1001 { 1002 WARN(("vboxVdmaCrHmCreate failed Status 0x%x", Status)); 1003 return Status; 1004 } 1005 1006 int dummy = 1; 1007 1008 crPackWindowCreate(&CrPacker.CrPacker, "", visualBits, 0, &pi32CtxID, &dummy); 1009 1010 Status = vboxVdmaCrHmSubmitWrSync(pDevExt, &Mgr, u32CrConClientID); 1011 if (!NT_SUCCESS(Status)) 1012 { 1013 WARN(("vboxVdmaCrHmSubmitWrSync failed Status 0x%x", Status)); 1014 return Status; 1015 } 1016 1017 return STATUS_SUCCESS; 1018 } 1019 1020 static NTSTATUS vboxVdmaCrCtlGetDefaultCtxId(PVBOXMP_DEVEXT pDevExt, int32_t *pi32CtxID) 1021 { 1022 if (!pDevExt->i32CrConDefaultCtxID) 1023 { 1024 if (!pDevExt->f3DEnabled) 1025 { 1026 WARN(("3D disabled, should not be here!")); 1027 return STATUS_UNSUCCESSFUL; 1028 } 1029 1030 uint32_t u32ClienID; 1031 NTSTATUS Status = vboxVdmaCrCtlGetDefaultClientId(pDevExt, &u32ClienID); 1032 if (!NT_SUCCESS(Status)) 1033 { 1034 WARN(("vboxVdmaCrCtlGetDefaultClientId failed, Status %#x", Status)); 1035 return Status; 1036 } 1037 1038 Status = vboxVdmaCrCmdWindowCreate(PVBOXMP_DEVEXT pDevExt, int32_t visualBits, int32_t *pi32WinID) 1039 1040 VBOXMP_CRPACKER CrPacker; 1041 VBoxMpCrPackerInit(&CrPacker); 1042 1043 int rc = VBoxMpCrCtlConConnect(&pDevExt->CrCtlCon, CR_PROTOCOL_VERSION_MAJOR, CR_PROTOCOL_VERSION_MINOR, &pDevExt->u32CrConDefaultClientID); 1044 if (!RT_SUCCESS(rc)) 1045 { 1046 WARN(("VBoxMpCrCtlConConnect failed, rc %d", rc)); 1047 return STATUS_UNSUCCESSFUL; 1048 } 1049 } 1050 1051 *pi32CtxID = pDevExt->i32CrConDefaultCtxID; 930 1052 return STATUS_SUCCESS; 931 1053 } -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r49171 r49244 57 57 } 58 58 59 DECLINLINE(void) VBoxWddmOaHostIDReleaseLocked(PVBOXWDDM_OPENALLOCATION pOa) 60 { 61 Assert(pOa->cHostIDRefs); 62 PVBOXWDDM_ALLOCATION pAllocation = pOa->pAllocation; 63 Assert(pAllocation->AllocData.cHostIDRefs >= pOa->cHostIDRefs); 64 Assert(pAllocation->AllocData.hostID); 65 --pOa->cHostIDRefs; 66 --pAllocation->AllocData.cHostIDRefs; 67 if (!pAllocation->AllocData.cHostIDRefs) 68 pAllocation->AllocData.hostID = 0; 69 } 70 71 DECLINLINE(void) VBoxWddmOaHostIDCheckReleaseLocked(PVBOXWDDM_OPENALLOCATION pOa) 72 { 73 if (pOa->cHostIDRefs) 74 VBoxWddmOaHostIDReleaseLocked(pOa); 75 } 76 59 77 DECLINLINE(void) VBoxWddmOaRelease(PVBOXWDDM_OPENALLOCATION pOa) 60 78 { … … 63 81 KeAcquireSpinLock(&pAllocation->OpenLock, &OldIrql); 64 82 Assert(pAllocation->cOpens); 83 VBoxWddmOaHostIDCheckReleaseLocked(pOa); 65 84 --pAllocation->cOpens; 66 85 uint32_t cOpens = --pOa->cOpens; … … 97 116 KeReleaseSpinLock(&pAllocation->OpenLock, OldIrql); 98 117 return pOa; 118 } 119 120 DECLINLINE(int) VBoxWddmOaSetHostID(PVBOXWDDM_DEVICE pDevice, PVBOXWDDM_ALLOCATION pAllocation, uint32_t hostID, uint32_t *pHostID) 121 { 122 PVBOXWDDM_OPENALLOCATION pOa; 123 KIRQL OldIrql; 124 int rc = VINF_SUCCESS; 125 KeAcquireSpinLock(&pAllocation->OpenLock, &OldIrql); 126 pOa = VBoxWddmOaSearchLocked(pDevice, pAllocation); 127 if (!pOa) 128 { 129 KeReleaseSpinLock(&pAllocation->OpenLock, OldIrql);; 130 WARN(("no open allocation!")); 131 return VERR_INVALID_STATE; 132 } 133 134 if (hostID) 135 { 136 if (pAllocation->AllocData.hostID == 0) 137 { 138 pAllocation->AllocData.hostID = hostID; 139 } 140 else if (pAllocation->AllocData.hostID != hostID) 141 { 142 WARN(("hostID differ: alloc(%d), trying to assign(%d)", pAllocation->AllocData.hostID, hostID)); 143 hostID = pAllocation->AllocData.hostID; 144 rc = VERR_NOT_EQUAL; 145 } 146 147 ++pAllocation->AllocData.cHostIDRefs; 148 ++pOa->cHostIDRefs; 149 } 150 else 151 VBoxWddmOaHostIDCheckReleaseLocked(pOa); 152 153 KeReleaseSpinLock(&pAllocation->OpenLock, OldIrql); 154 155 if (pHostID) 156 *pHostID = hostID; 157 158 return rc; 99 159 } 100 160 … … 4041 4101 break; 4042 4102 } 4103 case VBOXESC_SETALLOCHOSTID: 4104 { 4105 PVBOXWDDM_DEVICE pDevice = (PVBOXWDDM_DEVICE)pEscape->hDevice; 4106 if (!pDevice) 4107 { 4108 WARN(("VBOXESC_SETALLOCHOSTID called without no device specified, failing")); 4109 Status = STATUS_INVALID_PARAMETER; 4110 break; 4111 } 4112 4113 if (pEscape->PrivateDriverDataSize != sizeof (VBOXDISPIFESCAPE_SETALLOCHOSTID)) 4114 { 4115 WARN(("invalid buffer size for VBOXDISPIFESCAPE_SHRC_REF, was(%d), but expected (%d)", 4116 pEscape->PrivateDriverDataSize, sizeof (VBOXDISPIFESCAPE_SHRC_REF))); 4117 Status = STATUS_INVALID_PARAMETER; 4118 break; 4119 } 4120 4121 PVBOXDISPIFESCAPE_SETALLOCHOSTID pSetHostID = (PVBOXDISPIFESCAPE_SETALLOCHOSTID)pEscapeHdr; 4122 PVBOXWDDM_ALLOCATION pAlloc = vboxWddmGetAllocationFromHandle(pDevExt, (D3DKMT_HANDLE)pSetHostID->hAlloc); 4123 if (!pAlloc) 4124 { 4125 WARN(("failed to get allocation from handle")); 4126 Status = STATUS_INVALID_PARAMETER; 4127 break; 4128 } 4129 4130 if (pAlloc->enmType != VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE) 4131 { 4132 WARN(("setHostID: invalid allocation type: %d", pAlloc->enmType)); 4133 Status = STATUS_INVALID_PARAMETER; 4134 break; 4135 } 4136 4137 pSetHostID->rc = VBoxWddmOaSetHostID(pDevice, pAlloc, pSetHostID->hostID, &pSetHostID->EscapeHdr.u32CmdSpecific); 4138 Status = STATUS_SUCCESS; 4139 break; 4140 } 4043 4141 case VBOXESC_SHRC_ADDREF: 4044 4142 case VBOXESC_SHRC_RELEASE: 4045 4143 { 4046 4144 PVBOXWDDM_DEVICE pDevice = (PVBOXWDDM_DEVICE)pEscape->hDevice; 4145 if (!pDevice) 4146 { 4147 WARN(("VBOXESC_SHRC_ADDREF|VBOXESC_SHRC_RELEASE called without no device specified, failing")); 4148 Status = STATUS_INVALID_PARAMETER; 4149 break; 4150 } 4151 4047 4152 /* query whether the allocation represanted by the given [wine-generated] shared resource handle still exists */ 4048 4153 if (pEscape->PrivateDriverDataSize != sizeof (VBOXDISPIFESCAPE_SHRC_REF)) … … 5002 5107 if (pOpenAllocation->PrivateDriverSize) 5003 5108 { 5004 Assert(pOpenAllocation->PrivateDriverSize == sizeof (VBOXWDDM_RCINFO));5005 5109 Assert(pOpenAllocation->pPrivateDriverData); 5006 if (pOpenAllocation->PrivateDriverSize >= sizeof (VBOXWDDM_RCINFO))5110 if (pOpenAllocation->PrivateDriverSize == sizeof (VBOXWDDM_RCINFO)) 5007 5111 { 5008 5112 pRcInfo = (PVBOXWDDM_RCINFO)pOpenAllocation->pPrivateDriverData; … … 5010 5114 } 5011 5115 else 5116 { 5117 WARN(("Invalid PrivateDriverSize %d", pOpenAllocation->PrivateDriverSize)); 5012 5118 Status = STATUS_INVALID_PARAMETER; 5119 } 5013 5120 } 5014 5121 -
trunk/src/VBox/Additions/WINNT/include/VBoxDisplay.h
r48070 r49244 39 39 # define VBOXESC_SETCTXHOSTID 0xABCD9012 40 40 # define VBOXESC_CONFIGURETARGETS 0xABCD9013 41 # define VBOXESC_SETALLOCHOSTID 0xABCD9014 41 42 #endif /* #ifdef VBOX_WITH_WDDM */ 42 43
Note:
See TracChangeset
for help on using the changeset viewer.