Skip to content

WindowsDynLib lookup function should pass a C String to GetProcAddress #2435

Closed

Description

@rivten

In here : https://github.com/ziglang/zig/blob/master/std/dynamic_library.zig#L197 , the function lookup should either : receive a C String as an input (c"MyLookupName") or reformat the Zig String input to C String. This is because GetProcAddress expects a C String.

Activity

  1. emekoi commented on May 6, 2019

    @emekoi
    Contributor

    this should be solved by #265, but in the mean time, i can't think of a correct solution that doesn't require a comptime, an allocator, of the user null-terminating the string themselves.

  2. added this to the 0.5.0 milestone on May 7, 2019
  3. andrewrk commented on Sep 6, 2019

    @andrewrk
    Member

    One thing you can do for now is have a buffer on the stack with, say, 512 bytes. If the length is too big for this return error.NameTooLong or similar. We can always improve this API later.

  4. added
    standard library
    os-windows
    on Sep 20, 2019
  5. modified the milestones: 0.5.0, 0.6.0 on Sep 20, 2019
  6. andrewrk commented on Jan 5, 2020

    @andrewrk
    Member

    Solved with #265 and #2598

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

    os-windowsstandard library

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions