Step 8: Add Private Data for PDEVICE, Brushes, and Pens

The size of the PDEVICE structure that the DIB engine expects is declared in the dpDeviceSize field of the GDIINFO block returned by the DIB engine. If the driver needs private data in the PDEVICE, it can allocate it. The dpDeviceSize bytes must be in the DIB engine format and must be built using CreateDIBPDevice. Any private data should go after this in the structure and the minidriver must initialize the data itself.

The sizes of the brushes and pens that the DIB engine uses can be found by hooking the first call to RealizeObject and looking at the return value (for size) from the DIB engine. Any private data should go after this in the structure. The minidriver can set a bit in the Flags field to indicate that the pen or brush has additional data.