FilterSendMessage function

The FilterSendMessage function sends a message to a kernel-mode minifilter.

Syntax

HRESULT FilterSendMessage(
  HANDLE  hPort,
  LPVOID  lpInBuffer,
  DWORD   dwInBufferSize,
  LPVOID  lpOutBuffer,
  DWORD   dwOutBufferSize,
  LPDWORD lpBytesReturned
);

Parameters

hPort

Communication port handle returned by a previous call to FilterConnectCommunicationPort. This parameter is required and cannot be NULL.

lpInBuffer

Pointer to a caller-allocated buffer containing the message to be sent to the minifilter. The message format is caller-defined. This parameter is required and cannot be NULL.

dwInBufferSize

Size, in bytes, of the buffer pointed to by lpInBuffer.

lpOutBuffer

Pointer to a caller-allocated buffer that receives the reply (if any) from the minifilter.

dwOutBufferSize

Size, in bytes, of the buffer pointed to by lpOutBuffer. This value is ignored if lpOutBuffer is NULL.

lpBytesReturned

Pointer to a caller-allocated variable that receives the number of bytes returned in the buffer that lpOutBuffer points to if the call to FilterSendMessage succeeds. This parameter is required and cannot be NULL.

Return value

FilterSendMessage returns S_OK if successful. Otherwise, it returns an error value.

Remarks

The FilterSendMessage function sends a message to a minifilter. The message is passed to the minifilter's message notification callback routine, which processes the message. (The minifilter registers its message callback notification routine by passing it as the MessageNotifyCallback parameter to FltCreateCommunicationPort.)

FilterSendMessage is synchronous. The caller is put into a wait state until the message is delivered and the minifilter's reply (if any) is received.

If the caller expects a reply, it must pass a non-NULL buffer for the lpOutBuffer parameter and a positive value for the dwOutBufferSize parameter.

To get a message from a minifilter, call FilterGetMessage.

To reply to a message from a minifilter, call FilterReplyMessage.

A minifilter sends a message to a user-mode application by calling FltSendMessage.

Requirements

   
Target Platform Universal
Header fltuser.h (include Fltuser.h)
Library FltLib.lib
DLL FltLib.dll

See also

FilterConnectCommunicationPort

FilterGetMessage

FilterReplyMessage

FltCreateCommunicationPort

FltSendMessage