Skip to content

Latest commit

 

History

History
145 lines (91 loc) · 5.56 KB

nf-synchapi-openeventw.md

File metadata and controls

145 lines (91 loc) · 5.56 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:synchapi.OpenEventW
OpenEventW function (synchapi.h)
Opens an existing named event object. (Unicode)
OpenEvent
OpenEvent function
OpenEventW
_win32_openevent
base.openevent
synchapi/OpenEvent
synchapi/OpenEventW
base\openevent.htm
base
46741024-ace3-44d6-b8a6-5621ad121a1a
12/05/2018
OpenEvent, OpenEvent function, OpenEventA, OpenEventW, _win32_openevent, base.openevent, synchapi/OpenEvent, synchapi/OpenEventA, synchapi/OpenEventW, winbase/OpenEvent, winbase/OpenEventA, winbase/OpenEventW
synchapi.h
Windows.h on Windows Server 2003, Windows Vista, Windows 7, Windows Server 2008 Windows Server 2008 R2
Windows
Windows XP [desktop apps \| UWP apps]
Windows Server 2003 [desktop apps \| UWP apps]
OpenEventW (Unicode) and OpenEventA (ANSI)
Kernel32.lib
Kernel32.dll
Windows
19H1
OpenEventW
synchapi/OpenEventW
c++
APIRef
kbSyntax
DllExport
Kernel32.dll
API-MS-Win-Core-Synch-l1-1-0.dll
KernelBase.dll
API-MS-Win-Core-Synch-l1-2-0.dll
API-MS-Win-Core-Synch-l1-2-1.dll
API-MS-Win-DownLevel-Kernel32-l1-1-0.dll
MinKernelBase.dll
OpenEvent
OpenEventA
OpenEventW

OpenEventW function

-description

Opens an existing named event object.

-parameters

-param dwDesiredAccess [in]

The access to the event object. The function fails if the security descriptor of the specified object does not permit the requested access for the calling process. For a list of access rights, see Synchronization Object Security and Access Rights.

-param bInheritHandle [in]

If this value is TRUE, processes created by this process will inherit the handle. Otherwise, the processes do not inherit this handle.

-param lpName [in]

The name of the event to be opened. Name comparisons are case sensitive.

This function can open objects in a private namespace. For more information, see Object Namespaces.

Terminal Services:  The name can have a "Global" or "Local" prefix to explicitly open an object in the global or session namespace. The remainder of the name can contain any character except the backslash character (\). For more information, see Kernel Object Namespaces.

Note  Fast user switching is implemented using Terminal Services sessions. The first user to log on uses session 0, the next user to log on uses session 1, and so on. Kernel object names must follow the guidelines outlined for Terminal Services so that applications can support multiple users.

-returns

If the function succeeds, the return value is a handle to the event object.

If the function fails, the return value is NULL. To get extended error information, call GetLastError.

-remarks

The OpenEvent function enables multiple processes to open handles of the same event object. The function succeeds only if some process has already created the event by using the CreateEvent function. The calling process can use the returned handle in any function that requires a handle to an event object, subject to the limitations of the access specified in the dwDesiredAccess parameter.

The handle can be duplicated by using the DuplicateHandle function. Use the CloseHandle function to close the handle. The system closes the handle automatically when the process terminates. The event object is destroyed when its last handle has been closed.

Note

The synchapi.h header defines OpenEvent as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

-see-also

CloseHandle

CreateEvent

CreateProcess

DuplicateHandle

Event Objects

Object Names

PulseEvent

ResetEvent

SetEvent

Synchronization Functions