@@ -20,6 +20,36 @@ CLocalization* g_pLocalization = NULL;
20
20
21
21
HINSTANCE g_hModule = NULL ;
22
22
23
+ void AddLoaderProxyReport ()
24
+ {
25
+ HMODULE loaderHandle = nullptr ;
26
+ DWORD loaderSource = 0 ;
27
+ HMODULE (*mtasaGetLibraryHandle)() = nullptr ;
28
+ DWORD (*mtasaGetLibrarySource)() = nullptr ;
29
+
30
+ if (HMODULE mtasa = LoadLibraryW (L" mtasa.dll" ))
31
+ {
32
+ mtasaGetLibraryHandle = reinterpret_cast <decltype (mtasaGetLibraryHandle)>(GetProcAddress (mtasa, " mtasaGetLibraryHandle" ));
33
+ mtasaGetLibrarySource = reinterpret_cast <decltype (mtasaGetLibrarySource)>(GetProcAddress (mtasa, " mtasaGetLibrarySource" ));
34
+
35
+ if (mtasaGetLibraryHandle)
36
+ loaderHandle = mtasaGetLibraryHandle ();
37
+
38
+ if (mtasaGetLibrarySource)
39
+ loaderSource = mtasaGetLibrarySource ();
40
+
41
+ FreeLibrary (mtasa);
42
+ }
43
+
44
+ HMODULE winmm = LoadLibraryW (L" winmm.dll" );
45
+
46
+ if (winmm)
47
+ FreeLibrary (winmm);
48
+
49
+ AddReportLog (7120 , SString (" winmm.dll @%lu %08X=%08X [h:%08X, s:%08X]" , loaderSource, reinterpret_cast <DWORD>(loaderHandle), reinterpret_cast <DWORD>(winmm),
50
+ reinterpret_cast <DWORD>(mtasaGetLibraryHandle), reinterpret_cast <DWORD>(mtasaGetLibrarySource)));
51
+ }
52
+
23
53
int WINAPI DllMain (HINSTANCE hModule, DWORD dwReason, PVOID pvNothing)
24
54
{
25
55
CFilePathTranslator FileTranslator;
@@ -49,6 +79,8 @@ int WINAPI DllMain(HINSTANCE hModule, DWORD dwReason, PVOID pvNothing)
49
79
// http://msdn.microsoft.com/en-us/library/ms682586%28VS.85%29.aspx
50
80
SetDllDirectory (CalcMTASAPath (" MTA" ));
51
81
82
+ AddLoaderProxyReport ();
83
+
52
84
g_hModule = hModule;
53
85
g_pCore = new CCore;
54
86
0 commit comments