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 ) ...@@ -4720,27 +4720,27 @@ static UINT ACTION_RemoveIniValues( MSIPACKAGE *package )
static void register_dll( const WCHAR *dll, BOOL unregister ) 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 (!(cmd = msi_alloc( strlenW(dll) * sizeof(WCHAR) + sizeof(unregW) ))) return;
if (hmod)
{
HRESULT (WINAPI *func_ptr)( void );
const char *func = unregister ? "DllUnregisterServer" : "DllRegisterServer";
func_ptr = (void *)GetProcAddress( hmod, func ); if (unregister) sprintfW( cmd, unregW, dll );
if (func_ptr) 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(); CloseHandle( pi.hThread );
if (FAILED( hr )) msi_dialog_check_messages( pi.hProcess );
WARN("failed to register dll 0x%08x\n", hr); CloseHandle( pi.hProcess );
} }
else msi_free( cmd );
WARN("entry point %s not found\n", func);
FreeLibrary( hmod );
return;
}
WARN("failed to load library %u\n", GetLastError());
} }
static UINT ITERATE_SelfRegModules(MSIRECORD *row, LPVOID param) 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