Last active
August 29, 2015 14:16
-
-
Save crewjam/1d69eee9623d71738153 to your computer and use it in GitHub Desktop.
wide character path test program
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// cl test.cc & test.exe | |
#include <windows.h> | |
#include <stdio.h> | |
int main() { | |
wchar_t path[] = L"a<b"; | |
CreateFileW(path, GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); | |
LPVOID lastErrorString; | |
DWORD lastError = GetLastError(); | |
FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, lastError, 0, (LPTSTR) &lastErrorString, 0, NULL); | |
printf("error: %d %s\n", lastError, lastErrorString); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment