60 "Name=winetest.cat\r\n"
62 "PublicVersion=0x00000001\r\n"
64 "CATATTR1=0x10010001:attr1:value1\r\n"
65 "CATATTR2=0x10010001:attr2:value2\r\n"
68 "hashme=.\\winetest.cdf\r\n";
71 0x30, 0x82, 0x01, 0xbc, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0,
72 0x82, 0x01, 0xad, 0x30, 0x82, 0x01, 0xa9, 0x02, 0x01, 0x01, 0x31, 0x00, 0x30, 0x82, 0x01, 0x9e,
73 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x0a, 0x01, 0xa0, 0x82, 0x01, 0x8f, 0x30,
74 0x82, 0x01, 0x8b, 0x30, 0x0c, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x0c, 0x01,
75 0x01, 0x04, 0x10, 0xfa, 0x55, 0x2c, 0xc2, 0xf6, 0xcc, 0xdd, 0x11, 0x2a, 0x9c, 0x00, 0x14, 0x22,
76 0xec, 0x8f, 0x3b, 0x17, 0x0d, 0x30, 0x38, 0x31, 0x32, 0x31, 0x38, 0x31, 0x31, 0x32, 0x36, 0x34,
77 0x38, 0x5a, 0x30, 0x0e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x0c, 0x01, 0x02,
78 0x05, 0x00, 0x30, 0x81, 0xdd, 0x30, 0x81, 0xda, 0x04, 0x0e, 0x68, 0x00, 0x61, 0x00, 0x73, 0x00,
79 0x68, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x00, 0x00, 0x31, 0x81, 0xc7, 0x30, 0x61, 0x06, 0x0a, 0x2b,
80 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x02, 0x01, 0x04, 0x31, 0x53, 0x30, 0x51, 0x30, 0x2c, 0x06,
81 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x02, 0x01, 0x19, 0xa2, 0x1e, 0x80, 0x1c, 0x00,
82 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x4f, 0x00, 0x62, 0x00, 0x73, 0x00, 0x6f, 0x00, 0x6c, 0x00,
83 0x65, 0x00, 0x74, 0x00, 0x65, 0x00, 0x3e, 0x00, 0x3e, 0x00, 0x3e, 0x30, 0x21, 0x30, 0x09, 0x06,
84 0x05, 0x2b, 0x0e, 0x03, 0x02, 0x1a, 0x05, 0x00, 0x04, 0x14, 0xed, 0xd6, 0x9c, 0x9c, 0xb2, 0xfc,
85 0xaa, 0x03, 0xe8, 0xd3, 0x20, 0xf6, 0xab, 0x28, 0xc3, 0xff, 0xbd, 0x07, 0x36, 0xf5, 0x30, 0x62,
86 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x0c, 0x02, 0x02, 0x31, 0x54, 0x30, 0x52,
87 0x1e, 0x4c, 0x00, 0x7b, 0x00, 0x44, 0x00, 0x45, 0x00, 0x33, 0x00, 0x35, 0x00, 0x31, 0x00, 0x41,
88 0x00, 0x34, 0x00, 0x32, 0x00, 0x2d, 0x00, 0x38, 0x00, 0x45, 0x00, 0x35, 0x00, 0x39, 0x00, 0x2d,
89 0x00, 0x31, 0x00, 0x31, 0x00, 0x44, 0x00, 0x30, 0x00, 0x2d, 0x00, 0x38, 0x00, 0x43, 0x00, 0x34,
90 0x00, 0x37, 0x00, 0x2d, 0x00, 0x30, 0x00, 0x30, 0x00, 0x43, 0x00, 0x30, 0x00, 0x34, 0x00, 0x46,
91 0x00, 0x43, 0x00, 0x32, 0x00, 0x39, 0x00, 0x35, 0x00, 0x45, 0x00, 0x45, 0x00, 0x7d, 0x02, 0x02,
92 0x02, 0x00, 0xa0, 0x6a, 0x30, 0x68, 0x30, 0x32, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82,
93 0x37, 0x0c, 0x02, 0x01, 0x04, 0x24, 0x30, 0x22, 0x1e, 0x0a, 0x00, 0x61, 0x00, 0x74, 0x00, 0x74,
94 0x00, 0x72, 0x00, 0x32, 0x02, 0x04, 0x10, 0x01, 0x00, 0x01, 0x04, 0x0e, 0x76, 0x00, 0x61, 0x00,
95 0x6c, 0x00, 0x75, 0x00, 0x65, 0x00, 0x32, 0x00, 0x00, 0x00, 0x30, 0x32, 0x06, 0x0a, 0x2b, 0x06,
96 0x01, 0x04, 0x01, 0x82, 0x37, 0x0c, 0x02, 0x01, 0x04, 0x24, 0x30, 0x22, 0x1e, 0x0a, 0x00, 0x61,
97 0x00, 0x74, 0x00, 0x74, 0x00, 0x72, 0x00, 0x31, 0x02, 0x04, 0x10, 0x01, 0x00, 0x01, 0x04, 0x0e,
98 0x76, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x75, 0x00, 0x65, 0x00, 0x31, 0x00, 0x00, 0x00, 0x31, 0x00,
126#define WINTRUST_GET_PROC(func) \
127 p ## func = (void*)GetProcAddress(hWintrust, #func); \
129 trace("GetProcAddress(%s) failed\n", #func); \
149#undef WINTRUST_GET_PROC
153 trace(
"GetProcAddress(CryptSIPGetSignedDataMsg) failed\n");
157 trace(
"GetProcAddress(CryptSIPPutSignedDataMsg) failed\n");
160static GUID dummy = {0xdeadbeef,0xdead,0xbeef,{0xde,0xad,0xbe,0xef,0xde,0xad,0xbe,0xef}};
166 static GUID unknown = { 0xC689AABA, 0x8E78, 0x11D0, { 0x8C,0x47,0x00,0xC0,0x4F,0xC2,0x95,0xEE }};
201 ok(!
ret,
"Expected failure\n");
203 "Expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
207 ret = pCryptCATAdminAcquireContext(&hca,
NULL, 0);
209 ok(hca !=
NULL,
"Expected a context handle, got NULL\n");
213 ret = pCryptCATAdminReleaseContext(hca, 0);
218 ret = pCryptCATAdminReleaseContext(hca, 0);
219 ok(!
ret,
"Expected failure\n");
221 "Expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
226 ret = pCryptCATAdminReleaseContext(
NULL, 0);
227 ok(!
ret,
"Expected failure\n");
229 "Expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
234 ok(!
ret,
"Expected failure\n");
236 "Expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
248 ret = pCryptCATAdminAcquireContext(&hca, &
dummy, 0);
252 win_skip(
"Not running as administrator\n");
255 ok(hca !=
NULL,
"Expected a context handle, got NULL\n");
262 lstrcatA(dummydir,
"\\{DEADBEEF-DEAD-BEEF-DEAD-BEEFDEADBEEF}");
265 "Expected CatRoot\\{DEADBEEF-DEAD-BEEF-DEAD-BEEFDEADBEEF} directory to exist\n");
272 lstrcatA(dummydir,
"\\{DEADBEEF-DEAD-BEEF-DEAD-BEEFDEADBEEF}");
275 "Expected CatRoot2\\{DEADBEEF-DEAD-BEEF-DEAD-BEEFDEADBEEF} directory to exist\n");
278 ret = pCryptCATAdminReleaseContext(hca, 0);
282 ret = pCryptCATAdminAcquireContext(&hca, &
unknown, 0);
284 ok(hca !=
NULL,
"Expected a context handle, got NULL\n");
286 ret = pCryptCATAdminReleaseContext(hca, 0);
289 hca = (
void *) 0xdeadbeef;
292 ret = pCryptCATAdminAcquireContext(&hca, &
unknown, 1);
295 "Expected FALSE and ERROR_INVALID_PARAMETER with untouched handle, got %d and %u with %p\n",
301 ret = pCryptCATAdminReleaseContext(hca, 0);
313 BYTE expectedhash[20] = {0x3a,0xa1,0x19,0x08,0xec,0xa6,0x0d,0x2e,0x7e,0xcc,0x7a,0xca,0xf5,0xb8,0x2e,0x62,0x6a,0xda,0xf0,0x19};
320 ok(!
ret,
"Expected failure\n");
322 "Expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
326 ret = pCryptCATAdminCalcHashFromFileHandle(
NULL, &hashsize,
NULL, 0);
327 ok(!
ret,
"Expected failure\n");
329 "Expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
335 ok(!
ret,
"Expected failure\n");
337 "Expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
343 ret = pCryptCATAdminCalcHashFromFileHandle(
file, &hashsize,
NULL, 1);
344 ok(!
ret,
"Expected failure\n");
346 "Expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
353 ret = pCryptCATAdminCalcHashFromFileHandle(
file, &hashsize,
NULL, 0);
355 ok(hashsize == 20,
" Expected a hash size of 20, got %d\n", hashsize);
357 "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n",
GetLastError());
367 ret = pCryptCATAdminCalcHashFromFileHandle(
file, &hashsize,
hash, 0);
369 ok(hashsize == 20,
" Expected a hash size of 20, got %d\n", hashsize);
380 WriteFile(
file,
"Text in this file is needed to create a know hash", 49, &written,
NULL);
386 pCryptCATAdminCalcHashFromFileHandle(
file, &hashsize,
NULL, 0);
389 ret = pCryptCATAdminCalcHashFromFileHandle(
file, &hashsize,
hash, 0);
393 ok(hashsize ==
sizeof(expectedhash) &&
394 !
memcmp(
hash, expectedhash,
sizeof(expectedhash)),
395 "Hashes didn't match\n");
411 hcat = pCryptCATOpen(
NULL, 0, 0, 0, 0);
414 "Expected ERROR_INVALID_PARAMETER, got %08x\n",
GetLastError());
423 hcat = pCryptCATOpen(
emptyW, 0, 0, 0, 0);
427 ret = pCryptCATClose(hcat);
429 ok(
ret,
"CryptCATClose failed\n");
438 ok(
error_area != -2,
"Didn't expect cdf_callback() to be called (%08x, %08x)\n",
447 static WCHAR nonexistent[] = {
'd',
'e',
'a',
'd',
'b',
'e',
'e',
'f',
'.',
'c',
'd',
'f',0};
453 win_skip(
"CryptCATCDFOpen is not available\n");
459 ok(catcdf ==
NULL,
"CryptCATCDFOpen succeeded\n");
465 ok(catcdf ==
NULL,
"CryptCATCDFOpen succeeded\n");
472 ok(catcdf ==
NULL,
"CryptCATCDFOpen succeeded\n");
478 ok(!
ret,
"Expected failure\n");
484 ret = pCryptCATCDFClose(catcdf);
485 ok(!
ret,
"Expected failure\n");
493 static WCHAR basenameW[] = {
'w',
'i',
'n',
'e',
't',
'e',
's',
't',
'.',
'c',
'a',
't',0};
494 static const char basename[] =
"winetest.cat";
507 if (!pCryptCATAdminRemoveCatalog)
510 win_skip(
"CryptCATAdminRemoveCatalog is not available\n");
520 ret = pCryptCATAdminAcquireContext(&hcatadmin, &
dummy, 0);
524 win_skip(
"Not running as administrator\n");
529 hcatinfo = pCryptCATAdminAddCatalog(
NULL,
NULL,
NULL, 0);
531 ok(hcatinfo ==
NULL,
"CryptCATAdminAddCatalog succeeded\n");
535 hcatinfo = pCryptCATAdminAddCatalog(hcatadmin,
NULL,
NULL, 0);
537 ok(hcatinfo ==
NULL,
"CryptCATAdminAddCatalog succeeded\n");
543 hcatinfo = pCryptCATAdminAddCatalog(hcatadmin, tmpfileW, basenameW, 0);
546 ok(hcatinfo ==
NULL,
"CryptCATAdminAddCatalog succeeded\n");
549 if (hcatinfo !=
NULL)
550 pCryptCATAdminReleaseCatalogContext(hcatadmin, hcatinfo, 0);
553 hcatinfo = pCryptCATAdminAddCatalog(hcatadmin, tmpfileW, basenameW, 1);
555 ok(hcatinfo ==
NULL,
"CryptCATAdminAddCatalog succeeded\n");
561 hcatinfo = pCryptCATAdminAddCatalog(hcatadmin, tmpfileW,
NULL, 0);
563 ok(hcatinfo ==
NULL,
"CryptCATAdminAddCatalog succeeded\n");
573 hcatinfo = pCryptCATAdminAddCatalog(hcatadmin, tmpfileW,
NULL, 0);
582 info.wszCatalogFile[0] = 0;
583 ret = pCryptCATCatalogInfoFromContext(hcatinfo, &
info, 0);
587 ok(
info.wszCatalogFile[0] != 0,
"Expected a filename\n");
591 memset(catfileW, 0,
sizeof(catfileW));
600 hcatinfo = pCryptCATAdminAddCatalog(hcatadmin, tmpfileW, basenameW, 0);
604 lstrcatA(catfilepath,
"\\{DEADBEEF-DEAD-BEEF-DEAD-BEEFDEADBEEF}\\winetest.cat");
610 "File has wrong attributes : %08x\n", attrs);
613 info.wszCatalogFile[0] = 0;
614 ret = pCryptCATCatalogInfoFromContext(hcatinfo, &
info, 0);
616 ok(
info.wszCatalogFile[0] != 0,
"Expected a filename\n");
621 ret = pCryptCATAdminReleaseCatalogContext(hcatadmin, hcatinfo, 0);
625 ret = pCryptCATAdminRemoveCatalog(hcatadmin, catfileW, 0);
630 ret = pCryptCATAdminRemoveCatalog(hcatadmin,
info.wszCatalogFile, 0);
636 ret = pCryptCATAdminRemoveCatalog(hcatadmin, basenameW, 0);
642 ret = pCryptCATAdminReleaseContext(hcatadmin, 0);
654 static const GUID subject = {0xde351a42,0x8e59,0x11d0,{0x8c,0x47,0x00,0xc0,0x4f,0xc2,0x95,0xee}};
663 int attrcount = 0, membercount = 0;
674 trace(
"Creating the catalog file\n");
691 hcat = pCryptCATOpen(catalogW, 0, 0, 0, 0);
694 win_skip(
"CryptCATOpen on W2K can't handle catalog files with no members\n");
700 ok(
m ==
NULL,
"CryptCATEnumerateMember succeeded\n");
707 ok(!
memcmp(&
m->gSubjectType, &subject,
sizeof(subject)),
"guid differs\n");
708 ok(!
m->fdwMemberFlags,
"got %x expected 0\n",
m->fdwMemberFlags);
709 ok(
m->dwCertVersion == 0x200,
"got %x expected 0x200\n",
m->dwCertVersion);
710 ok(!
m->dwReserved,
"got %x expected 0\n",
m->dwReserved);
711 ok(
m->hReserved ==
NULL,
"got %p expected NULL\n",
m->hReserved);
714 ok(
attr ==
NULL,
"CryptCATEnumerateAttr succeeded\n");
718 ok(membercount == members,
"Expected %d members, got %d\n", members, membercount);
721 ok(
attr ==
NULL,
"CryptCATEnumerateAttr succeeded\n");
724 ok(
attr ==
NULL,
"CryptCATEnumerateAttr succeeded\n");
731 "Expected 'attr1' or 'attr2'\n");
736 ok(attrcount == attributes,
"Expected %d catalog attributes, got %d\n", attributes, attrcount);
738 ret = pCryptCATClose(hcat);
739 ok(
ret,
"CryptCATClose failed\n");
745 static const char catfileA[] =
"winetest.cat";
746 static const char cdffileA[] =
"winetest.cdf";
747 static WCHAR cdffileW[] = {
'w',
'i',
'n',
'e',
't',
'e',
's',
't',
'.',
'c',
'd',
'f',0};
752 DWORD written, attrs;
755 int attrcount, membercount;
759 win_skip(
"CryptCATCDFOpen is not available\n");
770 trace(
"No attribs and members\n");
775 ok(catcdf !=
NULL,
"CryptCATCDFOpen failed\n");
779 ret = pCryptCATCDFClose(catcdf);
794 trace(
"Only attributes\n");
803 "Expected 'attr1' or 'attr2'\n");
808 ok(attrcount == 2,
"Expected 2 attributes, got %d\n", attrcount);
810 pCryptCATCDFClose(catcdf);
816 trace(
"Only members\n");
822 while ((catmembertag = pCryptCATCDFEnumMembersByCDFTagEx(catcdf, catmembertag,
NULL, &catmember,
FALSE,
NULL)))
828 ok(membercount == 1,
"Expected 1 member, got %d\n", membercount);
830 pCryptCATCDFClose(catcdf);
835 trace(
"Attributes and members\n");
836 attrcount = membercount = 0;
843 ok(attrcount == 2,
"Expected 2 attributes, got %d\n", attrcount);
847 while ((catmembertag = pCryptCATCDFEnumMembersByCDFTagEx(catcdf, catmembertag,
NULL, &catmember,
FALSE,
NULL)))
850 ok(membercount == 1,
"Expected 1 member, got %d\n", membercount);
852 pCryptCATCDFClose(catcdf);
870#define CHECK_EXPECT(a, b) \
872 ok(a == error_area, "Expected %08x, got %08x\n", a, error_area); \
873 ok(b == local_error, "Expected %08x, got %08x\n", b, local_error); \
877#define CLEAR_EXPECT \
878 error_area = local_error = -1
881#define SET_UNEXPECTED \
882 error_area = local_error = -2
886 static const char catfileA[] =
"tempfile.cat";
887 static const char cdffileA[] =
"tempfile.cdf";
888 static WCHAR cdffileW[] = {
't',
'e',
'm',
'p',
'f',
'i',
'l',
'e',
'.',
'c',
'd',
'f',0};
889 CHAR cdf_contents[4096];
897 win_skip(
"CryptCATCDFOpen is not available\n");
910 ok(catcdf ==
NULL,
"CryptCATCDFOpen succeeded\n");
914 ok(!
DeleteFileA(catfileA),
"Didn't expect a catalog file to be created\n");
917 lstrcpyA(cdf_contents,
"[CatalogHeader]\r\n");
923 ok(catcdf ==
NULL,
"CryptCATCDFOpen succeeded\n");
926 "Expected ERROR_SHARING_VIOLATION, got %d\n",
GetLastError());
930 lstrcpyA(cdf_contents,
"[CatalogHeader]\r\n");
931 lstrcatA(cdf_contents,
"[CatalogFiles]\r\n");
932 lstrcatA(cdf_contents,
"hashme=.\\tempfile.cdf\r\n");
938 ok(catcdf ==
NULL,
"CryptCATCDFOpen succeeded\n");
941 "Expected ERROR_SHARING_VIOLATION, got %d\n",
GetLastError());
943 ok(!
DeleteFileA(catfileA),
"Didn't expect a catalog file to be created\n");
946 lstrcpyA(cdf_contents,
"[CatalogHeader]\r\n");
947 lstrcatA(cdf_contents,
"Name=\r\n");
953 ok(catcdf ==
NULL,
"CryptCATCDFOpen succeeded\n");
956 "Expected ERROR_SHARING_VIOLATION, got %d\n",
GetLastError());
958 ok(!
DeleteFileA(catfileA),
"Didn't expect a catalog file to be created\n");
961 lstrcpyA(cdf_contents,
"[CatalogHeader]\r\n");
962 lstrcatA(cdf_contents,
"Name=tempfile.cat\r\n");
970 ok(catcdf !=
NULL,
"CryptCATCDFOpen failed\n");
973 pCryptCATCDFClose(catcdf);
976 ok(
DeleteFileA(catfileA),
"Expected a catalog file to be created\n");
979 lstrcpyA(cdf_contents,
"[CatalogHeader]\r\n");
980 lstrcatA(cdf_contents,
"Name=tempfile.cat\r\n");
981 lstrcatA(cdf_contents,
"[CatalogFiles]\r\n");
982 lstrcatA(cdf_contents,
"hashme=.\\deadbeef.cdf\r\n");
990 ok(catcdf !=
NULL,
"CryptCATCDFOpen failed\n");
997 while ((catmembertag = pCryptCATCDFEnumMembersByCDFTagEx(catcdf, catmembertag,
cdf_callback, &catmember,
FALSE,
NULL))) ;
1000 pCryptCATCDFClose(catcdf);
1003 ok(
DeleteFileA(catfileA),
"Expected a catalog file to be created\n");
1006 lstrcpyA(cdf_contents,
"[CatalogHeader]\r\n");
1007 lstrcatA(cdf_contents,
"Name=tempfile.cat\r\n");
1008 lstrcatA(cdf_contents,
"[CatalogFiles]\r\n");
1009 lstrcatA(cdf_contents,
"hashme=.\\tempfile.cdf\r");
1017 ok(catcdf !=
NULL,
"CryptCATCDFOpen failed\n");
1023 catmembertag =
NULL;
1024 while ((catmembertag = pCryptCATCDFEnumMembersByCDFTagEx(catcdf, catmembertag,
cdf_callback, &catmember,
FALSE,
NULL))) ;
1026 "Expected area 0xffffffff, got %08x\n",
error_area);
1028 "Expected error 0xffffffff, got %08x\n",
local_error);
1030 pCryptCATCDFClose(catcdf);
1033 ok(
DeleteFileA(catfileA),
"Expected a catalog file to be created\n");
1036 lstrcpyA(cdf_contents,
"[CatalogHeader]\r\n");
1037 lstrcatA(cdf_contents,
"Name=tempfile.cat\r\n");
1038 lstrcatA(cdf_contents,
"[CatalogFiles]\r\n");
1039 lstrcatA(cdf_contents,
"hashme=.\\tempfile.cdf\r\n");
1040 lstrcatA(cdf_contents,
"hashme=.\\tempfile.cdf\r\n");
1048 ok(catcdf !=
NULL,
"CryptCATCDFOpen failed\n");
1054 catmembertag =
NULL;
1055 while ((catmembertag = pCryptCATCDFEnumMembersByCDFTagEx(catcdf, catmembertag,
cdf_callback, &catmember,
FALSE,
NULL))) ;
1056 pCryptCATCDFClose(catcdf);
1060 ok(
DeleteFileA(catfileA),
"Expected a catalog file to be created\n");
1063 lstrcpyA(cdf_contents,
"[CatalogHeader]\r\n");
1064 lstrcatA(cdf_contents,
"Name=tempfile.cat\r\n");
1065 lstrcatA(cdf_contents,
"CATATTR1=0x10010001:attr1\r\n");
1073 ok(catcdf !=
NULL,
"CryptCATCDFOpen failed\n");
1082 pCryptCATCDFClose(catcdf);
1085 ok(
DeleteFileA(catfileA),
"Expected a catalog file to be created\n");
1088 lstrcpyA(cdf_contents,
"[CatalogHeader]\r\n");
1089 lstrcatA(cdf_contents,
"Name=tempfile.cat\r\n");
1090 lstrcatA(cdf_contents,
"CATATTR1=0x10010001:attr1:value1\r\n");
1091 lstrcatA(cdf_contents,
"CATATTR1=0x10010001:attr1:value1\r\n");
1092 lstrcatA(cdf_contents,
"[CatalogFiles]\r\n");
1093 lstrcatA(cdf_contents,
"hashme=.\\tempfile.cdf\r\n");
1101 ok(catcdf !=
NULL,
"CryptCATCDFOpen failed\n");
1107 catmembertag =
NULL;
1108 while ((catmembertag = pCryptCATCDFEnumMembersByCDFTagEx(catcdf, catmembertag,
cdf_callback, &catmember,
FALSE,
NULL))) ;
1113 pCryptCATCDFClose(catcdf);
1117 ok(
DeleteFileA(catfileA),
"Expected a catalog file to be created\n");
1120 lstrcpyA(cdf_contents,
"[CatalogHeader]\r\n");
1121 lstrcatA(cdf_contents,
"Name=tempfile.cat\r\n");
1122 lstrcatA(cdf_contents,
"CATATTR1=0x10010001:attr1:value1\r\n");
1123 lstrcatA(cdf_contents,
"CATATTR1=0x10010001:attr2:value2\r\n");
1124 lstrcatA(cdf_contents,
"[CatalogFiles]\r\n");
1125 lstrcatA(cdf_contents,
"hashme=.\\tempfile.cdf\r\n");
1133 ok(catcdf !=
NULL,
"CryptCATCDFOpen failed\n");
1139 catmembertag =
NULL;
1140 while ((catmembertag = pCryptCATCDFEnumMembersByCDFTagEx(catcdf, catmembertag,
cdf_callback, &catmember,
FALSE,
NULL))) ;
1145 pCryptCATCDFClose(catcdf);
1149 ok(
DeleteFileA(catfileA),
"Expected a catalog file to be created\n");
1213 static const WCHAR nameW[] = {
't',
'e',
's',
't',
'.',
'e',
'x',
'e',0};
1241 ok(!
ret,
"CryptSIPPutSignedDataMsg succeeded\n");
1248 ok(!
ret,
"CryptSIPPutSignedDataMsg succeeded\n");
1255 ok(!
ret,
"CryptSIPPutSignedDataMsg succeeded\n");
1263 info.pwsFileName = (
void*)0xdeadbeef;
1315 if (!pCryptCATAdminAcquireContext)
1317 win_skip(
"CryptCATAdmin functions are not available\n");
int strcmp(const char *String1, const char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
char * strcpy(char *DstString, const char *SrcString)
static const WCHAR nameW[]
#define ERROR_INSUFFICIENT_BUFFER
BOOL WINAPI CryptReleaseContext(HCRYPTPROV hProv, DWORD dwFlags)
BOOL WINAPI CryptSIPRetrieveSubjectGuid(LPCWSTR FileName, HANDLE hFileIn, GUID *pgSubject)
static const WCHAR empty[]
#define ERROR_INVALID_PARAMETER
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
#define HeapFree(x, y, z)
#define FILE_ATTRIBUTE_NORMAL
#define WideCharToMultiByte
#define MultiByteToWideChar
#define ERROR_ACCESS_DENIED
static void cleanup(void)
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
BOOL WINAPI SetFileAttributesA(LPCSTR lpFileName, DWORD dwFileAttributes)
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
UINT WINAPI GetSystemDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
static void basename(LPCWSTR path, LPWSTR name)
BOOL WINAPI CryptCATAdminReleaseContext(HCATADMIN hCatAdmin, DWORD dwFlags)
CRYPTCATCDF *WINAPI CryptCATCDFOpen(LPWSTR pwszFilePath, PFN_CDF_PARSE_ERROR_CALLBACK pfnParseError)
CRYPTCATATTRIBUTE *WINAPI CryptCATCDFEnumCatAttributes(CRYPTCATCDF *pCDF, CRYPTCATATTRIBUTE *pPrevAttr, PFN_CDF_PARSE_ERROR_CALLBACK pfnParseError)
BOOL WINAPI CryptCATClose(HANDLE hCatalog)
HANDLE WINAPI CryptCATOpen(LPWSTR pwszFileName, DWORD fdwOpenFlags, HCRYPTPROV hProv, DWORD dwPublicVersion, DWORD dwEncodingType)
CRYPTCATMEMBER *WINAPI CryptCATEnumerateMember(HANDLE hCatalog, CRYPTCATMEMBER *prev)
BOOL WINAPI CryptCATCatalogInfoFromContext(HCATINFO hcatinfo, CATALOG_INFO *info, DWORD flags)
BOOL WINAPI CryptCATAdminCalcHashFromFileHandle(HANDLE hFile, DWORD *pcbHash, BYTE *pbHash, DWORD dwFlags)
static const GUID unknown
BOOL WINAPI CryptCATCDFClose(CRYPTCATCDF *pCDF)
LPWSTR WINAPI CryptCATCDFEnumMembersByCDFTagEx(CRYPTCATCDF *pCDF, LPWSTR pwszPrevCDFTag, PFN_CDF_PARSE_ERROR_CALLBACK pfnParseError, CRYPTCATMEMBER **ppMember, BOOL fContinueOnError, LPVOID pvReserved)
HCATINFO WINAPI CryptCATAdminAddCatalog(HCATADMIN catAdmin, PWSTR catalogFile, PWSTR selectBaseName, DWORD flags)
BOOL WINAPI CryptCATAdminReleaseCatalogContext(HCATADMIN hCatAdmin, HCATINFO hCatInfo, DWORD dwFlags)
BOOL WINAPI CryptCATAdminRemoveCatalog(HCATADMIN hCatAdmin, LPCWSTR pwszCatalogFile, DWORD dwFlags)
CRYPTCATATTRIBUTE *WINAPI CryptCATEnumerateCatAttr(HANDLE hCatalog, CRYPTCATATTRIBUTE *prev)
BOOL WINAPI CryptCATAdminAcquireContext(HCATADMIN *catAdmin, const GUID *sys, DWORD dwFlags)
CRYPTCATATTRIBUTE *WINAPI CryptCATEnumerateAttr(HANDLE hCatalog, CRYPTCATMEMBER *member, CRYPTCATATTRIBUTE *prev)
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
GLenum GLuint GLenum GLsizei const GLchar * buf
static const WCHAR emptyW[]
_Check_return_ _CRTIMP FILE *__cdecl tmpfile(void)
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
int WINAPI lstrlenA(LPCSTR lpString)
#define ERROR_FILE_NOT_FOUND
static BYTE HCRYPTKEY *static LPCWSTR
static const WCHAR nonexistent[]
static const char * contents
static CHAR CURR_DIR[MAX_PATH]
static void test_CryptCATAdminAddRemoveCatalog(void)
static CHAR catroot2[MAX_PATH]
static pCryptSIPPutSignedDataMsg pPutSignedDataMsg
static void test_cdf_parsing(void)
static void test_catalog_properties(const char *catfile, int attributes, int members)
static const BYTE test_catalog[]
static IMAGE_NT_HEADERS nt_header
static const struct @1742 dos_header
static CHAR catroot[MAX_PATH]
#define WINTRUST_GET_PROC(func)
static CRYPTCATATTRIBUTE *WINAPI * pCryptCATEnumerateAttr(HANDLE, CRYPTCATMEMBER *, CRYPTCATATTRIBUTE *)
static CRYPTCATMEMBER *WINAPI * pCryptCATEnumerateMember(HANDLE, CRYPTCATMEMBER *)
static void test_calchash(void)
static void test_context(void)
static pCryptSIPGetSignedDataMsg pGetSignedDataMsg
static const WCHAR attr2W[]
static void InitFunctionPtrs(void)
static const WCHAR attr1W[]
static void WINAPI cdf_callback(DWORD area, DWORD error, WCHAR *line)
static void test_CryptCATCDF_params(void)
static const WCHAR hashmeW[]
static void test_CryptCATOpen(void)
static CRYPTCATCDF *WINAPI * pCryptCATCDFOpen(LPWSTR, PFN_CDF_PARSE_ERROR_CALLBACK)
static const CHAR test_cdf[]
static CRYPTCATATTRIBUTE *WINAPI * pCryptCATCDFEnumCatAttributes(CRYPTCATCDF *, CRYPTCATATTRIBUTE *, PFN_CDF_PARSE_ERROR_CALLBACK)
#define CHECK_EXPECT(a, b)
static CRYPTCATATTRIBUTE *WINAPI * pCryptCATEnumerateCatAttr(HANDLE, CRYPTCATATTRIBUTE *)
static CRYPTCATMEMBER LPVOID
static void test_sip(void)
static char selfname[MAX_PATH]
static void create_cdf_file(const CHAR *filename, const CHAR *contents)
static void test_create_catalog_file(void)
#define CRYPTCAT_E_CDF_TAGNOTFOUND
#define CRYPTCAT_E_AREA_ATTRIBUTE
#define CRYPTCAT_E_CDF_MEMBER_FILENOTFOUND
#define CRYPTCAT_E_AREA_MEMBER
#define CRYPTCAT_E_AREA_HEADER
#define CRYPTCAT_E_CDF_MEMBER_FILE_PATH
#define CRYPTCAT_E_CDF_ATTR_TOOFEWVALUES
void(WINAPI * PFN_CDF_PARSE_ERROR_CALLBACK)(DWORD, DWORD, WCHAR *)
BOOL(WINAPI * pCryptSIPGetSignedDataMsg)(SIP_SUBJECTINFO *, DWORD *, DWORD, DWORD *, BYTE *)
BOOL(WINAPI * pCryptSIPPutSignedDataMsg)(SIP_SUBJECTINFO *, DWORD, DWORD *, DWORD, BYTE *)
struct SIP_SUBJECTINFO_ SIP_SUBJECTINFO
#define FILE_ATTRIBUTE_READONLY
#define FILE_ATTRIBUTE_SYSTEM
#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
#define IMAGE_SUBSYSTEM_WINDOWS_CUI
#define IMAGE_NT_OPTIONAL_HDR_MAGIC
#define IMAGE_FILE_EXECUTABLE_IMAGE
#define IMAGE_FILE_MACHINE_I386
struct _IMAGE_OPTIONAL_HEADER IMAGE_OPTIONAL_HEADER
#define IMAGE_NT_SIGNATURE
#define IMAGE_DOS_SIGNATURE
static Real area(Real A[2], Real B[2], Real C[2])
_CRT_RESTORE_GCC_WARNINGS _CRT_DISABLE_GCC_WARNINGS _Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
int winetest_get_mainargs(char ***pargv)
#define INVALID_FILE_ATTRIBUTES
DWORD WINAPI GetLastError(void)
#define X509_ASN_ENCODING
#define PKCS_7_ASN_ENCODING
#define ERROR_SHARING_VIOLATION
#define ERROR_PATH_NOT_FOUND