ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

shpolicy.cpp
Go to the documentation of this file.
00001 /*
00002  * shpolicy.c - Data for shell/system policies.
00003  *
00004  * Copyright 1999 Ian Schmidt <ischmidt@cfl.rr.com>
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
00019  *
00020  * NOTES:
00021  *
00022  * Some of these policies can be tweaked via the System Policy
00023  * Editor which came with the Win95 Migration Guide, although
00024  * there doesn't appear to be an updated Win98 version that
00025  * would handle the many new policies introduced since then.
00026  * You could easily write one with the information in
00027  * this file...
00028  *
00029  * Up to date as of SHELL32 v5.00 (W2K)
00030  */
00031 
00032 #include <precomp.h>
00033 
00034 WINE_DEFAULT_DEBUG_CHANNEL(shell);
00035 
00036 #define SHELL_NO_POLICY 0xffffffff
00037 
00038 typedef struct tagPOLICYDAT
00039 {
00040   RESTRICTIONS policy;          /* policy value passed to SHRestricted */
00041   LPCSTR appstr;         /* application str such as "Explorer" */
00042   LPCSTR keystr;         /* name of the actual registry key / policy */
00043   DWORD cache;           /* cached value or 0xffffffff for invalid */
00044 } POLICYDATA, *LPPOLICYDATA;
00045 
00046 /* registry strings */
00047 static const CHAR strRegistryPolicyA[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies";
00048 static const WCHAR strRegistryPolicyW[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o',
00049                                            's','o','f','t','\\','W','i','n','d','o','w','s','\\',
00050                                            'C','u','r','r','e','n','t','V','e','r','s','i','o','n',
00051                                            '\\','P','o','l','i','c','i','e','s',0};
00052 static const CHAR strPolicyA[] = "Policy";
00053 static const WCHAR strPolicyW[] = {'P','o','l','i','c','y',0};
00054 
00055 /* application strings */
00056 
00057 static const char strExplorer[] = {"Explorer"};
00058 static const char strActiveDesk[] = {"ActiveDesktop"};
00059 static const char strWinOldApp[] = {"WinOldApp"};
00060 static const char strAddRemoveProgs[] = {"AddRemoveProgs"};
00061 
00062 /* key strings */
00063 
00064 static const char strNoFileURL[] = {"NoFileUrl"};
00065 static const char strNoFolderOptions[] = {"NoFolderOptions"};
00066 static const char strNoChangeStartMenu[] = {"NoChangeStartMenu"};
00067 static const char strNoWindowsUpdate[] = {"NoWindowsUpdate"};
00068 static const char strNoSetActiveDesktop[] = {"NoSetActiveDesktop"};
00069 static const char strNoForgetSoftwareUpdate[] = {"NoForgetSoftwareUpdate"};
00070 static const char strNoMSAppLogo[] = {"NoMSAppLogo5ChannelNotify"};
00071 static const char strForceCopyACLW[] = {"ForceCopyACLWithFile"};
00072 static const char strNoResolveTrk[] = {"NoResolveTrack"};
00073 static const char strNoResolveSearch[] = {"NoResolveSearch"};
00074 static const char strNoEditComponent[] = {"NoEditingComponents"};
00075 static const char strNoMovingBand[] = {"NoMovingBands"};
00076 static const char strNoCloseDragDrop[] = {"NoCloseDragDropBands"};
00077 static const char strNoCloseComponent[] = {"NoClosingComponents"};
00078 static const char strNoDelComponent[] = {"NoDeletingComponents"};
00079 static const char strNoAddComponent[] = {"NoAddingComponents"};
00080 static const char strNoComponent[] = {"NoComponents"};
00081 static const char strNoChangeWallpaper[] = {"NoChangingWallpaper"};
00082 static const char strNoHTMLWallpaper[] = {"NoHTMLWallpaper"};
00083 static const char strNoCustomWebView[] = {"NoCustomizeWebView"};
00084 static const char strClassicShell[] = {"ClassicShell"};
00085 static const char strClearRecentDocs[] = {"ClearRecentDocsOnExit"};
00086 static const char strNoFavoritesMenu[] = {"NoFavoritesMenu"};
00087 static const char strNoActiveDesktopChanges[] = {"NoActiveDesktopChanges"};
00088 static const char strNoActiveDesktop[] = {"NoActiveDesktop"};
00089 static const char strNoRecentDocMenu[] = {"NoRecentDocsMenu"};
00090 static const char strNoRecentDocHistory[] = {"NoRecentDocsHistory"};
00091 static const char strNoInetIcon[] = {"NoInternetIcon"};
00092 static const char strNoSettingsWizard[] = {"NoSettingsWizards"};
00093 static const char strNoLogoff[] = {"NoLogoff"};
00094 static const char strNoNetConDis[] = {"NoNetConnectDisconnect"};
00095 static const char strNoViewContextMenu[] = {"NoViewContextMenu"};
00096 static const char strNoTrayContextMenu[] = {"NoTrayContextMenu"};
00097 static const char strNoWebMenu[] = {"NoWebMenu"};
00098 static const char strLnkResolveIgnoreLnkInfo[] = {"LinkResolveIgnoreLinkInfo"};
00099 static const char strNoCommonGroups[] = {"NoCommonGroups"};
00100 static const char strEnforceShlExtSecurity[] = {"EnforceShellExtensionSecurity"};
00101 static const char strNoRealMode[] = {"NoRealMode"};
00102 static const char strMyDocsOnNet[] = {"MyDocsOnNet"};
00103 static const char strNoStartMenuSubfolder[] = {"NoStartMenuSubFolders"};
00104 static const char strNoAddPrinters[] = {"NoAddPrinter"};
00105 static const char strNoDeletePrinters[] = {"NoDeletePrinter"};
00106 static const char strNoPrintTab[] = {"NoPrinterTabs"};
00107 static const char strRestrictRun[] = {"RestrictRun"};
00108 static const char strNoStartBanner[] = {"NoStartBanner"};
00109 static const char strNoNetworkNeighborhood[] = {"NoNetHood"};
00110 static const char strNoDriveTypeAtRun[] = {"NoDriveTypeAutoRun"};
00111 static const char strNoDrivesAutoRun[] = {"NoDriveAutoRun"};
00112 static const char strSeparateProcess[] = {"SeparateProcess"};
00113 static const char strNoDrives[] = {"NoDrives"};
00114 static const char strNoFind[] = {"NoFind"};
00115 static const char strNoDesktop[] = {"NoDesktop"};
00116 static const char strNoSetTaskBar[] = {"NoSetTaskbar"};
00117 static const char strNoSetFld[] = {"NoSetFolders"};
00118 static const char strNoFileMenu[] = {"NoFileMenu"};
00119 static const char strNoSaveSetting[] = {"NoSaveSettings"};
00120 static const char strNoClose[] = {"NoClose"};
00121 static const char strNoRun[] = {"NoRun"};
00122 
00123 /* policy data array */
00124 static POLICYDATA sh32_policy_table[] =
00125 {
00126   {
00127     REST_NORUN,
00128     strExplorer,
00129     strNoRun,
00130     SHELL_NO_POLICY
00131   },
00132   {
00133     REST_NOCLOSE,
00134     strExplorer,
00135     strNoClose,
00136     SHELL_NO_POLICY
00137   },
00138   {
00139     REST_NOSAVESET,
00140     strExplorer,
00141     strNoSaveSetting,
00142     SHELL_NO_POLICY
00143   },
00144   {
00145     REST_NOFILEMENU,
00146     strExplorer,
00147     strNoFileMenu,
00148     SHELL_NO_POLICY
00149   },
00150   {
00151     REST_NOSETFOLDERS,
00152     strExplorer,
00153     strNoSetFld,
00154     SHELL_NO_POLICY
00155   },
00156   {
00157     REST_NOSETTASKBAR,
00158     strExplorer,
00159     strNoSetTaskBar,
00160     SHELL_NO_POLICY
00161   },
00162   {
00163     REST_NODESKTOP,
00164     strExplorer,
00165     strNoDesktop,
00166     SHELL_NO_POLICY
00167   },
00168   {
00169     REST_NOFIND,
00170     strExplorer,
00171     strNoFind,
00172     SHELL_NO_POLICY
00173   },
00174   {
00175     REST_NODRIVES,
00176     strExplorer,
00177     strNoDrives,
00178     SHELL_NO_POLICY
00179   },
00180   {
00181     REST_NODRIVEAUTORUN,
00182     strExplorer,
00183     strNoDrivesAutoRun,
00184     SHELL_NO_POLICY
00185   },
00186   {
00187     REST_NODRIVETYPEAUTORUN,
00188     strExplorer,
00189     strNoDriveTypeAtRun,
00190     SHELL_NO_POLICY
00191   },
00192   {
00193     REST_NONETHOOD,
00194     strExplorer,
00195     strNoNetworkNeighborhood,
00196     SHELL_NO_POLICY
00197   },
00198   {
00199     REST_STARTBANNER,
00200     strExplorer,
00201     strNoStartBanner,
00202     SHELL_NO_POLICY
00203   },
00204   {
00205     REST_RESTRICTRUN,
00206     strExplorer,
00207     strRestrictRun,
00208     SHELL_NO_POLICY
00209   },
00210   {
00211     REST_NOPRINTERTABS,
00212     strExplorer,
00213     strNoPrintTab,
00214     SHELL_NO_POLICY
00215   },
00216   {
00217     REST_NOPRINTERDELETE,
00218     strExplorer,
00219     strNoDeletePrinters,
00220     SHELL_NO_POLICY
00221   },
00222   {
00223     REST_NOPRINTERADD,
00224     strExplorer,
00225     strNoAddPrinters,
00226     SHELL_NO_POLICY
00227   },
00228   {
00229     REST_NOSTARTMENUSUBFOLDERS,
00230     strExplorer,
00231     strNoStartMenuSubfolder,
00232     SHELL_NO_POLICY
00233   },
00234   {
00235     REST_MYDOCSONNET,
00236     strExplorer,
00237     strMyDocsOnNet,
00238     SHELL_NO_POLICY
00239   },
00240   {
00241     REST_NOEXITTODOS,
00242     strWinOldApp,
00243     strNoRealMode,
00244     SHELL_NO_POLICY
00245   },
00246   {
00247     REST_ENFORCESHELLEXTSECURITY,
00248     strExplorer,
00249     strEnforceShlExtSecurity,
00250     SHELL_NO_POLICY
00251   },
00252   {
00253     REST_LINKRESOLVEIGNORELINKINFO,
00254     strExplorer,
00255     strLnkResolveIgnoreLnkInfo,
00256     SHELL_NO_POLICY
00257   },
00258   {
00259     REST_NOCOMMONGROUPS,
00260     strExplorer,
00261     strNoCommonGroups,
00262     SHELL_NO_POLICY
00263   },
00264   {
00265     REST_SEPARATEDESKTOPPROCESS,
00266     strExplorer,
00267     strSeparateProcess,
00268     SHELL_NO_POLICY
00269   },
00270   {
00271     REST_NOWEB,
00272     strExplorer,
00273     strNoWebMenu,
00274     SHELL_NO_POLICY
00275   },
00276   {
00277     REST_NOTRAYCONTEXTMENU,
00278     strExplorer,
00279     strNoTrayContextMenu,
00280     SHELL_NO_POLICY
00281   },
00282   {
00283     REST_NOVIEWCONTEXTMENU,
00284     strExplorer,
00285     strNoViewContextMenu,
00286     SHELL_NO_POLICY
00287   },
00288   {
00289     REST_NONETCONNECTDISCONNECT,
00290     strExplorer,
00291     strNoNetConDis,
00292     SHELL_NO_POLICY
00293   },
00294   {
00295     REST_STARTMENULOGOFF,
00296     strExplorer,
00297     strNoLogoff,
00298     SHELL_NO_POLICY
00299   },
00300   {
00301     REST_NOSETTINGSASSIST,
00302     strExplorer,
00303     strNoSettingsWizard,
00304     SHELL_NO_POLICY
00305   },
00306   {
00307     REST_NOINTERNETICON,
00308     strExplorer,
00309     strNoInetIcon,
00310     SHELL_NO_POLICY
00311   },
00312   {
00313     REST_NORECENTDOCSHISTORY,
00314     strExplorer,
00315     strNoRecentDocHistory,
00316     SHELL_NO_POLICY
00317   },
00318   {
00319     REST_NORECENTDOCSMENU,
00320     strExplorer,
00321     strNoRecentDocMenu,
00322     SHELL_NO_POLICY
00323   },
00324   {
00325     REST_NOACTIVEDESKTOP,
00326     strExplorer,
00327     strNoActiveDesktop,
00328     SHELL_NO_POLICY
00329   },
00330   {
00331     REST_NOACTIVEDESKTOPCHANGES,
00332     strExplorer,
00333     strNoActiveDesktopChanges,
00334     SHELL_NO_POLICY
00335   },
00336   {
00337     REST_NOFAVORITESMENU,
00338     strExplorer,
00339     strNoFavoritesMenu,
00340     SHELL_NO_POLICY
00341   },
00342   {
00343     REST_CLEARRECENTDOCSONEXIT,
00344     strExplorer,
00345     strClearRecentDocs,
00346     SHELL_NO_POLICY
00347   },
00348   {
00349     REST_CLASSICSHELL,
00350     strExplorer,
00351     strClassicShell,
00352     SHELL_NO_POLICY
00353   },
00354   {
00355     REST_NOCUSTOMIZEWEBVIEW,
00356     strExplorer,
00357     strNoCustomWebView,
00358     SHELL_NO_POLICY
00359   },
00360   {
00361     REST_NOHTMLWALLPAPER,
00362     strActiveDesk,
00363     strNoHTMLWallpaper,
00364     SHELL_NO_POLICY
00365   },
00366   {
00367     REST_NOCHANGINGWALLPAPER,
00368     strActiveDesk,
00369     strNoChangeWallpaper,
00370     SHELL_NO_POLICY
00371   },
00372   {
00373     REST_NODESKCOMP,
00374     strActiveDesk,
00375     strNoComponent,
00376     SHELL_NO_POLICY
00377   },
00378   {
00379     REST_NOADDDESKCOMP,
00380     strActiveDesk,
00381     strNoAddComponent,
00382     SHELL_NO_POLICY
00383   },
00384   {
00385     REST_NODELDESKCOMP,
00386     strActiveDesk,
00387     strNoDelComponent,
00388     SHELL_NO_POLICY
00389   },
00390   {
00391     REST_NOCLOSEDESKCOMP,
00392     strActiveDesk,
00393     strNoCloseComponent,
00394     SHELL_NO_POLICY
00395   },
00396   {
00397     REST_NOCLOSE_DRAGDROPBAND,
00398     strActiveDesk,
00399     strNoCloseDragDrop,
00400     SHELL_NO_POLICY
00401   },
00402   {
00403     REST_NOMOVINGBAND,
00404     strActiveDesk,
00405     strNoMovingBand,
00406     SHELL_NO_POLICY
00407   },
00408   {
00409     REST_NOEDITDESKCOMP,
00410     strActiveDesk,
00411     strNoEditComponent,
00412     SHELL_NO_POLICY
00413   },
00414   {
00415     REST_NORESOLVESEARCH,
00416     strExplorer,
00417     strNoResolveSearch,
00418     SHELL_NO_POLICY
00419   },
00420   {
00421     REST_NORESOLVETRACK,
00422     strExplorer,
00423     strNoResolveTrk,
00424     SHELL_NO_POLICY
00425   },
00426   {
00427     REST_FORCECOPYACLWITHFILE,
00428     strExplorer,
00429     strForceCopyACLW,
00430     SHELL_NO_POLICY
00431   },
00432 #if (NTDDI_VERSION < NTDDI_LONGHORN)
00433   {
00434     REST_NOLOGO3CHANNELNOTIFY,
00435     strExplorer,
00436     strNoMSAppLogo,
00437     SHELL_NO_POLICY
00438   },
00439 #endif
00440   {
00441     REST_NOFORGETSOFTWAREUPDATE,
00442     strExplorer,
00443     strNoForgetSoftwareUpdate,
00444     SHELL_NO_POLICY
00445   },
00446   {
00447     REST_NOSETACTIVEDESKTOP,
00448     strExplorer,
00449     strNoSetActiveDesktop,
00450     SHELL_NO_POLICY
00451   },
00452   {
00453     REST_NOUPDATEWINDOWS,
00454     strExplorer,
00455     strNoWindowsUpdate,
00456     SHELL_NO_POLICY
00457   },
00458   {
00459     REST_NOCHANGESTARMENU,
00460     strExplorer,
00461     strNoChangeStartMenu,
00462     SHELL_NO_POLICY
00463   },
00464   {
00465     REST_NOFOLDEROPTIONS,
00466     strExplorer,
00467     strNoFolderOptions,
00468     SHELL_NO_POLICY
00469   },
00470   {
00471     REST_HASFINDCOMPUTERS,
00472     strExplorer,
00473     "FindComputers",
00474     SHELL_NO_POLICY
00475   },
00476   {
00477     REST_INTELLIMENUS,
00478     strExplorer,
00479     "IntelliMenus",
00480     SHELL_NO_POLICY
00481   },
00482   {
00483     REST_RUNDLGMEMCHECKBOX,
00484     strExplorer,
00485     "MemCheckBoxInRunDlg",
00486     SHELL_NO_POLICY
00487   },
00488   {
00489     REST_ARP_ShowPostSetup,
00490     strAddRemoveProgs,
00491     "ShowPostSetup",
00492     SHELL_NO_POLICY
00493   },
00494   {
00495     REST_NOCSC,
00496     strExplorer,
00497     "NoSyncAll",
00498     SHELL_NO_POLICY
00499   },
00500   {
00501     REST_NOCONTROLPANEL,
00502     strExplorer,
00503     "NoControlPanel",
00504     SHELL_NO_POLICY
00505   },
00506   {
00507     REST_ENUMWORKGROUP,
00508     strExplorer,
00509     "EnumWorkgroup",
00510     SHELL_NO_POLICY
00511   },
00512   {
00513     REST_ARP_NOARP,
00514     strAddRemoveProgs,
00515     "NoAddRemovePrograms",
00516     SHELL_NO_POLICY
00517   },
00518   {
00519     REST_ARP_NOREMOVEPAGE,
00520     strAddRemoveProgs,
00521     "NoRemovePage",
00522     SHELL_NO_POLICY
00523   },
00524   {
00525     REST_ARP_NOADDPAGE,
00526     strAddRemoveProgs,
00527     "NoAddPage",
00528     SHELL_NO_POLICY
00529   },
00530   {
00531     REST_ARP_NOWINSETUPPAGE,
00532     strAddRemoveProgs,
00533     "NoWindowsSetupPage",
00534     SHELL_NO_POLICY
00535   },
00536   {
00537     REST_GREYMSIADS,
00538     strExplorer,
00539     "",
00540     SHELL_NO_POLICY
00541   },
00542   {
00543     REST_NOCHANGEMAPPEDDRIVELABEL,
00544     strExplorer,
00545     "NoChangeMappedDriveLabel",
00546     SHELL_NO_POLICY
00547   },
00548   {
00549     REST_NOCHANGEMAPPEDDRIVECOMMENT,
00550     strExplorer,
00551     "NoChangeMappedDriveComment",
00552     SHELL_NO_POLICY
00553   },
00554   {
00555     REST_MaxRecentDocs,
00556     strExplorer,
00557     "MaxRecentDocs",
00558     SHELL_NO_POLICY
00559   },
00560   {
00561     REST_NONETWORKCONNECTIONS,
00562     strExplorer,
00563     "NoNetworkConnections",
00564     SHELL_NO_POLICY
00565   },
00566   {
00567     REST_FORCESTARTMENULOGOFF,
00568     strExplorer,
00569     "ForceStartMenuLogoff",
00570     SHELL_NO_POLICY
00571   },
00572   {
00573     REST_NOWEBVIEW,
00574     strExplorer,
00575      "NoWebView",
00576     SHELL_NO_POLICY
00577   },
00578   {
00579     REST_NOCUSTOMIZETHISFOLDER,
00580     strExplorer,
00581     "NoCustomizeThisFolder",
00582     SHELL_NO_POLICY
00583   },
00584   {
00585     REST_NOENCRYPTION,
00586     strExplorer,
00587     "NoEncryption",
00588     SHELL_NO_POLICY
00589   },
00590   {
00591     REST_ALLOWFRENCHENCRYPTION,
00592     strExplorer,
00593     "AllowFrenchEncryption",
00594     SHELL_NO_POLICY
00595   },
00596   {
00597     REST_DONTSHOWSUPERHIDDEN,
00598     strExplorer,
00599     "DontShowSuperHidden",
00600     SHELL_NO_POLICY
00601   },
00602   {
00603     REST_NOSHELLSEARCHBUTTON,
00604     strExplorer,
00605     "NoShellSearchButton",
00606     SHELL_NO_POLICY
00607   },
00608   {
00609     REST_NOHARDWARETAB,
00610     strExplorer,
00611     "NoHardwareTab",
00612     SHELL_NO_POLICY
00613   },
00614   {
00615     REST_NORUNASINSTALLPROMPT,
00616     strExplorer,
00617     "NoRunasInstallPrompt",
00618     SHELL_NO_POLICY
00619   },
00620   {
00621     REST_PROMPTRUNASINSTALLNETPATH,
00622     strExplorer,
00623     "PromptRunasInstallNetPath",
00624     SHELL_NO_POLICY
00625   },
00626   {
00627     REST_NOMANAGEMYCOMPUTERVERB,
00628     strExplorer,
00629     "NoManageMyComputerVerb",
00630     SHELL_NO_POLICY
00631   },
00632   {
00633     REST_NORECENTDOCSNETHOOD,
00634     strExplorer,
00635     "NoRecentDocsNetHood",
00636     SHELL_NO_POLICY
00637   },
00638   {
00639     REST_DISALLOWRUN,
00640     strExplorer,
00641     "DisallowRun",
00642     SHELL_NO_POLICY
00643   },
00644   {
00645     REST_NOWELCOMESCREEN,
00646     strExplorer,
00647     "NoWelcomeScreen",
00648     SHELL_NO_POLICY
00649   },
00650   {
00651     REST_RESTRICTCPL,
00652     strExplorer,
00653     "RestrictCpl",
00654     SHELL_NO_POLICY
00655   },
00656   {
00657     REST_DISALLOWCPL,
00658     strExplorer,
00659     "DisallowCpl",
00660     SHELL_NO_POLICY
00661   },
00662   {
00663     REST_NOSMBALLOONTIP,
00664     strExplorer,
00665     "NoSMBalloonTip",
00666     SHELL_NO_POLICY
00667   },
00668   {
00669     REST_NOSMHELP,
00670     strExplorer,
00671     "NoSMHelp",
00672     SHELL_NO_POLICY
00673   },
00674   {
00675     REST_NOWINKEYS,
00676     strExplorer,
00677     "NoWinKeys",
00678     SHELL_NO_POLICY
00679   },
00680   {
00681     REST_NOENCRYPTONMOVE,
00682     strExplorer,
00683     "NoEncryptOnMove",
00684     SHELL_NO_POLICY
00685   },
00686   {
00687     REST_NOLOCALMACHINERUN,
00688     strExplorer,
00689     "DisableLocalMachineRun",
00690     SHELL_NO_POLICY
00691   },
00692   {
00693     REST_NOCURRENTUSERRUN,
00694     strExplorer,
00695     "DisableCurrentUserRun",
00696     SHELL_NO_POLICY
00697   },
00698   {
00699     REST_NOLOCALMACHINERUNONCE,
00700     strExplorer,
00701     "DisableLocalMachineRunOnce",
00702     SHELL_NO_POLICY
00703   },
00704   {
00705     REST_NOCURRENTUSERRUNONCE,
00706     strExplorer,
00707     "DisableCurrentUserRunOnce",
00708     SHELL_NO_POLICY
00709   },
00710   {
00711     REST_FORCEACTIVEDESKTOPON,
00712     strExplorer,
00713     "ForceActiveDesktopOn",
00714     SHELL_NO_POLICY
00715   },
00716   {
00717     REST_NOCOMPUTERSNEARME,
00718     strExplorer,
00719     "NoComputersNearMe",
00720     SHELL_NO_POLICY
00721   },
00722   {
00723     REST_NOVIEWONDRIVE,
00724     strExplorer,
00725     "NoViewOnDrive",
00726     SHELL_NO_POLICY
00727   },
00728   {
00729     REST_NONETCRAWL,
00730     strExplorer,
00731     "NoNetCrawl",
00732     SHELL_NO_POLICY
00733   },
00734   {
00735     REST_NOSHAREDDOCUMENTS,
00736     strExplorer,
00737     "NoSharedDocs",
00738     SHELL_NO_POLICY
00739   },
00740   {
00741     REST_NOSMMYDOCS,
00742     strExplorer,
00743     "NoSMMyDocs",
00744     SHELL_NO_POLICY
00745   },
00746 /* 0x4000050 - 0x4000060 */
00747   {
00748     REST_NONLEGACYSHELLMODE,
00749     strExplorer,
00750     "NoneLegacyShellMode",
00751     SHELL_NO_POLICY
00752   },
00753   {
00754     REST_STARTRUNNOHOMEPATH,
00755     strExplorer,
00756     "StartRunNoHOMEPATH",
00757     SHELL_NO_POLICY
00758   },
00759 /* 0x4000061 - 0x4000086 */
00760   {
00761     REST_NODISCONNECT,
00762     strExplorer,
00763     "NoDisconnect",
00764     SHELL_NO_POLICY
00765   },
00766   {
00767     REST_NOSECURITY,
00768     strExplorer,
00769     "NoNTSecurity",
00770     SHELL_NO_POLICY
00771   },
00772   {
00773     REST_NOFILEASSOCIATE,
00774     strExplorer,
00775     "NoFileAssociate",
00776     SHELL_NO_POLICY
00777   },
00778   {
00779     (RESTRICTIONS)0x50000024,
00780     strExplorer,
00781     strNoFileURL,
00782     SHELL_NO_POLICY
00783   },
00784   {
00785     (RESTRICTIONS)0,
00786     0,
00787     0,
00788     SHELL_NO_POLICY
00789   }
00790 };
00791 
00792 /*************************************************************************
00793  * SHRestricted                 [SHELL32.100]
00794  *
00795  * Get the value associated with a policy Id.
00796  *
00797  * PARAMS
00798  *     pol [I] Policy Id
00799  *
00800  * RETURNS
00801  *     The queried value for the policy.
00802  *
00803  * NOTES
00804  *     Exported by ordinal.
00805  *     This function caches the retrieved values to prevent unnecessary registry access,
00806  *     if SHInitRestricted() was previously called.
00807  *
00808  * REFERENCES
00809  *     a: MS System Policy Editor.
00810  *     b: 98Lite 2.0 (which uses many of these policy keys) http://www.98lite.net/
00811  *     c: 'The Windows 95 Registry', by John Woram, 1996 MIS: Press
00812  */
00813 DWORD WINAPI SHRestricted (RESTRICTIONS policy)
00814 {
00815     char regstr[256];
00816     HKEY    xhkey;
00817     DWORD   retval, datsize = 4;
00818     LPPOLICYDATA p;
00819 
00820     TRACE("(%08x)\n", policy);
00821 
00822     /* scan to see if we know this policy ID */
00823     for (p = sh32_policy_table; p->policy; p++)
00824     {
00825       if (policy == p->policy)
00826       {
00827         break;
00828       }
00829     }
00830 
00831     if (p->policy == 0)
00832     {
00833         /* we don't know this policy, return 0 */
00834         TRACE("unknown policy: (%08x)\n", policy);
00835         return 0;
00836     }
00837 
00838     /* we have a known policy */
00839 
00840     /* first check if this policy has been cached, return it if so */
00841     if (p->cache != SHELL_NO_POLICY)
00842     {
00843         return p->cache;
00844     }
00845 
00846     lstrcpyA(regstr, strRegistryPolicyA);
00847     lstrcatA(regstr, p->appstr);
00848 
00849     /* return 0 and don't set the cache if any registry errors occur */
00850     retval = 0;
00851     if (RegOpenKeyA(HKEY_CURRENT_USER, regstr, &xhkey) == ERROR_SUCCESS)
00852     {
00853       if (RegQueryValueExA(xhkey, p->keystr, NULL, NULL, (LPBYTE)&retval, &datsize) == ERROR_SUCCESS)
00854       {
00855         p->cache = retval;
00856       }
00857       RegCloseKey(xhkey);
00858     }
00859     return retval;
00860 }
00861 
00862 /*************************************************************************
00863  * SHInitRestricted          [SHELL32.244]
00864  *
00865  * Initialise the policy cache to speed up calls to SHRestricted().
00866  *
00867  * PARAMS
00868  *  unused    [I] Reserved.
00869  *  inpRegKey [I] Registry key to scan.
00870  *
00871  * RETURNS
00872  *  Success: -1. The policy cache is initialised.
00873  *  Failure: 0, if inpRegKey is any value other than NULL, "Policy", or
00874  *           "Software\Microsoft\Windows\CurrentVersion\Policies".
00875  *
00876  * NOTES
00877  *  Exported by ordinal. Introduced in Win98.
00878  */
00879 BOOL WINAPI SHInitRestricted(LPCVOID unused, LPCVOID inpRegKey)
00880 {
00881     TRACE("(%p, %p)\n", unused, inpRegKey);
00882 
00883     /* first check - if input is non-NULL and points to the secret
00884        key string, then pass. Otherwise return 0.
00885      */
00886     if (inpRegKey != NULL)
00887     {
00888       if (SHELL_OsIsUnicode())
00889       {
00890         if (lstrcmpiW((LPCWSTR)inpRegKey, strRegistryPolicyW) &&
00891             lstrcmpiW((LPCWSTR)inpRegKey, strPolicyW))
00892           /* doesn't match, fail */
00893           return 0;
00894       }
00895       else
00896       {
00897         if (lstrcmpiA((LPCSTR)inpRegKey, strRegistryPolicyA) &&
00898             lstrcmpiA((LPCSTR)inpRegKey, strPolicyA))
00899           /* doesn't match, fail */
00900           return 0;
00901       }
00902     }
00903 
00904     return TRUE;
00905 }

Generated on Fri May 25 2012 04:24:37 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.