Adjusted win32 code