Compartilhar via


Função DxgkInitialize (dispmprt.h)

Uma rotina de driver de miniporto de exibição do modo kernel (KMD) chama a função DxgkInitialize fornecida pelo sistema para carregar e inicializar o subsistema de kernel de elementos gráficos directX (Dxgkrnl.sys).

Sintaxe

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

Parâmetros

[in] DriverObject

Ponteiro para uma estrutura DRIVER_OBJECT. O sistema operacional passou DriverObject para o KMD quando chama a rotina driverEntry kmd.

[in] RegistryPath

Ponteiro para um UNICODE_STRING que fornece o caminho para a chave do registro de serviço do driver. O sistema operacional passa do RegistryPath para KMD quando chama a rotina de DriverEntry do KMD.

[in] DriverInitializationData

Ponteiro para uma estrutura DRIVER_INITIALIZATION_DATA que fornece Dxgkrnl com ponteiros para funções implementadas pelo KMD.

Valor de retorno

DxgkInitialize retornará STATUS_SUCCESS se tiver êxito; caso contrário, ele retorna um dos códigos de erro definidos em Ntstatus.h.

Observações

O exemplo de código a seguir mostra uma implementação de DriverEntry no qual DxgkInitialize é chamado.

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

Requisitos

Requisito Valor
de cliente com suporte mínimo Windows Vista (WDDM 1.0)
da Plataforma de Destino Área de trabalho
cabeçalho dispmprt.h (inclua Dispmprt.h)
IRQL PASSIVE_LEVEL

Consulte também

DRIVER_INITIALIZATION_DATA

DRIVER_OBJECT

DriverEntry do Display Miniport Driver

UNICODE_STRING