Поделиться через


IOCTL_PF_SET_EXTENSION_POINTER control code

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.

Input Parameters

Pointer to a buffer that contains a PF_SET_EXTENSION_HOOK_INFOstructure. 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.

Output Parameters

None

I/O Status Block

Pointer to a buffer that is to receive an I/O status block. The I/O status is set after the IP filter driver completes the I/O request.

Remarks

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.

Requirements

Header

Pfhook.h (include Pfhook.h)

See also

PacketFilterExtensionPtr

PF_SET_EXTENSION_HOOK_INFO

 

 

Send comments about this topic to Microsoft