https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4ad772129d53f4019a214…
commit 4ad772129d53f4019a214d61284fbae095c075f4
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sat Mar 12 23:57:40 2022 +0100
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Mar 20 19:28:01 2022 +0100
[WINESYNC] msi/tests: Add more tests for remote MsiSummaryInfoGetProperty.
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id 69b7e09fa76d73c51fd290b511400060ef7c20f0 by Dmitry Timoshkov
<dmitry(a)baikal.ru>
---
modules/rostests/winetests/msi/custom.c | 69 ++++++++++++++++++++++-----------
1 file changed, 46 insertions(+), 23 deletions(-)
diff --git a/modules/rostests/winetests/msi/custom.c
b/modules/rostests/winetests/msi/custom.c
index a727bbd4df0..f06aee06755 100644
--- a/modules/rostests/winetests/msi/custom.c
+++ b/modules/rostests/winetests/msi/custom.c
@@ -277,10 +277,14 @@ static void test_props(MSIHANDLE hinst)
static void test_db(MSIHANDLE hinst)
{
+ static const UINT prop_type[20] = { VT_EMPTY, VT_EMPTY, VT_LPSTR, VT_EMPTY,
VT_EMPTY,
+ VT_EMPTY, VT_EMPTY, VT_LPSTR, VT_EMPTY,
VT_LPSTR,
+ VT_EMPTY, VT_EMPTY, VT_EMPTY, VT_EMPTY, VT_I4,
+ VT_I4, VT_EMPTY, VT_EMPTY, VT_EMPTY, VT_EMPTY };
MSIHANDLE hdb, view, rec, rec2, suminfo;
char buffer[10];
DWORD sz;
- UINT r, count, type;
+ UINT r, count, type, i;
INT int_value;
FILETIME ft;
@@ -466,30 +470,49 @@ static void test_db(MSIHANDLE hinst)
r = MsiSummaryInfoGetPropertyA(suminfo, 0, NULL, NULL, NULL, NULL, NULL);
ok(hinst, r == RPC_X_NULL_REF_POINTER, "got %u\n", r);
- type = 0xdeadbeef;
- int_value = 0xdeadbeef;
- strcpy(buffer, "deadbeef");
- sz = sizeof(buffer);
- r = MsiSummaryInfoGetPropertyA(suminfo, PID_AUTHOR, &type, &int_value,
&ft, buffer, &sz);
- ok(hinst, !r, "got %u\n", r);
- ok(hinst, type == 0, "got %u\n", type);
- ok(hinst, int_value == 0, "got %u\n", int_value);
- ok(hinst, sz == sizeof(buffer), "got %u\n", sz);
- ok(hinst, !lstrcmpA(buffer, "deadbeef"), "got %s\n", buffer);
+ for (i = 0; i < 20; i++)
+ {
+ /* for some reason query for PID_TITLE leads to install failure under Windows */
+ if (i == PID_TITLE) continue;
+
+ type = 0xdeadbeef;
+ int_value = 0xdeadbeef;
+ *buffer = 0;
+ sz = sizeof(buffer);
+ r = MsiSummaryInfoGetPropertyA(suminfo, i, &type, &int_value, &ft,
buffer, &sz);
+ if (sz == sizeof(buffer) || i == PID_TEMPLATE)
+ ok(hinst, !r, "%u: got %u\n", i, r);
+ else
+ ok(hinst, r == ERROR_MORE_DATA, "%u: got %u\n", i, r);
+ ok(hinst, type == prop_type[i], "%u: expected %u, got %u\n", i,
prop_type[i], type);
+ if (i == PID_PAGECOUNT)
+ ok(hinst, int_value == 100, "%u: got %u\n", i, int_value);
+ else
+ ok(hinst, int_value == 0, "%u: got %u\n", i, int_value);
+ if (i == PID_TEMPLATE)
+ {
+ ok(hinst, sz == 5, "%u: got %u\n", i, sz);
+ ok(hinst, !lstrcmpA(buffer, ";1033"), "%u: got %s\n", i,
buffer);
+ }
+ else if (i == PID_REVNUMBER)
+ {
+ ok(hinst, sz == 76, "%u: got %u\n", i, sz);
+ ok(hinst, !lstrcmpA(buffer, "{004757CA"), "%u: got %s\n",
i, buffer);
+ }
+ else
+ {
+ ok(hinst, sz == sizeof(buffer), "%u: got %u\n", i, sz);
+ ok(hinst, !*buffer, "%u: got %s\n", i, buffer);
+ }
+ }
- type = 0xdeadbeef;
- int_value = 0xdeadbeef;
- strcpy(buffer, "deadbeef");
- sz = sizeof(buffer);
- r = MsiSummaryInfoGetPropertyA(suminfo, PID_CODEPAGE, &type, &int_value,
&ft, buffer, &sz);
- ok(hinst, !r, "got %u\n", r);
- ok(hinst, type == 0, "got %u\n", type);
- ok(hinst, int_value == 0, "got %u\n", int_value);
- ok(hinst, sz == sizeof(buffer), "got %u\n", sz);
- ok(hinst, !lstrcmpA(buffer, "deadbeef"), "got %s\n", buffer);
+ GetSystemTimeAsFileTime(&ft);
- r = MsiSummaryInfoSetPropertyA(suminfo, PID_CODEPAGE, VT_I2, 1252, &ft,
"");
- ok(hinst, r == ERROR_FUNCTION_FAILED, "got %u\n", r);
+ for (i = 0; i < 20; i++)
+ {
+ r = MsiSummaryInfoSetPropertyA(suminfo, i, prop_type[i], 1252, &ft,
"");
+ ok(hinst, r == ERROR_FUNCTION_FAILED, "%u: got %u\n", i, r);
+ }
r = MsiSummaryInfoSetPropertyW(suminfo, PID_CODEPAGE, VT_I2, 1252, &ft, NULL);
ok(hinst, r == ERROR_FUNCTION_FAILED, "got %u\n", r);