#ifndef _WINREG_
#define _WINREG_
#include <winapifamily.h>
#include <apiset.h>
#include <apisetcconv.h>
#include <minwindef.h>
#include <minwinbase.h>
#ifdef _MAC
#include <macwin32.h>
#endif
#ifdef __cplusplus
extern
"C"
{
#endif
#if _MSC_VER >= 1200
#pragma warning(push)
#pragma warning(disable:4820) // padding added after data member
#endif
#pragma warning(disable:
4820
)
#pragma region Application Family or Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#ifndef WINVER
#define WINVER 0x0500 // version 5.0
#endif /* !WINVER */
typedef _Return_type_success_(return==ERROR_SUCCESS) LONG LSTATUS;
#define RRF_RT_REG_NONE 0x00000001 // restrict type to REG_NONE (other data types will not return ERROR_SUCCESS)
#define RRF_RT_REG_SZ 0x00000002 // restrict type to REG_SZ (other data types will not return ERROR_SUCCESS) (automatically converts REG_EXPAND_SZ to REG_SZ unless RRF_NOEXPAND is specified)
#define RRF_RT_REG_EXPAND_SZ 0x00000004 // restrict type to REG_EXPAND_SZ (other data types will not return ERROR_SUCCESS) (must specify RRF_NOEXPAND or RegGetValue will fail with ERROR_INVALID_PARAMETER)
#define RRF_RT_REG_BINARY 0x00000008 // restrict type to REG_BINARY (other data types will not return ERROR_SUCCESS)
#define RRF_RT_REG_DWORD 0x00000010 // restrict type to REG_DWORD (other data types will not return ERROR_SUCCESS)
#define RRF_RT_REG_MULTI_SZ 0x00000020 // restrict type to REG_MULTI_SZ (other data types will not return ERROR_SUCCESS)
#define RRF_RT_REG_QWORD 0x00000040 // restrict type to REG_QWORD (other data types will not return ERROR_SUCCESS)
#define RRF_RT_DWORD (RRF_RT_REG_BINARY | RRF_RT_REG_DWORD) // restrict type to *32-bit* RRF_RT_REG_BINARY or RRF_RT_REG_DWORD (other data types will not return ERROR_SUCCESS)
#define RRF_RT_QWORD (RRF_RT_REG_BINARY | RRF_RT_REG_QWORD) // restrict type to *64-bit* RRF_RT_REG_BINARY or RRF_RT_REG_DWORD (other data types will not return ERROR_SUCCESS)
#define RRF_RT_ANY 0x0000ffff // no type restriction
#if (_WIN32_WINNT >= _WIN32_WINNT_WINTHRESHOLD)
#define RRF_SUBKEY_WOW6464KEY 0x00010000 // when opening the subkey (if provided) force open from the 64bit location (only one SUBKEY_WOW64* flag can be set or RegGetValue will fail with ERROR_INVALID_PARAMETER)
#define RRF_SUBKEY_WOW6432KEY 0x00020000 // when opening the subkey (if provided) force open from the 32bit location (only one SUBKEY_WOW64* flag can be set or RegGetValue will fail with ERROR_INVALID_PARAMETER)
#define RRF_WOW64_MASK 0x00030000
#endif
#define RRF_NOEXPAND 0x10000000 // do not automatically expand environment strings if value is of type REG_EXPAND_SZ
#define RRF_ZEROONFAILURE 0x20000000 // if pvData is not NULL, set content to all zeros on failure
#define REG_PROCESS_APPKEY 0x00000001
typedef
;
#define HKEY_CLASSES_ROOT (( HKEY ) (ULONG_PTR)((LONG)0x80000000) )
#define HKEY_CURRENT_USER (( HKEY ) (ULONG_PTR)((LONG)0x80000001) )
#define HKEY_LOCAL_MACHINE (( HKEY ) (ULONG_PTR)((LONG)0x80000002) )
#define HKEY_USERS (( HKEY ) (ULONG_PTR)((LONG)0x80000003) )
#define HKEY_PERFORMANCE_DATA (( HKEY ) (ULONG_PTR)((LONG)0x80000004) )
#define HKEY_PERFORMANCE_TEXT (( HKEY ) (ULONG_PTR)((LONG)0x80000050) )
#define HKEY_PERFORMANCE_NLSTEXT (( HKEY ) (ULONG_PTR)((LONG)0x80000060) )
#if (WINVER >= 0x0400)
#define HKEY_CURRENT_CONFIG (( HKEY ) (ULONG_PTR)((LONG)0x80000005) )
#define HKEY_DYN_DATA (( HKEY ) (ULONG_PTR)((LONG)0x80000006) )
#define HKEY_CURRENT_USER_LOCAL_SETTINGS (( HKEY ) (ULONG_PTR)((LONG)0x80000007) )
#ifndef _PROVIDER_STRUCTS_DEFINED
#define _PROVIDER_STRUCTS_DEFINED
#define PROVIDER_KEEPS_VALUE_LENGTH 0x1
struct
{
int
;
;
;
};
typedef struct val_context FAR *PVALCONTEXT;
typedef
struct
{
;
int
;
;
;
typedef
struct
{
;
int
;
;
;
#ifdef UNICODE
typedef
;
typedef
;
#else
typedef PVALUEA PVALUE;
typedef PPVALUEA PPVALUE;
#endif // UNICODE
typedef
__cdecl
(
keycontext,
val_list,
num_vals,
LPVOID outputbuffer, DWORD FAR *total_outlen, DWORD input_blen);
outputbuffer,
*total_outlen,
input_blen);
typedef QUERYHANDLER FAR *PQUERYHANDLER;
typedef
struct
{
;
;
;
;
;
;
}
;
typedef struct provider_info FAR *PPROVIDER;
typedef
struct
{
;
;
;
;
typedef
struct
{
;
;
;
;
#ifdef UNICODE
typedef
;
typedef
;
#else
typedef VALENTA VALENT;
typedef PVALENTA PVALENT;
#endif // UNICODE
#endif // not(_PROVIDER_STRUCTS_DEFINED)
#endif /* WINVER >= 0x0400 */
#define WIN31_CLASS NULL
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#pragma region Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#define REG_MUI_STRING_TRUNCATE 0x00000001
#if (WINVER >= 0x0400)
#define REG_SECURE_CONNECTION 1
#endif /* WINVER >= 0x0400 */
(
);
(
);
(
_Reserved_ DWORD dwOptions,
);
(
);
RegDisablePredefinedCache
(
);
RegDisablePredefinedCacheEx
(
);
(
_In_opt_ LPCSTR lpMachineName,
);
(
_In_opt_ LPCWSTR lpMachineName,
);
#ifdef UNICODE
#define RegConnectRegistry RegConnectRegistryW
#else
#define RegConnectRegistry RegConnectRegistryA
#endif // !UNICODE
(
_In_opt_ LPCSTR lpMachineName,
);
(
_In_opt_ LPCWSTR lpMachineName,
);
#ifdef UNICODE
#define RegConnectRegistryEx RegConnectRegistryExW
#else
#define RegConnectRegistryEx RegConnectRegistryExA
#endif // !UNICODE
(
_In_opt_ LPCSTR lpSubKey,
);
(
_In_opt_ LPCWSTR lpSubKey,
);
#ifdef UNICODE
#define RegCreateKey RegCreateKeyW
#else
#define RegCreateKey RegCreateKeyA
#endif // !UNICODE
(
_Reserved_ DWORD Reserved,
_In_opt_ CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes,
_Out_opt_ LPDWORD lpdwDisposition
);
(
_Reserved_ DWORD Reserved,
_In_opt_ CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes,
_Out_opt_ LPDWORD lpdwDisposition
);
#ifdef UNICODE
#define RegCreateKeyEx RegCreateKeyExW
#else
#define RegCreateKeyEx RegCreateKeyExA
#endif // !UNICODE
(
_Reserved_ DWORD Reserved,
_In_opt_ CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes,
_Out_opt_ LPDWORD lpdwDisposition,
_In_ HANDLE hTransaction,
_Reserved_ PVOID pExtendedParemeter
);
(
_Reserved_ DWORD Reserved,
_In_opt_ CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes,
_Out_opt_ LPDWORD lpdwDisposition,
_In_ HANDLE hTransaction,
_Reserved_ PVOID pExtendedParemeter
);
#ifdef UNICODE
#define RegCreateKeyTransacted RegCreateKeyTransactedW
#else
#define RegCreateKeyTransacted RegCreateKeyTransactedA
#endif // !UNICODE
(
);
(
);
#ifdef UNICODE
#define RegDeleteKey RegDeleteKeyW
#else
#define RegDeleteKey RegDeleteKeyA
#endif // !UNICODE
(
_Reserved_ DWORD Reserved
);
(
_Reserved_ DWORD Reserved
);
#ifdef UNICODE
#define RegDeleteKeyEx RegDeleteKeyExW
#else
#define RegDeleteKeyEx RegDeleteKeyExA
#endif // !UNICODE
(
_Reserved_ DWORD Reserved,
_In_ HANDLE hTransaction,
_Reserved_ PVOID pExtendedParameter
);
(
_Reserved_ DWORD Reserved,
_In_ HANDLE hTransaction,
_Reserved_ PVOID pExtendedParameter
);
#ifdef UNICODE
#define RegDeleteKeyTransacted RegDeleteKeyTransactedW
#else
#define RegDeleteKeyTransacted RegDeleteKeyTransactedA
#endif // !UNICODE
(
);
(
);
(
_Out_ BOOL *bIsReflectionDisabled
);
(
_In_opt_ LPCSTR lpValueName
);
(
_In_opt_ LPCWSTR lpValueName
);
#ifdef UNICODE
#define RegDeleteValue RegDeleteValueW
#else
#define RegDeleteValue RegDeleteValueA
#endif // !UNICODE
(
_Out_writes_opt_(cchName) LPSTR lpName,
);
(
_Out_writes_opt_(cchName) LPWSTR lpName,
);
#ifdef UNICODE
#define RegEnumKey RegEnumKeyW
#else
#define RegEnumKey RegEnumKeyA
#endif // !UNICODE
(
_Out_writes_to_opt_(*lpcchName,*lpcchName + 1) LPSTR lpName,
_Inout_ LPDWORD lpcchName,
_Reserved_ LPDWORD lpReserved,
_Out_writes_to_opt_(*lpcchClass,*lpcchClass + 1) LPSTR lpClass,
_Inout_opt_ LPDWORD lpcchClass,
_Out_opt_ PFILETIME lpftLastWriteTime
);
(
_Out_writes_to_opt_(*lpcchName,*lpcchName + 1) LPWSTR lpName,
_Inout_ LPDWORD lpcchName,
_Reserved_ LPDWORD lpReserved,
_Out_writes_to_opt_(*lpcchClass,*lpcchClass + 1) LPWSTR lpClass,
_Inout_opt_ LPDWORD lpcchClass,
_Out_opt_ PFILETIME lpftLastWriteTime
);
#ifdef UNICODE
#define RegEnumKeyEx RegEnumKeyExW
#else
#define RegEnumKeyEx RegEnumKeyExA
#endif // !UNICODE
(
_Out_writes_to_opt_(*lpcchValueName,*lpcchValueName + 1) LPSTR lpValueName,
_Inout_ LPDWORD lpcchValueName,
_Reserved_ LPDWORD lpReserved,
_Out_opt_ LPDWORD lpType,
_Out_writes_bytes_to_opt_(*lpcbData, *lpcbData) __out_data_source(REGISTRY) LPBYTE lpData,
_Inout_opt_ LPDWORD lpcbData
);
(
_Out_writes_to_opt_(*lpcchValueName,*lpcchValueName + 1) LPWSTR lpValueName,
_Inout_ LPDWORD lpcchValueName,
_Reserved_ LPDWORD lpReserved,
_Out_opt_ LPDWORD lpType,
_Out_writes_bytes_to_opt_(*lpcbData, *lpcbData) __out_data_source(REGISTRY) LPBYTE lpData,
_Inout_opt_ LPDWORD lpcbData
);
#ifdef UNICODE
#define RegEnumValue RegEnumValueW
#else
#define RegEnumValue RegEnumValueA
#endif // !UNICODE
(
);
(
_In_ SECURITY_INFORMATION SecurityInformation,
_Out_writes_bytes_opt_(*lpcbSecurityDescriptor) PSECURITY_DESCRIPTOR pSecurityDescriptor,
_Inout_ LPDWORD lpcbSecurityDescriptor
);
(
_In_opt_ LPCSTR lpSubKey,
);
(
_In_opt_ LPCWSTR lpSubKey,
);
#ifdef UNICODE
#define RegLoadKey RegLoadKeyW
#else
#define RegLoadKey RegLoadKeyA
#endif // !UNICODE
(
_In_ DWORD dwNotifyFilter,
);
(
_In_opt_ LPCSTR lpSubKey,
);
(
_In_opt_ LPCWSTR lpSubKey,
);
#ifdef UNICODE
#define RegOpenKey RegOpenKeyW
#else
#define RegOpenKey RegOpenKeyA
#endif // !UNICODE
(
_In_opt_ LPCSTR lpSubKey,
_In_opt_ DWORD ulOptions,
);
(
_In_opt_ LPCWSTR lpSubKey,
_In_opt_ DWORD ulOptions,
);
#ifdef UNICODE
#define RegOpenKeyEx RegOpenKeyExW
#else
#define RegOpenKeyEx RegOpenKeyExA
#endif // !UNICODE
(
_In_opt_ LPCSTR lpSubKey,
_In_opt_ DWORD ulOptions,
_In_ HANDLE hTransaction,
_Reserved_ PVOID pExtendedParemeter
);
(
_In_opt_ LPCWSTR lpSubKey,
_In_opt_ DWORD ulOptions,
_In_ HANDLE hTransaction,
_Reserved_ PVOID pExtendedParemeter
);
#ifdef UNICODE
#define RegOpenKeyTransacted RegOpenKeyTransactedW
#else
#define RegOpenKeyTransacted RegOpenKeyTransactedA
#endif // !UNICODE
(
_Out_writes_to_opt_(*lpcchClass,*lpcchClass + 1) LPSTR lpClass,
_Inout_opt_ LPDWORD lpcchClass,
_Reserved_ LPDWORD lpReserved,
_Out_opt_ LPDWORD lpcSubKeys,
_Out_opt_ LPDWORD lpcbMaxSubKeyLen,
_Out_opt_ LPDWORD lpcbMaxClassLen,
_Out_opt_ LPDWORD lpcValues,
_Out_opt_ LPDWORD lpcbMaxValueNameLen,
_Out_opt_ LPDWORD lpcbMaxValueLen,
_Out_opt_ LPDWORD lpcbSecurityDescriptor,
_Out_opt_ PFILETIME lpftLastWriteTime
);
(
_Out_writes_to_opt_(*lpcchClass,*lpcchClass + 1) LPWSTR lpClass,
_Inout_opt_ LPDWORD lpcchClass,
_Reserved_ LPDWORD lpReserved,
_Out_opt_ LPDWORD lpcSubKeys,
_Out_opt_ LPDWORD lpcbMaxSubKeyLen,
_Out_opt_ LPDWORD lpcbMaxClassLen,
_Out_opt_ LPDWORD lpcValues,
_Out_opt_ LPDWORD lpcbMaxValueNameLen,
_Out_opt_ LPDWORD lpcbMaxValueLen,
_Out_opt_ LPDWORD lpcbSecurityDescriptor,
_Out_opt_ PFILETIME lpftLastWriteTime
);
#ifdef UNICODE
#define RegQueryInfoKey RegQueryInfoKeyW
#else
#define RegQueryInfoKey RegQueryInfoKeyA
#endif // !UNICODE
(
_In_opt_ LPCSTR lpSubKey,
_Out_writes_bytes_to_opt_(*lpcbData, *lpcbData) __out_data_source(REGISTRY) LPSTR lpData,
_Inout_opt_ PLONG lpcbData
);
(
_In_opt_ LPCWSTR lpSubKey,
_Out_writes_bytes_to_opt_(*lpcbData, *lpcbData) __out_data_source(REGISTRY) LPWSTR lpData,
_Inout_opt_ PLONG lpcbData
);
#ifdef UNICODE
#define RegQueryValue RegQueryValueW
#else
#define RegQueryValue RegQueryValueA
#endif // !UNICODE
#if (WINVER >= 0x0400)
(
_Out_writes_(num_vals) PVALENTA val_list,
_Out_writes_bytes_to_opt_(*ldwTotsize, *ldwTotsize) __out_data_source(REGISTRY) LPSTR lpValueBuf,
_Inout_opt_ LPDWORD ldwTotsize
);
(
_Out_writes_(num_vals) PVALENTW val_list,
_Out_writes_bytes_to_opt_(*ldwTotsize, *ldwTotsize) __out_data_source(REGISTRY) LPWSTR lpValueBuf,
_Inout_opt_ LPDWORD ldwTotsize
);
#ifdef UNICODE
#define RegQueryMultipleValues RegQueryMultipleValuesW
#else
#define RegQueryMultipleValues RegQueryMultipleValuesA
#endif // !UNICODE
#endif /* WINVER >= 0x0400 */
(
_In_opt_ LPCSTR lpValueName,
_Reserved_ LPDWORD lpReserved,
_Out_opt_ LPDWORD lpType,
_Out_writes_bytes_to_opt_(*lpcbData, *lpcbData) __out_data_source(REGISTRY) LPBYTE lpData,
_When_(lpData == NULL,_Out_opt_) _When_(lpData != NULL,_Inout_opt_) LPDWORD lpcbData
);
(
_In_opt_ LPCWSTR lpValueName,
_Reserved_ LPDWORD lpReserved,
_Out_opt_ LPDWORD lpType,
_Out_writes_bytes_to_opt_(*lpcbData, *lpcbData) __out_data_source(REGISTRY) LPBYTE lpData,
_When_(lpData == NULL,_Out_opt_) _When_(lpData != NULL,_Inout_opt_) LPDWORD lpcbData
);
#ifdef UNICODE
#define RegQueryValueEx RegQueryValueExW
#else
#define RegQueryValueEx RegQueryValueExA
#endif // !UNICODE
(
_In_opt_ LPCSTR lpSubKey,
);
(
_In_opt_ LPCWSTR lpSubKey,
);
#ifdef UNICODE
#define RegReplaceKey RegReplaceKeyW
#else
#define RegReplaceKey RegReplaceKeyA
#endif // !UNICODE
(
);
(
);
#ifdef UNICODE
#define RegRestoreKey RegRestoreKeyW
#else
#define RegRestoreKey RegRestoreKeyA
#endif // !UNICODE
#if (WINVER >= 0x0600)
(
_In_opt_ LPCWSTR lpSubKeyName,
_In_ LPCWSTR lpNewKeyName
);
#endif /* WINVER >= 0x0600 */
(
_In_opt_ CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes
);
(
_In_opt_ CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes
);
#ifdef UNICODE
#define RegSaveKey RegSaveKeyW
#else
#define RegSaveKey RegSaveKeyA
#endif // !UNICODE
(
_In_ SECURITY_INFORMATION SecurityInformation,
_In_ PSECURITY_DESCRIPTOR pSecurityDescriptor
);
(
_In_opt_ LPCSTR lpSubKey,
_In_reads_bytes_opt_(cbData) LPCSTR lpData,
);
(
_In_opt_ LPCWSTR lpSubKey,
_In_reads_bytes_opt_(cbData) LPCWSTR lpData,
);
#ifdef UNICODE
#define RegSetValue RegSetValueW
#else
#define RegSetValue RegSetValueA
#endif // !UNICODE
(
_In_opt_ LPCSTR lpValueName,
_Reserved_ DWORD Reserved,
_In_reads_bytes_opt_(cbData) CONST BYTE* lpData,
);
(
_In_opt_ LPCWSTR lpValueName,
_Reserved_ DWORD Reserved,
_In_reads_bytes_opt_(cbData) CONST BYTE* lpData,
);
#ifdef UNICODE
#define RegSetValueEx RegSetValueExW
#else
#define RegSetValueEx RegSetValueExA
#endif // !UNICODE
(
);
(
_In_opt_ LPCWSTR lpSubKey
);
#ifdef UNICODE
#define RegUnLoadKey RegUnLoadKeyW
#else
#define RegUnLoadKey RegUnLoadKeyA
#endif // !UNICODE
#if _WIN32_WINNT >= 0x0600
(
_In_opt_ LPCSTR lpSubKey,
_In_opt_ LPCSTR lpValueName
);
(
_In_opt_ LPCWSTR lpSubKey,
_In_opt_ LPCWSTR lpValueName
);
#ifdef UNICODE
#define RegDeleteKeyValue RegDeleteKeyValueW
#else
#define RegDeleteKeyValue RegDeleteKeyValueA
#endif // !UNICODE
(
_In_opt_ LPCSTR lpSubKey,
_In_opt_ LPCSTR lpValueName,
_In_reads_bytes_opt_(cbData) LPCVOID lpData,
);
(
_In_opt_ LPCWSTR lpSubKey,
_In_opt_ LPCWSTR lpValueName,
_In_reads_bytes_opt_(cbData) LPCVOID lpData,
);
#ifdef UNICODE
#define RegSetKeyValue RegSetKeyValueW
#else
#define RegSetKeyValue RegSetKeyValueA
#endif // !UNICODE
(
);
(
_In_opt_ LPCWSTR lpSubKey
);
#ifdef UNICODE
#define RegDeleteTree RegDeleteTreeW
#else
#define RegDeleteTree RegDeleteTreeA
#endif // !UNICODE
(
_In_opt_ LPCSTR lpSubKey,
);
#ifndef UNICODE
#define RegCopyTree RegCopyTreeA
#endif // !UNICODE
#endif // _WIN32_WINNT >= 0x0600
#if (_WIN32_WINNT >= 0x0502)
(
_In_opt_ LPCSTR lpSubKey,
_Out_opt_ LPDWORD pdwType,
_When_((dwFlags & 0x7F) == RRF_RT_REG_SZ ||
(dwFlags & 0x7F) == RRF_RT_REG_EXPAND_SZ ||
(dwFlags & 0x7F) == (RRF_RT_REG_SZ | RRF_RT_REG_EXPAND_SZ) ||
*pdwType == REG_SZ ||
*pdwType == REG_EXPAND_SZ, _Post_z_)
_When_((dwFlags & 0x7F) == RRF_RT_REG_MULTI_SZ ||
*pdwType == REG_MULTI_SZ, _Post_ _NullNull_terminated_)
_Out_writes_bytes_to_opt_(*pcbData,*pcbData) PVOID pvData,
_Inout_opt_ LPDWORD pcbData
);
(
_In_opt_ LPCWSTR lpSubKey,
_In_opt_ LPCWSTR lpValue,
_Out_opt_ LPDWORD pdwType,
_When_((dwFlags & 0x7F) == RRF_RT_REG_SZ ||
(dwFlags & 0x7F) == RRF_RT_REG_EXPAND_SZ ||
(dwFlags & 0x7F) == (RRF_RT_REG_SZ | RRF_RT_REG_EXPAND_SZ) ||
*pdwType == REG_SZ ||
*pdwType == REG_EXPAND_SZ, _Post_z_)
_When_((dwFlags & 0x7F) == RRF_RT_REG_MULTI_SZ ||
*pdwType == REG_MULTI_SZ, _Post_ _NullNull_terminated_)
_Out_writes_bytes_to_opt_(*pcbData,*pcbData) PVOID pvData,
_Inout_opt_ LPDWORD pcbData
);
#ifdef UNICODE
#define RegGetValue RegGetValueW
#else
#define RegGetValue RegGetValueA
#endif // !UNICODE
#endif // (_WIN32_WINNT >= 0x0502)
#if (_WIN32_WINNT >= 0x0600)
(
_In_opt_ LPCWSTR lpSubKey,
);
#ifdef UNICODE
#define RegCopyTree RegCopyTreeW
#endif
(
_In_opt_ LPCSTR pszValue,
_Out_writes_bytes_opt_(cbOutBuf) LPSTR pszOutBuf,
_Out_opt_ LPDWORD pcbData,
_In_opt_ LPCSTR pszDirectory
);
(
_In_opt_ LPCWSTR pszValue,
_Out_writes_bytes_opt_(cbOutBuf) LPWSTR pszOutBuf,
_Out_opt_ LPDWORD pcbData,
_In_opt_ LPCWSTR pszDirectory
);
#ifdef UNICODE
#define RegLoadMUIString RegLoadMUIStringW
#else
#define RegLoadMUIString RegLoadMUIStringA
#endif // !UNICODE
(
_Reserved_ DWORD Reserved
);
(
_Reserved_ DWORD Reserved
);
#ifdef UNICODE
#define RegLoadAppKey RegLoadAppKeyW
#else
#define RegLoadAppKey RegLoadAppKeyA
#endif // !UNICODE
#endif // _WIN32_WINNT >= 0x0600
__drv_preferredFunction("InitiateSystemShutdownEx", "Legacy API. Rearchitect to avoid Reboot")
(
_In_opt_ LPSTR lpMachineName,
_In_opt_ LPSTR lpMessage,
_In_ BOOL bForceAppsClosed,
_In_ BOOL bRebootAfterShutdown
);
__drv_preferredFunction("InitiateSystemShutdownEx", "Legacy API. Rearchitect to avoid Reboot")
(
_In_opt_ LPWSTR lpMachineName,
_In_opt_ LPWSTR lpMessage,
_In_ BOOL bForceAppsClosed,
_In_ BOOL bRebootAfterShutdown
);
#ifdef UNICODE
#define InitiateSystemShutdown InitiateSystemShutdownW
#else
#define InitiateSystemShutdown InitiateSystemShutdownA
#endif // !UNICODE
(
_In_opt_ LPSTR lpMachineName
);
(
_In_opt_ LPWSTR lpMachineName
);
#ifdef UNICODE
#define AbortSystemShutdown AbortSystemShutdownW
#else
#define AbortSystemShutdown AbortSystemShutdownA
#endif // !UNICODE
#include <reason.h> // get the public reasons
#define REASON_SWINSTALL (SHTDN_REASON_MAJOR_SOFTWARE|SHTDN_REASON_MINOR_INSTALLATION)
#define REASON_HWINSTALL (SHTDN_REASON_MAJOR_HARDWARE|SHTDN_REASON_MINOR_INSTALLATION)
#define REASON_SERVICEHANG (SHTDN_REASON_MAJOR_SOFTWARE|SHTDN_REASON_MINOR_HUNG)
#define REASON_UNSTABLE (SHTDN_REASON_MAJOR_SYSTEM|SHTDN_REASON_MINOR_UNSTABLE)
#define REASON_SWHWRECONF (SHTDN_REASON_MAJOR_SOFTWARE|SHTDN_REASON_MINOR_RECONFIG)
#define REASON_OTHER (SHTDN_REASON_MAJOR_OTHER|SHTDN_REASON_MINOR_OTHER)
#define REASON_UNKNOWN SHTDN_REASON_UNKNOWN
#define REASON_LEGACY_API SHTDN_REASON_LEGACY_API
#define REASON_PLANNED_FLAG SHTDN_REASON_FLAG_PLANNED
#define MAX_SHUTDOWN_TIMEOUT (10*365*24*60*60)
__drv_preferredFunction("a design alternative", "Rearchitect to avoid Reboot")
_When_(((dwReason==0 && lpMessage==0)) || dwReason>=0xd0000000,
__drv_reportError("Requires a valid dwReason or lpMessage"))
InitiateSystemShutdownExA
(
_In_opt_ LPSTR lpMachineName,
_In_opt_ LPSTR lpMessage,
_In_ BOOL bForceAppsClosed,
_In_ BOOL bRebootAfterShutdown,
);
__drv_preferredFunction("a design alternative", "Rearchitect to avoid Reboot")
_When_(((dwReason==0 && lpMessage==0)) || dwReason>=0xd0000000,
__drv_reportError("Requires a valid dwReason or lpMessage"))
InitiateSystemShutdownExW
(
_In_opt_ LPWSTR lpMachineName,
_In_opt_ LPWSTR lpMessage,
_In_ BOOL bForceAppsClosed,
_In_ BOOL bRebootAfterShutdown,
);
#ifdef UNICODE
#define InitiateSystemShutdownEx InitiateSystemShutdownExW
#else
#define InitiateSystemShutdownEx InitiateSystemShutdownExA
#endif // !UNICODE
#define SHUTDOWN_FORCE_OTHERS 0x00000001
#define SHUTDOWN_FORCE_SELF 0x00000002
#define SHUTDOWN_RESTART 0x00000004
#define SHUTDOWN_POWEROFF 0x00000008
#define SHUTDOWN_NOREBOOT 0x00000010
#define SHUTDOWN_GRACE_OVERRIDE 0x00000020
#define SHUTDOWN_INSTALL_UPDATES 0x00000040
#define SHUTDOWN_RESTARTAPPS 0x00000080
#define SHUTDOWN_SKIP_SVC_PRESHUTDOWN 0x00000100
#define SHUTDOWN_HYBRID 0x00000200
#define SHUTDOWN_RESTART_BOOTOPTIONS 0x00000400
#define SHUTDOWN_SOFT_REBOOT 0x00000800
#define SHUTDOWN_MOBILE_UI 0x00001000
(
_In_opt_ LPSTR lpMachineName,
_In_opt_ LPSTR lpMessage,
_In_ DWORD dwGracePeriod,
_In_ DWORD dwShutdownFlags,
);
(
_In_opt_ LPWSTR lpMachineName,
_In_opt_ LPWSTR lpMessage,
_In_ DWORD dwGracePeriod,
_In_ DWORD dwShutdownFlags,
);
#ifdef UNICODE
#define InitiateShutdown InitiateShutdownW
#else
#define InitiateShutdown InitiateShutdownA
#endif // !UNICODE
(
_Inout_ PBOOLEAN pHiberboot,
);
(
_In_opt_ CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes,
);
(
_In_opt_ CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes,
);
#ifdef UNICODE
#define RegSaveKeyEx RegSaveKeyExW
#else
#define RegSaveKeyEx RegSaveKeyExA
#endif // !UNICODE
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#if _MSC_VER >= 1200
#pragma warning(pop)
#endif
#ifdef __cplusplus
}
#endif
#endif // _WINREG_