Partager via


WPUQueryBlockingCallback (Compact 2013)

3/26/2014

This function returns a pointer to a callback function the service provider should invoke periodically while servicing blocking operations.

Note

WPUQueryBlockingCallback is not supported for the default TCP/UDP provider in Windows Embedded Compact. However, third parties can implement their own provider and have support for this function if they choose.

Syntax

int WPUQueryBlockingCallback(
  DWORD dwCatalogEntryId,
  LPBLOCKINGCALLBACK FAR* lplpfnCallback,
  PDWORD_PTR lpdwContext,
  LPINT lpErrno 
);

Parameters

  • dwCatalogEntryId
    [in] Descriptor identifying the calling service provider.
  • lplpfnCallback
    [out] Pointer that receives the blocking callback function.
  • lpdwContext
    [out] Pointer that receives a context value that the service provider must pass into the blocking callback.
  • lpErrno
    [out] Pointer to the error code.

Return Value

If no error occurs, this function returns zero and stores a pointer to a blocking callback function in lpfnCallback and an associated context value in lpdwContext. Otherwise, it returns SOCKET_ERROR, and a specific error code is available in lpErrno.

This function always returns NULL in lpfnCallback in Windows Embedded Compact.

The following table shows possible error codes.

Error value

Description

WSAEFAULT

The lpfnCallback or the lpdwContext parameter is not a valid part of the process address space.

WSAEINVAL

The dwCatalogEntryId is invalid.

Remarks

This function returns a pointer to a callback function in lpfnCallback to be invoked periodically during blocking operations. This function also returns a context value in lpdwContext to be passed into the blocking callback.

Using Win32, this function can return NULL in lpfnCallback, indicating that no user defined-blocking hook is installed. In this case, the service provider should use the native Win32 synchronization objects to implement blocking.

LPBLOCKINGCALLBACK is defined as typedef BOOL ( CALLBACK FAR * LPBLOCKINGCALLBACK )( DWORD dwContext );.

The blocking callback will return TRUE if the service provider is to continue waiting for the blocking operation to complete.

Any missing parts of the address will default to a reasonable value, if possible. For example, a missing port number will default to zero.

Requirements

Header

ws2spi.h

Library

Ws2.lib

See Also

Reference

Winsock SPI Functions