In CreateDIBSection function, if hdc is NULL it now uses the desktop DC