ReactOS 0.4.16-dev-197-g92996da
suminfo.c File Reference
#include <stdio.h>
#include <windows.h>
#include <msi.h>
#include <msiquery.h>
#include <objidl.h>
#include "wine/test.h"
Include dependency graph for suminfo.c:

Go to the source code of this file.

Macros

#define COBJMACROS
 
#define PID_DICTIONARY   0
 
#define PID_CODEPAGE   1
 
#define PID_TITLE   2
 
#define PID_SUBJECT   3
 
#define PID_AUTHOR   4
 
#define PID_KEYWORDS   5
 
#define PID_COMMENTS   6
 
#define PID_TEMPLATE   7
 
#define PID_LASTAUTHOR   8
 
#define PID_REVNUMBER   9
 
#define PID_EDITTINE   10
 
#define PID_LASTPRINTED   11
 
#define PID_CREATE_DTM   12
 
#define PID_LASTSAVE_DTM   13
 
#define PID_PAGECOUNT   14
 
#define PID_WORDCOUNT   15
 
#define PID_CHARCOUNT   16
 
#define PID_THUMBNAIL   17
 
#define PID_APPNAME   18
 
#define PID_SECURITY   19
 
#define PID_MSIVERSION   PID_PAGECOUNT
 
#define PID_MSISOURCE   PID_WORDCOUNT
 
#define PID_MSIRESTRICT   PID_CHARCOUNT
 
#define LOSE_CONST(x)   ((LPSTR)(UINT_PTR)(x))
 

Functions

static void test_suminfo (void)
 
static void test_create_database_binary (void)
 
static void test_summary_binary (void)
 
 START_TEST (suminfo)
 

Variables

static const charmsifile = "winetest-suminfo.msi"
 
static const WCHAR msifileW [] = L"winetest-suminfo.msi"
 
static const WCHAR tb [] = { 0x4840, 0x3f7f, 0x4164, 0x422f, 0x4836, 0 }
 
static const WCHAR sd [] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3b6a, 0x45e4, 0x4824, 0 }
 
static const WCHAR sp [] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3e6a, 0x44b2, 0x482f, 0 }
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file suminfo.c.

◆ LOSE_CONST

#define LOSE_CONST (   x)    ((LPSTR)(UINT_PTR)(x))

Definition at line 289 of file suminfo.c.

◆ PID_APPNAME

#define PID_APPNAME   18

Definition at line 60 of file suminfo.c.

◆ PID_AUTHOR

#define PID_AUTHOR   4

Definition at line 46 of file suminfo.c.

◆ PID_CHARCOUNT

#define PID_CHARCOUNT   16

Definition at line 58 of file suminfo.c.

◆ PID_CODEPAGE

#define PID_CODEPAGE   1

Definition at line 43 of file suminfo.c.

◆ PID_COMMENTS

#define PID_COMMENTS   6

Definition at line 48 of file suminfo.c.

◆ PID_CREATE_DTM

#define PID_CREATE_DTM   12

Definition at line 54 of file suminfo.c.

◆ PID_DICTIONARY

#define PID_DICTIONARY   0

Definition at line 42 of file suminfo.c.

◆ PID_EDITTINE

#define PID_EDITTINE   10

Definition at line 52 of file suminfo.c.

◆ PID_KEYWORDS

#define PID_KEYWORDS   5

Definition at line 47 of file suminfo.c.

◆ PID_LASTAUTHOR

#define PID_LASTAUTHOR   8

Definition at line 50 of file suminfo.c.

◆ PID_LASTPRINTED

#define PID_LASTPRINTED   11

Definition at line 53 of file suminfo.c.

◆ PID_LASTSAVE_DTM

#define PID_LASTSAVE_DTM   13

Definition at line 55 of file suminfo.c.

◆ PID_MSIRESTRICT

#define PID_MSIRESTRICT   PID_CHARCOUNT

Definition at line 64 of file suminfo.c.

◆ PID_MSISOURCE

#define PID_MSISOURCE   PID_WORDCOUNT

Definition at line 63 of file suminfo.c.

◆ PID_MSIVERSION

#define PID_MSIVERSION   PID_PAGECOUNT

Definition at line 62 of file suminfo.c.

◆ PID_PAGECOUNT

#define PID_PAGECOUNT   14

Definition at line 56 of file suminfo.c.

◆ PID_REVNUMBER

#define PID_REVNUMBER   9

