Signed-off-by: Zebediah Figura z.figura12@gmail.com --- 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 248439a..2cfc59b 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 ce36eda..b005529 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 db6d612..4497f3c 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -23,6 +23,7 @@
#include <windef.h> #include <winbase.h> +#include <winsvc.h> #define COBJMACROS #include <shlobj.h> #include <msxml.h> @@ -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 774f77b..1485546 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)