Checking for hooks works on Windows

This is a little lazy, we should probably make a platform.c for these
sorts of functions. It's only two copies of the same code though so
it'll do for now.