ReactOS 0.4.16-dev-109-gf4cb10f
CLayerUIPropPage.cpp File Reference
#include "precomp.h"
#include <shlwapi.h>
#include <shellapi.h>
#include <shellutils.h>
#include <strsafe.h>
#include <apphelp.h>
#include <windowsx.h>
#include <sfc.h>
Include dependency graph for CLayerUIPropPage.cpp:

Go to the source code of this file.

Macros

#define GPLK_USER   1
 
#define GPLK_MACHINE   2
 
#define MAX_LAYER_LENGTH   256
 
#define ACDBG(fmt, ...)   ACDBG_FN(__FUNCTION__, fmt, ##__VA_ARGS__ )
 

Functions

BOOL IsBuiltinLayer (PCWSTR Name)
 
void ACDBG_FN (PCSTR FunctionName, PCWSTR Format,...)
 
static BOOL GetLayerInfo (PCWSTR Filename, DWORD QueryFlags, PDWORD OSMode, PDWORD Enabledlayers, CSimpleArray< CString > &customLayers)
 
static BOOL ArrayEquals (const CSimpleArray< CString > &lhs, const CSimpleArray< CString > &rhs)
 
static BOOL DisableShellext ()
 

Variables

const GUID CLSID_CLayerUIPropPage = { 0x513D916F, 0x2A8E, 0x4F51, { 0xAE, 0xAB, 0x0C, 0xBC, 0x76, 0xFB, 0x1A, 0xF8 } }
 
struct {
   const PCWSTR   Display
 
   const PCWSTR   Name
 
g_CompatModes []
 
struct {
   const PCWSTR   Name
 
   DWORD   Id
 
g_Layers []
 
static const WCHARg_AllowedExtensions []
 

Macro Definition Documentation

◆ ACDBG

#define ACDBG (   fmt,
  ... 
)    ACDBG_FN(__FUNCTION__, fmt, ##__VA_ARGS__ )

Definition at line 106 of file CLayerUIPropPage.cpp.

◆ GPLK_MACHINE

#define GPLK_MACHINE   2

Definition at line 21 of file CLayerUIPropPage.cpp.

◆ GPLK_USER

#define GPLK_USER   1

Definition at line 20 of file CLayerUIPropPage.cpp.

◆ MAX_LAYER_LENGTH

#define MAX_LAYER_LENGTH   256

Definition at line 22 of file CLayerUIPropPage.cpp.

Function Documentation

◆ ACDBG_FN()

void ACDBG_FN ( PCSTR  FunctionName,
PCWSTR  Format,
  ... 
)

Definition at line 92 of file CLayerUIPropPage.cpp.

93{
94 WCHAR Buffer[512];
95 WCHAR* Current = Buffer;
96 size_t Length = _countof(Buffer);
97
98 StringCchPrintfExW(Current, Length, &Current, &Length, STRSAFE_NULL_ON_FAILURE, L"[%-20S] ", FunctionName);
99 va_list ArgList;
100 va_start(ArgList, Format);
101 StringCchVPrintfExW(Current, Length, &Current, &Length, STRSAFE_NULL_ON_FAILURE, Format, ArgList);
102 va_end(ArgList);
104}
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
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:1279
Definition: bufpool.h:45
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define STRSAFE_NULL_ON_FAILURE
Definition: ntstrsafe.h:34
#define L(x)
Definition: ntvdm.h:50
#define _countof(array)
Definition: sndvol32.h:70
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
STRSAFEAPI StringCchPrintfExW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPWSTR *ppszDestEnd, size_t *pcchRemaining, STRSAFE_DWORD dwFlags, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:585
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ ArrayEquals()

static BOOL ArrayEquals ( const CSimpleArray< CString > &  lhs,
const CSimpleArray< CString > &  rhs 
)
static

Definition at line 277 of file CLayerUIPropPage.cpp.

278{
279 if (lhs.GetSize() != rhs.GetSize())
280 return FALSE;
281
282 for (int n = 0; n < lhs.GetSize(); ++n)
283 {
284 if (lhs[n] != rhs[n])
285 return FALSE;
286 }
287 return TRUE;
288}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
GLdouble n
Definition: glext.h:7729

Referenced by CLayerUIPropPage::HasChanges().

◆ DisableShellext()

static BOOL DisableShellext ( )
static

Definition at line 420 of file CLayerUIPropPage.cpp.

421{
422 HKEY hkey;
423 LSTATUS ret = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Policies\\Microsoft\\Windows\\AppCompat", 0, KEY_QUERY_VALUE, &hkey);
424 BOOL Disable = FALSE;
425 if (ret == ERROR_SUCCESS)
426 {
427 DWORD dwValue = 0;
428 DWORD type, size = sizeof(dwValue);
429 ret = RegQueryValueExW(hkey, L"DisableEngine", NULL, &type, (PBYTE)&dwValue, &size);
430 if (ret == ERROR_SUCCESS && type == REG_DWORD)
431 {
432 Disable = !!dwValue;
433 }
434 if (!Disable)
435 {
436 size = sizeof(dwValue);
437 ret = RegQueryValueExW(hkey, L"DisablePropPage", NULL, &type, (PBYTE)&dwValue, &size);
438 if (ret == ERROR_SUCCESS && type == REG_DWORD)
439 {
440 Disable = !!dwValue;
441 }
442 }
443
444 RegCloseKey(hkey);
445 }
446 return Disable;
447}
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
#define NULL
Definition: types.h:112
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
BYTE * PBYTE
Definition: pedump.c:66
#define REG_DWORD
Definition: sdbapi.c:596
int ret
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by CLayerUIPropPage::Initialize().

◆ GetLayerInfo()

static BOOL GetLayerInfo ( PCWSTR  Filename,
DWORD  QueryFlags,
PDWORD  OSMode,
PDWORD  Enabledlayers,
CSimpleArray< CString > &  customLayers 
)
static

Definition at line 213 of file CLayerUIPropPage.cpp.

214{
216 DWORD dwBytes = sizeof(wszLayers);
217
218 *OSMode = *Enabledlayers = 0;
219 customLayers.RemoveAll();
220 if (!SdbGetPermLayerKeys(Filename, wszLayers, &dwBytes, QueryFlags))
221 return FALSE;
222
223 for (PWCHAR Layer = wcstok(wszLayers, L" "); Layer; Layer = wcstok(NULL, L" "))
224 {
225 size_t n;
226 for (n = 0; g_Layers[n].Name; ++n)
227 {
228 if (!wcsicmp(g_Layers[n].Name, Layer))
229 {
230 *Enabledlayers |= (1<<n);
231 break;
232 }
233 }
234 /* Did we find it? */
235 if (g_Layers[n].Name)
236 continue;
237
238 for (n = 0; g_CompatModes[n].Name; ++n)
239 {
241 {
242 *OSMode = n+1;
243 break;
244 }
245 }
246 /* Did we find it? */
247 if (g_CompatModes[n].Name)
248 continue;
249
250 /* Must be a 'custom' layer */
251 customLayers.Add(Layer);
252 }
253 return TRUE;
254}
static struct @302 g_Layers[]
static struct @301 g_CompatModes[]
#define MAX_LAYER_LENGTH
BOOL WINAPI SdbGetPermLayerKeys(PCWSTR wszPath, PWSTR pwszLayers, PDWORD pdwBytes, DWORD dwFlags)
Definition: layer.c:364
#define wcsicmp
Definition: compat.h:15
IN PVCB IN PBCB OUT PDIRENT IN USHORT IN POEM_STRING Filename
Definition: fatprocs.h:940
static PCWSTR wszLayers
Definition: layerapi.c:34
_Check_return_ _CRTIMP wchar_t *__cdecl wcstok(_Inout_opt_z_ wchar_t *_Str, _In_z_ const wchar_t *_Delim)
Definition: xml2sdb.h:111
uint16_t * PWCHAR
Definition: typedefs.h:56

Referenced by CLayerUIPropPage::OnSetActive().

◆ IsBuiltinLayer()

BOOL IsBuiltinLayer ( PCWSTR  Name)

Definition at line 69 of file CLayerUIPropPage.cpp.

70{
71 size_t n;
72
73 for (n = 0; g_Layers[n].Name; ++n)
74 {
75 if (!wcsicmp(g_Layers[n].Name, Name))
76 {
77 return TRUE;
78 }
79 }
80
81 for (n = 0; g_CompatModes[n].Name; ++n)
82 {
84 {
85 return TRUE;
86 }
87 }
88 return FALSE;
89}

Referenced by CLayerStringList::Next().

Variable Documentation

◆ CLSID_CLayerUIPropPage

const GUID CLSID_CLayerUIPropPage = { 0x513D916F, 0x2A8E, 0x4F51, { 0xAE, 0xAB, 0x0C, 0xBC, 0x76, 0xFB, 0x1A, 0xF8 } }

Definition at line 18 of file CLayerUIPropPage.cpp.

◆ Display

Definition at line 25 of file CLayerUIPropPage.cpp.

◆ g_AllowedExtensions

const WCHAR* g_AllowedExtensions[]
static
Initial value:
= {
L".exe",
L".msi",
L".pif",
L".bat",
L".cmd",
0
}

Definition at line 60 of file CLayerUIPropPage.cpp.

Referenced by CLayerUIPropPage::InitFile().

◆ 

struct { ... } g_CompatModes[]
Initial value:
= {
{ L"Windows 95", L"WIN95" },
{ L"Windows 98/ME", L"WIN98" },
{ L"Windows NT 4.0 (SP5)", L"NT4SP5" },
{ L"Windows 2000", L"WIN2000" },
{ L"Windows XP (SP3)", L"WINXPSP3" },
{ L"Windows Server 2003 (SP1)", L"WINSRV03SP1" },
{ L"Windows Server 2008 (SP1)", L"WINSRV08SP1" },
{ L"Windows Vista (SP2)", L"VISTASP2" },
{ L"Windows 7", L"WIN7RTM" },
{ L"Windows 7 (SP1)", L"WIN7SP1" },
{ L"Windows 8.1", L"WIN81RTM" },
{ L"Windows 10", L"WIN10RTM" },
{ L"Windows Server 2016", L"WINSRV16RTM" },
{ L"Windows Server 2019", L"WINSRV19RTM" },
{ NULL, NULL }
}

Referenced by GetLayerInfo(), IsBuiltinLayer(), CLayerUIPropPage::OnApply(), and CLayerUIPropPage::OnInitDialog().

◆ 

struct { ... } g_Layers[]
Initial value:
= {
{ L"256COLOR", IDC_CHKRUNIN256COLORS },
{ L"640X480", IDC_CHKRUNIN640480RES },
{ L"DISABLETHEMES", IDC_CHKDISABLEVISUALTHEMES },
{ NULL, 0 }
}
#define IDC_CHKRUNIN256COLORS
Definition: resource.h:9
#define IDC_CHKRUNIN640480RES
Definition: resource.h:10
#define IDC_CHKDISABLEVISUALTHEMES
Definition: resource.h:11

Referenced by CLayerUIPropPage::DisableControls(), GetLayerInfo(), IsBuiltinLayer(), CLayerUIPropPage::OnApply(), CLayerUIPropPage::OnSetActive(), and CLayerUIPropPage::UpdateControls().

◆ Id

DWORD Id

Definition at line 47 of file CLayerUIPropPage.cpp.

Referenced by AcpiUtIsPciRootBridge(), AppendMenuItem(), AsyncReader_FindPin(), AudioRecord_FindPin(), AVICompressor_FindPin(), AviMux_FindPin(), AviMuxIn_QueryId(), AviMuxOut_QueryId(), BasePinImpl_QueryId(), BaseRendererImpl_FindPin(), BlHtCreate(), BlockIoFirmwareOpen(), BlpIoRegisterDestroyRoutine(), BlResourceFindMessage(), CabinetSelectCodec(), CheckUnattendedSetup(), COMDLG32_FR_HandleWMCommand(), CreateLanguageList(), DECLSPEC_UUID(), CLayerUIPropPage::DisableControls(), CardWindow::DistributeStacks(), DosGetFileDescriptor(), EnableFileMenuItemByID(), EnumResourceLanguagesA(), EnumResourceLanguagesW(), EnumResourceNamesA(), EnumResourceNamesW(), EnumResourceTypesA(), EnumResourceTypesW(), EventDescCreate(), EventDescSetId(), FillDeviceComboBox(), find_entry_by_id(), CKsProxy::FindPin(), GetCommandString(), GetCommandStringA(), GetDevNum(), GetDiskBySCSI(), GetMenuItemDataById(), HalpQueryIdFdo(), HalpQueryIdPdo(), HandleFile(), IdentifyDevice(), InfpFindLineById(), InfpFindSectionById(), InitializeIdEntry(), IopValidateID(), KdRosSetDebugCallback(), KiSystemService(), KiSystemServiceHandler(), LoadSetupData(), LsapAddAuthPackage(), MENU_ButtonUp(), MENU_DoNextMenu(), NtfsMoonWalkID(), CLayerUIPropPage::OnSetActive(), Parser_FindPin(), PrepareCopyInfFile(), PrintDeviceData(), QueryDeviceInformation(), CInputPin::QueryId(), COutputPin::QueryId(), CPin::QueryId(), ResFindDirectoryEntry(), FxChildList::SearchBackwardsForMatchingDescriptionLocked(), FxChildList::SearchBackwardsForMatchingModificationLocked(), CCabinet::SelectCodec(), SetPaletteEntryRGB(), SetupStartPage(), SmartTeeFilter_FindPin(), TdiQueryInformationEx(), test_AT_ARP_STATS(), test_IF_MIB_STATS(), test_IP_MIB_STATS(), TOOLBAR_ChangeBitmap(), TOOLBAR_CheckButton(), TOOLBAR_CommandToIndex(), TOOLBAR_EnableButton(), TOOLBAR_GetBitmap(), TOOLBAR_GetButtonInfoT(), TOOLBAR_GetButtonText(), TOOLBAR_GetRect(), TOOLBAR_GetState(), TOOLBAR_HideButton(), TOOLBAR_Indeterminate(), TOOLBAR_IsButtonChecked(), TOOLBAR_IsButtonEnabled(), TOOLBAR_IsButtonHidden(), TOOLBAR_IsButtonHighlighted(), TOOLBAR_IsButtonIndeterminate(), TOOLBAR_IsButtonPressed(), TOOLBAR_MarkButton(), TOOLBAR_MoveButton(), TOOLBAR_PressButton(), TOOLBAR_SetButtonInfo(), TOOLBAR_SetState(), TransformFilterImpl_FindPin(), FxMessageDispatch::TransportQueryID(), FxDevice::TransportQueryId(), UDFCommonCreate(), UDFFindFileId(), UDFGetOpenParamsByFileId(), UDFRemoveFileId(), UDFStoreFileId(), CLayerUIPropPage::UpdateControls(), UpdateKBLayout(), UpdatePriority(), UpdateRegistry(), USBH_PdoQueryId(), USBHUB_DumpingIDs(), USBPORT_GetDeviceHwIds(), USBPORT_PdoPnP(), and VfwCapture_FindPin().

◆ Name

Definition at line 26 of file CLayerUIPropPage.cpp.