dcomperm.h

Go to the documentation of this file.
00001 /*++
00002 
00003 DCOM Permission Configuration Sample
00004 Copyright (c) 1996, Microsoft Corporation. All rights reserved.
00005 
00006 Module Name:
00007 
00008     dcomperm.h
00009 
00010 Abstract:
00011 
00012     Include file for DCOM Permission Configuration sample
00013 
00014 Author:
00015 
00016     Michael Nelson
00017 
00018 Environment:
00019 
00020     Windows NT
00021 
00022 --*/
00023 
00024 // added for definitions and headers.
00025 #include <basis/portable.h>
00026 
00027 #define GUIDSTR_MAX 38
00028 
00029 #ifndef STR2UNI
00030 
00031 #define STR2UNI(unistr, regstr) \
00032         mbstowcs (unistr, regstr, strlen (regstr)+1);
00033 
00034 #define UNI2STR(regstr, unistr) \
00035         wcstombs (regstr, unistr, wcslen (unistr)+1);
00036 
00037 #endif
00038 
00039 
00040 //
00041 // Wrappers
00042 //
00043 
00044 DWORD
00045 ListDefaultAccessACL();
00046 
00047 DWORD
00048 ListDefaultLaunchACL();
00049 
00050 DWORD
00051 ListAppIDAccessACL (
00052     LPTSTR AppID
00053     );
00054 
00055 DWORD
00056 ListAppIDLaunchACL (
00057     LPTSTR AppID
00058     );
00059 
00060 DWORD ZapAppIDLaunchACL(LPTSTR AppID);
00061 
00062 DWORD
00063 ChangeDefaultAccessACL (
00064     LPTSTR Principal,
00065     BOOL SetPrincipal,
00066     BOOL Permit
00067     );
00068 
00069 DWORD
00070 ChangeDefaultLaunchACL (
00071     LPTSTR Principal,
00072     BOOL SetPrincipal,
00073     BOOL Permit
00074     );
00075 
00076 DWORD
00077 ChangeAppIDAccessACL (
00078     LPTSTR AppID,
00079     LPTSTR Principal,
00080     BOOL SetPrincipal,
00081     BOOL Permit
00082     );
00083 
00084 DWORD
00085 ChangeAppIDLaunchACL (
00086     LPTSTR AppID,
00087     LPTSTR Principal,
00088     BOOL SetPrincipal,
00089     BOOL Permit
00090     );
00091 
00092 DWORD GetRunAsPassword (
00093     LPTSTR AppID,
00094     LPTSTR Password
00095     );
00096 
00097 DWORD SetRunAsPassword (
00098     LPTSTR AppID,
00099     LPTSTR Principal,
00100     LPTSTR Password
00101     );
00102 
00103 DWORD GetRunAsPassword (
00104     LPTSTR AppID,
00105     LPTSTR Password
00106     );
00107 
00108 DWORD SetRunAsPassword (
00109     LPTSTR AppID,
00110     LPTSTR Password
00111     );
00112 
00113 //
00114 // Internal functions
00115 //
00116 
00117 DWORD
00118 CreateNewSD (
00119     SECURITY_DESCRIPTOR **SD,
00120     bool install_defaults = true
00121     );
00122 
00123 DWORD
00124 MakeSDAbsolute (
00125     PSECURITY_DESCRIPTOR OldSD,
00126     PSECURITY_DESCRIPTOR *NewSD
00127     );
00128 
00129 DWORD
00130 SetNamedValueSD (
00131     HKEY RootKey,
00132     LPTSTR KeyName,
00133     LPTSTR ValueName,
00134     SECURITY_DESCRIPTOR *SD
00135     );
00136 
00137 DWORD
00138 GetNamedValueSD (
00139     HKEY RootKey,
00140     LPTSTR KeyName,
00141     LPTSTR ValueName,
00142     SECURITY_DESCRIPTOR **SD,
00143     BOOL *NewSD,
00144     bool install_defaults = true
00145     );
00146 
00147 DWORD
00148 ListNamedValueSD (
00149     HKEY RootKey,
00150     LPTSTR KeyName,
00151     LPTSTR ValueName
00152     );
00153 
00154 DWORD ZapNamedValueSD(HKEY RootKey, LPTSTR KeyName, LPTSTR ValueName);
00155 
00156 DWORD
00157 AddPrincipalToNamedValueSD (
00158     HKEY RootKey,
00159     LPTSTR KeyName,
00160     LPTSTR ValueName,
00161     LPTSTR Principal,
00162     BOOL Permit,
00163     bool install_defaults = true
00164     );
00165 
00166 DWORD
00167 RemovePrincipalFromNamedValueSD (
00168     HKEY RootKey,
00169     LPTSTR KeyName,
00170     LPTSTR ValueName,
00171     LPTSTR Principal,
00172     bool install_defaults = true
00173     );
00174 
00175 DWORD
00176 GetCurrentUserSID (
00177     PSID *Sid
00178     );
00179 
00180 DWORD
00181 GetPrincipalSID (
00182     LPTSTR Principal,
00183     PSID *Sid
00184     );
00185 
00186 DWORD
00187 CopyACL (
00188     PACL OldACL,
00189     PACL NewACL
00190     );
00191 
00192 DWORD
00193 AddAccessDeniedACEToACL (
00194     PACL *Acl,
00195     DWORD PermissionMask,
00196     LPTSTR Principal
00197     );
00198 
00199 DWORD
00200 AddAccessAllowedACEToACL (
00201     PACL *Acl,
00202     DWORD PermissionMask,
00203     LPTSTR Principal
00204     );
00205 
00206 DWORD
00207 RemovePrincipalFromACL (
00208     PACL Acl,
00209     LPTSTR Principal
00210     );
00211 
00212 void
00213 ListACL (
00214     PACL Acl
00215     );
00216 
00217 DWORD
00218 SetAccountRights (
00219     LPTSTR User,
00220     LPTSTR Privilege
00221     );
00222 
00223 //
00224 // Utility Functions
00225 //
00226 
00227 LPTSTR
00228 SystemMessage (
00229     LPTSTR szBuffer,
00230     HRESULT hr
00231     );
00232 

Generated on Fri Nov 28 04:28:49 2008 for HOOPLE Libraries by  doxygen 1.5.1