winmm: Fix a failing mixer test on 98 and ME.
[wine] / dlls / cryptui / main.c
1 /*
2  * Copyright 2008 Juan Lang
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
18
19 #include "config.h"
20
21 #include <stdarg.h>
22
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winnls.h"
26 #include "winuser.h"
27 #include "cryptuiapi.h"
28 #include "wine/debug.h"
29
30 WINE_DEFAULT_DEBUG_CHANNEL(cryptui);
31
32 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
33 {
34     TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
35
36     switch (fdwReason)
37     {
38         case DLL_WINE_PREATTACH:
39             return FALSE;    /* prefer native version */
40         case DLL_PROCESS_ATTACH:
41             DisableThreadLibraryCalls(hinstDLL);
42             break;
43         case DLL_PROCESS_DETACH:
44             break;
45         default:
46             break;
47     }
48     return TRUE;
49 }
50
51 /***********************************************************************
52  *              CryptUIDlgCertMgr (CRYPTUI.@)
53  */
54 BOOL WINAPI CryptUIDlgCertMgr(PCCRYPTUI_CERT_MGR_STRUCT pCryptUICertMgr)
55 {
56     FIXME("(%p): stub\n", pCryptUICertMgr);
57     return FALSE;
58 }
59
60 BOOL WINAPI CryptUIDlgViewCertificateA(
61  PCCRYPTUI_VIEWCERTIFICATE_STRUCTA pCertViewInfo, BOOL *pfPropertiesChanged)
62 {
63     CRYPTUI_VIEWCERTIFICATE_STRUCTW viewInfo;
64     LPWSTR title = NULL;
65     BOOL ret;
66
67     TRACE("(%p, %p)\n", pCertViewInfo, pfPropertiesChanged);
68
69     memcpy(&viewInfo, pCertViewInfo, sizeof(viewInfo));
70     if (pCertViewInfo->szTitle)
71     {
72         int len = MultiByteToWideChar(CP_ACP, 0, pCertViewInfo->szTitle, -1,
73          NULL, 0);
74
75         title = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
76         if (title)
77         {
78             MultiByteToWideChar(CP_ACP, 0, pCertViewInfo->szTitle, -1, title,
79              len);
80             viewInfo.szTitle = title;
81         }
82         else
83         {
84             ret = FALSE;
85             goto error;
86         }
87     }
88     ret = CryptUIDlgViewCertificateW(&viewInfo, pfPropertiesChanged);
89     HeapFree(GetProcessHeap(), 0, title);
90 error:
91     return ret;
92 }
93
94 BOOL WINAPI CryptUIDlgViewCertificateW(PCCRYPTUI_VIEWCERTIFICATE_STRUCTW pCertViewInfo,
95                                        BOOL *pfPropertiesChanged)
96 {
97     FIXME("(%p, %p): stub\n", pCertViewInfo, pfPropertiesChanged);
98     if (pfPropertiesChanged) *pfPropertiesChanged = FALSE;
99     return TRUE;
100 }