Share via


CeDriverDuplicateCallerHandle (Compact 2013)

3/26/2014

This function is used to duplicate a handle passed in by the calling application. A common usage of this function is to duplicate a notification handle in order to signal the completion of IO. The passed handle usually belongs to the calling applications process.

Syntax

HANDLE CeDriverDuplicateCallerHandle(
  HANDLE DirectCallerHandle,
  DWORD dwDesiredAccess,
  BOOL bInheritHandle,
  DWORD dwOptions
);

Parameters

  • DirectCallerHandle
    [in] Specifies a handle to the Direct Caller that the driver wants to duplicate.
  • dwDesiredAccess
    [in] Specifies the access requested for the new handle. If the dwOptions parameter specifies the DUPLICATE_SAME_ACCESS flag, then the dwDesiredAccess parameter is ignored. Windows Embedded Compact 2013 requires that the DUPLICATE_SAME_ACCESS flag is always set.
  • bInheritHandle
    [in] Indicates whether the handle is inheritable. Must be set to FALSE. If FALSE, the new handle cannot be inherited.
  • dwOptions
    [in] Specifies optional actions. This value can be zero or any combination of the values in the following table.

    Value

    Description

    DUPLICATE_CLOSE_SOURCE

    Closes the source handle regardless of any error status returned.

    DUPLICATE_SAME_ACCESS

    Ignores the dwDesiredAccess parameter. The duplicate handle has the same access as the source handle. This flag must be specified for Windows Embedded Compact 2013

Return Value

Returns a handle to the event object on success. Returns NULL on failure. For extended error information, call GetLastError.

Remarks

If CeDriverDuplicateCallerHandle is called from kernel mode, DuplicateHandle is used. However, if this function is called from a User Mode Driver, the function will be routed to the kernel mode reflector, which will duplicate the caller handle and return it to the User Mode Driver.

Requirements

Header

ceddk.h

Library

CEDDK.lib

See Also

Reference

User Mode Driver Framework Functions

Other Resources

User Mode Driver Framework