ReactOS  0.4.14-dev-606-g14ebc0b
main.c File Reference
#include "config.h"
#include <stdarg.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
#include "wincrypt.h"
#include "winreg.h"
#include "winuser.h"
#include "i_cryptasn1tls.h"
#include "crypt32_private.h"
#include "wine/debug.h"
Include dependency graph for main.c:

Go to the source code of this file.

Typedefs

typedef voidHLRUCACHE
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (crypt)
 
BOOL WINAPI DllMain (HINSTANCE hInst, DWORD fdwReason, PVOID pvReserved)
 
static HCRYPTPROV CRYPT_GetDefaultProvider (void)
 
BOOL WINAPI I_CryptCreateLruCache (void *unknown, HLRUCACHE *out)
 
BOOL WINAPI I_CryptFindLruEntry (DWORD unk0, DWORD unk1)
 
BOOL WINAPI I_CryptFindLruEntryData (DWORD unk0, DWORD unk1, DWORD unk2)
 
BOOL WINAPI I_CryptCreateLruEntry (HLRUCACHE h, DWORD unk0, DWORD unk1)
 
DWORD WINAPI I_CryptFlushLruCache (HLRUCACHE h, DWORD unk0, DWORD unk1)
 
HLRUCACHE WINAPI I_CryptFreeLruCache (HLRUCACHE h, DWORD unk0, DWORD unk1)
 
LPVOID WINAPI CryptMemAlloc (ULONG cbSize)
 
LPVOID WINAPI CryptMemRealloc (LPVOID pv, ULONG cbSize)
 
VOID WINAPI CryptMemFree (LPVOID pv)
 
DWORD WINAPI I_CryptAllocTls (void)
 
LPVOID WINAPI I_CryptDetachTls (DWORD dwTlsIndex)
 
LPVOID WINAPI I_CryptGetTls (DWORD dwTlsIndex)
 
BOOL WINAPI I_CryptSetTls (DWORD dwTlsIndex, LPVOID lpTlsValue)
 
BOOL WINAPI I_CryptFreeTls (DWORD dwTlsIndex, DWORD unknown)
 
BOOL WINAPI I_CryptGetOssGlobal (DWORD x)
 
static BOOL is_supported_algid (HCRYPTPROV prov, ALG_ID algid)
 
HCRYPTPROV WINAPI DECLSPEC_HOTPATCH I_CryptGetDefaultCryptProv (ALG_ID algid)
 
BOOL WINAPI I_CryptReadTrustedPublisherDWORDValueFromRegistry (LPCWSTR name, DWORD *value)
 
DWORD WINAPI I_CryptInstallOssGlobal (DWORD x, DWORD y, DWORD z)
 
BOOL WINAPI I_CryptInstallAsn1Module (ASN1module_t x, DWORD y, void *z)
 
BOOL WINAPI I_CryptUninstallAsn1Module (HCRYPTASN1MODULE x)
 
ASN1decoding_t WINAPI I_CryptGetAsn1Decoder (HCRYPTASN1MODULE x)
 
ASN1encoding_t WINAPI I_CryptGetAsn1Encoder (HCRYPTASN1MODULE x)
 
BOOL WINAPI CryptProtectMemory (void *data, DWORD len, DWORD flags)
 
BOOL WINAPI CryptUnprotectMemory (void *data, DWORD len, DWORD flags)
 

Variables

static HCRYPTPROV hDefProv
 
HINSTANCE hInstance
 
static CRITICAL_SECTION prov_param_cs = { &prov_param_cs_debug, -1, 0, 0, 0, 0 }
 
static CRITICAL_SECTION_DEBUG prov_param_cs_debug
 

Typedef Documentation

◆ HLRUCACHE

typedef void* HLRUCACHE

Definition at line 86 of file main.c.

Function Documentation

◆ CRYPT_GetDefaultProvider()

static HCRYPTPROV CRYPT_GetDefaultProvider ( void  )
static

Definition at line 69 of file main.c.

