Skip to content

Commit

Permalink
File names in Unicode
Browse files Browse the repository at this point in the history
Fix this bug
  • Loading branch information
master255 committed Jan 25, 2015
1 parent b3c1422 commit 4142c18
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 3 deletions.
Binary file modified Release/SimplyServer.exe
Binary file not shown.
Binary file modified SimplyServer.v12.suo
Binary file not shown.
5 changes: 2 additions & 3 deletions SimplyServer/MyForm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,14 @@ void SimplyServer::MyForm::Bclick()
void SimplyServer::MyForm::ProcessFile(String^ file1)
{
HANDLE hFile;
char* file2 = (char*)(void*)Marshal::StringToHGlobalAnsi(file1);
hFile = CreateFile(file2,
LPCWSTR file2 = (LPCWSTR)Marshal::StringToHGlobalUni(file1).ToPointer();
hFile = CreateFileW(file2,
GENERIC_READ, // open for reading
0, // do not share
NULL, // default security
OPEN_EXISTING, // existing file only
FILE_ATTRIBUTE_NORMAL, // normal file
NULL);
Marshal::FreeHGlobal((IntPtr)file2);
LARGE_INTEGER size;
GetFileSizeEx(hFile, &size);
if (size.QuadPart > (skipFile * 1048576))
Expand Down
Binary file modified x64/Release/SimplyServer.exe
Binary file not shown.

0 comments on commit 4142c18

Please sign in to comment.