Definition at line 51 of file suminfo.c.

◆ PID_SECURITY

#define PID_SECURITY   19

Definition at line 61 of file suminfo.c.

◆ PID_SUBJECT

#define PID_SUBJECT   3

Definition at line 45 of file suminfo.c.

◆ PID_TEMPLATE

#define PID_TEMPLATE   7

Definition at line 49 of file suminfo.c.

◆ PID_THUMBNAIL

#define PID_THUMBNAIL   17

Definition at line 59 of file suminfo.c.

◆ PID_TITLE

#define PID_TITLE   2

Definition at line 44 of file suminfo.c.

◆ PID_WORDCOUNT

#define PID_WORDCOUNT   15

Definition at line 57 of file suminfo.c.

Function Documentation

◆ START_TEST()

START_TEST ( suminfo  )

Definition at line 460 of file suminfo.c.

461{
462 test_suminfo();
464}
static void test_summary_binary(void)
Definition: suminfo.c:398
static void test_suminfo(void)
Definition: suminfo.c:69

◆ test_create_database_binary()

static void test_create_database_binary ( void  )
static

Definition at line 291 of file suminfo.c.

292{
293 static const CLSID CLSID_MsiDatabase =
294 { 0xc1084, 0, 0, {0xc0, 0, 0, 0, 0, 0, 0, 0x46 } };
295 static const CLSID IID_IPropertySetStorage =
296 { 0x13a, 0, 0, {0xc0, 0, 0, 0, 0, 0, 0, 0x46 } };
297 static const CLSID FMTID_SummaryInformation =
298 { 0xf29f85e0, 0x4ff9, 0x1068, {0xab, 0x91, 0x08, 0x00, 0x2b, 0x27, 0xb3, 0xd9}};
302 IStorage *stg = NULL;
303 IStream *stm = NULL;
304 HRESULT r;
305 PROPSPEC propspec[10];
306 PROPVARIANT propvar[10];
307 USHORT data[2] = { 0, 0 };
308
309 r = StgCreateDocfile( msifileW, mode, 0, &stg );
310 ok( r == S_OK, "failed to create database\n");
311
312 r = IStorage_SetClass( stg, &CLSID_MsiDatabase );
313 ok( r == S_OK, "failed to set clsid\n");
314
315 /* create the _StringData stream */
316 r = IStorage_CreateStream( stg, sd, STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm );
317 ok( r == S_OK, "failed to create stream\n");
318
319 IStream_Release( stm );
320
321 /* create the _StringPool stream */
322 r = IStorage_CreateStream( stg, sp, STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm );
323 ok( r == S_OK, "failed to create stream\n");
324
325 r = IStream_Write( stm, data, sizeof data, NULL );
326 ok( r == S_OK, "failed to write stream\n");
327
328 IStream_Release( stm );
329
330 /* create the _Tables stream */
331 r = IStorage_CreateStream( stg, tb, STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm );
332 ok( r == S_OK, "failed to create stream\n");
333
334 IStream_Release( stm );
335
336 r = IStorage_QueryInterface( stg, &IID_IPropertySetStorage, (void**) &pss );
337 ok( r == S_OK, "failed to set clsid\n");
338
339 r = IPropertySetStorage_Create( pss, &FMTID_SummaryInformation, NULL, 0, mode, &ps );
340 ok( r == S_OK, "failed to create property set\n");
341
342 r = IPropertyStorage_SetClass( ps, &FMTID_SummaryInformation );
343 ok( r == S_OK, "failed to set class\n");
344
345 propspec[0].ulKind = PRSPEC_PROPID;
346 propspec[0].propid = PID_TITLE;
347 propvar[0].vt = VT_LPSTR;
348 propvar[0].pszVal = LOSE_CONST("test title");
349
350 propspec[1].ulKind = PRSPEC_PROPID;
351 propspec[1].propid = PID_SUBJECT;
352 propvar[1].vt = VT_LPSTR;
353 propvar[1].pszVal = LOSE_CONST("msi suminfo / property storage test");
354
355 propspec[2].ulKind = PRSPEC_PROPID;
356 propspec[2].propid = PID_AUTHOR;
357 propvar[2].vt = VT_LPSTR;
358 propvar[2].pszVal = LOSE_CONST("mike_m");
359
360 propspec[3].ulKind = PRSPEC_PROPID;
361 propspec[3].propid = PID_TEMPLATE;
362 propvar[3].vt = VT_LPSTR;
363 propvar[3].pszVal = LOSE_CONST(";1033"); /* actually the string table's codepage */
364
365 propspec[4].ulKind = PRSPEC_PROPID;
366 propspec[4].propid = PID_REVNUMBER;
367 propvar[4].vt = VT_LPSTR;
368 propvar[4].pszVal = LOSE_CONST("{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}");
369
370 propspec[5].ulKind = PRSPEC_PROPID;
371 propspec[5].propid = PID_PAGECOUNT;
372 propvar[5].vt = VT_I4;
373 propvar[5].lVal = 100;
374
375 propspec[6].ulKind = PRSPEC_PROPID;
376 propspec[6].propid = PID_WORDCOUNT;
377 propvar[6].vt = VT_I4;
378 propvar[6].lVal = 0;
379
380 /* MSDN says that PID_LASTPRINTED should be a VT_FILETIME... */
381 propspec[7].ulKind = PRSPEC_PROPID;
382 propspec[7].propid = PID_LASTPRINTED;
383 propvar[7].vt = VT_LPSTR;
384 propvar[7].pszVal = LOSE_CONST("7/1/1999 5:17");
385
386 r = IPropertyStorage_WriteMultiple( ps, 8, propspec, propvar, PID_FIRST_USABLE );
387 ok( r == S_OK, "failed to write properties\n");
388
389 IPropertyStorage_Commit( ps, STGC_DEFAULT );
390
391 IPropertyStorage_Release( ps );
392 IPropertySetStorage_Release( pss );
393
394 IStorage_Commit( stg, STGC_DEFAULT );
395 IStorage_Release( stg );
396}
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
@ VT_LPSTR
Definition: compat.h:2324
@ VT_I4
Definition: compat.h:2298
HRESULT WINAPI StgCreateDocfile(LPCOLESTR pwcsName, DWORD grfMode, DWORD reserved, IStorage **ppstgOpen)
Definition: storage32.c:8636
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLenum mode
Definition: glext.h:6217
#define S_OK
Definition: intsafe.h:52
static const WCHAR tb[]
Definition: suminfo.c:285
#define PID_TEMPLATE
Definition: suminfo.c:49
static const WCHAR msifileW[]
Definition: suminfo.c:67
#define LOSE_CONST(x)
Definition: suminfo.c:289
#define PID_PAGECOUNT
Definition: suminfo.c:56
#define PID_WORDCOUNT
Definition: suminfo.c:57
static const WCHAR sd[]
Definition: suminfo.c:286
#define PID_TITLE
Definition: suminfo.c:44
#define PID_AUTHOR
Definition: suminfo.c:46
#define PID_REVNUMBER
Definition: suminfo.c:51
#define PID_LASTPRINTED
Definition: suminfo.c:53
static const WCHAR sp[]
Definition: suminfo.c:287
#define PID_SUBJECT
Definition: suminfo.c:45
#define STGM_CREATE
Definition: objbase.h:926
#define STGM_DIRECT
Definition: objbase.h:914
#define STGM_READWRITE
Definition: objbase.h:919
#define STGM_SHARE_EXCLUSIVE
Definition: objbase.h:923
#define STGM_WRITE
Definition: objbase.h:918
const FMTID FMTID_SummaryInformation
unsigned short USHORT
Definition: pedump.c:61
#define PID_FIRST_USABLE
Definition: propkeydef.h:20

