mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[ADVAPI32] wine/crypt.*: Misc fixes
Import62df03af96
8b9e3dae4f
2df16753f0
And use explicit '#ifndef __REACTOS__'.
This commit is contained in:
parent
8ae8083378
commit
5542dd50d6
2 changed files with 13 additions and 12 deletions
|
@ -604,7 +604,7 @@ BOOL WINAPI CryptAcquireContextA (HCRYPTPROV *phProv, LPCSTR pszContainer,
|
||||||
* PARAMS
|
* PARAMS
|
||||||
* hProv [I] Handle to the CSP whose reference is being incremented.
|
* hProv [I] Handle to the CSP whose reference is being incremented.
|
||||||
* pdwReserved [IN] Reserved for future use and must be NULL.
|
* pdwReserved [IN] Reserved for future use and must be NULL.
|
||||||
* dwFlags [I] Reserved for future use and must be NULL.
|
* dwFlags [I] Reserved for future use and must be 0.
|
||||||
*
|
*
|
||||||
* RETURNS
|
* RETURNS
|
||||||
* Success: TRUE
|
* Success: TRUE
|
||||||
|
@ -628,7 +628,7 @@ BOOL WINAPI CryptContextAddRef (HCRYPTPROV hProv, DWORD *pdwReserved, DWORD dwFl
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
pProv->refcount++;
|
InterlockedIncrement(&pProv->refcount);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -654,7 +654,7 @@ BOOL WINAPI CryptReleaseContext (HCRYPTPROV hProv, DWORD dwFlags)
|
||||||
|
|
||||||
if (!pProv)
|
if (!pProv)
|
||||||
{
|
{
|
||||||
SetLastError(NTE_BAD_UID);
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -664,8 +664,7 @@ BOOL WINAPI CryptReleaseContext (HCRYPTPROV hProv, DWORD dwFlags)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
pProv->refcount--;
|
if (InterlockedDecrement(&pProv->refcount) == 0)
|
||||||
if (pProv->refcount <= 0)
|
|
||||||
{
|
{
|
||||||
ret = pProv->pFuncs->pCPReleaseContext(pProv->hPrivate, dwFlags);
|
ret = pProv->pFuncs->pCPReleaseContext(pProv->hPrivate, dwFlags);
|
||||||
pProv->dwMagic = 0;
|
pProv->dwMagic = 0;
|
||||||
|
@ -728,7 +727,7 @@ BOOL WINAPI CryptGenRandom (HCRYPTPROV hProv, DWORD dwLen, BYTE *pbBuffer)
|
||||||
* hProv [I] Handle of a CSP.
|
* hProv [I] Handle of a CSP.
|
||||||
* Algid [I] Identifies the hash algorithm to use.
|
* Algid [I] Identifies the hash algorithm to use.
|
||||||
* hKey [I] Key for the hash (if required).
|
* hKey [I] Key for the hash (if required).
|
||||||
* dwFlags [I] Reserved for future use and must be NULL.
|
* dwFlags [I] Reserved for future use and must be 0.
|
||||||
* phHash [O] Address of the future handle to the new hash object.
|
* phHash [O] Address of the future handle to the new hash object.
|
||||||
*
|
*
|
||||||
* RETURNS
|
* RETURNS
|
||||||
|
@ -963,7 +962,7 @@ BOOL WINAPI CryptDestroyKey (HCRYPTKEY hKey)
|
||||||
*
|
*
|
||||||
* PARAMS
|
* PARAMS
|
||||||
* hHash [I] Handle to the hash to be copied.
|
* hHash [I] Handle to the hash to be copied.
|
||||||
* pdwReserved [I] Reserved for future use and must be zero.
|
* pdwReserved [I] Reserved for future use and must be NULL.
|
||||||
* dwFlags [I] Reserved for future use and must be zero.
|
* dwFlags [I] Reserved for future use and must be zero.
|
||||||
* phHash [O] Address of the handle to receive the copy.
|
* phHash [O] Address of the handle to receive the copy.
|
||||||
*
|
*
|
||||||
|
|
|
@ -21,11 +21,13 @@
|
||||||
#ifndef __WINE_CRYPT_H
|
#ifndef __WINE_CRYPT_H
|
||||||
#define __WINE_CRYPT_H
|
#define __WINE_CRYPT_H
|
||||||
|
|
||||||
//#include <stdarg.h>
|
#ifndef __REACTOS__
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
//#include "windef.h"
|
#include "windef.h"
|
||||||
//#include "winbase.h"
|
#include "winbase.h"
|
||||||
//#include "wincrypt.h"
|
#include "wincrypt.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct tagPROVFUNCS
|
typedef struct tagPROVFUNCS
|
||||||
{
|
{
|
||||||
|
@ -63,7 +65,7 @@ typedef struct tagPROVFUNCS
|
||||||
typedef struct tagCRYPTPROV
|
typedef struct tagCRYPTPROV
|
||||||
{
|
{
|
||||||
DWORD dwMagic;
|
DWORD dwMagic;
|
||||||
UINT refcount;
|
LONG refcount;
|
||||||
HMODULE hModule;
|
HMODULE hModule;
|
||||||
PPROVFUNCS pFuncs;
|
PPROVFUNCS pFuncs;
|
||||||
HCRYPTPROV hPrivate; /*CSP's handle - Should not be given to application under any circumstances!*/
|
HCRYPTPROV hPrivate; /*CSP's handle - Should not be given to application under any circumstances!*/
|
||||||
|
|
Loading…
Reference in a new issue