|
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
#pragma warning disable CS1591,CS1573,CS0465,CS0649,CS8019,CS1570,CS1584,CS1658,CS0436,CS8981
using global::System;
using global::System.Diagnostics;
using global::System.Diagnostics.CodeAnalysis;
using global::System.Runtime.CompilerServices;
using global::System.Runtime.InteropServices;
using global::System.Runtime.Versioning;
using winmdroot = global::Windows.Win32;
namespace Windows.Win32
{
/// <content>
/// Contains extern methods from "ADVAPI32.dll".
/// </content>
internal static partial class PInvoke
{
/// <summary>Closes a handle to the specified registry key.</summary>
/// <param name="hKey">
/// <para>A handle to the open key to be closed. The handle must have been opened by the <a href="https://docs.microsoft.com/windows/desktop/api/winreg/nf-winreg-regcreatekeyexa">RegCreateKeyEx</a>, <a href="https://docs.microsoft.com/windows/desktop/api/winreg/nf-winreg-regcreatekeytransacteda">RegCreateKeyTransacted</a>, <a href="https://docs.microsoft.com/windows/desktop/api/winreg/nf-winreg-regopenkeyexa">RegOpenKeyEx</a>, <a href="https://docs.microsoft.com/windows/desktop/api/winreg/nf-winreg-regopenkeytransacteda">RegOpenKeyTransacted</a>, or <a href="https://docs.microsoft.com/windows/desktop/api/winreg/nf-winreg-regconnectregistrya">RegConnectRegistry</a> function.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winreg/nf-winreg-regclosekey#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <returns>
/// <para>If the function succeeds, the return value is ERROR_SUCCESS. If the function fails, the return value is a nonzero error code defined in Winerror.h. You can use the <a href="https://docs.microsoft.com/windows/desktop/api/winbase/nf-winbase-formatmessage">FormatMessage</a> function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.</para>
/// </returns>
/// <remarks>
/// <para>The handle for a specified key should not be used after it has been closed, because it will no longer be valid. Key handles should not be left open any longer than necessary. The <b>RegCloseKey</b> function does not necessarily write information to the registry before returning; it can take as much as several seconds for the cache to be flushed to the hard disk. If an application must explicitly write registry information to the hard disk, it can use the <a href="https://docs.microsoft.com/windows/desktop/api/winreg/nf-winreg-regflushkey">RegFlushKey</a> function. <b>RegFlushKey</b>, however, uses many system resources and should be called only when necessary.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winreg/nf-winreg-regclosekey#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
[DllImport("ADVAPI32.dll", ExactSpelling = true),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
[SupportedOSPlatform("windows5.0")]
internal static extern winmdroot.Foundation.WIN32_ERROR RegCloseKey(winmdroot.System.Registry.HKEY hKey);
/// <inheritdoc cref="RegLoadMUIString(winmdroot.System.Registry.HKEY, winmdroot.Foundation.PCWSTR, winmdroot.Foundation.PWSTR, uint, uint*, uint, winmdroot.Foundation.PCWSTR)"/>
[SupportedOSPlatform("windows6.0.6000")]
internal static unsafe winmdroot.Foundation.WIN32_ERROR RegLoadMUIString(winmdroot.System.Registry.HKEY hKey, string pszValue, winmdroot.Foundation.PWSTR pszOutBuf, uint cbOutBuf, uint* pcbData, uint Flags, string pszDirectory)
{
fixed (char* pszDirectoryLocal = pszDirectory)
{
fixed (char* pszValueLocal = pszValue)
{
winmdroot.Foundation.WIN32_ERROR __result = PInvoke.RegLoadMUIString(hKey, pszValueLocal, pszOutBuf, cbOutBuf, pcbData, Flags, pszDirectoryLocal);
return __result;
}
}
}
/// <summary>Loads the specified string from the specified key and subkey. (Unicode)</summary>
/// <param name="hKey">
/// <para>A handle to an open registry key. The key must have been opened with the KEY_QUERY_VALUE access right. For more information, see <a href="https://docs.microsoft.com/windows/desktop/SysInfo/registry-key-security-and-access-rights">Registry Key Security and Access Rights</a>. This handle is returned by the <a href="https://docs.microsoft.com/windows/desktop/api/winreg/nf-winreg-regcreatekeyexa">RegCreateKeyEx</a> or <a href="https://docs.microsoft.com/windows/desktop/api/winreg/nf-winreg-regopenkeyexa">RegOpenKeyEx</a> function. It can also be one of the following <a href="https://docs.microsoft.com/windows/desktop/SysInfo/predefined-keys">predefined keys</a>:<dl> <dd><b>HKEY_CLASSES_ROOT</b></dd> <dd><b>HKEY_CURRENT_CONFIG</b></dd> <dd><b>HKEY_CURRENT_USER</b></dd> <dd><b>HKEY_LOCAL_MACHINE</b></dd> <dd><b>HKEY_USERS</b></dd> </dl></para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winreg/nf-winreg-regloadmuistringw#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="pszValue">The name of the registry value.</param>
/// <param name="pszOutBuf">
/// <para>A pointer to a buffer that receives the string. Strings of the following form receive special handling: @[<i>path</i>]\<i>dllname</i>,-<i>strID</i> The string with identifier <i>strID</i> is loaded from <i>dllname</i>; the <i>path</i> is optional. If the <i>pszDirectory</i> parameter is not <b>NULL</b>, the directory is prepended to the path specified in the registry data. Note that <i>dllname</i> can contain environment variables to be expanded.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winreg/nf-winreg-regloadmuistringw#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="cbOutBuf">The size of the <i>pszOutBuf</i> buffer, in bytes.</param>
/// <param name="pcbData">
/// <para>A pointer to a variable that receives the size of the data copied to the <i>pszOutBuf</i> buffer, in bytes. If the buffer is not large enough to hold the data, the function returns ERROR_MORE_DATA and stores the required buffer size in the variable pointed to by <i>pcbData</i>. In this case, the contents of the buffer are undefined.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winreg/nf-winreg-regloadmuistringw#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="Flags">
/// <para>This parameter can be 0 or the following value. </para>
/// <para>This doc was truncated.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winreg/nf-winreg-regloadmuistringw#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="pszDirectory">The directory path.</param>
/// <returns>
/// <para>If the function succeeds, the return value is ERROR_SUCCESS. If the function fails, the return value is a <a href="https://docs.microsoft.com/windows/desktop/Debug/system-error-codes">system error code</a>. If the <i>pcbData</i> buffer is too small to receive the string, the function returns ERROR_MORE_DATA. The ANSI version of this function returns ERROR_CALL_NOT_IMPLEMENTED.</para>
/// </returns>
/// <remarks>
/// <para>The <b>RegLoadMUIString</b> function is supported only for Unicode. Although both Unicode (W) and ANSI (A) versions of this function are declared, the <b>RegLoadMUIStringA</b> function returns ERROR_CALL_NOT_IMPLEMENTED. Applications should explicitly call <b>RegLoadMUIStringW</b> or specify Unicode as the character set in platform invoke (PInvoke) calls. To compile an application that uses this function, define _WIN32_WINNT as 0x0600 or later. For more information, see <a href="https://docs.microsoft.com/windows/desktop/WinProg/using-the-windows-headers">Using the Windows Headers</a>.</para>
/// <para>> [!NOTE] > The winreg.h header defines RegLoadMUIString as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see [Conventions for Function Prototypes](/windows/win32/intl/conventions-for-function-prototypes).</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winreg/nf-winreg-regloadmuistringw#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
[DllImport("ADVAPI32.dll", ExactSpelling = true, EntryPoint = "RegLoadMUIStringW"),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
[SupportedOSPlatform("windows6.0.6000")]
internal static extern unsafe winmdroot.Foundation.WIN32_ERROR RegLoadMUIString(winmdroot.System.Registry.HKEY hKey, winmdroot.Foundation.PCWSTR pszValue, winmdroot.Foundation.PWSTR pszOutBuf, uint cbOutBuf, [Optional] uint* pcbData, uint Flags, winmdroot.Foundation.PCWSTR pszDirectory);
}
}
|