DxgkInitialize function (dispmprt.h)

A kernel-mode display miniport driver's (KMD) DriverEntry routine calls the system-supplied DxgkInitialize function to load and initialize the DirectX graphics kernel subsystem (Dxgkrnl.sys).

Syntax

NTSTATUS DxgkInitialize(
  [in] PDRIVER_OBJECT              DriverObject,
  [in] PUNICODE_STRING             RegistryPath,
  [in] PDRIVER_INITIALIZATION_DATA DriverInitializationData
);

Parameters

[in] DriverObject

Pointer to a DRIVER_OBJECT structure. The OS passed DriverObject to the KMD when it calls KMD's DriverEntry routine.

[in] RegistryPath

Pointer to a UNICODE_STRING that supplies the path to the driver's service registry key. The OS passes RegistryPath to KMD when it calls KMD's DriverEntry routine.

[in] DriverInitializationData

Pointer to a DRIVER_INITIALIZATION_DATA structure that supplies Dxgkrnl with pointers to functions implemented by the KMD.

Return value

DxgkInitialize returns STATUS_SUCCESS if it succeeds; otherwise, it returns one of the error codes defined in Ntstatus.h.

Remarks

The following code example shows an implementation of DriverEntry in which DxgkInitialize is called.

NTSTATUS
DriverEntry(
    IN PDRIVER_OBJECT DriverObject,
    IN PUNICODE_STRING RegistryPath
    )
{
    DRIVER_INITIALIZATION_DATA DriverInitializationData = {'\0'};

    PAGED_CODE();

    if (! ARGUMENT_PRESENT(DriverObject) ||
        ! ARGUMENT_PRESENT(RegistryPath))
    {
        return STATUS_INVALID_PARAMETER;
    }

    // Fill in the DriverInitializationData structure and call DxgkInitialize()
    DriverInitializationData.Version  = DXGKDDI_INTERFACE_VERSION;
 
    DriverInitializationData.DxgkDdiAddDevice  = MyKMDAddDevice;
    DriverInitializationData.DxgkDdiStartDevice  = MyKMDStartDevice;
    DriverInitializationData.DxgkDdiStopDevice  = MyKMDStopDevice;
    DriverInitializationData.DxgkDdiRemoveDevice  = MyKMDRemoveDevice;
    DriverInitializationData.DxgkDdiDispatchIoRequest  = MyKMDDispatchIoRequest;
    DriverInitializationData.DxgkDdiInterruptRoutine  = MyKMDInterruptRoutine;
    DriverInitializationData.DxgkDdiDpcRoutine  = MyKMDDpcRoutine;
    DriverInitializationData.DxgkDdiQueryChildRelations  = MyKMDQueryChildRelations;
    DriverInitializationData.DxgkDdiQueryChildStatus   = MyKMDQueryChildStatus;
    DriverInitializationData.DxgkDdiQueryDeviceDescriptor  = MyKMDQueryDeviceDescriptor;
    DriverInitializationData.DxgkDdiSetPowerState  = MyKMDSetPowerState;
    DriverInitializationData.DxgkDdiNotifyAcpiEvent  = MyKMDNotifyAcpiEvent;
    DriverInitializationData.DxgkDdiResetDevice  = MyKMDResetDevice;
    DriverInitializationData.DxgkDdiUnload  = MyKMDUnload;
    DriverInitializationData.DxgkDdiQueryInterface  = MyKMDQueryInterface;
    DriverInitializationData.DxgkDdiControlEtwLogging  = MyKMDControlEtwLogging;

    DriverInitializationData.DxgkDdiQueryAdapterInfo  = MyKMDQueryAdapterInfo;
    DriverInitializationData.DxgkDdiCreateDevice  = MyKMDCreateDevice;
    DriverInitializationData.DxgkDdiCreateAllocation  = MyKMDCreateAllocation;
    DriverInitializationData.DxgkDdiDestroyAllocation  = MyKMDDestroyAllocation;

    DriverInitializationData.DxgkDdiCreateOverlay  = MyKMDCreateOverlay;
    DriverInitializationData.DxgkDdiUpdateOverlay  = MyKMDUpdateOverlay;
    DriverInitializationData.DxgkDdiFlipOverlay  = MyKMDFlipOverlay;
    DriverInitializationData.DxgkDdiDestroyOverlay  = MyKMDDestroyOverlay;

    DriverInitializationData.DxgkDdiDescribeAllocation  = MyKMDDescribeAllocation;
    DriverInitializationData.DxgkDdiGetStandardAllocationDriverData = MyKMDGetStandardAllocationDriverData;

    DriverInitializationData.DxgkDdiAcquireSwizzlingRange  = MyKMDAcquireSwizzlingRange;
    DriverInitializationData.DxgkDdiReleaseSwizzlingRange  = MyKMDReleaseSwizzlingRange;

    DriverInitializationData.DxgkDdiOpenAllocation  = MyKMDOpenAllocation;
    DriverInitializationData.DxgkDdiCloseAllocation  = MyKMDCloseAllocation;

    DriverInitializationData.DxgkDdiPatch  = MyKMDPatchDmaBuffer;
    DriverInitializationData.DxgkDdiSubmitCommand  = MyKMDSubmitCommand;
    DriverInitializationData.DxgkDdiBuildPagingBuffer  = MyKMDBuildPagingBuffer;
    DriverInitializationData.DxgkDdiSetPalette  = MyKMDSetPalette;
    DriverInitializationData.DxgkDdiSetPointerShape  = MyKMDSetPointerShape;
    DriverInitializationData.DxgkDdiSetPointerPosition  = MyKMDSetPointerPosition;
    DriverInitializationData.DxgkDdiPreemptCommand  = MyKMDPreemptCommand;

    DriverInitializationData.DxgkDdiDestroyDevice  = MyKMDDestroyDevice;
    DriverInitializationData.DxgkDdiRender  = MyKMDRender;
    DriverInitializationData.DxgkDdiRenderKm  = MyKMDRenderKm;    DriverInitializationData.DxgkDdiPresent  = MyKMDPresent;
    DriverInitializationData.DxgkDdiResetFromTimeout  = MyKMDResetFromTimeout;
    DriverInitializationData.DxgkDdiRestartFromTimeout  = MyKMDRestartFromTimeout;
    DriverInitializationData.DxgkDdiEscape  = MyKMDEscape;
    DriverInitializationData.DxgkDdiCollectDbgInfo  = MyKMDCollectDbgInfo;
    DriverInitializationData.DxgkDdiQueryCurrentFence  = MyKMDQueryCurrentFence;
    DriverInitializationData.DxgkDdiControlInterrupt  = MyKMDControlInterrupt;
    DriverInitializationData.DxgkDdiGetScanLine  = MyKMDGetScanLine;
    DriverInitializationData.DxgkDdiStopCapture  = MyKMD DxgkDdiStopCapture;    DriverInitializationData.DxgkDdiSetVidPnSourceAddress  = MyKMDSetVidPnSourceAddress;
    DriverInitializationData.DxgkDdiSetVidPnSourceVisibility  = MyKMDSetVidPnSourceVisibility;
    DriverInitializationData.DxgkDdiUpdateActiveVidPnPresentPath  = MyKMDUpdateActiveVidPnPresentPath;
    DriverInitializationData.DxgkDdiCommitVidPn  = MyKMDCommitVidPn;
    DriverInitializationData.DxgkDdiRecommendMonitorModes  = MyKMDRecommendMonitorModes;
    DriverInitializationData.DxgkDdiRecommendVidPnTopology  = MyKMDRecommendVidPnTopology;

    DriverInitializationData.DxgkDdiCreateContext  = MyKMDCreateContext;
    DriverInitializationData.DxgkDdiDestroyContext  = MyKMDDestroyContext;

    DriverInitializationData.DxgkDdiLinkDevice  = MyKMDLinkDevice;
    DriverInitializationData.DxgkDdiSetDisplayPrivateDriverFormat  = MyKMDSetDisplayPrivateDriverFormat;
    DriverInitializationData.DxgkDdiRecommendFunctionalVidPn  = MyKMDRecommendFunctionalVidPn_XddmParity;
    DriverInitializationData.DxgkDdiEnumVidPnCofuncModality  = MyKMDEnumVidPnCofuncModality_XddmParity;
    DriverInitializationData.DxgkDdiIsSupportedVidPn  = MyKMDIsSupportedVidPn_XddmParity;
    DriverInitializationData.DxgkDdiQueryVidPnHWCapability  = MyKMD DxgkDdiQueryVidPnHWCapability;

    return DxgkInitialize(DriverObject,
                          RegistryPath,
                          &DriverInitializationData);
}

Requirements

Requirement Value
Minimum supported client Windows Vista (WDDM 1.0)
Target Platform Desktop
Header dispmprt.h (include Dispmprt.h)
IRQL PASSIVE_LEVEL

See also

DRIVER_INITIALIZATION_DATA

DRIVER_OBJECT

DriverEntry of Display Miniport Driver

UNICODE_STRING