From f422fa83d22635a3ae13a8f34ae62b2581dfcc93 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Mon, 22 Sep 2008 11:06:58 -0700 Subject: [PATCH] cryptdlg: Implement CertViewPropertiesA on top of CertViewPropertiesW. --- dlls/cryptdlg/main.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/dlls/cryptdlg/main.c b/dlls/cryptdlg/main.c index 2447c3887b3..943794a30e2 100644 --- a/dlls/cryptdlg/main.c +++ b/dlls/cryptdlg/main.c @@ -22,6 +22,7 @@ #include "windef.h" #include "winbase.h" +#include "winnls.h" #include "wincrypt.h" #include "wintrust.h" #include "winuser.h" @@ -110,8 +111,33 @@ HRESULT WINAPI CertTrustFinalPolicy(CRYPT_PROVIDER_DATA *pProvData) */ BOOL WINAPI CertViewPropertiesA(CERT_VIEWPROPERTIES_STRUCT_A *info) { - FIXME("(%p): stub\n", info); - return FALSE; + CERT_VIEWPROPERTIES_STRUCT_W infoW; + LPWSTR title = NULL; + BOOL ret; + + TRACE("(%p)\n", info); + + memcpy(&infoW, info, sizeof(infoW)); + if (info->szTitle) + { + int len = MultiByteToWideChar(CP_ACP, 0, info->szTitle, -1, NULL, 0); + + title = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + if (title) + { + MultiByteToWideChar(CP_ACP, 0, info->szTitle, -1, title, len); + infoW.szTitle = title; + } + else + { + ret = FALSE; + goto error; + } + } + ret = CertViewPropertiesW(&infoW); + HeapFree(GetProcessHeap(), 0, title); +error: + return ret; } /***********************************************************************