https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5239ed572c8942d09bbfe4d1102f70b80cc945ef

commit 5239ed572c8942d09bbfe4d1102f70b80cc945ef
Author:     winesync <[email protected]>
AuthorDate: Sat Mar 12 16:34:03 2022 +0100
Commit:     Mark Jansen <[email protected]>
CommitDate: Sun Mar 20 19:27:52 2022 +0100

    [WINESYNC] msi/tests: Test deferral of WriteIniValues and RemoveIniValues.
    
    Signed-off-by: Zebediah Figura <[email protected]>
    Signed-off-by: Hans Leidekker <[email protected]>
    Signed-off-by: Alexandre Julliard <[email protected]>
    
    wine commit id 377d32c4fb6ea72c68436eb590541ec88d0c74f9 by Zebediah Figura 
<[email protected]>
---
 modules/rostests/winetests/msi/action.c    | 14 +++++++++++++
 modules/rostests/winetests/msi/custom.c    | 32 ++++++++++++++++++++++++++++++
 modules/rostests/winetests/msi/custom.spec |  2 ++
 3 files changed, 48 insertions(+)

diff --git a/modules/rostests/winetests/msi/action.c 
b/modules/rostests/winetests/msi/action.c
index b22462223bf..35f851f21e7 100644
--- a/modules/rostests/winetests/msi/action.c
+++ b/modules/rostests/winetests/msi/action.c
@@ -1457,12 +1457,25 @@ static const char ini_install_exec_seq_dat[] =
     "RemoveFiles\t\t1700\n"
     "InstallFiles\t\t2000\n"
     "RemoveIniValues\t\t3000\n"
+    "riv_immediate\tREMOVE\t3001\n"
+    "riv_deferred\tREMOVE\t3002\n"
     "WriteIniValues\t\t3100\n"
+    "wiv_immediate\tNOT REMOVE\t3101\n"
+    "wiv_deferred\tNOT REMOVE\t3102\n"
     "RegisterProduct\t\t5000\n"
     "PublishFeatures\t\t5100\n"
     "PublishProduct\t\t5200\n"
     "InstallFinalize\t\t6000\n";
 
+static const char ini_custom_action_dat[] =
+    "Action\tType\tSource\tTarget\n"
+    "s72\ti2\tS64\tS0\n"
+    "CustomAction\tAction\n"
+    "wiv_immediate\t1\tcustom.dll\tini_absent\n"
+    "wiv_deferred\t1025\tcustom.dll\tini_present\n"
+    "riv_immediate\t1\tcustom.dll\tini_present\n"
+    "riv_deferred\t1025\tcustom.dll\tini_absent\n";
+
 static const char rci_file_dat[] =
     
"File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
     "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
@@ -2260,6 +2273,7 @@ static const msi_table ini_tables[] =
     ADD_TABLE(ini_ini_file),
     ADD_TABLE(ini_remove_ini_file),
     ADD_TABLE(ini_install_exec_seq),
+    ADD_TABLE(ini_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 b1823043df2..3e742e381bc 100644
--- a/modules/rostests/winetests/msi/custom.c
+++ b/modules/rostests/winetests/msi/custom.c
@@ -1890,3 +1890,35 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) {
 
     return ERROR_SUCCESS;
 }
+
+UINT WINAPI ini_present(MSIHANDLE hinst)
+{
+    char path[MAX_PATH], buf[10];
+    DWORD len;
+
+    if (FAILED(SHGetFolderPathA(NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, path)))
+        SHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES, NULL, 0, path);
+    strcat(path, "\\msitest\\test.ini");
+
+    len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), 
path);
+todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
+    ok(hinst, len == 6, "got %u\n", len);
+
+    return ERROR_SUCCESS;
+}
+
+UINT WINAPI ini_absent(MSIHANDLE hinst)
+{
+    char path[MAX_PATH], buf[10];
+    DWORD len;
+
+    if (FAILED(SHGetFolderPathA(NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, path)))
+        SHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES, NULL, 0, path);
+    strcat(path, "\\msitest\\test.ini");
+
+    len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), 
path);
+todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
+    ok(hinst, !len, "got %u\n", len);
+
+    return ERROR_SUCCESS;
+}
diff --git a/modules/rostests/winetests/msi/custom.spec 
b/modules/rostests/winetests/msi/custom.spec
index 8b3c2fbf389..bfd83928e44 100644
--- a/modules/rostests/winetests/msi/custom.spec
+++ b/modules/rostests/winetests/msi/custom.spec
@@ -13,6 +13,8 @@
 @ stdcall file_absent(long)
 @ stdcall font_present(long)
 @ stdcall font_absent(long)
+@ stdcall ini_present(long)
+@ stdcall ini_absent(long)
 @ stdcall mov_present(long)
 @ stdcall mov_absent(long)
 @ stdcall odbc_present(long)

Reply via email to