Export (0) Print
Expand All

WSACOMPLETION structure

The WSACOMPLETION structure specifies completion notification settings for I/O control calls made to a registered namespace.

Syntax


typedef struct _WSACOMPLETION {
  WSACOMPLETIONTYPE Type;
  union {
    struct {
      HWND   hWnd;
      UINT   uMsg;
      WPARAM context;
    } WindowMessage;
    struct {
      LPWSAOVERLAPPED lpOverlapped;
    } Event;
    struct {
      LPWSAOVERLAPPED                    lpOverlapped;
      LPWSAOVERLAPPED_COMPLETION_ROUTINE lpfnCompletionProc;
    } Apc;
    struct {
      LPWSAOVERLAPPED lpOverlapped;
      HANDLE          hPort;
      ULONG_PTR       Key;
    } Port;
  } Parameters;
} WSACOMPLETION;

Members

Type

Type: WSACOMPLETIONTYPE

The type of completion notification required. See Remarks.

Parameters

The parameters required to complete the callback. The structures within the Parameters union specify information required for completing the callback of each given type. For example, the WindowMessage structure must be filled when Type is set to NSP_NOTIFY_HWND.

WindowMessage
hWnd

Type: HWND

Windows handle.

uMsg

Type: UINT

Message handle.

context

Type: WPARAM

Context of the message or handle.

Event
lpOverlapped

Type: LPWSAOVERLAPPED

A pointer to a WSAOVERLAPPED structure.

Apc
lpOverlapped

Type: LPWSAOVERLAPPED

A pointer to a WSAOVERLAPPED structure.

lpfnCompletionProc

Type: LPWSAOVERLAPPED_COMPLETION_ROUTINE

A pointer to an application-provided completion routine.

Port
lpOverlapped

Type: LPWSAOVERLAPPED

A pointer to a WSAOVERLAPPED structure.

hPort

Type: HANDLE

A handle to the port.

Key

Type: ULONG_PTR

A pointer to the key.

Remarks

The WSACOMPLETION structure enables callbacks to be provided in any of the following formats, based on the value provided in Type:

Callback FormatType value
Polling NSP_NOTIFY_IMMEDIATELY
Window MessageNSP_NOTIFY_HWND
EventNSP_NOTIFY_EVENT
APCNSP_NOTIFY_APC
Completion PortNSP_NOTIFY_PORT

 

For a blocking function, set the WSACOMPLETION structure to null.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Winsock2.h

See also

WSANSPIoctl

 

 

Community Additions

ADD
Show:
© 2014 Microsoft