[PATCH 2/2] msi/tests: Add test for special InstallService-ErrorControl-flag
Andreas Maier
andy1.m at gmx.de
Tue May 31 15:44:53 CDT 2016
This test expands a already existing test.
A Service is installed with the special ErrorControl-flag
0x8000 (msidbServiceInstallErrorControlVital).
The flag should be filtered out be msi. The test checks,
if the service is created without this flag.
Reference to BUG-Report: https://bugs.winehq.org/show_bug.cgi?id=40703
Signed-off-by: Andreas Maier <andy1.m at gmx.de>
---
dlls/msi/tests/action.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/dlls/msi/tests/action.c b/dlls/msi/tests/action.c
index 243e61b..3213737 100644
--- a/dlls/msi/tests/action.c
+++ b/dlls/msi/tests/action.c
@@ -234,7 +234,7 @@ static const char service_install2_dat[] =
"LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
"s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
"ServiceInstall\tServiceInstall\n"
- "TestService\tTestService\tTestService\t2\t3\t0\t\t\tTestService\t\t\tservice_comp\t\n"
+ "TestService\tTestService\tTestService\t2\t3\t0x8000\t\t\tTestService\t\t\tservice_comp\t\n"
"TestService4\tTestService4\tTestService4\t2\t3\t0\t\t\tTestService4\t\t\tservice_comp3\t\n";
static const char service_control_dat[] =
@@ -5501,6 +5501,9 @@ static void test_install_services(void)
UINT r;
SC_HANDLE manager, service;
BOOL ret;
+ LONG res;
+ HKEY hKey;
+ DWORD err_control, err_controlsize, err_controltype;
if (is_process_limited())
{
@@ -5532,7 +5535,21 @@ static void test_install_services(void)
service = OpenServiceA(manager, "TestService4", GENERIC_ALL);
ok(service == NULL, "TestService4 installed\n");
CloseServiceHandle(manager);
+
+ /* Check ErrorControl */
+ if (is_64bit)
+ res = RegOpenKeyA(HKEY_LOCAL_MACHINE, "SYSTEM\\Wow6432Node\\CurrentControlSet\\Services\\TestService", &hKey);
+ else
+ res = RegOpenKeyA(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\TestService", &hKey);
+ ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
+ err_control = 0xBEEF;
+ err_controltype = REG_DWORD;
+ err_controlsize = sizeof(err_control);
+ res = RegQueryValueExA(hKey, "ErrorControl", NULL, &err_controltype, (LPBYTE)&err_control, &err_controlsize);
+ ok(err_control == 0, "TestService.ErrorControl wrong, expected 0, got %u\n", err_control);
+ RegCloseKey(hKey);
+
r = MsiInstallProductA(msifile, "REMOVE=ALL");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
--
2.8.1
More information about the wine-patches
mailing list