ReactOS 0.4.15-dev-7942-gd23573b
asn.c
Go to the documentation of this file.
1/* Unit test suite for wintrust asn functions
2 *
3 * Copyright 2007 Juan Lang
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 *
19 */
20#include <stdarg.h>
21#include "windef.h"
22#include "winbase.h"
23#include "winerror.h"
24#include "wincrypt.h"
25#include "wintrust.h"
26
27#include "wine/test.h"
28
29static BOOL (WINAPI *pCryptDecodeObjectEx)(DWORD,LPCSTR,const BYTE*,DWORD,DWORD,PCRYPT_DECODE_PARA,void*,DWORD*);
30static BOOL (WINAPI *pCryptEncodeObjectEx)(DWORD,LPCSTR,const void*,DWORD,PCRYPT_ENCODE_PARA,void*,DWORD*);
31
32static const BYTE falseCriteria[] = { 0x30,0x06,0x01,0x01,0x00,0x01,0x01,0x00 };
33static const BYTE trueCriteria[] = { 0x30,0x06,0x01,0x01,0xff,0x01,0x01,0xff };
34
36{
37 BOOL ret;
38 DWORD size = 0;
39 LPBYTE buf;
40 SPC_FINANCIAL_CRITERIA criteria = { FALSE, FALSE };
41
42 if (!pCryptEncodeObjectEx)
43 {
44 win_skip("CryptEncodeObjectEx() is not available. Skipping the encodeFinancialCriteria tests\n");
45 return;
46 }
48 &criteria, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
49 ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
50 if (ret)
51 {
52 ok(size == sizeof(falseCriteria), "Unexpected size %d\n", size);
53 ok(!memcmp(buf, falseCriteria, size), "Unexpected value\n");
55 }
56 criteria.fFinancialInfoAvailable = criteria.fMeetsCriteria = TRUE;
58 &criteria, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
59 ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
60 if (ret)
61 {
62 ok(size == sizeof(trueCriteria), "Unexpected size %d\n", size);
63 ok(!memcmp(buf, trueCriteria, size), "Unexpected value\n");
65 }
66}
67
69{
70 BOOL ret;
72 DWORD size = sizeof(criteria);
73
74 if (!pCryptDecodeObjectEx)
75 {
76 win_skip("CryptDecodeObjectEx() is not available. Skipping the decodeSPCFinancialCriteria tests\n");
77 return;
78 }
79
81 falseCriteria, sizeof(falseCriteria), 0, NULL, &criteria, &size);
82 ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
83 if (ret)
84 {
85 ok(!criteria.fFinancialInfoAvailable, "expected FALSE\n");
86 ok(!criteria.fMeetsCriteria, "expected FALSE\n");
87 }
89 trueCriteria, sizeof(trueCriteria), 0, NULL, &criteria, &size);
90 ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
91 if (ret)
92 {
93 ok(criteria.fFinancialInfoAvailable, "expected TRUE\n");
94 ok(criteria.fMeetsCriteria, "expected TRUE\n");
95 }
96}
97
98static WCHAR url[] = { 'h','t','t','p',':','/','/','w','i','n','e','h','q','.',
99 'o','r','g',0 };
100static const WCHAR nihongoURL[] = { 'h','t','t','p',':','/','/',0x226f,
101 0x575b, 0 };
102static const BYTE emptyURLSPCLink[] = { 0x80,0x00 };
103static const BYTE urlSPCLink[] = {
1040x80,0x11,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x69,0x6e,0x65,0x68,0x71,
1050x2e,0x6f,0x72,0x67};
106static const BYTE fileSPCLink[] = {
1070xa2,0x14,0x80,0x12,0x00,0x68,0x00,0x74,0x00,0x74,0x00,0x70,0x00,0x3a,0x00,
1080x2f,0x00,0x2f,0x22,0x6f,0x57,0x5b };
109static const BYTE emptyMonikerSPCLink[] = {
1100xa1,0x14,0x04,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1110x00,0x00,0x00,0x00,0x00,0x04,0x00 };
112static BYTE data[] = { 0xba, 0xad, 0xf0, 0x0d };
113static const BYTE monikerSPCLink[] = {
1140xa1,0x18,0x04,0x10,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,
1150xea,0xea,0xea,0xea,0xea,0x04,0x04,0xba,0xad,0xf0,0x0d };
116
117static void test_encodeSPCLink(void)
118{
119 BOOL ret;
120 DWORD size = 0;
121 LPBYTE buf;
122 SPC_LINK link = { 0 };
123
124 if (!pCryptEncodeObjectEx)
125 {
126 win_skip("CryptEncodeObjectEx() is not available. Skipping the encodeSPCLink tests\n");
127 return;
128 }
129
130 SetLastError(0xdeadbeef);
131 ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT, &link,
134 "Expected E_INVALIDARG, got %08x\n", GetLastError());
135 link.dwLinkChoice = SPC_URL_LINK_CHOICE;
136 ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT, &link,
138 ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
139 if (ret)
140 {
141 ok(size == sizeof(emptyURLSPCLink), "Unexpected size %d\n", size);
142 ok(!memcmp(buf, emptyURLSPCLink, size), "Unexpected value\n");
143 LocalFree(buf);
144 }
145 /* With an invalid char: */
146 U(link).pwszUrl = (LPWSTR)nihongoURL;
147 size = 1;
148 SetLastError(0xdeadbeef);
149 ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT, &link,
151 ok(!ret &&
153 GetLastError() == OSS_BAD_PTR /* WinNT */),
154 "Expected CRYPT_E_INVALID_IA5_STRING, got %08x\n", GetLastError());
155 /* Unlike the crypt32 string encoding routines, size is not set to the
156 * index of the first invalid character.
157 */
158 ok(size == 0, "Expected size 0, got %d\n", size);
159 U(link).pwszUrl = url;
160 ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT, &link,
162 ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
163 if (ret)
164 {
165 ok(size == sizeof(urlSPCLink), "Unexpected size %d\n", size);
166 ok(!memcmp(buf, urlSPCLink, size), "Unexpected value\n");
167 LocalFree(buf);
168 }
169 link.dwLinkChoice = SPC_FILE_LINK_CHOICE;
170 U(link).pwszFile = (LPWSTR)nihongoURL;
171 ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT, &link,
173 ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
174 if (ret)
175 {
176 ok(size == sizeof(fileSPCLink), "Unexpected size %d\n", size);
177 ok(!memcmp(buf, fileSPCLink, size), "Unexpected value\n");
178 LocalFree(buf);
179 }
180 link.dwLinkChoice = SPC_MONIKER_LINK_CHOICE;
181 memset(&U(link).Moniker, 0, sizeof(U(link).Moniker));
182 ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT, &link,
184 ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
185 if (ret)
186 {
187 ok(size == sizeof(emptyMonikerSPCLink), "Unexpected size %d\n", size);
188 ok(!memcmp(buf, emptyMonikerSPCLink, size), "Unexpected value\n");
189 LocalFree(buf);
190 }
191 memset(&U(link).Moniker.ClassId, 0xea, sizeof(U(link).Moniker.ClassId));
192 U(link).Moniker.SerializedData.pbData = data;
193 U(link).Moniker.SerializedData.cbData = sizeof(data);
194 ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT, &link,
196 ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
197 if (ret)
198 {
199 ok(size == sizeof(monikerSPCLink), "Unexpected size %d\n", size);
200 ok(!memcmp(buf, monikerSPCLink, size), "Unexpected value\n");
201 LocalFree(buf);
202 }
203}
204
205static const BYTE badMonikerSPCLink[] = {
2060xa1,0x19,0x04,0x11,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,
2070xea,0xea,0xea,0xea,0xea,0xea,0x04,0x04,0xba,0xad,0xf0,0x0d };
208
209static void test_decodeSPCLink(void)
210{
211 BOOL ret;
212 LPBYTE buf = NULL;
213 DWORD size = 0;
214 SPC_LINK *link;
215
216 if (!pCryptDecodeObjectEx)
217 {
218 win_skip("CryptDecodeObjectEx() is not available. Skipping the decodeSPCLink tests\n");
219 return;
220 }
221
222 ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT,
224 &buf, &size);
225 ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
226 if (ret)
227 {
228 link = (SPC_LINK *)buf;
229 ok(link->dwLinkChoice == SPC_URL_LINK_CHOICE,
230 "Expected SPC_URL_LINK_CHOICE, got %d\n", link->dwLinkChoice);
231 ok(lstrlenW(U(*link).pwszUrl) == 0, "Expected empty string\n");
232 LocalFree(buf);
233 }
234 ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT,
236 &buf, &size);
237 ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
238 if (ret)
239 {
240 link = (SPC_LINK *)buf;
241 ok(link->dwLinkChoice == SPC_URL_LINK_CHOICE,
242 "Expected SPC_URL_LINK_CHOICE, got %d\n", link->dwLinkChoice);
243 ok(!lstrcmpW(U(*link).pwszUrl, url), "Unexpected URL\n");
244 LocalFree(buf);
245 }
246 ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT,
248 &buf, &size);
249 ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
250 if (ret)
251 {
252 link = (SPC_LINK *)buf;
253 ok(link->dwLinkChoice == SPC_FILE_LINK_CHOICE,
254 "Expected SPC_FILE_LINK_CHOICE, got %d\n", link->dwLinkChoice);
255 ok(!lstrcmpW(U(*link).pwszFile, nihongoURL), "Unexpected file\n");
256 LocalFree(buf);
257 }
258 ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT,
260 NULL, &buf, &size);
261 ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
262 if (ret)
263 {
264 SPC_SERIALIZED_OBJECT emptyMoniker = { { 0 } };
265
266 link = (SPC_LINK *)buf;
267 ok(link->dwLinkChoice == SPC_MONIKER_LINK_CHOICE,
268 "Expected SPC_MONIKER_LINK_CHOICE, got %d\n", link->dwLinkChoice);
269 ok(!memcmp(&U(*link).Moniker.ClassId, &emptyMoniker.ClassId,
270 sizeof(emptyMoniker.ClassId)), "Unexpected value\n");
271 ok(U(*link).Moniker.SerializedData.cbData == 0,
272 "Expected no serialized data\n");
273 LocalFree(buf);
274 }
275 ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT,
277 &buf, &size);
278 ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
279 if (ret)
280 {
281 SPC_UUID id;
282
283 link = (SPC_LINK *)buf;
284 ok(link->dwLinkChoice == SPC_MONIKER_LINK_CHOICE,
285 "Expected SPC_MONIKER_LINK_CHOICE, got %d\n", link->dwLinkChoice);
286 memset(&id, 0xea, sizeof(id));
287 ok(!memcmp(&U(*link).Moniker.ClassId, &id, sizeof(id)),
288 "Unexpected value\n");
289 ok(U(*link).Moniker.SerializedData.cbData == sizeof(data),
290 "Unexpected data size %d\n", U(*link).Moniker.SerializedData.cbData);
291 ok(!memcmp(U(*link).Moniker.SerializedData.pbData, data, sizeof(data)),
292 "Unexpected value\n");
293 LocalFree(buf);
294 }
295 SetLastError(0xdeadbeef);
296 ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT,
298 NULL, &buf, &size);
299 ok(!ret &&
301 GetLastError() == OSS_DATA_ERROR /* WinNT */),
302 "Expected CRYPT_E_BAD_ENCODE, got %08x\n", GetLastError());
303}
304
305static const BYTE emptySequence[] = { 0x30,0x00 };
306static BYTE flags[] = { 1 };
307static const BYTE onlyFlagsPEImage[] = { 0x30,0x04,0x03,0x02,0x00,0x01 };
308static const BYTE onlyEmptyFilePEImage[] = {
3090x30,0x06,0xa0,0x04,0xa2,0x02,0x80,0x00 };
3110x30,0x0a,0x03,0x02,0x00,0x01,0xa0,0x04,0xa2,0x02,0x80,0x00 };
312static const BYTE flagsAndFilePEImage[] = {
3130x30,0x1c,0x03,0x02,0x00,0x01,0xa0,0x16,0xa2,0x14,0x80,0x12,0x00,0x68,0x00,
3140x74,0x00,0x74,0x00,0x70,0x00,0x3a,0x00,0x2f,0x00,0x2f,0x22,0x6f,0x57,0x5b };
315
316static void test_encodeSPCPEImage(void)
317{
318 BOOL ret;
319 DWORD size = 0;
320 LPBYTE buf;
321 SPC_PE_IMAGE_DATA imageData = { { 0 } };
322 SPC_LINK link = { 0 };
323
324 if (!pCryptEncodeObjectEx)
325 {
326 win_skip("CryptEncodeObjectEx() is not available. Skipping the encodeSPCPEImage tests\n");
327 return;
328 }
329
330 ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
331 &imageData, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
332 ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
333 if (ret)
334 {
335 ok(size == sizeof(emptySequence), "Unexpected size %d\n", size);
337 "Unexpected value\n");
338 LocalFree(buf);
339 }
340 /* With an invalid link: */
341 imageData.pFile = &link;
342 SetLastError(0xdeadbeef);
343 ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
344 &imageData, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
346 "Expected E_INVALIDARG, got %08x\n", GetLastError());
347 /* With just unused bits field set: */
348 imageData.pFile = NULL;
349 imageData.Flags.cUnusedBits = 1;
350 ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
351 &imageData, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
352 ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
353 if (ret)
354 {
355 ok(size == sizeof(emptySequence), "Unexpected size %d\n", size);
357 "Unexpected value\n");
358 LocalFree(buf);
359 }
360 /* With flags set: */
361 imageData.Flags.cUnusedBits = 0;
362 imageData.Flags.pbData = flags;
363 imageData.Flags.cbData = sizeof(flags);
364 ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
365 &imageData, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
366 if (!ret && GetLastError() == OSS_TOO_LONG)
367 {
368 skip("SPC_PE_IMAGE_DATA_STRUCT not supported\n");
369 return;
370 }
371 ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
372 if (ret)
373 {
374 ok(size == sizeof(onlyFlagsPEImage), "Unexpected size %d\n", size);
376 "Unexpected value\n");
377 LocalFree(buf);
378 }
379 /* With just an empty file: */
380 imageData.Flags.cbData = 0;
381 link.dwLinkChoice = SPC_FILE_LINK_CHOICE;
382 imageData.pFile = &link;
383 ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
384 &imageData, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
385 ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
386 if (ret)
387 {
388 ok(size == sizeof(onlyEmptyFilePEImage), "Unexpected size %d\n", size);
390 "Unexpected value\n");
391 LocalFree(buf);
392 }
393 /* With flags and an empty file: */
394 imageData.Flags.pbData = flags;
395 imageData.Flags.cbData = sizeof(flags);
396 ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
397 &imageData, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
398 ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
399 if (ret)
400 {
401 ok(size == sizeof(flagsAndEmptyFilePEImage), "Unexpected size %d\n",
402 size);
404 sizeof(flagsAndEmptyFilePEImage)), "Unexpected value\n");
405 LocalFree(buf);
406 }
407 /* Finally, a non-empty file: */
408 U(link).pwszFile = (LPWSTR)nihongoURL;
409 ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
410 &imageData, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
411 ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
412 if (ret)
413 {
414 ok(size == sizeof(flagsAndFilePEImage), "Unexpected size %d\n", size);
416 "Unexpected value\n");
417 LocalFree(buf);
418 }
419}
420
421static void test_decodeSPCPEImage(void)
422{
423 static const WCHAR emptyString[] = { 0 };
424 BOOL ret;
425 LPBYTE buf = NULL;
426 DWORD size = 0;
427 SPC_PE_IMAGE_DATA *imageData;
428
429 if (!pCryptDecodeObjectEx)
430 {
431 win_skip("CryptDecodeObjectEx() is not available. Skipping the decodeSPCPEImage tests\n");
432 return;
433 }
434
435 ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
438 ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
439 if (ret)
440 {
441 imageData = (SPC_PE_IMAGE_DATA *)buf;
442 ok(imageData->Flags.cbData == 0, "Expected empty flags, got %d\n",
443 imageData->Flags.cbData);
444 ok(imageData->pFile == NULL, "Expected no file\n");
445 LocalFree(buf);
446 }
447 ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
450 ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
451 if (ret)
452 {
453 imageData = (SPC_PE_IMAGE_DATA *)buf;
454 ok(imageData->Flags.cbData == sizeof(flags),
455 "Unexpected flags size %d\n", imageData->Flags.cbData);
456 if (imageData->Flags.cbData)
457 ok(!memcmp(imageData->Flags.pbData, flags, sizeof(flags)),
458 "Unexpected flags\n");
459 ok(imageData->pFile == NULL, "Expected no file\n");
460 LocalFree(buf);
461 }
462 ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
465 ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
466 if (ret)
467 {
468 imageData = (SPC_PE_IMAGE_DATA *)buf;
469 ok(imageData->Flags.cbData == 0, "Expected empty flags, got %d\n",
470 imageData->Flags.cbData);
471 ok(imageData->pFile != NULL, "Expected a file\n");
472 if (imageData->pFile)
473 {
475 "Expected SPC_FILE_LINK_CHOICE, got %d\n",
476 imageData->pFile->dwLinkChoice);
477 ok(!lstrcmpW(U(*imageData->pFile).pwszFile, emptyString),
478 "Unexpected file\n");
479 }
480 LocalFree(buf);
481 }
482 ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
485 ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
486 if (ret)
487 {
488 imageData = (SPC_PE_IMAGE_DATA *)buf;
489 ok(imageData->Flags.cbData == sizeof(flags),
490 "Unexpected flags size %d\n", imageData->Flags.cbData);
491 if (imageData->Flags.cbData)
492 ok(!memcmp(imageData->Flags.pbData, flags, sizeof(flags)),
493 "Unexpected flags\n");
494 ok(imageData->pFile != NULL, "Expected a file\n");
495 if (imageData->pFile)
496 {
498 "Expected SPC_FILE_LINK_CHOICE, got %d\n",
499 imageData->pFile->dwLinkChoice);
500 ok(!lstrcmpW(U(*imageData->pFile).pwszFile, emptyString),
501 "Unexpected file\n");
502 }
503 LocalFree(buf);
504 }
505 ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
508 ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
509 if (ret)
510 {
511 imageData = (SPC_PE_IMAGE_DATA *)buf;
512 ok(imageData->Flags.cbData == sizeof(flags),
513 "Unexpected flags size %d\n", imageData->Flags.cbData);
514 if (imageData->Flags.cbData)
515 ok(!memcmp(imageData->Flags.pbData, flags, sizeof(flags)),
516 "Unexpected flags\n");
517 ok(imageData->pFile != NULL, "Expected a file\n");
518 if (imageData->pFile)
519 {
521 "Expected SPC_FILE_LINK_CHOICE, got %d\n",
522 imageData->pFile->dwLinkChoice);
523 ok(!lstrcmpW(U(*imageData->pFile).pwszFile, nihongoURL),
524 "Unexpected file\n");
525 }
526 LocalFree(buf);
527 }
528}
529
530static WCHAR foo[] = { 'f','o','o',0 };
531static WCHAR guidStr[] = { '{','8','b','c','9','6','b','0','0','-',
532 '8','d','a','1','-','1','1','c','f','-','8','7','3','6','-','0','0',
533 'a','a','0','0','a','4','8','5','e','b','}',0 };
534
535static const BYTE emptyCatMemberInfo[] = { 0x30,0x05,0x1e,0x00,0x02,0x01,0x00 };
5370x30,0x0b,0x1e,0x06,0x00,0x66,0x00,0x6f,0x00,0x6f,0x02,0x01,0x00 };
538static const BYTE catMemberInfoWithGuid[] = {
5390x30,0x51,0x1e,0x4c,0x00,0x7b,0x00,0x38,0x00,0x62,0x00,0x63,0x00,0x39,0x00,0x36,
5400x00,0x62,0x00,0x30,0x00,0x30,0x00,0x2d,0x00,0x38,0x00,0x64,0x00,0x61,0x00,0x31,
5410x00,0x2d,0x00,0x31,0x00,0x31,0x00,0x63,0x00,0x66,0x00,0x2d,0x00,0x38,0x00,0x37,
5420x00,0x33,0x00,0x36,0x00,0x2d,0x00,0x30,0x00,0x30,0x00,0x61,0x00,0x61,0x00,0x30,
5430x00,0x30,0x00,0x61,0x00,0x34,0x00,0x38,0x00,0x35,0x00,0x65,0x00,0x62,0x00,0x7d,
5440x02,0x01,0x00 };
545
547{
549 BOOL ret;
550 DWORD size = 0;
551 LPBYTE buf;
552
553 memset(&info, 0, sizeof(info));
554
555 if (!pCryptEncodeObjectEx)
556 {
557 win_skip("CryptEncodeObjectEx() is not available. Skipping the encodeCatMemberInfo tests\n");
558 return;
559 }
560
561 ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_MEMBERINFO_STRUCT,
563 ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
564 if (ret)
565 {
566 ok(size == sizeof(emptyCatMemberInfo), "Unexpected size %d\n", size);
568 "Unexpected value\n");
569 LocalFree(buf);
570 }
571 info.pwszSubjGuid = foo;
572 ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_MEMBERINFO_STRUCT,
574 ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
575 if (ret)
576 {
577 ok(size == sizeof(catMemberInfoWithSillyGuid), "Unexpected size %d\n",
578 size);
580 sizeof(catMemberInfoWithSillyGuid)), "Unexpected value\n");
581 LocalFree(buf);
582 }
583 info.pwszSubjGuid = guidStr;
584 ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_MEMBERINFO_STRUCT,
586 ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
587 if (ret)
588 {
589 ok(size == sizeof(catMemberInfoWithGuid), "Unexpected size %d\n",
590 size);
592 "Unexpected value\n");
593 LocalFree(buf);
594 }
595}
596
598{
599 BOOL ret;
600 LPBYTE buf;
601 DWORD size;
603
604 if (!pCryptDecodeObjectEx)
605 {
606 win_skip("CryptDecodeObjectEx() is not available. Skipping the decodeCatMemberInfo tests\n");
607 return;
608 }
609
610 ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_MEMBERINFO_STRUCT,
613 ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
614 if (ret)
615 {
617 ok(!info->pwszSubjGuid || !info->pwszSubjGuid[0],
618 "expected empty pwszSubjGuid\n");
619 ok(info->dwCertVersion == 0, "expected dwCertVersion == 0, got %d\n",
620 info->dwCertVersion);
621 LocalFree(buf);
622 }
623 ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_MEMBERINFO_STRUCT,
626 ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
627 if (ret)
628 {
630 ok(info->pwszSubjGuid && !lstrcmpW(info->pwszSubjGuid, foo),
631 "unexpected pwszSubjGuid\n");
632 ok(info->dwCertVersion == 0, "expected dwCertVersion == 0, got %d\n",
633 info->dwCertVersion);
634 LocalFree(buf);
635 }
636 ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_MEMBERINFO_STRUCT,
639 ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
640 if (ret)
641 {
643 ok(info->pwszSubjGuid && !lstrcmpW(info->pwszSubjGuid, guidStr),
644 "unexpected pwszSubjGuid\n");
645 ok(info->dwCertVersion == 0, "expected dwCertVersion == 0, got %d\n",
646 info->dwCertVersion);
647 LocalFree(buf);
648 }
649}
650
651static const BYTE emptyCatNameValue[] = {
6520x30,0x07,0x1e,0x00,0x02,0x01,0x00,0x04,0x00 };
653static const BYTE catNameValueWithTag[] = {
6540x30,0x0d,0x1e,0x06,0x00,0x66,0x00,0x6f,0x00,0x6f,0x02,0x01,0x00,0x04,0x00 };
655static const BYTE catNameValueWithFlags[] = {
6560x30,0x0a,0x1e,0x00,0x02,0x04,0xf0,0x0d,0xd0,0x0d,0x04,0x00 };
657static const BYTE catNameValueWithValue[] = {
6580x30,0x0b,0x1e,0x00,0x02,0x01,0x00,0x04,0x04,0x01,0x02,0x03,0x04 };
659
660static BYTE aVal[] = { 1,2,3,4 };
661
662static void test_encodeCatNameValue(void)
663{
664 static WCHAR foo[] = { 'f','o','o',0 };
665 BOOL ret;
666 LPBYTE buf;
667 DWORD size;
669
670 memset(&value, 0, sizeof(value));
671 ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
673 ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
674 if (ret)
675 {
676 ok(size == sizeof(emptyCatNameValue), "Unexpected size %d\n", size);
678 "Unexpected value\n");
679 LocalFree(buf);
680 }
681 value.pwszTag = foo;
682 ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
684 ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
685 if (ret)
686 {
687 ok(size == sizeof(catNameValueWithTag), "Unexpected size %d\n", size);
689 "Unexpected value\n");
690 LocalFree(buf);
691 }
692 value.pwszTag = NULL;
693 value.fdwFlags = 0xf00dd00d;
694 ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
696 ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
697 if (ret)
698 {
699 ok(size == sizeof(catNameValueWithFlags), "Unexpected size %d\n", size);
701 "Unexpected value\n");
702 LocalFree(buf);
703 }
704 value.fdwFlags = 0;
705 value.Value.cbData = sizeof(aVal);
706 value.Value.pbData = aVal;
707 ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
709 ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
710 if (ret)
711 {
712 ok(size == sizeof(catNameValueWithValue), "Unexpected size %d\n", size);
714 "Unexpected value\n");
715 LocalFree(buf);
716 }
717}
718
719static void test_decodeCatNameValue(void)
720{
721 BOOL ret;
722 LPBYTE buf;
723 DWORD size;
725
726 buf = NULL;
727 ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
730 ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
731 if (ret)
732 {
734 ok(!value->pwszTag || !value->pwszTag[0], "expected empty pwszTag\n");
735 ok(value->fdwFlags == 0, "expected fdwFlags == 0, got %08x\n",
736 value->fdwFlags);
737 ok(value->Value.cbData == 0, "expected 0-length value, got %d\n",
738 value->Value.cbData);
739 LocalFree(buf);
740 }
741 buf = NULL;
742 ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
745 ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
746 if (ret)
747 {
749 ok(value->pwszTag && !lstrcmpW(value->pwszTag, foo),
750 "unexpected pwszTag\n");
751 ok(value->fdwFlags == 0, "expected fdwFlags == 0, got %08x\n",
752 value->fdwFlags);
753 ok(value->Value.cbData == 0, "expected 0-length value, got %d\n",
754 value->Value.cbData);
755 LocalFree(buf);
756 }
757 buf = NULL;
758 ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
761 ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
762 if (ret)
763 {
765 ok(!value->pwszTag || !value->pwszTag[0], "expected empty pwszTag\n");
766 ok(value->fdwFlags == 0xf00dd00d,
767 "expected fdwFlags == 0xf00dd00d, got %08x\n", value->fdwFlags);
768 ok(value->Value.cbData == 0, "expected 0-length value, got %d\n",
769 value->Value.cbData);
770 LocalFree(buf);
771 }
772 buf = NULL;
773 ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
776 ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
777 if (ret)
778 {
780 ok(!value->pwszTag || !value->pwszTag[0], "expected empty pwszTag\n");
781 ok(value->fdwFlags == 0, "expected fdwFlags == 0, got %08x\n",
782 value->fdwFlags);
783 ok(value->Value.cbData == sizeof(aVal), "unexpected size %d\n",
784 value->Value.cbData);
785 ok(!memcmp(value->Value.pbData, aVal, value->Value.cbData),
786 "unexpected value\n");
787 LocalFree(buf);
788 }
789}
790
791static const WCHAR progName[] = { 'A',' ','p','r','o','g','r','a','m',0 };
7930x30,0x16,0xa0,0x14,0x80,0x12,0x00,0x41,0x00,0x20,0x00,0x70,0x00,0x72,0x00,0x6f,
7940x00,0x67,0x00,0x72,0x00,0x61,0x00,0x6d };
795static WCHAR winehq[] = { 'h','t','t','p',':','/','/','w','i','n','e','h','q',
796 '.','o','r','g','/',0 };
797static const BYTE spOpusInfoWithMoreInfo[] = {
7980x30,0x16,0xa1,0x14,0x80,0x12,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x69,0x6e,
7990x65,0x68,0x71,0x2e,0x6f,0x72,0x67,0x2f };
8010x30,0x16,0xa2,0x14,0x80,0x12,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x69,0x6e,
8020x65,0x68,0x71,0x2e,0x6f,0x72,0x67,0x2f };
803
804static void test_encodeSpOpusInfo(void)
805{
806 BOOL ret;
807 LPBYTE buf;
808 DWORD size;
810 SPC_LINK moreInfo;
811
812 memset(&info, 0, sizeof(info));
813 ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_SP_OPUS_INFO_STRUCT,
815 ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
816 if (ret)
817 {
818 ok(size == sizeof(emptySequence), "unexpected size %d\n", size);
819 ok(!memcmp(buf, emptySequence, size), "unexpected value\n");
820 LocalFree(buf);
821 }
822 info.pwszProgramName = progName;
823 ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_SP_OPUS_INFO_STRUCT,
825 ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
826 if (ret)
827 {
828 ok(size == sizeof(spOpusInfoWithProgramName), "unexpected size %d\n",
829 size);
831 "unexpected value\n");
832 LocalFree(buf);
833 }
834 info.pwszProgramName = NULL;
835 memset(&moreInfo, 0, sizeof(moreInfo));
836 info.pMoreInfo = &moreInfo;
837 SetLastError(0xdeadbeef);
838 ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_SP_OPUS_INFO_STRUCT,
841 "expected E_INVALIDARG, got %08x\n", GetLastError());
843 U(moreInfo).pwszUrl = winehq;
844 ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_SP_OPUS_INFO_STRUCT,
846 ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
847 if (ret)
848 {
849 ok(size == sizeof(spOpusInfoWithMoreInfo),
850 "unexpected size %d\n", size);
852 "unexpected value\n");
853 LocalFree(buf);
854 }
855 info.pMoreInfo = NULL;
856 info.pPublisherInfo = &moreInfo;
857 ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_SP_OPUS_INFO_STRUCT,
859 ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
860 if (ret)
861 {
863 "unexpected size %d\n", size);
865 "unexpected value\n");
866 LocalFree(buf);
867 }
868}
869
870static void test_decodeSpOpusInfo(void)
871{
872 BOOL ret;
873 DWORD size;
875
876 ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_SP_OPUS_INFO_STRUCT,
878 &info, &size);
879 ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
880 if (ret)
881 {
882 ok(!info->pwszProgramName, "expected NULL\n");
883 ok(!info->pMoreInfo, "expected NULL\n");
884 ok(!info->pPublisherInfo, "expected NULL\n");
886 }
887 ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_SP_OPUS_INFO_STRUCT,
890 ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
891 if (ret)
892 {
893 ok(info->pwszProgramName && !lstrcmpW(info->pwszProgramName,
894 progName), "unexpected program name\n");
895 ok(!info->pMoreInfo, "expected NULL\n");
896 ok(!info->pPublisherInfo, "expected NULL\n");
898 }
899 ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_SP_OPUS_INFO_STRUCT,
902 ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
903 if (ret)
904 {
905 ok(!info->pwszProgramName, "expected NULL\n");
906 ok(info->pMoreInfo != NULL, "expected a value for pMoreInfo\n");
907 if (info->pMoreInfo)
908 {
909 ok(info->pMoreInfo->dwLinkChoice == SPC_URL_LINK_CHOICE,
910 "unexpected link choice %d\n", info->pMoreInfo->dwLinkChoice);
911 ok(!lstrcmpW(U(*info->pMoreInfo).pwszUrl, winehq),
912 "unexpected link value\n");
913 }
914 ok(!info->pPublisherInfo, "expected NULL\n");
916 }
917 ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_SP_OPUS_INFO_STRUCT,
920 ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
921 if (ret)
922 {
923 ok(!info->pwszProgramName, "expected NULL\n");
924 ok(!info->pMoreInfo, "expected NULL\n");
925 ok(info->pPublisherInfo != NULL,
926 "expected a value for pPublisherInfo\n");
927 if (info->pPublisherInfo)
928 {
929 ok(info->pPublisherInfo->dwLinkChoice == SPC_URL_LINK_CHOICE,
930 "unexpected link choice %d\n",
931 info->pPublisherInfo->dwLinkChoice);
932 ok(!lstrcmpW(U(*info->pPublisherInfo).pwszUrl, winehq),
933 "unexpected link value\n");
934 }
936 }
937}
938
940{
941 HMODULE hCrypt32 = LoadLibraryA("crypt32.dll");
942 pCryptDecodeObjectEx = (void*)GetProcAddress(hCrypt32, "CryptDecodeObjectEx");
943 pCryptEncodeObjectEx = (void*)GetProcAddress(hCrypt32, "CryptEncodeObjectEx");
944
957
958 FreeLibrary(hCrypt32);
959}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define START_TEST(x)
Definition: atltest.h:75
#define U(x)
Definition: wordpad.c:45
const WCHAR * link
Definition: db.cpp:997
#define E_INVALIDARG
Definition: ddrawi.h:101
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define SetLastError(x)
Definition: compat.h:752
#define GetProcAddress(x, y)
Definition: compat.h:753
#define FreeLibrary(x)
Definition: compat.h:748
#define lstrlenW
Definition: compat.h:750
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLbitfield flags
Definition: glext.h:7161
GLuint id
Definition: glext.h:5910
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
static const BYTE onlyEmptyFilePEImage[]
Definition: asn.c:308
static const BYTE catNameValueWithFlags[]
Definition: asn.c:655
static WCHAR url[]
Definition: asn.c:98
static const BYTE emptyCatMemberInfo[]
Definition: asn.c:535
static void test_encodeSPCLink(void)
Definition: asn.c:117
static WCHAR foo[]
Definition: asn.c:530
static void test_decodeSpOpusInfo(void)
Definition: asn.c:870
static WCHAR guidStr[]
Definition: asn.c:531
static void test_encodeSPCPEImage(void)
Definition: asn.c:316
static const BYTE badMonikerSPCLink[]
Definition: asn.c:205
static const BYTE emptyCatNameValue[]
Definition: asn.c:651
static BYTE aVal[]
Definition: asn.c:660
static const BYTE spOpusInfoWithProgramName[]
Definition: asn.c:792
static void test_decodeSPCFinancialCriteria(void)
Definition: asn.c:68
static void test_encodeCatNameValue(void)
Definition: asn.c:662
static void test_decodeSPCLink(void)
Definition: asn.c:209
static const BYTE flagsAndEmptyFilePEImage[]
Definition: asn.c:310
static const BYTE catNameValueWithTag[]
Definition: asn.c:653
static const BYTE catMemberInfoWithGuid[]
Definition: asn.c:538
static const BYTE spOpusInfoWithMoreInfo[]
Definition: asn.c:797
static void test_encodeSpOpusInfo(void)
Definition: asn.c:804
static const BYTE fileSPCLink[]
Definition: asn.c:106
static const BYTE PCRYPT_DECODE_PARA
Definition: asn.c:29
static void test_decodeSPCPEImage(void)
Definition: asn.c:421
static WCHAR winehq[]
Definition: asn.c:795
static void test_decodeCatMemberInfo(void)
Definition: asn.c:597
static void test_encodeSPCFinancialCriteria(void)
Definition: asn.c:35
static const BYTE catMemberInfoWithSillyGuid[]
Definition: asn.c:536
static const BYTE void DWORD *static const void PCRYPT_ENCODE_PARA
Definition: asn.c:30
static const BYTE emptyURLSPCLink[]
Definition: asn.c:102
static const BYTE flagsAndFilePEImage[]
Definition: asn.c:312
static const WCHAR progName[]
Definition: asn.c:791
static const BYTE trueCriteria[]
Definition: asn.c:33
static const BYTE monikerSPCLink[]
Definition: asn.c:113
static const BYTE spOpusInfoWithPublisherInfo[]
Definition: asn.c:800
static void test_encodeCatMemberInfo(void)
Definition: asn.c:546
static const BYTE emptySequence[]
Definition: asn.c:305
static const BYTE void DWORD *static const void void DWORD *static const BYTE falseCriteria[]
Definition: asn.c:32
static BYTE flags[]
Definition: asn.c:306
static const BYTE onlyFlagsPEImage[]
Definition: asn.c:307
static const BYTE emptyMonikerSPCLink[]
Definition: asn.c:109
static const BYTE catNameValueWithValue[]
Definition: asn.c:657
static void test_decodeCatNameValue(void)
Definition: asn.c:719
static const WCHAR nihongoURL[]
Definition: asn.c:100
static const BYTE urlSPCLink[]
Definition: asn.c:103
#define BOOL
Definition: nt_native.h:43
#define DWORD
Definition: nt_native.h:44
#define win_skip
Definition: test.h:160
#define memset(x, y, z)
Definition: compat.h:39
DWORD cUnusedBits
Definition: wincrypt.h:198
BYTE * pbData
Definition: wincrypt.h:197
CRYPT_BIT_BLOB Flags
Definition: wintrust.h:552
PSPC_LINK pFile
Definition: wintrust.h:553
unsigned char * LPBYTE
Definition: typedefs.h:53
Definition: pdh_main.c:94
int ret
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define X509_ASN_ENCODING
Definition: wincrypt.h:2297
#define CRYPT_DECODE_ALLOC_FLAG
Definition: wincrypt.h:3454
#define CRYPT_ENCODE_ALLOC_FLAG
Definition: wincrypt.h:3441
#define WINAPI
Definition: msvc.h:6
#define OSS_BAD_PTR
Definition: winerror.h:3048
#define CRYPT_E_BAD_ENCODE
Definition: winerror.h:3005
#define OSS_TOO_LONG
Definition: winerror.h:3053
#define CRYPT_E_INVALID_IA5_STRING
Definition: winerror.h:3026
#define OSS_DATA_ERROR
Definition: winerror.h:3042
BYTE SPC_UUID[SPC_UUID_LENGTH]
Definition: wintrust.h:516
#define SPC_PE_IMAGE_DATA_STRUCT
Definition: wintrust.h:505
#define SPC_SP_OPUS_INFO_STRUCT
Definition: wintrust.h:508
#define SPC_FILE_LINK_CHOICE
Definition: wintrust.h:537
#define CAT_MEMBERINFO_STRUCT
Definition: wintrust.h:513
#define SPC_MONIKER_LINK_CHOICE
Definition: wintrust.h:536
#define SPC_LINK_STRUCT
Definition: wintrust.h:506
#define SPC_FINANCIAL_CRITERIA_STRUCT
Definition: wintrust.h:503
#define CAT_NAMEVALUE_STRUCT
Definition: wintrust.h:512
#define SPC_URL_LINK_CHOICE
Definition: wintrust.h:535
const char * LPCSTR
Definition: xmlstorage.h:183
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
unsigned char BYTE
Definition: xxhash.c:193