From 5d8e16f7018b4fb0382ec991adc08e1f305bd353 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Thu, 17 May 2018 22:26:10 -0500 Subject: [PATCH] msi/tests: Test deferral of DeleteServices. Signed-off-by: Zebediah Figura Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard --- dlls/msi/tests/Makefile.in | 2 +- dlls/msi/tests/action.c | 10 ++++++++++ dlls/msi/tests/custom.c | 24 ++++++++++++++++++++++++ dlls/msi/tests/custom.spec | 2 ++ 4 files changed, 37 insertions(+), 1 deletion(-) diff --git a/dlls/msi/tests/Makefile.in b/dlls/msi/tests/Makefile.in index 248439a6ecb..2cfc59b7af5 100644 --- a/dlls/msi/tests/Makefile.in +++ b/dlls/msi/tests/Makefile.in @@ -1,7 +1,7 @@ TESTDLL = msi.dll IMPORTS = cabinet msi shell32 ole32 oleaut32 user32 advapi32 version -custom_IMPORTS = uuid msi ole32 shell32 +custom_IMPORTS = uuid msi ole32 shell32 advapi32 SOURCES = \ action.c \ diff --git a/dlls/msi/tests/action.c b/dlls/msi/tests/action.c index ce36edaefd8..b0055294946 100644 --- a/dlls/msi/tests/action.c +++ b/dlls/msi/tests/action.c @@ -282,6 +282,8 @@ static const char sds_install_exec_seq_dat[] = "InstallInitialize\t\t1500\n" "StopServices\t\t5000\n" "DeleteServices\t\t5050\n" + "sds_immediate\tNOT REMOVE\t5051\n" + "sds_deferred\tNOT REMOVE\t5052\n" "MoveFiles\t\t5100\n" "InstallFiles\t\t5200\n" "DuplicateFiles\t\t5300\n" @@ -292,6 +294,13 @@ static const char sds_install_exec_seq_dat[] = "PublishProduct\t\t5700\n" "InstallFinalize\t\t6000\n"; +static const char sds_custom_action_dat[] = + "Action\tType\tSource\tTarget\n" + "s72\ti2\tS64\tS0\n" + "CustomAction\tAction\n" + "sds_immediate\t1\tcustom.dll\tsds_present\n" + "sds_deferred\t1025\tcustom.dll\tsds_absent\n"; + static const char rof_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" "s72\tS38\ts72\ti2\tS255\tS72\n" @@ -1823,6 +1832,7 @@ static const msi_table sds_tables[] = ADD_TABLE(feature_comp), ADD_TABLE(file), ADD_TABLE(sds_install_exec_seq), + ADD_TABLE(sds_custom_action), ADD_TABLE(service_control), ADD_TABLE(service_install), ADD_TABLE(media), diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index db6d61239ec..4497f3cc680 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -23,6 +23,7 @@ #include #include +#include #define COBJMACROS #include #include @@ -1192,3 +1193,26 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) ok(hinst, !pf_exists("msitest\\shortcut.lnk"), "shortcut present\n"); return ERROR_SUCCESS; } + +UINT WINAPI sds_present(MSIHANDLE hinst) +{ + SC_HANDLE manager, service; + manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS); + service = OpenServiceA(manager, "TestService3", GENERIC_ALL); +todo_wine + ok(hinst, !!service, "service absent: %u\n", GetLastError()); + CloseServiceHandle(service); + CloseServiceHandle(manager); + return ERROR_SUCCESS; +} + +UINT WINAPI sds_absent(MSIHANDLE hinst) +{ + SC_HANDLE manager, service; + manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS); + service = OpenServiceA(manager, "TestService3", GENERIC_ALL); + ok(hinst, !service, "service present\n"); + if (service) CloseServiceHandle(service); + CloseServiceHandle(manager); + return ERROR_SUCCESS; +} diff --git a/dlls/msi/tests/custom.spec b/dlls/msi/tests/custom.spec index 774f77bf793..1485546321c 100644 --- a/dlls/msi/tests/custom.spec +++ b/dlls/msi/tests/custom.spec @@ -7,3 +7,5 @@ @ stdcall cf_absent(long) @ stdcall crs_present(long) @ stdcall crs_absent(long) +@ stdcall sds_present(long) +@ stdcall sds_absent(long) -- 2.11.4.GIT