1999-10-23 16:46:15 +02:00
|
|
|
/*
|
|
|
|
* shpolicy.c - Data for shell/system policies.
|
|
|
|
*
|
2002-03-10 00:29:33 +01:00
|
|
|
* Copyright 1999 Ian Schmidt <ischmidt@cfl.rr.com>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* NOTES:
|
1999-10-23 16:46:15 +02:00
|
|
|
*
|
|
|
|
* Some of these policies can be tweaked via the System Policy
|
|
|
|
* Editor which came with the Win95 Migration Guide, although
|
|
|
|
* there doesn't appear to be an updated Win98 version that
|
|
|
|
* would handle the many new policies introduced since then.
|
2002-06-01 01:06:46 +02:00
|
|
|
* You could easily write one with the information in
|
1999-10-23 16:46:15 +02:00
|
|
|
* this file...
|
2002-06-01 01:06:46 +02:00
|
|
|
*
|
2003-03-21 22:26:25 +01:00
|
|
|
* Up to date as of SHELL32 v5.00 (W2K)
|
1999-10-23 16:46:15 +02:00
|
|
|
*/
|
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
1999-10-23 16:46:15 +02:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2000-02-10 20:03:02 +01:00
|
|
|
#include "windef.h"
|
2003-09-06 01:08:26 +02:00
|
|
|
#include "winbase.h"
|
2000-04-28 22:21:49 +02:00
|
|
|
#include "winerror.h"
|
|
|
|
#include "winreg.h"
|
2001-07-20 20:00:00 +02:00
|
|
|
|
2003-03-21 22:26:25 +01:00
|
|
|
#include "shell32_main.h"
|
2003-10-02 06:30:46 +02:00
|
|
|
#include "shlobj.h"
|
2000-04-28 22:21:49 +02:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
2001-07-20 20:00:00 +02:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
2000-04-28 22:21:49 +02:00
|
|
|
|
|
|
|
#define SHELL_NO_POLICY 0xffffffff
|
|
|
|
|
|
|
|
typedef struct tagPOLICYDAT
|
|
|
|
{
|
2003-03-21 22:26:25 +01:00
|
|
|
DWORD policy; /* policy value passed to SHRestricted */
|
2003-03-12 21:17:30 +01:00
|
|
|
LPCSTR appstr; /* application str such as "Explorer" */
|
|
|
|
LPCSTR keystr; /* name of the actual registry key / policy */
|
2000-04-28 22:21:49 +02:00
|
|
|
DWORD cache; /* cached value or 0xffffffff for invalid */
|
|
|
|
} POLICYDATA, *LPPOLICYDATA;
|
|
|
|
|
1999-10-23 16:46:15 +02:00
|
|
|
/* application strings */
|
|
|
|
|
2003-03-12 21:17:30 +01:00
|
|
|
static const char strExplorer[] = {"Explorer"};
|
|
|
|
static const char strActiveDesk[] = {"ActiveDesktop"};
|
|
|
|
static const char strWinOldApp[] = {"WinOldApp"};
|
2003-03-21 22:26:25 +01:00
|
|
|
static const char strAddRemoveProgs[] = {"AddRemoveProgs"};
|
1999-10-23 16:46:15 +02:00
|
|
|
|
|
|
|
/* key strings */
|
|
|
|
|
2003-03-12 21:17:30 +01:00
|
|
|
static const char strNoFileURL[] = {"NoFileUrl"};
|
|
|
|
static const char strNoFolderOptions[] = {"NoFolderOptions"};
|
|
|
|
static const char strNoChangeStartMenu[] = {"NoChangeStartMenu"};
|
|
|
|
static const char strNoWindowsUpdate[] = {"NoWindowsUpdate"};
|
|
|
|
static const char strNoSetActiveDesktop[] = {"NoSetActiveDesktop"};
|
|
|
|
static const char strNoForgetSoftwareUpdate[] = {"NoForgetSoftwareUpdate"};
|
|
|
|
static const char strNoMSAppLogo[] = {"NoMSAppLogo5ChannelNotify"};
|
|
|
|
static const char strForceCopyACLW[] = {"ForceCopyACLWithFile"};
|
|
|
|
static const char strNoResolveTrk[] = {"NoResolveTrack"};
|
|
|
|
static const char strNoResolveSearch[] = {"NoResolveSearch"};
|
|
|
|
static const char strNoEditComponent[] = {"NoEditingComponents"};
|
|
|
|
static const char strNoMovingBand[] = {"NoMovingBands"};
|
|
|
|
static const char strNoCloseDragDrop[] = {"NoCloseDragDropBands"};
|
|
|
|
static const char strNoCloseComponent[] = {"NoClosingComponents"};
|
|
|
|
static const char strNoDelComponent[] = {"NoDeletingComponents"};
|
|
|
|
static const char strNoAddComponent[] = {"NoAddingComponents"};
|
|
|
|
static const char strNoComponent[] = {"NoComponents"};
|
|
|
|
static const char strNoChangeWallpaper[] = {"NoChangingWallpaper"};
|
|
|
|
static const char strNoHTMLWallpaper[] = {"NoHTMLWallpaper"};
|
|
|
|
static const char strNoCustomWebView[] = {"NoCustomizeWebView"};
|
|
|
|
static const char strClassicShell[] = {"ClassicShell"};
|
|
|
|
static const char strClearRecentDocs[] = {"ClearRecentDocsOnExit"};
|
|
|
|
static const char strNoFavoritesMenu[] = {"NoFavoritesMenu"};
|
|
|
|
static const char strNoActiveDesktopChanges[] = {"NoActiveDesktopChanges"};
|
|
|
|
static const char strNoActiveDesktop[] = {"NoActiveDesktop"};
|
|
|
|
static const char strNoRecentDocMenu[] = {"NoRecentDocsMenu"};
|
|
|
|
static const char strNoRecentDocHistory[] = {"NoRecentDocsHistory"};
|
|
|
|
static const char strNoInetIcon[] = {"NoInternetIcon"};
|
2003-10-02 06:30:46 +02:00
|
|
|
static const char strNoSettingsWizard[] = {"NoSettingsWizards"};
|
2003-03-12 21:17:30 +01:00
|
|
|
static const char strNoLogoff[] = {"NoLogoff"};
|
|
|
|
static const char strNoNetConDis[] = {"NoNetConnectDisconnect"};
|
2003-10-02 06:30:46 +02:00
|
|
|
static const char strNoViewContextMenu[] = {"NoViewContextMenu"};
|
|
|
|
static const char strNoTrayContextMenu[] = {"NoTrayContextMenu"};
|
2003-03-12 21:17:30 +01:00
|
|
|
static const char strNoWebMenu[] = {"NoWebMenu"};
|
|
|
|
static const char strLnkResolveIgnoreLnkInfo[] = {"LinkResolveIgnoreLinkInfo"};
|
|
|
|
static const char strNoCommonGroups[] = {"NoCommonGroups"};
|
|
|
|
static const char strEnforceShlExtSecurity[] = {"EnforceShellExtensionSecurity"};
|
|
|
|
static const char strNoRealMode[] = {"NoRealMode"};
|
|
|
|
static const char strMyDocsOnNet[] = {"MyDocsOnNet"};
|
|
|
|
static const char strNoStartMenuSubfolder[] = {"NoStartMenuSubFolders"};
|
|
|
|
static const char strNoAddPrinters[] = {"NoAddPrinter"};
|
|
|
|
static const char strNoDeletePrinters[] = {"NoDeletePrinter"};
|
|
|
|
static const char strNoPrintTab[] = {"NoPrinterTabs"};
|
|
|
|
static const char strRestrictRun[] = {"RestrictRun"};
|
|
|
|
static const char strNoStartBanner[] = {"NoStartBanner"};
|
|
|
|
static const char strNoNetworkNeighborhood[] = {"NoNetHood"};
|
|
|
|
static const char strNoDriveTypeAtRun[] = {"NoDriveTypeAutoRun"};
|
|
|
|
static const char strNoDrivesAutoRun[] = {"NoDriveAutoRun"};
|
2003-10-02 06:30:46 +02:00
|
|
|
static const char strSeparateProcess[] = {"SeparateProcess"};
|
2003-03-12 21:17:30 +01:00
|
|
|
static const char strNoDrives[] = {"NoDrives"};
|
|
|
|
static const char strNoFind[] = {"NoFind"};
|
|
|
|
static const char strNoDesktop[] = {"NoDesktop"};
|
|
|
|
static const char strNoSetTaskBar[] = {"NoSetTaskbar"};
|
|
|
|
static const char strNoSetFld[] = {"NoSetFolders"};
|
|
|
|
static const char strNoFileMenu[] = {"NoFileMenu"};
|
2003-10-02 06:30:46 +02:00
|
|
|
static const char strNoSaveSetting[] = {"NoSaveSettings"};
|
2003-03-12 21:17:30 +01:00
|
|
|
static const char strNoClose[] = {"NoClose"};
|
|
|
|
static const char strNoRun[] = {"NoRun"};
|
1999-10-23 16:46:15 +02:00
|
|
|
|
|
|
|
/* policy data array */
|
2006-11-28 11:38:58 +01:00
|
|
|
static POLICYDATA sh32_policy_table[] =
|
1999-10-23 16:46:15 +02:00
|
|
|
{
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NORUN,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoRun,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOCLOSE,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoClose,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOSAVESET,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
2003-10-02 06:30:46 +02:00
|
|
|
strNoSaveSetting,
|
1999-10-23 16:46:15 +02:00
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOFILEMENU,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoFileMenu,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOSETFOLDERS,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoSetFld,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOSETTASKBAR,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoSetTaskBar,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NODESKTOP,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoDesktop,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOFIND,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoFind,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NODRIVES,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoDrives,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NODRIVEAUTORUN,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoDrivesAutoRun,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NODRIVETYPEAUTORUN,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoDriveTypeAtRun,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NONETHOOD,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoNetworkNeighborhood,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_STARTBANNER,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoStartBanner,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_RESTRICTRUN,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strRestrictRun,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOPRINTERTABS,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoPrintTab,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOPRINTERDELETE,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoDeletePrinters,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOPRINTERADD,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoAddPrinters,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOSTARTMENUSUBFOLDERS,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoStartMenuSubfolder,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_MYDOCSONNET,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strMyDocsOnNet,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOEXITTODOS,
|
1999-10-23 16:46:15 +02:00
|
|
|
strWinOldApp,
|
|
|
|
strNoRealMode,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_ENFORCESHELLEXTSECURITY,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strEnforceShlExtSecurity,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_LINKRESOLVEIGNORELINKINFO,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strLnkResolveIgnoreLnkInfo,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOCOMMONGROUPS,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoCommonGroups,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
2003-03-21 22:26:25 +01:00
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_SEPARATEDESKTOPPROCESS,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
2003-10-02 06:30:46 +02:00
|
|
|
strSeparateProcess,
|
2003-03-21 22:26:25 +01:00
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
1999-10-23 16:46:15 +02:00
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOWEB,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoWebMenu,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOTRAYCONTEXTMENU,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
2003-10-02 06:30:46 +02:00
|
|
|
strNoTrayContextMenu,
|
1999-10-23 16:46:15 +02:00
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOVIEWCONTEXTMENU,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
2003-10-02 06:30:46 +02:00
|
|
|
strNoViewContextMenu,
|
1999-10-23 16:46:15 +02:00
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NONETCONNECTDISCONNECT,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoNetConDis,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_STARTMENULOGOFF,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoLogoff,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOSETTINGSASSIST,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
2003-10-02 06:30:46 +02:00
|
|
|
strNoSettingsWizard,
|
1999-10-23 16:46:15 +02:00
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOINTERNETICON,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoInetIcon,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NORECENTDOCSHISTORY,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoRecentDocHistory,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NORECENTDOCSMENU,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoRecentDocMenu,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOACTIVEDESKTOP,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoActiveDesktop,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOACTIVEDESKTOPCHANGES,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoActiveDesktopChanges,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOFAVORITESMENU,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoFavoritesMenu,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_CLEARRECENTDOCSONEXIT,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strClearRecentDocs,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_CLASSICSHELL,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strClassicShell,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOCUSTOMIZEWEBVIEW,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoCustomWebView,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOHTMLWALLPAPER,
|
1999-10-23 16:46:15 +02:00
|
|
|
strActiveDesk,
|
|
|
|
strNoHTMLWallpaper,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOCHANGINGWALLPAPER,
|
1999-10-23 16:46:15 +02:00
|
|
|
strActiveDesk,
|
|
|
|
strNoChangeWallpaper,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NODESKCOMP,
|
1999-10-23 16:46:15 +02:00
|
|
|
strActiveDesk,
|
|
|
|
strNoComponent,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOADDDESKCOMP,
|
1999-10-23 16:46:15 +02:00
|
|
|
strActiveDesk,
|
|
|
|
strNoAddComponent,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NODELDESKCOMP,
|
1999-10-23 16:46:15 +02:00
|
|
|
strActiveDesk,
|
|
|
|
strNoDelComponent,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOCLOSEDESKCOMP,
|
1999-10-23 16:46:15 +02:00
|
|
|
strActiveDesk,
|
|
|
|
strNoCloseComponent,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOCLOSE_DRAGDROPBAND,
|
1999-10-23 16:46:15 +02:00
|
|
|
strActiveDesk,
|
|
|
|
strNoCloseDragDrop,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOMOVINGBAND,
|
1999-10-23 16:46:15 +02:00
|
|
|
strActiveDesk,
|
|
|
|
strNoMovingBand,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOEDITDESKCOMP,
|
1999-10-23 16:46:15 +02:00
|
|
|
strActiveDesk,
|
|
|
|
strNoEditComponent,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NORESOLVESEARCH,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoResolveSearch,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NORESOLVETRACK,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoResolveTrk,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_FORCECOPYACLWITHFILE,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strForceCopyACLW,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOLOGO3CHANNELNOTIFY,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoMSAppLogo,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOFORGETSOFTWAREUPDATE,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoForgetSoftwareUpdate,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOSETACTIVEDESKTOP,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoSetActiveDesktop,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOUPDATEWINDOWS,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoWindowsUpdate,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOCHANGESTARMENU,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoChangeStartMenu,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOFOLDEROPTIONS,
|
1999-10-23 16:46:15 +02:00
|
|
|
strExplorer,
|
|
|
|
strNoFolderOptions,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_HASFINDCOMPUTERS,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"FindComputers",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_INTELLIMENUS,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"IntelliMenus",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_RUNDLGMEMCHECKBOX,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"MemCheckBoxInRunDlg",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_ARP_ShowPostSetup,
|
2003-03-21 22:26:25 +01:00
|
|
|
strAddRemoveProgs,
|
|
|
|
"ShowPostSetup",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOCSC,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"NoSyncAll",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOCONTROLPANEL,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"NoControlPanel",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_ENUMWORKGROUP,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"EnumWorkgroup",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_ARP_NOARP,
|
2003-03-21 22:26:25 +01:00
|
|
|
strAddRemoveProgs,
|
|
|
|
"NoAddRemovePrograms",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_ARP_NOREMOVEPAGE,
|
2003-03-21 22:26:25 +01:00
|
|
|
strAddRemoveProgs,
|
|
|
|
"NoRemovePage",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_ARP_NOADDPAGE,
|
2003-03-21 22:26:25 +01:00
|
|
|
strAddRemoveProgs,
|
|
|
|
"NoAddPage",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_ARP_NOWINSETUPPAGE,
|
2003-03-21 22:26:25 +01:00
|
|
|
strAddRemoveProgs,
|
|
|
|
"NoWindowsSetupPage",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_GREYMSIADS,
|
|
|
|
strExplorer,
|
|
|
|
"",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
|
|
|
REST_NOCHANGEMAPPEDDRIVELABEL,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"NoChangeMappedDriveLabel",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOCHANGEMAPPEDDRIVECOMMENT,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"NoChangeMappedDriveComment",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_MaxRecentDocs,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"MaxRecentDocs",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NONETWORKCONNECTIONS,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"NoNetworkConnections",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_FORCESTARTMENULOGOFF,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"ForceStartMenuLogoff",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOWEBVIEW,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"NoWebView",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOCUSTOMIZETHISFOLDER,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"NoCustomizeThisFolder",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOENCRYPTION,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"NoEncryption",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_ALLOWFRENCHENCRYPTION,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"AllowFrenchEncryption",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_DONTSHOWSUPERHIDDEN,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"DontShowSuperHidden",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOSHELLSEARCHBUTTON,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"NoShellSearchButton",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOHARDWARETAB,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"NoHardwareTab",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NORUNASINSTALLPROMPT,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"NoRunasInstallPrompt",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_PROMPTRUNASINSTALLNETPATH,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"PromptRunasInstallNetPath",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOMANAGEMYCOMPUTERVERB,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"NoManageMyComputerVerb",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NORECENTDOCSNETHOOD,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"NoRecentDocsNetHood",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_DISALLOWRUN,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"DisallowRun",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOWELCOMESCREEN,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"NoWelcomeScreen",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_RESTRICTCPL,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"RestrictCpl",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_DISALLOWCPL,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"DisallowCpl",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOSMBALLOONTIP,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"NoSMBalloonTip",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOSMHELP,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"NoSMHelp",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOWINKEYS,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"NoWinKeys",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOENCRYPTONMOVE,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"NoEncryptOnMove",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOLOCALMACHINERUN,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"DisableLocalMachineRun",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOCURRENTUSERRUN,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"DisableCurrentUserRun",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOLOCALMACHINERUNONCE,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"DisableLocalMachineRunOnce",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOCURRENTUSERRUNONCE,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"DisableCurrentUserRunOnce",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_FORCEACTIVEDESKTOPON,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"ForceActiveDesktopOn",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOCOMPUTERSNEARME,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"NoComputersNearMe",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOVIEWONDRIVE,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"NoViewOnDrive",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NONETCRAWL,
|
|
|
|
strExplorer,
|
|
|
|
"NoNetCrawl",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
|
|
|
REST_NOSHAREDDOCUMENTS,
|
|
|
|
strExplorer,
|
|
|
|
"NoSharedDocs",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
|
|
|
REST_NOSMMYDOCS,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"NoSMMyDocs",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
2003-10-02 06:30:46 +02:00
|
|
|
/* 0x4000050 - 0x4000060 */
|
2004-07-30 01:58:31 +02:00
|
|
|
{
|
|
|
|
REST_NONLEGACYSHELLMODE,
|
|
|
|
strExplorer,
|
|
|
|
"NoneLegacyShellMode",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
2003-03-21 22:26:25 +01:00
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_STARTRUNNOHOMEPATH,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"StartRunNoHOMEPATH",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
2003-10-02 06:30:46 +02:00
|
|
|
/* 0x4000061 - 0x4000086 */
|
2003-03-21 22:26:25 +01:00
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NODISCONNECT,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"NoDisconnect",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOSECURITY,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"NoNTSecurity",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
|
|
|
{
|
2003-10-02 06:30:46 +02:00
|
|
|
REST_NOFILEASSOCIATE,
|
2003-03-21 22:26:25 +01:00
|
|
|
strExplorer,
|
|
|
|
"NoFileAssociate",
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
2003-10-02 06:30:46 +02:00
|
|
|
{
|
|
|
|
0x50000024,
|
|
|
|
strExplorer,
|
|
|
|
strNoFileURL,
|
|
|
|
SHELL_NO_POLICY
|
|
|
|
},
|
2003-03-21 22:26:25 +01:00
|
|
|
{
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
SHELL_NO_POLICY
|
2006-11-28 11:38:58 +01:00
|
|
|
}
|
1999-10-23 16:46:15 +02:00
|
|
|
};
|
2000-04-28 22:21:49 +02:00
|
|
|
|
|
|
|
/*************************************************************************
|
2003-03-21 22:26:25 +01:00
|
|
|
* SHRestricted [SHELL32.100]
|
2000-04-28 22:21:49 +02:00
|
|
|
*
|
2003-03-12 21:17:30 +01:00
|
|
|
* Get the value associated with a policy Id.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* pol [I] Policy Id
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* The queried value for the policy.
|
2000-04-28 22:21:49 +02:00
|
|
|
*
|
|
|
|
* NOTES
|
2003-03-12 21:17:30 +01:00
|
|
|
* Exported by ordinal.
|
|
|
|
* This function caches the retrieved values to prevent unnecessary registry access,
|
|
|
|
* if SHInitRestricted() was previously called.
|
2000-04-28 22:21:49 +02:00
|
|
|
*
|
2003-03-12 21:17:30 +01:00
|
|
|
* REFERENCES
|
|
|
|
* a: MS System Policy Editor.
|
|
|
|
* b: 98Lite 2.0 (which uses many of these policy keys) http://www.98lite.net/
|
|
|
|
* c: 'The Windows 95 Registry', by John Woram, 1996 MIS: Press
|
2000-04-28 22:21:49 +02:00
|
|
|
*/
|
2003-10-02 06:30:46 +02:00
|
|
|
DWORD WINAPI SHRestricted (RESTRICTIONS policy)
|
2003-03-21 22:26:25 +01:00
|
|
|
{
|
|
|
|
char regstr[256];
|
|
|
|
HKEY xhkey;
|
|
|
|
DWORD retval, datsize = 4;
|
|
|
|
LPPOLICYDATA p;
|
2000-04-28 22:21:49 +02:00
|
|
|
|
2003-10-02 06:30:46 +02:00
|
|
|
TRACE("(%08x)\n", policy);
|
2000-04-28 22:21:49 +02:00
|
|
|
|
|
|
|
/* scan to see if we know this policy ID */
|
2003-03-21 22:26:25 +01:00
|
|
|
for (p = sh32_policy_table; p->policy; p++)
|
2000-04-28 22:21:49 +02:00
|
|
|
{
|
2003-03-21 22:26:25 +01:00
|
|
|
if (policy == p->policy)
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
2000-04-28 22:21:49 +02:00
|
|
|
}
|
|
|
|
|
2003-03-21 22:26:25 +01:00
|
|
|
if (p->policy == 0)
|
2000-04-28 22:21:49 +02:00
|
|
|
{
|
|
|
|
/* we don't know this policy, return 0 */
|
2003-10-02 06:30:46 +02:00
|
|
|
TRACE("unknown policy: (%08x)\n", policy);
|
2000-04-28 22:21:49 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* we have a known policy */
|
|
|
|
|
|
|
|
/* first check if this policy has been cached, return it if so */
|
2003-03-21 22:26:25 +01:00
|
|
|
if (p->cache != SHELL_NO_POLICY)
|
2000-04-28 22:21:49 +02:00
|
|
|
{
|
2003-03-21 22:26:25 +01:00
|
|
|
return p->cache;
|
2000-04-28 22:21:49 +02:00
|
|
|
}
|
|
|
|
|
2021-09-20 12:58:52 +02:00
|
|
|
lstrcpyA(regstr, "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\");
|
2003-03-21 22:26:25 +01:00
|
|
|
lstrcatA(regstr, p->appstr);
|
|
|
|
|
2000-04-28 22:21:49 +02:00
|
|
|
/* return 0 and don't set the cache if any registry errors occur */
|
|
|
|
retval = 0;
|
|
|
|
if (RegOpenKeyA(HKEY_CURRENT_USER, regstr, &xhkey) == ERROR_SUCCESS)
|
|
|
|
{
|
2003-03-21 22:26:25 +01:00
|
|
|
if (RegQueryValueExA(xhkey, p->keystr, NULL, NULL, (LPBYTE)&retval, &datsize) == ERROR_SUCCESS)
|
|
|
|
{
|
|
|
|
p->cache = retval;
|
|
|
|
}
|
|
|
|
RegCloseKey(xhkey);
|
2001-09-11 02:32:32 +02:00
|
|
|
}
|
2000-04-28 22:21:49 +02:00
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2003-03-21 22:26:25 +01:00
|
|
|
* SHInitRestricted [SHELL32.244]
|
2000-04-28 22:21:49 +02:00
|
|
|
*
|
2003-03-12 21:17:30 +01:00
|
|
|
* Initialise the policy cache to speed up calls to SHRestricted().
|
2000-04-28 22:21:49 +02:00
|
|
|
*
|
2003-03-12 21:17:30 +01:00
|
|
|
* PARAMS
|
2003-03-21 22:26:25 +01:00
|
|
|
* unused [I] Reserved.
|
2003-03-12 21:17:30 +01:00
|
|
|
* inpRegKey [I] Registry key to scan.
|
2000-04-28 22:21:49 +02:00
|
|
|
*
|
2003-03-12 21:17:30 +01:00
|
|
|
* RETURNS
|
2003-03-21 22:26:25 +01:00
|
|
|
* Success: -1. The policy cache is initialised.
|
|
|
|
* Failure: 0, if inpRegKey is any value other than NULL, "Policy", or
|
2003-03-12 21:17:30 +01:00
|
|
|
* "Software\Microsoft\Windows\CurrentVersion\Policies".
|
2000-04-28 22:21:49 +02:00
|
|
|
*
|
2003-03-12 21:17:30 +01:00
|
|
|
* NOTES
|
|
|
|
* Exported by ordinal. Introduced in Win98.
|
2000-04-28 22:21:49 +02:00
|
|
|
*/
|
2003-03-21 22:26:25 +01:00
|
|
|
BOOL WINAPI SHInitRestricted(LPCVOID unused, LPCVOID inpRegKey)
|
2000-04-28 22:21:49 +02:00
|
|
|
{
|
2003-03-21 22:26:25 +01:00
|
|
|
TRACE("(%p, %p)\n", unused, inpRegKey);
|
2000-04-28 22:21:49 +02:00
|
|
|
|
2003-03-21 22:26:25 +01:00
|
|
|
/* first check - if input is non-NULL and points to the secret
|
2003-03-23 21:03:30 +01:00
|
|
|
key string, then pass. Otherwise return 0.
|
2003-03-21 22:26:25 +01:00
|
|
|
*/
|
|
|
|
if (inpRegKey != NULL)
|
|
|
|
{
|
|
|
|
if (SHELL_OsIsUnicode())
|
|
|
|
{
|
2021-09-20 12:58:52 +02:00
|
|
|
if (lstrcmpiW(inpRegKey, L"Software\\Microsoft\\Windows\\CurrentVersion\\Policies") &&
|
|
|
|
lstrcmpiW(inpRegKey, L"Policy"))
|
2003-03-21 22:26:25 +01:00
|
|
|
/* doesn't match, fail */
|
2013-01-10 19:54:34 +01:00
|
|
|
return FALSE;
|
2003-03-21 22:26:25 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-09-20 12:58:52 +02:00
|
|
|
if (lstrcmpiA(inpRegKey, "Software\\Microsoft\\Windows\\CurrentVersion\\Policies") &&
|
|
|
|
lstrcmpiA(inpRegKey, "Policy"))
|
2003-03-21 22:26:25 +01:00
|
|
|
/* doesn't match, fail */
|
2013-01-10 19:54:34 +01:00
|
|
|
return FALSE;
|
2003-03-21 22:26:25 +01:00
|
|
|
}
|
|
|
|
}
|
2000-04-28 22:21:49 +02:00
|
|
|
|
2003-10-24 06:23:37 +02:00
|
|
|
return TRUE;
|
2000-04-28 22:21:49 +02:00
|
|
|
}
|