diff --git a/dll/win32/shell32/dialogs/folder_options.cpp b/dll/win32/shell32/dialogs/folder_options.cpp index 865b69e109e..4cf05e40baf 100644 --- a/dll/win32/shell32/dialogs/folder_options.cpp +++ b/dll/win32/shell32/dialogs/folder_options.cpp @@ -136,6 +136,23 @@ ShowFolderOptionsDialogThreadProc(LPVOID param) HPROPSHEETPAGE hpage; UINT num_pages = 0; + // the stub window to hide taskbar button + DWORD style = WS_DISABLED | WS_CLIPSIBLINGS | WS_CAPTION; + DWORD exstyle = WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW; + CMSGlobalFolderOptionsStub stub; + if (!stub.Create(NULL, NULL, NULL, style, exstyle)) + { + ERR("stub.Create failed\n"); + return 0; + } + + if (SHRestricted(REST_NOFOLDEROPTIONS)) + { + SHRestrictedMessageBox(stub); + stub.DestroyWindow(); + return 0; + } + hpage = SH_CreatePropertySheetPage(IDD_FOLDER_OPTIONS_GENERAL, FolderOptionsGeneralDlg, 0, NULL); if (hpage) hppages[num_pages++] = hpage; @@ -148,16 +165,6 @@ ShowFolderOptionsDialogThreadProc(LPVOID param) if (hpage) hppages[num_pages++] = hpage; - // the stub window to hide taskbar button - DWORD style = WS_DISABLED | WS_CLIPSIBLINGS | WS_CAPTION; - DWORD exstyle = WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW; - CMSGlobalFolderOptionsStub stub; - if (!stub.Create(NULL, NULL, NULL, style, exstyle)) - { - ERR("stub.Create failed\n"); - return 0; - } - memset(&pinfo, 0x0, sizeof(PROPSHEETHEADERW)); pinfo.dwSize = sizeof(PROPSHEETHEADERW); pinfo.dwFlags = PSH_NOCONTEXTHELP | PSH_USEICONID | PSH_USECALLBACK; @@ -190,7 +197,7 @@ ShowFolderOptionsDialog(UINT Page, BOOL Async = FALSE) SetForegroundWindow(hPop); return; } - + LPVOID param = UlongToPtr(Page); if (Async) SHCreateThread(ShowFolderOptionsDialogThreadProc, param, 0, 0); diff --git a/dll/win32/shlwapi/lang/da-DK.rc b/dll/win32/shlwapi/lang/da-DK.rc index 68019343bda..f743f0a73d2 100644 --- a/dll/win32/shlwapi/lang/da-DK.rc +++ b/dll/win32/shlwapi/lang/da-DK.rc @@ -33,6 +33,8 @@ STRINGTABLE IDS_TB_FORMAT "%s TB" IDS_PB_FORMAT "%s PB" IDS_EB_FORMAT "%s EB" + IDS_RESTRICTED "This operation has been cancelled due to restrictions on this computer. Please contact your system administrator." + IDS_RESTRICTIONS "Restrictions" #endif } diff --git a/dll/win32/shlwapi/lang/de-DE.rc b/dll/win32/shlwapi/lang/de-DE.rc index e84a4c75452..79392fbdfef 100644 --- a/dll/win32/shlwapi/lang/de-DE.rc +++ b/dll/win32/shlwapi/lang/de-DE.rc @@ -33,6 +33,8 @@ STRINGTABLE IDS_TB_FORMAT "%s TB" IDS_PB_FORMAT "%s PB" IDS_EB_FORMAT "%s EB" + IDS_RESTRICTED "This operation has been cancelled due to restrictions on this computer. Please contact your system administrator." + IDS_RESTRICTIONS "Restrictions" #endif } diff --git a/dll/win32/shlwapi/lang/en-US.rc b/dll/win32/shlwapi/lang/en-US.rc index 3feb41b0bb3..f274217f5c7 100644 --- a/dll/win32/shlwapi/lang/en-US.rc +++ b/dll/win32/shlwapi/lang/en-US.rc @@ -33,6 +33,8 @@ STRINGTABLE IDS_TB_FORMAT "%s TB" IDS_PB_FORMAT "%s PB" IDS_EB_FORMAT "%s EB" + IDS_RESTRICTED "This operation has been cancelled due to restrictions on this computer. Please contact your system administrator." + IDS_RESTRICTIONS "Restrictions" #endif } diff --git a/dll/win32/shlwapi/lang/es-ES.rc b/dll/win32/shlwapi/lang/es-ES.rc index 68d9e93abb0..c13898a86cc 100644 --- a/dll/win32/shlwapi/lang/es-ES.rc +++ b/dll/win32/shlwapi/lang/es-ES.rc @@ -33,6 +33,8 @@ STRINGTABLE IDS_TB_FORMAT "%s TB" IDS_PB_FORMAT "%s PB" IDS_EB_FORMAT "%s EB" + IDS_RESTRICTED "This operation has been cancelled due to restrictions on this computer. Please contact your system administrator." + IDS_RESTRICTIONS "Restrictions" #endif } diff --git a/dll/win32/shlwapi/lang/fi-FI.rc b/dll/win32/shlwapi/lang/fi-FI.rc index 224a6d141c8..3b452a2fa53 100644 --- a/dll/win32/shlwapi/lang/fi-FI.rc +++ b/dll/win32/shlwapi/lang/fi-FI.rc @@ -33,6 +33,8 @@ STRINGTABLE IDS_TB_FORMAT "%s TB" IDS_PB_FORMAT "%s PB" IDS_EB_FORMAT "%s EB" + IDS_RESTRICTED "This operation has been cancelled due to restrictions on this computer. Please contact your system administrator." + IDS_RESTRICTIONS "Restrictions" #endif } diff --git a/dll/win32/shlwapi/lang/fr-FR.rc b/dll/win32/shlwapi/lang/fr-FR.rc index 09b03678373..0cd0a53b13d 100644 --- a/dll/win32/shlwapi/lang/fr-FR.rc +++ b/dll/win32/shlwapi/lang/fr-FR.rc @@ -33,6 +33,8 @@ STRINGTABLE IDS_TB_FORMAT "%s To" IDS_PB_FORMAT "%s Po" IDS_EB_FORMAT "%s Eo" + IDS_RESTRICTED "This operation has been cancelled due to restrictions on this computer. Please contact your system administrator." + IDS_RESTRICTIONS "Restrictions" #endif } diff --git a/dll/win32/shlwapi/lang/he-IL.rc b/dll/win32/shlwapi/lang/he-IL.rc index 256192b2e26..69b6d829fe0 100644 --- a/dll/win32/shlwapi/lang/he-IL.rc +++ b/dll/win32/shlwapi/lang/he-IL.rc @@ -35,6 +35,8 @@ STRINGTABLE IDS_TB_FORMAT "%s TB" IDS_PB_FORMAT "%s PB" IDS_EB_FORMAT "%s EB" + IDS_RESTRICTED "This operation has been cancelled due to restrictions on this computer. Please contact your system administrator." + IDS_RESTRICTIONS "Restrictions" #endif } diff --git a/dll/win32/shlwapi/lang/hu-HU.rc b/dll/win32/shlwapi/lang/hu-HU.rc index ccc262844d0..296576e364f 100644 --- a/dll/win32/shlwapi/lang/hu-HU.rc +++ b/dll/win32/shlwapi/lang/hu-HU.rc @@ -33,6 +33,8 @@ STRINGTABLE IDS_TB_FORMAT "%s TB" IDS_PB_FORMAT "%s PB" IDS_EB_FORMAT "%s EB" + IDS_RESTRICTED "This operation has been cancelled due to restrictions on this computer. Please contact your system administrator." + IDS_RESTRICTIONS "Restrictions" #endif } diff --git a/dll/win32/shlwapi/lang/it-IT.rc b/dll/win32/shlwapi/lang/it-IT.rc index 29c45dd3bba..b1d939e0963 100644 --- a/dll/win32/shlwapi/lang/it-IT.rc +++ b/dll/win32/shlwapi/lang/it-IT.rc @@ -33,6 +33,8 @@ STRINGTABLE IDS_TB_FORMAT "%s TB" IDS_PB_FORMAT "%s PB" IDS_EB_FORMAT "%s EB" + IDS_RESTRICTED "This operation has been cancelled due to restrictions on this computer. Please contact your system administrator." + IDS_RESTRICTIONS "Restrictions" #endif } diff --git a/dll/win32/shlwapi/lang/ja-JP.rc b/dll/win32/shlwapi/lang/ja-JP.rc index 3a770caecba..8e8280c9871 100644 --- a/dll/win32/shlwapi/lang/ja-JP.rc +++ b/dll/win32/shlwapi/lang/ja-JP.rc @@ -33,6 +33,8 @@ STRINGTABLE IDS_TB_FORMAT "%s TB" IDS_PB_FORMAT "%s PB" IDS_EB_FORMAT "%s EB" + IDS_RESTRICTED "This operation has been cancelled due to restrictions on this computer. Please contact your system administrator." + IDS_RESTRICTIONS "Restrictions" #endif } diff --git a/dll/win32/shlwapi/lang/ko-KR.rc b/dll/win32/shlwapi/lang/ko-KR.rc index 0005cf4e7da..e384b74e7a3 100644 --- a/dll/win32/shlwapi/lang/ko-KR.rc +++ b/dll/win32/shlwapi/lang/ko-KR.rc @@ -33,6 +33,8 @@ STRINGTABLE IDS_TB_FORMAT "%s TB" IDS_PB_FORMAT "%s PB" IDS_EB_FORMAT "%s EB" + IDS_RESTRICTED "This operation has been cancelled due to restrictions on this computer. Please contact your system administrator." + IDS_RESTRICTIONS "Restrictions" #endif } diff --git a/dll/win32/shlwapi/lang/lt-LT.rc b/dll/win32/shlwapi/lang/lt-LT.rc index 16502562dcc..20e6f9ab91c 100644 --- a/dll/win32/shlwapi/lang/lt-LT.rc +++ b/dll/win32/shlwapi/lang/lt-LT.rc @@ -33,6 +33,8 @@ STRINGTABLE IDS_TB_FORMAT "%s TB" IDS_PB_FORMAT "%s PB" IDS_EB_FORMAT "%s EB" + IDS_RESTRICTED "This operation has been cancelled due to restrictions on this computer. Please contact your system administrator." + IDS_RESTRICTIONS "Restrictions" #endif } diff --git a/dll/win32/shlwapi/lang/nl-NL.rc b/dll/win32/shlwapi/lang/nl-NL.rc index 0862f166fc0..78a0447b201 100644 --- a/dll/win32/shlwapi/lang/nl-NL.rc +++ b/dll/win32/shlwapi/lang/nl-NL.rc @@ -33,6 +33,8 @@ STRINGTABLE IDS_TB_FORMAT "%s TB" IDS_PB_FORMAT "%s PB" IDS_EB_FORMAT "%s EB" + IDS_RESTRICTED "This operation has been cancelled due to restrictions on this computer. Please contact your system administrator." + IDS_RESTRICTIONS "Restrictions" #endif } diff --git a/dll/win32/shlwapi/lang/no-NO.rc b/dll/win32/shlwapi/lang/no-NO.rc index ba77b987e06..cdd2e446173 100644 --- a/dll/win32/shlwapi/lang/no-NO.rc +++ b/dll/win32/shlwapi/lang/no-NO.rc @@ -33,6 +33,8 @@ STRINGTABLE IDS_TB_FORMAT "%s TB" IDS_PB_FORMAT "%s PB" IDS_EB_FORMAT "%s EB" + IDS_RESTRICTED "This operation has been cancelled due to restrictions on this computer. Please contact your system administrator." + IDS_RESTRICTIONS "Restrictions" #endif } diff --git a/dll/win32/shlwapi/lang/pl-PL.rc b/dll/win32/shlwapi/lang/pl-PL.rc index fd55f1fb785..6085710e0c5 100644 --- a/dll/win32/shlwapi/lang/pl-PL.rc +++ b/dll/win32/shlwapi/lang/pl-PL.rc @@ -34,6 +34,8 @@ STRINGTABLE IDS_TB_FORMAT "%s TB" IDS_PB_FORMAT "%s PB" IDS_EB_FORMAT "%s EB" + IDS_RESTRICTED "This operation has been cancelled due to restrictions on this computer. Please contact your system administrator." + IDS_RESTRICTIONS "Restrictions" #endif } diff --git a/dll/win32/shlwapi/lang/pt-PT.rc b/dll/win32/shlwapi/lang/pt-PT.rc index 3f2028b52de..3c2d2178cbe 100644 --- a/dll/win32/shlwapi/lang/pt-PT.rc +++ b/dll/win32/shlwapi/lang/pt-PT.rc @@ -36,6 +36,8 @@ STRINGTABLE IDS_TB_FORMAT "%s TB" IDS_PB_FORMAT "%s PB" IDS_EB_FORMAT "%s EB" + IDS_RESTRICTED "This operation has been cancelled due to restrictions on this computer. Please contact your system administrator." + IDS_RESTRICTIONS "Restrictions" #endif } diff --git a/dll/win32/shlwapi/lang/ro-RO.rc b/dll/win32/shlwapi/lang/ro-RO.rc index c9b7739414c..cd3ee99fbc6 100644 --- a/dll/win32/shlwapi/lang/ro-RO.rc +++ b/dll/win32/shlwapi/lang/ro-RO.rc @@ -36,6 +36,8 @@ STRINGTABLE IDS_TB_FORMAT "%s TO" IDS_PB_FORMAT "%s PO" IDS_EB_FORMAT "%s EO" + IDS_RESTRICTED "This operation has been cancelled due to restrictions on this computer. Please contact your system administrator." + IDS_RESTRICTIONS "Restrictions" #endif } diff --git a/dll/win32/shlwapi/lang/ru-RU.rc b/dll/win32/shlwapi/lang/ru-RU.rc index 1b1bdd0c699..22ea4348a87 100644 --- a/dll/win32/shlwapi/lang/ru-RU.rc +++ b/dll/win32/shlwapi/lang/ru-RU.rc @@ -33,6 +33,8 @@ STRINGTABLE IDS_TB_FORMAT "%s ТБ" IDS_PB_FORMAT "%s ПБ" IDS_EB_FORMAT "%s ЭБ" + IDS_RESTRICTED "This operation has been cancelled due to restrictions on this computer. Please contact your system administrator." + IDS_RESTRICTIONS "Restrictions" #endif } diff --git a/dll/win32/shlwapi/lang/sk-SK.rc b/dll/win32/shlwapi/lang/sk-SK.rc index 79769302560..9e770303fea 100644 --- a/dll/win32/shlwapi/lang/sk-SK.rc +++ b/dll/win32/shlwapi/lang/sk-SK.rc @@ -34,6 +34,8 @@ STRINGTABLE IDS_TB_FORMAT "%s TB" IDS_PB_FORMAT "%s PB" IDS_EB_FORMAT "%s EB" + IDS_RESTRICTED "This operation has been cancelled due to restrictions on this computer. Please contact your system administrator." + IDS_RESTRICTIONS "Restrictions" #endif } diff --git a/dll/win32/shlwapi/lang/sl-SI.rc b/dll/win32/shlwapi/lang/sl-SI.rc index 0e18cd09a44..16ea6ce9988 100644 --- a/dll/win32/shlwapi/lang/sl-SI.rc +++ b/dll/win32/shlwapi/lang/sl-SI.rc @@ -33,6 +33,8 @@ STRINGTABLE IDS_TB_FORMAT "%s TB" IDS_PB_FORMAT "%s PB" IDS_EB_FORMAT "%s EB" + IDS_RESTRICTED "This operation has been cancelled due to restrictions on this computer. Please contact your system administrator." + IDS_RESTRICTIONS "Restrictions" #endif } diff --git a/dll/win32/shlwapi/lang/sq-AL.rc b/dll/win32/shlwapi/lang/sq-AL.rc index ec7f10e706a..282e09fea75 100644 --- a/dll/win32/shlwapi/lang/sq-AL.rc +++ b/dll/win32/shlwapi/lang/sq-AL.rc @@ -33,6 +33,8 @@ STRINGTABLE IDS_TB_FORMAT "%s TB" IDS_PB_FORMAT "%s PB" IDS_EB_FORMAT "%s EB" + IDS_RESTRICTED "This operation has been cancelled due to restrictions on this computer. Please contact your system administrator." + IDS_RESTRICTIONS "Restrictions" #endif } diff --git a/dll/win32/shlwapi/lang/sv-SE.rc b/dll/win32/shlwapi/lang/sv-SE.rc index 82e5eee9fcb..4764caf3f0a 100644 --- a/dll/win32/shlwapi/lang/sv-SE.rc +++ b/dll/win32/shlwapi/lang/sv-SE.rc @@ -33,6 +33,8 @@ STRINGTABLE IDS_TB_FORMAT "%s TB" IDS_PB_FORMAT "%s PB" IDS_EB_FORMAT "%s EB" + IDS_RESTRICTED "This operation has been cancelled due to restrictions on this computer. Please contact your system administrator." + IDS_RESTRICTIONS "Restrictions" #endif } diff --git a/dll/win32/shlwapi/lang/tr-TR.rc b/dll/win32/shlwapi/lang/tr-TR.rc index 8e0ca35df38..b38a187321b 100644 --- a/dll/win32/shlwapi/lang/tr-TR.rc +++ b/dll/win32/shlwapi/lang/tr-TR.rc @@ -33,6 +33,8 @@ STRINGTABLE IDS_TB_FORMAT "%s TB" IDS_PB_FORMAT "%s PB" IDS_EB_FORMAT "%s EB" + IDS_RESTRICTED "This operation has been cancelled due to restrictions on this computer. Please contact your system administrator." + IDS_RESTRICTIONS "Restrictions" #endif } diff --git a/dll/win32/shlwapi/lang/uk-UA.rc b/dll/win32/shlwapi/lang/uk-UA.rc index 8cb3404c441..9f50d3371c2 100644 --- a/dll/win32/shlwapi/lang/uk-UA.rc +++ b/dll/win32/shlwapi/lang/uk-UA.rc @@ -33,6 +33,8 @@ STRINGTABLE IDS_TB_FORMAT "%s TB" IDS_PB_FORMAT "%s PB" IDS_EB_FORMAT "%s EB" + IDS_RESTRICTED "This operation has been cancelled due to restrictions on this computer. Please contact your system administrator." + IDS_RESTRICTIONS "Restrictions" #endif } diff --git a/dll/win32/shlwapi/lang/zh-CN.rc b/dll/win32/shlwapi/lang/zh-CN.rc index cca4fc59454..cc59ca32f46 100644 --- a/dll/win32/shlwapi/lang/zh-CN.rc +++ b/dll/win32/shlwapi/lang/zh-CN.rc @@ -33,6 +33,8 @@ STRINGTABLE IDS_TB_FORMAT "%s TB" IDS_PB_FORMAT "%s PB" IDS_EB_FORMAT "%s EB" + IDS_RESTRICTED "This operation has been cancelled due to restrictions on this computer. Please contact your system administrator." + IDS_RESTRICTIONS "Restrictions" #endif } diff --git a/dll/win32/shlwapi/lang/zh-TW.rc b/dll/win32/shlwapi/lang/zh-TW.rc index 1a774b18e82..fc56b20d75e 100644 --- a/dll/win32/shlwapi/lang/zh-TW.rc +++ b/dll/win32/shlwapi/lang/zh-TW.rc @@ -36,6 +36,8 @@ STRINGTABLE IDS_TB_FORMAT "%s TB" IDS_PB_FORMAT "%s PB" IDS_EB_FORMAT "%s EB" + IDS_RESTRICTED "This operation has been cancelled due to restrictions on this computer. Please contact your system administrator." + IDS_RESTRICTIONS "Restrictions" #endif } diff --git a/dll/win32/shlwapi/precomp.h b/dll/win32/shlwapi/precomp.h index 6a1028080d1..ca91603e27c 100644 --- a/dll/win32/shlwapi/precomp.h +++ b/dll/win32/shlwapi/precomp.h @@ -29,6 +29,7 @@ #ifdef __REACTOS__ EXTERN_C HRESULT VariantChangeTypeForRead(_Inout_ VARIANTARG *pvarg, _In_ VARTYPE vt); +EXTERN_C DECLSPEC_HIDDEN HINSTANCE shlwapi_hInstance; EXTERN_C ULONG WINAPI GetProcessOsVersion(void); #endif diff --git a/dll/win32/shlwapi/resource.h b/dll/win32/shlwapi/resource.h index ac10c5a5c9f..ae3705c2cf7 100644 --- a/dll/win32/shlwapi/resource.h +++ b/dll/win32/shlwapi/resource.h @@ -34,6 +34,8 @@ #define IDS_TB_FORMAT 71 #define IDS_PB_FORMAT 72 #define IDS_EB_FORMAT 73 +#define IDS_RESTRICTED 283 +#define IDS_RESTRICTIONS 284 #endif /* These numbers match native IDs and shouldn't be arbitrarily changed */ diff --git a/dll/win32/shlwapi/shlwapi.spec b/dll/win32/shlwapi/shlwapi.spec index b905fe79d2d..0c802433574 100644 --- a/dll/win32/shlwapi/shlwapi.spec +++ b/dll/win32/shlwapi/shlwapi.spec @@ -381,7 +381,7 @@ 381 stub -noname AssocCopyVerbs 382 stdcall -noname ZoneComputePaneSize(ptr) 383 stub -noname ZoneConfigureW -384 stub -noname SHRestrictedMessageBox +384 stdcall -noname SHRestrictedMessageBox(ptr) 385 stub -noname SHLoadRawAccelerators 386 stub -noname SHQueryRawAccelerator 387 stub -noname SHQueryRawAcceleratorMsg diff --git a/dll/win32/shlwapi/utils.cpp b/dll/win32/shlwapi/utils.cpp index 1a83f0b8e9a..a9a828e561d 100644 --- a/dll/win32/shlwapi/utils.cpp +++ b/dll/win32/shlwapi/utils.cpp @@ -22,6 +22,7 @@ #include #include #include +#include "resource.h" #include #include @@ -1241,6 +1242,18 @@ BOOL WINAPI SHGetFileDescriptionA( return ret; } +/************************************************************************* + * SHRestrictedMessageBox [SHLWAPI.384] + * + * @see https://www.geoffchappell.com/studies/windows/shell/shlwapi/api/util/restrictions/messagebox.htm + * @see ShellMessageBoxW + */ +EXTERN_C INT WINAPI SHRestrictedMessageBox(_In_ HWND hWnd) +{ + return ShellMessageBoxW(shlwapi_hInstance, hWnd, MAKEINTRESOURCEW(IDS_RESTRICTED), + MAKEINTRESOURCEW(IDS_RESTRICTIONS), MB_ICONERROR); +} + EXTERN_C ULONG WINAPI GetProcessOsVersion(void) { PPEB Peb = NtCurrentTeb()->Peb; diff --git a/sdk/include/reactos/shlwapi_undoc.h b/sdk/include/reactos/shlwapi_undoc.h index 0397dcde92c..02c49bd578b 100644 --- a/sdk/include/reactos/shlwapi_undoc.h +++ b/sdk/include/reactos/shlwapi_undoc.h @@ -58,6 +58,8 @@ SHRestrictionLookup( _In_ const POLICYDATA *polTable, _Inout_ LPDWORD polArr); +INT WINAPI SHRestrictedMessageBox(_In_ HWND hWnd); + BOOL WINAPI SHAboutInfoA(LPSTR lpszDest, DWORD dwDestLen); BOOL WINAPI SHAboutInfoW(LPWSTR lpszDest, DWORD dwDestLen);