70 {
71  if (!hDefProv)
72  {
73  HCRYPTPROV prov;
74 
77  return hDefProv;
79  NULL);
80  if (hDefProv != prov)
81  CryptReleaseContext(prov, 0);
82  }
83  return hDefProv;
84 }
static HCRYPTPROV hDefProv
Definition: main.c:35
BOOL WINAPI CryptAcquireContextW(HCRYPTPROV *phProv, LPCWSTR pszContainer, LPCWSTR pszProvider, DWORD dwProvType, DWORD dwFlags)
Definition: crypt.c:358
#define InterlockedCompareExchangePointer
Definition: interlocked.h:129
#define PROV_RSA_AES
Definition: wincrypt.h:2056
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR MS_ENH_RSA_AES_PROV_W[]
Definition: wincrypt.h:2012
#define CRYPT_VERIFYCONTEXT
Definition: wincrypt.h:2069
ULONG_PTR HCRYPTPROV
Definition: wincrypt.h:46
BOOL WINAPI CryptReleaseContext(HCRYPTPROV hProv, ULONG_PTR dwFlags)
Definition: crypt.c:651

Referenced by I_CryptGetDefaultCryptProv().

◆ CryptMemAlloc()

LPVOID WINAPI CryptMemAlloc ( ULONG  cbSize)

Definition at line 131 of file main.c.

132 {
133  return HeapAlloc(GetProcessHeap(), 0, cbSize);
134 }
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)

Referenced by accumulating_stream_output(), add_line_to_buffer(), CContentEncryptInfo_Construct(), CDataEncodeMsg_Open(), CDecodeHashMsg_VerifyHash(), CDecodeMsg_CopyData(), CDecodeMsg_FinalizeHashedContent(), CDecodeMsg_SaveAlgorithmID(), CEnvelopedEncodeMsg_GetParam(), CEnvelopedEncodeMsg_Open(), CEnvelopedEncodeMsg_Update(), Cert_clone(), cert_prov_info_matches_cert(), CertAddEnhancedKeyUsageIdentifier(), CertAddStoreToCollection(), CertContext_SetKeyProvInfo(), CertContext_SetKeyProvInfoProperty(), CertCreateCertificateContext(), CertCreateCRLContext(), CertCreateCTLContext(), CertCreateSelfSignCertificate(), CertGetEnhancedKeyUsage(), CertGetNameStringA(), CertGetValidUsages(), CertRemoveEnhancedKeyUsageIdentifier(), CertStrToNameA(), CertVerifyRevocation(), CHashEncodeMsg_GetParam(), CHashEncodeMsg_Open(), CHashEncodeMsg_Update(), CNG_CalcHash(), CNG_ImportECCPubKey(), CNG_PrepareSignature(), CNG_PrepareSignatureECC(), compare_cert_by_cert_id(), compare_cert_by_name_str(), compare_cert_by_signature_hash(), compare_crl_issued_by(), container_matches_cert(), Context_CreateDataContext(), Context_CreateLinkContext(), ContextPropertyList_Create(), ContextPropertyList_SetProperty(), convert_hash_to_blob(), convert_str_to_blob(), CRL_clone(), CRYPT_AddAlternateChainToChain(), CRYPT_AddCertToSimpleChain(), CRYPT_AddStringToMultiString(), CRYPT_AsnDecodeArray(), CRYPT_AsnEncodeBitsSwapBytes(), CRYPT_AsnEncodeNameConstraints(), CRYPT_AsnEncodeRdn(), CRYPT_BuildCandidateChainFromCert(), CRYPT_CacheSIP(), CRYPT_CacheURL(), CRYPT_CollectionOpenStore(), CRYPT_ConstructAlgorithmId(), CRYPT_ConstructAttribute(), CRYPT_ConstructAttributes(), CRYPT_ConstructBitBlob(), CRYPT_ConstructBlob(), CRYPT_ConstructBlobArray(), CRYPT_CopyChainToElement(), CRYPT_CopySimpleChainToElement(), CRYPT_CrackUrl(), CRYPT_CreateBlob(), CRYPT_CreateChainEngine(), CRYPT_CreateFileStore(), CRYPT_CreateSignedCert(), CRYPT_DEREncodeItemsAsSet(), CRYPT_DownloadObject(), CRYPT_EncodePKCSDigestedData(), CRYPT_EncodeValueWithType(), CRYPT_ExportKeyTrans(), CRYPT_ExportPublicKeyInfoEx(), CRYPT_FileNameOpenStoreA(), CRYPT_GetDefaultOIDDlls(), CRYPT_GetFuncFromReg(), CRYPT_GetKeyName(), CRYPT_GetObjectFromCache(), CRYPT_GetObjectFromFile(), CRYPT_GetRetrieveFunction(), CRYPT_GetSignerCertInfoFromMsg(), CRYPT_GetSimpleChainForCert(), CRYPT_ImportKeyTrans(), CRYPT_ImportPublicKeyInfoEx(), CRYPT_IsCertificateSelfSigned(), CRYPT_KeynameKeeperFromTokenW(), CRYPT_MakeInetContext(), CRYPT_MemOpenStore(), CRYPT_MsgOpenStore(), CRYPT_ProvCreateStore(), CRYPT_QueryContextObject(), CRYPT_QueryEmbeddedMessageObject(), CRYPT_QueryMessageObject(), CRYPT_ReadBlobFromFile(), CRYPT_ReadSerializedStore(), CRYPT_RegDeleteContext(), CRYPT_RegOpenStore(), CRYPT_RegReadSerializedFromReg(), CRYPT_SavePKCSToFile(), CRYPT_SavePKCSToMem(), CRYPT_SerializeContextsToReg(), CRYPT_SerializeContextsToStream(), CRYPT_SerializeStoreElement(), CRYPT_SetBitInField(), CRYPT_SysOpenStoreA(), CRYPT_SysRegOpenStoreA(), CRYPT_SysRegOpenStoreW(), CRYPT_ValueToRDN(), CryptEncryptMessage(), CryptGetDefaultOIDFunctionAddress(), CryptInitOIDFunctionSet(), CryptInstallOIDFunctionAddress(), CryptMsgOpenToDecode(), CryptProtectData(), CryptRegisterOIDInfo(), CryptRetrieveObjectByUrlA(), CryptSignAndEncodeCertificate(), CryptSignMessage(), CryptUnregisterOIDInfo(), CSignedEncodeMsg_GetParam(), CSignedEncodeMsg_Open(), CSignedEncodeMsg_Update(), CSignedMsgData_AllocateHandles(), CSignedMsgData_AppendMessageDigestAttribute(), CSignedMsgData_Sign(), decode_base64_blob(), dump_element(), File_RetrieveEncodedObjectW(), fill_protect_data(), find_cert_by_name_str_a(), find_cert_by_name_str_w(), find_matching_provider(), g_malloc(), I_CryptGetDefaultCryptProv(), import_base64_certs_from_fp(), init_oid_info(), key_prov_info_matches_cert(), load_encryption_key(), name_value_to_str(), read_oid_info(), test_cryptAllocate(), test_data_msg_update(), test_decode_msg_get_param(), test_encrypt_message(), test_getDefaultCryptProv(), test_sign_message(), test_verify_message_hash(), TrustIsCertificateSelfSigned(), unserialize_string(), and verify_cert_revocation_from_dist_points_ext().

