Skip to content

Commit

Permalink
0.4.0 - update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
zdimension committed Feb 2, 2024
1 parent 53bc032 commit 11b2c95
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 18 deletions.
16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "variant-rs"
description = "VARIANT support for Rust. Clean, idiomatic handling of WinAPI/COM results."
version = "0.3.1"
version = "0.4.0"
edition = "2021"
license = "MIT"
authors = ["Tom Niget <niget.tom@gmail.com>"]
Expand All @@ -10,13 +10,13 @@ categories = ["data-structures"]
keywords = ["com", "windows", "variant", "winapi"]

[dependencies]
chrono = "0.4.24"
enumn = "0.1.8"
paste = "1.0.12"
rust_decimal = "1.29.1"
thiserror = "1.0.40"
chrono = "0.4.33"
enumn = "0.1.13"
paste = "1.0.14"
rust_decimal = "1.34.2"
thiserror = "1.0.56"
widestring = "1.0.2"
windows = { version = "0.48.0", features = ["Win32_Foundation", "Win32_System_Com", "Win32_System_Ole"] }
windows = { version = "0.52.0", features = ["Win32_Foundation", "Win32_System_Com", "Win32_System_Ole", "Win32_System_Variant"] }

[dev-dependencies]
rust_decimal_macros = "1.29.1"
rust_decimal_macros = "1.34.2"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Safe wrapper around COM interface pointers.
Add this to your `Cargo.toml`:
```toml
[dependencies]
variant-rs = "0.3.1"
variant-rs = "0.4.0"
```

## License
Expand Down
4 changes: 2 additions & 2 deletions src/com_types/bool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ impl From<&mut i16> for &'static mut ComBool {
}
}

impl From<&VARIANT_BOOL> for &'static mut ComBool {
fn from(value: &VARIANT_BOOL) -> &'static mut ComBool {
impl From<&mut VARIANT_BOOL> for &'static mut ComBool {
fn from(value: &mut VARIANT_BOOL) -> &'static mut ComBool {
unsafe { &mut *(value as *const VARIANT_BOOL as *mut ComBool) }
}
}
Expand Down
14 changes: 11 additions & 3 deletions src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::mem::ManuallyDrop;
use thiserror::Error;
use windows::core::HRESULT;
use windows::Win32::Foundation::VARIANT_BOOL;
use windows::Win32::System::Com::{VARENUM, VARIANT};
use windows::Win32::System::Variant::{VARENUM, VARIANT};

#[derive(Debug, PartialEq, Eq, Error)]
pub enum VariantConversionError {
Expand Down Expand Up @@ -186,8 +186,16 @@ impl TryInto<VARIANT> for Variant {
Empty => Ok(variant!(VT_EMPTY)),
Null => Ok(variant!(VT_NULL)),

Bool(b) => Ok(variant!(VT_BOOL, boolVal, VARIANT_BOOL(ComBool::from(b) as i16))),
BoolRef(b) => Ok(variant!(VT_BOOL, pboolVal, b as *mut ComBool as *mut VARIANT_BOOL)),
Bool(b) => Ok(variant!(
VT_BOOL,
boolVal,
VARIANT_BOOL(ComBool::from(b) as i16)
)),
BoolRef(b) => Ok(variant!(
VT_BOOL,
pboolVal,
b as *mut ComBool as *mut VARIANT_BOOL
)),

I8(i) => Ok(variant!(VT_I1, cVal, i as u8)),
I8Ref(i) => Ok(variant!(VT_I1.byref(), pcVal, i)),
Expand Down
3 changes: 2 additions & 1 deletion src/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ use windows::core::{Error as WinError, GUID, PCWSTR};
use windows::Win32::Foundation::{DISP_E_EXCEPTION, DISP_E_PARAMNOTFOUND, DISP_E_TYPEMISMATCH};
use windows::Win32::System::Com::{
IDispatch, DISPATCH_FLAGS, DISPATCH_METHOD, DISPATCH_PROPERTYGET, DISPATCH_PROPERTYPUT,
DISPPARAMS, EXCEPINFO, VARIANT,
DISPPARAMS, EXCEPINFO,
};
use windows::Win32::System::Ole::DISPID_PROPERTYPUT;
use windows::Win32::System::Variant::VARIANT;

pub trait IDispatchExt {
fn get(&self, name: &str) -> Result<Variant, IDispatchError>;
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::com_types::bool::ComBool;
use crate::com_types::ptr_wrapper::PtrWrapper;
pub use crate::variant::*;

pub use windows::Win32::System::Com::{VARENUM, VARIANT};
pub use windows::Win32::System::Variant::{VARENUM, VARIANT};

pub mod com_types;
pub mod convert;
Expand Down Expand Up @@ -50,7 +50,7 @@ mod tests {
use windows::core::BSTR;
use windows::Win32::Foundation::{DECIMAL, DECIMAL_0, DECIMAL_0_0, DECIMAL_1, VARIANT_BOOL};
use windows::Win32::System::Com::CY;
use windows::Win32::System::Com::{VARENUM, VARIANT};
use windows::Win32::System::Variant::{VARENUM, VARIANT};

macro_rules! roundtrip
{
Expand Down
2 changes: 1 addition & 1 deletion src/variant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use windows::core::IUnknown;
use windows::core::HRESULT;
use windows::core::{BSTR, PSTR};
use windows::Win32::System::Com::IDispatch;
use windows::Win32::System::Com::VARIANT;
use windows::Win32::System::Variant::VARIANT;

macro_rules! variant_enum {
(@impl $name:ident) => {};
Expand Down

0 comments on commit 11b2c95

Please sign in to comment.