[MSI_WINETEST] Add a PCH.
[reactos.git] / modules / rostests / winetests / msi / suminfo.c
1 /*
2 * Copyright (C) 2005 Mike McCormack for CodeWeavers
3 *
4 * A test program for MSI database files.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21 #include "precomp.h"
22
23 /*
24 * The following are defined in Windows SDK's msidefs.h
25 * but that file doesn't exist in the msvc6 header set.
26 *
27 * Some are already defined in PropIdl.h - undefine them
28 */
29 #undef PID_DICTIONARY
30 #undef PID_CODEPAGE
31 #undef PID_SUBJECT
32 #undef PID_SECURITY
33
34 #define PID_DICTIONARY 0
35 #define PID_CODEPAGE 1
36 #define PID_TITLE 2
37 #define PID_SUBJECT 3
38 #define PID_AUTHOR 4
39 #define PID_KEYWORDS 5
40 #define PID_COMMENTS 6
41 #define PID_TEMPLATE 7
42 #define PID_LASTAUTHOR 8
43 #define PID_REVNUMBER 9
44 #define PID_EDITTINE 10
45 #define PID_LASTPRINTED 11
46 #define PID_CREATE_DTM 12
47 #define PID_LASTSAVE_DTM 13
48 #define PID_PAGECOUNT 14
49 #define PID_WORDCOUNT 15
50 #define PID_CHARCOUNT 16
51 #define PID_THUMBNAIL 17
52 #define PID_APPNAME 18
53 #define PID_SECURITY 19
54 #define PID_MSIVERSION PID_PAGECOUNT
55 #define PID_MSISOURCE PID_WORDCOUNT
56 #define PID_MSIRESTRICT PID_CHARCOUNT
57
58 static const char *msifile = "winetest-suminfo.msi";
59 static const WCHAR msifileW[] = {
60 'w','i','n','e','t','e','s','t','-','s','u','m','i','n','f','o','.','m','s','i',0 };
61
62 static void test_suminfo(void)
63 {
64 MSIHANDLE hdb = 0, hsuminfo;
65 UINT r, count, type;
66 DWORD sz;
67 INT val;
68 FILETIME ft;
69 char buf[0x10];
70
71 DeleteFileA(msifile);
72
73 /* just MsiOpenDatabase should not create a file */
74 r = MsiOpenDatabaseW(msifileW, MSIDBOPEN_CREATE, &hdb);
75 ok(r == ERROR_SUCCESS, "MsiOpenDatabase failed\n");
76
77 r = MsiGetSummaryInformationA(hdb, NULL, 0, NULL);
78 ok(r == ERROR_INVALID_PARAMETER, "MsiGetSummaryInformation wrong error\n");
79
80 r = MsiGetSummaryInformationA(hdb, NULL, 0, &hsuminfo);
81 ok(r == ERROR_SUCCESS, "MsiGetSummaryInformation failed %u\n", r);
82
83 r = MsiCloseHandle(hsuminfo);
84 ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n");
85
86 r = MsiGetSummaryInformationA(0, "", 0, &hsuminfo);
87 todo_wine
88 ok(r == ERROR_INSTALL_PACKAGE_INVALID || r == ERROR_INSTALL_PACKAGE_OPEN_FAILED,
89 "MsiGetSummaryInformation failed %u\n", r);
90
91 r = MsiGetSummaryInformationA(hdb, "", 0, &hsuminfo);
92 ok(r == ERROR_SUCCESS, "MsiGetSummaryInformation failed %u\n", r);
93
94 r = MsiSummaryInfoGetPropertyCount(0, NULL);
95 ok(r == ERROR_INVALID_HANDLE, "getpropcount failed\n");
96
97 r = MsiSummaryInfoGetPropertyCount(hsuminfo, NULL);
98 ok(r == ERROR_SUCCESS, "getpropcount failed\n");
99
100 count = -1;
101 r = MsiSummaryInfoGetPropertyCount(hsuminfo, &count);
102 ok(r == ERROR_SUCCESS, "getpropcount failed\n");
103 ok(count == 0, "count should be zero\n");
104
105 r = MsiSummaryInfoGetPropertyA(hsuminfo, 0, NULL, NULL, NULL, 0, NULL);
106 ok(r == ERROR_SUCCESS, "getpropcount failed\n");
107
108 r = MsiSummaryInfoGetPropertyA(hsuminfo, -1, NULL, NULL, NULL, 0, NULL);
109 ok(r == ERROR_UNKNOWN_PROPERTY, "MsiSummaryInfoGetProperty wrong error\n");
110
111 r = MsiSummaryInfoGetPropertyA(hsuminfo, PID_SECURITY+1, NULL, NULL, NULL, 0, NULL);
112 ok(r == ERROR_UNKNOWN_PROPERTY, "MsiSummaryInfoGetProperty wrong error\n");
113
114 type = -1;
115 r = MsiSummaryInfoGetPropertyA(hsuminfo, 0, &type, NULL, NULL, 0, NULL);
116 ok(r == ERROR_SUCCESS, "getpropcount failed\n");
117 ok(type == 0, "wrong type\n");
118
119 type = -1;
120 val = 1234;
121 r = MsiSummaryInfoGetPropertyA(hsuminfo, 0, &type, &val, NULL, 0, NULL);
122 ok(r == ERROR_SUCCESS, "getpropcount failed\n");
123 ok(type == 0, "wrong type\n");
124 ok(val == 1234, "wrong val\n");
125
126 buf[0]='x';
127 buf[1]=0;
128 sz = 0x10;
129 r = MsiSummaryInfoGetPropertyA(hsuminfo, PID_REVNUMBER, &type, &val, NULL, buf, &sz);
130 ok(r == ERROR_SUCCESS, "getpropcount failed\n");
131 ok(buf[0]=='x', "cleared buffer\n");
132 ok(sz == 0x10, "count wasn't zero\n");
133 ok(type == VT_EMPTY, "should be empty\n");
134
135 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_TITLE, VT_LPSTR, 0, NULL, "Mike");
136 ok(r == ERROR_FUNCTION_FAILED, "MsiSummaryInfoSetProperty wrong error\n");
137
138 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_TITLE, VT_LPSTR, 1, NULL, "JungAh");
139 ok(r == ERROR_FUNCTION_FAILED, "MsiSummaryInfoSetProperty wrong error\n");
140
141 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_TITLE, VT_LPSTR, 1, &ft, "Mike");
142 ok(r == ERROR_FUNCTION_FAILED, "MsiSummaryInfoSetProperty wrong error\n");
143
144 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_CODEPAGE, VT_I2, 1, &ft, "JungAh");
145 ok(r == ERROR_FUNCTION_FAILED, "MsiSummaryInfoSetProperty wrong error\n");
146
147 r = MsiCloseHandle(hsuminfo);
148 ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n");
149
150 /* try again with the update count set */
151 r = MsiGetSummaryInformationA(hdb, NULL, 1, &hsuminfo);
152 ok(r == ERROR_SUCCESS, "MsiGetSummaryInformation failed\n");
153
154 r = MsiSummaryInfoSetPropertyA(hsuminfo, 0, VT_LPSTR, 1, NULL, NULL);
155 ok(r == ERROR_DATATYPE_MISMATCH, "MsiSummaryInfoSetProperty wrong error\n");
156
157 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_CODEPAGE, VT_LPSTR, 1, NULL, NULL);
158 ok(r == ERROR_DATATYPE_MISMATCH, "MsiSummaryInfoSetProperty wrong error\n");
159
160 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_TITLE, VT_I4, 0, NULL, "Mike");
161 ok(r == ERROR_DATATYPE_MISMATCH, "MsiSummaryInfoSetProperty wrong error\n");
162
163 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_AUTHOR, VT_I4, 0, NULL, "JungAh");
164 ok(r == ERROR_DATATYPE_MISMATCH, "MsiSummaryInfoSetProperty wrong error\n");
165
166 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_KEYWORDS, VT_I2, 0, NULL, "Mike");
167 ok(r == ERROR_DATATYPE_MISMATCH, "MsiSummaryInfoSetProperty wrong error\n");
168
169 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_COMMENTS, VT_FILETIME, 0, NULL, "JungAh");
170 ok(r == ERROR_DATATYPE_MISMATCH, "MsiSummaryInfoSetProperty wrong error\n");
171
172 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_TEMPLATE, VT_I2, 0, NULL, "Mike");
173 ok(r == ERROR_DATATYPE_MISMATCH, "MsiSummaryInfoSetProperty wrong error\n");
174
175 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_LASTAUTHOR, VT_LPSTR, 0, NULL, NULL);
176 ok(r == ERROR_INVALID_PARAMETER, "MsiSummaryInfoSetProperty wrong error\n");
177
178 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_LASTSAVE_DTM, VT_FILETIME, 0, NULL, NULL);
179 ok(r == ERROR_INVALID_PARAMETER, "MsiSummaryInfoSetProperty wrong error\n");
180
181 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_LASTAUTHOR, VT_LPWSTR, 0, NULL, "h\0i\0\0");
182 ok(r == ERROR_DATATYPE_MISMATCH, "MsiSummaryInfoSetProperty wrong error\n");
183
184 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_REVNUMBER, VT_I4, 0, NULL, "Jungah");
185 ok(r == ERROR_DATATYPE_MISMATCH, "MsiSummaryInfoSetProperty wrong error\n");
186
187 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_PAGECOUNT, VT_LPSTR, 1, NULL, NULL);
188 ok(r == ERROR_DATATYPE_MISMATCH, "MsiSummaryInfoSetProperty wrong error\n");
189
190 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_TITLE, VT_LPSTR, 0, NULL, "Mike");
191 ok(r == ERROR_SUCCESS, "MsiSummaryInfoSetProperty failed\n");
192
193 sz = 2;
194 strcpy(buf,"x");
195 r = MsiSummaryInfoGetPropertyA(hsuminfo, PID_TITLE, &type, NULL, NULL, buf, &sz );
196 ok(r == ERROR_MORE_DATA, "MsiSummaryInfoSetProperty failed\n");
197 ok(sz == 4, "count was wrong\n");
198 ok(type == VT_LPSTR, "type was wrong\n");
199 ok(!strcmp(buf,"M"), "buffer was wrong\n");
200
201 sz = 4;
202 strcpy(buf,"x");
203 r = MsiSummaryInfoGetPropertyA(hsuminfo, PID_TITLE, &type, NULL, NULL, buf, &sz );
204 ok(r == ERROR_MORE_DATA, "MsiSummaryInfoSetProperty failed\n");
205 ok(sz == 4, "count was wrong\n");
206 ok(type == VT_LPSTR, "type was wrong\n");
207 ok(!strcmp(buf,"Mik"), "buffer was wrong\n");
208
209 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_TITLE, VT_LPSTR, 0, NULL, "JungAh");
210 ok(r == ERROR_SUCCESS, "MsiSummaryInfoSetProperty failed\n");
211
212 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_CODEPAGE, VT_I2, 1, &ft, "Mike");
213 ok(r == ERROR_FUNCTION_FAILED, "MsiSummaryInfoSetProperty wrong error\n");
214
215 r = MsiCloseHandle(hsuminfo);
216 ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n");
217
218 /* try again with a higher update count */
219 r = MsiGetSummaryInformationA(hdb, NULL, 10, &hsuminfo);
220 ok(r == ERROR_SUCCESS, "MsiGetSummaryInformation failed\n");
221
222 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_TITLE, VT_LPSTR, 0, NULL, "JungAh");
223 ok(r == ERROR_SUCCESS, "MsiSummaryInfoSetProperty failed\n");
224
225 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_CODEPAGE, VT_LPSTR, 1, NULL, NULL);
226 ok(r == ERROR_DATATYPE_MISMATCH, "MsiSummaryInfoSetProperty wrong error\n");
227
228 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_CODEPAGE, VT_I2, 1, NULL, NULL);
229 ok(r == ERROR_SUCCESS, "MsiSummaryInfoSetProperty wrong error\n");
230
231 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_CODEPAGE, VT_I2, 1, &ft, "Mike");
232 ok(r == ERROR_SUCCESS, "MsiSummaryInfoSetProperty wrong error\n");
233
234 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_AUTHOR, VT_LPSTR, 1, &ft, "Mike");
235 ok(r == ERROR_SUCCESS, "MsiSummaryInfoSetProperty wrong error\n");
236
237 r = MsiSummaryInfoPersist(hsuminfo);
238 ok(r == ERROR_SUCCESS, "MsiSummaryInfoPersist failed\n");
239
240 MsiDatabaseCommit(hdb);
241
242 r = MsiCloseHandle(hsuminfo);
243 ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n");
244
245 r = MsiCloseHandle(hdb);
246 ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n");
247
248 /* filename, non-zero update count */
249 r = MsiGetSummaryInformationA(0, msifile, 1, &hsuminfo);
250 ok(r == ERROR_SUCCESS, "MsiGetSummaryInformation failed\n");
251
252 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_AUTHOR, VT_LPSTR, 1, &ft, "Mike");
253 ok(r == ERROR_SUCCESS, "MsiSummaryInfoSetProperty wrong error\n");
254
255 r = MsiSummaryInfoPersist(hsuminfo);
256 ok(r == ERROR_SUCCESS, "MsiSummaryInfoPersist failed %u\n", r);
257
258 r = MsiCloseHandle(hsuminfo);
259 ok(r == ERROR_SUCCESS, "MsiCloseHandle failed %u\n", r);
260
261 /* filename, zero update count */
262 r = MsiGetSummaryInformationA(0, msifile, 0, &hsuminfo);
263 ok(r == ERROR_SUCCESS, "MsiGetSummaryInformation failed %u\n", r);
264
265 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_AUTHOR, VT_LPSTR, 1, &ft, "Mike");
266 todo_wine ok(r == ERROR_FUNCTION_FAILED, "MsiSummaryInfoSetProperty wrong error, %u\n", r);
267
268 r = MsiSummaryInfoPersist(hsuminfo);
269 ok(r == ERROR_FUNCTION_FAILED, "MsiSummaryInfoPersist wrong error %u\n", r);
270
271 r = MsiCloseHandle(hsuminfo);
272 ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n");
273
274 r = DeleteFileA(msifile);
275 ok(r, "DeleteFile failed\n");
276 }
277
278 static const WCHAR tb[] = { 0x4840, 0x3f7f, 0x4164, 0x422f, 0x4836, 0 }; /* _Tables */
279 static const WCHAR sd[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3b6a, 0x45e4, 0x4824, 0 }; /* _StringData */
280 static const WCHAR sp[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3e6a, 0x44b2, 0x482f, 0 }; /* _StringPool */
281
282 #define LOSE_CONST(x) ((LPSTR)(UINT_PTR)(x))
283
284 static void test_create_database_binary(void)
285 {
286 static const CLSID CLSID_MsiDatabase =
287 { 0xc1084, 0, 0, {0xc0, 0, 0, 0, 0, 0, 0, 0x46 } };
288 static const CLSID IID_IPropertySetStorage =
289 { 0x13a, 0, 0, {0xc0, 0, 0, 0, 0, 0, 0, 0x46 } };
290 static const CLSID FMTID_SummaryInformation =
291 { 0xf29f85e0, 0x4ff9, 0x1068, {0xab, 0x91, 0x08, 0x00, 0x2b, 0x27, 0xb3, 0xd9}};
292 DWORD mode = STGM_CREATE | STGM_READWRITE | STGM_DIRECT | STGM_SHARE_EXCLUSIVE;
293 IPropertySetStorage *pss = NULL;
294 IPropertyStorage *ps = NULL;
295 IStorage *stg = NULL;
296 IStream *stm = NULL;
297 HRESULT r;
298 PROPSPEC propspec[10];
299 PROPVARIANT propvar[10];
300 USHORT data[2] = { 0, 0 };
301
302 r = StgCreateDocfile( msifileW, mode, 0, &stg );
303 ok( r == S_OK, "failed to create database\n");
304
305 r = IStorage_SetClass( stg, &CLSID_MsiDatabase );
306 ok( r == S_OK, "failed to set clsid\n");
307
308 /* create the _StringData stream */
309 r = IStorage_CreateStream( stg, sd, STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm );
310 ok( r == S_OK, "failed to create stream\n");
311
312 IStream_Release( stm );
313
314 /* create the _StringPool stream */
315 r = IStorage_CreateStream( stg, sp, STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm );
316 ok( r == S_OK, "failed to create stream\n");
317
318 r = IStream_Write( stm, data, sizeof data, NULL );
319 ok( r == S_OK, "failed to write stream\n");
320
321 IStream_Release( stm );
322
323 /* create the _Tables stream */
324 r = IStorage_CreateStream( stg, tb, STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm );
325 ok( r == S_OK, "failed to create stream\n");
326
327 IStream_Release( stm );
328
329 r = IStorage_QueryInterface( stg, &IID_IPropertySetStorage, (void**) &pss );
330 ok( r == S_OK, "failed to set clsid\n");
331
332 r = IPropertySetStorage_Create( pss, &FMTID_SummaryInformation, NULL, 0, mode, &ps );
333 ok( r == S_OK, "failed to create property set\n");
334
335 r = IPropertyStorage_SetClass( ps, &FMTID_SummaryInformation );
336 ok( r == S_OK, "failed to set class\n");
337
338 propspec[0].ulKind = PRSPEC_PROPID;
339 U(propspec[0]).propid = PID_TITLE;
340 propvar[0].vt = VT_LPSTR;
341 U(propvar[0]).pszVal = LOSE_CONST("test title");
342
343 propspec[1].ulKind = PRSPEC_PROPID;
344 U(propspec[1]).propid = PID_SUBJECT;
345 propvar[1].vt = VT_LPSTR;
346 U(propvar[1]).pszVal = LOSE_CONST("msi suminfo / property storage test");
347
348 propspec[2].ulKind = PRSPEC_PROPID;
349 U(propspec[2]).propid = PID_AUTHOR;
350 propvar[2].vt = VT_LPSTR;
351 U(propvar[2]).pszVal = LOSE_CONST("mike_m");
352
353 propspec[3].ulKind = PRSPEC_PROPID;
354 U(propspec[3]).propid = PID_TEMPLATE;
355 propvar[3].vt = VT_LPSTR;
356 U(propvar[3]).pszVal = LOSE_CONST(";1033"); /* actually the string table's codepage */
357
358 propspec[4].ulKind = PRSPEC_PROPID;
359 U(propspec[4]).propid = PID_REVNUMBER;
360 propvar[4].vt = VT_LPSTR;
361 U(propvar[4]).pszVal = LOSE_CONST("{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}");
362
363 propspec[5].ulKind = PRSPEC_PROPID;
364 U(propspec[5]).propid = PID_PAGECOUNT;
365 propvar[5].vt = VT_I4;
366 U(propvar[5]).lVal = 100;
367
368 propspec[6].ulKind = PRSPEC_PROPID;
369 U(propspec[6]).propid = PID_WORDCOUNT;
370 propvar[6].vt = VT_I4;
371 U(propvar[6]).lVal = 0;
372
373 /* MSDN says that PID_LASTPRINTED should be a VT_FILETIME... */
374 propspec[7].ulKind = PRSPEC_PROPID;
375 U(propspec[7]).propid = PID_LASTPRINTED;
376 propvar[7].vt = VT_LPSTR;
377 U(propvar[7]).pszVal = LOSE_CONST("7/1/1999 5:17");
378
379 r = IPropertyStorage_WriteMultiple( ps, 8, propspec, propvar, PID_FIRST_USABLE );
380 ok( r == S_OK, "failed to write properties\n");
381
382 IPropertyStorage_Commit( ps, STGC_DEFAULT );
383
384 IPropertyStorage_Release( ps );
385 IPropertySetStorage_Release( pss );
386
387 IStorage_Commit( stg, STGC_DEFAULT );
388 IStorage_Release( stg );
389 }
390
391 static void test_summary_binary(void)
392 {
393 MSIHANDLE hdb = 0, hsuminfo = 0;
394 UINT r, type, count;
395 INT ival;
396 DWORD sz;
397 char sval[20];
398
399 DeleteFileA( msifile );
400
401 test_create_database_binary();
402
403 ok(GetFileAttributesA(msifile) != INVALID_FILE_ATTRIBUTES, "file doesn't exist!\n");
404
405 /* just MsiOpenDatabase should not create a file */
406 r = MsiOpenDatabaseW(msifileW, MSIDBOPEN_READONLY, &hdb);
407 ok(r == ERROR_SUCCESS, "MsiOpenDatabase failed\n");
408
409 r = MsiGetSummaryInformationA(hdb, NULL, 0, &hsuminfo);
410 ok(r == ERROR_SUCCESS, "MsiGetSummaryInformation failed\n");
411
412 /*
413 * Check what reading PID_LASTPRINTED does...
414 * The string value is written to the msi file
415 * but it appears that we're not allowed to read it back again.
416 * We can still read its type though...?
417 */
418 sz = sizeof sval;
419 sval[0] = 0;
420 type = 0;
421 r = MsiSummaryInfoGetPropertyA(hsuminfo, PID_LASTPRINTED, &type, NULL, NULL, sval, &sz);
422 ok(r == ERROR_SUCCESS, "MsiSummaryInfoGetProperty failed\n");
423 ok(!lstrcmpA(sval, "") || !lstrcmpA(sval, "7"),
424 "Expected empty string or \"7\", got \"%s\"\n", sval);
425 todo_wine {
426 ok(type == VT_LPSTR, "Expected VT_LPSTR, got %d\n", type);
427 ok(sz == 0 || sz == 1, "Expected 0 or 1, got %d\n", sz);
428 }
429
430 ival = -1;
431 r = MsiSummaryInfoGetPropertyA(hsuminfo, PID_WORDCOUNT, &type, &ival, NULL, NULL, NULL);
432 ok(r == ERROR_SUCCESS, "MsiSummaryInfoGetProperty failed\n");
433 todo_wine ok( ival == 0, "value incorrect\n");
434
435 /* looks like msi adds some of its own values in here */
436 count = 0;
437 r = MsiSummaryInfoGetPropertyCount( hsuminfo, &count );
438 ok(r == ERROR_SUCCESS, "getpropcount failed\n");
439 todo_wine ok(count == 10, "prop count incorrect\n");
440
441 r = MsiSummaryInfoSetPropertyA( hsuminfo, PID_TITLE, VT_LPSTR, 0, NULL, "Mike" );
442 ok(r == ERROR_FUNCTION_FAILED, "MsiSummaryInfoSetProperty failed %u\n", r);
443
444 r = MsiSummaryInfoPersist( hsuminfo );
445 ok(r == ERROR_FUNCTION_FAILED, "MsiSummaryInfoPersist failed %u\n", r);
446
447 MsiCloseHandle( hsuminfo );
448 MsiCloseHandle( hdb );
449
450 DeleteFileA( msifile );
451 }
452
453 START_TEST(suminfo)
454 {
455 test_suminfo();
456 test_summary_binary();
457 }