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

Use correct lib for internal bindings #1432

Merged
merged 1 commit into from Jan 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 20 additions & 20 deletions crates/libs/windows/src/core/bindings.rs
Expand Up @@ -1329,7 +1329,7 @@ pub const CLASS_E_CLASSNOTAVAILABLE: ::windows::core::HRESULT = ::windows::core:
pub unsafe fn CloseHandle<'a, Param0: ::windows::core::IntoParam<'a, HANDLE>>(hobject: Param0) -> BOOL {
#[cfg(windows)]
{
#[link(name = "kernel32")]
#[link(name = "windows")]
extern "system" {
fn CloseHandle(hobject: HANDLE) -> BOOL;
}
Expand All @@ -1346,7 +1346,7 @@ pub type FARPROC = ::core::option::Option<unsafe extern "system" fn() -> isize>;
pub unsafe fn GetLastError() -> WIN32_ERROR {
#[cfg(windows)]
{
#[link(name = "kernel32")]
#[link(name = "windows")]
extern "system" {
fn GetLastError() -> WIN32_ERROR;
}
Expand Down Expand Up @@ -1548,7 +1548,7 @@ pub const S_OK: ::windows::core::HRESULT = ::windows::core::HRESULT(0i32);
pub unsafe fn SysAllocStringLen<'a, Param0: ::windows::core::IntoParam<'a, PWSTR>>(strin: Param0, ui: u32) -> BSTR {
#[cfg(windows)]
{
#[link(name = "oleaut32")]
#[link(name = "windows")]
extern "system" {
fn SysAllocStringLen(strin: PWSTR, ui: u32) -> BSTR;
}
Expand All @@ -1561,7 +1561,7 @@ pub unsafe fn SysAllocStringLen<'a, Param0: ::windows::core::IntoParam<'a, PWSTR
pub unsafe fn SysFreeString<'a, Param0: ::windows::core::IntoParam<'a, BSTR>>(bstrstring: Param0) {
#[cfg(windows)]
{
#[link(name = "oleaut32")]
#[link(name = "windows")]
extern "system" {
fn SysFreeString(bstrstring: ::core::mem::ManuallyDrop<BSTR>);
}
Expand All @@ -1574,7 +1574,7 @@ pub unsafe fn SysFreeString<'a, Param0: ::windows::core::IntoParam<'a, BSTR>>(bs
pub unsafe fn SysStringLen<'a, Param0: ::windows::core::IntoParam<'a, BSTR>>(pbstr: Param0) -> u32 {
#[cfg(windows)]
{
#[link(name = "oleaut32")]
#[link(name = "windows")]
extern "system" {
fn SysStringLen(pbstr: ::core::mem::ManuallyDrop<BSTR>) -> u32;
}
Expand Down Expand Up @@ -1619,7 +1619,7 @@ impl ::core::default::Default for SECURITY_ATTRIBUTES {
pub unsafe fn CoCreateGuid() -> ::windows::core::Result<::windows::core::GUID> {
#[cfg(windows)]
{
#[link(name = "ole32")]
#[link(name = "windows")]
extern "system" {
fn CoCreateGuid(pguid: *mut ::windows::core::GUID) -> ::windows::core::HRESULT;
}
Expand All @@ -1633,7 +1633,7 @@ pub unsafe fn CoCreateGuid() -> ::windows::core::Result<::windows::core::GUID> {
pub unsafe fn CoTaskMemAlloc(cb: usize) -> *mut ::core::ffi::c_void {
#[cfg(windows)]
{
#[link(name = "ole32")]
#[link(name = "windows")]
extern "system" {
fn CoTaskMemAlloc(cb: usize) -> *mut ::core::ffi::c_void;
}
Expand All @@ -1646,7 +1646,7 @@ pub unsafe fn CoTaskMemAlloc(cb: usize) -> *mut ::core::ffi::c_void {
pub unsafe fn CoTaskMemFree(pv: *const ::core::ffi::c_void) {
#[cfg(windows)]
{
#[link(name = "ole32")]
#[link(name = "windows")]
extern "system" {
fn CoTaskMemFree(pv: *const ::core::ffi::c_void);
}
Expand All @@ -1659,7 +1659,7 @@ pub unsafe fn CoTaskMemFree(pv: *const ::core::ffi::c_void) {
pub unsafe fn GetErrorInfo(dwreserved: u32) -> ::windows::core::Result<IErrorInfo> {
#[cfg(windows)]
{
#[link(name = "oleaut32")]
#[link(name = "windows")]
extern "system" {
fn GetErrorInfo(dwreserved: u32, pperrinfo: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT;
}
Expand Down Expand Up @@ -1795,7 +1795,7 @@ pub struct IErrorInfoVtbl(
pub unsafe fn SetErrorInfo<'a, Param1: ::windows::core::IntoParam<'a, IErrorInfo>>(dwreserved: u32, perrinfo: Param1) -> ::windows::core::Result<()> {
#[cfg(windows)]
{
#[link(name = "oleaut32")]
#[link(name = "windows")]
extern "system" {
fn SetErrorInfo(dwreserved: u32, perrinfo: ::windows::core::RawPtr) -> ::windows::core::HRESULT;
}
Expand All @@ -1815,7 +1815,7 @@ pub const FORMAT_MESSAGE_IGNORE_INSERTS: FORMAT_MESSAGE_OPTIONS = 512u32;
pub unsafe fn FormatMessageW(dwflags: FORMAT_MESSAGE_OPTIONS, lpsource: *const ::core::ffi::c_void, dwmessageid: u32, dwlanguageid: u32, lpbuffer: PWSTR, nsize: u32, arguments: *const *const i8) -> u32 {
#[cfg(windows)]
{
#[link(name = "kernel32")]
#[link(name = "windows")]
extern "system" {
fn FormatMessageW(dwflags: FORMAT_MESSAGE_OPTIONS, lpsource: *const ::core::ffi::c_void, dwmessageid: u32, dwlanguageid: u32, lpbuffer: PWSTR, nsize: u32, arguments: *const *const i8) -> u32;
}
Expand All @@ -1828,7 +1828,7 @@ pub unsafe fn FormatMessageW(dwflags: FORMAT_MESSAGE_OPTIONS, lpsource: *const :
pub unsafe fn FreeLibrary<'a, Param0: ::windows::core::IntoParam<'a, HINSTANCE>>(hlibmodule: Param0) -> BOOL {
#[cfg(windows)]
{
#[link(name = "kernel32")]
#[link(name = "windows")]
extern "system" {
fn FreeLibrary(hlibmodule: HINSTANCE) -> BOOL;
}
Expand All @@ -1841,7 +1841,7 @@ pub unsafe fn FreeLibrary<'a, Param0: ::windows::core::IntoParam<'a, HINSTANCE>>
pub unsafe fn GetProcAddress<'a, Param0: ::windows::core::IntoParam<'a, HINSTANCE>, Param1: ::windows::core::IntoParam<'a, PSTR>>(hmodule: Param0, lpprocname: Param1) -> FARPROC {
#[cfg(windows)]
{
#[link(name = "kernel32")]
#[link(name = "windows")]
extern "system" {
fn GetProcAddress(hmodule: HINSTANCE, lpprocname: PSTR) -> FARPROC;
}
Expand All @@ -1854,7 +1854,7 @@ pub unsafe fn GetProcAddress<'a, Param0: ::windows::core::IntoParam<'a, HINSTANC
pub unsafe fn LoadLibraryA<'a, Param0: ::windows::core::IntoParam<'a, PSTR>>(lplibfilename: Param0) -> HINSTANCE {
#[cfg(windows)]
{
#[link(name = "kernel32")]
#[link(name = "windows")]
extern "system" {
fn LoadLibraryA(lplibfilename: PSTR) -> HINSTANCE;
}
Expand All @@ -1867,7 +1867,7 @@ pub unsafe fn LoadLibraryA<'a, Param0: ::windows::core::IntoParam<'a, PSTR>>(lpl
pub unsafe fn GetProcessHeap() -> HeapHandle {
#[cfg(windows)]
{
#[link(name = "kernel32")]
#[link(name = "windows")]
extern "system" {
fn GetProcessHeap() -> HeapHandle;
}
Expand Down Expand Up @@ -1898,7 +1898,7 @@ pub const HEAP_CREATE_HARDENED: HEAP_FLAGS = 512u32;
pub unsafe fn HeapAlloc<'a, Param0: ::windows::core::IntoParam<'a, HeapHandle>>(hheap: Param0, dwflags: HEAP_FLAGS, dwbytes: usize) -> *mut ::core::ffi::c_void {
#[cfg(windows)]
{
#[link(name = "kernel32")]
#[link(name = "windows")]
extern "system" {
fn HeapAlloc(hheap: HeapHandle, dwflags: HEAP_FLAGS, dwbytes: usize) -> *mut ::core::ffi::c_void;
}
Expand All @@ -1911,7 +1911,7 @@ pub unsafe fn HeapAlloc<'a, Param0: ::windows::core::IntoParam<'a, HeapHandle>>(
pub unsafe fn HeapFree<'a, Param0: ::windows::core::IntoParam<'a, HeapHandle>>(hheap: Param0, dwflags: HEAP_FLAGS, lpmem: *const ::core::ffi::c_void) -> BOOL {
#[cfg(windows)]
{
#[link(name = "kernel32")]
#[link(name = "windows")]
extern "system" {
fn HeapFree(hheap: HeapHandle, dwflags: HEAP_FLAGS, lpmem: *const ::core::ffi::c_void) -> BOOL;
}
Expand Down Expand Up @@ -1958,7 +1958,7 @@ unsafe impl ::windows::core::Abi for HeapHandle {
pub unsafe fn CreateEventA<'a, Param1: ::windows::core::IntoParam<'a, BOOL>, Param2: ::windows::core::IntoParam<'a, BOOL>, Param3: ::windows::core::IntoParam<'a, PSTR>>(lpeventattributes: *const SECURITY_ATTRIBUTES, bmanualreset: Param1, binitialstate: Param2, lpname: Param3) -> HANDLE {
#[cfg(windows)]
{
#[link(name = "kernel32")]
#[link(name = "windows")]
extern "system" {
fn CreateEventA(lpeventattributes: *const SECURITY_ATTRIBUTES, bmanualreset: BOOL, binitialstate: BOOL, lpname: PSTR) -> HANDLE;
}
Expand All @@ -1971,7 +1971,7 @@ pub unsafe fn CreateEventA<'a, Param1: ::windows::core::IntoParam<'a, BOOL>, Par
pub unsafe fn SetEvent<'a, Param0: ::windows::core::IntoParam<'a, HANDLE>>(hevent: Param0) -> BOOL {
#[cfg(windows)]
{
#[link(name = "kernel32")]
#[link(name = "windows")]
extern "system" {
fn SetEvent(hevent: HANDLE) -> BOOL;
}
Expand All @@ -1984,7 +1984,7 @@ pub unsafe fn SetEvent<'a, Param0: ::windows::core::IntoParam<'a, HANDLE>>(heven
pub unsafe fn WaitForSingleObject<'a, Param0: ::windows::core::IntoParam<'a, HANDLE>>(hhandle: Param0, dwmilliseconds: u32) -> u32 {
#[cfg(windows)]
{
#[link(name = "kernel32")]
#[link(name = "windows")]
extern "system" {
fn WaitForSingleObject(hhandle: HANDLE, dwmilliseconds: u32) -> u32;
}
Expand Down
2 changes: 1 addition & 1 deletion crates/tools/bindings/src/main.rs
Expand Up @@ -58,7 +58,7 @@ fn main() -> std::io::Result<()> {
];

let mut tokens = "#![allow(non_snake_case, non_upper_case_globals, dead_code, non_camel_case_types, clippy::upper_case_acronyms, clippy::derivable_impls)]".to_string();
let gen = bindgen::Gen { min_enum: true, min_inherit: true, flatten: true, ..Default::default() };
let gen = bindgen::Gen { namespace: "Windows.", min_enum: true, min_inherit: true, flatten: true, ..Default::default() };

for name in types {
tokens += &bindgen::gen_type(name, &gen);
Expand Down