Commit ee4f4a05 authored by Alexandre Julliard's avatar Alexandre Julliard

Avoid unnecessary run-time initializations.

parent fb85c9e9
...@@ -67,12 +67,12 @@ static const WCHAR szComponents[] = { ...@@ -67,12 +67,12 @@ static const WCHAR szComponents[] = {
'C','o','m','p','o','n','e','n','t','s',0 }; 'C','o','m','p','o','n','e','n','t','s',0 };
/* the UI level */ /* the UI level */
INSTALLUILEVEL gUILevel; INSTALLUILEVEL gUILevel = INSTALLUILEVEL_BASIC;
HWND gUIhwnd; HWND gUIhwnd = 0;
INSTALLUI_HANDLERA gUIHandler; INSTALLUI_HANDLERA gUIHandlerA = NULL;
INSTALLUI_HANDLERW gUIHandlerW; INSTALLUI_HANDLERW gUIHandlerW = NULL;
DWORD gUIFilter; DWORD gUIFilter = 0;
LPVOID gUIContext; LPVOID gUIContext = NULL;
WCHAR gszLogFile[MAX_PATH]; WCHAR gszLogFile[MAX_PATH];
/* /*
...@@ -1012,10 +1012,10 @@ INSTALLUILEVEL WINAPI MsiSetInternalUI(INSTALLUILEVEL dwUILevel, HWND *phWnd) ...@@ -1012,10 +1012,10 @@ INSTALLUILEVEL WINAPI MsiSetInternalUI(INSTALLUILEVEL dwUILevel, HWND *phWnd)
INSTALLUI_HANDLERA WINAPI MsiSetExternalUIA(INSTALLUI_HANDLERA puiHandler, INSTALLUI_HANDLERA WINAPI MsiSetExternalUIA(INSTALLUI_HANDLERA puiHandler,
DWORD dwMessageFilter, LPVOID pvContext) DWORD dwMessageFilter, LPVOID pvContext)
{ {
INSTALLUI_HANDLERA prev = gUIHandler; INSTALLUI_HANDLERA prev = gUIHandlerA;
TRACE("%p %lx %p\n",puiHandler, dwMessageFilter,pvContext); TRACE("%p %lx %p\n",puiHandler, dwMessageFilter,pvContext);
gUIHandler = puiHandler; gUIHandlerA = puiHandler;
gUIFilter = dwMessageFilter; gUIFilter = dwMessageFilter;
gUIContext = pvContext; gUIContext = pvContext;
...@@ -1729,15 +1729,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) ...@@ -1729,15 +1729,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{ {
case DLL_PROCESS_ATTACH: case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hinstDLL); DisableThreadLibraryCalls(hinstDLL);
/* UI Initialization */
gUILevel = INSTALLUILEVEL_BASIC;
gUIhwnd = 0;
gUIHandler = NULL;
gUIFilter = 0;
gUIContext = NULL;
gszLogFile[0]=0;
break; break;
case DLL_PROCESS_DETACH: case DLL_PROCESS_DETACH:
/* FIXME: Cleanup */ /* FIXME: Cleanup */
......
...@@ -338,7 +338,8 @@ BOOL decode_base85_guid(LPCWSTR,GUID*); ...@@ -338,7 +338,8 @@ BOOL decode_base85_guid(LPCWSTR,GUID*);
/* UI globals */ /* UI globals */
extern INSTALLUILEVEL gUILevel; extern INSTALLUILEVEL gUILevel;
extern HWND gUIhwnd; extern HWND gUIhwnd;
extern INSTALLUI_HANDLERA gUIHandler; extern INSTALLUI_HANDLERA gUIHandlerA;
extern INSTALLUI_HANDLERW gUIHandlerW;
extern DWORD gUIFilter; extern DWORD gUIFilter;
extern LPVOID gUIContext; extern LPVOID gUIContext;
extern WCHAR gszLogFile[MAX_PATH]; extern WCHAR gszLogFile[MAX_PATH];
......
...@@ -554,7 +554,7 @@ INT MSI_ProcessMessage( MSIPACKAGE *package, INSTALLMESSAGE eMessageType, ...@@ -554,7 +554,7 @@ INT MSI_ProcessMessage( MSIPACKAGE *package, INSTALLMESSAGE eMessageType,
HeapFree(GetProcessHeap(),0,tmp); HeapFree(GetProcessHeap(),0,tmp);
} }
TRACE("(%p %lx %lx %s)\n",gUIHandler, gUIFilter, log_type, TRACE("(%p %lx %lx %s)\n",gUIHandlerA, gUIFilter, log_type,
debugstr_w(message)); debugstr_w(message));
/* convert it to ASCII */ /* convert it to ASCII */
...@@ -564,9 +564,9 @@ INT MSI_ProcessMessage( MSIPACKAGE *package, INSTALLMESSAGE eMessageType, ...@@ -564,9 +564,9 @@ INT MSI_ProcessMessage( MSIPACKAGE *package, INSTALLMESSAGE eMessageType,
WideCharToMultiByte( CP_ACP, 0, message, -1, WideCharToMultiByte( CP_ACP, 0, message, -1,
msg, len, NULL, NULL ); msg, len, NULL, NULL );
if (gUIHandler && (gUIFilter & log_type)) if (gUIHandlerA && (gUIFilter & log_type))
{ {
rc = gUIHandler(gUIContext,eMessageType,msg); rc = gUIHandlerA(gUIContext,eMessageType,msg);
} }
if ((!rc) && (gszLogFile[0]) && !((eMessageType & 0xff000000) == if ((!rc) && (gszLogFile[0]) && !((eMessageType & 0xff000000) ==
......
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