27#define NONAMELESSUNION
38DEFINE_GUID(
GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
39DEFINE_GUID(dummy_guid, 0xdeadbeef, 0xdead, 0xbeef, 0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0xba, 0xbe);
40DEFINE_GUID(
expect_guid, 0x12345678, 0x1234, 0x1234, 0x12, 0x34, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12);
42#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]}}
44static const char topic[] =
"wine topic";
45static const WCHAR topicW[] = {
'w',
'i',
'n',
'e',
' ',
't',
'o',
'p',
'i',
'c',0};
57 static const WCHAR fillerW[] = {
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
58 'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
59 'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X'};
60 static const WCHAR zero_fillerW[] = {
'\0',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
61 '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'};
63 static const WCHAR zero_truncatedW[] = {
'\0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
64 '0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
65 '0',
'0',
'0',
'}',
' ',
'\0',
'9',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X'};
66 static const WCHAR zero_truncated2W[] = {
'\0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
67 '0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
68 '0',
'0',
'0',
'}',
' ',
'\0',
'9',
'2',
'7',
'6',
'9',
'4',
'9',
'2',
'X',
'X'};
69 static const WCHAR zero_truncated3W[] = {
'\0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
70 '0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
71 '0',
'0',
'0',
'}',
' ',
'\0',
'9',
'2',
'7',
'6',
'9',
'4',
'9',
'2',
'4',
'X'};
72 static const WCHAR zero_truncated4W[] = {
'\0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
73 '0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
74 '0',
'0',
'0',
'}',
' ',
'\0',
'7',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X'};
75 static const WCHAR truncatedW[] = {
'{',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
76 '0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
77 '0',
'}',
' ',
'\0',
'9',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X'};
78 static const WCHAR truncated2W[] = {
'{',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
79 '0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
80 '0',
'}',
' ',
'\0',
'9',
'2',
'7',
'6',
'9',
'4',
'9',
'2',
'X',
'X'};
81 static const WCHAR truncated3W[] = {
'{',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
82 '0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
83 '0',
'}',
' ',
'\0',
'9',
'2',
'7',
'6',
'9',
'4',
'9',
'2',
'4',
'X'};
84 static const WCHAR truncated4W[] = {
'{',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
85 '0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
86 '0',
'}',
' ',
'\0',
'7',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X'};
87 static const WCHAR expectedW[] = {
'{',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
88 '0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
89 '0',
'}',
' ',
'4',
'2',
'9',
'4',
'9',
'6',
'7',
'2',
'9',
'5',0};
90 static const WCHAR expected2W[] = {
'{',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
91 '0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
92 '0',
'}',
' ',
'1',
'3',
'5',
'7',
'9',
'\0',
'X',
'X',
'X',
'X',
'X'};
93 static const WCHAR expected3W[] = {
'{',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
94 '0',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
95 '0',
'}',
' ',
'0',
'\0',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X'};
108 const WCHAR *buf_expect;
126 {&prop,
out, PKEYSTR_MAX,
S_OK, expectedW},
128 {&prop2,
out, GUIDSTRING_MAX + 6,
S_OK, expected2W},
129 {&prop2,
out, PKEYSTR_MAX,
S_OK, expected2W},
131 {&prop3,
out, GUIDSTRING_MAX + 2,
S_OK, expected3W},
132 {&prop3,
out, PKEYSTR_MAX,
S_OK, expected3W},
139 if (testcases[
i].psz)
140 memcpy(testcases[
i].psz, fillerW, PKEYSTR_MAX *
sizeof(
WCHAR));
145 ok(
ret == testcases[
i].hr_expect ||
146 broken(testcases[
i].hr_broken &&
ret == testcases[
i].hr2),
147 "[%d] Expected PSStringFromPropertyKey to return 0x%08x, got 0x%08x\n",
148 i, testcases[
i].hr_expect,
ret);
150 if (testcases[
i].psz)
151 ok(!
memcmp(testcases[
i].psz, testcases[
i].buf_expect, PKEYSTR_MAX *
sizeof(
WCHAR)) ||
152 broken(testcases[
i].buf_broken &&
153 !
memcmp(testcases[
i].psz, testcases[
i].buf2, PKEYSTR_MAX *
sizeof(
WCHAR))),
154 "[%d] Unexpected output contents\n",
i);
160 static const WCHAR fmtid_clsidW[] = {
'S',
't',
'd',
'F',
'o',
'n',
't',
' ',
'1',0};
161 static const WCHAR fmtid_truncatedW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
162 '1',
'2',
'3',
'4',
'-',0};
163 static const WCHAR fmtid_nobracketsW[] = {
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
164 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
165 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',0};
166 static const WCHAR fmtid_badbracketW[] = {
'X',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
167 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
168 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
169 static const WCHAR fmtid_badcharW[] = {
'{',
'X',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
170 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
171 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
172 static const WCHAR fmtid_badchar2W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'X',
'-',
'1',
'2',
'3',
'4',
'-',
173 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
174 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
175 static const WCHAR fmtid_baddashW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'X',
'1',
'2',
'3',
'4',
'-',
176 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
177 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
178 static const WCHAR fmtid_badchar3W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'X',
'2',
'3',
'4',
'-',
179 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
180 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
181 static const WCHAR fmtid_badchar4W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'X',
'-',
182 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
183 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
184 static const WCHAR fmtid_baddash2W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'X',
185 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
186 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
187 static const WCHAR fmtid_badchar5W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
188 'X',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
189 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
190 static const WCHAR fmtid_badchar6W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
191 '1',
'2',
'3',
'X',
'-',
'1',
'2',
'3',
'4',
'-',
192 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
193 static const WCHAR fmtid_baddash3W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
194 '1',
'2',
'3',
'4',
'X',
'1',
'2',
'3',
'4',
'-',
195 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
196 static const WCHAR fmtid_badchar7W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
197 '1',
'2',
'3',
'4',
'-',
'X',
'2',
'3',
'4',
'-',
198 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
199 static const WCHAR fmtid_badchar8W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
200 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'X',
'-',
201 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
202 static const WCHAR fmtid_baddash4W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
203 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'X',
204 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
205 static const WCHAR fmtid_badchar9W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
206 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
207 'X',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
208 static const WCHAR fmtid_badchar9_adjW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
209 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
210 '1',
'X',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
211 static const WCHAR fmtid_badchar10W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
212 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
213 '1',
'2',
'X',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
214 static const WCHAR fmtid_badchar11W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
215 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
216 '1',
'2',
'3',
'4',
'X',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
217 static const WCHAR fmtid_badchar12W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
218 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
219 '1',
'2',
'3',
'4',
'5',
'6',
'X',
'8',
'9',
'0',
'1',
'2',
'}',0};
220 static const WCHAR fmtid_badchar13W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
221 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
222 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'X',
'0',
'1',
'2',
'}',0};
223 static const WCHAR fmtid_badchar14W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
224 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
225 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'X',
'2',
'}',0};
226 static const WCHAR fmtid_badbracket2W[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
227 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
228 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'X',0};
229 static const WCHAR fmtid_spaceW[] = {
' ',
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
230 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
231 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
232 static const WCHAR fmtid_spaceendW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
233 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
234 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',0};
235 static const WCHAR fmtid_spacesendW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
236 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
237 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
' ',
' ',0};
238 static const WCHAR fmtid_nopidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
239 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
240 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',0};
241 static const WCHAR fmtid_badpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
242 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
243 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'D',
'E',
'A',
'D',0};
244 static const WCHAR fmtid_adjpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
245 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
246 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
'1',
'3',
'5',
'7',
'9',0};
247 static const WCHAR fmtid_spacespidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
248 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
249 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
' ',
' ',
'1',
'3',
'5',
'7',
'9',0};
250 static const WCHAR fmtid_negpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
251 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
252 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'-',
'1',
'3',
'5',
'7',
'9',0};
253 static const WCHAR fmtid_negnegpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
254 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
255 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'-',
'-',
'1',
'3',
'5',
'7',
'9',0};
256 static const WCHAR fmtid_negnegnegpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
257 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
258 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'-',
'-',
'-',
'1',
'3',
'5',
'7',
'9',0};
259 static const WCHAR fmtid_negspacepidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
260 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
261 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'-',
' ',
'1',
'3',
'5',
'7',
'9',0};
262 static const WCHAR fmtid_negspacenegpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
263 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
264 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'-',
' ',
'-',
'1',
'3',
'5',
'7',
'9',0};
265 static const WCHAR fmtid_negspacespidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
266 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
267 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'-',
' ',
'-',
' ',
'-',
'1',
'3',
'5',
'7',
'9',0};
268 static const WCHAR fmtid_pospidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
269 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
270 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'+',
'1',
'3',
'5',
'7',
'9',0};
271 static const WCHAR fmtid_posnegpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
272 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
273 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'+',
'-',
'+',
'-',
'1',
'3',
'5',
'7',
'9',0};
274 static const WCHAR fmtid_symbolpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
275 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
276 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'+',
'/',
'$',
'-',
'1',
'3',
'5',
'7',
'9',0};
277 static const WCHAR fmtid_letterpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
278 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
279 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'A',
'B',
'C',
'D',
'1',
'3',
'5',
'7',
'9',0};
280 static const WCHAR fmtid_spacepadpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
281 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
282 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'1',
'3',
'5',
'7',
'9',
' ',
' ',
' ',0};
283 static const WCHAR fmtid_spacemixpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
284 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
285 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'1',
' ',
'3',
' ',
'5',
'7',
'9',
' ',
' ',
' ',0};
286 static const WCHAR fmtid_tabpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
287 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
288 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
'\t',
'1',
'3',
'5',
'7',
'9',0};
289 static const WCHAR fmtid_hexpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
290 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
291 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'0',
'x',
'D',
'E',
'A',
'D',0};
292 static const WCHAR fmtid_mixedpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
293 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
294 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'A',
'9',
'B',
'5',
'C',
'3',
'D',
'1',0};
295 static const WCHAR fmtid_overflowpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
296 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
297 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',0};
298 static const WCHAR fmtid_commapidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
299 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
300 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
',',
'1',
'3',
'5',
'7',
'9',0};
301 static const WCHAR fmtid_commaspidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
302 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
303 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
',',
',',
',',
'1',
'3',
'5',
'7',
'9',0};
304 static const WCHAR fmtid_commaspacepidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
305 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
306 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
',',
' ',
'1',
'3',
'5',
'7',
'9',0};
307 static const WCHAR fmtid_spacecommapidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
308 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
309 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
',',
'1',
'3',
'5',
'7',
'9',0};
310 static const WCHAR fmtid_spccommaspcpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
311 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
312 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
',',
' ',
'1',
'3',
'5',
'7',
'9',0};
313 static const WCHAR fmtid_spacescommaspidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
314 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
315 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
',',
' ',
',',
'1',
'3',
'5',
'7',
'9',0};
316 static const WCHAR fmtid_commanegpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
317 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
318 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
',',
'-',
'1',
'3',
'5',
'7',
'9',0};
319 static const WCHAR fmtid_spccommanegpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
320 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
321 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
',',
'-',
'1',
'3',
'5',
'7',
'9',0};
322 static const WCHAR fmtid_commaspcnegpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
323 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
324 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
',',
' ',
'-',
'1',
'3',
'5',
'7',
'9',0};
325 static const WCHAR fmtid_spccommaspcnegpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
326 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
327 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
',',
' ',
'-',
'1',
'3',
'5',
'7',
'9',0};
328 static const WCHAR fmtid_commanegspcpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
329 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
330 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
',',
'-',
' ',
'1',
'3',
'5',
'7',
'9',0};
331 static const WCHAR fmtid_negcommapidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
332 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
333 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
'-',
',',
'1',
'3',
'5',
'7',
'9',0};
334 static const WCHAR fmtid_normalpidW[] = {
'{',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'-',
'1',
'2',
'3',
'4',
'-',
335 '1',
'2',
'3',
'4',
'-',
'1',
'2',
'3',
'4',
'-',
336 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'}',
' ',
'1',
'3',
'5',
'7',
'9',0};
337 PROPERTYKEY out_init = {
GUID_MEMBERS(dummy_guid), 0xdeadbeef};
346 PROPERTYKEY pkey_expect;
354 {fmtid_truncatedW, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0,0,0,0,0,0,0,0}}, 0}},
359 {fmtid_baddashW, &
out,
E_INVALIDARG, { {0x12345678,0,0,{0,0,0,0,0,0,0,0}}, 0}},
360 {fmtid_badchar3W, &
out,
E_INVALIDARG, { {0x12345678,0,0,{0,0,0,0,0,0,0,0}}, 0}},
361 {fmtid_badchar4W, &
out,
E_INVALIDARG, { {0x12345678,0,0,{0,0,0,0,0,0,0,0}}, 0}},
362 {fmtid_baddash2W, &
out,
E_INVALIDARG, { {0x12345678,0,0,{0,0,0,0,0,0,0,0}}, 0}},
363 {fmtid_badchar5W, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0,{0,0,0,0,0,0,0,0}}, 0}},
364 {fmtid_badchar6W, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0,{0,0,0,0,0,0,0,0}}, 0}},
365 {fmtid_baddash3W, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0,{0,0,0,0,0,0,0,0}}, 0}},
366 {fmtid_badchar7W, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0,0,0,0,0,0,0,0}}, 0}},
367 {fmtid_badchar8W, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0,0,0,0,0,0,0}}, 0}},
368 {fmtid_baddash4W, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0,0,0,0,0,0,0}}, 0}},
369 {fmtid_badchar9W, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0,0,0,0,0,0}}, 0}},
370 {fmtid_badchar9_adjW, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0,0,0,0,0,0}}, 0}},
371 {fmtid_badchar10W, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0x12,0,0,0,0,0}}, 0}},
372 {fmtid_badchar11W, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0x12,0x34,0,0,0,0}}, 0}},
373 {fmtid_badchar12W, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0x12,0x34,0x56,0,0,0}}, 0}},
374 {fmtid_badchar13W, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0x12,0x34,0x56,0x78,0,0}}, 0}},
375 {fmtid_badchar14W, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0x12,0x34,0x56,0x78,0x90,0}}, 0}},
376 {fmtid_badbracket2W, &
out,
E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0x12,0x34,0x56,0x78,0x90,0x00}}, 0 }},
419 if (testcases[
i].pkey)
420 *testcases[
i].pkey = out_init;
423 ok(
ret == testcases[
i].hr_expect,
424 "[%d] Expected PSPropertyKeyFromString to return 0x%08x, got 0x%08x\n",
425 i, testcases[
i].hr_expect,
ret);
427 if (testcases[
i].pkey)
429 ok(
IsEqualGUID(&testcases[
i].pkey->fmtid, &testcases[
i].pkey_expect.fmtid),
430 "[%d] Expected GUID %s, got %s\n",
432 ok(testcases[
i].pkey->pid == testcases[
i].pkey_expect.pid,
433 "[%d] Expected property ID %u, got %u\n",
434 i, testcases[
i].pkey_expect.pid, testcases[
i].pkey->pid);
446 "Expected PSRefreshPropertySchema to return CO_E_NOTINITIALIZED, got 0x%08x\n",
ret);
452 "Expected PSRefreshPropertySchema to return S_OK, got 0x%08x\n",
ret);
468 {&
IID_NULL,
"{00000000-0000-0000-0000-000000000000}" },
469 {&dummy_guid,
"{DEADBEEF-DEAD-BEEF-DEAD-BEEFCAFEBABE}" },
485 memset(&propvar, 0,
sizeof(PROPVARIANT));
487 ok(
hres ==
S_OK,
"%d) InitPropVariantFromGUIDAsString returned %x\n",
i,
hres);
488 ok(propvar.vt ==
VT_LPWSTR,
"%d) propvar.vt = %d\n",
i, propvar.vt);
489 ok(!
strcmp_wa(propvar.u.pwszVal, testcases[
i].str),
"%d) propvar.u.pwszVal = %s\n",
495 ok(
hres ==
S_OK,
"%d) InitVariantFromGUIDAsString returned %x\n",
i,
hres);
507 static const char data_in[] =
"test";
515 ok(
hres ==
S_OK,
"InitPropVariantFromBuffer returned %x\n",
hres);
517 ok(propvar.u.caub.cElems == 0,
"cElems = %d\n", propvar.u.caub.cElems == 0);
521 ok(
hres ==
S_OK,
"InitPropVariantFromBuffer returned %x\n",
hres);
523 ok(propvar.u.caub.cElems == 4,
"cElems = %d\n", propvar.u.caub.cElems == 0);
524 ok(!
memcmp(propvar.u.caub.pElems, data_in, 4),
"Data inside array is incorrect\n");
531 ok(
size == 1,
"SafeArrayGetDim returned %d\n",
size);
544 ok(
size == 1,
"SafeArrayGetDim returned %d\n",
size);
553 ok(!
memcmp(data_in, data_out, 4),
"Data inside safe array is incorrect\n");
567 ok(
hres ==
S_OK,
"InitPropVariantFromGUIDAsString failed %x\n",
hres);
575 ok(
hres ==
S_OK,
"InitPropVariantFromGUIDAsString failed %x\n",
hres);
581 ok(propvar.vt ==
VT_LPWSTR,
"incorrect PROPVARIANT type: %d\n", propvar.vt);
582 propvar.u.pwszVal[1] =
'd';
583 propvar.u.pwszVal[2] =
'E';
584 propvar.u.pwszVal[3] =
'a';
589 propvar.u.pwszVal[1] =
'z';
596 ok(
hres ==
S_OK,
"InitVariantFromGUIDAsString failed %x\n",
hres);
604 ok(
hres ==
S_OK,
"InitVariantFromGUIDAsString failed %x\n",
hres);
662 PROPVARIANT
empty,
null, emptyarray, i2_0, i2_2, i4_large, i4_largeneg, i4_2, str_2, str_02, str_b;
663 PROPVARIANT clsid_null,
clsid, clsid2, r4_0, r4_2, r8_0, r8_2;
665 static const WCHAR str_2W[] = {
'2', 0};
666 static const WCHAR str_02W[] = {
'0',
'2', 0};
667 static const WCHAR str_bW[] = {
'b', 0};
670 PropVariantInit(&
empty);
671 PropVariantInit(&
null);
672 PropVariantInit(&emptyarray);
673 PropVariantInit(&i2_0);
674 PropVariantInit(&i2_2);
675 PropVariantInit(&i4_large);
676 PropVariantInit(&i4_largeneg);
677 PropVariantInit(&i4_2);
678 PropVariantInit(&str_2);
679 PropVariantInit(&str_b);
684 emptyarray.u.parray = &emptysafearray;
685 emptysafearray.
cDims = 1;
686 emptysafearray.
fFeatures = FADF_FIXEDSIZE;
688 emptysafearray.
cLocks = 0;
697 i4_large.u.lVal = 65536;
698 i4_largeneg.vt =
VT_I4;
699 i4_largeneg.u.lVal = -65536;
709 clsid_null.u.puuid =
NULL;
715 r4_0.u.fltVal = 0.0f;
717 r4_2.u.fltVal = 2.0f;
859 ok (
FAILED(
hr),
"PropVariantClear fails on invalid vt.\n");
865 propvar.u.hVal.QuadPart = (
ULONGLONG)1 << 63;
887 propvar.u.uhVal.QuadPart = 5;
899 ok(lval == 5,
"got wrong value %d\n", lval);
903 ok(ulval == 5,
"got wrong value %d\n", ulval);
907 ok(sval == 5,
"got wrong value %d\n", sval);
911 ok(usval == 5,
"got wrong value %d\n", usval);
914 propvar.u.hVal.QuadPart = -5;
925 ok(lval == -5,
"got wrong value %d\n", lval);
932 ok(sval == -5,
"got wrong value %d\n", sval);
968 static WCHAR str_0[] = {
'0',0};
969 static WCHAR str_1[] = {
'1',0};
970 static WCHAR str_7[] = {
'7',0};
971 static WCHAR str_n7[] = {
'-',
'7',0};
972 static WCHAR str_true[] = {
't',
'r',
'u',
'e',0};
973 static WCHAR str_true2[] = {
'#',
'T',
'R',
'U',
'E',
'#',0};
974 static WCHAR str_true_case[] = {
't',
'R',
'U',
'e',0};
975 static WCHAR str_false[] = {
'f',
'a',
'l',
's',
'e',0};
976 static WCHAR str_false2[] = {
'#',
'F',
'A',
'L',
'S',
'E',
'#',0};
977 static WCHAR str_true_space[] = {
't',
'r',
'u',
'e',
' ',0};
978 static WCHAR str_yes[] = {
'y',
'e',
's',0};
985 propvar.u.boolVal = VARIANT_FALSE;
992 propvar.u.boolVal = 1;
999 propvar.u.boolVal = VARIANT_TRUE;
1007 propvar.u.boolVal = VARIANT_TRUE;
1029 propvar.u.lVal = 67;
1036 propvar.u.lVal = -67;
1044 propvar.u.pwszVal = str_0;
1051 propvar.u.pwszVal = str_1;
1058 propvar.u.pwszVal = str_7;
1065 propvar.u.pwszVal = str_n7;
1072 propvar.u.pwszVal = str_true;
1079 propvar.u.pwszVal = str_true_case;
1086 propvar.u.pwszVal = str_true2;
1093 propvar.u.pwszVal = str_false;
1100 propvar.u.pwszVal = str_false2;
1107 propvar.u.pwszVal = str_true_space;
1114 propvar.u.pwszVal = str_yes;
1121 propvar.u.pwszVal =
NULL;
1129 propvar.u.pszVal = (
char *)
"#TruE#";
1136 propvar.u.pszVal = (
char *)
"#TRUE#";
1143 propvar.u.pszVal = (
char *)
"tRUe";
1150 propvar.u.pszVal = (
char *)
"#FALSE#";
1157 propvar.u.pszVal = (
char *)
"fALSe";
1164 propvar.u.pszVal = (
char *)
"1";
1171 propvar.u.pszVal = (
char *)
"-1";
1179 PROPVARIANT propvar;
1180 static WCHAR default_value[] = {
't',
'e',
's',
't', 0};
1181 static WCHAR wstr_test2[] = {
't',
'e',
's',
't',
'2', 0};
1182 static WCHAR wstr_empty[] = {0};
1183 static WCHAR wstr_space[] = {
' ', 0};
1184 static CHAR str_test2[] =
"test2";
1185 static CHAR str_empty[] =
"";
1186 static CHAR str_space[] =
" ";
1198 propvar.u.boolVal = VARIANT_TRUE;
1203 propvar.u.lVal = 15;
1210 propvar.u.pwszVal =
NULL;
1215 propvar.u.pwszVal = wstr_empty;
1220 propvar.u.pwszVal = wstr_space;
1225 propvar.u.pwszVal = wstr_test2;
1232 propvar.u.pszVal =
NULL;
1237 propvar.u.pszVal = str_empty;
1242 propvar.u.pszVal = str_space;
1247 propvar.u.pszVal = str_test2;
1254 propvar.u.bstrVal =
NULL;
1282 PropVariantInit(&
dest);
1315 PROPVARIANT propvar;
1319 memset(&propvar, 0,
sizeof(propvar));
1321 propvar.u.lVal = 15;
1326 ok(propvar.vt ==
VT_CLSID,
"Unexpected type %d.\n", propvar.vt);
1333 PROPVARIANT propvar;
1337 PropVariantInit(&propvar);
1339 propvar.u.dblVal = 15.0;
1341 ok(
hr ==
S_OK,
"PropVariantToDouble failed: 0x%08x.\n",
hr);
1346 propvar.u.lVal = 123;
1348 ok(
hr ==
S_OK,
"PropVariantToDouble failed: 0x%08x.\n",
hr);
1353 propvar.u.lVal = -256;
1355 ok(
hr ==
S_OK,
"PropVariantToDouble failed: 0x%08x.\n",
hr);
1360 propvar.u.lVal = 65536;
1362 ok(
hr ==
S_OK,
"PropVariantToDouble failed: 0x%08x.\n",
hr);
1363 ok(
value == 65536.0,
"Unexpected value: %f.\n",
value);
1367 propvar.u.lVal = -321;
1369 ok(
hr ==
S_OK,
"PropVariantToDouble failed: 0x%08x.\n",
hr);
1370 ok(
value == 4294966975.0,
"Unexpected value: %f.\n",
value);
1374 propvar.u.ulVal = 6;
1376 ok(
hr ==
S_OK,
"PropVariantToDouble failed: 0x%08x.\n",
hr);
1381 propvar.u.uhVal.QuadPart = 8;
1383 ok(
hr ==
S_OK,
"PropVariantToDouble failed: 0x%08x.\n",
hr);
1389 PROPVARIANT propvar;
1390 static CHAR string[] =
"Wine";
1392 WCHAR bufferW[256] = {0};
1395 PropVariantInit(&propvar);
1401 ok(!bufferW[0],
"got wrong string: \"%s\".\n",
wine_dbgstr_w(bufferW));
1402 memset(bufferW, 0,
sizeof(bufferW));
1405 PropVariantInit(&propvar);
1410 ok(
hr ==
S_OK,
"PropVariantToString failed: 0x%08x.\n",
hr);
1411 ok(!bufferW[0],
"got wrong string: \"%s\".\n",
wine_dbgstr_w(bufferW));
1412 memset(bufferW, 0,
sizeof(bufferW));
1415 PropVariantInit(&propvar);
1420 ok(
hr ==
S_OK,
"PropVariantToString failed: 0x%08x.\n",
hr);
1421 ok(!bufferW[0],
"got wrong string: \"%s\".\n",
wine_dbgstr_w(bufferW));
1422 memset(bufferW, 0,
sizeof(bufferW));
1425 PropVariantInit(&propvar);
1427 U(propvar).lVal = 22;
1431 memset(bufferW, 0,
sizeof(bufferW));
1434 PropVariantInit(&propvar);
1438 ok(
hr ==
S_OK,
"PropVariantToString failed: 0x%08x.\n",
hr);
1440 memset(bufferW, 0,
sizeof(bufferW));
1442 PropVariantInit(&propvar);
1446 ok(
hr ==
S_OK,
"PropVariantToString failed: 0x%08x.\n",
hr);
1448 memset(bufferW, 0,
sizeof(bufferW));
1450 PropVariantInit(&propvar);
1456 memset(bufferW, 0,
sizeof(bufferW));
1458 PropVariantInit(&propvar);
1464 memset(bufferW, 0,
sizeof(bufferW));
1466 PropVariantInit(&propvar);
1470 ok(
hr ==
S_OK,
"PropVariantToString failed: 0x%08x.\n",
hr);
1472 memset(bufferW, 0,
sizeof(bufferW));
1478 PROPVARIANT propvar;
1481 INT8 data_int8[] = {1,2,3,4,5,6,7,8,9,10};
1488 ok(
hr ==
S_OK,
"InitPropVariantFromBuffer failed 0x%08x.\n",
hr);
1490 ok(
hr ==
S_OK,
"PropVariantToBuffer failed: 0x%08x.\n",
hr);
1494 ok(
hr ==
S_OK,
"InitPropVariantFromBuffer failed 0x%08x.\n",
hr);
1496 ok(
hr ==
S_OK,
"PropVariantToBuffer failed: 0x%08x.\n",
hr);
1502 ok(
hr ==
S_OK,
"InitPropVariantFromBuffer failed 0x%08x.\n",
hr);
1505 ok(
hr ==
E_FAIL,
"PropVariantToBuffer returned: 0x%08x.\n",
hr);
1506 ok(
buffer[0] == 99,
"got wrong buffer.\n");
1511 ok(
hr ==
S_OK,
"InitPropVariantFromBuffer failed 0x%08x.\n",
hr);
1513 ok(
hr ==
S_OK,
"PropVariantToBuffer failed: 0x%08x.\n",
hr);
1518 PropVariantInit(&propvar);
1524 ok(
sa !=
NULL,
"SafeArrayCreate failed.\n");
1526 ok(
hr ==
S_OK,
"SafeArrayAccessData failed: 0x%08x.\n",
hr);
1529 ok(
hr ==
S_OK,
"SafeArrayUnaccessData failed: 0x%08x.\n",
hr);
1530 U(propvar).parray =
sa;
1534 ok(
buffer[0] == 99,
"got wrong buffer.\n");
1538 PropVariantInit(&propvar);
1544 ok(
sa !=
NULL,
"SafeArrayCreate failed.\n");
1546 ok(
hr ==
S_OK,
"SafeArrayAccessData failed: 0x%08x.\n",
hr);
1549 ok(
hr ==
S_OK,
"SafeArrayUnaccessData failed: 0x%08x.\n",
hr);
1550 U(propvar).parray =
sa;
1557 PropVariantInit(&propvar);
1560 U(propvar).caub.cElems =
sizeof(data_int8);
1561 memcpy(
U(propvar).caub.pElems, data_int8,
sizeof(data_int8));
1566 PropVariantInit(&propvar);
1572 ok(
sa !=
NULL,
"SafeArrayCreate failed.\n");
1574 ok(
hr ==
S_OK,
"SafeArrayAccessData failed: 0x%08x.\n",
hr);
1577 ok(
hr ==
S_OK,
"SafeArrayUnaccessData failed: 0x%08x.\n",
hr);
1578 U(propvar).parray =
sa;
#define CO_E_NOTINITIALIZED
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
static struct sockaddr_in sa
static const WCHAR empty[]
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
#define WideCharToMultiByte
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
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 PropVariantToInt32(REFPROPVARIANT propvarIn, LONG *ret)
HRESULT WINAPI InitVariantFromGUIDAsString(REFGUID guid, VARIANT *pvar)
PCWSTR WINAPI PropVariantToStringWithDefault(REFPROPVARIANT propvarIn, LPCWSTR pszDefault)
INT WINAPI PropVariantCompareEx(REFPROPVARIANT propvar1, REFPROPVARIANT propvar2, PROPVAR_COMPARE_UNIT unit, PROPVAR_COMPARE_FLAGS flags)
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 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 PropVariantToBoolean(REFPROPVARIANT propvarIn, BOOL *ret)
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 PropVariantToInt16(REFPROPVARIANT propvarIn, SHORT *ret)
HRESULT WINAPI InitVariantFromBuffer(const VOID *pv, UINT cb, VARIANT *pvar)
HRESULT WINAPI InitPropVariantFromGUIDAsString(REFGUID guid, PROPVARIANT *ppropvar)
static const WCHAR stringW[]
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLuint GLenum GLsizei const GLchar * buf
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)
#define memcpy(s1, s2, n)
static DWORD DWORD void LPSTR DWORD cch
static const char * strw(LPCWSTR x)
#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)
static void test_PSRefreshPropertySchema(void)
static void test_PropVariantToBuffer(void)
static void test_PropVariantCompare(void)
static const WCHAR topicW[]
static void test_PropVariantToStringWithDefault(void)
static void test_intconversions(void)
static void test_InitPropVariantFromCLSID(void)
static void test_InitPropVariantFromGUIDAsString(void)
static int strcmp_wa(LPCWSTR strw, const char *stra)
static void test_PSPropertyKeyFromString(void)
static void test_PropVariantToBoolean(void)
static const WCHAR emptyW[]
static void test_PropVariantToString(void)
static void test_InitPropVariantFromBuffer(void)
static void test_PropVariantChangeType_LPWSTR(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)
PROPERTYKEY * REFPROPERTYKEY
HRESULT WINAPI PSPropertyKeyFromString(LPCWSTR pszString, PROPERTYKEY *pkey)
static IPropertySystem propsys
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)
static __inline const char * wine_dbgstr_guid(const GUID *id)
#define STRSAFE_E_INSUFFICIENT_BUFFER
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
#define E_NOT_SUFFICIENT_BUFFER
#define HRESULT_FROM_WIN32(x)
#define ERROR_ARITHMETIC_OVERFLOW
#define DISP_E_TYPEMISMATCH