Skip to content

Issues with Importing Modules from winapi Crate in Rust #1060

@thiagolmoraes

Description

@thiagolmoraes

'm currently working on a Rust project where I need to use the winapi crate to allocate memory. However, I'm encountering issues with importing certain modules and functions from winapi. Here is a snippet of my Cargo.toml and main.rs:

[package]
name = "loader"
version = "0.1.0"
edition = "2021"

[dependencies]
sysinfo = "0.30.13"
winapi = { version = "0.3.9", features = [
    "winuser",
    "winbase",
    "synchapi",
    "processthreadsapi",
    "memoryapi",
    "handleapi",
    "tlhelp32",
    "winnt",
    "minwinbase"
] }

use winapi::um::winnt::{MEM_COMMIT, MEM_RESERVE, PAGE_EXECUTE_READWRITE};
use winapi::um::memoryapi::{VirtualAlloc, VirtualProtect};
use winapi::um::processthreadsapi::CreateThread;
use winapi::um::minwinbase::LPTHREAD_START_ROUTINE;
use winapi::ctypes::c_void;

...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions