This code isn’t malicious, but we’ll make it malicious in the next step. This updates bitmap’s hdev field so that it no longer points to the printer device object, but rather to the screen device object. They can be selected into only one device context at a time, so deselecting is required.ĥ) Finally, we select Bitmap into a screen-related DC. The variable PrevBitmap is set to the default bitmap that was created together with the printer DC.Ĥ) We deselect our bitmap (by selecting PrevBitmap instead), so we’ll be able to select Bitmap into some other device context again. This sets the bitmap’s hdev field so that it points to the printer device object in kernel memory. This includes 1-bit or 8-bit printer-related DCs and 32-bit screen-related DCs.ģ) We select the bitmap into the printer-related DC. Note that it’s a monochrome (1 bit deep) bitmap, so it’s compatible with any device context. If necessary, the EnumPrinters API could be used to get the names of all installed printers.Ģ) We create a bitmap ( Bitmap). For the printer DC, we used the printer named “Microsoft XPS Document Writer” which is available by default, but any installed printer could be used instead. 1) We create one printer-related device context ( DCPrn) and one screen-related device context ( DCScr).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |