24 ms·
I was at microsoft from 2008-2011 and definitely saw some C++ in the kernel, even one driver using operator new for its allocations which I thought was a little
by asveikau 12y ago
I was at microsoft from 2008-2011 and definitely saw some C++ in the kernel, even one driver using operator new for its allocations which I thought was a little nuts at the time. I also personally introduced some user mode .c files, it was just my preference. I don't think there's much rhyme or reason to which is used, although MS does lean very heavily towards C++ over C, seems like more and more as time goes on.
As for this directory tree... I found it creepy, like maybe source was leaked. The only inaccuracies I found relative to my memory of parts that I worked on was (1) I don't think they have done well tracking files that are part of static libraries and (2) what I presume are new files introduced by folks who came after me.
- DominikD 12y agoC++ code in kernel typically wouldn't fly for the new stuff, but I bet there were some legacy pieces, sure. But even then nothrow would be forced on new and prefast/prefix warnings around failed allocations would have to be handled.
- asveikau 12y agoThis is true. The driver I am thinking of didn't use C++ exceptions. I just found it weird not to use the pool APIs like everything else. But speaking of exceptions the kernel did use a lot of SEH.
- yuhong 12y agoI think the VC11 compiler adds official support with a /kernel switch.
- aionescu 12y agoIndeed, static libs caused massive duplication and not-always-correct source location in my script. Nice catch :)