ReactOS 0.4.15-dev-7788-g1ad9096
devsett.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Display Control Panel
4 * FILE: dll/cpl/desk/devsett.c
5 * PURPOSE: ReactOS Display Control Panel Shell Extension Support
6 */
7
8#include "desk.h"
9
10#include <cfgmgr32.h>
11
12#define NDEBUG
13#include <debug.h>
14
15#define DEBUG_DEVSETTINGS
16
17typedef struct _CDevSettings
18{
19 const struct IDataObjectVtbl *lpIDataObjectVtbl;
21
22 CLIPFORMAT cfExtInterface; /* "Desk.cpl extension interface" */
23 CLIPFORMAT cfDisplayDevice; /* "Display Device" */
24 CLIPFORMAT cfDisplayName; /* "Display Name" */
25 CLIPFORMAT cfDisplayId; /* "Display ID" */
26 CLIPFORMAT cfMonitorName; /* "Monitor Name" */
27 CLIPFORMAT cfMonitorDevice; /* "Monitor Device" */
28 CLIPFORMAT cfDisplayKey; /* "Display Key" */
29 CLIPFORMAT cfDisplayStateFlags; /* "Display State Flags" */
30 CLIPFORMAT cfPruningMode; /* "Pruning Mode" */
31
38
40
46
47 union
48 {
50 struct
51 {
55 };
56 };
58
59#define impl_to_interface(impl,iface) (struct iface *)(&(impl)->lp##iface##Vtbl)
60
61static __inline PCDevSettings
63{
65 lpIDataObjectVtbl));
66}
67
68static __inline VOID
70{
71 if (*psz != NULL)
72 {
73 LocalFree((HLOCAL)*psz);
74 *psz = NULL;
75 }
76}
77
78static PWSTR
80{
81 SIZE_T c;
82 PWSTR str;
83
84 c = _tcslen(pszSrc) + 1;
86 c * sizeof(WCHAR));
87 if (str != NULL)
88 {
89#ifdef UNICODE
90 StringCbCopyW(str, c * sizeof(WCHAR),
91 pszSrc);
92#else
94 0,
95 pszSrc,
96 -1,
97 str,
98 c);
99#endif
100 }
101
102 return str;
103}
104
105static PWSTR
106pCDevSettings_GetMonitorName(const WCHAR *pszDisplayDevice)
107{
108 DISPLAY_DEVICEW dd, dd2;
109 PWSTR str = NULL;
110
111 dd.cb = sizeof(dd);
112 if (EnumDisplayDevicesW(pszDisplayDevice,
113 0,
114 &dd,
115 0))
116 {
117 dd2.cb = sizeof(dd2);
118 if (EnumDisplayDevicesW(pszDisplayDevice,
119 1,
120 &dd2,
121 0))
122 {
123 /* There's more than one monitor connected... */
126 dd.DeviceString,
127 sizeof(dd.DeviceString) / sizeof(dd.DeviceString[0]));
128 }
129 }
130 else
131 {
132 /* We can't enumerate a monitor, make sure this fact is reported
133 to the user! */
136 dd.DeviceString,
137 sizeof(dd.DeviceString) / sizeof(dd.DeviceString[0]));
138 }
139
141 (wcslen(dd.DeviceString) + 1) * sizeof(WCHAR));
142 if (str != NULL)
143 {
144 wcscpy(str,
145 dd.DeviceString);
146 }
147
148 return str;
149}
150
151static PWSTR
152pCDevSettings_GetMonitorDevice(const WCHAR *pszDisplayDevice)
153{
155 PWSTR str = NULL;
156
157 dd.cb = sizeof(dd);
158 if (EnumDisplayDevicesW(pszDisplayDevice,
159 0,
160 &dd,
161 0))
162 {
164 (wcslen(dd.DeviceName) + 1) * sizeof(WCHAR));
165 if (str != NULL)
166 {
167 wcscpy(str,
168 dd.DeviceName);
169 }
170 }
171
172 return str;
173}
174
194static PWSTR
196{
197 HDEVINFO DevInfo;
198 SP_DEVINFO_DATA InfoData;
200 LPWSTR lpDevInstId = NULL;
201
202 DPRINT("CDevSettings::GetDeviceInstanceId(%ws)!\n", pszDevice);
203
205 if (DevInfo == INVALID_HANDLE_VALUE)
206 {
207 DPRINT1("SetupDiGetClassDevsW(\"%ws\") failed: %d\n", pszDevice, GetLastError());
208 return NULL;
209 }
210
211 ZeroMemory(&InfoData, sizeof(InfoData));
212 InfoData.cbSize = sizeof(InfoData);
213
214 /* Try to enumerate the first matching device */
215 if (!SetupDiEnumDeviceInfo(DevInfo, 0, &InfoData))
216 {
217 DPRINT1("SetupDiEnumDeviceInfo failed: %d\n", GetLastError());
218 return NULL;
219 }
220
221 if (SetupDiGetDeviceInstanceId(DevInfo, &InfoData, NULL, 0, &BufLen) ||
223 {
224 DPRINT1("SetupDiGetDeviceInstanceId failed: %d\n", GetLastError());
225 return NULL;
226 }
227
228 lpDevInstId = LocalAlloc(LMEM_FIXED,
229 (BufLen + 1) * sizeof(WCHAR));
230
231 if (lpDevInstId == NULL)
232 {
233 DPRINT1("LocalAlloc failed\n");
234 return NULL;
235 }
236
237 if (!SetupDiGetDeviceInstanceId(DevInfo, &InfoData, lpDevInstId, BufLen, NULL))
238 {
239 DPRINT1("SetupDiGetDeviceInstanceId failed: %d\n", GetLastError());
240 LocalFree((HLOCAL)lpDevInstId);
241 lpDevInstId = NULL;
242 }
243 else
244 {
245 DPRINT("instance id: %ws\n", lpDevInstId);
246 }
247
248 return lpDevInstId;
249}
250
251
252static HKEY
255{
256 static const WCHAR szRegPrefix[] = L"\\Registry\\Machine\\";
257 PWSTR lpRegKey;
258 REGSAM Access = KEY_READ;
259 HKEY hKey;
260
261 lpRegKey = This->pDisplayKey;
262 if (lpRegKey != NULL)
263 {
264 if (wcslen(lpRegKey) >= wcslen(szRegPrefix) &&
265 !_wcsnicmp(lpRegKey,
266 szRegPrefix,
267 wcslen(szRegPrefix)))
268 {
269 lpRegKey += wcslen(szRegPrefix);
270 }
271
272 if (!ReadOnly)
273 Access |= KEY_WRITE;
274
276 lpRegKey,
277 0,
278 Access,
279 &hKey) == ERROR_SUCCESS)
280 {
281 return hKey;
282 }
283 }
284
285 return NULL;
286}
287
290 DWORD Index)
291{
293 DWORD i, idx = 0;
294
295 DPRINT1("CDevSettings::EnumAllModes(%u)\n", Index);
296
297 if (!This->DevModes)
298 return NULL;
299
300 for (i = 0; i < This->nDevModes; i++)
301 {
302 /* FIXME: Add more sanity checks */
303 if (!This->DevModes[i])
304 continue;
305
306 if (idx == Index)
307 return This->DevModes[i];
308
309 idx++;
310 }
311
312 return NULL;
313}
314
317{
319
320 DPRINT1("CDevSettings::GetCurrentMode\n");
321 return This->lpCurDevMode;
322}
323
326 DEVMODEW *pDevMode)
327{
329 DWORD i;
330
331 DPRINT1("CDevSettings::SetCurrentMode(0x%p)\n", pDevMode);
332
333 if (!This->DevModes)
334 return FALSE;
335
336 for (i = 0; i < This->nDevModes; i++)
337 {
338 /* FIXME: Add more sanity checks */
339 if (!This->DevModes[i])
340 continue;
341
342 if (This->DevModes[i] == pDevMode)
343 {
344 This->lpCurDevMode = pDevMode;
345 return TRUE;
346 }
347 }
348
349 return FALSE;
350}
351
354 PBOOL pbModesPruned,
355 PBOOL pbKeyIsReadOnly,
356 PBOOL pbPruningOn)
357{
359
360 DPRINT1("CDevSettings::GetPruningMode(%p,%p,%p)\n", pbModesPruned, pbKeyIsReadOnly, pbPruningOn);
361
362 *pbModesPruned = This->bModesPruned;
363 *pbKeyIsReadOnly = This->bKeyIsReadOnly;
364 *pbPruningOn = This->bPruningOn;
365}
366
369 BOOL PruningOn)
370{
371 HKEY hKey;
372 DWORD dwValue;
374
375 DPRINT1("CDevSettings::SetPruningMode(%d)\n", PruningOn);
376
377 if (This->bModesPruned && !This->bKeyIsReadOnly &&
378 PruningOn != This->bPruningOn)
379 {
380 This->bPruningOn = (PruningOn != FALSE);
381
383 FALSE);
384 if (hKey != NULL)
385 {
386 dwValue = (DWORD)This->bPruningOn;
387
389 TEXT("PruningMode"),
390 0,
391 REG_DWORD,
392 (const BYTE *)&dwValue,
393 sizeof(dwValue));
394
396 }
397 }
398}
399
400static VOID
402 LPCTSTR lpValueName,
404{
406 DWORD size = 128 * sizeof(WCHAR);
408 lpValueName,
409 NULL,
410 &type,
412 &size);
413}
414
415static VOID
417{
418 PDESK_EXT_INTERFACE Interface = &This->ExtInterface;
419 HKEY hKeyDev;
420
422 sizeof(*Interface));
423 Interface->cbSize = sizeof(*Interface);
424
425 /* Initialize the callback table */
427 Interface->EnumAllModes = CDevSettings_EnumAllModes;
428 Interface->SetCurrentMode = CDevSettings_SetCurrentMode;
429 Interface->GetCurrentMode = CDevSettings_GetCurrentMode;
430 Interface->SetPruningMode = CDevSettings_SetPruningMode;
431 Interface->GetPruningMode = CDevSettings_GetPruningMode;
432
433 /* Read the HardwareInformation.* values from the registry key */
435 TRUE);
436 if (hKeyDev != NULL)
437 {
438 DWORD dwType, dwMemSize = 0;
439 DWORD dwSize = sizeof(dwMemSize);
440
441 if (RegQueryValueEx(hKeyDev,
442 TEXT("HardwareInformation.MemorySize"),
443 NULL,
444 &dwType,
445 (PBYTE)&dwMemSize,
446 &dwSize) == ERROR_SUCCESS &&
447 (dwType == REG_BINARY || dwType == REG_DWORD) &&
448 dwSize == sizeof(dwMemSize))
449 {
450 dwMemSize /= 1024;
451
452 if (dwMemSize > 1024)
453 {
454 dwMemSize /= 1024;
455 if (dwMemSize > 1024)
456 {
457 wsprintf(Interface->MemorySize,
458 _T("%u GB"),
459 dwMemSize / 1024);
460 }
461 else
462 {
463 wsprintf(Interface->MemorySize,
464 _T("%u MB"),
465 dwMemSize);
466 }
467 }
468 else
469 {
470 wsprintf(Interface->MemorySize,
471 _T("%u KB"),
472 dwMemSize);
473 }
474 }
475
477 TEXT("HardwareInformation.ChipType"),
478 Interface->ChipType);
480 TEXT("HardwareInformation.DacType"),
481 Interface->DacType);
483 TEXT("HardwareInformation.AdapterString"),
484 Interface->AdapterString);
486 TEXT("HardwareInformation.BiosString"),
487 Interface->BiosString);
488 RegCloseKey(hKeyDev);
489 }
490}
491
492static HRESULT
494 PDISPLAY_DEVICE_ENTRY DisplayDeviceInfo)
495{
496 HKEY hKey;
497 DWORD i = 0, dwSize;
499
500 This->lpOrigDevMode = NULL;
501 This->lpCurDevMode = NULL;
502 This->DevModes = NULL;
503 This->nDevModes = 0;
504 This->Flags = 0;
505 This->StateFlags = DisplayDeviceInfo->DeviceStateFlags;
506 DPRINT1("This->StateFlags: %x\n", This->StateFlags);
507
508 /* Register clipboard formats */
518
519 /* Copy the device name */
520 This->pDisplayDevice = pCDevSettings_AllocAndCopyString(DisplayDeviceInfo->DeviceName);
521 DPRINT1("This->pDisplayDevice: %ws\n", This->pDisplayDevice);
522 This->pDisplayName = pCDevSettings_AllocAndCopyString(DisplayDeviceInfo->DeviceDescription);
523 DPRINT1("This->pDisplayName: %ws\n", This->pDisplayName);
524 This->pDisplayKey = pCDevSettings_AllocAndCopyString(DisplayDeviceInfo->DeviceKey);
525 DPRINT1("This->pDisplayKey: %ws\n", This->pDisplayKey);
526 This->pDisplayId = pCDevSettings_GetDeviceInstanceId(DisplayDeviceInfo->DeviceID);
527 DPRINT1("This->pDisplayId: %ws\n", This->pDisplayId);
528 This->pMonitorName = pCDevSettings_GetMonitorName(This->pDisplayDevice);
529 DPRINT1("This->pMonitorName: %ws\n", This->pMonitorName);
530 This->pMonitorDevice = pCDevSettings_GetMonitorDevice(This->pDisplayDevice);
531 DPRINT1("This->pMonitorDevice: %ws\n", This->pMonitorDevice);
532
533 /* Check pruning mode */
534 This->bModesPruned = ((DisplayDeviceInfo->DeviceStateFlags & DISPLAY_DEVICE_MODESPRUNED) != 0);
536 FALSE);
537 if (hKey == NULL)
538 {
540 FALSE);
541 This->bKeyIsReadOnly = TRUE;
542 }
543 if (hKey != NULL)
544 {
545 DWORD dw = 0;
546 DWORD dwType;
547
548 dwSize = sizeof(dw);
550 TEXT("PruningMode"),
551 NULL,
552 &dwType,
553 (PBYTE)&dw,
555 {
556 if (dwType == REG_DWORD && dwSize == sizeof(dw))
557 This->bPruningOn = (dw != 0);
558 }
559
561 }
562
563 /* Initialize display modes */
564 ZeroMemory(&devmode, sizeof(devmode));
565 devmode.dmSize = (WORD)sizeof(devmode);
566 while (EnumDisplaySettingsExW(This->pDisplayDevice, i, &devmode, EDS_RAWMODE))
567 {
570 PDEVMODEW * DevModesNew = NULL;
571
572 if (pDevMode)
573 {
574 CopyMemory(pDevMode,
575 &devmode,
576 dwSize);
577
578 dwSize = (This->nDevModes + 1) * sizeof(pDevMode);
579 DevModesNew = LocalAlloc(LMEM_FIXED, dwSize);
580 if (DevModesNew)
581 {
582 if (This->DevModes)
583 {
584 CopyMemory(DevModesNew,
585 This->DevModes,
586 This->nDevModes * sizeof(pDevMode));
587
588 LocalFree(This->DevModes);
589 }
590
591 This->DevModes = DevModesNew;
592 This->DevModes[This->nDevModes++] = pDevMode;
593 }
594 else
595 {
596 DPRINT1("LocalAlloc failed to allocate %d bytes\n", dwSize);
597 return E_OUTOFMEMORY;
598 }
599 }
600 else
601 {
602 DPRINT1("LocalAlloc failed to allocate %d bytes\n", dwSize);
603 return E_OUTOFMEMORY;
604 }
605
607 i++;
608 }
609
610 /* FIXME: Detect duplicated modes and mark them.
611 * Enumeration functions should check these marks
612 * and skip corresponding array entries. */
613
614 /* Get current display mode */
615 ZeroMemory(&devmode, sizeof(devmode));
616 devmode.dmSize = (WORD)sizeof(devmode);
617 if (EnumDisplaySettingsExW(This->pDisplayDevice, ENUM_CURRENT_SETTINGS, &devmode, 0))
618 {
619 for (i = 0; i < This->nDevModes; i++)
620 {
621 PDEVMODEW CurMode = This->DevModes[i];
622
623 if (!CurMode)
624 continue;
625
626 if (((CurMode->dmFields & DM_PELSWIDTH) && devmode.dmPelsWidth == CurMode->dmPelsWidth) &&
627 ((CurMode->dmFields & DM_PELSHEIGHT) && devmode.dmPelsHeight == CurMode->dmPelsHeight) &&
628 ((CurMode->dmFields & DM_BITSPERPEL) && devmode.dmBitsPerPel == CurMode->dmBitsPerPel) &&
630 {
631 This->lpOrigDevMode = This->lpCurDevMode = CurMode;
632 break;
633 }
634 }
635 }
636
637 /* Initialize the shell extension interface */
639
640 return S_OK;
641}
642
643static VOID
645{
646 This->lpOrigDevMode = NULL;
647 This->lpCurDevMode = NULL;
648 while (This->nDevModes)
649 {
650 LocalFree(This->DevModes[--This->nDevModes]);
651 }
652 LocalFree(This->DevModes);
653 This->DevModes = NULL;
654
655 pCDevSettings_FreeString(&This->pDisplayDevice);
656 pCDevSettings_FreeString(&This->pDisplayName);
657 pCDevSettings_FreeString(&This->pDisplayKey);
658 pCDevSettings_FreeString(&This->pDisplayId);
659 pCDevSettings_FreeString(&This->pMonitorName);
660 pCDevSettings_FreeString(&This->pMonitorDevice);
661}
662
665 REFIID riid,
666 void** ppvObject)
667{
669
670 *ppvObject = NULL;
671
672 if (IsEqualGUID(riid,
673 &IID_IUnknown) ||
676 {
678 return S_OK;
679 }
680 else
681 {
682 DPRINT1("CDevSettings::QueryInterface: Queried unknown interface\n");
683 }
684
685 return E_NOINTERFACE;
686}
687
690{
692 return (ULONG)InterlockedIncrement((PLONG)&This->ref);
693}
694
697{
698 ULONG refs;
700 refs = (ULONG)InterlockedDecrement((PLONG)&This->ref);
701 if (refs == 0)
703
704 return refs;
705}
706
709 FORMATETC* pformatetcIn,
710 STGMEDIUM* pmedium)
711{
712 static const WCHAR szEmpty[] = {0};
713 HRESULT hr;
714 PCWSTR pszRet = NULL;
715 PWSTR pszBuf;
717
718 ZeroMemory(pmedium,
719 sizeof(STGMEDIUM));
720
721 hr = IDataObject_QueryGetData(iface,
722 pformatetcIn);
723 if (SUCCEEDED(hr))
724 {
725 /* Return the requested data back to the shell extension */
726
727 if (pformatetcIn->cfFormat == This->cfDisplayDevice)
728 {
729 pszRet = This->pDisplayDevice;
730 DPRINT1("CDevSettings::GetData returns display device %ws\n", pszRet);
731 }
732 else if (pformatetcIn->cfFormat == This->cfDisplayName)
733 {
734 pszRet = This->pDisplayName;
735 DPRINT1("CDevSettings::GetData returns display name %ws\n", pszRet);
736 }
737 else if (pformatetcIn->cfFormat == This->cfDisplayKey)
738 {
739 pszRet = This->pDisplayKey;
740 DPRINT1("CDevSettings::GetData returns display key %ws\n", pszRet);
741 }
742 else if (pformatetcIn->cfFormat == This->cfDisplayId)
743 {
744 pszRet = This->pDisplayId;
745 DPRINT1("CDevSettings::GetData returns display id %ws\n", pszRet);
746 }
747 else if (pformatetcIn->cfFormat == This->cfMonitorName)
748 {
749 pszRet = This->pMonitorName;
750 DPRINT1("CDevSettings::GetData returns monitor name %ws\n", pszRet);
751 }
752 else if (pformatetcIn->cfFormat == This->cfMonitorDevice)
753 {
754 pszRet = This->pMonitorDevice;
755 DPRINT1("CDevSettings::GetData returns monitor device %ws\n", pszRet);
756 }
757 else if (pformatetcIn->cfFormat == This->cfExtInterface)
758 {
759 PDESK_EXT_INTERFACE pIface;
760
761 pIface = GlobalAlloc(GPTR,
762 sizeof(*pIface));
763 if (pIface != NULL)
764 {
765 CopyMemory(pIface,
766 &This->ExtInterface,
767 sizeof(This->ExtInterface));
768
769 DPRINT1("CDevSettings::GetData returns the desk.cpl extension interface\n");
770
771 pmedium->tymed = TYMED_HGLOBAL;
772 pmedium->hGlobal = pIface;
773
774 return S_OK;
775 }
776 else
777 return E_OUTOFMEMORY;
778 }
779 else if (pformatetcIn->cfFormat == This->cfDisplayStateFlags)
780 {
781 PDWORD pdw;
782
783 pdw = GlobalAlloc(GPTR,
784 sizeof(*pdw));
785 if (pdw != NULL)
786 {
787 *pdw = This->StateFlags;
788
789 DPRINT1("CDevSettings::GetData returns the display state flags %x\n", This->StateFlags);
790
791 pmedium->tymed = TYMED_HGLOBAL;
792 pmedium->hGlobal = pdw;
793
794 return S_OK;
795 }
796 else
797 return E_OUTOFMEMORY;
798 }
799 else if (pformatetcIn->cfFormat == This->cfPruningMode)
800 {
801 PBYTE pb;
802
803 pb = GlobalAlloc(GPTR,
804 sizeof(*pb));
805 if (pb != NULL)
806 {
807 *pb = (This->bModesPruned && This->bPruningOn);
808
809 pmedium->tymed = TYMED_HGLOBAL;
810 pmedium->hGlobal = pb;
811
812 return S_OK;
813 }
814 else
815 return E_OUTOFMEMORY;
816 }
817
818 /* NOTE: This only returns null-terminated strings! */
819 if (pszRet == NULL)
820 pszRet = szEmpty;
821
822 pszBuf = GlobalAlloc(GPTR,
823 (wcslen(pszRet) + 1) * sizeof(WCHAR));
824 if (pszBuf != NULL)
825 {
826 hr = StringCbCopyW(pszBuf, (wcslen(pszRet) + 1) * sizeof(WCHAR), pszRet);
827 if (FAILED(hr))
828 {
829 GlobalFree(pszBuf);
830 return hr;
831 }
832
833 pmedium->tymed = TYMED_HGLOBAL;
834 pmedium->hGlobal = pszBuf;
835
836 hr = S_OK;
837 }
838 else
840 }
841
842 return hr;
843}
844
847 FORMATETC* pformatetc,
848 STGMEDIUM* pmedium)
849{
850 ZeroMemory(pformatetc,
851 sizeof(*pformatetc));
852 return E_NOTIMPL;
853}
854
857 FORMATETC* pformatetc)
858{
859#if DEBUG
860 TCHAR szFormatName[255];
861#endif
863
864 if (pformatetc->dwAspect != DVASPECT_CONTENT)
865 return DV_E_DVASPECT;
866
867 if (pformatetc->lindex != -1)
868 return DV_E_LINDEX;
869
870 if (!(pformatetc->tymed & TYMED_HGLOBAL))
871 return DV_E_TYMED;
872
873 /* Check if the requested data can be provided */
874 if (pformatetc->cfFormat == This->cfExtInterface ||
875 pformatetc->cfFormat == This->cfDisplayDevice ||
876 pformatetc->cfFormat == This->cfDisplayName ||
877 pformatetc->cfFormat == This->cfDisplayId ||
878 pformatetc->cfFormat == This->cfDisplayKey ||
879 pformatetc->cfFormat == This->cfDisplayStateFlags ||
880 pformatetc->cfFormat == This->cfMonitorDevice ||
881 pformatetc->cfFormat == This->cfMonitorName ||
882 pformatetc->cfFormat == This->cfPruningMode)
883 {
884 return S_OK;
885 }
886#if DEBUG
887 else
888 {
889 if (GetClipboardFormatName(pformatetc->cfFormat,
890 szFormatName,
891 sizeof(szFormatName) / sizeof(szFormatName[0])))
892 {
893 DPRINT1("CDevSettings::QueryGetData(\"%ws\")\n", szFormatName);
894 }
895 else
896 {
897 DPRINT1("CDevSettings::QueryGetData(Format %u)\n", (unsigned int)pformatetc->cfFormat);
898 }
899 }
900#endif
901
902 return DV_E_FORMATETC;
903}
904
907 FORMATETC* pformatectIn,
908 FORMATETC* pformatetcOut)
909{
910 HRESULT hr;
911
912 DPRINT1("CDevSettings::GetCanonicalFormatEtc\n");
913
914 hr = IDataObject_QueryGetData(iface,
915 pformatectIn);
916 if (SUCCEEDED(hr))
917 {
918 CopyMemory(pformatetcOut,
919 pformatectIn,
920 sizeof(FORMATETC));
921
922 /* Make sure the data is target device independent */
923 if (pformatectIn->ptd == NULL)
925 else
926 {
927 pformatetcOut->ptd = NULL;
928 hr = S_OK;
929 }
930 }
931 else
932 {
933 ZeroMemory(pformatetcOut,
934 sizeof(FORMATETC));
935 }
936
937 return hr;
938}
939
942 FORMATETC* pformatetc,
943 STGMEDIUM* pmedium,
944 BOOL fRelease)
945{
946 DPRINT1("CDevSettings::SetData UNIMPLEMENTED\n");
947 return E_NOTIMPL;
948}
949
950static __inline VOID
951pCDevSettings_FillFormatEtc(FORMATETC *pFormatEtc,
952 CLIPFORMAT cf)
953{
954 pFormatEtc->cfFormat = cf;
955 pFormatEtc->ptd = NULL;
956 pFormatEtc->dwAspect = DVASPECT_CONTENT;
957 pFormatEtc->lindex = -1;
958 pFormatEtc->tymed = TYMED_HGLOBAL;
959}
960
963 DWORD dwDirection,
964 IEnumFORMATETC** ppenumFormatEtc)
965{
966 HRESULT hr;
967 FORMATETC fetc[9];
969
970 *ppenumFormatEtc = NULL;
971
972 if (dwDirection == DATADIR_GET)
973 {
975 This->cfExtInterface);
977 This->cfDisplayDevice);
979 This->cfDisplayName);
981 This->cfDisplayId);
983 This->cfDisplayKey);
985 This->cfDisplayStateFlags);
987 This->cfMonitorName);
989 This->cfMonitorDevice);
991 This->cfPruningMode);
992
993 hr = SHCreateStdEnumFmtEtc(sizeof(fetc) / sizeof(fetc[0]),
994 fetc,
995 ppenumFormatEtc);
996 }
997 else
998 hr = E_NOTIMPL;
999
1000 return hr;
1001}
1002
1005 FORMATETC* pformatetc,
1006 DWORD advf,
1007 IAdviseSink* pAdvSink,
1008 DWORD* pdwConnection)
1009{
1010 *pdwConnection = 0;
1012}
1013
1016 DWORD dwConnection)
1017{
1019}
1020
1023 IEnumSTATDATA** ppenumAdvise)
1024{
1025 *ppenumAdvise = NULL;
1027}
1028
1029static const struct IDataObjectVtbl vtblIDataObject = {
1042};
1043
1046{
1048
1050 0,
1051 sizeof(*This));
1052 if (This != NULL)
1053 {
1054 This->lpIDataObjectVtbl = &vtblIDataObject;
1055 This->ref = 1;
1056
1058 DisplayDeviceInfo)))
1059 {
1061 }
1062
1064 }
1065
1066 return NULL;
1067}
1068
1071 HWND hwndPropSheet)
1072{
1075
1076 if (This->lpCurDevMode != This->lpOrigDevMode)
1077 {
1078 SETTINGS_ENTRY seOrig, seCur;
1079 BOOL Ret;
1080
1081 seOrig.dmPelsWidth = This->lpOrigDevMode->dmPelsWidth;
1082 seOrig.dmPelsHeight = This->lpOrigDevMode->dmPelsHeight;
1083 seOrig.dmBitsPerPel = This->lpOrigDevMode->dmBitsPerPel;
1084 seOrig.dmDisplayFrequency = This->lpOrigDevMode->dmDisplayFrequency;
1085
1086 seCur.dmPelsWidth = This->lpCurDevMode->dmPelsWidth;
1087 seCur.dmPelsHeight = This->lpCurDevMode->dmPelsHeight;
1088 seCur.dmBitsPerPel = This->lpCurDevMode->dmBitsPerPel;
1089 seCur.dmDisplayFrequency = This->lpCurDevMode->dmDisplayFrequency;
1090
1091 Ret = SwitchDisplayMode(hwndPropSheet,
1092 This->pDisplayDevice,
1093 &seOrig,
1094 &seCur,
1095 &rc);
1096
1097 if (rc == DISP_CHANGE_SUCCESSFUL)
1098 {
1099 if (Ret)
1100 This->lpOrigDevMode = This->lpCurDevMode;
1101 else
1102 This->lpCurDevMode = This->lpOrigDevMode;
1103 }
1104 }
1105
1106 return rc;
1107}
DEVMODEW devmode
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define DPRINT1
Definition: precomp.h:8
const GUID IID_IUnknown
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
#define RegCloseKey(hKey)
Definition: registry.h:49
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_NOTIMPL
Definition: ddrawi.h:99
#define ERROR_SUCCESS
Definition: deptool.c:10
BOOL SwitchDisplayMode(HWND hwndDlg, PWSTR DeviceName, PSETTINGS_ENTRY seInit, PSETTINGS_ENTRY seNew, OUT PLONG rc)
Definition: settings.c:771
#define DESK_EXT_CALLBACK
Definition: deskcplx.h:4
#define DESK_EXT_MONITORNAME
Definition: deskcplx.h:13
#define DESK_EXT_DISPLAYSTATEFLAGS
Definition: deskcplx.h:12
#define DESK_EXT_DISPLAYDEVICE
Definition: deskcplx.h:8
#define DESK_EXT_PRUNINGMODE
Definition: deskcplx.h:7
#define DESK_EXT_EXTINTERFACE
Definition: deskcplx.h:6
#define DESK_EXT_DISPLAYNAME
Definition: deskcplx.h:9
#define DESK_EXT_DISPLAYID
Definition: deskcplx.h:10
#define DESK_EXT_DISPLAYKEY
Definition: deskcplx.h:11
#define DESK_EXT_MONITORDEVICE
Definition: deskcplx.h:14
static HRESULT STDMETHODCALLTYPE CDevSettings_QueryInterface(IDataObject *iface, REFIID riid, void **ppvObject)
Definition: devsett.c:664
static HRESULT STDMETHODCALLTYPE CDevSettings_QueryGetData(IDataObject *iface, FORMATETC *pformatetc)
Definition: devsett.c:856
static __inline VOID pCDevSettings_FreeString(PWCHAR *psz)
Definition: devsett.c:69
static const struct IDataObjectVtbl vtblIDataObject
Definition: devsett.c:1029
static PWSTR pCDevSettings_GetMonitorDevice(const WCHAR *pszDisplayDevice)
Definition: devsett.c:152
static HRESULT STDMETHODCALLTYPE CDevSettings_SetData(IDataObject *iface, FORMATETC *pformatetc, STGMEDIUM *pmedium, BOOL fRelease)
Definition: devsett.c:941
static HRESULT STDMETHODCALLTYPE CDevSettings_GetData(IDataObject *iface, FORMATETC *pformatetcIn, STGMEDIUM *pmedium)
Definition: devsett.c:708
VOID DESK_EXT_CALLBACK CDevSettings_GetPruningMode(PVOID Context, PBOOL pbModesPruned, PBOOL pbKeyIsReadOnly, PBOOL pbPruningOn)
Definition: devsett.c:353
static HRESULT STDMETHODCALLTYPE CDevSettings_EnumFormatEtc(IDataObject *iface, DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc)
Definition: devsett.c:962
PDEVMODEW DESK_EXT_CALLBACK CDevSettings_EnumAllModes(PVOID Context, DWORD Index)
Definition: devsett.c:289
static HRESULT STDMETHODCALLTYPE CDevSettings_GetDataHere(IDataObject *iface, FORMATETC *pformatetc, STGMEDIUM *pmedium)
Definition: devsett.c:846
static __inline PCDevSettings impl_from_IDataObject(struct IDataObject *iface)
Definition: devsett.c:62
BOOL DESK_EXT_CALLBACK CDevSettings_SetCurrentMode(PVOID Context, DEVMODEW *pDevMode)
Definition: devsett.c:325
static ULONG STDMETHODCALLTYPE CDevSettings_AddRef(IDataObject *iface)
Definition: devsett.c:689
static HRESULT STDMETHODCALLTYPE CDevSettings_GetCanonicalFormatEtc(IDataObject *iface, FORMATETC *pformatectIn, FORMATETC *pformatetcOut)
Definition: devsett.c:906
struct _CDevSettings * PCDevSettings
static PWSTR pCDevSettings_AllocAndCopyString(const TCHAR *pszSrc)
Definition: devsett.c:79
static HKEY pCDevSettings_OpenDeviceKey(PCDevSettings This, BOOL ReadOnly)
Definition: devsett.c:253
#define impl_to_interface(impl, iface)
Definition: devsett.c:59
static ULONG STDMETHODCALLTYPE CDevSettings_Release(IDataObject *iface)
Definition: devsett.c:696
struct _CDevSettings CDevSettings
static HRESULT STDMETHODCALLTYPE CDevSettings_DUnadvise(IDataObject *iface, DWORD dwConnection)
Definition: devsett.c:1015
static VOID pCDevSettings_InitializeExtInterface(PCDevSettings This)
Definition: devsett.c:416
static __inline VOID pCDevSettings_FillFormatEtc(FORMATETC *pFormatEtc, CLIPFORMAT cf)
Definition: devsett.c:951
VOID DESK_EXT_CALLBACK CDevSettings_SetPruningMode(PVOID Context, BOOL PruningOn)
Definition: devsett.c:368
static HRESULT pCDevSettings_Initialize(PCDevSettings This, PDISPLAY_DEVICE_ENTRY DisplayDeviceInfo)
Definition: devsett.c:493
static HRESULT STDMETHODCALLTYPE CDevSettings_DAdvise(IDataObject *iface, FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection)
Definition: devsett.c:1004
PDEVMODEW DESK_EXT_CALLBACK CDevSettings_GetCurrentMode(PVOID Context)
Definition: devsett.c:316
static PWSTR pCDevSettings_GetDeviceInstanceId(const WCHAR *pszDevice)
Converts a Hardware ID (DeviceID from EnumDisplayDevices) to an unique Device Instance ID.
Definition: devsett.c:195
static HRESULT STDMETHODCALLTYPE CDevSettings_EnumDAdvise(IDataObject *iface, IEnumSTATDATA **ppenumAdvise)
Definition: devsett.c:1022
IDataObject * CreateDevSettings(PDISPLAY_DEVICE_ENTRY DisplayDeviceInfo)
Definition: devsett.c:1045
static PWSTR pCDevSettings_GetMonitorName(const WCHAR *pszDisplayDevice)
Definition: devsett.c:106
static VOID pCDevSettings_ReadHardwareInfo(HKEY hKey, LPCTSTR lpValueName, LPWSTR lpBuffer)
Definition: devsett.c:401
static VOID pCDevSettings_Free(PCDevSettings This)
Definition: devsett.c:644
LONG WINAPI DisplaySaveSettings(PVOID pContext, HWND hwndPropSheet)
Definition: devsett.c:1070
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HINSTANCE hApplet
Definition: access.c:17
#define IDS_UNKNOWNMONITOR
Definition: resource.h:158
#define IDS_MULTIPLEMONITORS
Definition: resource.h:157
static const WCHAR szEmpty[]
Definition: provider.c:50
unsigned int idx
Definition: utils.c:41
#define GetProcessHeap()
Definition: compat.h:736
#define CP_ACP
Definition: compat.h:109
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define HeapAlloc
Definition: compat.h:733
#define MultiByteToWideChar
Definition: compat.h:110
BOOL WINAPI SetupDiEnumDeviceInfo(HDEVINFO devinfo, DWORD index, PSP_DEVINFO_DATA info)
Definition: devinst.c:1787
HDEVINFO WINAPI SetupDiGetClassDevsW(CONST GUID *class, LPCWSTR enumstr, HWND parent, DWORD flags)
Definition: devinst.c:2292
#define ULONG_PTR
Definition: config.h:101
#define BufLen
Definition: fatfs.h:167
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
FxAutoRegKey hKey
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
const GLubyte * c
Definition: glext.h:8905
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
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1390
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID DWORD_PTR dw
Definition: atlbase.h:40
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define TEXT(s)
Definition: k32.h:26
#define c
Definition: ke_i.h:80
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define REG_BINARY
Definition: nt_native.h:1496
#define KEY_READ
Definition: nt_native.h:1023
#define KEY_WRITE
Definition: nt_native.h:1031
#define DWORD
Definition: nt_native.h:44
#define L(x)
Definition: ntvdm.h:50
const GUID IID_IDataObject
BYTE * PBYTE
Definition: pedump.c:66
DWORD * PDWORD
Definition: pedump.c:68
long LONG
Definition: pedump.c:60
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
const WCHAR * str
#define REG_DWORD
Definition: sdbapi.c:596
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
@ ReadOnly
Definition: arc.h:80
#define SetupDiGetDeviceInstanceId
Definition: setupapi.h:2600
#define DIGCF_ALLCLASSES
Definition: setupapi.h:172
#define DIGCF_PRESENT
Definition: setupapi.h:171
HRESULT WINAPI SHCreateStdEnumFmtEtc(UINT cFormats, const FORMATETC *lpFormats, LPENUMFORMATETC *ppenumFormatetc)
Definition: shellord.c:2232
HRESULT hr
Definition: shlfolder.c:183
#define DPRINT
Definition: sndvol32.h:71
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166
DWORD ref
Definition: devsett.c:20
DESK_EXT_INTERFACE ExtInterface
Definition: devsett.c:39
CLIPFORMAT cfMonitorName
Definition: devsett.c:26
CLIPFORMAT cfDisplayStateFlags
Definition: devsett.c:29
PWSTR pMonitorName
Definition: devsett.c:36
const struct IDataObjectVtbl * lpIDataObjectVtbl
Definition: devsett.c:19
CLIPFORMAT cfPruningMode
Definition: devsett.c:30
PDEVMODEW lpCurDevMode
Definition: devsett.c:42
PWSTR pMonitorDevice
Definition: devsett.c:37
DWORD bPruningOn
Definition: devsett.c:54
PWSTR pDisplayDevice
Definition: devsett.c:32
DWORD Flags
Definition: devsett.c:49
CLIPFORMAT cfExtInterface
Definition: devsett.c:22
PWSTR pDisplayName
Definition: devsett.c:33
PDEVMODEW lpOrigDevMode
Definition: devsett.c:41
CLIPFORMAT cfMonitorDevice
Definition: devsett.c:27
DWORD bModesPruned
Definition: devsett.c:52
CLIPFORMAT cfDisplayId
Definition: devsett.c:25
CLIPFORMAT cfDisplayKey
Definition: devsett.c:28
PWSTR pDisplayKey
Definition: devsett.c:34
CLIPFORMAT cfDisplayName
Definition: devsett.c:24
PWSTR pDisplayId
Definition: devsett.c:35
DWORD nDevModes
Definition: devsett.c:44
DWORD bKeyIsReadOnly
Definition: devsett.c:53
PDEVMODEW * DevModes
Definition: devsett.c:43
CLIPFORMAT cfDisplayDevice
Definition: devsett.c:23
DWORD StateFlags
Definition: devsett.c:45
WCHAR DeviceName[32]
Definition: wingdi.h:2818
WCHAR DeviceString[128]
Definition: wingdi.h:2819
Definition: precomp.h:68
DWORD DeviceStateFlags
Definition: precomp.h:74
LPWSTR DeviceID
Definition: precomp.h:73
LPWSTR DeviceDescription
Definition: precomp.h:70
LPWSTR DeviceKey
Definition: precomp.h:72
LPWSTR DeviceName
Definition: precomp.h:71
Definition: precomp.h:59
DWORD dmPelsHeight
Definition: precomp.h:64
DWORD dmDisplayFrequency
Definition: desk.h:138
DWORD dmBitsPerPel
Definition: precomp.h:62
DWORD dmPelsWidth
Definition: precomp.h:63
DWORD dmBitsPerPel
Definition: wingdi.h:1647
DWORD dmFields
Definition: wingdi.h:1622
DWORD dmPelsWidth
Definition: wingdi.h:1648
WORD dmDriverExtra
Definition: wingdi.h:1621
DWORD dmPelsHeight
Definition: wingdi.h:1649
DWORD dmDisplayFrequency
Definition: wingdi.h:1654
WORD dmSize
Definition: wingdi.h:1620
uint16_t * PWSTR
Definition: typedefs.h:56
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
void * PVOID
Definition: typedefs.h:50
ULONG_PTR SIZE_T
Definition: typedefs.h:80
int32_t * PLONG
Definition: typedefs.h:58
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
#define _T(x)
Definition: vfdio.h:22
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465
BOOL WINAPI EnumDisplayDevicesW(LPCWSTR lpDevice, DWORD iDevNum, PDISPLAY_DEVICEW lpDisplayDevice, DWORD dwFlags)
Definition: display.c:78
BOOL WINAPI EnumDisplaySettingsExW(LPCWSTR lpszDeviceName, DWORD iModeNum, LPDEVMODEW lpDevMode, DWORD dwFlags)
Definition: display.c:330
#define ZeroMemory
Definition: winbase.h:1712
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define GPTR
Definition: winbase.h:296
#define CopyMemory
Definition: winbase.h:1710
#define LMEM_FIXED
Definition: winbase.h:368
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
BOOL * PBOOL
Definition: windef.h:161
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:2364
#define DV_E_TYMED
Definition: winerror.h:2638
#define DV_E_FORMATETC
Definition: winerror.h:2633
#define OLE_E_ADVISENOTSUPPORTED
Definition: winerror.h:2617
#define DV_E_LINDEX
Definition: winerror.h:2637
#define DV_E_DVASPECT
Definition: winerror.h:2640
#define DATA_S_SAMEFORMATETC
Definition: winerror.h:2674
#define DM_DISPLAYFREQUENCY
Definition: wingdi.h:1272
#define DM_PELSWIDTH
Definition: wingdi.h:1269
#define DM_BITSPERPEL
Definition: wingdi.h:1268
#define DM_PELSHEIGHT
Definition: wingdi.h:1270
#define DISPLAY_DEVICE_MODESPRUNED
Definition: wingdi.h:1404
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define RegOpenKeyEx
Definition: winreg.h:520
#define RegSetValueEx
Definition: winreg.h:533
ACCESS_MASK REGSAM
Definition: winreg.h:69
#define RegQueryValueEx
Definition: winreg.h:524
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define DISP_CHANGE_SUCCESSFUL
Definition: winuser.h:190
#define RegisterClipboardFormat
Definition: winuser.h:5838
#define GetClipboardFormatName
Definition: winuser.h:5784
#define ENUM_CURRENT_SETTINGS
Definition: winuser.h:179
#define wsprintf
Definition: winuser.h:5865
char TCHAR
Definition: xmlstorage.h:189
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
#define _tcslen
Definition: xmlstorage.h:198
unsigned char BYTE
Definition: xxhash.c:193