Previous Next

IOCTL_PF_SET_EXTENSION_POINTER

The filter-hook driver uses this IOCTL to set up an IRP that the filter-hook driver submits to the IP filter driver. The filter-hook driver passes this IOCTL along with related parameters in the IoBuildDeviceIoControlRequest function to set up the IRP.

Operation

IOCTL_PF_SET_EXTENSION_POINTER registers filter hook callback functions to the IP filter driver to inform the IP filter driver to call those filter hook callbacks for every IP packet that is received or transmitted. Also, IOCTL_PF_SET_EXTENSION_POINTER clears filter hook callback functions from the IP filter driver.

Parameters

IoControlCode
IOCTL_PF_SET_EXTENSION_POINTER.
DeviceObject
Pointer to the device object for the IP filter driver.
InputBuffer
Pointer to a location containing a PF_SET_EXTENSION_HOOK_INFO structure. To register the filter hook callback function, this structure holds the address of the filter hook callback function. To clear the filter hook callback function, this structure holds a NULL value.
InputBufferLength
Size, in bytes, of the PF_SET_EXTENSION_HOOK_INFO structure.
OutputBuffer
NULL.
OutputBufferLength
Zero.
InternalDeviceIoControl
FALSE.
Event
NULL.
IoStatusBlock
Pointer to a location to receive an I/O status block. The I/O status is set after the IP filter driver completes the I/O request.

Comments

To set up an IRP, the filter-hook driver calls the IoBuildDeviceIoControlRequest function. In this call, the filter-hook driver passes parameters specifying the IOCTL_PF_SET_EXTENSION_POINTER IOCTL request; the pointer to the device object for the IP filter driver; and an input buffer containing a PF_SET_EXTENSION_HOOK_INFO structure. To retrieve the device object for the IP filter driver, the filter-hook driver calls the IoGetDeviceObjectPointer function. In this call, the filter-hook driver passes parameters specifying the name of the device object for the IP filter driver, along with SYNCHRONIZE, GENERIC_READ, and GENERIC_WRITE. These values specify that synchronous, read, and write access to the driver must be provided. In the IoGetDeviceObjectPointer call, the filter-hook driver also passes pointers to buffers to hold the returned file and device objects for the IP filter driver. The Unicode string that contains the name of the device object for the IP filter driver is \\Device\Ipfilterdriver.

To submit the IRP, the filter-hook driver calls the IoCallDriver function.

The PF_SET_EXTENSION_HOOK_INFO structure is defined in the following section.

PF_SET_EXTENSION_HOOK_INFO

The PF_SET_EXTENSION_HOOK_INFO structure contains information that describes a filter-hook callback function.

typedef struct _PF_SET_EXTENSION_HOOK_INFO {

    PacketFilterExtensionPtr  ExtensionPointer; 

} PF_SET_EXTENSION_HOOK_INFO, *PPF_SET_EXTENSION_HOOK_INFO;

The member of this structure contains the following information:

ExtensionPointer
Specifies a PacketFilterExtensionPtr data type that points to a filter hook callback function to register the function with the IP filter driver. If ExtensionPointer is a NULL value, the previously registered function is cleared from the IP filter driver.

See Also

PacketFilterExtensionPtr