[ACPPAGE] Register the extension + allow it to be disabled with policies. Disable...
authorMark Jansen <mark.jansen@reactos.org>
Sat, 1 Jul 2017 11:37:44 +0000 (11:37 +0000)
committerMark Jansen <mark.jansen@reactos.org>
Sat, 1 Jul 2017 11:37:44 +0000 (11:37 +0000)
svn path=/trunk/; revision=75256

reactos/boot/bootdata/hivesft.inf
reactos/boot/bootdata/hivesys.inf
reactos/dll/shellext/acppage/CLayerUIPropPage.cpp
reactos/media/inf/syssetup.inf

index c5663af..696be21 100644 (file)
@@ -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]
index fff6410..ca7c7f7 100644 (file)
@@ -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
index 36c67e3..764e9af 100644 (file)
@@ -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))
     {
index bb435cd..a9e98b5 100644 (file)
@@ -35,7 +35,7 @@ AddReg=Classes
 [OleControlDlls]\r
 11,,atl.dll,1\r
 11,,actxprxy.dll,1\r
-;11,,acppage.dll,1\r
+11,,acppage.dll,1\r
 11,,amstream.dll,1\r
 11,,avifil32.dll,1\r
 11,,browseui.dll,1\r