◆ CryptMemFree()

VOID WINAPI CryptMemFree ( LPVOID  pv)

Definition at line 141 of file main.c.

142 {
143  HeapFree(GetProcessHeap(), 0, pv);
144 }
#define GetProcessHeap()
Definition: compat.h:403
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by CContentEncryptInfo_Free(), CDecodeHashMsg_VerifyHash(), CDecodeMsg_Close(), CDecodeMsg_FinalizeHashedContent(), CDecodeMsg_SaveAlgorithmID(), CDecodeSignedMsg_VerifySignatureWithKey(), CEnvelopedEncodeMsg_Close(), CEnvelopedEncodeMsg_GetParam(), CEnvelopedEncodeMsg_Update(), Cert_free(), cert_prov_info_matches_cert(), CertAddEnhancedKeyUsageIdentifier(), CertContext_SetKeyProvInfo(), CertContext_SetKeyProvInfoProperty(), CertCreateCTLContext(), CertCreateSelfSignCertificate(), CertGetEnhancedKeyUsage(), CertGetNameStringA(), CertGetValidUsages(), CertRemoveEnhancedKeyUsageIdentifier(), CertRemoveStoreFromCollection(), CertStrToNameA(), CertStrToNameW(), CertVerifyRevocation(), CHashEncodeMsg_Close(), CHashEncodeMsg_GetParam(), CNG_CalcHash(), CNG_ImportECCPubKey(), CNG_PrepareSignature(), CNG_VerifySignature(), Collection_release(), compare_cert_by_cert_id(), compare_cert_by_name_str(), compare_cert_by_signature_hash(), compare_crl_issued_by(), Context_CreateDataContext(), Context_Free(), ContextPropertyList_Free(), ContextPropertyList_RemoveProperty(), ContextPropertyList_SetProperty(), convert_hash_to_blob(), CRecipientInfo_Free(), CRL_free(), CRYPT_AddCertToSimpleChain(), CRYPT_AddStringToMultiString(), CRYPT_AsnDecodeArray(), CRYPT_AsnEncodeBitsSwapBytes(), CRYPT_AsnEncodeNameConstraints(), CRYPT_AsnEncodeRdn(), CRYPT_CacheURL(), CRYPT_CopyChainToElement(), CRYPT_CopySimpleChainToElement(), CRYPT_CrackUrl(), CRYPT_CreateContext(), CRYPT_CreateSignedCert(), CRYPT_DEREncodeItemsAsSet(), CRYPT_DownloadObject(), CRYPT_EncodePKCSDigestedData(), CRYPT_EncodeValueWithType(), CRYPT_ExportEncryptedKey(), CRYPT_ExportKeyTrans(), CRYPT_ExportPublicKeyInfoEx(), CRYPT_FileCloseStore(), CRYPT_FileControl(), CRYPT_FileNameOpenStoreA(), CRYPT_FreeBlob(), CRYPT_FreeBlobArray(), CRYPT_FreeChainContext(), CRYPT_FreeChainElement(), CRYPT_FreeKeynameKeeper(), CRYPT_FreeLowerQualityChains(), CRYPT_FreeSimpleChain(), CRYPT_FreeStore(), CRYPT_GetDefaultOIDDlls(), CRYPT_GetDefaultOIDKey(), CRYPT_GetFuncFromReg(), CRYPT_GetObjectFromCache(), CRYPT_GetObjectFromFile(), CRYPT_GetRetrieveFunction(), CRYPT_GetSignerCertInfoFromMsg(), CRYPT_ImportKeyTrans(), CRYPT_ImportPublicKeyInfoEx(), CRYPT_IsCertificateSelfSigned(), CRYPT_MakeInetContext(), CRYPT_MsgOpenStore(), CRYPT_QueryContextObject(), CRYPT_QueryEmbeddedMessageObject(), CRYPT_QueryMessageObject(), CRYPT_QuerySerializedContextObject(), CRYPT_ReadBlobFromFile(), CRYPT_ReadSerializedStore(), CRYPT_RegCloseStore(), CRYPT_RegDeleteContext(), CRYPT_RegReadSerializedFromReg(), CRYPT_RegWriteToReg(), CRYPT_SavePKCSToMem(), CRYPT_SerializeContextsToReg(), CRYPT_SerializeContextsToStream(), CRYPT_SerializeStoreElement(), crypt_sip_free(), CRYPT_SysOpenStoreA(), CRYPT_SysRegOpenStoreA(), CRYPT_SysRegOpenStoreW(), CryptEncryptMessage(), CryptFreeOIDFunctionAddress(), CryptGetDefaultOIDDllList(), CryptGetDefaultOIDFunctionAddress(), CryptGetOIDFunctionValue(), CryptInitOIDFunctionSet(), CryptMsgClose(), CryptMsgGetAndVerifySigner(), CryptRegisterDefaultOIDFunction(), CryptRegisterOIDFunction(), CryptRegisterOIDInfo(), CryptRetrieveObjectByUrlA(), CryptSetOIDFunctionValue(), CryptSignAndEncodeCertificate(), CryptSignMessage(), CryptUnregisterDefaultOIDFunction(), CryptUnregisterOIDFunction(), CryptUnregisterOIDInfo(), CryptVerifyDetachedMessageSignature(), CryptVerifyMessageSignature(), CSignedEncodeMsg_Close(), CSignedEncodeMsg_GetParam(), CSignedEncodeMsg_Open(), CSignedMsgData_AppendMessageDigestAttribute(), CSignedMsgData_CloseHandles(), CSignerInfo_Free(), CTL_free(), decode_base64_blob(), dump_alt_name_entry(), dump_element(), File_RetrieveEncodedObjectW(), find_cert_by_name_str_a(), find_cert_by_name_str_w(), find_matching_provider(), free_chain_engine(), free_function_sets(), free_oid_info(), free_protect_data(), free_updates(), g_free(), hash_matches_blob(), HTTP_RetrieveEncodedObjectW(), I_CryptGetDefaultCryptProv(), import_base64_certs_from_fp(), import_certs_from_dir(), key_prov_info_matches_cert(), load_encryption_key(), test_cryptAllocate(), test_data_msg_update(), test_decode_msg_get_param(), test_encrypt_message(), test_getDefaultCryptProv(), test_retrieveObjectByUrl(), test_sign_message(), test_verify_message_hash(), TrustIsCertificateSelfSigned(), and verify_cert_revocation_from_dist_points_ext().

