Patch from James H which initialises a couple of Windows API object