ReactOS  0.4.14-dev-552-g2fad488
pdevobj.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS kernel
4  * PURPOSE: Support for physical devices
5  * FILE: win32ss/gdi/eng/pdevobj.c
6  * PROGRAMER: Timo Kreuzer (timo.kreuzer@reactos.org)
7  */
8 
9 #include <win32k.h>
10 #define NDEBUG
11 #include <debug.h>
12 
14 
17 
18 INIT_FUNCTION
20 NTAPI
22 {
25  return STATUS_SUCCESS;
26 }
27 
28 #if DBG
30 NTAPI
31 DbgLookupDHPDEV(DHPDEV dhpdev)
32 {
33  PPDEVOBJ ppdev;
34 
35  /* Lock PDEV list */
36  EngAcquireSemaphoreShared(ghsemPDEV);
37 
38  /* Walk through the list of PDEVs */
39  for (ppdev = gppdevList; ppdev; ppdev = ppdev->ppdevNext)
40  {
41  /* Compare with the given DHPDEV */
42  if (ppdev->dhpdev == dhpdev) break;
43  }
44 
45  /* Unlock PDEV list */
47 
48  return ppdev;
49 }
50 #endif
51 
54 {
55  PPDEVOBJ ppdev;
56 
58  if (!ppdev)
59  return NULL;
60 
61  RtlZeroMemory(ppdev, sizeof(PDEVOBJ));
62 
64  if (ppdev->hsemDevLock == NULL)
65  {
67  return NULL;
68  }
69 
70  /* Allocate EDD_DIRECTDRAW_GLOBAL for our ReactX driver */
72  if (ppdev->pEDDgpl)
74 
75  ppdev->cPdevRefs = 1;
76 
77  return ppdev;
78 }
79 
80 static
81 VOID
83  PPDEVOBJ ppdev)
84 {
86  if (ppdev->pEDDgpl)
89 }
90 
91 VOID
92 NTAPI
94  _Inout_ PPDEVOBJ ppdev)
95 {
96  /* Lock loader */
98 
99  /* Decrease reference count */
100  InterlockedDecrement(&ppdev->cPdevRefs);
101  ASSERT(ppdev->cPdevRefs >= 0);
102 
103  /* Check if references are left */
104  if (ppdev->cPdevRefs == 0)
105  {
106  /* Do we have a surface? */
107  if (ppdev->pSurface)
108  {
109  /* Release the surface and let the driver free it */
110  SURFACE_ShareUnlockSurface(ppdev->pSurface);
111  ppdev->pfn.DisableSurface(ppdev->dhpdev);
112  }
113 
114  /* Do we have a palette? */
115  if (ppdev->ppalSurf)
116  {
117  PALETTE_ShareUnlockPalette(ppdev->ppalSurf);
118  }
119 
120  /* Check if the PDEV was enabled */
121  if (ppdev->dhpdev != NULL)
122  {
123  /* Disable the PDEV */
124  ppdev->pfn.DisablePDEV(ppdev->dhpdev);
125  }
126 
127  /* Remove it from list */
128  if (ppdev == gppdevList)
129  {
130  gppdevList = ppdev->ppdevNext;
131  }
132  else
133  {
134  PPDEVOBJ ppdevCurrent = gppdevList;
135  BOOL found = FALSE;
136  while (!found && ppdevCurrent->ppdevNext)
137  {
138  if (ppdevCurrent->ppdevNext == ppdev)
139  found = TRUE;
140  else
141  ppdevCurrent = ppdevCurrent->ppdevNext;
142  }
143  if (found)
144  ppdevCurrent->ppdevNext = ppdev->ppdevNext;
145  }
146 
147  /* Is this the primary one ? */
148  if (ppdev == gppdevPrimary)
150 
151  /* Free it */
152  PDEVOBJ_vDeletePDEV(ppdev);
153  }
154 
155  /* Unlock loader */
157 }
158 
159 BOOL
160 NTAPI
162  PPDEVOBJ ppdev,
163  PDEVMODEW pdevmode,
165 {
166  PFN_DrvEnablePDEV pfnEnablePDEV;
167  ULONG i;
168 
169  DPRINT("PDEVOBJ_bEnablePDEV()\n");
170 
171  /* Get the DrvEnablePDEV function */
172  pfnEnablePDEV = ppdev->pldev->pfn.EnablePDEV;
173 
174  /* Call the drivers DrvEnablePDEV function */
175  ppdev->dhpdev = pfnEnablePDEV(pdevmode,
177  HS_DDI_MAX,
178  ppdev->ahsurf,
179  sizeof(GDIINFO),
180  (PULONG)&ppdev->gdiinfo,
181  sizeof(DEVINFO),
182  &ppdev->devinfo,
183  (HDEV)ppdev,
185  ppdev->pGraphicsDevice->DeviceObject);
186  if (ppdev->dhpdev == NULL)
187  {
188  DPRINT1("Failed to enable PDEV\n");
189  return FALSE;
190  }
191 
192  /* Fix up some values */
193  if (ppdev->gdiinfo.ulLogPixelsX == 0)
194  ppdev->gdiinfo.ulLogPixelsX = 96;
195 
196  if (ppdev->gdiinfo.ulLogPixelsY == 0)
197  ppdev->gdiinfo.ulLogPixelsY = 96;
198 
199  /* Set raster caps */
200  ppdev->gdiinfo.flRaster = RC_OP_DX_OUTPUT | RC_GDI20_OUTPUT | RC_BIGFONT;
201  if ((ppdev->gdiinfo.ulTechnology != DT_PLOTTER) && (ppdev->gdiinfo.ulTechnology != DT_CHARSTREAM))
202  ppdev->gdiinfo.flRaster |= RC_STRETCHDIB | RC_STRETCHBLT | RC_DIBTODEV | RC_DI_BITMAP | RC_BITMAP64 | RC_BITBLT;
203  if (ppdev->gdiinfo.ulTechnology == DT_RASDISPLAY)
204  ppdev->gdiinfo.flRaster |= RC_FLOODFILL;
205  if (ppdev->devinfo.flGraphicsCaps & GCAPS_PALMANAGED)
206  ppdev->gdiinfo.flRaster |= RC_PALETTE;
207 
208  /* Setup Palette */
209  ppdev->ppalSurf = PALETTE_ShareLockPalette(ppdev->devinfo.hpalDefault);
210 
211  /* Setup hatch brushes */
212  for (i = 0; i < HS_DDI_MAX; i++)
213  {
214  if (ppdev->ahsurf[i] == NULL)
215  ppdev->ahsurf[i] = gahsurfHatch[i];
216  }
217 
218  DPRINT("PDEVOBJ_bEnablePDEV - dhpdev = %p\n", ppdev->dhpdev);
219 
220  return TRUE;
221 }
222 
223 VOID
224 NTAPI
226  PPDEVOBJ ppdev)
227 {
228  /* Call the drivers DrvCompletePDEV function */
229  ppdev->pldev->pfn.CompletePDEV(ppdev->dhpdev, (HDEV)ppdev);
230 }
231 
232 PSURFACE
233 NTAPI
235  PPDEVOBJ ppdev)
236 {
237  HSURF hsurf;
238 
239  /* Check if there is no surface for this PDEV yet */
240  if (ppdev->pSurface == NULL)
241  {
242  /* Call the drivers DrvEnableSurface */
243  hsurf = ppdev->pldev->pfn.EnableSurface(ppdev->dhpdev);
244  if (hsurf== NULL)
245  {
246  DPRINT1("Failed to create PDEV surface!\n");
247  return NULL;
248  }
249 
250  /* Get a reference to the surface */
251  ppdev->pSurface = SURFACE_ShareLockSurface(hsurf);
252  NT_ASSERT(ppdev->pSurface != NULL);
253  }
254 
255  /* Increment reference count */
257 
258  DPRINT("PDEVOBJ_pSurface() returning %p\n", ppdev->pSurface);
259  return ppdev->pSurface;
260 }
261 
262 VOID
263 NTAPI
265  PPDEVOBJ ppdev)
266 {
267  PGRAPHICS_DEVICE pGraphicsDevice;
268  PDEVMODEINFO pdminfo, pdmiNext;
269  DEVMODEW dmDefault;
270  DEVMODEW dmCurrent;
271 
272  /* Lock the PDEV */
274 
275  pGraphicsDevice = ppdev->pGraphicsDevice;
276 
277  /* Remember our default mode */
278  dmDefault = *pGraphicsDevice->pDevModeList[pGraphicsDevice->iDefaultMode].pdm;
279  dmCurrent = *ppdev->pdmwDev;
280 
281  /* Clear out the modes */
282  for (pdminfo = pGraphicsDevice->pdevmodeInfo;
283  pdminfo;
284  pdminfo = pdmiNext)
285  {
286  pdmiNext = pdminfo->pdmiNext;
288  }
289  pGraphicsDevice->pdevmodeInfo = NULL;
290  ExFreePoolWithTag(pGraphicsDevice->pDevModeList, GDITAG_GDEVICE);
291  pGraphicsDevice->pDevModeList = NULL;
292 
293  /* Now re-populate the list */
294  if (!EngpPopulateDeviceModeList(pGraphicsDevice, &dmDefault))
295  {
296  DPRINT1("FIXME: EngpPopulateDeviceModeList failed, we just destroyed a perfectly good mode list\n");
297  }
298 
299  ppdev->pdmwDev = PDEVOBJ_pdmMatchDevMode(ppdev, &dmCurrent);
300 
301  /* Unlock PDEV */
303 }
304 
305 PDEVMODEW
306 NTAPI
308  PPDEVOBJ ppdev,
309  PDEVMODEW pdm)
310 {
311  PGRAPHICS_DEVICE pGraphicsDevice;
312  PDEVMODEW pdmCurrent;
313  ULONG i;
314  DWORD dwFields;
315 
316  pGraphicsDevice = ppdev->pGraphicsDevice;
317 
318  for (i = 0; i < pGraphicsDevice->cDevModes; i++)
319  {
320  pdmCurrent = pGraphicsDevice->pDevModeList[i].pdm;
321 
322  /* Compare asked DEVMODE fields
323  * Only compare those that are valid in both DEVMODE structs */
324  dwFields = pdmCurrent->dmFields & pdm->dmFields;
325 
326  /* For now, we only need those */
327  if ((dwFields & DM_BITSPERPEL) &&
328  (pdmCurrent->dmBitsPerPel != pdm->dmBitsPerPel)) continue;
329  if ((dwFields & DM_PELSWIDTH) &&
330  (pdmCurrent->dmPelsWidth != pdm->dmPelsWidth)) continue;
331  if ((dwFields & DM_PELSHEIGHT) &&
332  (pdmCurrent->dmPelsHeight != pdm->dmPelsHeight)) continue;
333  if ((dwFields & DM_DISPLAYFREQUENCY) &&
334  (pdmCurrent->dmDisplayFrequency != pdm->dmDisplayFrequency)) continue;
335 
336  /* Match! Return the DEVMODE */
337  return pdmCurrent;
338  }
339 
340  /* Nothing found */
341  return NULL;
342 }
343 
344 static
345 PPDEVOBJ
347  PUNICODE_STRING pustrDeviceName,
348  PDEVMODEW pdm)
349 {
350  PGRAPHICS_DEVICE pGraphicsDevice;
351  PPDEVOBJ ppdev;
352 
353  DPRINT("EngpCreatePDEV(%wZ, %p)\n", pustrDeviceName, pdm);
354 
355  /* Try to find the GRAPHICS_DEVICE */
356  if (pustrDeviceName)
357  {
358  pGraphicsDevice = EngpFindGraphicsDevice(pustrDeviceName, 0, 0);
359  if (!pGraphicsDevice)
360  {
361  DPRINT1("No GRAPHICS_DEVICE found for %ls!\n",
362  pustrDeviceName ? pustrDeviceName->Buffer : 0);
363  return NULL;
364  }
365  }
366  else
367  {
368  pGraphicsDevice = gpPrimaryGraphicsDevice;
369  }
370 
371  /* Allocate a new PDEVOBJ */
372  ppdev = PDEVOBJ_AllocPDEV();
373  if (!ppdev)
374  {
375  DPRINT1("failed to allocate a PDEV\n");
376  return NULL;
377  }
378 
379  /* If no DEVMODEW is given, ... */
380  if (!pdm)
381  {
382  /* ... use the device's default one */
383  pdm = pGraphicsDevice->pDevModeList[pGraphicsDevice->iDefaultMode].pdm;
384  DPRINT("Using iDefaultMode = %lu\n", pGraphicsDevice->iDefaultMode);
385  }
386 
387  /* Try to get a diplay driver */
389  if (!ppdev->pldev)
390  {
391  DPRINT1("Could not load display driver '%ls', '%ls'\n",
392  pGraphicsDevice->pDiplayDrivers,
393  pdm->dmDeviceName);
394  PDEVOBJ_vRelease(ppdev);
395  return NULL;
396  }
397 
398  /* Copy the function table */
399  ppdev->pfn = ppdev->pldev->pfn;
400 
401  /* Set MovePointer function */
402  ppdev->pfnMovePointer = ppdev->pfn.MovePointer;
403  if (!ppdev->pfnMovePointer)
405 
406  ppdev->pGraphicsDevice = pGraphicsDevice;
407 
408  // DxEngGetHdevData asks for Graphics DeviceObject in hSpooler field
409  ppdev->hSpooler = ppdev->pGraphicsDevice->DeviceObject;
410 
411  // Should we change the ative mode of pGraphicsDevice ?
412  ppdev->pdmwDev = PDEVOBJ_pdmMatchDevMode(ppdev, pdm);
413 
414  /* FIXME! */
415  ppdev->flFlags = PDEV_DISPLAY;
416 
417  /* HACK: Don't use the pointer */
418  ppdev->Pointer.Exclude.right = -1;
419 
420  /* Call the driver to enable the PDEV */
421  if (!PDEVOBJ_bEnablePDEV(ppdev, pdm, NULL))
422  {
423  DPRINT1("Failed to enable PDEV!\n");
424  PDEVOBJ_vRelease(ppdev);
425  return NULL;
426  }
427 
428  /* FIXME: this must be done in a better way */
430 
431  /* Tell the driver that the PDEV is ready */
432  PDEVOBJ_vCompletePDEV(ppdev);
433 
434  /* Return the PDEV */
435  return ppdev;
436 }
437 
439 VOID
441  _Inout_ PVOID pvPointer1,
442  _Inout_ PVOID pvPointer2)
443 {
444  PVOID *ppvPointer1 = pvPointer1;
445  PVOID *ppvPointer2 = pvPointer2;
446  PVOID pvTemp;
447 
448  pvTemp = *ppvPointer1;
449  *ppvPointer1 = *ppvPointer2;
450  *ppvPointer2 = pvTemp;
451 }
452 
453 VOID
454 NTAPI
456  PPDEVOBJ ppdev,
457  PPDEVOBJ ppdev2)
458 {
459  union
460  {
461  DRIVER_FUNCTIONS pfn;
462  GDIINFO gdiinfo;
463  DEVINFO devinfo;
464  DWORD StateFlags;
465  } temp;
466 
467  /* Exchange driver functions */
468  temp.pfn = ppdev->pfn;
469  ppdev->pfn = ppdev2->pfn;
470  ppdev2->pfn = temp.pfn;
471 
472  /* Exchange LDEVs */
473  SwitchPointer(&ppdev->pldev, &ppdev2->pldev);
474 
475  /* Exchange DHPDEV */
476  SwitchPointer(&ppdev->dhpdev, &ppdev2->dhpdev);
477 
478  /* Exchange surfaces and associate them with their new PDEV */
479  SwitchPointer(&ppdev->pSurface, &ppdev2->pSurface);
480  ppdev->pSurface->SurfObj.hdev = (HDEV)ppdev;
481  ppdev2->pSurface->SurfObj.hdev = (HDEV)ppdev2;
482 
483  /* Exchange devinfo */
484  temp.devinfo = ppdev->devinfo;
485  ppdev->devinfo = ppdev2->devinfo;
486  ppdev2->devinfo = temp.devinfo;
487 
488  /* Exchange gdiinfo */
489  temp.gdiinfo = ppdev->gdiinfo;
490  ppdev->gdiinfo = ppdev2->gdiinfo;
491  ppdev2->gdiinfo = temp.gdiinfo;
492 
493  /* Exchange DEVMODE */
494  SwitchPointer(&ppdev->pdmwDev, &ppdev2->pdmwDev);
495 
496  /* Exchange state flags */
497  temp.StateFlags = ppdev->pGraphicsDevice->StateFlags;
499  ppdev2->pGraphicsDevice->StateFlags = temp.StateFlags;
500 
501  /* Notify each driver instance of its new HDEV association */
502  ppdev->pfn.CompletePDEV(ppdev->dhpdev, (HDEV)ppdev);
503  ppdev2->pfn.CompletePDEV(ppdev2->dhpdev, (HDEV)ppdev2);
504 }
505 
506 
507 BOOL
508 NTAPI
510  PPDEVOBJ ppdev,
511  PDEVMODEW pdm)
512 {
513  UNICODE_STRING ustrDevice;
514  PPDEVOBJ ppdevTmp;
516  BOOL retval = FALSE;
517 
518  /* Lock the PDEV */
520 
521  /* And everything else */
523 
524  DPRINT1("PDEVOBJ_bSwitchMode, ppdev = %p, pSurface = %p\n", ppdev, ppdev->pSurface);
525 
526  // Lookup the GraphicsDevice + select DEVMODE
527  // pdm = PDEVOBJ_pdmMatchDevMode(ppdev, pdm);
528 
529  /* 1. Temporarily disable the current PDEV and reset video to its default mode */
530  if (!ppdev->pfn.AssertMode(ppdev->dhpdev, FALSE))
531  {
532  DPRINT1("DrvAssertMode(FALSE) failed\n");
533  goto leave;
534  }
535 
536  /* 2. Create new PDEV */
538  ppdevTmp = EngpCreatePDEV(&ustrDevice, pdm);
539  if (!ppdevTmp)
540  {
541  DPRINT1("Failed to create a new PDEV\n");
542  goto leave2;
543  }
544 
545  /* 3. Create a new surface */
546  pSurface = PDEVOBJ_pSurface(ppdevTmp);
547  if (!pSurface)
548  {
549  DPRINT1("PDEVOBJ_pSurface failed\n");
550  PDEVOBJ_vRelease(ppdevTmp);
551  goto leave2;
552  }
553 
554  /* 4. Get DirectDraw information */
555  /* 5. Enable DirectDraw Not traced */
556  /* 6. Copy old PDEV state to new PDEV instance */
557 
558  /* 7. Switch the PDEVs */
559  PDEVOBJ_vSwitchPdev(ppdev, ppdevTmp);
560 
561  /* 8. Disable DirectDraw */
562 
563  PDEVOBJ_vRelease(ppdevTmp);
564 
565  /* Update primary display capabilities */
566  if (ppdev == gppdevPrimary)
567  {
568  PDEVOBJ_vGetDeviceCaps(ppdev, &GdiHandleTable->DevCaps);
569  }
570 
571  /* Success! */
572  retval = TRUE;
573 
574 leave2:
575  /* Set the new video mode, or restore the original one in case of failure */
576  if (!ppdev->pfn.AssertMode(ppdev->dhpdev, TRUE))
577  {
578  DPRINT1("DrvAssertMode(TRUE) failed\n");
579  }
580 
581 leave:
582  /* Unlock everything else */
584  /* Unlock the PDEV */
586 
587  DPRINT1("leave, ppdev = %p, pSurface = %p\n", ppdev, ppdev->pSurface);
588 
589  return retval;
590 }
591 
592 
593 PPDEVOBJ
594 NTAPI
596  _In_opt_ PUNICODE_STRING pustrDeviceName)
597 {
598  UNICODE_STRING ustrCurrent;
599  PPDEVOBJ ppdev;
600  PGRAPHICS_DEVICE pGraphicsDevice;
601 
602  /* Acquire PDEV lock */
604 
605  /* Did the caller pass a device name? */
606  if (pustrDeviceName)
607  {
608  /* Loop all present PDEVs */
609  for (ppdev = gppdevList; ppdev; ppdev = ppdev->ppdevNext)
610  {
611  /* Get a pointer to the GRAPHICS_DEVICE */
612  pGraphicsDevice = ppdev->pGraphicsDevice;
613 
614  /* Compare the name */
615  RtlInitUnicodeString(&ustrCurrent, pGraphicsDevice->szWinDeviceName);
616  if (RtlEqualUnicodeString(pustrDeviceName, &ustrCurrent, FALSE))
617  {
618  /* Found! */
619  break;
620  }
621  }
622  }
623  else
624  {
625  /* Otherwise use the primary PDEV */
626  ppdev = gppdevPrimary;
627  }
628 
629  /* Did we find one? */
630  if (ppdev)
631  {
632  /* Yes, reference the PDEV */
633  PDEVOBJ_vReference(ppdev);
634  }
635  else
636  {
637  /* No, create a new PDEV for the given device */
638  ppdev = EngpCreatePDEV(pustrDeviceName, NULL);
639  if (ppdev)
640  {
641  /* Insert the PDEV into the list */
642  ppdev->ppdevNext = gppdevList;
643  gppdevList = ppdev;
644 
645  /* Set as primary PDEV, if we don't have one yet */
646  if (!gppdevPrimary)
647  {
648  gppdevPrimary = ppdev;
650  }
651  }
652  }
653 
654  /* Release PDEV lock */
656 
657  return ppdev;
658 }
659 
660 INT
661 NTAPI
663 {
664  INT ret = CM_NONE;
665 
666  if (ppdev->flFlags & PDEV_DISPLAY)
667  {
668  if (ppdev->devinfo.iDitherFormat == BMF_8BPP ||
670  ret = CM_GAMMA_RAMP;
671  }
672 
674  ret |= CM_CMYK_COLOR;
675  if (ppdev->devinfo.flGraphicsCaps & GCAPS_ICM)
676  ret |= CM_DEVICE_ICM;
677 
678  return ret;
679 }
680 
681 VOID
682 NTAPI
684  IN PPDEVOBJ ppdev,
686 {
687  PGDIINFO pGdiInfo = &ppdev->gdiinfo;
688 
689  pDevCaps->ulVersion = pGdiInfo->ulVersion;
690  pDevCaps->ulTechnology = pGdiInfo->ulTechnology;
691  pDevCaps->ulHorzSizeM = (pGdiInfo->ulHorzSize + 500) / 1000;
692  pDevCaps->ulVertSizeM = (pGdiInfo->ulVertSize + 500) / 1000;
693  pDevCaps->ulHorzSize = pGdiInfo->ulHorzSize;
694  pDevCaps->ulVertSize = pGdiInfo->ulVertSize;
695  pDevCaps->ulHorzRes = pGdiInfo->ulHorzRes;
696  pDevCaps->ulVertRes = pGdiInfo->ulVertRes;
697  pDevCaps->ulBitsPixel = pGdiInfo->cBitsPixel;
698  if (pDevCaps->ulBitsPixel == 15) pDevCaps->ulBitsPixel = 16;
699  pDevCaps->ulPlanes = pGdiInfo->cPlanes;
700  pDevCaps->ulNumPens = pGdiInfo->ulNumColors;
701  if (pDevCaps->ulNumPens != -1) pDevCaps->ulNumPens *= 5;
702  pDevCaps->ulNumFonts = 0; // PDEVOBJ_cFonts(ppdev);
703  pDevCaps->ulNumColors = pGdiInfo->ulNumColors;
704  pDevCaps->ulRasterCaps = pGdiInfo->flRaster;
705  pDevCaps->ulAspectX = pGdiInfo->ulAspectX;
706  pDevCaps->ulAspectY = pGdiInfo->ulAspectY;
707  pDevCaps->ulAspectXY = pGdiInfo->ulAspectXY;
708  pDevCaps->ulLogPixelsX = pGdiInfo->ulLogPixelsX;
709  pDevCaps->ulLogPixelsY = pGdiInfo->ulLogPixelsY;
710  pDevCaps->ulSizePalette = pGdiInfo->ulNumPalReg;
711  pDevCaps->ulColorRes = pGdiInfo->ulDACRed +
712  pGdiInfo->ulDACGreen +
713  pGdiInfo->ulDACBlue;
714  pDevCaps->ulPhysicalWidth = pGdiInfo->szlPhysSize.cx;
718  pDevCaps->ulTextCaps = pGdiInfo->flTextCaps;
720  if (pGdiInfo->ulTechnology != DT_PLOTTER)
722  pDevCaps->ulVRefresh = pGdiInfo->ulVRefresh;
723  pDevCaps->ulDesktopHorzRes = pGdiInfo->ulHorzRes;
724  pDevCaps->ulDesktopVertRes = pGdiInfo->ulVertRes;
730  pDevCaps->ulShadeBlend = pGdiInfo->flShadeBlend;
732 }
733 
734 
738 LPWSTR
739 APIENTRY
741 {
742  PPDEVOBJ ppdev = (PPDEVOBJ)hdev;
743 
744  ASSERT(ppdev);
745  ASSERT(ppdev->pldev);
746  ASSERT(ppdev->pldev->pGdiDriverInfo);
747  ASSERT(ppdev->pldev->pGdiDriverInfo->DriverName.Buffer);
748 
749  return ppdev->pldev->pGdiDriverInfo->DriverName.Buffer;
750 }
751 
752 
753 INT
754 APIENTRY
756  HDC hdc,
757  INT Index)
758 {
759  PDC pdc;
760  DEVCAPS devcaps;
761 
762  /* Lock the given DC */
763  pdc = DC_LockDc(hdc);
764  if (!pdc)
765  {
767  return 0;
768  }
769 
770  /* Get the data */
771  PDEVOBJ_vGetDeviceCaps(pdc->ppdev, &devcaps);
772 
773  /* Unlock the DC */
774  DC_UnlockDc(pdc);
775 
776  /* Return capability */
777  switch (Index)
778  {
779  case DRIVERVERSION:
780  return devcaps.ulVersion;
781 
782  case TECHNOLOGY:
783  return devcaps.ulTechnology;
784 
785  case HORZSIZE:
786  return devcaps.ulHorzSize;
787 
788  case VERTSIZE:
789  return devcaps.ulVertSize;
790 
791  case HORZRES:
792  return devcaps.ulHorzRes;
793 
794  case VERTRES:
795  return devcaps.ulVertRes;
796 
797  case LOGPIXELSX:
798  return devcaps.ulLogPixelsX;
799 
800  case LOGPIXELSY:
801  return devcaps.ulLogPixelsY;
802 
803  case BITSPIXEL:
804  return devcaps.ulBitsPixel;
805 
806  case PLANES:
807  return devcaps.ulPlanes;
808 
809  case NUMBRUSHES:
810  return -1;
811 
812  case NUMPENS:
813  return devcaps.ulNumPens;
814 
815  case NUMFONTS:
816  return devcaps.ulNumFonts;
817 
818  case NUMCOLORS:
819  return devcaps.ulNumColors;
820 
821  case ASPECTX:
822  return devcaps.ulAspectX;
823 
824  case ASPECTY:
825  return devcaps.ulAspectY;
826 
827  case ASPECTXY:
828  return devcaps.ulAspectXY;
829 
830  case CLIPCAPS:
831  return CP_RECTANGLE;
832 
833  case SIZEPALETTE:
834  return devcaps.ulSizePalette;
835 
836  case NUMRESERVED:
837  return 20;
838 
839  case COLORRES:
840  return devcaps.ulColorRes;
841 
842  case DESKTOPVERTRES:
843  return devcaps.ulVertRes;
844 
845  case DESKTOPHORZRES:
846  return devcaps.ulHorzRes;
847 
848  case BLTALIGNMENT:
849  return devcaps.ulBltAlignment;
850 
851  case SHADEBLENDCAPS:
852  return devcaps.ulShadeBlend;
853 
854  case COLORMGMTCAPS:
855  return devcaps.ulColorMgmtCaps;
856 
857  case PHYSICALWIDTH:
858  return devcaps.ulPhysicalWidth;
859 
860  case PHYSICALHEIGHT:
861  return devcaps.ulPhysicalHeight;
862 
863  case PHYSICALOFFSETX:
864  return devcaps.ulPhysicalOffsetX;
865 
866  case PHYSICALOFFSETY:
867  return devcaps.ulPhysicalOffsetY;
868 
869  case VREFRESH:
870  return devcaps.ulVRefresh;
871 
872  case RASTERCAPS:
873  return devcaps.ulRasterCaps;
874 
875  case CURVECAPS:
876  return (CC_CIRCLES | CC_PIE | CC_CHORD | CC_ELLIPSES | CC_WIDE |
878 
879  case LINECAPS:
882 
883  case POLYGONALCAPS:
886 
887  case TEXTCAPS:
888  return devcaps.ulTextCaps;
889 
890  case CAPS1:
891  case PDEVICESIZE:
892  case SCALINGFACTORX:
893  case SCALINGFACTORY:
894  default:
895  return 0;
896  }
897 
898  return 0;
899 }
900 
901 _Success_(return!=FALSE)
902 BOOL
903 APIENTRY
904 NtGdiGetDeviceCapsAll(
905  IN HDC hDC,
907 {
908  PDC pdc;
909  DEVCAPS devcaps;
910  BOOL bResult = TRUE;
911 
912  /* Lock the given DC */
913  pdc = DC_LockDc(hDC);
914  if (!pdc)
915  {
917  return FALSE;
918  }
919 
920  /* Get the data */
921  PDEVOBJ_vGetDeviceCaps(pdc->ppdev, &devcaps);
922 
923  /* Unlock the DC */
924  DC_UnlockDc(pdc);
925 
926  /* Copy data to caller */
927  _SEH2_TRY
928  {
929  ProbeForWrite(pDevCaps, sizeof(DEVCAPS), 1);
930  RtlCopyMemory(pDevCaps, &devcaps, sizeof(DEVCAPS));
931  }
933  {
935  bResult = FALSE;
936  }
937  _SEH2_END;
938 
939  return bResult;
940 }
941 
942 DHPDEV
943 APIENTRY
945  IN HDEV hdev)
946 {
947  PPDEVOBJ ppdev;
948  DHPDEV dhpdev = NULL;
949 
950  /* Check parameter */
951  if (!hdev || (PCHAR)hdev < (PCHAR)MmSystemRangeStart)
952  return NULL;
953 
954  /* Lock PDEV list */
955  EngAcquireSemaphoreShared(ghsemPDEV);
956 
957  /* Walk through the list of PDEVs */
958  for (ppdev = gppdevList; ppdev; ppdev = ppdev->ppdevNext)
959  {
960  /* Compare with the given HDEV */
961  if (ppdev == (PPDEVOBJ)hdev)
962  {
963  /* Found the PDEV! Get it's dhpdev and break */
964  dhpdev = ppdev->dhpdev;
965  break;
966  }
967  }
968 
969  /* Unlock PDEV list */
971 
972  return dhpdev;
973 }
974 
975 PSIZEL
976 FASTCALL
978 {
979  if (ppdev->flFlags & PDEV_META_DEVICE)
980  {
981  psizl->cx = ppdev->ulHorzRes;
982  psizl->cy = ppdev->ulVertRes;
983  }
984  else
985  {
986  psizl->cx = ppdev->gdiinfo.ulHorzRes;
987  psizl->cy = ppdev->gdiinfo.ulVertRes;
988  }
989  return psizl;
990 }
DHPDEV dhpdev
Definition: pdevobj.h:121
#define CP_RECTANGLE
Definition: wingdi.h:825
BOOL NTAPI PDEVOBJ_bSwitchMode(PPDEVOBJ ppdev, PDEVMODEW pdm)
Definition: pdevobj.c:509
SIZEL szlPhysSize
Definition: winddi.h:901
#define DESKTOPHORZRES
Definition: wingdi.h:741
BOOLEAN EngpPopulateDeviceModeList(_Inout_ PGRAPHICS_DEVICE pGraphicsDevice, _In_ PDEVMODEW pdmDefault)
Definition: device.c:36
signed char * PCHAR
Definition: retypes.h:7
#define CC_PIE
Definition: wingdi.h:761
_Out_ PDEVCAPS pDevCaps
Definition: ntgdi.h:2664
#define DESKTOPVERTRES
Definition: wingdi.h:742
VOID WINAPI EngReleaseSemaphore(IN HSEMAPHORE hsem)
Definition: eng.c:235
#define NUMBRUSHES
Definition: wingdi.h:721
#define _Ret_z_
Definition: no_sal2.h:625
#define CC_CHORD
Definition: wingdi.h:762
BOOL NTAPI PDEVOBJ_bEnablePDEV(PPDEVOBJ ppdev, PDEVMODEW pdevmode, PWSTR pwszLogAddress)
Definition: pdevobj.c:161
#define BITSPIXEL
Definition: wingdi.h:719
#define IN
Definition: typedefs.h:38
LONG cPdevRefs
Definition: pdevobj.h:86
#define RC_STRETCHBLT
Definition: wingdi.h:754
#define HORZRES
Definition: wingdi.h:715
#define LOGPIXELSX
Definition: wingdi.h:717
#define _Must_inspect_result_
Definition: no_sal2.h:314
#define TC_UA_ABLE
Definition: wingdi.h:817
ULONG flShadeBlend
Definition: winddi.h:920
ULONG ulBltAlignment
Definition: ntgdityp.h:326
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define NUMRESERVED
Definition: wingdi.h:732
#define HS_DDI_MAX
Definition: winddi.h:3954
#define LC_WIDE
Definition: wingdi.h:774
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define GCAPS_CMYKCOLOR
Definition: winddi.h:347
#define GDITAG_DEVMODE
Definition: tags.h:73
typedef DHPDEV(APIENTRY FN_DrvEnablePDEV)(_In_ DEVMODEW *pdm
ULONG ulHorzRes
Definition: ntgdityp.h:303
INT NTAPI PDEVOBJ_iGetColorManagementCaps(PPDEVOBJ ppdev)
Definition: pdevobj.c:662
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
ULONG ulDACRed
Definition: winddi.h:891
PDEVICE_OBJECT DeviceObject
Definition: pdevobj.h:63
struct _LDEVOBJ * pldev
Definition: pdevobj.h:120
#define PC_INTERIORS
Definition: wingdi.h:803
#define RC_BIGFONT
Definition: wingdi.h:780
DWORD dmFields
Definition: wingdi.h:1621
#define SURFACE_ShareUnlockSurface(pBMObj)
Definition: surface.h:102
PFN_DrvMovePointer pfnMovePointer
Definition: pdevobj.h:114
#define ASPECTX
Definition: wingdi.h:726
ULONG ulVertSizeM
Definition: ntgdityp.h:300
WCHAR szWinDeviceName[CCHDEVICENAME/2]
Definition: pdevobj.h:60
ULONG ulRasterCaps
Definition: ntgdityp.h:310
FORCEINLINE VOID PDEVOBJ_vReference(_In_ PPDEVOBJ ppdev)
Definition: pdevobj.h:167
#define RC_GDI20_OUTPUT
Definition: wingdi.h:785
PSURFACE NTAPI PDEVOBJ_pSurface(PPDEVOBJ ppdev)
Definition: pdevobj.c:234
uint16_t * PWSTR
Definition: typedefs.h:54
#define LC_POLYLINE
Definition: wingdi.h:771
GDIINFO gdiinfo
Definition: pdevobj.h:124
PPDEVOBJ gppdevPrimary
Definition: pdevobj.c:13
_Must_inspect_result_ _Ret_z_ LPWSTR APIENTRY EngGetDriverName(_In_ HDEV hdev)
Definition: pdevobj.c:740
DWORD StateFlags
Definition: pdevobj.h:66
#define CC_STYLED
Definition: wingdi.h:765
ULONG ulNumFonts
Definition: ntgdityp.h:308
ULONG yPanningAlignment
Definition: winddi.h:914
ULONG ulAspectY
Definition: winddi.h:895
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
ULONG ulDesktopVertRes
Definition: ntgdityp.h:325
LONG NTSTATUS
Definition: precomp.h:26
#define COLORRES
Definition: wingdi.h:733
static HDC
Definition: imagelist.c:92
#define DRIVERVERSION
Definition: wingdi.h:704
#define PDEVICESIZE
Definition: wingdi.h:729
_Requires_lock_not_held_ hsem ENGAPI VOID APIENTRY EngDeleteSemaphore(_Inout_ __drv_freesMem(Mem) HSEMAPHORE hsem)
Definition: semaphor.c:106
#define BLTALIGNMENT
Definition: wingdi.h:743
ULONG ulHorzSize
Definition: ntgdityp.h:301
PDEVMODEENTRY pDevModeList
Definition: pdevobj.h:70
#define SCALINGFACTORX
Definition: wingdi.h:738
#define RC_BITMAP64
Definition: wingdi.h:782
ULONG ulLogPixelsY
Definition: winddi.h:889
ULONG ulPanningHorzRes
Definition: winddi.h:911
#define LC_POLYMARKER
Definition: wingdi.h:773
#define POLYGONALCAPS
Definition: wingdi.h:778
ULONG ulBitsPixel
Definition: ntgdityp.h:305
ULONG cPlanes
Definition: winddi.h:885
#define SURFACE_ShareLockSurface(hBMObj)
Definition: surface.h:91
#define PC_WINDPOLYGON
Definition: wingdi.h:797
DWORD dmBitsPerPel
Definition: wingdi.h:1646
ULONG flTextCaps
Definition: winddi.h:890
PGRAPHICS_DEVICE gpPrimaryGraphicsDevice
Definition: device.c:15
#define TC_SO_ABLE
Definition: wingdi.h:818
ULONG ulPhysicalHeight
Definition: ntgdityp.h:319
#define RASTERCAPS
Definition: wingdi.h:744
#define FASTCALL
Definition: nt_native.h:50
#define DT_RASDISPLAY
Definition: wingdi.h:707
static PPDEVOBJ EngpCreatePDEV(PUNICODE_STRING pustrDeviceName, PDEVMODEW pdm)
Definition: pdevobj.c:346
int32_t INT
Definition: typedefs.h:56
#define TECHNOLOGY
Definition: wingdi.h:705
ULONG ulVRefresh
Definition: ntgdityp.h:323
#define RC_FLOODFILL
Definition: wingdi.h:750
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
PDEVMODEW pdm
Definition: pdevobj.h:53
#define _In_opt_
Definition: no_sal2.h:213
LONG y
Definition: windef.h:330
struct _PDEVOBJ * ppdevNext
Definition: pdevobj.h:85
_SEH2_TRY
Definition: create.c:4250
#define DM_PELSWIDTH
Definition: wingdi.h:1268
#define TEXTCAPS
Definition: wingdi.h:805
struct _PDEVOBJ * PPDEVOBJ
ULONG ulPanningVertRes
Definition: ntgdityp.h:328
#define PHYSICALHEIGHT
Definition: wingdi.h:735
PLDEVOBJ NTAPI EngLoadImageEx(_In_z_ LPWSTR pwszDriverName, _In_ ULONG ldevtype)
Definition: ldevobj.c:328
ULONG ulNumPalReg
Definition: winddi.h:902
ULONG ulShadeBlend
Definition: ntgdityp.h:331
ULONG ulVertSize
Definition: winddi.h:881
long right
Definition: polytest.cpp:53
#define PC_WIDESTYLED
Definition: wingdi.h:802
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
INT APIENTRY NtGdiGetDeviceCaps(HDC hdc, INT Index)
Definition: pdevobj.c:755
PGRAPHICS_DEVICE NTAPI EngpFindGraphicsDevice(_In_opt_ PUNICODE_STRING pustrDevice, _In_ ULONG iDevNum, _In_ DWORD dwFlags)
Definition: device.c:369
ULONG ulDACGreen
Definition: winddi.h:892
#define NUMCOLORS
Definition: wingdi.h:724
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
POINTL ptlPhysOffset
Definition: winddi.h:900
FLONG flFlags
Definition: pdevobj.h:89
ULONG ulVersion
Definition: winddi.h:878
unsigned int BOOL
Definition: ntddk_ex.h:94
ULONG ulNumPens
Definition: ntgdityp.h:307
ULONG ulVertRes
Definition: ntgdityp.h:304
RECTL Exclude
Definition: pdevobj.h:39
SURFOBJ SurfObj
Definition: surface.h:8
#define VREFRESH
Definition: wingdi.h:740
LPWSTR pwszDescription
Definition: pdevobj.h:72
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define CC_INTERIORS
Definition: wingdi.h:767
ULONG ulVertSize
Definition: ntgdityp.h:302
static HSEMAPHORE ghsemPDEV
Definition: pdevobj.c:16
ULONG ulHorzRes
Definition: winddi.h:882
ENGAPI VOID APIENTRY EngAcquireSemaphore(_Inout_ HSEMAPHORE hsem)
smooth NULL
Definition: ftsmooth.c:416
ULONG xPanningAlignment
Definition: ntgdityp.h:329
ULONG ulAspectXY
Definition: ntgdityp.h:313
#define LC_MARKER
Definition: wingdi.h:772
#define FORCEINLINE
Definition: ntbasedef.h:221
LONG cx
Definition: windef.h:334
ULONG ulTechnology
Definition: winddi.h:879
void DPRINT(...)
Definition: polytest.cpp:61
PDEVMODEW pdmwDev
Definition: pdevobj.h:130
HSEMAPHORE hsemDevLock
Definition: pdevobj.h:91
DRIVER_FUNCTIONS pfn
Definition: pdevobj.h:139
ULONG iDitherFormat
Definition: winddi.h:395
VOID NTAPI PDEVOBJ_vGetDeviceCaps(IN PPDEVOBJ ppdev, OUT PDEVCAPS pDevCaps)
Definition: pdevobj.c:683
HSURF gahsurfHatch[HS_DDI_MAX]
Definition: engbrush.c:24
ULONG ulAspectXY
Definition: winddi.h:896
ULONG xPanningAlignment
Definition: winddi.h:913
#define PALETTE_ShareLockPalette(hpal)
Definition: palette.h:57
#define TC_VA_ABLE
Definition: wingdi.h:820
typedef HSURF(APIENTRY FN_DrvEnableSurface)(_In_ DHPDEV dhpdev)
#define SCALINGFACTORY
Definition: wingdi.h:739
#define TC_OP_STROKE
Definition: wingdi.h:807
#define PC_STYLED
Definition: wingdi.h:801
VOID NTAPI PDEVOBJ_vCompletePDEV(PPDEVOBJ ppdev)
Definition: pdevobj.c:225
BASEOBJECT BaseObject
Definition: surface.h:6
#define CC_WIDE
Definition: wingdi.h:764
ULONG ulColorRes
Definition: ntgdityp.h:317
ULONG ulPhysicalOffsetY
Definition: ntgdityp.h:321
#define LC_STYLED
Definition: wingdi.h:775
ULONG ulAspectY
Definition: ntgdityp.h:312
#define GCAPS2_CHANGEGAMMARAMP
Definition: winddi.h:370
#define DISPLAY_DEVICE_PRIMARY_DEVICE
Definition: wingdi.h:1397
#define PC_WIDE
Definition: wingdi.h:800
#define GdiHandleTable
Definition: win32nt.h:35
ULONG ulPlanes
Definition: ntgdityp.h:306
Definition: polytest.cpp:40
#define ASPECTXY
Definition: wingdi.h:728
static PPDEVOBJ gppdevList
Definition: pdevobj.c:15
#define RC_OP_DX_OUTPUT
Definition: wingdi.h:788
ULONG ulVersion
Definition: ntgdityp.h:297
ULONG ulBltAlignment
Definition: winddi.h:910
ULONG ulDACBlue
Definition: winddi.h:893
_In_ DD_SURFACE_LOCAL * pSurface
Definition: winddi.h:3481
#define PHYSICALOFFSETY
Definition: wingdi.h:737
DWORD_PTR HSEMAPHORE
Definition: axcore.idl:60
LPWSTR pDiplayDrivers
Definition: pdevobj.h:71
ULONG cDevModes
Definition: pdevobj.h:69
struct _DEVMODEINFO * pdmiNext
Definition: pdevobj.h:44
DEVINFO devinfo
Definition: pdevobj.h:123
#define DISPLAY_DEVICE_ATTACHED_TO_DESKTOP
Definition: wingdi.h:1395
#define RC_PALETTE
Definition: wingdi.h:789
#define CC_ROUNDRECT
Definition: wingdi.h:768
#define ASPECTY
Definition: wingdi.h:727
static const UCHAR Index[8]
Definition: usbohci.c:18
static VOID PDEVOBJ_vDeletePDEV(PPDEVOBJ ppdev)
Definition: pdevobj.c:82
unsigned long DWORD
Definition: ntddk_ex.h:95
LONG x
Definition: windef.h:329
#define CLIPCAPS
Definition: wingdi.h:730
#define RC_BITBLT
Definition: wingdi.h:781
#define _Inout_
Definition: no_sal2.h:244
#define DT_PLOTTER
Definition: wingdi.h:706
ULONG ulHorzRes
Definition: pdevobj.h:110
ULONG ulHorzSize
Definition: winddi.h:880
PSIZEL FASTCALL PDEVOBJ_sizl(PPDEVOBJ ppdev, PSIZEL psizl)
Definition: pdevobj.c:977
ULONG ulPanningHorzRes
Definition: ntgdityp.h:327
_In_ LPWSTR pwszLogAddress
Definition: winddi.h:3548
WCHAR dmDeviceName[CCHDEVICENAME]
Definition: wingdi.h:1616
HANDLE hSpooler
Definition: pdevobj.h:126
ULONG ulDesktopHorzRes
Definition: ntgdityp.h:324
DWORD dmPelsWidth
Definition: wingdi.h:1647
#define LC_WIDESTYLED
Definition: wingdi.h:776
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define SIZEPALETTE
Definition: wingdi.h:731
#define DT_CHARSTREAM
Definition: wingdi.h:710
VOID NTAPI PDEVOBJ_vSwitchPdev(PPDEVOBJ ppdev, PPDEVOBJ ppdev2)
Definition: pdevobj.c:455
int ret
INIT_FUNCTION NTSTATUS NTAPI InitPDEVImpl(VOID)
Definition: pdevobj.c:21
#define GCAPS_ICM
Definition: winddi.h:346
#define InterlockedDecrement
Definition: armddk.h:52
HDEV hdev
Definition: winddi.h:1208
ULONG ulLogPixelsY
Definition: ntgdityp.h:315
HDC hdc
Definition: main.c:9
ULONG flRaster
Definition: winddi.h:887
ULONG ulVRefresh
Definition: winddi.h:909
#define DM_DISPLAYFREQUENCY
Definition: wingdi.h:1271
#define CC_ELLIPSES
Definition: wingdi.h:763
#define TC_OP_CHARACTER
Definition: wingdi.h:806
ULONG ulPhysicalOffsetX
Definition: ntgdityp.h:320
DHPDEV APIENTRY NtGdiGetDhpdev(IN HDEV hdev)
Definition: pdevobj.c:944
ULONG cBitsPixel
Definition: winddi.h:884
ULONG ulAspectX
Definition: winddi.h:894
PDEVMODEW NTAPI PDEVOBJ_pdmMatchDevMode(PPDEVOBJ ppdev, PDEVMODEW pdm)
Definition: pdevobj.c:307
#define CAPS1
Definition: mmsystem.h:934
#define RC_DI_BITMAP
Definition: wingdi.h:784
VOID FASTCALL SetLastNtError(NTSTATUS Status)
Definition: error.c:36
struct _EDD_DIRECTDRAW_GLOBAL * pEDDgpl
Definition: pdevobj.h:150
#define GDITAG_GDEVICE
Definition: tags.h:98
PFN_DrvMovePointer MovePointer
Definition: ntgdityp.h:598
#define HORZSIZE
Definition: wingdi.h:713
ULONG ulVertRes
Definition: pdevobj.h:111
#define _In_
Definition: no_sal2.h:204
#define PHYSICALOFFSETX
Definition: wingdi.h:736
static HDC hDC
Definition: 3dtext.c:33
DWORD dmDisplayFrequency
Definition: wingdi.h:1653
#define PHYSICALWIDTH
Definition: wingdi.h:734
#define PC_RECTANGLE
Definition: wingdi.h:796
#define VERTSIZE
Definition: wingdi.h:714
_Success_(return!=FALSE)
Definition: pdevobj.c:901
_SEH2_END
Definition: create.c:4424
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
#define RC_STRETCHDIB
Definition: wingdi.h:755
#define NUMPENS
Definition: wingdi.h:722
#define LINECAPS
Definition: wingdi.h:769
static calc_node_t temp
Definition: rpn_ieee.c:38
#define DM_PELSHEIGHT
Definition: wingdi.h:1269
FLONG flGraphicsCaps
Definition: winddi.h:390
ULONG ulTextCaps
Definition: ntgdityp.h:322
PFN_DrvAssertMode AssertMode
Definition: ntgdityp.h:573
#define PALETTE_ShareUnlockPalette(ppal)
Definition: palette.h:59
PPDEVOBJ PDEVOBJ_AllocPDEV(VOID)
Definition: pdevobj.c:53
unsigned int * PULONG
Definition: retypes.h:1
VOID NTAPI GDIOBJ_vReferenceObjectByPointer(POBJ pobj)
Definition: gdiobj.c:731
ULONG ulPhysicalWidth
Definition: ntgdityp.h:318
#define VERTRES
Definition: wingdi.h:716
PSURFACE pSurface
Definition: pdevobj.h:125
#define RC_DIBTODEV
Definition: wingdi.h:749
ULONG ulPanningVertRes
Definition: winddi.h:912
GDIPOINTER Pointer
Definition: pdevobj.h:145
#define PC_POLYGON
Definition: wingdi.h:793
ULONG ulNumColors
Definition: winddi.h:886
#define DPRINT1
Definition: precomp.h:8
#define PC_SCANLINE
Definition: wingdi.h:798
DWORD dmPelsHeight
Definition: wingdi.h:1648
VOID NTAPI PDEVOBJ_vRefreshModeList(PPDEVOBJ ppdev)
Definition: pdevobj.c:264
ULONG ulAspectX
Definition: ntgdityp.h:311
#define OUT
Definition: typedefs.h:39
HSEMAPHORE WINAPI EngCreateSemaphore(VOID)
Definition: eng.c:75
FN_DrvEnablePDEV * PFN_DrvEnablePDEV
Definition: winddi.h:3558
unsigned int ULONG
Definition: retypes.h:1
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
ULONG ulColorMgmtCaps
Definition: ntgdityp.h:332
ENGAPI VOID APIENTRY EngMovePointer(_In_ SURFOBJ *pso, _In_ LONG x, _In_ LONG y, _In_ RECTL *prcl)
Definition: mouse.c:566
ULONG ulHorzSizeM
Definition: ntgdityp.h:299
#define LOGPIXELSY
Definition: wingdi.h:718
#define DM_BITSPERPEL
Definition: wingdi.h:1267
ULONG ulNumColors
Definition: ntgdityp.h:309
#define CC_WIDESTYLED
Definition: wingdi.h:766
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
PFN_DrvCompletePDEV CompletePDEV
Definition: ntgdityp.h:569
Definition: xlate.c:10
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
ULONG ulLogPixelsX
Definition: winddi.h:888
ULONG ulVertRes
Definition: winddi.h:883
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define GCAPS_PALMANAGED
Definition: winddi.h:341
VOID NTAPI PDEVOBJ_vRelease(_Inout_ PPDEVOBJ ppdev)
Definition: pdevobj.c:93
ULONG ulSizePalette
Definition: ntgdityp.h:316
ULONG yPanningAlignment
Definition: ntgdityp.h:330
HSURF ahsurf[HS_DDI_MAX]
Definition: pdevobj.h:99
#define CC_CIRCLES
Definition: wingdi.h:760
ULONG ulLogPixelsX
Definition: ntgdityp.h:314
return STATUS_SUCCESS
Definition: btrfs.c:2938
#define LC_INTERIORS
Definition: wingdi.h:777
PDEVMODEINFO pdevmodeInfo
Definition: pdevobj.h:68
PGRAPHICS_DEVICE pGraphicsDevice
Definition: pdevobj.h:128
#define TC_CP_STROKE
Definition: wingdi.h:808
#define CURVECAPS
Definition: wingdi.h:758
#define NUMFONTS
Definition: wingdi.h:723
FORCEINLINE VOID SwitchPointer(_Inout_ PVOID pvPointer1, _Inout_ PVOID pvPointer2)
Definition: pdevobj.c:440
#define GDITAG_PDEV
Definition: tags.h:74
LONG cy
Definition: windef.h:335
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive)
FLONG flGraphicsCaps2
Definition: winddi.h:399
#define MmSystemRangeStart
Definition: mm.h:32
_In_ HDEV hdev
Definition: winddi.h:3449
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
ULONG iDefaultMode
Definition: pdevobj.h:77
ULONG ulTechnology
Definition: ntgdityp.h:298
#define APIENTRY
Definition: api.h:79
PPDEVOBJ NTAPI EngpGetPDEV(_In_opt_ PUNICODE_STRING pustrDeviceName)
Definition: pdevobj.c:595
PPDEVOBJ NTAPI DbgLookupDHPDEV(DHPDEV dhpdev)
#define PLANES
Definition: wingdi.h:720
#define NT_ASSERT
Definition: rtlfuncs.h:3312