ReactOS  0.4.14-dev-593-g1793dcc
CLayerUIPropPage.cpp
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Compatibility Layer Shell Extension
3  * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4  * PURPOSE: CLayerUIPropPage implementation
5  * COPYRIGHT: Copyright 2015-2019 Mark Jansen (mark.jansen@reactos.org)
6  */
7 
8 #include "precomp.h"
9 
10 #include <shlwapi.h>
11 #include <shellapi.h>
12 #include <shellutils.h>
13 #include <strsafe.h>
14 #include <apphelp.h>
15 #include <windowsx.h>
16 #include <sfc.h>
17 
18 const GUID CLSID_CLayerUIPropPage = { 0x513D916F, 0x2A8E, 0x4F51, { 0xAE, 0xAB, 0x0C, 0xBC, 0x76, 0xFB, 0x1A, 0xF8 } };
19 
20 #define GPLK_USER 1
21 #define GPLK_MACHINE 2
22 #define MAX_LAYER_LENGTH 256
23 
24 static struct {
25  const PCWSTR Display;
26  const PCWSTR Name;
27 } g_CompatModes[] = {
28  { L"Windows 95", L"WIN95" },
29  { L"Windows 98/ME", L"WIN98" },
30  { L"Windows NT 4.0 (SP5)", L"NT4SP5" },
31  { L"Windows 2000", L"WIN2000" },
32  { L"Windows XP (SP2)", L"WINXPSP2" },
33  { L"Windows XP (SP3)", L"WINXPSP3" },
34  { L"Windows Server 2003 (SP1)", L"WINSRV03SP1" },
35  { L"Windows Server 2008 (SP1)", L"WINSRV08SP1" },
36  { L"Windows Vista", L"VISTARTM" },
37  { L"Windows Vista (SP1)", L"VISTASP1" },
38  { L"Windows Vista (SP2)", L"VISTASP2" },
39  { L"Windows 7", L"WIN7RTM" },
40  { L"Windows 7 (SP1)", L"WIN7SP1" },
41  { L"Windows 8", L"WIN8RTM" },
42  { L"Windows 8.1", L"WIN81RTM" },
43  { NULL, NULL }
44 };
45 
46 static struct {
47  const PCWSTR Name;
49 } g_Layers[] = {
50  { L"256COLOR", IDC_CHKRUNIN256COLORS },
51  { L"640X480", IDC_CHKRUNIN640480RES },
52  { L"DISABLETHEMES", IDC_CHKDISABLEVISUALTHEMES },
53 #if 0
54  { L"DISABLEDWM", IDC_??, TRUE },
55  { L"HIGHDPIAWARE", IDC_??, TRUE },
56  { L"RUNASADMIN", IDC_??, TRUE },
57 #endif
58  { NULL, 0 }
59 };
60 
61 static const WCHAR* g_AllowedExtensions[] = {
62  L".exe",
63  L".msi",
64  L".pif",
65  L".bat",
66  L".cmd",
67  0
68 };
69 
71 {
72  size_t n;
73 
74  for (n = 0; g_Layers[n].Name; ++n)
75  {
76  if (!wcsicmp(g_Layers[n].Name, Name))
77  {
78  return TRUE;
79  }
80  }
81 
82  for (n = 0; g_CompatModes[n].Name; ++n)
83  {
85  {
86  return TRUE;
87  }
88  }
89  return FALSE;
90 }
91 
92 
94 {
95  WCHAR Buffer[512];
96  WCHAR* Current = Buffer;
97  size_t Length = _countof(Buffer);
98 
99  StringCchPrintfExW(Current, Length, &Current, &Length, STRSAFE_NULL_ON_FAILURE, L"[%-20S] ", FunctionName);
100  va_list ArgList;
101  va_start(ArgList, Format);
102  StringCchVPrintfExW(Current, Length, &Current, &Length, STRSAFE_NULL_ON_FAILURE, Format, ArgList);
103  va_end(ArgList);
105 }
106 
107 #define ACDBG(fmt, ...) ACDBG_FN(__FUNCTION__, fmt, ##__VA_ARGS__ )
108 
109 
110 
112 : m_IsSfcProtected(FALSE)
113 , m_AllowPermLayer(FALSE)
114 , m_LayerQueryFlags(GPLK_USER) /* TODO: When do we read from HKLM? */
115 , m_RegistryOSMode(0)
116 , m_OSMode(0)
117 , m_RegistryEnabledLayers(0)
118 , m_EnabledLayers(0)
119 {
120  CComBSTR title;
121  title.LoadString(g_hModule, IDS_COMPAT_TITLE);
122  m_psp.pszTitle = title.Detach();
123  m_psp.dwFlags |= PSP_USETITLE;
124 }
125 
127 {
128  CComBSTR title;
129  title.Attach((BSTR)m_psp.pszTitle);
130 }
131 
133 {
134  CString ExpandedFilename;
135  DWORD dwRequired = ExpandEnvironmentStringsW(Filename, NULL, 0);
136  if (dwRequired > 0)
137  {
138  LPWSTR Buffer = ExpandedFilename.GetBuffer(dwRequired);
139  DWORD dwReturned = ExpandEnvironmentStringsW(Filename, Buffer, dwRequired);
140  if (dwRequired == dwReturned)
141  {
142  ExpandedFilename.ReleaseBufferSetLength(dwReturned - 1);
143  ACDBG(L"Expanded '%s' => '%s'\r\n", Filename, (PCWSTR)ExpandedFilename);
144  }
145  else
146  {
147  ExpandedFilename.ReleaseBufferSetLength(0);
148  ExpandedFilename = Filename;
149  ACDBG(L"Failed during expansion '%s'\r\n", Filename);
150  }
151  }
152  else
153  {
154  ACDBG(L"Failed to expand '%s'\r\n", Filename);
155  ExpandedFilename = Filename;
156  }
157  PCWSTR pwszExt = PathFindExtensionW(ExpandedFilename);
158  if (!pwszExt)
159  {
160  ACDBG(L"Failed to find an extension: '%s'\r\n", (PCWSTR)ExpandedFilename);
161  return E_FAIL;
162  }
163  if (!wcsicmp(pwszExt, L".lnk"))
164  {
166  if (!GetExeFromLnk(ExpandedFilename, Buffer, _countof(Buffer)))
167  {
168  ACDBG(L"Failed to read link target from: '%s'\r\n", (PCWSTR)ExpandedFilename);
169  return E_FAIL;
170  }
171  if (!wcsicmp(Buffer, ExpandedFilename))
172  {
173  ACDBG(L"Link redirects to itself: '%s'\r\n", (PCWSTR)ExpandedFilename);
174  return E_FAIL;
175  }
176  return InitFile(Buffer);
177  }
178 
179  CString tmp;
180  if (tmp.GetEnvironmentVariable(L"SystemRoot"))
181  {
182  tmp += L"\\System32";
183  if (ExpandedFilename.GetLength() >= tmp.GetLength() &&
184  ExpandedFilename.Left(tmp.GetLength()).MakeLower() == tmp.MakeLower())
185  {
186  ACDBG(L"Ignoring System32: %s\r\n", (PCWSTR)ExpandedFilename);
187  return E_FAIL;
188  }
189  tmp.GetEnvironmentVariable(L"SystemRoot");
190  tmp += L"\\WinSxs";
191  if (ExpandedFilename.GetLength() >= tmp.GetLength() &&
192  ExpandedFilename.Left(tmp.GetLength()).MakeLower() == tmp.MakeLower())
193  {
194  ACDBG(L"Ignoring WinSxs: %s\r\n", (PCWSTR)ExpandedFilename);
195  return E_FAIL;
196  }
197  }
198 
199  for (size_t n = 0; g_AllowedExtensions[n]; ++n)
200  {
201  if (!wcsicmp(g_AllowedExtensions[n], pwszExt))
202  {
203  m_Filename = ExpandedFilename;
204  ACDBG(L"Got: %s\r\n", (PCWSTR)ExpandedFilename);
206  m_AllowPermLayer = AllowPermLayer(ExpandedFilename);
207  return S_OK;
208  }
209  }
210  ACDBG(L"Extension not included: '%s'\r\n", pwszExt);
211  return E_FAIL;
212 }
213 
214 static BOOL GetLayerInfo(PCWSTR Filename, DWORD QueryFlags, PDWORD OSMode, PDWORD Enabledlayers, CSimpleArray<CString>& customLayers)
215 {
217  DWORD dwBytes = sizeof(wszLayers);
218 
219  *OSMode = *Enabledlayers = 0;
220  customLayers.RemoveAll();
221  if (!SdbGetPermLayerKeys(Filename, wszLayers, &dwBytes, QueryFlags))
222  return FALSE;
223 
224  for (PWCHAR Layer = wcstok(wszLayers, L" "); Layer; Layer = wcstok(NULL, L" "))
225  {
226  size_t n;
227  for (n = 0; g_Layers[n].Name; ++n)
228  {
229  if (!wcsicmp(g_Layers[n].Name, Layer))
230  {
231  *Enabledlayers |= (1<<n);
232  break;
233  }
234  }
235  /* Did we find it? */
236  if (g_Layers[n].Name)
237  continue;
238 
239  for (n = 0; g_CompatModes[n].Name; ++n)
240  {
241  if (!wcsicmp(g_CompatModes[n].Name, Layer))
242  {
243  *OSMode = n+1;
244  break;
245  }
246  }
247  /* Did we find it? */
248  if (g_CompatModes[n].Name)
249  continue;
250 
251  /* Must be a 'custom' layer */
252  customLayers.Add(Layer);
253  }
254  return TRUE;
255 }
256 
258 {
261 
262  for (size_t n = 0; g_Layers[n].Name; ++n)
264 
266 
267  if (m_RegistryOSMode)
269 
271 
272  UpdateControls();
273 
274  return 0;
275 }
276 
277 
279 {
280  if (lhs.GetSize() != rhs.GetSize())
281  return FALSE;
282 
283  for (int n = 0; n < lhs.GetSize(); ++n)
284  {
285  if (lhs[n] != rhs[n])
286  return FALSE;
287  }
288  return TRUE;
289 }
290 
292 {
294  return TRUE;
295 
296  if (m_RegistryOSMode != m_OSMode)
297  return TRUE;
298 
300  return TRUE;
301 
302  return FALSE;
303 }
304 
306 {
307  if (HasChanges())
308  {
310 
311  for (size_t n = 0; g_CompatModes[n].Name; ++n)
313 
314  for (size_t n = 0; g_Layers[n].Name; ++n)
315  {
317  }
318 
319  /* Disable all old values */
320  for (int j = 0; j < m_RegistryCustomLayers.GetSize(); j++)
321  {
323  }
324 
325  /* Enable all new values */
326  for (int j = 0; j < m_CustomLayers.GetSize(); j++)
327  {
329  }
330 
332  }
333 
334  return PSNRET_NOERROR;
335 }
336 
338 {
340  for (size_t n = 0; g_CompatModes[n].Display; ++n)
342  ComboBox_SetCurSel(cboMode, 5);
343 
344  CStringW explanation;
345  if (!m_AllowPermLayer)
346  {
348  DisableControls();
349  ACDBG(L"AllowPermLayer returned FALSE\r\n");
350  }
351  else if (m_IsSfcProtected)
352  {
354  DisableControls();
355  ACDBG(L"Protected OS file\r\n");
356  }
357  else
358  {
359  return TRUE;
360  }
361  SetDlgItemTextW(IDC_EXPLANATION, explanation);
362  return TRUE;
363 }
364 
366 {
369  for (size_t n = 0; g_Layers[n].Name; ++n)
372  return TRUE;
373 }
374 
376 {
377  m_OSMode = 0, m_EnabledLayers = 0;
379  if (ModeEnabled)
382 
383  for (size_t n = 0; g_Layers[n].Name; ++n)
384  {
387  }
388 
389  CStringW customLayers;
390  for (int j = 0; j < m_CustomLayers.GetSize(); ++j)
391  {
392  if (j > 0)
393  customLayers += L", ";
394  customLayers += m_CustomLayers[j];
395  }
396  SetDlgItemTextW(IDC_ENABLED_LAYERS, customLayers);
397 
398  SetModified(HasChanges());
399 }
400 
401 LRESULT CLayerUIPropPage::OnCtrlCommand(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
402 {
403  UpdateControls();
404  return 0;
405 }
406 
407 LRESULT CLayerUIPropPage::OnEditModes(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
408 {
409  if (ShowEditCompatModes(m_hWnd, this))
410  UpdateControls();
411  return 0;
412 }
413 
415 {
416  if (hdr->idFrom == IDC_INFOLINK)
417  ShellExecute(NULL, L"open", L"https://www.reactos.org/forum/viewforum.php?f=4", NULL, NULL, SW_SHOW);
418  return 0;
419 }
420 
422 {
423  HKEY hkey;
424  LSTATUS ret = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Policies\\Microsoft\\Windows\\AppCompat", 0, KEY_QUERY_VALUE, &hkey);
425  BOOL Disable = FALSE;
426  if (ret == ERROR_SUCCESS)
427  {
428  DWORD dwValue = 0;
429  DWORD type, size = sizeof(dwValue);
430  ret = RegQueryValueExW(hkey, L"DisableEngine", NULL, &type, (PBYTE)&dwValue, &size);
431  if (ret == ERROR_SUCCESS && type == REG_DWORD)
432  {
433  Disable = !!dwValue;
434  }
435  if (!Disable)
436  {
437  size = sizeof(dwValue);
438  ret = RegQueryValueExW(hkey, L"DisablePropPage", NULL, &type, (PBYTE)&dwValue, &size);
439  if (ret == ERROR_SUCCESS && type == REG_DWORD)
440  {
441  Disable = !!dwValue;
442  }
443  }
444 
445  RegCloseKey(hkey);
446  }
447  return Disable;
448 }
449 
451 {
452  FORMATETC etc = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
453  STGMEDIUM stg;
454 
455  if (DisableShellext())
456  return E_ACCESSDENIED;
457 
458  HRESULT hr = pDataObj->GetData(&etc, &stg);
459  if (FAILED(hr))
460  {
461  ACDBG(L"Failed to retrieve Data from pDataObj.\r\n");
462  return E_INVALIDARG;
463  }
464  hr = E_FAIL;
465  HDROP hdrop = (HDROP)GlobalLock(stg.hGlobal);
466  if (hdrop)
467  {
468  UINT uNumFiles = DragQueryFileW(hdrop, 0xFFFFFFFF, NULL, 0);
469  if (uNumFiles == 1)
470  {
471  WCHAR szFile[MAX_PATH * 2];
472  if (DragQueryFileW(hdrop, 0, szFile, _countof(szFile)))
473  {
474  this->AddRef();
475  hr = InitFile(szFile);
476  }
477  else
478  {
479  ACDBG(L"Failed to query the file.\r\n");
480  }
481  }
482  else
483  {
484  ACDBG(L"Invalid number of files: %d\r\n", uNumFiles);
485  }
486  GlobalUnlock(stg.hGlobal);
487  }
488  else
489  {
490  ACDBG(L"Could not lock stg.hGlobal\r\n");
491  }
492  ReleaseStgMedium(&stg);
493  return hr;
494 }
int GetLength() const
Definition: atlsimpstr.h:356
#define IDC_CHKDISABLEVISUALTHEMES
Definition: resource.h:11
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
const uint16_t * PCWSTR
Definition: typedefs.h:55
#define E_ACCESSDENIED
Definition: winerror.h:2849
#define TRUE
Definition: types.h:120
char hdr[14]
Definition: iptest.cpp:33
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
#define ComboBox_AddString(hwndCtl, lpsz)
Definition: windowsx.h:16
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
#define IDC_EDITCOMPATIBILITYMODES
Definition: resource.h:12
BOOL WINAPI SetPermLayerState(PCWSTR wszPath, PCWSTR wszLayer, DWORD dwFlags, BOOL bMachine, BOOL bEnable)
Definition: layer.c:467
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
Definition: ole2.c:2033
#define IDC_CHKRUNCOMPATIBILITY
Definition: resource.h:7
BOOL WINAPI SfcIsFileProtected(HANDLE RpcHandle, LPCWSTR ProtFileName)
Definition: sfc_os.c:83
STDMETHODIMP Initialize(PCIDLIST_ABSOLUTE pidlFolder, LPDATAOBJECT pdtobj, HKEY hkeyProgID)
#define IDS_FAILED_NETWORK
Definition: resource.h:25
#define _countof(array)
Definition: fontsub.cpp:30
CSimpleArray< CString > m_CustomLayers
#define IDS_COMPAT_TITLE
Definition: resource.h:24
_Check_return_ _CRTIMP wchar_t *__cdecl wcstok(_Inout_opt_z_ wchar_t *_Str, _In_z_ const wchar_t *_Delim)
GLdouble n
Definition: glext.h:7729
LRESULT OnCtrlCommand(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
HMODULE g_hModule
Definition: ACPPage.cpp:12
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define ComboBox_GetCurSel(hwndCtl)
Definition: windowsx.h:24
UINT_PTR WPARAM
Definition: windef.h:207
BOOL WINAPI AllowPermLayer(PCWSTR path)
Definition: layer.c:320
OLECHAR * BSTR
Definition: compat.h:1942
uint16_t * PWCHAR
Definition: typedefs.h:54
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
static BOOL ArrayEquals(const CSimpleArray< CString > &lhs, const CSimpleArray< CString > &rhs)
int32_t INT_PTR
Definition: typedefs.h:62
#define E_FAIL
Definition: ddrawi.h:102
#define IDS_FAILED_PROTECTED
Definition: resource.h:26
int32_t INT
Definition: typedefs.h:56
WPARAM wParam
Definition: combotst.c:138
IN PVCB IN PBCB OUT PDIRENT IN USHORT IN POEM_STRING Filename
Definition: fatprocs.h:925
DWORD Id
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
STRSAFEAPI StringCchPrintfExW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPWSTR *ppszDestEnd, size_t *pcchRemaining, STRSAFE_DWORD dwFlags, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:585
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
static struct @298 g_Layers[]
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define va_end(ap)
Definition: acmsvcex.h:90
#define IDC_EXPLANATION
Definition: resource.h:6
unsigned int BOOL
Definition: ntddk_ex.h:94
CSimpleArray< CString > m_RegistryCustomLayers
#define ShellExecute
Definition: shellapi.h:689
#define GPLK_MACHINE
#define STDMETHODIMP
Definition: basetyps.h:43
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define CF_HDROP
Definition: constants.h:410
LONG_PTR LPARAM
Definition: windef.h:208
char * va_list
Definition: acmsvcex.h:78
Definition: bufpool.h:45
#define IDC_INFOLINK
Definition: resource.h:13
#define SW_SHOW
Definition: winuser.h:769
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
Definition: path.c:442
static BOOL GetLayerInfo(PCWSTR Filename, DWORD QueryFlags, PDWORD OSMode, PDWORD Enabledlayers, CSimpleArray< CString > &customLayers)
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
LRESULT OnClickNotify(INT uCode, LPNMHDR hdr, BOOL &bHandled)
EXTERN_C BOOL WINAPI GetExeFromLnk(PCWSTR pszLnk, PWSTR pszExe, size_t cchSize)
Definition: ACPPage.cpp:86
LRESULT OnEditModes(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
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 GLint GLint j
Definition: glfuncs.h:250
#define IDC_CHKRUNIN256COLORS
Definition: resource.h:9
BOOL WINAPI SdbGetPermLayerKeys(PCWSTR wszPath, PWSTR pwszLayers, PDWORD pdwBytes, DWORD dwFlags)
Definition: layer.c:364
static BOOL DisableShellext()
HRESULT InitFile(PCWSTR Filename)
GLsizeiptr size
Definition: glext.h:5919
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
void ReleaseBufferSetLength(_In_ int nNewLength)
Definition: atlsimpstr.h:366
#define MAX_PATH
Definition: compat.h:26
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
ULONG AddRef()
#define PSNRET_NOERROR
Definition: prsht.h:129
int ret
BOOL GetEnvironmentVariable(_In_z_ PCXSTR pszVar)
Definition: cstringt.h:525
static const WCHAR L[]
Definition: oid.c:1250
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
#define IDC_COMPATIBILITYMODE
Definition: resource.h:8
const PCWSTR Display
interface IDataObject * LPDATAOBJECT
Definition: objfwd.h:21
void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
Definition: changenotify.c:340
#define PSP_USETITLE
Definition: prsht.h:26
BOOL HasChanges() const
#define BST_UNCHECKED
Definition: winuser.h:199
#define MAX_LAYER_LENGTH
#define wcsicmp
Definition: string.h:1152
#define ComboBox_SetCurSel(hwndCtl, index)
Definition: windowsx.h:41
#define SHCNF_PATHW
Definition: shlobj.h:1755
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
BOOL ShowEditCompatModes(HWND hWnd, CLayerUIPropPage *page)
const PCWSTR Name
#define S_OK
Definition: intsafe.h:59
#define IDC_ENABLED_LAYERS
Definition: resource.h:19
STRSAFEAPI StringCchVPrintfExW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPWSTR *ppszDestEnd, size_t *pcchRemaining, STRSAFE_DWORD dwFlags, STRSAFE_LPCWSTR pszFormat, va_list argList)
Definition: strsafe.h:661
void ACDBG_FN(PCSTR FunctionName, PCWSTR Format,...)
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define GPLK_USER
#define va_start(ap, A)
Definition: acmsvcex.h:91
static struct @297 g_CompatModes[]
unsigned int UINT
Definition: ndis.h:50
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
DWORD * PDWORD
Definition: pedump.c:68
#define ACDBG(fmt,...)
#define BST_CHECKED
Definition: winuser.h:197
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char * FunctionName
Definition: acpixf.h:1270
static const WCHAR * g_AllowedExtensions[]
#define STRSAFE_NULL_ON_FAILURE
Definition: ntstrsafe.h:34
int Display
Definition: x11stubs.h:25
BOOL LoadString(_In_ UINT nID)
Definition: cstringt.h:506
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define IDC_CHKRUNIN640480RES
Definition: resource.h:10
const GUID CLSID_CLayerUIPropPage
const char * PCSTR
Definition: typedefs.h:51
#define SHCNE_UPDATEITEM
Definition: shlobj.h:1733
static PCWSTR wszLayers
Definition: layerapi.c:34
Definition: xml2sdb.h:110
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LONG_PTR LRESULT
Definition: windef.h:209
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
#define REG_DWORD
Definition: sdbapi.c:596
UINT WINAPI DragQueryFileW(HDROP hDrop, UINT lFile, LPWSTR lpszwFile, UINT lLength)
Definition: shellole.c:627
BOOL IsBuiltinLayer(PCWSTR Name)
BYTE * PBYTE
Definition: pedump.c:66
LPARAM lParam
Definition: combotst.c:139
CStringT Left(int nCount) const
Definition: cstringt.h:643
static char title[]
Definition: ps.c:92
CStringT & MakeLower()
Definition: cstringt.h:541
static PCWSTR BOOL bMachine
Definition: layerapi.c:34
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12