24#define PID_BEHAVIOR 0x80000003
32 static const WCHAR szDot[] = {
'.',0 };
33 static const WCHAR szPrefix[] = {
's',
't',
'g',0 };
35 'I',
'n',
'f',
'o',
'r',
'm',
'a',
't',
'i',
'o',
'n',0 };
36 static WCHAR propName[] = {
'p',
'r',
'o',
'p',0 };
37 static char val[] =
"l33t auth0r";
46 unsigned char clipcontent[] =
"foobar";
47 GUID anyOldGuid = { 0x12345678,0xdead,0xbeef, {
48 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07 } };
51 trace(
"Testing property storage with a set...\n");
53 trace(
"Testing property storage without a set...\n");
62 ok(
hr ==
S_OK,
"StgCreateDocfile failed: 0x%08lx\n",
hr);
67 ok(
hr ==
S_OK,
"StgCreatePropSetStg failed: 0x%08lx\n",
hr);
69 hr = IPropertySetStorage_Create(*propSetStorage,
73 ok(
hr ==
S_OK,
"IPropertySetStorage_Create failed: 0x%08lx\n",
hr);
79 ok(
hr ==
S_OK,
"IStorage_CreateStream failed: 0x%08lx\n",
hr);
82 NULL, PROPSETFLAG_ANSI, 0, &propertyStorage);
83 ok(
hr ==
S_OK,
"StgCreatePropStg failed: 0x%08lx\n",
hr);
86 hr = IPropertyStorage_WriteMultiple(propertyStorage, 0,
NULL,
NULL, 0);
87 ok(
hr ==
S_OK,
"WriteMultiple with 0 args failed: 0x%08lx\n",
hr);
88 hr = IPropertyStorage_WriteMultiple(propertyStorage, 1,
NULL,
NULL, 0);
92 spec.ulKind = PRSPEC_PROPID;
96 hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &
var, 0);
98 "Expected STG_E_INVALIDPARAMETER, got 0x%08lx\n",
hr);
101 spec.ulKind = PRSPEC_LPWSTR;
102 spec.lpwstr = propName;
103 hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &
var,
106 "Expected STG_E_INVALIDPARAMETER, got 0x%08lx\n",
hr);
109 spec.ulKind = PRSPEC_PROPID;
112 hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &
var, 0);
114 "Expected STG_E_INVALIDPARAMETER, got 0x%08lx\n",
hr);
117 spec.ulKind = PRSPEC_PROPID;
120 hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &
var, 0);
121 ok(
hr ==
S_OK,
"WriteMultiple failed: 0x%08lx\n",
hr);
124 spec.ulKind = PRSPEC_LPWSTR;
125 spec.lpwstr = propName;
127 hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &
var,
129 ok(
hr ==
S_OK,
"WriteMultiple failed: 0x%08lx\n",
hr);
132 spec.ulKind = PRSPEC_PROPID;
133 spec.propid = PIDSI_AUTHOR;
136 hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &
var, 0);
137 ok(
hr ==
S_OK,
"WriteMultiple failed: 0x%08lx\n",
hr);
140 spec.ulKind = PRSPEC_PROPID;
141 spec.propid = PIDSI_THUMBNAIL;
143 clipdata.cbSize =
sizeof clipcontent +
sizeof (
ULONG);
145 clipdata.pClipData = clipcontent;
146 var.pclipdata = &clipdata;
147 hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &
var, 0);
148 ok(
hr ==
S_OK,
"WriteMultiple failed: 0x%08lx\n",
hr);
152 hr = IPropertyStorage_ReadMultiple(propertyStorage, 0,
NULL,
NULL);
153 ok(
hr ==
S_FALSE,
"ReadMultiple with 0 args failed: 0x%08lx\n",
hr);
154 hr = IPropertyStorage_ReadMultiple(propertyStorage, 1,
NULL,
NULL);
157 spec.ulKind = PRSPEC_PROPID;
159 hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &
var);
160 ok(
hr ==
S_OK,
"ReadMultiple failed: 0x%08lx\n",
hr);
162 "Didn't get expected type or value for property (got type %d, value %ld)\n",
165 spec.ulKind = PRSPEC_LPWSTR;
166 spec.lpwstr = propName;
167 hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &
var);
168 ok(
hr ==
S_OK,
"ReadMultiple failed: 0x%08lx\n",
hr);
170 "Didn't get expected type or value for property (got type %d, value %ld)\n",
173 spec.ulKind = PRSPEC_PROPID;
174 spec.propid = PIDSI_AUTHOR;
175 hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &
var);
176 ok(
hr ==
S_OK,
"ReadMultiple failed: 0x%08lx\n",
hr);
178 "Didn't get expected type or value for property (got type %d, value %s)\n",
183 spec.ulKind = PRSPEC_PROPID;
184 spec.propid = PIDSI_THUMBNAIL;
185 hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &
var);
186 ok(
hr ==
S_OK,
"ReadMultiple failed: 0x%08lx\n",
hr);
189 "clipboard type wrong\n");
191 "clipboard size wrong\n");
192 ok(!
memcmp(
var.pclipdata->pClipData, clipcontent,
sizeof clipcontent),
193 "clipboard contents wrong\n");
197 hr = IPropertyStorage_DeleteMultiple(propertyStorage, 0,
NULL);
198 ok(
hr ==
S_OK,
"DeleteMultiple with 0 args failed: 0x%08lx\n",
hr);
199 hr = IPropertyStorage_DeleteMultiple(propertyStorage, 1,
NULL);
202 spec.ulKind = PRSPEC_PROPID;
204 hr = IPropertyStorage_DeleteMultiple(propertyStorage, 1, &spec);
206 "Expected STG_E_INVALIDPARAMETER, got 0x%08lx\n",
hr);
209 hr = IPropertyStorage_DeleteMultiple(propertyStorage, 1, &spec);
210 ok(
hr ==
S_OK,
"DeleteMultiple failed: 0x%08lx\n",
hr);
212 hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &
var);
215 hr = IPropertyStorage_Commit(propertyStorage, STGC_DEFAULT);
216 ok(
hr ==
S_OK,
"Commit failed: 0x%08lx\n",
hr);
219 spec.ulKind = PRSPEC_PROPID;
221 hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &
var, 0);
222 ok(
hr ==
S_OK,
"WriteMultiple failed: 0x%08lx\n",
hr);
223 hr = IPropertyStorage_Revert(propertyStorage);
224 ok(
hr ==
S_OK,
"Revert failed: 0x%08lx\n",
hr);
226 hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &
var);
229 spec.ulKind = PRSPEC_PROPID;
233 hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &
var, 0);
234 ok(
hr ==
S_OK,
"WriteMultiple failed: 0x%08lx\n",
hr);
236 hr = IPropertyStorage_Commit(propertyStorage, STGC_DEFAULT);
237 ok(
hr ==
S_OK,
"Commit failed: 0x%08lx\n",
hr);
241 hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &
var, 0);
242 ok(
hr ==
S_OK,
"WriteMultiple failed: 0x%08lx\n",
hr);
244 hr = IPropertyStorage_Revert(propertyStorage);
245 ok(
hr ==
S_OK,
"Revert failed: 0x%08lx\n",
hr);
251 IPropertyStorage_Release(propertyStorage);
252 if(propSetStorage) IPropertySetStorage_Release(*propSetStorage);
259 ok(
hr ==
S_OK,
"StgOpenStorage failed: 0x%08lx\n",
hr);
264 ok(
hr ==
S_OK,
"StgCreatePropSetStg failed: 0x%08lx\n",
hr);
268 ok(
hr ==
S_OK,
"IPropertySetStorage_Open failed: 0x%08lx\n",
hr);
274 ok(
hr ==
S_OK,
"IStorage_OpenStream failed: 0x%08lx\n",
hr);
277 PROPSETFLAG_DEFAULT, 0, &propertyStorage);
278 ok(
hr ==
S_OK,
"StgOpenPropStg failed: 0x%08lx\n",
hr);
282 spec.ulKind = PRSPEC_LPWSTR;
283 spec.lpwstr = propName;
284 hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &
var);
285 ok(
hr ==
S_OK,
"ReadMultiple failed: 0x%08lx\n",
hr);
287 "Didn't get expected type or value for property (got type %d, value %ld)\n",
289 spec.ulKind = PRSPEC_PROPID;
290 spec.propid = PIDSI_AUTHOR;
291 hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &
var);
292 ok(
hr ==
S_OK,
"ReadMultiple failed: 0x%08lx\n",
hr);
294 "Didn't get expected type or value for property (got type %d, value %s)\n",
298 IPropertyStorage_Release(propertyStorage);
299 if(propSetStorage) IPropertySetStorage_Release(*propSetStorage);
308 ok(
hr ==
S_OK,
"StgCreateDocfile failed: 0x%08lx\n",
hr);
313 ok(
hr ==
S_OK,
"StgCreatePropSetStg failed: 0x%08lx\n",
hr);
315 hr = IPropertySetStorage_Create(*propSetStorage,
316 &anyOldGuid,
NULL, PROPSETFLAG_ANSI,
319 ok(
hr ==
S_OK,
"IPropertySetStorage_Create failed: 0x%08lx\n",
hr);
325 ok(
hr ==
S_OK,
"IStorage_CreateStream failed: 0x%08lx\n",
hr);
328 PROPSETFLAG_DEFAULT, 0, &propertyStorage);
329 ok(
hr ==
S_OK,
"StgCreatePropStg failed: 0x%08lx\n",
hr);
332 spec.ulKind = PRSPEC_PROPID;
336 hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &
var, 0);
337 ok(
hr ==
S_OK,
"WriteMultiple failed: 0x%08lx\n",
hr);
339 hr = IPropertyStorage_Commit(propertyStorage, STGC_DEFAULT);
340 ok(
hr ==
S_OK,
"Commit failed: 0x%08lx\n",
hr);
342 IPropertyStorage_Release(propertyStorage);
343 if(propSetStorage) IPropertySetStorage_Release(*propSetStorage);
350 ok(
hr ==
S_OK,
"StgOpenStorage failed: 0x%08lx\n",
hr);
355 ok(
hr ==
S_OK,
"StgCreatePropSetStg failed: 0x%08lx\n",
hr);
357 hr = IPropertySetStorage_Open(*propSetStorage, &anyOldGuid,
359 ok(
hr ==
S_OK,
"IPropertySetStorage_Open failed: 0x%08lx\n",
hr);
365 ok(
hr ==
S_OK,
"IStorage_OpenStream failed: 0x%08lx\n",
hr);
368 PROPSETFLAG_DEFAULT, 0, &propertyStorage);
369 ok(
hr ==
S_OK,
"StgOpenPropStg failed: 0x%08lx\n",
hr);
372 spec.ulKind = PRSPEC_PROPID;
374 hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &
var);
375 ok(
hr ==
S_OK,
"ReadMultiple failed: 0x%08lx\n",
hr);
378 "Didn't get expected type or value for property (got type %d, value %ld)\n",
381 IPropertyStorage_Release(propertyStorage);
382 if(propSetStorage) IPropertySetStorage_Release(*propSetStorage);
399 static const WCHAR szDot[] = {
'.',0 };
400 static const WCHAR szPrefix[] = {
's',
't',
'g',0 };
401 static CHAR aval[] =
"hi";
402 static WCHAR wval[] = {
'h',
'i',0 };
416 ok(
hr ==
S_OK,
"StgCreateDocfile failed: 0x%08lx\n",
hr);
419 ok(
hr ==
S_OK,
"StgCreatePropSetStg failed: 0x%08lx\n",
hr);
421 hr = IPropertySetStorage_Create(propSetStorage,
425 ok(
hr ==
S_OK,
"IPropertySetStorage_Create failed: 0x%08lx\n",
hr);
427 PropVariantInit(&
var);
428 spec.ulKind = PRSPEC_PROPID;
431 hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &
var);
432 ok(
hr ==
S_OK,
"ReadMultiple failed: 0x%08lx\n",
hr);
434 "Didn't get expected type or value for property\n");
438 hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &
var, 0);
439 ok(
hr ==
S_OK,
"WriteMultiple failed: 0x%08lx\n",
hr);
441 hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &
var);
442 ok(
hr ==
S_OK,
"ReadMultiple failed: 0x%08lx\n",
hr);
444 "Didn't get expected type or value for property\n");
447 hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &
var, 0);
448 ok(
hr ==
S_OK,
"WriteMultiple failed: 0x%08lx\n",
hr);
450 hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &
var);
451 ok(
hr ==
S_OK,
"ReadMultiple failed: 0x%08lx\n",
hr);
453 "Didn't get expected type or value for property\n");
455 spec.ulKind = PRSPEC_PROPID;
459 hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &
var, 0);
460 ok(
hr ==
S_OK,
"WriteMultiple failed: 0x%08lx\n",
hr);
461 hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &
var);
462 ok(
hr ==
S_OK,
"ReadMultiple failed: 0x%08lx\n",
hr);
464 "Didn't get expected type or value for property\n");
473 hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &
var, 0);
474 ok(
hr ==
S_OK,
"WriteMultiple failed: 0x%08lx\n",
hr);
475 hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &
var);
476 ok(
hr ==
S_OK,
"ReadMultiple failed: 0x%08lx\n",
hr);
478 "Didn't get expected type or value for property\n");
482 spec.ulKind = PRSPEC_PROPID;
486 hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &
var, 0);
488 "Expected STG_E_INVALIDPARAMETER, got 0x%08lx\n",
hr);
490 IPropertyStorage_Release(propertyStorage);
491 IPropertySetStorage_Release(propSetStorage);
499 ok(
hr ==
S_OK,
"StgCreateDocfile failed: 0x%08lx\n",
hr);
502 ok(
hr ==
S_OK,
"StgCreatePropSetStg failed: 0x%08lx\n",
hr);
504 hr = IPropertySetStorage_Create(propSetStorage,
508 ok(
hr ==
S_OK,
"IPropertySetStorage_Create failed: 0x%08lx\n",
hr);
511 hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &
var);
512 ok(
hr ==
S_OK,
"ReadMultiple failed: 0x%08lx\n",
hr);
513 ok(
var.vt ==
VT_I2,
"Didn't get expected type for property (%u)\n",
var.vt);
516 hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &
var, 0);
517 ok(
hr ==
S_OK,
"WriteMultiple failed: 0x%08lx\n",
hr);
519 hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &
var);
520 ok(
hr ==
S_OK,
"ReadMultiple failed: 0x%08lx\n",
hr);
522 "Didn't get expected type or value for property\n");
528 static unsigned char strVal[] = { 0x81, 0xff, 0x04, 0 };
531 hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &
var, 0);
532 ok(
hr ==
S_OK,
"WriteMultiple failed: 0x%08lx\n",
hr);
536 spec.ulKind = PRSPEC_PROPID;
540 hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &
var, 0);
541 ok(
hr ==
S_OK,
"WriteMultiple failed: 0x%08lx\n",
hr);
543 hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &
var);
544 ok(
hr ==
S_OK,
"ReadMultiple failed: 0x%08lx\n",
hr);
546 "Didn't get expected type or value for property\n");
549 IPropertyStorage_Release(propertyStorage);
550 IPropertySetStorage_Release(propSetStorage);
559 'I',
'n',
'f',
'o',
'r',
'm',
'a',
't',
'i',
'o',
'n',0 };
561 'S',
'u',
'm',
'm',
'a',
'r',
'y',
'I',
'n',
'f',
'o',
'r',
'm',
'a',
't',
'i',
'o',
'n',
563 WCHAR szIID_IPropSetStg[] = { 5,
'0',
'j',
'a',
'a',
'a',
'a',
'a',
564 'a',
'A',
'a',
'a',
'a',
'a',
'a',
'd',
'a',
'A',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'G',
575 ok(
hr ==
S_OK,
"FmtIdToPropStgName failed: 0x%08lx\n",
hr);
577 sizeof(
WCHAR)),
"Got wrong name for FMTID_SummaryInformation\n");
579 ok(
hr ==
S_OK,
"FmtIdToPropStgName failed: 0x%08lx\n",
hr);
581 sizeof(
WCHAR)),
"Got wrong name for FMTID_DocSummaryInformation\n");
583 ok(
hr ==
S_OK,
"FmtIdToPropStgName failed: 0x%08lx\n",
hr);
585 sizeof(
WCHAR)),
"Got wrong name for FMTID_DocSummaryInformation\n");
587 ok(
hr ==
S_OK,
"FmtIdToPropStgName failed: 0x%08lx\n",
hr);
589 sizeof(
WCHAR)),
"Got wrong name for IID_IPropertySetStorage\n");
601 ok(
hr ==
S_OK,
"PropStgNameToFmtId failed: 0x%08lx\n",
hr);
603 "Got unexpected FMTID, expected FMTID_SummaryInformation\n");
605 ok(
hr ==
S_OK,
"PropStgNameToFmtId failed: 0x%08lx\n",
hr);
607 "Got unexpected FMTID, expected FMTID_DocSummaryInformation\n");
610 ok(
hr ==
S_OK,
"PropStgNameToFmtId failed: 0x%08lx\n",
hr);
611 ok(!
memcmp(&fmtid, &IID_IPropertySetStorage,
sizeof(fmtid)),
612 "Got unexpected FMTID, expected IID_IPropertySetStorage\n");
616 ok(
hr ==
S_OK,
"PropStgNameToFmtId failed: 0x%08lx\n",
hr);
618 "Got unexpected FMTID, expected FMTID_DocSummaryInformation\n");
621 ok(
hr ==
S_OK,
"PropStgNameToFmtId failed: 0x%08lx\n",
hr);
622 ok(!
memcmp(&fmtid, &IID_IPropertySetStorage,
sizeof(fmtid)),
623 "Got unexpected FMTID, expected IID_IPropertySetStorage\n");
672 0xfffe, 0, 0x2000a00,
674 {0x00000000, 0x0000, 0x0000, {0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}},
679 {0xd5cdd502, 0x2e9c, 0x101b, {0x93, 0x97, 0x08, 0x00, 0x2b, 0x2c, 0xf9, 0xae}},
684 {0xd5cdd505, 0x2e9c, 0x101b, {0x93, 0x97, 0x08, 0x00, 0x2b, 0x2c, 0xf9, 0xae}},
705 IEnumSTATPROPSETSTG *ps_enum;
708 STATPROPSETSTG psstg;
719 ok(
ret,
"Failed to get temporary file name.\n");
722 ok(
hr ==
S_OK,
"Failed to crate storage, hr %#lx.\n",
hr);
725 ok(
hr ==
S_OK,
"Failed to create property set storage, hr %#lx.\n",
hr);
729 ok(
hr ==
S_OK,
"Failed to create property storage, hr %#lx.\n",
hr);
731 hr = IPropertyStorage_Stat(prop_storage, &psstg);
732 ok(
hr ==
S_OK,
"Failed to get prop storage stats, hr %#lx.\n",
hr);
736 hr = IPropertySetStorage_Enum(ps_storage,
NULL);
739 hr = IPropertySetStorage_Enum(ps_storage, &ps_enum);
740 ok(
hr ==
S_OK,
"Failed to get enum object, hr %#lx.\n",
hr);
742 memset(&psstg, 0,
sizeof(psstg));
743 hr = IEnumSTATPROPSETSTG_Next(ps_enum, 1, &psstg, &fetched);
744 ok(
hr ==
S_OK,
"Failed to get enum item, hr %#lx.\n",
hr);
745 ok(fetched == 1,
"Unexpected fetched count.\n");
748 ok(psstg.mtime.dwHighDateTime == 0 && psstg.mtime.dwLowDateTime == 0,
"Unexpected mtime %#lx / %#lx.\n",
749 psstg.mtime.dwHighDateTime, psstg.mtime.dwLowDateTime);
752 ftime.dwLowDateTime = 1;
755 ok(
hr ==
S_OK,
"Failed to set storage times, hr %#lx.\n",
hr);
757 hr = IEnumSTATPROPSETSTG_Reset(ps_enum);
758 ok(
hr ==
S_OK,
"Failed to reset enumerator, hr %#lx.\n",
hr);
759 memset(&psstg, 0,
sizeof(psstg));
760 hr = IEnumSTATPROPSETSTG_Next(ps_enum, 1, &psstg, &fetched);
761 ok(
hr ==
S_OK,
"Failed to get enum item, hr %#lx.\n",
hr);
762 ok(fetched == 1,
"Unexpected fetched count.\n");
765 ok(psstg.mtime.dwHighDateTime == 0 && psstg.mtime.dwLowDateTime == 0,
"Unexpected mtime %#lx / %#lx.\n",
766 psstg.mtime.dwHighDateTime, psstg.mtime.dwLowDateTime);
767 hr = IEnumSTATPROPSETSTG_Next(ps_enum, 1, &psstg, &fetched);
772 ok(
hr ==
S_OK,
"Failed to create property storage, hr %#lx.\n",
hr);
774 hr = IEnumSTATPROPSETSTG_Reset(ps_enum);
775 ok(
hr ==
S_OK,
"Failed to reset enumerator, hr %#lx.\n",
hr);
776 hr = IEnumSTATPROPSETSTG_Next(ps_enum, 1, &psstg, &fetched);
777 ok(
hr ==
S_OK,
"Failed to get enum item, hr %#lx.\n",
hr);
778 ok(fetched == 1,
"Unexpected fetched count.\n");
779 hr = IEnumSTATPROPSETSTG_Next(ps_enum, 1, &psstg, &fetched);
780 ok(
hr ==
S_FALSE,
"Failed to get enum item, hr %#lx.\n",
hr);
783 hr = IEnumSTATPROPSETSTG_Reset(ps_enum);
784 ok(
hr ==
S_OK,
"Failed to reset enumerator, hr %#lx.\n",
hr);
785 hr = IEnumSTATPROPSETSTG_Skip(ps_enum, 2);
788 hr = IEnumSTATPROPSETSTG_Next(ps_enum, 1, &psstg, &fetched);
790 ok(
hr ==
S_FALSE,
"Failed to get enum item, hr %#lx.\n",
hr);
792 hr = IEnumSTATPROPSETSTG_Reset(ps_enum);
793 ok(
hr ==
S_OK,
"Failed to reset enumerator, hr %#lx.\n",
hr);
794 hr = IEnumSTATPROPSETSTG_Skip(ps_enum, 1);
795 ok(
hr ==
S_OK,
"Failed to skip, hr %#lx.\n",
hr);
796 hr = IEnumSTATPROPSETSTG_Next(ps_enum, 1, &psstg, &fetched);
798 ok(
hr ==
S_FALSE,
"Failed to get enum item, hr %#lx.\n",
hr);
800 hr = IEnumSTATPROPSETSTG_Reset(ps_enum);
801 ok(
hr ==
S_OK,
"Failed to reset enumerator, hr %#lx.\n",
hr);
803 hr = IEnumSTATPROPSETSTG_Skip(ps_enum, 0);
805 hr = IEnumSTATPROPSETSTG_Next(ps_enum, 1, &psstg, &fetched);
806 ok(
hr ==
S_FALSE,
"Failed to get enum item, hr %#lx.\n",
hr);
808 IEnumSTATPROPSETSTG_Release(ps_enum);
810 IPropertyStorage_Release(prop_storage2);
811 IPropertyStorage_Release(prop_storage);
813 IPropertySetStorage_Release(ps_storage);
818 ok(
hr ==
S_OK,
"Failed to crate storage, hr %#lx.\n",
hr);
821 ok(
hr ==
S_OK,
"Failed to create property set storage, hr %#lx.\n",
hr);
825 ok(
hr ==
S_OK,
"Failed to create property storage, hr %#lx.\n",
hr);
826 ps.ulKind = PRSPEC_PROPID;
830 hr = IPropertyStorage_WriteMultiple(prop_storage, 1, &ps, &pv, 0x10);
831 ok(
hr ==
S_OK,
"Failed to add property, hr %#lx.\n",
hr);
832 IPropertyStorage_Release(prop_storage);
836 ok(
hr ==
S_OK,
"Failed to open FMTID_DocSummaryInformation, hr %#lx.\n",
hr);
839 hr = IPropertyStorage_WriteMultiple(prop_storage, 1, &ps, &pv, 0x10);
840 ok(
hr ==
S_OK,
"Failed to add property, hr %#lx.\n",
hr);
841 IPropertyStorage_Release(prop_storage);
843 hr = IPropertySetStorage_Enum(ps_storage, &ps_enum);
844 ok(
hr ==
S_OK,
"Failed to get enum object, hr %#lx.\n",
hr);
845 memset(&psstg, 0,
sizeof(psstg));
846 hr = IEnumSTATPROPSETSTG_Next(ps_enum, 1, &psstg, &fetched);
847 ok(
hr ==
S_OK,
"Failed to get enum item, hr %#lx.\n",
hr);
848 ok(fetched == 1,
"Unexpected fetched count.\n");
851 memset(&psstg, 0,
sizeof(psstg));
852 hr = IEnumSTATPROPSETSTG_Next(ps_enum, 1, &psstg, &fetched);
854 IEnumSTATPROPSETSTG_Release(ps_enum);
858 ok(
hr ==
S_OK,
"Failed to open FMTID_DocSummaryInformation, hr %#lx.\n",
hr);
859 hr = IPropertyStorage_Enum(prop_storage, &prop_enum);
860 ok(
hr ==
S_OK,
"IPropertyStorage_Enum failed, hr %#lx.\n",
hr);
861 memset(&pstg, 0,
sizeof(pstg));
862 hr = IEnumSTATPROPSTG_Next(prop_enum, 1, &pstg, &fetched);
863 ok(
hr ==
S_OK,
"IEnumSTATPROPSTG_Next failed, hr %#lx.\n",
hr);
864 ok(pstg.propid == 0x10,
"pstg.propid = %lx\n", pstg.propid);
865 ok(pstg.vt ==
VT_UI4,
"pstg.vt = %d\n", pstg.vt);
866 memset(&pstg, 0,
sizeof(pstg));
867 hr = IEnumSTATPROPSTG_Next(prop_enum, 1, &pstg, &fetched);
868 ok(
hr ==
S_FALSE,
"IEnumSTATPROPSTG_Next failed, hr %#lx.\n",
hr);
869 IEnumSTATPROPSTG_Release(prop_enum);
870 IPropertyStorage_Release(prop_storage);
874 ok(
hr ==
S_OK,
"Failed to open FMTID_DocSummaryInformation, hr %#lx.\n",
hr);
875 hr = IPropertyStorage_Enum(prop_storage, &prop_enum);
876 ok(
hr ==
S_OK,
"IPropertyStorage_Enum failed, hr %#lx.\n",
hr);
877 memset(&pstg, 0,
sizeof(pstg));
878 hr = IEnumSTATPROPSTG_Next(prop_enum, 1, &pstg, &fetched);
879 ok(
hr ==
S_OK,
"IEnumSTATPROPSTG_Next failed, hr %#lx.\n",
hr);
880 ok(pstg.propid == 0x10,
"pstg.propid = %lx\n", pstg.propid);
882 memset(&pstg, 0,
sizeof(pstg));
883 hr = IEnumSTATPROPSTG_Next(prop_enum, 1, &pstg, &fetched);
884 ok(
hr ==
S_FALSE,
"IEnumSTATPROPSTG_Next failed, hr %#lx.\n",
hr);
885 IEnumSTATPROPSTG_Release(prop_enum);
886 IPropertyStorage_Release(prop_storage);
888 hr = IStorage_OpenStream(
storage,
L"\5DocumentSummaryInformation",
NULL,
890 ok(
hr ==
S_OK,
"IStorage_CreateStream failed, hr %#lx.\n",
hr);
892 ok(
hr ==
S_OK,
"IStream_Write failed, hr %#lx.\n",
hr);
897 ok(
hr ==
S_OK,
"Failed to open FMTID_DocSummaryInformation, hr %#lx.\n",
hr);
898 hr = IPropertyStorage_Enum(prop_storage, &prop_enum);
899 ok(
hr ==
S_OK,
"IPropertyStorage_Enum failed, hr %#lx.\n",
hr);
900 memset(&pstg, 0,
sizeof(pstg));
901 hr = IEnumSTATPROPSTG_Next(prop_enum, 1, &pstg, &fetched);
902 ok(
hr ==
S_OK,
"IEnumSTATPROPSTG_Next failed, hr %#lx.\n",
hr);
903 ok(pstg.propid == 0x10,
"pstg.propid = %lx\n", pstg.propid);
904 ok(pstg.vt ==
VT_UI4,
"pstg.vt = %d\n", pstg.vt);
905 memset(&pstg, 0,
sizeof(pstg));
906 hr = IEnumSTATPROPSTG_Next(prop_enum, 1, &pstg, &fetched);
907 ok(
hr ==
S_FALSE,
"IEnumSTATPROPSTG_Next failed, hr %#lx.\n",
hr);
908 IEnumSTATPROPSTG_Release(prop_enum);
909 IPropertyStorage_Release(prop_storage);
913 ok(
hr ==
S_OK,
"Failed to open FMTID_DocSummaryInformation, hr %#lx.\n",
hr);
914 hr = IPropertyStorage_Enum(prop_storage, &prop_enum);
915 ok(
hr ==
S_OK,
"IPropertyStorage_Enum failed, hr %#lx.\n",
hr);
916 memset(&pstg, 0,
sizeof(pstg));
917 hr = IEnumSTATPROPSTG_Next(prop_enum, 1, &pstg, &fetched);
918 ok(
hr ==
S_OK,
"IEnumSTATPROPSTG_Next failed, hr %#lx.\n",
hr);
919 ok(pstg.propid == 0x10,
"pstg.propid = %lx\n", pstg.propid);
921 memset(&pstg, 0,
sizeof(pstg));
922 hr = IEnumSTATPROPSTG_Next(prop_enum, 1, &pstg, &fetched);
923 ok(
hr ==
S_FALSE,
"IEnumSTATPROPSTG_Next failed, hr %#lx.\n",
hr);
924 IEnumSTATPROPSTG_Release(prop_enum);
925 IPropertyStorage_Release(prop_storage);
927 IPropertySetStorage_Release(ps_storage);
931 ok(
ret,
"Failed to delete storage file.\n");
HRESULT WINAPI PropVariantClear(PROPVARIANT *pvar)
static const WCHAR szDocSummaryInfo[]
static const WCHAR szSummaryInfo[]
HRESULT WINAPI FmtIdToPropStgName(const FMTID *rfmtid, LPOLESTR str)
HRESULT WINAPI PropStgNameToFmtId(const LPOLESTR str, FMTID *rfmtid)
HRESULT WINAPI StgCreatePropSetStg(IStorage *pstg, DWORD reserved, IPropertySetStorage **propset)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
LPWSTR WINAPI CharUpperW(WCHAR *str)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
_ACRTIMP int __cdecl strcmp(const char *, const char *)
static void ftime(struct _timeb *ptr)
struct tagPROPERTYIDOFFSET PROPERTYIDOFFSET
struct tagPROPERTYSETHEADER PROPERTYSETHEADER
struct tagFORMATIDOFFSET FORMATIDOFFSET
struct tagPROPERTYSECTIONHEADER PROPERTYSECTIONHEADER
HRESULT WINAPI StgOpenPropStg(IUnknown *unk, REFFMTID fmt, DWORD flags, DWORD reserved, IPropertyStorage **prop_stg)
HRESULT WINAPI StgCreatePropStg(IUnknown *unk, REFFMTID fmt, const CLSID *clsid, DWORD flags, DWORD reserved, IPropertyStorage **prop_stg)
HRESULT WINAPI StgOpenStorage(const OLECHAR *pwcsName, IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstgOpen)
HRESULT WINAPI StgCreateDocfile(LPCOLESTR pwcsName, DWORD grfMode, DWORD reserved, IStorage **ppstgOpen)
UINT WINAPI GetTempFileNameW(IN LPCWSTR lpPathName, IN LPCWSTR lpPrefixString, IN UINT uUnique, OUT LPWSTR lpTempFileName)
static void testProps(void)
static void testPropsHelper(IPropertySetStorage **propSetStorage)
static void testFmtId(void)
static void testCodepage(void)
static void test_propertyset_storage_enum(void)
#define STGM_SHARE_EXCLUSIVE
const FMTID FMTID_UserDefinedProperties
const FMTID FMTID_DocSummaryInformation
const FMTID FMTID_SummaryInformation
#define IsEqualCLSID(rclsid1, rclsid2)
static __inline const char * wine_dbgstr_guid(const GUID *id)
PROPVARIANT_DWORD prop2_val
FORMATIDOFFSET doc_summary
FORMATIDOFFSET user_def_props
PROPERTYSECTIONHEADER doc_summary_header
PROPVARIANT_DWORD prop1_val
PROPERTYSECTIONHEADER user_def_props_header
#define FIELD_OFFSET(t, f)
#define STG_E_INVALIDNAME
#define STG_E_INVALIDPARAMETER
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList