Use the Windows CreateFile/WriteFile functions instead of open/write.