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

Add windows-result crate #2847

Merged
merged 9 commits into from
Feb 15, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ jobs:
cargo clippy -p test_readme &&
cargo clippy -p test_reserved &&
cargo clippy -p test_resources &&
cargo clippy -p test_result &&
cargo clippy -p test_return_handle &&
cargo clippy -p test_return_struct &&
cargo clippy -p test_riddle &&
Expand Down Expand Up @@ -153,6 +154,7 @@ jobs:
cargo clippy -p windows-implement &&
cargo clippy -p windows-interface &&
cargo clippy -p windows-metadata &&
cargo clippy -p windows-result &&
cargo clippy -p windows-sys &&
cargo clippy -p windows-targets &&
cargo clippy -p windows-version &&
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ jobs:
cargo test -p test_debugger_visualizer &&
cargo test -p test_deprecated &&
cargo test -p test_dispatch &&
cargo clean &&
cargo test -p test_does_not_return &&
cargo clean &&
cargo test -p test_enums &&
cargo test -p test_error &&
cargo test -p test_event &&
Expand All @@ -128,6 +128,7 @@ jobs:
cargo test -p test_readme &&
cargo test -p test_reserved &&
cargo test -p test_resources &&
cargo test -p test_result &&
cargo test -p test_return_handle &&
cargo test -p test_return_struct &&
cargo test -p test_riddle &&
Expand Down Expand Up @@ -161,6 +162,7 @@ jobs:
cargo test -p windows-implement &&
cargo test -p windows-interface &&
cargo test -p windows-metadata &&
cargo test -p windows-result &&
cargo test -p windows-sys &&
cargo test -p windows-targets &&
cargo test -p windows-version &&
Expand Down
4 changes: 4 additions & 0 deletions crates/libs/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ targets = []
version = "0.52.0"
path = "../targets"

[dependencies.windows-result]
version = "0.1.0"
path = "../result"

[features]
default = []
implement = []
168 changes: 0 additions & 168 deletions crates/libs/core/src/error.rs

This file was deleted.

11 changes: 0 additions & 11 deletions crates/libs/core/src/imp/bindings.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
// Bindings generated by `windows-bindgen` 0.52.0

#![allow(non_snake_case, non_upper_case_globals, non_camel_case_types, dead_code, clippy::all)]
::windows_targets::link!("api-ms-win-core-winrt-error-l1-1-0.dll" "system" fn RoOriginateError(error : HRESULT, message : * mut::core::ffi::c_void) -> BOOL);
::windows_targets::link!("api-ms-win-core-winrt-l1-1-0.dll" "system" fn RoGetActivationFactory(activatableclassid : * mut::core::ffi::c_void, iid : *const GUID, factory : *mut *mut ::core::ffi::c_void) -> HRESULT);
::windows_targets::link!("kernel32.dll" "system" fn CloseHandle(hobject : HANDLE) -> BOOL);
::windows_targets::link!("kernel32.dll" "system" fn CreateEventW(lpeventattributes : *const SECURITY_ATTRIBUTES, bmanualreset : BOOL, binitialstate : BOOL, lpname : PCWSTR) -> HANDLE);
::windows_targets::link!("kernel32.dll" "system" fn EncodePointer(ptr : *const ::core::ffi::c_void) -> *mut ::core::ffi::c_void);
::windows_targets::link!("kernel32.dll" "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);
::windows_targets::link!("kernel32.dll" "system" fn FreeLibrary(hlibmodule : HMODULE) -> BOOL);
::windows_targets::link!("kernel32.dll" "system" fn GetLastError() -> WIN32_ERROR);
::windows_targets::link!("kernel32.dll" "system" fn GetProcAddress(hmodule : HMODULE, lpprocname : PCSTR) -> FARPROC);
::windows_targets::link!("kernel32.dll" "system" fn GetProcessHeap() -> HANDLE);
::windows_targets::link!("kernel32.dll" "system" fn HeapAlloc(hheap : HANDLE, dwflags : HEAP_FLAGS, dwbytes : usize) -> *mut ::core::ffi::c_void);
Expand All @@ -21,8 +18,6 @@
::windows_targets::link!("ole32.dll" "system" fn CoTaskMemFree(pv : *const ::core::ffi::c_void));
::windows_targets::link!("ole32.dll" "system" fn PropVariantClear(pvar : *mut PROPVARIANT) -> HRESULT);
::windows_targets::link!("ole32.dll" "system" fn PropVariantCopy(pvardest : *mut PROPVARIANT, pvarsrc : *const PROPVARIANT) -> HRESULT);
::windows_targets::link!("oleaut32.dll" "system" fn GetErrorInfo(dwreserved : u32, pperrinfo : *mut * mut::core::ffi::c_void) -> HRESULT);
::windows_targets::link!("oleaut32.dll" "system" fn SetErrorInfo(dwreserved : u32, perrinfo : * mut::core::ffi::c_void) -> HRESULT);
::windows_targets::link!("oleaut32.dll" "system" fn SysAllocStringLen(strin : PCWSTR, ui : u32) -> BSTR);
::windows_targets::link!("oleaut32.dll" "system" fn SysFreeString(bstrstring : BSTR));
::windows_targets::link!("oleaut32.dll" "system" fn SysStringLen(pbstr : BSTR) -> u32);
Expand Down Expand Up @@ -469,7 +464,6 @@ impl ::core::clone::Clone for ELEMDESC_0 {
*self
}
}
pub const ERROR_NO_UNICODE_TRANSLATION: WIN32_ERROR = 1113u32;
#[repr(C)]
pub struct EXCEPINFO {
pub wCode: u16,
Expand Down Expand Up @@ -500,10 +494,6 @@ impl ::core::clone::Clone for FILETIME {
*self
}
}
pub const FORMAT_MESSAGE_ALLOCATE_BUFFER: FORMAT_MESSAGE_OPTIONS = 256u32;
pub const FORMAT_MESSAGE_FROM_SYSTEM: FORMAT_MESSAGE_OPTIONS = 4096u32;
pub const FORMAT_MESSAGE_IGNORE_INSERTS: FORMAT_MESSAGE_OPTIONS = 512u32;
pub type FORMAT_MESSAGE_OPTIONS = u32;
#[repr(C)]
pub struct FUNCDESC {
pub memid: i32,
Expand Down Expand Up @@ -996,4 +986,3 @@ pub const VT_UI4: VARENUM = 19u16;
pub const VT_UI8: VARENUM = 21u16;
pub const VT_UNKNOWN: VARENUM = 13u16;
pub type WAIT_EVENT = u32;
pub type WIN32_ERROR = u32;
Loading