0

Microsoft's STL in his lecture briefly hinted that STL has problems interacting in the kernel mode. Can somebody please explain what he meant by that?

unj2
  • 52,135
  • 87
  • 247
  • 375
  • 2
    He meant that he's a library developer, and as such he does really have problem interacting in the kernel mode. But he's a nice guy otherwise. – Kerrek SB Nov 24 '12 at 01:38
  • (... why by the way responds very happily to comments on the video page! Just ask *him* what he meant.) – Kerrek SB Nov 24 '12 at 01:43
  • 2
    I think he's talking about the general problems you have with C++ in (Windows) kernel mode, explained e.g. [here](http://msdn.microsoft.com/en-us/library/windows/hardware/gg487420.aspx). – Matteo Italia Nov 24 '12 at 01:43
  • It means you can run into problems with exception handling (e.g. out of memory.) To make things even clearer, the windows 8 wdk has completely dropped STL. – vladr Nov 24 '12 at 01:43
  • @kunj2aan - The Windows kernel is written by hardcore C guys. They just don't care if C++ works in kernel code. – Bo Persson Nov 24 '12 at 07:44

1 Answers1

0

Kernel mode code relies on a few proprietary Microsoft extensions to C++, in particular to determine at which IRQ level the code can run. If you get this wrong, Windows can blue-screen with a "Driver IRQL Not Less or Equal" fault.

These extensions are unfortunately not compatible with C++ templates, or virtual functions for that matter. The reason is that the C++ compiler implicitly instantiates templates and vtables, but fails to apply the right IRQL setting because there's no explicit point of instantiation from which the right level can be taken.

MSalters
  • 173,980
  • 10
  • 155
  • 350