◆ CryptMemRealloc()

◆ CryptProtectMemory()

BOOL WINAPI CryptProtectMemory ( void data,
DWORD  len,
DWORD  flags 
)

Definition at line 312 of file main.c.

313 {
314  static int fixme_once;
315  if (!fixme_once++) FIXME("(%p %u %08x): stub\n", data, len, flags);
316  return TRUE;
317 }
#define TRUE
Definition: types.h:120
#define FIXME(fmt,...)
Definition: debug.h:110
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLbitfield flags
Definition: glext.h:7161
GLenum GLsizei len
Definition: glext.h:6722

◆ CryptUnprotectMemory()

BOOL WINAPI CryptUnprotectMemory ( void data,
DWORD  len,
DWORD  flags 
)

Definition at line 319 of file main.c.

320 {
321  static int fixme_once;
322  if (!fixme_once++) FIXME("(%p %u %08x): stub\n", data, len, flags);
323  return TRUE;
324 }
#define TRUE
Definition: types.h:120
#define FIXME(fmt,...)
Definition: debug.h:110
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLbitfield flags
Definition: glext.h:7161
GLenum GLsizei len
Definition: glext.h:6722

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hInst,
DWORD  fdwReason,
PVOID  pvReserved 
)

Definition at line 48 of file main.c.

