https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cc5bb28b0cc5005d752c1…
commit cc5bb28b0cc5005d752c1b35a3c8d2e47023fb34
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sat Mar 12 16:13:28 2022 +0100
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Mar 20 19:27:51 2022 +0100
[WINESYNC] msi/tests: Test deferral of RegisterTypeLibraries and
UnregisterTypeLibraries.
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id d3023ad3f7c87f29da762e82c7e0d47f6830df19 by Zebediah Figura
<z.figura12(a)gmail.com>
---
modules/rostests/winetests/msi/CMakeLists.txt | 2 +-
modules/rostests/winetests/msi/action.c | 14 +++++++++++++
modules/rostests/winetests/msi/custom.c | 29 +++++++++++++++++++++++++++
modules/rostests/winetests/msi/custom.spec | 2 ++
4 files changed, 46 insertions(+), 1 deletion(-)
diff --git a/modules/rostests/winetests/msi/CMakeLists.txt
b/modules/rostests/winetests/msi/CMakeLists.txt
index 66187352588..acdd7c13a47 100644
--- a/modules/rostests/winetests/msi/CMakeLists.txt
+++ b/modules/rostests/winetests/msi/CMakeLists.txt
@@ -3,7 +3,7 @@ spec2def(custom.dll custom.spec)
add_library(custom MODULE custom.c ${CMAKE_CURRENT_BINARY_DIR}/custom.def)
target_link_libraries(custom uuid)
set_module_type(custom win32dll)
-add_importlibs(custom msi ole32 odbccp32 shell32 advapi32 msvcrt kernel32)
+add_importlibs(custom msi ole32 oleaut32 odbccp32 shell32 advapi32 msvcrt kernel32)
list(APPEND SOURCE
action.c
diff --git a/modules/rostests/winetests/msi/action.c
b/modules/rostests/winetests/msi/action.c
index 7026a0c5b73..98d030354ca 100644
--- a/modules/rostests/winetests/msi/action.c
+++ b/modules/rostests/winetests/msi/action.c
@@ -1009,14 +1009,27 @@ static const char tl_install_exec_seq_dat[] =
"InstallInitialize\t\t1500\n"
"ProcessComponents\t\t1600\n"
"UnregisterTypeLibraries\t\t3100\n"
+ "ut_immediate\tREMOVE\t3101\n"
+ "ut_deferred\tREMOVE\t3102\n"
"RemoveFiles\t\t3200\n"
"InstallFiles\t\t3300\n"
"RegisterTypeLibraries\t\t3400\n"
+ "rt_immediate\tNOT REMOVE\t3401\n"
+ "rt_deferred\tNOT REMOVE\t3402\n"
"RegisterProduct\t\t5100\n"
"PublishFeatures\t\t5200\n"
"PublishProduct\t\t5300\n"
"InstallFinalize\t\t6000\n";
+static const char tl_custom_action_dat[] =
+ "Action\tType\tSource\tTarget\n"
+ "s72\ti2\tS64\tS0\n"
+ "CustomAction\tAction\n"
+ "rt_immediate\t1\tcustom.dll\ttl_absent\n"
+ "rt_deferred\t1025\tcustom.dll\ttl_present\n"
+ "ut_immediate\t1\tcustom.dll\ttl_present\n"
+ "ut_deferred\t1025\tcustom.dll\ttl_absent\n";
+
static const char crs_file_dat[] =
"File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
"s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
@@ -2149,6 +2162,7 @@ static const msi_table tl_tables[] =
ADD_TABLE(tl_file),
ADD_TABLE(tl_typelib),
ADD_TABLE(tl_install_exec_seq),
+ ADD_TABLE(tl_custom_action),
ADD_TABLE(media),
ADD_TABLE(property)
};
diff --git a/modules/rostests/winetests/msi/custom.c
b/modules/rostests/winetests/msi/custom.c
index 7a3f01ed29a..b7da2b8fcc8 100644
--- a/modules/rostests/winetests/msi/custom.c
+++ b/modules/rostests/winetests/msi/custom.c
@@ -1804,3 +1804,32 @@ todo_wine
return ERROR_SUCCESS;
}
+
+static const GUID LIBID_register_test =
+ {0xeac5166a, 0x9734, 0x4d91, {0x87,0x8f, 0x1d,0xd0,0x23,0x04,0xc6,0x6c}};
+
+UINT WINAPI tl_present(MSIHANDLE hinst)
+{
+ ITypeLib *tlb;
+ HRESULT hr;
+
+ hr = LoadRegTypeLib(&LIBID_register_test, 7, 1, 0, &tlb);
+todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
+ ok(hinst, hr == S_OK, "got %#x\n", hr);
+ if (tlb)
+ ITypeLib_Release(tlb);
+
+ return ERROR_SUCCESS;
+}
+
+UINT WINAPI tl_absent(MSIHANDLE hinst)
+{
+ ITypeLib *tlb;
+ HRESULT hr;
+
+ hr = LoadRegTypeLib(&LIBID_register_test, 7, 1, 0, &tlb);
+todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
+ ok(hinst, hr == TYPE_E_LIBNOTREGISTERED, "got %#x\n", hr);
+
+ return ERROR_SUCCESS;
+}
diff --git a/modules/rostests/winetests/msi/custom.spec
b/modules/rostests/winetests/msi/custom.spec
index eec6a43c0a1..058a9172f1f 100644
--- a/modules/rostests/winetests/msi/custom.spec
+++ b/modules/rostests/winetests/msi/custom.spec
@@ -45,3 +45,5 @@
@ stdcall sis_absent(long)
@ stdcall sss_started(long)
@ stdcall sss_stopped(long)
+@ stdcall tl_present(long)
+@ stdcall tl_absent(long)