Changeset 9501 in vbox
- Timestamp:
- Jun 8, 2008 1:15:34 AM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 31772
- Location:
- trunk/src/VBox/Additions/WINNT/VBoxGuest
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxGuest/Makefile.kmk
r8760 r9501 28 28 # 29 29 SYSMODS += VBoxGuest 30 ifdef VBOX_WITH_64BIT_ADDITIONS 31 VBoxGuest_TEMPLATE = VBOXGUESTR0 32 else 30 33 VBoxGuest_TEMPLATE = VBOXW32GUESTR0 34 VBoxGuest_SDKS = W2K3DDKX86 WINPSDKINCS 35 endif 31 36 ifdef VBOX_SIGN_ADDITIONS 32 37 VBoxGuest_NOINST = true 33 38 endif 34 VBoxGuest_SDKS = W2K3DDKX86 WINPSDKINCS35 39 VBoxGuest_DEFS = LOG_TO_BACKDOOR VBGL_VBOXGUEST VBOX_HGCM VBOX_REBOOT_ON_UNINSTALL 36 40 #VBoxGuest_DEFS += LOG_ENABLED 37 41 VBoxGuest_INCS = ../include 42 ifdef VBOX_WITH_64BIT_ADDITIONS 43 VBoxGuest_LDFLAGS.x86 = -Entry:DriverEntry@8 44 VBoxGuest_LDFLAGS.amd64 = -Entry:DriverEntry 45 else 38 46 VBoxGuest_LDFLAGS = -Entry:DriverEntry@8 47 endif 39 48 VBoxGuest_SOURCES = \ 40 49 VBoxGuest.cpp \ … … 42 51 Helper.cpp \ 43 52 VBoxGuest.rc 53 ifdef VBOX_WITH_64BIT_ADDITIONS 54 VBoxGuest_LIBS = \ 55 $(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \ 56 $(PATH_SDK_W2K3DDK_LIB)/hal.lib \ 57 $(PATH_SDK_W2K3DDK_LIB)/win32k.lib \ 58 $(VBOX_LIB_VBGL_R0BASE) \ 59 $(VBOX_LIB_IPRT_GUEST_R0) 60 else 44 61 VBoxGuest_LIBS = \ 45 62 $(PATH_SDK_W2K3DDKX86_LIB)/int64.lib \ 46 63 $(PATH_SDK_W2K3DDKX86_LIB)/win32k.lib \ 47 64 $(PATH_SDK_W2K3DDKX86_LIB)/ntoskrnl.lib \ 48 $(PATH_SDK_W2K3DDKX86_LIB)/hal.lib \65 $(PATH_SDK_W2K3DDKX86_LIB)/hal.lib 49 66 $(PATH_LIB)/additions/VBoxGuestLibBase$(VBOXW32GUEST_SUFF_LIB) \ 50 67 $(PATH_LIB)/additions/RuntimeW32GuestR0$(VBOXW32GUEST_SUFF_LIB) 68 endif 51 69 52 70 53 71 # 54 # VBoxGuestNT - NT version of the driver .72 # VBoxGuestNT - NT version of the driver (x86 only). 55 73 # 74 ifdef VBOX_WITH_64BIT_ADDITIONS 75 SYSMODS.x86 += VBoxGuestNT 76 VBoxGuestNT_TEMPLATE = VBOXGUESTR0 77 else 56 78 SYSMODS += VBoxGuestNT 57 79 VBoxGuestNT_TEMPLATE = VBOXW32GUESTR0 58 80 VBoxGuestNT_SDKS = W2K3DDKX86 WINPSDKINCS 81 endif 59 82 VBoxGuestNT_DEFS = $(VBoxGuest_DEFS) TARGET_NT4 60 83 VBoxGuestNT_INCS = $(VBoxGuest_INCS) … … 65 88 NTLegacy.cpp \ 66 89 VBoxGuest.rc 90 ifdef VBOX_WITH_64BIT_ADDITIONS 91 VBoxGuestNT_LIBS = \ 92 $(PATH_SDK_W2K3DDKX86_LIB)/exsup.lib \ 93 $(PATH_SDK_W2K3DDKX86_LIB)/int64.lib \ 94 $(PATH_SDK_W2K3DDKX86_LIB)/ntoskrnl.lib \ 95 $(PATH_SDK_W2K3DDKX86_LIB)/hal.lib \ 96 $(VBOX_LIB_VBGL_R0BASE) \ 97 $(VBOX_LIB_IPRT_GUEST_R0_NT4) 98 else 67 99 VBoxGuestNT_LIBS = \ 68 100 $(PATH_SDK_W2K3DDKX86_LIB)/exsup.lib \ … … 72 104 $(PATH_LIB)/additions/VBoxGuestLibBase$(VBOXW32GUEST_SUFF_LIB) \ 73 105 $(PATH_LIB)/additions/RuntimeW32NT4GuestR0$(VBOXW32GUEST_SUFF_LIB) 74 # $(PATH_SDK_W2K3DDKX86_LIB)/win32k.lib - not needed? 75 106 endif 76 107 77 108 # … … 79 110 # 80 111 #PROGRAMS += VBoxGuestInst 81 VBoxGuestInst_TEMPLATE= VBOX W32GUESTR3112 VBoxGuestInst_TEMPLATE= VBOXGUESTR3EXE 82 113 VBoxGuestInst_SOURCES = VBoxGuestInst.cpp 83 114 -
trunk/src/VBox/Additions/WINNT/VBoxGuest/VBoxGuest.cpp
r8781 r9501 40 40 41 41 #ifdef TARGET_NT4 42 /* XP DDK #defines ExFreePool to ExFreePoolWithTag. The latter does not exist on NT4, so... 42 /* XP DDK #defines ExFreePool to ExFreePoolWithTag. The latter does not exist on NT4, so... 43 43 * The same for ExAllocatePool. 44 44 */ … … 345 345 346 346 dprintf(("VBoxHGCMCallback\n")); 347 348 /* Possible problem with request completion right between the fu32Flags check and KeWaitForSingleObject 347 348 /* Possible problem with request completion right between the fu32Flags check and KeWaitForSingleObject 349 349 * call; introduce a timeout to make sure we don't wait indefinitely. 350 350 */ … … 357 357 * calling process is being killed. 358 358 * When alertable is TRUE, the wait sometimes ends with STATUS_USER_APC. 359 */ 359 */ 360 360 NTSTATUS rc = KeWaitForSingleObject (&pDevExt->keventNotification, Executive, 361 361 UserMode, … … 400 400 #endif /* VBOX_HGCM */ 401 401 402 static bool403 __declspec (naked) __fastcall404 TestAndClearEvent (PVBOXGUESTDEVEXT pDevExt, int iBitOffset)405 {406 _asm {407 lock btr PVBOXGUESTDEVEXT[ecx].u32Events, edx;408 setc al;409 movzx eax, al;410 ret;411 }412 }413 414 402 static bool IsPowerOfTwo (uint32_t val) 415 403 { 416 404 return (val & (val - 1)) == 0; 417 }418 419 static int __declspec (naked) __fastcall GetMsb32 (uint32_t val)420 {421 _asm {422 bsf eax, ecx;423 ret;424 }425 405 } 426 406 … … 521 501 /* Calls to MmProbeAndLockPages must be enclosed in a try/except block. */ 522 502 MmProbeAndLockPages (pMdl, KernelMode, IoModifyAccess); 523 } 524 __except(EXCEPTION_EXECUTE_HANDLER) 503 } 504 __except(EXCEPTION_EXECUTE_HANDLER) 525 505 { 526 506 dprintf(("MmProbeAndLockPages failed!\n")); … … 775 755 776 756 eventInfo->u32EventFlagsOut = 0; 777 int iBitOffset = GetMsb32 (eventInfo->u32EventMaskIn);757 int iBitOffset = ASMBitFirstSetU32 (eventInfo->u32EventMaskIn) - 1; 778 758 bool fTimeout = (eventInfo->u32TimeoutIn != ~0L); 779 759 780 760 dprintf (("mask = %d, iBitOffset = %d\n", iBitOffset, eventInfo->u32EventMaskIn)); 781 761 782 /* Possible problem with request completion right between the pending event check and KeWaitForSingleObject 762 /* Possible problem with request completion right between the pending event check and KeWaitForSingleObject 783 763 * call; introduce a timeout (if none was specified) to make sure we don't wait indefinitely. 784 764 */ … … 791 771 for (;;) 792 772 { 793 bool fEventPending = TestAndClearEvent (pDevExt, iBitOffset);773 bool fEventPending = ASMAtomicBitTestAndClear(&pDevExt->u32Events, iBitOffset); 794 774 if (fEventPending) 795 775 { … … 998 978 Status = vboxHGCMVerifyIOBuffers (pStack, 999 979 sizeof (VBoxGuestHGCMCallInfo)); 1000 980 1001 981 if (Status != STATUS_SUCCESS) 1002 982 {
Note:
See TracChangeset
for help on using the changeset viewer.