text: #pragma once
  #include "helper.h"
  
  extern "C"
  DRIVER_INITIALIZE DriverEntry;
  
  //
  // PnP DDIs
  //
  
  VOID
  VioGpuDodUnload(VOID);
  
  // If uncommenting ENABLE_DXGK_SAL in the sources file, all the below function prototypes should be updated to use
  // the function typedef's from the header files. Additionally, annotations on the function definitions can be removed
  // as they are inherited from the prototype definition here. As an example the entire 4-line prototype for BddDdiAddDevice
  // is replaced by the single commented line below:
  // DXGKDDI_ADD_DEVICE BddDdiAddDevice;
  NTSTATUS
  VioGpuDodAddDevice(
      _In_ DEVICE_OBJECT* pPhysicalDeviceObject,
      _Outptr_ PVOID*  ppDeviceContext);
  
  NTSTATUS
  VioGpuDodRemoveDevice(
      _In_  VOID* pDeviceContext);
  
  NTSTATUS
  VioGpuDodStartDevice(
      _In_  VOID*              pDeviceContext,
      _In_  DXGK_START_INFO*   pDxgkStartInfo,
      _In_  DXGKRNL_INTERFACE* pDxgkInterface,
      _Out_ ULONG*             pNumberOfViews,
      _Out_ ULONG*             pNumberOfChildren);
  
  NTSTATUS
  VioGpuDodStopDevice(
      _In_  VOID* pDeviceContext);
  
  VOID
  VioGpuDodResetDevice(
      _In_  VOID* pDeviceContext);
  
  
  NTSTATUS
  VioGpuDodDispatchIoRequest(
      _In_  VOID*                 pDeviceContext,
      _In_  ULONG                 VidPnSourceId,
      _In_  VIDEO_REQUEST_PACKET* pVideoRequestPacket);
  
  NTSTATUS
  VioGpuDodSetPowerState(
      _In_  VOID*              pDeviceContext,
      _In_  ULONG              HardwareUid,
      _In_  DEVICE_POWER_STATE DevicePowerState,
      _In_  POWER_ACTION       ActionType);
  
  NTSTATUS
  VioGpuDodQueryChildRelations(
      _In_                             VOID*                  pDeviceContext,
      _Out_writes_bytes_(ChildRelationsSize) DXGK_CHILD_DESCRIPTOR* pChildRelations,
      _In_                             ULONG                  ChildRelationsSize);
  
  NTSTATUS
  VioGpuDodQueryChildStatus(
      _In_    VOID*              pDeviceContext,
      _Inout_ DXGK_CHILD_STATUS* pChildStatus,
      _In_    BOOLEAN            NonDestructiveOnly);
  
  NTSTATUS
  VioGpuDodQueryDeviceDescriptor(
      _In_  VOID*                     pDeviceContext,
      _In_  ULONG                     ChildUid,
      _Inout_ DXGK_DEVICE_DESCRIPTOR* pDeviceDescriptor);
  
  // Must be Non-Paged
  BOOLEAN
  VioGpuDodInterruptRoutine(
      _In_  VOID* pDeviceContext,
      _In_  ULONG MessageNumber);
  
  VOID
  VioGpuDodDpcRoutine(
      _In_  VOID* pDeviceContext);
  
  //
  // WDDM Display Only Driver DDIs
  //
  
  NTSTATUS
  APIENTRY
  VioGpuDodQueryAdapterInfo(
      _In_ CONST HANDLE                         hAdapter,
      _In_ CONST DXGKARG_QUERYADAPTERINFO*      pQueryAdapterInfo);
  
  NTSTATUS
  APIENTRY
  VioGpuDodSetPointerPosition(
      _In_ CONST HANDLE                         hAdapter,
      _In_ CONST DXGKARG_SETPOINTERPOSITION*    pSetPointerPosition);
  
  NTSTATUS
  APIENTRY
  VioGpuDodSetPointerShape(
      _In_ CONST HANDLE                         hAdapter,
      _In_ CONST DXGKARG_SETPOINTERSHAPE*       pSetPointerShape);
  
  NTSTATUS
  APIENTRY
  VioGpuDodEscape(
      _In_ CONST HANDLE hAdapter,
      _In_ CONST DXGKARG_ESCAPE *pEscape);
  
  NTSTATUS
  VioGpuDodQueryInterface(
      _In_ CONST PVOID                          pDeviceContext,
      _In_ CONST PQUERY_INTERFACE               pQueryInterface);
  
  NTSTATUS
  APIENTRY
  VioGpuDodPresentDisplayOnly(
      _In_ CONST HANDLE                         hAdapter,
      _In_ CONST DXGKARG_PRESENT_DISPLAYONLY*   pPresentDisplayOnly);
  
  NTSTATUS
  APIENTRY
  VioGpuDodIsSupportedVidPn(
      _In_ CONST HANDLE                         hAdapter,
      _Inout_ DXGKARG_ISSUPPORTEDVIDPN*         pIsSupportedVidPn);
  
  NTSTATUS
  APIENTRY
  VioGpuDodRecommendFunctionalVidPn(
      _In_ CONST HANDLE                                   hAdapter,
      _In_ CONST DXGKARG_RECOMMENDFUNCTIONALVIDPN* CONST  pRecommendFunctionalVidPn);
  
  NTSTATUS
  APIENTRY
  VioGpuDodRecommendVidPnTopology(
      _In_ CONST HANDLE                                 hAdapter,
      _In_ CONST DXGKARG_RECOMMENDVIDPNTOPOLOGY* CONST  pRecommendVidPnTopology);
  
  NTSTATUS
  APIENTRY
  VioGpuDodRecommendMonitorModes(
      _In_ CONST HANDLE                                hAdapter,
      _In_ CONST DXGKARG_RECOMMENDMONITORMODES* CONST  pRecommendMonitorModes);
  
  NTSTATUS
  APIENTRY
  VioGpuDodEnumVidPnCofuncModality(
      _In_ CONST HANDLE                                  hAdapter,
      _In_ CONST DXGKARG_ENUMVIDPNCOFUNCMODALITY* CONST  pEnumCofuncModality);
  
  NTSTATUS
  APIENTRY
  VioGpuDodSetVidPnSourceVisibility(
      _In_ CONST HANDLE                             hAdapter,
      _In_ CONST DXGKARG_SETVIDPNSOURCEVISIBILITY*  pSetVidPnSourceVisibility);
  
  NTSTATUS
  APIENTRY
  VioGpuDodCommitVidPn(
      _In_ CONST HANDLE                         hAdapter,
      _In_ CONST DXGKARG_COMMITVIDPN* CONST     pCommitVidPn);
  
  NTSTATUS
  APIENTRY
  VioGpuDodUpdateActiveVidPnPresentPath(
      _In_ CONST HANDLE                                       hAdapter,
      _In_ CONST DXGKARG_UPDATEACTIVEVIDPNPRESENTPATH* CONST  pUpdateActiveVidPnPresentPath);
  
  NTSTATUS
  APIENTRY
  VioGpuDodQueryVidPnHWCapability(
      _In_ CONST HANDLE                         hAdapter,
      _Inout_ DXGKARG_QUERYVIDPNHWCAPABILITY*   pVidPnHWCaps);
  
  NTSTATUS
  APIENTRY
  VioGpuDodStopDeviceAndReleasePostDisplayOwnership(
      _In_  VOID*                          pDeviceContext,
      _In_  D3DDDI_VIDEO_PRESENT_TARGET_ID TargetId,
      _Out_ DXGK_DISPLAY_INFORMATION*      DisplayInfo);
  
  // Must be Non-Paged
  NTSTATUS
  APIENTRY
  VioGpuDodSystemDisplayEnable(
      _In_  VOID* pDeviceContext,
      _In_  D3DDDI_VIDEO_PRESENT_TARGET_ID TargetId,
      _In_  PDXGKARG_SYSTEM_DISPLAY_ENABLE_FLAGS Flags,
      _Out_ UINT* Width,
      _Out_ UINT* Height,
      _Out_ D3DDDIFORMAT* ColorFormat);
  
  // Must be Non-Paged
  VOID
  APIENTRY
  VioGpuDodSystemDisplayWrite(
      _In_  VOID* pDeviceContext,
      _In_  VOID* Source,
      _In_  UINT  SourceWidth,
      _In_  UINT  SourceHeight,
      _In_  UINT  SourceStride,
      _In_  UINT  PositionX,
      _In_  UINT  PositionY);
  
  