Changeset 33800 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Timestamp:
- Nov 5, 2010 4:40:26 PM (14 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
r33761 r33800 205 205 return VideoPortSetRegistryParameters(Reg, pName, &Val, sizeof(Val)); 206 206 } 207 208 void VBoxVideoCmnSignalEvent(PVBOXVIDEO_COMMON pCommon, uint64_t pvEvent) 209 { 210 PDEVICE_EXTENSION PrimaryExtension = commonToPrimaryExt(pCommon); 211 #ifndef VBOX_WITH_WDDM 212 PEVENT pEvent = (PEVENT)pvEvent; 213 PrimaryExtension->u.primary.VideoPortProcs.pfnSetEvent(PrimaryExtension, 214 pEvent); 215 #else 216 PKEVENT pEvent = (PKEVENT)pvEvent; 217 KeSetEvent(pEvent, 0, FALSE); 218 #endif 219 } 220 221 222 #define MEM_TAG 'HVBV' 223 224 void *VBoxVideoCmnMemAllocDriver(PVBOXVIDEO_COMMON pCommon, size_t cb) 225 { 226 ULONG Tag = MEM_TAG; 227 #ifndef VBOX_WITH_WDDM 228 PDEVICE_EXTENSION PrimaryExtension = commonToPrimaryExt(pCommon); 229 return PrimaryExtension->u.primary.VideoPortProcs.pfnAllocatePool(PrimaryExtension, (VBOXVP_POOL_TYPE)VpNonPagedPool, cb, Tag); 230 #else 231 return ExAllocatePoolWithTag(NonPagedPool, cb, Tag); 232 #endif 233 } 234 235 236 void VBoxVideoCmnMemFreeDriver(PVBOXVIDEO_COMMON pCommon, void *pv) 237 { 238 #ifndef VBOX_WITH_WDDM 239 PDEVICE_EXTENSION PrimaryExtension = commonToPrimaryExt(pCommon); 240 PrimaryExtension->u.primary.VideoPortProcs.pfnFreePool(PrimaryExtension, 241 pv); 242 #else 243 ExFreePool(pv); 244 #endif 245 } 246 207 247 208 248 static void VBoxSetupVideoPortFunctions(PDEVICE_EXTENSION PrimaryExtension, -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r33761 r33800 372 372 extern "C" 373 373 { 374 /** Signal an event in a guest-OS-specific way. pvEvent will be re-cast to 375 * something OS-specific. */ 376 void VBoxVideoCmnSignalEvent(PVBOXVIDEO_COMMON pCommon, uint64_t pvEvent); 377 378 /** Allocate memory to be used in normal driver operation (dispatch level in 379 * Windows) but not necessarily in IRQ context. */ 380 void *VBoxVideoCmnMemAllocDriver(PVBOXVIDEO_COMMON pCommon, size_t cb); 381 382 /** Free memory allocated by @a VBoxVideoCmnMemAllocDriver */ 383 void VBoxVideoCmnMemFreeDriver(PVBOXVIDEO_COMMON pCommon, void *pv); 384 374 385 #ifndef VBOX_WITH_WDDM 375 386 /* XPDM-WDDM common API */ … … 462 473 } 463 474 464 DECLINLINE(PVOID) VBoxVideoCmnMemAllocNonPaged(IN PDEVICE_EXTENSION pDeviceExtension, IN SIZE_T NumberOfBytes, IN ULONG Tag)465 {466 return pDeviceExtension->u.primary.VideoPortProcs.pfnAllocatePool(pDeviceExtension, (VBOXVP_POOL_TYPE)VpNonPagedPool, NumberOfBytes, Tag);467 }468 469 DECLINLINE(VOID) VBoxVideoCmnMemFree(IN PDEVICE_EXTENSION pDeviceExtension, IN PVOID Ptr)470 {471 pDeviceExtension->u.primary.VideoPortProcs.pfnFreePool(pDeviceExtension, Ptr);472 }473 474 475 DECLINLINE(VP_STATUS) VBoxVideoCmnRegInit(IN PDEVICE_EXTENSION pDeviceExtension, OUT VBOXCMNREG *pReg) 475 476 { … … 576 577 { 577 578 return NO_ERROR; 578 }579 580 DECLINLINE(PVOID) VBoxVideoCmnMemAllocNonPaged(IN PDEVICE_EXTENSION pDeviceExtension, IN SIZE_T NumberOfBytes, IN ULONG Tag)581 {582 return ExAllocatePoolWithTag(NonPagedPool, NumberOfBytes, Tag);583 }584 585 DECLINLINE(VOID) VBoxVideoCmnMemFree(IN PDEVICE_EXTENSION pDeviceExtension, IN PVOID Ptr)586 {587 ExFreePool(Ptr);588 579 } 589 580 … … 839 830 } 840 831 832 841 833 BOOLEAN VBoxHGSMIIsSupported (void); 842 834 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideoHGSMI.cpp
r33761 r33800 30 30 31 31 #include "vboxioctl.h" 32 33 #define MEM_TAG 'HVBV'34 32 35 33 void HGSMINotifyHostCmdComplete (PVBOXVIDEO_COMMON pCommon, HGSMIOFFSET offt) … … 719 717 }VBVA_CHANNELCONTEXTS; 720 718 721 static int vboxVBVADeleteChannelContexts(PDEVICE_EXTENSION PrimaryExtension, VBVA_CHANNELCONTEXTS * pContext) 722 { 723 VBoxVideoCmnMemFree(PrimaryExtension,pContext); 719 static int vboxVBVADeleteChannelContexts(PVBOXVIDEO_COMMON pCommon, 720 VBVA_CHANNELCONTEXTS * pContext) 721 { 722 VBoxVideoCmnMemFreeDriver(pCommon, pContext); 724 723 return VINF_SUCCESS; 725 724 } … … 729 728 uint32_t cDisplays = (uint32_t)commonFromDeviceExt(PrimaryExtension)->cDisplays; 730 729 const size_t size = RT_OFFSETOF(VBVA_CHANNELCONTEXTS, aContexts[cDisplays]); 731 VBVA_CHANNELCONTEXTS * pContext = (VBVA_CHANNELCONTEXTS*)VBoxVideoCmnMemAlloc NonPaged(PrimaryExtension, size, MEM_TAG);730 VBVA_CHANNELCONTEXTS * pContext = (VBVA_CHANNELCONTEXTS*)VBoxVideoCmnMemAllocDriver(commonFromDeviceExt(PrimaryExtension), size); 732 731 if(pContext) 733 732 { … … 802 801 return VERR_INVALID_PARAMETER; 803 802 } 803 804 804 805 805 static DECLCALLBACK(int) vboxVBVAChannelGenericHandler(void *pvHandler, uint16_t u16ChannelInfo, void *pvBuffer, HGSMISIZE cbBuffer) … … 829 829 case VBVAHG_DISPLAY_CUSTOM: 830 830 { 831 #if 0 /* Never taken */ 831 832 if(pLast) 832 833 { … … 835 836 } 836 837 else 838 #endif 837 839 { 838 840 pFirst = pCur; … … 840 842 } 841 843 Assert(!pCur->u.Data); 844 #if 0 /* Who is supposed to set pNext? */ 842 845 //TODO: use offset here 843 846 pCur = pCur->u.pNext; 844 847 Assert(!pCur); 848 #else 849 Assert(!pCur->u.pNext); 850 pCur = NULL; 851 #endif 845 852 Assert(pFirst); 846 853 Assert(pFirst == pLast); … … 850 857 { 851 858 VBVAHOSTCMDEVENT *pEventCmd = VBVAHOSTCMD_BODY(pCur, VBVAHOSTCMDEVENT); 852 #ifndef VBOX_WITH_WDDM 853 PEVENT pEvent = (PEVENT)pEventCmd->pEvent; 854 pCallbacks->PrimaryExtension->u.primary.VideoPortProcs.pfnSetEvent( 855 pCallbacks->PrimaryExtension, 856 pEvent); 857 #else 858 PKEVENT pEvent = (PKEVENT)pEventCmd->pEvent; 859 KeSetEvent(pEvent, 0, FALSE); 860 #endif 859 VBoxVideoCmnSignalEvent(commonFromDeviceExt(pCallbacks->PrimaryExtension), pEventCmd->pEvent); 861 860 } 862 861 default: … … 865 864 Assert(u16ChannelInfo==VBVAHG_EVENT); 866 865 Assert(!pCur->u.Data); 866 #if 0 /* pLast has been asserted to be NULL, and who should set pNext? */ 867 867 //TODO: use offset here 868 868 if(pLast) … … 870 870 VBVAHOSTCMD * pNext = pCur->u.pNext; 871 871 pCur->u.pNext = NULL; 872 #else 873 Assert(!pCur->u.pNext); 874 #endif 872 875 HGSMIHostCmdComplete(commonFromDeviceExt(pCallbacks->PrimaryExtension), pCur); 876 #if 0 /* pNext is NULL, and the other things have already been asserted */ 873 877 pCur = pNext; 874 878 Assert(!pCur); 875 879 Assert(!pFirst); 876 880 Assert(pFirst == pLast); 881 #else 882 pCur = NULL; 883 #endif 877 884 break; 878 885 } … … 1005 1012 if(!pChannel) 1006 1013 { 1007 vboxVBVADeleteChannelContexts( PrimaryExtension, pContexts);1014 vboxVBVADeleteChannelContexts(commonFromDeviceExt(PrimaryExtension), pContexts); 1008 1015 } 1009 1016
Note:
See TracChangeset
for help on using the changeset viewer.