From: Mark Jansen Date: Sat, 1 Jul 2017 11:37:44 +0000 (+0000) Subject: [ACPPAGE] Register the extension + allow it to be disabled with policies. Disable... X-Git-Tag: ReactOS-0.4.6~139 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=1fa3c1a922e132061dda703b00cca986d8695271;hp=b4533fa94a1e3f16ac3118bc0e32ee3fa746baad [ACPPAGE] Register the extension + allow it to be disabled with policies. Disable it with the rest of the app compat infrastructure. CORE-10375 svn path=/trunk/; revision=75256 --- diff --git a/reactos/boot/bootdata/hivesft.inf b/reactos/boot/bootdata/hivesft.inf index c5663af6f4d..696be214024 100644 --- a/reactos/boot/bootdata/hivesft.inf +++ b/reactos/boot/bootdata/hivesft.inf @@ -1686,6 +1686,9 @@ HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows","swapdisk",0x0000000 HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows","TransmissionRetryTimeout",0x00000000,"90" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows","USERProcessHandleQuota",0x00010001,0x2710 +; App Compat -- Disable on ReactOS +HKLM,"SOFTWARE\Policies\Microsoft\Windows\AppCompat","DisableEngine",0x00010003, 0x00000001 + ;-------------------------------- STRINGS ------------------------------- [Strings] diff --git a/reactos/boot/bootdata/hivesys.inf b/reactos/boot/bootdata/hivesys.inf index fff64105fa9..ca7c7f7a59f 100644 --- a/reactos/boot/bootdata/hivesys.inf +++ b/reactos/boot/bootdata/hivesys.inf @@ -1454,9 +1454,6 @@ HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\SubSystems","Posix",0x000 HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\SubSystems","Required",0x00010000,"Debug","Windows" HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\SubSystems","Windows",0x00020000,"%SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows SharedSection=1024,12288,512 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll=winsrv:ConServerDllInitialization,2 ProfileControl=Off MaxRequestThreads=16" -; App Compat -- Disable on ReactOS -HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\AppCompatibility","DisableAppCompat",0x00010003, 0x00000001 - ; This is an empty App Compat cache HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\AppCompatCache","AppCompatCache", 0x00000001, \ fe,0f,dc,ba,00,00,00,00 diff --git a/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp b/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp index 36c67e3498f..764e9af8d45 100644 --- a/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp +++ b/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp @@ -561,11 +561,43 @@ INT_PTR CALLBACK CLayerUIPropPage::EditModesProc(HWND hWnd, UINT uMsg, WPARAM wP return FALSE; } +static BOOL DisableShellext() +{ + HKEY hkey; + LSTATUS ret = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Policies\\Microsoft\\Windows\\AppCompat", 0, KEY_QUERY_VALUE, &hkey); + BOOL Disable = FALSE; + if (ret == ERROR_SUCCESS) + { + DWORD dwValue = 0; + DWORD type, size = sizeof(dwValue); + ret = RegQueryValueExW(hkey, L"DisableEngine", NULL, &type, (PBYTE)&dwValue, &size); + if (ret == ERROR_SUCCESS && type == REG_DWORD) + { + Disable = !!dwValue; + } + if (!Disable) + { + size = sizeof(dwValue); + ret = RegQueryValueExW(hkey, L"DisablePropPage", NULL, &type, (PBYTE)&dwValue, &size); + if (ret == ERROR_SUCCESS && type == REG_DWORD) + { + Disable = !!dwValue; + } + } + + RegCloseKey(hkey); + } + return Disable; +} STDMETHODIMP CLayerUIPropPage::Initialize(LPCITEMIDLIST pidlFolder, LPDATAOBJECT pDataObj, HKEY hkeyProgID) { FORMATETC etc = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; STGMEDIUM stg; + + if (DisableShellext()) + return E_ACCESSDENIED; + HRESULT hr = pDataObj->GetData(&etc, &stg); if (FAILED(hr)) { diff --git a/reactos/media/inf/syssetup.inf b/reactos/media/inf/syssetup.inf index bb435cde2e2..a9e98b5bc54 100644 --- a/reactos/media/inf/syssetup.inf +++ b/reactos/media/inf/syssetup.inf @@ -35,7 +35,7 @@ AddReg=Classes [OleControlDlls] 11,,atl.dll,1 11,,actxprxy.dll,1 -;11,,acppage.dll,1 +11,,acppage.dll,1 11,,amstream.dll,1 11,,avifil32.dll,1 11,,browseui.dll,1