How do I deal with both winnt.h and ntstatus.h both in the WDK?

Viewed 1029

I am compiling a program that gets an error because both winnt.h and ntstatus.h are included in the WDK. I compiled with preprocess to a file and found this:

#line 1 "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.18362.0\\um\\winnt.h"

and this:

#line 1 "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.18362.0\\shared\\ntstatus.h"

Here are my includes:

#include <windows.h>
#include <winbase.h> 
#include <winnt.h>

Here is the error I get:

1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\ntstatus.h(66,14): warning C4005: 'STATUS_WAIT_0': macro redefinition
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winnt.h(2496): message : see previous definition of 'STATUS_WAIT_0'

Is there a define I need to use to tell VS not to open both?

2 Answers

I was using the dokan library. I found that dokan.h includes ntstatus.h and there is a define called WIN32_NO_STATUS to take care of that.

Related