49 {
50  switch (fdwReason)
51  {
52  case DLL_PROCESS_ATTACH:
53  hInstance = hInst;
57  break;
58  case DLL_PROCESS_DETACH:
59  if (pvReserved) break;
64  break;
65  }
66  return TRUE;
67 }
static HCRYPTPROV hDefProv
Definition: main.c:35
#define TRUE
Definition: types.h:120
void crypt_sip_free(void) DECLSPEC_HIDDEN
Definition: sip.c:610
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
HINSTANCE hInst
Definition: main.c:29
void init_empty_store(void) DECLSPEC_HIDDEN
Definition: store.c:1511
#define DLL_PROCESS_DETACH
Definition: compat.h:119
static LPCSTR DWORD void * pvReserved
Definition: str.c:196
HINSTANCE hInstance
Definition: main.c:36
BOOL WINAPI CryptReleaseContext(HCRYPTPROV hProv, ULONG_PTR dwFlags)
Definition: crypt.c:651
void default_chain_engine_free(void)
Definition: chain.c:255
void crypt_oid_init(void) DECLSPEC_HIDDEN
Definition: oid.c:1914
void crypt_oid_free(void) DECLSPEC_HIDDEN
Definition: oid.c:1920

◆ I_CryptAllocTls()

DWORD WINAPI I_CryptAllocTls ( void  )

Definition at line 146 of file main.c.

147 {
148  return TlsAlloc();
149 }
DWORD WINAPI TlsAlloc(VOID)
Definition: thread.c:1088

◆ I_CryptCreateLruCache()

BOOL WINAPI I_CryptCreateLruCache ( void unknown,
HLRUCACHE out 
)

Definition at line 94 of file main.c.

95 {
96  FIXME("(%p, %p): stub!\n", unknown, out);
97  *out = (void *)0xbaadf00d;
98  return TRUE;
99 }
#define TRUE
Definition: types.h:120
#define FIXME(fmt,...)
Definition: debug.h:110
static FILE * out
Definition: regtests2xml.c:44
Definition: id3.c:18

◆ I_CryptCreateLruEntry()

BOOL WINAPI I_CryptCreateLruEntry ( HLRUCACHE  h,
DWORD  unk0,
DWORD  unk1 
)

Definition at line 113 of file main.c.

114 {
115  FIXME("(%p, %08x, %08x): stub!\n", h, unk0, unk1);
116  return FALSE;
117 }
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
static DWORD unk1
Definition: cursoricon.c:1638
#define FIXME(fmt,...)
Definition: debug.h:110

◆ I_CryptDetachTls()

LPVOID WINAPI I_CryptDetachTls ( DWORD  dwTlsIndex)

Definition at line 151 of file main.c.

