Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

delay.c File Reference

#include "exp.h"

Go to the source code of this file.

Functions

NTSTATUS NtDelayExecution (IN BOOLEAN Alertable, IN PLARGE_INTEGER DelayInterval)


Function Documentation

NTSTATUS NtDelayExecution IN BOOLEAN  Alertable,
IN PLARGE_INTEGER  DelayInterval
 

Definition at line 33 of file delay.c.

References EXCEPTION_EXECUTE_HANDLER, KeDelayExecutionThread(), KernelMode, KPROCESSOR_MODE, NTSTATUS(), ProbeForRead, and Status.

Referenced by CtxBadAppDelay(), LdrpInitialize(), RtlpCreateCriticalSectionSem(), RtlpForceAllocateTPHeap(), RtlpInitializeEventCache(), RtlpInitializeTimerThreadPool(), RtlpInitializeWaitThreadPool(), RtlpInitializeWorkerThreadPool(), RtlpIOWorkerThread(), RtlpLpcServerCallback(), RtlpStartThread(), RtlpTimerThread(), and RtlpWaitThread().

00040 : 00041 00042 This function delays the execution of the current thread for the specified 00043 interval of time. 00044 00045 Arguments: 00046 00047 Alertable - Supplies a boolean value that specifies whether the delay 00048 is alertable. 00049 00050 DelayInterval - Supplies the absolute of relative time over which the 00051 delay is to occur. 00052 00053 Return Value: 00054 00055 TBS 00056 00057 --*/ 00058 00059 { 00060 00061 LARGE_INTEGER Interval; 00062 KPROCESSOR_MODE PreviousMode; 00063 NTSTATUS Status; 00064 00065 // 00066 // Establish an exception handler and probe delay interval address. If 00067 // the probe fails, then return the exception code as the service status. 00068 // Otherwise return the status value returned by the delay execution 00069 // routine. 00070 // 00071 00072 try { 00073 00074 // 00075 // Get previous processor mode and probe delay interval address if 00076 // necessary. 00077 // 00078 00079 PreviousMode = KeGetPreviousMode(); 00080 if (PreviousMode != KernelMode) { 00081 ProbeForRead(DelayInterval, sizeof(LARGE_INTEGER), sizeof(ULONG)); 00082 } 00083 Interval = *DelayInterval; 00084 00085 // 00086 // Delay execution for the specified amount of time. 00087 // 00088 00089 Status = KeDelayExecutionThread(PreviousMode, Alertable, &Interval); 00090 00091 // 00092 // If an exception occurs during the probing of the delay interval address, 00093 // then always handle the exception and return the exception code as the 00094 // status value. 00095 // 00096 00097 } except(EXCEPTION_EXECUTE_HANDLER) { 00098 return GetExceptionCode(); 00099 } 00100 00101 // 00102 // Return service status. 00103 // 00104 00105 return Status; 00106 } }


Generated on Sat May 15 19:43:25 2004 for test by doxygen 1.3.7