source: Daodan/MSYS2/mingw32/i686-w64-mingw32/include/libloaderapi.h@ 1180

Last change on this file since 1180 was 1166, checked in by rossy, 3 years ago

Daodan: Replace MinGW build env with an up-to-date MSYS2 env

File size: 8.6 KB
Line 
1/**
2 * This file is part of the mingw-w64 runtime package.
3 * No warranty is given; refer to the file DISCLAIMER within this package.
4 */
5#ifndef _APISETLIBLOADER_
6#define _APISETLIBLOADER_
7
8#include <apiset.h>
9#include <apisetcconv.h>
10#include <minwindef.h>
11#include <minwinbase.h>
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
18 typedef struct tagENUMUILANG {
19 ULONG NumOfEnumUILang;
20 ULONG SizeOfEnumUIBuffer;
21 LANGID *pEnumUIBuffer;
22 } ENUMUILANG, *PENUMUILANG;
23
24#ifdef STRICT
25 typedef WINBOOL (CALLBACK *ENUMRESLANGPROCA) (HMODULE hModule, LPCSTR lpType, LPCSTR lpName, WORD wLanguage, LONG_PTR lParam);
26 typedef WINBOOL (CALLBACK *ENUMRESLANGPROCW) (HMODULE hModule, LPCWSTR lpType, LPCWSTR lpName, WORD wLanguage, LONG_PTR lParam);
27 typedef WINBOOL (CALLBACK *ENUMRESNAMEPROCA) (HMODULE hModule, LPCSTR lpType, LPSTR lpName, LONG_PTR lParam);
28 typedef WINBOOL (CALLBACK *ENUMRESNAMEPROCW) (HMODULE hModule, LPCWSTR lpType, LPWSTR lpName, LONG_PTR lParam);
29 typedef WINBOOL (CALLBACK *ENUMRESTYPEPROCA) (HMODULE hModule, LPSTR lpType, LONG_PTR lParam);
30 typedef WINBOOL (CALLBACK *ENUMRESTYPEPROCW) (HMODULE hModule, LPWSTR lpType, LONG_PTR lParam);
31#else
32 typedef FARPROC ENUMRESTYPEPROCA;
33 typedef FARPROC ENUMRESTYPEPROCW;
34 typedef FARPROC ENUMRESNAMEPROCA;
35 typedef FARPROC ENUMRESNAMEPROCW;
36 typedef FARPROC ENUMRESLANGPROCA;
37 typedef FARPROC ENUMRESLANGPROCW;
38#endif
39
40#ifndef RC_INVOKED
41 typedef WINBOOL (WINAPI *PGET_MODULE_HANDLE_EXA) (DWORD dwFlags, LPCSTR lpModuleName, HMODULE *phModule);
42 typedef WINBOOL (WINAPI *PGET_MODULE_HANDLE_EXW) (DWORD dwFlags, LPCWSTR lpModuleName, HMODULE *phModule);
43#endif
44
45 typedef PVOID DLL_DIRECTORY_COOKIE, *PDLL_DIRECTORY_COOKIE;
46
47#define FIND_RESOURCE_DIRECTORY_TYPES (0x0100)
48#define FIND_RESOURCE_DIRECTORY_NAMES (0x0200)
49#define FIND_RESOURCE_DIRECTORY_LANGUAGES (0x0400)
50
51#define RESOURCE_ENUM_LN (0x0001)
52#define RESOURCE_ENUM_MUI (0x0002)
53#define RESOURCE_ENUM_MUI_SYSTEM (0x0004)
54#define RESOURCE_ENUM_VALIDATE (0x0008)
55#define RESOURCE_ENUM_MODULE_EXACT (0x0010)
56
57#define SUPPORT_LANG_NUMBER 32
58
59#define DONT_RESOLVE_DLL_REFERENCES 0x1
60#define LOAD_LIBRARY_AS_DATAFILE 0x2
61#define LOAD_WITH_ALTERED_SEARCH_PATH 0x8
62#define LOAD_IGNORE_CODE_AUTHZ_LEVEL 0x10
63#define LOAD_LIBRARY_AS_IMAGE_RESOURCE 0x20
64#define LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE 0x40
65#define LOAD_LIBRARY_REQUIRE_SIGNED_TARGET 0x80
66#define LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR 0x100
67#define LOAD_LIBRARY_SEARCH_APPLICATION_DIR 0x200
68#define LOAD_LIBRARY_SEARCH_USER_DIRS 0x400
69#define LOAD_LIBRARY_SEARCH_SYSTEM32 0x800
70#define LOAD_LIBRARY_SEARCH_DEFAULT_DIRS 0x1000
71
72#if (NTDDI_VERSION >= NTDDI_WIN10_RS1)
73#define LOAD_LIBRARY_SAFE_CURRENT_DIRS 0x00002000
74#define LOAD_LIBRARY_SEARCH_SYSTEM32_NO_FORWARDER 0x00004000
75#else
76#define LOAD_LIBRARY_SEARCH_SYSTEM32_NO_FORWARDER LOAD_LIBRARY_SEARCH_SYSTEM32
77#endif
78
79#if (NTDDI_VERSION >= NTDDI_WIN10_RS2)
80#define LOAD_LIBRARY_OS_INTEGRITY_CONTINUITY 0x00008000
81#endif
82
83#define GET_MODULE_HANDLE_EX_FLAG_PIN (0x1)
84#define GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT (0x2)
85#define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS (0x4)
86
87#define ENUMRESLANGPROC __MINGW_NAME_AW(ENUMRESLANGPROC)
88#define ENUMRESNAMEPROC __MINGW_NAME_AW(ENUMRESNAMEPROC)
89#define ENUMRESTYPEPROC __MINGW_NAME_AW(ENUMRESTYPEPROC)
90
91 WINBASEAPI WINBOOL WINAPI EnumResourceNamesW(HMODULE hModule, LPCWSTR lpType, ENUMRESNAMEPROCW lpEnumFunc, LONG_PTR lParam);
92 WINBASEAPI HRSRC WINAPI FindResourceW(HMODULE hModule, LPCWSTR lpName, LPCWSTR lpType);
93 WINBASEAPI HRSRC WINAPI FindResourceExW (HMODULE hModule, LPCWSTR lpType, LPCWSTR lpName, WORD wLanguage);
94 WINBASEAPI WINBOOL WINAPI FreeResource (HGLOBAL hResData);
95 WINBASEAPI HMODULE WINAPI LoadLibraryExA (LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags);
96 WINBASEAPI HMODULE WINAPI LoadLibraryExW (LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags);
97 WINBASEAPI HGLOBAL WINAPI LoadResource (HMODULE hModule, HRSRC hResInfo);
98 WINUSERAPI int WINAPI LoadStringA (HINSTANCE hInstance, UINT uID, LPSTR lpBuffer, int cchBufferMax);
99 WINUSERAPI int WINAPI LoadStringW (HINSTANCE hInstance, UINT uID, LPWSTR lpBuffer, int cchBufferMax);
100 WINBASEAPI LPVOID WINAPI LockResource (HGLOBAL hResData);
101 WINBASEAPI DWORD WINAPI SizeofResource (HMODULE hModule, HRSRC hResInfo);
102 WINBASEAPI DLL_DIRECTORY_COOKIE WINAPI AddDllDirectory (PCWSTR NewDirectory);
103 WINBASEAPI WINBOOL WINAPI RemoveDllDirectory (DLL_DIRECTORY_COOKIE Cookie);
104 WINBASEAPI WINBOOL WINAPI SetDefaultDllDirectories (DWORD DirectoryFlags);
105 WINBASEAPI WINBOOL WINAPI GetModuleHandleExA (DWORD dwFlags, LPCSTR lpModuleName, HMODULE *phModule);
106 WINBASEAPI WINBOOL WINAPI GetModuleHandleExW (DWORD dwFlags, LPCWSTR lpModuleName, HMODULE *phModule);
107
108#ifdef UNICODE
109#define EnumResourceNames EnumResourceNamesW
110#define FindResource FindResourceW
111#define FindResourceEx FindResourceExW
112#endif
113
114#define PGET_MODULE_HANDLE_EX __MINGW_NAME_AW(PGET_MODULE_HANDLE_EX)
115#define LoadString __MINGW_NAME_AW(LoadString)
116#define GetModuleHandleEx __MINGW_NAME_AW(GetModuleHandleEx)
117#define LoadLibraryEx __MINGW_NAME_AW(LoadLibraryEx)
118
119#define EnumResourceLanguages __MINGW_NAME_AW(EnumResourceLanguages)
120 WINBASEAPI WINBOOL WINAPI EnumResourceLanguagesA(HMODULE hModule,LPCSTR lpType,LPCSTR lpName,ENUMRESLANGPROCA lpEnumFunc,LONG_PTR lParam);
121 WINBASEAPI WINBOOL WINAPI EnumResourceLanguagesW(HMODULE hModule,LPCWSTR lpType,LPCWSTR lpName,ENUMRESLANGPROCW lpEnumFunc,LONG_PTR lParam);
122
123
124#if _WIN32_WINNT >= 0x0600
125 WINBASEAPI WINBOOL APIENTRY EnumResourceLanguagesExA (HMODULE hModule, LPCSTR lpType, LPCSTR lpName, ENUMRESLANGPROCA lpEnumFunc, LONG_PTR lParam, DWORD dwFlags, LANGID LangId);
126 WINBASEAPI WINBOOL APIENTRY EnumResourceLanguagesExW (HMODULE hModule, LPCWSTR lpType, LPCWSTR lpName, ENUMRESLANGPROCW lpEnumFunc, LONG_PTR lParam, DWORD dwFlags, LANGID LangId);
127 WINBASEAPI WINBOOL WINAPI EnumResourceNamesExA (HMODULE hModule, LPCSTR lpType, ENUMRESNAMEPROCA lpEnumFunc, LONG_PTR lParam, DWORD dwFlags, LANGID LangId);
128 WINBASEAPI WINBOOL WINAPI EnumResourceNamesExW (HMODULE hModule, LPCWSTR lpType, ENUMRESNAMEPROCW lpEnumFunc, LONG_PTR lParam, DWORD dwFlags, LANGID LangId);
129 WINBASEAPI WINBOOL WINAPI EnumResourceTypesExA (HMODULE hModule, ENUMRESTYPEPROCA lpEnumFunc, LONG_PTR lParam, DWORD dwFlags, LANGID LangId);
130 WINBASEAPI WINBOOL WINAPI EnumResourceTypesExW (HMODULE hModule, ENUMRESTYPEPROCW lpEnumFunc, LONG_PTR lParam, DWORD dwFlags, LANGID LangId);
131 WINBASEAPI WINBOOL WINAPI QueryOptionalDelayLoadedAPI (HMODULE CallerModule, LPCSTR lpDllName, LPCSTR lpProcName, DWORD Reserved);
132
133#define EnumResourceLanguagesEx __MINGW_NAME_AW(EnumResourceLanguagesEx)
134#define EnumResourceNamesEx __MINGW_NAME_AW(EnumResourceNamesEx)
135#define EnumResourceTypesEx __MINGW_NAME_AW(EnumResourceTypesEx)
136#endif
137#endif
138#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || defined(WINSTORECOMPAT)
139WINBASEAPI HMODULE WINAPI GetModuleHandleA (LPCSTR lpModuleName);
140WINBASEAPI HMODULE WINAPI GetModuleHandleW (LPCWSTR lpModuleName);
141WINBASEAPI HMODULE WINAPI LoadLibraryA(LPCSTR lpLibFileName);
142WINBASEAPI HMODULE WINAPI LoadLibraryW(LPCWSTR lpLibFileName);
143#define GetModuleHandle __MINGW_NAME_AW(GetModuleHandle)
144#define LoadLibrary __MINGW_NAME_AW(LoadLibrary)
145#endif
146
147#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
148 WINBASEAPI DECLSPEC_NORETURN VOID WINAPI FreeLibraryAndExitThread (HMODULE hLibModule, DWORD dwExitCode);
149 WINBASEAPI WINBOOL WINAPI DisableThreadLibraryCalls (HMODULE hLibModule);
150 WINBASEAPI WINBOOL WINAPI FreeLibrary (HMODULE hLibModule);
151 WINBASEAPI FARPROC WINAPI GetProcAddress (HMODULE hModule, LPCSTR lpProcName);
152 WINBASEAPI DWORD WINAPI GetModuleFileNameA (HMODULE hModule, LPSTR lpFilename, DWORD nSize);
153 WINBASEAPI DWORD WINAPI GetModuleFileNameW (HMODULE hModule, LPWSTR lpFilename, DWORD nSize);
154 #define GetModuleFileName __MINGW_NAME_AW(GetModuleFileName)
155
156#define CURRENT_IMPORT_REDIRECTION_VERSION 1
157
158typedef struct _REDIRECTION_FUNCTION_DESCRIPTOR {
159 PCSTR DllName;
160 PCSTR FunctionName;
161 PVOID RedirectionTarget;
162} REDIRECTION_FUNCTION_DESCRIPTOR, *PREDIRECTION_FUNCTION_DESCRIPTOR;
163
164typedef const REDIRECTION_FUNCTION_DESCRIPTOR *PCREDIRECTION_FUNCTION_DESCRIPTOR;
165
166typedef struct _REDIRECTION_DESCRIPTOR {
167 ULONG Version;
168 ULONG FunctionCount;
169 PCREDIRECTION_FUNCTION_DESCRIPTOR Redirections;
170} REDIRECTION_DESCRIPTOR, *PREDIRECTION_DESCRIPTOR;
171
172typedef const REDIRECTION_DESCRIPTOR *PCREDIRECTION_DESCRIPTOR;
173
174#if WINVER >= 0x0601
175 WINBASEAPI int WINAPI FindStringOrdinal (DWORD dwFindStringOrdinalFlags, LPCWSTR lpStringSource, int cchSource, LPCWSTR lpStringValue, int cchValue, WINBOOL bIgnoreCase);
176#endif
177#endif
178
179#ifdef __cplusplus
180}
181#endif
182#endif
Note: See TracBrowser for help on using the repository browser.