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.
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.
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.
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: