Skip to content

Fix Windows CI build warnings and missing system libs#3

Merged
mostwise merged 7 commits intomainfrom
copilot/fix-ci-cd-errors
Apr 30, 2026
Merged

Fix Windows CI build warnings and missing system libs#3
mostwise merged 7 commits intomainfrom
copilot/fix-ci-cd-errors

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 30, 2026

The Windows CI build failed due to MSVC size-conversion warnings and unresolved external symbols from missing system libraries. Linker errors hit token/COM APIs and formatting helpers, blocking the executable output.

  • Linker dependencies

    • Add explicit pragma links for advapi32, ole32, and user32 to resolve missing symbols.
  • Size safety + buffer handling

    • Replace lossy size_t→DWORD/ULONG conversions with checked bounds and clearer buffer sizing in rename and reparse flows.
    • Free rename buffer after NtSetInformationFile use to avoid leaks on the success path.
  • Time conversion clarity

    • Normalize FILETIME→ULARGE_INTEGER handling and label the 5-second 100ns offset.

Example change:

const size_t tmp_len = wcslen(_tmp);
if (tmp_len > (ULONG_MAX / sizeof(wchar_t))) {
    printf("Rename filename length exceeds maximum size.\n");
    return 1;
}
const size_t tmp_bytes = tmp_len * sizeof(wchar_t);
if (tmp_bytes > (ULONG_MAX - sizeof(FILE_RENAME_INFORMATION))) {
    printf("Rename buffer size exceeds maximum limit.\n");
    return 1;
}

Copilot AI and others added 7 commits April 30, 2026 16:13
Agent-Logs-Url: https://github.com/mostwise/RedSun/sessions/dc09c994-6bf2-44db-8456-9eafc97d6304

Co-authored-by: mostwise <100317628+mostwise@users.noreply.github.com>
Agent-Logs-Url: https://github.com/mostwise/RedSun/sessions/dc09c994-6bf2-44db-8456-9eafc97d6304

Co-authored-by: mostwise <100317628+mostwise@users.noreply.github.com>
Agent-Logs-Url: https://github.com/mostwise/RedSun/sessions/dc09c994-6bf2-44db-8456-9eafc97d6304

Co-authored-by: mostwise <100317628+mostwise@users.noreply.github.com>
Agent-Logs-Url: https://github.com/mostwise/RedSun/sessions/dc09c994-6bf2-44db-8456-9eafc97d6304

Co-authored-by: mostwise <100317628+mostwise@users.noreply.github.com>
Agent-Logs-Url: https://github.com/mostwise/RedSun/sessions/dc09c994-6bf2-44db-8456-9eafc97d6304

Co-authored-by: mostwise <100317628+mostwise@users.noreply.github.com>
Agent-Logs-Url: https://github.com/mostwise/RedSun/sessions/dc09c994-6bf2-44db-8456-9eafc97d6304

Co-authored-by: mostwise <100317628+mostwise@users.noreply.github.com>
Agent-Logs-Url: https://github.com/mostwise/RedSun/sessions/dc09c994-6bf2-44db-8456-9eafc97d6304

Co-authored-by: mostwise <100317628+mostwise@users.noreply.github.com>
@mostwise mostwise marked this pull request as ready for review April 30, 2026 16:25
@mostwise mostwise merged commit 9a219f2 into main Apr 30, 2026
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