ReactOS 0.4.15-dev-7958-gcd0bb1a
wintrust_priv.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void *WINAPI WINTRUST_Alloc (DWORD cb) __WINE_ALLOC_SIZE(1) DECLSPEC_HIDDEN
 
void WINAPI WINTRUST_Free (void *p) DECLSPEC_HIDDEN
 
BOOL WINAPI WINTRUST_AddStore (CRYPT_PROVIDER_DATA *data, HCERTSTORE store) DECLSPEC_HIDDEN
 
BOOL WINAPI WINTRUST_AddSgnr (CRYPT_PROVIDER_DATA *data, BOOL fCounterSigner, DWORD idxSigner, CRYPT_PROVIDER_SGNR *sgnr) DECLSPEC_HIDDEN
 
BOOL WINAPI WINTRUST_AddCert (CRYPT_PROVIDER_DATA *data, DWORD idxSigner, BOOL fCounterSigner, DWORD idxCounterSigner, PCCERT_CONTEXT pCert2Add) DECLSPEC_HIDDEN
 
BOOL WINAPI WINTRUST_AddPrivData (CRYPT_PROVIDER_DATA *data, CRYPT_PROVIDER_PRIVDATA *pPrivData2Add) DECLSPEC_HIDDEN
 

Function Documentation

◆ WINTRUST_AddCert()

BOOL WINAPI WINTRUST_AddCert ( CRYPT_PROVIDER_DATA data,
DWORD  idxSigner,
BOOL  fCounterSigner,
DWORD  idxCounterSigner,
PCCERT_CONTEXT  pCert2Add 
)

Definition at line 1074 of file wintrust_main.c.

1076{
1077 BOOL ret = FALSE;
1078
1079 TRACE("(%p, %d, %d, %d, %p)\n", data, idxSigner, fCounterSigner,
1080 idxSigner, pCert2Add);
1081
1082 if (fCounterSigner)
1083 {
1084 FIXME("unimplemented for counter signers\n");
1086 return FALSE;
1087 }
1088 if (data->pasSigners[idxSigner].csCertChain)
1089 data->pasSigners[idxSigner].pasCertChain =
1090 WINTRUST_ReAlloc(data->pasSigners[idxSigner].pasCertChain,
1091 (data->pasSigners[idxSigner].csCertChain + 1) *
1092 sizeof(CRYPT_PROVIDER_CERT));
1093 else
1094 {
1095 data->pasSigners[idxSigner].pasCertChain =
1097 data->pasSigners[idxSigner].csCertChain = 0;
1098 }
1099 if (data->pasSigners[idxSigner].pasCertChain)
1100 {
1101 CRYPT_PROVIDER_CERT *cert = &data->pasSigners[idxSigner].pasCertChain[
1102 data->pasSigners[idxSigner].csCertChain];
1103
1104 cert->cbStruct = sizeof(CRYPT_PROVIDER_CERT);
1105 cert->pCert = CertDuplicateCertificateContext(pCert2Add);
1106 data->pasSigners[idxSigner].csCertChain++;
1107 ret = TRUE;
1108 }
1109 else
1111 return ret;
1112}
#define FIXME(fmt,...)
Definition: debug.h:111
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
PCCERT_CONTEXT WINAPI CertDuplicateCertificateContext(PCCERT_CONTEXT pCertContext)
Definition: cert.c:360
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
unsigned int BOOL
Definition: ntddk_ex.h:94
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static BYTE cert[]
Definition: msg.c:1437
#define TRACE(s)
Definition: solgame.cpp:4
int ret
struct _CRYPT_PROVIDER_CERT CRYPT_PROVIDER_CERT
void *WINAPI WINTRUST_Alloc(DWORD cb)
Definition: wintrust_main.c:43
static void * WINTRUST_ReAlloc(void *ptr, DWORD cb) __WINE_ALLOC_SIZE(2)
Definition: wintrust_main.c:49

Referenced by WintrustLoadFunctionPointers().

◆ WINTRUST_AddPrivData()

BOOL WINAPI WINTRUST_AddPrivData ( CRYPT_PROVIDER_DATA data,
CRYPT_PROVIDER_PRIVDATA pPrivData2Add 
)

Definition at line 1114 of file wintrust_main.c.

