2008-04-10 20:16:01 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2008 Juan Lang
|
|
|
|
*
|
|
|
|
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
2008-09-20 01:58:03 +02:00
|
|
|
#include "winnls.h"
|
2008-08-28 17:41:59 +02:00
|
|
|
#include "winuser.h"
|
|
|
|
#include "cryptuiapi.h"
|
2008-04-10 20:16:01 +02:00
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(cryptui);
|
|
|
|
|
|
|
|
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
|
|
|
{
|
|
|
|
TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
|
|
|
|
|
|
|
|
switch (fdwReason)
|
|
|
|
{
|
|
|
|
case DLL_WINE_PREATTACH:
|
|
|
|
return FALSE; /* prefer native version */
|
|
|
|
case DLL_PROCESS_ATTACH:
|
|
|
|
DisableThreadLibraryCalls(hinstDLL);
|
|
|
|
break;
|
|
|
|
case DLL_PROCESS_DETACH:
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
2008-08-28 17:41:59 +02:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CryptUIDlgCertMgr (CRYPTUI.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI CryptUIDlgCertMgr(PCCRYPTUI_CERT_MGR_STRUCT pCryptUICertMgr)
|
|
|
|
{
|
|
|
|
FIXME("(%p): stub\n", pCryptUICertMgr);
|
|
|
|
return FALSE;
|
|
|
|
}
|
2008-09-11 11:47:14 +02:00
|
|
|
|
2008-09-20 01:58:03 +02:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2008-09-11 11:47:14 +02:00
|
|
|
BOOL WINAPI CryptUIDlgViewCertificateW(PCCRYPTUI_VIEWCERTIFICATE_STRUCTW pCertViewInfo,
|
|
|
|
BOOL *pfPropertiesChanged)
|
|
|
|
{
|
|
|
|
FIXME("(%p, %p): stub\n", pCertViewInfo, pfPropertiesChanged);
|
|
|
|
if (pfPropertiesChanged) *pfPropertiesChanged = FALSE;
|
|
|
|
return TRUE;
|
|
|
|
}
|