dxgkInitialize 函数 (dispmprt.h)
DxgkInitialize 函数加载并初始化 DirectX 图形内核子系统 (Dxgkrnl.sys) 。
语法
NTSTATUS DxgkInitialize(
[in] PDRIVER_OBJECT DriverObject,
[in] PUNICODE_STRING RegistryPath,
[in] PDRIVER_INITIALIZATION_DATA DriverInitializationData
);
参数
[in] DriverObject
指向 DRIVER_OBJECT 结构的指针。 显示微型端口驱动程序之前在其 DriverEntry 函数中获取了此指针。
[in] RegistryPath
指向 UNICODE_STRING 结构的指针,该结构提供驱动程序的服务注册表项的路径。 显示微型端口驱动程序之前在其 DRIVER_OBJECT 函数中获取了此指针。
[in] DriverInitializationData
指向 DRIVER_INITIALIZATION_DATA 结构的指针,该结构为 DirectX 图形内核子系统提供指向显示微型端口驱动程序实现的函数的指针。
返回值
DxgkInitialize如果成功,则返回STATUS_SUCCESS;否则,它将返回 Ntstatus.h 中定义的错误代码之一。
注解
显示微型端口驱动程序的 DriverEntry 函数调用 DxgkInitialize。
示例
下面的代码示例演示 DriverEntry 的实现,其中调用 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 = 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);
}
要求
要求 | 值 |
---|---|
最低受支持的客户端 | Windows Vista |
目标平台 | 桌面 |
标头 | dispmprt.h (包括 Dispmprt.h) |
IRQL | PASSIVE_LEVEL |