microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
94.94k stars 8.22k forks source link

Document ConDrv headers (condrv.h and conmsgl*.h) #10463

Open lhecker opened 3 years ago

lhecker commented 3 years ago

As the ConDrv headers and \Device\ConDrv\Server are undocumented, it:

In the name of https://github.com/microsoft/terminal/issues/10462#issuecomment-864446348 I'd like to thus ask for ConDrv to be documented.

malxau commented 3 years ago

Can I ask what the expected gain is here?

~Six months ago I went through the exercise of figuring out how this works. The conhost side is straightforward because all of the code pulling from condrv is in the tree, and I'm sure with this any competent dev could write/rewrite/replace the conhost side. The client side was a bit more interesting, because that code would normally be in kernel32.dll but with a usermode debugger and the headers here it wasn't hard to figure out.

What I was trying to do with this exercise was investigate the feasibility of a Win32++ that exposes newer capabilities via a familiar API, and the natural way to do that is with condrv messages. As luck would have it, condrv doesn't do much sanity checking of messages so adding new ones is trivial. I didn't speak to anyone here about it because I thought this isn't something you'd be interested in (with all those deprecation notices on MSDN and all), and eventually lost interest in pursuing it. There is a nice bonus of having a functional/RPC interface, which is the client can detect when the server can't implement something and gracefully fall back.

Ultimately though it ended in a pile of "learnings":

So even as someone who generally finishes anything he starts, this is one thing I walked away from.