winapigraphicsntnt-native-apinative-executable

How do you get Graphics in Native NT Text-Mode?


Apparently, the EASEUS Partition Master program can display graphics before the Windows GUI starts (i.e., it runs at the same time CheckDisk runs at boot).

What I already know:

  1. This might require not-very-well-documented functions. That's fine with me.

  2. I already know how to compile native NT executables, so feel free to omit that from responses.

Questions:

  1. How can you display graphics before everything has started up? (i.e. What functions/libraries do you use?)

  2. How does it display formatted and aligned text on the screen?
    I know NtDisplayString is capable of writing text, but it can't draw things in a formatted manner, as you can see below. What function(s) do you use to replicate the behavior below?

Screenshot


Solution

  • I feel kind of silly answering my own question right now, but Ben's hints helped me figure it out:

    It's using a driver, which in turn uses these functions in BootVid.dll:

    VidBufferToScreenBlt
    VidScreenToBufferBlt
    VidBitBlt