Commit b036ee63 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msi: Register dlls in a separate process.

parent e2900c23
......@@ -4720,27 +4720,27 @@ static UINT ACTION_RemoveIniValues( MSIPACKAGE *package )
static void register_dll( const WCHAR *dll, BOOL unregister )
{
HMODULE hmod;
static const WCHAR regW[] =
{'r','e','g','s','v','r','3','2','.','e','x','e',' ','\"','%','s','\"',0};
static const WCHAR unregW[] =
{'r','e','g','s','v','r','3','2','.','e','x','e',' ','/','u',' ','\"','%','s','\"',0};
PROCESS_INFORMATION pi;
STARTUPINFOW si;
WCHAR *cmd;
hmod = LoadLibraryExW( dll, 0, LOAD_WITH_ALTERED_SEARCH_PATH );
if (hmod)
{
HRESULT (WINAPI *func_ptr)( void );
const char *func = unregister ? "DllUnregisterServer" : "DllRegisterServer";
if (!(cmd = msi_alloc( strlenW(dll) * sizeof(WCHAR) + sizeof(unregW) ))) return;
func_ptr = (void *)GetProcAddress( hmod, func );
if (func_ptr)
if (unregister) sprintfW( cmd, unregW, dll );
else sprintfW( cmd, regW, dll );
memset( &si, 0, sizeof(STARTUPINFOW) );
if (CreateProcessW( NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ))
{
HRESULT hr = func_ptr();
if (FAILED( hr ))
WARN("failed to register dll 0x%08x\n", hr);
CloseHandle( pi.hThread );
msi_dialog_check_messages( pi.hProcess );
CloseHandle( pi.hProcess );
}
else
WARN("entry point %s not found\n", func);
FreeLibrary( hmod );
return;
}
WARN("failed to load library %u\n", GetLastError());
msi_free( cmd );
}
static UINT ITERATE_SelfRegModules(MSIRECORD *row, LPVOID param)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment