18const GUID CLSID_CLayerUIPropPage = { 0x513D916F, 0x2A8E, 0x4F51, { 0xAE, 0xAB, 0x0C, 0xBC, 0x76, 0xFB, 0x1A, 0xF8 } };
22#define MAX_LAYER_LENGTH 256
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 (SP3)",
L"WINXPSP3" },
33 {
L"Windows Server 2003 (SP1)",
L"WINSRV03SP1" },
34 {
L"Windows Server 2008 (SP1)",
L"WINSRV08SP1" },
35 {
L"Windows Vista (SP2)",
L"VISTASP2" },
36 {
L"Windows 7",
L"WIN7RTM" },
37 {
L"Windows 7 (SP1)",
L"WIN7SP1" },
38 {
L"Windows 8.1",
L"WIN81RTM" },
39 {
L"Windows 10",
L"WIN10RTM" },
40 {
L"Windows Server 2016",
L"WINSRV16RTM" },
41 {
L"Windows Server 2019",
L"WINSRV19RTM" },
53 {
L"DISABLEDWM", IDC_??,
TRUE },
54 {
L"HIGHDPIAWARE", IDC_??,
TRUE },
55 {
L"RUNASADMIN", IDC_??,
TRUE },
106#define ACDBG(fmt, ...) ACDBG_FN(__FUNCTION__, fmt, ##__VA_ARGS__ )
111: m_IsSfcProtected(
FALSE)
112, m_AllowPermLayer(
FALSE)
116, m_RegistryEnabledLayers(0)
121 m_psp.pszTitle =
title.Detach();
139 if (dwRequired == dwReturned)
159 ACDBG(
L"Failed to find an extension: '%s'\r\n", (
PCWSTR)ExpandedFilename);
167 ACDBG(
L"Failed to read link target from: '%s'\r\n", (
PCWSTR)ExpandedFilename);
172 ACDBG(
L"Link redirects to itself: '%s'\r\n", (
PCWSTR)ExpandedFilename);
181 tmp +=
L"\\System32";
185 ACDBG(
L"Ignoring System32: %s\r\n", (
PCWSTR)ExpandedFilename);
193 ACDBG(
L"Ignoring WinSxs: %s\r\n", (
PCWSTR)ExpandedFilename);
209 ACDBG(
L"Extension not included: '%s'\r\n", pwszExt);
218 *OSMode = *Enabledlayers = 0;
219 customLayers.RemoveAll();
230 *Enabledlayers |= (1<<
n);
251 customLayers.Add(
Layer);
279 if (lhs.GetSize() != rhs.GetSize())
282 for (
int n = 0;
n < lhs.GetSize(); ++
n)
284 if (lhs[
n] != rhs[
n])
348 ACDBG(
L"AllowPermLayer returned FALSE\r\n");
354 ACDBG(
L"Protected OS file\r\n");
392 customLayers +=
L", ";
436 size =
sizeof(dwValue);
451 FORMATETC etc = {
CF_HDROP,
NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
457 HRESULT hr = pDataObj->GetData(&etc, &stg);
460 ACDBG(
L"Failed to retrieve Data from pDataObj.\r\n");
478 ACDBG(
L"Failed to query the file.\r\n");
483 ACDBG(
L"Invalid number of files: %d\r\n", uNumFiles);
489 ACDBG(
L"Could not lock stg.hGlobal\r\n");
EXTERN_C BOOL WINAPI GetExeFromLnk(PCWSTR pszLnk, PWSTR pszExe, size_t cchSize)
BOOL ShowEditCompatModes(HWND hWnd, CLayerUIPropPage *page)
static const WCHAR * g_AllowedExtensions[]
static BOOL GetLayerInfo(PCWSTR Filename, DWORD QueryFlags, PDWORD OSMode, PDWORD Enabledlayers, CSimpleArray< CString > &customLayers)
static BOOL DisableShellext()
static struct @302 g_Layers[]
static BOOL ArrayEquals(const CSimpleArray< CString > &lhs, const CSimpleArray< CString > &rhs)
static struct @301 g_CompatModes[]
void ACDBG_FN(PCSTR FunctionName, PCWSTR Format,...)
BOOL IsBuiltinLayer(PCWSTR Name)
const GUID CLSID_CLayerUIPropPage
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
BOOL WINAPI SetPermLayerState(PCWSTR wszPath, PCWSTR wszLayer, DWORD dwFlags, BOOL bMachine, BOOL bEnable)
BOOL WINAPI AllowPermLayer(PCWSTR path)
BOOL WINAPI SdbGetPermLayerKeys(PCWSTR wszPath, PWSTR pwszLayers, PDWORD pdwBytes, DWORD dwFlags)
#define RegCloseKey(hKey)
EXTERN_C void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
void ReleaseBufferSetLength(_In_ int nNewLength)
int GetLength() const noexcept
BOOL GetEnvironmentVariable(_In_z_ PCXSTR pszVar)
BOOL LoadString(_In_ UINT nID)
CStringT Left(int nCount) const
CSimpleArray< CString > m_CustomLayers
LRESULT OnEditModes(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
LRESULT OnCtrlCommand(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
HRESULT InitFile(PCWSTR Filename)
STDMETHODIMP Initialize(PCIDLIST_ABSOLUTE pidlFolder, LPDATAOBJECT pdtobj, HKEY hkeyProgID)
LRESULT OnClickNotify(INT uCode, LPNMHDR hdr, BOOL &bHandled)
DWORD m_RegistryEnabledLayers
CSimpleArray< CString > m_RegistryCustomLayers
INT_PTR DisableControls()
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
#define IDC_COMPATIBILITYMODE
#define IDC_CHKRUNIN256COLORS
#define IDC_CHKRUNIN640480RES
#define IDC_EDITCOMPATIBILITYMODES
#define IDC_ENABLED_LAYERS
#define IDS_FAILED_PROTECTED
#define IDC_CHKDISABLEVISUALTHEMES
#define IDS_FAILED_NETWORK
#define IDC_CHKRUNCOMPATIBILITY
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
UINT WINAPI DragQueryFileW(HDROP hDrop, UINT lFile, LPWSTR lpszwFile, UINT lLength)
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
IN PVCB IN PBCB OUT PDIRENT IN USHORT IN POEM_STRING Filename
GLuint GLuint GLsizei GLenum type
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
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
static PCWSTR BOOL bMachine
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define STRSAFE_NULL_ON_FAILURE
interface IDataObject * LPDATAOBJECT
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_CRT_RESTORE_GCC_WARNINGS _Check_return_ _CRTIMP wchar_t *__cdecl wcstok(_Inout_opt_z_ wchar_t *_Str, _In_z_ const wchar_t *_Delim)
BOOL WINAPI SfcIsFileProtected(HANDLE RpcHandle, LPCWSTR ProtFileName)
STRSAFEAPI StringCchVPrintfExW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPWSTR *ppszDestEnd, size_t *pcchRemaining, STRSAFE_DWORD dwFlags, STRSAFE_LPCWSTR pszFormat, va_list argList)
STRSAFEAPI StringCchPrintfExW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPWSTR *ppszDestEnd, size_t *pcchRemaining, STRSAFE_DWORD dwFlags, STRSAFE_LPCWSTR pszFormat,...)
#define ComboBox_SetCurSel(hwndCtl, index)
#define ComboBox_GetCurSel(hwndCtl)
#define ComboBox_AddString(hwndCtl, lpsz)
#define HKEY_LOCAL_MACHINE
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)