1 #pragma once 2 3 #include <ddrawint.h> 4 #include <d3dkmthk.h> 5 #include <ddkernel.h> 6 #include <reactos/drivers/directx/directxint.h> 7 #include <reactos/drivers/directx/dxg.h> 8 #include <reactos/drivers/directx/dxeng.h> 9 10 /* From ddraw.c */ 11 NTSTATUS APIENTRY DxDdStartupDxGraphics(ULONG, PDRVENABLEDATA, ULONG, PDRVENABLEDATA, PULONG, PEPROCESS); 12 extern DRVFN gpDxFuncs[]; 13 14 typedef BOOL (APIENTRY* PGD_DDSETGAMMARAMP)(HANDLE, HDC, LPVOID); 15 typedef BOOL (APIENTRY* PGD_DDRELEASEDC)(HANDLE); 16 typedef BOOL (APIENTRY* PGD_DDRESTVISRGN)(HANDLE, HWND); 17 typedef HANDLE (APIENTRY* PGD_DDGETDXHANDLE)(HANDLE, HANDLE, BOOL); 18 typedef HDC (APIENTRY *PGD_DDGETDC)(HANDLE, PALETTEENTRY *); 19 typedef DWORD (APIENTRY *PGD_DXDDREENABLEDIRECTDRAWOBJECT)(HANDLE, BOOL*); 20 typedef DWORD (APIENTRY *PGD_DXDDGETDRIVERINFO)(HANDLE, PDD_GETDRIVERINFODATA); 21 typedef DWORD (APIENTRY *PGD_DXDDSETEXCLUSIVEMODE)(HANDLE, PDD_SETEXCLUSIVEMODEDATA); 22 typedef NTSTATUS (APIENTRY *PGD_DXDDSTARTUPDXGRAPHICS) (ULONG, PDRVENABLEDATA, ULONG, PDRVENABLEDATA, PULONG, PEPROCESS); 23 typedef NTSTATUS (APIENTRY *PGD_DXDDCLEANUPDXGRAPHICS) (VOID); 24 typedef HANDLE (APIENTRY *PGD_DDCREATEDIRECTDRAWOBJECT) (HDC hdc); 25 typedef DWORD (APIENTRY *PGD_DDGETDRIVERSTATE)(PDD_GETDRIVERSTATEDATA); 26 typedef DWORD (APIENTRY *PGD_DDCOLORCONTROL)(HANDLE hSurface,PDD_COLORCONTROLDATA puColorControlData); 27 typedef HANDLE (APIENTRY *PGD_DXDDCREATESURFACEOBJECT)(HANDLE, HANDLE, PDD_SURFACE_LOCAL, PDD_SURFACE_MORE, PDD_SURFACE_GLOBAL, BOOL); 28 typedef BOOL (APIENTRY *PGD_DXDDDELETEDIRECTDRAWOBJECT)(HANDLE); 29 typedef BOOL (APIENTRY *PGD_DXDDDELETESURFACEOBJECT)(HANDLE); 30 typedef DWORD (APIENTRY *PGD_DXDDFLIPTOGDISURFACE)(HANDLE, PDD_FLIPTOGDISURFACEDATA); 31 typedef DWORD (APIENTRY *PGD_DXDDGETAVAILDRIVERMEMORY)(HANDLE , PDD_GETAVAILDRIVERMEMORYDATA); 32 typedef BOOL (APIENTRY *PGD_DXDDQUERYDIRECTDRAWOBJECT)(HANDLE, DD_HALINFO*, DWORD*, LPD3DNTHAL_CALLBACKS, LPD3DNTHAL_GLOBALDRIVERDATA, 33 PDD_D3DBUFCALLBACKS, LPDDSURFACEDESC, DWORD *, VIDEOMEMORY *, DWORD *, DWORD *); 34 35 36 /* From d3d.c */ 37 typedef DWORD (APIENTRY *PGD_DXDDDESTROYD3DBUFFER)(HANDLE); 38 typedef DWORD (APIENTRY *PGD_DDCANCREATED3DBUFFER)(HANDLE, PDD_CANCREATESURFACEDATA); 39 typedef DWORD (APIENTRY *PGD_DXDDUNLOCKD3D)(HANDLE, PDD_UNLOCKDATA); 40 typedef DWORD (APIENTRY *PGD_DXDDLOCKD3D)(HANDLE, PDD_LOCKDATA); 41 typedef DWORD (APIENTRY *PGD_D3DVALIDATETEXTURESTAGESTATE)(LPD3DNTHAL_VALIDATETEXTURESTAGESTATEDATA); 42 typedef DWORD (APIENTRY *PGD_D3DDRAWPRIMITIVES2)(HANDLE, HANDLE, LPD3DNTHAL_DRAWPRIMITIVES2DATA, FLATPTR *, DWORD *, FLATPTR *, DWORD *); 43 typedef DWORD (APIENTRY *PGD_DDCREATED3DBUFFER)(HANDLE, HANDLE *, DDSURFACEDESC *, DD_SURFACE_GLOBAL *, DD_SURFACE_LOCAL *, DD_SURFACE_MORE *, PDD_CREATESURFACEDATA , HANDLE *); 44 typedef BOOL (APIENTRY *PGD_D3DCONTEXTCREATE)(HANDLE, HANDLE, HANDLE, LPD3DNTHAL_CONTEXTCREATEDATA); 45 typedef DWORD (APIENTRY *PGD_D3DCONTEXTDESTROY)(LPD3DNTHAL_CONTEXTDESTROYDATA); 46 typedef DWORD (APIENTRY *PGD_D3DCONTEXTDESTROYALL)(LPD3DNTHAL_CONTEXTDESTROYALLDATA); 47 48 /* From dvp.c */ 49 typedef DWORD (APIENTRY* PGD_DVPCANCREATEVIDEOPORT)(HANDLE, PDD_CANCREATEVPORTDATA); 50 typedef DWORD (APIENTRY* PGD_DVPCOLORCONTROL)(HANDLE, PDD_VPORTCOLORDATA); 51 typedef HANDLE (APIENTRY* PGD_DVPCREATEVIDEOPORT)(HANDLE, PDD_CREATEVPORTDATA); 52 typedef DWORD (APIENTRY* PGD_DVPDESTROYVIDEOPORT)(HANDLE, PDD_DESTROYVPORTDATA); 53 typedef DWORD (APIENTRY* PGD_DVPFLIPVIDEOPORT)(HANDLE,HANDLE,HANDLE,PDD_FLIPVPORTDATA); 54 typedef DWORD (APIENTRY* PGD_DVPGETVIDEOPORTBANDWITH)(HANDLE, PDD_GETVPORTBANDWIDTHDATA); 55 typedef DWORD (APIENTRY *PGD_DXDVPGETVIDEOPORTFLIPSTATUS)(HANDLE, PDD_GETVPORTFLIPSTATUSDATA); 56 typedef DWORD (APIENTRY *PGD_DXDVPGETVIDEOPORTINPUTFORMATS)(HANDLE, PDD_GETVPORTINPUTFORMATDATA); 57 typedef DWORD (APIENTRY *PGD_DXDVPGETVIDEOPORTLINE)(HANDLE, PDD_GETVPORTLINEDATA); 58 typedef DWORD (APIENTRY *PGD_DXDVPGETVIDEOPORTOUTPUTFORMATS)(HANDLE, PDD_GETVPORTOUTPUTFORMATDATA); 59 typedef DWORD (APIENTRY *PGD_DXDVPGETVIDEOPORTCONNECTINFO)(HANDLE, PDD_GETVPORTCONNECTDATA); 60 typedef DWORD (APIENTRY *PGD_DXDVPGETVIDEOSIGNALSTATUS)(HANDLE, PDD_GETVPORTSIGNALDATA); 61 typedef DWORD (APIENTRY *PGD_DXDVPUPDATEVIDEOPORT)(HANDLE, HANDLE*, HANDLE*, PDD_UPDATEVPORTDATA); 62 typedef DWORD (APIENTRY *PGD_DXDVPWAITFORVIDEOPORTSYNC)(HANDLE, PDD_WAITFORVPORTSYNCDATA); 63 typedef DWORD (APIENTRY *PGD_DXDVPACQUIRENOTIFICATION)(HANDLE, HANDLE*, LPDDVIDEOPORTNOTIFY); 64 typedef DWORD (APIENTRY *PGD_DXDVPRELEASENOTIFICATION)(HANDLE, HANDLE); 65 typedef DWORD (APIENTRY *PGD_DXDVPGETVIDEOPORTFIELD)(HANDLE, PDD_GETVPORTFIELDDATA); 66 67 /* From mocomp.c */ 68 typedef DWORD (APIENTRY *PGD_DDBEGINMOCOMPFRAME)(HANDLE, PDD_BEGINMOCOMPFRAMEDATA); 69 typedef HANDLE (APIENTRY *PGD_DXDDCREATEMOCOMP)(HANDLE, PDD_CREATEMOCOMPDATA ); 70 typedef DWORD (APIENTRY *PGD_DXDDDESTROYMOCOMP)(HANDLE, PDD_DESTROYMOCOMPDATA); 71 typedef DWORD (APIENTRY *PGD_DXDDENDMOCOMPFRAME)(HANDLE, PDD_ENDMOCOMPFRAMEDATA); 72 typedef DWORD (APIENTRY *PGD_DXDDGETINTERNALMOCOMPINFO)(HANDLE, PDD_GETINTERNALMOCOMPDATA); 73 typedef DWORD (APIENTRY *PGD_DXDDGETMOCOMPBUFFINFO)(HANDLE, PDD_GETMOCOMPCOMPBUFFDATA); 74 typedef DWORD (APIENTRY *PGD_DXDDGETMOCOMPGUIDS)(HANDLE, PDD_GETMOCOMPGUIDSDATA); 75 typedef DWORD (APIENTRY *PGD_DXDDGETMOCOMPFORMATS)(HANDLE, PDD_GETMOCOMPFORMATSDATA); 76 typedef DWORD (APIENTRY *PGD_DXDDQUERYMOCOMPSTATUS)(HANDLE, PDD_QUERYMOCOMPSTATUSDATA); 77 typedef DWORD (APIENTRY *PGD_DXDDRENDERMOCOMP)(HANDLE, PDD_RENDERMOCOMPDATA); 78 79 /* From dd.c */ 80 typedef DWORD (APIENTRY *PGD_DDCREATESURFACE)(HANDLE, HANDLE *, DDSURFACEDESC *, DD_SURFACE_GLOBAL *, DD_SURFACE_LOCAL *, DD_SURFACE_MORE *, PDD_CREATESURFACEDATA , HANDLE *); 81 typedef DWORD (APIENTRY *PGD_DXDDWAITFORVERTICALBLANK)(HANDLE, PDD_WAITFORVERTICALBLANKDATA); 82 typedef DWORD (APIENTRY *PGD_DDCANCREATESURFACE)(HANDLE hDirectDrawLocal, PDD_CANCREATESURFACEDATA puCanCreateSurfaceData); 83 typedef DWORD (APIENTRY *PGD_DXDDGETSCANLINE)(HANDLE, PDD_GETSCANLINEDATA); 84 typedef DWORD (APIENTRY *PGD_DXDDCREATESURFACEEX)(HANDLE,HANDLE,DWORD); 85 86 /* From ddsurf.c */ 87 typedef DWORD (APIENTRY *PGD_DDALPHABLT)(HANDLE, HANDLE, PDD_BLTDATA); 88 typedef BOOL (APIENTRY *PGD_DDATTACHSURFACE)(HANDLE, HANDLE); 89 typedef DWORD (APIENTRY *PGD_DXDDUNATTACHSURFACE)(HANDLE, HANDLE); 90 typedef DWORD (APIENTRY *PGD_DXDDDESTROYSURFACE)(HANDLE, BOOL); 91 typedef DWORD (APIENTRY *PGD_DXDDFLIP)(HANDLE, HANDLE, HANDLE, HANDLE, PDD_FLIPDATA); 92 typedef DWORD (APIENTRY *PGD_DXDDLOCK)(HANDLE, PDD_LOCKDATA, HDC); 93 typedef DWORD (APIENTRY *PGD_DXDDUNLOCK)(HANDLE, PDD_UNLOCKDATA ); 94 typedef DWORD (APIENTRY *PGD_DDBLT)(HANDLE, HANDLE, PDD_BLTDATA); 95 typedef DWORD (APIENTRY *PGD_DXDDSETCOLORKEY)(HANDLE, PDD_SETCOLORKEYDATA); 96 typedef DWORD (APIENTRY *PGD_DDADDATTACHEDSURFACE)(HANDLE, HANDLE,PDD_ADDATTACHEDSURFACEDATA); 97 typedef DWORD (APIENTRY *PGD_DXDDGETBLTSTATUS)(HANDLE, PDD_GETBLTSTATUSDATA); 98 typedef DWORD (APIENTRY *PGD_DXDDGETFLIPSTATUS)(HANDLE, PDD_GETFLIPSTATUSDATA); 99 typedef DWORD (APIENTRY *PGD_DXDDUPDATEOVERLAY)(HANDLE, HANDLE, PDD_UPDATEOVERLAYDATA); 100 typedef DWORD (APIENTRY *PGD_DXDDSETOVERLAYPOSITION)(HANDLE, HANDLE, PDD_SETOVERLAYPOSITIONDATA); 101 102 /* From eng.c */ 103 typedef FLATPTR (APIENTRY *PGD_HEAPVIDMEMALLOCALIGNED)(LPVIDMEM, DWORD, DWORD, LPSURFACEALIGNMENT, LPLONG); 104 typedef VOID (APIENTRY *PGD_VIDMEMFREE)(LPVMEMHEAP, FLATPTR); 105 typedef PVOID (APIENTRY *PGD_ENGALLOCPRIVATEUSERMEM)(PDD_SURFACE_LOCAL, SIZE_T, ULONG) ; 106 typedef VOID (APIENTRY *PGD_ENGFREEPRIVATEUSERMEM)(PDD_SURFACE_LOCAL, PVOID); 107 typedef PDD_SURFACE_LOCAL (APIENTRY *PGD_ENGLOCKDIRECTDRAWSURFACE)(HANDLE); 108 typedef BOOL (APIENTRY *PGD_ENGUNLOCKDIRECTDRAWSURFACE)(PDD_SURFACE_LOCAL); 109 110 /* Other internal functions */ 111 typedef VOID (APIENTRY *PGD_DXDDDYNAMICMODECHANGE)(HDEV, HDEV, ULONG_PTR); 112 typedef VOID (APIENTRY *PGD_DXDDRESUMEDIRECTDRAW)(HDEV, ULONG_PTR); 113 typedef VOID (APIENTRY *PGD_DXDDSUSPENDDIRECTDRAW)(HDEV, ULONG_PTR); 114 115 /* Gammaramp internal prototype */ 116 BOOL FASTCALL IntGetDeviceGammaRamp(HDEV hPDev, PGAMMARAMP Ramp); 117 BOOL FASTCALL IntSetDeviceGammaRamp(HDEV hPDev, PGAMMARAMP Ramp, BOOL); 118