Condividi tramite


Funzione DxgkInitialize (dispmprt.h)

Una routine DriverEntry del driver miniport in modalità kernel chiama la funzione dxgkInitialize dxgkInitialize per caricare e inizializzare il sottosistema del kernel grafico DirectX (Dxgkrnl.sys).

Sintassi

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

Parametri

[in] DriverObject

Puntatore a una struttura DRIVER_OBJECT. Il sistema operativo ha passato DriverObject al KMD quando chiama la routine DriverEntry kmD.

[in] RegistryPath

Puntatore a un UNICODE_STRING che fornisce il percorso alla chiave del Registro di sistema del servizio del driver. Il sistema operativo passa RegistryPath a KMD quando chiama la routine driverEntry kmD.

[in] DriverInitializationData

Puntatore a una struttura DRIVER_INITIALIZATION_DATA che fornisce Dxgkrnl con puntatori alle funzioni implementate dal KMD.

Valore restituito

DxgkInitialize restituisce STATUS_SUCCESS se ha esito positivo; in caso contrario, restituisce uno dei codici di errore definiti in Ntstatus.h.

Osservazioni

L'esempio di codice seguente mostra un'implementazione di DriverEntry in cui viene chiamato DxgkInitialize.

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);
}

Fabbisogno

Requisito Valore
client minimo supportato Windows Vista (WDDM 1.0)
piattaforma di destinazione Desktop
intestazione dispmprt.h (include Dispmprt.h)
IRQL PASSIVE_LEVEL

Vedere anche

DRIVER_INITIALIZATION_DATA

DRIVER_OBJECT

DriverEntry del driver Miniport visualizzato

UNICODE_STRING