ReactOS  0.4.14-dev-77-gd9e7c48
display.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS user32.dll
3  * FILE: win32ss/user/user32/misc/display.c
4  * PURPOSE: DDE
5  * PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
6  */
7 
8 #include <user32.h>
9 
11 
12 #define SIZEOF_DEVMODEA_300 124
13 #define SIZEOF_DEVMODEA_400 148
14 #define SIZEOF_DEVMODEA_500 156
15 #define SIZEOF_DEVMODEW_300 188
16 #define SIZEOF_DEVMODEW_400 212
17 #define SIZEOF_DEVMODEW_500 220
18 
19 /*
20  * @implemented
21  */
24  LPCSTR lpDevice,
25  DWORD iDevNum,
26  PDISPLAY_DEVICEA lpDisplayDevice,
27  DWORD dwFlags)
28 {
29  BOOL rc;
31  DISPLAY_DEVICEW DisplayDeviceW;
32 
34  {
36  return FALSE;
37  }
38 
39  RtlZeroMemory(&DisplayDeviceW, sizeof(DISPLAY_DEVICEW));
40  DisplayDeviceW.cb = sizeof(DISPLAY_DEVICEW);
42  iDevNum,
43  &DisplayDeviceW,
44  dwFlags);
45  if (rc)
46  {
47  /* Copy result from DisplayDeviceW to lpDisplayDevice. Buffers have the same size so result is always NULL terminated. */
48  lpDisplayDevice->StateFlags = DisplayDeviceW.StateFlags;
49  WideCharToMultiByte(CP_ACP, 0, DisplayDeviceW.DeviceName, -1,
50  lpDisplayDevice->DeviceName,
51  sizeof(lpDisplayDevice->DeviceName) / sizeof(lpDisplayDevice->DeviceName[0]),
52  NULL, NULL);
53  WideCharToMultiByte(CP_ACP, 0, DisplayDeviceW.DeviceString, -1,
54  lpDisplayDevice->DeviceString,
55  sizeof(lpDisplayDevice->DeviceString) / sizeof(lpDisplayDevice->DeviceString[0]),
56  NULL, NULL);
57  WideCharToMultiByte(CP_ACP, 0, DisplayDeviceW.DeviceID, -1,
58  lpDisplayDevice->DeviceID,
59  sizeof(lpDisplayDevice->DeviceID) / sizeof(lpDisplayDevice->DeviceID[0]),
60  NULL, NULL);
61  WideCharToMultiByte(CP_ACP, 0, DisplayDeviceW.DeviceKey, -1,
62  lpDisplayDevice->DeviceKey,
63  sizeof(lpDisplayDevice->DeviceKey) / sizeof(lpDisplayDevice->DeviceKey[0]),
64  NULL, NULL);
65  }
66 
68 
69  return rc;
70 }
71 
72 
73 /*
74  * @implemented
75  */
76 BOOL
77 WINAPI
79  LPCWSTR lpDevice,
80  DWORD iDevNum,
81  PDISPLAY_DEVICEW lpDisplayDevice,
82  DWORD dwFlags)
83 {
85  BOOL rc;
86 
87  RtlInitUnicodeString(&Device, lpDevice);
88 
90  &Device,
91  iDevNum,
92  lpDisplayDevice,
93  dwFlags);
94 
95  return rc;
96 }
97 
98 
99 /*
100  * @implemented
101  */
102 BOOL
103 WINAPI
105  HDC hdc,
106  LPCRECT lprcClip,
107  MONITORENUMPROC lpfnEnum,
108  LPARAM dwData)
109 {
110  INT iCount, i;
111  HMONITOR *hMonitorList;
112  LPRECT pRectList;
113  HANDLE hHeap;
114  BOOL ret = FALSE;
115 
116  /* get list of monitors/rects */
117  iCount = NtUserEnumDisplayMonitors(hdc, lprcClip, NULL, NULL, 0);
118  if (iCount < 0)
119  {
120  /* FIXME: SetLastError() */
121  return FALSE;
122  }
123  if (iCount == 0)
124  {
125  return TRUE;
126  }
127 
128  hHeap = GetProcessHeap();
129  hMonitorList = HeapAlloc(hHeap, 0, sizeof (HMONITOR) * iCount);
130  if (hMonitorList == NULL)
131  {
133  return FALSE;
134  }
135  pRectList = HeapAlloc(hHeap, 0, sizeof (RECT) * iCount);
136  if (pRectList == NULL)
137  {
139  goto cleanup;
140  }
141 
142  iCount = NtUserEnumDisplayMonitors(hdc, lprcClip, hMonitorList, pRectList, iCount);
143  if (iCount <= 0)
144  {
145  /* FIXME: SetLastError() */
146  goto cleanup;
147  }
148 
149  /* enumerate list */
150  for (i = 0; i < iCount; i++)
151  {
152  HMONITOR hMonitor = hMonitorList[i];
153  LPRECT pMonitorRect = pRectList + i;
154  HDC hMonitorDC = NULL;
155 
156  if (hdc != NULL)
157  {
158  /* make monitor DC */
159  hMonitorDC = hdc;
160  }
161 
162  if (!lpfnEnum(hMonitor, hMonitorDC, pMonitorRect, dwData))
163  goto cleanup; /* return FALSE */
164  }
165 
166  ret = TRUE;
167 
168 cleanup:
169  if(hMonitorList)
170  HeapFree(hHeap, 0, hMonitorList);
171  if(pRectList)
172  HeapFree(hHeap, 0, pRectList);
173  return ret;
174 }
175 
176 
177 /*
178  * @implemented
179  */
180 BOOL
181 WINAPI
183  LPCSTR lpszDeviceName,
184  DWORD iModeNum,
186  DWORD dwFlags)
187 {
189  UNICODE_STRING usDeviceName;
190  PUNICODE_STRING pusDeviceName = NULL;
191  LPDEVMODEW lpExtendedDevMode;
192  BOOL Result = FALSE;
193 
194  if (lpszDeviceName)
195  {
196  if (!RtlCreateUnicodeStringFromAsciiz(&usDeviceName, (PCSZ)lpszDeviceName))
197  {
199  return FALSE;
200  }
201  pusDeviceName = &usDeviceName;
202  }
203 
204  /* Allocate memory for DEVMODEW and extra data */
205  lpExtendedDevMode = RtlAllocateHeap(RtlGetProcessHeap(),
207  sizeof(DEVMODEW) + lpDevMode->dmDriverExtra);
208  if (!lpExtendedDevMode)
209  {
210  if (pusDeviceName)
211  RtlFreeUnicodeString(&usDeviceName);
212 
213  return FALSE;
214  }
215 
216  /* Initialize structure fields */
217  lpExtendedDevMode->dmSize = sizeof(DEVMODEW);
218  lpExtendedDevMode->dmDriverExtra = lpDevMode->dmDriverExtra;
219 
220  Status = NtUserEnumDisplaySettings(pusDeviceName, iModeNum, lpExtendedDevMode, dwFlags);
221 
222  if (pusDeviceName)
223  RtlFreeUnicodeString(&usDeviceName);
224 
225  if (NT_SUCCESS(Status))
226  {
227  /* Store old structure size */
228  WORD OldSize = lpDevMode->dmSize;
229 
230 #define COPYS(f,len) WideCharToMultiByte(CP_THREAD_ACP, 0, lpExtendedDevMode->f, len, (LPSTR)lpDevMode->f, len, NULL, NULL)
231 #define COPYN(f) lpDevMode->f = lpExtendedDevMode->f
232 
233  COPYS(dmDeviceName, CCHDEVICENAME);
234  COPYN(dmSpecVersion);
235  COPYN(dmDriverVersion);
236  COPYN(dmFields);
237  COPYN(dmPosition.x);
238  COPYN(dmPosition.y);
239  COPYN(dmScale);
240  COPYN(dmCopies);
241  COPYN(dmDefaultSource);
242  COPYN(dmPrintQuality);
243  COPYN(dmColor);
244  COPYN(dmDuplex);
245  COPYN(dmYResolution);
246  COPYN(dmTTOption);
247  COPYN(dmCollate);
248  COPYS(dmFormName,CCHFORMNAME);
249  COPYN(dmLogPixels);
250  COPYN(dmBitsPerPel);
251  COPYN(dmPelsWidth);
252  COPYN(dmPelsHeight);
253  COPYN(dmDisplayFlags); // aka dmNup
254  COPYN(dmDisplayFrequency);
255 
256  /* we're done with 0x300 fields */
257  if (OldSize > SIZEOF_DEVMODEA_300)
258  {
259  COPYN(dmICMMethod);
260  COPYN(dmICMIntent);
261  COPYN(dmMediaType);
262  COPYN(dmDitherType);
263  COPYN(dmReserved1);
264  COPYN(dmReserved2);
265 
266  /* we're done with 0x400 fields */
267  if (OldSize > SIZEOF_DEVMODEA_400)
268  {
269  COPYN(dmPanningWidth);
270  COPYN(dmPanningHeight);
271  }
272  }
273 
274  /* Restore old size */
275  lpDevMode->dmSize = OldSize;
276 
277  /* Extra data presented? */
278  if (lpDevMode->dmDriverExtra && lpExtendedDevMode->dmDriverExtra)
279  {
280  /* We choose the smallest size */
281  if (lpDevMode->dmDriverExtra > lpExtendedDevMode->dmDriverExtra)
282  lpDevMode->dmDriverExtra = lpExtendedDevMode->dmDriverExtra;
283 
284  /* Copy extra data */
285  RtlCopyMemory((PUCHAR)lpDevMode + OldSize,
286  lpExtendedDevMode + 1,
288  }
289 
290  /* If the size of source structure is less, than used, we clean unsupported flags */
291  if (OldSize < FIELD_OFFSET(DEVMODEA, dmPanningHeight))
293 
294  if (OldSize < FIELD_OFFSET(DEVMODEA, dmPanningWidth))
296 
297  Result = TRUE;
298  }
299 
300  /* Free memory */
301  RtlFreeHeap(RtlGetProcessHeap(), 0, lpExtendedDevMode);
302 
303  return Result;
304 }
305 
306 
307 /*
308  * @implemented
309  */
310 BOOL
311 WINAPI
313  LPCSTR lpszDeviceName,
314  DWORD iModeNum,
316 {
317  /* Fixup sizes */
318  lpDevMode->dmSize = FIELD_OFFSET(DEVMODEA, dmICMMethod);
320 
321  return EnumDisplaySettingsExA(lpszDeviceName, iModeNum, lpDevMode, 0);
322 }
323 
324 
325 /*
326  * @implemented
327  */
328 BOOL
329 WINAPI
331  LPCWSTR lpszDeviceName,
332  DWORD iModeNum,
334  DWORD dwFlags)
335 {
337  UNICODE_STRING usDeviceName;
338  PUNICODE_STRING pusDeviceName = NULL;
339  LPDEVMODEW lpExtendedDevMode;
340  BOOL Result = FALSE;
341 
342  if (lpszDeviceName)
343  {
344  RtlInitUnicodeString(&usDeviceName, lpszDeviceName);
345  pusDeviceName = &usDeviceName;
346  }
347 
348  /* Allocate memory for DEVMODEW and extra data */
349  lpExtendedDevMode = RtlAllocateHeap(RtlGetProcessHeap(),
351  sizeof(DEVMODEW) + lpDevMode->dmDriverExtra);
352  if (!lpExtendedDevMode)
353  return FALSE;
354 
355  /* Initialize structure fields */
356  lpExtendedDevMode->dmSize = sizeof(DEVMODEW);
357  lpExtendedDevMode->dmDriverExtra = lpDevMode->dmDriverExtra;
358 
359  Status = NtUserEnumDisplaySettings(pusDeviceName, iModeNum, lpExtendedDevMode, dwFlags);
360  if (NT_SUCCESS(Status))
361  {
362  /* Store old structure sizes */
363  WORD OldSize = lpDevMode->dmSize;
364  WORD OldDriverExtra = lpDevMode->dmDriverExtra;
365 
366  /* Copy general data */
367  RtlCopyMemory(lpDevMode, lpExtendedDevMode, OldSize);
368 
369  /* Restore old sizes */
370  lpDevMode->dmSize = OldSize;
371  lpDevMode->dmDriverExtra = OldDriverExtra;
372 
373  /* Extra data presented? */
374  if (lpDevMode->dmDriverExtra && lpExtendedDevMode->dmDriverExtra)
375  {
376  /* We choose the smallest size */
377  if (lpDevMode->dmDriverExtra > lpExtendedDevMode->dmDriverExtra)
378  lpDevMode->dmDriverExtra = lpExtendedDevMode->dmDriverExtra;
379 
380  /* Copy extra data */
381  RtlCopyMemory((PUCHAR)lpDevMode + OldSize,
382  lpExtendedDevMode + 1,
384  }
385 
386  /* If the size of source structure is less, than used, we clean unsupported flags */
387  if (OldSize < FIELD_OFFSET(DEVMODEW, dmPanningHeight))
389 
390  if (OldSize < FIELD_OFFSET(DEVMODEW, dmPanningWidth))
392 
393  Result = TRUE;
394  }
395 
396  /* Free memory */
397  RtlFreeHeap(RtlGetProcessHeap(), 0, lpExtendedDevMode);
398 
399  return Result;
400 }
401 
402 
403 /*
404  * @implemented
405  */
406 BOOL
407 WINAPI
409  LPCWSTR lpszDeviceName,
410  DWORD iModeNum,
412 {
413  /* Fixup sizes */
414  lpDevMode->dmSize = FIELD_OFFSET(DEVMODEW, dmICMMethod);
416 
417  return EnumDisplaySettingsExW(lpszDeviceName, iModeNum, lpDevMode, 0);
418 }
419 
420 
421 /*
422  * @implemented
423  */
424 BOOL
425 WINAPI
427  HMONITOR hMonitor,
428  LPMONITORINFO lpmi)
429 {
430  if (lpmi->cbSize == sizeof (MONITORINFO))
431  {
432  return NtUserGetMonitorInfo(hMonitor, lpmi);
433  }
434  else if (lpmi->cbSize != sizeof (MONITORINFOEXA))
435  {
437  return FALSE;
438  }
439  else
440  {
441  MONITORINFOEXW miExW;
442  INT res;
443 
444  miExW.cbSize = sizeof (MONITORINFOEXW);
445  if (!NtUserGetMonitorInfo(hMonitor, (LPMONITORINFO)&miExW))
446  {
447  return FALSE;
448  }
449  memcpy(lpmi, &miExW, sizeof (MONITORINFO));
450  res = WideCharToMultiByte(CP_THREAD_ACP, 0, miExW.szDevice, -1,
451  ((LPMONITORINFOEXA)lpmi)->szDevice, CCHDEVICENAME,
452  NULL, NULL);
453  if (res == 0)
454  {
455  WARN("WideCharToMultiByte() failed!\n");
456  return FALSE;
457  }
458  }
459 
460  return TRUE;
461 }
462 
463 
464 /*
465  * @implemented
466  */
467 BOOL
468 WINAPI
470  HMONITOR hMonitor,
471  LPMONITORINFO lpmi)
472 {
473  return NtUserGetMonitorInfo(hMonitor, lpmi);
474 }
475 
476 
477 /*
478  * @implemented
479  */
480 HMONITOR
481 WINAPI
483  IN POINT ptPoint,
484  IN DWORD dwFlags )
485 {
486  return NtUserMonitorFromPoint(ptPoint, dwFlags);
487 }
488 
489 
490 /*
491  * @implemented
492  */
493 HMONITOR
494 WINAPI
496  IN LPCRECT lpcRect,
497  IN DWORD dwFlags )
498 {
499  return NtUserMonitorFromRect(lpcRect, dwFlags);
500 }
501 
502 
503 /*
504  * @implemented
505  */
506 HMONITOR
507 WINAPI
509  IN HWND hWnd,
510  IN DWORD dwFlags )
511 {
513 }
514 
515 
516 /*
517  * @implemented
518  */
519 LONG
520 WINAPI
522  LPCSTR lpszDeviceName,
524  HWND hwnd,
525  DWORD dwflags,
526  LPVOID lParam)
527 {
528  LONG rc;
530  PUNICODE_STRING pDeviceName = &DeviceName;
531 
532  if (lpszDeviceName != NULL)
533  {
534  if (!RtlCreateUnicodeStringFromAsciiz(pDeviceName, (PCSZ)lpszDeviceName))
535  {
537  return DISP_CHANGE_BADPARAM; /* FIXME what to return? */
538  }
539  }
540  else
541  pDeviceName = NULL;
542 
543  if (lpDevMode != NULL)
544  {
545  LPDEVMODEW pDevModeW;
546  pDevModeW = GdiConvertToDevmodeW(lpDevMode);
547  if(pDevModeW)
548  {
549  rc = NtUserChangeDisplaySettings(pDeviceName, pDevModeW, dwflags, lParam);
550  RtlFreeHeap(GetProcessHeap(), 0, pDevModeW);
551  }
552  else
554  }
555  else
556  rc = NtUserChangeDisplaySettings(pDeviceName, NULL, dwflags, lParam);
557 
558  if (lpszDeviceName != NULL)
560 
561  return rc;
562 }
563 
564 
565 /*
566  * @implemented
567  */
568 LONG
569 WINAPI
572  DWORD dwflags)
573 {
574  if(lpDevMode)
577 }
578 
579 
580 /*
581  * @implemented
582  */
583 LONG
584 WINAPI
586  LPCWSTR lpszDeviceName,
588  HWND hwnd,
589  DWORD dwflags,
590  LPVOID lParam)
591 {
592  LONG rc;
594  PUNICODE_STRING pDeviceName = &DeviceName;
595 
596  if (lpszDeviceName != NULL)
597  RtlInitUnicodeString(pDeviceName, lpszDeviceName);
598  else
599  pDeviceName = NULL;
600 
602 
603  return rc;
604 }
605 
606 
607 /*
608  * @implemented
609  */
610 LONG
611 WINAPI
614  DWORD dwflags)
615 {
616  if(lpDevMode)
619 }
LONG WINAPI ChangeDisplaySettingsExA(LPCSTR lpszDeviceName, LPDEVMODEA lpDevMode, HWND hwnd, DWORD dwflags, LPVOID lParam)
Definition: display.c:521
BOOL WINAPI GetMonitorInfoW(HMONITOR hMonitor, LPMONITORINFO lpmi)
Definition: display.c:469
LONG WINAPI ChangeDisplaySettingsW(LPDEVMODEW lpDevMode, DWORD dwflags)
Definition: display.c:612
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
CONST char * PCSZ
Definition: umtypes.h:125
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define IN
Definition: typedefs.h:38
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
_In_ PIRP _In_ PDEVICE_OBJECT Device
Definition: fatprocs.h:2020
#define WideCharToMultiByte
Definition: compat.h:101
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
WORD dmSize
Definition: wingdi.h:1563
CHAR DeviceString[128]
Definition: wingdi.h:2806
#define CP_ACP
Definition: compat.h:99
WORD dmDriverExtra
Definition: wingdi.h:1564
unsigned char * PUCHAR
Definition: retypes.h:3
WCHAR DeviceString[128]
Definition: wingdi.h:2814
#define WARN(fmt,...)
Definition: debug.h:111
#define DM_PANNINGWIDTH
Definition: wingdi.h:1276
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
static HDC
Definition: imagelist.c:92
HWND hWnd
Definition: settings.c:17
WORD dmDriverExtra
Definition: wingdi.h:1616
static HANDLE ULONG_PTR dwData
Definition: file.c:35
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
CHAR DeviceName[32]
Definition: wingdi.h:2805
WCHAR DeviceName[]
Definition: adapter.cpp:21
INT NTAPI NtUserEnumDisplayMonitors(OPTIONAL IN HDC hDC, OPTIONAL IN LPCRECT pRect, OPTIONAL OUT HMONITOR *hMonitorList, OPTIONAL OUT LPRECT monitorRectList, OPTIONAL IN DWORD listSize)
DEVMODEW *WINAPI GdiConvertToDevmodeW(const DEVMODEA *)
Definition: misc.c:968
BOOL NTAPI NtUserGetMonitorInfo(IN HMONITOR hMonitor, OUT LPMONITORINFO pMonitorInfo)
Definition: monitor.c:728
int32_t INT
Definition: typedefs.h:56
WCHAR DeviceName[32]
Definition: wingdi.h:2813
BOOL NTAPI NtUserEnumDisplayDevices(PUNICODE_STRING pustrDevice, DWORD iDevNum, PDISPLAY_DEVICEW pDisplayDevice, DWORD dwFlags)
Definition: display.c:343
LONG WINAPI ChangeDisplaySettingsExW(LPCWSTR lpszDeviceName, LPDEVMODEW lpDevMode, HWND hwnd, DWORD dwflags, LPVOID lParam)
Definition: display.c:585
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
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
WCHAR DeviceID[128]
Definition: wingdi.h:2816
#define COPYS(f, len)
static _In_ DWORD iModeNum
Definition: dispmode.c:77
CHAR DeviceKey[128]
Definition: wingdi.h:2809
BOOL WINAPI EnumDisplayDevicesA(LPCSTR lpDevice, DWORD iDevNum, PDISPLAY_DEVICEA lpDisplayDevice, DWORD dwFlags)
Definition: display.c:23
#define DISP_CHANGE_BADPARAM
Definition: winuser.h:193
struct tagMONITORINFOEXW MONITORINFOEXW
smooth NULL
Definition: ftsmooth.c:416
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
LONG_PTR LPARAM
Definition: windef.h:208
BOOL WINAPI GetMonitorInfoA(HMONITOR hMonitor, LPMONITORINFO lpmi)
Definition: display.c:426
BOOL WINAPI EnumDisplayDevicesW(LPCWSTR lpDevice, DWORD iDevNum, PDISPLAY_DEVICEW lpDisplayDevice, DWORD dwFlags)
Definition: display.c:78
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
static _In_ DWORD _Inout_ PDEVMODEA lpDevMode
Definition: dispmode.c:77
BOOL WINAPI EnumDisplaySettingsW(LPCWSTR lpszDeviceName, DWORD iModeNum, LPDEVMODEW lpDevMode)
Definition: display.c:408
#define SIZEOF_DEVMODEA_300
Definition: display.c:12
const char * LPCSTR
Definition: xmlstorage.h:183
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
#define SIZEOF_DEVMODEA_400
Definition: display.c:13
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSTATUS APIENTRY NtUserEnumDisplaySettings(IN PUNICODE_STRING pustrDevice, IN DWORD iModeNum, OUT LPDEVMODEW lpDevMode, IN DWORD dwFlags)
Definition: display.c:565
BOOL WINAPI EnumDisplaySettingsA(LPCSTR lpszDeviceName, DWORD iModeNum, LPDEVMODEA lpDevMode)
Definition: display.c:312
WORD dmSize
Definition: wingdi.h:1615
#define WINAPI
Definition: msvc.h:8
#define DISP_CHANGE_SUCCESSFUL
Definition: winuser.h:190
unsigned short WORD
Definition: ntddk_ex.h:93
HMONITOR WINAPI MonitorFromWindow(IN HWND hWnd, IN DWORD dwFlags)
Definition: display.c:508
unsigned long DWORD
Definition: ntddk_ex.h:95
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define SetLastError(x)
Definition: compat.h:409
BOOL WINAPI EnumDisplayMonitors(HDC hdc, LPCRECT lprcClip, MONITORENUMPROC lpfnEnum, LPARAM dwData)
Definition: display.c:104
DWORD dmFields
Definition: wingdi.h:1565
int ret
HMONITOR NTAPI NtUserMonitorFromPoint(IN POINT point, IN DWORD dwFlags)
Definition: monitor.c:827
HDC hdc
Definition: main.c:9
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
BOOL WINAPI EnumDisplaySettingsExW(LPCWSTR lpszDeviceName, DWORD iModeNum, LPDEVMODEW lpDevMode, DWORD dwFlags)
Definition: display.c:330
DWORD StateFlags
Definition: wingdi.h:2815
WINE_DEFAULT_DEBUG_CHANNEL(netapi32)
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static _In_ DWORD dwflags
Definition: dispmode.c:64
struct _DISPLAY_DEVICEW DISPLAY_DEVICEW
BOOL(CALLBACK * MONITORENUMPROC)(HMONITOR, HDC, LPRECT, LPARAM)
Definition: winuser.h:2883
WCHAR DeviceKey[128]
Definition: wingdi.h:2817
#define CCHFORMNAME
Definition: wingdi.h:67
Status
Definition: gdiplustypes.h:24
DWORD StateFlags
Definition: wingdi.h:2807
#define CCHDEVICENAME
Definition: ddrawi.h:63
DWORD cbSize
Definition: winuser.h:3758
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
CHAR DeviceID[128]
Definition: wingdi.h:2808
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
BOOL WINAPI EnumDisplaySettingsExA(LPCSTR lpszDeviceName, DWORD iModeNum, LPDEVMODEA lpDevMode, DWORD dwFlags)
Definition: display.c:182
GLuint res
Definition: glext.h:9613
LONG WINAPI ChangeDisplaySettingsA(LPDEVMODEA lpDevMode, DWORD dwflags)
Definition: display.c:570
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
char * cleanup(char *str)
Definition: wpickclick.c:99
HMONITOR WINAPI MonitorFromRect(IN LPCRECT lpcRect, IN DWORD dwFlags)
Definition: display.c:495
struct _devicemodeW DEVMODEW
HMONITOR WINAPI MonitorFromPoint(IN POINT ptPoint, IN DWORD dwFlags)
Definition: display.c:482
HMONITOR NTAPI NtUserMonitorFromRect(IN LPCRECT pRect, IN DWORD dwFlags)
#define CP_THREAD_ACP
Definition: winnls.h:230
#define DM_PANNINGHEIGHT
Definition: wingdi.h:1277
LONG APIENTRY NtUserChangeDisplaySettings(PUNICODE_STRING pustrDevice, LPDEVMODEW lpDevMode, DWORD dwflags, LPVOID lParam)
Definition: display.c:912
#define COPYN(f)
LPARAM lParam
Definition: combotst.c:139
#define HeapFree(x, y, z)
Definition: compat.h:394
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
HMONITOR NTAPI NtUserMonitorFromWindow(IN HWND hWnd, IN DWORD dwFlags)
Definition: monitor.c:967