Referenced by test_summary_binary().

◆ test_suminfo()

static void test_suminfo ( void  )
static

Definition at line 69 of file suminfo.c.

70{
71 MSIHANDLE hdb = 0, hsuminfo;
72 UINT r, count, type;
73 DWORD sz;
74 INT val;
75 FILETIME ft;
76 char buf[0x10];
77
79
80 /* just MsiOpenDatabase should not create a file */
82 ok(r == ERROR_SUCCESS, "MsiOpenDatabase failed\n");
83
85 ok(r == ERROR_INVALID_PARAMETER, "MsiGetSummaryInformation wrong error\n");
86
87 r = MsiGetSummaryInformationA(hdb, NULL, 0, &hsuminfo);
88 ok(r == ERROR_SUCCESS, "MsiGetSummaryInformation failed %u\n", r);
89
90 r = MsiCloseHandle(hsuminfo);
91 ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n");
92
93 r = MsiGetSummaryInformationA(0, "", 0, &hsuminfo);
96 "MsiGetSummaryInformation failed %u\n", r);
97
98 r = MsiGetSummaryInformationA(hdb, "", 0, &hsuminfo);
99 ok(r == ERROR_SUCCESS, "MsiGetSummaryInformation failed %u\n", r);
100
102 ok(r == ERROR_INVALID_HANDLE, "getpropcount failed\n");
103
105 ok(r == ERROR_SUCCESS, "getpropcount failed\n");
106
107 count = -1;
109 ok(r == ERROR_SUCCESS, "getpropcount failed\n");
110 ok(count == 0, "count should be zero\n");
111
112 r = MsiSummaryInfoGetPropertyA(hsuminfo, 0, NULL, NULL, NULL, 0, NULL);
113 ok(r == ERROR_SUCCESS, "getpropcount failed\n");
114
115 r = MsiSummaryInfoGetPropertyA(hsuminfo, -1, NULL, NULL, NULL, 0, NULL);
116 ok(r == ERROR_UNKNOWN_PROPERTY, "MsiSummaryInfoGetProperty wrong error\n");
117
119 ok(r == ERROR_UNKNOWN_PROPERTY, "MsiSummaryInfoGetProperty wrong error\n");
120
121 type = -1;
122 r = MsiSummaryInfoGetPropertyA(hsuminfo, 0, &type, NULL, NULL, 0, NULL);
123 ok(r == ERROR_SUCCESS, "getpropcount failed\n");
124 ok(type == 0, "wrong type\n");
125
126 type = -1;
127 val = 1234;
128 r = MsiSummaryInfoGetPropertyA(hsuminfo, 0, &type, &val, NULL, 0, NULL);
129 ok(r == ERROR_SUCCESS, "getpropcount failed\n");
130 ok(type == 0, "wrong type\n");
131 ok(val == 1234, "wrong val\n");
132
133 buf[0]='x';
134 buf[1]=0;
135 sz = 0x10;
136 r = MsiSummaryInfoGetPropertyA(hsuminfo, PID_REVNUMBER, &type, &val, NULL, buf, &sz);
137 ok(r == ERROR_SUCCESS, "getpropcount failed\n");
138 ok(buf[0]=='x', "cleared buffer\n");
139 ok(sz == 0x10, "count wasn't zero\n");
140 ok(type == VT_EMPTY, "should be empty\n");
141
142 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_TITLE, VT_LPSTR, 0, NULL, "Mike");
143 ok(r == ERROR_FUNCTION_FAILED, "MsiSummaryInfoSetProperty wrong error\n");
144
145 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_TITLE, VT_LPSTR, 1, NULL, "JungAh");
146 ok(r == ERROR_FUNCTION_FAILED, "MsiSummaryInfoSetProperty wrong error\n");
147
148 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_TITLE, VT_LPSTR, 1, &ft, "Mike");
149 ok(r == ERROR_FUNCTION_FAILED, "MsiSummaryInfoSetProperty wrong error\n");
150
151 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_CODEPAGE, VT_I2, 1, &ft, "JungAh");
152 ok(r == ERROR_FUNCTION_FAILED, "MsiSummaryInfoSetProperty wrong error\n");
153
154 r = MsiCloseHandle(hsuminfo);
155 ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n");
156
157 /* try again with the update count set */
158 r = MsiGetSummaryInformationA(hdb, NULL, 1, &hsuminfo);
159 ok(r == ERROR_SUCCESS, "MsiGetSummaryInformation failed\n");
160
161 r = MsiSummaryInfoSetPropertyA(hsuminfo, 0, VT_LPSTR, 1, NULL, NULL);
162 ok(r == ERROR_DATATYPE_MISMATCH, "MsiSummaryInfoSetProperty wrong error\n");
163
165 ok(r == ERROR_DATATYPE_MISMATCH, "MsiSummaryInfoSetProperty wrong error\n");
166
167 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_TITLE, VT_I4, 0, NULL, "Mike");
168 ok(r == ERROR_DATATYPE_MISMATCH, "MsiSummaryInfoSetProperty wrong error\n");
169
170 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_AUTHOR, VT_I4, 0, NULL, "JungAh");
171 ok(r == ERROR_DATATYPE_MISMATCH, "MsiSummaryInfoSetProperty wrong error\n");
172
173 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_KEYWORDS, VT_I2, 0, NULL, "Mike");
174 ok(r == ERROR_DATATYPE_MISMATCH, "MsiSummaryInfoSetProperty wrong error\n");
175
176 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_COMMENTS, VT_FILETIME, 0, NULL, "JungAh");
177 ok(r == ERROR_DATATYPE_MISMATCH, "MsiSummaryInfoSetProperty wrong error\n");
178
179 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_TEMPLATE, VT_I2, 0, NULL, "Mike");
180 ok(r == ERROR_DATATYPE_MISMATCH, "MsiSummaryInfoSetProperty wrong error\n");
181
183 ok(r == ERROR_INVALID_PARAMETER, "MsiSummaryInfoSetProperty wrong error\n");
184
186 ok(r == ERROR_INVALID_PARAMETER, "MsiSummaryInfoSetProperty wrong error\n");
187
188 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_LASTAUTHOR, VT_LPWSTR, 0, NULL, "h\0i\0\0");
189 ok(r == ERROR_DATATYPE_MISMATCH, "MsiSummaryInfoSetProperty wrong error\n");
190
191 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_REVNUMBER, VT_I4, 0, NULL, "Jungah");
192 ok(r == ERROR_DATATYPE_MISMATCH, "MsiSummaryInfoSetProperty wrong error\n");
193
195 ok(r == ERROR_DATATYPE_MISMATCH, "MsiSummaryInfoSetProperty wrong error\n");
196
197 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_TITLE, VT_LPSTR, 0, NULL, "Mike");
198 ok(r == ERROR_SUCCESS, "MsiSummaryInfoSetProperty failed\n");
199
200 sz = 2;
201 strcpy(buf,"x");
202 r = MsiSummaryInfoGetPropertyA(hsuminfo, PID_TITLE, &type, NULL, NULL, buf, &sz );
203 ok(r == ERROR_MORE_DATA, "MsiSummaryInfoSetProperty failed\n");
204 ok(sz == 4, "count was wrong\n");
205 ok(type == VT_LPSTR, "type was wrong\n");
206 ok(!strcmp(buf,"M"), "buffer was wrong\n");
207
208 sz = 4;
209 strcpy(buf,"x");
210 r = MsiSummaryInfoGetPropertyA(hsuminfo, PID_TITLE, &type, NULL, NULL, buf, &sz );
211 ok(r == ERROR_MORE_DATA, "MsiSummaryInfoSetProperty failed\n");
212 ok(sz == 4, "count was wrong\n");
213 ok(type == VT_LPSTR, "type was wrong\n");
214 ok(!strcmp(buf,"Mik"), "buffer was wrong\n");
215
216 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_TITLE, VT_LPSTR, 0, NULL, "JungAh");
217 ok(r == ERROR_SUCCESS, "MsiSummaryInfoSetProperty failed\n");
218
219 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_CODEPAGE, VT_I2, 1, &ft, "Mike");
220 ok(r == ERROR_FUNCTION_FAILED, "MsiSummaryInfoSetProperty wrong error\n");
221
222 r = MsiCloseHandle(hsuminfo);
223 ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n");
224
225 /* try again with a higher update count */
226 r = MsiGetSummaryInformationA(hdb, NULL, 10, &hsuminfo);
227 ok(r == ERROR_SUCCESS, "MsiGetSummaryInformation failed\n");
228
229 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_TITLE, VT_LPSTR, 0, NULL, "JungAh");
230 ok(r == ERROR_SUCCESS, "MsiSummaryInfoSetProperty failed\n");
231
233 ok(r == ERROR_DATATYPE_MISMATCH, "MsiSummaryInfoSetProperty wrong error\n");
234
236 ok(r == ERROR_SUCCESS, "MsiSummaryInfoSetProperty wrong error\n");
237
238 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_CODEPAGE, VT_I2, 1, &ft, "Mike");
239 ok(r == ERROR_SUCCESS, "MsiSummaryInfoSetProperty wrong error\n");
240
241 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_AUTHOR, VT_LPSTR, 1, &ft, "Mike");
242 ok(r == ERROR_SUCCESS, "MsiSummaryInfoSetProperty wrong error\n");
243
244 r = MsiSummaryInfoPersist(hsuminfo);
245 ok(r == ERROR_SUCCESS, "MsiSummaryInfoPersist failed\n");
246
248
249 r = MsiCloseHandle(hsuminfo);
250 ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n");
251
252 r = MsiCloseHandle(hdb);
253 ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n");
254
255 /* filename, non-zero update count */
256 r = MsiGetSummaryInformationA(0, msifile, 1, &hsuminfo);
257 ok(r == ERROR_SUCCESS, "MsiGetSummaryInformation failed\n");
258
259 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_AUTHOR, VT_LPSTR, 1, &ft, "Mike");
260 ok(r == ERROR_SUCCESS, "MsiSummaryInfoSetProperty wrong error\n");
261
262 r = MsiSummaryInfoPersist(hsuminfo);
263 ok(r == ERROR_SUCCESS, "MsiSummaryInfoPersist failed %u\n", r);
264
265 r = MsiCloseHandle(hsuminfo);
266 ok(r == ERROR_SUCCESS, "MsiCloseHandle failed %u\n", r);
267
268 /* filename, zero update count */
269 r = MsiGetSummaryInformationA(0, msifile, 0, &hsuminfo);
270 ok(r == ERROR_SUCCESS, "MsiGetSummaryInformation failed %u\n", r);
271
272 r = MsiSummaryInfoSetPropertyA(hsuminfo, PID_AUTHOR, VT_LPSTR, 1, &ft, "Mike");
273 todo_wine ok(r == ERROR_FUNCTION_FAILED, "MsiSummaryInfoSetProperty wrong error, %u\n", r);
274
275 r = MsiSummaryInfoPersist(hsuminfo);
276 ok(r == ERROR_FUNCTION_FAILED, "MsiSummaryInfoPersist wrong error %u\n", r);
277
278 r = MsiCloseHandle(hsuminfo);
279 ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n");
280
282 ok(r, "DeleteFile failed\n");
283}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
@ VT_LPWSTR
Definition: compat.h:2325
@ VT_FILETIME
Definition: compat.h:2329
@ VT_I2
Definition: compat.h:2297
@ VT_EMPTY
Definition: compat.h:2295
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
UINT WINAPI MsiOpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIHANDLE *phDB)
Definition: database.c:298
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:269
UINT WINAPI MsiSummaryInfoSetPropertyA(MSIHANDLE handle, UINT uiProperty, UINT uiDataType, INT iValue, FILETIME *pftValue, const char *szValue)
Definition: suminfo.c:942
UINT WINAPI MsiSummaryInfoGetPropertyA(MSIHANDLE handle, UINT uiProperty, UINT *puiDataType, INT *piValue, FILETIME *pftValue, char *szValueBuf, DWORD *pcchValueBuf)
Definition: suminfo.c:742
UINT WINAPI MsiGetSummaryInformationA(MSIHANDLE hDatabase, const char *szDatabase, UINT uiUpdateCount, MSIHANDLE *pHandle)
Definition: suminfo.c:589
UINT WINAPI MsiSummaryInfoGetPropertyCount(MSIHANDLE hSummaryInfo, UINT *pCount)
Definition: suminfo.c:611
UINT WINAPI MsiSummaryInfoPersist(MSIHANDLE handle)
Definition: suminfo.c:1227
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLuint GLfloat * val
Definition: glext.h:7180
#define todo_wine
Definition: custom.c:89
#define PID_KEYWORDS
Definition: suminfo.c:47
#define PID_SECURITY
Definition: suminfo.c:61
#define PID_COMMENTS
Definition: suminfo.c:48
static const char * msifile
Definition: suminfo.c:66
#define PID_LASTAUTHOR
Definition: suminfo.c:50
#define PID_CODEPAGE
Definition: suminfo.c:43
#define PID_LASTSAVE_DTM
Definition: suminfo.c:55
UINT WINAPI MsiDatabaseCommit(MSIHANDLE hdb)
Definition: msiquery.c:962
#define MSIDBOPEN_CREATE
Definition: msiquery.h:69
unsigned int UINT
Definition: ndis.h:50
int32_t INT
Definition: typedefs.h:58
unsigned long MSIHANDLE
Definition: winemsi.idl:27
#define ERROR_INSTALL_PACKAGE_INVALID
Definition: winerror.h:978
#define ERROR_INSTALL_PACKAGE_OPEN_FAILED
Definition: winerror.h:977
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define ERROR_UNKNOWN_PROPERTY
Definition: winerror.h:966
#define ERROR_DATATYPE_MISMATCH
Definition: winerror.h:987

