Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from winapi to windows-sys #634

Merged
merged 13 commits into from
Jul 27, 2024
336 changes: 167 additions & 169 deletions .github/workflows/main.yml

Large diffs are not rendered by default.

136 changes: 115 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 0 additions & 17 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ version = "0.36.0"
default-features = false
features = ['read_core', 'elf', 'macho', 'pe', 'xcoff', 'unaligned', 'archive']

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3.9", optional = true }

[build-dependencies]
# Only needed for Android, but cannot be target dependent
# https://github.com/rust-lang/cargo/issues/4932
Expand Down Expand Up @@ -82,20 +79,6 @@ dladdr = []
kernel32 = []
libunwind = []
unix-backtrace = []
verify-winapi = [
'winapi/dbghelp',
'winapi/handleapi',
'winapi/libloaderapi',
'winapi/memoryapi',
'winapi/minwindef',
'winapi/processthreadsapi',
'winapi/synchapi',
'winapi/tlhelp32',
'winapi/winbase',
'winapi/winnt',
'winapi/winnls',
'winapi/stringapiset',
]

[[example]]
name = "backtrace"
Expand Down
63 changes: 63 additions & 0 deletions bindings.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
--out src/windows_sys.rs
--config std flatten
--filter
Windows.Win32.Foundation.CloseHandle
Windows.Win32.Foundation.FALSE
Windows.Win32.Foundation.HINSTANCE
Windows.Win32.Foundation.INVALID_HANDLE_VALUE
Windows.Win32.Foundation.TRUE
Windows.Win32.Globalization.CP_UTF8
Windows.Win32.Globalization.lstrlenW
Windows.Win32.Globalization.WideCharToMultiByte
Windows.Win32.System.Diagnostics.Debug.AddrModeFlat
Windows.Win32.System.Diagnostics.Debug.CONTEXT
Windows.Win32.System.Diagnostics.Debug.EnumerateLoadedModulesW64
Windows.Win32.System.Diagnostics.Debug.IMAGEHLP_LINEW64
Windows.Win32.System.Diagnostics.Debug.MAX_SYM_NAME
Windows.Win32.System.Diagnostics.Debug.PENUMLOADED_MODULES_CALLBACKW64
Windows.Win32.System.Diagnostics.Debug.PFUNCTION_TABLE_ACCESS_ROUTINE64
Windows.Win32.System.Diagnostics.Debug.PGET_MODULE_BASE_ROUTINE64
Windows.Win32.System.Diagnostics.Debug.PREAD_PROCESS_MEMORY_ROUTINE64
Windows.Win32.System.Diagnostics.Debug.PTRANSLATE_ADDRESS_ROUTINE64
Windows.Win32.System.Diagnostics.Debug.RtlCaptureContext
Windows.Win32.System.Diagnostics.Debug.RtlLookupFunctionEntry
Windows.Win32.System.Diagnostics.Debug.RtlVirtualUnwind
Windows.Win32.System.Diagnostics.Debug.STACKFRAME64
Windows.Win32.System.Diagnostics.Debug.STACKFRAME_EX
Windows.Win32.System.Diagnostics.Debug.StackWalk64
Windows.Win32.System.Diagnostics.Debug.StackWalkEx
Windows.Win32.System.Diagnostics.Debug.SymAddrIncludeInlineTrace
Windows.Win32.System.Diagnostics.Debug.SYMBOL_INFOW
Windows.Win32.System.Diagnostics.Debug.SymFromAddrW
Windows.Win32.System.Diagnostics.Debug.SymFromInlineContextW
Windows.Win32.System.Diagnostics.Debug.SymFunctionTableAccess64
Windows.Win32.System.Diagnostics.Debug.SymGetLineFromAddrW64
Windows.Win32.System.Diagnostics.Debug.SymGetLineFromInlineContextW
Windows.Win32.System.Diagnostics.Debug.SymGetModuleBase64
Windows.Win32.System.Diagnostics.Debug.SymGetOptions
Windows.Win32.System.Diagnostics.Debug.SymGetSearchPathW
Windows.Win32.System.Diagnostics.Debug.SymInitializeW
Windows.Win32.System.Diagnostics.Debug.SYMOPT_DEFERRED_LOADS
Windows.Win32.System.Diagnostics.Debug.SymQueryInlineTrace
Windows.Win32.System.Diagnostics.Debug.SymSetOptions
Windows.Win32.System.Diagnostics.Debug.SymSetSearchPathW
Windows.Win32.System.Diagnostics.ToolHelp.CreateToolhelp32Snapshot
Windows.Win32.System.Diagnostics.ToolHelp.Module32FirstW
Windows.Win32.System.Diagnostics.ToolHelp.Module32NextW
Windows.Win32.System.Diagnostics.ToolHelp.MODULEENTRY32W
Windows.Win32.System.Diagnostics.ToolHelp.TH32CS_SNAPMODULE
Windows.Win32.System.LibraryLoader.GetProcAddress
Windows.Win32.System.LibraryLoader.LoadLibraryA
Windows.Win32.System.Memory.CreateFileMappingA
Windows.Win32.System.Memory.FILE_MAP_READ
Windows.Win32.System.Memory.MapViewOfFile
Windows.Win32.System.Memory.PAGE_READONLY
Windows.Win32.System.Memory.UnmapViewOfFile
Windows.Win32.System.SystemInformation.IMAGE_FILE_MACHINE_I386
Windows.Win32.System.Threading.CreateMutexA
Windows.Win32.System.Threading.GetCurrentProcess
Windows.Win32.System.Threading.GetCurrentProcessId
Windows.Win32.System.Threading.GetCurrentThread
Windows.Win32.System.Threading.INFINITE
Windows.Win32.System.Threading.ReleaseMutex
Windows.Win32.System.Threading.WaitForSingleObjectEx
1 change: 1 addition & 0 deletions crates/as-if-std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ features = ['read_core', 'elf', 'macho', 'pe', 'xcoff', 'unaligned', 'archive']
[build-dependencies]
# Dependency of the `backtrace` crate
cc = "1.0.97"
windows-bindgen = "0.56"

[features]
default = ['backtrace']
Expand Down
Loading
Loading