Skip to content

Commit 3365030

Browse files
committed
Use procedure name instead of ordinal in loader proxy
1 parent cc2134a commit 3365030

File tree

2 files changed

+205
-196
lines changed

2 files changed

+205
-196
lines changed

Client/loader-proxy/generator.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,9 @@ int main(int argc, char* argv[])
212212

213213
{
214214
std::ofstream output("exports.def");
215-
output << "EXPORTS\n";
215+
output << "; Do not edit this file manually because it has been generated by generator.cpp\n"
216+
<< "\n"
217+
<< "EXPORTS\n";
216218

217219
for (const ImageExport& item : exports)
218220
{
@@ -241,7 +243,9 @@ int main(int argc, char* argv[])
241243

242244
{
243245
std::ofstream output("winmm.asm");
244-
output << ".386\n"
246+
output << "; Do not edit this file manually because it has been generated by generator.cpp\n"
247+
<< "\n"
248+
<< ".386\n"
245249
<< ".model flat, stdcall\n"
246250
<< "\n"
247251
<< ".code\n"
@@ -272,7 +276,9 @@ int main(int argc, char* argv[])
272276

273277
{
274278
std::ofstream output("setup.cpp");
275-
output << "#define WIN32_LEAN_AND_MEAN\n"
279+
output << "// Do not edit this file manually because it has been generated by generator.cpp\n"
280+
<< "\n"
281+
<< "#define WIN32_LEAN_AND_MEAN\n"
276282
<< "#include <windows.h>\n"
277283
<< "#include <array>\n"
278284
<< "\n"
@@ -286,7 +292,10 @@ int main(int argc, char* argv[])
286292
if (!item.forwarded.empty())
287293
continue;
288294

289-
output << " functions[" << item.hint << "] = GetProcAddress(handle, LPCSTR(" << item.ordinal << "));\n";
295+
if (item.name.empty())
296+
output << " functions[" << item.hint << "] = GetProcAddress(handle, LPCSTR(" << item.ordinal << "));\n";
297+
else
298+
output << " functions[" << item.hint << "] = GetProcAddress(handle, \"" << item.name << "\");\n";
290299
}
291300

292301
output << "}\n";

0 commit comments

Comments
 (0)