43 const BYTE *encodedContext,
DWORD cbEncodedContext,
DWORD contextPropID,
50 omitHashes, pbElement, pcbElement);
68 }
while (
ret && prop != 0);
72 *pcbElement = bytesNeeded;
75 else if (*pcbElement < bytesNeeded)
77 *pcbElement = bytesNeeded;
120 pbElement += propSize;
128 }
while (
ret && prop != 0);
132 hdr->propID = contextPropID;
134 hdr->cb = cbEncodedContext;
136 encodedContext, cbEncodedContext);
197 else if (!
hdr->propID)
204 else if (
hdr->unknown != 1)
209 else if (
hdr->propID == propID)
227 if (cbElement < hdr->
cb)
232 else if (
hdr->unknown != 1)
271 hdr->propID, 0, pbElement);
280 hdr->propID, 0, pbElement);
378 while (!noMoreProps &&
ret)
399 pbElement +=
hdr->cb;
408 *pdwContentType =
type;
439 ret = read_func(
handle, fileHeaderBuf,
sizeof(fileHeaderBuf), &
read);
444 else if (
read !=
sizeof(fileHeaderBuf))
456 if (
ret &&
read ==
sizeof(propHdr))
458 if (contextInterface &&
context &&
505 if (!contextInterface)
507 WARN(
"prop id %d before a context id\n",
522 if (contextInterface &&
context)
565 reader->current += *bytesRead;
648 static const BYTE fileTrailer[12] = { 0 };
675 ret = output(
handle, fileTrailer,
sizeof(fileTrailer));
902 TRACE(
"(%p, %08x, %d, %d, %p, %08x)\n", hCertStore,
920 WARN(
"unimplemented for %d\n", dwSaveAs);
942 WARN(
"unimplemented for %d\n", dwSaveTo);
961 TRACE(
"(%p, %p, %d, %08x, %08x, %08x, %p, %p)\n", hCertStore,
989 if (contextInterface)
996 *pdwContentType =
type;
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
BOOL(WINAPI * SerializeElementFunc)(const void *context, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement)
BOOL CRYPT_AsnEncodeCMSSignedInfo(CRYPT_SIGNED_INFO *, void *pvData, DWORD *pcbData) DECLSPEC_HIDDEN
#define CERT_CERT_PROP_ID
static context_t * context_from_ptr(const void *ptr)
void CRYPT_FixKeyProvInfoPointers(PCRYPT_KEY_PROV_INFO info)
void Context_Release(context_t *context)
LPVOID WINAPI CryptMemAlloc(ULONG cbSize)
LPVOID WINAPI CryptMemRealloc(LPVOID pv, ULONG cbSize)
VOID WINAPI CryptMemFree(LPVOID pv)
const WINE_CONTEXT_INTERFACE * pCTLInterface
const WINE_CONTEXT_INTERFACE * pCertInterface
const WINE_CONTEXT_INTERFACE * pCRLInterface
PCCRL_CONTEXT WINAPI CertEnumCRLsInStore(HCERTSTORE hCertStore, PCCRL_CONTEXT pPrev)
PCCERT_CONTEXT WINAPI CertEnumCertificatesInStore(HCERTSTORE hCertStore, PCCERT_CONTEXT pPrev)
#define ERROR_INVALID_PARAMETER
#define ReadFile(a, b, c, d, e)
#define CreateFileA(a, b, c, d, e, f, g)
#define __EXCEPT_PAGE_FAULT
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
GLuint GLuint GLsizei GLenum type
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
#define memcpy(s1, s2, n)
#define ERROR_FILE_NOT_FOUND
static HMODULE MODULEINFO DWORD cb
#define STATUS_ACCESS_VIOLATION
BOOL CRYPT_ReadSerializedStoreFromFile(HANDLE file, HCERTSTORE store)
BOOL(* SerializedOutputFunc)(void *handle, const void *buffer, DWORD size)
const void * CRYPT_ReadSerializedElement(const BYTE *pbElement, DWORD cbElement, DWORD dwContextTypeFlags, DWORD *pdwContentType)
static BOOL CRYPT_CountSerializedBytes(void *handle, const void *buffer, DWORD size)
static BOOL CRYPT_SerializeStoreElement(const void *context, const BYTE *encodedContext, DWORD cbEncodedContext, DWORD contextPropID, const WINE_CONTEXT_INTERFACE *contextInterface, DWORD dwFlags, BOOL omitHashes, BYTE *pbElement, DWORD *pcbElement)
BOOL WINAPI CertSaveStore(HCERTSTORE hCertStore, DWORD dwMsgAndCertEncodingType, DWORD dwSaveAs, DWORD dwSaveTo, void *pvSaveToPara, DWORD dwFlags)
static BOOL CRYPT_SaveSerializedToFile(HCERTSTORE store, DWORD dwMsgAndCertEncodingType, void *handle)
static BOOL read_blob_wrapper(void *handle, void *buffer, DWORD bytesToRead, DWORD *bytesRead)
BOOL WINAPI CertSerializeCRLStoreElement(PCCRL_CONTEXT pCrlContext, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement)
BOOL(* read_serialized_func)(void *handle, void *buffer, DWORD bytesToRead, DWORD *bytesRead)
static BOOL read_file_wrapper(void *handle, void *buffer, DWORD bytesToRead, DWORD *bytesRead)
static BOOL CRYPT_SaveSerializedToMem(HCERTSTORE store, DWORD dwMsgAndCertEncodingType, void *handle)
static BOOL WINAPI CRYPT_SerializeCTLNoHash(PCCTL_CONTEXT pCtlContext, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement)
static BOOL CRYPT_MemOutputFunc(void *handle, const void *buffer, DWORD size)
BOOL CRYPT_ReadSerializedStoreFromBlob(const CRYPT_DATA_BLOB *blob, HCERTSTORE store)
static const WINE_CERT_PROP_HEADER * CRYPT_findPropID(const BYTE *buf, DWORD size, DWORD propID)
static const BYTE fileHeader[]
static BOOL CRYPT_WriteSerializedStoreToStream(HCERTSTORE store, SerializedOutputFunc output, void *handle)
static BOOL CRYPT_ReadSerializedStore(void *handle, read_serialized_func read_func, HCERTSTORE store)
BOOL WINAPI CertAddSerializedElementToStore(HCERTSTORE hCertStore, const BYTE *pbElement, DWORD cbElement, DWORD dwAddDisposition, DWORD dwFlags, DWORD dwContextTypeFlags, DWORD *pdwContentType, const void **ppvContext)
static BOOL CRYPT_SavePKCSToMem(HCERTSTORE store, DWORD dwMsgAndCertEncodingType, void *handle)
BOOL WINAPI CertSerializeCTLStoreElement(PCCTL_CONTEXT pCtlContext, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement)
static BOOL CRYPT_FileOutputFunc(void *handle, const void *buffer, DWORD size)
static BOOL CRYPT_ReadContextProp(const WINE_CONTEXT_INTERFACE *contextInterface, const void *context, const WINE_CERT_PROP_HEADER *hdr, const BYTE *pbElement, DWORD cbElement)
static BOOL CRYPT_SerializeContextsToStream(SerializedOutputFunc output, void *handle, const WINE_CONTEXT_INTERFACE *contextInterface, HCERTSTORE store)
BOOL WINAPI CertSerializeCertificateStoreElement(PCCERT_CONTEXT pCertContext, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement)
static BOOL CRYPT_WriteSerializedStoreToFile(HANDLE file, HCERTSTORE store)
static BOOL CRYPT_SavePKCSToFile(HCERTSTORE store, DWORD dwMsgAndCertEncodingType, void *handle)
static BOOL WINAPI CRYPT_SerializeCRLNoHash(PCCRL_CONTEXT pCrlContext, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement)
static BOOL WINAPI CRYPT_SerializeCertNoHash(PCCERT_CONTEXT pCertContext, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement)
struct _WINE_CERT_PROP_HEADER WINE_CERT_PROP_HEADER
const CRYPT_DATA_BLOB * blob
SetContextPropertyFunc setProp
AddEncodedContextToStoreFunc addEncodedToStore
EnumPropertiesFunc enumProps
GetContextPropertyFunc getProp
SerializeElementFunc serialize
AddContextToStoreFunc addContextToStore
EnumContextsInStoreFunc enumContextsInStore
DWORD WINAPI GetLastError(void)
#define CERT_PVK_FILE_PROP_ID
_In_ DWORD dwMsgAndCertEncodingType
#define CERT_CROSS_CERT_DIST_POINTS_PROP_ID
#define CERT_ENROLLMENT_PROP_ID
_In_ PCCRL_CONTEXT pCrlContext
#define CERT_MD5_HASH_PROP_ID
#define CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID
#define CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID
#define CERT_KEY_IDENTIFIER_PROP_ID
#define CERT_STORE_SAVE_AS_STORE
#define IS_CERT_HASH_PROP_ID(x)
#define CERT_STORE_SAVE_AS_PKCS7
#define CERT_KEY_PROV_INFO_PROP_ID
_In_ PCCERT_CONTEXT _In_ DWORD dwAddDisposition
#define CERT_DESCRIPTION_PROP_ID
_In_ DWORD _In_ DWORD _In_ DWORD _In_ DWORD _Out_opt_ DWORD _Outptr_opt_ const void ** ppvContext
#define CERT_NEXT_UPDATE_LOCATION_PROP_ID
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
#define CERT_STORE_CTL_CONTEXT_FLAG
_In_ PCCTL_CONTEXT pCtlContext
#define X509_ASN_ENCODING
#define CERT_STORE_CRL_CONTEXT_FLAG
#define CERT_STORE_ALL_CONTEXT_FLAG
#define CERT_PUBKEY_ALG_PARA_PROP_ID
#define CERT_AUTO_ENROLL_PROP_ID
_In_ DWORD _In_ DWORD _In_ DWORD _In_ DWORD dwContextTypeFlags
#define CERT_FRIENDLY_NAME_PROP_ID
#define CERT_CTL_USAGE_PROP_ID
#define CERT_STORE_CERTIFICATE_CONTEXT
#define CERT_STORE_CTL_CONTEXT
#define CERT_STORE_ADD_NEW
#define CERT_STORE_SAVE_TO_MEMORY
_In_ PCCERT_CONTEXT pCertContext
#define CERT_HASH_PROP_ID
#define CERT_RENEWAL_PROP_ID
#define CERT_SIGNATURE_HASH_PROP_ID
#define CERT_STORE_CERTIFICATE_CONTEXT_FLAG
struct _CRYPT_KEY_PROV_INFO * PCRYPT_KEY_PROV_INFO
#define CERT_STORE_SAVE_TO_FILE
#define CERT_STORE_CRL_CONTEXT
#define CERT_STORE_SAVE_TO_FILENAME_A
#define CERT_DATE_STAMP_PROP_ID
#define CERT_STORE_SAVE_TO_FILENAME_W
#define CRYPT_E_FILE_ERROR
#define ERROR_END_OF_MEDIA