halildurmus / win32

Access common Win32 APIs directly from Dart using FFI — no C required!
https://win32.pub
BSD 3-Clause "New" or "Revised" License
755 stars 123 forks source link

Adding Win32 functions? #290

Closed bezubaba closed 3 years ago

bezubaba commented 3 years ago

Inside Kernel32.dart it says // THIS FILE IS GENERATED AUTOMATICALLY AND SHOULD NOT BE EDITED DIRECTLY.

How am I suppose to add additional function? For example there is no CreateFileMappingA defined inside the kernel32.dart.

ilopX commented 3 years ago

When wrapping a Win32 API, use the Unicode ('W') wide variants of these APIs, rather than the ANSI ('A') variants. For example: CredWriteW, rather than CredWriteA.

To create a new API, don't edit the main library files themselves; these get overwritten. Instead, edit tool\manual_gen\win32api.json and run tool\generate.cmd to update the library files. This might seem a pain, but it gives protection against any changes to dart:ffi, since the typedef syntax can be easily recreated as necessary.

https://github.com/timsneath/win32/blob/main/CONTRIBUTING.md