Skip to content

Fix Windows Unicode API usage and ntstatus header conflicts#2

Merged
mostwise merged 2 commits intomainfrom
copilot/fix-build-process-errors
Apr 30, 2026
Merged

Fix Windows Unicode API usage and ntstatus header conflicts#2
mostwise merged 2 commits intomainfrom
copilot/fix-build-process-errors

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 30, 2026

Windows build was failing with widespread ntstatus.h macro redefinitions and C2664 errors from passing wchar_t strings to ANSI WinAPI functions. These changes align header ordering and API variants to remove the conflicts and mismatched types.

  • Header ordering / NTSTATUS macros
    • Define WIN32_NO_STATUS before Windows.h and include ntstatus.h after to avoid duplicate macro definitions.
  • Wide-character WinAPI usage
    • Switch ANSI *A calls to *W variants and align related structures to match wchar_t literals.

Example:

#define WIN32_NO_STATUS
#include <Windows.h>
#undef WIN32_NO_STATUS
#include <ntstatus.h>

HMODULE hm = GetModuleHandleW(L"ntdll.dll");
CreateProcessAsUserW(hnewtoken, L"C:\\Windows\\System32\\conhost.exe", nullptr, nullptr, nullptr, FALSE, 0, nullptr, nullptr, &si, &pi);

Copilot AI and others added 2 commits April 30, 2026 16:07
Agent-Logs-Url: https://github.com/mostwise/RedSun/sessions/436ebc85-bc23-48b0-aad3-05862fc22ac3

Co-authored-by: mostwise <100317628+mostwise@users.noreply.github.com>
Agent-Logs-Url: https://github.com/mostwise/RedSun/sessions/436ebc85-bc23-48b0-aad3-05862fc22ac3

Co-authored-by: mostwise <100317628+mostwise@users.noreply.github.com>
@mostwise mostwise marked this pull request as ready for review April 30, 2026 16:10
@mostwise mostwise merged commit 61f8fdd into main Apr 30, 2026
0 of 2 checks passed
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.

2 participants