ReactOS  r76032
register.c File Reference
#include "wintrust_priv.h"
Include dependency graph for register.c:

Go to the source code of this file.

Macros

#define WINTRUST_INITREGENTRY(action, dllname, functionname)
 
#define WINTRUST_FREEREGENTRY(action)
 
#define WIN_SPUB_ACTION_PUBLISHED_SOFTWARE_NOBADUI   { 0xc6b2e8d0, 0xe005, 0x11cf, { 0xa1,0x34,0x00,0xc0,0x4f,0xd7,0xbf,0x43 }}
 
#define WINTRUST_REGISTEROID(oid, encode_funcname, decode_funcname)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wintrust)
 
static void WINTRUST_InitRegStructs (void)
 
static void WINTRUST_FreeRegStructs (void)
 
static void WINTRUST_Guid2Wstr (const GUID *pgActionID, WCHAR *GuidString)
 
static LONG WINTRUST_WriteProviderToReg (WCHAR *GuidString, const WCHAR *FunctionType, CRYPT_TRUST_REG_ENTRY RegEntry)
 
BOOL WINAPI WintrustAddActionID (GUID *pgActionID, DWORD fdwFlags, CRYPT_REGISTER_ACTIONID *psProvInfo)
 
static void WINTRUST_RemoveProviderFromReg (WCHAR *GuidString, const WCHAR *FunctionType)
 
BOOL WINAPI WintrustRemoveActionID (GUID *pgActionID)
 
static LONG WINTRUST_WriteSingleUsageEntry (LPCSTR OID, const WCHAR *Value, WCHAR *Data)
 
static BOOL WINTRUST_RegisterGenVerifyV2 (void)
 
static BOOL WINTRUST_RegisterPublishedSoftware (void)
 
static BOOL WINTRUST_RegisterPublishedSoftwareNoBadUi (void)
 
static BOOL WINTRUST_RegisterGenCertVerify (void)
 
static BOOL WINTRUST_RegisterTrustProviderTest (void)
 
static BOOL WINTRUST_RegisterHttpsProv (void)
 
static BOOL WINTRUST_RegisterOfficeSignVerify (void)
 
static BOOL WINTRUST_RegisterDriverVerify (void)
 
static BOOL WINTRUST_RegisterGenChainVerify (void)
 
BOOL WINAPI WintrustAddDefaultForUsage (const char *pszUsageOID, CRYPT_PROVIDER_REGDEFUSAGE *psDefUsage)
 
static FARPROC WINTRUST_ReadProviderFromReg (WCHAR *GuidString, const WCHAR *FunctionType)
 
BOOL WINAPI WintrustLoadFunctionPointers (GUID *pgActionID, CRYPT_PROVIDER_FUNCTIONS *pPfns)
 
static BOOL WINTRUST_SIPPAddProvider (GUID *Subject, WCHAR *MagicNumber)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (void)
 
HRESULT WINAPI SoftpubDllRegisterServer (void)
 
HRESULT WINAPI SoftpubDllUnregisterServer (void)
 
HRESULT WINAPI mscat32DllRegisterServer (void)
 
HRESULT WINAPI mscat32DllUnregisterServer (void)
 
HRESULT WINAPI mssip32DllRegisterServer (void)
 
HRESULT WINAPI mssip32DllUnregisterServer (void)
 

Variables

static CRYPT_TRUST_REG_ENTRY SoftpubInitialization
 
static CRYPT_TRUST_REG_ENTRY SoftpubMessage
 
static CRYPT_TRUST_REG_ENTRY SoftpubSignature
 
static CRYPT_TRUST_REG_ENTRY SoftpubCertificate
 
static CRYPT_TRUST_REG_ENTRY SoftpubCertCheck
 
static CRYPT_TRUST_REG_ENTRY SoftpubFinalPolicy
 
static CRYPT_TRUST_REG_ENTRY SoftpubCleanup
 
static CRYPT_TRUST_REG_ENTRY SoftpubDefCertInit
 
static CRYPT_TRUST_REG_ENTRY SoftpubDumpStructure
 
static CRYPT_TRUST_REG_ENTRY HTTPSCertificateTrust
 
static CRYPT_TRUST_REG_ENTRY HTTPSFinalProv
 
static CRYPT_TRUST_REG_ENTRY OfficeInitializePolicy
 
static CRYPT_TRUST_REG_ENTRY OfficeCleanupPolicy
 
static CRYPT_TRUST_REG_ENTRY DriverInitializePolicy
 
static CRYPT_TRUST_REG_ENTRY DriverFinalPolicy
 
static CRYPT_TRUST_REG_ENTRY DriverCleanupPolicy
 
static CRYPT_TRUST_REG_ENTRY GenericChainCertificateTrust
 
static CRYPT_TRUST_REG_ENTRY GenericChainFinalProv
 
static const CRYPT_TRUST_REG_ENTRY NullCTRE = { 0, NULL, NULL }
 
static const WCHAR Trust []
 
static const WCHAR Initialization [] = {'I','n','i','t','i','a','l','i','z','a','t','i','o','n','\\', 0}
 
static const WCHAR Message [] = {'M','e','s','s','a','g','e','\\', 0}
 
static const WCHAR Signature [] = {'S','i','g','n','a','t','u','r','e','\\', 0}
 
static const WCHAR Certificate [] = {'C','e','r','t','i','f','i','c','a','t','e','\\', 0}
 
static const WCHAR CertCheck [] = {'C','e','r','t','C','h','e','c','k','\\', 0}
 
static const WCHAR FinalPolicy [] = {'F','i','n','a','l','P','o','l','i','c','y','\\', 0}
 
static const WCHAR DiagnosticPolicy [] = {'D','i','a','g','n','o','s','t','i','c','P','o','l','i','c','y','\\', 0}
 
static const WCHAR Cleanup [] = {'C','l','e','a','n','u','p','\\', 0}
 
static const WCHAR DefaultId [] = {'D','e','f','a','u','l','t','I','d', 0}
 
static const WCHAR Dll [] = {'$','D','L','L', 0}
 

Macro Definition Documentation

#define WIN_SPUB_ACTION_PUBLISHED_SOFTWARE_NOBADUI   { 0xc6b2e8d0, 0xe005, 0x11cf, { 0xa1,0x34,0x00,0xc0,0x4f,0xd7,0xbf,0x43 }}

Definition at line 465 of file register.c.

Referenced by WINTRUST_RegisterPublishedSoftwareNoBadUi().

#define WINTRUST_FREEREGENTRY (   action)
Value:
WINTRUST_Free(action.pwszDLLName); \
WINTRUST_Free(action.pwszFunctionName);
void WINAPI WINTRUST_Free(void *p)
Definition: wintrust_main.c:40
const WCHAR * action
Definition: action.c:7683

Referenced by WINTRUST_FreeRegStructs().

#define WINTRUST_INITREGENTRY (   action,
  dllname,
  functionname 
)
Value:
action.cbStruct = sizeof(CRYPT_TRUST_REG_ENTRY); \
action.pwszDLLName = WINTRUST_Alloc(sizeof(dllname)); \
lstrcpyW(action.pwszDLLName, dllname); \
action.pwszFunctionName = WINTRUST_Alloc(sizeof(functionname)); \
lstrcpyW(action.pwszFunctionName, functionname);
void *WINAPI WINTRUST_Alloc(DWORD cb)
Definition: wintrust_main.c:29
struct _CRYPT_TRUST_REG_ENTRY CRYPT_TRUST_REG_ENTRY
const WCHAR * action
Definition: action.c:7683
#define lstrcpyW
Definition: compat.h:406

Referenced by WINTRUST_InitRegStructs().

#define WINTRUST_REGISTEROID (   oid,
  encode_funcname,
  decode_funcname 
)
Value:
do { \
{ \
CryptRegisterRes = HRESULT_FROM_WIN32(GetLastError()); \
goto add_trust_providers; \
} \
{ \
CryptRegisterRes = HRESULT_FROM_WIN32(GetLastError()); \
goto add_trust_providers; \
} \
} while (0)
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
BOOL WINAPI CryptRegisterOIDFunction(DWORD dwEncodingType, LPCSTR pszFuncName, LPCSTR pszOID, LPCWSTR pwszDll, LPCSTR pszOverrideFuncName)
Definition: oid.c:582
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1056
#define X509_ASN_ENCODING
Definition: wincrypt.h:2253
static const WCHAR SP_POLICY_PROVIDER_DLL_NAME[]
Definition: softpub.h:104
#define CRYPT_OID_DECODE_OBJECT_FUNC
Definition: wincrypt.h:2449
if(!(yy_init))
Definition: macro.lex.yy.c:704
#define CRYPT_OID_ENCODE_OBJECT_FUNC
Definition: wincrypt.h:2448

Referenced by DllRegisterServer().

Function Documentation

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 911 of file register.c.

