WinStd
Additional templates and function helpers for Microsoft Windows using Standard C++ classes
Classes | Macros | Typedefs | Functions
Windows API

Integrates WinStd classes with Microsoft Windows API. More...

Classes

class  winstd::win_handle< INVALID >
 Windows HANDLE wrapper class. More...
 
class  winstd::library
 Module handle wrapper. More...
 
struct  winstd::UnmapViewOfFile_delete< _Ty >
 Deleter for unique_ptr using UnmapViewOfFile. More...
 
struct  winstd::UnmapViewOfFile_delete< _Ty[]>
 Deleter for unique_ptr to array of unknown size using UnmapViewOfFile. More...
 
class  winstd::critical_section
 Critical section wrapper. More...
 
class  winstd::find_file
 Find-file handle wrapper. More...
 
class  winstd::heap
 Heap handle wrapper. More...
 
class  winstd::heap_allocator< _Ty >
 HeapAlloc allocator. More...
 
class  winstd::actctx_activator
 Activates given activation context in constructor and deactivates it in destructor. More...
 
class  winstd::user_impersonator
 Lets the calling thread impersonate the security context of a logged-on user. More...
 
class  winstd::console_ctrl_handler
 Console control handler stack management. More...
 
class  winstd::vmemory
 Memory in virtual address space of a process handle wrapper. More...
 
class  winstd::reg_key
 Registry key wrapper class. More...
 
class  winstd::security_id
 SID wrapper class. More...
 
class  winstd::process_information
 PROCESS_INFORMATION struct wrapper. More...
 
class  winstd::event_log
 Event log handle wrapper. More...
 

Macros

#define GuidToString   GuidToStringA
 Formats GUID and stores it in a std::wstring string. More...
 
#define StringToGuid   StringToGuidA
 Parses string with GUID and stores it to GUID. More...
 

Typedefs

typedef win_handle< NULL > winstd::process
 Process handle wrapper. More...
 
typedef win_handle< NULL > winstd::thread
 Thread handle wrapper. More...
 
typedef win_handle< INVALID_HANDLE_VALUE > winstd::process_snapshot
 Process snapshot handle wrapper. More...
 
typedef win_handle< INVALID_HANDLE_VALUE > winstd::file
 File handle wrapper. More...
 
typedef win_handle< NULL > winstd::file_mapping
 File mapping. More...
 
typedef win_handle< NULL > winstd::event
 Event handle wrapper. More...
 

Functions

template<class _Traits , class _Ax >
static DWORD GetModuleFileNameA (HMODULE hModule, std::basic_string< char, _Traits, _Ax > &sValue) noexcept
 Retrieves the fully qualified path for the file that contains the specified module and stores it in a std::wstring string. More...
 
template<class _Traits , class _Ax >
static DWORD GetModuleFileNameW (HMODULE hModule, std::basic_string< wchar_t, _Traits, _Ax > &sValue) noexcept
 Retrieves the fully qualified path for the file that contains the specified module and stores it in a std::wstring string. More...
 
template<class _Traits , class _Ax >
static int GetWindowTextA (HWND hWnd, std::basic_string< char, _Traits, _Ax > &sValue) noexcept
 Copies the text of the specified window's title bar (if it has one) into a std::wstring string. More...
 
template<class _Traits , class _Ax >
static int GetWindowTextW (HWND hWnd, std::basic_string< wchar_t, _Traits, _Ax > &sValue) noexcept
 Copies the text of the specified window's title bar (if it has one) into a std::wstring string. More...
 
template<class _Ty , class _Ax >
static BOOL GetFileVersionInfoA (LPCSTR lptstrFilename, __reserved DWORD dwHandle, std::vector< _Ty, _Ax > &aValue) noexcept
 Retrieves version information for the specified file and stores it in a std::vector buffer. More...
 
template<class _Ty , class _Ax >
static BOOL GetFileVersionInfoW (LPCWSTR lptstrFilename, __reserved DWORD dwHandle, std::vector< _Ty, _Ax > &aValue) noexcept
 Retrieves version information for the specified file and stores it in a std::vector buffer. More...
 
template<class _Traits , class _Ax >
static DWORD ExpandEnvironmentStringsA (LPCSTR lpSrc, std::basic_string< char, _Traits, _Ax > &sValue) noexcept
 Expands environment-variable strings, replaces them with the values defined for the current user, and stores it in a std::wstring string. More...
 
template<class _Traits , class _Ax >
static DWORD ExpandEnvironmentStringsW (LPCWSTR lpSrc, std::basic_string< wchar_t, _Traits, _Ax > &sValue) noexcept
 Expands environment-variable strings, replaces them with the values defined for the current user, and stores it in a std::wstring string. More...
 
template<class _Traits , class _Ax >
static VOID GuidToStringA (LPCGUID lpGuid, std::basic_string< char, _Traits, _Ax > &str) noexcept
 Formats GUID and stores it in a std::wstring string. More...
 
template<class _Traits , class _Ax >
static VOID GuidToStringW (LPCGUID lpGuid, std::basic_string< wchar_t, _Traits, _Ax > &str) noexcept
 Formats GUID and stores it in a std::wstring string. More...
 
static BOOL StringToGuidA (LPCSTR lpszGuid, LPGUID lpGuid, LPCSTR *lpszGuidEnd=NULL) noexcept
 Parses string with GUID and stores it to GUID. More...
 
