ReactOS 0.4.15-dev-8102-g108db8f
ddsurf.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * PURPOSE: Native DirectDraw implementation
5 * FILE: win32ss/reactx/ntddraw/ddsurf.c
6 * PROGRAMER: Magnus Olsen (greatlord@reactos.org)
7 * REVISION HISTORY:
8 * 19/7-2006 Magnus Olsen
9 */
10
11#include <win32k.h>
12
13// #define NDEBUG
14#include <debug.h>
15
16/************************************************************************/
17/* NtGdiDdDestroySurface */
18/************************************************************************/
21NtGdiDdDestroySurface(HANDLE hSurface, BOOL bRealDestroy)
22{
24
25 if (pfnDdDestroySurface == NULL)
26 {
27 DPRINT1("Warning: no pfnDdDestroySurface\n");
29 }
30
31 DPRINT("Calling dxg.sys pfnDdDestroySurface\n");
32 return pfnDdDestroySurface(hSurface, bRealDestroy);
33}
34
35/************************************************************************/
36/* NtGdiDdFlip */
37/************************************************************************/
40NtGdiDdFlip(HANDLE hSurfaceCurrent,
41 HANDLE hSurfaceTarget,
42 HANDLE hSurfaceCurrentLeft,
43 HANDLE hSurfaceTargetLeft,
44 PDD_FLIPDATA puFlipData)
45{
47
48 if (pfnDdDdFlip == NULL)
49 {
50 DPRINT1("Warning: no pfnDdDdFlip\n");
52 }
53
54 DPRINT("Calling dxg.sys pfnDdDdFlip\n");
55 return pfnDdDdFlip(hSurfaceCurrent, hSurfaceTarget, hSurfaceCurrentLeft, hSurfaceTargetLeft, puFlipData);
56}
57
58/************************************************************************/
59/* NtGdiDdUnlock */
60/************************************************************************/
64 PDD_LOCKDATA puLockData,
65 HDC hdcClip)
66{
68
69 if (pfnDdLock == NULL)
70 {
71 DPRINT1("Warning: no pfnDdLock\n");
73 }
74
75 DPRINT("Calling dxg.sys pfnDdLock\n");
76 return pfnDdLock(hSurface, puLockData, hdcClip);
77}
78
79/************************************************************************/
80/* NtGdiDdunlock */
81/************************************************************************/
85 PDD_UNLOCKDATA puUnlockData)
86{
88
89 if (pfnDdUnlock == NULL)
90 {
91 DPRINT1("Warning: no pfnDdUnlock\n");
93 }
94
95 DPRINT("Calling dxg.sys pfnDdUnlock\n");
96 return pfnDdUnlock(hSurface, puUnlockData);
97}
98
99/************************************************************************/
100/* NtGdiDdBlt */
101/************************************************************************/
102DWORD
104NtGdiDdBlt(HANDLE hSurfaceDest,
105 HANDLE hSurfaceSrc,
106 PDD_BLTDATA puBltData)
107{
109
110 if (pfnDdBlt == NULL)
111 {
112 DPRINT1("Warning: no pfnDdBlt\n");
114 }
115
116 DPRINT("Calling dxg.sys pfnDdBlt\n");
117 return pfnDdBlt(hSurfaceDest,hSurfaceSrc,puBltData);
118}
119
120/************************************************************************/
121/* NtGdiDdSetColorKey */
122/************************************************************************/
123DWORD
126 PDD_SETCOLORKEYDATA puSetColorKeyData)
127{
129
130 if (pfnDdSetColorKey == NULL)
131 {
132 DPRINT1("Warning: no pfnDdSetColorKey\n");
134 }
135
136 DPRINT("Calling dxg.sys pfnDdSetColorKey\n");
137 return pfnDdSetColorKey(hSurface,puSetColorKeyData);
138}
139
140/************************************************************************/
141/* NtGdiDdAddAttachedSurface */
142/************************************************************************/
143DWORD
146 HANDLE hSurfaceAttached,
147 PDD_ADDATTACHEDSURFACEDATA puAddAttachedSurfaceData)
148{
150
151 if (pfnDdAddAttachedSurface == NULL)
152 {
153 DPRINT1("Warning: no pfnDdAddAttachedSurface\n");
155 }
156
157 DPRINT("Calling dxg.sys pfnDdAddAttachedSurface\n");
158 return pfnDdAddAttachedSurface(hSurface,hSurfaceAttached,puAddAttachedSurfaceData);
159}
160
161/************************************************************************/
162/* NtGdiDdGetBltStatus */
163/************************************************************************/
164DWORD
167 PDD_GETBLTSTATUSDATA puGetBltStatusData)
168{
170
171 if (pfnDdGetBltStatus == NULL)
172 {
173 DPRINT1("Warning: no pfnDdGetBltStatus\n");
175 }
176
177 DPRINT("Calling dxg.sys pfnDdGetBltStatus\n");
178 return pfnDdGetBltStatus(hSurface,puGetBltStatusData);
179}
180
181/************************************************************************/
182/* NtGdiDdGetFlipStatus */
183/************************************************************************/
184DWORD
187 PDD_GETFLIPSTATUSDATA puGetFlipStatusData)
188{
190
191 if (pfnDdGetFlipStatus == NULL)
192 {
193 DPRINT1("Warning: no pfnDdGetFlipStatus\n");
195 }
196
197 DPRINT("Calling dxg.sys pfnDdGetFlipStatus\n");
198 return pfnDdGetFlipStatus(hSurface,puGetFlipStatusData);
199}
200
201/************************************************************************/
202/* NtGdiDdUpdateOverlay */
203/************************************************************************/
204DWORD
206NtGdiDdUpdateOverlay(HANDLE hSurfaceDestination,
207 HANDLE hSurfaceSource,
208 PDD_UPDATEOVERLAYDATA puUpdateOverlayData)
209{
211
212 if (pfnDdUpdateOverlay == NULL)
213 {
214 DPRINT1("Warning: no pfnDdUpdateOverlay\n");
216 }
217
218 DPRINT("Calling dxg.sys pfnDdUpdateOverlay\n");
219 return pfnDdUpdateOverlay(hSurfaceDestination,hSurfaceSource,puUpdateOverlayData);
220}
221
222/************************************************************************/
223/* NtGdiDdSetOverlayPosition */
224/************************************************************************/
225DWORD
228 HANDLE hSurfaceDestination,
229 PDD_SETOVERLAYPOSITIONDATA puSetOverlayPositionData)
230{
232
233 if (pfnDdSetOverlayPosition == NULL)
234 {
235 DPRINT1("Warning: no pfnDdSetOverlayPosition\n");
237 }
238
239 DPRINT("Calling dxg.sys pfnDdSetOverlayPosition\n");
240 return pfnDdSetOverlayPosition(hSurfaceSource,hSurfaceDestination,puSetOverlayPositionData);
241}
242
243/************************************************************************/
244/* This is not part of the ddsurface interface but it */
245/* deals with the surface */
246/************************************************************************/
247
248
249/************************************************************************/
250/* NtGdiDdAlphaBlt */
251/************************************************************************/
252DWORD
255 HANDLE hSurfaceSrc,
256 PDD_BLTDATA puBltData)
257{
259
260 if (pfnDdAlphaBlt == NULL)
261 {
262 DPRINT1("Warning: no pfnDdAlphaBlt\n");
264 }
265
266 DPRINT("Calling dxg.sys pfnDdAlphaBlt\n");
267 return pfnDdAlphaBlt(hSurfaceDest,hSurfaceSrc,puBltData);
268}
269
270/************************************************************************/
271/* NtGdiDdAttachSurface */
272/************************************************************************/
273BOOL
276 HANDLE hSurfaceTo
277)
278{
280
281 if (pfnDdAttachSurface == NULL)
282 {
283 DPRINT1("Warning: no pfnDdAttachSurface\n");
285 }
286
287 DPRINT("Calling dxg.sys pfnDdAttachSurface\n");
288 return pfnDdAttachSurface(hSurfaceFrom,hSurfaceTo);
289}
290
291/************************************************************************/
292/* NtGdiDdUnattachSurface */
293/************************************************************************/
294/* Note: MSDN protypes is VOID APIENTRY NtGdiDdUnattachSurface(HANDLE hSurface, HANDLE hSurfaceAttached)
295 But it say it return either DDHAL_DRIVER_NOTHANDLED or DDHAL_DRIVER_HANDLED
296 so I guess it is a typo in MSDN for this prototype for the info contradicts itself.
297*/
301 HANDLE hSurfaceAttached)
302{
304 if (pfnDdUnattachSurface == NULL)
305 {
306 DPRINT1("Warning: no pfnDdUnattachSurface\n");
307 //return DDHAL_DRIVER_NOTHANDLED;
309 }
310
311 DPRINT("Calling dxg.sys pfnDdUnattachSurface\n");
312 return pfnDdUnattachSurface(hSurface,hSurfaceAttached);
313}
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define DDHAL_DRIVER_NOTHANDLED
Definition: ddrawi.h:320
#define NULL
Definition: types.h:112
#define APIENTRY
Definition: api.h:79
#define DXG_INDEX_DxDdGetBltStatus
Definition: dxg.h:40
#define DXG_INDEX_DxDdAddAttachedSurface
Definition: dxg.h:17
#define DXG_INDEX_DxDdDestroySurface
Definition: dxg.h:34
#define DXG_INDEX_DxDdSetOverlayPosition
Definition: dxg.h:63
#define DXG_INDEX_DxDdLock
Definition: dxg.h:51
#define DXG_INDEX_DxDdGetFlipStatus
Definition: dxg.h:44
#define DXG_INDEX_DxDdFlip
Definition: dxg.h:37
#define DXG_INDEX_DxDdAttachSurface
Definition: dxg.h:19
#define DXG_INDEX_DxDdAlphaBlt
Definition: dxg.h:18
#define DXG_INDEX_DxDdUpdateOverlay
Definition: dxg.h:68
#define DXG_INDEX_DxDdUnattachSurface
Definition: dxg.h:64
#define DXG_INDEX_DxDdSetColorKey
Definition: dxg.h:59
#define DXG_INDEX_DxDdBlt
Definition: dxg.h:21
#define DXG_INDEX_DxDdUnlock
Definition: dxg.h:66
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD(APIENTRY * PGD_DXDDGETBLTSTATUS)(HANDLE, PDD_GETBLTSTATUSDATA)
Definition: intddraw.h:97
DWORD(APIENTRY * PGD_DXDDSETOVERLAYPOSITION)(HANDLE, HANDLE, PDD_SETOVERLAYPOSITIONDATA)
Definition: intddraw.h:100
DWORD(APIENTRY * PGD_DXDDLOCK)(HANDLE, PDD_LOCKDATA, HDC)
Definition: intddraw.h:92
DWORD(APIENTRY * PGD_DXDDUNATTACHSURFACE)(HANDLE, HANDLE)
Definition: intddraw.h:89
DWORD(APIENTRY * PGD_DDBLT)(HANDLE, HANDLE, PDD_BLTDATA)
Definition: intddraw.h:94
DWORD(APIENTRY * PGD_DXDDUPDATEOVERLAY)(HANDLE, HANDLE, PDD_UPDATEOVERLAYDATA)
Definition: intddraw.h:99
DWORD(APIENTRY * PGD_DXDDSETCOLORKEY)(HANDLE, PDD_SETCOLORKEYDATA)
Definition: intddraw.h:95
BOOL(APIENTRY * PGD_DDATTACHSURFACE)(HANDLE, HANDLE)
Definition: intddraw.h:88
DWORD(APIENTRY * PGD_DDALPHABLT)(HANDLE, HANDLE, PDD_BLTDATA)
Definition: intddraw.h:87
DWORD(APIENTRY * PGD_DXDDUNLOCK)(HANDLE, PDD_UNLOCKDATA)
Definition: intddraw.h:93
DWORD(APIENTRY * PGD_DXDDFLIP)(HANDLE, HANDLE, HANDLE, HANDLE, PDD_FLIPDATA)
Definition: intddraw.h:91
DWORD(APIENTRY * PGD_DXDDGETFLIPSTATUS)(HANDLE, PDD_GETFLIPSTATUSDATA)
Definition: intddraw.h:98
DWORD(APIENTRY * PGD_DXDDDESTROYSURFACE)(HANDLE, BOOL)
Definition: intddraw.h:90
DWORD(APIENTRY * PGD_DDADDATTACHEDSURFACE)(HANDLE, HANDLE, PDD_ADDATTACHEDSURFACEDATA)
Definition: intddraw.h:96
static HDC
Definition: imagelist.c:92
DWORD APIENTRY NtGdiDdSetOverlayPosition(HANDLE hSurfaceSource, HANDLE hSurfaceDestination, PDD_SETOVERLAYPOSITIONDATA puSetOverlayPositionData)
Definition: ddsurf.c:227
DWORD APIENTRY NtGdiDdFlip(HANDLE hSurfaceCurrent, HANDLE hSurfaceTarget, HANDLE hSurfaceCurrentLeft, HANDLE hSurfaceTargetLeft, PDD_FLIPDATA puFlipData)
Definition: ddsurf.c:40
DWORD APIENTRY NtGdiDdGetBltStatus(HANDLE hSurface, PDD_GETBLTSTATUSDATA puGetBltStatusData)
Definition: ddsurf.c:166
DWORD APIENTRY NtGdiDdAlphaBlt(HANDLE hSurfaceDest, HANDLE hSurfaceSrc, PDD_BLTDATA puBltData)
Definition: ddsurf.c:254
DWORD APIENTRY NtGdiDdSetColorKey(HANDLE hSurface, PDD_SETCOLORKEYDATA puSetColorKeyData)
Definition: ddsurf.c:125
DWORD APIENTRY NtGdiDdLock(HANDLE hSurface, PDD_LOCKDATA puLockData, HDC hdcClip)
Definition: ddsurf.c:63
DWORD APIENTRY NtGdiDdUnlock(HANDLE hSurface, PDD_UNLOCKDATA puUnlockData)
Definition: ddsurf.c:84
DWORD APIENTRY NtGdiDdGetFlipStatus(HANDLE hSurface, PDD_GETFLIPSTATUSDATA puGetFlipStatusData)
Definition: ddsurf.c:186
DWORD APIENTRY NtGdiDdUpdateOverlay(HANDLE hSurfaceDestination, HANDLE hSurfaceSource, PDD_UPDATEOVERLAYDATA puUpdateOverlayData)
Definition: ddsurf.c:206
BOOL APIENTRY NtGdiDdAttachSurface(HANDLE hSurfaceFrom, HANDLE hSurfaceTo)
Definition: ddsurf.c:275
DWORD APIENTRY NtGdiDdAddAttachedSurface(HANDLE hSurface, HANDLE hSurfaceAttached, PDD_ADDATTACHEDSURFACEDATA puAddAttachedSurfaceData)
Definition: ddsurf.c:145
DWORD APIENTRY NtGdiDdBlt(HANDLE hSurfaceDest, HANDLE hSurfaceSrc, PDD_BLTDATA puBltData)
Definition: ddsurf.c:104
DWORD APIENTRY NtGdiDdDestroySurface(HANDLE hSurface, BOOL bRealDestroy)
Definition: ddsurf.c:21
NTSTATUS APIENTRY NtGdiDdUnattachSurface(HANDLE hSurface, HANDLE hSurfaceAttached)
Definition: ddsurf.c:300
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239
#define DPRINT
Definition: sndvol32.h:73
DRVFN gpDxFuncs[DXG_INDEX_DxDdIoctl+1]
Definition: ddraw.c:24