Referenced by START_TEST().

◆ test_summary_binary()

static void test_summary_binary ( void  )
static

Definition at line 398 of file suminfo.c.

399{
400 MSIHANDLE hdb = 0, hsuminfo = 0;
401 UINT r, type, count;
402 INT ival;
403 DWORD sz;
404 char sval[20];
405
407
409
410 ok(GetFileAttributesA(msifile) != INVALID_FILE_ATTRIBUTES, "file doesn't exist!\n");
411
412 /* just MsiOpenDatabase should not create a file */
414 ok(r == ERROR_SUCCESS, "MsiOpenDatabase failed\n");
415
416 r = MsiGetSummaryInformationA(hdb, NULL, 0, &hsuminfo);
417 ok(r == ERROR_SUCCESS, "MsiGetSummaryInformation failed\n");
418
419 /*
420 * Check what reading PID_LASTPRINTED does...
421 * The string value is written to the msi file
422 * but it appears that we're not allowed to read it back again.
423 * We can still read its type though...?
424 */
425 sz = sizeof sval;
426 sval[0] = 0;
427 type = 0;
428 r = MsiSummaryInfoGetPropertyA(hsuminfo, PID_LASTPRINTED, &type, NULL, NULL, sval, &sz);
429 ok(r == ERROR_SUCCESS, "MsiSummaryInfoGetProperty failed\n");
430 ok(!lstrcmpA(sval, "") || !lstrcmpA(sval, "7"),
431 "Expected empty string or \"7\", got \"%s\"\n", sval);
432 todo_wine {
433 ok(type == VT_LPSTR, "Expected VT_LPSTR, got %d\n", type);
434 ok(sz == 0 || sz == 1, "Expected 0 or 1, got %lu\n", sz);
435 }
436
437 ival = -1;
439 ok(r == ERROR_SUCCESS, "MsiSummaryInfoGetProperty failed\n");
440 todo_wine ok( ival == 0, "value incorrect\n");
441
442 /* looks like msi adds some of its own values in here */
443 count = 0;
444 r = MsiSummaryInfoGetPropertyCount( hsuminfo, &count );
445 ok(r == ERROR_SUCCESS, "getpropcount failed\n");
446 todo_wine ok(count == 10, "prop count incorrect\n");
447
448 r = MsiSummaryInfoSetPropertyA( hsuminfo, PID_TITLE, VT_LPSTR, 0, NULL, "Mike" );
449 ok(r == ERROR_FUNCTION_FAILED, "MsiSummaryInfoSetProperty failed %u\n", r);
450
451 r = MsiSummaryInfoPersist( hsuminfo );
452 ok(r == ERROR_FUNCTION_FAILED, "MsiSummaryInfoPersist failed %u\n", r);
453
454 MsiCloseHandle( hsuminfo );
455 MsiCloseHandle( hdb );
456
458}
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
Definition: fileinfo.c:636
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4195
static void test_create_database_binary(void)
Definition: suminfo.c:291
#define MSIDBOPEN_READONLY
Definition: msiquery.h:66
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23

