ReactOS  0.4.14-dev-50-g13bb5e2
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 {
95  /* Lock loader */
97 
98  /* Decrease reference count */
99  --ppdev->cPdevRefs;
100 
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 */
111  ppdev->pfn.DisableSurface(ppdev->dhpdev);
112  }
113 
114  /* Do we have a palette? */
115  if(ppdev->ppalSurf)
116  {
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  gppdevList = ppdev->ppdevNext ;
130  else
131  {
132  PPDEVOBJ ppdevCurrent = gppdevList;
133  BOOL found = FALSE ;
134  while (!found && ppdevCurrent->ppdevNext)
135  {
136  if (ppdevCurrent->ppdevNext == ppdev)
137  found = TRUE;
138  else
139  ppdevCurrent = ppdevCurrent->ppdevNext ;
140  }
141  if(found)
142  ppdevCurrent->ppdevNext = ppdev->ppdevNext;
143  }
144 
145  /* Is this the primary one ? */
146  if (ppdev == gppdevPrimary)
148 
149  /* Free it */
150  PDEVOBJ_vDeletePDEV(ppdev);
151  }
152 
153  /* Unlock loader */
155 
156 }
157 
158 BOOL
159 NTAPI
161  PPDEVOBJ ppdev,
162  PDEVMODEW pdevmode,
164 {
165  PFN_DrvEnablePDEV pfnEnablePDEV;
166  ULONG i;
167 
168  DPRINT("PDEVOBJ_bEnablePDEV()\n");
169 
170  /* Get the DrvEnablePDEV function */
171  pfnEnablePDEV = ppdev->pldev->pfn.EnablePDEV;
172 
173  /* Call the drivers DrvEnablePDEV function */
174  ppdev->dhpdev = pfnEnablePDEV(pdevmode,
176  HS_DDI_MAX,
177  ppdev->ahsurf,
178  sizeof(GDIINFO),
179  (PULONG)&ppdev->gdiinfo,
180  sizeof(DEVINFO),
181  &ppdev->devinfo,
182  (HDEV)ppdev,
184  ppdev->pGraphicsDevice->DeviceObject);
185  if (ppdev->dhpdev == NULL)
186  {
187  DPRINT1("Failed to enable PDEV\n");
188  return FALSE;
189  }
190 
191  /* Fix up some values */
192  if (ppdev->gdiinfo.ulLogPixelsX == 0)
193  ppdev->gdiinfo.ulLogPixelsX = 96;
194 
195  if (ppdev->gdiinfo.ulLogPixelsY == 0)
196  ppdev->gdiinfo.ulLogPixelsY = 96;
197 
198  /* Set raster caps */
199  ppdev->gdiinfo.flRaster = RC_OP_DX_OUTPUT | RC_GDI20_OUTPUT | RC_BIGFONT;
200  if ((ppdev->gdiinfo.ulTechnology != DT_PLOTTER) && (ppdev->gdiinfo.ulTechnology != DT_CHARSTREAM))
201  ppdev->gdiinfo.flRaster |= RC_STRETCHDIB | RC_STRETCHBLT | RC_DIBTODEV | RC_DI_BITMAP | RC_BITMAP64 | RC_BITBLT;
202  if (ppdev->gdiinfo.ulTechnology == DT_RASDISPLAY)
203  ppdev->gdiinfo.flRaster |= RC_FLOODFILL;
204  if (ppdev->devinfo.flGraphicsCaps & GCAPS_PALMANAGED)
205  ppdev->gdiinfo.flRaster |= RC_PALETTE;
206 
207  /* Setup Palette */
208  ppdev->ppalSurf = PALETTE_ShareLockPalette(ppdev->devinfo.hpalDefault);
209 
210  /* Setup hatch brushes */
211  for (i = 0; i < HS_DDI_MAX; i++)
212  {
213  if (ppdev->ahsurf[i] == NULL)
214  ppdev->ahsurf[i] = gahsurfHatch[i];
215  }
216 
217  DPRINT("PDEVOBJ_bEnablePDEV - dhpdev = %p\n", ppdev->dhpdev);
218 
219  return TRUE;
220 }
221 
222 VOID
223 NTAPI
225  PPDEVOBJ ppdev)
226 {
227  /* Call the drivers DrvCompletePDEV function */
228  ppdev->pldev->pfn.CompletePDEV(ppdev->dhpdev, (HDEV)ppdev);
229 }
230 
231 PSURFACE
232 NTAPI
234  PPDEVOBJ ppdev)
235 {
236  HSURF hsurf;
237 
238  /* Check if there is no surface for this PDEV yet */
239  if (ppdev->pSurface == NULL)
240  {
241  /* Call the drivers DrvEnableSurface */
242  hsurf = ppdev->pldev->pfn.EnableSurface(ppdev->dhpdev);
243  if (hsurf== NULL)
244  {
245  DPRINT1("Failed to create PDEV surface!\n");
246  return NULL;
247  }
248 
249  /* Get a reference to the surface */
250  ppdev->pSurface = SURFACE_ShareLockSurface(hsurf);
251  NT_ASSERT(ppdev->pSurface != NULL);
252  }
253 
254  /* Increment reference count */
256 
257  DPRINT("PDEVOBJ_pSurface() returning %p\n", ppdev->pSurface);
258  return ppdev->pSurface;
259 }
260 
261 VOID
262 NTAPI
264  PPDEVOBJ ppdev)
265 {
266  PGRAPHICS_DEVICE pGraphicsDevice;
267  PDEVMODEINFO pdminfo, pdmiNext;
268  DEVMODEW dmDefault;
269  DEVMODEW dmCurrent;
270 
271  /* Lock the PDEV */
273 
274  pGraphicsDevice = ppdev->pGraphicsDevice;
275 
276  /* Remember our default mode */
277  dmDefault = *pGraphicsDevice->pDevModeList[pGraphicsDevice->iDefaultMode].pdm;
278  dmCurrent = *ppdev->pdmwDev;
279 
280  /* Clear out the modes */
281  for (pdminfo = pGraphicsDevice->pdevmodeInfo;
282  pdminfo;
283  pdminfo = pdmiNext)
284  {
285  pdmiNext = pdminfo->pdmiNext;
287  }
288  pGraphicsDevice->pdevmodeInfo = NULL;
289  ExFreePoolWithTag(pGraphicsDevice->pDevModeList, GDITAG_GDEVICE);
290  pGraphicsDevice->pDevModeList = NULL;
291 
292  /* Now re-populate the list */
293  if (!EngpPopulateDeviceModeList(pGraphicsDevice, &dmDefault))
294  {
295  DPRINT1("FIXME: EngpPopulateDeviceModeList failed, we just destroyed a perfectly good mode list\n");
296  }
297 
298  ppdev->pdmwDev = PDEVOBJ_pdmMatchDevMode(ppdev, &dmCurrent);
299 
300  /* Unlock PDEV */
302 }
303 
304 PDEVMODEW
305 NTAPI
307  PPDEVOBJ ppdev,
308  PDEVMODEW pdm)
309 {
310  PGRAPHICS_DEVICE pGraphicsDevice;
311  PDEVMODEW pdmCurrent;
312  ULONG i;
313  DWORD dwFields;
314 
315  pGraphicsDevice = ppdev->pGraphicsDevice;
316 
317  for (i = 0; i < pGraphicsDevice->cDevModes; i++)
318  {
319  pdmCurrent = pGraphicsDevice->pDevModeList[i].pdm;
320 
321  /* Compare asked DEVMODE fields
322  * Only compare those that are valid in both DEVMODE structs */
323  dwFields = pdmCurrent->dmFields & pdm->dmFields ;
324 
325  /* For now, we only need those */
326  if ((dwFields & DM_BITSPERPEL) &&
327  (pdmCurrent->dmBitsPerPel != pdm->dmBitsPerPel)) continue;
328  if ((dwFields & DM_PELSWIDTH) &&
329  (pdmCurrent->dmPelsWidth != pdm->dmPelsWidth)) continue;
330  if ((dwFields & DM_PELSHEIGHT) &&
331  (pdmCurrent->dmPelsHeight != pdm->dmPelsHeight)) continue;
332  if ((dwFields & DM_DISPLAYFREQUENCY) &&
333  (pdmCurrent->dmDisplayFrequency != pdm->dmDisplayFrequency)) continue;
334 
335  /* Match! Return the DEVMODE */
336  return pdmCurrent;
337  }
338 
339  /* Nothing found */
340  return NULL;
341 }
342 
343 static
344 PPDEVOBJ
346  PUNICODE_STRING pustrDeviceName,
347  PDEVMODEW pdm)
348 {
349  PGRAPHICS_DEVICE pGraphicsDevice;
350  PPDEVOBJ ppdev;
351  DPRINT("EngpCreatePDEV(%wZ, %p)\n", pustrDeviceName, pdm);
352 
353  /* Try to find the GRAPHICS_DEVICE */
354  if (pustrDeviceName)
355  {
356  pGraphicsDevice = EngpFindGraphicsDevice(pustrDeviceName, 0, 0);
357  if (!pGraphicsDevice)
358  {
359  DPRINT1("No GRAPHICS_DEVICE found for %ls!\n",
360  pustrDeviceName ? pustrDeviceName->Buffer : 0);
361  return NULL;
362  }
363  }
364  else
365  {
366  pGraphicsDevice = gpPrimaryGraphicsDevice;
367  }
368 
369  /* Allocate a new PDEVOBJ */
370  ppdev = PDEVOBJ_AllocPDEV();
371  if (!ppdev)
372  {
373  DPRINT1("failed to allocate a PDEV\n");
374  return NULL;
375  }
376 
377  /* If no DEVMODEW is given, ... */
378  if (!pdm)
379  {
380  /* ... use the device's default one */
381  pdm = pGraphicsDevice->pDevModeList[pGraphicsDevice->iDefaultMode].pdm;
382  DPRINT("Using iDefaultMode = %lu\n", pGraphicsDevice->iDefaultMode);
383  }
384 
385  /* Try to get a diplay driver */
387  if (!ppdev->pldev)
388  {
389  DPRINT1("Could not load display driver '%ls', '%ls'\n",
390  pGraphicsDevice->pDiplayDrivers,
391  pdm->dmDeviceName);
392  PDEVOBJ_vRelease(ppdev);
393  return NULL;
394  }
395 
396  /* Copy the function table */
397  ppdev->pfn = ppdev->pldev->pfn;
398 
399  /* Set MovePointer function */
400  ppdev->pfnMovePointer = ppdev->pfn.MovePointer;
401  if (!ppdev->pfnMovePointer)
403 
404  ppdev->pGraphicsDevice = pGraphicsDevice;
405 
406  // DxEngGetHdevData asks for Graphics DeviceObject in hSpooler field
407  ppdev->hSpooler = ppdev->pGraphicsDevice->DeviceObject;
408 
409  // Should we change the ative mode of pGraphicsDevice ?
410  ppdev->pdmwDev = PDEVOBJ_pdmMatchDevMode(ppdev, pdm) ;
411 
412  /* FIXME! */
413  ppdev->flFlags = PDEV_DISPLAY;
414 
415  /* HACK: Don't use the pointer */
416  ppdev->Pointer.Exclude.right = -1;
417 
418  /* Call the driver to enable the PDEV */
419  if (!PDEVOBJ_bEnablePDEV(ppdev, pdm, NULL))
420  {
421  DPRINT1("Failed to enable PDEV!\n");
422  PDEVOBJ_vRelease(ppdev);
423  return NULL;
424  }
425 
426  /* FIXME: this must be done in a better way */
428 
429  /* Tell the driver that the PDEV is ready */
430  PDEVOBJ_vCompletePDEV(ppdev);
431 
432  /* Return the PDEV */
433  return ppdev;
434 }
435 
437 VOID
439  _Inout_ PVOID pvPointer1,
440  _Inout_ PVOID pvPointer2)
441 {
442  PVOID *ppvPointer1 = pvPointer1;
443  PVOID *ppvPointer2 = pvPointer2;
444  PVOID pvTemp;
445 
446  pvTemp = *ppvPointer1;
447  *ppvPointer1 = *ppvPointer2;
448  *ppvPointer2 = pvTemp;
449 }
450 
451 VOID
452 NTAPI
454  PPDEVOBJ ppdev,
455  PPDEVOBJ ppdev2)
456 {
457  union
458  {
459  DRIVER_FUNCTIONS pfn;
460  GDIINFO gdiinfo;
461  DEVINFO devinfo;
462  DWORD StateFlags;
463  } temp;
464 
465  /* Exchange driver functions */
466  temp.pfn = ppdev->pfn;
467  ppdev->pfn = ppdev2->pfn;
468  ppdev2->pfn = temp.pfn;
469 
470  /* Exchange LDEVs */
471  SwitchPointer(&ppdev->pldev, &ppdev2->pldev);
472 
473  /* Exchange DHPDEV */
474  SwitchPointer(&ppdev->dhpdev, &ppdev2->dhpdev);
475 
476  /* Exchange surfaces and associate them with their new PDEV */
477  SwitchPointer(&ppdev->pSurface, &ppdev2->pSurface);
478  ppdev->pSurface->SurfObj.hdev = (HDEV)ppdev;
479  ppdev2->pSurface->SurfObj.hdev = (HDEV)ppdev2;
480 
481  /* Exchange devinfo */
482  temp.devinfo = ppdev->devinfo;
483  ppdev->devinfo = ppdev2->devinfo;
484  ppdev2->devinfo = temp.devinfo;
485 
486  /* Exchange gdiinfo */
487  temp.gdiinfo = ppdev->gdiinfo;
488  ppdev->gdiinfo = ppdev2->gdiinfo;
489  ppdev2->gdiinfo = temp.gdiinfo;
490 
491  /* Exchange DEVMODE */
492  SwitchPointer(&ppdev->pdmwDev, &ppdev2->pdmwDev);
493 
494  /* Exchange state flags */
495  temp.StateFlags = ppdev->pGraphicsDevice->StateFlags;
497  ppdev2->pGraphicsDevice->StateFlags = temp.StateFlags;
498 
499  /* Notify each driver instance of its new HDEV association */
500  ppdev->pfn.CompletePDEV(ppdev->dhpdev, (HDEV)ppdev);
501  ppdev2->pfn.CompletePDEV(ppdev2->dhpdev, (HDEV)ppdev2);
502 }
503 
504 
505 BOOL
506 NTAPI
508  PPDEVOBJ ppdev,
509  PDEVMODEW pdm)
510 {
511  UNICODE_STRING ustrDevice;
512  PPDEVOBJ ppdevTmp;
514  BOOL retval = FALSE;
515 
516  /* Lock the PDEV */
518 
519  /* And everything else */
521 
522  DPRINT1("PDEVOBJ_bSwitchMode, ppdev = %p, pSurface = %p\n", ppdev, ppdev->pSurface);
523 
524  // Lookup the GraphicsDevice + select DEVMODE
525  // pdm = PDEVOBJ_pdmMatchDevMode(ppdev, pdm);
526 
527  /* 1. Temporarily disable the current PDEV and reset video to its default mode */
528  if (!ppdev->pfn.AssertMode(ppdev->dhpdev, FALSE))
529  {
530  DPRINT1("DrvAssertMode(FALSE) failed\n");
531  goto leave;
532  }
533 
534  /* 2. Create new PDEV */
536  ppdevTmp = EngpCreatePDEV(&ustrDevice, pdm);
537  if (!ppdevTmp)
538  {
539  DPRINT1("Failed to create a new PDEV\n");
540  goto leave2;
541  }
542 
543  /* 3. Create a new surface */
544  pSurface = PDEVOBJ_pSurface(ppdevTmp);
545  if (!pSurface)
546  {
547  DPRINT1("PDEVOBJ_pSurface failed\n");
548  PDEVOBJ_vRelease(ppdevTmp);
549  goto leave2;
550  }
551 
552  /* 4. Get DirectDraw information */
553  /* 5. Enable DirectDraw Not traced */
554  /* 6. Copy old PDEV state to new PDEV instance */
555 
556  /* 7. Switch the PDEVs */
557  PDEVOBJ_vSwitchPdev(ppdev, ppdevTmp);
558 
559  /* 8. Disable DirectDraw */
560 
561  PDEVOBJ_vRelease(ppdevTmp);
562 
563  /* Update primary display capabilities */
564  if(ppdev == gppdevPrimary)
565  {
566  PDEVOBJ_vGetDeviceCaps(ppdev, &GdiHandleTable->DevCaps);
567  }
568 
569  /* Success! */
570  retval = TRUE;
571 
572 leave2:
573  /* Set the new video mode, or restore the original one in case of failure */
574  if (!ppdev->pfn.AssertMode(ppdev->dhpdev, TRUE))
575  {
576  DPRINT1("DrvAssertMode(TRUE) failed\n");
577  }
578 
579 leave:
580  /* Unlock everything else */
582  /* Unlock the PDEV */
584 
585  DPRINT1("leave, ppdev = %p, pSurface = %p\n", ppdev, ppdev->pSurface);
586 
587  return retval;
588 }
589 
590 
591 PPDEVOBJ
592 NTAPI
594  _In_opt_ PUNICODE_STRING pustrDeviceName)
595 {
596  UNICODE_STRING ustrCurrent;
597  PPDEVOBJ ppdev;
598  PGRAPHICS_DEVICE pGraphicsDevice;
599 
600  /* Acquire PDEV lock */
602 
603  /* Did the caller pass a device name? */
604  if (pustrDeviceName)
605  {
606  /* Loop all present PDEVs */
607  for (ppdev = gppdevList; ppdev; ppdev = ppdev->ppdevNext)
608  {
609  /* Get a pointer to the GRAPHICS_DEVICE */
610  pGraphicsDevice = ppdev->pGraphicsDevice;
611 
612  /* Compare the name */
613  RtlInitUnicodeString(&ustrCurrent, pGraphicsDevice->szWinDeviceName);
614  if (RtlEqualUnicodeString(pustrDeviceName, &ustrCurrent, FALSE))
615  {
616  /* Found! */
617  break;
618  }
619  }
620  }
621  else
622  {
623  /* Otherwise use the primary PDEV */
624  ppdev = gppdevPrimary;
625  }
626 
627  /* Did we find one? */
628  if (ppdev)
629  {
630  /* Yes, reference the PDEV */
632  }
633  else
634  {
635  /* No, create a new PDEV for the given device */
636  ppdev = EngpCreatePDEV(pustrDeviceName, NULL);
637  if (ppdev)
638  {
639  /* Insert the PDEV into the list */
640  ppdev->ppdevNext = gppdevList;
641  gppdevList = ppdev;
642 
643  /* Set as primary PDEV, if we don't have one yet */
644  if (!gppdevPrimary)
645  {
646  gppdevPrimary = ppdev;
648  }
649  }
650  }
651 
652  /* Release PDEV lock */
654 
655  return ppdev;
656 }
657 
658 INT
659 NTAPI
661 {
662  INT ret = CM_NONE;
663 
664  if (ppdev->flFlags & PDEV_DISPLAY)
665  {
666  if (ppdev->devinfo.iDitherFormat == BMF_8BPP ||
668  ret = CM_GAMMA_RAMP;
669  }
670 
672  ret |= CM_CMYK_COLOR;
673  if (ppdev->devinfo.flGraphicsCaps & GCAPS_ICM)
674  ret |= CM_DEVICE_ICM;
675 
676  return ret;
677 }
678 
679 VOID
680 NTAPI
682  IN PPDEVOBJ ppdev,
684 {
685  PGDIINFO pGdiInfo = &ppdev->gdiinfo;
686 
687  pDevCaps->ulVersion = pGdiInfo->ulVersion;
688  pDevCaps->ulTechnology = pGdiInfo->ulTechnology;
689  pDevCaps->ulHorzSizeM = (pGdiInfo->ulHorzSize + 500) / 1000;
690  pDevCaps->ulVertSizeM = (pGdiInfo->ulVertSize + 500) / 1000;
691  pDevCaps->ulHorzSize = pGdiInfo->ulHorzSize;
692  pDevCaps->ulVertSize = pGdiInfo->ulVertSize;
693  pDevCaps->ulHorzRes = pGdiInfo->ulHorzRes;
694  pDevCaps->ulVertRes = pGdiInfo->ulVertRes;
695  pDevCaps->ulBitsPixel = pGdiInfo->cBitsPixel;
696  if (pDevCaps->ulBitsPixel == 15) pDevCaps->ulBitsPixel = 16;
697  pDevCaps->ulPlanes = pGdiInfo->cPlanes;
698  pDevCaps->ulNumPens = pGdiInfo->ulNumColors;
699  if (pDevCaps->ulNumPens != -1) pDevCaps->ulNumPens *= 5;
700  pDevCaps->ulNumFonts = 0; // PDEVOBJ_cFonts(ppdev);
701  pDevCaps->ulNumColors = pGdiInfo->ulNumColors;
702  pDevCaps->ulRasterCaps = pGdiInfo->flRaster;
703  pDevCaps->ulAspectX = pGdiInfo->ulAspectX;
704  pDevCaps->ulAspectY = pGdiInfo->ulAspectY;
705  pDevCaps->ulAspectXY = pGdiInfo->ulAspectXY;
706  pDevCaps->ulLogPixelsX = pGdiInfo->ulLogPixelsX;
707  pDevCaps->ulLogPixelsY = pGdiInfo->ulLogPixelsY;
708  pDevCaps->ulSizePalette = pGdiInfo->ulNumPalReg;
709  pDevCaps->ulColorRes = pGdiInfo->ulDACRed +
710  pGdiInfo->ulDACGreen +
711  pGdiInfo->ulDACBlue;
712  pDevCaps->ulPhysicalWidth = pGdiInfo->szlPhysSize.cx;
716  pDevCaps->ulTextCaps = pGdiInfo->flTextCaps;
718  if (pGdiInfo->ulTechnology != DT_PLOTTER)
720  pDevCaps->ulVRefresh = pGdiInfo->ulVRefresh;
721  pDevCaps->ulDesktopHorzRes = pGdiInfo->ulHorzRes;
722  pDevCaps->ulDesktopVertRes = pGdiInfo->ulVertRes;
728  pDevCaps->ulShadeBlend = pGdiInfo->flShadeBlend;
730 }
731 
732 
736 LPWSTR
737 APIENTRY
739 {
740  PPDEVOBJ ppdev = (PPDEVOBJ)hdev;
741 
742  ASSERT(ppdev);
743  ASSERT(ppdev->pldev);
744  ASSERT(ppdev->pldev->pGdiDriverInfo);
745  ASSERT(ppdev->pldev->pGdiDriverInfo->DriverName.Buffer);
746 
747  return ppdev->pldev->pGdiDriverInfo->DriverName.Buffer;
748 }
749 
750 
751 INT
752 APIENTRY
754  HDC hdc,
755  INT Index)
756 {
757  PDC pdc;
758  DEVCAPS devcaps;
759 
760  /* Lock the given DC */
761  pdc = DC_LockDc(hdc);
762  if (!pdc)
763  {
765  return 0;
766  }
767 
768  /* Get the data */
769  PDEVOBJ_vGetDeviceCaps(pdc->ppdev, &devcaps);
770 
771  /* Unlock the DC */
772  DC_UnlockDc(pdc);
773 
774  /* Return capability */
775  switch (Index)
776  {
777  case DRIVERVERSION:
778  return devcaps.ulVersion;
779 
780  case TECHNOLOGY:
781  return devcaps.ulTechnology;
782 
783  case HORZSIZE:
784  return devcaps.ulHorzSize;
785 
786  case VERTSIZE:
787  return devcaps.ulVertSize;
788 
789  case HORZRES:
790  return devcaps.ulHorzRes;
791 
792  case VERTRES:
793  return devcaps.ulVertRes;
794 
795  case LOGPIXELSX:
796  return devcaps.ulLogPixelsX;
797 
798  case LOGPIXELSY:
799  return devcaps.ulLogPixelsY;
800 
801  case BITSPIXEL:
802  return devcaps.ulBitsPixel;
803 
804  case PLANES:
805  return devcaps.ulPlanes;
806 
807  case NUMBRUSHES:
808  return -1;
809 
810  case NUMPENS:
811  return devcaps.ulNumPens;
812 
813  case NUMFONTS:
814  return devcaps.ulNumFonts;
815 
816  case NUMCOLORS:
817  return devcaps.ulNumColors;
818 
819  case ASPECTX:
820  return devcaps.ulAspectX;
821 
822  case ASPECTY:
823  return devcaps.ulAspectY;
824 
825  case ASPECTXY:
826  return devcaps.ulAspectXY;
827 
828  case CLIPCAPS:
829  return CP_RECTANGLE;
830 
831  case SIZEPALETTE:
832  return devcaps.ulSizePalette;
833 
834  case NUMRESERVED:
835  return 20;
836 
837  case COLORRES:
838  return devcaps.ulColorRes;
839 
840  case DESKTOPVERTRES:
841  return devcaps.ulVertRes;
842 
843  case DESKTOPHORZRES:
844  return devcaps.ulHorzRes;
845 
846  case BLTALIGNMENT:
847  return devcaps.ulBltAlignment;
848 
849  case SHADEBLENDCAPS:
850  return devcaps.ulShadeBlend;
851 
852  case COLORMGMTCAPS:
853  return devcaps.ulColorMgmtCaps;
854 
855  case PHYSICALWIDTH:
856  return devcaps.ulPhysicalWidth;
857 
858  case PHYSICALHEIGHT:
859  return devcaps.ulPhysicalHeight;
860 
861  case PHYSICALOFFSETX:
862  return devcaps.ulPhysicalOffsetX;
863 
864  case PHYSICALOFFSETY:
865  return devcaps.ulPhysicalOffsetY;
866 
867  case VREFRESH:
868  return devcaps.ulVRefresh;
869 
870  case RASTERCAPS:
871  return devcaps.ulRasterCaps;
872 
873  case CURVECAPS:
874  return (CC_CIRCLES | CC_PIE | CC_CHORD | CC_ELLIPSES | CC_WIDE |
876 
877  case LINECAPS:
880 
881  case POLYGONALCAPS:
884 
885  case TEXTCAPS:
886  return devcaps.ulTextCaps;
887 
888  case CAPS1:
889  case PDEVICESIZE:
890  case SCALINGFACTORX:
891  case SCALINGFACTORY:
892  default:
893  return 0;
894  }
895 
896  return 0;
897 }
898 
899 _Success_(return!=FALSE)
900 BOOL
901 APIENTRY
902 NtGdiGetDeviceCapsAll(
903  IN HDC hDC,
905 {
906  PDC pdc;
907  DEVCAPS devcaps;
908  BOOL bResult = TRUE;
909 
910  /* Lock the given DC */
911  pdc = DC_LockDc(hDC);
912  if (!pdc)
913  {
915  return FALSE;
916  }
917 
918  /* Get the data */
919  PDEVOBJ_vGetDeviceCaps(pdc->ppdev, &devcaps);
920 
921  /* Unlock the DC */
922  DC_UnlockDc(pdc);
923 
924  /* Copy data to caller */
925  _SEH2_TRY
926  {
927  ProbeForWrite(pDevCaps, sizeof(DEVCAPS), 1);
928  RtlCopyMemory(pDevCaps, &devcaps, sizeof(DEVCAPS));
929  }
931  {
933  bResult = FALSE;
934  }
935  _SEH2_END;
936 
937  return bResult;
938 }
939 
940 DHPDEV
941 APIENTRY
943  IN HDEV hdev)
944 {
945  PPDEVOBJ ppdev;
946  DHPDEV dhpdev = NULL;
947 
948  /* Check parameter */
949  if (!hdev || (PCHAR)hdev < (PCHAR)MmSystemRangeStart)
950  return NULL;
951 
952  /* Lock PDEV list */
953  EngAcquireSemaphoreShared(ghsemPDEV);
954 
955  /* Walk through the list of PDEVs */
956  for (ppdev = gppdevList; ppdev; ppdev = ppdev->ppdevNext)
957  {
958  /* Compare with the given HDEV */
959  if (ppdev == (PPDEVOBJ)hdev)
960  {
961  /* Found the PDEV! Get it's dhpdev and break */
962  dhpdev = ppdev->dhpdev;
963  break;
964  }
965  }
966 
967  /* Unlock PDEV list */
969 
970  return dhpdev;
971 }
972 
973 PSIZEL
974 FASTCALL
976 {
977  if (ppdev->flFlags & PDEV_META_DEVICE)
978  {
979  psizl->cx = ppdev->ulHorzRes;
980  psizl->cy = ppdev->ulVertRes;
981  }
982  else
983  {
984  psizl->cx = ppdev->gdiinfo.ulHorzRes;
985  psizl->cy = ppdev->gdiinfo.ulVertRes;
986  }
987  return psizl;
988 }
DHPDEV dhpdev
Definition: pdevobj.h:121
#define CP_RECTANGLE
Definition: wingdi.h:825
BOOL NTAPI PDEVOBJ_bSwitchMode(PPDEVOBJ ppdev, PDEVMODEW pdm)
Definition: pdevobj.c:507
SIZEL szlPhysSize
Definition: winddi.h:901
#define DESKTOPHORZRES
Definition: wingdi.h:741
BOOLEAN EngpPopulateDeviceModeList(_Inout_ PGRAPHICS_DEVICE pGraphicsDevice, _In_ PDEVMODEW pdmDefault)
Definition: device.c:34
signed char * PCHAR
Definition: retypes.h:7
PFN_DrvDisablePDEV DisablePDEV
Definition: ntgdityp.h:570
#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:160
#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:660
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:1617
#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
#define RC_GDI20_OUTPUT
Definition: wingdi.h:785
PSURFACE NTAPI PDEVOBJ_pSurface(PPDEVOBJ ppdev)
Definition: pdevobj.c:233
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:738
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:1642
ULONG flTextCaps
Definition: winddi.h:890
PGRAPHICS_DEVICE gpPrimaryGraphicsDevice
Definition: device.c:13
#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:345
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:315
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
Definition: xlate.c:10
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:753
PGRAPHICS_DEVICE NTAPI EngpFindGraphicsDevice(_In_opt_ PUNICODE_STRING pustrDevice, _In_ ULONG iDevNum, _In_ DWORD dwFlags)
Definition: device.c:281
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
struct _PALETTE * ppalSurf
Definition: pdevobj.h:122
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:319
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:681
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:224
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
PFN_DrvDisableSurface DisableSurface
Definition: ntgdityp.h:572
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:314
#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:975
ULONG ulPanningHorzRes
Definition: ntgdityp.h:327
_In_ LPWSTR pwszLogAddress
Definition: winddi.h:3548
WCHAR dmDeviceName[CCHDEVICENAME]
Definition: wingdi.h:1612
HANDLE hSpooler
Definition: pdevobj.h:126
ULONG ulDesktopHorzRes
Definition: ntgdityp.h:324
DWORD dmPelsWidth
Definition: wingdi.h:1643
#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:453
int ret
INIT_FUNCTION NTSTATUS NTAPI InitPDEVImpl(VOID)
Definition: pdevobj.c:21
#define GCAPS_ICM
Definition: winddi.h:346
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:942
ULONG cBitsPixel
Definition: winddi.h:884
ULONG ulAspectX
Definition: winddi.h:894
PDEVMODEW NTAPI PDEVOBJ_pdmMatchDevMode(PPDEVOBJ ppdev, PDEVMODEW pdm)
Definition: pdevobj.c:306
#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:1649
#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:899
_SEH2_END
Definition: create.c:4424
#define InterlockedIncrement
Definition: armddk.h:53
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:1644
VOID NTAPI PDEVOBJ_vRefreshModeList(PPDEVOBJ ppdev)
Definition: pdevobj.c:263
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
#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
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:2966
#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:438
#define GDITAG_PDEV
Definition: tags.h:74
LONG cy
Definition: windef.h:320
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:593
PPDEVOBJ NTAPI DbgLookupDHPDEV(DHPDEV dhpdev)
VOID NTAPI PDEVOBJ_vRelease(PPDEVOBJ ppdev)
Definition: pdevobj.c:93
#define PLANES
Definition: wingdi.h:720
#define NT_ASSERT
Definition: rtlfuncs.h:3312