Documentation ordinal fixes.
[wine/multimedia.git] / dlls / advapi32 / crypt.c
blob5b99481fd0956df994b8992f474ed49474932dfc
1 /*
2 * dlls/advapi32/crypt.c
3 */
4 #include <time.h>
5 #include <stdlib.h>
7 #include "windef.h"
8 #include "winerror.h"
9 #include "wincrypt.h"
10 #include "debugtools.h"
12 DEFAULT_DEBUG_CHANNEL(advapi);
14 /******************************************************************************
15 * CryptAcquireContextA (ADVAPI32.@)
16 * Acquire a crypto provider context handle.
18 * PARAMS
19 * phProv: Pointer to HCRYPTPROV for the output.
20 * pszContainer: FIXME (unknown)
21 * pszProvider: FIXME (unknown)
22 * dwProvType: Crypto provider type to get a handle.
23 * dwFlags: flags for the operation
25 * RETURNS TRUE on success, FALSE on failure.
28 BOOL WINAPI
29 CryptAcquireContextA( HCRYPTPROV *phProv, LPCSTR pszContainer,
30 LPCSTR pszProvider, DWORD dwProvType, DWORD dwFlags)
32 FIXME("(%p, %s, %s, %ld, %08lx): stub!\n", phProv, pszContainer,
33 pszProvider, dwProvType, dwFlags);
34 return FALSE;
37 /******************************************************************************
38 * CryptSetKeyParam (ADVAPI32.@)
40 BOOL WINAPI
41 CryptSetKeyParam( HCRYPTKEY hKey, DWORD dwParam, BYTE *pbData, DWORD dwFlags)
43 FIXME("(%lx, %lx, %p, %lx): stub!\n", hKey, dwParam, pbData, dwFlags);
44 return FALSE;
48 /******************************************************************************
49 * CryptGenRandom (ADVAPI32.@)
51 BOOL WINAPI
52 CryptGenRandom (HCRYPTPROV hProv, DWORD dwLen, BYTE *pbBuffer)
54 DWORD i;
56 FIXME("(0x%lx, %ld, %p): stub!\n", hProv, dwLen, pbBuffer);
58 FIXME: Currently this function is just a stub, it is missing functionality in
59 the following (major) ways:
60 (1) It makes no use of the passed in HCRYPTPROV handle. (ie. it doesn't
61 use a cryptographic service provider (CSP)
62 (2) It doesn't use the values in the passed in pbBuffer to further randomize
63 its internal seed.
64 (3) MSDN mentions that this function produces "cryptographically random"
65 data, which is "... far more random than the data generated by the typical
66 random number generator such as the one shipped with your C compiler".
67 We are currently using the C runtime rand() function. ^_^
69 See MSDN documentation for CryptGenRandom for more information.
72 if (dwLen <= 0)
73 return FALSE;
75 srand(time(NULL));
76 for (i=0; i<dwLen; i++)
78 *pbBuffer = (BYTE)(rand() % 256);
79 pbBuffer++;
82 return TRUE;
86 /******************************************************************************
87 * CryptReleaseContext (ADVAPI32.@)
89 BOOL WINAPI
90 CryptReleaseContext (HCRYPTPROV hProv, DWORD dwFlags)
92 FIXME("(0x%lx, 0x%lx): stub!\n", hProv, dwFlags);
93 return FALSE;