6 ms·
Graphics hasn't been kernel mode since the Vista days FYI. It's now in userspace.
by pixel16 7y ago
Graphics hasn't been kernel mode since the Vista days FYI. It's now in userspace.
- jdsully 7y agoIt was moved out in Vista with great fanfare. A side effect was GDI was no longer hardware accelerated. With windows 7 and later hardware acceleration was added back necessitating parts of it return to the kernel. For obvious reasons this wasn't as widely publicized. This makes exploits like this possible: https://sensepost.com/blog/2017/abusing-gdi-objects-for-ring0-primitives-revolution/ https://sensepost.com/blog/2017/abusing-gdi-objects-for-ring...
- dman 7y agoI thought GDI is now emulated over Direct2D.
- jdsully 7y agoYou draw to a DirectX surface rather than the raw frame buffer but it is by no means translated to D2D. D2D has a "GDI" emulation mode, but it's more than worthless if you care about rendering fidelity with the real thing - and you probably do if your still on GDI these days.
- dman 7y agoAh good to know - I was under the incorrect impression that the D2D "GDI" emulation mode was the only codepath remaining. Btw any pointers on how to keep track of the graphics stack in Windows? In the past there used to be a treasure trove of blogs and content in MSDN but over time that community has frittered away. Any pointers on how to keep track of what Microsofts graphics roadmap is going forward?
- jdsully 7y agoThe simple answer is use D2D/Dwrite for low level render code in new projects. If you use C# there’s probably higher level wrappers over these. Some of the older C# APIs wrap GDI+ which is pretty slow and renders text really poorly so go with whatever new stuff they have now. I don’t know of any specific blogs/resources. I used to work on Excel’s render code so had a bit of an inside view.
- dman 7y agoI worked on some inhouse tools similar to Excel (rendering highly customizable grids) so efficient 2D rendering is of high interest to me. This is from C++.
- saagarjha 7y agoI seem to recall having a discussion with you a while back where Windows would just leave kernel pointers out in userspace, which seemed to do with GDI as well.
- jdsully 7y agoYes, I think we debated the whole concept of GDI being in the kernel as well. The Vista experience shows you it was and still is necessary for perf.