File Index Symbol Index

/******************************************************************************** * * * libloaderapi.h -- ApiSet Contract for api-ms-win-core-libraryloader-l1 * * * * Copyright (c) Microsoft Corporation. All rights reserved. * * * ********************************************************************************/
#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
tagENUMUILANG
{
ULONG
NumOfEnumUILang
;
// Acutall number of enumerated languages
ULONG
SizeOfEnumUIBuffer
;
// Buffer size of pMUIEnumUILanguages
LANGID
*
pEnumUIBuffer
; }
ENUMUILANG
, *
PENUMUILANG
;
#ifdef STRICT
#ifdef UNICODE
#define ENUMRESLANGPROC ENUMRESLANGPROCW
#else
#define ENUMRESLANGPROC ENUMRESLANGPROCA #endif // !UNICODE
#ifdef UNICODE
#define ENUMRESNAMEPROC ENUMRESNAMEPROCW
#else
#define ENUMRESNAMEPROC ENUMRESNAMEPROCA #endif // !UNICODE
); );
#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)
BOOL
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_
HRSRC
FindResourceExW
( );
#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
FindStringOrdinal
( );
#endif // (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
BOOL
FreeLibrary
( );
FreeLibraryAndExitThread
( );
#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)
BOOL
FreeResource
( );
#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)
DWORD
GetModuleFileNameA
( );
_Success_(return != 0)
_Ret_range_(1,nSize)
DWORD
GetModuleFileNameW
( );
#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_)
HMODULE
GetModuleHandleA
( );
_When_(lpModuleName == NULL,_Ret_notnull_)
_When_(lpModuleName != NULL,_Ret_maybenull_)
HMODULE
GetModuleHandleW
( );
#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
BOOL
PGET_MODULE_HANDLE_EXA
)( );
typedef
BOOL
PGET_MODULE_HANDLE_EXW
)( );
#ifdef UNICODE
#define PGET_MODULE_HANDLE_EX PGET_MODULE_HANDLE_EXW
#else
#define PGET_MODULE_HANDLE_EX PGET_MODULE_HANDLE_EXA #endif // !UNICODE
BOOL
GetModuleHandleExA
( );
BOOL
GetModuleHandleExW
( );
#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)
FARPROC
GetProcAddress
( );
#define CURRENT_IMPORT_REDIRECTION_VERSION 1
typedef
struct
_REDIRECTION_FUNCTION_DESCRIPTOR
{
PCSTR
DllName
;
PCSTR
FunctionName
;
PVOID
RedirectionTarget
; }
REDIRECTION_FUNCTION_DESCRIPTOR
, *
PREDIRECTION_FUNCTION_DESCRIPTOR
;
typedef
const
REDIRECTION_FUNCTION_DESCRIPTOR
*
PCREDIRECTION_FUNCTION_DESCRIPTOR
;
typedef
struct
_REDIRECTION_DESCRIPTOR
{
ULONG
Version
;
ULONG
FunctionCount
;
PCREDIRECTION_FUNCTION_DESCRIPTOR
Redirections
; }
REDIRECTION_DESCRIPTOR
, *
PREDIRECTION_DESCRIPTOR
;
typedef
const
REDIRECTION_DESCRIPTOR
*
PCREDIRECTION_DESCRIPTOR
;
#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_
HMODULE
LoadLibraryExA
( );
_Ret_maybenull_
HMODULE
LoadLibraryExW
( );
#ifdef UNICODE
#define LoadLibraryEx LoadLibraryExW
#else
#define LoadLibraryEx LoadLibraryExA #endif // !UNICODE
#define DONT_RESOLVE_DLL_REFERENCES 0x00000001
#define LOAD_LIBRARY_AS_DATAFILE 0x00000002
// reserved for internal LOAD_PACKAGED_LIBRARY: 0x00000004
#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_
HGLOBAL
LoadResource
( );
#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
LoadStringA
( );
int
LoadStringW
( );
#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)
LPVOID
LockResource
( );
DWORD
SizeofResource
( );
#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
PVOID
, *;
DLL_DIRECTORY_COOKIE
AddDllDirectory
( );
BOOL
RemoveDllDirectory
( );
BOOL
SetDefaultDllDirectories
( );
#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)
BOOL
EnumResourceLanguagesExA
(
DWORD
dwFlags
,
LANGID
LangId
);
BOOL
EnumResourceLanguagesExW
(
DWORD
dwFlags
,
LANGID
LangId
);
#ifdef UNICODE
#define EnumResourceLanguagesEx EnumResourceLanguagesExW
#else
#define EnumResourceLanguagesEx EnumResourceLanguagesExA #endif // !UNICODE
BOOL
EnumResourceNamesExA
(
DWORD
dwFlags
,
LANGID
LangId
);
BOOL
EnumResourceNamesExW
(
DWORD
dwFlags
,
LANGID
LangId
);
#ifdef UNICODE
#define EnumResourceNamesEx EnumResourceNamesExW
#else
#define EnumResourceNamesEx EnumResourceNamesExA #endif // !UNICODE
BOOL
EnumResourceTypesExA
(
DWORD
dwFlags
,
LANGID
LangId
);
BOOL
EnumResourceTypesExW
(
DWORD
dwFlags
,
LANGID
LangId
);
#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_
HRSRC
FindResourceW
( );
#ifdef UNICODE
#define FindResource FindResourceW #endif
_Ret_maybenull_
HMODULE
LoadLibraryA
( );
_Ret_maybenull_
HMODULE
LoadLibraryW
( );
#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)
BOOL
EnumResourceNamesW
( );
#ifdef UNICODE
#define EnumResourceNames EnumResourceNamesW #endif
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#ifdef __cplusplus
}
#endif
#endif // _APISETLIBLOADER_