KsAddDevice - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// ks.h

KSDDKAPI NTSTATUS KsAddDevice(
  [in] PDRIVER_OBJECT DriverObject,
  [in] PDEVICE_OBJECT PhysicalDeviceObject
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-ks-ksadddevice)

KsAddDevice function

Description

The KsAddDevice function is the default AddDevice handler installed by KsInitializeDriver.

Parameters

DriverObject [in]

A pointer to the WDM driver object for the minidriver.

PhysicalDeviceObject [in]

A pointer to the WDM physical device object.

Return value

Returns STATUS_SUCCESS indicating the device was successfully created or an error status from IoCreateDevice or KsInitializeDevice.

Remarks

Normally, an AVStream minidriver does not call this function directly.

For more information, see AddDevice Routine for AVStream Minidrivers.

KsAddDevice extracts the device descriptor stored in the device extension allocated from a call to KsInitializeDriver and creates the device described by it. If KsInitializeDriver is not used to initialize the driver, this function creates a device with the default characteristics and no filter factories. The minidriver always has the option of calling KsCreateDevice directly, in which case the driver extension is not used by AVStream. Because KsAddDevice calls KsCreateDevice, drivers that call KsAddDevice should not call KsCreateDevice separately.

See also

DEVICE_OBJECT

DRIVER_OBJECT

KSDEVICE

KsCreateDevice

KsDispatchIrp

KsInitializeDevice

KsInitializeDriver