KsAddDevice function (ks.h)

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

Syntax

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

Parameters

[in] DriverObject

A pointer to the WDM driver object for the minidriver.

[in] PhysicalDeviceObject

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.

Requirements

Requirement Value
Minimum supported client Available in Microsoft Windows XP and later operating systems and DirectX 8.0 and later DirectX versions.
Target Platform Universal
Header ks.h (include Ks.h)
Library Ks.lib
IRQL PASSIVE_LEVEL

See also

DEVICE_OBJECT

DRIVER_OBJECT

KSDEVICE

KsCreateDevice

KsDispatchIrp

KsInitializeDevice

KsInitializeDriver