cryptui: Implement CryptUIDlgViewCertificateA on top of CryptUIDlgViewCertificateW.

This commit is contained in:
Juan Lang 2008-09-19 16:58:03 -07:00 committed by Alexandre Julliard
parent 6538cb44e3
commit b01348c9a9
2 changed files with 36 additions and 1 deletions

View File

@ -11,7 +11,7 @@
11 stub CryptUIDlgViewCRLW
12 stub CryptUIDlgViewCTLA
13 stub CryptUIDlgViewCTLW
14 stub CryptUIDlgViewCertificateA
14 stdcall CryptUIDlgViewCertificateA(ptr ptr)
15 stub CryptUIDlgViewCertificatePropertiesA
16 stub CryptUIDlgViewCertificatePropertiesW
17 stdcall CryptUIDlgViewCertificateW(ptr ptr)

View File

@ -22,6 +22,7 @@
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winuser.h"
#include "cryptuiapi.h"
#include "wine/debug.h"
@ -56,6 +57,40 @@ BOOL WINAPI CryptUIDlgCertMgr(PCCRYPTUI_CERT_MGR_STRUCT pCryptUICertMgr)
return FALSE;
}
BOOL WINAPI CryptUIDlgViewCertificateA(
PCCRYPTUI_VIEWCERTIFICATE_STRUCTA pCertViewInfo, BOOL *pfPropertiesChanged)
{
CRYPTUI_VIEWCERTIFICATE_STRUCTW viewInfo;
LPWSTR title = NULL;
BOOL ret;
TRACE("(%p, %p)\n", pCertViewInfo, pfPropertiesChanged);
memcpy(&viewInfo, pCertViewInfo, sizeof(viewInfo));
if (pCertViewInfo->szTitle)
{
int len = MultiByteToWideChar(CP_ACP, 0, pCertViewInfo->szTitle, -1,
NULL, 0);
title = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (title)
{
MultiByteToWideChar(CP_ACP, 0, pCertViewInfo->szTitle, -1, title,
len);
viewInfo.szTitle = title;
}
else
{
ret = FALSE;
goto error;
}
}
ret = CryptUIDlgViewCertificateW(&viewInfo, pfPropertiesChanged);
HeapFree(GetProcessHeap(), 0, title);
error:
return ret;
}
BOOL WINAPI CryptUIDlgViewCertificateW(PCCRYPTUI_VIEWCERTIFICATE_STRUCTW pCertViewInfo,
BOOL *pfPropertiesChanged)
{