VideoPortInitialize

VP_STATUS VideoPortInitialize(

    PVOID Argument1,
   PVOID Argument2,
   PVIDEO_HW_INITIALIZATION_DATA HwInitializationData,
   PVOID HwContext /* optional */
  );

VideoPortInitialize performs the initialization of the driver, allocating system resources for the miniport.

Parameters

Argument1

A pointer with which the operating system called DriverEntry.

Argument2

A second pointer with which the operating system called DriverEntry.

HwInitializationData

Points to the VIDEO_HW_INITIALIZATION_DATA structure on the stack. This structure has been zero-initialized and then filled in by DriverEntry with driver-specific configuration information describing a video adapter that the miniport can support.

HwContext

Points to a driver-supplied context parameter to be passed to the miniport driver’s HwVidFindAdapter function. This parameter can be NULL.

Return Value

VideoPortInitialize returns the final status of the initialization operation.

Comments

Every video miniport driver must call VideoPortInitialize from its DriverEntry function. The DriverEntry function can call VideoPortInitialize only after it has first zeroed and then set up the VIDEO_HW_INITIALIZATION_DATA structure. VideoPortInitialize can be called only from a miniport’s DriverEntry function.

VideoPortInitialize allocates resources for the miniport driver, allocates a buffer for and initializes as much configuration information as it can in the VIDEO_PORT_CONFIG_INFO structure, and then calls the miniport’s HwVidFindAdapter function.

Assuming the miniport’s HwVidFindAdapter function finds a video adapter it supports, VideoPortInitialize allocates and sets up system resources for the miniport before it returns control to the DriverEntry function. For example, VideoPortInitialize sets up a symbolic link between the named device object it creates to represent the video adapter and an alias so the corresponding display driver can open the video adapter.

If a miniport can support video adapters on different types of I/O buses, such as Isa and MicroChannel type buses, it should call VideoPortInitialize for each supported interface type.

If a miniport’s DriverEntry function calls VideoPortInitialize more than once for different types of I/O buses, DriverEntry must return the smallest of the values returned by VideoPortInitialize.

See Also

DriverEntry, HwVidFindAdapter, HwVidInitialize, VIDEO_HW_INITIALIZATION_DATA, VIDEO_PORT_CONFIG_INFO, VideoPortZeroMemory