static BOOL StringToGuidW (LPCWSTR lpszGuid, LPGUID lpGuid, LPCWSTR *lpszGuidEnd=NULL) noexcept
 Parses string with GUID and stores it to GUID. More...
 
template<class _Traits , class _Ax >
static LSTATUS RegQueryStringValue (HKEY hReg, LPCSTR pszName, std::basic_string< char, _Traits, _Ax > &sValue) noexcept
 Queries for a string value in the registry and stores it in a std::string string. More...
 
template<class _Traits , class _Ax >
static LSTATUS RegQueryStringValue (HKEY hReg, LPCWSTR pszName, std::basic_string< wchar_t, _Traits, _Ax > &sValue) noexcept
 Queries for a string value in the registry and stores it in a std::wstring string. More...
 
template<class _Ty , class _Ax >
static LSTATUS RegQueryValueExA (HKEY hKey, LPCSTR lpValueName, __reserved LPDWORD lpReserved, LPDWORD lpType, std::vector< _Ty, _Ax > &aData) noexcept
 Retrieves the type and data for the specified value name associated with an open registry key and stores the data in a std::vector buffer. More...
 
template<class _Ty , class _Ax >
static LSTATUS RegQueryValueExW (HKEY hKey, LPCWSTR lpValueName, __reserved LPDWORD lpReserved, LPDWORD lpType, std::vector< _Ty, _Ax > &aData) noexcept
 Retrieves the type and data for the specified value name associated with an open registry key and stores the data in a std::vector buffer. More...
 
template<class _Traits , class _Ax >
static LSTATUS RegLoadMUIStringA (HKEY hKey, LPCSTR pszValue, std::basic_string< char, _Traits, _Ax > &sOut, DWORD Flags, LPCSTR pszDirectory) noexcept
 Loads the specified string from the specified key and subkey, and stores it in a std::wstring string. More...
 
template<class _Traits , class _Ax >
static LSTATUS RegLoadMUIStringW (HKEY hKey, LPCWSTR pszValue, std::basic_string< wchar_t, _Traits, _Ax > &sOut, DWORD Flags, LPCWSTR pszDirectory) noexcept
 Loads the specified string from the specified key and subkey, and stores it in a std::wstring string. More...
 
template<class _Traits , class _Ax >
static int WideCharToMultiByte (UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, int cchWideChar, std::basic_string< char, _Traits, _Ax > &sMultiByteStr, LPCSTR lpDefaultChar, LPBOOL lpUsedDefaultChar) noexcept
 Maps a UTF-16 (wide character) string to a std::string. The new character string is not necessarily from a multibyte character set. More...
 
template<class _Ax >
static int WideCharToMultiByte (UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, int cchWideChar, std::vector< char, _Ax > &sMultiByteStr, LPCSTR lpDefaultChar, LPBOOL lpUsedDefaultChar) noexcept
 Maps a UTF-16 (wide character) string to a std::vector. The new character vector is not necessarily from a multibyte character set. More...
 
template<class _Traits1 , class _Ax1 , class _Traits2 , class _Ax2 >
static int WideCharToMultiByte (UINT CodePage, DWORD dwFlags, std::basic_string< wchar_t, _Traits1, _Ax1 > sWideCharStr, std::basic_string< char, _Traits2, _Ax2 > &sMultiByteStr, LPCSTR lpDefaultChar, LPBOOL lpUsedDefaultChar) noexcept
 Maps a UTF-16 (wide character) string to a std::string. The new character string is not necessarily from a multibyte character set. More...
 
template<class _Traits , class _Ax >
static int SecureWideCharToMultiByte (UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, int cchWideChar, std::basic_string< char, _Traits, _Ax > &sMultiByteStr, LPCSTR lpDefaultChar, LPBOOL lpUsedDefaultChar) noexcept
 Maps a UTF-16 (wide character) string to a std::string. The new character string is not necessarily from a multibyte character set. More...
 
template<class _Ax >
static int SecureWideCharToMultiByte (UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, int cchWideChar, std::vector< char, _Ax > &sMultiByteStr, LPCSTR lpDefaultChar, LPBOOL lpUsedDefaultChar) noexcept
 Maps a UTF-16 (wide character) string to a std::vector. The new character vector is not necessarily from a multibyte character set. More...
 
template<class _Traits1 , class _Ax1 , class _Traits2 , class _Ax2 >
static int SecureWideCharToMultiByte (UINT CodePage, DWORD dwFlags, std::basic_string< wchar_t, _Traits1, _Ax1 > sWideCharStr, std::basic_string< char, _Traits2, _Ax2 > &sMultiByteStr, LPCSTR lpDefaultChar, LPBOOL lpUsedDefaultChar) noexcept
 Maps a UTF-16 (wide character) string to a std::string. The new character string is not necessarily from a multibyte character set. More...
 
template<class _Traits , class _Ax >
static int MultiByteToWideChar (UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, int cbMultiByte, std::basic_string< wchar_t, _Traits, _Ax > &sWideCharStr) noexcept
 Maps a character string to a UTF-16 (wide character) std::wstring. The character string is not necessarily from a multibyte character set. More...
 
template<class _Ax >
static int MultiByteToWideChar (UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, int cbMultiByte, std::vector< wchar_t, _Ax > &sWideCharStr) noexcept
 Maps a character string to a UTF-16 (wide character) std::vector. The character vector is not necessarily from a multibyte character set. More...
 
