ReactOS  0.4.14-dev-317-g96040ec
ddraw.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/ddraw.c
6  * PROGRAMER: Magnus olsen (magnus@greatlord.com)
7  * REVISION HISTORY:
8  * 19/1-2006 Magnus Olsen
9  */
10 
11 #include <win32k.h>
12 #include <debug.h>
13 
16 
17 /* export from dxeng.c */
18 extern DRVFN gaEngFuncs[];
19 extern ULONG gcEngFuncs;
21 
22 
26 
27 #define DXDBG 1
28 
29 /************************************************************************/
30 /* DirectX graphic/video driver enable start here */
31 /************************************************************************/
32 BOOL
34 {
36  PEPROCESS Proc = NULL;
37  PDC pDC = NULL;
38  PPDEVOBJ pDev = NULL;
39  PGD_DXDDENABLEDIRECTDRAW pfnDdEnableDirectDraw = NULL;
40  BOOL success = FALSE;
41 
42  /* FIXME: Get the process data */
43 
44  /* Do not try load dxg.sys when it have already been load once */
46  {
48  if (!NT_SUCCESS(Status))
49  {
50  DPRINT1("Warning: Failed to create the directx interface\n");
51  return FALSE;
52  }
53  }
54 
55  pDC = DC_LockDc(hdc);
56  if (pDC == NULL)
57  {
58  DPRINT1("Warning: Failed to lock hdc\n");
59  return FALSE;
60  }
61 
62  pDev = pDC->ppdev;
63 
64  /* Test and see if drv got a DX interface or not */
65  if ( ( pDev->DriverFunctions.DisableDirectDraw == NULL) ||
67  {
68  DPRINT1("Warning : DisableDirectDraw and EnableDirectDraw are NULL, no dx driver \n");
69  }
70  else
71  {
72 
73  /* Check and see if DX has been enabled or not */
74  if ( pDev->pEDDgpl->pvmList == NULL)
75  {
76  pDev->pEDDgpl->ddCallbacks.dwSize = sizeof(DD_CALLBACKS);
77  pDev->pEDDgpl->ddSurfaceCallbacks.dwSize = sizeof(DD_SURFACECALLBACKS);
78  pDev->pEDDgpl->ddPaletteCallbacks.dwSize = sizeof(DD_PALETTECALLBACKS);
79 
81  if (pfnDdEnableDirectDraw == NULL)
82  {
83  DPRINT1("Warning: no pfnDdEnableDirectDraw\n");
84  }
85  else
86  {
87  DPRINT1(" call to pfnDdEnableDirectDraw \n ");
88 
89  /* Note: it is the hdev struct it wants, not the drv hPDev aka pdc->PDev */
90  success = pfnDdEnableDirectDraw(pDC->ppdev, TRUE);
91  }
92  }
93  else
94  {
95  DPRINT1(" The dxg.sys and graphic card driver interface is enabled \n ");
96  success = TRUE;
97  }
98  }
99 
100 
101  DPRINT1("Return value : 0x%08x\n",success);
102  DC_UnlockDc(pDC);
103  DPRINT1(" end call to pfnDdEnableDirectDraw \n ");
104  return success;
105 }
106 
107 /************************************************************************/
108 /* DirectX graphic/video driver enable ends here */
109 /************************************************************************/
110 
111 /************************************************************************/
112 /* DirectX graphic/video driver loading and cleanup starts here */
113 /************************************************************************/
114 NTSTATUS
115 APIENTRY
117  PDRVENABLEDATA DxEngDrvOld,
118  ULONG ulc2,
119  PDRVENABLEDATA DxgDrvOld,
120  PULONG DirectDrawContext,
121  PEPROCESS Proc)
122 {
123  DRVENABLEDATA DxEngDrv;
124  DRVENABLEDATA DxgDrv;
125 
127 
128  /* FIXME: Setup of gaEngFuncs driver export list
129  * but not in this api, we can add it here tempary until we figout where
130  * no code have been writen for it yet
131  */
132 
133 
134  /* FIXME: ReactOS does not loading the dxapi.sys or import functions from it yet */
135  // DxApiGetVersion()
136 
137  /* Loading the kernel interface of DirectX for win32k */
138 
139  DPRINT1("Warning: trying loading xp/2003/windows7/reactos dxg.sys\n");
140  ghDxGraphics = EngLoadImage(L"\\SystemRoot\\System32\\drivers\\dxg.sys");
141  if ( ghDxGraphics == NULL)
142  {
144  DPRINT1("Warning: no ReactX or DirectX kernel driver found\n");
145  }
146  else
147  {
148  /* Import DxDdStartupDxGraphics and DxDdCleanupDxGraphics */
151 
152  if ((gpfnStartupDxGraphics) &&
154  {
155  /* Setup driver data for activate the dx interface */
157  DxEngDrv.pdrvfn = gaEngFuncs;
158  DxEngDrv.c = gcEngFuncs;
159 
161  &DxEngDrv,
162  sizeof(DRVENABLEDATA),
163  &DxgDrv,
165  Proc );
166  }
167 
168  /* Check if we manage loading the data and execute the dxStartupDxGraphics if it is successful */
169  if (!NT_SUCCESS(Status))
170  {
173  if (ghDxGraphics != NULL)
174  {
176  ghDxGraphics = NULL;
177  }
178  DPRINT1("Warning: DirectX graphics interface can not be initialized\n");
179  }
180  else
181  {
182  /* Sort the drv functions list in index order, this allows us doing, smaller optimize
183  * in API that are redirect to dx.sys
184  */
185 
186  PDRVFN lstDrvFN = DxgDrv.pdrvfn;
187  INT t;
188  for (t=0;t<=DXG_INDEX_DxDdIoctl;t++)
189  {
190  gpDxFuncs[lstDrvFN[t].iFunc].iFunc =lstDrvFN[t].iFunc;
191  gpDxFuncs[lstDrvFN[t].iFunc].pfn =lstDrvFN[t].pfn;
192  }
193 
194  DPRINT1("DirectX interface is activated\n");
195 
196  }
197  /* Return the status */
198  }
199 
200  return Status;
201 }
202 
203 /************************************************************************/
204 /* DirectX graphic/video driver loading cleanup ends here */
205 /************************************************************************/
206 
207 /************************************************************************/
208 /* NtGdiDdCreateDirectDrawObject */
209 /************************************************************************/
210 HANDLE
211 APIENTRY
213 {
214  PGD_DDCREATEDIRECTDRAWOBJECT pfnDdCreateDirectDrawObject;
215 
216  if (hdc == NULL)
217  {
218  DPRINT1("Warning: hdc is NULL\n");
219  return 0;
220  }
221 
222  /* FIXME: This should be alloc for each drv and use it from each drv, not global for whole win32k */
224  {
225  DPRINT1("Warning: Failed to start the DirectX interface from the graphic driver\n");
227  }
228 
229  /* Get the pfnDdCreateDirectDrawObject after we load the drv */
231 
232  if (pfnDdCreateDirectDrawObject == NULL)
233  {
234  DPRINT1("Warning: no pfnDdCreateDirectDrawObject\n");
236  }
237 
238  DPRINT1("Calling dxg.sys DdCreateDirectDrawObject\n");
239 
240  return pfnDdCreateDirectDrawObject(hdc);
241 }
242 
243 /*++
244 * @name NtGdiDxgGenericThunk
245 * @implemented
246 *
247 * The function NtGdiDxgGenericThunk redirects DirectX calls to another function.
248 * It redirects to dxg.sys in Windows XP/2003, dxkrnl.sys in Vista and is fully implemented in win32k.sys in Windows 2000 and below
249 *
250 * @param ULONG_PTR ulIndex
251 * The functions we want to redirect
252 *
253 * @param ULONG_PTR ulHandle
254 * Unknown
255 *
256 * @param SIZE_T *pdwSizeOfPtr1
257 * Unknown
258 *
259 * @param PVOID pvPtr1
260 * Unknown
261 *
262 * @param SIZE_T *pdwSizeOfPtr2
263 * Unknown
264 *
265 * @param PVOID pvPtr2
266 * Unknown
267 *
268 * @return
269 * Always returns DDHAL_DRIVER_NOTHANDLED
270 *
271 * @remarks.
272 * dxg.sys NtGdiDxgGenericThunk calls are redirected to dxg.sys
273 * This function is no longer used but is still present in Windows NT 2000/XP/2003.
274 *
275 *--*/
276 DWORD
277 APIENTRY
279  ULONG_PTR ulHandle,
280  SIZE_T *pdwSizeOfPtr1,
281  PVOID pvPtr1,
282  SIZE_T *pdwSizeOfPtr2,
283  PVOID pvPtr2)
284 {
286 
287  if (pfnDxgGenericThunk == NULL)
288  {
289  DPRINT1("Warning: no pfnDxgGenericThunk\n");
291  }
292 
293  DPRINT1("Calling dxg.sys pfnDxgGenericThunk\n");
294  return pfnDxgGenericThunk(ulIndex, ulHandle, pdwSizeOfPtr1, pvPtr1, pdwSizeOfPtr2, pvPtr2);
295 }
296 
297 /************************************************************************/
298 /* NtGdiDdGetDriverState */
299 /************************************************************************/
300 DWORD
301 APIENTRY
303 {
305 
306  if (pfnDdGetDriverState == NULL)
307  {
308  DPRINT1("Warning: no pfnDdGetDriverState\n");
310  }
311 
312  DPRINT1("Calling dxg.sys DdGetDriverState\n");
313  return pfnDdGetDriverState(pdata);
314 }
315 
316 /************************************************************************/
317 /* NtGdiDdColorControl */
318 /************************************************************************/
319 DWORD
320 APIENTRY
322  PDD_COLORCONTROLDATA puColorControlData)
323 {
325 
326  if (pfnDdColorControl == NULL)
327  {
328  DPRINT1("Warning: no pfnDdColorControl\n");
330  }
331 
332  DPRINT1("Calling dxg.sys DdColorControl\n");
333  return pfnDdColorControl(hSurface,puColorControlData);
334 }
335 
336 /************************************************************************/
337 /* NtGdiDdCreateSurfaceObject */
338 /************************************************************************/
339 HANDLE
340 APIENTRY
342  HANDLE hSurface,
343  PDD_SURFACE_LOCAL puSurfaceLocal,
344  PDD_SURFACE_MORE puSurfaceMore,
345  PDD_SURFACE_GLOBAL puSurfaceGlobal,
346  BOOL bComplete
347 )
348 {
350 
351  if (pfnDdCreateSurfaceObject == NULL)
352  {
353  DPRINT1("Warning: no pfnDdCreateSurfaceObject\n");
355  }
356 
357  DPRINT1("Calling dxg.sys pfnDdCreateSurfaceObject\n");
358  return pfnDdCreateSurfaceObject(hDirectDrawLocal, hSurface, puSurfaceLocal, puSurfaceMore, puSurfaceGlobal, bComplete);
359 }
360 
361 /************************************************************************/
362 /* NtGdiDdDeleteDirectDrawObject */
363 /************************************************************************/
364 BOOL
365 APIENTRY
367 {
369 
370  if (pfnDdDeleteDirectDrawObject == NULL)
371  {
372  DPRINT1("Warning: no pfnDdDeleteDirectDrawObject\n");
373  return FALSE;
374  }
375 
376  if (hDirectDrawLocal == NULL)
377  {
378  DPRINT1("Warning: hDirectDrawLocal is NULL\n");
379  return FALSE;
380  }
381 
382  DPRINT1("hDirectDrawLocal = %p \n", hDirectDrawLocal);
383  DPRINT1("Calling dxg.sys pfnDdDeleteDirectDrawObject\n");
384 
385  return pfnDdDeleteDirectDrawObject(hDirectDrawLocal);
386 }
387 
388 /************************************************************************/
389 /* NtGdiDdDeleteSurfaceObject */
390 /************************************************************************/
391 BOOL
392 APIENTRY
394 {
396 
397  if (pfnDdDeleteSurfaceObject == NULL)
398  {
399  DPRINT1("Warning: no pfnDdDeleteSurfaceObject\n");
401  }
402  /* Try and see if the handle is valid */
403 
404  DPRINT1("Calling dxg.sys DdDeleteSurfaceObject\n");
405  return pfnDdDeleteSurfaceObject(hSurface);
406 }
407 
408 /************************************************************************/
409 /* NtGdiDdQueryDirectDrawObject */
410 /************************************************************************/
411 BOOL
412 APIENTRY
415  DWORD *pCallBackFlags,
416  LPD3DNTHAL_CALLBACKS puD3dCallbacks,
417  LPD3DNTHAL_GLOBALDRIVERDATA puD3dDriverData,
418  PDD_D3DBUFCALLBACKS puD3dBufferCallbacks,
419  LPDDSURFACEDESC puD3dTextureFormats,
420  DWORD *puNumHeaps,
421  VIDEOMEMORY *puvmList,
422  DWORD *puNumFourCC,
423  DWORD *puFourCC)
424 {
426 
427  if (pfnDdQueryDirectDrawObject == NULL)
428  {
429  DPRINT1("Warning: no pfnDdQueryDirectDrawObject\n");
431  }
432 
433  DPRINT1("Calling dxg.sys pfnDdQueryDirectDrawObject\n");
434 
435 
436  return pfnDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData,
437  puD3dBufferCallbacks, puD3dTextureFormats, puNumHeaps, puvmList, puNumFourCC, puFourCC);
438 
439 }
440 
441 
442 /************************************************************************/
443 /* NtGdiDdReenableDirectDrawObject */
444 /************************************************************************/
445 BOOL
446 APIENTRY
448  BOOL *pubNewMode)
449 {
450 #if DXDBG
451  BOOL status = FALSE;
452 #endif
454 
455  if (pfnDdReenableDirectDrawObject == NULL)
456  {
457  DPRINT1("Warning: no pfnDdReenableDirectDrawObject\n");
459  }
460 
461  DPRINT1("Calling dxg.sys pfnDdReenableDirectDrawObject\n");
462 
463 #if DXDBG
464  status = pfnDdReenableDirectDrawObject(hDirectDrawLocal, pubNewMode);
465  DPRINT1("end Calling dxg.sys pfnDdReenableDirectDrawObject\n");
466  DPRINT1("return value : 0x%08x\n", status);
467  return status;
468 #else
469  return pfnDdReenableDirectDrawObject(hDirectDrawLocal, pubNewMode);
470 #endif
471 }
472 
473 
474 /************************************************************************/
475 /* NtGdiDdGetDriverInfo */
476 /************************************************************************/
477 DWORD
478 APIENTRY
479 NtGdiDdGetDriverInfo(HANDLE hDirectDrawLocal,
480  PDD_GETDRIVERINFODATA puGetDriverInfoData)
481 
482 {
484 
485  if (pfnDdGetDriverInfo == NULL)
486  {
487  DPRINT1("Warning: no pfnDdGetDriverInfo\n");
489  }
490 
491  DPRINT1("Calling dxg.sys pfnDdGetDriverInfo\n");
492  return pfnDdGetDriverInfo(hDirectDrawLocal, puGetDriverInfoData);
493 }
494 
495 
496 /************************************************************************/
497 /* NtGdiDdGetAvailDriverMemory */
498 /************************************************************************/
499 DWORD
500 APIENTRY
502  PDD_GETAVAILDRIVERMEMORYDATA puGetAvailDriverMemoryData)
503 {
505 
506  if (pfnDdGetAvailDriverMemory == NULL)
507  {
508  DPRINT1("Warning: no pfnDdGetAvailDriverMemory\n");
510  }
511 
512  DPRINT1("Calling dxg.sys pfnDdGetAvailDriverMemory\n");
513  return pfnDdGetAvailDriverMemory(hDirectDrawLocal, puGetAvailDriverMemoryData);
514 }
515 
516 
517 /************************************************************************/
518 /* NtGdiDdSetExclusiveMode */
519 /************************************************************************/
520 
521 DWORD
522 APIENTRY
524  PDD_SETEXCLUSIVEMODEDATA puSetExclusiveModeData)
525 {
527 
528  if (pfnDdSetExclusiveMode == NULL)
529  {
530  DPRINT1("Warning: no pfnDdSetExclusiveMode\n");
532  }
533 
534  DPRINT1("Calling dxg.sys pfnDdSetExclusiveMode\n");
535  return pfnDdSetExclusiveMode(hDirectDraw, puSetExclusiveModeData);
536 
537 }
538 
539 
540 /************************************************************************/
541 /* NtGdiDdFlipToGDISurface */
542 /************************************************************************/
543 DWORD
544 APIENTRY
546  PDD_FLIPTOGDISURFACEDATA puFlipToGDISurfaceData)
547 {
549 
550  if (pfnDdFlipToGDISurface == NULL)
551  {
552  DPRINT1("Warning: no pfnDdFlipToGDISurface\n");
554  }
555 
556  DPRINT1("Calling dxg.sys pfnDdFlipToGDISurface\n");
557  return pfnDdFlipToGDISurface(hDirectDraw, puFlipToGDISurfaceData);
558 
559 }
560 
561 /************************************************************************/
562 /* NtGdiDdGetDC */
563 /************************************************************************/
564 HDC
565 APIENTRY
567  PALETTEENTRY *puColorTable)
568 {
570 
571  if (pfnDdGetDC == NULL)
572  {
573  DPRINT1("Warning: no pfnDdGetDC\n");
575  }
576 
577  DPRINT1("Calling dxg.sys pfnDdGetDC\n");
578  return pfnDdGetDC(hSurface, puColorTable);
579 }
580 
581 /************************************************************************/
582 /* NtGdiDdGetDxHandle */
583 /************************************************************************/
584 HANDLE
585 APIENTRY
587  HANDLE hSurface,
588  BOOL bRelease)
589 {
591 
592  if (pfnDdGetDxHandle == NULL)
593  {
594  DPRINT1("Warning: no pfnDdGetDxHandle\n");
596  }
597 
598  DPRINT1("Calling dxg.sys pfnDdGetDxHandle\n");
599  return pfnDdGetDxHandle(hDirectDraw, hSurface, bRelease);
600 }
601 
602 
603 /************************************************************************/
604 /* NtGdiDdReleaseDC */
605 /************************************************************************/
606 BOOL
607 APIENTRY
609 {
611 
612  if (pfnDdReleaseDC == NULL)
613  {
614  DPRINT1("Warning: no pfnDdReleaseDC\n");
616  }
617 
618  DPRINT1("Calling dxg.sys pfnDdReleaseDC\n");
619  return pfnDdReleaseDC(hSurface);
620 }
621 
622 /************************************************************************/
623 /* NtGdiDdResetVisrgn */
624 /************************************************************************/
625 BOOL
626 APIENTRY
628  HWND hwnd)
629 {
630 
632 
633  if (pfnDdResetVisrgn == NULL)
634  {
635  DPRINT1("Warning: no pfnDdResetVisrgn\n");
637  }
638 
639  DPRINT1("Calling dxg.sys pfnDdResetVisrgn\n");
640  return pfnDdResetVisrgn(hSurface, hwnd);
641 }
642 
643 /************************************************************************/
644 /* NtGdiDdSetGammaRamp */
645 /************************************************************************/
646 BOOL
647 APIENTRY
649  HDC hdc,
650  LPVOID lpGammaRamp)
651 {
653 
654  if (pfnDdSetGammaRamp == NULL)
655  {
656  DPRINT1("Warning: no pfnDdSetGammaRamp\n");
658  }
659 
660  DPRINT1("Calling dxg.sys pfnDdSetGammaRamp\n");
661  return pfnDdSetGammaRamp(hDirectDraw, hdc, lpGammaRamp);
662 }
BOOL APIENTRY NtGdiDdSetGammaRamp(HANDLE hDirectDraw, HDC hdc, LPVOID lpGammaRamp)
Definition: ddraw.c:648
#define DXG_INDEX_DxDdEnableDirectDraw
Definition: dxg.h:107
#define DXG_INDEX_DxDdCreateSurfaceObject
Definition: dxg.h:30
ULONG iFunc
Definition: winddi.h:530
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL APIENTRY NtGdiDdReenableDirectDrawObject(HANDLE hDirectDrawLocal, BOOL *pubNewMode)
Definition: ddraw.c:447
#define TRUE
Definition: types.h:120
HANDLE APIENTRY NtGdiDdCreateSurfaceObject(HANDLE hDirectDrawLocal, HANDLE hSurface, PDD_SURFACE_LOCAL puSurfaceLocal, PDD_SURFACE_MORE puSurfaceMore, PDD_SURFACE_GLOBAL puSurfaceGlobal, BOOL bComplete)
Definition: ddraw.c:341
DWORD(APIENTRY * PGD_DXDDGETDRIVERINFO)(HANDLE, PDD_GETDRIVERINFODATA)
Definition: intddraw.h:21
DWORD APIENTRY NtGdiDxgGenericThunk(ULONG_PTR ulIndex, ULONG_PTR ulHandle, SIZE_T *pdwSizeOfPtr1, PVOID pvPtr1, SIZE_T *pdwSizeOfPtr2, PVOID pvPtr2)
Definition: ddraw.c:278
HANDLE(APIENTRY * PGD_DDCREATEDIRECTDRAWOBJECT)(HDC hdc)
Definition: intddraw.h:25
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
HANDLE APIENTRY NtGdiDdGetDxHandle(HANDLE hDirectDraw, HANDLE hSurface, BOOL bRelease)
Definition: ddraw.c:586
#define DXG_INDEX_DxDdGetDC
Definition: dxg.h:41
#define DXG_INDEX_DxDdSetGammaRamp
Definition: dxg.h:61
#define DDHAL_DRIVER_NOTHANDLED
Definition: ddrawi.h:320
LONG NTSTATUS
Definition: precomp.h:26
static HDC
Definition: imagelist.c:92
GLdouble GLdouble t
Definition: gl.h:2047
BOOL(APIENTRY * PGD_DDSETGAMMARAMP)(HANDLE, HDC, LPVOID)
Definition: intddraw.h:15
BOOL(APIENTRY * PGD_DXDDDELETESURFACEOBJECT)(HANDLE)
Definition: intddraw.h:30
BOOLEAN(NTAPI * PGD_DXDDENABLEDIRECTDRAW)(PVOID, BOOLEAN)
Definition: dxg.h:199
BOOL APIENTRY NtGdiDdResetVisrgn(HANDLE hSurface, HWND hwnd)
Definition: ddraw.c:627
struct DD_CALLBACKS DD_CALLBACKS
BOOL(APIENTRY * PGD_DXDDDELETEDIRECTDRAWOBJECT)(HANDLE)
Definition: intddraw.h:29
NTSTATUS(APIENTRY * PGD_DXDDSTARTUPDXGRAPHICS)(ULONG, PDRVENABLEDATA, ULONG, PDRVENABLEDATA, PULONG, PEPROCESS)
Definition: intddraw.h:23
PGD_DXDDCLEANUPDXGRAPHICS gpfnCleanupDxGraphics
Definition: ddraw.c:15
int32_t INT
Definition: typedefs.h:56
BOOL intEnableReactXDriver(HDC hdc)
Definition: ddraw.c:33
uint32_t ULONG_PTR
Definition: typedefs.h:63
PFN pfn
Definition: winddi.h:531
#define DXG_INDEX_DxDdColorControl
Definition: dxg.h:24
#define DXG_INDEX_DxDdDeleteDirectDrawObject
Definition: dxg.h:31
BOOL APIENTRY NtGdiDdDeleteDirectDrawObject(HANDLE hDirectDrawLocal)
Definition: ddraw.c:366
DRIVER_FUNCTIONS DriverFunctions
Definition: pdevobj.h:138
#define DXG_INDEX_DxDdCreateDirectDrawObject
Definition: dxg.h:25
DWORD APIENTRY NtGdiDdGetDriverInfo(HANDLE hDirectDrawLocal, PDD_GETDRIVERINFODATA puGetDriverInfoData)
Definition: ddraw.c:479
DWORD APIENTRY NtGdiDdSetExclusiveMode(HANDLE hDirectDraw, PDD_SETEXCLUSIVEMODEDATA puSetExclusiveModeData)
Definition: ddraw.c:523
struct DD_PALETTECALLBACKS DD_PALETTECALLBACKS
unsigned int BOOL
Definition: ntddk_ex.h:94
#define DXG_INDEX_DxDdGetDriverInfo
Definition: dxg.h:42
#define DXG_INDEX_DxDdGetDriverState
Definition: dxg.h:16
PGD_DXDDSTARTUPDXGRAPHICS gpfnStartupDxGraphics
Definition: ddraw.c:14
#define DXG_INDEX_DxDdResetVisrgn
Definition: dxg.h:58
DWORD APIENTRY NtGdiDdFlipToGDISurface(HANDLE hDirectDraw, PDD_FLIPTOGDISURFACEDATA puFlipToGDISurfaceData)
Definition: ddraw.c:545
HANDLE ghDxGraphics
Definition: ddraw.c:24
smooth NULL
Definition: ftsmooth.c:416
#define DXG_INDEX_DxDdFlipToGDISurface
Definition: dxg.h:38
ULONG gdwDirectDrawContext
Definition: ddraw.c:25
DWORD APIENTRY NtGdiDdGetDriverState(PDD_GETDRIVERSTATEDATA pdata)
Definition: ddraw.c:302
static PROTOCOLDATA * pdata
Definition: protocol.c:157
#define DXG_INDEX_DxDdGetDxHandle
Definition: dxg.h:43
NTSTATUS APIENTRY DxDdStartupDxGraphics(ULONG ulc1, PDRVENABLEDATA DxEngDrvOld, ULONG ulc2, PDRVENABLEDATA DxgDrvOld, PULONG DirectDrawContext, PEPROCESS Proc)
Definition: ddraw.c:116
Definition: polytest.cpp:40
HDC(APIENTRY * PGD_DDGETDC)(HANDLE, PALETTEENTRY *)
Definition: intddraw.h:19
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
unsigned long DWORD
Definition: ntddk_ex.h:95
#define success(from, fromstr, to, tostr)
ENGAPI HANDLE APIENTRY EngLoadImage(_In_ LPWSTR pwszDriver)
Definition: ldevobj.c:456
DRVFN * pdrvfn
Definition: winddi.h:544
_Out_ DD_HALINFO * pHalInfo
Definition: winddi.h:4226
NTSTATUS(APIENTRY * PGD_DXDDCLEANUPDXGRAPHICS)(VOID)
Definition: intddraw.h:24
DWORD(APIENTRY * PGD_DXDDREENABLEDIRECTDRAWOBJECT)(HANDLE, BOOL *)
Definition: intddraw.h:20
static const WCHAR L[]
Definition: oid.c:1250
HDC hdc
Definition: main.c:9
HDC APIENTRY NtGdiDdGetDC(HANDLE hSurface, PALETTEENTRY *puColorTable)
Definition: ddraw.c:566
BOOL(APIENTRY * PGD_DXDDQUERYDIRECTDRAWOBJECT)(HANDLE, DD_HALINFO *, DWORD *, LPD3DNTHAL_CALLBACKS, LPD3DNTHAL_GLOBALDRIVERDATA, PDD_D3DBUFCALLBACKS, LPDDSURFACEDESC, DWORD *, VIDEOMEMORY *, DWORD *, DWORD *)
Definition: intddraw.h:33
DRVFN gpDxFuncs[DXG_INDEX_DxDdIoctl+1]
Definition: ddraw.c:23
PFN_DrvDisableDirectDraw DisableDirectDraw
Definition: ntgdityp.h:629
DWORD(APIENTRY * PGD_DXDDSETEXCLUSIVEMODE)(HANDLE, PDD_SETEXCLUSIVEMODEDATA)
Definition: intddraw.h:22
struct DD_SURFACECALLBACKS DD_SURFACECALLBACKS
#define DXG_INDEX_DxDdReleaseDC
Definition: dxg.h:56
#define DXG_INDEX_DxDxgGenericThunk
Definition: dxg.h:10
struct _EDD_DIRECTDRAW_GLOBAL * pEDDgpl
Definition: pdevobj.h:150
#define DDI_DRIVER_VERSION_NT5_01
Definition: winddi.h:538
Status
Definition: gdiplustypes.h:24
ULONG_PTR SIZE_T
Definition: typedefs.h:78
#define DXG_INDEX_DxDdIoctl
Definition: dxg.h:100
ULONG ulIndex
Definition: symbols.c:92
#define DXG_INDEX_DxDdGetAvailDriverMemory
Definition: dxg.h:39
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
#define STATUS_DLL_NOT_FOUND
Definition: ntstatus.h:531
ENGAPI PVOID APIENTRY EngFindImageProcAddress(_In_ HANDLE hModule, _In_ LPSTR lpProcName)
Definition: ldevobj.c:497
ULONG iDriverVersion
Definition: winddi.h:542
DWORD(NTAPI * PGD_DXGENERICTRUNK)(ULONG_PTR, ULONG_PTR, SIZE_T *, PVOID, SIZE_T *, PVOID)
Definition: dxg.h:123
unsigned int * PULONG
Definition: retypes.h:1
DWORD(APIENTRY * PGD_DXDDFLIPTOGDISURFACE)(HANDLE, PDD_FLIPTOGDISURFACEDATA)
Definition: intddraw.h:31
BOOL APIENTRY NtGdiDdReleaseDC(HANDLE hSurface)
Definition: ddraw.c:608
BOOL APIENTRY NtGdiDdQueryDirectDrawObject(HANDLE hDirectDrawLocal, DD_HALINFO *pHalInfo, DWORD *pCallBackFlags, LPD3DNTHAL_CALLBACKS puD3dCallbacks, LPD3DNTHAL_GLOBALDRIVERDATA puD3dDriverData, PDD_D3DBUFCALLBACKS puD3dBufferCallbacks, LPDDSURFACEDESC puD3dTextureFormats, DWORD *puNumHeaps, VIDEOMEMORY *puvmList, DWORD *puNumFourCC, DWORD *puFourCC)
Definition: ddraw.c:413
#define STATUS_PROCEDURE_NOT_FOUND
Definition: ntstatus.h:344
DWORD APIENTRY NtGdiDdColorControl(HANDLE hSurface, PDD_COLORCONTROLDATA puColorControlData)
Definition: ddraw.c:321
#define DPRINT1
Definition: precomp.h:8
BOOL APIENTRY NtGdiDdDeleteSurfaceObject(HANDLE hSurface)
Definition: ddraw.c:393
DWORD(APIENTRY * PGD_DDGETDRIVERSTATE)(PDD_GETDRIVERSTATEDATA)
Definition: intddraw.h:26
HANDLE(APIENTRY * PGD_DXDDCREATESURFACEOBJECT)(HANDLE, HANDLE, PDD_SURFACE_LOCAL, PDD_SURFACE_MORE, PDD_SURFACE_GLOBAL, BOOL)
Definition: intddraw.h:28
HANDLE APIENTRY NtGdiDdCreateDirectDrawObject(HDC hdc)
Definition: ddraw.c:212
PFN_DrvEnableDirectDraw EnableDirectDraw
Definition: ntgdityp.h:628
unsigned int ULONG
Definition: retypes.h:1
DWORD(APIENTRY * PGD_DDCOLORCONTROL)(HANDLE hSurface, PDD_COLORCONTROLDATA puColorControlData)
Definition: intddraw.h:27
#define DXG_INDEX_DxDdReenableDirectDrawObject
Definition: dxg.h:55
DRVFN gaEngFuncs[]
Definition: dxeng.c:15
HANDLE(APIENTRY * PGD_DDGETDXHANDLE)(HANDLE, HANDLE, BOOL)
Definition: intddraw.h:18
ENGAPI VOID APIENTRY EngUnloadImage(_In_ HANDLE hModule)
Definition: ldevobj.c:465
DWORD APIENTRY NtGdiDdGetAvailDriverMemory(HANDLE hDirectDrawLocal, PDD_GETAVAILDRIVERMEMORYDATA puGetAvailDriverMemoryData)
Definition: ddraw.c:501
EDD_DIRECTDRAW_GLOBAL edd_DdirectDraw_Global
DWORD(APIENTRY * PGD_DXDDGETAVAILDRIVERMEMORY)(HANDLE, PDD_GETAVAILDRIVERMEMORYDATA)
Definition: intddraw.h:32
#define DXG_INDEX_DxDdDeleteSurfaceObject
Definition: dxg.h:32
BOOL(APIENTRY * PGD_DDRELEASEDC)(HANDLE)
Definition: intddraw.h:16
#define DXG_INDEX_DxDdQueryDirectDrawObject
Definition: dxg.h:53
static SERVICE_STATUS status
Definition: service.c:31
Definition: winddi.h:529
#define APIENTRY
Definition: api.h:79
BOOL(APIENTRY * PGD_DDRESTVISRGN)(HANDLE, HWND)
Definition: intddraw.h:17
#define DXG_INDEX_DxDdSetExclusiveMode
Definition: dxg.h:60
ULONG gcEngFuncs
Definition: dxeng.c:14
Definition: ps.c:97