KsCreateDevice function (ks.h)

The KsCreateDevice function creates an AVStream device.

Syntax

KSDDKAPI NTSTATUS KsCreateDevice(
  [in]            PDRIVER_OBJECT            DriverObject,
  [in]            PDEVICE_OBJECT            PhysicalDeviceObject,
  [in, optional]  const KSDEVICE_DESCRIPTOR *Descriptor,
  [in]            ULONG                     ExtensionSize,
  [out, optional] PKSDEVICE                 *Device
);

Parameters

[in] DriverObject

A pointer to the WDM driver object of the minidriver.

[in] PhysicalDeviceObject

A pointer to the WDM physical device object for the device you want to create under AVStream.

[in, optional] Descriptor

A pointer to a device descriptor that describes the characteristics of the device being created. If the caller does not specify this optional parameter, AVStream creates a device with default characteristics and no associated filter factories.

[in] ExtensionSize

This parameter contains the size of the device extension. If this is zero, the default extension size is used. If not, it must be at least sizeof (KSDEVICE_HEADER).

[out, optional] Device

A pointer to a memory location that contains the address of the created KSDEVICE structure. Optional.

Return value

Returns STATUS_SUCCESS if the device is created successfully. Otherwise, it returns an appropriate error code.

Remarks

Normally, the minidriver does not call this function directly. Instead, KsCreateDevice is called by the default AddDevice handler, KsAddDevice. Because KsAddDevice makes an internal call to KsCreateDevice, drivers that call KsCreateDevice should not call KsAddDevice separately.

A minidriver that calls KsCreateDevice directly should not use KsInitializeDriver. If the minidriver is not calling KsInitializeDriver, it should instead provide its own AddDevice callback. The minidriver can then call KsCreateDevice from that AddDevice callback.

If no KSDEVICE_DESCRIPTOR is provided, AVStream creates a device with the default characteristics and no associated filter factories. If a KSDEVICE_DESCRIPTOR is supplied and contains a KSDEVICE_DISPATCH table with a create dispatch, the create dispatch is called.

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

KSDEVICE_DESCRIPTOR

KSDEVICE_DISPATCH

KsAddDevice

KsInitializeDevice

KsInitializeDriver