Convert d_win32.c to C++