modify for Win32 support