diff --git a/api/adapter.c b/api/adapter.c index 3c65bb2..348441a 100644 --- a/api/adapter.c +++ b/api/adapter.c @@ -6,18 +6,19 @@ #include #include #include -#define _NTDEF_ /* TODO: figure out how to include ntsecapi and winternal together without requiring this */ +#include #include #include #include #include #include -#include #include #include +#include #include #include /* Keep these two at bottom in this order, so that we only generate extra GUIDs for devpkey. The other keys we'll get from uuid.lib like usual. */ #include +#include #include "adapter.h" #include "entry.h" diff --git a/api/api.vcxproj b/api/api.vcxproj index 79a9932..5aeedc1 100644 --- a/api/api.vcxproj +++ b/api/api.vcxproj @@ -39,15 +39,16 @@ {897F02E3-3EAA-40AF-A6DC-17EB2376EDAF} Win32Proj api - 10.0 + $(LatestTargetPlatformVersion) api DynamicLibrary Unicode - v142 + WindowsApplicationForDrivers10.0 false + false true @@ -55,6 +56,18 @@ true + + Windows7 + + + Windows8 + + + Windows7 + + + Windows10 + diff --git a/api/entry.c b/api/entry.c index 7402f5c..c74cffe 100644 --- a/api/entry.c +++ b/api/entry.c @@ -17,6 +17,8 @@ #include #pragma warning(pop) #include +#include +#include HINSTANCE ResourceModule; HANDLE ModuleHeap; diff --git a/api/logger.c b/api/logger.c index 8afcd3f..253d525 100644 --- a/api/logger.c +++ b/api/logger.c @@ -8,6 +8,7 @@ #include #include #include +#include static BOOL CALLBACK NopLogger(_In_ WINTUN_LOGGER_LEVEL Level, _In_z_ const WCHAR *LogLine) diff --git a/api/namespace.c b/api/namespace.c index 735e585..aa8ffb4 100644 --- a/api/namespace.c +++ b/api/namespace.c @@ -10,7 +10,9 @@ #include #include #include +#include #include +#include static HANDLE PrivateNamespace = NULL; static HANDLE BoundaryDescriptor = NULL; diff --git a/api/ntdll.h b/api/ntdll.h index 93b32a6..825119b 100644 --- a/api/ntdll.h +++ b/api/ntdll.h @@ -61,3 +61,9 @@ NtQueryKey( _Out_bytecap_post_bytecount_(Length, *ResultLength) PVOID KeyInformation, _In_ ULONG Length, _Out_ PULONG ResultLength); + +/* This is documented in NTSecAPI.h, which we can't include, due to header conflicts. It actually lives in advapi32.dll. */ +#define RtlGenRandom SystemFunction036 +BOOLEAN +NTAPI +RtlGenRandom(_Out_writes_bytes_all_(RandomBufferLength) PVOID RandomBuffer, _In_ ULONG RandomBufferLength); \ No newline at end of file diff --git a/api/registry.c b/api/registry.c index 7cb7cf2..bf012e2 100644 --- a/api/registry.c +++ b/api/registry.c @@ -8,6 +8,7 @@ #include "registry.h" #include #include +#include #include static _Return_type_success_(return != NULL) HKEY diff --git a/api/rundll32.c b/api/rundll32.c index ca77b7f..80ada15 100644 --- a/api/rundll32.c +++ b/api/rundll32.c @@ -4,6 +4,7 @@ */ #include "entry.h" +#include #if ACCEPT_WOW64 == 1 diff --git a/api/session.c b/api/session.c index 7c408d5..41c623f 100644 --- a/api/session.c +++ b/api/session.c @@ -8,6 +8,8 @@ #include "logger.h" #include "wintun.h" #include +#include +#include #pragma warning(disable : 4200) /* nonstandard: zero-sized array in struct/union */