janoglezcampos / janoglezcampos/rust_syscalls

Issue with ntapi module imports

Open
#5 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
238
Forks
32
PR merge metrics
No merged PRs in 30d

Description

When trying to import the project there is an issue with the ntapi dependency where the modules being called could not be found despite existing in the source file.

```
`error[E0432]: unresolved import `ntapi::ntldr`
--> rust_syscalls/src/syscall_resolve.rs:6:12
|
6 | use ntapi::ntldr::PLDR_DATA_TABLE_ENTRY;
| ^^^^^ could not find `ntldr` in `ntapi`

error[E0432]: unresolved import `ntapi::ntpebteb`
--> rust_syscalls/src/syscall_resolve.rs:7:12
|
7 | use ntapi::ntpebteb::{PPEB, TEB};
| ^^^^^^^^ could not find `ntpebteb` in `ntapi`

error[E0432]: unresolved import `ntapi::ntpsapi`
--> rust_syscalls/src/syscall_resolve.rs:8:12
|
8 | use ntapi::ntpsapi::PPEB_LDR_DATA;
| ^^^^^^^ could not find `ntpsapi` in `ntapi`

error[E0433]: failed to resolve: could not find `shared` in `winapi`
--> rust_syscalls/src/syscall_resolve.rs:11:13
|
11 | use winapi::shared::minwindef::{PUSHORT, PWORD};
| ^^^^^^ could not find `shared` in `winapi`

error[E0433]: failed to resolve: could not find `shared` in `winapi`
--> rust_syscalls/src/syscall_resolve.rs:12:13
|
12 | use winapi::shared::ntdef::{NULL, PLIST_ENTRY, PUCHAR, PVOID, ULONG};
| ^^^^^^ could not find `shared` in `winapi`

error[E0433]: failed to resolve: could not find `um` in `winapi`
--> rust_syscalls/src/syscall_resolve.rs:13:13
|
13 | use winapi::um::winnt::{
| ^^ could not find `um` in `winapi`

error[E0433]: failed to resolve: could not find `um` in `winapi`
--> rust_syscalls/src/syscall_resolve.rs:53:17
|
53 | use winapi::um::winnt::NT_TIB;
| ^^ could not find `um` in `winapi`

error[E0432]: unresolved import `ntapi::FIELD_OFFSET`
--> rust_syscalls/src/syscall_resolve.rs:9:5
|
9 | use ntapi::FIELD_OFFSET;
| ^^^^^^^^^^^^^^^^^^^ no `FIELD_OFFSET` in the root

error: cannot determine resolution for the macro `FIELD_OFFSET`
--> rust_syscalls/src/syscall_resolve.rs:54:22
|
54 | let teb_offset = FIELD_OFFSET!(NT_TIB, _Self) as u32;
| ^^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with rust_syscalls/src/syscall_resolve.rs and reproduce the reported compiler errors while checking the ntapi and winapi imports shown there. Done means the listed modules, types, and FIELD_OFFSET macro resolve and the project builds without these errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.