template<class _Traits1 , class _Ax1 , class _Traits2 , class _Ax2 >
static int MultiByteToWideChar (UINT CodePage, DWORD dwFlags, const std::basic_string< char, _Traits1, _Ax1 > &sMultiByteStr, std::basic_string< wchar_t, _Traits2, _Ax2 > &sWideCharStr) noexcept
 Maps a character string to a UTF-16 (wide character) std::wstring. The character string is not necessarily from a multibyte character set. More...
 
template<class _Traits , class _Ax >
static int SecureMultiByteToWideChar (UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, int cbMultiByte, std::basic_string< wchar_t, _Traits, _Ax > &sWideCharStr) noexcept
 Maps a character string to a UTF-16 (wide character) std::wstring. The character string is not necessarily from a multibyte character set. More...
 
template<class _Ax >
static int SecureMultiByteToWideChar (UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, int cbMultiByte, std::vector< wchar_t, _Ax > &sWideCharStr) noexcept
 Maps a character string to a UTF-16 (wide character) std::vector. The character vector is not necessarily from a multibyte character set. More...
 
template<class _Traits1 , class _Ax1 , class _Traits2 , class _Ax2 >
static int SecureMultiByteToWideChar (UINT CodePage, DWORD dwFlags, const std::basic_string< char, _Traits1, _Ax1 > &sMultiByteStr, std::basic_string< wchar_t, _Traits2, _Ax2 > &sWideCharStr) noexcept
 Maps a character string to a UTF-16 (wide character) std::wstring. The character string is not necessarily from a multibyte character set. More...
 
template<class _Traits , class _Ax >
static int NormalizeString (NORM_FORM NormForm, LPCWSTR lpSrcString, int cwSrcLength, std::basic_string< wchar_t, _Traits, _Ax > &sDstString) noexcept
 Normalizes characters of a text string according to Unicode 4.0 TR#15. More...
 
template<class _Traits1 , class _Ax1 , class _Traits2 , class _Ax2 >
static int NormalizeString (NORM_FORM NormForm, const std::basic_string< wchar_t, _Traits1, _Ax1 > &sSrcString, std::basic_string< wchar_t, _Traits2, _Ax2 > &sDstString) noexcept
 Normalizes characters of a text string according to Unicode 4.0 TR#15. More...
 
template<class _Traits , class _Ax >
static int WINAPI LoadStringA (HINSTANCE hInstance, UINT uID, std::basic_string< char, _Traits, _Ax > &sBuffer) noexcept
 Loads a string resource from the executable file associated with a specified module. More...
 
template<class _Traits , class _Ax >
static int WINAPI LoadStringW (HINSTANCE hInstance, UINT uID, std::basic_string< wchar_t, _Traits, _Ax > &sBuffer) noexcept
 Loads a string resource from the executable file associated with a specified module. More...
 
static VOID OutputDebugStrV (LPCSTR lpOutputString, va_list arg) noexcept
 Formats and sends a string to the debugger for display. More...
 
static VOID OutputDebugStrV (LPCWSTR lpOutputString, va_list arg) noexcept
 Formats and sends a string to the debugger for display. More...
 
static VOID OutputDebugStr (LPCSTR lpOutputString,...) noexcept
 Formats and sends a string to the debugger for display. More...
 
static VOID OutputDebugStr (LPCWSTR lpOutputString,...) noexcept
 Formats and sends a string to the debugger for display. More...
 
template<class _Traits , class _Ax >
static int GetDateFormatA (LCID Locale, DWORD dwFlags, const SYSTEMTIME *lpDate, LPCSTR lpFormat, std::basic_string< char, _Traits, _Ax > &sDate) noexcept
 Formats a date as a date string for a locale specified by the locale identifier. The function formats either a specified date or the local system date. More...
 
template<class _Traits , class _Ax >
static int GetDateFormatW (LCID Locale, DWORD dwFlags, const SYSTEMTIME *lpDate, LPCWSTR lpFormat, std::basic_string< wchar_t, _Traits, _Ax > &sDate) noexcept
 Formats a date as a date string for a locale specified by the locale identifier. The function formats either a specified date or the local system date. More...
 
template<class _Traits , class _Ax >
static BOOL LookupAccountSidA (LPCSTR lpSystemName, PSID lpSid, std::basic_string< char, _Traits, _Ax > *sName, std::basic_string< char, _Traits, _Ax > *sReferencedDomainName, PSID_NAME_USE peUse) noexcept
 Retrieves the name of the account for this SID and the name of the first domain on which this SID is found. More...
 
template<class _Traits , class _Ax >
static BOOL LookupAccountSidW (LPCWSTR lpSystemName, PSID lpSid, std::basic_string< wchar_t, _Traits, _Ax > *sName, std::basic_string< wchar_t, _Traits, _Ax > *sReferencedDomainName, PSID_NAME_USE peUse) noexcept
 Retrieves the name of the account for this SID and the name of the first domain on which this SID is found. More...
 
template<class _Ty >
static BOOL GetTokenInformation (HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, std::unique_ptr< _Ty > &TokenInformation) noexcept
 Retrieves a specified type of information about an access token. The calling process must have appropriate access rights to obtain the information. More...
 
