Platform SDK: Windows Sockets

WPUModifyIFSHandle

The WPUModifyIFSHandle function receives a (possibly) modified IFS handle from Ws2_32.dll.

SOCKET WPUModifyIFSHandle (
  DWORD      dwCatalogEntryId,   
  SOCKET     ProposedHandle,   
  LPINT      lpErrno            
);

Parameters

dwCatalogEntryId
[in] Descriptor identifying the calling service provider.
ProposedHandle
[in] IFS handle allocated by the provider.
lpErrno
[out] Pointer to the error code.

Return Values

If no error occurs, WPUModifyIFSHandle returns the modified socket handle. Otherwise, it returns INVALID_SOCKET, and a specific error code is available in lpErrno.

Remarks

The WPUModifyIFSHandle handle allows the Ws2_32.dll to streamline its internal operations by returning a possibly modified version of the supplied IFS handle. It is guaranteed that the returned handle is indistinguishable from the proposed handle as far as the operating system is concerned. IFS providers must call this function before returning any newly created socket descriptor to a service provider. The service provider will only use the modified handle for any subsequent socket operations.

This routine is only used by IFS providers whose socket descriptors are real IFS handles.

Layered Service Provider Considerations

This procedure may also be used by a layered provider that is layered on top of a base IFS provider and wants to expose the base provider's socket handles as its own instead of creating them with a WPUCreateSocketHandle call. A layered provider that wishes to "pass through" the IFS socket handles it receives from the next layer in the chain can call WPUModifyIFSHandle, passing its own catalog entry ID as dwCatalogEntryId. This informs the Windows Sockets DLL that this layer, and not the next layer, should be the target for SPI calls involving that socket handle.

There are several limitations a layered provider should observe if it takes this approach.

Error Codes

Error code Meaning
WSAEINVAL Proposed handle is invalid.

Requirements

  Version: Requires Windows Sockets 2.0.
  Header: Declared in Ws2spi.h.

See Also

WPUCreateSocketHandle