Changeset 2016 in vbox for trunk/src/VBox/Additions/common
- Timestamp:
- Apr 10, 2007 4:22:01 PM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 20304
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/SysHlp.cpp
r1083 r2016 89 89 IO_STATUS_BLOCK ioStatusBlock; 90 90 91 KEVENT event; 92 KeInitializeEvent (&event, NotificationEvent, FALSE); 91 KEVENT *pEvent; 92 #ifdef KEVENT_STACK_ALLOC 93 KEVENT eventAlloc; 94 pEvent = &eventAlloc; 95 #else 96 pEvent = (KEVENT *)ExAllocatePool (NonPagedPool, sizeof (KEVENT)); 97 if (!pEvent) return VERR_NO_MEMORY; 98 #endif /* KEVENT_STACK_ALLOC */ 99 KeInitializeEvent (pEvent, NotificationEvent, FALSE); 93 100 94 101 PIRP irp = IoBuildDeviceIoControlRequest (u32Function, … … 99 106 cbData, 100 107 FALSE, 101 &event,108 pEvent, 102 109 &ioStatusBlock); 103 110 if (irp == NULL) 104 111 { 105 112 Log(("vbglDriverIOCtl: IoBuildDeviceIoControlRequest failed\n")); 113 #ifndef KEVENT_STACK_ALLOC 114 ExFreePool (pEvent); 115 #endif /* KEVENT_STACK_ALLOC */ 106 116 return VERR_NO_MEMORY; 107 117 } … … 109 119 NTSTATUS rc = IoCallDriver (pDriver->pDeviceObject, irp); 110 120 121 if (rc == STATUS_PENDING) 122 { 123 Log(("vbglDriverIOCtl: STATUS_PENDING\n")); 124 rc = KeWaitForSingleObject(pEvent, 125 Executive, 126 KernelMode, 127 FALSE, 128 NULL); 129 130 rc = ioStatusBlock.Status; 131 } 132 111 133 if (!NT_SUCCESS(rc)) 112 134 Log(("vbglDriverIOCtl: IoCallDriver failed with ntstatus=%x\n", rc)); 135 136 #ifndef KEVENT_STACK_ALLOC 137 ExFreePool (pEvent); 138 #endif /* KEVENT_STACK_ALLOC */ 113 139 114 140 return NT_SUCCESS(rc)? VINF_SUCCESS: VERR_VBGL_IOCTL_FAILED;
Note:
See TracChangeset
for help on using the changeset viewer.