gdi32/tests: Fix a signed/unsigned int mismatch.
[wine] / dlls / wintrust / crypt.c
1 /*
2  * WinTrust Cryptography functions
3  *
4  * Copyright 2006 James Hawkins
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 #include <stdarg.h>
22
23 #include "windef.h"
24 #include "winbase.h"
25 #include "wintrust.h"
26 #include "mscat.h"
27 #include "mssip.h"
28
29 #include "wine/debug.h"
30
31 WINE_DEFAULT_DEBUG_CHANNEL(wintrust);
32
33 /***********************************************************************
34  *      CryptCATAdminAcquireContext (WINTRUST.@)
35  *
36  * Get a catalog administrator context handle.
37  *
38  * PARAMS
39  *   catAdmin  [O] Pointer to the context handle.
40  *   sysSystem [I] Pointer to a GUID for the needed subsystem.
41  *   dwFlags   [I] Reserved.
42  *
43  * RETURNS
44  *   Success: TRUE. catAdmin contains the context handle.
45  *   Failure: FALSE.
46  *
47  */
48 BOOL WINAPI CryptCATAdminAcquireContext(HCATADMIN* catAdmin,
49                     const GUID *sysSystem, DWORD dwFlags )
50 {
51     FIXME("%p %s %x\n", catAdmin, debugstr_guid(sysSystem), dwFlags);
52
53     if (catAdmin) *catAdmin = (HCATADMIN)0xdeadbeef;
54     return TRUE;
55 }
56
57 /***********************************************************************
58  *             CryptCATAdminCalcHashFromFileHandle (WINTRUST.@)
59  */
60 BOOL WINAPI CryptCATAdminCalcHashFromFileHandle(HANDLE hFile, DWORD* pcbHash,
61                                                 BYTE* pbHash, DWORD dwFlags )
62 {
63     FIXME("%p %p %p %x\n", hFile, pcbHash, pbHash, dwFlags);
64
65     if (pbHash && pcbHash) memset(pbHash, 0, *pcbHash);
66     return TRUE;
67 }
68
69 /***********************************************************************
70  *             CryptCATAdminEnumCatalogFromHash (WINTRUST.@)
71  */
72 HCATINFO WINAPI CryptCATAdminEnumCatalogFromHash(HCATADMIN hCatAdmin,
73                                                  BYTE* pbHash,
74                                                  DWORD cbHash,
75                                                  DWORD dwFlags,
76                                                  HCATINFO* phPrevCatInfo )
77 {
78     FIXME("%p %p %d %d %p\n", hCatAdmin, pbHash, cbHash, dwFlags, phPrevCatInfo);
79     return NULL;
80 }
81
82 /***********************************************************************
83  *      CryptCATAdminReleaseContext (WINTRUST.@)
84  *
85  * Release a catalog administrator context handle.
86  *
87  * PARAMS
88  *   catAdmin  [I] Context handle.
89  *   dwFlags   [I] Reserved.
90  *
91  * RETURNS
92  *   Success: TRUE.
93  *   Failure: FAIL.
94  *
95  */
96 BOOL WINAPI CryptCATAdminReleaseContext(HCATADMIN hCatAdmin, DWORD dwFlags )
97 {
98     FIXME("%p %x\n", hCatAdmin, dwFlags);
99     return TRUE;
100 }
101
102 /***********************************************************************
103  *      CryptCATAdminRemoveCatalog (WINTRUST.@)
104  *
105  * Remove a catalog file.
106  *
107  * PARAMS
108  *   catAdmin         [I] Context handle.
109  *   pwszCatalogFile  [I] Catalog file.
110  *   dwFlags          [I] Reserved.
111  *
112  * RETURNS
113  *   Success: TRUE.
114  *   Failure: FALSE.
115  *
116  */
117 BOOL WINAPI CryptCATAdminRemoveCatalog(HCATADMIN hCatAdmin, LPCWSTR pwszCatalogFile, DWORD dwFlags)
118 {
119     FIXME("%p %s %x\n", hCatAdmin, debugstr_w(pwszCatalogFile), dwFlags);
120     return DeleteFileW(pwszCatalogFile);
121 }
122
123 /***********************************************************************
124  *      CryptCATClose  (WINTRUST.@)
125  */
126 BOOL WINAPI CryptCATClose(HANDLE hCatalog)
127 {
128     FIXME("(%p) stub\n", hCatalog);
129     return TRUE;
130 }
131
132 /***********************************************************************
133  *      CryptCATEnumerateMember  (WINTRUST.@)
134  */
135 CRYPTCATMEMBER *WINAPI CryptCATEnumerateMember(HANDLE hCatalog, CRYPTCATMEMBER* pPrevMember)
136 {
137     FIXME("(%p, %p) stub\n", hCatalog, pPrevMember);
138     return NULL;
139 }
140
141 /***********************************************************************
142  *      CryptCATOpen  (WINTRUST.@)
143  */
144 HANDLE WINAPI CryptCATOpen(LPWSTR pwszFileName, DWORD fdwOpenFlags, HCRYPTPROV hProv,
145                            DWORD dwPublicVersion, DWORD dwEncodingType)
146 {
147     FIXME("(%s, %d, %ld, %d, %d) stub\n", debugstr_w(pwszFileName), fdwOpenFlags,
148           hProv, dwPublicVersion, dwEncodingType);
149     return 0;
150 }
151
152 /***********************************************************************
153  *      CryptSIPCreateIndirectData  (WINTRUST.@)
154  */
155 BOOL WINAPI CryptSIPCreateIndirectData(SIP_SUBJECTINFO* pSubjectInfo, DWORD* pcbIndirectData,
156                                        SIP_INDIRECT_DATA* pIndirectData)
157 {
158     FIXME("(%p %p %p) stub\n", pSubjectInfo, pcbIndirectData, pIndirectData);
159  
160     return FALSE;
161 }
162
163 /***********************************************************************
164  *      CryptSIPGetSignedDataMsg  (WINTRUST.@)
165  */
166 BOOL WINAPI CryptSIPGetSignedDataMsg(SIP_SUBJECTINFO* pSubjectInfo, DWORD* pdwEncodingType,
167                                        DWORD dwIndex, DWORD* pcbSignedDataMsg, BYTE* pbSignedDataMsg)
168 {
169     FIXME("(%p %p %d %p %p) stub\n", pSubjectInfo, pdwEncodingType, dwIndex,
170           pcbSignedDataMsg, pbSignedDataMsg);
171  
172     return FALSE;
173 }
174
175 /***********************************************************************
176  *      CryptSIPPutSignedDataMsg  (WINTRUST.@)
177  */
178 BOOL WINAPI CryptSIPPutSignedDataMsg(SIP_SUBJECTINFO* pSubjectInfo, DWORD pdwEncodingType,
179                                        DWORD* pdwIndex, DWORD cbSignedDataMsg, BYTE* pbSignedDataMsg)
180 {
181     FIXME("(%p %d %p %d %p) stub\n", pSubjectInfo, pdwEncodingType, pdwIndex,
182           cbSignedDataMsg, pbSignedDataMsg);
183  
184     return FALSE;
185 }
186
187 /***********************************************************************
188  *      CryptSIPRemoveSignedDataMsg  (WINTRUST.@)
189  */
190 BOOL WINAPI CryptSIPRemoveSignedDataMsg(SIP_SUBJECTINFO* pSubjectInfo,
191                                        DWORD dwIndex)
192 {
193     FIXME("(%p %d) stub\n", pSubjectInfo, dwIndex);
194  
195     return FALSE;
196 }
197
198 /***********************************************************************
199  *      CryptSIPVerifyIndirectData  (WINTRUST.@)
200  */
201 BOOL WINAPI CryptSIPVerifyIndirectData(SIP_SUBJECTINFO* pSubjectInfo,
202                                        SIP_INDIRECT_DATA* pIndirectData)
203 {
204     FIXME("(%p %p) stub\n", pSubjectInfo, pIndirectData);
205  
206     return FALSE;
207 }