Bewerken

Delen via


INTERFACE structure (miniport.h)

The INTERFACE structure describes an interface that is exported by a driver for use by other drivers.

Syntax

typedef struct _INTERFACE {
  USHORT                 Size;
  USHORT                 Version;
  PVOID                  Context;
  PINTERFACE_REFERENCE   InterfaceReference;
  PINTERFACE_DEREFERENCE InterfaceDereference;
} INTERFACE, *PINTERFACE;

Members

Size

Size, in bytes, of a structure defining a driver interface, including this structure and interface-specific members.

Version

Driver-defined interface version.

Context

Pointer to interface-specific context information.

InterfaceReference

Pointer to a driver-supplied InterfaceReference routine that increments the interface's reference count.

InterfaceDereference

Pointer to a driver-supplied InterfaceDereference routine that decrements the interface's reference count.

Remarks

The INTERFACE structure must be included as the first member of all structures that describe interfaces returned by drivers in response to an IRP_MN_QUERY_INTERFACE request.

The InterfaceReference routine must be called by the driver that exports the interface, each time the driver supplies that interface in response to IRP_MN_QUERY_INTERFACE. Likewise, if the driver that requests the interface subsequently passes it to another driver, the driver that passes the interface must call InterfaceReference on behalf of the driver that receives it.

Each driver that imports the interface (whether by sending IRP_MN_QUERY_INTERFACE or by receiving the interface from another driver) must call the InterfaceDereference routine after it has finished using the interface. After calling the InterfaceDereference routine, a driver cannot use the interface again without first reobtaining it.

Requirements

Requirement Value
Header miniport.h (include Wdm.h, Ntddk.h, Ntifs.h, Miniport.h)

See also

IRP_MN_QUERY_INTERFACE

InterfaceDereference

InterfaceReference