No real changes, just replace several pairs of calls to GetDeviceCaps() with a single helper function call.