Skip to content

ctypes.c_wchar type mismatch between windows and *nix causing wrong size calculation #1566

Closed as duplicate
@kungfulon

Description

@kungfulon

*Describe the bug
ctypes.c_wchar type mismatch between windows and *nix causing wrong size calculation

Sample Code

>>> from qiling.os.windows.structs import make_os_version_info_ex
>>> make_os_version_info_ex(64, wide=True).sizeof()
540

Expected behavior
Size of OSVERSIONINFOEXW is 284 bytes.

Screenshots
N/A

Additional context
In Windows, wchar_t is 2 bytes, while in *nix wchar_t is 4 bytes. That caused difference in size calculation. This is just an example, I think there are many other places in Windows api handling that might have this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions