Skip to content

[physfs.mod] Current version fails on Windows 7 (CreateFile2 not known in kernel) #68

@GWRon

Description

@GWRon

Coming from my initial thoughts in: bmx-ng/image.mod#29

The current Weekly Builds are not able to execute their built files on Windows 7 - because physfs calls CreateFile2 there.

The issue is in physfs.mod/physfs/src/physfs_platform_windows.c

static inline HANDLE winCreateFileW(const WCHAR *wfname, const DWORD mode,
                                    const DWORD creation)
{
    const DWORD share = FILE_SHARE_READ | FILE_SHARE_WRITE;
    #if defined(PHYSFS_PLATFORM_WINRT) || (_WIN32_WINNT >= 0x0602) // Windows 8+
        return CreateFile2(wfname, mode, share, creation, NULL);
    #else
    return CreateFileW(wfname, mode, share, NULL, creation,
                       FILE_ATTRIBUTE_NORMAL, NULL);
    #endif
} /* winCreateFileW */

That code there is incorrect - it also is used on Windows 7.

Once knowing this it was easy to spot, that the physfs-repo already fixed that 2 months ago:
icculus/physfs@cc2da5a

Maybe we could update physfs too - or at least incorporate the fix so Windows7 users are back in the game again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions