1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 09:58:01 +00:00
putty-source/windows/wincapi.c
Simon Tatham a6f1709c2f Adopt C99 <stdbool.h>'s true/false.
This commit includes <stdbool.h> from defs.h and deletes my
traditional definitions of TRUE and FALSE, but other than that, it's a
100% mechanical search-and-replace transforming all uses of TRUE and
FALSE into the C99-standardised lowercase spellings.

No actual types are changed in this commit; that will come next. This
is just getting the noise out of the way, so that subsequent commits
can have a higher proportion of signal.
2018-11-03 13:45:00 +00:00

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 */