From: José Fonseca Date: Fri, 20 Apr 2012 20:05:15 +0000 (+0100) Subject: Don't force using system librarie on retrace. X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=b5efee195a250aba3ecb16b7e6b9e30787406609;p=apitrace Don't force using system librarie on retrace. --- diff --git a/retrace/dllretrace.py b/retrace/dllretrace.py index db1a586..abcd202 100644 --- a/retrace/dllretrace.py +++ b/retrace/dllretrace.py @@ -31,23 +31,18 @@ from dispatch import Dispatcher class DllRetracer(Retracer): def retraceApi(self, api): - print ''' + print r''' +static LPCSTR g_szDll = "%s"; static HMODULE g_hDll = NULL; static PROC _getPublicProcAddress(LPCSTR lpProcName) { if (!g_hDll) { - char szDll[MAX_PATH] = {0}; - - if (!GetSystemDirectoryA(szDll, MAX_PATH)) { - return NULL; - } - - strcat(szDll, "\\\\%s"); - - g_hDll = LoadLibraryA(szDll); + g_hDll = LoadLibraryA(g_szDll); if (!g_hDll) { + os::log("error: failed to load %%s\n", g_szDll); + exit(1); return NULL; } } @@ -55,7 +50,7 @@ _getPublicProcAddress(LPCSTR lpProcName) return GetProcAddress(g_hDll, lpProcName); } -''' % api.name +''' % api.name.upper() dispatcher = Dispatcher() dispatcher.dispatch_api(api)