1c2c66affSColin Finck /*
2c2c66affSColin Finck * COPYRIGHT: See COPYING in the top level directory
3c2c66affSColin Finck * PROJECT: ReactOS kernel
4c2c66affSColin Finck * PURPOSE: Native DirectDraw implementation
5c2c66affSColin Finck * FILE: win32ss/reactx/ntddraw/dd.c
6c2c66affSColin Finck * PROGRAMER: Magnus Olsen (greatlord@reactos.org)
7c2c66affSColin Finck * REVISION HISTORY:
8c2c66affSColin Finck * 19/1-2006 Magnus Olsen
9c2c66affSColin Finck */
10c2c66affSColin Finck
11c2c66affSColin Finck #include <win32k.h>
12*24757e30SSerge Gautherie
13*24757e30SSerge Gautherie // #define NDEBUG
14c2c66affSColin Finck #include <debug.h>
15c2c66affSColin Finck
16c2c66affSColin Finck /************************************************************************/
17c2c66affSColin Finck /* NtGdiDdCreateSurface */
18c2c66affSColin Finck /************************************************************************/
19c2c66affSColin Finck DWORD
20c2c66affSColin Finck APIENTRY
NtGdiDdCreateSurface(HANDLE hDirectDrawLocal,HANDLE * hSurface,DDSURFACEDESC * puSurfaceDescription,DD_SURFACE_GLOBAL * puSurfaceGlobalData,DD_SURFACE_LOCAL * puSurfaceLocalData,DD_SURFACE_MORE * puSurfaceMoreData,PDD_CREATESURFACEDATA puCreateSurfaceData,HANDLE * puhSurface)21c2c66affSColin Finck NtGdiDdCreateSurface(HANDLE hDirectDrawLocal,
22c2c66affSColin Finck HANDLE *hSurface,
23c2c66affSColin Finck DDSURFACEDESC *puSurfaceDescription,
24c2c66affSColin Finck DD_SURFACE_GLOBAL *puSurfaceGlobalData,
25c2c66affSColin Finck DD_SURFACE_LOCAL *puSurfaceLocalData,
26c2c66affSColin Finck DD_SURFACE_MORE *puSurfaceMoreData,
27c2c66affSColin Finck PDD_CREATESURFACEDATA puCreateSurfaceData,
28c2c66affSColin Finck HANDLE *puhSurface)
29c2c66affSColin Finck {
30c2c66affSColin Finck PGD_DDCREATESURFACE pfnDdCreateSurface = (PGD_DDCREATESURFACE)gpDxFuncs[DXG_INDEX_DxDdCreateSurface].pfn;
31c2c66affSColin Finck
32c2c66affSColin Finck if (pfnDdCreateSurface == NULL)
33c2c66affSColin Finck {
34c2c66affSColin Finck DPRINT1("Warning: no pfnDdCreateSurface\n");
35c2c66affSColin Finck return DDHAL_DRIVER_NOTHANDLED;
36c2c66affSColin Finck }
37c2c66affSColin Finck
38*24757e30SSerge Gautherie DPRINT("Calling dxg.sys pfnDdCreateSurface\n");
39c2c66affSColin Finck return pfnDdCreateSurface(hDirectDrawLocal,hSurface,puSurfaceDescription,puSurfaceGlobalData,
40c2c66affSColin Finck puSurfaceLocalData,puSurfaceMoreData,puCreateSurfaceData,puhSurface);
41c2c66affSColin Finck }
42c2c66affSColin Finck
43c2c66affSColin Finck /************************************************************************/
44c2c66affSColin Finck /* NtGdiDdWaitForVerticalBlank */
45c2c66affSColin Finck /************************************************************************/
46c2c66affSColin Finck DWORD
47c2c66affSColin Finck APIENTRY
NtGdiDdWaitForVerticalBlank(HANDLE hDirectDraw,PDD_WAITFORVERTICALBLANKDATA puWaitForVerticalBlankData)48c2c66affSColin Finck NtGdiDdWaitForVerticalBlank(HANDLE hDirectDraw,
49c2c66affSColin Finck PDD_WAITFORVERTICALBLANKDATA puWaitForVerticalBlankData)
50c2c66affSColin Finck {
51c2c66affSColin Finck PGD_DXDDWAITFORVERTICALBLANK pfnDdWaitForVerticalBlank = (PGD_DXDDWAITFORVERTICALBLANK)gpDxFuncs[DXG_INDEX_DxDdWaitForVerticalBlank].pfn;
52c2c66affSColin Finck
53c2c66affSColin Finck if (pfnDdWaitForVerticalBlank == NULL)
54c2c66affSColin Finck {
55c2c66affSColin Finck DPRINT1("Warning: no pfnDdWaitForVerticalBlank\n");
56c2c66affSColin Finck return DDHAL_DRIVER_NOTHANDLED;
57c2c66affSColin Finck }
58c2c66affSColin Finck
59*24757e30SSerge Gautherie DPRINT("Calling dxg.sys pfnDdWaitForVerticalBlank\n");
60c2c66affSColin Finck return pfnDdWaitForVerticalBlank(hDirectDraw, puWaitForVerticalBlankData);
61c2c66affSColin Finck }
62c2c66affSColin Finck
63c2c66affSColin Finck /************************************************************************/
64c2c66affSColin Finck /* NtGdiDdCanCreateSurface */
65c2c66affSColin Finck /************************************************************************/
66c2c66affSColin Finck DWORD
67c2c66affSColin Finck APIENTRY
NtGdiDdCanCreateSurface(HANDLE hDirectDrawLocal,PDD_CANCREATESURFACEDATA puCanCreateSurfaceData)68c2c66affSColin Finck NtGdiDdCanCreateSurface(HANDLE hDirectDrawLocal,
69c2c66affSColin Finck PDD_CANCREATESURFACEDATA puCanCreateSurfaceData)
70c2c66affSColin Finck {
71c2c66affSColin Finck PGD_DDCANCREATESURFACE pfnDdCanCreateSurface = (PGD_DDCANCREATESURFACE)gpDxFuncs[DXG_INDEX_DxDdCanCreateSurface].pfn;
72c2c66affSColin Finck
73c2c66affSColin Finck if (pfnDdCanCreateSurface == NULL)
74c2c66affSColin Finck {
75c2c66affSColin Finck DPRINT1("Warning: no pfnDdCanCreateSurface\n");
76c2c66affSColin Finck return DDHAL_DRIVER_NOTHANDLED;
77c2c66affSColin Finck }
78c2c66affSColin Finck
79*24757e30SSerge Gautherie DPRINT("Calling dxg.sys pfnDdCanCreateSurface\n");
80c2c66affSColin Finck
81c2c66affSColin Finck return pfnDdCanCreateSurface(hDirectDrawLocal,puCanCreateSurfaceData);
82c2c66affSColin Finck }
83c2c66affSColin Finck
84c2c66affSColin Finck /************************************************************************/
85c2c66affSColin Finck /* NtGdiDdGetScanLine */
86c2c66affSColin Finck /************************************************************************/
87c2c66affSColin Finck DWORD
88c2c66affSColin Finck APIENTRY
NtGdiDdGetScanLine(HANDLE hDirectDrawLocal,PDD_GETSCANLINEDATA puGetScanLineData)89c2c66affSColin Finck NtGdiDdGetScanLine(HANDLE hDirectDrawLocal,
90c2c66affSColin Finck PDD_GETSCANLINEDATA puGetScanLineData)
91c2c66affSColin Finck {
92c2c66affSColin Finck PGD_DXDDGETSCANLINE pfnDdGetScanLine = (PGD_DXDDGETSCANLINE)gpDxFuncs[DXG_INDEX_DxDdGetScanLine].pfn;
93c2c66affSColin Finck
94c2c66affSColin Finck if (pfnDdGetScanLine == NULL)
95c2c66affSColin Finck {
96c2c66affSColin Finck DPRINT1("Warning: no pfnDdGetScanLine\n");
97c2c66affSColin Finck return DDHAL_DRIVER_NOTHANDLED;
98c2c66affSColin Finck }
99c2c66affSColin Finck
100*24757e30SSerge Gautherie DPRINT("Calling dxg.sys pfnDdGetScanLine\n");
101c2c66affSColin Finck
102c2c66affSColin Finck return pfnDdGetScanLine(hDirectDrawLocal,puGetScanLineData);
103c2c66affSColin Finck }
104c2c66affSColin Finck
105c2c66affSColin Finck
106c2c66affSColin Finck /************************************************************************/
107c2c66affSColin Finck /* This is not part of the ddsurface interface but it */
108c2c66affSColin Finck /* deals with the surface */
109c2c66affSColin Finck /************************************************************************/
110c2c66affSColin Finck
111c2c66affSColin Finck /************************************************************************/
112c2c66affSColin Finck /* NtGdiDdCreateSurfaceEx */
113c2c66affSColin Finck /************************************************************************/
114c2c66affSColin Finck DWORD
115c2c66affSColin Finck APIENTRY
NtGdiDdCreateSurfaceEx(HANDLE hDirectDraw,HANDLE hSurface,DWORD dwSurfaceHandle)116c2c66affSColin Finck NtGdiDdCreateSurfaceEx(HANDLE hDirectDraw,
117c2c66affSColin Finck HANDLE hSurface,
118c2c66affSColin Finck DWORD dwSurfaceHandle)
119c2c66affSColin Finck {
120c2c66affSColin Finck PGD_DXDDCREATESURFACEEX pfnDdCreateSurfaceEx = (PGD_DXDDCREATESURFACEEX)gpDxFuncs[DXG_INDEX_DxDdCreateSurfaceEx].pfn;
121c2c66affSColin Finck
122c2c66affSColin Finck if (pfnDdCreateSurfaceEx == NULL)
123c2c66affSColin Finck {
124c2c66affSColin Finck DPRINT1("Warning: no pfnDdCreateSurfaceEx\n");
125c2c66affSColin Finck return DDHAL_DRIVER_NOTHANDLED;
126c2c66affSColin Finck }
127c2c66affSColin Finck
128*24757e30SSerge Gautherie DPRINT("Calling dxg.sys pfnDdCreateSurfaceEx\n");
129c2c66affSColin Finck return pfnDdCreateSurfaceEx(hDirectDraw,hSurface,dwSurfaceHandle);
130c2c66affSColin Finck }
131