Define RtlGenRandom correctly in ntsecapi.h wrapper

Include ntsecapi.h where required and just redefine RtlGenRandom
correctly in the ntsecapi.h wrapper.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2016-12-14 14:14:28 +01:00
parent 74f7872f89
commit 86fc4bf065
5 changed files with 29 additions and 6 deletions

View File

@ -7,6 +7,7 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
#include "winsup.h"
#include <ntsecapi.h>
#include <unistd.h>
#include <sys/param.h>
#include "cygerrno.h"

View File

@ -21,6 +21,7 @@
#undef u_long
#define u_long __ms_u_long
#endif
#include <ntsecapi.h>
#include <ws2tcpip.h>
#include <mswsock.h>
#include <iphlpapi.h>

View File

@ -8,6 +8,7 @@ details. */
#include "winsup.h"
#include "miscfuncs.h"
#include <ntsecapi.h>
#include <sys/uio.h>
#include <assert.h>
#include <alloca.h>

View File

@ -1608,10 +1608,4 @@ extern "C"
}
}
/* There's a bug in ntsecapi.h (Mingw as well as MSFT). SystemFunction036
is, in fact, a WINAPI function, but it's not defined as such. Therefore
we have to do it correctly here. *Strictly*, this is not ntdll... */
#define RtlGenRandom SystemFunction036
extern "C" BOOLEAN WINAPI RtlGenRandom (PVOID, ULONG);
#endif

26
winsup/cygwin/ntsecapi.h Normal file
View File

@ -0,0 +1,26 @@
#ifndef _CYGWIN_NTSECAPI_H
#define _CYGWIN_NTSECAPI_H
/* There's a bug in ntsecapi.h (Mingw as well as MSFT). SystemFunction036
is, in fact, a WINAPI function, but it's not defined as such. Therefore
we have to do it correctly here in the ntsecapi.h wrapper. */
#define SystemFunction036 __nonexistant_SystemFunction036__
#include_next <ntsecapi.h>
#undef SystemFunction036
#define RtlGenRandom SystemFunction036
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
BOOLEAN WINAPI RtlGenRandom (PVOID, ULONG);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _CYGWIN_NTSECAPI_H */