Skip to content

Commit cc5bb28

Browse files
winesynclearn-more
authored andcommitted
[WINESYNC] msi/tests: Test deferral of RegisterTypeLibraries and UnregisterTypeLibraries.
Signed-off-by: Zebediah Figura <[email protected]> Signed-off-by: Hans Leidekker <[email protected]> Signed-off-by: Alexandre Julliard <[email protected]> wine commit id d3023ad3f7c87f29da762e82c7e0d47f6830df19 by Zebediah Figura <[email protected]>
1 parent 45a3a9f commit cc5bb28

File tree

4 files changed

+46
-1
lines changed

4 files changed

+46
-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 odbccp32 shell32 advapi32 msvcrt kernel32)
6+
add_importlibs(custom msi ole32 oleaut32 odbccp32 shell32 advapi32 msvcrt kernel32)
77

88
list(APPEND SOURCE
99
action.c

modules/rostests/winetests/msi/action.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,14 +1009,27 @@ static const char tl_install_exec_seq_dat[] =
10091009
"InstallInitialize\t\t1500\n"
10101010
"ProcessComponents\t\t1600\n"
10111011
"UnregisterTypeLibraries\t\t3100\n"
1012+
"ut_immediate\tREMOVE\t3101\n"
1013+
"ut_deferred\tREMOVE\t3102\n"
10121014
"RemoveFiles\t\t3200\n"
10131015
"InstallFiles\t\t3300\n"
10141016
"RegisterTypeLibraries\t\t3400\n"
1017+
"rt_immediate\tNOT REMOVE\t3401\n"
1018+
"rt_deferred\tNOT REMOVE\t3402\n"
10151019
"RegisterProduct\t\t5100\n"
10161020
"PublishFeatures\t\t5200\n"
10171021
"PublishProduct\t\t5300\n"
10181022
"InstallFinalize\t\t6000\n";
10191023

1024+
static const char tl_custom_action_dat[] =
1025+
"Action\tType\tSource\tTarget\n"
1026+
"s72\ti2\tS64\tS0\n"
1027+
"CustomAction\tAction\n"
1028+
"rt_immediate\t1\tcustom.dll\ttl_absent\n"
1029+
"rt_deferred\t1025\tcustom.dll\ttl_present\n"
1030+
"ut_immediate\t1\tcustom.dll\ttl_present\n"
1031+
"ut_deferred\t1025\tcustom.dll\ttl_absent\n";
1032+
10201033
static const char crs_file_dat[] =
10211034
"File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
10221035
"s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
@@ -2149,6 +2162,7 @@ static const msi_table tl_tables[] =
21492162
ADD_TABLE(tl_file),
21502163
ADD_TABLE(tl_typelib),
21512164
ADD_TABLE(tl_install_exec_seq),
2165+
ADD_TABLE(tl_custom_action),
21522166
ADD_TABLE(media),
21532167
ADD_TABLE(property)
21542168
};

modules/rostests/winetests/msi/custom.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,3 +1804,32 @@ todo_wine
18041804

18051805
return ERROR_SUCCESS;
18061806
}
1807+
1808+
static const GUID LIBID_register_test =
1809+
{0xeac5166a, 0x9734, 0x4d91, {0x87,0x8f, 0x1d,0xd0,0x23,0x04,0xc6,0x6c}};
1810+
1811+
UINT WINAPI tl_present(MSIHANDLE hinst)
1812+
{
1813+
ITypeLib *tlb;
1814+
HRESULT hr;
1815+
1816+
hr = LoadRegTypeLib(&LIBID_register_test, 7, 1, 0, &tlb);
1817+
todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
1818+
ok(hinst, hr == S_OK, "got %#x\n", hr);
1819+
if (tlb)
1820+
ITypeLib_Release(tlb);
1821+
1822+
return ERROR_SUCCESS;
1823+
}
1824+
1825+
UINT WINAPI tl_absent(MSIHANDLE hinst)
1826+
{
1827+
ITypeLib *tlb;
1828+
HRESULT hr;
1829+
1830+
hr = LoadRegTypeLib(&LIBID_register_test, 7, 1, 0, &tlb);
1831+
todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
1832+
ok(hinst, hr == TYPE_E_LIBNOTREGISTERED, "got %#x\n", hr);
1833+
1834+
return ERROR_SUCCESS;
1835+
}

modules/rostests/winetests/msi/custom.spec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,5 @@
4545
@ stdcall sis_absent(long)
4646
@ stdcall sss_started(long)
4747
@ stdcall sss_stopped(long)
48+
@ stdcall tl_present(long)
49+
@ stdcall tl_absent(long)

0 commit comments

Comments
 (0)