1116{
1117 BOOL ret = FALSE;
1118
1119 TRACE("(%p, %p)\n", data, pPrivData2Add);
1120
1121 if (pPrivData2Add->cbStruct > sizeof(CRYPT_PROVIDER_PRIVDATA))
1122 {
1124 WARN("invalid struct size\n");
1125 return FALSE;
1126 }
1127 if (data->csProvPrivData)
1128 data->pasProvPrivData = WINTRUST_ReAlloc(data->pasProvPrivData,
1129 (data->csProvPrivData + 1) * sizeof(CRYPT_PROVIDER_SGNR));
1130 else
1131 {
1132 data->pasProvPrivData = WINTRUST_Alloc(sizeof(CRYPT_PROVIDER_SGNR));
1133 data->csProvPrivData = 0;
1134 }
1135 if (data->pasProvPrivData)
1136 {
1137 DWORD i;
1138
1139 for (i = 0; i < data->csProvPrivData; i++)
1140 if (IsEqualGUID(&pPrivData2Add->gProviderID, &data->pasProvPrivData[i]))
1141 break;
1142
1143 data->pasProvPrivData[i] = *pPrivData2Add;
1144 if (i == data->csProvPrivData)
1145 data->csProvPrivData++;
1146 }
1147 else
1149 return ret;
1150}
#define WARN(fmt,...)
Definition: debug.h:112
unsigned long DWORD
Definition: ntddk_ex.h:95
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
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147

Referenced by WintrustLoadFunctionPointers().

◆ WINTRUST_AddSgnr()

BOOL WINAPI WINTRUST_AddSgnr ( CRYPT_PROVIDER_DATA data,
BOOL  fCounterSigner,
DWORD  idxSigner,
CRYPT_PROVIDER_SGNR sgnr 
)

Definition at line 1021 of file wintrust_main.c.

1023{
1024 BOOL ret = FALSE;
1025
1026 TRACE("(%p, %d, %d, %p)\n", data, fCounterSigner, idxSigner, sgnr);
1027
1028 if (sgnr->cbStruct > sizeof(CRYPT_PROVIDER_SGNR))
1029 {
1031 return FALSE;
1032 }
1033 if (fCounterSigner)
1034 {
1035 FIXME("unimplemented for counter signers\n");
1037 return FALSE;
1038 }
1039 if (data->csSigners)
1040 data->pasSigners = WINTRUST_ReAlloc(data->pasSigners,
1041 (data->csSigners + 1) * sizeof(CRYPT_PROVIDER_SGNR));
1042 else
1043 {
1044 data->pasSigners = WINTRUST_Alloc(sizeof(CRYPT_PROVIDER_SGNR));
1045 data->csSigners = 0;
1046 }
1047 if (data->pasSigners)
1048 {
1049 if (idxSigner < data->csSigners)
1050 memmove(&data->pasSigners[idxSigner],
1051 &data->pasSigners[idxSigner + 1],
1052 (data->csSigners - idxSigner) * sizeof(CRYPT_PROVIDER_SGNR));
1053 ret = TRUE;
1054 if (sgnr->cbStruct == sizeof(CRYPT_PROVIDER_SGNR))
1055 {
1056 /* The PSDK says psSigner should be allocated using pfnAlloc, but
1057 * it doesn't say anything about ownership. Since callers are
1058 * internal, assume ownership is passed, and just store the
1059 * pointer.
1060 */
1061 memcpy(&data->pasSigners[idxSigner], sgnr,
1062 sizeof(CRYPT_PROVIDER_SGNR));
1063 }
1064 else
1065 memset(&data->pasSigners[idxSigner], 0,
1066 sizeof(CRYPT_PROVIDER_SGNR));
1067 data->csSigners++;
1068 }
1069 else
1071 return ret;
1072}
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
#define memset(x, y, z)
Definition: compat.h:39

Referenced by WintrustLoadFunctionPointers().

◆ WINTRUST_AddStore()

BOOL WINAPI WINTRUST_AddStore ( CRYPT_PROVIDER_DATA data,
HCERTSTORE  store 
)

Definition at line 997 of file wintrust_main.c.

998{
999 BOOL ret = FALSE;
1000
1001 TRACE("(%p, %p)\n", data, store);
1002
1003 if (data->chStores)
1004 data->pahStores = WINTRUST_ReAlloc(data->pahStores,
1005 (data->chStores + 1) * sizeof(HCERTSTORE));
1006 else
1007 {
1008 data->pahStores = WINTRUST_Alloc(sizeof(HCERTSTORE));
1009 data->chStores = 0;
1010 }
1011 if (data->pahStores)
1012 {
1013 data->pahStores[data->chStores++] = CertDuplicateStore(store);
1014 ret = TRUE;
1015 }
1016 else
1018 return ret;
1019}
HCERTSTORE WINAPI CertDuplicateStore(HCERTSTORE hCertStore)
Definition: store.c:1116

Referenced by WintrustLoadFunctionPointers().

◆ WINTRUST_Alloc()

◆ WINTRUST_Free()