<ntstrsafe.h> undeclared identifier STATUS_BUFFER_OVERFLOW RRS feed

  • Question

  • I am working on updating some legacy code to replace unsafe string functions. Following the recommendations for Windows driver development, I am using functions defined in <ntstrsafe.h>. When I try to compile, I get undeclared identifier errors for return values that are defined in <ntstatus.h>

    The file, "ntstrsafe.h" doesn't include "ntstatus.h".  If I manually add it to the file, of course the project compiles, but obviously this isn't the way to handle this.  I check the other inludes in <ntstrsafe.h> and don't see any other place that would pull the missing definitions in.  I searched MSDN and then general google on to find anything like this and found 0 references.

    I am using the WDK and a checked build window to compile code that I compile all the time with no issues.

    So what am I missing here?  How do I correctly deal with the undefined status so I can compile?

    Saturday, January 23, 2016 9:38 PM

All replies

  • Mysteriously, I tried building again today and all is well so this will remain a dark mystery.
    Saturday, January 23, 2016 9:54 PM
  • Facing with same issue, any clue or workaround except adding #include <ntstatus.h>. 
    Wednesday, August 9, 2017 12:22 PM