cryptdlg: Implement CertViewPropertiesW on top of CryptUIDlgViewCertificateW.
This commit is contained in:
parent
f422fa83d2
commit
0ff7bf13f6
@ -3,7 +3,7 @@ TOPOBJDIR = ../..
|
|||||||
SRCDIR = @srcdir@
|
SRCDIR = @srcdir@
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
MODULE = cryptdlg.dll
|
MODULE = cryptdlg.dll
|
||||||
IMPORTS = crypt32 wintrust kernel32
|
IMPORTS = cryptui crypt32 wintrust kernel32
|
||||||
|
|
||||||
C_SRCS = \
|
C_SRCS = \
|
||||||
main.c
|
main.c
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include "wintrust.h"
|
#include "wintrust.h"
|
||||||
#include "winuser.h"
|
#include "winuser.h"
|
||||||
#include "cryptdlg.h"
|
#include "cryptdlg.h"
|
||||||
|
#include "cryptuiapi.h"
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(cryptdlg);
|
WINE_DEFAULT_DEBUG_CHANNEL(cryptdlg);
|
||||||
@ -145,8 +146,61 @@ error:
|
|||||||
*/
|
*/
|
||||||
BOOL WINAPI CertViewPropertiesW(CERT_VIEWPROPERTIES_STRUCT_W *info)
|
BOOL WINAPI CertViewPropertiesW(CERT_VIEWPROPERTIES_STRUCT_W *info)
|
||||||
{
|
{
|
||||||
FIXME("(%p): stub\n", info);
|
static GUID cert_action_verify = CERT_CERTIFICATE_ACTION_VERIFY;
|
||||||
return FALSE;
|
CERT_VERIFY_CERTIFICATE_TRUST trust;
|
||||||
|
WINTRUST_BLOB_INFO blob;
|
||||||
|
WINTRUST_DATA wtd;
|
||||||
|
LONG err;
|
||||||
|
BOOL ret;
|
||||||
|
|
||||||
|
TRACE("(%p)\n", info);
|
||||||
|
|
||||||
|
memset(&trust, 0, sizeof(trust));
|
||||||
|
trust.cbSize = sizeof(trust);
|
||||||
|
trust.pccert = info->pCertContext;
|
||||||
|
trust.cRootStores = info->cRootStores;
|
||||||
|
trust.rghstoreRoots = info->rghstoreRoots;
|
||||||
|
trust.cStores = info->cStores;
|
||||||
|
trust.rghstoreCAs = info->rghstoreCAs;
|
||||||
|
trust.cTrustStores = info->cTrustStores;
|
||||||
|
trust.rghstoreTrust = info->rghstoreTrust;
|
||||||
|
memset(&blob, 0, sizeof(blob));
|
||||||
|
blob.cbStruct = sizeof(blob);
|
||||||
|
blob.cbMemObject = sizeof(trust);
|
||||||
|
blob.pbMemObject = (BYTE *)&trust;
|
||||||
|
memset(&wtd, 0, sizeof(wtd));
|
||||||
|
wtd.cbStruct = sizeof(wtd);
|
||||||
|
wtd.dwUIChoice = WTD_UI_NONE;
|
||||||
|
wtd.dwUnionChoice = WTD_CHOICE_BLOB;
|
||||||
|
wtd.pBlob = &blob;
|
||||||
|
wtd.dwStateAction = WTD_STATEACTION_VERIFY;
|
||||||
|
err = WinVerifyTrust(NULL, &cert_action_verify, &wtd);
|
||||||
|
if (err == ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
CRYPTUI_VIEWCERTIFICATE_STRUCTW uiInfo;
|
||||||
|
BOOL propsChanged = FALSE;
|
||||||
|
|
||||||
|
memset(&uiInfo, 0, sizeof(uiInfo));
|
||||||
|
uiInfo.dwSize = sizeof(uiInfo);
|
||||||
|
uiInfo.hwndParent = info->hwndParent;
|
||||||
|
uiInfo.dwFlags =
|
||||||
|
CRYPTUI_DISABLE_ADDTOSTORE | CRYPTUI_ENABLE_EDITPROPERTIES;
|
||||||
|
uiInfo.szTitle = info->szTitle;
|
||||||
|
uiInfo.pCertContext = info->pCertContext;
|
||||||
|
uiInfo.cPurposes = info->cArrayPurposes;
|
||||||
|
uiInfo.rgszPurposes = (LPCSTR *)info->arrayPurposes;
|
||||||
|
uiInfo.hWVTStateData = wtd.hWVTStateData;
|
||||||
|
uiInfo.fpCryptProviderDataTrustedUsage = TRUE;
|
||||||
|
uiInfo.cPropSheetPages = info->cArrayPropSheetPages;
|
||||||
|
uiInfo.rgPropSheetPages = info->arrayPropSheetPages;
|
||||||
|
uiInfo.nStartPage = info->nStartPage;
|
||||||
|
ret = CryptUIDlgViewCertificateW(&uiInfo, &propsChanged);
|
||||||
|
wtd.dwStateAction = WTD_STATEACTION_CLOSE;
|
||||||
|
WinVerifyTrust(NULL, &cert_action_verify, &wtd);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ret = FALSE;
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
Loading…
x
Reference in New Issue
Block a user