#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER
#ifndef _APISETLIBLOADER_
#define _APISETLIBLOADER_
#include <apiset.h>
#include <apisetcconv.h>
#include <minwindef.h>
#include <minwinbase.h>
#ifdef __cplusplus
extern
"C"
{
#endif
#pragma region Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#define FIND_RESOURCE_DIRECTORY_TYPES (0x0100)
#define FIND_RESOURCE_DIRECTORY_NAMES (0x0200)
#define FIND_RESOURCE_DIRECTORY_LANGUAGES (0x0400)
#define RESOURCE_ENUM_LN (0x0001)
#define RESOURCE_ENUM_MUI (0x0002)
#define RESOURCE_ENUM_MUI_SYSTEM (0x0004)
#define RESOURCE_ENUM_VALIDATE (0x0008)
#define RESOURCE_ENUM_MODULE_EXACT (0x0010)
#define SUPPORT_LANG_NUMBER 32
typedef
struct
{
;
;
*
;
}
, *
;
#ifdef STRICT
typedef BOOL (CALLBACK* ENUMRESLANGPROCA)(
_In_opt_ HMODULE hModule,
typedef BOOL (CALLBACK* ENUMRESLANGPROCW)(
_In_opt_ HMODULE hModule,
#ifdef UNICODE
#define ENUMRESLANGPROC ENUMRESLANGPROCW
#else
#define ENUMRESLANGPROC ENUMRESLANGPROCA
#endif // !UNICODE
typedef BOOL (CALLBACK* ENUMRESNAMEPROCA)(
_In_opt_ HMODULE hModule,
typedef BOOL (CALLBACK* ENUMRESNAMEPROCW)(
_In_opt_ HMODULE hModule,
#ifdef UNICODE
#define ENUMRESNAMEPROC ENUMRESNAMEPROCW
#else
#define ENUMRESNAMEPROC ENUMRESNAMEPROCA
#endif // !UNICODE
typedef BOOL (CALLBACK* ENUMRESTYPEPROCA)(
_In_opt_ HMODULE hModule,
);
typedef BOOL (CALLBACK* ENUMRESTYPEPROCW)(
_In_opt_ HMODULE hModule,
);
#ifdef UNICODE
#define ENUMRESTYPEPROC ENUMRESTYPEPROCW
#else
#define ENUMRESTYPEPROC ENUMRESTYPEPROCA
#endif // !UNICODE
#else
typedef FARPROC ENUMRESTYPEPROCA;
typedef FARPROC ENUMRESTYPEPROCW;
#ifdef UNICODE
typedef ENUMRESTYPEPROCW ENUMRESTYPEPROC;
#else
typedef ENUMRESTYPEPROCA ENUMRESTYPEPROC;
#endif // UNICODE
typedef FARPROC ENUMRESNAMEPROCA;
typedef FARPROC ENUMRESNAMEPROCW;
#ifdef UNICODE
typedef ENUMRESNAMEPROCW ENUMRESNAMEPROC;
#else
typedef ENUMRESNAMEPROCA ENUMRESNAMEPROC;
#endif // UNICODE
typedef FARPROC ENUMRESLANGPROCA;
typedef FARPROC ENUMRESLANGPROCW;
#ifdef UNICODE
typedef ENUMRESLANGPROCW ENUMRESLANGPROC;
#else
typedef ENUMRESLANGPROCA ENUMRESLANGPROC;
#endif // UNICODE
#endif
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Application Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
DisableThreadLibraryCalls
(
);
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
_Ret_maybenull_
(
_In_opt_ HMODULE hModule,
);
#ifdef UNICODE
#define FindResourceEx FindResourceExW
#endif
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Application Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
int
(
_In_ DWORD dwFindStringOrdinalFlags,
_In_reads_(cchSource) LPCWSTR lpStringSource,
_In_reads_(cchValue) LPCWSTR lpStringValue,
);
#endif // (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
(
);
(
);
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
(
);
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Application Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
_Success_(return != 0)
_Ret_range_(1,nSize)
(
_In_opt_ HMODULE hModule,
_Out_writes_to_(nSize,((return < nSize) ? (return + 1) : nSize)) LPSTR lpFilename,
);
_Success_(return != 0)
_Ret_range_(1,nSize)
(
_In_opt_ HMODULE hModule,
_Out_writes_to_(nSize,((return < nSize) ? (return + 1) : nSize)) LPWSTR lpFilename,
);
#ifdef UNICODE
#define GetModuleFileName GetModuleFileNameW
#else
#define GetModuleFileName GetModuleFileNameA
#endif // !UNICODE
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
_When_(lpModuleName == NULL,_Ret_notnull_)
_When_(lpModuleName != NULL,_Ret_maybenull_)
(
_In_opt_ LPCSTR lpModuleName
);
_When_(lpModuleName == NULL,_Ret_notnull_)
_When_(lpModuleName != NULL,_Ret_maybenull_)
(
_In_opt_ LPCWSTR lpModuleName
);
#ifdef UNICODE
#define GetModuleHandle GetModuleHandleW
#else
#define GetModuleHandle GetModuleHandleA
#endif // !UNICODE
#if !defined(RC_INVOKED)
#define GET_MODULE_HANDLE_EX_FLAG_PIN (0x00000001)
#define GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT (0x00000002)
#define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS (0x00000004)
typedef
)(
_In_opt_ LPCSTR lpModuleName,
_Outptr_ HMODULE* phModule
);
typedef
)(
_In_opt_ LPCWSTR lpModuleName,
_Outptr_ HMODULE* phModule
);
#ifdef UNICODE
#define PGET_MODULE_HANDLE_EX PGET_MODULE_HANDLE_EXW
#else
#define PGET_MODULE_HANDLE_EX PGET_MODULE_HANDLE_EXA
#endif // !UNICODE
(
_In_opt_ LPCSTR lpModuleName,
);
(
_In_opt_ LPCWSTR lpModuleName,
);
#ifdef UNICODE
#define GetModuleHandleEx GetModuleHandleExW
#else
#define GetModuleHandleEx GetModuleHandleExA
#endif // !UNICODE
#endif
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#pragma region Application Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
(
);
#define CURRENT_IMPORT_REDIRECTION_VERSION 1
typedef
struct
_REDIRECTION_FUNCTION_DESCRIPTOR
{
;
;
;
}
REDIRECTION_FUNCTION_DESCRIPTOR
, *
PREDIRECTION_FUNCTION_DESCRIPTOR
;
typedef
const
REDIRECTION_FUNCTION_DESCRIPTOR
*
PCREDIRECTION_FUNCTION_DESCRIPTOR
;
typedef
struct
{
;
;
PCREDIRECTION_FUNCTION_DESCRIPTOR
;
}
, *
;
typedef
const
*
;
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
_Ret_maybenull_
(
_In_ LPCSTR lpLibFileName,
);
_Ret_maybenull_
(
_In_ LPCWSTR lpLibFileName,
);
#ifdef UNICODE
#define LoadLibraryEx LoadLibraryExW
#else
#define LoadLibraryEx LoadLibraryExA
#endif // !UNICODE
#define DONT_RESOLVE_DLL_REFERENCES 0x00000001
#define LOAD_LIBRARY_AS_DATAFILE 0x00000002
#define LOAD_WITH_ALTERED_SEARCH_PATH 0x00000008
#define LOAD_IGNORE_CODE_AUTHZ_LEVEL 0x00000010
#define LOAD_LIBRARY_AS_IMAGE_RESOURCE 0x00000020
#define LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE 0x00000040
#define LOAD_LIBRARY_REQUIRE_SIGNED_TARGET 0x00000080
#define LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR 0x00000100
#define LOAD_LIBRARY_SEARCH_APPLICATION_DIR 0x00000200
#define LOAD_LIBRARY_SEARCH_USER_DIRS 0x00000400
#define LOAD_LIBRARY_SEARCH_SYSTEM32 0x00000800
#define LOAD_LIBRARY_SEARCH_DEFAULT_DIRS 0x00001000
#if (NTDDI_VERSION >= NTDDI_WIN10_RS1)
#define LOAD_LIBRARY_SAFE_CURRENT_DIRS 0x00002000
#define LOAD_LIBRARY_SEARCH_SYSTEM32_NO_FORWARDER 0x00004000
#else
//
// For anything building for downlevel, set the flag to be the same as LOAD_LIBRARY_SEARCH_SYSTEM32
// such that they're treated the same when running on older version of OS.
//
#define LOAD_LIBRARY_SEARCH_SYSTEM32_NO_FORWARDER LOAD_LIBRARY_SEARCH_SYSTEM32
#endif // (_APISET_LIBLOADER_VER >= 0x0202)
#if (NTDDI_VERSION >= NTDDI_WIN10_RS2)
#define LOAD_LIBRARY_OS_INTEGRITY_CONTINUITY 0x00008000
#endif
_Ret_maybenull_
(
_In_opt_ HMODULE hModule,
);
#endif // WINAPI_FAMILY_PARTITION(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)
int
(
_In_opt_ HINSTANCE hInstance,
_Out_writes_to_(cchBufferMax,return + 1) LPSTR lpBuffer,
);
int
(
_In_opt_ HINSTANCE hInstance,
_Out_writes_to_(cchBufferMax,return + 1) LPWSTR lpBuffer,
);
#ifdef UNICODE
#define LoadString LoadStringW
#else
#define LoadString LoadStringA
#endif // !UNICODE
#endif // WINAPI_FAMILY_PARTITION(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)
(
);
(
_In_opt_ HMODULE hModule,
);
#endif // WINAPI_FAMILY_PARTITION(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)
typedef
, *
;
(
);
(
_In_ DLL_DIRECTORY_COOKIE Cookie
);
(
_In_ DWORD DirectoryFlags
);
#endif // WINAPI_FAMILY_PARTITION(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)
#if (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
(
_In_opt_ HMODULE hModule,
_In_ ENUMRESLANGPROCA lpEnumFunc,
_In_opt_ LONG_PTR lParam,
,
);
(
_In_opt_ HMODULE hModule,
_In_ ENUMRESLANGPROCW lpEnumFunc,
_In_opt_ LONG_PTR lParam,
,
);
#ifdef UNICODE
#define EnumResourceLanguagesEx EnumResourceLanguagesExW
#else
#define EnumResourceLanguagesEx EnumResourceLanguagesExA
#endif // !UNICODE
(
_In_opt_ HMODULE hModule,
_In_ ENUMRESNAMEPROCA lpEnumFunc,
,
);
(
_In_opt_ HMODULE hModule,
_In_ ENUMRESNAMEPROCW lpEnumFunc,
,
);
#ifdef UNICODE
#define EnumResourceNamesEx EnumResourceNamesExW
#else
#define EnumResourceNamesEx EnumResourceNamesExA
#endif // !UNICODE
(
_In_opt_ HMODULE hModule,
_In_ ENUMRESTYPEPROCA lpEnumFunc,
,
);
(
_In_opt_ HMODULE hModule,
_In_ ENUMRESTYPEPROCW lpEnumFunc,
,
);
#ifdef UNICODE
#define EnumResourceTypesEx EnumResourceTypesExW
#else
#define EnumResourceTypesEx EnumResourceTypesExA
#endif // !UNICODE
#endif // (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
#endif // WINAPI_FAMILY_PARTITION(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)
_Ret_maybenull_
(
_In_opt_ HMODULE hModule,
);
#ifdef UNICODE
#define FindResource FindResourceW
#endif
_Ret_maybenull_
(
_In_ LPCSTR lpLibFileName
);
_Ret_maybenull_
(
_In_ LPCWSTR lpLibFileName
);
#ifdef UNICODE
#define LoadLibrary LoadLibraryW
#else
#define LoadLibrary LoadLibraryA
#endif // !UNICODE
#endif // WINAPI_FAMILY_PARTITION(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)
(
_In_opt_ HMODULE hModule,
_In_ ENUMRESNAMEPROCW lpEnumFunc,
);
#ifdef UNICODE
#define EnumResourceNames EnumResourceNamesW
#endif
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#ifdef __cplusplus
}
#endif
#endif // _APISETLIBLOADER_