In Bug 773518 I once again needed to use a check for IsVistaOrLater so I decided to refactor all of this into nsWindowsHelpers.h with a header only implementation.
Created attachment 642455 [details] [diff] [review] Patch v1.
This is passing tests from a push to try by the way.
Comment on attachment 642455 [details] [diff] [review] Patch v1. Seems to me that we want this in a .cpp file if we're going to use it any number of times, but I guess this is at least as good as what we've got now.
I did it that way so that we can use it in various libraries without having linking errors. Also you can use it without even linking to anything at all (as is the rest of nsWindowsHelpers.h).