#ifndef _NTEXAPI_H
#if (PHNT_MODE != PHNT_MODE_KERNEL)
/**
* The NtSetEvent routine sets an event object to the signaled state.
*
* \param EventHandle A handle to the event object.
* \param PreviousState A pointer to a variable that receives the previous state of the event object.
* \return NTSTATUS Successful or errant status.
*/
NTSYSCALLAPI
NTSTATUS
NTAPI
NtSetEvent(
_In_ HANDLE EventHandle,
_Out_opt_ PLONG PreviousState
);
View code on GitHub
#ifndef _NTZWAPI_H
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwSetEvent(
_In_ HANDLE EventHandle,
_Out_opt_ PLONG PreviousState
);
View code on GitHub
// ntifs.h
NTSYSAPI NTSTATUS ZwSetEvent(
[in] HANDLE EventHandle,
[out, optional] PLONG PreviousState
);
View the official Windows Driver Kit DDI reference
No description available.
The ZwSetEvent routine sets an event object to a Signaled state and attempts to satisfy as many waits as possible.
EventHandle
[in]A handle to an event object.
PreviousState
[out, optional]An optional pointer to a variable where the previous state of the event object is stored on output.
ZwSetEvent returns STATUS_SUCCESS or an appropriate error status. Possible error status codes include the following:
Return code | Description |
---|---|
STATUS_ACCESS_DENIED | The caller did not have the required privileges to modify the event specified by the EventHandle parameter. |
STATUS_INSUFFICIENT_RESOURCES | Resources required by this function could not be allocated. |
STATUS_INVALID_HANDLE | The supplied EventHandle parameter was invalid. |
ZwSetEvent sets an event object to a Signaled state and attempts to satisfy as many waits as possible.
Note If the call to the ZwSetEvent function occurs in user mode, you should use the name "NtSetEvent" instead of "ZwSetEvent".
For calls from kernel-mode drivers, the NtXxx and ZwXxx versions of a Windows Native System Services routine can behave differently in the way that they handle and interpret input parameters. For more information about the relationship between the NtXxx and ZwXxx versions of a routine, see Using Nt and Zw Versions of the Native System Services Routines.
Using Nt and Zw Versions of the Native System Services Routines
This function is documented in Windows Driver Kit.
HANDLE
to Event Object opened with EVENT_MODIFY_STATE
access.
State of Event Object before function call.