Okay well make sure you got drivers that support it first, I guess.

I just tested this on Windows 7 and promtly crashed each time on
GetDeviceGammaRamp API.

MSDN list both API with this:
Direct color display modes do not use color lookup tables and are usually 16, 24, or 32 bit. Not all direct color video boards support loadable gamma ramps. GetDeviceGammaRamp succeeds only for devices with drivers that support downloadable gamma ramps in hardware