Win32 helper functions imported from old wn library