Referenced by START_TEST().

Variable Documentation

◆ msifile

const char* msifile = "winetest-suminfo.msi"
static

Definition at line 66 of file suminfo.c.

Referenced by test_suminfo(), and test_summary_binary().

◆ msifileW

const WCHAR msifileW[] = L"winetest-suminfo.msi"
static

Definition at line 67 of file suminfo.c.

Referenced by test_create_database_binary(), test_suminfo(), and test_summary_binary().

◆ sd

const WCHAR sd[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3b6a, 0x45e4, 0x4824, 0 }
static

Definition at line 286 of file suminfo.c.

Referenced by _Dispatch_type_(), _Function_class_(), add_zone_to_listview(), AddPrinterW(), bindresvport(), bindresvport_sa(), CDefView::DoColumnContextMenu(), CShellCommandDACL::Execute(), CShellCommandSACL::Execute(), get_sd(), get_top_level_sd(), CDesktopFolder::GetColumnDetails(), CDefView::GetDetailsByFolderColumn(), CDefView::GetDetailsByListColumn(), CFSFolder::GetFSColumnDetails(), getInterfaces(), IMAGEHLP_GetSecurityDirOffset(), IMAGEHLP_SetSecurityDirOffset(), InstallOneService(), ITERATE_InstallService(), CDefView::LoadColumn(), look_for_collision(), main(), make_file_orphan(), CDefView::OnNotify(), registry_callback(), RSAENH_CPGetProvParam(), RSAENH_CPSetProvParam(), security_cleanup_zones(), security_dlgproc(), security_enum_zones(), security_get_sd(), security_on_destroy(), security_on_initdialog(), security_on_notify(), send_add_dir(), send_inode(), send_inode_extref(), send_inode_ref(), send_utimes_command_dir(), set_file_security(), SetPrinterW(), SHELL32_CompareDetails(), SHGlobalCounterCreateNamedW(), test_AddMandatoryAce(), test_child_token_sd(), test_child_token_sd_medium(), test_child_token_sd_restricted(), test_container_sd(), test_create_database_binary(), test_CreateDirectoryA(), test_default_dacl_owner_sid(), test_default_handle_security(), test_event(), test_FileSecurity(), test_get_security_descriptor(), test_GetNamedSecurityInfoA(), test_GetSecurityInfo(), test_items(), test_maximum_allowed(), test_namespace(), test_ParseName(), test_reg_create_key(), test_reg_open_key(), test_RtlMakeSelfRelativeSD(), test_security_descriptor(), test_service(), test_ShellExecute(), test_system_security_access(), test_SystemSecurity(), test_token_label(), test_token_security_descriptor(), test_Verbs(), update_security_level(), update_zone_info(), and validate_default_security_descriptor().

