Skip to content

rust: Port libobs/util/platform-windows.c to obs-util #703

Closed

Description

@nathan-v

Unit

libobs/util/platform-windows.c to obs-util.

Phase and position

Phase 4, position 7 in docs/rust-port/testing-policy.md (platform.c, then platform-nix*.c / platform-windows.c). platform-nix.c is merged (#403). platform.c is still #262. Tracking issue #153.

Dependencies and existing tests

Depends on the Windows utf8_to_wchar / wchar_to_utf8 port, bmem, and the header-inline util_mul_div64 already in obs-util. test/cmocka/test_platform.c already characterizes the filesystem helpers this file implements (os_file_exists, os_mkdir, os_rename, os_safe_replace, os_opendir, os_get_abs_path_ptr). No new cmocka test. This is a per-OS file: the port is done when Windows Tier 2 passes in CI.

Notes

Windows only. ENABLE_RUST_LIBOBS drops util/platform-windows.c. The same file also defines get_win_ver, get_win_ver_int, get_win_release_id (not EXPORT), get_dll_ver, is_64_bit_windows, is_arm64_windows, get_reg_dword, get_plugin_info (not EXPORT), and DllMain (timeBeginPeriod(1)). The SEH around the mapped-image plugin scan stays in a small C helper, because Rust cannot write __try. Header-inline win_version_compare stays C. os_request_high_performance is a stub in the C file. The PTW32_STATIC_LIB pthread hooks in DllMain are not compiled into libobs.

Activity

  1. nathan-v commented on Oct 14, 2026

    @nathan-v
    ContributorAuthor

    Claiming: libobs/util/platform-windows.c

    1. RED: Tier 1 ports of the test_platform cases this file implements (file_exists, unlink, mkdir, rename, safe_replace, opendir, abs_path) against empty stubs (false, -1, None).
    2. GREEN: Win32 core in platform/windows, C shims, layout test, Tier 3 against platform-windows.c, ENABLE_RUST_LIBOBS drops util/platform-windows.c, export fragment. The SEH plugin scan stays in a small C helper. DllMain keeps timeBeginPeriod(1).
    3. Windows Tier 2 is CI. This machine has no Docker, so the local-gate stamp cannot be run.

    First commit today. Please add the claimed label; I cannot.

    Refs #153

  2. added
    claimed
    port
    enhancement
    on Oct 14, 2026
  3. zackees commented on Oct 14, 2026

    @zackees
    Member

    Done in #707 (merged via the merge queue): libobs/util/platform-windows.c is ported to obs-util::platform::windows::host, and ENABLE_RUST_LIBOBS drops the C file on Windows. The #153 checklist item can be ticked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claimedenhancementport

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions