#message-box #windows #fn-message-box-a

wintypes

A rust library that exports windows functions as types

5 releases

0.1.4 Jan 26, 2025
0.1.3 Jan 20, 2025
0.1.2 Jan 18, 2025
0.1.1 Jan 18, 2025
0.1.0 Jan 17, 2025

#67 in Windows APIs

Download history 148/week @ 2025-01-12 167/week @ 2025-01-19 113/week @ 2025-01-26 11/week @ 2025-02-02 5/week @ 2025-02-09 4/week @ 2025-02-16

215 downloads per month

MIT license

665KB
14K SLoC

wintypes

A rust library that exports windows functions as types

Usage

Once this library is downloaded you can just use a function as a type by DLL:

use wintypes::user32::FnMessageBoxA;

Build

Get DLLs exported functions

The first step is to get the exported functions of the DLLs:

$ scripts/parse_dll_exports.py ~/SharedFolder/dlls/advapi32.dll ~/SharedFolder/dlls/crypt32.dll ~/SharedFolder/dlls/kernel32.dll ~/SharedFolder/dlls/kernelbase.dll ~/SharedFolder/dlls/winhttp.dll ~/SharedFolder/dlls/ntdll.dll | jq . > exports.json

Generate the types

$ ./scripts/parse_doc_crates.py exports.json

Credits

  • ntapi and winapi for implementing windows functions as functions. This project scrapes prototypes from those crates.

Dependencies

~0.7–1MB
~22K SLoC