Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Native Windows Support #1681

Draft
wants to merge 37 commits into
base: master
Choose a base branch
from
Draft

Conversation

jhett12321
Copy link
Contributor

This PR adds a new "Launcher" executable that is needed to start the server with NWNX on Windows. It uses DetourCreateProcessWithDll from the detours package to inject the NWNX_Core library during startup.

There are also a bunch of changes to replace platform-specific library calls with equivalents from the standard library, or into a new interface wrapper for each platform (See NWNXLib/Platform)

Some early observations:

  • MSVC generates different mangled names for structs and classes. All API headers/the source generator need to be updated to use their actual base game structure types.
  • MSVC also generates different mangled names for public/protected/private members. This means NWNX plugins that use protected/private members (e.g. AreaPlugin.ExportGit) will require a workaround.
  • NWNX needs to be linked against a dynamic .lib of the nwserver.exe binary. It can be generated from the exe, but not sure if this should be checked in to the repository.
  • I had to revert back to the "older" style for function hooking, as MSVC does some funky stuff with member function pointers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant