39#define CATADMIN_MAGIC 0x43415441
40#define CRYPTCAT_MAGIC 0x43415443
41#define CATINFO_MAGIC 0x43415449
101 {
'\\',
'c',
'a',
't',
'r',
'o',
'o',
't',0};
103 {
'%',
's',
'\\',
'{',
'%',
'0',
'8',
'x',
'-',
'%',
'0',
'4',
'x',
'-',
'%',
'0',
104 '4',
'x',
'-',
'%',
'0',
'2',
'x',
'%',
'0',
'2',
'x',
'-',
'%',
'0',
'2',
'x',
105 '%',
'0',
'2',
'x',
'%',
'0',
'2',
'x',
'%',
'0',
'2',
'x',
'%',
'0',
'2',
'x',
106 '%',
'0',
'2',
'x',
'}',0};
107 static const GUID defsys =
108 {0x127d0a1d,0x4ef2,0x11d1,{0x86,0x08,0x00,0xc0,0x4f,0xc2,0x95,0xee}};
132 if (!sys) sys = &defsys;
134 sys->Data3, sys->Data4[0], sys->Data4[1], sys->Data4[2],
135 sys->Data4[3], sys->Data4[4], sys->Data4[5], sys->Data4[6],
176 FIXME(
"NULL basename not handled\n");
285 static const WCHAR globW[] = {
'\\',
'*',
'.',
'c',
'a',
't',0};
294 TRACE(
"%p %p %d %x %p\n", hCatAdmin, pbHash, cbHash,
dwFlags, phPrevCatInfo);
301 if (phPrevCatInfo) prev = *phPrevCatInfo;
362 if (
member->pIndirectData->Digest.cbData != cbHash)
364 WARN(
"amount of hash bytes differs: %u/%u\n",
member->pIndirectData->Digest.cbData, cbHash);
367 if (!
memcmp(
member->pIndirectData->Digest.pbData, pbHash, cbHash))
488 if (pwszCatalogFile && pwszCatalogFile[0] != 0 &&
489 !
wcschr(pwszCatalogFile,
'\\') && !
wcschr(pwszCatalogFile,
'/') &&
490 !
wcschr(pwszCatalogFile,
':'))
544 TRACE(
"(%p)\n", hCatalog);
636 FIXME(
"%p, %p\n", hCatalog, prev);
657 TRACE(
"%p, %p\n", hCatalog, prev);
673 member->cbStruct =
sizeof(*member);
678 member->fdwMemberFlags = 0;
680 member->dwCertVersion =
cc->inner->dwVersion;
682 else member->dwReserved++;
684 if (
member->dwReserved >=
cc->inner->cCTLEntry)
691 entry = &
cc->inner->rgCTLEntry[
cc->inner->cCTLEntry -
member->dwReserved - 1];
693 member->sEncodedIndirectData.cbData =
member->sEncodedMemberInfo.cbData = 0;
694 member->sEncodedIndirectData.pbData =
member->sEncodedMemberInfo.pbData =
NULL;
698 for (
i = 0;
i <
entry->cAttribute;
i++)
702 if (
attr->cValue != 1)
704 ERR(
"Can't handle attr->cValue of %u\n",
attr->cValue);
712 member->sEncodedMemberInfo.cbData =
attr->rgValue->cbData;
713 member->sEncodedMemberInfo.pbData =
attr->rgValue->pbData;
727 member->dwCertVersion =
mi->dwCertVersion;
742 member->sEncodedIndirectData.cbData =
attr->rgValue->cbData;
743 member->sEncodedIndirectData.pbData =
attr->rgValue->pbData;
756 FIXME(
"unhandled object id \"%s\"\n",
attr->pszObjId);
759 if (!
member->sEncodedMemberInfo.cbData || !
member->sEncodedIndirectData.cbData)
761 ERR(
"Corrupted catalog entry?\n");
766 if (
member->pwszReferenceTag)
771 if (!
member->pwszReferenceTag)
777 for (
i = 0;
i <
member->pIndirectData->Digest.cbData;
i++)
781 sub =
member->pIndirectData->Digest.pbData[
i] >> 4;
782 member->pwszReferenceTag[
i * 2] = (sub < 10 ?
'0' + sub :
'A' + sub - 10);
783 sub =
member->pIndirectData->Digest.pbData[
i] & 0xf;
784 member->pwszReferenceTag[
i * 2 + 1] = (sub < 10 ?
'0' + sub :
'A' + sub - 10);
786 member->pwszReferenceTag[
i * 2] = 0;
917 for (
i = 0;
i <
cc->attr_count;
i++)
935 for (
i = 0;
i <
cc->attr_count;
i++)
975 FIXME(
"(%p %p %p) stub\n", pSubjectInfo, pcbIndirectData, pIndirectData);
986 FIXME(
"(%p) stub\n", pCDF);
998 FIXME(
"(%p %p %p) stub\n", pCDF, pPrevAttr, pfnParseError);
1011 FIXME(
"(%p %s %p %p %d %p) stub\n", pCDF,
debugstr_w(pwszPrevCDFTag), pfnParseError,
1030 BYTE *pbSignedDataMsg)
1036 TRACE(
"(%p %p %d %p %p)\n", pSubjectInfo, pdwEncodingType, dwIndex,
1037 pcbSignedDataMsg, pbSignedDataMsg);
1049 if (!pbSignedDataMsg)
1057 switch (
cert.wCertificateType)
1061 *pcbSignedDataMsg =
cert.dwLength;
1064 WARN(
"unknown certificate type %d\n",
cert.wCertificateType);
1086 if (*pcbSignedDataMsg < pCert->
dwLength)
1088 *pcbSignedDataMsg = pCert->
dwLength;
1095 *pcbSignedDataMsg = pCert->
dwLength;
1105 WARN(
"don't know what to do for encoding type %d\n",
1107 *pdwEncodingType = 0;
1146 memcpy(
cert->bCertificate, pbSignedDataMsg, cbSignedDataMsg);
1156#define cfhead_Signature (0x00)
1157#define cfhead_CabinetSize (0x08)
1158#define cfhead_MinorVersion (0x18)
1159#define cfhead_MajorVersion (0x19)
1160#define cfhead_Flags (0x1E)
1161#define cfhead_SIZEOF (0x24)
1162#define cfheadext_HeaderReserved (0x00)
1163#define cfheadext_SIZEOF (0x04)
1164#define cfsigninfo_CertOffset (0x04)
1165#define cfsigninfo_CertSize (0x08)
1166#define cfsigninfo_SIZEOF (0x0C)
1169#define cfheadRESERVE_PRESENT (0x0004)
1172#define EndGetI32(a) ((((a)[3])<<24)|(((a)[2])<<16)|(((a)[1])<<8)|((a)[0]))
1173#define EndGetI16(a) ((((a)[1])<<8)|((a)[0]))
1189 BYTE *pbSignedDataMsg)
1192 LONG base_offset, cabsize;
1195 DWORD cert_offset, cert_size, dwRead;
1197 TRACE(
"(%p %p %d %p %p)\n", pSubjectInfo, pdwEncodingType, dwIndex,
1198 pcbSignedDataMsg, pbSignedDataMsg);
1205 TRACE(
"seek error\n");
1210 if ((cabsize == -1) || (base_offset == -1) ||
1213 TRACE(
"seek error\n");
1221 TRACE(
"reading header failed\n");
1228 WARN(
"cabinet signature not present\n");
1238 WARN(
"cabinet format version > 1.3\n");
1247 TRACE(
"no header present, not signed\n");
1254 ERR(
"bunk reserve-sizes?\n");
1261 TRACE(
"no header_resv, not signed\n");
1266 TRACE(
"header_resv too small, not signed\n");
1270 if (header_resv > 60000)
1272 WARN(
"WARNING; header reserved space > 60000\n");
1278 ERR(
"couldn't read reserve\n");
1283 TRACE(
"cert_offset: %d\n", cert_offset);
1285 TRACE(
"cert_size: %d\n", cert_size);
1288 if (cert_offset > cabsize || cert_size > cabsize ||
1289 cert_offset + cert_size > cabsize)
1291 WARN(
"offset beyond file, not attempting to read\n");
1296 if (!pbSignedDataMsg)
1298 *pcbSignedDataMsg = cert_size;
1301 if (*pcbSignedDataMsg < cert_size)
1303 *pcbSignedDataMsg = cert_size;
1309 ERR(
"couldn't seek to cert location\n");
1312 if (!
ReadFile(pSubjectInfo->
hFile, pbSignedDataMsg, cert_size, &dwRead,
1313 NULL) || dwRead != cert_size)
1315 ERR(
"couldn't read cert\n");
1331 BYTE *pbSignedDataMsg)
1335 TRACE(
"(%p %p %d %p %p)\n", pSubjectInfo, pdwEncodingType, dwIndex,
1336 pcbSignedDataMsg, pbSignedDataMsg);
1338 if (!pbSignedDataMsg)
1347 if (*pcbSignedDataMsg <
len)
1349 *pcbSignedDataMsg =
len;
1356 pcbSignedDataMsg,
NULL);
1366 0x00,0xC0,0x4F,0xC2,0x95,0xEE } };
1368 0x00,0xC0,0x4F,0xC2,0x95,0xEE } };
1370 0x00,0xC0,0x4F,0xC2,0x95,0xEE }};
1380 TRACE(
"(%p %p %d %p %p)\n", pSubjectInfo, pdwEncodingType, dwIndex,
1381 pcbSignedDataMsg, pbSignedDataMsg);
1391 dwIndex, pcbSignedDataMsg, pbSignedDataMsg);
1394 dwIndex, pcbSignedDataMsg, pbSignedDataMsg);
1397 dwIndex, pcbSignedDataMsg, pbSignedDataMsg);
1400 FIXME(
"unimplemented for subject type %s\n",
1415 TRACE(
"(%p %d %p %d %p)\n", pSubjectInfo, pdwEncodingType, pdwIndex,
1416 cbSignedDataMsg, pbSignedDataMsg);
1425 pdwIndex, cbSignedDataMsg, pbSignedDataMsg);
1427 FIXME(
"unimplemented for subject type %s\n",
1439 FIXME(
"(%p %d) stub\n", pSubjectInfo, dwIndex);
1450 FIXME(
"(%p %p) stub\n", pSubjectInfo, pIndirectData);
#define WIN_CERT_TYPE_PKCS_SIGNED_DATA
int strcmp(const char *String1, const char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
BOOL WINAPI CryptDecodeObject(DWORD dwCertEncodingType, LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, void *pvStructInfo, DWORD *pcbStructInfo)
#define ERROR_INSUFFICIENT_BUFFER
BOOL WINAPI CryptCreateHash(HCRYPTPROV hProv, ALG_ID Algid, HCRYPTKEY hKey, DWORD dwFlags, HCRYPTHASH *phHash)
BOOL WINAPI CryptGetHashParam(HCRYPTHASH hHash, DWORD dwParam, BYTE *pbData, DWORD *pdwDataLen, DWORD dwFlags)
BOOL WINAPI CryptDestroyHash(HCRYPTHASH hHash)
BOOL WINAPI CryptReleaseContext(HCRYPTPROV hProv, DWORD dwFlags)
BOOL WINAPI CryptHashData(HCRYPTHASH hHash, const BYTE *pbData, DWORD dwDataLen, DWORD dwFlags)
BOOL WINAPI CryptAcquireContextW(HCRYPTPROV *phProv, LPCWSTR pszContainer, LPCWSTR pszProvider, DWORD dwProvType, DWORD dwFlags)
HCRYPTMSG WINAPI CryptMsgOpenToDecode(DWORD dwMsgEncodingType, DWORD dwFlags, DWORD dwMsgType, HCRYPTPROV_LEGACY hCryptProv, PCERT_INFO pRecipientInfo, PCMSG_STREAM_INFO pStreamInfo)
BOOL WINAPI CryptMsgGetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, DWORD dwIndex, void *pvData, DWORD *pcbData)
BOOL WINAPI CryptMsgUpdate(HCRYPTMSG hCryptMsg, const BYTE *pbData, DWORD cbData, BOOL fFinal)
BOOL WINAPI CryptMsgClose(HCRYPTMSG hCryptMsg)
BOOL WINAPI CryptSIPRetrieveSubjectGuid(LPCWSTR FileName, HANDLE hFileIn, GUID *pgSubject)
#define ERROR_CALL_NOT_IMPLEMENTED
#define ERROR_INVALID_PARAMETER
#define INVALID_SET_FILE_POINTER
#define ReadFile(a, b, c, d, e)
#define INVALID_HANDLE_VALUE
#define HeapFree(x, y, z)
static DWORD DWORD * dwLength
BOOL WINAPI ImageGetCertificateData(HANDLE handle, DWORD Index, LPWIN_CERTIFICATE Certificate, PDWORD RequiredLength)
BOOL WINAPI ImageAddCertificate(HANDLE FileHandle, LPWIN_CERTIFICATE Certificate, PDWORD Index)
BOOL WINAPI ImageGetCertificateHeader(HANDLE handle, DWORD index, LPWIN_CERTIFICATE pCert)
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
BOOL WINAPI FindClose(HANDLE hFindFile)
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
static const WCHAR slashW[]
CRYPTCATATTRIBUTE *WINAPI CryptCATGetAttrInfo(HANDLE hCatalog, CRYPTCATMEMBER *member, LPWSTR tag)
BOOL WINAPI CryptSIPPutSignedDataMsg(SIP_SUBJECTINFO *pSubjectInfo, DWORD pdwEncodingType, DWORD *pdwIndex, DWORD cbSignedDataMsg, BYTE *pbSignedDataMsg)
BOOL WINAPI CryptCATAdminReleaseContext(HCATADMIN hCatAdmin, DWORD dwFlags)
CRYPTCATCDF *WINAPI CryptCATCDFOpen(LPWSTR pwszFilePath, PFN_CDF_PARSE_ERROR_CALLBACK pfnParseError)
static HCATINFO create_catinfo(const WCHAR *filename)
BOOL WINAPI CryptCATAdminAcquireContext2(HCATADMIN *catAdmin, const GUID *sys, const WCHAR *algorithm, const CERT_STRONG_SIGN_PARA *policy, DWORD flags)
CRYPTCATATTRIBUTE *WINAPI CryptCATCDFEnumCatAttributes(CRYPTCATCDF *pCDF, CRYPTCATATTRIBUTE *pPrevAttr, PFN_CDF_PARSE_ERROR_CALLBACK pfnParseError)
struct _CAB_SIGNINFO * PCAB_SIGNINFO
BOOL WINAPI CryptCATClose(HANDLE hCatalog)
HANDLE WINAPI CryptCATOpen(LPWSTR pwszFileName, DWORD fdwOpenFlags, HCRYPTPROV hProv, DWORD dwPublicVersion, DWORD dwEncodingType)
CRYPTCATATTRIBUTE *WINAPI CryptCATGetCatAttrInfo(HANDLE hCatalog, LPWSTR tag)
#define cfheadext_HeaderReserved
CRYPTCATMEMBER *WINAPI CryptCATEnumerateMember(HANDLE hCatalog, CRYPTCATMEMBER *prev)
BOOL WINAPI CryptCATCatalogInfoFromContext(HCATINFO hcatinfo, CATALOG_INFO *info, DWORD flags)
#define cfheadRESERVE_PRESENT
#define cfsigninfo_CertSize
BOOL WINAPI CryptCATAdminCalcHashFromFileHandle(HANDLE hFile, DWORD *pcbHash, BYTE *pbHash, DWORD dwFlags)
static CTL_INFO * decode_inner_content(HANDLE hmsg, DWORD encoding, DWORD *len)
static const GUID unknown
#define cfhead_MajorVersion
#define cfsigninfo_CertOffset
BOOL WINAPI CryptCATCDFClose(CRYPTCATCDF *pCDF)
static BOOL WINTRUST_GetSignedMsgFromCabFile(SIP_SUBJECTINFO *pSubjectInfo, DWORD *pdwEncodingType, DWORD dwIndex, DWORD *pcbSignedDataMsg, BYTE *pbSignedDataMsg)
LPWSTR WINAPI CryptCATCDFEnumMembersByCDFTagEx(CRYPTCATCDF *pCDF, LPWSTR pwszPrevCDFTag, PFN_CDF_PARSE_ERROR_CALLBACK pfnParseError, CRYPTCATMEMBER **ppMember, BOOL fContinueOnError, LPVOID pvReserved)
BOOL WINAPI CryptSIPRemoveSignedDataMsg(SIP_SUBJECTINFO *pSubjectInfo, DWORD dwIndex)
#define cfhead_MinorVersion
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)
BOOL WINAPI CryptSIPGetSignedDataMsg(SIP_SUBJECTINFO *pSubjectInfo, DWORD *pdwEncodingType, DWORD dwIndex, DWORD *pcbSignedDataMsg, BYTE *pbSignedDataMsg)
BOOL WINAPI CryptCATAdminResolveCatalogPath(HCATADMIN hcatadmin, WCHAR *catalog_file, CATALOG_INFO *info, DWORD flags)
CRYPTCATATTRIBUTE *WINAPI CryptCATEnumerateCatAttr(HANDLE hCatalog, CRYPTCATATTRIBUTE *prev)
BOOL WINAPI CryptSIPCreateIndirectData(SIP_SUBJECTINFO *pSubjectInfo, DWORD *pcbIndirectData, SIP_INDIRECT_DATA *pIndirectData)
BOOL WINAPI CryptCATAdminAcquireContext(HCATADMIN *catAdmin, const GUID *sys, DWORD dwFlags)
static BOOL WINTRUST_GetSignedMsgFromPEFile(SIP_SUBJECTINFO *pSubjectInfo, DWORD *pdwEncodingType, DWORD dwIndex, DWORD *pcbSignedDataMsg, BYTE *pbSignedDataMsg)
#define cfsigninfo_SIZEOF
BOOL WINAPI CryptSIPVerifyIndirectData(SIP_SUBJECTINFO *pSubjectInfo, SIP_INDIRECT_DATA *pIndirectData)
HCATINFO WINAPI CryptCATAdminEnumCatalogFromHash(HCATADMIN hCatAdmin, BYTE *pbHash, DWORD cbHash, DWORD dwFlags, HCATINFO *phPrevCatInfo)
CRYPTCATATTRIBUTE *WINAPI CryptCATEnumerateAttr(HANDLE hCatalog, CRYPTCATMEMBER *member, CRYPTCATATTRIBUTE *prev)
CRYPTCATMEMBER *WINAPI CryptCATGetMemberInfo(HANDLE hCatalog, LPWSTR tag)
static BOOL WINTRUST_PutSignedMsgToPEFile(SIP_SUBJECTINFO *pSubjectInfo, DWORD pdwEncodingType, DWORD *pdwIndex, DWORD cbSignedDataMsg, BYTE *pbSignedDataMsg)
static const GUID catGUID
static BOOL WINTRUST_GetSignedMsgFromCatFile(SIP_SUBJECTINFO *pSubjectInfo, DWORD *pdwEncodingType, DWORD dwIndex, DWORD *pcbSignedDataMsg, BYTE *pbSignedDataMsg)
static const GUID cabGUID
struct _CAB_SIGNINFO CAB_SIGNINFO
WDF_INTERRUPT_POLICY policy
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
NTSYSAPI NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING, GUID *)
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
#define memcpy(s1, s2, n)
static LPCSTR DWORD void * pvReserved
static CHAR catroot[MAX_PATH]
#define CRYPTCAT_OPEN_CREATENEW
#define CRYPTCAT_OPEN_ALWAYS
void(WINAPI * PFN_CDF_PARSE_ERROR_CALLBACK)(DWORD, DWORD, WCHAR *)
#define CRYPTCAT_OPEN_EXISTING
#define FILE_ATTRIBUTE_SYSTEM
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
static int sum(int x_, int y_)
#define FIELD_OFFSET(t, f)
DWORD WINAPI GetLastError(void)
#define CRYPT_VERIFYCONTEXT
#define CMSG_ATTR_CERT_COUNT_PARAM
_In_ DWORD dwEncodingType
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
#define X509_ASN_ENCODING
#define CMSG_INNER_CONTENT_TYPE_PARAM
static const WCHAR MS_DEF_PROV_W[]
#define PKCS_7_ASN_ENCODING
#define CMSG_ATTR_CERT_PARAM
#define CMSG_CONTENT_PARAM
#define CRYPT_E_NOT_FOUND
#define CRYPT_E_ATTRIBUTES_MISSING
#define WIN_CERT_TYPE_X509
#define WIN_CERT_REVISION_2_0
#define CAT_MEMBERINFO_OBJID
#define SPC_INDIRECT_DATA_OBJID