Partager via


DriverEntry of NDIS Filter Drivers (Compact 7)

3/12/2014

This routine is required and is the first function that the system calls in any NDIS filter driver.

Syntax

NTSTATUS
  DriverEntry(
    IN PDRIVER_OBJECT  DriverObject,
    IN PUNICODE_STRING  RegistryPath
    );

Parameters

  • DriverObject
    A pointer to a DRIVER_OBJECT structure that represents this filter driver.
  • RegistryPath
    A pointer to a driver-specific registry path specification set up by the driver's installation file (.inf).

Return Value

DriverEntry returns STATUS_SUCCESS, or its equivalent NDIS_STATUS_SUCCESS, if the driver successfully registered as an NDIS filter driver. If DriverEntry fails initialization by propagating an error status returned by an NdisXxx function or by a kernel-mode support routine, the driver will not remain loaded. DriverEntry must execute synchronously; that is, it cannot return STATUS_PENDING or its equivalent NDIS_STATUS_PENDING.

Remarks

The DriverEntry routine of an NDIS filter driver must call the NdisFRegisterFilterDriver function to register the driver's FilterXxx entry points with NDIS. Generally, a DriverEntry routine should call NdisFRegisterFilterDriver exactly before it returns control with STATUS_SUCCESS or NDIS_STATUS_SUCCESS.

If an attempt to allocate resources fails, DriverEntry should release all resources it already allocated before it returns control with a status other than STATUS_SUCCESS or NDIS_STATUS_SUCCESS.

If DriverEntry is completed successfully, the system will call the FilterDriverUnload routine when the system is ready for the driver to unload. FilterDriverUnload should undo all the operations that were performed in DriverEntry.

The system calls DriverEntry at IRQL = PASSIVE_LEVEL.

See Also

Reference

NDIS Filter Driver Functions
DriverEntry
FilterDriverUnload
NdisFRegisterFilterDriver