TransportDuplicateHandle

This function creates a duplicate of the specified service handle.

At a Glance

Header file: Msgstor2.h
Platforms: H/PC 3.0
Windows CE versions: 2.10 and later

Syntax

BOOL TransportDuplicateHandle(HANDLE hService,
HANDLE
*phDuplicate);

Parameters

hService
[in] Handle to a private SERVICE structure.
phDuplicate
[in/out] Pointer to a handle to a private SERVICE structure. This function returns a copy of hService in this parameter.

Return Values

TRUE indicates success. FALSE indicates failure. To get extended error information, call the function TransportError or TransportErrorMsg.

Remarks

The transport service provider must implement this function in a DLL registered as a mail service. The Inbox application can then load this DLL and call this function.

Both the original handle and the duplicate handle behave the same. You can use either handle in calls to transport API functions from multiple threads. These calls do not create race conditions on data associated with the service handle.

If a transport service provider does not implement this function, your application cannot perform any multithreading techniques that require two or more handles to the service.