RtlStringxxx functions

Hello!
I am trying to use RtlStringCbxxx functions in my minifilter. The online doc (such as http://msdn.microsoft.com/en-us/library/windows/hardware/ff562820(v=vs.85).aspx) mentions I have to include Ntstrsafe.h. My problem is that this include causes several warnings:
1>c:\winddk\7600.16385.1\inc\crt\stdio.h(268) : warning C4995: ‘scanf’: name was marked as #pragma deprecated
1>c:\winddk\7600.16385.1\inc\crt\stdio.h(284) : warning C4995: ‘sscanf’: name was marked as #pragma deprecated

And this warnings turn into errors when I compile the release version.

I have seen Ntstrsafe.h includes stdio.h which causes all these warnings. Is that normal? Where I am wrong?

Thank you very much!

Do you include dontuse.h in your code as well? If so, try including
ntstrsafe.h before dontuse.h (or remove including dontuse.h). Seems to me
like these are incompatible with each other if ntstrsafe is included after
dontuse.

-scott


Scott Noone
Consulting Associate and Chief System Problem Analyst
OSR Open Systems Resources, Inc.
http://www.osronline.com

wrote in message news:xxxxx@ntfsd…

Hello!
I am trying to use RtlStringCbxxx functions in my minifilter. The online doc
(such as
http://msdn.microsoft.com/en-us/library/windows/hardware/ff562820(v=vs.85).aspx)
mentions I have to include Ntstrsafe.h. My problem is that this include
causes several warnings:
1>c:\winddk\7600.16385.1\inc\crt\stdio.h(268) : warning C4995: ‘scanf’: name
was marked as #pragma deprecated
1>c:\winddk\7600.16385.1\inc\crt\stdio.h(284) : warning C4995: ‘sscanf’:
name was marked as #pragma deprecated

And this warnings turn into errors when I compile the release version.

I have seen Ntstrsafe.h includes stdio.h which causes all these warnings. Is
that normal? Where I am wrong?

Thank you very much!

Hi Igor,

Not sure what the problem is. I use these functions occasionally and I don’t see this issue. I don’t remember doing anything special to include the file. I’ve looked to see whether I have any #pragma warning(disable:4995) anywhere but I don’t.

In fact I took one of the minifilter samples, set an #include <ntifs.h> as the first line (only ntstatus.h seems to be necessary) and then the #include <ntstrsafe.h> and it all compiled just fine. I’m using the same WDK version (7600.16385.1) and i’m doing this in a build environment launched from the start menu.

Can you do this in your environment ?

Thanks,
Alex.</ntstrsafe.h></ntifs.h>

Hello Scott and Alex, and thank you very much for your responses!!
Scott is right, I have commented out the include <dontuse.h> and it compiles just fine (looking that file I can see why). And as he says, if include <ntstrsafe.h> is before include <dontuse.h> it also compiles fine.

Thank you very much!!</dontuse.h></ntstrsafe.h></dontuse.h>