Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The Windows kernel only supports part of the standard C runtime. In particular, high-level functionality &mdash; like file streams, console I/O, and networking &mdash; is not supported. Instead, you need to use native kernel APIs for similar functionality.</p> <p>The reason that stdio.h is included with the WDK is because some parts of the C runtime are provided for your convenience. For example, you can use <code>memcmp</code> (although the native <code>RtlCompareMemory</code> is preferred). Microsoft has not picked through the CRT headers to #ifdef out the bits and pieces that are not available in kernel mode. Once you develop some experience writing kernel drivers, you'll get the hang of what's possible in the kernel, and what probably won't work.</p> <p>To address your high-level question: you're probably looking for some debug/logging mechanism. You really have two options:</p> <ol> <li><code>DbgPrintEx</code> is the easiest to use. It's basically a drop-in for printf (although you need to be careful about certain types of string inserts when running >=DISPATCH_LEVEL). Output goes to the debugger, or, if you like, to <a href="http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx" rel="noreferrer">DbgView</a>.</li> <li><a href="http://msdn.microsoft.com/en-us/library/ff556201%28VS.85%29.aspx" rel="noreferrer">WPP</a> is the industrial-strength option. The initial learning curve is pretty steep (although there are samples in the WDK). However, it is very flexible (e.g., you can create your own shrieks, like <code>Print("My IP address is: %!IPV4!", ip);</code>), and it is very fast (Microsoft ships WPP tracing in the non-debug builds of most Windows components).</li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload