Windows Dev Center

PeerDistClientCancelAsyncOperation function

The PeerDistClientCancelAsyncOperation function cancels asynchronous operation associated with an OVERLAPPED structure and the content handle returned by PeerDistClientOpenContent.

Syntax


DWORD WINAPI PeerDistClientCancelAsyncOperation(
  _In_     PEERDIST_INSTANCE_HANDLE hPeerDist,
  _In_     PEERDIST_CONTENT_HANDLE  hContentHandle,
  _In_opt_ LPOVERLAPPED             pOverlapped
);

Parameters

hPeerDist [in]

A PEERDIST_INSTANCE_HANDLE returned by PeerDistStartup.

hContentHandle [in]

A content handle opened by PeerDistClientOpenContent function call.

pOverlapped [in, optional]

Pointer to an OVERLAPPED structure that contains the canceling asynchronous operation data. If the pointer is NULL all asynchronous operations for specified content handle will be canceled.

Return value

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

Return codeDescription
ERROR_INVALID_PARAMETER

One or more parameters are invalid.

ERROR_INVALID_HANDLE

The hPeerDist handle is invalid.

PEERDIST_ERROR_OPERATION_NOT_FOUND

The operation associated with the specified 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 cancellation 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 PeerDistClientCancelAsyncOperation 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 PeerDistClientCancelAsyncOperation will return the ERROR_OPERATION_ABORTED error code.

Requirements

Minimum supported client

Windows 7 Professional [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

Header

PeerDist.h

Library

PeerDist.lib

DLL

PeerDist.dll

See also

PeerDistServerCancelAsyncOperation

 

 

Community Additions

ADD
Show:
© 2015 Microsoft