42 if (!pCryptEncodeObjectEx)
44 win_skip(
"CryptEncodeObjectEx() is not available. Skipping the encodeFinancialCriteria tests\n");
74 if (!pCryptDecodeObjectEx)
76 win_skip(
"CryptDecodeObjectEx() is not available. Skipping the decodeSPCFinancialCriteria tests\n");
98static WCHAR url[] = {
'h',
't',
't',
'p',
':',
'/',
'/',
'w',
'i',
'n',
'e',
'h',
'q',
'.',
1040x80,0x11,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x69,0x6e,0x65,0x68,0x71,
1070xa2,0x14,0x80,0x12,0x00,0x68,0x00,0x74,0x00,0x74,0x00,0x70,0x00,0x3a,0x00,
1080x2f,0x00,0x2f,0x22,0x6f,0x57,0x5b };
1100xa1,0x14,0x04,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1110x00,0x00,0x00,0x00,0x00,0x04,0x00 };
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 };
124 if (!pCryptEncodeObjectEx)
126 win_skip(
"CryptEncodeObjectEx() is not available. Skipping the encodeSPCLink tests\n");
154 "Expected CRYPT_E_INVALID_IA5_STRING, got %08x\n",
GetLastError());
158 ok(
size == 0,
"Expected size 0, got %d\n",
size);
192 U(
link).Moniker.SerializedData.pbData =
data;
193 U(
link).Moniker.SerializedData.cbData =
sizeof(
data);
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 };
216 if (!pCryptDecodeObjectEx)
218 win_skip(
"CryptDecodeObjectEx() is not available. Skipping the decodeSPCLink tests\n");
230 "Expected SPC_URL_LINK_CHOICE, got %d\n",
link->dwLinkChoice);
231 ok(
lstrlenW(
U(*link).pwszUrl) == 0,
"Expected empty string\n");
242 "Expected SPC_URL_LINK_CHOICE, got %d\n",
link->dwLinkChoice);
254 "Expected SPC_FILE_LINK_CHOICE, got %d\n",
link->dwLinkChoice);
268 "Expected SPC_MONIKER_LINK_CHOICE, got %d\n",
link->dwLinkChoice);
270 sizeof(emptyMoniker.
ClassId)),
"Unexpected value\n");
271 ok(
U(*link).Moniker.SerializedData.cbData == 0,
272 "Expected no serialized data\n");
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);
292 "Unexpected value\n");
302 "Expected CRYPT_E_BAD_ENCODE, got %08x\n",
GetLastError());
3090x30,0x06,0xa0,0x04,0xa2,0x02,0x80,0x00 };
3110x30,0x0a,0x03,0x02,0x00,0x01,0xa0,0x04,0xa2,0x02,0x80,0x00 };
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 };
324 if (!pCryptEncodeObjectEx)
326 win_skip(
"CryptEncodeObjectEx() is not available. Skipping the encodeSPCPEImage tests\n");
337 "Unexpected value\n");
357 "Unexpected value\n");
368 skip(
"SPC_PE_IMAGE_DATA_STRUCT not supported\n");
376 "Unexpected value\n");
390 "Unexpected value\n");
416 "Unexpected value\n");
423 static const WCHAR emptyString[] = { 0 };
429 if (!pCryptDecodeObjectEx)
431 win_skip(
"CryptDecodeObjectEx() is not available. Skipping the decodeSPCPEImage tests\n");
442 ok(imageData->
Flags.
cbData == 0,
"Expected empty flags, got %d\n",
444 ok(imageData->
pFile ==
NULL,
"Expected no file\n");
455 "Unexpected flags size %d\n", imageData->
Flags.
cbData);
458 "Unexpected flags\n");
459 ok(imageData->
pFile ==
NULL,
"Expected no file\n");
469 ok(imageData->
Flags.
cbData == 0,
"Expected empty flags, got %d\n",
472 if (imageData->
pFile)
475 "Expected SPC_FILE_LINK_CHOICE, got %d\n",
478 "Unexpected file\n");
490 "Unexpected flags size %d\n", imageData->
Flags.
cbData);
493 "Unexpected flags\n");
495 if (imageData->
pFile)
498 "Expected SPC_FILE_LINK_CHOICE, got %d\n",
501 "Unexpected file\n");
513 "Unexpected flags size %d\n", imageData->
Flags.
cbData);
516 "Unexpected flags\n");
518 if (imageData->
pFile)
521 "Expected SPC_FILE_LINK_CHOICE, got %d\n",
524 "Unexpected file\n");
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 };
5370x30,0x0b,0x1e,0x06,0x00,0x66,0x00,0x6f,0x00,0x6f,0x02,0x01,0x00 };
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,
555 if (!pCryptEncodeObjectEx)
557 win_skip(
"CryptEncodeObjectEx() is not available. Skipping the encodeCatMemberInfo tests\n");
568 "Unexpected value\n");
592 "Unexpected value\n");
604 if (!pCryptDecodeObjectEx)
606 win_skip(
"CryptDecodeObjectEx() is not available. Skipping the decodeCatMemberInfo tests\n");
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);
631 "unexpected pwszSubjGuid\n");
632 ok(
info->dwCertVersion == 0,
"expected dwCertVersion == 0, got %d\n",
633 info->dwCertVersion);
644 "unexpected pwszSubjGuid\n");
645 ok(
info->dwCertVersion == 0,
"expected dwCertVersion == 0, got %d\n",
646 info->dwCertVersion);
6520x30,0x07,0x1e,0x00,0x02,0x01,0x00,0x04,0x00 };
6540x30,0x0d,0x1e,0x06,0x00,0x66,0x00,0x6f,0x00,0x6f,0x02,0x01,0x00,0x04,0x00 };
6560x30,0x0a,0x1e,0x00,0x02,0x04,0xf0,0x0d,0xd0,0x0d,0x04,0x00 };
6580x30,0x0b,0x1e,0x00,0x02,0x01,0x00,0x04,0x04,0x01,0x02,0x03,0x04 };
664 static WCHAR foo[] = {
'f',
'o',
'o',0 };
678 "Unexpected value\n");
689 "Unexpected value\n");
693 value.fdwFlags = 0xf00dd00d;
701 "Unexpected value\n");
714 "Unexpected value\n");
734 ok(!
value->pwszTag || !
value->pwszTag[0],
"expected empty pwszTag\n");
735 ok(
value->fdwFlags == 0,
"expected fdwFlags == 0, got %08x\n",
737 ok(
value->Value.cbData == 0,
"expected 0-length value, got %d\n",
738 value->Value.cbData);
750 "unexpected pwszTag\n");
751 ok(
value->fdwFlags == 0,
"expected fdwFlags == 0, got %08x\n",
753 ok(
value->Value.cbData == 0,
"expected 0-length value, got %d\n",
754 value->Value.cbData);
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);
780 ok(!
value->pwszTag || !
value->pwszTag[0],
"expected empty pwszTag\n");
781 ok(
value->fdwFlags == 0,
"expected fdwFlags == 0, got %08x\n",
783 ok(
value->Value.cbData ==
sizeof(
aVal),
"unexpected size %d\n",
784 value->Value.cbData);
786 "unexpected value\n");
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 };
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 };
831 "unexpected value\n");
835 memset(&moreInfo, 0,
sizeof(moreInfo));
836 info.pMoreInfo = &moreInfo;
850 "unexpected size %d\n",
size);
852 "unexpected value\n");
856 info.pPublisherInfo = &moreInfo;
863 "unexpected size %d\n",
size);
865 "unexpected value\n");
882 ok(!
info->pwszProgramName,
"expected NULL\n");
883 ok(!
info->pMoreInfo,
"expected NULL\n");
884 ok(!
info->pPublisherInfo,
"expected NULL\n");
894 progName),
"unexpected program name\n");
895 ok(!
info->pMoreInfo,
"expected NULL\n");
896 ok(!
info->pPublisherInfo,
"expected NULL\n");
905 ok(!
info->pwszProgramName,
"expected NULL\n");
906 ok(
info->pMoreInfo !=
NULL,
"expected a value for pMoreInfo\n");
910 "unexpected link choice %d\n",
info->pMoreInfo->dwLinkChoice);
912 "unexpected link value\n");
914 ok(!
info->pPublisherInfo,
"expected NULL\n");
923 ok(!
info->pwszProgramName,
"expected NULL\n");
924 ok(!
info->pMoreInfo,
"expected NULL\n");
926 "expected a value for pPublisherInfo\n");
927 if (
info->pPublisherInfo)
930 "unexpected link choice %d\n",
931 info->pPublisherInfo->dwLinkChoice);
933 "unexpected link value\n");
942 pCryptDecodeObjectEx = (
void*)
GetProcAddress(hCrypt32,
"CryptDecodeObjectEx");
943 pCryptEncodeObjectEx = (
void*)
GetProcAddress(hCrypt32,
"CryptEncodeObjectEx");
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define GetProcAddress(x, y)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLuint GLenum GLsizei const GLchar * buf
HLOCAL NTAPI LocalFree(HLOCAL hMem)
static const BYTE onlyEmptyFilePEImage[]
static const BYTE catNameValueWithFlags[]
static const BYTE emptyCatMemberInfo[]
static void test_encodeSPCLink(void)
static void test_decodeSpOpusInfo(void)
static void test_encodeSPCPEImage(void)
static const BYTE badMonikerSPCLink[]
static const BYTE emptyCatNameValue[]
static const BYTE spOpusInfoWithProgramName[]
static void test_decodeSPCFinancialCriteria(void)
static void test_encodeCatNameValue(void)
static void test_decodeSPCLink(void)
static const BYTE flagsAndEmptyFilePEImage[]
static const BYTE catNameValueWithTag[]
static const BYTE catMemberInfoWithGuid[]
static const BYTE spOpusInfoWithMoreInfo[]
static void test_encodeSpOpusInfo(void)
static const BYTE fileSPCLink[]
static const BYTE PCRYPT_DECODE_PARA
static void test_decodeSPCPEImage(void)
static void test_decodeCatMemberInfo(void)
static void test_encodeSPCFinancialCriteria(void)
static const BYTE catMemberInfoWithSillyGuid[]
static const BYTE void DWORD *static const void PCRYPT_ENCODE_PARA
static const BYTE emptyURLSPCLink[]
static const BYTE flagsAndFilePEImage[]
static const WCHAR progName[]
static const BYTE trueCriteria[]
static const BYTE monikerSPCLink[]
static const BYTE spOpusInfoWithPublisherInfo[]
static void test_encodeCatMemberInfo(void)
static const BYTE emptySequence[]
static const BYTE void DWORD *static const void void DWORD *static const BYTE falseCriteria[]
static const BYTE onlyFlagsPEImage[]
static const BYTE emptyMonikerSPCLink[]
static const BYTE catNameValueWithValue[]
static void test_decodeCatNameValue(void)
static const WCHAR nihongoURL[]
static const BYTE urlSPCLink[]
BOOL fFinancialInfoAvailable
DWORD WINAPI GetLastError(void)
#define X509_ASN_ENCODING
#define CRYPT_DECODE_ALLOC_FLAG
#define CRYPT_ENCODE_ALLOC_FLAG
#define CRYPT_E_BAD_ENCODE
#define CRYPT_E_INVALID_IA5_STRING
BYTE SPC_UUID[SPC_UUID_LENGTH]
#define SPC_PE_IMAGE_DATA_STRUCT
#define SPC_SP_OPUS_INFO_STRUCT
#define SPC_FILE_LINK_CHOICE
#define CAT_MEMBERINFO_STRUCT
#define SPC_MONIKER_LINK_CHOICE
#define SPC_FINANCIAL_CRITERIA_STRUCT
#define CAT_NAMEVALUE_STRUCT
#define SPC_URL_LINK_CHOICE