From 67a2b6ffcb4bffe3855d628cda205616d05eaaa1 Mon Sep 17 00:00:00 2001 From: "Derek J. Ravenson" Date: Thu, 23 Apr 2020 17:20:33 +0100 Subject: [PATCH] Fix compiler errors when winternl.h is included before krabs.hpp. (#127) * Fix warnings/errors when winternl.h is included before krabs.hpp. * Declare NtSetSystemInformation() even when winternl.h is included. * Increment sub-minor version number in .nuspec files. Co-authored-by: dravenson --- O365.Security.Native.ETW.Debug.nuspec | 2 +- O365.Security.Native.ETW.nuspec | 2 +- krabs/krabs/perfinfo_groupmask.hpp | 9 +++++++-- krabsetw.nuspec | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/O365.Security.Native.ETW.Debug.nuspec b/O365.Security.Native.ETW.Debug.nuspec index 85bfe45..34c590e 100644 --- a/O365.Security.Native.ETW.Debug.nuspec +++ b/O365.Security.Native.ETW.Debug.nuspec @@ -2,7 +2,7 @@ Microsoft.O365.Security.Native.ETW.Debug - 4.1.8 + 4.1.9 Microsoft.O365.Security.Native.ETW Debug - managed wrappers for krabsetw Microsoft Microsoft diff --git a/O365.Security.Native.ETW.nuspec b/O365.Security.Native.ETW.nuspec index 2347a01..474d78c 100644 --- a/O365.Security.Native.ETW.nuspec +++ b/O365.Security.Native.ETW.nuspec @@ -2,7 +2,7 @@ Microsoft.O365.Security.Native.ETW - 4.1.8 + 4.1.9 Microsoft.O365.Security.Native.ETW - managed wrappers for krabsetw Microsoft Microsoft diff --git a/krabs/krabs/perfinfo_groupmask.hpp b/krabs/krabs/perfinfo_groupmask.hpp index 9d322d4..8d36894 100644 --- a/krabs/krabs/perfinfo_groupmask.hpp +++ b/krabs/krabs/perfinfo_groupmask.hpp @@ -184,8 +184,9 @@ typedef struct _EVENT_TRACE_GROUPMASK_INFORMATION { PERFINFO_GROUPMASK EventTraceGroupMasks; } EVENT_TRACE_GROUPMASK_INFORMATION, * PEVENT_TRACE_GROUPMASK_INFORMATION; +#ifndef _WINTERNL_ + typedef enum _SYSTEM_INFORMATION_CLASS { - SystemPerformanceTraceInformation = 0x1f } SYSTEM_INFORMATION_CLASS; typedef LONG NTSTATUS; @@ -197,8 +198,12 @@ extern "C" NTSTATUS NTAPI NtQuerySystemInformation( _Out_opt_ PULONG ReturnLength ); +#endif // _WINTERNL_ + extern "C" NTSTATUS NTAPI NtSetSystemInformation( _In_ SYSTEM_INFORMATION_CLASS SystemInformationClass, _In_reads_bytes_opt_(SystemInformationLength) PVOID SystemInformation, _In_ ULONG SystemInformationLength -); \ No newline at end of file +); + +constexpr auto SystemPerformanceTraceInformation{ static_cast(0x1f) }; diff --git a/krabsetw.nuspec b/krabsetw.nuspec index 6bd0d01..039ee21 100644 --- a/krabsetw.nuspec +++ b/krabsetw.nuspec @@ -2,7 +2,7 @@ Microsoft.O365.Security.Krabsetw - 4.1.8 + 4.1.9 Krabs ETW Wrappers Microsoft Microsoft