Microsoft Internet Security and Acceleration Server 2000

IFWXIOCompletion::CompleteAsyncIO Method

Receives notifications from the Firewall service when an asynchronous I/O operation completes. All overlapped operations on an IFWXSocket interface require the filter to implement this interface.

The CompleteAsyncIO method is where you should implement the logic of your filter, based on the protocol in which you are working.

HRESULT CompleteAsyncIO(
  BOOL fSuccess,
  DWORD Win32ErrorCode,
  IFWXIOBuffer *pIOBuffer,
  UserContextType UserData,
  LPSOCKADDR ExternalAddress,
  INT ExternalAddressLength


[in] Success flag. If TRUE, the I/O operation succeeded. If FALSE, it failed.
[in] Win32 error code. This parameter is defined only if the fSuccess parameter is FALSE.
[in] Pointer to the IFWXIOBuffer interface for the data buffer, if this is a completion for a receive method.
[in] The UserData parameter that was passed to the I/O method.
[in] Pointer to a sockaddr structure that contains the address of the external source or external destination of a UDP packet. This parameter is passed only for the IFWXSocket::Recv method on a UDP socket. The ExternalAddress parameter is NULL for TCP sockets.

The address is the source when receiving from an external socket, and the target when receiving from an internal socket.

Note that IP packets on the Internet can be made to appear as though they are authorized when they are not. Therefore, do not rely on this address for authentication.

[in] Length, in bytes, of the ExternalAddress parameter.

Return Values

The method succeeded.

Any error should be handled in this method.


Be aware that completion of a send or sendto operation indicates only that the next filter in the chain of filters received the buffer and began processing it. The buffer cannot be recycled at this point.

The UserData parameter provides a context to the notification. You can use the same notification interface for completion notifications from distinct network socket objects and differentiate between them by using different values for UserData.

See Also