Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function returns a pseudohandle for the current process.

Syntax

HANDLE GetCurrentProcess(void);

Parameters

None.

Return Value

Pseudohandle to the current process.

Remarks

A pseudohandle is a special constant that is interpreted as the current process handle. The calling process can use this handle to specify its own process when a process handle is required.

This handle has the maximum possible access to the process object.

A process can also use the OpenProcessfunction to open a real handle to itself.

The pseudohandle does not need to be closed when it is no longer needed.

Calling the CloseHandlefunction with a pseudohandle can have unexplained results.

To retrieve the identifier for the current process, use the GetCurrentProcessIdfunction. The process identifier value returned from GetCurrentProcessIdcan be cast to a handle and used in functions that require process handles.

Requirements

Header kfuncs.h
Library coredll.lib
Windows Embedded CE Windows CE 1.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also