template<class _Traits , class _Ax >
static BOOL QueryFullProcessImageNameA (HANDLE hProcess, DWORD dwFlags, std::basic_string< char, _Traits, _Ax > &sExeName)
 Retrieves the full name of the executable image for the specified process. More...
 
template<class _Traits , class _Ax >
static BOOL QueryFullProcessImageNameW (HANDLE hProcess, DWORD dwFlags, std::basic_string< wchar_t, _Traits, _Ax > &sExeName)
 Retrieves the full name of the executable image for the specified process. More...
 
static LSTATUS RegCreateKeyExA (HKEY hKey, LPCSTR lpSubKey, DWORD Reserved, LPSTR lpClass, DWORD dwOptions, REGSAM samDesired, CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes, winstd::reg_key &result, LPDWORD lpdwDisposition)
 Creates the specified registry key. If the key already exists, the function opens it. More...
 
static LSTATUS RegCreateKeyExW (HKEY hKey, LPCWSTR lpSubKey, DWORD Reserved, LPWSTR lpClass, DWORD dwOptions, REGSAM samDesired, CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes, winstd::reg_key &result, LPDWORD lpdwDisposition)
 Creates the specified registry key. If the key already exists, the function opens it. More...
 
static LSTATUS RegOpenKeyExA (HKEY hKey, LPCSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, winstd::reg_key &result)
 Opens the specified registry key. More...
 
static LSTATUS RegOpenKeyExW (HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, winstd::reg_key &result)
 Opens the specified registry key. More...
 

Detailed Description

Integrates WinStd classes with Microsoft Windows API.

Macro Definition Documentation

◆ GuidToString

#define GuidToString   GuidToStringA

Formats GUID and stores it in a std::wstring string.

Parameters
[in]lpGuidPointer to GUID
[out]strString to store the result to

◆ StringToGuid

#define StringToGuid   StringToGuidA

Parses string with GUID and stores it to GUID.

Parameters
[in]lpszGuidString with GUID
[out]lpGuidGUID to store the result to
[out]lpszGuidEndIf non-NULL the pointer to the end of parsed GUID within lpszGuid is returned
Returns
  • TRUE if GUID successfuly parsed;
  • FALSE otherwise.

Typedef Documentation

◆ event

typedef win_handle<NULL> winstd::event

Event handle wrapper.

See also
CreateEventW function
OpenEventW function

◆ file

typedef win_handle<INVALID_HANDLE_VALUE> winstd::file

File handle wrapper.

See also
CreateFile function

◆ file_mapping

File mapping.

See also
CreateFileMapping function

◆ process

typedef win_handle<NULL> winstd::process

Process handle wrapper.

See also
OpenProcess function

◆ process_snapshot

typedef win_handle<INVALID_HANDLE_VALUE> winstd::process_snapshot

Process snapshot handle wrapper.

See also
CreateToolhelp32Snapshot function

◆ thread

typedef win_handle<NULL> winstd::thread

Thread handle wrapper.

See also
CreateThread function

Function Documentation

◆ ExpandEnvironmentStringsA()

template<class _Traits , class _Ax >
static DWORD ExpandEnvironmentStringsA ( LPCSTR  lpSrc,
std::basic_string< char, _Traits, _Ax > &  sValue 
)
staticnoexcept

Expands environment-variable strings, replaces them with the values defined for the current user, and stores it in a std::wstring string.

See also
ExpandEnvironmentStrings function

◆ ExpandEnvironmentStringsW()

template<class _Traits , class _Ax >
static DWORD ExpandEnvironmentStringsW ( LPCWSTR  lpSrc,
std::basic_string< wchar_t, _Traits, _Ax > &  sValue 
)
staticnoexcept

Expands environment-variable strings, replaces them with the values defined for the current user, and stores it in a std::wstring string.

See also
ExpandEnvironmentStrings function

◆ GetDateFormatA()

template<class _Traits , class _Ax >
static int GetDateFormatA ( LCID  Locale,
DWORD  dwFlags,
const SYSTEMTIME *  lpDate,
LPCSTR  lpFormat,
std::basic_string< char, _Traits, _Ax > &  sDate 
)
staticnoexcept

Formats a date as a date string for a locale specified by the locale identifier. The function formats either a specified date or the local system date.

See also
GetDateFormat function

◆ GetDateFormatW()

template<class _Traits , class _Ax >
static int GetDateFormatW ( LCID  Locale,
DWORD  dwFlags,
const SYSTEMTIME *  lpDate,
LPCWSTR  lpFormat,
std::basic_string< wchar_t, _Traits, _Ax > &  sDate 
)
staticnoexcept

Formats a date as a date string for a locale specified by the locale identifier. The function formats either a specified date or the local system date.

See also
GetDateFormat function

◆ GetFileVersionInfoA()

template<class _Ty , class _Ax >
static BOOL GetFileVersionInfoA ( LPCSTR  lptstrFilename,
__reserved DWORD  dwHandle,
std::vector< _Ty, _Ax > &  aValue 
)
staticnoexcept

Retrieves version information for the specified file and stores it in a std::vector buffer.

See also
GetFileVersionInfo function

◆ GetFileVersionInfoW()

template<class _Ty , class _Ax >
static BOOL GetFileVersionInfoW ( LPCWSTR  lptstrFilename,
__reserved DWORD  dwHandle,
std::vector< _Ty, _Ax > &  aValue 
)
staticnoexcept

