Windows Dev Center

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DuplicateHandle function

The DuplicateHandle function creates a duplicate handle. The returned duplicate is in the caller's process space.

Syntax


NTSTATUS DuplicateHandle(
  _In_  HANDLE  SourceHandle,
  _Out_ PHANDLE DestinationHandle
);

Parameters

SourceHandle [in]

A handle to duplicate.

DestinationHandle [out]

Pointer that receives the address of a duplicate of the SourceHandle handle. The duplicate handle is in the caller's process space. When you have finished using the handle, close it by calling the CloseHandle function.

Return value

If the function succeeds, the return value is STATUS_SUCCESS.

If the function fails, the return value is an NTSTATUS code indicating the reason it failed.

Remarks

A pointer to the DuplicateHandle function is available in the LSA_SECPKG_FUNCTION_TABLE structure received by the SpInitialize function.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Ntsecpkg.h

See also

LSA_SECPKG_FUNCTION_TABLE
SpInitialize

 

 

Community Additions

Show:
© 2015 Microsoft