#include <ksync.h>
Public Member Functions | |
KEvent (EVENT_TYPE Type, bool State) | |
~KEvent () | |
bool | Valid () |
bool | Set (KPRIORITY Increment=IO_NO_INCREMENT, bool NextCallIsWaitXXX=false) |
void | Clear () |
bool | IsSet () |
NTSTATUS | Wait (KWAIT_REASON WaitReason=Executive, KPROCESSOR_MODE WaitMode=KernelMode, bool Alertable=false) |
NTSTATUS | WaitWithTimeout (LONGLONG Timeout, KWAIT_REASON WaitReason=Executive, KPROCESSOR_MODE WaitMode=KernelMode, bool Alertable=false) |
operator PKEVENT () | |
Private Attributes | |
KEVENT * | m_pEvent |
BazisLib::DDK::KEvent::KEvent | ( | EVENT_TYPE | Type, | |
bool | State | |||
) | [inline] |
Initializes the KEvent object. The arguments are similar to KeInitializeEvent() routine.
Type | Specifies event type. Can be NotificationEvent or SynchronizationEvent. SynchronizationEvent is automatically reset after successful wait, NotificationEvent is not. | |
State | Specifies initial event state. |
BazisLib::DDK::KEvent::~KEvent | ( | ) | [inline] |
void BazisLib::DDK::KEvent::Clear | ( | ) | [inline] |
bool BazisLib::DDK::KEvent::IsSet | ( | ) | [inline] |
BazisLib::DDK::KEvent::operator PKEVENT | ( | ) | [inline] |
Allows converting KEvent class to KEVENT kernel structure. Can be passed to various routines such as IoBuildSynchronousFsdRequest().
NTSTATUS StartXXX() { KEvent evt; StartOperation((PKEVENT)evt, ...); return STATUS_PENDING; //BAD!!! The evt object will be deleted now! }In this example, the operation started by StartOperation() routine may end AFTER the evt is deleted, and its call to KeSetEvent() will cause the system to crash.
bool BazisLib::DDK::KEvent::Set | ( | KPRIORITY | Increment = IO_NO_INCREMENT , |
|
bool | NextCallIsWaitXXX = false | |||
) | [inline] |
bool BazisLib::DDK::KEvent::Valid | ( | ) | [inline] |
NTSTATUS BazisLib::DDK::KEvent::Wait | ( | KWAIT_REASON | WaitReason = Executive , |
|
KPROCESSOR_MODE | WaitMode = KernelMode , |
|||
bool | Alertable = false | |||
) | [inline] |
Waits for the event to become signalled. The wait operation is not time-limited and will not end by timeout.
NTSTATUS BazisLib::DDK::KEvent::WaitWithTimeout | ( | LONGLONG | Timeout, | |
KWAIT_REASON | WaitReason = Executive , |
|||
KPROCESSOR_MODE | WaitMode = KernelMode , |
|||
bool | Alertable = false | |||
) | [inline] |
Waits for the event to become signalled. The wait operation is always time-limited.
Timeout | Specifies the wait timeout in 100-nanosecond units. If this parameter has the value of 0, the method returns immediately. |
KEVENT* BazisLib::DDK::KEvent::m_pEvent [private] |