Retrieves version information for the specified file and stores it in a std::vector buffer.

See also
GetFileVersionInfo function

◆ GetModuleFileNameA()

template<class _Traits , class _Ax >
static DWORD GetModuleFileNameA ( HMODULE  hModule,
std::basic_string< char, _Traits, _Ax > &  sValue 
)
staticnoexcept

Retrieves the fully qualified path for the file that contains the specified module and stores it in a std::wstring string.

See also
GetModuleFileName function

◆ GetModuleFileNameW()

template<class _Traits , class _Ax >
static DWORD GetModuleFileNameW ( HMODULE  hModule,
std::basic_string< wchar_t, _Traits, _Ax > &  sValue 
)
staticnoexcept

Retrieves the fully qualified path for the file that contains the specified module and stores it in a std::wstring string.

See also
GetModuleFileName function

◆ GetTokenInformation()

template<class _Ty >
static BOOL GetTokenInformation ( HANDLE  TokenHandle,
TOKEN_INFORMATION_CLASS  TokenInformationClass,
std::unique_ptr< _Ty > &  TokenInformation 
)
staticnoexcept

Retrieves a specified type of information about an access token. The calling process must have appropriate access rights to obtain the information.

See also
GetTokenInformation function

◆ GetWindowTextA()

template<class _Traits , class _Ax >
static int GetWindowTextA ( HWND  hWnd,
std::basic_string< char, _Traits, _Ax > &  sValue 
)
staticnoexcept

Copies the text of the specified window's title bar (if it has one) into a std::wstring string.

See also
GetWindowText function

◆ GetWindowTextW()

template<class _Traits , class _Ax >
static int GetWindowTextW ( HWND  hWnd,
std::basic_string< wchar_t, _Traits, _Ax > &  sValue 
)
staticnoexcept

Copies the text of the specified window's title bar (if it has one) into a std::wstring string.

See also
GetWindowText function

◆ GuidToStringA()

template<class _Traits , class _Ax >
static VOID GuidToStringA ( LPCGUID  lpGuid,
std::basic_string< char, _Traits, _Ax > &  str 
)
staticnoexcept

Formats GUID and stores it in a std::wstring string.

Parameters
[in]lpGuidPointer to GUID
[out]strString to store the result to

◆ GuidToStringW()

template<class _Traits , class _Ax >
static VOID GuidToStringW ( LPCGUID  lpGuid,
std::basic_string< wchar_t, _Traits, _Ax > &  str 
)
staticnoexcept

Formats GUID and stores it in a std::wstring string.

Parameters
[in]lpGuidPointer to GUID
[out]strString to store the result to

◆ LoadStringA()

template<class _Traits , class _Ax >
static int WINAPI LoadStringA ( HINSTANCE  hInstance,
UINT  uID,
std::basic_string< char, _Traits, _Ax > &  sBuffer 
)
staticnoexcept

Loads a string resource from the executable file associated with a specified module.

See also
LoadString function

◆ LoadStringW()

template<class _Traits , class _Ax >
static int WINAPI LoadStringW ( HINSTANCE  hInstance,
UINT  uID,
std::basic_string< wchar_t, _Traits, _Ax > &  sBuffer 
)
staticnoexcept

Loads a string resource from the executable file associated with a specified module.

See also
LoadString function

◆ LookupAccountSidA()

template<class _Traits , class _Ax >
static BOOL LookupAccountSidA ( LPCSTR  lpSystemName,
PSID  lpSid,
std::basic_string< char, _Traits, _Ax > *  sName,
std::basic_string< char, _Traits, _Ax > *  sReferencedDomainName,
PSID_NAME_USE  peUse 
)
staticnoexcept

Retrieves the name of the account for this SID and the name of the first domain on which this SID is found.

See also
LookupAccountSid function

◆ LookupAccountSidW()

template<class _Traits , class _Ax >
static BOOL LookupAccountSidW ( LPCWSTR  lpSystemName,
PSID  lpSid,
std::basic_string< wchar_t, _Traits, _Ax > *  sName,
std::basic_string< wchar_t, _Traits, _Ax > *  sReferencedDomainName,
PSID_NAME_USE  peUse 
)
staticnoexcept

Retrieves the name of the account for this SID and the name of the first domain on which this SID is found.

See also
LookupAccountSid function

◆ MultiByteToWideChar() [1/3]

template<class _Traits1 , class _Ax1 , class _Traits2 , class _Ax2 >
static int MultiByteToWideChar ( UINT  CodePage,
DWORD  dwFlags,
const std::basic_string< char, _Traits1, _Ax1 > &  sMultiByteStr,
std::basic_string< wchar_t, _Traits2, _Ax2 > &  sWideCharStr 
)
staticnoexcept

Maps a character string to a UTF-16 (wide character) std::wstring. The character string is not necessarily from a multibyte character set.

See also
MultiByteToWideChar function

◆ MultiByteToWideChar() [2/3]

template<class _Traits , class _Ax >
static int MultiByteToWideChar ( UINT  CodePage,
DWORD  dwFlags,
LPCSTR  lpMultiByteStr,
int  cbMultiByte,
std::basic_string< wchar_t, _Traits, _Ax > &  sWideCharStr 
)
staticnoexcept

Maps a character string to a UTF-16 (wide character) std::wstring. The character string is not necessarily from a multibyte character set.