◆ sp

const WCHAR sp[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3e6a, 0x44b2, 0x482f, 0 }
static

Definition at line 287 of file suminfo.c.

Referenced by _bdf_is_atom(), _bdf_list_split(), _cgets(), _i64tow(), _tcsrchr(), _ui64tow(), AddPrincipalListEntry(), AddPrincipalToList(), AddSelectedPrincipal(), basic_tests(), BuildDefaultPrincipalAce(), Telnet::Connect(), Control_DoLaunch(), create_ax_site(), create_serviceprovider(), DestroySecurityPage(), DGifGetImageDesc(), DGifSlurp(), do_query_service(), eval_expression(), ShellDirectory::find_entry(), for(), frame_set_seek(), framehandle(), FreePrincipalsList(), FreeSavedImages(), get_ldnumber(), get_long_path_name(), get_sec_mgr(), horDiff16(), horDiff32(), horDiff8(), IDirectPlay4Impl_InitializeConnection(), IDirectPlayLobby2AImpl_CreateAddress(), IDirectPlayLobby2AImpl_EnumAddressTypes(), IDirectPlayLobby2Impl_CreateAddress(), IDirectPlayLobby2Impl_EnumAddressTypes(), IDirectPlayLobby3Impl_EnumAddressTypes(), IDirectPlayLobbyAImpl_CreateAddress(), IDirectPlayLobbyAImpl_EnumAddressTypes(), IDirectPlayLobbyImpl_CreateAddress(), IDirectPlayLobbyImpl_EnumAddressTypes(), insert_sic(), LazyUnixLocalGlob(), LoadPermissionsList(), main(), ME_GetParaLineSpace(), netfinger(), ObjectIdentity_IsEqualObject(), ObjectWithSite_SetSite(), patmatch(), PersistPropertyBag_Load(), PredictorDecodeRow(), PredictorDecodeTile(), PredictorEncodeRow(), PredictorEncodeTile(), PredictorPrintDir(), PredictorSetup(), PredictorSetupDecode(), PredictorSetupEncode(), PredictorVGetField(), PredictorVSetField(), ReadStyleSheet(), ReloadPrincipalsList(), remove_sic(), ResizeControls(), RTFDestroyAttrs(), RtlIntegerToUnicode(), s_sum_sp(), SecurityPageCallback(), SecurityPageProc(), ServiceNameToPortNumber(), SidLookupCompletion(), SpoolName(), Mapdesc::subdivide(), SymInitialize(), SymSetSearchPath(), test_create_database_binary(), test_QueryService(), test_security(), test_ShellWindows(), test_sp(), test_VarBstrFromCy(), test_VarBstrFromDec(), TIFFPredictorCleanup(), TIFFPredictorInit(), TIFFVGetFieldDefaulted(), UpdateControlStates(), UpdatePrincipalInfo(), UpdatePrincipalListItem(), xdr_bytes(), xdr_short(), xdr_string(), Mapdesc::xformBounding(), Mapdesc::xformSampling(), ZSTD_compressSubBlock_multi(), and ZSTD_seqDecompressedSize().

◆ tb