本文整理汇总了C#中Microsoft.Win32.SafeHandles.SafeRegistryHandle类的典型用法代码示例。如果您正苦于以下问题:C# SafeRegistryHandle类的具体用法?C# SafeRegistryHandle怎么用?C# SafeRegistryHandle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SafeRegistryHandle类属于Microsoft.Win32.SafeHandles命名空间,在下文中一共展示了SafeRegistryHandle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: RegSetValueEx
internal static extern int RegSetValueEx(
SafeRegistryHandle hKey,
String lpValueName,
int Reserved,
RegistryValueKind dwType,
String lpData,
int cbData);
开发者ID:dotnet,项目名称:corefx,代码行数:7,代码来源:Interop.RegSetValueEx.cs
示例2: UnmapRegistryKey
static void UnmapRegistryKey(RegistryKey registryKey)
{
using (var emptyHandle = new SafeRegistryHandle(IntPtr.Zero, true))
{
Win32Api.Registry.RedirectRegistryKey(registryKey.Handle, emptyHandle);
}
}
开发者ID:DavidMoore,项目名称:Foundation,代码行数:7,代码来源:RegistryRedirector.cs
示例3: FromHandle
public IRegistryKey FromHandle(
SafeRegistryHandle handle,
RegistryView view
)
{
return new RegistryKeyWrap(RegistryKey.FromHandle(handle, view));
}
开发者ID:sign42,项目名称:SystemWrapper,代码行数:7,代码来源:RegistryKeySystem.cs
示例4: RegQueryValueEx
internal static extern int RegQueryValueEx(
SafeRegistryHandle hKey,
String lpValueName,
int[] lpReserved,
ref int lpType,
[Out]StringBuilder lpData,
ref int lpcbData);
开发者ID:dotnet,项目名称:corefx,代码行数:7,代码来源:Interop.RegQueryValueEx.cs
示例5: RegEnumKeyEx
internal unsafe static extern int RegEnumKeyEx(
SafeRegistryHandle hKey,
int dwIndex,
char* lpName,
ref int lpcbName,
int[] lpReserved,
[Out]StringBuilder lpClass,
int[] lpcbClass,
long[] lpftLastWriteTime);
开发者ID:dotnet,项目名称:corefx,代码行数:9,代码来源:Interop.RegEnumKeyEx.cs
示例6: RegEnumValue
internal static extern unsafe int RegEnumValue(
SafeRegistryHandle hKey,
int dwIndex,
char* lpValueName,
ref int lpcbValueName,
IntPtr lpReserved_MustBeZero,
int[] lpType,
byte[] lpData,
int[] lpcbData);
开发者ID:justinvp,项目名称:corert,代码行数:9,代码来源:Interop.RegEnumValue.cs
示例7: RegCreateKeyEx
internal static extern int RegCreateKeyEx(
SafeRegistryHandle hKey,
String lpSubKey,
int Reserved,
String lpClass,
int dwOptions,
int samDesired,
ref SECURITY_ATTRIBUTES secAttrs,
out SafeRegistryHandle hkResult,
out int lpdwDisposition);
开发者ID:ChuangYang,项目名称:corefx,代码行数:10,代码来源:Interop.RegCreateKeyEx.cs
示例8: RegQueryInfoKey
internal static extern int RegQueryInfoKey(
SafeRegistryHandle hKey,
[Out]StringBuilder lpClass,
int[] lpcbClass,
IntPtr lpReserved_MustBeZero,
ref int lpcSubKeys,
int[] lpcbMaxSubKeyLen,
int[] lpcbMaxClassLen,
ref int lpcValues,
int[] lpcbMaxValueNameLen,
int[] lpcbMaxValueLen,
int[] lpcbSecurityDescriptor,
int[] lpftLastWriteTime);
开发者ID:noahfalk,项目名称:corefx,代码行数:13,代码来源:Interop.RegQueryInfoKey.cs
示例9: RegistryKey
private RegistryKey(SafeRegistryHandle hkey, bool writable, bool systemkey, bool remoteKey, bool isPerfData, RegistryView view)
{
this.hkey = hkey;
this.keyName = "";
this.remoteKey = remoteKey;
this.regView = view;
if (systemkey)
{
this.state |= 2;
}
if (writable)
{
this.state |= 4;
}
if (isPerfData)
{
this.state |= 8;
}
ValidateKeyView(view);
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:20,代码来源:RegistryKey.cs
示例10: Persist
internal void Persist(SafeRegistryHandle hKey, string keyName)
{
new RegistryPermission(RegistryPermissionAccess.NoAccess, AccessControlActions.Change, keyName).Demand();
base.WriteLock();
try
{
AccessControlSections accessControlSectionsFromChanges = this.GetAccessControlSectionsFromChanges();
if (accessControlSectionsFromChanges != AccessControlSections.None)
{
bool flag;
bool flag2;
base.Persist(hKey, accessControlSectionsFromChanges);
base.AccessRulesModified = flag = false;
base.AuditRulesModified = flag2 = flag;
base.OwnerModified = base.GroupModified = flag2;
}
}
finally
{
base.WriteUnlock();
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:22,代码来源:RegistrySecurity.cs
示例11: RegistryKey
/// <summary>
/// Creates a RegistryKey.
/// This key is bound to hkey, if writable is <b>false</b> then no write operations
/// will be allowed. If systemkey is set then the hkey won't be released
/// when the object is GC'ed.
/// The remoteKey flag when set to true indicates that we are dealing with registry entries
/// on a remote machine and requires the program making these calls to have full trust.
/// </summary>
private RegistryKey(SafeRegistryHandle hkey, bool writable, bool systemkey, bool remoteKey, bool isPerfData, RegistryView view)
{
ValidateKeyView(view);
_hkey = hkey;
_keyName = "";
_remoteKey = remoteKey;
_regView = view;
if (systemkey)
{
_state |= StateFlags.SystemKey;
}
if (writable)
{
_state |= StateFlags.WriteAccess;
}
if (isPerfData)
{
_state |= StateFlags.PerfData;
}
}
开发者ID:Corillian,项目名称:corefx,代码行数:30,代码来源:RegistryKey.cs
示例12: FromHandle
public static RegistryKey FromHandle(SafeRegistryHandle handle)
{
return FromHandle(handle, RegistryView.Default);
}
开发者ID:Corillian,项目名称:corefx,代码行数:4,代码来源:RegistryKey.cs
示例13: RegistryHandler
public RegistryHandler(int hKey)
{
key_found = false;
SafeRegistryHandle safeRegistryHandle = new SafeRegistryHandle(new IntPtr(hKey), true);
root_key = RegistryKey.FromHandle(safeRegistryHandle);
}
开发者ID:elkine,项目名称:MASGAU,代码行数:6,代码来源:RegistryHandler.cs
示例14: FromHandle
public RegistryKey FromHandle (SafeRegistryHandle handle)
{
// At this point we can't tell whether the key is writable
// or not (nor the name), so we let the error check code handle it later, as
// .Net seems to do.
return new RegistryKey (handle.DangerousGetHandle (), String.Empty, true);
}
开发者ID:jack-pappas,项目名称:mono,代码行数:7,代码来源:Win32RegistryApi.cs
示例15: RedirectRegistryKey
/// <summary>
/// Override a registry hive key to another registry key.
/// </summary>
/// <param name="key">Handle of the key to override.</param>
/// <param name="newKey">Handle to override key.</param>
internal static void RedirectRegistryKey(SafeRegistryHandle key, SafeRegistryHandle newKey)
{
if (0 != RegOverridePredefKey(key, newKey))
{
throw new Exception();
}
}
开发者ID:DavidMoore,项目名称:ipfilter,代码行数:12,代码来源:Win32Api.cs
示例16: RegOpenKeyEx
internal static extern int RegOpenKeyEx(IntPtr hKey, String lpSubKey,
int ulOptions, int samDesired, out SafeRegistryHandle hkResult);
开发者ID:Clockwork-Muse,项目名称:coreclr,代码行数:2,代码来源:Win32Native.cs
示例17: FromHandle
public static RegistryKey FromHandle (SafeRegistryHandle handle)
{
if (handle == null)
throw new ArgumentNullException ("handle");
return RegistryApi.FromHandle (handle);
}
开发者ID:Profit0004,项目名称:mono,代码行数:7,代码来源:RegistryKey.cs
示例18: RegDeleteKey
internal static extern int RegDeleteKey(SafeRegistryHandle hKey, String lpSubKey);
开发者ID:Clockwork-Muse,项目名称:coreclr,代码行数:1,代码来源:Win32Native.cs
示例19: RegDeleteKeyEx
internal static extern int RegDeleteKeyEx(SafeRegistryHandle hKey, String lpSubKey,
int samDesired, int Reserved);
开发者ID:Clockwork-Muse,项目名称:coreclr,代码行数:2,代码来源:Win32Native.cs
示例20: RegOverridePredefKey
static extern int RegOverridePredefKey(SafeRegistryHandle key, SafeRegistryHandle newKey);
开发者ID:DavidMoore,项目名称:ipfilter,代码行数:1,代码来源:Win32Api.cs
注:本文中的Microsoft.Win32.SafeHandles.SafeRegistryHandle类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论