PeerDistServerCancelAsyncOperation function (peerdist.h)

The PeerDistServerCancelAsyncOperation function cancels the asynchronous operation associated with the content identifier and OVERLAPPED structure.

Syntax

DWORD PeerDistServerCancelAsyncOperation(
  [in] PEERDIST_INSTANCE_HANDLE hPeerDist,
       DWORD                    cbContentIdentifier,
  [in] PBYTE                    pContentIdentifier,
  [in] LPOVERLAPPED             pOverlapped
);

Parameters

[in] hPeerDist

A PEERDIST_INSTANCE_HANDLE returned by PeerDistStartup.

cbContentIdentifier

The length, in bytes, of the content identifier.

[in] pContentIdentifier

Pointer to an array that contains the content identifier.

[in] pOverlapped

Pointer to an OVERLAPPED structure that contains the canceling asynchronous operation data.

Return value

The function will return ERROR_SUCCESS value if the operation associated with OVERLAPPED structure is successfully canceled. Otherwise, the function may return one of the following values:

Return code Description
ERROR_INVALID_PARAMETER
One or more parameters are invalid.
ERROR_INVALID_HANDLE
The hPeerDist handle is invalid.
PEERDIST_ERROR_OPERATION_NOT_FOUND
The operation for OVERLAPPED structure cannot be found.
ERROR_ACCESS_DISABLED_BY_POLICY
The feature is disabled by Group Policy.
PEERDIST_ERROR_SERVICE_UNAVAILABLE
The service is unavailable.

Remarks

This function will synchronously cancel the operation, but will not return until the cancelation result is posted to the completion port or wait event is set to the 'signaled' state. Any threads in waiting can receive the completion notice for the operation before or after the PeerDistServerCancelAsyncOperation function returns.

This function does not guarantee that the operation will complete as canceled. The cancellation result will be posted only if no other results have been posted.

To confirm successfully canceled operations, a call should be made to GetOverlappedResult with an expected return of FALSE.

Additionally, calling GetLastError immediately after a successful PeerDistServerCancelAsyncOperation will return the ERROR_OPERATION_ABORTED error code.

Requirements

Requirement Value
Minimum supported client Windows 7 Professional [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header peerdist.h
Library PeerDist.lib
DLL PeerDist.dll

See also

PeerDistClientCancelAsyncOperation

PeerDistClientOpenContent