Skip to content

Commit 49a44f0

Browse files
winesynclearn-more
authored andcommitted
[WINESYNC] msi/tests: Test deferral of DeleteServices.
Signed-off-by: Zebediah Figura <[email protected]> Signed-off-by: Hans Leidekker <[email protected]> Signed-off-by: Alexandre Julliard <[email protected]> wine commit id 5d8e16f7018b4fb0382ec991adc08e1f305bd353 by Zebediah Figura <[email protected]>
1 parent 0c2c386 commit 49a44f0

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed

modules/rostests/winetests/msi/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ spec2def(custom.dll custom.spec)
33
add_library(custom MODULE custom.c ${CMAKE_CURRENT_BINARY_DIR}/custom.def)
44
target_link_libraries(custom uuid)
55
set_module_type(custom win32dll)
6-
add_importlibs(custom msi ole32 shell32 msvcrt kernel32)
6+
add_importlibs(custom msi ole32 shell32 advapi32 msvcrt kernel32)
77

88
list(APPEND SOURCE
99
action.c

modules/rostests/winetests/msi/action.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,8 @@ static const char sds_install_exec_seq_dat[] =
282282
"InstallInitialize\t\t1500\n"
283283
"StopServices\t\t5000\n"
284284
"DeleteServices\t\t5050\n"
285+
"sds_immediate\tNOT REMOVE\t5051\n"
286+
"sds_deferred\tNOT REMOVE\t5052\n"
285287
"MoveFiles\t\t5100\n"
286288
"InstallFiles\t\t5200\n"
287289
"DuplicateFiles\t\t5300\n"
@@ -292,6 +294,13 @@ static const char sds_install_exec_seq_dat[] =
292294
"PublishProduct\t\t5700\n"
293295
"InstallFinalize\t\t6000\n";
294296

297+
static const char sds_custom_action_dat[] =
298+
"Action\tType\tSource\tTarget\n"
299+
"s72\ti2\tS64\tS0\n"
300+
"CustomAction\tAction\n"
301+
"sds_immediate\t1\tcustom.dll\tsds_present\n"
302+
"sds_deferred\t1025\tcustom.dll\tsds_absent\n";
303+
295304
static const char rof_component_dat[] =
296305
"Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
297306
"s72\tS38\ts72\ti2\tS255\tS72\n"
@@ -1823,6 +1832,7 @@ static const msi_table sds_tables[] =
18231832
ADD_TABLE(feature_comp),
18241833
ADD_TABLE(file),
18251834
ADD_TABLE(sds_install_exec_seq),
1835+
ADD_TABLE(sds_custom_action),
18261836
ADD_TABLE(service_control),
18271837
ADD_TABLE(service_install),
18281838
ADD_TABLE(media),

modules/rostests/winetests/msi/custom.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#include <windef.h>
2525
#include <winbase.h>
26+
#include <winsvc.h>
2627
#define COBJMACROS
2728
#include <shlobj.h>
2829
#include <msxml.h>
@@ -1192,3 +1193,26 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
11921193
ok(hinst, !pf_exists("msitest\\shortcut.lnk"), "shortcut present\n");
11931194
return ERROR_SUCCESS;
11941195
}
1196+
1197+
UINT WINAPI sds_present(MSIHANDLE hinst)
1198+
{
1199+
SC_HANDLE manager, service;
1200+
manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
1201+
service = OpenServiceA(manager, "TestService3", GENERIC_ALL);
1202+
todo_wine
1203+
ok(hinst, !!service, "service absent: %u\n", GetLastError());
1204+
CloseServiceHandle(service);
1205+
CloseServiceHandle(manager);
1206+
return ERROR_SUCCESS;
1207+
}
1208+
1209+
UINT WINAPI sds_absent(MSIHANDLE hinst)
1210+
{
1211+
SC_HANDLE manager, service;
1212+
manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
1213+
service = OpenServiceA(manager, "TestService3", GENERIC_ALL);
1214+
ok(hinst, !service, "service present\n");
1215+
if (service) CloseServiceHandle(service);
1216+
CloseServiceHandle(manager);
1217+
return ERROR_SUCCESS;
1218+
}

modules/rostests/winetests/msi/custom.spec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@
77
@ stdcall cf_absent(long)
88
@ stdcall crs_present(long)
99
@ stdcall crs_absent(long)
10+
@ stdcall sds_present(long)
11+
@ stdcall sds_absent(long)

0 commit comments

Comments
 (0)