Prevent use of MAKEPOINTS in Wine code.
[wine/multimedia.git] / dlls / crypt32 / cert.c
blob26d0841408e6493ee21ea6d25501de8cc800437d
1 /*
2 * Copyright 2002 Mike McCormack for CodeWeavers
3 * Copyright (C) 2004 Juan Lang
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #include <stdarg.h>
20 #include "windef.h"
21 #include "winbase.h"
22 #include "winreg.h"
23 #include "wincrypt.h"
24 #include "wine/debug.h"
26 WINE_DEFAULT_DEBUG_CHANNEL(crypt);
28 #define WINE_CRYPTCERTSTORE_MAGIC 0x74726563
30 typedef struct WINE_CRYPTCERTSTORE
32 DWORD dwMagic;
33 } WINECRYPT_CERTSTORE;
37 * CertOpenStore
39 * System Store CA is
40 * HKLM\\Software\\Microsoft\\SystemCertificates\\CA\\
41 * Certificates\\<compressed guid>
42 * "Blob" = REG_BINARY
43 * CRLs\\<compressed guid>
44 * "Blob" = REG_BINARY
45 * CTLs\\<compressed guid>
46 * "Blob" = REG_BINARY
48 HCERTSTORE WINAPI CertOpenStore( LPCSTR lpszStoreProvider,
49 DWORD dwMsgAndCertEncodingType, HCRYPTPROV hCryptProv,
50 DWORD dwFlags, const void* pvPara )
52 WINECRYPT_CERTSTORE *hcs;
54 FIXME("%s %08lx %08lx %08lx %p stub\n", debugstr_a(lpszStoreProvider),
55 dwMsgAndCertEncodingType, hCryptProv, dwFlags, pvPara);
57 if( lpszStoreProvider == (LPCSTR) 0x0009 )
59 FIXME("pvPara = %s\n", debugstr_a( (LPCSTR) pvPara ) );
62 hcs = HeapAlloc( GetProcessHeap(), 0, sizeof (WINECRYPT_CERTSTORE) );
63 if( !hcs )
64 return NULL;
66 hcs->dwMagic = WINE_CRYPTCERTSTORE_MAGIC;
68 return (HCERTSTORE) hcs;
71 HCERTSTORE WINAPI CertOpenSystemStoreA(HCRYPTPROV hProv,
72 LPCSTR szSubSystemProtocol)
74 FIXME("(%ld, %s), stub\n", hProv, debugstr_a(szSubSystemProtocol));
75 return (HCERTSTORE)1;
78 HCERTSTORE WINAPI CertOpenSystemStoreW(HCRYPTPROV hProv,
79 LPCWSTR szSubSystemProtocol)
81 FIXME("(%ld, %s), stub\n", hProv, debugstr_w(szSubSystemProtocol));
82 return (HCERTSTORE)1;
85 PCCERT_CONTEXT WINAPI CertEnumCertificatesInStore(HCERTSTORE hCertStore, PCCERT_CONTEXT pPrev)
87 FIXME("(%p,%p)\n", hCertStore, pPrev);
88 return NULL;
91 BOOL WINAPI CertSaveStore(HCERTSTORE hCertStore, DWORD dwMsgAndCertEncodingType,
92 DWORD dwSaveAs, DWORD dwSaveTo, void* pvSaveToPara, DWORD dwFlags)
94 FIXME("(%p,%ld,%ld,%ld,%p,%08lx) stub!\n", hCertStore,
95 dwMsgAndCertEncodingType, dwSaveAs, dwSaveTo, pvSaveToPara, dwFlags);
96 return TRUE;
99 PCCRL_CONTEXT WINAPI CertCreateCRLContext( DWORD dwCertEncodingType,
100 const BYTE* pbCrlEncoded, DWORD cbCrlEncoded)
102 PCRL_CONTEXT pcrl;
103 BYTE* data;
105 TRACE("%08lx %p %08lx\n", dwCertEncodingType, pbCrlEncoded, cbCrlEncoded);
107 pcrl = HeapAlloc( GetProcessHeap(), 0, sizeof (CRL_CONTEXT) );
108 if( !pcrl )
109 return NULL;
111 data = HeapAlloc( GetProcessHeap(), 0, cbCrlEncoded );
112 if( !data )
114 HeapFree( GetProcessHeap(), 0, pcrl );
115 return NULL;
118 pcrl->dwCertEncodingType = dwCertEncodingType;
119 pcrl->pbCrlEncoded = data;
120 pcrl->cbCrlEncoded = cbCrlEncoded;
121 pcrl->pCrlInfo = NULL;
122 pcrl->hCertStore = 0;
124 return pcrl;
127 BOOL WINAPI CertAddCRLContextToStore( HCERTSTORE hCertStore,
128 PCCRL_CONTEXT pCrlContext, DWORD dwAddDisposition,
129 PCCRL_CONTEXT* ppStoreContext )
131 FIXME("%p %p %08lx %p\n", hCertStore, pCrlContext,
132 dwAddDisposition, ppStoreContext);
133 return TRUE;
136 BOOL WINAPI CertFreeCRLContext( PCCRL_CONTEXT pCrlContext)
138 FIXME("%p\n", pCrlContext );
140 return TRUE;
143 BOOL WINAPI CertCloseStore( HCERTSTORE hCertStore, DWORD dwFlags )
145 FIXME("%p %08lx\n", hCertStore, dwFlags );
146 if( ! hCertStore )
147 return FALSE;
149 HeapFree( GetProcessHeap(), 0, hCertStore );
151 return TRUE;
154 BOOL WINAPI CertFreeCertificateContext( PCCERT_CONTEXT pCertContext )
156 FIXME("%p stub\n", pCertContext);
157 return TRUE;
160 PCCERT_CONTEXT WINAPI CertFindCertificateInStore(HCERTSTORE hCertStore,
161 DWORD dwCertEncodingType, DWORD dwFlags, DWORD dwType,
162 const void *pvPara, PCCERT_CONTEXT pPrevCertContext)
164 FIXME("stub: %p %ld %ld %ld %p %p\n", hCertStore, dwCertEncodingType,
165 dwFlags, dwType, pvPara, pPrevCertContext);
166 SetLastError(CRYPT_E_NOT_FOUND);
167 return NULL;