37DEFINE_GUID(
GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
38DEFINE_GUID(dummy_guid, 0xdeadbeef, 0xdead, 0xbeef, 0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0xba, 0xbe);
39DEFINE_GUID(
expect_guid, 0x12345678, 0x1234, 0x1234, 0x12, 0x34, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12);
40DEFINE_GUID(PKEY_WineTest, 0x7b317433, 0xdfa3, 0x4c44, 0xad, 0x3e, 0x2f, 0x80, 0x4b, 0x90, 0xdb, 0xf4);
41DEFINE_GUID(DUMMY_GUID1, 0x12345678, 0x1234,0x1234, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19);
43#define GUID_MEMBERS(g) {(g).Data1, (g).Data2, (g).Data3, {(g).Data4[0], (g).Data4[1], (g).Data4[2], (g).Data4[3], (g).Data4[4], (g).Data4[5], (g).Data4[6], (g).Data4[7]}}
45static const char topic[] =
"wine topic";
46static const WCHAR topicW[] = {
'w',
'i',
'n',
'e',
' ',
't',
'o',
'p',
'i',
'c',0};
50#define EXPECT_REF(obj,ref) _expect_ref((IUnknown *)obj, ref, __LINE__)
55 rc = IUnknown_Release(
obj);
56 ok_(__FILE__,
line)(rc ==
ref,
"expected refcount %ld, got %ld\n",
ref, rc);
61 static const WCHAR fillerW[] = {
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
62 'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
63 'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X'};
64 static const WCHAR zero_fillerW[] = {
'\0',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
65 'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
66 'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X'};
67 static const WCHAR zero_truncatedW[] = {
'\0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
68 '0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
69 '0',
'0',
'0',
'}',
' ',
'\0',
'9',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X'};
70 static const WCHAR zero_truncated2W[] = {
'\0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
71 '0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
72 '0',
'0',
'0',
'}',
' ',
'\0',
'9',
'2',
'7',
'6',
'9',
'4',
'9',
'2',
'X',
'X'};
73 static const WCHAR zero_truncated3W[] = {
'\0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
74 '0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
75 '0',
'0',
'0',
'}',
' ',
'\0',
'9',
'2',
'7',
'6',
'9',
'4',
'9',
'2',
'4',
'X'};
76 static const WCHAR zero_truncated4W[] = {
'\0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
77 '0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
78 '0',
'0',
'0',
'}',
' ',
'\0',
'7',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X'};
79 static const WCHAR truncatedW[] = {
'{',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
80 '0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
81 '0',
'}',
' ',
'\0',
'9',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X'};
82 static const WCHAR truncated2W[] = {
'{',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
83 '0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
84 '0',
'}',
' ',
'\0',
'9',
'2',
'7',
'6',
'9',
'4',
'9',
'2',
'X',
'X'};
85 static const WCHAR truncated3W[] = {
'{',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
86 '0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
87 '0',
'}',
' ',
'\0',
'9',
'2',
'7',
'6',
'9',
'4',
'9',
'2',
'4',
'X'};
88 static const WCHAR truncated4W[] = {
'{',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
89 '0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
90 '0',
'}',
' ',
'\0',
'7',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X'};
91 static const WCHAR expectedW[] = {
'{',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
92 '0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
93 '0',
'}',
' ',
'4',
'2',
'9',
'4',
'9',
'6',
'7',
'2',
'9',
'5',0};
94 static const WCHAR expected2W[] = {
'{',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
95 '0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
96 '0',
'}',
' ',
'1',
'3',
'5',
'7',
'9',
'\0',
'X',
'X',
'X',
'X',
'X'};
97 static const WCHAR expected3W[] = {
'{',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
98 '0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
99 '0',
'}',
' ',
'0',
'\0',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X'};
112 const WCHAR *buf_expect;
130 {&prop,
out, PKEYSTR_MAX,
S_OK, expectedW},
132 {&prop2,
out, GUIDSTRING_MAX + 6,
S_OK, expected2W},
133 {&prop2,
out, PKEYSTR_MAX,
S_OK, expected2W},
135 {&prop3,
out, GUIDSTRING_MAX + 2,
S_OK, expected3W},
136 {&prop3,
out, PKEYSTR_MAX,
S_OK, expected3W},
143 if (testcases[
i].psz)
144 memcpy(testcases[
i].psz, fillerW, PKEYSTR_MAX *
sizeof(
WCHAR));
149 ok(
ret == testcases[
i].hr_expect ||
150 broken(testcases[
i].hr_broken &&
ret == testcases[
i].hr2),
151 "[%d] Expected PSStringFromPropertyKey to return 0x%08lx, got 0x%08lx\n",
152 i, testcases[
i].hr_expect,
ret);
154 if (testcases[
i].psz)
155 ok(!
memcmp(testcases[
i].psz, testcases[
i].buf_expect, PKEYSTR_MAX *
sizeof(
WCHAR)) ||
156 broken(testcases[
i].buf_broken &&
157 !
memcmp(testcases[
i].psz, testcases[
i].buf2, PKEYSTR_MAX *
sizeof(
WCHAR))),
158 "[%d] Unexpected output contents\n",
i);
164 static const WCHAR fmtid_clsidW[] = {
'S',
't',
'd',
'F',
'o',
'n',
't',
' ',
'1',0};
165 static const WCHAR fmtid_truncatedW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
166 '1',
'2',
'3',
'4',
'-',0};
167 static const WCHAR fmtid_nobracketsW[] = {
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
168 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
169 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',0};
170 static const WCHAR fmtid_badbracketW[] = {
'X',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
171 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
172 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
173 static const WCHAR fmtid_badcharW[] = {
'{',
'X',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
174 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
175 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
176 static const WCHAR fmtid_badchar2W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'X',
'-',
'1',
'2',
'3',
'4',
'-',
177 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
178 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
179 static const WCHAR fmtid_baddashW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'X',
'1',
'2',
'3',
'4',
'-',
180 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
181 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
182 static const WCHAR fmtid_badchar3W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'X',
'2',
'3',
'4',
'-',
183 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
184 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
185 static const WCHAR fmtid_badchar4W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'X',
'-',
186 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
187 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
188 static const WCHAR fmtid_baddash2W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'X',
189 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
190 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
191 static const WCHAR fmtid_badchar5W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
192 'X',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
193 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
194 static const WCHAR fmtid_badchar6W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
195 '1',
'2',
'3',
'X',
'-',
'1',
'2',
'3',
'4',
'-',
196 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
197 static const WCHAR fmtid_baddash3W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
198 '1',
'2',
'3',
'4',
'X',
'1',
'2',
'3',
'4',
'-',
199 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
200 static const WCHAR fmtid_badchar7W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
201 '1',
'2',
'3',
'4',
'-',
'X',
'2',
'3',
'4',
'-',
202 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
203 static const WCHAR fmtid_badchar8W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
204 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'X',
'-',
205 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
206 static const WCHAR fmtid_baddash4W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
207 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'X',
208 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
209 static const WCHAR fmtid_badchar9W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
210 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
211 'X',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
212 static const WCHAR fmtid_badchar9_adjW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
213 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
214 '1',
'X',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
215 static const WCHAR fmtid_badchar10W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
216 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
217 '1',
'2',
'X',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
218 static const WCHAR fmtid_badchar11W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
219 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
220 '1',
'2',
'3',
'4',
'X',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
221 static const WCHAR fmtid_badchar12W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
222 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
223 '1',
'2',
'3',
'4',
'5',
'6',
'X',
'8',
'9',
'0',
'1',
'2',
'}',0};
224 static const WCHAR fmtid_badchar13W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
225 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
226 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'X',
'0',
'1',
'2',
'}',0};
227 static const WCHAR fmtid_badchar14W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
228 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
229 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'X',
'2',
'}',0};
230 static const WCHAR fmtid_badbracket2W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
231 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
232 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'X',0};
233 static const WCHAR fmtid_spaceW[] = {
' ',
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
234 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
235 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
236 static const WCHAR fmtid_spaceendW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
237 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
238 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',0};
239 static const WCHAR fmtid_spacesendW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
240 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
241 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
' ',
' ',0};
242 static const WCHAR fmtid_nopidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
243 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
244 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
245 static const WCHAR fmtid_badpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
246 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
247 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'D',
'E',
'A',
'D',0};
248 static const WCHAR fmtid_adjpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
249 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
250 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
'1',
'3',
'5',
'7',
'9',0};
251 static const WCHAR fmtid_spacespidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
252 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
253 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
' ',
' ',
'1',
'3',
'5',
'7',
'9',0};
254 static const WCHAR fmtid_negpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
255 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
256 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'-',
'1',
'3',
'5',
'7',
'9',0};
257 static const WCHAR fmtid_negnegpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
258 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
259 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'-',
'-',
'1',
'3',
'5',
'7',
'9',0};
260 static const WCHAR fmtid_negnegnegpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
261 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
262 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'-',
'-',
'-',
'1',
'3',
'5',
'7',
'9',0};
263 static const WCHAR fmtid_negspacepidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
264 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
265 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'-',
' ',
'1',
'3',
'5',
'7',
'9',0};
266 static const WCHAR fmtid_negspacenegpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
267 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
268 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'-',
' ',
'-',
'1',
'3',
'5',
'7',
'9',0};
269 static const WCHAR fmtid_negspacespidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
270 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
271 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'-',
' ',
'-',
' ',
'-',
'1',
'3',
'5',
'7',
'9',0};
272 static const WCHAR fmtid_pospidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
273 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
274 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'+',
'1',
'3',
'5',
'7',
'9',0};
275 static const WCHAR fmtid_posnegpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
276 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
277 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'+',
'-',
'+',
'-',
'1',
'3',
'5',
'7',
'9',0};
278 static const WCHAR fmtid_symbolpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
279 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
280 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'+',
'/',
'$',
'-',
'1',
'3',
'5',
'7',
'9',0};
281 static const WCHAR fmtid_letterpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
282 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
283 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'A',
'B',
'C',
'D',
'1',
'3',
'5',
'7',
'9',0};
284 static const WCHAR fmtid_spacepadpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
285 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
286 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'1',
'3',
'5',
'7',
'9',
' ',
' ',
' ',0};
287 static const WCHAR fmtid_spacemixpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
288 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
289 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'1',
' ',
'3',
' ',
'5',
'7',
'9',
' ',
' ',
' ',0};
290 static const WCHAR fmtid_tabpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
291 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
292 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
'\t',
'1',
'3',
'5',
'7',
'9',0};
293 static const WCHAR fmtid_hexpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
294 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
295 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'0',
'x',
'D',
'E',
'A',
'D',0};
296 static const WCHAR fmtid_mixedpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
297 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
298 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'A',
'9',
'B',
'5',
'C',
'3',
'D',
'1',0};
299 static const WCHAR fmtid_overflowpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
300 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
301 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',0};
302 static const WCHAR fmtid_commapidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
303 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
304 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
',',
'1',
'3',
'5',
'7',
'9',0};
305 static const WCHAR fmtid_commaspidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
306 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
307 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
',',
',',
',',
'1',
'3',
'5',
'7',
'9',0};
308 static const WCHAR fmtid_commaspacepidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
309 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
310 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
',',
' ',
'1',
'3',
'5',
'7',
'9',0};
311 static const WCHAR fmtid_spacecommapidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
312 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
313 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
',',
'1',
'3',
'5',
'7',
'9',0};
314 static const WCHAR fmtid_spccommaspcpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
315 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
316 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
',',
' ',
'1',
'3',
'5',
'7',
'9',0};
317 static const WCHAR fmtid_spacescommaspidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
318 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
319 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
',',
' ',
',',
'1',
'3',
'5',
'7',
'9',0};
320 static const WCHAR fmtid_commanegpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
321 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
322 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
',',
'-',
'1',
'3',
'5',
'7',
'9',0};
323 static const WCHAR fmtid_spccommanegpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
324 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
325 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
',',
'-',
'1',
'3',
'5',
'7',
'9',0};
326 static const WCHAR fmtid_commaspcnegpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
327 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
328 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
',',
' ',
'-',
'1',
'3',
'5',
'7',
'9',0};
329 static const WCHAR fmtid_spccommaspcnegpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
330 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
331 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
',',
' ',
'-',
'1',
'3',
'5',
'7',
'9',0};
332 static const WCHAR fmtid_commanegspcpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
333 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
334 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
',',
'-',
' ',
'1',
'3',
'5',
'7',
'9',0};
335 static const WCHAR fmtid_negcommapidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
336 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
337 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
'-',
',',
'1',
'3',
'5',
'7',
'9',0};
338 static const WCHAR fmtid_normalpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
339 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
340 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'1',
'3',
'5',
'7',
'9',0};
341 static const WCHAR fmtid_udigitW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
342 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
343 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'1',
'2',
'3',0x661,
'5',
'7',
'9',0};
344 PROPERTYKEY out_init = {
GUID_MEMBERS(dummy_guid), 0xdeadbeef};
353 PROPERTYKEY pkey_expect;
361 {fmtid_truncatedW, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0,0,0,0,0,0,0,0}}, 0}},
366 {fmtid_baddashW, &
out,
E_INVALIDARG, { {0x12345678,0,0,{0,0,0,0,0,0,0,0}}, 0}},
367 {fmtid_badchar3W, &
out,
E_INVALIDARG, { {0x12345678,0,0,{0,0,0,0,0,0,0,0}}, 0}},
368 {fmtid_badchar4W, &
out,
E_INVALIDARG, { {0x12345678,0,0,{0,0,0,0,0,0,0,0}}, 0}},
369 {fmtid_baddash2W, &
out,
E_INVALIDARG, { {0x12345678,0,0,{0,0,0,0,0,0,0,0}}, 0}},
370 {fmtid_badchar5W, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0,{0,0,0,0,0,0,0,0}}, 0}},
371 {fmtid_badchar6W, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0,{0,0,0,0,0,0,0,0}}, 0}},
372 {fmtid_baddash3W, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0,{0,0,0,0,0,0,0,0}}, 0}},
373 {fmtid_badchar7W, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0,0,0,0,0,0,0,0}}, 0}},
374 {fmtid_badchar8W, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0,0,0,0,0,0,0}}, 0}},
375 {fmtid_baddash4W, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0,0,0,0,0,0,0}}, 0}},
376 {fmtid_badchar9W, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0,0,0,0,0,0}}, 0}},
377 {fmtid_badchar9_adjW, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0,0,0,0,0,0}}, 0}},
378 {fmtid_badchar10W, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0x12,0,0,0,0,0}}, 0}},
379 {fmtid_badchar11W, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0x12,0x34,0,0,0,0}}, 0}},
380 {fmtid_badchar12W, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0x12,0x34,0x56,0,0,0}}, 0}},
381 {fmtid_badchar13W, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0x12,0x34,0x56,0x78,0,0}}, 0}},
382 {fmtid_badchar14W, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0x12,0x34,0x56,0x78,0x90,0}}, 0}},
383 {fmtid_badbracket2W, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0x12,0x34,0x56,0x78,0x90,0x00}}, 0 }},
427 if (testcases[
i].pkey)
428 *testcases[
i].pkey = out_init;
431 ok(
ret == testcases[
i].hr_expect,
432 "[%d] Expected PSPropertyKeyFromString to return 0x%08lx, got 0x%08lx\n",
433 i, testcases[
i].hr_expect,
ret);
435 if (testcases[
i].pkey)
437 ok(
IsEqualGUID(&testcases[
i].pkey->fmtid, &testcases[
i].pkey_expect.fmtid),
438 "[%d] Expected GUID %s, got %s\n",
440 ok(testcases[
i].pkey->pid == testcases[
i].pkey_expect.pid,
441 "[%d] Expected property ID %lu, got %lu\n",
442 i, testcases[
i].pkey_expect.pid, testcases[
i].pkey->pid);
454 "Expected PSRefreshPropertySchema to return CO_E_NOTINITIALIZED, got 0x%08lx\n",
ret);
460 "Expected PSRefreshPropertySchema to return S_OK, got 0x%08lx\n",
ret);
476 {&
IID_NULL,
L"{00000000-0000-0000-0000-000000000000}" },
493 memset(&propvar, 0,
sizeof(PROPVARIANT));
495 ok(
hres ==
S_OK,
"%d) InitPropVariantFromGUIDAsString returned %lx\n",
i,
hres);
496 ok(propvar.vt ==
VT_LPWSTR,
"%d) propvar.vt = %d\n",
i, propvar.vt);
497 ok(!
lstrcmpW(propvar.pwszVal, testcases[
i].str),
"%d) propvar.pwszVal = %s\n",
503 ok(
hres ==
S_OK,
"%d) InitVariantFromGUIDAsString returned %lx\n",
i,
hres);
515 static const char data_in[] =
"test";
523 ok(
hres ==
S_OK,
"InitPropVariantFromBuffer returned %lx\n",
hres);
525 ok(propvar.caub.cElems == 0,
"cElems = %d\n", propvar.caub.cElems == 0);
529 ok(
hres ==
S_OK,
"InitPropVariantFromBuffer returned %lx\n",
hres);
531 ok(propvar.caub.cElems == 4,
"cElems = %d\n", propvar.caub.cElems == 0);
532 ok(!
memcmp(propvar.caub.pElems, data_in, 4),
"Data inside array is incorrect\n");
539 ok(
size == 1,
"SafeArrayGetDim returned %ld\n",
size);
552 ok(
size == 1,
"SafeArrayGetDim returned %ld\n",
size);
561 ok(!
memcmp(data_in, data_out, 4),
"Data inside safe array is incorrect\n");
575 ok(
hres ==
S_OK,
"InitPropVariantFromGUIDAsString failed %lx\n",
hres);
583 ok(
hres ==
S_OK,
"InitPropVariantFromGUIDAsString failed %lx\n",
hres);
589 ok(propvar.vt ==
VT_LPWSTR,
"incorrect PROPVARIANT type: %d\n", propvar.vt);
590 propvar.pwszVal[1] =
'd';
591 propvar.pwszVal[2] =
'E';
592 propvar.pwszVal[3] =
'a';
597 propvar.pwszVal[1] =
'z';
604 ok(
hres ==
S_OK,
"InitVariantFromGUIDAsString failed %lx\n",
hres);
612 ok(
hres ==
S_OK,
"InitVariantFromGUIDAsString failed %lx\n",
hres);
668 prop.puuid = (
CLSID *)&dummy_guid;
670 ok(
hres ==
S_OK,
"PropVariantToStringAlloc returned %#lx.\n",
hres);
677 PROPVARIANT
empty,
null, emptyarray, i2_0, i2_2, i4_large, i4_largeneg, i4_2, str_2, str_02, str_b;
678 PROPVARIANT clsid_null,
clsid, clsid2, r4_0, r4_2, r8_0, r8_2;
679 PROPVARIANT ui4, ui4_large;
680 PROPVARIANT var1, var2;
682 static const WCHAR str_2W[] = {
'2', 0};
683 static const WCHAR str_02W[] = {
'0',
'2', 0};
684 static const WCHAR str_bW[] = {
'b', 0};
686 unsigned char bytevector1[] = {1,2,3};
687 unsigned char bytevector2[] = {4,5,6};
689 PropVariantInit(&
empty);
690 PropVariantInit(&
null);
691 PropVariantInit(&emptyarray);
692 PropVariantInit(&i2_0);
693 PropVariantInit(&i2_2);
694 PropVariantInit(&i4_large);
695 PropVariantInit(&i4_largeneg);
696 PropVariantInit(&i4_2);
697 PropVariantInit(&str_2);
698 PropVariantInit(&str_b);
703 emptyarray.parray = &emptysafearray;
704 emptysafearray.
cDims = 1;
705 emptysafearray.
fFeatures = FADF_FIXEDSIZE;
707 emptysafearray.
cLocks = 0;
716 i4_large.lVal = 65536;
717 i4_largeneg.vt =
VT_I4;
718 i4_largeneg.lVal = -65536;
724 ui4_large.ulVal = 65536;
732 clsid_null.puuid =
NULL;
872 var1.caub.cElems = 1;
873 var1.caub.pElems = bytevector1;
875 var2.caub.cElems = 1;
876 var2.caub.pElems = bytevector2;
885 var1.caub.cElems = 2;
892 var1.caub.pElems = bytevector2;
893 var2.caub.pElems = bytevector1;
897 var1.caub.pElems = bytevector1;
898 var2.caub.pElems = bytevector2;
900 var1.caub.cElems = 1;
901 var2.caub.cElems = 2;
909 var1.caub.pElems = bytevector1;
910 var2.caub.pElems = bytevector1;
918 var1.caub.cElems = 1;
919 var2.caub.cElems = 1;
923 var1.caub.cElems = 0;
934 var2.caub.cElems = 0;
956 ok (
FAILED(
hr),
"PropVariantClear fails on invalid vt.\n");
962 propvar.hVal.QuadPart = (
ULONGLONG)1 << 63;
978 ok(ulval == 77,
"ulval=%lu\n", ulval);
987 propvar.uhVal.QuadPart = 5;
999 ok(lval == 5,
"got wrong value %ld\n", lval);
1003 ok(ulval == 5,
"got wrong value %ld\n", ulval);
1006 ok(ulval == 5,
"got wrong value %lu\n", ulval);
1010 ok(sval == 5,
"got wrong value %d\n", sval);
1014 ok(usval == 5,
"got wrong value %d\n", usval);
1017 propvar.hVal.QuadPart = -5;
1028 ok(lval == -5,
"got wrong value %ld\n", lval);
1034 ok(ulval == 77,
"ulval=%lu\n", ulval);
1038 ok(sval == -5,
"got wrong value %d\n", sval);
1074 static WCHAR str_0[] = {
'0',0};
1075 static WCHAR str_1[] = {
'1',0};
1076 static WCHAR str_7[] = {
'7',0};
1077 static WCHAR str_n7[] = {
'-',
'7',0};
1078 static WCHAR str_true[] = {
't',
'r',
'u',
'e',0};
1079 static WCHAR str_true2[] = {
'#',
'T',
'R',
'U',
'E',
'#',0};
1080 static WCHAR str_true_case[] = {
't',
'R',
'U',
'e',0};
1081 static WCHAR str_false[] = {
'f',
'a',
'l',
's',
'e',0};
1082 static WCHAR str_false2[] = {
'#',
'F',
'A',
'L',
'S',
'E',
'#',0};
1083 static WCHAR str_true_space[] = {
't',
'r',
'u',
'e',
' ',0};
1084 static WCHAR str_yes[] = {
'y',
'e',
's',0};
1085 PROPVARIANT propvar;
1091 propvar.boolVal = VARIANT_FALSE;
1098 propvar.boolVal = 1;
1105 propvar.boolVal = VARIANT_TRUE;
1113 propvar.boolVal = VARIANT_TRUE;
1150 propvar.pwszVal = str_0;
1157 propvar.pwszVal = str_1;
1164 propvar.pwszVal = str_7;
1171 propvar.pwszVal = str_n7;
1178 propvar.pwszVal = str_true;
1185 propvar.pwszVal = str_true_case;
1192 propvar.pwszVal = str_true2;
1199 propvar.pwszVal = str_false;
1206 propvar.pwszVal = str_false2;
1213 propvar.pwszVal = str_true_space;
1220 propvar.pwszVal = str_yes;
1227 propvar.pwszVal =
NULL;
1235 propvar.pszVal = (
char *)
"#TruE#";
1242 propvar.pszVal = (
char *)
"#TRUE#";
1249 propvar.pszVal = (
char *)
"tRUe";
1256 propvar.pszVal = (
char *)
"#FALSE#";
1263 propvar.pszVal = (
char *)
"fALSe";
1270 propvar.pszVal = (
char *)
"1";
1277 propvar.pszVal = (
char *)
"-1";
1285 PROPVARIANT propvar;
1286 static WCHAR default_value[] = {
't',
'e',
's',
't', 0};
1287 static WCHAR wstr_test2[] = {
't',
'e',
's',
't',
'2', 0};
1288 static WCHAR wstr_empty[] = {0};
1289 static WCHAR wstr_space[] = {
' ', 0};
1290 static CHAR str_test2[] =
"test2";
1291 static CHAR str_empty[] =
"";
1292 static CHAR str_space[] =
" ";
1304 propvar.boolVal = VARIANT_TRUE;
1314 propvar.puuid = (
CLSID *)&dummy_guid;
1321 propvar.pwszVal =
NULL;
1326 propvar.pwszVal = wstr_empty;
1331 propvar.pwszVal = wstr_space;
1336 propvar.pwszVal = wstr_test2;
1343 propvar.pszVal =
NULL;
1348 propvar.pszVal = str_empty;
1353 propvar.pszVal = str_space;
1358 propvar.pszVal = str_test2;
1365 propvar.bstrVal =
NULL;
1393 PropVariantInit(&
dest);
1426 PROPVARIANT propvar;
1430 memset(&propvar, 0,
sizeof(propvar));
1437 ok(propvar.vt ==
VT_CLSID,
"Unexpected type %d.\n", propvar.vt);
1444 static const WCHAR *strs[2] = {
L"abc",
L"def" };
1445 PROPVARIANT propvar;
1448 memset(&propvar, 0,
sizeof(propvar));
1455 ok(!propvar.calpwstr.cElems,
"Unexpected number of elements.\n");
1456 ok(!!propvar.calpwstr.pElems,
"Unexpected vector pointer.\n");
1462 ok(propvar.calpwstr.cElems == 2,
"Unexpected number of elements.\n");
1463 ok(!!propvar.calpwstr.pElems,
"Unexpected vector pointer.\n");
1464 ok(propvar.calpwstr.pElems[0] != strs[0],
"Unexpected string pointer.\n");
1465 ok(!
wcscmp(propvar.calpwstr.pElems[0], strs[0]),
"Unexpected string %s.\n",
debugstr_w(propvar.calpwstr.pElems[0]));
1466 ok(propvar.calpwstr.pElems[1] != strs[1],
"Unexpected string pointer.\n");
1467 ok(!
wcscmp(propvar.calpwstr.pElems[1], strs[1]),
"Unexpected string %s.\n",
debugstr_w(propvar.calpwstr.pElems[1]));
1473 PROPVARIANT propvar;
1477 PropVariantInit(&propvar);
1479 propvar.dblVal = 15.0;
1481 ok(
hr ==
S_OK,
"PropVariantToDouble failed: 0x%08lx.\n",
hr);
1488 ok(
hr ==
S_OK,
"PropVariantToDouble failed: 0x%08lx.\n",
hr);
1493 propvar.lVal = -256;
1495 ok(
hr ==
S_OK,
"PropVariantToDouble failed: 0x%08lx.\n",
hr);
1500 propvar.lVal = 65536;
1502 ok(
hr ==
S_OK,
"PropVariantToDouble failed: 0x%08lx.\n",
hr);
1503 ok(
value == 65536.0,
"Unexpected value: %f.\n",
value);
1507 propvar.lVal = -321;
1509 ok(
hr ==
S_OK,
"PropVariantToDouble failed: 0x%08lx.\n",
hr);
1510 ok(
value == 4294966975.0,
"Unexpected value: %f.\n",
value);
1516 ok(
hr ==
S_OK,
"PropVariantToDouble failed: 0x%08lx.\n",
hr);
1521 propvar.uhVal.QuadPart = 8;
1523 ok(
hr ==
S_OK,
"PropVariantToDouble failed: 0x%08lx.\n",
hr);
1530 static CHAR string[] =
"Wine";
1531 WCHAR bufferW[256] = {0};
1532 PROPVARIANT propvar;
1535 PropVariantInit(&propvar);
1541 ok(!bufferW[0],
"got wrong string: \"%s\".\n",
wine_dbgstr_w(bufferW));
1542 memset(bufferW, 0,
sizeof(bufferW));
1545 PropVariantInit(&propvar);
1550 ok(
hr ==
S_OK,
"PropVariantToString failed: 0x%08lx.\n",
hr);
1551 ok(!bufferW[0],
"got wrong string: \"%s\".\n",
wine_dbgstr_w(bufferW));
1552 memset(bufferW, 0,
sizeof(bufferW));
1555 PropVariantInit(&propvar);
1560 ok(
hr ==
S_OK,
"PropVariantToString failed: 0x%08lx.\n",
hr);
1561 ok(!bufferW[0],
"got wrong string: \"%s\".\n",
wine_dbgstr_w(bufferW));
1562 memset(bufferW, 0,
sizeof(bufferW));
1565 PropVariantInit(&propvar);
1571 memset(bufferW, 0,
sizeof(bufferW));
1574 PropVariantInit(&propvar);
1578 ok(
hr ==
S_OK,
"PropVariantToString failed: 0x%08lx.\n",
hr);
1580 memset(bufferW, 0,
sizeof(bufferW));
1582 PropVariantInit(&propvar);
1586 ok(
hr ==
S_OK,
"PropVariantToString failed: 0x%08lx.\n",
hr);
1588 memset(bufferW, 0,
sizeof(bufferW));
1591 PropVariantInit(&propvar);
1593 propvar.lVal = 123456;
1599 memset(bufferW, 0,
sizeof(bufferW));
1601 PropVariantInit(&propvar);
1607 memset(bufferW, 0,
sizeof(bufferW));
1609 PropVariantInit(&propvar);
1615 memset(bufferW, 0,
sizeof(bufferW));
1617 PropVariantInit(&propvar);
1621 ok(
hr ==
S_OK,
"PropVariantToString failed: 0x%08lx.\n",
hr);
1623 memset(bufferW, 0,
sizeof(bufferW));
1626 PropVariantInit(&propvar);
1628 propvar.puuid = (
CLSID *)&dummy_guid;
1630 ok(
hr ==
S_OK,
"PropVariantToString returned %#lx.\n",
hr);
1632 memset(bufferW, 0,
sizeof(bufferW));
1635#define check_PropVariantToBSTR(type, member, value, expect_str) \
1638 PROPVARIANT check_propvar_ = {.vt = (type), .member = (value)}; \
1639 HRESULT check_hr_; \
1642 check_hr_ = PropVariantToBSTR(&check_propvar_, &check_bstr_); \
1643 ok_(__FILE__, __LINE__)(check_hr_ == S_OK, \
1644 "PropVariantToBSTR returned %#lx.\n", check_hr_); \
1646 if (check_hr_ == S_OK) \
1648 ok_(__FILE__, __LINE__)(!wcscmp(check_bstr_, (expect_str)), \
1649 "Unexpected bstr %s.\n", debugstr_w(check_bstr_)); \
1650 SysFreeString(check_bstr_); \
1656 unsigned char test_bytes[] = {1, 20, 30, 4};
1657 WCHAR test_bstr[] = {
'a', 0,
'b', 0,
'c'};
1658 PROPVARIANT propvar;
1687 PropVariantInit(&propvar);
1689 propvar.filetime.dwLowDateTime = 0xdead;
1690 propvar.filetime.dwHighDateTime = 0xbeef;
1693 ok(
hr ==
S_OK,
"PropVariantToBSTR returned %#lx.\n",
hr);
1700 PropVariantInit(&propvar);
1702 propvar.date = 123.123f;
1705 ok(
hr ==
S_OK,
"PropVariantToBSTR returned %#lx.\n",
hr);
1712 PropVariantInit(&propvar);
1714 propvar.caub.cElems =
ARRAY_SIZE(test_bytes);
1715 propvar.caub.pElems = test_bytes;
1718 ok(
hr ==
S_OK,
"PropVariantToBSTR returned %#lx.\n",
hr);
1725 PropVariantInit(&propvar);
1729 ok(
hr ==
S_OK,
"PropVariantToBSTR returned %#lx.\n",
hr);
1739 PROPVARIANT propvar;
1742 INT8 data_int8[] = {1,2,3,4,5,6,7,8,9,10};
1749 ok(
hr ==
S_OK,
"InitPropVariantFromBuffer failed 0x%08lx.\n",
hr);
1751 ok(
hr ==
S_OK,
"PropVariantToBuffer failed: 0x%08lx.\n",
hr);
1755 ok(
hr ==
S_OK,
"InitPropVariantFromBuffer failed 0x%08lx.\n",
hr);
1757 ok(
hr ==
S_OK,
"PropVariantToBuffer failed: 0x%08lx.\n",
hr);
1763 ok(
hr ==
S_OK,
"InitPropVariantFromBuffer failed 0x%08lx.\n",
hr);
1766 ok(
hr ==
E_FAIL,
"PropVariantToBuffer returned: 0x%08lx.\n",
hr);
1767 ok(
buffer[0] == 99,
"got wrong buffer.\n");
1772 ok(
hr ==
S_OK,
"InitPropVariantFromBuffer failed 0x%08lx.\n",
hr);
1774 ok(
hr ==
S_OK,
"PropVariantToBuffer failed: 0x%08lx.\n",
hr);
1779 PropVariantInit(&propvar);
1785 ok(
sa !=
NULL,
"SafeArrayCreate failed.\n");
1787 ok(
hr ==
S_OK,
"SafeArrayAccessData failed: 0x%08lx.\n",
hr);
1790 ok(
hr ==
S_OK,
"SafeArrayUnaccessData failed: 0x%08lx.\n",
hr);
1791 propvar.parray =
sa;
1795 ok(
buffer[0] == 99,
"got wrong buffer.\n");
1799 PropVariantInit(&propvar);
1805 ok(
sa !=
NULL,
"SafeArrayCreate failed.\n");
1807 ok(
hr ==
S_OK,
"SafeArrayAccessData failed: 0x%08lx.\n",
hr);
1810 ok(
hr ==
S_OK,
"SafeArrayUnaccessData failed: 0x%08lx.\n",
hr);
1811 propvar.parray =
sa;
1818 PropVariantInit(&propvar);
1821 propvar.caub.cElems =
sizeof(data_int8);
1822 memcpy(propvar.caub.pElems, data_int8,
sizeof(data_int8));
1827 PropVariantInit(&propvar);
1833 ok(
sa !=
NULL,
"SafeArrayCreate failed.\n");
1835 ok(
hr ==
S_OK,
"SafeArrayAccessData failed: 0x%08lx.\n",
hr);
1838 ok(
hr ==
S_OK,
"SafeArrayUnaccessData failed: 0x%08lx.\n",
hr);
1839 propvar.parray =
sa;
1850 PROPVARIANT propvar;
1857 &IID_IPropertyStoreCache, (
void**)&propcache);
1858 ok(
hr ==
S_OK,
"CoCreateInstance failed, hr=%lx\n",
hr);
1862 win_skip(
"CLSID_InMemoryPropertyStore not supported\n");
1867 hr = IPropertyStoreCache_GetCount(propcache,
NULL);
1870 hr = IPropertyStoreCache_GetCount(propcache, &
count);
1871 ok(
hr ==
S_OK,
"GetCount failed, hr=%lx\n",
hr);
1872 ok(
count == 0,
"GetCount returned %li, expected 0\n",
count);
1874 hr = IPropertyStoreCache_Commit(propcache);
1875 ok(
hr ==
S_OK,
"Commit failed, hr=%lx\n",
hr);
1877 hr = IPropertyStoreCache_Commit(propcache);
1878 ok(
hr ==
S_OK,
"Commit failed, hr=%lx\n",
hr);
1880 hr = IPropertyStoreCache_GetAt(propcache, 0, &pkey);
1883 pkey.fmtid = PKEY_WineTest;
1886 memset(&propvar, 0,
sizeof(propvar));
1888 propvar.lVal = 12345;
1893 hr = IPropertyStoreCache_SetValue(propcache,
NULL, &propvar);
1896 hr = IPropertyStoreCache_SetValue(propcache, &pkey,
NULL);
1900 hr = IPropertyStoreCache_SetValue(propcache, &pkey, &propvar);
1901 ok(
hr ==
S_OK,
"SetValue failed, hr=%lx\n",
hr);
1903 hr = IPropertyStoreCache_GetCount(propcache, &
count);
1904 ok(
hr ==
S_OK,
"GetCount failed, hr=%lx\n",
hr);
1905 ok(
count == 1,
"GetCount returned %li, expected 0\n",
count);
1907 memset(&pkey, 0,
sizeof(pkey));
1909 hr = IPropertyStoreCache_GetAt(propcache, 0, &pkey);
1910 ok(
hr ==
S_OK,
"GetAt failed, hr=%lx\n",
hr);
1911 ok(
IsEqualGUID(&pkey.fmtid, &PKEY_WineTest),
"got wrong pkey\n");
1912 ok(pkey.pid == 4,
"got pid of %li, expected 4\n", pkey.pid);
1914 pkey.fmtid = PKEY_WineTest;
1917 memset(&propvar, 0,
sizeof(propvar));
1922 hr = IPropertyStoreCache_GetValue(propcache,
NULL, &propvar);
1926 hr = IPropertyStoreCache_GetValue(propcache, &pkey,
NULL);
1929 hr = IPropertyStoreCache_GetValue(propcache, &pkey, &propvar);
1930 ok(
hr ==
S_OK,
"GetValue failed, hr=%lx\n",
hr);
1931 ok(propvar.vt ==
VT_I4,
"expected VT_I4, got %d\n", propvar.vt);
1932 ok(propvar.lVal == 12345,
"expected 12345, got %ld\n", propvar.lVal);
1934 pkey.fmtid = PKEY_WineTest;
1939 hr = IPropertyStoreCache_GetValue(propcache, &pkey, &propvar);
1940 ok(
hr ==
S_OK,
"GetValue failed, hr=%lx\n",
hr);
1941 ok(propvar.vt ==
VT_EMPTY,
"expected VT_EMPTY, got %d\n", propvar.vt);
1944 hr = IPropertyStoreCache_GetState(propcache, &pkey, &
state);
1946 ok(
state == PSC_NORMAL,
"expected PSC_NORMAL, got %d\n",
state);
1950 hr = IPropertyStoreCache_GetValueAndState(propcache, &pkey, &propvar, &
state);
1952 ok(propvar.vt ==
VT_EMPTY,
"expected VT_EMPTY, got %d\n", propvar.vt);
1953 ok(
state == PSC_NORMAL,
"expected PSC_NORMAL, got %d\n",
state);
1956 hr = IPropertyStoreCache_SetState(propcache, &pkey, PSC_NORMAL);
1960 pkey.fmtid = PKEY_WineTest;
1964 hr = IPropertyStoreCache_GetState(propcache, &pkey, &
state);
1965 ok(
hr ==
S_OK,
"GetState failed, hr=%lx\n",
hr);
1966 ok(
state == PSC_NORMAL,
"expected PSC_NORMAL, got %d\n",
state);
1968 hr = IPropertyStoreCache_SetState(propcache, &pkey, 10);
1969 ok(
hr ==
S_OK,
"SetState failed, hr=%lx\n",
hr);
1972 hr = IPropertyStoreCache_GetState(propcache, &pkey, &
state);
1973 ok(
hr ==
S_OK,
"GetState failed, hr=%lx\n",
hr);
1977 propvar.lVal = 12346;
1978 hr = IPropertyStoreCache_SetValueAndState(propcache, &pkey, &propvar, 5);
1979 ok(
hr ==
S_OK,
"SetValueAndState failed, hr=%lx\n",
hr);
1981 memset(&propvar, 0,
sizeof(propvar));
1983 hr = IPropertyStoreCache_GetValueAndState(propcache, &pkey, &propvar, &
state);
1984 ok(
hr ==
S_OK,
"GetValueAndState failed, hr=%lx\n",
hr);
1985 ok(propvar.vt ==
VT_I4,
"expected VT_I4, got %d\n", propvar.vt);
1986 ok(propvar.lVal == 12346,
"expected 12346, got %d\n", propvar.vt);
1990 pkey.fmtid = PKEY_WineTest;
1994 propvar.lVal = 12347;
1995 hr = IPropertyStoreCache_SetValueAndState(propcache, &pkey, &propvar, PSC_DIRTY);
1996 ok(
hr ==
S_OK,
"SetValueAndState failed, hr=%lx\n",
hr);
1998 memset(&propvar, 0,
sizeof(propvar));
2000 hr = IPropertyStoreCache_GetValueAndState(propcache, &pkey, &propvar, &
state);
2001 ok(
hr ==
S_OK,
"GetValueAndState failed, hr=%lx\n",
hr);
2002 ok(propvar.vt ==
VT_I4,
"expected VT_I4, got %d\n", propvar.vt);
2003 ok(propvar.lVal == 12347,
"expected 12347, got %d\n", propvar.vt);
2004 ok(
state == PSC_DIRTY,
"expected PSC_DIRTY, got %d\n",
state);
2006 IPropertyStoreCache_Release(propcache);
2022 &IID_IPropertyStore, (
void**)&propstore);
2023 ok(
hr ==
S_OK,
"CoCreateInstance failed, hr=%lx\n",
hr);
2025 hr = IPropertyStore_QueryInterface(propstore, &IID_IPersistSerializedPropStorage,
2026 (
void**)&serialized);
2031 IPropertyStore_Release(propstore);
2032 skip(
"IPersistSerializedPropStorage not supported\n");
2037 hr = IPersistSerializedPropStorage_GetPropertyStorage(serialized,
NULL, &
result_size);
2040 hr = IPersistSerializedPropStorage_GetPropertyStorage(serialized, &
result,
NULL);
2044 ok(
hr ==
S_OK,
"GetPropertyStorage failed, hr=%lx\n",
hr);
2053 hr = IPersistSerializedPropStorage_SetPropertyStorage(serialized,
NULL, 4);
2056 hr = IPersistSerializedPropStorage_SetPropertyStorage(serialized,
NULL, 0);
2057 ok(
hr ==
S_OK,
"SetPropertyStorage failed, hr=%lx\n",
hr);
2060 ok(
hr ==
S_OK,
"GetCount failed, hr=%lx\n",
hr);
2063 IPropertyStore_Release(propstore);
2064 IPersistSerializedPropStorage_Release(serialized);
2079 ok(
hr ==
S_OK,
"PSCreateMemoryPropertyStore failed: 0x%08lx.\n",
hr);
2080 ok(propstore !=
NULL,
"got %p.\n", propstore);
2090 IPersistSerializedPropStorage_Release(serialized);
2094 ok(
hr ==
S_OK,
"PSCreateMemoryPropertyStore failed: 0x%08lx.\n",
hr);
2095 ok(propstorecache !=
NULL,
"got %p.\n", propstore);
2096 ok(propstorecache != (
IPropertyStoreCache *)propstore,
"pointer are equal: %p, %p.\n", propstorecache, propstore);
2101 ok(
hr ==
S_OK,
"PSCreateMemoryPropertyStore failed: 0x%08lx.\n",
hr);
2102 ok(propstore1 !=
NULL,
"got %p.\n", propstore);
2103 ok(propstore1 != propstore,
"pointer are equal: %p, %p.\n", propstore1, propstore);
2108 IPropertyStore_Release(propstore1);
2109 IPropertyStore_Release(propstore);
2110 IPropertyStoreCache_Release(propstorecache);
2117 PROPVARIANT propvar, ret_propvar;
2118 PROPERTYKEY propkey;
2122 ok(
hr ==
S_OK,
"PSCreateMemoryPropertyStore failed: 0x%08lx.\n",
hr);
2123 ok(propstore !=
NULL,
"got %p.\n", propstore);
2125 hr = IPropertyStore_GetCount(propstore, &
count);
2126 ok(
hr ==
S_OK,
"IPropertyStore_GetCount failed: 0x%08lx.\n",
hr);
2127 ok(!
count,
"got wrong property count: %ld, expected 0.\n",
count);
2129 PropVariantInit(&propvar);
2132 propkey.fmtid = DUMMY_GUID1;
2134 hr = IPropertyStore_SetValue(propstore, &propkey, &propvar);
2135 ok(
hr ==
S_OK,
"IPropertyStore_SetValue failed: 0x%08lx.\n",
hr);
2136 hr = IPropertyStore_Commit(propstore);
2137 ok(
hr ==
S_OK,
"IPropertyStore_Commit failed: 0x%08lx.\n",
hr);
2138 hr = IPropertyStore_GetCount(propstore, &
count);
2139 ok(
hr ==
S_OK,
"IPropertyStore_GetCount failed: 0x%08lx.\n",
hr);
2140 ok(
count == 1,
"got wrong property count: %ld, expected 1.\n",
count);
2141 PropVariantInit(&ret_propvar);
2142 ret_propvar.vt =
VT_I4;
2143 hr = IPropertyStore_GetValue(propstore, &propkey, &ret_propvar);
2144 ok(
hr ==
S_OK,
"IPropertyStore_GetValue failed: 0x%08lx.\n",
hr);
2145 ok(ret_propvar.vt ==
VT_I4,
"got wrong property type: %x.\n", ret_propvar.vt);
2146 ok(ret_propvar.lVal == 123,
"got wrong value: %ld, expected 123.\n", ret_propvar.lVal);
2150 PropVariantInit(&propvar);
2151 propkey.fmtid = DUMMY_GUID1;
2153 hr = IPropertyStore_SetValue(propstore, &propkey, &propvar);
2154 ok(
hr ==
S_OK,
"IPropertyStore_SetValue failed: 0x%08lx.\n",
hr);
2155 hr = IPropertyStore_Commit(propstore);
2156 ok(
hr ==
S_OK,
"IPropertyStore_Commit failed: 0x%08lx.\n",
hr);
2157 hr = IPropertyStore_GetCount(propstore, &
count);
2158 ok(
hr ==
S_OK,
"IPropertyStore_GetCount failed: 0x%08lx.\n",
hr);
2159 ok(
count == 1,
"got wrong property count: %ld, expected 1.\n",
count);
2160 PropVariantInit(&ret_propvar);
2161 hr = IPropertyStore_GetValue(propstore, &propkey, &ret_propvar);
2162 ok(
hr ==
S_OK,
"IPropertyStore_GetValue failed: 0x%08lx.\n",
hr);
2163 ok(ret_propvar.vt ==
VT_EMPTY,
"got wrong property type: %x.\n", ret_propvar.vt);
2164 ok(!ret_propvar.lVal,
"got wrong value: %ld, expected 0.\n", ret_propvar.lVal);
2168 IPropertyStore_Release(propstore);
2178 ok(
hr ==
S_OK,
"Failed to create property store, hr %#lx.\n",
hr);
2188 ok(
hr ==
S_OK,
"Failed to create wrapper, hr %#lx.\n",
hr);
2191 ok(unk != (
IUnknown *)propstore,
"Unexpected object returned.\n");
2192 IUnknown_Release(unk);
2196 ok(
hr ==
S_OK,
"Failed to create wrapper, hr %#lx.\n",
hr);
2197 ok(unk == (
IUnknown *)propstore,
"Unexpected object returned.\n");
2198 IUnknown_Release(unk);
2200 IPropertyStore_Release(propstore);
2239 static WCHAR default_value[] =
L"test";
2434 ok(!
buff[0],
"Unexpected buffer.\n");
2449 ok(!
buff[0],
"Unexpected buffer.\n");
2459#define check_VariantToPropVariant(var, propvar, type, member, value, format) do \
2461 V_VT(&(var)) = VT_##type; \
2462 V_##type(&(var)) = (value); \
2463 hr = VariantToPropVariant(&(var), &(propvar)); \
2464 ok_(__FILE__, __LINE__)(hr == S_OK, "VariantToPropVariant returned %#lx.\n", hr); \
2465 ok_(__FILE__, __LINE__)((propvar).vt == VT_##type, "Unexpected propvar.vt %d.\n", (propvar).vt); \
2466 ok_(__FILE__, __LINE__)((propvar).member == (value), \
2467 "Unexpected propvar."#member" "format".\n", (propvar).member); \
2470#define check_PropVariantToVariant(propvar, var, type, member, value, format) do \
2472 (propvar).vt = VT_##type; \
2473 (propvar).member = (value); \
2474 hr = PropVariantToVariant(&(propvar), &(var)); \
2475 ok_(__FILE__, __LINE__)(hr == S_OK, "PropVariantToVariant returned %#lx.\n", hr); \
2476 ok_(__FILE__, __LINE__)(V_VT(&(var)) == VT_##type, "Unexpected vt %d.\n", V_VT(&(var))); \
2477 ok_(__FILE__, __LINE__)(V_##type(&(var)) == (value), \
2478 "Unexpected V_"#type"(&var) "format".\n", (propvar).member); \
2483 PROPVARIANT propvar;
2488 PropVariantInit(&propvar);
2509 ok(
hr ==
S_OK,
"VariantToPropVariant returned %#lx.\n",
hr);
2510 ok(propvar.vt ==
VT_EMPTY,
"Unexpected propvar.vt %d.\n", propvar.vt);
2514 ok(
hr ==
S_OK,
"VariantToPropVariant returned %#lx.\n",
hr);
2515 ok(propvar.vt ==
VT_NULL,
"Unexpected propvar.vt %d.\n", propvar.vt);
2535 ok(
hr ==
S_OK,
"VariantToPropVariant returned %#lx.\n",
hr);
2536 ok(propvar.vt ==
VT_BSTR,
"Unexpected propvar.vt %d.\n", propvar.vt);
2537 ok(propvar.bstrVal !=
V_BSTR(&
var),
"Got same string pointer.\n");
2546 PROPVARIANT propvar;
2551 PropVariantInit(&propvar);
2558 propvar.vt = 0xdead;
2569 ok(
hr ==
S_OK,
"PropVariantToVariant returned %#lx.\n",
hr);
2574 ok(
hr ==
S_OK,
"PropVariantToVariant returned %#lx.\n",
hr);
2595 ok(
hr ==
S_OK,
"PropVariantToVariant returned %#lx.\n",
hr);
2597 ok(
V_BSTR(&
var) != propvar.bstrVal,
"Got same string pointer.\n");
2603 propvar.puuid = (
GUID *)&dummy_guid;
2606 ok(
hr == 39,
"PropVariantToVariant returned %#lx.\n",
hr);
2612 propvar.pszVal = (
char *)
topic;
2614 ok(
hr ==
S_OK,
"PropVariantToVariant returned %#lx.\n",
hr);
2622 ok(
hr ==
S_OK,
"PropVariantToVariant returned %#lx.\n",
hr);
#define CO_E_NOTINITIALIZED
PCWSTR const LCTYPE const int const result_size
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
static struct sockaddr_in sa
HRESULT InitVariantFromBuffer(const void *buffer, UINT cb, VARIANT *pv)
static const WCHAR empty[]
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
VOID WINAPI GetSystemTimeAsFileTime(OUT PFILETIME lpFileTime)
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
HRESULT WINAPI PropVariantClear(PROPVARIANT *pvar)
HRESULT WINAPI SafeArrayGetUBound(SAFEARRAY *psa, UINT nDim, LONG *plUbound)
HRESULT WINAPI SafeArrayAccessData(SAFEARRAY *psa, void **ppvData)
HRESULT WINAPI SafeArrayUnaccessData(SAFEARRAY *psa)
UINT WINAPI SafeArrayGetDim(SAFEARRAY *psa)
HRESULT WINAPI SafeArrayGetLBound(SAFEARRAY *psa, UINT nDim, LONG *plLbound)
SAFEARRAY *WINAPI SafeArrayCreate(VARTYPE vt, UINT cDims, SAFEARRAYBOUND *rgsabound)
HRESULT WINAPI PSCreatePropertyStoreFromObject(IUnknown *obj, DWORD access, REFIID riid, void **ret)
HRESULT WINAPI PropVariantToInt32(REFPROPVARIANT propvarIn, LONG *ret)
HRESULT WINAPI InitVariantFromGUIDAsString(REFGUID guid, VARIANT *pvar)
HRESULT WINAPI InitVariantFromFileTime(const FILETIME *ft, VARIANT *var)
PCWSTR WINAPI PropVariantToStringWithDefault(REFPROPVARIANT propvarIn, LPCWSTR pszDefault)
INT WINAPI PropVariantCompareEx(REFPROPVARIANT propvar1, REFPROPVARIANT propvar2, PROPVAR_COMPARE_UNIT unit, PROPVAR_COMPARE_FLAGS flags)
ULONG WINAPI PropVariantToUInt32WithDefault(REFPROPVARIANT propvarIn, ULONG ulDefault)
HRESULT WINAPI VariantToGUID(const VARIANT *pvar, GUID *guid)
HRESULT WINAPI PropVariantToBuffer(REFPROPVARIANT propvarIn, void *ret, UINT cb)
HRESULT WINAPI PropVariantToUInt16(REFPROPVARIANT propvarIn, USHORT *ret)
HRESULT WINAPI InitPropVariantFromCLSID(REFCLSID clsid, PROPVARIANT *ppropvar)
HRESULT WINAPI VariantToString(REFVARIANT var, PWSTR ret, UINT cch)
HRESULT WINAPI PropVariantToStringAlloc(REFPROPVARIANT propvarIn, WCHAR **ret)
HRESULT WINAPI PropVariantChangeType(PROPVARIANT *ppropvarDest, REFPROPVARIANT propvarSrc, PROPVAR_CHANGE_FLAGS flags, VARTYPE vt)
HRESULT WINAPI InitPropVariantFromBuffer(const VOID *pv, UINT cb, PROPVARIANT *ppropvar)
HRESULT WINAPI InitPropVariantFromStringVector(PCWSTR *strs, ULONG count, PROPVARIANT *ppropvar)
HRESULT WINAPI PropVariantToBoolean(REFPROPVARIANT propvarIn, BOOL *ret)
HRESULT WINAPI PropVariantToBSTR(REFPROPVARIANT propvar, BSTR *bstr)
PCWSTR WINAPI VariantToStringWithDefault(const VARIANT *pvar, const WCHAR *default_value)
HRESULT WINAPI PropVariantToInt64(REFPROPVARIANT propvarIn, LONGLONG *ret)
HRESULT WINAPI PropVariantToDouble(REFPROPVARIANT propvarIn, double *ret)
HRESULT WINAPI PropVariantToString(REFPROPVARIANT propvarIn, PWSTR ret, UINT cch)
HRESULT WINAPI PropVariantToUInt64(REFPROPVARIANT propvarIn, ULONGLONG *ret)
HRESULT WINAPI PropVariantToUInt32(REFPROPVARIANT propvarIn, ULONG *ret)
HRESULT WINAPI PropVariantToGUID(const PROPVARIANT *ppropvar, GUID *guid)
HRESULT WINAPI VariantToPropVariant(const VARIANT *var, PROPVARIANT *propvar)
HRESULT WINAPI PropVariantToInt16(REFPROPVARIANT propvarIn, SHORT *ret)
HRESULT WINAPI InitPropVariantFromGUIDAsString(REFGUID guid, PROPVARIANT *ppropvar)
HRESULT WINAPI PropVariantToVariant(const PROPVARIANT *propvar, VARIANT *var)
static const WCHAR stringW[]
static unsigned char buff[32768]
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLboolean GLboolean GLboolean b
GLuint GLsizei GLsizei * length
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
VOID WINAPI CoTaskMemFree(LPVOID ptr)
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define memcpy(s1, s2, n)
static DWORD DWORD void LPSTR DWORD cch
#define expect_guid(expected, guid)
static PROTOCOLDATA * pdata
BSTR WINAPI SysAllocString(LPCOLESTR str)
UINT WINAPI SysStringLen(BSTR str)
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
#define check_VariantToPropVariant(var, propvar, type, member, value, format)
static void test_VariantToString(void)
static void test_InitPropVariantFromStringVector(void)
static void test_PSRefreshPropertySchema(void)
static void test_inmemorystore(void)
static void test_PropVariantToBuffer(void)
#define check_PropVariantToBSTR(type, member, value, expect_str)
static void test_PSCreatePropertyStoreFromObject(void)
static void test_propertystore(void)
static const WCHAR topicW[]
static void test_InitVariantFromFileTime(void)
static void test_PropVariantToStringWithDefault(void)
static void _expect_ref(IUnknown *obj, ULONG ref, int line)
static void test_intconversions(void)
static void test_InitPropVariantFromCLSID(void)
static void test_InitPropVariantFromGUIDAsString(void)
static void test_PSPropertyKeyFromString(void)
static const WCHAR dummy_guid_str[]
static void test_PropVariantToBSTR(void)
static void test_VariantToPropVariant(void)
#define check_PropVariantToVariant(propvar, var, type, member, value, format)
static void test_PropVariantToVariant(void)
static void test_PropVariantToBoolean(void)
static const WCHAR emptyW[]
static void test_PropVariantToString(void)
#define EXPECT_REF(obj, ref)
static void test_PropVariantCompareEx(void)
static void test_VariantToStringWithDefault(void)
static void test_InitPropVariantFromBuffer(void)
static void test_PropVariantChangeType_LPWSTR(void)
static void test_persistserialized(void)
static void test_PSStringFromPropertyKey(void)
static void test_PropVariantToGUID(void)
static const char topic[]
static void test_PropVariantToStringAlloc(void)
static void test_PropVariantToDouble(void)
static void test_PSCreateMemoryPropertyStore(void)
struct tagSERIALIZEDROPSTORAGE SERIALIZEDPROPSTORAGE
PROPERTYKEY * REFPROPERTYKEY
HRESULT WINAPI PSPropertyKeyFromString(LPCWSTR pszString, PROPERTYKEY *pkey)
static IPropertySystem propsys
HRESULT WINAPI PSCreateMemoryPropertyStore(REFIID riid, void **ppv)
HRESULT WINAPI PSStringFromPropertyKey(REFPROPERTYKEY pkey, LPWSTR psz, UINT cch)
HRESULT WINAPI PSRefreshPropertySchema(void)
@ PVCF_TREATEMPTYASGREATERTHAN
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
#define IsEqualGUID(rguid1, rguid2)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
static __inline const char * wine_dbgstr_guid(const GUID *id)
#define R4(v, w, x, y, z, i)
#define STRSAFE_E_INSUFFICIENT_BUFFER
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
void WINAPI VariantInit(VARIANTARG *pVarg)
INT WINAPI SystemTimeToVariantTime(LPSYSTEMTIME lpSt, double *pDateOut)
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
#define DISP_E_PARAMNOTFOUND
#define TYPE_E_ELEMENTNOTFOUND
#define E_NOT_SUFFICIENT_BUFFER
#define DISP_E_BADVARTYPE
#define TYPE_E_TYPEMISMATCH
#define HRESULT_FROM_WIN32(x)
#define ERROR_ARITHMETIC_OVERFLOW
#define DISP_E_TYPEMISMATCH