WinInclude.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /**@file
  2. Public include file for the WinNt Library
  3. Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef __WIN_NT_INCLUDE_H__
  7. #define __WIN_NT_INCLUDE_H__
  8. //
  9. // Win32 include files do not compile clean with /W4, so we use the warning
  10. // pragma to suppress the warnings for Win32 only. This way our code can stil
  11. // compile at /W4 (highest warning level) with /WX (warnings cause build
  12. // errors).
  13. //
  14. #pragma warning(disable : 4115)
  15. #pragma warning(disable : 4201)
  16. #pragma warning(disable : 4028)
  17. #pragma warning(disable : 4133)
  18. #define GUID _WINNT_DUP_GUID_____
  19. #define _LIST_ENTRY _WINNT_DUP_LIST_ENTRY_FORWARD
  20. #define LIST_ENTRY _WINNT_DUP_LIST_ENTRY
  21. #if defined (MDE_CPU_IA32) && (_MSC_VER < 1800)
  22. #define InterlockedIncrement _WINNT_DUP_InterlockedIncrement
  23. #define InterlockedDecrement _WINNT_DUP_InterlockedDecrement
  24. #define InterlockedCompareExchange64 _WINNT_DUP_InterlockedCompareExchange64
  25. #endif
  26. #undef UNALIGNED
  27. #undef CONST
  28. #undef VOID
  29. #undef DEBUG_EVENT
  30. // WQBugBug: This typedef is to make "windows.h" buildable.
  31. // It should be removed after the root cause why
  32. // size_t is undefined when go into the line below is found.
  33. #if defined (MDE_CPU_IA32)
  34. typedef UINT32 size_t;
  35. #endif
  36. #include "windows.h"
  37. #include "windowsx.h"
  38. #undef GUID
  39. #undef _LIST_ENTRY
  40. #undef LIST_ENTRY
  41. #undef InterlockedIncrement
  42. #undef InterlockedDecrement
  43. #undef InterlockedCompareExchange64
  44. #undef InterlockedCompareExchangePointer
  45. #undef CreateEventEx
  46. #define VOID void
  47. //
  48. // Prevent collisions with Windows API name macros that deal with Unicode/Not issues
  49. //
  50. #undef LoadImage
  51. #undef CreateEvent
  52. #undef FAR
  53. //
  54. // Set the warnings back on as the EFI code must be /W4.
  55. //
  56. #pragma warning(default : 4115)
  57. #pragma warning(default : 4201)
  58. #endif