msi: Unicode and ANSI global UI handlers are mutually exclusive.

This commit is contained in:
Hans Leidekker 2009-11-02 10:03:39 +01:00 committed by Alexandre Julliard
parent 4b5248c9e0
commit 90fa4fe155
2 changed files with 40 additions and 4 deletions

View File

@ -1905,8 +1905,9 @@ INSTALLUI_HANDLERA WINAPI MsiSetExternalUIA(INSTALLUI_HANDLERA puiHandler,
TRACE("%p %08x %p\n", puiHandler, dwMessageFilter, pvContext);
gUIHandlerA = puiHandler;
gUIFilter = dwMessageFilter;
gUIContext = pvContext;
gUIHandlerW = NULL;
gUIFilter = dwMessageFilter;
gUIContext = pvContext;
return prev;
}
@ -1918,9 +1919,10 @@ INSTALLUI_HANDLERW WINAPI MsiSetExternalUIW(INSTALLUI_HANDLERW puiHandler,
TRACE("%p %08x %p\n", puiHandler, dwMessageFilter, pvContext);
gUIHandlerA = NULL;
gUIHandlerW = puiHandler;
gUIFilter = dwMessageFilter;
gUIContext = pvContext;
gUIFilter = dwMessageFilter;
gUIContext = pvContext;
return prev;
}

View File

@ -6871,6 +6871,39 @@ static void test_file_in_use_cab(void)
delete_test_files();
}
INT CALLBACK handler_a(LPVOID context, UINT type, LPCSTR msg) { return IDOK; };
INT CALLBACK handler_w(LPVOID context, UINT type, LPCWSTR msg) { return IDOK; };
static void test_MsiSetExternalUI(void)
{
INSTALLUI_HANDLERA ret_a;
INSTALLUI_HANDLERW ret_w;
ret_a = MsiSetExternalUIA(handler_a, INSTALLLOGMODE_ERROR, NULL);
ok(ret_a == NULL, "expected NULL, got %p\n", ret_a);
ret_a = MsiSetExternalUIA(NULL, 0, NULL);
ok(ret_a == handler_a, "expected %p, got %p\n", handler_a, ret_a);
ret_w = MsiSetExternalUIW(handler_w, INSTALLLOGMODE_ERROR, NULL);
ok(ret_w == NULL, "expected NULL, got %p\n", ret_w);
ret_w = MsiSetExternalUIW(NULL, 0, NULL);
ok(ret_w == handler_w, "expected %p, got %p\n", handler_w, ret_w);
ret_a = MsiSetExternalUIA(handler_a, INSTALLLOGMODE_ERROR, NULL);
ok(ret_a == NULL, "expected NULL, got %p\n", ret_a);
ret_w = MsiSetExternalUIW(handler_w, INSTALLLOGMODE_ERROR, NULL);
ok(ret_w == NULL, "expected NULL, got %p\n", ret_w);
ret_a = MsiSetExternalUIA(NULL, 0, NULL);
ok(ret_a == NULL, "expected NULL, got %p\n", ret_a);
ret_w = MsiSetExternalUIW(NULL, 0, NULL);
ok(ret_w == NULL, "expected NULL, got %p\n", ret_w);
}
START_TEST(install)
{
DWORD len;
@ -6959,6 +6992,7 @@ START_TEST(install)
test_installed_prop();
test_file_in_use();
test_file_in_use_cab();
test_MsiSetExternalUI();
DeleteFileA(log_file);