1f0436e6db575af29519b61f83a98506e08dcb1d
[reactos.git] / reactos / subsystems / win32 / win32k / ntddraw / dxeng.c
1 /*
2 * PROJECT: ReactOS Win32 Subsystem
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: subsystems/win32/win32k/ntddraw/dxeng.c
5 * PURPOSE: Implementation of DxEng functions
6 * PROGRAMMERS: Magnus Olsen (magnus@greatlord.com)
7 */
8
9 #include <w32k.h>
10 #include <debug.h>
11
12 HSEMAPHORE ghsemShareDevLock = NULL;
13
14 ULONG gcEngFuncs = DXENG_INDEX_DxEngLoadImage + 1;
15 DRVFN gaEngFuncs [] =
16 {
17 {0, (PFN) NULL},
18 {DXENG_INDEX_DxEngNUIsTermSrv, (PFN)DxEngNUIsTermSrv},
19 {DXENG_INDEX_DxEngScreenAccessCheck, (PFN)DxEngScreenAccessCheck},
20 {DXENG_INDEX_DxEngRedrawDesktop, (PFN)DxEngRedrawDesktop},
21 {DXENG_INDEX_DxEngDispUniq, (PFN)DxEngDispUniq},
22 {DXENG_INDEX_DxEngIncDispUniq, (PFN)DxEngIncDispUniq},
23 {DXENG_INDEX_DxEngVisRgnUniq, (PFN)DxEngVisRgnUniq},
24 {DXENG_INDEX_DxEngLockShareSem, (PFN)DxEngLockShareSem},
25 {DXENG_INDEX_DxEngUnlockShareSem, (PFN)DxEngUnlockShareSem},
26 {DXENG_INDEX_DxEngEnumerateHdev, (PFN)DxEngEnumerateHdev},
27 {DXENG_INDEX_DxEngLockHdev, (PFN)DxEngLockHdev},
28 {DXENG_INDEX_DxEngUnlockHdev, (PFN)DxEngUnlockHdev},
29 {DXENG_INDEX_DxEngIsHdevLockedByCurrentThread, (PFN)DxEngIsHdevLockedByCurrentThread},
30 {DXENG_INDEX_DxEngReferenceHdev, (PFN)DxEngReferenceHdev},
31 {DXENG_INDEX_DxEngUnreferenceHdev, (PFN)DxEngUnreferenceHdev},
32 {DXENG_INDEX_DxEngGetDeviceGammaRamp, (PFN)DxEngGetDeviceGammaRamp},
33 {DXENG_INDEX_DxEngSetDeviceGammaRamp, (PFN)DxEngSetDeviceGammaRamp},
34 {DXENG_INDEX_DxEngSpTearDownSprites, (PFN)DxEngSpTearDownSprites},
35 {DXENG_INDEX_DxEngSpUnTearDownSprites, (PFN)DxEngSpUnTearDownSprites},
36 {DXENG_INDEX_DxEngSpSpritesVisible, (PFN)DxEngSpSpritesVisible},
37 {DXENG_INDEX_DxEngGetHdevData, (PFN)DxEngGetHdevData},
38 {DXENG_INDEX_DxEngSetHdevData, (PFN)DxEngSetHdevData},
39 {DXENG_INDEX_DxEngCreateMemoryDC, (PFN)DxEngCreateMemoryDC},
40 {DXENG_INDEX_DxEngGetDesktopDC, (PFN)DxEngGetDesktopDC},
41 {DXENG_INDEX_DxEngDeleteDC, (PFN)DxEngDeleteDC},
42 {DXENG_INDEX_DxEngCleanDC, (PFN)DxEngCleanDC},
43 {DXENG_INDEX_DxEngSetDCOwner, (PFN)DxEngSetDCOwner},
44 {DXENG_INDEX_DxEngLockDC, (PFN)DxEngLockDC},
45 {DXENG_INDEX_DxEngUnlockDC, (PFN)DxEngUnlockDC},
46 {DXENG_INDEX_DxEngSetDCState, (PFN)DxEngSetDCState},
47 {DXENG_INDEX_DxEngGetDCState, (PFN)DxEngGetDCState},
48 {DXENG_INDEX_DxEngSelectBitmap, (PFN)DxEngSelectBitmap},
49 {DXENG_INDEX_DxEngSetBitmapOwner, (PFN)DxEngSetBitmapOwner},
50 {DXENG_INDEX_DxEngDeleteSurface, (PFN)DxEngDeleteSurface},
51 {DXENG_INDEX_DxEngGetSurfaceData, (PFN)DxEngGetSurfaceData},
52 {DXENG_INDEX_DxEngAltLockSurface, (PFN)DxEngAltLockSurface},
53 {DXENG_INDEX_DxEngUploadPaletteEntryToSurface, (PFN)DxEngUploadPaletteEntryToSurface},
54 {DXENG_INDEX_DxEngMarkSurfaceAsDirectDraw, (PFN)DxEngMarkSurfaceAsDirectDraw},
55 {DXENG_INDEX_DxEngSelectPaletteToSurface, (PFN)DxEngSelectPaletteToSurface},
56 {DXENG_INDEX_DxEngSyncPaletteTableWithDevice, (PFN)DxEngSyncPaletteTableWithDevice},
57 {DXENG_INDEX_DxEngSetPaletteState, (PFN)DxEngSetPaletteState},
58 {DXENG_INDEX_DxEngGetRedirectionBitmap, (PFN)DxEngGetRedirectionBitmap},
59 {DXENG_INDEX_DxEngLoadImage, (PFN)DxEngLoadImage}
60 };
61
62
63 /*++
64 * @name DxEngDispUniq
65 * @implemented
66 *
67 * The function DxEngDispUniq returns the DisplayUniqVisrgn counter value from GDI shared memory
68 *
69 * @return
70 * Returns the DisplayUniqVisrgn counter value from GDI shared memory
71 *
72 * @remarks.
73 * none
74 *
75 *--*/
76 ULONG
77 APIENTRY
78 DxEngDispUniq()
79 {
80 DPRINT1("ReactX Calling : DxEngDispUniq\n");
81 return GdiHandleTable->flDeviceUniq;
82 }
83
84 /*++
85 * @name DxEngGetDeviceGammaRamp
86 * @implemented
87 *
88 * The function DxEngGetDeviceGammaRamp gets the gamma ramp to dxg.sys.
89
90 * @param HDEV hPDev
91 * The hdev.
92 *
93 * @param PGAMMARAMP Ramp
94 * Pointer to store the gamma ramp value in.
95 *
96 * @return
97 *Returns TRUE for success, FALSE for failure
98 *
99 * @remarks.
100 * None
101 *
102 *--*/
103 BOOL
104 APIENTRY
105 DxEngGetDeviceGammaRamp(HDEV hPDev, PGAMMARAMP Ramp)
106 {
107 DPRINT1("ReactX Calling : DxEngGetDeviceGammaRamp\n");
108 return IntGetDeviceGammaRamp(hPDev, Ramp);
109 }
110
111
112 /*++
113 * @name DxEngLockDC
114 * @implemented
115 *
116 * The function DxEngLockDC locks a hdc from dxg.sys
117 *
118 * @param HDC hDC
119 * The handle we want to lock
120 *
121 * @return
122 * Returns PDC if lock succeeded or NULL if it failed.
123 *
124 * @remarks.
125 * none
126 *
127 *--*/
128 PDC
129 APIENTRY
130 DxEngLockDC(HDC hDC)
131 {
132 DPRINT1("ReactX Calling : DxEngLockDC\n");
133 return DC_LockDc(hDC);
134 }
135
136
137 /*++
138 * @name DxEngUnlockDC
139 * @implemented
140 *
141 * The function DxEngUnlockDC unlocks a pDC (hdc) from dxg.sys.
142
143 * @param PDC pDC
144 * The handle we want to unlock.
145 *
146 * @return
147 * This function returns TRUE no matter what.
148 *
149 * @remarks.
150 * none
151 *
152 *--*/
153 BOOLEAN
154 APIENTRY
155 DxEngUnlockDC(PDC pDC)
156 {
157 DPRINT1("ReactX Calling : DxEngUnlockDC\n");
158 DC_UnlockDc(pDC);
159 return TRUE;
160 }
161
162 /*++
163 * @name DxEngLockShareSem
164 * @implemented
165 *
166 * The function DxEngLockShareSem locks a struct of type ghsemShareDevLock that can be shared.
167 *
168 * @return
169 * This function returns TRUE for success and FALSE for failure.
170 * FALSE must mean the struct has already been locked.
171 *
172 * @remarks.
173 * It is being used in various ntuser* functions and ntgdi*
174 * ReactOS specific: It is not in use yet?
175 *SystemResourcesList
176 *--*/
177 BOOLEAN
178 APIENTRY
179 DxEngLockShareSem()
180 {
181 DPRINT1("ReactX Calling : DxEngLockShareSem\n");
182 if(!ghsemShareDevLock) ghsemShareDevLock = EngCreateSemaphore(); // Hax, should be in dllmain.c
183 IntGdiAcquireSemaphore(ghsemShareDevLock);
184 return TRUE;
185 }
186
187 /*++
188 * @name DxEngUnlockShareSem
189 * @implemented
190 *
191 * The function DxEngUnlockShareSem unlocks the struct of type ghsemShareDevLock.
192 *
193 * @return
194 * This function returns TRUE no matter what.
195 *
196 * @remarks.
197 * ReactOS specific: It is not in use yet?
198 *
199 *--*/
200 BOOLEAN
201 APIENTRY
202 DxEngUnlockShareSem()
203 {
204 DPRINT1("ReactX Calling : DxEngUnlockShareSem\n");
205 IntGdiReleaseSemaphore(ghsemShareDevLock);
206 return TRUE;
207 }
208
209 /*++
210 * @name DxEngSetDeviceGammaRamp
211 * @implemented
212 *
213 * The function DxEngSetDeviceGammaRamp sets gamma ramp from dxg.sys
214
215 * @param HDEV hPDev
216 * The hdev
217 *
218 * @param PGAMMARAMP Ramp
219 * Value to change gamma ramp to.
220 *
221 * @param BOOL Test
222 * Whether gamma should be tested. TRUE to test, FALSE to not test.
223 *
224 * @return
225 *Returns TRUE for success, FALSE for failure.
226 *
227 * @remarks.
228 * None
229 *
230 *--*/
231 BOOLEAN
232 APIENTRY
233 DxEngSetDeviceGammaRamp(HDEV hPDev, PGAMMARAMP Ramp, BOOL Test)
234 {
235 DPRINT1("ReactX Calling : DxEngSetDeviceGammaRamp\n");
236 return IntSetDeviceGammaRamp(hPDev, Ramp, Test);
237 }
238
239 /*++
240 * @name DxEngGetHdevData
241 * @implemented
242 *
243 * The function DxEngGetHdevData retrieves a value from the HDEV
244
245 * @param HDEV hPDev
246 * The HDEV
247 *
248 * @param DXEGSHDEVDATA Type
249 * The following typs are supported
250 * Type Purpose
251 * DxEGShDevData_Surface Retrieve pointer to Surface handle.
252 * DxEGShDevData_hSpooler See if the device is a spooler driver.
253 * DxEGShDevData_DitherFmt Retrieve the device iDitherFormat
254 * DxEGShDevData_FxCaps Retrieve the device flGraphicsCaps
255 * DxEGShDevData_FxCaps2 Retrieve the device flGraphicsCaps2
256 * DxEGShDevData_DrvFuncs Retrieve the device DriverFunctions function table
257 * DxEGShDevData_dhpdev Retrieve the device hPDev, the real DHPDEV
258 * DxEGShDevData_eddg Retrieve the device pEDDgpl
259 * DxEGShDevData_dd_nCount Retrieve the device DxDd_nCount
260 * DxEGShDevData_dd_flags Retrieve the device DxDd_Flags
261 * DxEGShDevData_disable See if the device pdev is disabled
262 * DxEGShDevData_metadev See if the device pdev is a meta device
263 * DxEGShDevData_display See if the device is the primary display driver
264 * DxEGShDevData_Parent Retrieve the ppdevParent
265 * DxEGShDevData_OpenRefs Retrieve the pdevOpenRefs counter
266 * DxEGShDevData_palette See if the device RC_PALETTE is set
267 * DxEGShDevData_ldev ATM we do not support the Loader Device driver structure
268 * DxEGShDevData_GDev Retrieve the device pGraphicsDev
269 * DxEGShDevData_clonedev Retrieve the device PDEV_CLONE_DEVICE flag is set or not
270 *
271 * @return
272 * Returns the data we requested
273 *
274 * @remarks.
275 * ReactOS specific: Implementation is incomplete, I do not save the value into the hdev yet.
276 *
277 *--*/
278 DWORD_PTR
279 APIENTRY
280 DxEngGetHdevData(HDEV hDev,
281 DXEGSHDEVDATA Type)
282 {
283 DWORD_PTR retVal = 0;
284 PPDEVOBJ PDev = (PPDEVOBJ)hDev;
285
286 DPRINT1("ReactX Calling : DxEngGetHdevData DXEGSHDEVDATA : %ld\n", Type);
287
288 #if 1
289 DPRINT1("HDEV hDev %08lx\n", hDev);
290 #endif
291
292 switch ( Type )
293 {
294 case DxEGShDevData_Surface:
295 DPRINT1("requested DXEGSHDEVDATA DxEGShDevData_Surface\n");
296 retVal = (DWORD_PTR) PDev->pSurface; // ptr to Surface handle.
297 break;
298 case DxEGShDevData_hSpooler:
299 DPRINT1("requested DXEGSHDEVDATA DxEGShDevData_hSpooler\n");
300 // retVal = (DWORD_PTR) PDev->hSpooler; // If the device is a spooler driver.
301 retVal = (DWORD_PTR) PDev->VideoFileObject->DeviceObject;
302 break;
303 case DxEGShDevData_DitherFmt:
304 DPRINT1("requested DXEGSHDEVDATA DxEGShDevData_DitherFmt\n");
305 retVal = (DWORD_PTR) PDev->DevInfo.iDitherFormat;
306 break;
307 case DxEGShDevData_FxCaps:
308 DPRINT1("requested DXEGSHDEVDATA DxEGShDevData_FxCaps\n");
309 retVal = (DWORD_PTR) PDev->DevInfo.flGraphicsCaps;
310 break;
311 case DxEGShDevData_FxCaps2:
312 DPRINT1("requested DXEGSHDEVDATA DxEGShDevData_FxCaps2\n");
313 retVal = (DWORD_PTR) PDev->DevInfo.flGraphicsCaps2;
314 break;
315 case DxEGShDevData_DrvFuncs:
316 DPRINT1("requested DXEGSHDEVDATA DxEGShDevData_DrvFuncs\n");
317 retVal = (DWORD_PTR) &PDev->DriverFunctions;
318 break;
319 case DxEGShDevData_dhpdev:
320 DPRINT1("requested DXEGSHDEVDATA DxEGShDevData_dhpdev\n");
321 retVal = (DWORD_PTR) PDev->hPDev; // DHPDEV
322 break;
323 case DxEGShDevData_eddg:
324 DPRINT1("requested DXEGSHDEVDATA DxEGShDevData_eddg\n");
325 retVal = (DWORD_PTR) PDev->pEDDgpl;
326 break;
327 case DxEGShDevData_dd_nCount:
328 DPRINT1("requested DXEGSHDEVDATA DxEGShDevData_dd_nCount\n");
329 retVal = (DWORD_PTR) PDev->DxDd_nCount;
330 break;
331 case DxEGShDevData_dd_flags:
332 DPRINT1("requested DXEGSHDEVDATA DxEGShDevData_dd_flags\n");
333 retVal = (DWORD_PTR) PDev->DxDd_Flags;
334 break;
335 case DxEGShDevData_disable:
336 DPRINT1("requested DXEGSHDEVDATA DxEGShDevData_disable\n");
337 retVal = (DWORD_PTR) PDev->flFlags & PDEV_DISABLED;
338 break;
339 case DxEGShDevData_metadev:
340 DPRINT1("requested DXEGSHDEVDATA DxEGShDevData_metadev\n");
341 retVal = (DWORD_PTR) PDev->flFlags & PDEV_META_DEVICE;
342 break;
343 case DxEGShDevData_display:
344 DPRINT1("requested DXEGSHDEVDATA DxEGShDevData_display\n");
345 retVal = (DWORD_PTR) PDev->flFlags & PDEV_DISPLAY;
346 break;
347 case DxEGShDevData_Parent:
348 DPRINT1("requested DXEGSHDEVDATA DxEGShDevData_Parent\n");
349 retVal = (DWORD_PTR) PDev->ppdevParent;
350 break;
351 case DxEGShDevData_OpenRefs:
352 DPRINT1("requested DXEGSHDEVDATA DxEGShDevData_OpenRefs\n");
353 retVal = (DWORD_PTR) PDev->cPdevOpenRefs != 0;
354 break;
355 case DxEGShDevData_palette:
356 DPRINT1("requested DXEGSHDEVDATA DxEGShDevData_palette\n");
357 retVal = (DWORD_PTR) PDev->GDIInfo.flRaster & RC_PALETTE;
358 break;
359 case DxEGShDevData_ldev:
360 DPRINT1("DxEGShDevData_ldev not supported yet\n");
361 // ATM we do not support the Loader Device driver structure.
362 // retVal = (DWORD) PDev->pldev;
363 break;
364 case DxEGShDevData_GDev:
365 DPRINT1("requested DXEGSHDEVDATA DxEGShDevData_GDev\n");
366 retVal = (DWORD_PTR) PDev->pGraphicsDev; // P"GRAPHICS_DEVICE"
367 break;
368 case DxEGShDevData_clonedev:
369 DPRINT1("requested DXEGSHDEVDATA DxEGShDevData_clonedev\n");
370 retVal = (DWORD_PTR) PDev->flFlags & PDEV_CLONE_DEVICE;
371 break;
372
373 default:
374 break;
375 }
376
377 #if 1
378 DPRINT1("return value %08lx\n", retVal);
379 #endif
380
381 return retVal;
382
383 }
384
385 /*++
386 * @name DxEngSetHdevData
387 * @implemented
388 *
389 * The function DxEngSetHdevData sets a value in hdev
390
391 * @param HDEV hPDev
392 * The hdev
393 *
394 * @param DXEGSHDEVDATA Type
395 * Supports only DxEGShDevData_dd_nCount. It is an internal counter on how many times hdev has been locked and unlocked
396 *
397 * @param DWORD Data
398 * The value to be saved to hdev's internal counter.
399 *
400 * @return
401 * Returns TRUE for success, FALSE for failure
402 *
403 * @remarks.
404 * none
405 *
406 *--*/
407 BOOLEAN
408 APIENTRY
409 DxEngSetHdevData(HDEV hDev,
410 DXEGSHDEVDATA Type,
411 DWORD_PTR Data)
412 {
413 BOOLEAN retVal = FALSE; // Default, no set.
414
415 DPRINT1("ReactX Calling : DxEngSetHdevData DXEGSHDEVDATA : %ld\n", Type);
416
417 if ( Type == DxEGShDevData_dd_nCount )
418 {
419 ((PPDEVOBJ)hDev)->DxDd_nCount = Data;
420 retVal = TRUE; // Set
421 }
422 return retVal;
423 }
424
425 /*++
426 * @name DxEngGetDCState
427 * @implemented
428 *
429 * The function DxEngGetDCState is capable of returning three
430 * DC states depending on what value is passed in its second parameter:
431 * 1. If the DC is full screen
432 * 2. Get Complexity of visible region
433 * 3. Get Driver hdev, which is ppdev
434 *
435 * @param HDC hdc
436 * The DC handle
437 *
438 * @param DWORD type
439 * value 1 = Is DC fullscreen
440 * value 2 = Get Complexity of visible region.
441 * value 3 = Get Driver hdev, which is a ppdev.
442 *
443 * @return
444 * Return one of the type values
445 *
446 * @remarks.
447 * We do not have type 2 implemented yet
448 *
449 *--*/
450 DWORD_PTR
451 APIENTRY
452 DxEngGetDCState(HDC hDC,
453 DWORD type)
454 {
455 PDC pDC = DC_LockDc(hDC);
456 DWORD_PTR retVal = 0;
457
458 DPRINT1("ReactX Calling : DxEngGetDCState type : %ld\n", type);
459
460 if (pDC)
461 {
462 switch (type)
463 {
464 case 1:
465 retVal = (DWORD_PTR) pDC->fs & DC_FLAG_FULLSCREEN;
466 break;
467 case 2:
468 UNIMPLEMENTED;
469 break;
470 case 3:
471 {
472 /* Return the HDEV of this DC. */
473 retVal = (DWORD_PTR) pDC->ppdev;
474 break;
475 }
476 default:
477 /* if a valid type is not found, zero is returned */
478 DPRINT1("Warning did not find type %d\n",type);
479 break;
480 }
481 DC_UnlockDc(pDC);
482 }
483
484 return retVal;
485 }
486
487 /*++
488 * @name DxEngIncDispUniq
489 * @implemented
490 *
491 * The function DxEngIncDispUniq increments the DisplayUniqVisrgn counter from GDI shared memory.
492 *
493 * @return
494 * This function returns TRUE no matter what.
495 *
496 * @remarks.
497 * none
498 *
499 *--*/
500 BOOLEAN
501 APIENTRY
502 DxEngIncDispUniq()
503 {
504 DPRINT1("ReactX Calling : DxEngIncDispUniq \n");
505
506 InterlockedIncrement((LONG*)&GdiHandleTable->flDeviceUniq);
507 return TRUE;
508 }
509
510 /*++
511 * @name DxEngLockHdev
512 * @implemented
513 *
514 * The function DxEngLockHdev lock the internal PDEV
515 *
516 * @param HDEV type
517 * it is a pointer to win32k internal pdev struct known as PPDEVOBJ
518
519 * @return
520 * This function returns TRUE no matter what.
521 *
522 * @remarks.
523 * none
524 *
525 *--*/
526 BOOLEAN
527 APIENTRY
528 DxEngLockHdev(HDEV hDev)
529 {
530 PPDEVOBJ ppdev = (PPDEVOBJ)hDev;
531 PERESOURCE Resource;
532
533 DPRINT1("ReactX Calling : DxEngLockHdev \n");
534
535 DPRINT1("hDev : 0x%08lx\n",hDev);
536
537 Resource = ppdev->hsemDevLock;
538
539 if (Resource)
540 {
541 KeEnterCriticalRegion();
542 ExAcquireResourceExclusiveLite( Resource , TRUE); // Lock monitor.
543 }
544 return TRUE;
545 }
546
547 /*++
548 * @name DxEngUnlockHdev
549 * @implemented
550 *
551 * The function DxEngUnlockHdev unlock the internal PDEV
552 *
553 * @param HDEV type
554 * it is a pointer to win32k internal pdev struct known as PPDEVOBJ
555
556 * @return
557 * This function returns TRUE no matter what.
558 *
559 * @remarks.
560 * none
561 *
562 *--*/
563 BOOLEAN
564 APIENTRY
565 DxEngUnlockHdev(HDEV hDev)
566 {
567 PPDEVOBJ ppdev = (PPDEVOBJ)hDev;
568 PERESOURCE Resource = ppdev->hsemDevLock;
569
570 DPRINT1("ReactX Calling : DxEngUnlockHdev \n");
571
572 if (Resource)
573 {
574 ExReleaseResourceLite( Resource );
575 KeLeaveCriticalRegion();
576 }
577 return TRUE;
578 }
579
580
581 /************************************************************************/
582 /* DxEngReferenceHdev */
583 /************************************************************************/
584 BOOLEAN
585 APIENTRY
586 DxEngReferenceHdev(HDEV hDev)
587 {
588 IntGdiReferencePdev((PPDEVOBJ) hDev);
589 /* ALWAYS return true */
590 return TRUE;
591 }
592
593 /************************************************************************/
594 /* DxEngNUIsTermSrv */
595 /************************************************************************/
596
597 /* Notes : Check see if termal server got a connections or not */
598 BOOLEAN
599 APIENTRY
600 DxEngNUIsTermSrv()
601 {
602 /* FIXME ReactOS does not suport terminal server yet, we can not check if we got a connections or not */
603 UNIMPLEMENTED;
604 return FALSE;
605 }
606
607 /************************************************************************/
608 /* DxEngRedrawDesktop */
609 /************************************************************************/
610
611 /* Notes : it always returns TRUE, and it updates whole screen
612 (redraws current desktop) */
613 BOOLEAN
614 APIENTRY
615 DxEngRedrawDesktop()
616 {
617 UserRedrawDesktop();
618 return TRUE;
619 }
620
621
622 ULONG gulVisRgnUniqueness; // Increase count everytime client region is updated.
623
624 /************************************************************************/
625 /* DxEngVisRgnUniq */
626 /************************************************************************/
627 /* Notes : returns the VisRgnUniq counter for win32k */
628 ULONG
629 APIENTRY
630 DxEngVisRgnUniq()
631 {
632 DPRINT1("ReactX Calling : DxEngVisRgnUniq \n");
633
634 return gulVisRgnUniqueness;
635 }
636
637 /************************************************************************/
638 /* DxEngEnumerateHdev */
639 /************************************************************************/
640 /* Enumerate all drivers in win32k */
641 HDEV *
642 APIENTRY
643 DxEngEnumerateHdev(HDEV *hdev)
644 {
645 /* FIXME Enumerate all drivers in win32k */
646 UNIMPLEMENTED;
647 return FALSE;
648 }
649
650 /************************************************************************/
651 /* DxEngCreateMemoryDC */
652 /************************************************************************/
653 HDC
654 APIENTRY
655 DxEngCreateMemoryDC(HDEV hDev)
656 {
657 return IntGdiCreateDisplayDC(hDev, DC_TYPE_MEMORY, FALSE);
658 }
659
660 /************************************************************************/
661 /* DxEngScreenAccessCheck */
662 /************************************************************************/
663 DWORD APIENTRY DxEngScreenAccessCheck()
664 {
665 UNIMPLEMENTED;
666
667 /* we cheating here and tell dxg.sys it have always premitions to access the screen */
668 return TRUE;
669 }
670
671 /************************************************************************/
672 /* DxEngIsHdevLockedByCurrentThread */
673 /************************************************************************/
674 BOOLEAN
675 APIENTRY
676 DxEngIsHdevLockedByCurrentThread(HDEV hDev)
677 { // base on EngIsSemaphoreOwnedByCurrentThread w/o the Ex call.
678 PERESOURCE pSem = ((PPDEVOBJ)hDev)->hsemDevLock;
679 return pSem->OwnerEntry.OwnerThread == (ERESOURCE_THREAD)PsGetCurrentThread();
680 }
681
682
683 /************************************************************************/
684 /* DxEngUnreferenceHdev */
685 /************************************************************************/
686 BOOLEAN
687 APIENTRY
688 DxEngUnreferenceHdev(HDEV hDev)
689 {
690 IntGdiUnreferencePdev((PPDEVOBJ) hDev, 0);
691 return TRUE; // Always true.
692 }
693
694 /************************************************************************/
695 /* DxEngGetDesktopDC */
696 /************************************************************************/
697 HDC
698 APIENTRY
699 DxEngGetDesktopDC(ULONG DcType, BOOL EmptyDC, BOOL ValidatehWnd)
700 {
701 return UserGetDesktopDC(DcType, EmptyDC, ValidatehWnd);
702 }
703
704 /************************************************************************/
705 /* DxEngDeleteDC */
706 /************************************************************************/
707 BOOLEAN
708 APIENTRY
709 DxEngDeleteDC(HDC hdc, BOOL Force)
710 {
711 return IntGdiDeleteDC(hdc, Force);
712 }
713
714 /************************************************************************/
715 /* DxEngCleanDC */
716 /************************************************************************/
717 BOOLEAN
718 APIENTRY
719 DxEngCleanDC(HDC hdc)
720 {
721 return IntGdiCleanDC(hdc);
722 }
723
724 /************************************************************************/
725 /* DxEngSetDCOwner */
726 /************************************************************************/
727 BOOL APIENTRY DxEngSetDCOwner(HGDIOBJ hObject, DWORD OwnerMask)
728 {
729 DPRINT1("ReactX Calling : DxEngSetDCOwner \n");
730
731 return IntGdiSetDCOwnerEx( hObject, OwnerMask, FALSE);
732 }
733
734 /************************************************************************/
735 /* DxEngSetDCState */
736 /************************************************************************/
737 BOOLEAN
738 APIENTRY
739 DxEngSetDCState(HDC hDC, DWORD SetType, DWORD Set)
740 {
741 BOOLEAN Ret = FALSE;
742 PDC pDC = DC_LockDc(hDC);
743
744 if (pDC)
745 {
746 if (SetType == 1)
747 {
748 if ( Set )
749 pDC->fs |= DC_FLAG_FULLSCREEN;
750 else
751 pDC->fs &= ~DC_FLAG_FULLSCREEN;
752 Ret = TRUE;
753 }
754 DC_UnlockDc(pDC);
755 return Ret; // Everything else returns FALSE.
756 }
757 return Ret;
758 }
759
760 /************************************************************************/
761 /* DxEngSelectBitmap */
762 /************************************************************************/
763 DWORD APIENTRY DxEngSelectBitmap(DWORD x1, DWORD x2)
764 {
765 UNIMPLEMENTED;
766 return FALSE;
767 }
768
769 /************************************************************************/
770 /* DxEngSetBitmapOwner */
771 /************************************************************************/
772 DWORD APIENTRY DxEngSetBitmapOwner(DWORD x1, DWORD x2)
773 {
774 UNIMPLEMENTED;
775 return FALSE;
776 }
777
778 /************************************************************************/
779 /* DxEngDeleteSurface */
780 /************************************************************************/
781 DWORD APIENTRY DxEngDeleteSurface(DWORD x1)
782 {
783 UNIMPLEMENTED;
784 return FALSE;
785 }
786
787 /************************************************************************/
788 /* DxEngGetSurfaceData */
789 /************************************************************************/
790 DWORD APIENTRY DxEngGetSurfaceData(DWORD x1, DWORD x2)
791 {
792 UNIMPLEMENTED;
793 return FALSE;
794 }
795
796 /************************************************************************/
797 /* DxEngAltLockSurface */
798 /************************************************************************/
799 DWORD APIENTRY DxEngAltLockSurface(DWORD x1)
800 {
801 UNIMPLEMENTED;
802 return FALSE;
803 }
804
805 /************************************************************************/
806 /* DxEngUploadPaletteEntryToSurface */
807 /************************************************************************/
808 DWORD APIENTRY DxEngUploadPaletteEntryToSurface(DWORD x1, DWORD x2,DWORD x3, DWORD x4)
809 {
810 UNIMPLEMENTED;
811 return FALSE;
812 }
813
814 /************************************************************************/
815 /* DxEngMarkSurfaceAsDirectDraw */
816 /************************************************************************/
817 DWORD APIENTRY DxEngMarkSurfaceAsDirectDraw(DWORD x1, DWORD x2)
818 {
819 UNIMPLEMENTED;
820 return FALSE;
821 }
822
823 /************************************************************************/
824 /* DxEngSelectPaletteToSurface */
825 /************************************************************************/
826 DWORD APIENTRY DxEngSelectPaletteToSurface(DWORD x1, DWORD x2)
827 {
828 UNIMPLEMENTED;
829 return FALSE;
830 }
831
832 /************************************************************************/
833 /* DxEngSyncPaletteTableWithDevice */
834 /************************************************************************/
835 DWORD APIENTRY DxEngSyncPaletteTableWithDevice(DWORD x1, DWORD x2)
836 {
837 UNIMPLEMENTED;
838 return FALSE;
839 }
840
841 /************************************************************************/
842 /* DxEngSetPaletteState */
843 /************************************************************************/
844 DWORD APIENTRY DxEngSetPaletteState(DWORD x1, DWORD x2, DWORD x3)
845 {
846 UNIMPLEMENTED;
847 return FALSE;
848 }
849
850 /************************************************************************/
851 /* DxEngGetRedirectionBitmap */
852 /************************************************************************/
853 DWORD
854 APIENTRY
855 DxEngGetRedirectionBitmap(DWORD x1)
856 {
857 return FALSE; // Normal return.
858 }
859
860 /************************************************************************/
861 /* DxEngLoadImage */
862 /************************************************************************/
863 DWORD APIENTRY DxEngLoadImage(DWORD x1,DWORD x2)
864 {
865 UNIMPLEMENTED;
866 return FALSE;
867 }
868
869 /************************************************************************/
870 /* DxEngSpTearDownSprites */
871 /************************************************************************/
872 DWORD APIENTRY DxEngSpTearDownSprites(DWORD x1, DWORD x2, DWORD x3)
873 {
874 UNIMPLEMENTED;
875 return FALSE;
876 }
877
878 /************************************************************************/
879 /* DxEngSpUnTearDownSprites */
880 /************************************************************************/
881 DWORD APIENTRY DxEngSpUnTearDownSprites(DWORD x1, DWORD x2, DWORD x3)
882 {
883 UNIMPLEMENTED;
884 return FALSE;
885 }
886
887 /************************************************************************/
888 /* DxEngSpSpritesVisible */
889 /************************************************************************/
890 DWORD APIENTRY DxEngSpSpritesVisible(DWORD x1)
891 {
892 UNIMPLEMENTED;
893 return FALSE;
894 }