• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Windows/NtCheck.h
2 
3 #ifndef __WINDOWS_NT_CHECK_H
4 #define __WINDOWS_NT_CHECK_H
5 
6 #ifdef _WIN32
7 
8 #include "../Common/MyWindows.h"
9 
10 #if !defined(_WIN64) && !defined(UNDER_CE)
IsItWindowsNT()11 static inline bool IsItWindowsNT()
12 {
13   OSVERSIONINFO vi;
14   vi.dwOSVersionInfoSize = sizeof(vi);
15   return (::GetVersionEx(&vi) && vi.dwPlatformId == VER_PLATFORM_WIN32_NT);
16 }
17 #endif
18 
19 #ifndef _UNICODE
20   #if defined(_WIN64) || defined(UNDER_CE)
21     bool g_IsNT = true;
22     #define SET_IS_NT
23   #else
24     bool g_IsNT = false;
25     #define SET_IS_NT g_IsNT = IsItWindowsNT();
26   #endif
27   #define NT_CHECK_ACTION
28   // #define NT_CHECK_ACTION { NT_CHECK_FAIL_ACTION }
29 #else
30   #if !defined(_WIN64) && !defined(UNDER_CE)
31     #define NT_CHECK_ACTION if (!IsItWindowsNT()) { NT_CHECK_FAIL_ACTION }
32   #else
33     #define NT_CHECK_ACTION
34   #endif
35   #define SET_IS_NT
36 #endif
37 
38 #define NT_CHECK  NT_CHECK_ACTION SET_IS_NT
39 
40 #else
41 
42 #define NT_CHECK
43 
44 #endif
45 
46 #endif
47