912 {
913  static const CHAR SpcPeImageDataEncode[] = "WVTAsn1SpcPeImageDataEncode";
914  static const CHAR SpcPeImageDataDecode[] = "WVTAsn1SpcPeImageDataDecode";
915  static const CHAR SpcLinkEncode[] = "WVTAsn1SpcLinkEncode";
916  static const CHAR SpcLinkDecode[] = "WVTAsn1SpcLinkDecode";
917  static const CHAR SpcSigInfoEncode[] = "WVTAsn1SpcSigInfoEncode";
918  static const CHAR SpcSigInfoDecode[] = "WVTAsn1SpcSigInfoDecode";
919  static const CHAR SpcIndirectDataContentEncode[] = "WVTAsn1SpcIndirectDataContentEncode";
920  static const CHAR SpcIndirectDataContentDecode[] = "WVTAsn1SpcIndirectDataContentDecode";
921  static const CHAR SpcSpAgencyInfoEncode[] = "WVTAsn1SpcSpAgencyInfoEncode";
922  static const CHAR SpcSpAgencyInfoDecode[] = "WVTAsn1SpcSpAgencyInfoDecode";
923  static const CHAR SpcMinimalCriteriaInfoEncode[] = "WVTAsn1SpcMinimalCriteriaInfoEncode";
924  static const CHAR SpcMinimalCriteriaInfoDecode[] = "WVTAsn1SpcMinimalCriteriaInfoDecode";
925  static const CHAR SpcFinancialCriteriaInfoEncode[] = "WVTAsn1SpcFinancialCriteriaInfoEncode";
926  static const CHAR SpcFinancialCriteriaInfoDecode[] = "WVTAsn1SpcFinancialCriteriaInfoDecode";
927  static const CHAR SpcStatementTypeEncode[] = "WVTAsn1SpcStatementTypeEncode";
928  static const CHAR SpcStatementTypeDecode[] = "WVTAsn1SpcStatementTypeDecode";
929  static const CHAR CatNameValueEncode[] = "WVTAsn1CatNameValueEncode";
930  static const CHAR CatNameValueDecode[] = "WVTAsn1CatNameValueDecode";
931  static const CHAR CatMemberInfoEncode[] = "WVTAsn1CatMemberInfoEncode";
932  static const CHAR CatMemberInfoDecode[] = "WVTAsn1CatMemberInfoDecode";
933  static const CHAR SpcSpOpusInfoEncode[] = "WVTAsn1SpcSpOpusInfoEncode";
934  static const CHAR SpcSpOpusInfoDecode[] = "WVTAsn1SpcSpOpusInfoDecode";
935  static GUID Unknown1 = { 0xDE351A42, 0x8E59, 0x11D0, { 0x8C,0x47,0x00,0xC0,0x4F,0xC2,0x95,0xEE }};
936  static GUID Unknown2 = { 0xC689AABA, 0x8E78, 0x11D0, { 0x8C,0x47,0x00,0xC0,0x4F,0xC2,0x95,0xEE }};
937  static GUID Unknown3 = { 0xC689AAB8, 0x8E78, 0x11D0, { 0x8C,0x47,0x00,0xC0,0x4F,0xC2,0x95,0xEE }};
938  static GUID Unknown4 = { 0xC689AAB9, 0x8E78, 0x11D0, { 0x8C,0x47,0x00,0xC0,0x4F,0xC2,0x95,0xEE }};
939  static GUID Unknown5 = { 0xDE351A43, 0x8E59, 0x11D0, { 0x8C,0x47,0x00,0xC0,0x4F,0xC2,0x95,0xEE }};
940  static GUID Unknown6 = { 0x9BA61D3F, 0xE73A, 0x11D0, { 0x8C,0xD2,0x00,0xC0,0x4F,0xC2,0x95,0xEE }};
941  static WCHAR MagicNumber2[] = {'M','S','C','F', 0};
942  static WCHAR MagicNumber3[] = {'0','x','0','0','0','0','4','5','5','0', 0};
943  static WCHAR CafeBabe[] = {'0','x','c','a','f','e','b','a','b','e', 0};
944 
945  HRESULT CryptRegisterRes = S_OK;
946  HRESULT TrustProviderRes = S_OK;
947  HRESULT SIPAddProviderRes = S_OK;
948  HCRYPTPROV crypt_provider;
949  BOOL ret;
950 
951  TRACE("\n");
952 
953  /* Testing on native shows that when an error is encountered in one of the CryptRegisterOIDFunction calls
954  * the rest of these calls are skipped. Registering is however continued for the trust providers.
955  *
956  * We are not totally in line with native as all decoding functions are registered after all encoding
957  * functions there.
958  */
959 #define WINTRUST_REGISTEROID( oid, encode_funcname, decode_funcname ) \
960  do { \
961  if (!CryptRegisterOIDFunction(X509_ASN_ENCODING, CRYPT_OID_ENCODE_OBJECT_FUNC, oid, SP_POLICY_PROVIDER_DLL_NAME, encode_funcname)) \
962  { \
963  CryptRegisterRes = HRESULT_FROM_WIN32(GetLastError()); \
964  goto add_trust_providers; \
965  } \
966  if (!CryptRegisterOIDFunction(X509_ASN_ENCODING, CRYPT_OID_DECODE_OBJECT_FUNC, oid, SP_POLICY_PROVIDER_DLL_NAME, decode_funcname)) \
967  { \
968  CryptRegisterRes = HRESULT_FROM_WIN32(GetLastError()); \
969  goto add_trust_providers; \
970  } \
971  } while (0)
972 
973  WINTRUST_REGISTEROID(SPC_PE_IMAGE_DATA_OBJID, SpcPeImageDataEncode, SpcPeImageDataDecode);
974  WINTRUST_REGISTEROID(SPC_PE_IMAGE_DATA_STRUCT, SpcPeImageDataEncode, SpcPeImageDataDecode);
975  WINTRUST_REGISTEROID(SPC_CAB_DATA_OBJID, SpcLinkEncode, SpcLinkDecode);
976  WINTRUST_REGISTEROID(SPC_CAB_DATA_STRUCT, SpcLinkEncode, SpcLinkDecode);
977  WINTRUST_REGISTEROID(SPC_JAVA_CLASS_DATA_OBJID, SpcLinkEncode, SpcLinkDecode);
978  WINTRUST_REGISTEROID(SPC_JAVA_CLASS_DATA_STRUCT, SpcLinkEncode, SpcLinkDecode);
979  WINTRUST_REGISTEROID(SPC_LINK_OBJID, SpcLinkEncode, SpcLinkDecode);
980  WINTRUST_REGISTEROID(SPC_LINK_STRUCT, SpcLinkEncode, SpcLinkDecode);
981  WINTRUST_REGISTEROID(SPC_SIGINFO_OBJID, SpcSigInfoEncode, SpcSigInfoDecode);
982  WINTRUST_REGISTEROID(SPC_SIGINFO_STRUCT, SpcSigInfoEncode, SpcSigInfoDecode);
983  WINTRUST_REGISTEROID(SPC_INDIRECT_DATA_OBJID, SpcIndirectDataContentEncode, SpcIndirectDataContentDecode);
984  WINTRUST_REGISTEROID(SPC_INDIRECT_DATA_CONTENT_STRUCT, SpcIndirectDataContentEncode, SpcIndirectDataContentDecode);
985  WINTRUST_REGISTEROID(SPC_SP_AGENCY_INFO_OBJID, SpcSpAgencyInfoEncode, SpcSpAgencyInfoDecode);
986  WINTRUST_REGISTEROID(SPC_SP_AGENCY_INFO_STRUCT, SpcSpAgencyInfoEncode, SpcSpAgencyInfoDecode);
987  WINTRUST_REGISTEROID(SPC_MINIMAL_CRITERIA_OBJID, SpcMinimalCriteriaInfoEncode, SpcMinimalCriteriaInfoDecode);
988  WINTRUST_REGISTEROID(SPC_MINIMAL_CRITERIA_STRUCT, SpcMinimalCriteriaInfoEncode, SpcMinimalCriteriaInfoDecode);
989  WINTRUST_REGISTEROID(SPC_FINANCIAL_CRITERIA_OBJID, SpcFinancialCriteriaInfoEncode, SpcFinancialCriteriaInfoDecode);
990  WINTRUST_REGISTEROID(SPC_FINANCIAL_CRITERIA_STRUCT, SpcFinancialCriteriaInfoEncode, SpcFinancialCriteriaInfoDecode);
991  WINTRUST_REGISTEROID(SPC_STATEMENT_TYPE_OBJID, SpcStatementTypeEncode, SpcStatementTypeDecode);
992  WINTRUST_REGISTEROID(SPC_STATEMENT_TYPE_STRUCT, SpcStatementTypeEncode, SpcStatementTypeDecode);
993  WINTRUST_REGISTEROID(CAT_NAMEVALUE_OBJID, CatNameValueEncode, CatNameValueDecode);
994  WINTRUST_REGISTEROID(CAT_NAMEVALUE_STRUCT, CatNameValueEncode, CatNameValueDecode);
995  WINTRUST_REGISTEROID(CAT_MEMBERINFO_OBJID, CatMemberInfoEncode, CatMemberInfoDecode);
996  WINTRUST_REGISTEROID(CAT_MEMBERINFO_STRUCT, CatMemberInfoEncode, CatMemberInfoDecode);
997  WINTRUST_REGISTEROID(SPC_SP_OPUS_INFO_OBJID, SpcSpOpusInfoEncode, SpcSpOpusInfoDecode);
998  WINTRUST_REGISTEROID(SPC_SP_OPUS_INFO_STRUCT, SpcSpOpusInfoEncode, SpcSpOpusInfoDecode);
999 
1000 #undef WINTRUST_REGISTEROID
1001 
1002 add_trust_providers:
1003 
1004  /* Testing on W2K3 shows:
1005  * All registry writes are tried. If one fails this part will return S_FALSE.
1006  *
1007  * Last error is set to the last error encountered, regardless if the first
1008  * part failed or not.
1009  */
1010 
1011  /* Create the necessary action registry structures */
1013 
1014  /* Register several Trust Provider actions */
1016  TrustProviderRes = S_FALSE;
1018  TrustProviderRes = S_FALSE;
1020  TrustProviderRes = S_FALSE;
1022  TrustProviderRes = S_FALSE;
1024  TrustProviderRes = S_FALSE;
1026  TrustProviderRes = S_FALSE;
1028  TrustProviderRes = S_FALSE;
1030  TrustProviderRes = S_FALSE;
1032  TrustProviderRes = S_FALSE;
1033 
1034  /* Free the registry structures */
1036 
1037  /* Testing on W2K3 shows:
1038  * All registry writes are tried. If one fails this part will return S_FALSE.
1039  *
1040  * Last error is set to the last error encountered, regardless if the previous
1041  * parts failed or not.
1042  */
1043 
1044  if (!WINTRUST_SIPPAddProvider(&Unknown1, NULL))
1045  SIPAddProviderRes = S_FALSE;
1046  if (!WINTRUST_SIPPAddProvider(&Unknown2, MagicNumber2))
1047  SIPAddProviderRes = S_FALSE;
1048  if (!WINTRUST_SIPPAddProvider(&Unknown3, MagicNumber3))
1049  SIPAddProviderRes = S_FALSE;
1050  if (!WINTRUST_SIPPAddProvider(&Unknown4, CafeBabe))
1051  SIPAddProviderRes = S_FALSE;
1052  if (!WINTRUST_SIPPAddProvider(&Unknown5, CafeBabe))
1053  SIPAddProviderRes = S_FALSE;
1054  if (!WINTRUST_SIPPAddProvider(&Unknown6, CafeBabe))
1055  SIPAddProviderRes = S_FALSE;
1056 
1057  /* Native does a CryptSIPRemoveProvider here for {941C2937-1292-11D1-85BE-00C04FC295EE}.
1058  * This SIP Provider is however not found on up-to-date window install and native will
1059  * set the last error to ERROR_FILE_NOT_FOUND.
1060  * Wine has the last error set to ERROR_INVALID_PARAMETER. There shouldn't be an app
1061  * depending on this last error though so there is no need to imitate native to the full extent.
1062  *
1063  * (The ERROR_INVALID_PARAMETER for Wine it totally valid as we (and native) do register
1064  * a trust provider without a diagnostic policy).
1065  */
1066 
1067  /* Create a dummy context to force creation of the MachineGuid registry key. */
1068  ret = CryptAcquireContextW(&crypt_provider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT);
1069  if (ret) CryptReleaseContext(crypt_provider, 0);
1070  else ERR("Failed to acquire cryptographic context: %u\n", GetLastError());
1071 
1072  /* If CryptRegisterRes is not S_OK it will always overrule the return value. */
1073  if (CryptRegisterRes != S_OK)
1074  return CryptRegisterRes;
1075  else if (SIPAddProviderRes == S_OK)
1076  return TrustProviderRes;
1077  else
1078  return SIPAddProviderRes;
1079 }
#define SPC_FINANCIAL_CRITERIA_OBJID
Definition: wintrust.h:495
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES IN DWORD Unknown3
Definition: conport.c:35
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define SPC_CAB_DATA_OBJID
Definition: wintrust.h:492
char CHAR
Definition: xmlstorage.h:175
#define SPC_LINK_STRUCT
Definition: wintrust.h:506
#define SPC_SP_AGENCY_INFO_OBJID
Definition: wintrust.h:482
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES IN DWORD IN DWORD IN DWORD IN DWORD Unknown6
Definition: conport.c:35
static BOOL WINTRUST_RegisterGenCertVerify(void)
Definition: register.c:506
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1056
static BOOL WINTRUST_RegisterPublishedSoftwareNoBadUi(void)
Definition: register.c:476
#define SPC_MINIMAL_CRITERIA_STRUCT
Definition: wintrust.h:502
#define CAT_MEMBERINFO_STRUCT
Definition: wintrust.h:513
#define SPC_LINK_OBJID
Definition: wintrust.h:496
static BOOL WINTRUST_RegisterGenVerifyV2(void)
Definition: register.c:405
#define CAT_NAMEVALUE_OBJID
Definition: wintrust.h:498
BOOL WINAPI CryptAcquireContextW(HCRYPTPROV *phProv, LPCWSTR pszContainer, LPCWSTR pszProvider, DWORD dwProvType, DWORD dwFlags)
Definition: crypt.c:329
#define SPC_SP_OPUS_INFO_OBJID
Definition: wintrust.h:484
#define SPC_CAB_DATA_STRUCT
Definition: wintrust.h:509
static BOOL WINTRUST_RegisterTrustProviderTest(void)
Definition: register.c:536
#define CAT_NAMEVALUE_STRUCT
Definition: wintrust.h:512
PRTL_UNICODE_STRING_BUFFER PULONG PULONG Unknown4
BOOL WINAPI CryptReleaseContext(HCRYPTPROV hProv, DWORD dwFlags)
Definition: crypt.c:619
#define SPC_SP_OPUS_INFO_STRUCT
Definition: wintrust.h:508
static BOOL WINTRUST_RegisterOfficeSignVerify(void)
Definition: register.c:618
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:557
#define SPC_SP_AGENCY_INFO_STRUCT
Definition: wintrust.h:501
#define SPC_STATEMENT_TYPE_OBJID
Definition: wintrust.h:483
#define SPC_PE_IMAGE_DATA_OBJID
Definition: wintrust.h:486
#define TRACE(s)
Definition: solgame.cpp:4
unsigned int BOOL
Definition: ntddk_ex.h:94
LONG HRESULT
Definition: typedefs.h:77
static BOOL WINTRUST_RegisterPublishedSoftware(void)
Definition: register.c:444
static BOOL WINTRUST_SIPPAddProvider(GUID *Subject, WCHAR *MagicNumber)
Definition: register.c:869
int ret
#define SPC_STATEMENT_TYPE_STRUCT
Definition: wintrust.h:507
static void WINTRUST_InitRegStructs(void)
Definition: register.c:76
#define SPC_INDIRECT_DATA_CONTENT_STRUCT
Definition: wintrust.h:504
#define SPC_MINIMAL_CRITERIA_OBJID
Definition: wintrust.h:494
#define CRYPT_VERIFYCONTEXT
Definition: wincrypt.h:2031
#define ERR(fmt,...)
Definition: debug.h:109
static BOOL WINTRUST_RegisterGenChainVerify(void)
Definition: register.c:680
#define S_OK
Definition: intsafe.h:59
static BOOL WINTRUST_RegisterDriverVerify(void)
Definition: register.c:649
ULONG_PTR HCRYPTPROV
Definition: wincrypt.h:46
static BOOL WINTRUST_RegisterHttpsProv(void)
Definition: register.c:566
#define SPC_SIGINFO_OBJID
Definition: wintrust.h:497
#define CAT_MEMBERINFO_OBJID
Definition: wintrust.h:499
static void WINTRUST_FreeRegStructs(void)
Definition: register.c:113
#define SPC_FINANCIAL_CRITERIA_STRUCT
Definition: wintrust.h:503
#define SPC_INDIRECT_DATA_OBJID
Definition: wintrust.h:481
#define SPC_SIGINFO_STRUCT
Definition: wintrust.h:511
#define SPC_PE_IMAGE_DATA_STRUCT
Definition: wintrust.h:505
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES IN DWORD IN DWORD IN DWORD Unknown5
Definition: conport.c:35
#define SPC_JAVA_CLASS_DATA_OBJID
Definition: wintrust.h:489
#define SPC_JAVA_CLASS_DATA_STRUCT
Definition: wintrust.h:510
#define WINTRUST_REGISTEROID(oid, encode_funcname, decode_funcname)
#define PROV_RSA_FULL
Definition: wincrypt.h:2001
HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 1084 of file register.c.

