From 2f2ccbd779b25f17c0c0b0182951811568af2572 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Wed, 23 Apr 2008 14:59:44 -0700 Subject: [PATCH] cryptdlg: Implement GetFriendlyNameOfCertA/W. --- dlls/cryptdlg/Makefile.in | 2 +- dlls/cryptdlg/cryptdlg.spec | 4 ++-- dlls/cryptdlg/main.c | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/dlls/cryptdlg/Makefile.in b/dlls/cryptdlg/Makefile.in index 9c936303435..612a90d5d73 100644 --- a/dlls/cryptdlg/Makefile.in +++ b/dlls/cryptdlg/Makefile.in @@ -3,7 +3,7 @@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = cryptdlg.dll -IMPORTS = kernel32 +IMPORTS = crypt32 kernel32 C_SRCS = \ main.c diff --git a/dlls/cryptdlg/cryptdlg.spec b/dlls/cryptdlg/cryptdlg.spec index 1b80d406607..70f38b9e310 100644 --- a/dlls/cryptdlg/cryptdlg.spec +++ b/dlls/cryptdlg/cryptdlg.spec @@ -17,5 +17,5 @@ 17 stub CertViewPropertiesW 18 stub DllRegisterServer 19 stub DllUnregisterServer -20 stub GetFriendlyNameOfCertA -21 stub GetFriendlyNameOfCertW +20 stdcall GetFriendlyNameOfCertA(ptr ptr long) +21 stdcall GetFriendlyNameOfCertW(ptr ptr long) diff --git a/dlls/cryptdlg/main.c b/dlls/cryptdlg/main.c index eec0fa09550..c3c2ae768e8 100644 --- a/dlls/cryptdlg/main.c +++ b/dlls/cryptdlg/main.c @@ -22,6 +22,7 @@ #include "windef.h" #include "winbase.h" +#include "wincrypt.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(cryptdlg); @@ -44,3 +45,17 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) } return TRUE; } + +DWORD GetFriendlyNameOfCertA(PCCERT_CONTEXT pccert, LPSTR pchBuffer, + DWORD cchBuffer) +{ + return CertGetNameStringA(pccert, CERT_NAME_FRIENDLY_DISPLAY_TYPE, 0, NULL, + pchBuffer, cchBuffer); +} + +DWORD GetFriendlyNameOfCertW(PCCERT_CONTEXT pccert, LPWSTR pchBuffer, + DWORD cchBuffer) +{ + return CertGetNameStringW(pccert, CERT_NAME_FRIENDLY_DISPLAY_TYPE, 0, NULL, + pchBuffer, cchBuffer); +} -- 2.11.4.GIT