From 7e264690cf48e17df7375e47927a1e1f70b2aa3d Mon Sep 17 00:00:00 2001 From: "Dimitrie O. Paun" Date: Wed, 9 Apr 2003 23:34:19 +0000 Subject: [PATCH] We don't need to dlopen the app module before the LoadLibrary(). --- tools/winewrap.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/tools/winewrap.c b/tools/winewrap.c index c61bfa838bf..2b225afb4a7 100644 --- a/tools/winewrap.c +++ b/tools/winewrap.c @@ -173,33 +173,15 @@ static const char *wrapper_code = "int WINAPI main(int argc, char** argv, char** envp)\n" "#endif\n" "{\n" - " void* appLibrary;\n" " HINSTANCE hApp = 0, hMFC = 0, hMain = 0;\n" " void* appMain;\n" - " char* libName;\n" " int retcode;\n" "\n" - " /* Load the application's library */\n" - " libName=(char*)malloc(2+strlen(appName)+3+1);\n" - " /* FIXME: we should get the wrapper's path and use that as the base for\n" - " * the library\n" - " */\n" - " sprintf(libName,\"./%%s.so\",appName);\n" - " appLibrary=dlopen(libName,RTLD_NOW);\n" - " if (appLibrary==NULL) {\n" - " sprintf(libName,\"%%s.so\",appName);\n" - " appLibrary=dlopen(libName,RTLD_NOW);\n" - " }\n" - " if (!appLibrary) error(\"Could not load the %%s library: %%s\", libName, dlerror());\n" - "\n" " /* Then if this application is MFC based, load the MFC module */\n" - " /* FIXME: I'm not sure this is really necessary */\n" " if (mfcModule) {\n" " hMFC = LoadLibrary(mfcModule);\n" " if (!hMFC) error(\"Could not load the MFC module %%s (%%d)\", mfcModule, GetLastError());\n" - " /* MFC is a special case: the WinMain is in the MFC library,\n" - " * instead of the application's library.\n" - " */\n" + " /* For MFC apps, WinMain is in the MFC library */\n" " hMain = hMFC;\n" " }\n" "\n" @@ -223,8 +205,6 @@ static const char *wrapper_code = " /* Cleanup and done */\n" " FreeLibrary(hApp);\n" " FreeLibrary(hMFC);\n" - " dlclose(appLibrary);\n" - " free(libName);\n" "\n" " return retcode;\n" "}\n" -- 2.11.4.GIT