forked from InWILL/Locale_Remulator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLROriginalFunc.h
346 lines (300 loc) · 9 KB
/
LROriginalFunc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
#pragma once
#include<Windows.h>
#include<imm.h>
#include<DSound.h>
#include<shlwapi.h>
#pragma comment(lib, "Imm32.lib")
#pragma comment(lib, "Dsound.lib")
#pragma comment(lib, "Version.lib")
#pragma comment(lib, "Shlwapi.lib")
static int (WINAPI* OriginalMultiByteToWideChar)(
UINT CodePage,
DWORD dwFlags,
LPCSTR lpMultiByteStr,
int cbMultiByte,
LPWSTR lpWideCharStr,
int cchWideChar
) = MultiByteToWideChar;
static int (WINAPI* OriginalWideCharToMultiByte)(
UINT CodePage,
DWORD dwFlags,
LPCWSTR lpWideCharStr,
int cchWideChar,
LPSTR lpMultiByteStr,
int cbMultiByte,
LPCSTR lpDefaultChar,
LPBOOL lpUsedDefaultChar
) = WideCharToMultiByte;
static UINT(WINAPI* OriginalGetACP)(void) = GetACP;
static UINT(WINAPI* OriginalGetOEMCP)(void) = GetOEMCP;
static BOOL(WINAPI* OriginalGetCPInfo)(
UINT CodePage,
LPCPINFO lpCPInfo
) = GetCPInfo;
static HWND(WINAPI* OriginalCreateWindowExA)(
_In_ DWORD dwExStyle,
_In_opt_ LPCSTR lpClassName,
_In_opt_ LPCSTR lpWindowName,
_In_ DWORD dwStyle,
_In_ int X,
_In_ int Y,
_In_ int nWidth,
_In_ int nHeight,
_In_opt_ HWND hWndParent,
_In_opt_ HMENU hMenu,
_In_opt_ HINSTANCE hInstance,
_In_opt_ LPVOID lpParam
) = CreateWindowExA;
static LRESULT(WINAPI* OriginalSendMessageA)(
_In_ HWND hWnd,
_In_ UINT Msg,
_Pre_maybenull_ _Post_valid_ WPARAM wParam,
_Pre_maybenull_ _Post_valid_ LPARAM lParam
) = SendMessageA;
static UINT(WINAPI* OriginalWinExec)(
_In_ LPCSTR lpCmdLine,
_In_ UINT uCmdShow
) = WinExec;
static BOOL(WINAPI* OriginalCreateProcessA)(
_In_opt_ LPCSTR lpApplicationName,
_Inout_opt_ LPSTR lpCommandLine,
_In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
_In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
_In_ BOOL bInheritHandles,
_In_ DWORD dwCreationFlags,
_In_opt_ LPVOID lpEnvironment,
_In_opt_ LPCSTR lpCurrentDirectory,
_In_ LPSTARTUPINFOA lpStartupInfo,
_Out_ LPPROCESS_INFORMATION lpProcessInformation
) = CreateProcessA;
static BOOL(WINAPI* OriginalCreateProcessW)(
_In_opt_ LPCWSTR lpApplicationName,
_Inout_opt_ LPWSTR lpCommandLine,
_In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
_In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
_In_ BOOL bInheritHandles,
_In_ DWORD dwCreationFlags,
_In_opt_ LPVOID lpEnvironment,
_In_opt_ LPCWSTR lpCurrentDirectory,
_In_ LPSTARTUPINFOW lpStartupInfo,
_Out_ LPPROCESS_INFORMATION lpProcessInformation
) = CreateProcessW;
static HINSTANCE(WINAPI* OriginalShellExecuteA)(
_In_opt_ HWND hwnd,
_In_opt_ LPCSTR lpOperation,
_In_ LPCSTR lpFile,
_In_opt_ LPCSTR lpParameters,
_In_opt_ LPCSTR lpDirectory,
_In_ INT nShowCmd
)= ShellExecuteA;
static HINSTANCE(WINAPI* OriginalShellExecuteW)(
_In_opt_ HWND hwnd,
_In_opt_ LPCWSTR lpOperation,
_In_ LPCWSTR lpFile,
_In_opt_ LPCWSTR lpParameters,
_In_opt_ LPCWSTR lpDirectory,
_In_ INT nShowCmd
) = ShellExecuteW;
static int(WINAPI* OriginalMessageBoxA)(
_In_opt_ HWND hWnd,
_In_opt_ LPCSTR lpText,
_In_opt_ LPCSTR lpCaption,
_In_ UINT uType
) = MessageBoxA;
static BOOL(WINAPI* OriginalSetWindowTextA)(
_In_ HWND hWnd,
_In_opt_ LPCSTR lpString
) = SetWindowTextA;
static int(WINAPI* OriginalGetWindowTextA)(
_In_ HWND hWnd,
_Out_writes_(nMaxCount) LPSTR lpString,
_In_ int nMaxCount
) = GetWindowTextA;
static LONG(WINAPI* OriginalImmGetCompositionStringA)(
HIMC hIMC,
DWORD dwIndex,
LPVOID lpBuf,
DWORD dwBufLen
) = ImmGetCompositionStringA;
static DWORD(WINAPI* OriginalImmGetCandidateListA)(
HIMC hIMC,
DWORD deIndex,
LPCANDIDATELIST lpCandList,
DWORD dwBufLen
) = ImmGetCandidateListA;
static HFONT(WINAPI* OriginalCreateFontA)(
_In_ int cHeight,
_In_ int cWidth,
_In_ int cEscapement,
_In_ int cOrientation,
_In_ int cWeight,
_In_ DWORD bItalic,
_In_ DWORD bUnderline,
_In_ DWORD bStrikeOut,
_In_ DWORD iCharSet,
_In_ DWORD iOutPrecision,
_In_ DWORD iClipPrecision,
_In_ DWORD iQuality,
_In_ DWORD iPitchAndFamily,
_In_opt_ LPCSTR pszFaceName
) = CreateFontA;
static HFONT(WINAPI* OriginalCreateFontW)(
_In_ int cHeight,
_In_ int cWidth,
_In_ int cEscapement,
_In_ int cOrientation,
_In_ int cWeight,
_In_ DWORD bItalic,
_In_ DWORD bUnderline,
_In_ DWORD bStrikeOut,
_In_ DWORD iCharSet,
_In_ DWORD iOutPrecision,
_In_ DWORD iClipPrecision,
_In_ DWORD iQuality,
_In_ DWORD iPitchAndFamily,
_In_opt_ LPCWSTR pszFaceName
) = CreateFontW;
static HFONT(WINAPI* OriginalCreateFontIndirectA)(
const LOGFONTA* lplf
) = CreateFontIndirectA;
static HFONT(WINAPI* OriginalCreateFontIndirectW)(
_In_ CONST LOGFONTW* lplf
) = CreateFontIndirectW;
static HFONT(WINAPI* OriginalCreateFontIndirectExA)(
_In_ CONST ENUMLOGFONTEXDVA*
) = CreateFontIndirectExA;
static HFONT(WINAPI* OriginalCreateFontIndirectExW)(
_In_ CONST ENUMLOGFONTEXDVW*
) = CreateFontIndirectExW;
static BOOL(WINAPI* OriginalTextOutA)(
HDC hdc,
int x,
int y,
LPCSTR lpString,
int c
) = TextOutA;
static int(WINAPI* OriginalDrawTextExA)(
_In_ HDC hdc,
LPSTR lpchText,
_In_ int cchText,
_Inout_ LPRECT lprc,
_In_ UINT format,
_In_opt_ LPDRAWTEXTPARAMS lpdtp
) = DrawTextExA;
static HANDLE(WINAPI* OriginalGetClipboardData)(
_In_ UINT uFormat
) = GetClipboardData;
static HANDLE(WINAPI* OriginalSetClipboardData)(
_In_ UINT uFormat,
_In_opt_ HANDLE hMem
) = SetClipboardData;
static HRESULT(WINAPI* OriginalDirectSoundEnumerateA)(
_In_ LPDSENUMCALLBACKA pDSEnumCallback,
_In_opt_ LPVOID pContext
) = DirectSoundEnumerateA;
static LPSTR(WINAPI* OriginalCharPrevExA)(
_In_ WORD CodePage,
_In_ LPCSTR lpStart,
_In_ LPCSTR lpCurrentChar,
_In_ DWORD dwFlags
) = CharPrevExA;
static LPSTR(WINAPI* OriginalCharNextExA)(
_In_ WORD CodePage,
_In_ LPCSTR lpCurrentChar,
_In_ DWORD dwFlags
) = CharNextExA;
static BOOL(WINAPI* OriginalIsDBCSLeadByteEx)(
_In_ UINT CodePage,
_In_ BYTE TestChar
) = IsDBCSLeadByteEx;
static INT_PTR(WINAPI* OriginalDialogBoxParamA)(
_In_opt_ HINSTANCE hInstance,
_In_ LPCSTR lpTemplateName,
_In_opt_ HWND hWndParent,
_In_opt_ DLGPROC lpDialogFunc,
_In_ LPARAM dwInitParam
) = DialogBoxParamA;
static HWND(WINAPI* OriginalCreateDialogIndirectParamA)(
_In_opt_ HINSTANCE hInstance,
_In_ LPCDLGTEMPLATEA lpTemplate,
_In_opt_ HWND hWndParent,
_In_opt_ DLGPROC lpDialogFunc,
_In_ LPARAM dwInitParam
) = CreateDialogIndirectParamA;
static BOOL(WINAPI* OriginalVerQueryValueA)(
LPCVOID pBlock,
LPCSTR lpSubBlock,
LPVOID* lplpBuffer,
PUINT puLen
) = VerQueryValueA;
static DWORD(WINAPI* OriginalGetModuleFileNameA)(
HMODULE hModule,
LPSTR lpFilename,
DWORD nSize
) = GetModuleFileNameA;
static HMODULE(WINAPI* OriginalLoadLibraryExA)(
_In_ LPCSTR lpLibFileName,
_Reserved_ HANDLE hFile,
_In_ DWORD dwFlags
) = LoadLibraryExA;
static DWORD(WINAPI* OriginalGetFileVersionInfoSizeA)(
_In_ LPCSTR lpwstrFilename,
_Out_ LPDWORD lpdwHandle
) = GetFileVersionInfoSizeA;
static BOOL(WINAPI* OriginalGetFileVersionInfoA)(
_In_ LPCSTR lptstrFilename, /* Filename of version stamped file */
_Reserved_ DWORD dwHandle, /* Information from GetFileVersionSize */
_In_ DWORD dwLen, /* Length of buffer for info */
_Out_writes_bytes_(dwLen) LPVOID lpData /* Buffer to place the data structure */
) = GetFileVersionInfoA;
static BOOL(WINAPI* OriginalPathRenameExtensionA)(
LPSTR pszPath,
LPCSTR pszExt
) = PathRenameExtensionA;
static ATOM(WINAPI* OriginalRegisterClassA)(
_In_ CONST WNDCLASSA* lpWndClass
) = RegisterClassA;
static ATOM(WINAPI* OriginalRegisterClassExA)(
_In_ CONST WNDCLASSEXA* lpWndClass
) = RegisterClassExA;
static LRESULT(WINAPI* OriginalDefWindowProcA)(
_In_ HWND hWnd,
_In_ UINT Msg,
_In_ WPARAM wParam,
_In_ LPARAM lParam
) = DefWindowProcA;
static LCID(WINAPI* OriginalGetThreadLocale)() = GetThreadLocale;
static LANGID(WINAPI* OriginalGetSystemDefaultUILanguage)() = GetSystemDefaultUILanguage;
static LANGID(WINAPI* OriginalGetUserDefaultUILanguage)() = GetUserDefaultUILanguage;
static LCID(WINAPI* OriginalGetSystemDefaultLCID)() = GetSystemDefaultLCID;
static LCID(WINAPI* OriginalGetUserDefaultLCID)() = GetUserDefaultLCID;
static LANGID(WINAPI* OriginalGetSystemDefaultLangID)() = GetSystemDefaultLangID;
static LANGID(WINAPI* OriginalGetUserDefaultLangID)() = GetUserDefaultLangID;
static DWORD(WINAPI* OriginalGetTimeZoneInformation)(
_Out_ LPTIME_ZONE_INFORMATION lpTimeZoneInformation
) = GetTimeZoneInformation;
static BOOL(WINAPI* OriginalCreateDirectoryA)(
_In_ LPCSTR lpPathName,
_In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes
) = CreateDirectoryA;
static HANDLE(WINAPI* OriginalCreateFileA)(
_In_ LPCSTR lpFileName,
_In_ DWORD dwDesiredAccess,
_In_ DWORD dwShareMode,
_In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes,
_In_ DWORD dwCreationDisposition,
_In_ DWORD dwFlagsAndAttributes,
_In_opt_ HANDLE hTemplateFile
) = CreateFileA;
static int(WINAPI* OriginalGetLocaleInfoA)(
_In_ LCID Locale,
_In_ LCTYPE LCType,
_Out_writes_opt_(cchData) LPSTR lpLCData,
_In_ int cchData
) = GetLocaleInfoA;
static int(WINAPI* OriginalGetLocaleInfoW)(
_In_ LCID Locale,
_In_ LCTYPE LCType,
_Out_writes_opt_(cchData) LPWSTR lpLCData,
_In_ int cchData
) = GetLocaleInfoW;