... CreateFileW is a dummy routine that always returns an error, unless you link with the Microsoft Layer for Unicode (Unicows.dll). Unicows.dll translates all UNICODE argument strings to the current code page, and calls CreateFileA. So you can always link with CreateFileW, since it always exists, ...