https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d6a9b26126160d7996540…
commit d6a9b26126160d799654051b415c1c2a37e889be
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sat Mar 12 15:14:53 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 RegisterProgIdInfo and UnregisterProgIdInfo.
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 2fe0388d0cf205926cc9b8686b8f7ebd692261ef by Zebediah Figura
<z.figura12(a)gmail.com>
---
modules/rostests/winetests/msi/action.c | 14 +++++++++
modules/rostests/winetests/msi/custom.c | 50 ++++++++++++++++++++++++++++++
modules/rostests/winetests/msi/custom.spec | 2 ++
3 files changed, 66 insertions(+)
diff --git a/modules/rostests/winetests/msi/action.c
b/modules/rostests/winetests/msi/action.c
index 9409ad19272..22ece567836 100644
--- a/modules/rostests/winetests/msi/action.c
+++ b/modules/rostests/winetests/msi/action.c
@@ -1654,15 +1654,28 @@ static const char rpi_install_exec_seq_dat[] =
"UnregisterClassInfo\t\t3000\n"
"UnregisterExtensionInfo\t\t3200\n"
"UnregisterProgIdInfo\t\t3400\n"
+ "upi_immediate\tREMOVE\t3401\n"
+ "upi_deferred\tREMOVE\t3402\n"
"InstallFiles\t\t3600\n"
"RegisterClassInfo\t\t4000\n"
"RegisterExtensionInfo\t\t4200\n"
"RegisterProgIdInfo\t\t4400\n"
+ "rpi_immediate\tNOT REMOVE\t4401\n"
+ "rpi_deferred\tNOT REMOVE\t4402\n"
"RegisterProduct\t\t5000\n"
"PublishFeatures\t\t5100\n"
"PublishProduct\t\t5200\n"
"InstallFinalize\t\t6000\n";
+static const char rpi_custom_action_dat[] =
+ "Action\tType\tSource\tTarget\n"
+ "s72\ti2\tS64\tS0\n"
+ "CustomAction\tAction\n"
+ "rpi_immediate\t1\tcustom.dll\trpi_absent\n"
+ "rpi_deferred\t1025\tcustom.dll\trpi_present\n"
+ "upi_immediate\t1\tcustom.dll\trpi_present\n"
+ "upi_deferred\t1025\tcustom.dll\trpi_absent\n";
+
static const char rmi_file_dat[] =
"File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
"s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
@@ -2272,6 +2285,7 @@ static const msi_table rpi_tables[] =
ADD_TABLE(rpi_verb),
ADD_TABLE(rpi_progid),
ADD_TABLE(rpi_install_exec_seq),
+ ADD_TABLE(rpi_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 5e9173761fc..f5aa34446e4 100644
--- a/modules/rostests/winetests/msi/custom.c
+++ b/modules/rostests/winetests/msi/custom.c
@@ -1726,3 +1726,53 @@ todo_wine
return ERROR_SUCCESS;
}
+
+UINT WINAPI rpi_present(MSIHANDLE hinst)
+{
+ HKEY key;
+ LONG res;
+
+todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) {
+ res = RegOpenKeyExA(HKEY_CLASSES_ROOT,
"CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}",
+ 0, KEY_READ | KEY_WOW64_32KEY, &key);
+ ok(hinst, !res, "got %u\n", res);
+ RegCloseKey(key);
+
+ res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class.1", &key);
+ ok(hinst, !res, "got %u\n", res);
+ RegCloseKey(key);
+
+ res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class", &key);
+ ok(hinst, !res, "got %u\n", res);
+ RegCloseKey(key);
+
+ res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class.2", &key);
+ ok(hinst, !res, "got %u\n", res);
+ RegCloseKey(key);
+}
+
+ return ERROR_SUCCESS;
+}
+
+UINT WINAPI rpi_absent(MSIHANDLE hinst)
+{
+ HKEY key;
+ LONG res;
+
+todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) {
+ res = RegOpenKeyExA(HKEY_CLASSES_ROOT,
"CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}",
+ 0, KEY_READ | KEY_WOW64_32KEY, &key);
+ ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+
+ res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class.1", &key);
+ ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+
+ res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class", &key);
+ ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+
+ res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class.2", &key);
+ ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+}
+
+ return ERROR_SUCCESS;
+}
diff --git a/modules/rostests/winetests/msi/custom.spec
b/modules/rostests/winetests/msi/custom.spec
index 9dadfbdf753..2b3b76a3499 100644
--- a/modules/rostests/winetests/msi/custom.spec
+++ b/modules/rostests/winetests/msi/custom.spec
@@ -35,6 +35,8 @@
@ stdcall rd_absent(long)
@ stdcall rp_present(long)
@ stdcall rp_absent(long)
+@ stdcall rpi_present(long)
+@ stdcall rpi_absent(long)
@ stdcall sds_present(long)
@ stdcall sds_absent(long)
@ stdcall sis_present(long)