diff --git a/reactos/baseaddress.xml b/reactos/baseaddress.xml index 9eef0284d69..b1fa7d8aa9d 100644 --- a/reactos/baseaddress.xml +++ b/reactos/baseaddress.xml @@ -85,6 +85,7 @@ + diff --git a/reactos/bootdata/packages/reactos.dff b/reactos/bootdata/packages/reactos.dff index 4bb902a32f3..6f5daed5023 100755 --- a/reactos/bootdata/packages/reactos.dff +++ b/reactos/bootdata/packages/reactos.dff @@ -167,9 +167,10 @@ lib\user32\user32.dll 1 lib\userenv\userenv.dll 1 lib\uxtheme\uxtheme.dll 1 lib\version\version.dll 1 -lib\winspool\winspool.drv 1 lib\wininet\wininet.dll 1 lib\winmm\winmm.dll 1 +lib\winspool\winspool.drv 1 +lib\wintrust\wintrust.dll 1 lib\ws2_32\ws2_32.dll 1 lib\ws2help\ws2help.dll 1 lib\wshirda\wshirda.dll 1 diff --git a/reactos/lib/directory.xml b/reactos/lib/directory.xml index e478ebf0616..ae4ef977fd1 100644 --- a/reactos/lib/directory.xml +++ b/reactos/lib/directory.xml @@ -338,6 +338,9 @@ + + + diff --git a/reactos/lib/wintrust/Makefile.in b/reactos/lib/wintrust/Makefile.in new file mode 100644 index 00000000000..22000f35233 --- /dev/null +++ b/reactos/lib/wintrust/Makefile.in @@ -0,0 +1,16 @@ +TOPSRCDIR = @top_srcdir@ +TOPOBJDIR = ../.. +SRCDIR = @srcdir@ +VPATH = @srcdir@ +MODULE = wintrust.dll +IMPORTLIB = libwintrust.$(IMPLIBEXT) +IMPORTS = kernel32 + +C_SRCS = wintrust_main.c + +RC_SRCS = \ + version.rc + +@MAKE_DLL_RULES@ + +### Dependencies: diff --git a/reactos/lib/wintrust/version.rc b/reactos/lib/wintrust/version.rc new file mode 100644 index 00000000000..3c13cf999f6 --- /dev/null +++ b/reactos/lib/wintrust/version.rc @@ -0,0 +1,27 @@ +/* + * Copyright 2005 + * + * Stefan Leichter + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#define WINE_FILENAME_STR "wintrust.dll" +#define WINE_FILEVERSION 5,131,2195,6824 +#define WINE_FILEVERSION_STR "5.131.2195.6824" +#define WINE_PRODUCTVERSION 5,131,2195,6824 +#define WINE_PRODUCTVERSION_STR "5.131.2195.6824" + +#include "wine/wine_common_ver.rc" diff --git a/reactos/lib/wintrust/wintrust.spec b/reactos/lib/wintrust/wintrust.spec new file mode 100644 index 00000000000..fccc4aa36c1 --- /dev/null +++ b/reactos/lib/wintrust/wintrust.spec @@ -0,0 +1,124 @@ +@ stub AddPersonalTrustDBPages +@ stub CatalogCompactHashDatabase +@ stdcall CryptCATAdminAcquireContext(long ptr long) +@ stub CryptCATAdminAddCatalog +@ stdcall CryptCATAdminCalcHashFromFileHandle(long ptr ptr long) +@ stub CryptCATAdminEnumCatalogFromHash +@ stub CryptCATAdminPauseServiceForBackup +@ stub CryptCATAdminReleaseCatalogContext +@ stdcall CryptCATAdminReleaseContext(long long) +@ stub CryptCATAdminRemoveCatalog +@ stub CryptCATAdminResolveCatalogPath +@ stub CryptCATCDFClose +@ stub CryptCATCDFEnumAttributes +@ stub CryptCATCDFEnumAttributesWithCDFTag +@ stub CryptCATCDFEnumCatAttributes +@ stub CryptCATCDFEnumMembers +@ stub CryptCATCDFEnumMembersByCDFTag +@ stub CryptCATCDFEnumMembersByCDFTagEx +@ stub CryptCATCDFOpen +@ stub CryptCATCatalogInfoFromContext +@ stub CryptCATClose +@ stub CryptCATEnumerateAttr +@ stub CryptCATEnumerateCatAttr +@ stub CryptCATEnumerateMember +@ stub CryptCATGetAttrInfo +@ stub CryptCATGetCatAttrInfo +@ stub CryptCATGetMemberInfo +@ stub CryptCATHandleFromStore +@ stub CryptCATOpen +@ stub CryptCATPersistStore +@ stub CryptCATPutAttrInfo +@ stub CryptCATPutCatAttrInfo +@ stub CryptCATPutMemberInfo +@ stub CryptCATStoreFromHandle +@ stub CryptCATVerifyMember +@ stub CryptSIPCreateIndirectData +@ stub CryptSIPGetInfo +@ stub CryptSIPGetRegWorkingFlags +@ stub CryptSIPGetSignedDataMsg +@ stub CryptSIPPutSignedDataMsg +@ stub CryptSIPRemoveSignedDataMsg +@ stub CryptSIPVerifyIndirectData +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() +@ stub DriverCleanupPolicy +@ stub DriverFinalPolicy +@ stub DriverInitializePolicy +@ stub FindCertsByIssuer +@ stub GenericChainCertificateTrust +@ stub GenericChainFinalProv +@ stub HTTPSCertificateTrust +@ stub HTTPSFinalProv +@ stub IsCatalogFile +@ stub MsCatConstructHashTag +@ stub MsCatFreeHashTag +@ stub OfficeCleanupPolicy +@ stub OfficeInitializePolicy +@ stub OpenPersonalTrustDBDialog +@ stub SoftpubAuthenticode +@ stub SoftpubCheckCert +@ stub SoftpubCleanup +@ stub SoftpubDefCertInit +@ stub SoftpubDllRegisterServer +@ stub SoftpubDllUnregisterServer +@ stub SoftpubDumpStructure +@ stub SoftpubFreeDefUsageCallData +@ stub SoftpubInitialize +@ stub SoftpubLoadDefUsageCallData +@ stub SoftpubLoadMessage +@ stub SoftpubLoadSignature +@ stub TrustDecode +@ stub TrustFindIssuerCertificate +@ stub TrustFreeDecode +@ stub TrustIsCertificateSelfSigned +@ stub TrustOpenStores +@ stub WTHelperCertFindIssuerCertificate +@ stub WTHelperCertIsSelfSigned +@ stub WTHelperCheckCertUsage +@ stub WTHelperGetAgencyInfo +@ stub WTHelperGetFileHandle +@ stub WTHelperGetFileName +@ stub WTHelperGetKnownUsages +@ stub WTHelperGetProvCertFromChain +@ stub WTHelperGetProvPrivateDataFromChain +@ stub WTHelperGetProvSignerFromChain +@ stub WTHelperIsInRootStore +@ stub WTHelperOpenKnownStores +@ stub WTHelperProvDataFromStateData +@ stub WVTAsn1CatMemberInfoDecode +@ stub WVTAsn1CatMemberInfoEncode +@ stub WVTAsn1CatNameValueDecode +@ stub WVTAsn1CatNameValueEncode +@ stub WVTAsn1SpcFinancialCriteriaInfoDecode +@ stub WVTAsn1SpcFinancialCriteriaInfoEncode +@ stub WVTAsn1SpcIndirectDataContentDecode +@ stub WVTAsn1SpcIndirectDataContentEncode +@ stub WVTAsn1SpcLinkDecode +@ stub WVTAsn1SpcLinkEncode +@ stub WVTAsn1SpcMinimalCriteriaInfoDecode +@ stub WVTAsn1SpcMinimalCriteriaInfoEncode +@ stub WVTAsn1SpcPeImageDataDecode +@ stub WVTAsn1SpcPeImageDataEncode +@ stub WVTAsn1SpcSigInfoDecode +@ stub WVTAsn1SpcSigInfoEncode +@ stub WVTAsn1SpcSpAgencyInfoDecode +@ stub WVTAsn1SpcSpAgencyInfoEncode +@ stub WVTAsn1SpcSpOpusInfoDecode +@ stub WVTAsn1SpcSpOpusInfoEncode +@ stub WVTAsn1SpcStatementTypeDecode +@ stub WVTAsn1SpcStatementTypeEncode +@ stdcall WinVerifyTrust(long ptr ptr) +@ stub WinVerifyTrustEx +@ stdcall WintrustAddActionID(ptr long ptr) +@ stub WintrustAddDefaultForUsage +@ stub WintrustCertificateTrust +@ stub WintrustGetDefaultForUsage +@ stdcall WintrustGetRegPolicyFlags(ptr) +@ stub WintrustLoadFunctionPointers +@ stub WintrustRemoveActionID +@ stdcall WintrustSetRegPolicyFlags(long) +@ stub mscat32DllRegisterServer +@ stub mscat32DllUnregisterServer +@ stub mssip32DllRegisterServer +@ stub mssip32DllUnregisterServer diff --git a/reactos/lib/wintrust/wintrust.xml b/reactos/lib/wintrust/wintrust.xml new file mode 100644 index 00000000000..cc25b8683f1 --- /dev/null +++ b/reactos/lib/wintrust/wintrust.xml @@ -0,0 +1,12 @@ + + + + . + include/wine + + wine + ntdll + wintrust_main.c + version.rc + wintrust.spec + diff --git a/reactos/lib/wintrust/wintrust_main.c b/reactos/lib/wintrust/wintrust_main.c new file mode 100644 index 00000000000..30bb992d8cd --- /dev/null +++ b/reactos/lib/wintrust/wintrust_main.c @@ -0,0 +1,141 @@ +/* + * Copyright 2001 Rein Klazes + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "config.h" + +#include + +#include "windef.h" +#include "winbase.h" +#include "winerror.h" +#include "guiddef.h" +#include "wintrust.h" +#include "mscat.h" +#include "objbase.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wintrust); + +/*********************************************************************** + * CryptCATAdminAcquireContext (WINTRUST.@) + */ +BOOL WINAPI CryptCATAdminAcquireContext(HCATADMIN* catAdmin, + const GUID *sysSystem, DWORD dwFlags ) +{ + FIXME("%p %s %lx\n", catAdmin, debugstr_guid(sysSystem), dwFlags); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +/*********************************************************************** + * CryptCATAdminCalcHashFromFileHandle (WINTRUST.@) + */ +BOOL WINAPI CryptCATAdminCalcHashFromFileHandle(HANDLE hFile, DWORD* pcbHash, + BYTE* pbHash, DWORD dwFlags ) +{ + FIXME("%p %p %p %lx\n", hFile, pcbHash, pbHash, dwFlags); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +/*********************************************************************** + * CryptCATAdminReleaseContext (WINTRUST.@) + */ +BOOL WINAPI CryptCATAdminReleaseContext(HCATADMIN hCatAdmin, DWORD dwFlags ) +{ + FIXME("%p %lx\n", hCatAdmin, dwFlags); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +/*********************************************************************** + * WinVerifyTrust (WINTRUST.@) + */ +LONG WINAPI WinVerifyTrust( HWND hwnd, GUID *ActionID, WINTRUST_DATA* ActionData ) +{ + static const GUID WINTRUST_ACTION_GENERIC_VERIFY_V2 = { 0xaac56b, 0xcd44, 0x11d0, + { 0x8c,0xc2,0x00,0xc0,0x4f,0xc2,0x95,0xee }}; + + FIXME("%p %s %p\n", hwnd, debugstr_guid(ActionID), ActionData); + + /* Trust providers can be found at: + * HKLM\SOFTWARE\Microsoft\Cryptography\Providers\Trust\CertCheck\ + * + * Process Explorer expects a correct implementation, so we + * return TRUST_E_PROVIDER_UNKNOWN. + * + * Girotel needs ERROR_SUCCESS. + * + * For now return TRUST_E_PROVIDER_UNKNOWN only when + * ActionID = WINTRUST_ACTION_GENERIC_VERIFY_V2. + * + */ + + if (IsEqualCLSID(ActionID, &WINTRUST_ACTION_GENERIC_VERIFY_V2)) + return TRUST_E_PROVIDER_UNKNOWN; + + return ERROR_SUCCESS; +} + +/*********************************************************************** + * WintrustAddActionID (WINTRUST.@) + */ +BOOL WINAPI WintrustAddActionID( GUID* pgActionID, DWORD fdwFlags, + CRYPT_REGISTER_ACTIONID* psProvInfo) +{ + FIXME("%p %lx %p\n", pgActionID, fdwFlags, psProvInfo); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +/*********************************************************************** + * WintrustGetRegPolicyFlags (WINTRUST.@) + */ +void WINAPI WintrustGetRegPolicyFlags( DWORD* pdwPolicyFlags ) +{ + FIXME("%p\n", pdwPolicyFlags); + *pdwPolicyFlags = 0; +} + +/*********************************************************************** + * WintrustSetRegPolicyFlags (WINTRUST.@) + */ +BOOL WINAPI WintrustSetRegPolicyFlags( DWORD dwPolicyFlags) +{ + FIXME("stub: %lx\n", dwPolicyFlags); + return TRUE; +} + +/*********************************************************************** + * DllRegisterServer (WINTRUST.@) + */ +HRESULT WINAPI DllRegisterServer(void) +{ + FIXME("stub\n"); + return S_OK; +} + +/*********************************************************************** + * DllUnregisterServer (WINTRUST.@) + */ +HRESULT WINAPI DllUnregisterServer(void) +{ + FIXME("stub\n"); + return S_OK; +} diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index f07d28d83f6..a5ac5939185 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -79,6 +79,7 @@ reactos/lib/urlmon # Synced to Wine-0_9_5 reactos/lib/uxtheme # Synced to Wine-0_9_5 reactos/lib/version # Out of sync reactos/lib/wininet # Out of sync +reactos/lib/wintrust # Synced to Wine-0_9_5 reactos/lib/winmm # Forked at Wine-20050628 reactos/lib/winmm/midimap # Forked at Wine-20050628 reactos/lib/winmm/wavemap # Forked at Wine-20050628 diff --git a/reactos/w32api/include/mscat.h b/reactos/w32api/include/mscat.h new file mode 100644 index 00000000000..209445bda84 --- /dev/null +++ b/reactos/w32api/include/mscat.h @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2004 Francois Gouget + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __WINE_MSCAT_H +#define __WINE_MSCAT_H + +typedef HANDLE HCATADMIN; + + +#ifdef __cplusplus +extern "C" { +#endif + +BOOL WINAPI CryptCATAdminAcquireContext(HCATADMIN*,const GUID*,DWORD); +BOOL WINAPI CryptCATAdminCalcHashFromFileHandle(HANDLE,DWORD*,BYTE*,DWORD); +BOOL WINAPI CryptCATAdminReleaseContext(HCATADMIN,DWORD); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/reactos/w32api/include/wincrypt.h b/reactos/w32api/include/wincrypt.h index 94d90ae051b..95caeff2e80 100644 --- a/reactos/w32api/include/wincrypt.h +++ b/reactos/w32api/include/wincrypt.h @@ -1482,6 +1482,21 @@ typedef struct _CRYPT_ATTRIBUTE { DWORD cValue; PCRYPT_ATTR_BLOB rgValue; } CRYPT_ATTRIBUTE, *PCRYPT_ATTRIBUTE; +typedef struct _CRYPT_ATTRIBUTES { + DWORD cAttr; + PCRYPT_ATTRIBUTE rgAttr; +} CRYPT_ATTRIBUTES, *PCRYPT_ATTRIBUTES; + +typedef struct _CMSG_SIGNER_INFO { + DWORD dwVersion; + CERT_NAME_BLOB Issuer; + CRYPT_INTEGER_BLOB SerialNumber; + CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm; + CRYPT_ALGORITHM_IDENTIFIER HashEncryptionAlgorithm; + CRYPT_DATA_BLOB EncryptedHash; + CRYPT_ATTRIBUTES AuthAttrs; + CRYPT_ATTRIBUTES UnauthAttrs; +} CMSG_SIGNER_INFO, *PCMSG_SIGNER_INFO; typedef struct _CTL_ENTRY { CRYPT_DATA_BLOB SubjectIdentifier; DWORD cAttribute; diff --git a/reactos/w32api/include/wintrust.h b/reactos/w32api/include/wintrust.h new file mode 100644 index 00000000000..e86179b6309 --- /dev/null +++ b/reactos/w32api/include/wintrust.h @@ -0,0 +1,139 @@ +/* + * Copyright (C) 2004 Francois Gouget + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __WINE_WINTRUST_H +#define __WINE_WINTRUST_H + +#include + + +#include + +typedef struct WINTRUST_FILE_INFO_ +{ + DWORD cbStruct; + LPCWSTR pcwszFilePath; + HANDLE hFile; + GUID* pgKnownSubject; +} WINTRUST_FILE_INFO, *PWINTRUST_FILE_INFO; + +typedef struct WINTRUST_CATALOG_INFO_ +{ + DWORD cbStruct; + DWORD dwCatalogVersion; + LPCWSTR pcwszCatalogFilePath; + LPCWSTR pcwszMemberTag; + LPCWSTR pcwszMemberFilePath; + HANDLE hMemberFile; + BYTE* pbCalculatedFileHash; + DWORD cbCalculatedFileHash; + PCCTL_CONTEXT pcCatalogContext; +} WINTRUST_CATALOG_INFO, *PWINTRUST_CATALOG_INFO; + +typedef struct WINTRUST_BLOB_INFO_ +{ + DWORD cbStruct; + GUID gSubject; + LPCWSTR pcwszDisplayName; + DWORD cbMemObject; + BYTE* pbMemObject; + DWORD cbMemSignedMsg; + BYTE* pbMemSignedMsg; +} WINTRUST_BLOB_INFO, *PWINTRUST_BLOB_INFO; + +typedef struct WINTRUST_SGNR_INFO_ +{ + DWORD cbStruct; + LPCWSTR pcwszDisplayName; + CMSG_SIGNER_INFO* psSignerInfo; + DWORD chStores; + HCERTSTORE* pahStores; +} WINTRUST_SGNR_INFO, *PWINTRUST_SGNR_INFO; + +typedef struct WINTRUST_CERT_INFO_ +{ + DWORD cbStruct; + LPCWSTR pcwszDisplayName; + CERT_CONTEXT* psCertContext; + DWORD chStores; + HCERTSTORE* pahStores; + DWORD dwFlags; + FILETIME* psftVerifyAsOf; +} WINTRUST_CERT_INFO, *PWINTRUST_CERT_INFO; + + +typedef struct _WINTRUST_DATA +{ + DWORD cbStruct; + LPVOID pPolicyCallbackData; + LPVOID pSIPClientData; + DWORD dwUIChoice; + DWORD fdwRevocationChecks; + DWORD dwUnionChoice; + union + { + struct WINTRUST_FILE_INFO_* pFile; + struct WINTRUST_CATALOG_INFO_* pCatalog; + struct WINTRUST_BLOB_INFO_* pBlob; + struct WINTRUST_SGNR_INFO_* pSgnr; + struct WINTRUST_CERT_INFO_* pCert; + } DUMMYUNIONNAME; + + DWORD dwStateAction; + HANDLE hWVTStateData; + WCHAR* pwszURLReference; + DWORD dwProvFlags; + DWORD dwUIContext; +} WINTRUST_DATA, *PWINTRUST_DATA; + +typedef struct _CRYPT_TRUST_REG_ENTRY +{ + DWORD cbStruct; + WCHAR *pwszDLLName; + WCHAR *pwszFunctionName; +} CRYPT_TRUST_REG_ENTRY, *PCRYPT_TRUST_REG_ENTRY; + +typedef struct _CRYPT_REGISTER_ACTIONID +{ + DWORD cbStruct; + CRYPT_TRUST_REG_ENTRY sInitProvider; + CRYPT_TRUST_REG_ENTRY sObjectProvider; + CRYPT_TRUST_REG_ENTRY sSignatureProvider; + CRYPT_TRUST_REG_ENTRY sCertificateProvider; + CRYPT_TRUST_REG_ENTRY sCertificatePolicyProvider; + CRYPT_TRUST_REG_ENTRY sFinalPolicyProvider; + CRYPT_TRUST_REG_ENTRY sTestPolicyProvider; + CRYPT_TRUST_REG_ENTRY sCleanupProvider; +} CRYPT_REGISTER_ACTIONID, *PCRYPT_REGISTER_ACTIONID; + +#include + + +#ifdef __cplusplus +extern "C" { +#endif + +BOOL WINAPI WintrustAddActionID(GUID*,DWORD,CRYPT_REGISTER_ACTIONID*); +void WINAPI WintrustGetRegPolicyFlags(DWORD*); +LONG WINAPI WinVerifyTrust(HWND,GUID*,WINTRUST_DATA*); + +#ifdef __cplusplus +} +#endif + +#endif