DxgkInitialize function (dispmprt.h)

The DxgkInitialize function loads and initializes 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

A pointer to a DRIVER_OBJECT structure. The display miniport driver previously obtained this pointer in its DriverEntry function.

[in] RegistryPath

A pointer to a UNICODE_STRING structure that supplies the path to the driver's service registry key. The display miniport driver previously obtained this pointer in its DRIVER_OBJECT function.

[in] DriverInitializationData

A pointer to a DRIVER_INITIALIZATION_DATA structure that supplies the DirectX graphics kernel subsystem with pointers to functions implemented by the display miniport driver.

Return value

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

Remarks

The display miniport driver's DriverEntry function calls DxgkInitialize.

Examples

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  = AtiAddDevice;
    DriverInitializationData.DxgkDdiStartDevice  = AtiStartDevice;
    DriverInitializationData.DxgkDdiStopDevice  = AtiStopDevice;
    DriverInitializationData.DxgkDdiRemoveDevice  = AtiRemoveDevice;
    DriverInitializationData.DxgkDdiDispatchIoRequest  = AtiDispatchIoRequest;
    DriverInitializationData.DxgkDdiInterruptRoutine  = AtiInterruptRoutine;
    DriverInitializationData.DxgkDdiDpcRoutine  = AtiDpcRoutine;
    DriverInitializationData.DxgkDdiQueryChildRelations  = AtiQueryChildRelations;
    DriverInitializationData.DxgkDdiQueryChildStatus   = AtiQueryChildStatus;
    DriverInitializationData.DxgkDdiQueryDeviceDescriptor  = AtiQueryDeviceDescriptor;
    DriverInitializationData.DxgkDdiSetPowerState  = AtiSetPowerState;
    DriverInitializationData.DxgkDdiNotifyAcpiEvent  = AtiNotifyAcpiEvent;
    DriverInitializationData.DxgkDdiResetDevice  = AtiResetDevice;
    DriverInitializationData.DxgkDdiUnload  = AtiUnload;
    DriverInitializationData.DxgkDdiQueryInterface  = AtiQueryInterface;
    DriverInitializationData.DxgkDdiControlEtwLogging  = D3DDDIControlEtwLogging;

    DriverInitializationData.DxgkDdiQueryAdapterInfo  = D3DDDIQueryAdapterInfo;
    DriverInitializationData.DxgkDdiCreateDevice  = D3DDDICreateDevice;
    DriverInitializationData.DxgkDdiCreateAllocation  = D3DDDICreateAllocation;
    DriverInitializationData.DxgkDdiDestroyAllocation  = D3DDDIDestroyAllocation;

    DriverInitializationData.DxgkDdiCreateOverlay  = D3DDDICreateOverlay;
    DriverInitializationData.DxgkDdiUpdateOverlay  = D3DDDIUpdateOverlay;
    DriverInitializationData.DxgkDdiFlipOverlay  = D3DDDIFlipOverlay;
    DriverInitializationData.DxgkDdiDestroyOverlay  = D3DDDIDestroyOverlay;

    DriverInitializationData.DxgkDdiDescribeAllocation  = D3DDDIDescribeAllocation;
    DriverInitializationData.DxgkDdiGetStandardAllocationDriverData = D3DDDIGetStandardAllocationDriverData;

    DriverInitializationData.DxgkDdiAcquireSwizzlingRange  = D3DDDIAcquireSwizzlingRange;
    DriverInitializationData.DxgkDdiReleaseSwizzlingRange  = D3DDDIReleaseSwizzlingRange;

    DriverInitializationData.DxgkDdiOpenAllocation  = D3DDDIOpenAllocation;
    DriverInitializationData.DxgkDdiCloseAllocation  = D3DDDICloseAllocation;

    DriverInitializationData.DxgkDdiPatch  = D3DDDIPatchDmaBuffer;
    DriverInitializationData.DxgkDdiSubmitCommand  = D3DDDISubmitCommand;
    DriverInitializationData.DxgkDdiBuildPagingBuffer  = D3DDDIBuildPagingBuffer;
    DriverInitializationData.DxgkDdiSetPalette  = D3DDDISetPalette;
    DriverInitializationData.DxgkDdiSetPointerShape  = D3DDDISetPointerShape;
    DriverInitializationData.DxgkDdiSetPointerPosition  = D3DDDISetPointerPosition;
    DriverInitializationData.DxgkDdiPreemptCommand  = D3DDDIPreemptCommand;

    DriverInitializationData.DxgkDdiDestroyDevice  = D3DDDIDestroyDevice;
    DriverInitializationData.DxgkDdiRender  = D3DDDIRender;
    DriverInitializationData.DxgkDdiRenderKm  = D3DDDIRenderKm;    DriverInitializationData.DxgkDdiPresent  = D3DDDIPresent;
    DriverInitializationData.DxgkDdiResetFromTimeout  = D3DDDIResetFromTimeout;
    DriverInitializationData.DxgkDdiRestartFromTimeout  = D3DDDIRestartFromTimeout;
    DriverInitializationData.DxgkDdiEscape  = D3DDDIEscape;
    DriverInitializationData.DxgkDdiCollectDbgInfo  = D3DDDICollectDbgInfo;
    DriverInitializationData.DxgkDdiQueryCurrentFence  = D3DDDIQueryCurrentFence;
    DriverInitializationData.DxgkDdiControlInterrupt  = D3DDDIControlInterrupt;
    DriverInitializationData.DxgkDdiGetScanLine  = D3DDDIGetScanLine;
    DriverInitializationData.DxgkDdiStopCapture  = D3DDDI DxgkDdiStopCapture;    DriverInitializationData.DxgkDdiSetVidPnSourceAddress  = D3DDDISetVidPnSourceAddress;
    DriverInitializationData.DxgkDdiSetVidPnSourceVisibility  = D3DDDISetVidPnSourceVisibility;
    DriverInitializationData.DxgkDdiUpdateActiveVidPnPresentPath  = D3DDDIUpdateActiveVidPnPresentPath;
    DriverInitializationData.DxgkDdiCommitVidPn  = D3DDDICommitVidPn;
    DriverInitializationData.DxgkDdiRecommendMonitorModes  = D3DDDIRecommendMonitorModes;
    DriverInitializationData.DxgkDdiRecommendVidPnTopology  = D3DDDIRecommendVidPnTopology;

    DriverInitializationData.DxgkDdiCreateContext  = D3DDDICreateContext;
    DriverInitializationData.DxgkDdiDestroyContext  = D3DDDIDestroyContext;

    DriverInitializationData.DxgkDdiLinkDevice  = D3DDDILinkDevice;
    DriverInitializationData.DxgkDdiSetDisplayPrivateDriverFormat  = D3DDDISetDisplayPrivateDriverFormat;
    DriverInitializationData.DxgkDdiRecommendFunctionalVidPn  = D3DDDIRecommendFunctionalVidPn_XddmParity;
    DriverInitializationData.DxgkDdiEnumVidPnCofuncModality  = D3DDDIEnumVidPnCofuncModality_XddmParity;
    DriverInitializationData.DxgkDdiIsSupportedVidPn  = D3DDDIIsSupportedVidPn_XddmParity;
    DriverInitializationData.DxgkDdiQueryVidPnHWCapability  = D3DDDI DxgkDdiQueryVidPnHWCapability;

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

Requirements

Requirement Value
Minimum supported client Windows Vista
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