mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
4696f4a40b
Like every other toolchain I've tried, my Coverity scanning build has its share of random objections to parts of my Windows API type- checking system. I do wonder if that bright idea was worth the hassle - but it would probably cost all the annoyance all over again to back out now...
35 lines
752 B
C
35 lines
752 B
C
/*
|
|
* wincapi.c: implementation of wincapi.h.
|
|
*/
|
|
|
|
#include "putty.h"
|
|
|
|
#if !defined NO_SECURITY
|
|
|
|
#define WINCAPI_GLOBAL
|
|
#include "wincapi.h"
|
|
|
|
int got_crypt(void)
|
|
{
|
|
static int attempted = FALSE;
|
|
static int successful;
|
|
static HMODULE crypt;
|
|
|
|
if (!attempted) {
|
|
attempted = TRUE;
|
|
crypt = load_system32_dll("crypt32.dll");
|
|
successful = crypt &&
|
|
#ifdef COVERITY
|
|
/* The build toolchain I use with Coverity doesn't know
|
|
* about this function, so can't type-check it */
|
|
GET_WINDOWS_FUNCTION_NO_TYPECHECK(crypt, CryptProtectMemory)
|
|
#else
|
|
GET_WINDOWS_FUNCTION(crypt, CryptProtectMemory)
|
|
#endif
|
|
;
|
|
}
|
|
return successful;
|
|
}
|
|
|
|
#endif /* !defined NO_SECURITY */
|