Skip to content

Commit

Permalink
[ACPPAGE] Register the extension + allow it to be disabled with polic…
Browse files Browse the repository at this point in the history
…ies. Disable it with the rest of the app compat infrastructure. CORE-10375

svn path=/trunk/; revision=75256
  • Loading branch information
learn-more committed Jul 1, 2017
1 parent b4533fa commit 1fa3c1a
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
3 changes: 3 additions & 0 deletions reactos/boot/bootdata/hivesft.inf
Expand Up @@ -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]
Expand Down
3 changes: 0 additions & 3 deletions reactos/boot/bootdata/hivesys.inf
Expand Up @@ -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
Expand Down
32 changes: 32 additions & 0 deletions reactos/dll/shellext/acppage/CLayerUIPropPage.cpp
Expand Up @@ -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))
{
Expand Down
2 changes: 1 addition & 1 deletion reactos/media/inf/syssetup.inf
Expand Up @@ -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
Expand Down

0 comments on commit 1fa3c1a

Please sign in to comment.