See also
MultiByteToWideChar function

◆ MultiByteToWideChar() [3/3]

template<class _Ax >
static int MultiByteToWideChar ( UINT  CodePage,
DWORD  dwFlags,
LPCSTR  lpMultiByteStr,
int  cbMultiByte,
std::vector< wchar_t, _Ax > &  sWideCharStr 
)
staticnoexcept

Maps a character string to a UTF-16 (wide character) std::vector. The character vector is not necessarily from a multibyte character set.

See also
MultiByteToWideChar function

◆ NormalizeString() [1/2]

template<class _Traits1 , class _Ax1 , class _Traits2 , class _Ax2 >
static int NormalizeString ( NORM_FORM  NormForm,
const std::basic_string< wchar_t, _Traits1, _Ax1 > &  sSrcString,
std::basic_string< wchar_t, _Traits2, _Ax2 > &  sDstString 
)
staticnoexcept

Normalizes characters of a text string according to Unicode 4.0 TR#15.

See also
NormalizeString function

◆ NormalizeString() [2/2]

template<class _Traits , class _Ax >
static int NormalizeString ( NORM_FORM  NormForm,
LPCWSTR  lpSrcString,
int  cwSrcLength,
std::basic_string< wchar_t, _Traits, _Ax > &  sDstString 
)
staticnoexcept

Normalizes characters of a text string according to Unicode 4.0 TR#15.

See also
NormalizeString function

◆ OutputDebugStr() [1/2]

static VOID OutputDebugStr ( LPCSTR  lpOutputString,
  ... 
)
staticnoexcept

Formats and sends a string to the debugger for display.

See also
OutputDebugString function

◆ OutputDebugStr() [2/2]

static VOID OutputDebugStr ( LPCWSTR  lpOutputString,
  ... 
)
staticnoexcept

Formats and sends a string to the debugger for display.

See also
OutputDebugString function

◆ OutputDebugStrV() [1/2]

static VOID OutputDebugStrV ( LPCSTR  lpOutputString,
va_list  arg 
)
staticnoexcept

Formats and sends a string to the debugger for display.

See also
OutputDebugString function

◆ OutputDebugStrV() [2/2]

static VOID OutputDebugStrV ( LPCWSTR  lpOutputString,
va_list  arg 
)
staticnoexcept

Formats and sends a string to the debugger for display.

See also
OutputDebugString function

◆ QueryFullProcessImageNameA()

template<class _Traits , class _Ax >
static BOOL QueryFullProcessImageNameA ( HANDLE  hProcess,
DWORD  dwFlags,
std::basic_string< char, _Traits, _Ax > &  sExeName 
)
static

Retrieves the full name of the executable image for the specified process.

See also
QueryFullProcessImageNameA function

◆ QueryFullProcessImageNameW()

template<class _Traits , class _Ax >
static BOOL QueryFullProcessImageNameW ( HANDLE  hProcess,
DWORD  dwFlags,
std::basic_string< wchar_t, _Traits, _Ax > &  sExeName 
)
static

Retrieves the full name of the executable image for the specified process.

See also
QueryFullProcessImageNameW function

◆ RegCreateKeyExA()

static LSTATUS RegCreateKeyExA ( HKEY  hKey,
LPCSTR  lpSubKey,
DWORD  Reserved,
LPSTR  lpClass,
DWORD  dwOptions,
REGSAM  samDesired,
CONST LPSECURITY_ATTRIBUTES  lpSecurityAttributes,
winstd::reg_key result,
LPDWORD  lpdwDisposition 
)
static

Creates the specified registry key. If the key already exists, the function opens it.

See also
RegCreateKeyEx function

◆ RegCreateKeyExW()

static LSTATUS RegCreateKeyExW ( HKEY  hKey,
LPCWSTR  lpSubKey,
DWORD  Reserved,
LPWSTR  lpClass,
DWORD  dwOptions,
REGSAM  samDesired,
CONST LPSECURITY_ATTRIBUTES  lpSecurityAttributes,
winstd::reg_key result,
LPDWORD  lpdwDisposition 
)
static

Creates the specified registry key. If the key already exists, the function opens it.

See also
RegCreateKeyEx function

◆ RegLoadMUIStringA()

template<class _Traits , class _Ax >
static LSTATUS RegLoadMUIStringA ( HKEY  hKey,
LPCSTR  pszValue,
std::basic_string< char, _Traits, _Ax > &  sOut,
DWORD  Flags,
LPCSTR  pszDirectory 
)
staticnoexcept

Loads the specified string from the specified key and subkey, and stores it in a std::wstring string.

See also
RegLoadMUIString function

◆ RegLoadMUIStringW()

template<class _Traits , class _Ax >
static LSTATUS RegLoadMUIStringW ( HKEY  hKey,
LPCWSTR  pszValue,
std::basic_string< wchar_t, _Traits, _Ax > &  sOut,
DWORD  Flags,
LPCWSTR  pszDirectory 
)
staticnoexcept

Loads the specified string from the specified key and subkey, and stores it in a std::wstring string.

See also
RegLoadMUIString function

◆ RegOpenKeyExA()

static LSTATUS RegOpenKeyExA ( HKEY  hKey,
LPCSTR  lpSubKey,
DWORD  ulOptions,
REGSAM  samDesired,
winstd::reg_key result 
)
static

Opens the specified registry key.

