X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fio%2Fwindows%2Ffile.cpp;h=a388ade8fd687ae9db3c4bb5351e4f0e9332b8a4;hb=HEAD;hp=51fe814a5e29b197f8843d3f4ae1d31653718297;hpb=d28df82ca5c33fa4be0f6ce1ffee58b8e447e20c;p=libs%2Fcore.git diff --git a/source/io/windows/file.cpp b/source/io/windows/file.cpp index 51fe814..a388ade 100644 --- a/source/io/windows/file.cpp +++ b/source/io/windows/file.cpp @@ -35,14 +35,14 @@ void File::platform_init(const string &fn, CreateMode cm) SECURITY_ATTRIBUTES sec_attr; sec_attr.nLength = sizeof(SECURITY_ATTRIBUTES); - sec_attr.lpSecurityDescriptor = 0; + sec_attr.lpSecurityDescriptor = nullptr; sec_attr.bInheritHandle = !!(mode&M_INHERIT); - *handle = CreateFile(fn.c_str(), flags, share_flags, 0, create_flags, FILE_ATTRIBUTE_NORMAL, &sec_attr); + *handle = CreateFile(fn.c_str(), flags, share_flags, &sec_attr, create_flags, FILE_ATTRIBUTE_NORMAL, nullptr); if(!handle) { int err = GetLastError(); - if(err==ERROR_FILE_NOT_FOUND) + if(err==ERROR_FILE_NOT_FOUND || err==ERROR_PATH_NOT_FOUND) throw file_not_found(fn); else if(err==ERROR_FILE_EXISTS) throw file_already_exists(fn);