Synchronize with trunk revision 59636 (just before Alex's CreateProcess revamp).
[reactos.git] / dll / cpl / inetcpl / content.c
1 /*
2 * Internet control panel applet: content propsheet
3 *
4 * Copyright 2010 Detlef Riekenberg
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 *
20 */
21
22 #define NONAMELESSUNION
23 #define WIN32_NO_STATUS
24
25 #include <stdarg.h>
26 #include <windef.h>
27 #include <winbase.h>
28 #include <winuser.h>
29 #include <cryptuiapi.h>
30
31 #include "inetcpl.h"
32 #include <wine/debug.h>
33
34 WINE_DEFAULT_DEBUG_CHANNEL(inetcpl);
35
36 /*********************************************************************
37 * display_cert_manager (internal)
38 *
39 * call cryptui to display a specific certificate manager dialog
40 *
41 */
42 static BOOL display_cert_manager(HWND parent, DWORD flags)
43 {
44 CRYPTUI_CERT_MGR_STRUCT dlg;
45
46 TRACE("(%p, 0x%x)\n", parent, flags);
47
48 ZeroMemory(&dlg, sizeof(CRYPTUI_CERT_MGR_STRUCT));
49 dlg.dwSize = sizeof(CRYPTUI_CERT_MGR_STRUCT);
50 dlg.hwndParent = parent;
51 dlg.dwFlags = flags;
52
53 return CryptUIDlgCertMgr(&dlg);
54 }
55
56 /*********************************************************************
57 * LaunchSiteCertDialog (inetcpl.@)
58 *
59 * Launch a dialog to manage personal certificates
60 *
61 * PARAMS
62 * parent [I] Handle for the parent window
63 *
64 * RETURNS
65 * Failure: FALSE
66 * Success: TRUE
67 *
68 * NOTES
69 * rundll32 callable function: rundll32 inetcpl.cpl,LaunchSiteCertDialog
70 *
71 */
72 BOOL WINAPI LaunchSiteCertDialog(HWND parent)
73 {
74 return display_cert_manager(parent, 0);
75 }
76
77 /*********************************************************************
78 * content_dlgproc [internal]
79 *
80 */
81 INT_PTR CALLBACK content_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
82 {
83 if ((msg != WM_SETCURSOR) && (msg != WM_NCHITTEST) && (msg != WM_MOUSEMOVE))
84 TRACE("(%p, 0x%08x/%d, 0x%lx, 0x%lx)\n", hwnd, msg, msg, wparam, lparam);
85
86 if (msg == WM_COMMAND)
87 {
88 switch (LOWORD(wparam))
89 {
90 case IDC_CERT:
91 display_cert_manager(hwnd, 0);
92 break;
93
94 case IDC_CERT_PUBLISHER:
95 display_cert_manager(hwnd, CRYPTUI_CERT_MGR_PUBLISHER_TAB);
96 break;
97 }
98 }
99 return FALSE;
100 }