1085 {
1086  FIXME("stub\n");
1087  return S_OK;
1088 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:59
HRESULT WINAPI mscat32DllRegisterServer ( void  )

Definition at line 1152 of file register.c.

1153 {
1154  FIXME("stub\n");
1155  return S_OK;
1156 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:59
HRESULT WINAPI mscat32DllUnregisterServer ( void  )

Definition at line 1161 of file register.c.

1162 {
1163  FIXME("stub\n");
1164  return S_OK;
1165 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:59
HRESULT WINAPI mssip32DllRegisterServer ( void  )

Definition at line 1170 of file register.c.

1171 {
1172  FIXME("stub\n");
1173  return S_OK;
1174 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:59
HRESULT WINAPI mssip32DllUnregisterServer ( void  )

Definition at line 1179 of file register.c.

1180 {
1181  FIXME("stub\n");
1182  return S_OK;
1183 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:59
HRESULT WINAPI SoftpubDllRegisterServer ( void  )

Definition at line 1105 of file register.c.

1106 {
1107  HRESULT TrustProviderRes = S_OK;
1108 
1109  TRACE("\n");
1110 
1111  /* Create the necessary action registry structures */
1113 
1114  /* Register several Trust Provider actions */
1116  TrustProviderRes = S_FALSE;
1118  TrustProviderRes = S_FALSE;
1120  TrustProviderRes = S_FALSE;
1122  TrustProviderRes = S_FALSE;
1124  TrustProviderRes = S_FALSE;
1126  TrustProviderRes = S_FALSE;
1128  TrustProviderRes = S_FALSE;
1130  TrustProviderRes = S_FALSE;
1132  TrustProviderRes = S_FALSE;
1133 
1134  /* Free the registry structures */
1136 
1137  return TrustProviderRes;
1138 }
static BOOL WINTRUST_RegisterGenCertVerify(void)
Definition: register.c:506
static BOOL WINTRUST_RegisterPublishedSoftwareNoBadUi(void)
Definition: register.c:476
static BOOL WINTRUST_RegisterGenVerifyV2(void)
Definition: register.c:405
static BOOL WINTRUST_RegisterTrustProviderTest(void)
Definition: register.c:536
static BOOL WINTRUST_RegisterOfficeSignVerify(void)
Definition: register.c:618
#define S_FALSE
Definition: winerror.h:2357
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
static BOOL WINTRUST_RegisterPublishedSoftware(void)
Definition: register.c:444
static void WINTRUST_InitRegStructs(void)
Definition: register.c:76
static BOOL WINTRUST_RegisterGenChainVerify(void)
Definition: register.c:680
#define S_OK
Definition: intsafe.h:59
static BOOL WINTRUST_RegisterDriverVerify(void)
Definition: register.c:649
static BOOL WINTRUST_RegisterHttpsProv(void)
Definition: register.c:566
static void WINTRUST_FreeRegStructs(void)
Definition: register.c:113
HRESULT WINAPI SoftpubDllUnregisterServer ( void  )

Definition at line 1143 of file register.c.

1144 {
1145  FIXME("stub\n");
1146  return S_OK;
1147 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:59
WINE_DEFAULT_DEBUG_CHANNEL ( wintrust  )
static void WINTRUST_FreeRegStructs ( void  )
static

Definition at line 113 of file register.c.

Referenced by DllRegisterServer(), and SoftpubDllRegisterServer().

114 {
115 #define WINTRUST_FREEREGENTRY( action ) \
116  WINTRUST_Free(action.pwszDLLName); \
117  WINTRUST_Free(action.pwszFunctionName);
118 
137 
138 #undef WINTRUST_FREEREGENTRY
139 }
static CRYPT_TRUST_REG_ENTRY SoftpubSignature
Definition: register.c:27
static CRYPT_TRUST_REG_ENTRY HTTPSCertificateTrust
Definition: register.c:37
static CRYPT_TRUST_REG_ENTRY OfficeCleanupPolicy
Definition: register.c:41
static CRYPT_TRUST_REG_ENTRY GenericChainFinalProv
Definition: register.c:48
static CRYPT_TRUST_REG_ENTRY DriverFinalPolicy
Definition: register.c:44
static CRYPT_TRUST_REG_ENTRY SoftpubInitialization
Definition: register.c:25
static CRYPT_TRUST_REG_ENTRY OfficeInitializePolicy
Definition: register.c:40
static CRYPT_TRUST_REG_ENTRY DriverInitializePolicy
Definition: register.c:43
static CRYPT_TRUST_REG_ENTRY GenericChainCertificateTrust
Definition: register.c:47
#define WINTRUST_FREEREGENTRY(action)
static CRYPT_TRUST_REG_ENTRY SoftpubCertificate
Definition: register.c:28
static CRYPT_TRUST_REG_ENTRY SoftpubDefCertInit
Definition: register.c:33
static CRYPT_TRUST_REG_ENTRY SoftpubCertCheck
Definition: register.c:29
static CRYPT_TRUST_REG_ENTRY SoftpubCleanup
Definition: register.c:31
static CRYPT_TRUST_REG_ENTRY SoftpubMessage
Definition: register.c:26
static CRYPT_TRUST_REG_ENTRY HTTPSFinalProv
Definition: register.c:38
static CRYPT_TRUST_REG_ENTRY SoftpubDumpStructure
Definition: register.c:35
static CRYPT_TRUST_REG_ENTRY SoftpubFinalPolicy
Definition: register.c:30
static CRYPT_TRUST_REG_ENTRY DriverCleanupPolicy
Definition: register.c:45
static void WINTRUST_Guid2Wstr ( const GUID pgActionID,
WCHAR GuidString 
)
static

Definition at line 147 of file register.c.

Referenced by WintrustAddActionID(), WintrustAddDefaultForUsage(), WintrustLoadFunctionPointers(), and WintrustRemoveActionID().

148 {
149  static const WCHAR wszFormat[] = {'{','%','0','8','l','X','-','%','0','4','X','-','%','0','4','X','-',
150  '%','0','2','X','%','0','2','X','-','%','0','2','X','%','0','2','X','%','0','2','X','%','0','2',
151  'X','%','0','2','X','%','0','2','X','}', 0};
152 
153  wsprintfW(GuidString, wszFormat, pgActionID->Data1, pgActionID->Data2, pgActionID->Data3,
154  pgActionID->Data4[0], pgActionID->Data4[1], pgActionID->Data4[2], pgActionID->Data4[3],
155  pgActionID->Data4[4], pgActionID->Data4[5], pgActionID->Data4[6], pgActionID->Data4[7]);
156 }
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
__wchar_t WCHAR
Definition: xmlstorage.h:180
static void WINTRUST_InitRegStructs ( void  )
static

Definition at line 76 of file register.c.

Referenced by DllRegisterServer(), and SoftpubDllRegisterServer().

77 {
78 #define WINTRUST_INITREGENTRY( action, dllname, functionname ) \
79  action.cbStruct = sizeof(CRYPT_TRUST_REG_ENTRY); \
80  action.pwszDLLName = WINTRUST_Alloc(sizeof(dllname)); \
81  lstrcpyW(action.pwszDLLName, dllname); \
82  action.pwszFunctionName = WINTRUST_Alloc(sizeof(functionname)); \
83  lstrcpyW(action.pwszFunctionName, functionname);
84 
87  WINTRUST_INITREGENTRY(SoftpubSignature, SP_POLICY_PROVIDER_DLL_NAME, SP_SIGTRUST_FUNCTION)
89  WINTRUST_INITREGENTRY(SoftpubCertCheck, SP_POLICY_PROVIDER_DLL_NAME, SP_CHKCERT_FUNCTION)
103 
104 #undef WINTRUST_INITREGENTRY
105 }
static const WCHAR DRIVER_CLEANUPPOLICY_FUNCTION[]
Definition: softpub.h:219
static const WCHAR HTTPS_CERTTRUST_FUNCTION[]
Definition: softpub.h:171
static CRYPT_TRUST_REG_ENTRY SoftpubSignature
Definition: register.c:27
static const WCHAR SP_CLEANUPPOLICY_FUNCTION[]
Definition: softpub.h:142
static CRYPT_TRUST_REG_ENTRY HTTPSCertificateTrust
Definition: register.c:37
static const WCHAR SP_GENERIC_CERT_INIT_FUNCTION[]
Definition: softpub.h:33
static const WCHAR SP_OBJTRUST_FUNCTION[]
Definition: softpub.h:134
static CRYPT_TRUST_REG_ENTRY OfficeCleanupPolicy
Definition: register.c:41
static CRYPT_TRUST_REG_ENTRY GenericChainFinalProv
Definition: register.c:48
static const WCHAR DRIVER_FINALPOLPROV_FUNCTION[]
Definition: softpub.h:217
static const WCHAR OFFICE_POLICY_PROVIDER_DLL_NAME[]
Definition: softpub.h:192
static const WCHAR SP_TESTDUMPPOLICY_FUNCTION_TEST[]
Definition: softpub.h:155
static CRYPT_TRUST_REG_ENTRY DriverFinalPolicy
Definition: register.c:44
static CRYPT_TRUST_REG_ENTRY SoftpubInitialization
Definition: register.c:25
static CRYPT_TRUST_REG_ENTRY OfficeInitializePolicy
Definition: register.c:40
static const WCHAR HTTPS_FINALPOLICY_FUNCTION[]
Definition: softpub.h:173
static CRYPT_TRUST_REG_ENTRY DriverInitializePolicy
Definition: register.c:43
static CRYPT_TRUST_REG_ENTRY GenericChainCertificateTrust
Definition: register.c:47
static const WCHAR WT_PROVIDER_CERTTRUST_FUNCTION[]
Definition: wintrust.h:460
static const WCHAR SP_SIGTRUST_FUNCTION[]
Definition: softpub.h:136
static const WCHAR SP_POLICY_PROVIDER_DLL_NAME[]
Definition: softpub.h:104
static const WCHAR GENERIC_CHAIN_CERTTRUST_FUNCTION[]
Definition: softpub.h:51
#define WINTRUST_INITREGENTRY(action, dllname, functionname)
static const WCHAR DRIVER_INITPROV_FUNCTION[]
Definition: softpub.h:215
static const WCHAR SP_FINALPOLICY_FUNCTION[]
Definition: softpub.h:140
static const WCHAR SP_CHKCERT_FUNCTION[]
Definition: softpub.h:138
static CRYPT_TRUST_REG_ENTRY SoftpubCertificate
Definition: register.c:28
static const WCHAR OFFICE_CLEANUPPOLICY_FUNCTION[]
Definition: softpub.h:196
static CRYPT_TRUST_REG_ENTRY SoftpubDefCertInit
Definition: register.c:33
static CRYPT_TRUST_REG_ENTRY SoftpubCertCheck
Definition: register.c:29
static CRYPT_TRUST_REG_ENTRY SoftpubCleanup
Definition: register.c:31
static const WCHAR GENERIC_CHAIN_FINALPOLICY_FUNCTION[]
Definition: softpub.h:49
static CRYPT_TRUST_REG_ENTRY SoftpubMessage
Definition: register.c:26
static const WCHAR OFFICE_INITPROV_FUNCTION[]
Definition: softpub.h:194
static const WCHAR SP_INIT_FUNCTION[]
Definition: softpub.h:132
static CRYPT_TRUST_REG_ENTRY HTTPSFinalProv
Definition: register.c:38
static CRYPT_TRUST_REG_ENTRY SoftpubDumpStructure
Definition: register.c:35
static CRYPT_TRUST_REG_ENTRY SoftpubFinalPolicy
Definition: register.c:30
static CRYPT_TRUST_REG_ENTRY DriverCleanupPolicy
Definition: register.c:45
static FARPROC WINTRUST_ReadProviderFromReg ( WCHAR GuidString,
const WCHAR FunctionType 
)
static

Definition at line 782 of file register.c.

Referenced by WintrustLoadFunctionPointers().

783 {
784  WCHAR ProvKey[MAX_PATH], DllName[MAX_PATH];
785  char FunctionName[MAX_PATH];
786  HKEY Key;
787  LONG Res = ERROR_SUCCESS;
788  DWORD Size;
789  HMODULE Lib;
790  FARPROC Func = NULL;
791 
792  /* Create the needed key string */
793  ProvKey[0]='\0';
794  lstrcatW(ProvKey, Trust);
795  lstrcatW(ProvKey, FunctionType);
796  lstrcatW(ProvKey, GuidString);
797 
798  Res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, ProvKey, 0, KEY_READ, &Key);
799  if (Res != ERROR_SUCCESS) return NULL;
800 
801  /* Read the $DLL entry */
802  Size = sizeof(DllName);
803  Res = RegQueryValueExW(Key, Dll, NULL, NULL, (LPBYTE)DllName, &Size);
804  if (Res != ERROR_SUCCESS) goto error_close_key;
805 
806  /* Read the $Function entry */
807  Size = sizeof(FunctionName);
808  Res = RegQueryValueExA(Key, "$Function", NULL, NULL, (LPBYTE)FunctionName, &Size);
809  if (Res != ERROR_SUCCESS) goto error_close_key;
810 
811  /* Load the library - there appears to be no way to close a provider, so
812  * just leak the module handle.
813  */
814  Lib = LoadLibraryW(DllName);
815  Func = GetProcAddress(Lib, FunctionName);
816 
817 error_close_key:
818  RegCloseKey(Key);
819 
820  return Func;
821 }
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4041
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_READ
Definition: nt_native.h:1023
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned char * LPBYTE
Definition: typedefs.h:52
DWORD DWORD
Definition: winlogon.h:75
static const WCHAR Trust[]
Definition: register.c:52
static const WCHAR Dll[]
Definition: register.c:68
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
#define LoadLibraryW(x)
Definition: compat.h:404
smooth NULL
Definition: ftsmooth.c:557
UINTN Size
Definition: acefiex.h:555
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4134
HANDLE HKEY
Definition: registry.h:24
#define MAX_PATH
Definition: compat.h:26
void(* Func)(int)
int(* FARPROC)()
Definition: compat.h:28
HANDLE HMODULE
Definition: typedefs.h:75
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 const char UINT32 const char * FunctionName
Definition: acpixf.h:1256
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
#define GetProcAddress(x, y)
Definition: compat.h:410
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
ACPI_EFI_INPUT_KEY * Key
Definition: acefiex.h:303
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
static BOOL WINTRUST_RegisterDriverVerify ( void  )
static

Definition at line 649 of file register.c.

Referenced by DllRegisterServer(), and SoftpubDllRegisterServer().

650 {
651  static GUID ProvGUID = DRIVER_ACTION_VERIFY;
652  CRYPT_REGISTER_ACTIONID ProvInfo;
653 
654  ProvInfo.cbStruct = sizeof(CRYPT_REGISTER_ACTIONID);
656  ProvInfo.sObjectProvider = SoftpubMessage;
661  ProvInfo.sTestPolicyProvider = NullCTRE; /* No diagnostic policy */
663 
664 
665  if (!WintrustAddActionID(&ProvGUID, 0, &ProvInfo))
666  return FALSE;
667 
668  return TRUE;
669 }
#define TRUE
Definition: types.h:120
static CRYPT_TRUST_REG_ENTRY SoftpubSignature
Definition: register.c:27
static CRYPT_TRUST_REG_ENTRY DriverFinalPolicy
Definition: register.c:44
CRYPT_TRUST_REG_ENTRY sFinalPolicyProvider
Definition: wintrust.h:180
CRYPT_TRUST_REG_ENTRY sTestPolicyProvider
Definition: wintrust.h:181
#define FALSE
Definition: types.h:117
CRYPT_TRUST_REG_ENTRY sCleanupProvider
Definition: wintrust.h:182
static CRYPT_TRUST_REG_ENTRY DriverInitializePolicy
Definition: register.c:43
static CRYPT_TRUST_REG_ENTRY SoftpubCertificate
Definition: register.c:28
static CRYPT_TRUST_REG_ENTRY SoftpubCertCheck
Definition: register.c:29
static CRYPT_TRUST_REG_ENTRY SoftpubMessage
Definition: register.c:26
#define DRIVER_ACTION_VERIFY
Definition: softpub.h:200
struct _CRYPT_REGISTER_ACTIONID CRYPT_REGISTER_ACTIONID
CRYPT_TRUST_REG_ENTRY sCertificateProvider
Definition: wintrust.h:178
CRYPT_TRUST_REG_ENTRY sInitProvider
Definition: wintrust.h:175
static const CRYPT_TRUST_REG_ENTRY NullCTRE
Definition: register.c:50
BOOL WINAPI WintrustAddActionID(GUID *pgActionID, DWORD fdwFlags, CRYPT_REGISTER_ACTIONID *psProvInfo)
Definition: register.c:223
CRYPT_TRUST_REG_ENTRY sSignatureProvider
Definition: wintrust.h:177
CRYPT_TRUST_REG_ENTRY sObjectProvider
Definition: wintrust.h:176
CRYPT_TRUST_REG_ENTRY sCertificatePolicyProvider
Definition: wintrust.h:179
static CRYPT_TRUST_REG_ENTRY DriverCleanupPolicy
Definition: register.c:45
static BOOL WINTRUST_RegisterGenCertVerify ( void  )
static

Definition at line 506 of file register.c.

Referenced by DllRegisterServer(), and SoftpubDllRegisterServer().

507 {
508  static GUID ProvGUID = WINTRUST_ACTION_GENERIC_CERT_VERIFY;
509  CRYPT_REGISTER_ACTIONID ProvInfo;
510 
511  ProvInfo.cbStruct = sizeof(CRYPT_REGISTER_ACTIONID);
513  ProvInfo.sObjectProvider = SoftpubMessage;
518  ProvInfo.sTestPolicyProvider = NullCTRE; /* No diagnostic policy */
519  ProvInfo.sCleanupProvider = SoftpubCleanup;
520 
521  if (!WintrustAddActionID(&ProvGUID, 0, &ProvInfo))
522  return FALSE;
523 
524  return TRUE;
525 }
#define TRUE
Definition: types.h:120
static CRYPT_TRUST_REG_ENTRY SoftpubSignature
Definition: register.c:27
CRYPT_TRUST_REG_ENTRY sFinalPolicyProvider
Definition: wintrust.h:180
CRYPT_TRUST_REG_ENTRY sTestPolicyProvider
Definition: wintrust.h:181
#define FALSE
Definition: types.h:117
CRYPT_TRUST_REG_ENTRY sCleanupProvider
Definition: wintrust.h:182
static CRYPT_TRUST_REG_ENTRY SoftpubCertificate
Definition: register.c:28
static CRYPT_TRUST_REG_ENTRY SoftpubDefCertInit
Definition: register.c:33
static CRYPT_TRUST_REG_ENTRY SoftpubCertCheck
Definition: register.c:29
static CRYPT_TRUST_REG_ENTRY SoftpubCleanup
Definition: register.c:31
#define WINTRUST_ACTION_GENERIC_CERT_VERIFY
Definition: softpub.h:24
static CRYPT_TRUST_REG_ENTRY SoftpubMessage
Definition: register.c:26
struct _CRYPT_REGISTER_ACTIONID CRYPT_REGISTER_ACTIONID
CRYPT_TRUST_REG_ENTRY sCertificateProvider
Definition: wintrust.h:178
CRYPT_TRUST_REG_ENTRY sInitProvider
Definition: wintrust.h:175
static const CRYPT_TRUST_REG_ENTRY NullCTRE
Definition: register.c:50
BOOL WINAPI WintrustAddActionID(GUID *pgActionID, DWORD fdwFlags, CRYPT_REGISTER_ACTIONID *psProvInfo)
Definition: register.c:223
CRYPT_TRUST_REG_ENTRY sSignatureProvider
Definition: wintrust.h:177
CRYPT_TRUST_REG_ENTRY sObjectProvider
Definition: wintrust.h:176
static CRYPT_TRUST_REG_ENTRY SoftpubFinalPolicy
Definition: register.c:30
CRYPT_TRUST_REG_ENTRY sCertificatePolicyProvider
Definition: wintrust.h:179
static BOOL WINTRUST_RegisterGenChainVerify ( void  )
static

Definition at line 680 of file register.c.

Referenced by DllRegisterServer(), and SoftpubDllRegisterServer().

681 {
682  static GUID ProvGUID = WINTRUST_ACTION_GENERIC_CHAIN_VERIFY;
683  CRYPT_REGISTER_ACTIONID ProvInfo;
684 
685  ProvInfo.cbStruct = sizeof(CRYPT_REGISTER_ACTIONID);
687  ProvInfo.sObjectProvider = SoftpubMessage;
692  ProvInfo.sTestPolicyProvider = NullCTRE; /* No diagnostic policy */
693  ProvInfo.sCleanupProvider = SoftpubCleanup;
694 
695  if (!WintrustAddActionID(&ProvGUID, 0, &ProvInfo))
696  return FALSE;
697 
698  return TRUE;
699 }
#define TRUE
Definition: types.h:120
static CRYPT_TRUST_REG_ENTRY SoftpubSignature
Definition: register.c:27
static CRYPT_TRUST_REG_ENTRY GenericChainFinalProv
Definition: register.c:48
CRYPT_TRUST_REG_ENTRY sFinalPolicyProvider
Definition: wintrust.h:180
CRYPT_TRUST_REG_ENTRY sTestPolicyProvider
Definition: wintrust.h:181
static CRYPT_TRUST_REG_ENTRY SoftpubInitialization
Definition: register.c:25
#define FALSE
Definition: types.h:117
CRYPT_TRUST_REG_ENTRY sCleanupProvider
Definition: wintrust.h:182
static CRYPT_TRUST_REG_ENTRY GenericChainCertificateTrust
Definition: register.c:47
static CRYPT_TRUST_REG_ENTRY SoftpubCertCheck
Definition: register.c:29
static CRYPT_TRUST_REG_ENTRY SoftpubCleanup
Definition: register.c:31
static CRYPT_TRUST_REG_ENTRY SoftpubMessage
Definition: register.c:26
struct _CRYPT_REGISTER_ACTIONID CRYPT_REGISTER_ACTIONID
CRYPT_TRUST_REG_ENTRY sCertificateProvider
Definition: wintrust.h:178
CRYPT_TRUST_REG_ENTRY sInitProvider
Definition: wintrust.h:175
static const CRYPT_TRUST_REG_ENTRY NullCTRE
Definition: register.c:50
BOOL WINAPI WintrustAddActionID(GUID *pgActionID, DWORD fdwFlags, CRYPT_REGISTER_ACTIONID *psProvInfo)
Definition: register.c:223
CRYPT_TRUST_REG_ENTRY sSignatureProvider
Definition: wintrust.h:177
CRYPT_TRUST_REG_ENTRY sObjectProvider
Definition: wintrust.h:176
CRYPT_TRUST_REG_ENTRY sCertificatePolicyProvider
Definition: wintrust.h:179
#define WINTRUST_ACTION_GENERIC_CHAIN_VERIFY
Definition: softpub.h:37
static BOOL WINTRUST_RegisterGenVerifyV2 ( void  )
static

Definition at line 405 of file register.c.

Referenced by DllRegisterServer(), and SoftpubDllRegisterServer().

406 {
407  BOOL RegisteredOK = TRUE;
408  static GUID ProvGUID = WINTRUST_ACTION_GENERIC_VERIFY_V2;
409  CRYPT_REGISTER_ACTIONID ProvInfo;
411  &ProvGUID,
412  NULL, /* No Dll provided */
413  NULL, /* No load callback function */
414  NULL }; /* No free callback function */
415 
416  ProvInfo.cbStruct = sizeof(CRYPT_REGISTER_ACTIONID);
418  ProvInfo.sObjectProvider = SoftpubMessage;
423  ProvInfo.sTestPolicyProvider = NullCTRE; /* No diagnostic policy */
424  ProvInfo.sCleanupProvider = SoftpubCleanup;
425 
427  RegisteredOK = FALSE;
428 
429  if (!WintrustAddActionID(&ProvGUID, 0, &ProvInfo))
430  RegisteredOK = FALSE;
431 
432  return RegisteredOK;
433 }
#define TRUE
Definition: types.h:120
static CRYPT_TRUST_REG_ENTRY SoftpubSignature
Definition: register.c:27
BOOL WINAPI WintrustAddDefaultForUsage(const char *pszUsageOID, CRYPT_PROVIDER_REGDEFUSAGE *psDefUsage)
Definition: register.c:718
#define szOID_PKIX_KP_CODE_SIGNING
Definition: wincrypt.h:3242
CRYPT_TRUST_REG_ENTRY sFinalPolicyProvider
Definition: wintrust.h:180
#define WINTRUST_ACTION_GENERIC_VERIFY_V2
Definition: softpub.h:108
CRYPT_TRUST_REG_ENTRY sTestPolicyProvider
Definition: wintrust.h:181
static CRYPT_TRUST_REG_ENTRY SoftpubInitialization
Definition: register.c:25
#define FALSE
Definition: types.h:117
CRYPT_TRUST_REG_ENTRY sCleanupProvider
Definition: wintrust.h:182
smooth NULL
Definition: ftsmooth.c:557
unsigned int BOOL
Definition: ntddk_ex.h:94
static CRYPT_TRUST_REG_ENTRY SoftpubCertificate
Definition: register.c:28
struct _CRYPT_PROVIDER_REGDEFUSAGE CRYPT_PROVIDER_REGDEFUSAGE
static CRYPT_TRUST_REG_ENTRY SoftpubCertCheck
Definition: register.c:29
static CRYPT_TRUST_REG_ENTRY SoftpubCleanup
Definition: register.c:31
static CRYPT_TRUST_REG_ENTRY SoftpubMessage
Definition: register.c:26
struct _CRYPT_REGISTER_ACTIONID CRYPT_REGISTER_ACTIONID
CRYPT_TRUST_REG_ENTRY sCertificateProvider
Definition: wintrust.h:178
CRYPT_TRUST_REG_ENTRY sInitProvider
Definition: wintrust.h:175
static const CRYPT_TRUST_REG_ENTRY NullCTRE
Definition: register.c:50
BOOL WINAPI WintrustAddActionID(GUID *pgActionID, DWORD fdwFlags, CRYPT_REGISTER_ACTIONID *psProvInfo)
Definition: register.c:223
CRYPT_TRUST_REG_ENTRY sSignatureProvider
Definition: wintrust.h:177
CRYPT_TRUST_REG_ENTRY sObjectProvider
Definition: wintrust.h:176
static CRYPT_TRUST_REG_ENTRY SoftpubFinalPolicy
Definition: register.c:30
CRYPT_TRUST_REG_ENTRY sCertificatePolicyProvider
Definition: wintrust.h:179
static BOOL WINTRUST_RegisterHttpsProv ( void  )
static

Definition at line 566 of file register.c.

Referenced by DllRegisterServer(), and SoftpubDllRegisterServer().

567 {
568  BOOL RegisteredOK = TRUE;
569  static CHAR SoftpubLoadUsage[] = "SoftpubLoadDefUsageCallData";
570  static CHAR SoftpubFreeUsage[] = "SoftpubFreeDefUsageCallData";
571  static GUID ProvGUID = HTTPSPROV_ACTION;
572  CRYPT_REGISTER_ACTIONID ProvInfo;
574  &ProvGUID,
575  NULL, /* Will be filled later */
576  SoftpubLoadUsage,
577  SoftpubFreeUsage };
578 
579  ProvInfo.cbStruct = sizeof(CRYPT_REGISTER_ACTIONID);
581  ProvInfo.sObjectProvider = SoftpubMessage;
586  ProvInfo.sTestPolicyProvider = NullCTRE; /* No diagnostic policy */
587  ProvInfo.sCleanupProvider = SoftpubCleanup;
588 
591 
593  RegisteredOK = FALSE;
595  RegisteredOK = FALSE;
597  RegisteredOK = FALSE;
599  RegisteredOK = FALSE;
600 
601  WINTRUST_Free(DefUsage.pwszDllName);
602 
603  if (!WintrustAddActionID(&ProvGUID, 0, &ProvInfo))
604  RegisteredOK = FALSE;
605 
606  return RegisteredOK;
607 }
#define TRUE
Definition: types.h:120
static CRYPT_TRUST_REG_ENTRY SoftpubSignature
Definition: register.c:27
BOOL WINAPI WintrustAddDefaultForUsage(const char *pszUsageOID, CRYPT_PROVIDER_REGDEFUSAGE *psDefUsage)
Definition: register.c:718
static CRYPT_TRUST_REG_ENTRY HTTPSCertificateTrust
Definition: register.c:37
char CHAR
Definition: xmlstorage.h:175
#define szOID_PKIX_KP_SERVER_AUTH
Definition: wincrypt.h:3240
CRYPT_TRUST_REG_ENTRY sFinalPolicyProvider
Definition: wintrust.h:180
CRYPT_TRUST_REG_ENTRY sTestPolicyProvider
Definition: wintrust.h:181
static CRYPT_TRUST_REG_ENTRY SoftpubInitialization
Definition: register.c:25
#define FALSE
Definition: types.h:117
CRYPT_TRUST_REG_ENTRY sCleanupProvider
Definition: wintrust.h:182
smooth NULL
Definition: ftsmooth.c:557
static const WCHAR SP_POLICY_PROVIDER_DLL_NAME[]
Definition: softpub.h:104
void WINAPI WINTRUST_Free(void *p)
Definition: wintrust_main.c:40
#define szOID_SGC_NETSCAPE
Definition: wincrypt.h:3162
void *WINAPI WINTRUST_Alloc(DWORD cb)
Definition: wintrust_main.c:29
unsigned int BOOL
Definition: ntddk_ex.h:94
#define HTTPSPROV_ACTION
Definition: softpub.h:159
struct _CRYPT_PROVIDER_REGDEFUSAGE CRYPT_PROVIDER_REGDEFUSAGE
static CRYPT_TRUST_REG_ENTRY SoftpubCertCheck
Definition: register.c:29
static CRYPT_TRUST_REG_ENTRY SoftpubCleanup
Definition: register.c:31
static CRYPT_TRUST_REG_ENTRY SoftpubMessage
Definition: register.c:26
struct _CRYPT_REGISTER_ACTIONID CRYPT_REGISTER_ACTIONID
CRYPT_TRUST_REG_ENTRY sCertificateProvider
Definition: wintrust.h:178
static CRYPT_TRUST_REG_ENTRY HTTPSFinalProv
Definition: register.c:38
CRYPT_TRUST_REG_ENTRY sInitProvider
Definition: wintrust.h:175
static const CRYPT_TRUST_REG_ENTRY NullCTRE
Definition: register.c:50
#define lstrcpyW
Definition: compat.h:406
BOOL WINAPI WintrustAddActionID(GUID *pgActionID, DWORD fdwFlags, CRYPT_REGISTER_ACTIONID *psProvInfo)
Definition: register.c:223
CRYPT_TRUST_REG_ENTRY sSignatureProvider
Definition: wintrust.h:177
#define szOID_SERVER_GATED_CRYPTO
Definition: wincrypt.h:3159
CRYPT_TRUST_REG_ENTRY sObjectProvider
Definition: wintrust.h:176
CRYPT_TRUST_REG_ENTRY sCertificatePolicyProvider
Definition: wintrust.h:179
#define szOID_PKIX_KP_CLIENT_AUTH
Definition: wincrypt.h:3241
static BOOL WINTRUST_RegisterOfficeSignVerify ( void  )
static

Definition at line 618 of file register.c.

Referenced by DllRegisterServer(), and SoftpubDllRegisterServer().

619 {
620  static GUID ProvGUID = OFFICESIGN_ACTION_VERIFY;
621  CRYPT_REGISTER_ACTIONID ProvInfo;
622 
623  ProvInfo.cbStruct = sizeof(CRYPT_REGISTER_ACTIONID);
625  ProvInfo.sObjectProvider = SoftpubMessage;
630  ProvInfo.sTestPolicyProvider = NullCTRE; /* No diagnostic policy */
632 
633 
634  if (!WintrustAddActionID(&ProvGUID, 0, &ProvInfo))
635  return FALSE;
636 
637  return TRUE;
638 }
#define TRUE
Definition: types.h:120
static CRYPT_TRUST_REG_ENTRY SoftpubSignature
Definition: register.c:27
static CRYPT_TRUST_REG_ENTRY OfficeCleanupPolicy
Definition: register.c:41
CRYPT_TRUST_REG_ENTRY sFinalPolicyProvider
Definition: wintrust.h:180
CRYPT_TRUST_REG_ENTRY sTestPolicyProvider
Definition: wintrust.h:181
static CRYPT_TRUST_REG_ENTRY OfficeInitializePolicy
Definition: register.c:40
#define FALSE
Definition: types.h:117
CRYPT_TRUST_REG_ENTRY sCleanupProvider
Definition: wintrust.h:182
static CRYPT_TRUST_REG_ENTRY SoftpubCertificate
Definition: register.c:28
static CRYPT_TRUST_REG_ENTRY SoftpubCertCheck
Definition: register.c:29
static CRYPT_TRUST_REG_ENTRY SoftpubMessage
Definition: register.c:26
struct _CRYPT_REGISTER_ACTIONID CRYPT_REGISTER_ACTIONID
CRYPT_TRUST_REG_ENTRY sCertificateProvider
Definition: wintrust.h:178
CRYPT_TRUST_REG_ENTRY sInitProvider
Definition: wintrust.h:175
static const CRYPT_TRUST_REG_ENTRY NullCTRE
Definition: register.c:50
BOOL WINAPI WintrustAddActionID(GUID *pgActionID, DWORD fdwFlags, CRYPT_REGISTER_ACTIONID *psProvInfo)
Definition: register.c:223
CRYPT_TRUST_REG_ENTRY sSignatureProvider
Definition: wintrust.h:177
CRYPT_TRUST_REG_ENTRY sObjectProvider
Definition: wintrust.h:176
static CRYPT_TRUST_REG_ENTRY SoftpubFinalPolicy
Definition: register.c:30
CRYPT_TRUST_REG_ENTRY sCertificatePolicyProvider
Definition: wintrust.h:179
#define OFFICESIGN_ACTION_VERIFY
Definition: softpub.h:177
static BOOL WINTRUST_RegisterPublishedSoftware ( void  )
static

Definition at line 444 of file register.c.

Referenced by DllRegisterServer(), and SoftpubDllRegisterServer().

445 {
446  static GUID ProvGUID = WIN_SPUB_ACTION_PUBLISHED_SOFTWARE;
447  CRYPT_REGISTER_ACTIONID ProvInfo;
448 
449  ProvInfo.cbStruct = sizeof(CRYPT_REGISTER_ACTIONID);
451  ProvInfo.sObjectProvider = SoftpubMessage;
456  ProvInfo.sTestPolicyProvider = NullCTRE; /* No diagnostic policy */
457  ProvInfo.sCleanupProvider = SoftpubCleanup;
458 
459  if (!WintrustAddActionID(&ProvGUID, 0, &ProvInfo))
460  return FALSE;
461 
462  return TRUE;
463 }
#define TRUE
Definition: types.h:120
static CRYPT_TRUST_REG_ENTRY SoftpubSignature
Definition: register.c:27
#define WIN_SPUB_ACTION_PUBLISHED_SOFTWARE
Definition: wintrust.h:661
CRYPT_TRUST_REG_ENTRY sFinalPolicyProvider
Definition: wintrust.h:180
CRYPT_TRUST_REG_ENTRY sTestPolicyProvider
Definition: wintrust.h:181
static CRYPT_TRUST_REG_ENTRY SoftpubInitialization
Definition: register.c:25
#define FALSE
Definition: types.h:117
CRYPT_TRUST_REG_ENTRY sCleanupProvider
Definition: wintrust.h:182
static CRYPT_TRUST_REG_ENTRY SoftpubCertificate
Definition: register.c:28
static CRYPT_TRUST_REG_ENTRY SoftpubCertCheck
Definition: register.c:29
static CRYPT_TRUST_REG_ENTRY SoftpubCleanup
Definition: register.c:31
static CRYPT_TRUST_REG_ENTRY SoftpubMessage
Definition: register.c:26
struct _CRYPT_REGISTER_ACTIONID CRYPT_REGISTER_ACTIONID
CRYPT_TRUST_REG_ENTRY sCertificateProvider
Definition: wintrust.h:178
CRYPT_TRUST_REG_ENTRY sInitProvider
Definition: wintrust.h:175
static const CRYPT_TRUST_REG_ENTRY NullCTRE
Definition: register.c:50
BOOL WINAPI WintrustAddActionID(GUID *pgActionID, DWORD fdwFlags, CRYPT_REGISTER_ACTIONID *psProvInfo)
Definition: register.c:223
CRYPT_TRUST_REG_ENTRY sSignatureProvider
Definition: wintrust.h:177
CRYPT_TRUST_REG_ENTRY sObjectProvider
Definition: wintrust.h:176
static CRYPT_TRUST_REG_ENTRY SoftpubFinalPolicy
Definition: register.c:30
CRYPT_TRUST_REG_ENTRY sCertificatePolicyProvider
Definition: wintrust.h:179
static BOOL WINTRUST_RegisterPublishedSoftwareNoBadUi ( void  )
static

Definition at line 476 of file register.c.

Referenced by DllRegisterServer(), and SoftpubDllRegisterServer().

477 {
479  CRYPT_REGISTER_ACTIONID ProvInfo;
480 
481  ProvInfo.cbStruct = sizeof(CRYPT_REGISTER_ACTIONID);
483  ProvInfo.sObjectProvider = SoftpubMessage;
488  ProvInfo.sTestPolicyProvider = NullCTRE; /* No diagnostic policy */
489  ProvInfo.sCleanupProvider = SoftpubCleanup;
490 
491  if (!WintrustAddActionID(&ProvGUID, 0, &ProvInfo))
492  return FALSE;
493 
494  return TRUE;
495 }
#define TRUE
Definition: types.h:120
static CRYPT_TRUST_REG_ENTRY SoftpubSignature
Definition: register.c:27
CRYPT_TRUST_REG_ENTRY sFinalPolicyProvider
Definition: wintrust.h:180
CRYPT_TRUST_REG_ENTRY sTestPolicyProvider
Definition: wintrust.h:181
static CRYPT_TRUST_REG_ENTRY SoftpubInitialization
Definition: register.c:25
#define FALSE
Definition: types.h:117
CRYPT_TRUST_REG_ENTRY sCleanupProvider
Definition: wintrust.h:182
static CRYPT_TRUST_REG_ENTRY SoftpubCertificate
Definition: register.c:28
#define WIN_SPUB_ACTION_PUBLISHED_SOFTWARE_NOBADUI
Definition: register.c:465
static CRYPT_TRUST_REG_ENTRY SoftpubCertCheck
Definition: register.c:29
static CRYPT_TRUST_REG_ENTRY SoftpubCleanup
Definition: register.c:31
static CRYPT_TRUST_REG_ENTRY SoftpubMessage
Definition: register.c:26
struct _CRYPT_REGISTER_ACTIONID CRYPT_REGISTER_ACTIONID
CRYPT_TRUST_REG_ENTRY sCertificateProvider
Definition: wintrust.h:178
CRYPT_TRUST_REG_ENTRY sInitProvider
Definition: wintrust.h:175
static const CRYPT_TRUST_REG_ENTRY NullCTRE
Definition: register.c:50
BOOL WINAPI WintrustAddActionID(GUID *pgActionID, DWORD fdwFlags, CRYPT_REGISTER_ACTIONID *psProvInfo)
Definition: register.c:223
CRYPT_TRUST_REG_ENTRY sSignatureProvider
Definition: wintrust.h:177
CRYPT_TRUST_REG_ENTRY sObjectProvider
Definition: wintrust.h:176
static CRYPT_TRUST_REG_ENTRY SoftpubFinalPolicy
Definition: register.c:30
CRYPT_TRUST_REG_ENTRY sCertificatePolicyProvider
Definition: wintrust.h:179
static BOOL WINTRUST_RegisterTrustProviderTest ( void  )
static

Definition at line 536 of file register.c.

Referenced by DllRegisterServer(), and SoftpubDllRegisterServer().

537 {
538  static GUID ProvGUID = WINTRUST_ACTION_TRUSTPROVIDER_TEST;
539  CRYPT_REGISTER_ACTIONID ProvInfo;
540 
541  ProvInfo.cbStruct = sizeof(CRYPT_REGISTER_ACTIONID);
543  ProvInfo.sObjectProvider = SoftpubMessage;
549  ProvInfo.sCleanupProvider = SoftpubCleanup;
550 
551  if (!WintrustAddActionID(&ProvGUID, 0, &ProvInfo))
552  return FALSE;
553 
554  return TRUE;
555 }
#define TRUE
Definition: types.h:120
static CRYPT_TRUST_REG_ENTRY SoftpubSignature
Definition: register.c:27
CRYPT_TRUST_REG_ENTRY sFinalPolicyProvider
Definition: wintrust.h:180
CRYPT_TRUST_REG_ENTRY sTestPolicyProvider
Definition: wintrust.h:181
static CRYPT_TRUST_REG_ENTRY SoftpubInitialization
Definition: register.c:25
#define FALSE
Definition: types.h:117
CRYPT_TRUST_REG_ENTRY sCleanupProvider
Definition: wintrust.h:182
#define WINTRUST_ACTION_TRUSTPROVIDER_TEST
Definition: softpub.h:146
static CRYPT_TRUST_REG_ENTRY SoftpubCertificate
Definition: register.c:28
static CRYPT_TRUST_REG_ENTRY SoftpubCertCheck
Definition: register.c:29
static CRYPT_TRUST_REG_ENTRY SoftpubCleanup
Definition: register.c:31
static CRYPT_TRUST_REG_ENTRY SoftpubMessage
Definition: register.c:26
struct _CRYPT_REGISTER_ACTIONID CRYPT_REGISTER_ACTIONID
CRYPT_TRUST_REG_ENTRY sCertificateProvider
Definition: wintrust.h:178
CRYPT_TRUST_REG_ENTRY sInitProvider
Definition: wintrust.h:175
BOOL WINAPI WintrustAddActionID(GUID *pgActionID, DWORD fdwFlags, CRYPT_REGISTER_ACTIONID *psProvInfo)
Definition: register.c:223
static CRYPT_TRUST_REG_ENTRY SoftpubDumpStructure
Definition: register.c:35
CRYPT_TRUST_REG_ENTRY sSignatureProvider
Definition: wintrust.h:177
CRYPT_TRUST_REG_ENTRY sObjectProvider
Definition: wintrust.h:176
static CRYPT_TRUST_REG_ENTRY SoftpubFinalPolicy
Definition: register.c:30
CRYPT_TRUST_REG_ENTRY sCertificatePolicyProvider
Definition: wintrust.h:179
static void WINTRUST_RemoveProviderFromReg ( WCHAR GuidString,
const WCHAR FunctionType 
)
static

Definition at line 289 of file register.c.

Referenced by WintrustRemoveActionID().

291 {
292  WCHAR ProvKey[MAX_PATH];
293 
294  /* Create the needed key string */
295  ProvKey[0]='\0';
296  lstrcatW(ProvKey, Trust);
297  lstrcatW(ProvKey, FunctionType);
298  lstrcatW(ProvKey, GuidString);
299 
300  /* We don't care about success or failure */
302 }
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
Definition: reg.c:1240
static const WCHAR Trust[]
Definition: register.c:52
#define MAX_PATH
Definition: compat.h:26
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
static BOOL WINTRUST_SIPPAddProvider ( GUID Subject,
WCHAR MagicNumber 
)
static

Definition at line 869 of file register.c.

Referenced by DllRegisterServer().

870 {
872  {'C','r','y','p','t','S','I','P','G','e','t','S','i','g','n','e','d','D','a','t','a','M','s','g', 0};
874  {'C','r','y','p','t','S','I','P','P','u','t','S','i','g','n','e','d','D','a','t','a','M','s','g', 0};
876  {'C','r','y','p','t','S','I','P','C','r','e','a','t','e','I','n','d','i','r','e','c','t','D','a','t','a', 0};
878  {'C','r','y','p','t','S','I','P','V','e','r','i','f','y','I','n','d','i','r','e','c','t','D','a','t','a', 0};
880  {'C','r','y','p','t','S','I','P','R','e','m','o','v','e','S','i','g','n','e','d','D','a','t','a','M','s','g', 0};
881  SIP_ADD_NEWPROVIDER NewProv;
882  BOOL Ret;
883 
884  /* Clear and initialize the structure */
885  memset(&NewProv, 0, sizeof(SIP_ADD_NEWPROVIDER));
886  NewProv.cbStruct = sizeof(SIP_ADD_NEWPROVIDER);
888  /* Fill the structure */
889  NewProv.pgSubject = Subject;
891  NewProv.pwszMagicNumber = MagicNumber;
892  NewProv.pwszIsFunctionName = NULL;
898  NewProv.pwszIsFunctionNameFmt2 = NULL;
899  NewProv.pwszGetCapFuncName = NULL;
900 
901  Ret = CryptSIPAddProvider(&NewProv);
902 
904 
905  return Ret;
906 }
BOOL WINAPI CryptSIPVerifyIndirectData(SIP_SUBJECTINFO *pSubjectInfo, SIP_INDIRECT_DATA *pIndirectData)
Definition: sip.c:779
WCHAR * pwszGetFuncName
Definition: mssip.h:152
WCHAR * pwszVerifyFuncName
Definition: mssip.h:155
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * pwszDLLFileName
Definition: mssip.h:147
BOOL WINAPI CryptSIPPutSignedDataMsg(SIP_SUBJECTINFO *pSubjectInfo, DWORD pdwEncodingType, DWORD *pdwIndex, DWORD cbSignedDataMsg, BYTE *pbSignedDataMsg)
Definition: sip.c:743
GUID * pgSubject
Definition: mssip.h:145
WCHAR * pwszPutFuncName
Definition: mssip.h:153
BOOL WINAPI CryptSIPGetSignedDataMsg(SIP_SUBJECTINFO *pSubjectInfo, DWORD *pdwEncodingType, DWORD dwIndex, DWORD *pcbSignedDataMsg, BYTE *pbSignedDataMsg)
Definition: sip.c:724
smooth NULL
Definition: ftsmooth.c:557
static const WCHAR SP_POLICY_PROVIDER_DLL_NAME[]
Definition: softpub.h:104
void WINAPI WINTRUST_Free(void *p)
Definition: wintrust_main.c:40
void *WINAPI WINTRUST_Alloc(DWORD cb)
Definition: wintrust_main.c:29
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI CryptSIPAddProvider(SIP_ADD_NEWPROVIDER *psNewProv)
Definition: sip.c:194
BOOL WINAPI CryptSIPRemoveSignedDataMsg(SIP_SUBJECTINFO *pSubjectInfo, DWORD dwIndex)
Definition: sip.c:762
BOOL WINAPI CryptSIPCreateIndirectData(SIP_SUBJECTINFO *pSubjectInfo, DWORD *pcbIndirectData, SIP_INDIRECT_DATA *pIndirectData)
Definition: sip.c:702
WCHAR * pwszIsFunctionNameFmt2
Definition: mssip.h:158
#define lstrcpyW
Definition: compat.h:406
WCHAR * pwszGetCapFuncName
Definition: mssip.h:161
WCHAR * pwszRemoveFuncName
Definition: mssip.h:156
#define memset(x, y, z)
Definition: compat.h:39
WCHAR * pwszCreateFuncName
Definition: mssip.h:154
WCHAR * pwszMagicNumber
Definition: mssip.h:148
struct SIP_ADD_NEWPROVIDER_ SIP_ADD_NEWPROVIDER
WCHAR * pwszIsFunctionName
Definition: mssip.h:150
static LONG WINTRUST_WriteProviderToReg ( WCHAR GuidString,
const WCHAR FunctionType,
CRYPT_TRUST_REG_ENTRY  RegEntry 
)
static

Definition at line 164 of file register.c.

Referenced by WintrustAddActionID().

167 {
168  static const WCHAR Function[] = {'$','F','u','n','c','t','i','o','n', 0};
169  WCHAR ProvKey[MAX_PATH];
170  HKEY Key;
171  LONG Res = ERROR_SUCCESS;
172 
173  /* Create the needed key string */
174  ProvKey[0]='\0';
175  lstrcatW(ProvKey, Trust);
176  lstrcatW(ProvKey, FunctionType);
177  lstrcatW(ProvKey, GuidString);
178 
179  if (!RegEntry.pwszDLLName || !RegEntry.pwszFunctionName)
181 
182  Res = RegCreateKeyExW(HKEY_LOCAL_MACHINE, ProvKey, 0, NULL, 0, KEY_WRITE, NULL, &Key, NULL);
183  if (Res != ERROR_SUCCESS) goto error_close_key;
184 
185  /* Create the $DLL entry */
186  Res = RegSetValueExW(Key, Dll, 0, REG_SZ, (BYTE*)RegEntry.pwszDLLName,
187  (lstrlenW(RegEntry.pwszDLLName) + 1)*sizeof(WCHAR));
188  if (Res != ERROR_SUCCESS) goto error_close_key;
189 
190  /* Create the $Function entry */
191  Res = RegSetValueExW(Key, Function, 0, REG_SZ, (BYTE*)RegEntry.pwszFunctionName,
192  (lstrlenW(RegEntry.pwszFunctionName) + 1)*sizeof(WCHAR));
193 
194 error_close_key:
195  RegCloseKey(Key);
196 
197  return Res;
198 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define ERROR_SUCCESS
Definition: deptool.c:10
WCHAR * pwszDLLName
Definition: wintrust.h:168
__wchar_t WCHAR
Definition: xmlstorage.h:180
IN OUT PIRP IN ULONG IN WMIENABLEDISABLECONTROL Function
Definition: wmilib.h:37
#define lstrlenW
Definition: compat.h:407
static const WCHAR Trust[]
Definition: register.c:52
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1094
static const WCHAR Dll[]
Definition: register.c:68
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:557
#define KEY_WRITE
Definition: nt_native.h:1031
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4917
HANDLE HKEY
Definition: registry.h:24
#define MAX_PATH
Definition: compat.h:26
unsigned char BYTE
Definition: ntddk_ex.h:96
WCHAR * pwszFunctionName
Definition: wintrust.h:169
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
ACPI_EFI_INPUT_KEY * Key
Definition: acefiex.h:303
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define REG_SZ
Definition: layer.c:22
static LONG WINTRUST_WriteSingleUsageEntry ( LPCSTR  OID,
const WCHAR Value,
WCHAR Data 
)
static

Definition at line 358 of file register.c.

Referenced by WintrustAddDefaultForUsage().

361 {
362  static const WCHAR Usages[] = {'U','s','a','g','e','s','\\', 0};
363  WCHAR* UsageKey;
364  HKEY Key;
365  LONG Res = ERROR_SUCCESS;
366  WCHAR* OIDW;
367  DWORD Len;
368 
369  /* Turn OID into a wide-character string */
370  Len = MultiByteToWideChar( CP_ACP, 0, OID, -1, NULL, 0 );
371  OIDW = WINTRUST_Alloc( Len * sizeof(WCHAR) );
372  MultiByteToWideChar( CP_ACP, 0, OID, -1, OIDW, Len );
373 
374  /* Allocate the needed space for UsageKey */
375  UsageKey = WINTRUST_Alloc((lstrlenW(Trust) + lstrlenW(Usages) + Len) * sizeof(WCHAR));
376  /* Create the key string */
377  lstrcpyW(UsageKey, Trust);
378  lstrcatW(UsageKey, Usages);
379  lstrcatW(UsageKey, OIDW);
380 
381  Res = RegCreateKeyExW(HKEY_LOCAL_MACHINE, UsageKey, 0, NULL, 0, KEY_WRITE, NULL, &Key, NULL);
382  if (Res == ERROR_SUCCESS)
383  {
384  /* Create the Value entry */
385  Res = RegSetValueExW(Key, Value, 0, REG_SZ, (BYTE*)Data,
386  (lstrlenW(Data) + 1)*sizeof(WCHAR));
387  }
388  RegCloseKey(Key);
389 
390  WINTRUST_Free(OIDW);
391  WINTRUST_Free(UsageKey);
392 
393  return Res;
394 }
#define ERROR_SUCCESS
Definition: deptool.c:10
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CP_ACP
Definition: compat.h:99
#define lstrlenW
Definition: compat.h:407
DWORD DWORD
Definition: winlogon.h:75
static const WCHAR Trust[]
Definition: register.c:52
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1094
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:557
void WINAPI WINTRUST_Free(void *p)
Definition: wintrust_main.c:40
#define KEY_WRITE
Definition: nt_native.h:1031
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4917
void *WINAPI WINTRUST_Alloc(DWORD cb)
Definition: wintrust_main.c:29
HANDLE HKEY
Definition: registry.h:24
#define Len
Definition: deflate.h:82
UINTN UINT8 Value
Definition: acefiex.h:751
unsigned char BYTE
Definition: ntddk_ex.h:96
#define lstrcpyW
Definition: compat.h:406
#define MultiByteToWideChar
Definition: compat.h:100
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
ACPI_EFI_INPUT_KEY * Key
Definition: acefiex.h:303
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define REG_SZ
Definition: layer.c:22
BOOL WINAPI WintrustAddActionID ( GUID pgActionID,
DWORD  fdwFlags,
CRYPT_REGISTER_ACTIONID psProvInfo 
)

Definition at line 223 of file register.c.

Referenced by DllRegisterServer(), InitFunctionPtrs(), WINTRUST_RegisterDriverVerify(), WINTRUST_RegisterGenCertVerify(), WINTRUST_RegisterGenChainVerify(), WINTRUST_RegisterGenVerifyV2(), WINTRUST_RegisterHttpsProv(), WINTRUST_RegisterOfficeSignVerify(), WINTRUST_RegisterPublishedSoftware(), WINTRUST_RegisterPublishedSoftwareNoBadUi(), and WINTRUST_RegisterTrustProviderTest().

225 {
226  WCHAR GuidString[39];
227  LONG Res;
228  LONG WriteActionError = ERROR_SUCCESS;
229 
230  TRACE("%s %x %p\n", debugstr_guid(pgActionID), fdwFlags, psProvInfo);
231 
232  /* Some sanity checks.
233  * We use the W2K3 last error as it makes more sense (W2K leaves the last error
234  * as is).
235  */
236  if (!pgActionID ||
237  !psProvInfo ||
238  (psProvInfo->cbStruct != sizeof(CRYPT_REGISTER_ACTIONID)))
239  {
241  return FALSE;
242  }
243 
244  /* Create this string only once, instead of in the helper function */
245  WINTRUST_Guid2Wstr( pgActionID, GuidString);
246 
247  /* Write the information to the registry */
248  Res = WINTRUST_WriteProviderToReg(GuidString, Initialization , psProvInfo->sInitProvider);
249  if (Res != ERROR_SUCCESS) WriteActionError = Res;
250  Res = WINTRUST_WriteProviderToReg(GuidString, Message , psProvInfo->sObjectProvider);
251  if (Res != ERROR_SUCCESS) WriteActionError = Res;
252  Res = WINTRUST_WriteProviderToReg(GuidString, Signature , psProvInfo->sSignatureProvider);
253  if (Res != ERROR_SUCCESS) WriteActionError = Res;
254  Res = WINTRUST_WriteProviderToReg(GuidString, Certificate , psProvInfo->sCertificateProvider);
255  if (Res != ERROR_SUCCESS) WriteActionError = Res;
256  Res = WINTRUST_WriteProviderToReg(GuidString, CertCheck , psProvInfo->sCertificatePolicyProvider);
257  if (Res != ERROR_SUCCESS) WriteActionError = Res;
258  Res = WINTRUST_WriteProviderToReg(GuidString, FinalPolicy , psProvInfo->sFinalPolicyProvider);
259  if (Res != ERROR_SUCCESS) WriteActionError = Res;
260  Res = WINTRUST_WriteProviderToReg(GuidString, DiagnosticPolicy, psProvInfo->sTestPolicyProvider);
261  if (Res != ERROR_SUCCESS) WriteActionError = Res;
262  Res = WINTRUST_WriteProviderToReg(GuidString, Cleanup , psProvInfo->sCleanupProvider);
263  if (Res != ERROR_SUCCESS) WriteActionError = Res;
264 
265  /* Testing (by restricting access to the registry for some keys) shows that the last failing function
266  * will be used for last error.
267  * If the flag WT_ADD_ACTION_ID_RET_RESULT_FLAG is set and there are errors when adding the action
268  * we have to return FALSE. Errors includes both invalid entries as well as registry errors.
269  * Testing also showed that one error doesn't stop the registry writes. Every action will be dealt with.
270  */
271 
272  if (WriteActionError != ERROR_SUCCESS)
273  {
274  SetLastError(WriteActionError);
275 
276  if (fdwFlags == WT_ADD_ACTION_ID_RET_RESULT_FLAG)
277  return FALSE;
278  }
279 
280  return TRUE;
281 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
static LONG WINTRUST_WriteProviderToReg(WCHAR *GuidString, const WCHAR *FunctionType, CRYPT_TRUST_REG_ENTRY RegEntry)
Definition: register.c:164
static const WCHAR Message[]
Definition: register.c:59
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const WCHAR Certificate[]
Definition: register.c:61
static const WCHAR FinalPolicy[]
Definition: register.c:63
CRYPT_TRUST_REG_ENTRY sFinalPolicyProvider
Definition: wintrust.h:180
static const WCHAR CertCheck[]
Definition: register.c:62
CRYPT_TRUST_REG_ENTRY sTestPolicyProvider
Definition: wintrust.h:181
#define FALSE
Definition: types.h:117
CRYPT_TRUST_REG_ENTRY sCleanupProvider
Definition: wintrust.h:182
static const WCHAR DiagnosticPolicy[]
Definition: register.c:64
long LONG
Definition: pedump.c:60
static void WINTRUST_Guid2Wstr(const GUID *pgActionID, WCHAR *GuidString)
Definition: register.c:147
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static const WCHAR Signature[]
Definition: register.c:60
#define SetLastError(x)
Definition: compat.h:409
static const WCHAR Cleanup[]
Definition: register.c:65
CRYPT_TRUST_REG_ENTRY sCertificateProvider
Definition: wintrust.h:178
CRYPT_TRUST_REG_ENTRY sInitProvider
Definition: wintrust.h:175
#define WT_ADD_ACTION_ID_RET_RESULT_FLAG
Definition: wintrust.h:448
static const WCHAR Initialization[]
Definition: register.c:58
CRYPT_TRUST_REG_ENTRY sSignatureProvider
Definition: wintrust.h:177
CRYPT_TRUST_REG_ENTRY sObjectProvider
Definition: wintrust.h:176
CRYPT_TRUST_REG_ENTRY sCertificatePolicyProvider
Definition: wintrust.h:179
BOOL WINAPI WintrustAddDefaultForUsage ( const char pszUsageOID,
CRYPT_PROVIDER_REGDEFUSAGE psDefUsage 
)

Definition at line 718 of file register.c.

Referenced by InitFunctionPtrs(), WINTRUST_RegisterGenVerifyV2(), and WINTRUST_RegisterHttpsProv().

720 {
721  static const WCHAR CBAlloc[] = {'C','a','l','l','b','a','c','k','A','l','l','o','c','F','u','n','c','t','i','o','n', 0};
722  static const WCHAR CBFree[] = {'C','a','l','l','b','a','c','k','F','r','e','e','F','u','n','c','t','i','o','n', 0};
723  LONG Res = ERROR_SUCCESS;
724  LONG WriteUsageError = ERROR_SUCCESS;
725  DWORD Len;
726  WCHAR GuidString[39];
727 
728  TRACE("(%s %p)\n", debugstr_a(pszUsageOID), psDefUsage);
729 
730  /* Some sanity checks. */
731  if (!pszUsageOID ||
732  !psDefUsage ||
733  !psDefUsage->pgActionID ||
734  (psDefUsage->cbStruct != sizeof(CRYPT_PROVIDER_REGDEFUSAGE)))
735  {
737  return FALSE;
738  }
739 
740  if (psDefUsage->pwszDllName)
741  {
742  Res = WINTRUST_WriteSingleUsageEntry(pszUsageOID, Dll, psDefUsage->pwszDllName);
743  if (Res != ERROR_SUCCESS) WriteUsageError = Res;
744  }
745  if (psDefUsage->pwszLoadCallbackDataFunctionName)
746  {
747  WCHAR* CallbackW;
748 
749  Len = MultiByteToWideChar( CP_ACP, 0, psDefUsage->pwszLoadCallbackDataFunctionName, -1, NULL, 0 );
750  CallbackW = WINTRUST_Alloc( Len * sizeof(WCHAR) );
751  MultiByteToWideChar( CP_ACP, 0, psDefUsage->pwszLoadCallbackDataFunctionName, -1, CallbackW, Len );
752 
753  Res = WINTRUST_WriteSingleUsageEntry(pszUsageOID, CBAlloc, CallbackW);
754  if (Res != ERROR_SUCCESS) WriteUsageError = Res;
755 
756  WINTRUST_Free(CallbackW);
757  }
758  if (psDefUsage->pwszFreeCallbackDataFunctionName)
759  {
760  WCHAR* CallbackW;
761 
762  Len = MultiByteToWideChar( CP_ACP, 0, psDefUsage->pwszFreeCallbackDataFunctionName, -1, NULL, 0 );
763  CallbackW = WINTRUST_Alloc( Len * sizeof(WCHAR) );
764  MultiByteToWideChar( CP_ACP, 0, psDefUsage->pwszFreeCallbackDataFunctionName, -1, CallbackW, Len );
765 
766  Res = WINTRUST_WriteSingleUsageEntry(pszUsageOID, CBFree, CallbackW);
767  if (Res != ERROR_SUCCESS) WriteUsageError = Res;
768 
769  WINTRUST_Free(CallbackW);
770  }
771 
772  WINTRUST_Guid2Wstr(psDefUsage->pgActionID, GuidString);
773  Res = WINTRUST_WriteSingleUsageEntry(pszUsageOID, DefaultId, GuidString);
774  if (Res != ERROR_SUCCESS) WriteUsageError = Res;
775 
776  if (WriteUsageError != ERROR_SUCCESS)
777  return FALSE;
778 
779  return TRUE;
780 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
static const WCHAR DefaultId[]
Definition: register.c:67
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CP_ACP
Definition: compat.h:99
static LONG WINTRUST_WriteSingleUsageEntry(LPCSTR OID, const WCHAR *Value, WCHAR *Data)
Definition: register.c:358
DWORD DWORD
Definition: winlogon.h:75
static const WCHAR Dll[]
Definition: register.c:68
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
static void WINTRUST_Guid2Wstr(const GUID *pgActionID, WCHAR *GuidString)
Definition: register.c:147
smooth NULL
Definition: ftsmooth.c:557
void WINAPI WINTRUST_Free(void *p)
Definition: wintrust_main.c:40
#define TRACE(s)
Definition: solgame.cpp:4
void *WINAPI WINTRUST_Alloc(DWORD cb)
Definition: wintrust_main.c:29
#define debugstr_a
Definition: kernel32.h:31
char * pwszFreeCallbackDataFunctionName
Definition: wintrust.h:191
#define Len
Definition: deflate.h:82
#define SetLastError(x)
Definition: compat.h:409
#define MultiByteToWideChar
Definition: compat.h:100
char * pwszLoadCallbackDataFunctionName
Definition: wintrust.h:190
BOOL WINAPI WintrustLoadFunctionPointers ( GUID pgActionID,
CRYPT_PROVIDER_FUNCTIONS pPfns 
)

Definition at line 826 of file register.c.

Referenced by InitFunctionPtrs(), test_provider_funcs(), WINTRUST_CertVerify(), and WINTRUST_DefaultVerify().

828 {
829  WCHAR GuidString[39];
830 
831  TRACE("(%s %p)\n", debugstr_guid(pgActionID), pPfns);
832 
833  if (!pPfns) return FALSE;
834  if (!pgActionID)
835  {
837  return FALSE;
838  }
839  if (pPfns->cbStruct != sizeof(CRYPT_PROVIDER_FUNCTIONS)) return FALSE;
840 
841  /* Create this string only once, instead of in the helper function */
842  WINTRUST_Guid2Wstr( pgActionID, GuidString);
843 
844  /* Get the function pointers from the registry, where applicable */
845  pPfns->pfnAlloc = WINTRUST_Alloc;
846  pPfns->pfnFree = WINTRUST_Free;
851  pPfns->psUIpfns = NULL;
860 
861  return TRUE;
862 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
static const WCHAR Message[]
Definition: register.c:59
struct _CRYPT_PROVUI_FUNCS * psUIpfns
Definition: wintrust.h:328
#define TRUE
Definition: types.h:120
PFN_CPD_MEM_ALLOC pfnAlloc
Definition: wintrust.h:315
PFN_CPD_ADD_STORE pfnAddStore2Chain
Definition: wintrust.h:317
__wchar_t WCHAR
Definition: xmlstorage.h:180
HRESULT(WINAPI * PFN_PROVIDER_FINALPOLICY_CALL)(struct _CRYPT_PROVIDER_DATA *pProvData)
Definition: wintrust.h:303
static const WCHAR Certificate[]
Definition: register.c:61
HRESULT(WINAPI * PFN_PROVIDER_TESTFINALPOLICY_CALL)(struct _CRYPT_PROVIDER_DATA *pProvData)
Definition: wintrust.h:305
PFN_PROVIDER_CLEANUP_CALL pfnCleanupPolicy
Definition: wintrust.h:329
static const WCHAR FinalPolicy[]
Definition: register.c:63
HRESULT(WINAPI * PFN_PROVIDER_CERTTRUST_CALL)(struct _CRYPT_PROVIDER_DATA *pProvData)
Definition: wintrust.h:301
BOOL WINAPI WINTRUST_AddSgnr(CRYPT_PROVIDER_DATA *data, BOOL fCounterSigner, DWORD idxSigner, CRYPT_PROVIDER_SGNR *sgnr)
BOOL WINAPI WINTRUST_AddCert(CRYPT_PROVIDER_DATA *data, DWORD idxSigner, BOOL fCounterSigner, DWORD idxCounterSigner, PCCERT_CONTEXT pCert2Add)
static const WCHAR CertCheck[]
Definition: register.c:62
#define FALSE
Definition: types.h:117
static const WCHAR DiagnosticPolicy[]
Definition: register.c:64
PFN_CPD_ADD_CERT pfnAddCert2Chain
Definition: wintrust.h:319
static void WINTRUST_Guid2Wstr(const GUID *pgActionID, WCHAR *GuidString)
Definition: register.c:147
PFN_PROVIDER_CERTCHKPOLICY_CALL pfnCertCheckPolicy
Definition: wintrust.h:326
smooth NULL
Definition: ftsmooth.c:557
#define debugstr_guid
Definition: kernel32.h:35
void WINAPI WINTRUST_Free(void *p)
Definition: wintrust_main.c:40
static FARPROC WINTRUST_ReadProviderFromReg(WCHAR *GuidString, const WCHAR *FunctionType)
Definition: register.c:782
#define TRACE(s)
Definition: solgame.cpp:4
void *WINAPI WINTRUST_Alloc(DWORD cb)
Definition: wintrust_main.c:29
PFN_CPD_MEM_FREE pfnFree
Definition: wintrust.h:316
HRESULT(WINAPI * PFN_PROVIDER_INIT_CALL)(struct _CRYPT_PROVIDER_DATA *pProvData)
Definition: wintrust.h:295
static const WCHAR Signature[]
Definition: register.c:60
HRESULT(WINAPI * PFN_PROVIDER_CLEANUP_CALL)(struct _CRYPT_PROVIDER_DATA *pProvData)
Definition: wintrust.h:307
PFN_CPD_ADD_PRIVDATA pfnAddPrivData2Chain
Definition: wintrust.h:320
#define SetLastError(x)
Definition: compat.h:409
PFN_PROVIDER_OBJTRUST_CALL pfnObjectTrust
Definition: wintrust.h:322
static const WCHAR Cleanup[]
Definition: register.c:65
PFN_CPD_ADD_SGNR pfnAddSgnr2Chain
Definition: wintrust.h:318
PFN_PROVIDER_TESTFINALPOLICY_CALL pfnTestFinalPolicy
Definition: wintrust.h:327
BOOL WINAPI WINTRUST_AddStore(CRYPT_PROVIDER_DATA *data, HCERTSTORE store)
BOOL(WINAPI * PFN_PROVIDER_CERTCHKPOLICY_CALL)(struct _CRYPT_PROVIDER_DATA *pProvData, DWORD idxSigner, BOOL fCounterSignerChain, DWORD idxCounterSigner)
Definition: wintrust.h:309
PFN_PROVIDER_INIT_CALL pfnInitialize
Definition: wintrust.h:321
static const WCHAR Initialization[]
Definition: register.c:58
BOOL WINAPI WINTRUST_AddPrivData(CRYPT_PROVIDER_DATA *data, CRYPT_PROVIDER_PRIVDATA *pPrivData2Add)
PFN_PROVIDER_SIGTRUST_CALL pfnSignatureTrust
Definition: wintrust.h:323
HRESULT(WINAPI * PFN_PROVIDER_OBJTRUST_CALL)(struct _CRYPT_PROVIDER_DATA *pProvData)
Definition: wintrust.h:297
PFN_PROVIDER_CERTTRUST_CALL pfnCertificateTrust
Definition: wintrust.h:324
PFN_PROVIDER_FINALPOLICY_CALL pfnFinalPolicy
Definition: wintrust.h:325
HRESULT(WINAPI * PFN_PROVIDER_SIGTRUST_CALL)(struct _CRYPT_PROVIDER_DATA *pProvData)
Definition: wintrust.h:299
BOOL WINAPI WintrustRemoveActionID ( GUID pgActionID)

Definition at line 322 of file register.c.

Referenced by DllUnregisterServer(), and InitFunctionPtrs().

323 {
324  WCHAR GuidString[39];
325 
326  TRACE("(%s)\n", debugstr_guid(pgActionID));
327 
328  if (!pgActionID)
329  {
331  return TRUE;
332  }
333 
334  /* Create this string only once, instead of in the helper function */
335  WINTRUST_Guid2Wstr( pgActionID, GuidString);
336 
337  /* We don't care about success or failure */
346 
347  return TRUE;
348 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
static const WCHAR Message[]
Definition: register.c:59
#define TRUE
Definition: types.h:120
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const WCHAR Certificate[]
Definition: register.c:61
static const WCHAR FinalPolicy[]
Definition: register.c:63
static const WCHAR CertCheck[]
Definition: register.c:62
static const WCHAR DiagnosticPolicy[]
Definition: register.c:64
static void WINTRUST_Guid2Wstr(const GUID *pgActionID, WCHAR *GuidString)
Definition: register.c:147
#define debugstr_guid
Definition: kernel32.h:35
static void WINTRUST_RemoveProviderFromReg(WCHAR *GuidString, const WCHAR *FunctionType)
Definition: register.c:289
#define TRACE(s)
Definition: solgame.cpp:4
static const WCHAR Signature[]
Definition: register.c:60
#define SetLastError(x)
Definition: compat.h:409
static const WCHAR Cleanup[]
Definition: register.c:65
static const WCHAR Initialization[]
Definition: register.c:58

Variable Documentation

const WCHAR CertCheck[] = {'C','e','r','t','C','h','e','c','k','\\', 0}
static
const WCHAR Certificate[] = {'C','e','r','t','i','f','i','c','a','t','e','\\', 0}
static
const WCHAR Cleanup[] = {'C','l','e','a','n','u','p','\\', 0}
static

Definition at line 65 of file register.c.

Referenced by _AddPrintProviderToList(), _CreateNonspooledPort(), _HandleConfigureLPTPortCommandOK(), _HandleSetDefaultCommConfig(), _InitializeLocalSpooler(), _InitializePrintProviderList(), _LocalGetPrinterHandleData(), _LocalSetJobLevel1(), _LocalSetJobLevel2(), _LocalSetPrinterHandleData(), _OpenEnvironment(), _ReparsePIDL(), _RunRemoteTest(), _StartDocPrinterSpooled(), AccpLookupSidByName(), AccpOpenNamedObject(), AccRewriteGetHandleRights(), AccRewriteSetEntriesInAcl(), AcpiDsBeginMethodExecution(), AcpiDsCallControlMethod(), AcpiDsCreateBufferField(), AcpiDsCreateOperands(), AcpiDsEvalTableRegionOperands(), AcpiDsExecEndOp(), AcpiDsExecuteArguments(), AcpiDsGetPredicateValue(), AcpiDsInitBufferField(), AcpiDsLoad2EndOp(), AcpiEvaluateObject(), AcpiEvGpeInitialize(), AcpiExCreateEvent(), AcpiExCreateMutex(), AcpiExCreateRegion(), AcpiExDoConcatenate(), AcpiExDoLogicalOp(), AcpiExOpcode_0A_0T_1R(), AcpiExOpcode_1A_0T_1R(), AcpiExOpcode_1A_1T_0R(), AcpiExOpcode_1A_1T_1R(), AcpiExOpcode_2A_0T_1R(), AcpiExOpcode_2A_1T_1R(), AcpiExOpcode_2A_2T_1R(), AcpiExOpcode_3A_0T_0R(), AcpiExOpcode_3A_1T_1R(), AcpiExOpcode_6A_0T_1R(), AcpiGetObjectInfo(), AcpiInstallExceptionHandler(), AcpiInstallFixedEventHandler(), AcpiInstallGlobalEventHandler(), AcpiInstallTableHandler(), AcpiNsEvaluate(), AcpiNsExecuteTable(), AcpiNsOneCompleteParse(), AcpiPsCompleteThisOp(), AcpiPsExecuteMethod(), AcpiPsExecuteTable(), AcpiRemoveTableHandler(), AcpiRsSetSrsMethodData(), AcpiUtEvaluateObject(), AcpiUtExecute_CID(), AcpiUtExecute_CLS(), AcpiUtExecute_HID(), AcpiUtExecute_UID(), CBandSiteBase::AddBand(), AddJobW(), AllowWinstaAccess(), ApphelpCacheLookupEntry(), ApphelpCacheUpdateEntry(), ApplyParameterStringsToMessage(), BaseCheckVDM(), BaseCreateVDMEnvironment(), BaseSrvCopyCommand(), BuildAndSubmitIrp(), BuildFileFilterAndDeviceMenu(), CheckTokenMembership(), ClosePrinter(), ClosePrintProcessor(), CmpCopyCell(), CmpCreateControlSet(), CmpDeepCopyKeyInternal(), CmSaveKey(), ConDrvWriteConsoleOutputString(), CreateDefaultSecurityDescriptor(), CreateJob(), CreateRegistryFile(), CreateRemoteDatabaseWorker(), CreateSidCacheMgr(), CreateUsbChildDeviceObject(), CreateUserHive(), CSR_API(), DeviceAdvancedPropertiesA(), DeviceCreateHardwarePageEx(), DeviceProblemWizardA(), DevicePropertiesExA(), DisplayDeviceAdvancedProperties(), DoesPortExist(), DosLoadDriver(), DosLoadExecutable(), DosLoadExecutableInternal(), DriverEntry(), DumpFont(), EndDocPrinter(), EndPagePrinter(), EnumEventsThread(), EnumJobsW(), EnumPrintersW(), EnumPrintProcessorDatatypesW(), ExpandEnvironmentStringsForUserA(), Fast486FpuRemainder(), FillList(), FindCurrentDriver(), FindFirstStreamW(), FltpAttachToFileSystemDevice(), FsRecIsCdfsVolume(), FsRtlCopyRead(), FsRtlCopyWrite(), FsRtlMdlReadDev(), FsRtlPrepareMdlWriteDev(), FsRtlRegisterUncProvider(), FsRtlTest_StartTest(), FstubGetDiskGeometry(), FstubVerifyPartitionTableEFI(), GetDefaultPrinterA(), GetDefaultPrinterW(), GetFontCellSize(), GetJobW(), GetLPTTransmissionRetryTimeout(), GetNextVDMCommand(), GetPrinterDataExA(), GetPrinterW(), GetPrintProcessorDirectoryA(), GetPrintProcessorDirectoryW(), GreExtTextOutW(), ImpersonatePrinterClient(), InitializeGlobalJobList(), InitializeModeTable(), InitializePortList(), InitializePrinterList(), InitializePrintMonitor2(), InitializePrintMonitorList(), InitializePrintProcessorList(), InitLogo(), InputList_PrepareUserRegistry(), IntCopyRegistryKey(), IntScrollWindowEx(), IntSetAconData(), IopCreateArcNamesCd(), IopCreateArcNamesDisk(), IoReadDiskSignature(), ISecurityObjectTypeInfo_fnGetInheritSource(), IssueUniqueIdChangeNotify(), LoadXMLDocumentFromResource(), LocalAddJob(), LocalEndDocPrinter(), LocalEndPagePrinter(), LocalEnumJobs(), LocalEnumMonitors(), LocalEnumPrinters(), LocalEnumPrintProcessorDatatypes(), LocalEnumPrintProcessors(), LocalGetJob(), LocalGetPrinter(), LocalGetPrintProcessorDirectory(), LocalmonEnumPorts(), LocalmonGetPrinterDataFromPort(), LocalmonOpenPort(), LocalmonReadPort(), LocalmonSetPortTimeOuts(), LocalmonStartDocPort(), LocalmonWritePort(), LocalmonXcvOpenPort(), LocalOpenPrinter(), LocalReadPrinter(), LocalScheduleJob(), LocalSetJob(), LocalStartDocPrinter(), LocalStartPagePrinter(), LocalWritePrinter(), LpcpCopyRequestData(), Main_DirectDraw_Release(), MiLockVirtualMemory(), MiniportInitialize(), MiUnlockVirtualMemory(), MmAddVerifierThunks(), MmAdjustWorkingSetSize(), MmProbeAndLockPages(), MountMgrVolumeMountPointChanged(), my_test_server(), nls_from_txt(), NtAdjustPrivilegesToken(), NtCloseObjectAuditAlarm(), NtCreateToken(), NtImpersonateClientOfPort(), NtOpenObjectAuditAlarm(), NtPrivilegedServiceAuditAlarm(), NtReplyWaitReceivePortEx(), NtSetDefaultLocale(), NtSetInformationToken(), NtUserGetCPD(), NtUserSetClassLong(), ObOpenObjectByName(), CExplorerBand::OnContextMenu(), OpenPrinterA(), OpenPrinterW(), OpenPrintProcessor(), PlotCharacter(), PrintDocumentOnPrintProcessor(), PrintingThreadProc(), PrintRawJob(), PspCreateProcess(), QueryPathCompletionRoutine(), ReadJobShadowFile(), ReadPrinter(), RegCopyTreeW(), RegDeleteKeyExW(), RegDeleteKeyValueW(), RegEnumKeyExW(), RegisterGPNotification(), RegKeyEditPermissions(), RegLoadKeyW(), RegQueryInfoKeyW(), RegReplaceKeyW(), RegRestoreKeyW(), RegSaveKeyW(), RegSetKeyValueA(), RegSetKeyValueW(), RegSetValueA(), RegSetValueW(), RemoveDirectoryW(), ReplaceFileW(), RevertToPrinterSelf(), RtlAcquirePrivilege(), RtlpSysVolCheckOwnerAndSecurity(), RtlpSysVolCreateSecurityDescriptor(), RtlpSysVolTakeOwnership(), RtlQueueWorkItem(), ScheduleJob(), SdbGetMatchingExe(), SdbpMatchExe(), SendLinkCreated(), SendLinkDeleted(), SendOnlineNotification(), SepAccessCheckAndAuditAlarm(), SepRegQueryHelper(), SepRmCommandServerThreadInit(), SetDefaultPrinterA(), SetDefaultPrinterW(), SetJobW(), SetPrinterDataExA(), SetupDiGetDriverInfoDetailA(), SetupDiGetINFClassA(), SetupGetInfFileListA(), START_TEST(), StartDocPrinterA(), StartDocPrinterW(), StartPagePrinter(), TestSharedCacheMap(), txt_get_glyph_table(), txt_get_header(), txt_get_mb_table(), txt_get_wc_table(), UserDrawIconEx(), VfatSetRenameInformation(), VgaInitializePalette(), VgaSetMode(), WintrustAddActionID(), WintrustLoadFunctionPointers(), WintrustRemoveActionID(), wmain(), WriteJobShadowFile(), WritePrinter(), wWinMain(), and xHalGetPartialGeometry().

const WCHAR DefaultId[] = {'D','e','f','a','u','l','t','I','d', 0}
static

Definition at line 67 of file register.c.

Referenced by USBH_PdoQueryDeviceText(), and WintrustAddDefaultForUsage().

const WCHAR DiagnosticPolicy[] = {'D','i','a','g','n','o','s','t','i','c','P','o','l','i','c','y','\\', 0}
static
const WCHAR Dll[] = {'$','D','L','L', 0}
static
CRYPT_TRUST_REG_ENTRY DriverCleanupPolicy
static

Definition at line 45 of file register.c.

Referenced by WINTRUST_RegisterDriverVerify().

CRYPT_TRUST_REG_ENTRY DriverFinalPolicy
static

Definition at line 44 of file register.c.

Referenced by WINTRUST_RegisterDriverVerify().

CRYPT_TRUST_REG_ENTRY DriverInitializePolicy
static

Definition at line 43 of file register.c.

Referenced by WINTRUST_RegisterDriverVerify().

const WCHAR FinalPolicy[] = {'F','i','n','a','l','P','o','l','i','c','y','\\', 0}
static
CRYPT_TRUST_REG_ENTRY GenericChainCertificateTrust
static

Definition at line 47 of file register.c.

Referenced by WINTRUST_RegisterGenChainVerify().

CRYPT_TRUST_REG_ENTRY GenericChainFinalProv
static

Definition at line 48 of file register.c.

Referenced by WINTRUST_RegisterGenChainVerify().

CRYPT_TRUST_REG_ENTRY HTTPSCertificateTrust
static

Definition at line 37 of file register.c.

Referenced by WINTRUST_RegisterHttpsProv().

CRYPT_TRUST_REG_ENTRY HTTPSFinalProv
static

Definition at line 38 of file register.c.

Referenced by WINTRUST_RegisterHttpsProv().

const WCHAR Initialization[] = {'I','n','i','t','i','a','l','i','z','a','t','i','o','n','\\', 0}
static
const WCHAR Message[] = {'M','e','s','s','a','g','e','\\', 0}
static
CRYPT_TRUST_REG_ENTRY OfficeCleanupPolicy
static

Definition at line 41 of file register.c.

Referenced by WINTRUST_RegisterOfficeSignVerify().

CRYPT_TRUST_REG_ENTRY OfficeInitializePolicy
static

Definition at line 40 of file register.c.

Referenced by WINTRUST_RegisterOfficeSignVerify().

const WCHAR Signature[] = {'S','i','g','n','a','t','u','r','e','\\', 0}
static
CRYPT_TRUST_REG_ENTRY SoftpubDefCertInit
static

Definition at line 33 of file register.c.

Referenced by WINTRUST_RegisterGenCertVerify().

CRYPT_TRUST_REG_ENTRY SoftpubDumpStructure
static

Definition at line 35 of file register.c.

Referenced by WINTRUST_RegisterTrustProviderTest().

const WCHAR Trust[]
static
Initial value:
= {'S','o','f','t','w','a','r','e','\\',
'M','i','c','r','o','s','o','f','t','\\',
'C','r','y','p','t','o','g','r','a','p','h','y','\\',
'P','r','o','v','i','d','e','r','s','\\',
'T','r','u','s','t','\\', 0 }

Definition at line 52 of file register.c.

Referenced by WINTRUST_ReadProviderFromReg(), WINTRUST_RemoveProviderFromReg(), WINTRUST_WriteProviderToReg(), and WINTRUST_WriteSingleUsageEntry().