Returns
  • true when creation succeeds;
  • false when creation fails. For extended error information, call GetLastError().
See also
RegOpenKeyEx function

◆ RegOpenKeyExW()

static LSTATUS RegOpenKeyExW ( HKEY  hKey,
LPCWSTR  lpSubKey,
DWORD  ulOptions,
REGSAM  samDesired,
winstd::reg_key result 
)
static

Opens the specified registry key.

Returns
  • true when creation succeeds;
  • false when creation fails. For extended error information, call GetLastError().
See also
RegOpenKeyEx function

◆ RegQueryStringValue() [1/2]

template<class _Traits , class _Ax >
static LSTATUS RegQueryStringValue ( HKEY  hReg,
LPCSTR  pszName,
std::basic_string< char, _Traits, _Ax > &  sValue 
)
staticnoexcept

Queries for a string value in the registry and stores it in a std::string string.

REG_EXPAND_SZ are expanded using ExpandEnvironmentStrings() before storing to sValue.

Parameters
[in]hRegA handle to an open registry key. The key must have been opened with the KEY_QUERY_VALUE access right.
[in]pszNameThe name of the registry value. If lpValueName is NULL or an empty string, "", the function retrieves the type and data for the key's unnamed or default value, if any.
[out]sValueString to store the value to
Returns
  • ERROR_SUCCESS when query succeeds;
  • ERROR_INVALID_DATA when the registy value type is not REG_SZ, REG_MULTI_SZ, or REG_EXPAND_SZ;
  • ERROR_OUTOFMEMORY when the memory allocation for the sValue buffer fails;
  • Error code when query fails. See RegQueryValueEx() for the list of error codes.
See also
RegQueryValueEx function
ExpandEnvironmentStrings function

◆ RegQueryStringValue() [2/2]

template<class _Traits , class _Ax >
static LSTATUS RegQueryStringValue ( HKEY  hReg,
LPCWSTR  pszName,
std::basic_string< wchar_t, _Traits, _Ax > &  sValue 
)
staticnoexcept

Queries for a string value in the registry and stores it in a std::wstring string.

REG_EXPAND_SZ are expanded using ExpandEnvironmentStrings() before storing to sValue.

Parameters
[in]hRegA handle to an open registry key. The key must have been opened with the KEY_QUERY_VALUE access right.
[in]pszNameThe name of the registry value. If lpValueName is NULL or an empty string, "", the function retrieves the type and data for the key's unnamed or default value, if any.
[out]sValueString to store the value to
Returns
  • ERROR_SUCCESS when query succeeds;
  • ERROR_INVALID_DATA when the registy value type is not REG_SZ, REG_MULTI_SZ, or REG_EXPAND_SZ;
  • ERROR_OUTOFMEMORY when the memory allocation for the sValue buffer fails;
  • Error code when query fails. See RegQueryValueEx() for the list of error codes.
See also
RegQueryValueEx function
ExpandEnvironmentStrings function

◆ RegQueryValueExA()

template<class _Ty , class _Ax >
static LSTATUS RegQueryValueExA ( HKEY  hKey,
LPCSTR  lpValueName,
__reserved LPDWORD  lpReserved,
LPDWORD  lpType,
std::vector< _Ty, _Ax > &  aData 
)
staticnoexcept

Retrieves the type and data for the specified value name associated with an open registry key and stores the data in a std::vector buffer.

See also
RegQueryValueEx function

◆ RegQueryValueExW()

template<class _Ty , class _Ax >
static LSTATUS RegQueryValueExW ( HKEY  hKey,
LPCWSTR  lpValueName,
__reserved LPDWORD  lpReserved,
LPDWORD  lpType,
std::vector< _Ty, _Ax > &  aData 
)
staticnoexcept

Retrieves the type and data for the specified value name associated with an open registry key and stores the data in a std::vector buffer.

See also
RegQueryValueEx function

◆ SecureMultiByteToWideChar() [1/3]

template<class _Traits1 , class _Ax1 , class _Traits2 , class _Ax2 >
static int SecureMultiByteToWideChar ( UINT  CodePage,
DWORD  dwFlags,
const std::basic_string< char, _Traits1, _Ax1 > &  sMultiByteStr,
std::basic_string< wchar_t, _Traits2, _Ax2 > &  sWideCharStr 
)
staticnoexcept

Maps a character string to a UTF-16 (wide character) std::wstring. The character string is not necessarily from a multibyte character set.

Note
This function cleans all internal buffers using SecureZeroMemory() before returning.
See also
MultiByteToWideChar function

◆ SecureMultiByteToWideChar() [2/3]

template<class _Traits , class _Ax >
static int SecureMultiByteToWideChar ( UINT  CodePage,
DWORD  dwFlags,
LPCSTR  lpMultiByteStr,
int  cbMultiByte,
std::basic_string< wchar_t, _Traits, _Ax > &  sWideCharStr 
)
staticnoexcept

Maps a character string to a UTF-16 (wide character) std::wstring. The character string is not necessarily from a multibyte character set.

Note
This function cleans all internal buffers using SecureZeroMemory() before returning.
See also
MultiByteToWideChar function

◆ SecureMultiByteToWideChar() [3/3]

template<class _Ax >
static int SecureMultiByteToWideChar ( UINT  CodePage,
DWORD  dwFlags,
LPCSTR  lpMultiByteStr,
int  cbMultiByte,
std::vector< wchar_t, _Ax > &  sWideCharStr 
)
staticnoexcept

