https://git.reactos.org/?p=reactos.git;a=commitdiff;h=07f42a0af167afc14d69a302f8d9bad333750b71

commit 07f42a0af167afc14d69a302f8d9bad333750b71
Author:     winesync <[email protected]>
AuthorDate: Sat Mar 12 15:12:21 2022 +0100
Commit:     Mark Jansen <[email protected]>
CommitDate: Sun Mar 20 19:27:47 2022 +0100

    [WINESYNC] msi/tests: Test deferral of InstallServices.
    
    Signed-off-by: Zebediah Figura <[email protected]>
    Signed-off-by: Hans Leidekker <[email protected]>
    Signed-off-by: Alexandre Julliard <[email protected]>
    
    wine commit id b8f982fa4b190398edce45290cd49159d586a26b by Zebediah Figura 
<[email protected]>
---
 modules/rostests/winetests/msi/action.c    | 31 +++++++++++++++++++++++++++++-
 modules/rostests/winetests/msi/custom.c    | 23 ++++++++++++++++++++++
 modules/rostests/winetests/msi/custom.spec |  2 ++
 3 files changed, 55 insertions(+), 1 deletion(-)

diff --git a/modules/rostests/winetests/msi/action.c 
b/modules/rostests/winetests/msi/action.c
index b0055294946..4abf8675350 100644
--- a/modules/rostests/winetests/msi/action.c
+++ b/modules/rostests/winetests/msi/action.c
@@ -301,6 +301,34 @@ static const char sds_custom_action_dat[] =
     "sds_immediate\t1\tcustom.dll\tsds_present\n"
     "sds_deferred\t1025\tcustom.dll\tsds_absent\n";
 
+static const char sis_install_exec_seq_dat[] =
+    "Action\tCondition\tSequence\n"
+    "s72\tS255\tI2\n"
+    "InstallExecuteSequence\tAction\n"
+    "CostInitialize\t\t800\n"
+    "FileCost\t\t900\n"
+    "CostFinalize\t\t1000\n"
+    "InstallValidate\t\t1400\n"
+    "InstallInitialize\t\t1500\n"
+    "StopServices\t\t5000\n"
+    "DeleteServices\t\t5050\n"
+    "InstallFiles\t\t5200\n"
+    "InstallServices\t\t5400\n"
+    "sis_immediate\tNOT REMOVE\t5401\n"
+    "sis_deferred\tNOT REMOVE\t5402\n"
+    "StartServices\t\t5450\n"
+    "RegisterProduct\t\t5500\n"
+    "PublishFeatures\t\t5600\n"
+    "PublishProduct\t\t5700\n"
+    "InstallFinalize\t\t6000\n";
+
+static const char sis_custom_action_dat[] =
+    "Action\tType\tSource\tTarget\n"
+    "s72\ti2\tS64\tS0\n"
+    "CustomAction\tAction\n"
+    "sis_immediate\t1\tcustom.dll\tsis_absent\n"
+    "sis_deferred\t1025\tcustom.dll\tsis_present\n";
+
 static const char rof_component_dat[] =
     "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
     "s72\tS38\ts72\ti2\tS255\tS72\n"
@@ -1846,7 +1874,8 @@ static const msi_table sis_tables[] =
     ADD_TABLE(feature),
     ADD_TABLE(feature_comp),
     ADD_TABLE(file),
-    ADD_TABLE(sds_install_exec_seq),
+    ADD_TABLE(sis_install_exec_seq),
+    ADD_TABLE(sis_custom_action),
     ADD_TABLE(service_install2),
     ADD_TABLE(media),
     ADD_TABLE(property)
diff --git a/modules/rostests/winetests/msi/custom.c 
b/modules/rostests/winetests/msi/custom.c
index 4497f3cc680..43365041a04 100644
--- a/modules/rostests/winetests/msi/custom.c
+++ b/modules/rostests/winetests/msi/custom.c
@@ -1216,3 +1216,26 @@ UINT WINAPI sds_absent(MSIHANDLE hinst)
     CloseServiceHandle(manager);
     return ERROR_SUCCESS;
 }
+
+UINT WINAPI sis_present(MSIHANDLE hinst)
+{
+    SC_HANDLE manager, service;
+    manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
+    service = OpenServiceA(manager, "TestService", GENERIC_ALL);
+    ok(hinst, !!service, "service absent: %u\n", GetLastError());
+    CloseServiceHandle(service);
+    CloseServiceHandle(manager);
+    return ERROR_SUCCESS;
+}
+
+UINT WINAPI sis_absent(MSIHANDLE hinst)
+{
+    SC_HANDLE manager, service;
+    manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
+    service = OpenServiceA(manager, "TestService", GENERIC_ALL);
+todo_wine
+    ok(hinst, !service, "service present\n");
+    if (service) CloseServiceHandle(service);
+    CloseServiceHandle(manager);
+    return ERROR_SUCCESS;
+}
diff --git a/modules/rostests/winetests/msi/custom.spec 
b/modules/rostests/winetests/msi/custom.spec
index 1485546321c..471f9569711 100644
--- a/modules/rostests/winetests/msi/custom.spec
+++ b/modules/rostests/winetests/msi/custom.spec
@@ -9,3 +9,5 @@
 @ stdcall crs_absent(long)
 @ stdcall sds_present(long)
 @ stdcall sds_absent(long)
+@ stdcall sis_present(long)
+@ stdcall sis_absent(long)

Reply via email to