152 {
153  LPVOID ret;
154 
157  return ret;
158 }
BOOL WINAPI TlsSetValue(IN DWORD Index, IN LPVOID Value)
Definition: thread.c:1264
smooth NULL
Definition: ftsmooth.c:416
int ret
static DWORD dwTlsIndex
Definition: wintirpc.c:34
LPVOID WINAPI TlsGetValue(IN DWORD Index)
Definition: thread.c:1228

◆ I_CryptFindLruEntry()

BOOL WINAPI I_CryptFindLruEntry ( DWORD  unk0,
DWORD  unk1 
)

Definition at line 101 of file main.c.

102 {
103  FIXME("(%08x, %08x): stub!\n", unk0, unk1);
104  return FALSE;
105 }
static DWORD unk1
Definition: cursoricon.c:1638
#define FIXME(fmt,...)
Definition: debug.h:110

◆ I_CryptFindLruEntryData()

BOOL WINAPI I_CryptFindLruEntryData ( DWORD  unk0,
DWORD  unk1,
DWORD  unk2 
)

Definition at line 107 of file main.c.

108 {
109  FIXME("(%08x, %08x, %08x): stub!\n", unk0, unk1, unk2);
110  return FALSE;
111 }
static DWORD unk1
Definition: cursoricon.c:1638
#define FIXME(fmt,...)
Definition: debug.h:110

◆ I_CryptFlushLruCache()

DWORD WINAPI I_CryptFlushLruCache ( HLRUCACHE  h,
DWORD  unk0,
DWORD  unk1 
)

Definition at line 119 of file main.c.

120 {
121  FIXME("(%p, %08x, %08x): stub!\n", h, unk0, unk1);
122  return 0;
123 }
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
static DWORD unk1
Definition: cursoricon.c:1638
#define FIXME(fmt,...)
Definition: debug.h:110

◆ I_CryptFreeLruCache()

HLRUCACHE WINAPI I_CryptFreeLruCache ( HLRUCACHE  h,
DWORD  unk0,
DWORD  unk1 
)

Definition at line 125 of file main.c.

126 {
127  FIXME("(%p, %08x, %08x): stub!\n", h, unk0, unk1);
128  return h;
129 }
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
static DWORD unk1
Definition: cursoricon.c:1638
#define FIXME(fmt,...)
Definition: debug.h:110

◆ I_CryptFreeTls()

BOOL WINAPI I_CryptFreeTls ( DWORD  dwTlsIndex,
DWORD  unknown 
)

Definition at line 170 of file main.c.

171 {
172  BOOL ret;
173 
174  TRACE("(%d, %d)\n", dwTlsIndex, unknown);
175 
177  if (!ret) SetLastError( E_INVALIDARG );
178  return ret;
179 }
unsigned int BOOL
Definition: ntddk_ex.h:94
#define E_INVALIDARG
Definition: ddrawi.h:101
#define TRACE(s)
Definition: solgame.cpp:4
BOOL WINAPI TlsFree(IN DWORD Index)
Definition: thread.c:1154
#define SetLastError(x)
Definition: compat.h:417
Definition: id3.c:18
int ret
static DWORD dwTlsIndex
Definition: wintirpc.c:34

◆ I_CryptGetAsn1Decoder()

ASN1decoding_t WINAPI I_CryptGetAsn1Decoder ( HCRYPTASN1MODULE  x)

Definition at line 300 of file main.c.