Maps a character string to a UTF-16 (wide character) std::vector. The character vector is not necessarily from a multibyte character set.

Note
This function cleans all internal buffers using SecureZeroMemory() before returning.
See also
MultiByteToWideChar function

◆ SecureWideCharToMultiByte() [1/3]

template<class _Traits , class _Ax >
static int SecureWideCharToMultiByte ( UINT  CodePage,
DWORD  dwFlags,
LPCWSTR  lpWideCharStr,
int  cchWideChar,
std::basic_string< char, _Traits, _Ax > &  sMultiByteStr,
LPCSTR  lpDefaultChar,
LPBOOL  lpUsedDefaultChar 
)
staticnoexcept

Maps a UTF-16 (wide character) string to a std::string. The new character string is not necessarily from a multibyte character set.

Note
This function cleans all internal buffers using SecureZeroMemory() before returning.
See also
WideCharToMultiByte function

◆ SecureWideCharToMultiByte() [2/3]

template<class _Ax >
static int SecureWideCharToMultiByte ( UINT  CodePage,
DWORD  dwFlags,
LPCWSTR  lpWideCharStr,
int  cchWideChar,
std::vector< char, _Ax > &  sMultiByteStr,
LPCSTR  lpDefaultChar,
LPBOOL  lpUsedDefaultChar 
)
staticnoexcept

Maps a UTF-16 (wide character) string to a std::vector. The new character vector is not necessarily from a multibyte character set.

Note
This function cleans all internal buffers using SecureZeroMemory() before returning.
See also
WideCharToMultiByte function

◆ SecureWideCharToMultiByte() [3/3]

template<class _Traits1 , class _Ax1 , class _Traits2 , class _Ax2 >
static int SecureWideCharToMultiByte ( UINT  CodePage,
DWORD  dwFlags,
std::basic_string< wchar_t, _Traits1, _Ax1 >  sWideCharStr,
std::basic_string< char, _Traits2, _Ax2 > &  sMultiByteStr,
LPCSTR  lpDefaultChar,
LPBOOL  lpUsedDefaultChar 
)
staticnoexcept

Maps a UTF-16 (wide character) string to a std::string. The new character string is not necessarily from a multibyte character set.

Note
This function cleans all internal buffers using SecureZeroMemory() before returning.
See also
WideCharToMultiByte function

◆ StringToGuidA()

static BOOL StringToGuidA ( LPCSTR  lpszGuid,
LPGUID  lpGuid,
LPCSTR *  lpszGuidEnd = NULL 
)
staticnoexcept

Parses string with GUID and stores it to GUID.

Parameters
[in]lpszGuidString with GUID
[out]lpGuidGUID to store the result to
[out]lpszGuidEndIf non-NULL the pointer to the end of parsed GUID within lpszGuid is returned
Returns
  • TRUE if GUID successfuly parsed;
  • FALSE otherwise.

◆ StringToGuidW()

static BOOL StringToGuidW ( LPCWSTR  lpszGuid,
LPGUID  lpGuid,
LPCWSTR *  lpszGuidEnd = NULL 
)
staticnoexcept

Parses string with GUID and stores it to GUID.

Parameters
[in]lpszGuidString with GUID
[out]lpGuidGUID to store the result to
[out]lpszGuidEndIf non-NULL the pointer to the end of parsed GUID within lpszGuid is returned
Returns
  • TRUE if GUID successfuly parsed;
  • FALSE otherwise.

◆ WideCharToMultiByte() [1/3]

template<class _Traits , class _Ax >
static int WideCharToMultiByte ( UINT  CodePage,
DWORD  dwFlags,
LPCWSTR  lpWideCharStr,
int  cchWideChar,
std::basic_string< char, _Traits, _Ax > &  sMultiByteStr,
LPCSTR  lpDefaultChar,
LPBOOL  lpUsedDefaultChar 
)
staticnoexcept

Maps a UTF-16 (wide character) string to a std::string. The new character string is not necessarily from a multibyte character set.

See also
WideCharToMultiByte function

◆ WideCharToMultiByte() [2/3]

template<class _Ax >
static int WideCharToMultiByte ( UINT  CodePage,
DWORD  dwFlags,
LPCWSTR  lpWideCharStr,
int  cchWideChar,
std::vector< char, _Ax > &  sMultiByteStr,
LPCSTR  lpDefaultChar,
LPBOOL  lpUsedDefaultChar 
)
staticnoexcept

Maps a UTF-16 (wide character) string to a std::vector. The new character vector is not necessarily from a multibyte character set.

See also
WideCharToMultiByte function

◆ WideCharToMultiByte() [3/3]

template<class _Traits1 , class _Ax1 , class _Traits2 , class _Ax2 >
static int WideCharToMultiByte ( UINT  CodePage,
DWORD  dwFlags,
std::basic_string< wchar_t, _Traits1, _Ax1 >  sWideCharStr,
std::basic_string< char, _Traits2, _Ax2 > &  sMultiByteStr,
LPCSTR  lpDefaultChar,
LPBOOL  lpUsedDefaultChar 
)
staticnoexcept

Maps a UTF-16 (wide character) string to a std::string. The new character string is not necessarily from a multibyte character set.

See also
WideCharToMultiByte function