Skip to content

Latest commit

 

History

History
156 lines (107 loc) · 4.64 KB

nf-portcls-pcinitializeadapterdriver.md

File metadata and controls

156 lines (107 loc) · 4.64 KB
UID title description old-location tech.root ms.date keywords ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames f1_keywords topic_type api_type api_location api_name
NF:portcls.PcInitializeAdapterDriver
PcInitializeAdapterDriver function (portcls.h)
The PcInitializeAdapterDriver function binds an adapter driver to the PortCls system driver.
audio\pcinitializeadapterdriver.htm
audio
05/08/2018
PcInitializeAdapterDriver function
PcInitializeAdapterDriver, PcInitializeAdapterDriver function [Audio Devices], audio.pcinitializeadapterdriver, audpc-routines_57c7e54d-ab27-4752-b13b-9d7de107322c.xml, portcls/PcInitializeAdapterDriver
portcls.h
Portcls.h
Universal
The PortCls system driver implements the PcInitializeAdapterDriver function in Microsoft Windows 98/Me and in Windows 2000 and later operating systems.
Portcls.lib
PASSIVE_LEVEL
Windows
PcInitializeAdapterDriver
portcls/PcInitializeAdapterDriver
APIRef
kbSyntax
LibDef
Portcls.lib
Portcls.dll
PcInitializeAdapterDriver

PcInitializeAdapterDriver function

-description

The PcInitializeAdapterDriver function binds an adapter driver to the PortCls system driver. IRP handlers and handlers for device addition and removal are installed in the driver object. Adapter drivers that need to bind to more than one class driver should not call this function.

-parameters

-param DriverObject [in]

Pointer to the driver object, which is a system structure of type DRIVER_OBJECT. This pointer is passed as a parameter to the adapter's DriverEntry function.

-param RegistryPathName [in]

Specifies the registry path name that is to be passed as a parameter to the adapter's DriverEntry function.

-param AddDevice [in]

Pointer to the adapter's AddDevice function. This is a pointer of type PDRIVER_ADD_DEVICE, which is defined in ntddk.h to be:

  NTSTATUS
    (*PDRIVER_ADD_DEVICE)(
      IN struct _DRIVER_OBJECT  *DriverObject,
      IN struct _DEVICE_OBJECT  *PhysicalDeviceObject
        );

-returns

PcInitializeAdapterDriver returns STATUS_SUCCESS if the call was successful. Otherwise, it returns an appropriate error code.

-remarks

The AddDevice handler supplied in the call to this function should call PcAddAdapterDevice. For more information, see Startup Sequence.

The PcInitializeAdapterDriver function loads pointers to handlers for the following IRPs into the driver object:

  • IRP_MJ_CLOSE
  • IRP_MJ_CREATE
  • IRP_MJ_DEVICE_CONTROL
  • IRP_MJ_FLUSH_BUFFERS
  • IRP_MJ_PNP
  • IRP_MJ_POWER
  • IRP_MJ_QUERY_SECURITY
  • IRP_MJ_READ
  • IRP_MJ_SET_SECURITY
  • IRP_MJ_SYSTEM_CONTROL
  • IRP_MJ_WRITE
PortCls uses its own internal handlers for the CREATE, PNP, POWER, and SYSTEM_CONTROL IRPs above. It uses the default KS handlers for the other seven IRPs.

An adapter driver that overwrites one or more of the pointers above with a pointer to its own IRP handler can call PcDispatchIrp from within its handler routine in order to forward the IRP to PortCls. For a code example, see the SB16 sample audio driver in the Microsoft Windows Driver Kit (WDK).

-see-also

AddDevice

DRIVER_OBJECT

DriverEntry

PcAddAdapterDevice

PcDispatchIrp