301 {
302  FIXME("(%08x): stub\n", x);
303  return NULL;
304 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416

◆ I_CryptGetAsn1Encoder()

ASN1encoding_t WINAPI I_CryptGetAsn1Encoder ( HCRYPTASN1MODULE  x)

Definition at line 306 of file main.c.

307 {
308  FIXME("(%08x): stub\n", x);
309  return NULL;
310 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416

◆ I_CryptGetDefaultCryptProv()

HCRYPTPROV WINAPI DECLSPEC_HOTPATCH I_CryptGetDefaultCryptProv ( ALG_ID  algid)

Definition at line 210 of file main.c.

211 {
212  HCRYPTPROV prov, defprov;
213 
214  TRACE("(%08x)\n", algid);
215 
216  defprov = CRYPT_GetDefaultProvider();
217 
218  if (algid && !is_supported_algid(defprov, algid))
219  {
220  DWORD i = 0, type, size;
221 
222  while (CryptEnumProvidersW(i, NULL, 0, &type, NULL, &size))
223  {
225  if (name)
226  {
227  if (CryptEnumProvidersW(i, NULL, 0, &type, name, &size))
228  {
230  {
231  if (is_supported_algid(prov, algid))
232  {
234  return prov;
235  }
236  CryptReleaseContext(prov, 0);
237  }
238  }
240  }
241  i++;
242  }
243 
245  return 0;
246  }
247 
248  CryptContextAddRef(defprov, NULL, 0);
249  return defprov;
250 }
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
BOOL WINAPI CryptAcquireContextW(HCRYPTPROV *phProv, LPCWSTR pszContainer, LPCWSTR pszProvider, DWORD dwProvType, DWORD dwFlags)
Definition: crypt.c:358
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
Definition: glfuncs.h:248
LPVOID WINAPI CryptMemAlloc(ULONG cbSize)
Definition: main.c:131
BOOL WINAPI CryptContextAddRef(HCRYPTPROV hProv, DWORD *pdwReserved, DWORD dwFlags)
Definition: crypt.c:613
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI CryptEnumProvidersW(DWORD dwIndex, DWORD *pdwReserved, DWORD dwFlags, DWORD *pdwProvType, LPWSTR pszProvName, DWORD *pcbProvName)
Definition: crypt.c:1141
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:417
#define CRYPT_VERIFYCONTEXT
Definition: wincrypt.h:2069
int type
Definition: main.c:85
ULONG_PTR HCRYPTPROV
Definition: wincrypt.h:46
static HCRYPTPROV CRYPT_GetDefaultProvider(void)
Definition: main.c:69
VOID WINAPI CryptMemFree(LPVOID pv)
Definition: main.c:141
BOOL WINAPI CryptReleaseContext(HCRYPTPROV hProv, ULONG_PTR dwFlags)
Definition: crypt.c:651
Definition: name.c:38
static BOOL is_supported_algid(HCRYPTPROV prov, ALG_ID algid)
Definition: main.c:187

Referenced by CDecodeMsg_FinalizeHashedContent(), CEnvelopedEncodeMsg_Open(), CertGetPublicKeyLength(), CHashEncodeMsg_Open(), CRYPT_VerifySignature(), CryptHashCertificate(), CryptHashPublicKeyInfo(), CryptHashToBeSigned(), CryptSignCertificate(), and CSignedMsgData_ConstructSignerHandles().

◆ I_CryptGetOssGlobal()

BOOL WINAPI I_CryptGetOssGlobal ( DWORD  x)

Definition at line 181 of file main.c.

182 {
183  FIXME("%08x\n", x);
184  return FALSE;
185 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define FIXME(fmt,...)
Definition: debug.h:110

◆ I_CryptGetTls()

LPVOID WINAPI I_CryptGetTls ( DWORD  dwTlsIndex)

Definition at line 160 of file main.c.

161 {
162  return TlsGetValue(dwTlsIndex);
163 }
static DWORD dwTlsIndex
Definition: wintirpc.c:34
LPVOID WINAPI TlsGetValue(IN DWORD Index)
Definition: thread.c:1228

◆ I_CryptInstallAsn1Module()

BOOL WINAPI I_CryptInstallAsn1Module ( ASN1module_t  x,
DWORD  y,
void z 
)

Definition at line 288 of file main.c.

289 {
290  FIXME("(%p %08x %p): stub\n", x, y, z);
291  return TRUE;
292 }
#define TRUE
Definition: types.h:120
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define FIXME(fmt,...)
Definition: debug.h:110
GLdouble GLdouble z
Definition: glext.h:5874
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

◆ I_CryptInstallOssGlobal()

DWORD WINAPI I_CryptInstallOssGlobal ( DWORD  x,
DWORD  y,
DWORD  z 
)

Definition at line 280 of file main.c.

281 {
282  static int ret = 8;
283  ret++;
284  FIXME("%08x %08x %08x, return value %d\n", x, y, z,ret);
285  return ret;
286 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define FIXME(fmt,...)
Definition: debug.h:110
GLdouble GLdouble z
Definition: glext.h:5874
int ret
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

◆ I_CryptReadTrustedPublisherDWORDValueFromRegistry()

BOOL WINAPI I_CryptReadTrustedPublisherDWORDValueFromRegistry ( LPCWSTR  name,
DWORD value 
)

Definition at line 252 of file main.c.

254 {
255  static const WCHAR safer[] = {
256  'S','o','f','t','w','a','r','e','\\','P','o','l','i','c','i','e','s','\\',
257  'M','i','c','r','o','s','o','f','t','\\','S','y','s','t','e','m',
258  'C','e','r','t','i','f','i','c','a','t','e','s','\\',
259  'T','r','u','s','t','e','d','P','u','b','l','i','s','h','e','r','\\',
260  'S','a','f','e','r',0 };
261  HKEY key;
262  LONG rc;
263  BOOL ret = FALSE;
264 
265  TRACE("(%s, %p)\n", debugstr_w(name), value);
266 
267  *value = 0;
268  rc = RegCreateKeyW(HKEY_LOCAL_MACHINE, safer, &key);
269  if (rc == ERROR_SUCCESS)
270  {
271  DWORD size = sizeof(DWORD);
272 
274  ret = TRUE;
275  RegCloseKey(key);
276  }
277  return ret;
278 }
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
#define DWORD
Definition: nt_native.h:44
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
HKEY key
Definition: reg.c:42
LONG WINAPI RegCreateKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1199
Definition: name.c:38
Definition: path.c:41
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

◆ I_CryptSetTls()

BOOL WINAPI I_CryptSetTls ( DWORD  dwTlsIndex,
LPVOID  lpTlsValue 
)

Definition at line 165 of file main.c.

166 {
167  return TlsSetValue(dwTlsIndex, lpTlsValue);
168 }
BOOL WINAPI TlsSetValue(IN DWORD Index, IN LPVOID Value)
Definition: thread.c:1264
static DWORD dwTlsIndex
Definition: wintirpc.c:34

◆ I_CryptUninstallAsn1Module()

BOOL WINAPI I_CryptUninstallAsn1Module ( HCRYPTASN1MODULE  x)

Definition at line 294 of file main.c.

295 {
296  FIXME("(%08x): stub\n", x);
297  return TRUE;
298 }
#define TRUE
Definition: types.h:120
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define FIXME(fmt,...)
Definition: debug.h:110

◆ is_supported_algid()

static BOOL is_supported_algid ( HCRYPTPROV  prov,
ALG_ID  algid 
)
static

Definition at line 187 of file main.c.

188 {
189  PROV_ENUMALGS prov_algs;
190  DWORD size = sizeof(prov_algs);
191  BOOL ret = FALSE;
192 
193  /* This enumeration is not thread safe */
195  if (CryptGetProvParam(prov, PP_ENUMALGS, (BYTE *)&prov_algs, &size, CRYPT_FIRST))
196  {
197  do
198  {
199  if (prov_algs.aiAlgid == algid)
200  {
201  ret = TRUE;
202  break;
203  }
204  } while (CryptGetProvParam(prov, PP_ENUMALGS, (BYTE *)&prov_algs, &size, CRYPT_NEXT));
205  }
207  return ret;
208 }
#define TRUE
Definition: types.h:120
#define CRYPT_FIRST
Definition: wincrypt.h:2060
#define CRYPT_NEXT
Definition: wincrypt.h:2061
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
unsigned int BOOL
Definition: ntddk_ex.h:94
#define PP_ENUMALGS
Definition: wincrypt.h:2082
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
unsigned char BYTE
Definition: mem.h:68
BOOL WINAPI CryptGetProvParam(HCRYPTPROV hProv, DWORD dwParam, BYTE *pbData, DWORD *pdwDataLen, DWORD dwFlags)
Definition: crypt.c:1693
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION prov_param_cs
Definition: main.c:38

Referenced by I_CryptGetDefaultCryptProv().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( crypt  )

Variable Documentation

◆ hDefProv

HCRYPTPROV hDefProv
static

Definition at line 35 of file main.c.

Referenced by CRYPT_GetDefaultProvider(), and DllMain().

◆ hInstance

◆ prov_param_cs

static CRITICAL_SECTION prov_param_cs = { &prov_param_cs_debug, -1, 0, 0, 0, 0 }
static

Definition at line 38 of file main.c.

Referenced by is_supported_algid().

◆ prov_param_cs_debug

CRITICAL_SECTION_DEBUG prov_param_cs_debug
static
Initial value:
=
{
0, 0, &prov_param_cs,
0, 0, { (DWORD_PTR)(__FILE__ ": prov_param_cs") }
}
#define DWORD_PTR
Definition: treelist.c:76
static CRITICAL_SECTION_DEBUG prov_param_cs_debug
Definition: main.c:39
LIST_ENTRY ProcessLocksList
Definition: winbase.h:855
static CRITICAL_SECTION prov_param_cs
Definition: main.c:38

Definition at line 39 of file main.c.