win32 invalid matrix work round