dbghelp: Cast-qual warnings fix.
[wine.git] / dlls / wintrust / wintrust_main.c
blob8a9a2f538079a3ebed3aa3de5a7f000de93edb64
1 /*
2 * Copyright 2001 Rein Klazes
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.
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.
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
19 #include "config.h"
21 #include <stdarg.h>
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winerror.h"
26 #include "guiddef.h"
27 #include "wintrust.h"
28 #include "softpub.h"
29 #include "mscat.h"
30 #include "objbase.h"
32 #include "wine/debug.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(wintrust);
37 /***********************************************************************
38 * DllMain (WINTRUST.@)
40 BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
42 switch(reason)
44 case DLL_WINE_PREATTACH:
45 return FALSE; /* prefer native version */
46 case DLL_PROCESS_ATTACH:
47 DisableThreadLibraryCalls( inst );
48 break;
50 return TRUE;
53 /***********************************************************************
54 * CryptCATAdminAcquireContext (WINTRUST.@)
56 * Get a catalog administrator context handle.
58 * PARAMS
59 * catAdmin [O] Pointer to the context handle.
60 * sysSystem [I] Pointer to a GUID for the needed subsystem.
61 * dwFlags [I] Reserved.
63 * RETURNS
64 * Success: TRUE. catAdmin contains the context handle.
65 * Failure: FAIL.
68 BOOL WINAPI CryptCATAdminAcquireContext(HCATADMIN* catAdmin,
69 const GUID *sysSystem, DWORD dwFlags )
71 FIXME("%p %s %lx\n", catAdmin, debugstr_guid(sysSystem), dwFlags);
72 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
73 return FALSE;
76 /***********************************************************************
77 * CryptCATAdminCalcHashFromFileHandle (WINTRUST.@)
79 BOOL WINAPI CryptCATAdminCalcHashFromFileHandle(HANDLE hFile, DWORD* pcbHash,
80 BYTE* pbHash, DWORD dwFlags )
82 FIXME("%p %p %p %lx\n", hFile, pcbHash, pbHash, dwFlags);
83 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
84 return FALSE;
87 /***********************************************************************
88 * CryptCATAdminEnumCatalogFromHash (WINTRUST.@)
90 HCATINFO WINAPI CryptCATAdminEnumCatalogFromHash(HCATADMIN hCatAdmin,
91 BYTE* pbHash,
92 DWORD cbHash,
93 DWORD dwFlags,
94 HCATINFO* phPrevCatInfo )
96 FIXME("%p %p %ld %ld %p\n", hCatAdmin, pbHash, cbHash, dwFlags, phPrevCatInfo);
97 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
98 return NULL;
101 /***********************************************************************
102 * CryptCATAdminReleaseContext (WINTRUST.@)
104 * Release a catalog administrator context handle.
106 * PARAMS
107 * catAdmin [I] Pointer to the context handle.
108 * dwFlags [I] Reserved.
110 * RETURNS
111 * Success: TRUE.
112 * Failure: FAIL.
115 BOOL WINAPI CryptCATAdminReleaseContext(HCATADMIN hCatAdmin, DWORD dwFlags )
117 FIXME("%p %lx\n", hCatAdmin, dwFlags);
118 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
119 return FALSE;
122 /***********************************************************************
123 * TrustIsCertificateSelfSigned (WINTRUST.@)
125 BOOL WINAPI TrustIsCertificateSelfSigned( PCCERT_CONTEXT cert )
127 BOOL ret;
129 TRACE("%p\n", cert);
130 ret = CertCompareCertificateName(cert->dwCertEncodingType,
131 &cert->pCertInfo->Subject, &cert->pCertInfo->Issuer);
132 return ret;
135 /***********************************************************************
136 * WinVerifyTrust (WINTRUST.@)
138 * Verifies an object by calling the specified trust provider.
140 * PARAMS
141 * hwnd [I] Handle to a caller window.
142 * ActionID [I] Pointer to a GUID that identifies the action to perform.
143 * ActionData [I] Information used by the trust provider to verify the object.
145 * RETURNS
146 * Success: Zero.
147 * Failure: A TRUST_E_* error code.
149 * NOTES
150 * Trust providers can be found at:
151 * HKLM\SOFTWARE\Microsoft\Cryptography\Providers\Trust\
153 LONG WINAPI WinVerifyTrust( HWND hwnd, GUID *ActionID, WINTRUST_DATA* ActionData )
155 FIXME("%p %s %p\n", hwnd, debugstr_guid(ActionID), ActionData);
156 return ERROR_SUCCESS;
159 /***********************************************************************
160 * WinVerifyTrustEx (WINTRUST.@)
162 HRESULT WINAPI WinVerifyTrustEx( HWND hwnd, GUID *ActionID,
163 WINTRUST_DATA* ActionData )
165 FIXME("%p %s %p\n", hwnd, debugstr_guid(ActionID), ActionData);
166 return S_OK;
169 /***********************************************************************
170 * WTHelperGetProvSignerFromChain (WINTRUST.@)
172 CRYPT_PROVIDER_SGNR * WINAPI WTHelperGetProvSignerFromChain(
173 CRYPT_PROVIDER_DATA *pProvData, DWORD idxSigner, BOOL fCounterSigner,
174 DWORD idxCounterSigner)
176 FIXME("%p %ld %d %ld\n", pProvData, idxSigner, fCounterSigner,
177 idxCounterSigner);
178 return NULL;
181 /***********************************************************************
182 * WTHelperProvDataFromStateData (WINTRUST.@)
184 CRYPT_PROVIDER_DATA * WINAPI WTHelperProvDataFromStateData(HANDLE hStateData)
186 FIXME("%p\n", hStateData);
187 return NULL;
190 /***********************************************************************
191 * WintrustLoadFunctionPointers (WINTRUST.@)
193 BOOL WINAPI WintrustLoadFunctionPointers( GUID* pgActionID,
194 CRYPT_PROVIDER_FUNCTIONS* pPfns )
196 FIXME("%s %p\n", debugstr_guid(pgActionID), pPfns);
197 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
198 return FALSE;
201 /***********************************************************************
202 * WintrustGetRegPolicyFlags (WINTRUST.@)
204 void WINAPI WintrustGetRegPolicyFlags( DWORD* pdwPolicyFlags )
206 FIXME("%p\n", pdwPolicyFlags);
207 *pdwPolicyFlags = 0;
210 /***********************************************************************
211 * WintrustSetRegPolicyFlags (WINTRUST.@)
213 BOOL WINAPI WintrustSetRegPolicyFlags( DWORD dwPolicyFlags)
215 FIXME("stub: %lx\n", dwPolicyFlags);
216 return TRUE;