- Timestamp:
- Jun 25, 2009 11:21:35 AM (16 years ago)
- Location:
- trunk/src/VBox/Runtime/r0drv/nt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/nt/semevent-r0drv-nt.cpp
r20913 r20923 136 136 } 137 137 138 #if 1139 138 /* 140 139 * Wait for it. … … 151 150 rcNt = KeWaitForSingleObject(&pEventInt->Event, Executive, WaitMode, fInterruptible, &Timeout); 152 151 } 153 #else154 /*155 * Wait for it.156 *157 * We default to UserMode here as the waits might be aborted due to process termination.158 * @todo As far as I can tell this is currently safe as all calls are made on behalf of user threads.159 */160 NTSTATUS rcNt;161 if (cMillies == RT_INDEFINITE_WAIT)162 rcNt = KeWaitForSingleObject(&pEventInt->Event, Executive, UserMode, fInterruptible, NULL);163 else164 {165 /* Can't use the stack here as the wait is UserMode. */166 PLARGE_INTEGER pTimeout = (PLARGE_INTEGER)RTMemAlloc(sizeof(*pTimeout));167 if (!pTimeout)168 return VERR_NO_MEMORY;169 170 pTimeout->QuadPart = -(int64_t)cMillies * 10000;171 rcNt = KeWaitForSingleObject(&pEventInt->Event, Executive, UserMode, fInterruptible, pTimeout);172 RTMemFree(pTimeout);173 }174 #endif175 152 switch (rcNt) 176 153 { -
trunk/src/VBox/Runtime/r0drv/nt/semeventmulti-r0drv-nt.cpp
r20913 r20923 143 143 AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC, ("%p u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_PARAMETER); 144 144 145 #if 1146 145 /* 147 146 * Wait for it. … … 158 157 rcNt = KeWaitForSingleObject(&pThis->Event, Executive, WaitMode, fInterruptible, &Timeout); 159 158 } 160 #else161 /*162 * Wait for it.163 *164 * We default to UserMode here as the waits might be aborted due to process termination.165 * @todo As far as I can tell this is currently safe as all calls are made on behalf of user threads.166 */167 NTSTATUS rcNt;168 if (cMillies == RT_INDEFINITE_WAIT)169 rcNt = KeWaitForSingleObject(&pThis->Event, Executive, UserMode, fInterruptible, NULL);170 else171 {172 /* Can't use the stack here as the wait is UserMode. */173 PLARGE_INTEGER pTimeout = (PLARGE_INTEGER)RTMemAlloc(sizeof(*pTimeout));174 if (!pTimeout)175 return VERR_NO_MEMORY;176 177 pTimeout->QuadPart = -(int64_t)cMillies * 10000;178 rcNt = KeWaitForSingleObject(&pThis->Event, Executive, UserMode, fInterruptible, pTimeout);179 RTMemFree(pTimeout);180 }181 #endif182 159 switch (rcNt) 183 160 {
Note:
See TracChangeset
for help on using the changeset viewer.