]> git.tdb.fi Git - libs/core.git/commitdiff
Pass security attributes to the correct argument of CreateFile
authorMikko Rasa <tdb@tdb.fi>
Sun, 31 Oct 2021 17:46:51 +0000 (19:46 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 31 Oct 2021 19:35:23 +0000 (21:35 +0200)
source/io/windows/file.cpp

index 90c5bb5e6b50bdd840ee3482dd4ee8c585c04582..a388ade8fd687ae9db3c4bb5351e4f0e9332b8a4 100644 (file)
@@ -38,7 +38,7 @@ void File::platform_init(const string &fn, CreateMode cm)
        sec_attr.lpSecurityDescriptor = nullptr;
        sec_attr.bInheritHandle = !!(mode&M_INHERIT);
 
-       *handle = CreateFile(fn.c_str(), flags, share_flags, nullptr, 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();