Skip to content
Snippets Groups Projects
Commit 7e264690 authored by Dimitrie O. Paun's avatar Dimitrie O. Paun Committed by Alexandre Julliard
Browse files

We don't need to dlopen the app module before the LoadLibrary().

parent da7d5ac6
No related branches found
No related tags found
No related merge requests found
......@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment