Fix ups and added support to prevent GDI from crashing. These functions will be required for GDI. Part 1 of print support.
CORE-15522