Zebediah Figura : msi/tests: Test deferral of RegisterTypeLibraries and UnregisterTypeLibraries.
Alexandre Julliard
julliard at winehq.org
Wed May 30 15:30:50 CDT 2018
Module: wine
Branch: master
Commit: d3023ad3f7c87f29da762e82c7e0d47f6830df19
URL: https://source.winehq.org/git/wine.git/?a=commit;h=d3023ad3f7c87f29da762e82c7e0d47f6830df19
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Wed May 30 10:22:25 2018 +0200
msi/tests: Test deferral of RegisterTypeLibraries and UnregisterTypeLibraries.
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/msi/tests/Makefile.in | 2 +-
dlls/msi/tests/action.c | 14 ++++++++++++++
dlls/msi/tests/custom.c | 29 +++++++++++++++++++++++++++++
dlls/msi/tests/custom.spec | 2 ++
4 files changed, 46 insertions(+), 1 deletion(-)
diff --git a/dlls/msi/tests/Makefile.in b/dlls/msi/tests/Makefile.in
index 5c7e81e..5f85d11 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 odbccp32
-custom_IMPORTS = uuid msi ole32 shell32 advapi32 odbccp32
+custom_IMPORTS = uuid msi ole32 shell32 advapi32 odbccp32 oleaut32
SOURCES = \
action.c \
diff --git a/dlls/msi/tests/action.c b/dlls/msi/tests/action.c
index 1cf9e9e..306bfae 100644
--- a/dlls/msi/tests/action.c
+++ b/dlls/msi/tests/action.c
@@ -1006,14 +1006,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"
@@ -2146,6 +2159,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/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c
index 7a3f01e..b7da2b8 100644
--- a/dlls/msi/tests/custom.c
+++ b/dlls/msi/tests/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/dlls/msi/tests/custom.spec b/dlls/msi/tests/custom.spec
index eec6a43..058a917 100644
--- a/dlls/msi/tests/custom.spec
+++ b/dlls/msi/tests/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)
More information about the wine-cvs
mailing list