KsCreateDevice function

The KsCreateDevice function creates an AVStream device.

Syntax

KSDDKAPI NTSTATUS KsCreateDevice(
  PDRIVER_OBJECT            DriverObject,
  PDEVICE_OBJECT            PhysicalDeviceObject,
  const KSDEVICE_DESCRIPTOR *Descriptor,
  ULONG                     ExtensionSize,
  PKSDEVICE                 *Device
);

Parameters

DriverObject

A pointer to the WDM driver object of the minidriver.

PhysicalDeviceObject

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

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.

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).

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

   
Windows version 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