diff --git a/Cargo.toml b/Cargo.toml index e5c40d2bd3..c689a71215 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,5 +11,7 @@ members = [ "crates/tests/debug", "crates/tests/enums", "crates/tests/sys", + "crates/tests/handles", + "crates/tests/agile", ] exclude = ["crates/tests/component"] diff --git a/crates/libs/bindgen/src/handles.rs b/crates/libs/bindgen/src/handles.rs new file mode 100644 index 0000000000..b919472bae --- /dev/null +++ b/crates/libs/bindgen/src/handles.rs @@ -0,0 +1,88 @@ +use super::*; + +pub fn gen(def: &TypeDef, gen: &Gen) -> TokenStream { + if gen.sys { + gen_sys_handle(def, gen) + } else { + gen_win_handle(def, gen) + } +} + +pub fn gen_sys_handle(def: &TypeDef, gen: &Gen) -> TokenStream { + let ident = gen_ident(def.name()); + let signature = gen_signature(def, gen); + + quote! { + pub type #ident = #signature; + } +} + +pub fn gen_win_handle(def: &TypeDef, gen: &Gen) -> TokenStream { + let name = def.name(); + let ident = gen_ident(def.name()); + let signature = gen_signature(def, gen); + + let mut tokens = quote! { + #[repr(transparent)] + // Unfortunately, Rust requires these to be derived to allow constant patterns. + #[derive(::core::cmp::PartialEq, ::core::cmp::Eq)] + pub struct #ident(pub #signature); + impl #ident { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } + } + impl ::core::default::Default for #ident { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } + } + impl ::core::clone::Clone for #ident { + fn clone(&self) -> Self { + *self + } + } + impl ::core::marker::Copy for #ident {} + impl ::core::fmt::Debug for #ident { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple(#name).field(&self.0).finish() + } + } + unsafe impl ::windows::core::Abi for #ident { + type Abi = Self; + } + }; + + if let Some(dependency) = def.is_convertible_to() { + let type_name = dependency.type_name(); + let mut dependency = gen.namespace(type_name.namespace()); + dependency.push_str(type_name.name()); + + tokens.combine("e! { + impl<'a> ::windows::core::IntoParam<'a, #dependency> for #ident { + fn into_param(self) -> ::windows::core::Param<'a, #dependency> { + ::windows::core::Param::Owned(#dependency(self.0)) + } + } + }); + } + + tokens +} + +fn gen_signature(def: &TypeDef, gen: &Gen) -> TokenStream { + if def.type_name() == TypeName::HANDLE { + quote! { *mut ::core::ffi::c_void } + } else { + let signature = def.fields().next().map(|field| field.signature(Some(def))).unwrap(); + gen_sig(&signature, gen) + } +} diff --git a/crates/libs/bindgen/src/interfaces.rs b/crates/libs/bindgen/src/interfaces.rs index 3b2e96827e..6fd0ac68fd 100644 --- a/crates/libs/bindgen/src/interfaces.rs +++ b/crates/libs/bindgen/src/interfaces.rs @@ -181,11 +181,12 @@ fn gen_conversions(def: &TypeDef, cfg: &Cfg, gen: &Gen) -> TokenStream { } fn gen_agile(def: &TypeDef, gen: &Gen) -> TokenStream { - if def.type_name() == TypeName::IRestrictedErrorInfo { + if def.type_name() == TypeName::IRestrictedErrorInfo || def.async_kind() != AsyncKind::None { let name = gen_type_ident(def, gen); + let constraints = gen_type_constraints(def, gen); quote! { - unsafe impl ::core::marker::Send for #name {} - unsafe impl ::core::marker::Sync for #name {} + unsafe impl<#(#constraints)*> ::core::marker::Send for #name {} + unsafe impl<#(#constraints)*> ::core::marker::Sync for #name {} } } else { TokenStream::new() diff --git a/crates/libs/bindgen/src/lib.rs b/crates/libs/bindgen/src/lib.rs index f6d88764a2..48d54d947d 100644 --- a/crates/libs/bindgen/src/lib.rs +++ b/crates/libs/bindgen/src/lib.rs @@ -8,6 +8,7 @@ mod enums; mod extensions; mod functions; mod gen; +mod handles; mod helpers; mod interfaces; mod iterator; diff --git a/crates/libs/bindgen/src/structs.rs b/crates/libs/bindgen/src/structs.rs index 9cc841e40b..009f6aa0e9 100644 --- a/crates/libs/bindgen/src/structs.rs +++ b/crates/libs/bindgen/src/structs.rs @@ -5,31 +5,22 @@ pub fn gen(def: &TypeDef, gen: &Gen) -> TokenStream { return quote! {}; } - gen_struct_with_name(def, def.name(), &Cfg::new(), gen) -} - -fn gen_struct_with_name(def: &TypeDef, struct_name: &str, cfg: &Cfg, gen: &Gen) -> TokenStream { if !gen.sys { if let Some(replacement) = replacements::gen(def) { return replacement; } } - let name = gen_ident(struct_name); - if def.is_handle() { - let signature = if def.type_name() == TypeName::HANDLE { - quote! { *mut ::core::ffi::c_void } - } else { - let signature = def.fields().next().map(|field| field.signature(Some(def))).unwrap(); - gen_sig(&signature, gen) - }; - - return quote! { - pub type #name = #signature; - }; + return handles::gen(def, gen); } + gen_struct_with_name(def, def.name(), &Cfg::new(), gen) +} + +fn gen_struct_with_name(def: &TypeDef, struct_name: &str, cfg: &Cfg, gen: &Gen) -> TokenStream { + let name = gen_ident(struct_name); + if def.fields().next().is_none() { if let Some(guid) = GUID::from_attributes(def.attributes()) { let value = gen_guid(&guid, gen); diff --git a/crates/libs/quote/src/token_stream.rs b/crates/libs/quote/src/token_stream.rs index 5269b43e98..c0bfbc0b30 100644 --- a/crates/libs/quote/src/token_stream.rs +++ b/crates/libs/quote/src/token_stream.rs @@ -33,6 +33,7 @@ impl TokenStream { self.0.push_str(&other.0) } + #[must_use] pub fn join(&self, value: &str) -> Self { Self(format!("{}{}", self.0, value)) } diff --git a/crates/libs/reader/src/constant_value.rs b/crates/libs/reader/src/constant_value.rs index 046d7f8eac..f5c84d5451 100644 --- a/crates/libs/reader/src/constant_value.rs +++ b/crates/libs/reader/src/constant_value.rs @@ -45,6 +45,7 @@ impl ConstantValue { } } + #[must_use] pub fn next(&self) -> Self { match self { Self::U32(value) => Self::U32(value + 1), diff --git a/crates/libs/reader/src/element_type.rs b/crates/libs/reader/src/element_type.rs index 651c88e944..6155fe2c49 100644 --- a/crates/libs/reader/src/element_type.rs +++ b/crates/libs/reader/src/element_type.rs @@ -232,6 +232,7 @@ impl ElementType { } } + #[must_use] pub fn underlying_type(&self) -> ElementType { match self { Self::TypeDef(def) => def.underlying_type(), @@ -243,7 +244,7 @@ impl ElementType { pub fn has_replacement(&self) -> bool { match self { Self::HRESULT => true, - Self::TypeDef(def) => matches!(def.type_name(), TypeName::BOOL | TypeName::BSTR | TypeName::HANDLE | TypeName::NTSTATUS | TypeName::PSTR | TypeName::PWSTR), + Self::TypeDef(def) => def.is_handle(), _ => false, } } diff --git a/crates/libs/reader/src/tables/type_def.rs b/crates/libs/reader/src/tables/type_def.rs index 58064005d1..175b71f016 100644 --- a/crates/libs/reader/src/tables/type_def.rs +++ b/crates/libs/reader/src/tables/type_def.rs @@ -14,6 +14,7 @@ impl From for TypeDef { } impl TypeDef { + #[must_use] pub fn with_generics(mut self) -> Self { self.generics = self.generic_params().map(|generic| ElementType::GenericParam(generic.name().to_string())).collect(); self diff --git a/crates/libs/windows/src/Windows/Foundation/mod.rs b/crates/libs/windows/src/Windows/Foundation/mod.rs index f40c7ca0ce..696d7f8c28 100644 --- a/crates/libs/windows/src/Windows/Foundation/mod.rs +++ b/crates/libs/windows/src/Windows/Foundation/mod.rs @@ -1119,6 +1119,8 @@ impl ::std::future::Future for IAsyncAction { } } } +unsafe impl ::core::marker::Send for IAsyncAction {} +unsafe impl ::core::marker::Sync for IAsyncAction {} unsafe impl ::windows::core::Interface for IAsyncAction { type Vtable = IAsyncActionVtbl; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x5a648006_843a_4da9_865b_9d26e5dfad7b); @@ -1320,6 +1322,8 @@ impl ::std::future::Future fo } } } +unsafe impl ::core::marker::Send for IAsyncActionWithProgress {} +unsafe impl ::core::marker::Sync for IAsyncActionWithProgress {} unsafe impl ::windows::core::Interface for IAsyncActionWithProgress { type Vtable = IAsyncActionWithProgressVtbl; const IID: ::windows::core::GUID = ::windows::core::GUID::from_signature(::SIGNATURE); @@ -1633,6 +1637,8 @@ impl ::std::future::Future for } } } +unsafe impl ::core::marker::Send for IAsyncOperation {} +unsafe impl ::core::marker::Sync for IAsyncOperation {} unsafe impl ::windows::core::Interface for IAsyncOperation { type Vtable = IAsyncOperationVtbl; const IID: ::windows::core::GUID = ::windows::core::GUID::from_signature(::SIGNATURE); @@ -1841,6 +1847,8 @@ impl ::core::marker::Send for IAsyncOperationWithProgress {} +unsafe impl ::core::marker::Sync for IAsyncOperationWithProgress {} unsafe impl ::windows::core::Interface for IAsyncOperationWithProgress { type Vtable = IAsyncOperationWithProgressVtbl; const IID: ::windows::core::GUID = ::windows::core::GUID::from_signature(::SIGNATURE); diff --git a/crates/libs/windows/src/Windows/Win32/Devices/AllJoyn/mod.rs b/crates/libs/windows/src/Windows/Win32/Devices/AllJoyn/mod.rs index efd9899ec7..313a92d130 100644 --- a/crates/libs/windows/src/Windows/Win32/Devices/AllJoyn/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Devices/AllJoyn/mod.rs @@ -1015,7 +1015,40 @@ pub type alljoyn_about_announceflag = i32; pub const UNANNOUNCED: alljoyn_about_announceflag = 0i32; #[doc = "*Required features: 'Win32_Devices_AllJoyn'*"] pub const ANNOUNCED: alljoyn_about_announceflag = 1i32; -pub type alljoyn_aboutdata = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_aboutdata(pub isize); +impl alljoyn_aboutdata { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_aboutdata { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_aboutdata { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_aboutdata {} +impl ::core::fmt::Debug for alljoyn_aboutdata { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_aboutdata").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_aboutdata { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Devices_AllJoyn', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] #[inline] @@ -1661,7 +1694,40 @@ pub unsafe fn alljoyn_aboutdata_setsupporturl<'a, Param0: ::windows::core::IntoP #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type alljoyn_aboutdatalistener = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_aboutdatalistener(pub isize); +impl alljoyn_aboutdatalistener { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_aboutdatalistener { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_aboutdatalistener { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_aboutdatalistener {} +impl ::core::fmt::Debug for alljoyn_aboutdatalistener { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_aboutdatalistener").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_aboutdatalistener { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_Devices_AllJoyn', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] @@ -1934,7 +2000,40 @@ pub unsafe fn alljoyn_abouticonproxy_getversion(proxy: *mut _alljoyn_abouticonpr #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type alljoyn_aboutlistener = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_aboutlistener(pub isize); +impl alljoyn_aboutlistener { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_aboutlistener { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_aboutlistener { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_aboutlistener {} +impl ::core::fmt::Debug for alljoyn_aboutlistener { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_aboutlistener").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_aboutlistener { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_Devices_AllJoyn', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] @@ -2002,7 +2101,40 @@ pub unsafe fn alljoyn_aboutlistener_destroy<'a, Param0: ::windows::core::IntoPar #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type alljoyn_aboutobj = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_aboutobj(pub isize); +impl alljoyn_aboutobj { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_aboutobj { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_aboutobj { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_aboutobj {} +impl ::core::fmt::Debug for alljoyn_aboutobj { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_aboutobj").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_aboutobj { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Devices_AllJoyn'*"] #[inline] pub unsafe fn alljoyn_aboutobj_announce<'a, Param0: ::windows::core::IntoParam<'a, alljoyn_aboutobj>, Param2: ::windows::core::IntoParam<'a, alljoyn_aboutdata>>(obj: Param0, sessionport: u16, aboutdata: Param2) -> QStatus { @@ -2073,7 +2205,40 @@ pub unsafe fn alljoyn_aboutobj_unannounce<'a, Param0: ::windows::core::IntoParam #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type alljoyn_aboutobjectdescription = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_aboutobjectdescription(pub isize); +impl alljoyn_aboutobjectdescription { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_aboutobjectdescription { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_aboutobjectdescription { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_aboutobjectdescription {} +impl ::core::fmt::Debug for alljoyn_aboutobjectdescription { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_aboutobjectdescription").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_aboutobjectdescription { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Devices_AllJoyn'*"] #[inline] pub unsafe fn alljoyn_aboutobjectdescription_clear<'a, Param0: ::windows::core::IntoParam<'a, alljoyn_aboutobjectdescription>>(description: Param0) { @@ -2247,7 +2412,40 @@ pub unsafe fn alljoyn_aboutobjectdescription_haspath<'a, Param0: ::windows::core #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type alljoyn_aboutproxy = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_aboutproxy(pub isize); +impl alljoyn_aboutproxy { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_aboutproxy { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_aboutproxy { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_aboutproxy {} +impl ::core::fmt::Debug for alljoyn_aboutproxy { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_aboutproxy").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_aboutproxy { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Devices_AllJoyn', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] #[inline] @@ -2330,7 +2528,40 @@ pub const CLAIMABLE: alljoyn_applicationstate = 1i32; pub const CLAIMED: alljoyn_applicationstate = 2i32; #[doc = "*Required features: 'Win32_Devices_AllJoyn'*"] pub const NEED_UPDATE: alljoyn_applicationstate = 3i32; -pub type alljoyn_applicationstatelistener = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_applicationstatelistener(pub isize); +impl alljoyn_applicationstatelistener { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_applicationstatelistener { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_applicationstatelistener { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_applicationstatelistener {} +impl ::core::fmt::Debug for alljoyn_applicationstatelistener { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_applicationstatelistener").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_applicationstatelistener { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_Devices_AllJoyn'*"] pub struct alljoyn_applicationstatelistener_callbacks { @@ -2391,7 +2622,40 @@ pub unsafe fn alljoyn_applicationstatelistener_destroy<'a, Param0: ::windows::co } #[doc = "*Required features: 'Win32_Devices_AllJoyn'*"] pub type alljoyn_applicationstatelistener_state_ptr = ::core::option::Option; -pub type alljoyn_authlistener = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_authlistener(pub isize); +impl alljoyn_authlistener { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_authlistener { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_authlistener { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_authlistener {} +impl ::core::fmt::Debug for alljoyn_authlistener { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_authlistener").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_authlistener { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Devices_AllJoyn', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] pub type alljoyn_authlistener_authenticationcomplete_ptr = ::core::option::Option; @@ -2591,7 +2855,40 @@ pub unsafe fn alljoyn_authlistenerasync_destroy<'a, Param0: ::windows::core::Int #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type alljoyn_autopinger = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_autopinger(pub isize); +impl alljoyn_autopinger { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_autopinger { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_autopinger { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_autopinger {} +impl ::core::fmt::Debug for alljoyn_autopinger { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_autopinger").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_autopinger { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Devices_AllJoyn', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] #[inline] @@ -2729,7 +3026,40 @@ pub unsafe fn alljoyn_autopinger_setpinginterval<'a, Param0: ::windows::core::In #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type alljoyn_busattachment = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_busattachment(pub isize); +impl alljoyn_busattachment { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_busattachment { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_busattachment { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_busattachment {} +impl ::core::fmt::Debug for alljoyn_busattachment { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_busattachment").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_busattachment { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Devices_AllJoyn', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] #[inline] @@ -3925,7 +4255,40 @@ pub unsafe fn alljoyn_busattachment_whoimplements_interfaces<'a, Param0: ::windo #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type alljoyn_buslistener = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_buslistener(pub isize); +impl alljoyn_buslistener { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_buslistener { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_buslistener { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_buslistener {} +impl ::core::fmt::Debug for alljoyn_buslistener { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_buslistener").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_buslistener { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Devices_AllJoyn'*"] pub type alljoyn_buslistener_bus_disconnected_ptr = ::core::option::Option; #[doc = "*Required features: 'Win32_Devices_AllJoyn', 'Win32_Foundation'*"] @@ -4029,7 +4392,40 @@ pub type alljoyn_buslistener_lost_advertised_name_ptr = ::core::option::Option; -pub type alljoyn_busobject = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_busobject(pub isize); +impl alljoyn_busobject { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_busobject { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_busobject { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_busobject {} +impl ::core::fmt::Debug for alljoyn_busobject { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_busobject").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_busobject { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Devices_AllJoyn'*"] #[inline] pub unsafe fn alljoyn_busobject_addinterface<'a, Param0: ::windows::core::IntoParam<'a, alljoyn_busobject>, Param1: ::windows::core::IntoParam<'a, alljoyn_interfacedescription>>(bus: Param0, iface: Param1) -> QStatus { @@ -4486,7 +4882,40 @@ pub type alljoyn_claimcapabilityadditionalinfo_masks = i32; pub const PASSWORD_GENERATED_BY_SECURITY_MANAGER: alljoyn_claimcapabilityadditionalinfo_masks = 1i32; #[doc = "*Required features: 'Win32_Devices_AllJoyn'*"] pub const PASSWORD_GENERATED_BY_APPLICATION: alljoyn_claimcapabilityadditionalinfo_masks = 2i32; -pub type alljoyn_credentials = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_credentials(pub isize); +impl alljoyn_credentials { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_credentials { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_credentials { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_credentials {} +impl ::core::fmt::Debug for alljoyn_credentials { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_credentials").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_credentials { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Devices_AllJoyn'*"] #[inline] pub unsafe fn alljoyn_credentials_clear<'a, Param0: ::windows::core::IntoParam<'a, alljoyn_credentials>>(cred: Param0) { @@ -4779,7 +5208,40 @@ pub unsafe fn alljoyn_init() -> QStatus { #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type alljoyn_interfacedescription = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_interfacedescription(pub isize); +impl alljoyn_interfacedescription { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_interfacedescription { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_interfacedescription { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_interfacedescription {} +impl ::core::fmt::Debug for alljoyn_interfacedescription { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_interfacedescription").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_interfacedescription { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Devices_AllJoyn'*"] #[inline] pub unsafe fn alljoyn_interfacedescription_activate<'a, Param0: ::windows::core::IntoParam<'a, alljoyn_interfacedescription>>(iface: Param0) { @@ -5738,8 +6200,74 @@ pub unsafe fn alljoyn_interfacedescription_setpropertydescriptionforlanguage<'a, #[doc = "*Required features: 'Win32_Devices_AllJoyn', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] pub type alljoyn_interfacedescription_translation_callback_ptr = ::core::option::Option super::super::Foundation::PSTR>; -pub type alljoyn_keystore = isize; -pub type alljoyn_keystorelistener = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_keystore(pub isize); +impl alljoyn_keystore { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_keystore { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_keystore { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_keystore {} +impl ::core::fmt::Debug for alljoyn_keystore { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_keystore").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_keystore { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_keystorelistener(pub isize); +impl alljoyn_keystorelistener { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_keystorelistener { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_keystorelistener { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_keystorelistener {} +impl ::core::fmt::Debug for alljoyn_keystorelistener { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_keystorelistener").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_keystorelistener { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Devices_AllJoyn'*"] pub type alljoyn_keystorelistener_acquireexclusivelock_ptr = ::core::option::Option QStatus>; #[repr(C)] @@ -5915,7 +6443,40 @@ impl ::core::default::Default for alljoyn_manifestarray { unsafe { ::core::mem::zeroed() } } } -pub type alljoyn_message = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_message(pub isize); +impl alljoyn_message { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_message { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_message { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_message {} +impl ::core::fmt::Debug for alljoyn_message { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_message").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_message { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Devices_AllJoyn'*"] #[inline] pub unsafe fn alljoyn_message_create<'a, Param0: ::windows::core::IntoParam<'a, alljoyn_busattachment>>(bus: Param0) -> alljoyn_message { @@ -6382,7 +6943,40 @@ pub const ALLJOYN_MESSAGE_METHOD_RET: alljoyn_messagetype = 2i32; pub const ALLJOYN_MESSAGE_ERROR: alljoyn_messagetype = 3i32; #[doc = "*Required features: 'Win32_Devices_AllJoyn'*"] pub const ALLJOYN_MESSAGE_SIGNAL: alljoyn_messagetype = 4i32; -pub type alljoyn_msgarg = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_msgarg(pub isize); +impl alljoyn_msgarg { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_msgarg { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_msgarg { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_msgarg {} +impl ::core::fmt::Debug for alljoyn_msgarg { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_msgarg").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_msgarg { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Devices_AllJoyn'*"] #[inline] pub unsafe fn alljoyn_msgarg_array_create(size: usize) -> alljoyn_msgarg { @@ -7507,7 +8101,40 @@ pub unsafe fn alljoyn_msgarg_tostring<'a, Param0: ::windows::core::IntoParam<'a, #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type alljoyn_observer = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_observer(pub isize); +impl alljoyn_observer { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_observer { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_observer { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_observer {} +impl ::core::fmt::Debug for alljoyn_observer { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_observer").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_observer { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Devices_AllJoyn'*"] #[inline] pub unsafe fn alljoyn_observer_create<'a, Param0: ::windows::core::IntoParam<'a, alljoyn_busattachment>>(bus: Param0, mandatoryinterfaces: *const *const i8, nummandatoryinterfaces: usize) -> alljoyn_observer { @@ -7625,7 +8252,40 @@ pub unsafe fn alljoyn_observer_unregisterlistener<'a, Param0: ::windows::core::I #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type alljoyn_observerlistener = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_observerlistener(pub isize); +impl alljoyn_observerlistener { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_observerlistener { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_observerlistener { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_observerlistener {} +impl ::core::fmt::Debug for alljoyn_observerlistener { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_observerlistener").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_observerlistener { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_Devices_AllJoyn'*"] pub struct alljoyn_observerlistener_callback { @@ -7700,7 +8360,40 @@ pub unsafe fn alljoyn_passwordmanager_setcredentials<'a, Param0: ::windows::core #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type alljoyn_permissionconfigurationlistener = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_permissionconfigurationlistener(pub isize); +impl alljoyn_permissionconfigurationlistener { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_permissionconfigurationlistener { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_permissionconfigurationlistener { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_permissionconfigurationlistener {} +impl ::core::fmt::Debug for alljoyn_permissionconfigurationlistener { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_permissionconfigurationlistener").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_permissionconfigurationlistener { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_Devices_AllJoyn'*"] pub struct alljoyn_permissionconfigurationlistener_callbacks { @@ -7770,7 +8463,40 @@ pub type alljoyn_permissionconfigurationlistener_factoryreset_ptr = ::core::opti pub type alljoyn_permissionconfigurationlistener_policychanged_ptr = ::core::option::Option; #[doc = "*Required features: 'Win32_Devices_AllJoyn'*"] pub type alljoyn_permissionconfigurationlistener_startmanagement_ptr = ::core::option::Option; -pub type alljoyn_permissionconfigurator = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_permissionconfigurator(pub isize); +impl alljoyn_permissionconfigurator { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_permissionconfigurator { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_permissionconfigurator { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_permissionconfigurator {} +impl ::core::fmt::Debug for alljoyn_permissionconfigurator { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_permissionconfigurator").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_permissionconfigurator { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Devices_AllJoyn'*"] #[inline] pub unsafe fn alljoyn_permissionconfigurator_certificatechain_destroy(certificatechain: *mut i8) { @@ -8233,7 +8959,40 @@ pub unsafe fn alljoyn_permissionconfigurator_updatepolicy<'a, Param0: ::windows: #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type alljoyn_pinglistener = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_pinglistener(pub isize); +impl alljoyn_pinglistener { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_pinglistener { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_pinglistener { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_pinglistener {} +impl ::core::fmt::Debug for alljoyn_pinglistener { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_pinglistener").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_pinglistener { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_Devices_AllJoyn', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] @@ -8302,7 +9061,40 @@ pub unsafe fn alljoyn_pinglistener_destroy<'a, Param0: ::windows::core::IntoPara #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type alljoyn_proxybusobject = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_proxybusobject(pub isize); +impl alljoyn_proxybusobject { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_proxybusobject { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_proxybusobject { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_proxybusobject {} +impl ::core::fmt::Debug for alljoyn_proxybusobject { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_proxybusobject").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_proxybusobject { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Devices_AllJoyn'*"] #[inline] pub unsafe fn alljoyn_proxybusobject_addchild<'a, Param0: ::windows::core::IntoParam<'a, alljoyn_proxybusobject>, Param1: ::windows::core::IntoParam<'a, alljoyn_proxybusobject>>(proxyobj: Param0, child: Param1) -> QStatus { @@ -8782,7 +9574,40 @@ pub unsafe fn alljoyn_proxybusobject_parsexml<'a, Param0: ::windows::core::IntoP #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type alljoyn_proxybusobject_ref = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_proxybusobject_ref(pub isize); +impl alljoyn_proxybusobject_ref { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_proxybusobject_ref { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_proxybusobject_ref { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_proxybusobject_ref {} +impl ::core::fmt::Debug for alljoyn_proxybusobject_ref { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_proxybusobject_ref").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_proxybusobject_ref { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Devices_AllJoyn'*"] #[inline] pub unsafe fn alljoyn_proxybusobject_ref_create<'a, Param0: ::windows::core::IntoParam<'a, alljoyn_proxybusobject>>(proxy: Param0) -> alljoyn_proxybusobject_ref { @@ -8984,7 +9809,40 @@ pub unsafe fn alljoyn_routershutdown() -> QStatus { #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type alljoyn_securityapplicationproxy = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_securityapplicationproxy(pub isize); +impl alljoyn_securityapplicationproxy { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_securityapplicationproxy { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_securityapplicationproxy { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_securityapplicationproxy {} +impl ::core::fmt::Debug for alljoyn_securityapplicationproxy { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_securityapplicationproxy").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_securityapplicationproxy { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Devices_AllJoyn'*"] #[inline] pub unsafe fn alljoyn_securityapplicationproxy_claim<'a, Param0: ::windows::core::IntoParam<'a, alljoyn_securityapplicationproxy>>(proxy: Param0, cakey: *mut i8, identitycertificatechain: *mut i8, groupid: *const u8, groupsize: usize, groupauthority: *mut i8, manifestsxmls: *mut *mut i8, manifestscount: usize) -> QStatus { @@ -9349,7 +10207,40 @@ pub unsafe fn alljoyn_securityapplicationproxy_updatepolicy<'a, Param0: ::window #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type alljoyn_sessionlistener = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_sessionlistener(pub isize); +impl alljoyn_sessionlistener { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_sessionlistener { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_sessionlistener { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_sessionlistener {} +impl ::core::fmt::Debug for alljoyn_sessionlistener { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_sessionlistener").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_sessionlistener { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_Devices_AllJoyn', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] @@ -9441,7 +10332,40 @@ pub const ALLJOYN_SESSIONLOST_REMOVED_BY_BINDER: alljoyn_sessionlostreason = 3i3 pub const ALLJOYN_SESSIONLOST_LINK_TIMEOUT: alljoyn_sessionlostreason = 4i32; #[doc = "*Required features: 'Win32_Devices_AllJoyn'*"] pub const ALLJOYN_SESSIONLOST_REASON_OTHER: alljoyn_sessionlostreason = 5i32; -pub type alljoyn_sessionopts = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_sessionopts(pub isize); +impl alljoyn_sessionopts { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_sessionopts { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_sessionopts { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_sessionopts {} +impl ::core::fmt::Debug for alljoyn_sessionopts { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_sessionopts").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_sessionopts { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Devices_AllJoyn'*"] #[inline] pub unsafe fn alljoyn_sessionopts_cmp<'a, Param0: ::windows::core::IntoParam<'a, alljoyn_sessionopts>, Param1: ::windows::core::IntoParam<'a, alljoyn_sessionopts>>(one: Param0, other: Param1) -> i32 { @@ -9610,7 +10534,40 @@ pub unsafe fn alljoyn_sessionopts_set_transports<'a, Param0: ::windows::core::In #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type alljoyn_sessionportlistener = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct alljoyn_sessionportlistener(pub isize); +impl alljoyn_sessionportlistener { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for alljoyn_sessionportlistener { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for alljoyn_sessionportlistener { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for alljoyn_sessionportlistener {} +impl ::core::fmt::Debug for alljoyn_sessionportlistener { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("alljoyn_sessionportlistener").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for alljoyn_sessionportlistener { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Devices_AllJoyn', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] pub type alljoyn_sessionportlistener_acceptsessionjoiner_ptr = ::core::option::Option i32>; diff --git a/crates/libs/windows/src/Windows/Win32/Devices/Bluetooth/mod.rs b/crates/libs/windows/src/Windows/Win32/Devices/Bluetooth/mod.rs index 9dc4399908..923557165b 100644 --- a/crates/libs/windows/src/Windows/Win32/Devices/Bluetooth/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Devices/Bluetooth/mod.rs @@ -2488,7 +2488,40 @@ pub const GenericFileTransferServiceClassID_UUID16: u32 = 4610u32; pub const GenericNetworkingServiceClassID_UUID16: u32 = 4609u32; #[doc = "*Required features: 'Win32_Devices_Bluetooth'*"] pub const GenericTelephonyServiceClassID_UUID16: u32 = 4612u32; -pub type HANDLE_SDP_TYPE = u64; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HANDLE_SDP_TYPE(pub u64); +impl HANDLE_SDP_TYPE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HANDLE_SDP_TYPE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HANDLE_SDP_TYPE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HANDLE_SDP_TYPE {} +impl ::core::fmt::Debug for HANDLE_SDP_TYPE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HANDLE_SDP_TYPE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HANDLE_SDP_TYPE { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Devices_Bluetooth'*"] pub const HCCC_PROTOCOL_UUID16: u32 = 18u32; #[doc = "*Required features: 'Win32_Devices_Bluetooth'*"] diff --git a/crates/libs/windows/src/Windows/Win32/Devices/DeviceAndDriverInstallation/mod.rs b/crates/libs/windows/src/Windows/Win32/Devices/DeviceAndDriverInstallation/mod.rs index aa4e98d38f..ed8ebf86c0 100644 --- a/crates/libs/windows/src/Windows/Win32/Devices/DeviceAndDriverInstallation/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Devices/DeviceAndDriverInstallation/mod.rs @@ -6717,7 +6717,40 @@ pub const GUID_TARGET_DEVICE_TRANSPORT_RELATIONS_CHANGED: ::windows::core::GUID pub const GUID_THERMAL_COOLING_INTERFACE: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xecbe47a8_c498_4bb9_bd70_e867e0940d22); pub const GUID_TRANSLATOR_INTERFACE_STANDARD: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x6c154a92_aacf_11d0_8d2a_00a0c906b244); pub const GUID_WUDF_DEVICE_HOST_PROBLEM: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xc43d25bd_9346_40ee_a2d2_d70c15f8b75b); -pub type HCMNOTIFICATION = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HCMNOTIFICATION(pub isize); +impl HCMNOTIFICATION { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HCMNOTIFICATION { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HCMNOTIFICATION { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HCMNOTIFICATION {} +impl ::core::fmt::Debug for HCMNOTIFICATION { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HCMNOTIFICATION").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HCMNOTIFICATION { + type Abi = Self; +} #[repr(C, packed(1))] #[doc = "*Required features: 'Win32_Devices_DeviceAndDriverInstallation', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/Devices/Display/mod.rs b/crates/libs/windows/src/Windows/Win32/Devices/Display/mod.rs index 1011583e42..4c21b7e813 100644 --- a/crates/libs/windows/src/Windows/Win32/Devices/Display/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Devices/Display/mod.rs @@ -1418,8 +1418,74 @@ pub const DEVPKEY_Device_TerminalLuid: super::super::UI::Shell::PropertiesSystem #[doc = "*Required features: 'Win32_Devices_Display', 'Win32_UI_Shell_PropertiesSystem'*"] #[cfg(feature = "Win32_UI_Shell_PropertiesSystem")] pub const DEVPKEY_IndirectDisplay: super::super::UI::Shell::PropertiesSystem::PROPERTYKEY = super::super::UI::Shell::PropertiesSystem::PROPERTYKEY { fmtid: ::windows::core::GUID::from_u128(0xc50a3f10_aa5c_4247_b830_d6a6f8eaa310), pid: 1u32 }; -pub type DHPDEV = isize; -pub type DHSURF = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct DHPDEV(pub isize); +impl DHPDEV { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for DHPDEV { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for DHPDEV { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for DHPDEV {} +impl ::core::fmt::Debug for DHPDEV { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("DHPDEV").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for DHPDEV { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct DHSURF(pub isize); +impl DHSURF { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for DHSURF { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for DHSURF { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for DHSURF {} +impl ::core::fmt::Debug for DHSURF { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("DHSURF").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for DHSURF { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_Devices_Display'*"] pub struct DISPLAYCONFIG_2DREGION { @@ -6523,10 +6589,142 @@ pub unsafe fn GetVCPFeatureAndVCPFeatureReply<'a, Param0: ::windows::core::IntoP #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type HBM = isize; -pub type HDEV = isize; -pub type HDRVOBJ = isize; -pub type HFASTMUTEX = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HBM(pub isize); +impl HBM { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HBM { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HBM { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HBM {} +impl ::core::fmt::Debug for HBM { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HBM").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HBM { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HDEV(pub isize); +impl HDEV { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HDEV { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HDEV { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HDEV {} +impl ::core::fmt::Debug for HDEV { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HDEV").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HDEV { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HDRVOBJ(pub isize); +impl HDRVOBJ { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HDRVOBJ { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HDRVOBJ { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HDRVOBJ {} +impl ::core::fmt::Debug for HDRVOBJ { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HDRVOBJ").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HDRVOBJ { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HFASTMUTEX(pub isize); +impl HFASTMUTEX { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HFASTMUTEX { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HFASTMUTEX { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HFASTMUTEX {} +impl ::core::fmt::Debug for HFASTMUTEX { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HFASTMUTEX").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HFASTMUTEX { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Devices_Display'*"] pub const HOOK_ALPHABLEND: u32 = 65536u32; #[doc = "*Required features: 'Win32_Devices_Display'*"] @@ -6583,8 +6781,74 @@ pub const HOST_DSI_TRANSMISSION_CANCELLED: u32 = 16u32; pub const HOST_DSI_TRANSMISSION_DROPPED: u32 = 32u32; #[doc = "*Required features: 'Win32_Devices_Display'*"] pub const HOST_DSI_TRANSMISSION_TIMEOUT: u32 = 64u32; -pub type HSEMAPHORE = isize; -pub type HSURF = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HSEMAPHORE(pub isize); +impl HSEMAPHORE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HSEMAPHORE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HSEMAPHORE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HSEMAPHORE {} +impl ::core::fmt::Debug for HSEMAPHORE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HSEMAPHORE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HSEMAPHORE { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HSURF(pub isize); +impl HSURF { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HSURF { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HSURF { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HSURF {} +impl ::core::fmt::Debug for HSURF { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HSURF").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HSURF { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Devices_Display'*"] pub const HS_DDI_MAX: u32 = 6u32; #[doc = "*Required features: 'Win32_Devices_Display'*"] diff --git a/crates/libs/windows/src/Windows/Win32/Devices/Enumeration/Pnp/mod.rs b/crates/libs/windows/src/Windows/Win32/Devices/Enumeration/Pnp/mod.rs index 1091522214..ac3c05d240 100644 --- a/crates/libs/windows/src/Windows/Win32/Devices/Enumeration/Pnp/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Devices/Enumeration/Pnp/mod.rs @@ -13,7 +13,40 @@ pub const FAULT_INVALID_ARG: u32 = 402u32; pub const FAULT_INVALID_SEQUENCE_NUMBER: u32 = 403u32; #[doc = "*Required features: 'Win32_Devices_Enumeration_Pnp'*"] pub const FAULT_INVALID_VARIABLE: u32 = 404u32; -pub type HSWDEVICE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HSWDEVICE(pub isize); +impl HSWDEVICE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HSWDEVICE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HSWDEVICE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HSWDEVICE {} +impl ::core::fmt::Debug for HSWDEVICE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HSWDEVICE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HSWDEVICE { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Devices_Enumeration_Pnp'*"] #[repr(transparent)] pub struct IUPnPAddressFamilyControl(::windows::core::IUnknown); diff --git a/crates/libs/windows/src/Windows/Win32/Devices/SerialCommunication/mod.rs b/crates/libs/windows/src/Windows/Win32/Devices/SerialCommunication/mod.rs index 628f33bcf6..3ffb78d1c9 100644 --- a/crates/libs/windows/src/Windows/Win32/Devices/SerialCommunication/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Devices/SerialCommunication/mod.rs @@ -106,4 +106,37 @@ pub unsafe fn ComDBResizeDatabase<'a, Param0: ::windows::core::IntoParam<'a, HCO #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type HCOMDB = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HCOMDB(pub isize); +impl HCOMDB { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HCOMDB { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HCOMDB { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HCOMDB {} +impl ::core::fmt::Debug for HCOMDB { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HCOMDB").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HCOMDB { + type Abi = Self; +} diff --git a/crates/libs/windows/src/Windows/Win32/Foundation/mod.rs b/crates/libs/windows/src/Windows/Win32/Foundation/mod.rs index af6e2cec84..f418c04403 100644 --- a/crates/libs/windows/src/Windows/Win32/Foundation/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Foundation/mod.rs @@ -197,7 +197,40 @@ impl<'a> ::windows::core::IntoParam<'a, BOOL> for bool { ::windows::core::Param::Owned(self.into()) } } -pub type BOOLEAN = u8; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct BOOLEAN(pub u8); +impl BOOLEAN { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for BOOLEAN { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for BOOLEAN { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for BOOLEAN {} +impl ::core::fmt::Debug for BOOLEAN { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("BOOLEAN").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for BOOLEAN { + type Abi = Self; +} #[repr(transparent)] pub struct BSTR(*mut u16); impl BSTR { @@ -504,7 +537,40 @@ pub const CERT_E_UNTRUSTEDTESTROOT: ::windows::core::HRESULT = ::windows::core:: pub const CERT_E_VALIDITYPERIODNESTING: ::windows::core::HRESULT = ::windows::core::HRESULT(-2146762494i32); #[doc = "*Required features: 'Win32_Foundation'*"] pub const CERT_E_WRONG_USAGE: ::windows::core::HRESULT = ::windows::core::HRESULT(-2146762480i32); -pub type CHAR = u8; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct CHAR(pub u8); +impl CHAR { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for CHAR { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for CHAR { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for CHAR {} +impl ::core::fmt::Debug for CHAR { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("CHAR").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for CHAR { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Foundation'*"] pub const CI_CORRUPT_CATALOG: ::windows::core::HRESULT = ::windows::core::HRESULT(-1073473535i32); #[doc = "*Required features: 'Win32_Foundation'*"] @@ -3836,7 +3902,40 @@ pub type HANDLE_FLAGS = u32; pub const HANDLE_FLAG_INHERIT: HANDLE_FLAGS = 1u32; #[doc = "*Required features: 'Win32_Foundation'*"] pub const HANDLE_FLAG_PROTECT_FROM_CLOSE: HANDLE_FLAGS = 2u32; -pub type HANDLE_PTR = usize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HANDLE_PTR(pub usize); +impl HANDLE_PTR { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HANDLE_PTR { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HANDLE_PTR { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HANDLE_PTR {} +impl ::core::fmt::Debug for HANDLE_PTR { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HANDLE_PTR").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HANDLE_PTR { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Foundation'*"] pub const HCN_E_ADAPTER_NOT_FOUND: ::windows::core::HRESULT = ::windows::core::HRESULT(-2143617018i32); #[doc = "*Required features: 'Win32_Foundation'*"] @@ -3991,7 +4090,40 @@ pub const HCS_E_UNKNOWN_MESSAGE: ::windows::core::HRESULT = ::windows::core::HRE pub const HCS_E_UNSUPPORTED_PROTOCOL_VERSION: ::windows::core::HRESULT = ::windows::core::HRESULT(-2143878900i32); #[doc = "*Required features: 'Win32_Foundation'*"] pub const HCS_E_WINDOWS_INSIDER_REQUIRED: ::windows::core::HRESULT = ::windows::core::HRESULT(-2143878893i32); -pub type HINSTANCE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HINSTANCE(pub isize); +impl HINSTANCE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HINSTANCE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HINSTANCE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HINSTANCE {} +impl ::core::fmt::Debug for HINSTANCE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HINSTANCE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HINSTANCE { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_Foundation'*"] pub struct HLSURF__ { @@ -4022,7 +4154,40 @@ impl ::core::default::Default for HLSURF__ { unsafe { ::core::mem::zeroed() } } } -pub type HRSRC = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HRSRC(pub isize); +impl HRSRC { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HRSRC { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HRSRC { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HRSRC {} +impl ::core::fmt::Debug for HRSRC { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HRSRC").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HRSRC { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_Foundation'*"] pub struct HSPRITE__ { @@ -4239,7 +4404,40 @@ impl ::core::default::Default for HUMPD__ { unsafe { ::core::mem::zeroed() } } } -pub type HWND = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HWND(pub isize); +impl HWND { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HWND { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HWND { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HWND {} +impl ::core::fmt::Debug for HWND { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HWND").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HWND { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Foundation'*"] pub const INPLACE_E_FIRST: i32 = -2147221088i32; #[doc = "*Required features: 'Win32_Foundation'*"] @@ -4294,8 +4492,74 @@ pub const JSCRIPT_E_CANTEXECUTE: ::windows::core::HRESULT = ::windows::core::HRE pub const LANGUAGE_E_DATABASE_NOT_FOUND: ::windows::core::HRESULT = ::windows::core::HRESULT(-2147215484i32); #[doc = "*Required features: 'Win32_Foundation'*"] pub const LANGUAGE_S_LARGE_WORD: ::windows::core::HRESULT = ::windows::core::HRESULT(268161i32); -pub type LPARAM = isize; -pub type LRESULT = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct LPARAM(pub isize); +impl LPARAM { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for LPARAM { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for LPARAM { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for LPARAM {} +impl ::core::fmt::Debug for LPARAM { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("LPARAM").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for LPARAM { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct LRESULT(pub isize); +impl LRESULT { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for LRESULT { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for LRESULT { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for LRESULT {} +impl ::core::fmt::Debug for LRESULT { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("LRESULT").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for LRESULT { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_Foundation'*"] pub struct LUID { @@ -5459,7 +5723,40 @@ impl ::core::default::Default for POINTS { pub const PRESENTATION_ERROR_LOST: ::windows::core::HRESULT = ::windows::core::HRESULT(-2004811775i32); #[doc = "*Required features: 'Win32_Foundation'*"] pub type PROC = ::core::option::Option isize>; -pub type PSID = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct PSID(pub isize); +impl PSID { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for PSID { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for PSID { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for PSID {} +impl ::core::fmt::Debug for PSID { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("PSID").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for PSID { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Foundation'*"] pub const PSINK_E_INDEX_ONLY: ::windows::core::HRESULT = ::windows::core::HRESULT(-2147215471i32); #[doc = "*Required features: 'Win32_Foundation'*"] @@ -6635,7 +6932,40 @@ pub const SEC_I_SIGNATURE_NEEDED: ::windows::core::HRESULT = ::windows::core::HR pub const SEVERITY_ERROR: u32 = 1u32; #[doc = "*Required features: 'Win32_Foundation'*"] pub const SEVERITY_SUCCESS: u32 = 0u32; -pub type SHANDLE_PTR = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct SHANDLE_PTR(pub isize); +impl SHANDLE_PTR { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for SHANDLE_PTR { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for SHANDLE_PTR { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for SHANDLE_PTR {} +impl ::core::fmt::Debug for SHANDLE_PTR { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("SHANDLE_PTR").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for SHANDLE_PTR { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_Foundation'*"] pub struct SIZE { @@ -20624,7 +20954,40 @@ pub const WINML_ERR_VALUE_NOTFOUND: ::windows::core::HRESULT = ::windows::core:: pub const WINVER: u32 = 1280u32; #[doc = "*Required features: 'Win32_Foundation'*"] pub const WINVER_MAXVER: u32 = 2560u32; -pub type WPARAM = usize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct WPARAM(pub usize); +impl WPARAM { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for WPARAM { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for WPARAM { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for WPARAM {} +impl ::core::fmt::Debug for WPARAM { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("WPARAM").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for WPARAM { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Foundation'*"] pub const WPN_E_ACCESS_DENIED: ::windows::core::HRESULT = ::windows::core::HRESULT(-2143420137i32); #[doc = "*Required features: 'Win32_Foundation'*"] diff --git a/crates/libs/windows/src/Windows/Win32/Globalization/mod.rs b/crates/libs/windows/src/Windows/Win32/Globalization/mod.rs index 1a42c5c89c..da7bda6969 100644 --- a/crates/libs/windows/src/Windows/Win32/Globalization/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Globalization/mod.rs @@ -2483,9 +2483,108 @@ pub const HIGHLEVEL_SERVICE_TYPES: u32 = 1u32; pub const HIGH_SURROGATE_END: u32 = 56319u32; #[doc = "*Required features: 'Win32_Globalization'*"] pub const HIGH_SURROGATE_START: u32 = 55296u32; -pub type HIMC = isize; -pub type HIMCC = isize; -pub type HSAVEDUILANGUAGES = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HIMC(pub isize); +impl HIMC { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HIMC { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HIMC { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HIMC {} +impl ::core::fmt::Debug for HIMC { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HIMC").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HIMC { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HIMCC(pub isize); +impl HIMCC { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HIMCC { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HIMCC { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HIMCC {} +impl ::core::fmt::Debug for HIMCC { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HIMCC").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HIMCC { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HSAVEDUILANGUAGES(pub isize); +impl HSAVEDUILANGUAGES { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HSAVEDUILANGUAGES { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HSAVEDUILANGUAGES { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HSAVEDUILANGUAGES {} +impl ::core::fmt::Debug for HSAVEDUILANGUAGES { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HSAVEDUILANGUAGES").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HSAVEDUILANGUAGES { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Globalization'*"] #[repr(transparent)] pub struct IComprehensiveSpellCheckProvider(::windows::core::IUnknown); diff --git a/crates/libs/windows/src/Windows/Win32/Graphics/Gdi/mod.rs b/crates/libs/windows/src/Windows/Win32/Graphics/Gdi/mod.rs index ad947cd8d0..5e4a769f7f 100644 --- a/crates/libs/windows/src/Windows/Win32/Graphics/Gdi/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Graphics/Gdi/mod.rs @@ -2082,7 +2082,45 @@ pub unsafe fn CreateSolidBrush(color: u32) -> HBRUSH { #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type CreatedHDC = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct CreatedHDC(pub isize); +impl CreatedHDC { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for CreatedHDC { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for CreatedHDC { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for CreatedHDC {} +impl ::core::fmt::Debug for CreatedHDC { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("CreatedHDC").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for CreatedHDC { + type Abi = Self; +} +impl<'a> ::windows::core::IntoParam<'a, HDC> for CreatedHDC { + fn into_param(self) -> ::windows::core::Param<'a, HDC> { + ::windows::core::Param::Owned(HDC(self.0)) + } +} #[doc = "*Required features: 'Win32_Graphics_Gdi'*"] pub const DCBA_FACEDOWNCENTER: u32 = 257u32; #[doc = "*Required features: 'Win32_Graphics_Gdi'*"] @@ -10673,9 +10711,118 @@ pub const HS_FDIAGONAL: HATCH_BRUSH_STYLE = 2u32; pub const HS_HORIZONTAL: HATCH_BRUSH_STYLE = 0u32; #[doc = "*Required features: 'Win32_Graphics_Gdi'*"] pub const HS_VERTICAL: HATCH_BRUSH_STYLE = 1u32; -pub type HBITMAP = isize; -pub type HBRUSH = isize; -pub type HDC = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HBITMAP(pub isize); +impl HBITMAP { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HBITMAP { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HBITMAP { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HBITMAP {} +impl ::core::fmt::Debug for HBITMAP { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HBITMAP").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HBITMAP { + type Abi = Self; +} +impl<'a> ::windows::core::IntoParam<'a, HGDIOBJ> for HBITMAP { + fn into_param(self) -> ::windows::core::Param<'a, HGDIOBJ> { + ::windows::core::Param::Owned(HGDIOBJ(self.0)) + } +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HBRUSH(pub isize); +impl HBRUSH { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HBRUSH { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HBRUSH { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HBRUSH {} +impl ::core::fmt::Debug for HBRUSH { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HBRUSH").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HBRUSH { + type Abi = Self; +} +impl<'a> ::windows::core::IntoParam<'a, HGDIOBJ> for HBRUSH { + fn into_param(self) -> ::windows::core::Param<'a, HGDIOBJ> { + ::windows::core::Param::Owned(HGDIOBJ(self.0)) + } +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HDC(pub isize); +impl HDC { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HDC { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HDC { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HDC {} +impl ::core::fmt::Debug for HDC { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HDC").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HDC { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Graphics_Gdi'*"] pub type HDC_MAP_MODE = u32; #[doc = "*Required features: 'Win32_Graphics_Gdi'*"] @@ -10696,18 +10843,368 @@ pub const MM_TEXT: HDC_MAP_MODE = 1u32; pub const MM_TWIPS: HDC_MAP_MODE = 6u32; #[doc = "*Required features: 'Win32_Graphics_Gdi'*"] pub const HEBREW_CHARSET: u32 = 177u32; -pub type HENHMETAFILE = isize; -pub type HFONT = isize; -pub type HGDIOBJ = isize; -pub type HMETAFILE = isize; -pub type HMONITOR = isize; -pub type HPALETTE = isize; -pub type HPEN = isize; -pub type HRGN = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HENHMETAFILE(pub isize); +impl HENHMETAFILE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HENHMETAFILE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HENHMETAFILE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HENHMETAFILE {} +impl ::core::fmt::Debug for HENHMETAFILE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HENHMETAFILE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HENHMETAFILE { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HFONT(pub isize); +impl HFONT { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HFONT { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HFONT { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HFONT {} +impl ::core::fmt::Debug for HFONT { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HFONT").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HFONT { + type Abi = Self; +} +impl<'a> ::windows::core::IntoParam<'a, HGDIOBJ> for HFONT { + fn into_param(self) -> ::windows::core::Param<'a, HGDIOBJ> { + ::windows::core::Param::Owned(HGDIOBJ(self.0)) + } +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HGDIOBJ(pub isize); +impl HGDIOBJ { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HGDIOBJ { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HGDIOBJ { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HGDIOBJ {} +impl ::core::fmt::Debug for HGDIOBJ { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HGDIOBJ").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HGDIOBJ { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HMETAFILE(pub isize); +impl HMETAFILE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HMETAFILE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HMETAFILE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HMETAFILE {} +impl ::core::fmt::Debug for HMETAFILE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HMETAFILE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HMETAFILE { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HMONITOR(pub isize); +impl HMONITOR { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HMONITOR { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HMONITOR { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HMONITOR {} +impl ::core::fmt::Debug for HMONITOR { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HMONITOR").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HMONITOR { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HPALETTE(pub isize); +impl HPALETTE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HPALETTE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HPALETTE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HPALETTE {} +impl ::core::fmt::Debug for HPALETTE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HPALETTE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HPALETTE { + type Abi = Self; +} +impl<'a> ::windows::core::IntoParam<'a, HGDIOBJ> for HPALETTE { + fn into_param(self) -> ::windows::core::Param<'a, HGDIOBJ> { + ::windows::core::Param::Owned(HGDIOBJ(self.0)) + } +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HPEN(pub isize); +impl HPEN { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HPEN { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HPEN { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HPEN {} +impl ::core::fmt::Debug for HPEN { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HPEN").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HPEN { + type Abi = Self; +} +impl<'a> ::windows::core::IntoParam<'a, HGDIOBJ> for HPEN { + fn into_param(self) -> ::windows::core::Param<'a, HGDIOBJ> { + ::windows::core::Param::Owned(HGDIOBJ(self.0)) + } +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HRGN(pub isize); +impl HRGN { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HRGN { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HRGN { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HRGN {} +impl ::core::fmt::Debug for HRGN { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HRGN").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HRGN { + type Abi = Self; +} +impl<'a> ::windows::core::IntoParam<'a, HGDIOBJ> for HRGN { + fn into_param(self) -> ::windows::core::Param<'a, HGDIOBJ> { + ::windows::core::Param::Owned(HGDIOBJ(self.0)) + } +} #[doc = "*Required features: 'Win32_Graphics_Gdi'*"] pub const HS_API_MAX: u32 = 12u32; -pub type HdcMetdataEnhFileHandle = isize; -pub type HdcMetdataFileHandle = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HdcMetdataEnhFileHandle(pub isize); +impl HdcMetdataEnhFileHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HdcMetdataEnhFileHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HdcMetdataEnhFileHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HdcMetdataEnhFileHandle {} +impl ::core::fmt::Debug for HdcMetdataEnhFileHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HdcMetdataEnhFileHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HdcMetdataEnhFileHandle { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HdcMetdataFileHandle(pub isize); +impl HdcMetdataFileHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HdcMetdataFileHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HdcMetdataFileHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HdcMetdataFileHandle {} +impl ::core::fmt::Debug for HdcMetdataFileHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HdcMetdataFileHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HdcMetdataFileHandle { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Graphics_Gdi'*"] pub const ICM_DONE_OUTSIDEDC: u32 = 4u32; #[doc = "*Required features: 'Win32_Graphics_Gdi'*"] diff --git a/crates/libs/windows/src/Windows/Win32/Graphics/OpenGL/mod.rs b/crates/libs/windows/src/Windows/Win32/Graphics/OpenGL/mod.rs index df5215543b..7afeef8d75 100644 --- a/crates/libs/windows/src/Windows/Win32/Graphics/OpenGL/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Graphics/OpenGL/mod.rs @@ -1572,7 +1572,40 @@ pub unsafe fn GetPixelFormat<'a, Param0: ::windows::core::IntoParam<'a, super::G #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type HGLRC = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HGLRC(pub isize); +impl HGLRC { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HGLRC { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HGLRC { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HGLRC {} +impl ::core::fmt::Debug for HGLRC { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HGLRC").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HGLRC { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_Graphics_OpenGL'*"] pub struct LAYERPLANEDESCRIPTOR { diff --git a/crates/libs/windows/src/Windows/Win32/Media/Audio/mod.rs b/crates/libs/windows/src/Windows/Win32/Media/Audio/mod.rs index 2b0fd557be..77e8093594 100644 --- a/crates/libs/windows/src/Windows/Win32/Media/Audio/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Media/Audio/mod.rs @@ -2119,19 +2119,448 @@ pub const FORMATCHOOSE_FORMATTAG_VERIFY: u32 = 0u32; pub const FORMATCHOOSE_FORMAT_VERIFY: u32 = 1u32; #[doc = "*Required features: 'Win32_Media_Audio'*"] pub const FORMATCHOOSE_MESSAGE: u32 = 0u32; -pub type HACMDRIVER = isize; -pub type HACMDRIVERID = isize; -pub type HACMOBJ = isize; -pub type HACMSTREAM = isize; -pub type HMIDI = isize; -pub type HMIDIIN = isize; -pub type HMIDIOUT = isize; -pub type HMIDISTRM = isize; -pub type HMIXER = isize; -pub type HMIXEROBJ = isize; -pub type HWAVE = isize; -pub type HWAVEIN = isize; -pub type HWAVEOUT = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HACMDRIVER(pub isize); +impl HACMDRIVER { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HACMDRIVER { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HACMDRIVER { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HACMDRIVER {} +impl ::core::fmt::Debug for HACMDRIVER { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HACMDRIVER").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HACMDRIVER { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HACMDRIVERID(pub isize); +impl HACMDRIVERID { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HACMDRIVERID { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HACMDRIVERID { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HACMDRIVERID {} +impl ::core::fmt::Debug for HACMDRIVERID { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HACMDRIVERID").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HACMDRIVERID { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HACMOBJ(pub isize); +impl HACMOBJ { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HACMOBJ { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HACMOBJ { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HACMOBJ {} +impl ::core::fmt::Debug for HACMOBJ { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HACMOBJ").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HACMOBJ { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HACMSTREAM(pub isize); +impl HACMSTREAM { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HACMSTREAM { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HACMSTREAM { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HACMSTREAM {} +impl ::core::fmt::Debug for HACMSTREAM { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HACMSTREAM").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HACMSTREAM { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HMIDI(pub isize); +impl HMIDI { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HMIDI { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HMIDI { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HMIDI {} +impl ::core::fmt::Debug for HMIDI { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HMIDI").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HMIDI { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HMIDIIN(pub isize); +impl HMIDIIN { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HMIDIIN { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HMIDIIN { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HMIDIIN {} +impl ::core::fmt::Debug for HMIDIIN { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HMIDIIN").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HMIDIIN { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HMIDIOUT(pub isize); +impl HMIDIOUT { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HMIDIOUT { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HMIDIOUT { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HMIDIOUT {} +impl ::core::fmt::Debug for HMIDIOUT { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HMIDIOUT").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HMIDIOUT { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HMIDISTRM(pub isize); +impl HMIDISTRM { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HMIDISTRM { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HMIDISTRM { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HMIDISTRM {} +impl ::core::fmt::Debug for HMIDISTRM { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HMIDISTRM").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HMIDISTRM { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HMIXER(pub isize); +impl HMIXER { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HMIXER { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HMIXER { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HMIXER {} +impl ::core::fmt::Debug for HMIXER { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HMIXER").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HMIXER { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HMIXEROBJ(pub isize); +impl HMIXEROBJ { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HMIXEROBJ { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HMIXEROBJ { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HMIXEROBJ {} +impl ::core::fmt::Debug for HMIXEROBJ { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HMIXEROBJ").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HMIXEROBJ { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HWAVE(pub isize); +impl HWAVE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HWAVE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HWAVE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HWAVE {} +impl ::core::fmt::Debug for HWAVE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HWAVE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HWAVE { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HWAVEIN(pub isize); +impl HWAVEIN { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HWAVEIN { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HWAVEIN { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HWAVEIN {} +impl ::core::fmt::Debug for HWAVEIN { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HWAVEIN").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HWAVEIN { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HWAVEOUT(pub isize); +impl HWAVEOUT { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HWAVEOUT { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HWAVEOUT { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HWAVEOUT {} +impl ::core::fmt::Debug for HWAVEOUT { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HWAVEOUT").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HWAVEOUT { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Media_Audio'*"] #[repr(transparent)] pub struct IActivateAudioInterfaceAsyncOperation(::windows::core::IUnknown); diff --git a/crates/libs/windows/src/Windows/Win32/Media/Multimedia/mod.rs b/crates/libs/windows/src/Windows/Win32/Media/Multimedia/mod.rs index 3ac187961a..c3ca6bfdaa 100644 --- a/crates/libs/windows/src/Windows/Win32/Media/Multimedia/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Media/Multimedia/mod.rs @@ -3251,10 +3251,142 @@ pub unsafe fn GetSaveFileNamePreviewW(lpofn: *mut super::super::UI::Controls::Di #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type HDRVR = isize; -pub type HIC = isize; -pub type HMMIO = isize; -pub type HVIDEO = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HDRVR(pub isize); +impl HDRVR { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HDRVR { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HDRVR { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HDRVR {} +impl ::core::fmt::Debug for HDRVR { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HDRVR").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HDRVR { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HIC(pub isize); +impl HIC { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HIC { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HIC { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HIC {} +impl ::core::fmt::Debug for HIC { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HIC").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HIC { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HMMIO(pub isize); +impl HMMIO { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HMMIO { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HMMIO { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HMMIO {} +impl ::core::fmt::Debug for HMMIO { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HMMIO").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HMMIO { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HVIDEO(pub isize); +impl HVIDEO { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HVIDEO { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HVIDEO { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HVIDEO {} +impl ::core::fmt::Debug for HVIDEO { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HVIDEO").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HVIDEO { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Media_Multimedia'*"] #[repr(transparent)] pub struct IAVIEditStream(::windows::core::IUnknown); diff --git a/crates/libs/windows/src/Windows/Win32/Media/mod.rs b/crates/libs/windows/src/Windows/Win32/Media/mod.rs index c3893fa2cd..2a2a76590e 100644 --- a/crates/libs/windows/src/Windows/Win32/Media/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Media/mod.rs @@ -25,7 +25,40 @@ pub mod Speech; pub mod Streaming; #[cfg(feature = "Win32_Media_WindowsMediaFormat")] pub mod WindowsMediaFormat; -pub type HTASK = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HTASK(pub isize); +impl HTASK { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HTASK { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HTASK { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HTASK {} +impl ::core::fmt::Debug for HTASK { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HTASK").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HTASK { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Media'*"] #[repr(transparent)] pub struct IReferenceClock(::windows::core::IUnknown); diff --git a/crates/libs/windows/src/Windows/Win32/NetworkManagement/Dns/mod.rs b/crates/libs/windows/src/Windows/Win32/NetworkManagement/Dns/mod.rs index e37cf402b9..9ca064bbd1 100644 --- a/crates/libs/windows/src/Windows/Win32/NetworkManagement/Dns/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/NetworkManagement/Dns/mod.rs @@ -4409,7 +4409,40 @@ pub unsafe fn DnsConnectionUpdateIfIndexTable(pconnectionifindexentries: *const #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type DnsContextHandle = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct DnsContextHandle(pub isize); +impl DnsContextHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for DnsContextHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for DnsContextHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for DnsContextHandle {} +impl ::core::fmt::Debug for DnsContextHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("DnsContextHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for DnsContextHandle { + type Abi = Self; +} #[doc = "*Required features: 'Win32_NetworkManagement_Dns', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] #[inline] diff --git a/crates/libs/windows/src/Windows/Win32/NetworkManagement/IpHelper/mod.rs b/crates/libs/windows/src/Windows/Win32/NetworkManagement/IpHelper/mod.rs index 4c54d47bef..65a9863edd 100644 --- a/crates/libs/windows/src/Windows/Win32/NetworkManagement/IpHelper/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/NetworkManagement/IpHelper/mod.rs @@ -2373,7 +2373,40 @@ pub unsafe fn GetUnicastIpAddressTable(family: u16, table: *mut *mut MIB_UNICAST #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type HIFTIMESTAMPCHANGE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HIFTIMESTAMPCHANGE(pub isize); +impl HIFTIMESTAMPCHANGE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HIFTIMESTAMPCHANGE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HIFTIMESTAMPCHANGE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HIFTIMESTAMPCHANGE {} +impl ::core::fmt::Debug for HIFTIMESTAMPCHANGE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HIFTIMESTAMPCHANGE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HIFTIMESTAMPCHANGE { + type Abi = Self; +} #[doc = "*Required features: 'Win32_NetworkManagement_IpHelper'*"] pub const HYBRID_NODETYPE: u32 = 8u32; #[doc = "*Required features: 'Win32_NetworkManagement_IpHelper'*"] @@ -5078,7 +5111,40 @@ pub unsafe fn IcmpCreateFile() -> IcmpHandle { #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type IcmpHandle = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct IcmpHandle(pub isize); +impl IcmpHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for IcmpHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for IcmpHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for IcmpHandle {} +impl ::core::fmt::Debug for IcmpHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("IcmpHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for IcmpHandle { + type Abi = Self; +} #[doc = "*Required features: 'Win32_NetworkManagement_IpHelper'*"] #[inline] pub unsafe fn IcmpParseReplies(replybuffer: *mut ::core::ffi::c_void, replysize: u32) -> u32 { diff --git a/crates/libs/windows/src/Windows/Win32/NetworkManagement/QoS/mod.rs b/crates/libs/windows/src/Windows/Win32/NetworkManagement/QoS/mod.rs index 117f3d5bab..d4eddc7a9c 100644 --- a/crates/libs/windows/src/Windows/Win32/NetworkManagement/QoS/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/NetworkManagement/QoS/mod.rs @@ -1571,7 +1571,40 @@ pub const LOCAL_QOSABILITY: u32 = 50005u32; pub const LOCAL_TRAFFIC_CONTROL: u32 = 50004u32; #[doc = "*Required features: 'Win32_NetworkManagement_QoS'*"] pub const LPM_API_VERSION_1: u32 = 1u32; -pub type LPM_HANDLE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct LPM_HANDLE(pub isize); +impl LPM_HANDLE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for LPM_HANDLE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for LPM_HANDLE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for LPM_HANDLE {} +impl ::core::fmt::Debug for LPM_HANDLE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("LPM_HANDLE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for LPM_HANDLE { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_NetworkManagement_QoS'*"] pub struct LPM_INIT_INFO { @@ -2799,7 +2832,40 @@ impl ::core::default::Default for RESV_STYLE { unsafe { ::core::mem::zeroed() } } } -pub type RHANDLE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct RHANDLE(pub isize); +impl RHANDLE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for RHANDLE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for RHANDLE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for RHANDLE {} +impl ::core::fmt::Debug for RHANDLE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("RHANDLE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for RHANDLE { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_NetworkManagement_QoS'*"] pub struct RSVP_ADSPEC { diff --git a/crates/libs/windows/src/Windows/Win32/NetworkManagement/Rras/mod.rs b/crates/libs/windows/src/Windows/Win32/NetworkManagement/Rras/mod.rs index 31a13dc4ba..e3e2daf94f 100644 --- a/crates/libs/windows/src/Windows/Win32/NetworkManagement/Rras/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/NetworkManagement/Rras/mod.rs @@ -639,7 +639,40 @@ impl ::core::default::Default for GRE_CONFIG_PARAMS0 { unsafe { ::core::mem::zeroed() } } } -pub type HRASCONN = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HRASCONN(pub isize); +impl HRASCONN { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HRASCONN { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HRASCONN { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HRASCONN {} +impl ::core::fmt::Debug for HRASCONN { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HRASCONN").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HRASCONN { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_NetworkManagement_Rras', 'Win32_Foundation', 'Win32_Security_Cryptography'*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security_Cryptography"))] diff --git a/crates/libs/windows/src/Windows/Win32/NetworkManagement/WNet/mod.rs b/crates/libs/windows/src/Windows/Win32/NetworkManagement/WNet/mod.rs index ba11e0d0d0..af6915ba41 100644 --- a/crates/libs/windows/src/Windows/Win32/NetworkManagement/WNet/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/NetworkManagement/WNet/mod.rs @@ -862,7 +862,40 @@ pub const WNPS_FILE: NP_PROPERTY_DIALOG_SELECTION = 0u32; pub const WNPS_DIR: NP_PROPERTY_DIALOG_SELECTION = 1u32; #[doc = "*Required features: 'Win32_NetworkManagement_WNet'*"] pub const WNPS_MULT: NP_PROPERTY_DIALOG_SELECTION = 2u32; -pub type NetEnumHandle = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct NetEnumHandle(pub isize); +impl NetEnumHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for NetEnumHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for NetEnumHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for NetEnumHandle {} +impl ::core::fmt::Debug for NetEnumHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("NetEnumHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for NetEnumHandle { + type Abi = Self; +} #[doc = "*Required features: 'Win32_NetworkManagement_WNet', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] pub type PF_AddConnectNotify = ::core::option::Option u32>; diff --git a/crates/libs/windows/src/Windows/Win32/Networking/ActiveDirectory/mod.rs b/crates/libs/windows/src/Windows/Win32/Networking/ActiveDirectory/mod.rs index 241b05a155..f63dd7b903 100644 --- a/crates/libs/windows/src/Windows/Win32/Networking/ActiveDirectory/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Networking/ActiveDirectory/mod.rs @@ -8412,7 +8412,40 @@ pub unsafe fn FreeADsStr<'a, Param0: ::windows::core::IntoParam<'a, super::super #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type GetDcContextHandle = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct GetDcContextHandle(pub isize); +impl GetDcContextHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for GetDcContextHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for GetDcContextHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for GetDcContextHandle {} +impl ::core::fmt::Debug for GetDcContextHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("GetDcContextHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for GetDcContextHandle { + type Abi = Self; +} pub const Hold: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb3ad3e13_4080_11d1_a3ac_00c04fb950dc); #[doc = "*Required features: 'Win32_Networking_ActiveDirectory'*"] #[repr(transparent)] diff --git a/crates/libs/windows/src/Windows/Win32/Networking/WebSocket/mod.rs b/crates/libs/windows/src/Windows/Win32/Networking/WebSocket/mod.rs index abced99b76..76fe15f055 100644 --- a/crates/libs/windows/src/Windows/Win32/Networking/WebSocket/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Networking/WebSocket/mod.rs @@ -150,7 +150,40 @@ pub const WEB_SOCKET_UNSUPPORTED_EXTENSIONS_CLOSE_STATUS: WEB_SOCKET_CLOSE_STATU pub const WEB_SOCKET_SERVER_ERROR_CLOSE_STATUS: WEB_SOCKET_CLOSE_STATUS = 1011i32; #[doc = "*Required features: 'Win32_Networking_WebSocket'*"] pub const WEB_SOCKET_SECURE_HANDSHAKE_ERROR_CLOSE_STATUS: WEB_SOCKET_CLOSE_STATUS = 1015i32; -pub type WEB_SOCKET_HANDLE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct WEB_SOCKET_HANDLE(pub isize); +impl WEB_SOCKET_HANDLE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for WEB_SOCKET_HANDLE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for WEB_SOCKET_HANDLE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for WEB_SOCKET_HANDLE {} +impl ::core::fmt::Debug for WEB_SOCKET_HANDLE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("WEB_SOCKET_HANDLE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for WEB_SOCKET_HANDLE { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_Networking_WebSocket', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/Networking/WinInet/mod.rs b/crates/libs/windows/src/Windows/Win32/Networking/WinInet/mod.rs index fa658c8bb4..91fa1f631f 100644 --- a/crates/libs/windows/src/Windows/Win32/Networking/WinInet/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Networking/WinInet/mod.rs @@ -3433,7 +3433,40 @@ impl ::core::default::Default for HTTP_PUSH_TRANSPORT_SETTING { unsafe { ::core::mem::zeroed() } } } -pub type HTTP_PUSH_WAIT_HANDLE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HTTP_PUSH_WAIT_HANDLE(pub isize); +impl HTTP_PUSH_WAIT_HANDLE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HTTP_PUSH_WAIT_HANDLE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HTTP_PUSH_WAIT_HANDLE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HTTP_PUSH_WAIT_HANDLE {} +impl ::core::fmt::Debug for HTTP_PUSH_WAIT_HANDLE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HTTP_PUSH_WAIT_HANDLE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HTTP_PUSH_WAIT_HANDLE { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Networking_WinInet'*"] pub type HTTP_PUSH_WAIT_TYPE = i32; #[doc = "*Required features: 'Win32_Networking_WinInet'*"] diff --git a/crates/libs/windows/src/Windows/Win32/Networking/WinSock/mod.rs b/crates/libs/windows/src/Windows/Win32/Networking/WinSock/mod.rs index 8aad3167e0..9743ebd709 100644 --- a/crates/libs/windows/src/Windows/Win32/Networking/WinSock/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Networking/WinSock/mod.rs @@ -1627,7 +1627,40 @@ pub unsafe fn GetTypeByNameW<'a, Param0: ::windows::core::IntoParam<'a, super::s #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type HWSAEVENT = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HWSAEVENT(pub isize); +impl HWSAEVENT { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HWSAEVENT { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HWSAEVENT { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HWSAEVENT {} +impl ::core::fmt::Debug for HWSAEVENT { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HWSAEVENT").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HWSAEVENT { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Networking_WinSock'*"] pub const IAS_ATTRIB_INT: u32 = 1u32; #[doc = "*Required features: 'Win32_Networking_WinSock'*"] @@ -2005,7 +2038,7 @@ impl ::core::default::Default for INTERFACE_INFO_EX { } } #[doc = "*Required features: 'Win32_Networking_WinSock'*"] -pub const INVALID_SOCKET: SOCKET = 4294967295u32 as _; +pub const INVALID_SOCKET: SOCKET = SOCKET(4294967295u32 as _); #[repr(C)] #[doc = "*Required features: 'Win32_Networking_WinSock'*"] pub struct IN_ADDR { @@ -7231,7 +7264,40 @@ impl ::core::default::Default for SOCKADDR_STORAGE_XP { unsafe { ::core::mem::zeroed() } } } -pub type SOCKET = usize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct SOCKET(pub usize); +impl SOCKET { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for SOCKET { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for SOCKET { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for SOCKET {} +impl ::core::fmt::Debug for SOCKET { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("SOCKET").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for SOCKET { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_Networking_WinSock', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/Security/Authentication/Identity/mod.rs b/crates/libs/windows/src/Windows/Win32/Security/Authentication/Identity/mod.rs index 1c7881f1af..845918456c 100644 --- a/crates/libs/windows/src/Windows/Win32/Security/Authentication/Identity/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Security/Authentication/Identity/mod.rs @@ -6272,7 +6272,40 @@ pub unsafe fn LsaGetLogonSessionData(logonid: *const super::super::super::Founda #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type LsaHandle = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct LsaHandle(pub isize); +impl LsaHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for LsaHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for LsaHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for LsaHandle {} +impl ::core::fmt::Debug for LsaHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("LsaHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for LsaHandle { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Security_Authentication_Identity', 'Win32_Foundation', 'Win32_System_Kernel'*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Kernel"))] #[inline] diff --git a/crates/libs/windows/src/Windows/Win32/Security/Authorization/mod.rs b/crates/libs/windows/src/Windows/Win32/Security/Authorization/mod.rs index a3b1360c58..4a4093f759 100644 --- a/crates/libs/windows/src/Windows/Win32/Security/Authorization/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Security/Authorization/mod.rs @@ -1044,7 +1044,40 @@ pub const AUTHZP_WPD_EVENT: u32 = 16u32; pub type AUTHZ_ACCESS_CHECK_FLAGS = u32; #[doc = "*Required features: 'Win32_Security_Authorization'*"] pub const AUTHZ_ACCESS_CHECK_NO_DEEP_COPY_SD: AUTHZ_ACCESS_CHECK_FLAGS = 1u32; -pub type AUTHZ_ACCESS_CHECK_RESULTS_HANDLE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct AUTHZ_ACCESS_CHECK_RESULTS_HANDLE(pub isize); +impl AUTHZ_ACCESS_CHECK_RESULTS_HANDLE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for AUTHZ_ACCESS_CHECK_RESULTS_HANDLE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for AUTHZ_ACCESS_CHECK_RESULTS_HANDLE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for AUTHZ_ACCESS_CHECK_RESULTS_HANDLE {} +impl ::core::fmt::Debug for AUTHZ_ACCESS_CHECK_RESULTS_HANDLE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("AUTHZ_ACCESS_CHECK_RESULTS_HANDLE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for AUTHZ_ACCESS_CHECK_RESULTS_HANDLE { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_Security_Authorization'*"] pub struct AUTHZ_ACCESS_REPLY { @@ -1122,7 +1155,40 @@ impl ::core::default::Default for AUTHZ_ACCESS_REQUEST { } #[doc = "*Required features: 'Win32_Security_Authorization'*"] pub const AUTHZ_ALLOW_MULTIPLE_SOURCE_INSTANCES: u32 = 1u32; -pub type AUTHZ_AUDIT_EVENT_HANDLE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct AUTHZ_AUDIT_EVENT_HANDLE(pub isize); +impl AUTHZ_AUDIT_EVENT_HANDLE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for AUTHZ_AUDIT_EVENT_HANDLE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for AUTHZ_AUDIT_EVENT_HANDLE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for AUTHZ_AUDIT_EVENT_HANDLE {} +impl ::core::fmt::Debug for AUTHZ_AUDIT_EVENT_HANDLE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("AUTHZ_AUDIT_EVENT_HANDLE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for AUTHZ_AUDIT_EVENT_HANDLE { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Security_Authorization'*"] pub type AUTHZ_AUDIT_EVENT_INFORMATION_CLASS = i32; #[doc = "*Required features: 'Win32_Security_Authorization'*"] @@ -1135,7 +1201,40 @@ pub const AuthzAuditEventInfoObjectType: AUTHZ_AUDIT_EVENT_INFORMATION_CLASS = 3 pub const AuthzAuditEventInfoObjectName: AUTHZ_AUDIT_EVENT_INFORMATION_CLASS = 4i32; #[doc = "*Required features: 'Win32_Security_Authorization'*"] pub const AuthzAuditEventInfoAdditionalInfo: AUTHZ_AUDIT_EVENT_INFORMATION_CLASS = 5i32; -pub type AUTHZ_AUDIT_EVENT_TYPE_HANDLE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct AUTHZ_AUDIT_EVENT_TYPE_HANDLE(pub isize); +impl AUTHZ_AUDIT_EVENT_TYPE_HANDLE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for AUTHZ_AUDIT_EVENT_TYPE_HANDLE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for AUTHZ_AUDIT_EVENT_TYPE_HANDLE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for AUTHZ_AUDIT_EVENT_TYPE_HANDLE {} +impl ::core::fmt::Debug for AUTHZ_AUDIT_EVENT_TYPE_HANDLE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("AUTHZ_AUDIT_EVENT_TYPE_HANDLE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for AUTHZ_AUDIT_EVENT_TYPE_HANDLE { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_Security_Authorization'*"] pub struct AUTHZ_AUDIT_EVENT_TYPE_LEGACY { @@ -1262,7 +1361,40 @@ impl ::core::default::Default for AUTHZ_CAP_CHANGE_SUBSCRIPTION_HANDLE__ { unsafe { ::core::mem::zeroed() } } } -pub type AUTHZ_CLIENT_CONTEXT_HANDLE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct AUTHZ_CLIENT_CONTEXT_HANDLE(pub isize); +impl AUTHZ_CLIENT_CONTEXT_HANDLE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for AUTHZ_CLIENT_CONTEXT_HANDLE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for AUTHZ_CLIENT_CONTEXT_HANDLE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for AUTHZ_CLIENT_CONTEXT_HANDLE {} +impl ::core::fmt::Debug for AUTHZ_CLIENT_CONTEXT_HANDLE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("AUTHZ_CLIENT_CONTEXT_HANDLE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for AUTHZ_CLIENT_CONTEXT_HANDLE { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Security_Authorization'*"] pub const AUTHZ_COMPUTE_PRIVILEGES: u32 = 8u32; #[doc = "*Required features: 'Win32_Security_Authorization'*"] @@ -1420,7 +1552,40 @@ pub const AUTHZ_RM_FLAG_NO_AUDIT: AUTHZ_RESOURCE_MANAGER_FLAGS = 1u32; pub const AUTHZ_RM_FLAG_INITIALIZE_UNDER_IMPERSONATION: AUTHZ_RESOURCE_MANAGER_FLAGS = 2u32; #[doc = "*Required features: 'Win32_Security_Authorization'*"] pub const AUTHZ_RM_FLAG_NO_CENTRAL_ACCESS_POLICIES: AUTHZ_RESOURCE_MANAGER_FLAGS = 4u32; -pub type AUTHZ_RESOURCE_MANAGER_HANDLE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct AUTHZ_RESOURCE_MANAGER_HANDLE(pub isize); +impl AUTHZ_RESOURCE_MANAGER_HANDLE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for AUTHZ_RESOURCE_MANAGER_HANDLE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for AUTHZ_RESOURCE_MANAGER_HANDLE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for AUTHZ_RESOURCE_MANAGER_HANDLE {} +impl ::core::fmt::Debug for AUTHZ_RESOURCE_MANAGER_HANDLE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("AUTHZ_RESOURCE_MANAGER_HANDLE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for AUTHZ_RESOURCE_MANAGER_HANDLE { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_Security_Authorization', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] @@ -1715,7 +1880,40 @@ impl ::core::default::Default for AUTHZ_SECURITY_ATTRIBUTE_V1_0 { unsafe { ::core::mem::zeroed() } } } -pub type AUTHZ_SECURITY_EVENT_PROVIDER_HANDLE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct AUTHZ_SECURITY_EVENT_PROVIDER_HANDLE(pub isize); +impl AUTHZ_SECURITY_EVENT_PROVIDER_HANDLE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for AUTHZ_SECURITY_EVENT_PROVIDER_HANDLE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for AUTHZ_SECURITY_EVENT_PROVIDER_HANDLE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for AUTHZ_SECURITY_EVENT_PROVIDER_HANDLE {} +impl ::core::fmt::Debug for AUTHZ_SECURITY_EVENT_PROVIDER_HANDLE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("AUTHZ_SECURITY_EVENT_PROVIDER_HANDLE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for AUTHZ_SECURITY_EVENT_PROVIDER_HANDLE { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Security_Authorization'*"] pub type AUTHZ_SID_OPERATION = i32; #[doc = "*Required features: 'Win32_Security_Authorization'*"] diff --git a/crates/libs/windows/src/Windows/Win32/Security/Cryptography/mod.rs b/crates/libs/windows/src/Windows/Win32/Security/Cryptography/mod.rs index 25e87a41b0..a785a4e9d7 100644 --- a/crates/libs/windows/src/Windows/Win32/Security/Cryptography/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Security/Cryptography/mod.rs @@ -299,31 +299,31 @@ pub const BASIC_CONSTRAINTS_CERT_CHAIN_POLICY_END_ENTITY_FLAG: u32 = 1073741824u #[doc = "*Required features: 'Win32_Security_Cryptography'*"] pub const BCRYPTBUFFER_VERSION: u32 = 0u32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_3DES_112_CBC_ALG_HANDLE: BCRYPT_ALG_HANDLE = 369u32 as _; +pub const BCRYPT_3DES_112_CBC_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(369u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_3DES_112_CFB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 401u32 as _; +pub const BCRYPT_3DES_112_CFB_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(401u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_3DES_112_ECB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 385u32 as _; +pub const BCRYPT_3DES_112_ECB_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(385u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_3DES_CBC_ALG_HANDLE: BCRYPT_ALG_HANDLE = 321u32 as _; +pub const BCRYPT_3DES_CBC_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(321u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_3DES_CFB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 353u32 as _; +pub const BCRYPT_3DES_CFB_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(353u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_3DES_ECB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 337u32 as _; +pub const BCRYPT_3DES_ECB_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(337u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_AES_CBC_ALG_HANDLE: BCRYPT_ALG_HANDLE = 417u32 as _; +pub const BCRYPT_AES_CBC_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(417u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_AES_CCM_ALG_HANDLE: BCRYPT_ALG_HANDLE = 465u32 as _; +pub const BCRYPT_AES_CCM_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(465u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_AES_CFB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 449u32 as _; +pub const BCRYPT_AES_CFB_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(449u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_AES_CMAC_ALG_HANDLE: BCRYPT_ALG_HANDLE = 257u32 as _; +pub const BCRYPT_AES_CMAC_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(257u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_AES_ECB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 433u32 as _; +pub const BCRYPT_AES_ECB_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(433u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_AES_GCM_ALG_HANDLE: BCRYPT_ALG_HANDLE = 481u32 as _; +pub const BCRYPT_AES_GCM_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(481u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_AES_GMAC_ALG_HANDLE: BCRYPT_ALG_HANDLE = 273u32 as _; +pub const BCRYPT_AES_GMAC_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(273u32 as _); #[repr(C)] #[doc = "*Required features: 'Win32_Security_Cryptography', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] @@ -364,7 +364,40 @@ impl ::core::default::Default for BCRYPT_ALGORITHM_IDENTIFIER { unsafe { ::core::mem::zeroed() } } } -pub type BCRYPT_ALG_HANDLE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct BCRYPT_ALG_HANDLE(pub isize); +impl BCRYPT_ALG_HANDLE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for BCRYPT_ALG_HANDLE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for BCRYPT_ALG_HANDLE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for BCRYPT_ALG_HANDLE {} +impl ::core::fmt::Debug for BCRYPT_ALG_HANDLE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("BCRYPT_ALG_HANDLE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for BCRYPT_ALG_HANDLE { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_Security_Cryptography'*"] pub struct BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO { @@ -434,23 +467,23 @@ pub const BCRYPT_BUFFERS_LOCKED_FLAG: u32 = 64u32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] pub const BCRYPT_CAPI_AES_FLAG: u32 = 16u32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_CAPI_KDF_ALG_HANDLE: BCRYPT_ALG_HANDLE = 801u32 as _; +pub const BCRYPT_CAPI_KDF_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(801u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_CHACHA20_POLY1305_ALG_HANDLE: BCRYPT_ALG_HANDLE = 929u32 as _; +pub const BCRYPT_CHACHA20_POLY1305_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(929u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_DESX_CBC_ALG_HANDLE: BCRYPT_ALG_HANDLE = 545u32 as _; +pub const BCRYPT_DESX_CBC_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(545u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_DESX_CFB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 577u32 as _; +pub const BCRYPT_DESX_CFB_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(577u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_DESX_ECB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 561u32 as _; +pub const BCRYPT_DESX_ECB_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(561u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_DES_CBC_ALG_HANDLE: BCRYPT_ALG_HANDLE = 497u32 as _; +pub const BCRYPT_DES_CBC_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(497u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_DES_CFB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 529u32 as _; +pub const BCRYPT_DES_CFB_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(529u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_DES_ECB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 513u32 as _; +pub const BCRYPT_DES_ECB_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(513u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_DH_ALG_HANDLE: BCRYPT_ALG_HANDLE = 641u32 as _; +pub const BCRYPT_DH_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(641u32 as _); #[repr(C)] #[doc = "*Required features: 'Win32_Security_Cryptography'*"] pub struct BCRYPT_DH_KEY_BLOB { @@ -523,7 +556,7 @@ impl ::core::default::Default for BCRYPT_DH_PARAMETER_HEADER { } } #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_DSA_ALG_HANDLE: BCRYPT_ALG_HANDLE = 721u32 as _; +pub const BCRYPT_DSA_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(721u32 as _); #[repr(C)] #[doc = "*Required features: 'Win32_Security_Cryptography'*"] pub struct BCRYPT_DSA_KEY_BLOB { @@ -792,13 +825,13 @@ pub const BCRYPT_ECC_FULLKEY_BLOB_V1: u32 = 1u32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] pub const BCRYPT_ECC_PARAMETERS_MAGIC: u32 = 1346585413u32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_ECDH_ALG_HANDLE: BCRYPT_ALG_HANDLE = 657u32 as _; +pub const BCRYPT_ECDH_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(657u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_ECDH_P256_ALG_HANDLE: BCRYPT_ALG_HANDLE = 673u32 as _; +pub const BCRYPT_ECDH_P256_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(673u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_ECDH_P384_ALG_HANDLE: BCRYPT_ALG_HANDLE = 689u32 as _; +pub const BCRYPT_ECDH_P384_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(689u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_ECDH_P521_ALG_HANDLE: BCRYPT_ALG_HANDLE = 705u32 as _; +pub const BCRYPT_ECDH_P521_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(705u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] pub const BCRYPT_ECDH_PRIVATE_GENERIC_MAGIC: u32 = 1447772997u32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] @@ -816,13 +849,13 @@ pub const BCRYPT_ECDH_PUBLIC_P384_MAGIC: u32 = 860570437u32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] pub const BCRYPT_ECDH_PUBLIC_P521_MAGIC: u32 = 894124869u32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_ECDSA_ALG_HANDLE: BCRYPT_ALG_HANDLE = 241u32 as _; +pub const BCRYPT_ECDSA_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(241u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_ECDSA_P256_ALG_HANDLE: BCRYPT_ALG_HANDLE = 737u32 as _; +pub const BCRYPT_ECDSA_P256_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(737u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_ECDSA_P384_ALG_HANDLE: BCRYPT_ALG_HANDLE = 753u32 as _; +pub const BCRYPT_ECDSA_P384_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(753u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_ECDSA_P521_ALG_HANDLE: BCRYPT_ALG_HANDLE = 769u32 as _; +pub const BCRYPT_ECDSA_P521_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(769u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] pub const BCRYPT_ECDSA_PRIVATE_GENERIC_MAGIC: u32 = 1447314245u32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] @@ -854,21 +887,21 @@ pub const BCRYPT_HASH_OPERATION_HASH_DATA: BCRYPT_HASH_OPERATION_TYPE = 1i32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] pub const BCRYPT_HASH_OPERATION_FINISH_HASH: BCRYPT_HASH_OPERATION_TYPE = 2i32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_HKDF_ALG_HANDLE: BCRYPT_ALG_HANDLE = 913u32 as _; +pub const BCRYPT_HKDF_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(913u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_HMAC_MD2_ALG_HANDLE: BCRYPT_ALG_HANDLE = 289u32 as _; +pub const BCRYPT_HMAC_MD2_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(289u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_HMAC_MD4_ALG_HANDLE: BCRYPT_ALG_HANDLE = 305u32 as _; +pub const BCRYPT_HMAC_MD4_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(305u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_HMAC_MD5_ALG_HANDLE: BCRYPT_ALG_HANDLE = 145u32 as _; +pub const BCRYPT_HMAC_MD5_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(145u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_HMAC_SHA1_ALG_HANDLE: BCRYPT_ALG_HANDLE = 161u32 as _; +pub const BCRYPT_HMAC_SHA1_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(161u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_HMAC_SHA256_ALG_HANDLE: BCRYPT_ALG_HANDLE = 177u32 as _; +pub const BCRYPT_HMAC_SHA256_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(177u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_HMAC_SHA384_ALG_HANDLE: BCRYPT_ALG_HANDLE = 193u32 as _; +pub const BCRYPT_HMAC_SHA384_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(193u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_HMAC_SHA512_ALG_HANDLE: BCRYPT_ALG_HANDLE = 209u32 as _; +pub const BCRYPT_HMAC_SHA512_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(209u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] pub type BCRYPT_INTERFACE = u32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] @@ -990,7 +1023,40 @@ pub const BCRYPT_KEY_DATA_BLOB_VERSION1: u32 = 1u32; pub const BCRYPT_KEY_DERIVATION_INTERFACE: u32 = 7u32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] pub const BCRYPT_KEY_DERIVATION_OPERATION: u32 = 64u32; -pub type BCRYPT_KEY_HANDLE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct BCRYPT_KEY_HANDLE(pub isize); +impl BCRYPT_KEY_HANDLE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for BCRYPT_KEY_HANDLE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for BCRYPT_KEY_HANDLE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for BCRYPT_KEY_HANDLE {} +impl ::core::fmt::Debug for BCRYPT_KEY_HANDLE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("BCRYPT_KEY_HANDLE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for BCRYPT_KEY_HANDLE { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_Security_Cryptography'*"] pub struct BCRYPT_KEY_LENGTHS_STRUCT { @@ -1030,11 +1096,11 @@ pub const BCRYPT_KEY_VALIDATION_RANGE_AND_ORDER: u32 = 24u32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] pub const BCRYPT_KEY_VALIDATION_REGENERATE: u32 = 32u32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_MD2_ALG_HANDLE: BCRYPT_ALG_HANDLE = 1u32 as _; +pub const BCRYPT_MD2_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(1u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_MD4_ALG_HANDLE: BCRYPT_ALG_HANDLE = 17u32 as _; +pub const BCRYPT_MD4_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(17u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_MD5_ALG_HANDLE: BCRYPT_ALG_HANDLE = 33u32 as _; +pub const BCRYPT_MD5_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(33u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] pub const BCRYPT_MULTI_FLAG: u32 = 64u32; #[repr(C)] @@ -1236,7 +1302,7 @@ pub const BCRYPT_RNG_OPERATION: BCRYPT_OPERATION = 32u32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] pub const BCRYPT_PAD_PKCS1_OPTIONAL_HASH_OID: u32 = 16u32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_PBKDF2_ALG_HANDLE: BCRYPT_ALG_HANDLE = 817u32 as _; +pub const BCRYPT_PBKDF2_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(817u32 as _); #[repr(C)] #[doc = "*Required features: 'Win32_Security_Cryptography', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] @@ -1367,13 +1433,13 @@ pub const CRYPT_KM: BCRYPT_QUERY_PROVIDER_MODE = 2u32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] pub const CRYPT_MM: BCRYPT_QUERY_PROVIDER_MODE = 3u32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_RC2_CBC_ALG_HANDLE: BCRYPT_ALG_HANDLE = 593u32 as _; +pub const BCRYPT_RC2_CBC_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(593u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_RC2_CFB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 625u32 as _; +pub const BCRYPT_RC2_CFB_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(625u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_RC2_ECB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 609u32 as _; +pub const BCRYPT_RC2_ECB_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(609u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_RC4_ALG_HANDLE: BCRYPT_ALG_HANDLE = 113u32 as _; +pub const BCRYPT_RC4_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(113u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] pub type BCRYPT_RESOLVE_PROVIDERS_FLAGS = u32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] @@ -1381,7 +1447,7 @@ pub const CRYPT_ALL_FUNCTIONS: BCRYPT_RESOLVE_PROVIDERS_FLAGS = 1u32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] pub const CRYPT_ALL_PROVIDERS: BCRYPT_RESOLVE_PROVIDERS_FLAGS = 2u32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_RNG_ALG_HANDLE: BCRYPT_ALG_HANDLE = 129u32 as _; +pub const BCRYPT_RNG_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(129u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] pub const BCRYPT_RNG_USE_ENTROPY_IN_BUFFER: u32 = 1u32; #[repr(C)] @@ -1428,21 +1494,21 @@ pub const BCRYPT_RSAPRIVATE_MAGIC: BCRYPT_RSAKEY_BLOB_MAGIC = 843141970u32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] pub const BCRYPT_RSAFULLPRIVATE_MAGIC: BCRYPT_RSAKEY_BLOB_MAGIC = 859919186u32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_RSA_ALG_HANDLE: BCRYPT_ALG_HANDLE = 225u32 as _; +pub const BCRYPT_RSA_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(225u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_RSA_SIGN_ALG_HANDLE: BCRYPT_ALG_HANDLE = 785u32 as _; +pub const BCRYPT_RSA_SIGN_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(785u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_SHA1_ALG_HANDLE: BCRYPT_ALG_HANDLE = 49u32 as _; +pub const BCRYPT_SHA1_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(49u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_SHA256_ALG_HANDLE: BCRYPT_ALG_HANDLE = 65u32 as _; +pub const BCRYPT_SHA256_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(65u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_SHA384_ALG_HANDLE: BCRYPT_ALG_HANDLE = 81u32 as _; +pub const BCRYPT_SHA384_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(81u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_SHA512_ALG_HANDLE: BCRYPT_ALG_HANDLE = 97u32 as _; +pub const BCRYPT_SHA512_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(97u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_SP800108_CTR_HMAC_ALG_HANDLE: BCRYPT_ALG_HANDLE = 833u32 as _; +pub const BCRYPT_SP800108_CTR_HMAC_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(833u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_SP80056A_CONCAT_ALG_HANDLE: BCRYPT_ALG_HANDLE = 849u32 as _; +pub const BCRYPT_SP80056A_CONCAT_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(849u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] pub const BCRYPT_SUPPORTED_PAD_OAEP: u32 = 8u32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] @@ -1460,15 +1526,15 @@ pub const CRYPT_LOCAL: BCRYPT_TABLE = 1u32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] pub const CRYPT_DOMAIN: BCRYPT_TABLE = 2u32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_TLS1_1_KDF_ALG_HANDLE: BCRYPT_ALG_HANDLE = 865u32 as _; +pub const BCRYPT_TLS1_1_KDF_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(865u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_TLS1_2_KDF_ALG_HANDLE: BCRYPT_ALG_HANDLE = 881u32 as _; +pub const BCRYPT_TLS1_2_KDF_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(881u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography'*"] pub const BCRYPT_TLS_CBC_HMAC_VERIFY_FLAG: u32 = 4u32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] pub const BCRYPT_USE_SYSTEM_PREFERRED_RNG: u32 = 2u32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] -pub const BCRYPT_XTS_AES_ALG_HANDLE: BCRYPT_ALG_HANDLE = 897u32 as _; +pub const BCRYPT_XTS_AES_ALG_HANDLE: BCRYPT_ALG_HANDLE = BCRYPT_ALG_HANDLE(897u32 as _); #[doc = "*Required features: 'Win32_Security_Cryptography', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] #[inline] @@ -21712,8 +21778,74 @@ pub const DSA_HASH_ALGORITHM_SHA1: HASHALGORITHM_ENUM = 0i32; pub const DSA_HASH_ALGORITHM_SHA256: HASHALGORITHM_ENUM = 1i32; #[doc = "*Required features: 'Win32_Security_Cryptography'*"] pub const DSA_HASH_ALGORITHM_SHA512: HASHALGORITHM_ENUM = 2i32; -pub type HCERTCHAINENGINE = isize; -pub type HCRYPTASYNC = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HCERTCHAINENGINE(pub isize); +impl HCERTCHAINENGINE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HCERTCHAINENGINE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HCERTCHAINENGINE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HCERTCHAINENGINE {} +impl ::core::fmt::Debug for HCERTCHAINENGINE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HCERTCHAINENGINE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HCERTCHAINENGINE { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HCRYPTASYNC(pub isize); +impl HCRYPTASYNC { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HCRYPTASYNC { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HCRYPTASYNC { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HCRYPTASYNC {} +impl ::core::fmt::Debug for HCRYPTASYNC { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HCRYPTASYNC").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HCRYPTASYNC { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_Security_Cryptography'*"] pub struct HMAC_Info { diff --git a/crates/libs/windows/src/Windows/Win32/Security/mod.rs b/crates/libs/windows/src/Windows/Win32/Security/mod.rs index 5c8cf447a5..54c6b4f69c 100644 --- a/crates/libs/windows/src/Windows/Win32/Security/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Security/mod.rs @@ -2184,12 +2184,210 @@ pub unsafe fn GetWindowsAccountDomainSid<'a, Param0: ::windows::core::IntoParam< #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type HDIAGNOSTIC_DATA_QUERY_SESSION = isize; -pub type HDIAGNOSTIC_EVENT_CATEGORY_DESCRIPTION = isize; -pub type HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION = isize; -pub type HDIAGNOSTIC_EVENT_TAG_DESCRIPTION = isize; -pub type HDIAGNOSTIC_RECORD = isize; -pub type HDIAGNOSTIC_REPORT = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HDIAGNOSTIC_DATA_QUERY_SESSION(pub isize); +impl HDIAGNOSTIC_DATA_QUERY_SESSION { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HDIAGNOSTIC_DATA_QUERY_SESSION { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HDIAGNOSTIC_DATA_QUERY_SESSION { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HDIAGNOSTIC_DATA_QUERY_SESSION {} +impl ::core::fmt::Debug for HDIAGNOSTIC_DATA_QUERY_SESSION { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HDIAGNOSTIC_DATA_QUERY_SESSION").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HDIAGNOSTIC_DATA_QUERY_SESSION { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HDIAGNOSTIC_EVENT_CATEGORY_DESCRIPTION(pub isize); +impl HDIAGNOSTIC_EVENT_CATEGORY_DESCRIPTION { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HDIAGNOSTIC_EVENT_CATEGORY_DESCRIPTION { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HDIAGNOSTIC_EVENT_CATEGORY_DESCRIPTION { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HDIAGNOSTIC_EVENT_CATEGORY_DESCRIPTION {} +impl ::core::fmt::Debug for HDIAGNOSTIC_EVENT_CATEGORY_DESCRIPTION { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HDIAGNOSTIC_EVENT_CATEGORY_DESCRIPTION").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HDIAGNOSTIC_EVENT_CATEGORY_DESCRIPTION { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION(pub isize); +impl HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION {} +impl ::core::fmt::Debug for HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HDIAGNOSTIC_EVENT_TAG_DESCRIPTION(pub isize); +impl HDIAGNOSTIC_EVENT_TAG_DESCRIPTION { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HDIAGNOSTIC_EVENT_TAG_DESCRIPTION { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HDIAGNOSTIC_EVENT_TAG_DESCRIPTION { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HDIAGNOSTIC_EVENT_TAG_DESCRIPTION {} +impl ::core::fmt::Debug for HDIAGNOSTIC_EVENT_TAG_DESCRIPTION { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HDIAGNOSTIC_EVENT_TAG_DESCRIPTION").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HDIAGNOSTIC_EVENT_TAG_DESCRIPTION { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HDIAGNOSTIC_RECORD(pub isize); +impl HDIAGNOSTIC_RECORD { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HDIAGNOSTIC_RECORD { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HDIAGNOSTIC_RECORD { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HDIAGNOSTIC_RECORD {} +impl ::core::fmt::Debug for HDIAGNOSTIC_RECORD { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HDIAGNOSTIC_RECORD").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HDIAGNOSTIC_RECORD { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HDIAGNOSTIC_REPORT(pub isize); +impl HDIAGNOSTIC_REPORT { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HDIAGNOSTIC_REPORT { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HDIAGNOSTIC_REPORT { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HDIAGNOSTIC_REPORT {} +impl ::core::fmt::Debug for HDIAGNOSTIC_REPORT { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HDIAGNOSTIC_REPORT").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HDIAGNOSTIC_REPORT { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Security', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] #[inline] @@ -2753,8 +2951,74 @@ pub unsafe fn MapGenericMask(accessmask: *mut u32, genericmapping: *const GENERI #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type NCRYPT_DESCRIPTOR_HANDLE = isize; -pub type NCRYPT_STREAM_HANDLE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct NCRYPT_DESCRIPTOR_HANDLE(pub isize); +impl NCRYPT_DESCRIPTOR_HANDLE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for NCRYPT_DESCRIPTOR_HANDLE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for NCRYPT_DESCRIPTOR_HANDLE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for NCRYPT_DESCRIPTOR_HANDLE {} +impl ::core::fmt::Debug for NCRYPT_DESCRIPTOR_HANDLE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("NCRYPT_DESCRIPTOR_HANDLE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for NCRYPT_DESCRIPTOR_HANDLE { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct NCRYPT_STREAM_HANDLE(pub isize); +impl NCRYPT_STREAM_HANDLE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for NCRYPT_STREAM_HANDLE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for NCRYPT_STREAM_HANDLE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for NCRYPT_STREAM_HANDLE {} +impl ::core::fmt::Debug for NCRYPT_STREAM_HANDLE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("NCRYPT_STREAM_HANDLE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for NCRYPT_STREAM_HANDLE { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Security'*"] pub type OBJECT_SECURITY_INFORMATION = u32; #[doc = "*Required features: 'Win32_Security'*"] @@ -3115,8 +3379,74 @@ pub unsafe fn RtlNormalizeSecurityDescriptor<'a, Param4: ::windows::core::IntoPa #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type SAFER_LEVEL_HANDLE = isize; -pub type SC_HANDLE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct SAFER_LEVEL_HANDLE(pub isize); +impl SAFER_LEVEL_HANDLE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for SAFER_LEVEL_HANDLE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for SAFER_LEVEL_HANDLE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for SAFER_LEVEL_HANDLE {} +impl ::core::fmt::Debug for SAFER_LEVEL_HANDLE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("SAFER_LEVEL_HANDLE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for SAFER_LEVEL_HANDLE { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct SC_HANDLE(pub isize); +impl SC_HANDLE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for SC_HANDLE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for SC_HANDLE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for SC_HANDLE {} +impl ::core::fmt::Debug for SC_HANDLE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("SC_HANDLE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for SC_HANDLE { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_Security', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/Storage/CloudFilters/mod.rs b/crates/libs/windows/src/Windows/Win32/Storage/CloudFilters/mod.rs index 5a05e4de9b..70fab14e19 100644 --- a/crates/libs/windows/src/Windows/Win32/Storage/CloudFilters/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Storage/CloudFilters/mod.rs @@ -850,7 +850,40 @@ pub type CF_CALLBACK_VALIDATE_DATA_FLAGS = u32; pub const CF_CALLBACK_VALIDATE_DATA_FLAG_NONE: CF_CALLBACK_VALIDATE_DATA_FLAGS = 0u32; #[doc = "*Required features: 'Win32_Storage_CloudFilters'*"] pub const CF_CALLBACK_VALIDATE_DATA_FLAG_EXPLICIT_HYDRATION: CF_CALLBACK_VALIDATE_DATA_FLAGS = 2u32; -pub type CF_CONNECTION_KEY = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct CF_CONNECTION_KEY(pub isize); +impl CF_CONNECTION_KEY { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for CF_CONNECTION_KEY { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for CF_CONNECTION_KEY { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for CF_CONNECTION_KEY {} +impl ::core::fmt::Debug for CF_CONNECTION_KEY { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("CF_CONNECTION_KEY").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for CF_CONNECTION_KEY { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Storage_CloudFilters'*"] pub type CF_CONNECT_FLAGS = u32; #[doc = "*Required features: 'Win32_Storage_CloudFilters'*"] diff --git a/crates/libs/windows/src/Windows/Win32/Storage/Compression/mod.rs b/crates/libs/windows/src/Windows/Win32/Storage/Compression/mod.rs index f4964b2e45..8b506eda70 100644 --- a/crates/libs/windows/src/Windows/Win32/Storage/Compression/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Storage/Compression/mod.rs @@ -1,5 +1,38 @@ #![allow(non_snake_case, non_camel_case_types, non_upper_case_globals, clashing_extern_declarations, clippy::all)] -pub type COMPRESSOR_HANDLE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct COMPRESSOR_HANDLE(pub isize); +impl COMPRESSOR_HANDLE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for COMPRESSOR_HANDLE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for COMPRESSOR_HANDLE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for COMPRESSOR_HANDLE {} +impl ::core::fmt::Debug for COMPRESSOR_HANDLE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("COMPRESSOR_HANDLE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for COMPRESSOR_HANDLE { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Storage_Compression'*"] pub type COMPRESS_ALGORITHM = u32; #[doc = "*Required features: 'Win32_Storage_Compression'*"] diff --git a/crates/libs/windows/src/Windows/Win32/Storage/FileSystem/mod.rs b/crates/libs/windows/src/Windows/Win32/Storage/FileSystem/mod.rs index de7c0df671..e81e6ba381 100644 --- a/crates/libs/windows/src/Windows/Win32/Storage/FileSystem/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Storage/FileSystem/mod.rs @@ -5354,7 +5354,40 @@ pub unsafe fn FileTimeToLocalFileTime(lpfiletime: *const super::super::Foundatio #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type FindChangeNotificationHandle = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct FindChangeNotificationHandle(pub isize); +impl FindChangeNotificationHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for FindChangeNotificationHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for FindChangeNotificationHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for FindChangeNotificationHandle {} +impl ::core::fmt::Debug for FindChangeNotificationHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("FindChangeNotificationHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for FindChangeNotificationHandle { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Storage_FileSystem', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] #[inline] @@ -5385,8 +5418,74 @@ pub unsafe fn FindCloseChangeNotification<'a, Param0: ::windows::core::IntoParam #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type FindFileHandle = isize; -pub type FindFileNameHandle = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct FindFileHandle(pub isize); +impl FindFileHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for FindFileHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for FindFileHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for FindFileHandle {} +impl ::core::fmt::Debug for FindFileHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("FindFileHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for FindFileHandle { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct FindFileNameHandle(pub isize); +impl FindFileNameHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for FindFileNameHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for FindFileNameHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for FindFileNameHandle {} +impl ::core::fmt::Debug for FindFileNameHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("FindFileNameHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for FindFileNameHandle { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Storage_FileSystem', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] #[inline] @@ -5777,7 +5876,40 @@ pub unsafe fn FindNextVolumeW<'a, Param0: ::windows::core::IntoParam<'a, FindVol #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type FindStreamHandle = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct FindStreamHandle(pub isize); +impl FindStreamHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for FindStreamHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for FindStreamHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for FindStreamHandle {} +impl ::core::fmt::Debug for FindStreamHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("FindStreamHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for FindStreamHandle { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Storage_FileSystem', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] #[inline] @@ -5793,8 +5925,74 @@ pub unsafe fn FindVolumeClose<'a, Param0: ::windows::core::IntoParam<'a, FindVol #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type FindVolumeHandle = isize; -pub type FindVolumeMointPointHandle = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct FindVolumeHandle(pub isize); +impl FindVolumeHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for FindVolumeHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for FindVolumeHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for FindVolumeHandle {} +impl ::core::fmt::Debug for FindVolumeHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("FindVolumeHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for FindVolumeHandle { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct FindVolumeMointPointHandle(pub isize); +impl FindVolumeMointPointHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for FindVolumeMointPointHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for FindVolumeMointPointHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for FindVolumeMointPointHandle {} +impl ::core::fmt::Debug for FindVolumeMointPointHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("FindVolumeMointPointHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for FindVolumeMointPointHandle { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Storage_FileSystem', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] #[inline] diff --git a/crates/libs/windows/src/Windows/Win32/Storage/InstallableFileSystems/mod.rs b/crates/libs/windows/src/Windows/Win32/Storage/InstallableFileSystems/mod.rs index a013b67f36..b3420e654d 100644 --- a/crates/libs/windows/src/Windows/Win32/Storage/InstallableFileSystems/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Storage/InstallableFileSystems/mod.rs @@ -631,7 +631,40 @@ pub unsafe fn FilterFindFirst(dwinformationclass: FILTER_INFORMATION_CLASS, lpbu #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type FilterFindHandle = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct FilterFindHandle(pub isize); +impl FilterFindHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for FilterFindHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for FilterFindHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for FilterFindHandle {} +impl ::core::fmt::Debug for FilterFindHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("FilterFindHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for FilterFindHandle { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Storage_InstallableFileSystems', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] #[inline] @@ -751,7 +784,40 @@ pub unsafe fn FilterInstanceFindFirst<'a, Param0: ::windows::core::IntoParam<'a, #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type FilterInstanceFindHandle = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct FilterInstanceFindHandle(pub isize); +impl FilterInstanceFindHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for FilterInstanceFindHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for FilterInstanceFindHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for FilterInstanceFindHandle {} +impl ::core::fmt::Debug for FilterInstanceFindHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("FilterInstanceFindHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for FilterInstanceFindHandle { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Storage_InstallableFileSystems', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] #[inline] @@ -870,7 +936,40 @@ pub unsafe fn FilterVolumeFindFirst(dwinformationclass: FILTER_VOLUME_INFORMATIO #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type FilterVolumeFindHandle = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct FilterVolumeFindHandle(pub isize); +impl FilterVolumeFindHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for FilterVolumeFindHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for FilterVolumeFindHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for FilterVolumeFindHandle {} +impl ::core::fmt::Debug for FilterVolumeFindHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("FilterVolumeFindHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for FilterVolumeFindHandle { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Storage_InstallableFileSystems', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] #[inline] @@ -916,7 +1015,40 @@ pub unsafe fn FilterVolumeInstanceFindFirst<'a, Param0: ::windows::core::IntoPar #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type FilterVolumeInstanceFindHandle = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct FilterVolumeInstanceFindHandle(pub isize); +impl FilterVolumeInstanceFindHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for FilterVolumeInstanceFindHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for FilterVolumeInstanceFindHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for FilterVolumeInstanceFindHandle {} +impl ::core::fmt::Debug for FilterVolumeInstanceFindHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("FilterVolumeInstanceFindHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for FilterVolumeInstanceFindHandle { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Storage_InstallableFileSystems', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] #[inline] @@ -932,8 +1064,74 @@ pub unsafe fn FilterVolumeInstanceFindNext<'a, Param0: ::windows::core::IntoPara #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type HFILTER = isize; -pub type HFILTER_INSTANCE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HFILTER(pub isize); +impl HFILTER { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HFILTER { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HFILTER { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HFILTER {} +impl ::core::fmt::Debug for HFILTER { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HFILTER").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HFILTER { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HFILTER_INSTANCE(pub isize); +impl HFILTER_INSTANCE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HFILTER_INSTANCE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HFILTER_INSTANCE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HFILTER_INSTANCE {} +impl ::core::fmt::Debug for HFILTER_INSTANCE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HFILTER_INSTANCE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HFILTER_INSTANCE { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_Storage_InstallableFileSystems'*"] pub struct INSTANCE_AGGREGATE_STANDARD_INFORMATION { diff --git a/crates/libs/windows/src/Windows/Win32/Storage/Jet/mod.rs b/crates/libs/windows/src/Windows/Win32/Storage/Jet/mod.rs index 5448e893af..990c88188e 100644 --- a/crates/libs/windows/src/Windows/Win32/Storage/Jet/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Storage/Jet/mod.rs @@ -2811,7 +2811,40 @@ impl ::core::default::Default for JET_LOGTIME_1_0 { unsafe { ::core::mem::zeroed() } } } -pub type JET_LS = usize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct JET_LS(pub usize); +impl JET_LS { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for JET_LS { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for JET_LS { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for JET_LS {} +impl ::core::fmt::Debug for JET_LS { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("JET_LS").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for JET_LS { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Storage_Jet'*"] pub const JET_MAX_COMPUTERNAME_LENGTH: u32 = 15u32; #[doc = "*Required features: 'Win32_Storage_Jet'*"] @@ -3092,7 +3125,40 @@ impl ::core::default::Default for JET_OPERATIONCONTEXT { unsafe { ::core::mem::zeroed() } } } -pub type JET_OSSNAPID = usize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct JET_OSSNAPID(pub usize); +impl JET_OSSNAPID { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for JET_OSSNAPID { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for JET_OSSNAPID { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for JET_OSSNAPID {} +impl ::core::fmt::Debug for JET_OSSNAPID { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("JET_OSSNAPID").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for JET_OSSNAPID { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Storage_Jet'*"] pub const JET_OnlineDefragAll: u32 = 65535u32; #[doc = "*Required features: 'Win32_Storage_Jet'*"] diff --git a/crates/libs/windows/src/Windows/Win32/Storage/ProjectedFileSystem/mod.rs b/crates/libs/windows/src/Windows/Win32/Storage/ProjectedFileSystem/mod.rs index 721431fe14..4129f7e5b6 100644 --- a/crates/libs/windows/src/Windows/Win32/Storage/ProjectedFileSystem/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Storage/ProjectedFileSystem/mod.rs @@ -240,7 +240,40 @@ pub type PRJ_COMPLETE_COMMAND_TYPE = i32; pub const PRJ_COMPLETE_COMMAND_TYPE_NOTIFICATION: PRJ_COMPLETE_COMMAND_TYPE = 1i32; #[doc = "*Required features: 'Win32_Storage_ProjectedFileSystem'*"] pub const PRJ_COMPLETE_COMMAND_TYPE_ENUMERATION: PRJ_COMPLETE_COMMAND_TYPE = 2i32; -pub type PRJ_DIR_ENTRY_BUFFER_HANDLE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct PRJ_DIR_ENTRY_BUFFER_HANDLE(pub isize); +impl PRJ_DIR_ENTRY_BUFFER_HANDLE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for PRJ_DIR_ENTRY_BUFFER_HANDLE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for PRJ_DIR_ENTRY_BUFFER_HANDLE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for PRJ_DIR_ENTRY_BUFFER_HANDLE {} +impl ::core::fmt::Debug for PRJ_DIR_ENTRY_BUFFER_HANDLE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("PRJ_DIR_ENTRY_BUFFER_HANDLE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for PRJ_DIR_ENTRY_BUFFER_HANDLE { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Storage_ProjectedFileSystem', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] pub type PRJ_END_DIRECTORY_ENUMERATION_CB = ::core::option::Option ::windows::core::HRESULT>; @@ -417,7 +450,40 @@ pub type PRJ_GET_FILE_DATA_CB = ::core::option::Option ::windows::core::HRESULT>; -pub type PRJ_NAMESPACE_VIRTUALIZATION_CONTEXT = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct PRJ_NAMESPACE_VIRTUALIZATION_CONTEXT(pub isize); +impl PRJ_NAMESPACE_VIRTUALIZATION_CONTEXT { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for PRJ_NAMESPACE_VIRTUALIZATION_CONTEXT { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for PRJ_NAMESPACE_VIRTUALIZATION_CONTEXT { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for PRJ_NAMESPACE_VIRTUALIZATION_CONTEXT {} +impl ::core::fmt::Debug for PRJ_NAMESPACE_VIRTUALIZATION_CONTEXT { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("PRJ_NAMESPACE_VIRTUALIZATION_CONTEXT").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for PRJ_NAMESPACE_VIRTUALIZATION_CONTEXT { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Storage_ProjectedFileSystem'*"] pub type PRJ_NOTIFICATION = i32; #[doc = "*Required features: 'Win32_Storage_ProjectedFileSystem'*"] diff --git a/crates/libs/windows/src/Windows/Win32/Storage/StructuredStorage/mod.rs b/crates/libs/windows/src/Windows/Win32/Storage/StructuredStorage/mod.rs index 02f3cf85d2..6cd59bf3f3 100644 --- a/crates/libs/windows/src/Windows/Win32/Storage/StructuredStorage/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Storage/StructuredStorage/mod.rs @@ -1,6 +1,171 @@ #![allow(non_snake_case, non_camel_case_types, non_upper_case_globals, clashing_extern_declarations, clippy::all)] -pub type JET_API_PTR = usize; -pub type JET_HANDLE = usize; -pub type JET_INSTANCE = usize; -pub type JET_SESID = usize; -pub type JET_TABLEID = usize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct JET_API_PTR(pub usize); +impl JET_API_PTR { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for JET_API_PTR { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for JET_API_PTR { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for JET_API_PTR {} +impl ::core::fmt::Debug for JET_API_PTR { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("JET_API_PTR").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for JET_API_PTR { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct JET_HANDLE(pub usize); +impl JET_HANDLE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for JET_HANDLE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for JET_HANDLE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for JET_HANDLE {} +impl ::core::fmt::Debug for JET_HANDLE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("JET_HANDLE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for JET_HANDLE { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct JET_INSTANCE(pub usize); +impl JET_INSTANCE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for JET_INSTANCE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for JET_INSTANCE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for JET_INSTANCE {} +impl ::core::fmt::Debug for JET_INSTANCE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("JET_INSTANCE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for JET_INSTANCE { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct JET_SESID(pub usize); +impl JET_SESID { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for JET_SESID { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for JET_SESID { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for JET_SESID {} +impl ::core::fmt::Debug for JET_SESID { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("JET_SESID").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for JET_SESID { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct JET_TABLEID(pub usize); +impl JET_TABLEID { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for JET_TABLEID { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for JET_TABLEID { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for JET_TABLEID {} +impl ::core::fmt::Debug for JET_TABLEID { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("JET_TABLEID").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for JET_TABLEID { + type Abi = Self; +} diff --git a/crates/libs/windows/src/Windows/Win32/Storage/Xps/mod.rs b/crates/libs/windows/src/Windows/Win32/Storage/Xps/mod.rs index 07f898a71d..9400736456 100644 --- a/crates/libs/windows/src/Windows/Win32/Storage/Xps/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Storage/Xps/mod.rs @@ -296,7 +296,40 @@ pub unsafe fn ExtEscape<'a, Param0: ::windows::core::IntoParam<'a, super::super: #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type HPTPROVIDER = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HPTPROVIDER(pub isize); +impl HPTPROVIDER { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HPTPROVIDER { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HPTPROVIDER { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HPTPROVIDER {} +impl ::core::fmt::Debug for HPTPROVIDER { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HPTPROVIDER").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HPTPROVIDER { + type Abi = Self; +} #[doc = "*Required features: 'Win32_Storage_Xps'*"] #[repr(transparent)] pub struct IXpsDocumentPackageTarget(::windows::core::IUnknown); diff --git a/crates/libs/windows/src/Windows/Win32/System/Antimalware/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Antimalware/mod.rs index 773c5bacaf..bd242154d8 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Antimalware/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Antimalware/mod.rs @@ -474,8 +474,74 @@ pub unsafe fn AmsiUninitialize<'a, Param0: ::windows::core::IntoParam<'a, HAMSIC unimplemented!("Unsupported target OS"); } pub const CAntimalware: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xfdb00e52_a214_4aa1_8fba_4357bb0072ec); -pub type HAMSICONTEXT = isize; -pub type HAMSISESSION = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HAMSICONTEXT(pub isize); +impl HAMSICONTEXT { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HAMSICONTEXT { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HAMSICONTEXT { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HAMSICONTEXT {} +impl ::core::fmt::Debug for HAMSICONTEXT { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HAMSICONTEXT").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HAMSICONTEXT { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HAMSISESSION(pub isize); +impl HAMSISESSION { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HAMSISESSION { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HAMSISESSION { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HAMSISESSION {} +impl ::core::fmt::Debug for HAMSISESSION { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HAMSISESSION").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HAMSISESSION { + type Abi = Self; +} #[doc = "*Required features: 'Win32_System_Antimalware'*"] #[repr(transparent)] pub struct IAmsiStream(::windows::core::IUnknown); diff --git a/crates/libs/windows/src/Windows/Win32/System/ApplicationInstallationAndServicing/mod.rs b/crates/libs/windows/src/Windows/Win32/System/ApplicationInstallationAndServicing/mod.rs index 03c6a32b0f..f59dc4f8be 100644 --- a/crates/libs/windows/src/Windows/Win32/System/ApplicationInstallationAndServicing/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/ApplicationInstallationAndServicing/mod.rs @@ -6689,7 +6689,40 @@ impl ::core::default::Default for MSIFILEHASHINFO { unsafe { ::core::mem::zeroed() } } } -pub type MSIHANDLE = u32; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct MSIHANDLE(pub u32); +impl MSIHANDLE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for MSIHANDLE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for MSIHANDLE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for MSIHANDLE {} +impl ::core::fmt::Debug for MSIHANDLE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("MSIHANDLE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for MSIHANDLE { + type Abi = Self; +} #[doc = "*Required features: 'Win32_System_ApplicationInstallationAndServicing'*"] pub type MSIINSTALLCONTEXT = i32; #[doc = "*Required features: 'Win32_System_ApplicationInstallationAndServicing'*"] diff --git a/crates/libs/windows/src/Windows/Win32/System/Com/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Com/mod.rs index ad8ffedd33..432089f4e1 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Com/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Com/mod.rs @@ -1430,7 +1430,40 @@ pub const COWAIT_INPUTAVAILABLE: COWAIT_FLAGS = 4i32; pub const COWAIT_DISPATCH_CALLS: COWAIT_FLAGS = 8i32; #[doc = "*Required features: 'Win32_System_Com'*"] pub const COWAIT_DISPATCH_WINDOW_MESSAGES: COWAIT_FLAGS = 16i32; -pub type CO_DEVICE_CATALOG_COOKIE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct CO_DEVICE_CATALOG_COOKIE(pub isize); +impl CO_DEVICE_CATALOG_COOKIE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for CO_DEVICE_CATALOG_COOKIE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for CO_DEVICE_CATALOG_COOKIE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for CO_DEVICE_CATALOG_COOKIE {} +impl ::core::fmt::Debug for CO_DEVICE_CATALOG_COOKIE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("CO_DEVICE_CATALOG_COOKIE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for CO_DEVICE_CATALOG_COOKIE { + type Abi = Self; +} #[doc = "*Required features: 'Win32_System_Com'*"] pub type CO_MARSHALING_CONTEXT_ATTRIBUTES = i32; #[doc = "*Required features: 'Win32_System_Com'*"] @@ -1471,7 +1504,40 @@ pub const CO_MARSHALING_CONTEXT_ATTRIBUTE_RESERVED_16: CO_MARSHALING_CONTEXT_ATT pub const CO_MARSHALING_CONTEXT_ATTRIBUTE_RESERVED_17: CO_MARSHALING_CONTEXT_ATTRIBUTES = -2147483632i32; #[doc = "*Required features: 'Win32_System_Com'*"] pub const CO_MARSHALING_CONTEXT_ATTRIBUTE_RESERVED_18: CO_MARSHALING_CONTEXT_ATTRIBUTES = -2147483631i32; -pub type CO_MTA_USAGE_COOKIE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct CO_MTA_USAGE_COOKIE(pub isize); +impl CO_MTA_USAGE_COOKIE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for CO_MTA_USAGE_COOKIE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for CO_MTA_USAGE_COOKIE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for CO_MTA_USAGE_COOKIE {} +impl ::core::fmt::Debug for CO_MTA_USAGE_COOKIE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("CO_MTA_USAGE_COOKIE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for CO_MTA_USAGE_COOKIE { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_System_Com'*"] pub struct CSPLATFORM { diff --git a/crates/libs/windows/src/Windows/Win32/System/Console/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Console/mod.rs index b8ff164203..51240ce69e 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Console/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Console/mod.rs @@ -1293,7 +1293,40 @@ pub unsafe fn GetStdHandle(nstdhandle: STD_HANDLE) -> super::super::Foundation:: } #[doc = "*Required features: 'Win32_System_Console'*"] pub const HISTORY_NO_DUP_FLAG: u32 = 1u32; -pub type HPCON = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HPCON(pub isize); +impl HPCON { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HPCON { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HPCON { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HPCON {} +impl ::core::fmt::Debug for HPCON { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HPCON").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HPCON { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_System_Console', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/System/DataExchange/mod.rs b/crates/libs/windows/src/Windows/Win32/System/DataExchange/mod.rs index f33dec91e0..234d9746db 100644 --- a/crates/libs/windows/src/Windows/Win32/System/DataExchange/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/DataExchange/mod.rs @@ -1534,12 +1534,144 @@ pub unsafe fn GlobalGetAtomNameW(natom: u16, lpbuffer: super::super::Foundation: #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type HCONV = isize; -pub type HCONVLIST = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HCONV(pub isize); +impl HCONV { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HCONV { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HCONV { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HCONV {} +impl ::core::fmt::Debug for HCONV { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HCONV").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HCONV { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HCONVLIST(pub isize); +impl HCONVLIST { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HCONVLIST { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HCONVLIST { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HCONVLIST {} +impl ::core::fmt::Debug for HCONVLIST { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HCONVLIST").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HCONVLIST { + type Abi = Self; +} #[doc = "*Required features: 'Win32_System_DataExchange'*"] pub const HDATA_APPOWNED: u32 = 1u32; -pub type HDDEDATA = isize; -pub type HSZ = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HDDEDATA(pub isize); +impl HDDEDATA { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HDDEDATA { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HDDEDATA { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HDDEDATA {} +impl ::core::fmt::Debug for HDDEDATA { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HDDEDATA").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HDDEDATA { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HSZ(pub isize); +impl HSZ { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HSZ { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HSZ { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HSZ {} +impl ::core::fmt::Debug for HSZ { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HSZ").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HSZ { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_System_DataExchange'*"] pub struct HSZPAIR { diff --git a/crates/libs/windows/src/Windows/Win32/System/Diagnostics/Etw/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Diagnostics/Etw/mod.rs index 8c943242d2..fd09df333e 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Diagnostics/Etw/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Diagnostics/Etw/mod.rs @@ -4949,7 +4949,40 @@ pub const TDH_CONTEXT_POINTERSIZE: TDH_CONTEXT_TYPE = 3i32; pub const TDH_CONTEXT_PDB_PATH: TDH_CONTEXT_TYPE = 4i32; #[doc = "*Required features: 'Win32_System_Diagnostics_Etw'*"] pub const TDH_CONTEXT_MAXIMUM: TDH_CONTEXT_TYPE = 5i32; -pub type TDH_HANDLE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct TDH_HANDLE(pub isize); +impl TDH_HANDLE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for TDH_HANDLE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for TDH_HANDLE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for TDH_HANDLE {} +impl ::core::fmt::Debug for TDH_HANDLE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("TDH_HANDLE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for TDH_HANDLE { + type Abi = Self; +} #[doc = "*Required features: 'Win32_System_Diagnostics_Etw'*"] pub type TEMPLATE_FLAGS = i32; #[doc = "*Required features: 'Win32_System_Diagnostics_Etw'*"] diff --git a/crates/libs/windows/src/Windows/Win32/System/Diagnostics/ProcessSnapshotting/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Diagnostics/ProcessSnapshotting/mod.rs index 0d6458a1dc..36990f36b1 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Diagnostics/ProcessSnapshotting/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Diagnostics/ProcessSnapshotting/mod.rs @@ -1,6 +1,72 @@ #![allow(non_snake_case, non_camel_case_types, non_upper_case_globals, clashing_extern_declarations, clippy::all)] -pub type HPSS = isize; -pub type HPSSWALK = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HPSS(pub isize); +impl HPSS { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HPSS { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HPSS { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HPSS {} +impl ::core::fmt::Debug for HPSS { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HPSS").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HPSS { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HPSSWALK(pub isize); +impl HPSSWALK { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HPSSWALK { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HPSSWALK { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HPSSWALK {} +impl ::core::fmt::Debug for HPSSWALK { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HPSSWALK").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HPSSWALK { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_System_Diagnostics_ProcessSnapshotting'*"] pub struct PSS_ALLOCATOR { diff --git a/crates/libs/windows/src/Windows/Win32/System/ErrorReporting/mod.rs b/crates/libs/windows/src/Windows/Win32/System/ErrorReporting/mod.rs index 3d7c13b875..25c2b9d20a 100644 --- a/crates/libs/windows/src/Windows/Win32/System/ErrorReporting/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/ErrorReporting/mod.rs @@ -53,8 +53,74 @@ pub const frrvErrAnotherInstance: EFaultRepRetVal = 8i32; pub const frrvErrNoMemory: EFaultRepRetVal = 9i32; #[doc = "*Required features: 'Win32_System_ErrorReporting'*"] pub const frrvErrDoubleFault: EFaultRepRetVal = 10i32; -pub type HREPORT = isize; -pub type HREPORTSTORE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HREPORT(pub isize); +impl HREPORT { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HREPORT { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HREPORT { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HREPORT {} +impl ::core::fmt::Debug for HREPORT { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HREPORT").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HREPORT { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HREPORTSTORE(pub isize); +impl HREPORTSTORE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HREPORTSTORE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HREPORTSTORE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HREPORTSTORE {} +impl ::core::fmt::Debug for HREPORTSTORE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HREPORTSTORE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HREPORTSTORE { + type Abi = Self; +} #[doc = "*Required features: 'Win32_System_ErrorReporting', 'Win32_Foundation', 'Win32_System_Diagnostics_Debug', 'Win32_System_Kernel'*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Diagnostics_Debug", feature = "Win32_System_Kernel"))] pub type PFN_WER_RUNTIME_EXCEPTION_DEBUGGER_LAUNCH = ::core::option::Option ::windows::core::HRESULT>; diff --git a/crates/libs/windows/src/Windows/Win32/System/EventLog/mod.rs b/crates/libs/windows/src/Windows/Win32/System/EventLog/mod.rs index df3b614293..9b11410855 100644 --- a/crates/libs/windows/src/Windows/Win32/System/EventLog/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/EventLog/mod.rs @@ -775,8 +775,74 @@ pub const EVT_VARIANT_TYPE_ARRAY: u32 = 128u32; pub const EVT_VARIANT_TYPE_MASK: u32 = 127u32; #[doc = "*Required features: 'Win32_System_EventLog'*"] pub const EVT_WRITE_ACCESS: u32 = 2u32; -pub type EventLogHandle = isize; -pub type EventSourceHandle = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct EventLogHandle(pub isize); +impl EventLogHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for EventLogHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for EventLogHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for EventLogHandle {} +impl ::core::fmt::Debug for EventLogHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("EventLogHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for EventLogHandle { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct EventSourceHandle(pub isize); +impl EventSourceHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for EventSourceHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for EventSourceHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for EventSourceHandle {} +impl ::core::fmt::Debug for EventSourceHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("EventSourceHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for EventSourceHandle { + type Abi = Self; +} #[doc = "*Required features: 'Win32_System_EventLog', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] #[inline] diff --git a/crates/libs/windows/src/Windows/Win32/System/GroupPolicy/mod.rs b/crates/libs/windows/src/Windows/Win32/System/GroupPolicy/mod.rs index 737038710b..60708417e6 100644 --- a/crates/libs/windows/src/Windows/Win32/System/GroupPolicy/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/GroupPolicy/mod.rs @@ -55,7 +55,40 @@ pub unsafe fn CreateGPOLink<'a, Param0: ::windows::core::IntoParam<'a, super::su #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type CriticalPolicySectionHandle = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct CriticalPolicySectionHandle(pub isize); +impl CriticalPolicySectionHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for CriticalPolicySectionHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for CriticalPolicySectionHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for CriticalPolicySectionHandle {} +impl ::core::fmt::Debug for CriticalPolicySectionHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("CriticalPolicySectionHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for CriticalPolicySectionHandle { + type Abi = Self; +} #[doc = "*Required features: 'Win32_System_GroupPolicy', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] #[inline] diff --git a/crates/libs/windows/src/Windows/Win32/System/HostCompute/mod.rs b/crates/libs/windows/src/Windows/Win32/System/HostCompute/mod.rs index ede70bb119..65e23c4a19 100644 --- a/crates/libs/windows/src/Windows/Win32/System/HostCompute/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/HostCompute/mod.rs @@ -1,2 +1,35 @@ #![allow(non_snake_case, non_camel_case_types, non_upper_case_globals, clashing_extern_declarations, clippy::all)] -pub type HCS_CALLBACK = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HCS_CALLBACK(pub isize); +impl HCS_CALLBACK { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HCS_CALLBACK { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HCS_CALLBACK { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HCS_CALLBACK {} +impl ::core::fmt::Debug for HCS_CALLBACK { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HCS_CALLBACK").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HCS_CALLBACK { + type Abi = Self; +} diff --git a/crates/libs/windows/src/Windows/Win32/System/HostComputeSystem/mod.rs b/crates/libs/windows/src/Windows/Win32/System/HostComputeSystem/mod.rs index 90229993ce..b6582163f9 100644 --- a/crates/libs/windows/src/Windows/Win32/System/HostComputeSystem/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/HostComputeSystem/mod.rs @@ -170,7 +170,40 @@ pub type HCS_NOTIFICATION_FLAGS = i32; pub const HcsNotificationFlagSuccess: HCS_NOTIFICATION_FLAGS = 0i32; #[doc = "*Required features: 'Win32_System_HostComputeSystem'*"] pub const HcsNotificationFlagFailure: HCS_NOTIFICATION_FLAGS = -2147483648i32; -pub type HCS_OPERATION = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HCS_OPERATION(pub isize); +impl HCS_OPERATION { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HCS_OPERATION { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HCS_OPERATION { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HCS_OPERATION {} +impl ::core::fmt::Debug for HCS_OPERATION { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HCS_OPERATION").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HCS_OPERATION { + type Abi = Self; +} #[doc = "*Required features: 'Win32_System_HostComputeSystem'*"] pub type HCS_OPERATION_COMPLETION = ::core::option::Option; #[doc = "*Required features: 'Win32_System_HostComputeSystem'*"] @@ -209,7 +242,40 @@ pub const HcsOperationTypeGetProcessProperties: HCS_OPERATION_TYPE = 13i32; pub const HcsOperationTypeModifyProcess: HCS_OPERATION_TYPE = 14i32; #[doc = "*Required features: 'Win32_System_HostComputeSystem'*"] pub const HcsOperationTypeCrash: HCS_OPERATION_TYPE = 15i32; -pub type HCS_PROCESS = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HCS_PROCESS(pub isize); +impl HCS_PROCESS { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HCS_PROCESS { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HCS_PROCESS { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HCS_PROCESS {} +impl ::core::fmt::Debug for HCS_PROCESS { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HCS_PROCESS").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HCS_PROCESS { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_System_HostComputeSystem', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] @@ -252,7 +318,40 @@ impl ::core::default::Default for HCS_PROCESS_INFORMATION { unsafe { ::core::mem::zeroed() } } } -pub type HCS_SYSTEM = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HCS_SYSTEM(pub isize); +impl HCS_SYSTEM { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HCS_SYSTEM { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HCS_SYSTEM { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HCS_SYSTEM {} +impl ::core::fmt::Debug for HCS_SYSTEM { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HCS_SYSTEM").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HCS_SYSTEM { + type Abi = Self; +} #[doc = "*Required features: 'Win32_System_HostComputeSystem', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] #[inline] diff --git a/crates/libs/windows/src/Windows/Win32/System/Hypervisor/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Hypervisor/mod.rs index b9f42a487a..f7220fb56d 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Hypervisor/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Hypervisor/mod.rs @@ -3189,7 +3189,40 @@ pub const WHvNotificationPortTypeDoorbell: WHV_NOTIFICATION_PORT_TYPE = 4i32; pub type WHV_PARTITION_COUNTER_SET = i32; #[doc = "*Required features: 'Win32_System_Hypervisor'*"] pub const WHvPartitionCounterSetMemory: WHV_PARTITION_COUNTER_SET = 0i32; -pub type WHV_PARTITION_HANDLE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct WHV_PARTITION_HANDLE(pub isize); +impl WHV_PARTITION_HANDLE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for WHV_PARTITION_HANDLE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for WHV_PARTITION_HANDLE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for WHV_PARTITION_HANDLE {} +impl ::core::fmt::Debug for WHV_PARTITION_HANDLE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("WHV_PARTITION_HANDLE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for WHV_PARTITION_HANDLE { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_System_Hypervisor'*"] pub struct WHV_PARTITION_MEMORY_COUNTERS { diff --git a/crates/libs/windows/src/Windows/Win32/System/Memory/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Memory/mod.rs index 882d07af05..489e4344c2 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Memory/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Memory/mod.rs @@ -645,7 +645,40 @@ pub unsafe fn HeapFree<'a, Param0: ::windows::core::IntoParam<'a, HeapHandle>>(h #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type HeapHandle = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HeapHandle(pub isize); +impl HeapHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HeapHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HeapHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HeapHandle {} +impl ::core::fmt::Debug for HeapHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HeapHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HeapHandle { + type Abi = Self; +} #[doc = "*Required features: 'Win32_System_Memory', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] #[inline] diff --git a/crates/libs/windows/src/Windows/Win32/System/Performance/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Performance/mod.rs index 44ee834dd4..ceba6a6cdb 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Performance/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Performance/mod.rs @@ -11778,7 +11778,40 @@ pub unsafe fn PerfOpenQueryHandle<'a, Param0: ::windows::core::IntoParam<'a, sup #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type PerfProviderHandle = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct PerfProviderHandle(pub isize); +impl PerfProviderHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for PerfProviderHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for PerfProviderHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for PerfProviderHandle {} +impl ::core::fmt::Debug for PerfProviderHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("PerfProviderHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for PerfProviderHandle { + type Abi = Self; +} #[doc = "*Required features: 'Win32_System_Performance', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] #[inline] @@ -11823,7 +11856,40 @@ pub unsafe fn PerfQueryCounterSetRegistrationInfo<'a, Param0: ::windows::core::I #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type PerfQueryHandle = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct PerfQueryHandle(pub isize); +impl PerfQueryHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for PerfQueryHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for PerfQueryHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for PerfQueryHandle {} +impl ::core::fmt::Debug for PerfQueryHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("PerfQueryHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for PerfQueryHandle { + type Abi = Self; +} #[doc = "*Required features: 'Win32_System_Performance', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] #[inline] diff --git a/crates/libs/windows/src/Windows/Win32/System/Power/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Power/mod.rs index 97eb5c6e35..ac3dbd1e8d 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Power/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Power/mod.rs @@ -1273,7 +1273,40 @@ pub unsafe fn GetSystemPowerStatus(lpsystempowerstatus: *mut SYSTEM_POWER_STATUS #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type HPOWERNOTIFY = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HPOWERNOTIFY(pub isize); +impl HPOWERNOTIFY { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HPOWERNOTIFY { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HPOWERNOTIFY { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HPOWERNOTIFY {} +impl ::core::fmt::Debug for HPOWERNOTIFY { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HPOWERNOTIFY").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HPOWERNOTIFY { + type Abi = Self; +} #[doc = "*Required features: 'Win32_System_Power'*"] pub const IOCTL_ACPI_GET_REAL_TIME: u32 = 2703888u32; #[doc = "*Required features: 'Win32_System_Power'*"] diff --git a/crates/libs/windows/src/Windows/Win32/System/Registry/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Registry/mod.rs index 0a28d0db48..8e9544a507 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Registry/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Registry/mod.rs @@ -172,27 +172,60 @@ pub unsafe fn GetRegistryValueWithFallbackW<'a, Param0: ::windows::core::IntoPar #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type HKEY = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HKEY(pub isize); +impl HKEY { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HKEY { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HKEY { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HKEY {} +impl ::core::fmt::Debug for HKEY { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HKEY").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HKEY { + type Abi = Self; +} #[doc = "*Required features: 'Win32_System_Registry'*"] -pub const HKEY_CLASSES_ROOT: HKEY = -2147483648i32 as _; +pub const HKEY_CLASSES_ROOT: HKEY = HKEY(-2147483648i32 as _); #[doc = "*Required features: 'Win32_System_Registry'*"] -pub const HKEY_CURRENT_CONFIG: HKEY = -2147483643i32 as _; +pub const HKEY_CURRENT_CONFIG: HKEY = HKEY(-2147483643i32 as _); #[doc = "*Required features: 'Win32_System_Registry'*"] -pub const HKEY_CURRENT_USER: HKEY = -2147483647i32 as _; +pub const HKEY_CURRENT_USER: HKEY = HKEY(-2147483647i32 as _); #[doc = "*Required features: 'Win32_System_Registry'*"] -pub const HKEY_CURRENT_USER_LOCAL_SETTINGS: HKEY = -2147483641i32 as _; +pub const HKEY_CURRENT_USER_LOCAL_SETTINGS: HKEY = HKEY(-2147483641i32 as _); #[doc = "*Required features: 'Win32_System_Registry'*"] -pub const HKEY_DYN_DATA: HKEY = -2147483642i32 as _; +pub const HKEY_DYN_DATA: HKEY = HKEY(-2147483642i32 as _); #[doc = "*Required features: 'Win32_System_Registry'*"] -pub const HKEY_LOCAL_MACHINE: HKEY = -2147483646i32 as _; +pub const HKEY_LOCAL_MACHINE: HKEY = HKEY(-2147483646i32 as _); #[doc = "*Required features: 'Win32_System_Registry'*"] -pub const HKEY_PERFORMANCE_DATA: HKEY = -2147483644i32 as _; +pub const HKEY_PERFORMANCE_DATA: HKEY = HKEY(-2147483644i32 as _); #[doc = "*Required features: 'Win32_System_Registry'*"] -pub const HKEY_PERFORMANCE_NLSTEXT: HKEY = -2147483552i32 as _; +pub const HKEY_PERFORMANCE_NLSTEXT: HKEY = HKEY(-2147483552i32 as _); #[doc = "*Required features: 'Win32_System_Registry'*"] -pub const HKEY_PERFORMANCE_TEXT: HKEY = -2147483568i32 as _; +pub const HKEY_PERFORMANCE_TEXT: HKEY = HKEY(-2147483568i32 as _); #[doc = "*Required features: 'Win32_System_Registry'*"] -pub const HKEY_USERS: HKEY = -2147483645i32 as _; +pub const HKEY_USERS: HKEY = HKEY(-2147483645i32 as _); #[doc = "*Required features: 'Win32_System_Registry'*"] pub const IT_COMPACT: u32 = 0u32; #[doc = "*Required features: 'Win32_System_Registry'*"] diff --git a/crates/libs/windows/src/Windows/Win32/System/RemoteDesktop/mod.rs b/crates/libs/windows/src/Windows/Win32/System/RemoteDesktop/mod.rs index 79afde9721..aa533339ef 100644 --- a/crates/libs/windows/src/Windows/Win32/System/RemoteDesktop/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/RemoteDesktop/mod.rs @@ -539,7 +539,40 @@ pub const DOMAIN_LENGTH: u32 = 17u32; pub const FORCE_REJOIN: u32 = 2u32; #[doc = "*Required features: 'Win32_System_RemoteDesktop'*"] pub const FORCE_REJOIN_IN_CLUSTERMODE: u32 = 3u32; -pub type HwtsVirtualChannelHandle = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HwtsVirtualChannelHandle(pub isize); +impl HwtsVirtualChannelHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HwtsVirtualChannelHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HwtsVirtualChannelHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HwtsVirtualChannelHandle {} +impl ::core::fmt::Debug for HwtsVirtualChannelHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HwtsVirtualChannelHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HwtsVirtualChannelHandle { + type Abi = Self; +} #[doc = "*Required features: 'Win32_System_RemoteDesktop'*"] #[repr(transparent)] pub struct IADsTSUserEx(::windows::core::IUnknown); diff --git a/crates/libs/windows/src/Windows/Win32/System/Services/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Services/mod.rs index f003c0f705..cf35f1c1db 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Services/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Services/mod.rs @@ -2273,7 +2273,40 @@ pub const SERVICE_START_PENDING: SERVICE_STATUS_CURRENT_STATE = 2u32; pub const SERVICE_STOP_PENDING: SERVICE_STATUS_CURRENT_STATE = 3u32; #[doc = "*Required features: 'Win32_System_Services'*"] pub const SERVICE_STOPPED: SERVICE_STATUS_CURRENT_STATE = 1u32; -pub type SERVICE_STATUS_HANDLE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct SERVICE_STATUS_HANDLE(pub isize); +impl SERVICE_STATUS_HANDLE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for SERVICE_STATUS_HANDLE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for SERVICE_STATUS_HANDLE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for SERVICE_STATUS_HANDLE {} +impl ::core::fmt::Debug for SERVICE_STATUS_HANDLE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("SERVICE_STATUS_HANDLE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for SERVICE_STATUS_HANDLE { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_System_Services'*"] pub struct SERVICE_STATUS_PROCESS { diff --git a/crates/libs/windows/src/Windows/Win32/System/StationsAndDesktops/mod.rs b/crates/libs/windows/src/Windows/Win32/System/StationsAndDesktops/mod.rs index 95a24055ec..d6bc50b95a 100644 --- a/crates/libs/windows/src/Windows/Win32/System/StationsAndDesktops/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/StationsAndDesktops/mod.rs @@ -391,8 +391,74 @@ pub unsafe fn GetUserObjectInformationW<'a, Param0: ::windows::core::IntoParam<' #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type HDESK = isize; -pub type HWINSTA = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HDESK(pub isize); +impl HDESK { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HDESK { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HDESK { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HDESK {} +impl ::core::fmt::Debug for HDESK { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HDESK").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HDESK { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HWINSTA(pub isize); +impl HWINSTA { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HWINSTA { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HWINSTA { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HWINSTA {} +impl ::core::fmt::Debug for HWINSTA { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HWINSTA").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HWINSTA { + type Abi = Self; +} #[doc = "*Required features: 'Win32_System_StationsAndDesktops', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] #[inline] diff --git a/crates/libs/windows/src/Windows/Win32/System/SystemInformation/mod.rs b/crates/libs/windows/src/Windows/Win32/System/SystemInformation/mod.rs index 0387b6fce6..fe01345fee 100644 --- a/crates/libs/windows/src/Windows/Win32/System/SystemInformation/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/SystemInformation/mod.rs @@ -292,7 +292,40 @@ pub unsafe fn EnumSystemFirmwareTables(firmwaretableprovidersignature: FIRMWARE_ #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type FIRMWARE_TABLE_ID = u32; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct FIRMWARE_TABLE_ID(pub u32); +impl FIRMWARE_TABLE_ID { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for FIRMWARE_TABLE_ID { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for FIRMWARE_TABLE_ID { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for FIRMWARE_TABLE_ID {} +impl ::core::fmt::Debug for FIRMWARE_TABLE_ID { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("FIRMWARE_TABLE_ID").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for FIRMWARE_TABLE_ID { + type Abi = Self; +} #[doc = "*Required features: 'Win32_System_SystemInformation'*"] pub type FIRMWARE_TABLE_PROVIDER = u32; #[doc = "*Required features: 'Win32_System_SystemInformation'*"] diff --git a/crates/libs/windows/src/Windows/Win32/System/Threading/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Threading/mod.rs index 01ad819f0a..d527a2523e 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Threading/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Threading/mod.rs @@ -105,7 +105,40 @@ pub unsafe fn AttachThreadInput<'a, Param2: ::windows::core::IntoParam<'a, super #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type BoundaryDescriptorHandle = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct BoundaryDescriptorHandle(pub isize); +impl BoundaryDescriptorHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for BoundaryDescriptorHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for BoundaryDescriptorHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for BoundaryDescriptorHandle {} +impl ::core::fmt::Debug for BoundaryDescriptorHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("BoundaryDescriptorHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for BoundaryDescriptorHandle { + type Abi = Self; +} #[doc = "*Required features: 'Win32_System_Threading'*"] pub const CONDITION_VARIABLE_LOCKMODE_SHARED: u32 = 1u32; #[doc = "*Required features: 'Win32_System_Threading'*"] @@ -2609,7 +2642,40 @@ pub unsafe fn IsWow64Process2<'a, Param0: ::windows::core::IntoParam<'a, super:: } #[doc = "*Required features: 'Win32_System_Threading'*"] pub type LPFIBER_START_ROUTINE = ::core::option::Option; -pub type LPPROC_THREAD_ATTRIBUTE_LIST = *mut ::core::ffi::c_void; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct LPPROC_THREAD_ATTRIBUTE_LIST(pub *mut ::core::ffi::c_void); +impl LPPROC_THREAD_ATTRIBUTE_LIST { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for LPPROC_THREAD_ATTRIBUTE_LIST { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for LPPROC_THREAD_ATTRIBUTE_LIST { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for LPPROC_THREAD_ATTRIBUTE_LIST {} +impl ::core::fmt::Debug for LPPROC_THREAD_ATTRIBUTE_LIST { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("LPPROC_THREAD_ATTRIBUTE_LIST").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for LPPROC_THREAD_ATTRIBUTE_LIST { + type Abi = Self; +} #[doc = "*Required features: 'Win32_System_Threading'*"] pub type LPTHREAD_START_ROUTINE = ::core::option::Option u32>; #[doc = "*Required features: 'Win32_System_Threading', 'Win32_Foundation', 'Win32_System_Kernel'*"] @@ -2694,7 +2760,40 @@ impl ::core::default::Default for MEMORY_PRIORITY_INFORMATION { } #[doc = "*Required features: 'Win32_System_Threading'*"] pub const MUTEX_MODIFY_STATE: u32 = 1u32; -pub type NamespaceHandle = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct NamespaceHandle(pub isize); +impl NamespaceHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for NamespaceHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for NamespaceHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for NamespaceHandle {} +impl ::core::fmt::Debug for NamespaceHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("NamespaceHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for NamespaceHandle { + type Abi = Self; +} #[doc = "*Required features: 'Win32_System_Threading', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] #[inline] @@ -3719,7 +3818,40 @@ pub type PRTL_UMS_SCHEDULER_ENTRY_POINT = ::core::option::Option; #[doc = "*Required features: 'Win32_System_Threading'*"] pub type PTP_CLEANUP_GROUP_CANCEL_CALLBACK = ::core::option::Option; -pub type PTP_POOL = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct PTP_POOL(pub isize); +impl PTP_POOL { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for PTP_POOL { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for PTP_POOL { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for PTP_POOL {} +impl ::core::fmt::Debug for PTP_POOL { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("PTP_POOL").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for PTP_POOL { + type Abi = Self; +} #[doc = "*Required features: 'Win32_System_Threading'*"] pub type PTP_SIMPLE_CALLBACK = ::core::option::Option; #[doc = "*Required features: 'Win32_System_Threading'*"] @@ -5717,7 +5849,40 @@ pub unsafe fn TerminateThread<'a, Param0: ::windows::core::IntoParam<'a, super:: #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type TimerQueueHandle = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct TimerQueueHandle(pub isize); +impl TimerQueueHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for TimerQueueHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for TimerQueueHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for TimerQueueHandle {} +impl ::core::fmt::Debug for TimerQueueHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("TimerQueueHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for TimerQueueHandle { + type Abi = Self; +} #[doc = "*Required features: 'Win32_System_Threading'*"] #[inline] pub unsafe fn TlsAlloc() -> u32 { diff --git a/crates/libs/windows/src/Windows/Win32/System/WinRT/mod.rs b/crates/libs/windows/src/Windows/Win32/System/WinRT/mod.rs index fabf121e84..5043372f23 100644 --- a/crates/libs/windows/src/Windows/Win32/System/WinRT/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/WinRT/mod.rs @@ -43,7 +43,40 @@ pub const ACTIVATIONTYPE_FROM_STORAGE: ACTIVATIONTYPE = 4i32; pub const ACTIVATIONTYPE_FROM_STREAM: ACTIVATIONTYPE = 8i32; #[doc = "*Required features: 'Win32_System_WinRT'*"] pub const ACTIVATIONTYPE_FROM_FILE: ACTIVATIONTYPE = 16i32; -pub type APARTMENT_SHUTDOWN_REGISTRATION_COOKIE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct APARTMENT_SHUTDOWN_REGISTRATION_COOKIE(pub isize); +impl APARTMENT_SHUTDOWN_REGISTRATION_COOKIE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for APARTMENT_SHUTDOWN_REGISTRATION_COOKIE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for APARTMENT_SHUTDOWN_REGISTRATION_COOKIE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for APARTMENT_SHUTDOWN_REGISTRATION_COOKIE {} +impl ::core::fmt::Debug for APARTMENT_SHUTDOWN_REGISTRATION_COOKIE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("APARTMENT_SHUTDOWN_REGISTRATION_COOKIE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for APARTMENT_SHUTDOWN_REGISTRATION_COOKIE { + type Abi = Self; +} #[doc = "*Required features: 'Win32_System_WinRT'*"] pub type AgileReferenceOptions = i32; #[doc = "*Required features: 'Win32_System_WinRT'*"] @@ -259,7 +292,40 @@ pub unsafe fn GetRestrictedErrorInfo() -> ::windows::core::Result bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HSTRING_BUFFER { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HSTRING_BUFFER { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HSTRING_BUFFER {} +impl ::core::fmt::Debug for HSTRING_BUFFER { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HSTRING_BUFFER").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HSTRING_BUFFER { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_System_WinRT', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] @@ -3029,7 +3095,40 @@ pub type PINSPECT_HSTRING_CALLBACK = ::core::option::Option ::windows::core::HRESULT>; #[doc = "*Required features: 'Win32_System_WinRT'*"] pub type PINSPECT_MEMORY_CALLBACK = ::core::option::Option ::windows::core::HRESULT>; -pub type ROPARAMIIDHANDLE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct ROPARAMIIDHANDLE(pub isize); +impl ROPARAMIIDHANDLE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for ROPARAMIIDHANDLE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for ROPARAMIIDHANDLE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for ROPARAMIIDHANDLE {} +impl ::core::fmt::Debug for ROPARAMIIDHANDLE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("ROPARAMIIDHANDLE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for ROPARAMIIDHANDLE { + type Abi = Self; +} #[doc = "*Required features: 'Win32_System_WinRT'*"] pub type RO_ERROR_REPORTING_FLAGS = u32; #[doc = "*Required features: 'Win32_System_WinRT'*"] diff --git a/crates/libs/windows/src/Windows/Win32/System/WindowsProgramming/mod.rs b/crates/libs/windows/src/Windows/Win32/System/WindowsProgramming/mod.rs index 75bd78ec57..9b3e74a5ad 100644 --- a/crates/libs/windows/src/Windows/Win32/System/WindowsProgramming/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/WindowsProgramming/mod.rs @@ -1978,8 +1978,74 @@ impl ::core::default::Default for FEATURE_ERROR { unsafe { ::core::mem::zeroed() } } } -pub type FEATURE_STATE_CHANGE_SUBSCRIPTION = isize; -pub type FH_SERVICE_PIPE_HANDLE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct FEATURE_STATE_CHANGE_SUBSCRIPTION(pub isize); +impl FEATURE_STATE_CHANGE_SUBSCRIPTION { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for FEATURE_STATE_CHANGE_SUBSCRIPTION { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for FEATURE_STATE_CHANGE_SUBSCRIPTION { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for FEATURE_STATE_CHANGE_SUBSCRIPTION {} +impl ::core::fmt::Debug for FEATURE_STATE_CHANGE_SUBSCRIPTION { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("FEATURE_STATE_CHANGE_SUBSCRIPTION").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for FEATURE_STATE_CHANGE_SUBSCRIPTION { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct FH_SERVICE_PIPE_HANDLE(pub isize); +impl FH_SERVICE_PIPE_HANDLE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for FH_SERVICE_PIPE_HANDLE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for FH_SERVICE_PIPE_HANDLE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for FH_SERVICE_PIPE_HANDLE {} +impl ::core::fmt::Debug for FH_SERVICE_PIPE_HANDLE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("FH_SERVICE_PIPE_HANDLE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for FH_SERVICE_PIPE_HANDLE { + type Abi = Self; +} #[doc = "*Required features: 'Win32_System_WindowsProgramming'*"] pub const FIBER_FLAG_FLOAT_SWITCH: u32 = 1u32; #[repr(C)] @@ -2930,7 +2996,40 @@ pub unsafe fn GlobalWire(hmem: isize) -> *mut ::core::ffi::c_void { pub const HANJA_WINDOW: u32 = 2u32; #[doc = "*Required features: 'Win32_System_WindowsProgramming'*"] pub const HINSTANCE_ERROR: u32 = 32u32; -pub type HWINWATCH = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HWINWATCH(pub isize); +impl HWINWATCH { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HWINWATCH { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HWINWATCH { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HWINWATCH {} +impl ::core::fmt::Debug for HWINWATCH { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HWINWATCH").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HWINWATCH { + type Abi = Self; +} #[doc = "*Required features: 'Win32_System_WindowsProgramming'*"] pub const HW_PROFILE_GUIDLEN: u32 = 39u32; #[repr(C)] diff --git a/crates/libs/windows/src/Windows/Win32/UI/Accessibility/mod.rs b/crates/libs/windows/src/Windows/Win32/UI/Accessibility/mod.rs index f794629ab4..b375e001cb 100644 --- a/crates/libs/windows/src/Windows/Win32/UI/Accessibility/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/UI/Accessibility/mod.rs @@ -876,11 +876,176 @@ pub const HCF_INDICATOR: HIGHCONTRASTW_FLAGS = 32u32; pub const HCF_HOTKEYAVAILABLE: HIGHCONTRASTW_FLAGS = 64u32; #[doc = "*Required features: 'Win32_UI_Accessibility'*"] pub const HCF_OPTION_NOTHEMECHANGE: HIGHCONTRASTW_FLAGS = 4096u32; -pub type HUIAEVENT = isize; -pub type HUIANODE = isize; -pub type HUIAPATTERNOBJECT = isize; -pub type HUIATEXTRANGE = isize; -pub type HWINEVENTHOOK = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HUIAEVENT(pub isize); +impl HUIAEVENT { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HUIAEVENT { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HUIAEVENT { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HUIAEVENT {} +impl ::core::fmt::Debug for HUIAEVENT { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HUIAEVENT").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HUIAEVENT { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HUIANODE(pub isize); +impl HUIANODE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HUIANODE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HUIANODE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HUIANODE {} +impl ::core::fmt::Debug for HUIANODE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HUIANODE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HUIANODE { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HUIAPATTERNOBJECT(pub isize); +impl HUIAPATTERNOBJECT { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HUIAPATTERNOBJECT { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HUIAPATTERNOBJECT { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HUIAPATTERNOBJECT {} +impl ::core::fmt::Debug for HUIAPATTERNOBJECT { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HUIAPATTERNOBJECT").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HUIAPATTERNOBJECT { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HUIATEXTRANGE(pub isize); +impl HUIATEXTRANGE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HUIATEXTRANGE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HUIATEXTRANGE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HUIATEXTRANGE {} +impl ::core::fmt::Debug for HUIATEXTRANGE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HUIATEXTRANGE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HUIATEXTRANGE { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HWINEVENTHOOK(pub isize); +impl HWINEVENTHOOK { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HWINEVENTHOOK { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HWINEVENTHOOK { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HWINEVENTHOOK {} +impl ::core::fmt::Debug for HWINEVENTHOOK { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HWINEVENTHOOK").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HWINEVENTHOOK { + type Abi = Self; +} pub const HasKeyboardFocus_Property_GUID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xcf8afd39_3f46_4800_9656_b2bf12529905); pub const HeaderItem_Control_GUID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xe6bc12cb_7c8e_49cf_b168_4a93a32bebb0); pub const Header_Control_GUID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x5b90cbce_78fb_4614_82b6_554d74718e67); diff --git a/crates/libs/windows/src/Windows/Win32/UI/Animation/mod.rs b/crates/libs/windows/src/Windows/Win32/UI/Animation/mod.rs index 9e245868d7..7cb8e3b91f 100644 --- a/crates/libs/windows/src/Windows/Win32/UI/Animation/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/UI/Animation/mod.rs @@ -2733,7 +2733,40 @@ pub type UI_ANIMATION_IDLE_BEHAVIOR = i32; pub const UI_ANIMATION_IDLE_BEHAVIOR_CONTINUE: UI_ANIMATION_IDLE_BEHAVIOR = 0i32; #[doc = "*Required features: 'Win32_UI_Animation'*"] pub const UI_ANIMATION_IDLE_BEHAVIOR_DISABLE: UI_ANIMATION_IDLE_BEHAVIOR = 1i32; -pub type UI_ANIMATION_KEYFRAME = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct UI_ANIMATION_KEYFRAME(pub isize); +impl UI_ANIMATION_KEYFRAME { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for UI_ANIMATION_KEYFRAME { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for UI_ANIMATION_KEYFRAME { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for UI_ANIMATION_KEYFRAME {} +impl ::core::fmt::Debug for UI_ANIMATION_KEYFRAME { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("UI_ANIMATION_KEYFRAME").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for UI_ANIMATION_KEYFRAME { + type Abi = Self; +} #[doc = "*Required features: 'Win32_UI_Animation'*"] pub type UI_ANIMATION_MANAGER_STATUS = i32; #[doc = "*Required features: 'Win32_UI_Animation'*"] diff --git a/crates/libs/windows/src/Windows/Win32/UI/ColorSystem/mod.rs b/crates/libs/windows/src/Windows/Win32/UI/ColorSystem/mod.rs index 9f334a416d..96a8121ee5 100644 --- a/crates/libs/windows/src/Windows/Win32/UI/ColorSystem/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/UI/ColorSystem/mod.rs @@ -2073,7 +2073,40 @@ pub unsafe fn GetStandardColorSpaceProfileW<'a, Param0: ::windows::core::IntoPar #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type HCOLORSPACE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HCOLORSPACE(pub isize); +impl HCOLORSPACE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HCOLORSPACE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HCOLORSPACE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HCOLORSPACE {} +impl ::core::fmt::Debug for HCOLORSPACE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HCOLORSPACE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HCOLORSPACE { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_UI_ColorSystem'*"] pub struct HiFiCOLOR { diff --git a/crates/libs/windows/src/Windows/Win32/UI/Controls/mod.rs b/crates/libs/windows/src/Windows/Win32/UI/Controls/mod.rs index 8082101bf7..c65f489438 100644 --- a/crates/libs/windows/src/Windows/Win32/UI/Controls/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/UI/Controls/mod.rs @@ -4309,8 +4309,74 @@ pub const HDM_SETITEMW: u32 = 4620u32; pub const HDM_SETORDERARRAY: u32 = 4626u32; #[doc = "*Required features: 'Win32_UI_Controls'*"] pub const HDM_SETUNICODEFORMAT: u32 = 8197u32; -pub type HDPA = isize; -pub type HDSA = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HDPA(pub isize); +impl HDPA { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HDPA { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HDPA { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HDPA {} +impl ::core::fmt::Debug for HDPA { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HDPA").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HDPA { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HDSA(pub isize); +impl HDSA { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HDSA { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HDSA { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HDSA {} +impl ::core::fmt::Debug for HDSA { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HDSA").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HDSA { + type Abi = Self; +} #[doc = "*Required features: 'Win32_UI_Controls'*"] pub const HDSIL_NORMAL: u32 = 0u32; #[doc = "*Required features: 'Win32_UI_Controls'*"] @@ -4449,7 +4515,40 @@ pub const HHT_ONOVERFLOW: u32 = 16384u32; pub const HHT_TOLEFT: u32 = 2048u32; #[doc = "*Required features: 'Win32_UI_Controls'*"] pub const HHT_TORIGHT: u32 = 1024u32; -pub type HIMAGELIST = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HIMAGELIST(pub isize); +impl HIMAGELIST { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HIMAGELIST { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HIMAGELIST { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HIMAGELIST {} +impl ::core::fmt::Debug for HIMAGELIST { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HIMAGELIST").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HIMAGELIST { + type Abi = Self; +} #[doc = "*Required features: 'Win32_UI_Controls'*"] #[inline] pub unsafe fn HIMAGELIST_QueryInterface<'a, Param0: ::windows::core::IntoParam<'a, HIMAGELIST>>(himl: Param0, riid: *const ::windows::core::GUID, ppv: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { @@ -4506,9 +4605,108 @@ pub const HOTKEYF_EXT: u32 = 128u32; pub const HOTKEYF_SHIFT: u32 = 1u32; #[doc = "*Required features: 'Win32_UI_Controls'*"] pub const HOVER_DEFAULT: u32 = 4294967295u32; -pub type HPROPSHEETPAGE = isize; -pub type HSYNTHETICPOINTERDEVICE = isize; -pub type HTREEITEM = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HPROPSHEETPAGE(pub isize); +impl HPROPSHEETPAGE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HPROPSHEETPAGE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HPROPSHEETPAGE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HPROPSHEETPAGE {} +impl ::core::fmt::Debug for HPROPSHEETPAGE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HPROPSHEETPAGE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HPROPSHEETPAGE { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HSYNTHETICPOINTERDEVICE(pub isize); +impl HSYNTHETICPOINTERDEVICE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HSYNTHETICPOINTERDEVICE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HSYNTHETICPOINTERDEVICE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HSYNTHETICPOINTERDEVICE {} +impl ::core::fmt::Debug for HSYNTHETICPOINTERDEVICE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HSYNTHETICPOINTERDEVICE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HSYNTHETICPOINTERDEVICE { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HTREEITEM(pub isize); +impl HTREEITEM { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HTREEITEM { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HTREEITEM { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HTREEITEM {} +impl ::core::fmt::Debug for HTREEITEM { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HTREEITEM").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HTREEITEM { + type Abi = Self; +} #[doc = "*Required features: 'Win32_UI_Controls'*"] pub const HTTB_BACKGROUNDSEG: u32 = 0u32; #[doc = "*Required features: 'Win32_UI_Controls'*"] @@ -19041,13 +19239,13 @@ pub const TVIF_INTEGRAL: TVITEM_MASK = 128u32; #[doc = "*Required features: 'Win32_UI_Controls'*"] pub const TVIF_STATEEX: TVITEM_MASK = 256u32; #[doc = "*Required features: 'Win32_UI_Controls'*"] -pub const TVI_FIRST: HTREEITEM = -65535i32 as _; +pub const TVI_FIRST: HTREEITEM = HTREEITEM(-65535i32 as _); #[doc = "*Required features: 'Win32_UI_Controls'*"] -pub const TVI_LAST: HTREEITEM = -65534i32 as _; +pub const TVI_LAST: HTREEITEM = HTREEITEM(-65534i32 as _); #[doc = "*Required features: 'Win32_UI_Controls'*"] -pub const TVI_ROOT: HTREEITEM = -65536i32 as _; +pub const TVI_ROOT: HTREEITEM = HTREEITEM(-65536i32 as _); #[doc = "*Required features: 'Win32_UI_Controls'*"] -pub const TVI_SORT: HTREEITEM = -65533i32 as _; +pub const TVI_SORT: HTREEITEM = HTREEITEM(-65533i32 as _); #[doc = "*Required features: 'Win32_UI_Controls'*"] pub const TVM_CREATEDRAGIMAGE: u32 = 4370u32; #[doc = "*Required features: 'Win32_UI_Controls'*"] diff --git a/crates/libs/windows/src/Windows/Win32/UI/HiDpi/mod.rs b/crates/libs/windows/src/Windows/Win32/UI/HiDpi/mod.rs index e208508dbe..e2ecda7783 100644 --- a/crates/libs/windows/src/Windows/Win32/UI/HiDpi/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/UI/HiDpi/mod.rs @@ -57,17 +57,50 @@ pub const DPI_AWARENESS_UNAWARE: DPI_AWARENESS = 0i32; pub const DPI_AWARENESS_SYSTEM_AWARE: DPI_AWARENESS = 1i32; #[doc = "*Required features: 'Win32_UI_HiDpi'*"] pub const DPI_AWARENESS_PER_MONITOR_AWARE: DPI_AWARENESS = 2i32; -pub type DPI_AWARENESS_CONTEXT = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct DPI_AWARENESS_CONTEXT(pub isize); +impl DPI_AWARENESS_CONTEXT { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for DPI_AWARENESS_CONTEXT { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for DPI_AWARENESS_CONTEXT { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for DPI_AWARENESS_CONTEXT {} +impl ::core::fmt::Debug for DPI_AWARENESS_CONTEXT { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("DPI_AWARENESS_CONTEXT").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for DPI_AWARENESS_CONTEXT { + type Abi = Self; +} #[doc = "*Required features: 'Win32_UI_HiDpi'*"] -pub const DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE: DPI_AWARENESS_CONTEXT = -3i32 as _; +pub const DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE: DPI_AWARENESS_CONTEXT = DPI_AWARENESS_CONTEXT(-3i32 as _); #[doc = "*Required features: 'Win32_UI_HiDpi'*"] -pub const DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2: DPI_AWARENESS_CONTEXT = -4i32 as _; +pub const DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2: DPI_AWARENESS_CONTEXT = DPI_AWARENESS_CONTEXT(-4i32 as _); #[doc = "*Required features: 'Win32_UI_HiDpi'*"] -pub const DPI_AWARENESS_CONTEXT_SYSTEM_AWARE: DPI_AWARENESS_CONTEXT = -2i32 as _; +pub const DPI_AWARENESS_CONTEXT_SYSTEM_AWARE: DPI_AWARENESS_CONTEXT = DPI_AWARENESS_CONTEXT(-2i32 as _); #[doc = "*Required features: 'Win32_UI_HiDpi'*"] -pub const DPI_AWARENESS_CONTEXT_UNAWARE: DPI_AWARENESS_CONTEXT = -1i32 as _; +pub const DPI_AWARENESS_CONTEXT_UNAWARE: DPI_AWARENESS_CONTEXT = DPI_AWARENESS_CONTEXT(-1i32 as _); #[doc = "*Required features: 'Win32_UI_HiDpi'*"] -pub const DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED: DPI_AWARENESS_CONTEXT = -5i32 as _; +pub const DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED: DPI_AWARENESS_CONTEXT = DPI_AWARENESS_CONTEXT(-5i32 as _); #[doc = "*Required features: 'Win32_UI_HiDpi'*"] pub type DPI_HOSTING_BEHAVIOR = i32; #[doc = "*Required features: 'Win32_UI_HiDpi'*"] diff --git a/crates/libs/windows/src/Windows/Win32/UI/Input/Touch/mod.rs b/crates/libs/windows/src/Windows/Win32/UI/Input/Touch/mod.rs index 8a0852fea3..8210e05b29 100644 --- a/crates/libs/windows/src/Windows/Win32/UI/Input/Touch/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/UI/Input/Touch/mod.rs @@ -227,8 +227,74 @@ pub unsafe fn GetTouchInputInfo<'a, Param0: ::windows::core::IntoParam<'a, HTOUC #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type HGESTUREINFO = isize; -pub type HTOUCHINPUT = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HGESTUREINFO(pub isize); +impl HGESTUREINFO { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HGESTUREINFO { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HGESTUREINFO { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HGESTUREINFO {} +impl ::core::fmt::Debug for HGESTUREINFO { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HGESTUREINFO").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HGESTUREINFO { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HTOUCHINPUT(pub isize); +impl HTOUCHINPUT { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HTOUCHINPUT { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HTOUCHINPUT { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HTOUCHINPUT {} +impl ::core::fmt::Debug for HTOUCHINPUT { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HTOUCHINPUT").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HTOUCHINPUT { + type Abi = Self; +} #[doc = "*Required features: 'Win32_UI_Input_Touch'*"] #[repr(transparent)] pub struct IInertiaProcessor(::windows::core::IUnknown); diff --git a/crates/libs/windows/src/Windows/Win32/UI/Input/mod.rs b/crates/libs/windows/src/Windows/Win32/UI/Input/mod.rs index c7b7d38e6c..cd1fe32c09 100644 --- a/crates/libs/windows/src/Windows/Win32/UI/Input/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/UI/Input/mod.rs @@ -147,7 +147,40 @@ pub unsafe fn GetRegisteredRawInputDevices(prawinputdevices: *mut RAWINPUTDEVICE #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type HRAWINPUT = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HRAWINPUT(pub isize); +impl HRAWINPUT { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HRAWINPUT { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HRAWINPUT { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HRAWINPUT {} +impl ::core::fmt::Debug for HRAWINPUT { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HRAWINPUT").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HRAWINPUT { + type Abi = Self; +} #[doc = "*Required features: 'Win32_UI_Input'*"] pub type INPUT_MESSAGE_DEVICE_TYPE = i32; #[doc = "*Required features: 'Win32_UI_Input'*"] diff --git a/crates/libs/windows/src/Windows/Win32/UI/InteractionContext/mod.rs b/crates/libs/windows/src/Windows/Win32/UI/InteractionContext/mod.rs index b38d6ee3ff..3318edcb97 100644 --- a/crates/libs/windows/src/Windows/Win32/UI/InteractionContext/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/UI/InteractionContext/mod.rs @@ -249,7 +249,40 @@ pub unsafe fn GetTranslationParameterInteractionContext<'a, Param0: ::windows::c #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type HINTERACTIONCONTEXT = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HINTERACTIONCONTEXT(pub isize); +impl HINTERACTIONCONTEXT { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HINTERACTIONCONTEXT { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HINTERACTIONCONTEXT { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HINTERACTIONCONTEXT {} +impl ::core::fmt::Debug for HINTERACTIONCONTEXT { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HINTERACTIONCONTEXT").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HINTERACTIONCONTEXT { + type Abi = Self; +} #[doc = "*Required features: 'Win32_UI_InteractionContext'*"] pub type HOLD_PARAMETER = i32; #[doc = "*Required features: 'Win32_UI_InteractionContext'*"] diff --git a/crates/libs/windows/src/Windows/Win32/UI/Shell/mod.rs b/crates/libs/windows/src/Windows/Win32/UI/Shell/mod.rs index 04dc0a5b88..9b0bcea78b 100644 --- a/crates/libs/windows/src/Windows/Win32/UI/Shell/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/UI/Shell/mod.rs @@ -8945,7 +8945,40 @@ pub unsafe fn GetWindowSubclass<'a, Param0: ::windows::core::IntoParam<'a, super #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type HDROP = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HDROP(pub isize); +impl HDROP { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HDROP { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HDROP { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HDROP {} +impl ::core::fmt::Debug for HDROP { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HDROP").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HDROP { + type Abi = Self; +} #[repr(C)] #[doc = "*Required features: 'Win32_UI_Shell', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] @@ -9441,7 +9474,40 @@ pub const HGSC_VIDEOSLIBRARY: HOMEGROUPSHARINGCHOICES = 4i32; pub const HGSC_DOCUMENTSLIBRARY: HOMEGROUPSHARINGCHOICES = 8i32; #[doc = "*Required features: 'Win32_UI_Shell'*"] pub const HGSC_PRINTERS: HOMEGROUPSHARINGCHOICES = 16i32; -pub type HPSXA = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HPSXA(pub isize); +impl HPSXA { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HPSXA { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HPSXA { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HPSXA {} +impl ::core::fmt::Debug for HPSXA { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HPSXA").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HPSXA { + type Abi = Self; +} #[doc = "*Required features: 'Win32_UI_Shell'*"] #[inline] pub unsafe fn HashData(pbdata: *const u8, cbdata: u32, pbhash: *mut u8, cbhash: u32) -> ::windows::core::Result<()> { @@ -70408,7 +70474,40 @@ pub unsafe fn SetWindowSubclass<'a, Param0: ::windows::core::IntoParam<'a, super #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type ShFindChangeNotificationHandle = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct ShFindChangeNotificationHandle(pub isize); +impl ShFindChangeNotificationHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for ShFindChangeNotificationHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for ShFindChangeNotificationHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for ShFindChangeNotificationHandle {} +impl ::core::fmt::Debug for ShFindChangeNotificationHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("ShFindChangeNotificationHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for ShFindChangeNotificationHandle { + type Abi = Self; +} pub const SharedBitmap: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x4db26476_6787_4046_b836_e8412a9e8a27); pub const SharingConfigurationManager: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x49f371e1_8c5c_4d9c_9a3b_54a6827f513c); pub const Shell: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x13709620_c279_11ce_a49e_444553540000); diff --git a/crates/libs/windows/src/Windows/Win32/UI/TabletPC/mod.rs b/crates/libs/windows/src/Windows/Win32/UI/TabletPC/mod.rs index b780f8f076..bbce24c768 100644 --- a/crates/libs/windows/src/Windows/Win32/UI/TabletPC/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/UI/TabletPC/mod.rs @@ -1815,11 +1815,176 @@ pub unsafe fn GetUnicodeRanges<'a, Param0: ::windows::core::IntoParam<'a, HRECOG #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type HRECOALT = isize; -pub type HRECOCONTEXT = isize; -pub type HRECOGNIZER = isize; -pub type HRECOLATTICE = isize; -pub type HRECOWORDLIST = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HRECOALT(pub isize); +impl HRECOALT { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HRECOALT { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HRECOALT { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HRECOALT {} +impl ::core::fmt::Debug for HRECOALT { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HRECOALT").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HRECOALT { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HRECOCONTEXT(pub isize); +impl HRECOCONTEXT { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HRECOCONTEXT { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HRECOCONTEXT { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HRECOCONTEXT {} +impl ::core::fmt::Debug for HRECOCONTEXT { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HRECOCONTEXT").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HRECOCONTEXT { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HRECOGNIZER(pub isize); +impl HRECOGNIZER { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HRECOGNIZER { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HRECOGNIZER { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HRECOGNIZER {} +impl ::core::fmt::Debug for HRECOGNIZER { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HRECOGNIZER").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HRECOGNIZER { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HRECOLATTICE(pub isize); +impl HRECOLATTICE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HRECOLATTICE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HRECOLATTICE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HRECOLATTICE {} +impl ::core::fmt::Debug for HRECOLATTICE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HRECOLATTICE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HRECOLATTICE { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HRECOWORDLIST(pub isize); +impl HRECOWORDLIST { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HRECOWORDLIST { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HRECOWORDLIST { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HRECOWORDLIST {} +impl ::core::fmt::Debug for HRECOWORDLIST { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HRECOWORDLIST").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HRECOWORDLIST { + type Abi = Self; +} pub const HandwrittenTextInsertion: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x9f074ee2_e6e9_4d8a_a047_eb5b5c3c55da); #[doc = "*Required features: 'Win32_UI_TabletPC'*"] #[repr(transparent)] diff --git a/crates/libs/windows/src/Windows/Win32/UI/TextServices/mod.rs b/crates/libs/windows/src/Windows/Win32/UI/TextServices/mod.rs index 385d6deb36..01061cbb12 100644 --- a/crates/libs/windows/src/Windows/Win32/UI/TextServices/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/UI/TextServices/mod.rs @@ -121,7 +121,40 @@ pub const GUID_TS_SERVICE_DATAOBJECT: ::windows::core::GUID = ::windows::core::G pub const GXFPF_NEAREST: u32 = 2u32; #[doc = "*Required features: 'Win32_UI_TextServices'*"] pub const GXFPF_ROUND_NEAREST: u32 = 1u32; -pub type HKL = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HKL(pub isize); +impl HKL { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HKL { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HKL { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HKL {} +impl ::core::fmt::Debug for HKL { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HKL").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HKL { + type Abi = Self; +} #[doc = "*Required features: 'Win32_UI_TextServices'*"] #[repr(transparent)] pub struct IAccClientDocMgr(::windows::core::IUnknown); diff --git a/crates/libs/windows/src/Windows/Win32/UI/WindowsAndMessaging/mod.rs b/crates/libs/windows/src/Windows/Win32/UI/WindowsAndMessaging/mod.rs index 3224e8235e..46215bc540 100644 --- a/crates/libs/windows/src/Windows/Win32/UI/WindowsAndMessaging/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/UI/WindowsAndMessaging/mod.rs @@ -4876,7 +4876,40 @@ pub unsafe fn GetWindowWord<'a, Param0: ::windows::core::IntoParam<'a, super::su #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type HACCEL = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HACCEL(pub isize); +impl HACCEL { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HACCEL { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HACCEL { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HACCEL {} +impl ::core::fmt::Debug for HACCEL { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HACCEL").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HACCEL { + type Abi = Self; +} #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging'*"] pub type HANDEDNESS = i32; #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging'*"] @@ -4926,37 +4959,37 @@ impl ::core::default::Default for HARDWAREHOOKSTRUCT { } #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging', 'Win32_Graphics_Gdi'*"] #[cfg(feature = "Win32_Graphics_Gdi")] -pub const HBMMENU_CALLBACK: super::super::Graphics::Gdi::HBITMAP = -1i32 as _; +pub const HBMMENU_CALLBACK: super::super::Graphics::Gdi::HBITMAP = super::super::Graphics::Gdi::HBITMAP(-1i32 as _); #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging', 'Win32_Graphics_Gdi'*"] #[cfg(feature = "Win32_Graphics_Gdi")] -pub const HBMMENU_MBAR_CLOSE: super::super::Graphics::Gdi::HBITMAP = 5i32 as _; +pub const HBMMENU_MBAR_CLOSE: super::super::Graphics::Gdi::HBITMAP = super::super::Graphics::Gdi::HBITMAP(5i32 as _); #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging', 'Win32_Graphics_Gdi'*"] #[cfg(feature = "Win32_Graphics_Gdi")] -pub const HBMMENU_MBAR_CLOSE_D: super::super::Graphics::Gdi::HBITMAP = 6i32 as _; +pub const HBMMENU_MBAR_CLOSE_D: super::super::Graphics::Gdi::HBITMAP = super::super::Graphics::Gdi::HBITMAP(6i32 as _); #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging', 'Win32_Graphics_Gdi'*"] #[cfg(feature = "Win32_Graphics_Gdi")] -pub const HBMMENU_MBAR_MINIMIZE: super::super::Graphics::Gdi::HBITMAP = 3i32 as _; +pub const HBMMENU_MBAR_MINIMIZE: super::super::Graphics::Gdi::HBITMAP = super::super::Graphics::Gdi::HBITMAP(3i32 as _); #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging', 'Win32_Graphics_Gdi'*"] #[cfg(feature = "Win32_Graphics_Gdi")] -pub const HBMMENU_MBAR_MINIMIZE_D: super::super::Graphics::Gdi::HBITMAP = 7i32 as _; +pub const HBMMENU_MBAR_MINIMIZE_D: super::super::Graphics::Gdi::HBITMAP = super::super::Graphics::Gdi::HBITMAP(7i32 as _); #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging', 'Win32_Graphics_Gdi'*"] #[cfg(feature = "Win32_Graphics_Gdi")] -pub const HBMMENU_MBAR_RESTORE: super::super::Graphics::Gdi::HBITMAP = 2i32 as _; +pub const HBMMENU_MBAR_RESTORE: super::super::Graphics::Gdi::HBITMAP = super::super::Graphics::Gdi::HBITMAP(2i32 as _); #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging', 'Win32_Graphics_Gdi'*"] #[cfg(feature = "Win32_Graphics_Gdi")] -pub const HBMMENU_POPUP_CLOSE: super::super::Graphics::Gdi::HBITMAP = 8i32 as _; +pub const HBMMENU_POPUP_CLOSE: super::super::Graphics::Gdi::HBITMAP = super::super::Graphics::Gdi::HBITMAP(8i32 as _); #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging', 'Win32_Graphics_Gdi'*"] #[cfg(feature = "Win32_Graphics_Gdi")] -pub const HBMMENU_POPUP_MAXIMIZE: super::super::Graphics::Gdi::HBITMAP = 10i32 as _; +pub const HBMMENU_POPUP_MAXIMIZE: super::super::Graphics::Gdi::HBITMAP = super::super::Graphics::Gdi::HBITMAP(10i32 as _); #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging', 'Win32_Graphics_Gdi'*"] #[cfg(feature = "Win32_Graphics_Gdi")] -pub const HBMMENU_POPUP_MINIMIZE: super::super::Graphics::Gdi::HBITMAP = 11i32 as _; +pub const HBMMENU_POPUP_MINIMIZE: super::super::Graphics::Gdi::HBITMAP = super::super::Graphics::Gdi::HBITMAP(11i32 as _); #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging', 'Win32_Graphics_Gdi'*"] #[cfg(feature = "Win32_Graphics_Gdi")] -pub const HBMMENU_POPUP_RESTORE: super::super::Graphics::Gdi::HBITMAP = 9i32 as _; +pub const HBMMENU_POPUP_RESTORE: super::super::Graphics::Gdi::HBITMAP = super::super::Graphics::Gdi::HBITMAP(9i32 as _); #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging', 'Win32_Graphics_Gdi'*"] #[cfg(feature = "Win32_Graphics_Gdi")] -pub const HBMMENU_SYSTEM: super::super::Graphics::Gdi::HBITMAP = 1i32 as _; +pub const HBMMENU_SYSTEM: super::super::Graphics::Gdi::HBITMAP = super::super::Graphics::Gdi::HBITMAP(1i32 as _); #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging'*"] pub const HCBT_ACTIVATE: u32 = 5u32; #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging'*"] @@ -4981,7 +5014,45 @@ pub const HCBT_SYSCOMMAND: u32 = 8u32; pub const HCF_DEFAULTDESKTOP: u32 = 512u32; #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging'*"] pub const HCF_LOGONDESKTOP: u32 = 256u32; -pub type HCURSOR = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HCURSOR(pub isize); +impl HCURSOR { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HCURSOR { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HCURSOR { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HCURSOR {} +impl ::core::fmt::Debug for HCURSOR { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HCURSOR").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HCURSOR { + type Abi = Self; +} +impl<'a> ::windows::core::IntoParam<'a, HICON> for HCURSOR { + fn into_param(self) -> ::windows::core::Param<'a, HICON> { + ::windows::core::Param::Owned(HICON(self.0)) + } +} #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging'*"] pub const HC_ACTION: u32 = 0u32; #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging'*"] @@ -5042,15 +5113,114 @@ pub const HELP_TCARD_DATA: u32 = 16u32; pub const HELP_TCARD_OTHER_CALLER: u32 = 17u32; #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging'*"] pub const HELP_WM_HELP: u32 = 12u32; -pub type HHOOK = isize; -pub type HICON = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HHOOK(pub isize); +impl HHOOK { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HHOOK { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HHOOK { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HHOOK {} +impl ::core::fmt::Debug for HHOOK { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HHOOK").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HHOOK { + type Abi = Self; +} +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HICON(pub isize); +impl HICON { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HICON { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HICON { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HICON {} +impl ::core::fmt::Debug for HICON { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HICON").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HICON { + type Abi = Self; +} #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging'*"] pub const HIDE_WINDOW: u32 = 0u32; #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging'*"] pub const HKL_NEXT: u32 = 1u32; #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging'*"] pub const HKL_PREV: u32 = 0u32; -pub type HMENU = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HMENU(pub isize); +impl HMENU { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HMENU { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HMENU { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HMENU {} +impl ::core::fmt::Debug for HMENU { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HMENU").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HMENU { + type Abi = Self; +} #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] pub type HOOKPROC = ::core::option::Option super::super::Foundation::LRESULT>; @@ -5146,22 +5316,22 @@ pub const HTVSCROLL: u32 = 7u32; pub const HTZOOM: u32 = 9u32; #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] -pub const HWND_BOTTOM: super::super::Foundation::HWND = 1i32 as _; +pub const HWND_BOTTOM: super::super::Foundation::HWND = super::super::Foundation::HWND(1i32 as _); #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] -pub const HWND_DESKTOP: super::super::Foundation::HWND = 0i32 as _; +pub const HWND_DESKTOP: super::super::Foundation::HWND = super::super::Foundation::HWND(0i32 as _); #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] -pub const HWND_MESSAGE: super::super::Foundation::HWND = -3i32 as _; +pub const HWND_MESSAGE: super::super::Foundation::HWND = super::super::Foundation::HWND(-3i32 as _); #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] -pub const HWND_NOTOPMOST: super::super::Foundation::HWND = -2i32 as _; +pub const HWND_NOTOPMOST: super::super::Foundation::HWND = super::super::Foundation::HWND(-2i32 as _); #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] -pub const HWND_TOP: super::super::Foundation::HWND = 0i32 as _; +pub const HWND_TOP: super::super::Foundation::HWND = super::super::Foundation::HWND(0i32 as _); #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] -pub const HWND_TOPMOST: super::super::Foundation::HWND = -1i32 as _; +pub const HWND_TOPMOST: super::super::Foundation::HWND = super::super::Foundation::HWND(-1i32 as _); #[doc = "*Required features: 'Win32_UI_WindowsAndMessaging', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] #[inline] diff --git a/crates/libs/windows/src/core/bindings.rs b/crates/libs/windows/src/core/bindings.rs index bf8dd472d5..d5a73f15a7 100644 --- a/crates/libs/windows/src/core/bindings.rs +++ b/crates/libs/windows/src/core/bindings.rs @@ -1394,7 +1394,40 @@ impl ::core::fmt::Debug for HANDLE { unsafe impl ::windows::core::Abi for HANDLE { type Abi = Self; } -pub type HINSTANCE = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HINSTANCE(pub isize); +impl HINSTANCE { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HINSTANCE { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HINSTANCE { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HINSTANCE {} +impl ::core::fmt::Debug for HINSTANCE { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HINSTANCE").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HINSTANCE { + type Abi = Self; +} #[repr(transparent)] pub struct PSTR(pub *mut u8); impl PSTR { @@ -1889,7 +1922,40 @@ pub unsafe fn HeapFree<'a, Param0: ::windows::core::IntoParam<'a, HeapHandle>>(h #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } -pub type HeapHandle = isize; +#[repr(transparent)] +#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] +pub struct HeapHandle(pub isize); +impl HeapHandle { + pub fn is_invalid(&self) -> bool { + *self == unsafe { ::core::mem::zeroed() } + } + pub fn ok(self) -> ::windows::core::Result { + if !self.is_invalid() { + Ok(self) + } else { + Err(::windows::core::Error::from_win32()) + } + } +} +impl ::core::default::Default for HeapHandle { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +impl ::core::clone::Clone for HeapHandle { + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for HeapHandle {} +impl ::core::fmt::Debug for HeapHandle { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("HeapHandle").field(&self.0).finish() + } +} +unsafe impl ::windows::core::Abi for HeapHandle { + type Abi = Self; +} #[inline] 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)] diff --git a/crates/libs/windows/src/core/delay_load.rs b/crates/libs/windows/src/core/delay_load.rs index 486f6c8a38..f50b754780 100644 --- a/crates/libs/windows/src/core/delay_load.rs +++ b/crates/libs/windows/src/core/delay_load.rs @@ -6,7 +6,7 @@ pub fn delay_load(library: &[u8], function: &[u8]) -> RawPtr { unsafe { let library = LoadLibraryA(PSTR(library.as_ptr() as *mut _)); - if library == 0 { + if library.is_invalid() { return core::ptr::null_mut(); } diff --git a/crates/tests/agile/Cargo.toml b/crates/tests/agile/Cargo.toml new file mode 100644 index 0000000000..b4b20525fa --- /dev/null +++ b/crates/tests/agile/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "test_agile" +version = "0.0.0" +authors = ["Microsoft"] +edition = "2018" + +[dependencies.windows] +path = "../../libs/windows" +features = [ + "Foundation", + "Win32_System_WinRT", +] diff --git a/crates/tests/agile/src/lib.rs b/crates/tests/agile/src/lib.rs new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/crates/tests/agile/src/lib.rs @@ -0,0 +1 @@ + diff --git a/crates/tests/agile/tests/tests.rs b/crates/tests/agile/tests/tests.rs new file mode 100644 index 0000000000..0643fc8be9 --- /dev/null +++ b/crates/tests/agile/tests/tests.rs @@ -0,0 +1,25 @@ +use windows::{Foundation::*, Win32::System::WinRT::*}; + +fn send(_: Option) {} +fn sync(_: Option) {} + +#[test] +fn test() { + send(Option::::None); + sync(Option::::None); + + send(Option::::None); + sync(Option::::None); + + send(Option::::None); + sync(Option::::None); + + send(Option::>::None); + sync(Option::>::None); + + send(Option::>::None); + sync(Option::>::None); + + send(Option::>::None); + sync(Option::>::None); +} diff --git a/crates/tests/handles/Cargo.toml b/crates/tests/handles/Cargo.toml new file mode 100644 index 0000000000..b2eaad1f24 --- /dev/null +++ b/crates/tests/handles/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "test_handles" +version = "0.0.0" +authors = ["Microsoft"] +edition = "2018" + +[dependencies.windows] +path = "../../libs/windows" +features = [ + "Win32_Foundation", + "Win32_Graphics_Gdi", +] + +[dependencies.windows-sys] +path = "../../libs/sys" +features = [ + "Win32_Foundation", + "Win32_Graphics_Gdi", +] diff --git a/crates/tests/handles/src/lib.rs b/crates/tests/handles/src/lib.rs new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/crates/tests/handles/src/lib.rs @@ -0,0 +1 @@ + diff --git a/crates/tests/handles/tests/sys.rs b/crates/tests/handles/tests/sys.rs new file mode 100644 index 0000000000..026368d2a0 --- /dev/null +++ b/crates/tests/handles/tests/sys.rs @@ -0,0 +1,20 @@ +use windows_sys::{Win32::Foundation::*, Win32::Graphics::Gdi::*}; + +#[test] +fn boolean() { + let underlying: u8 = 123; + let handle: BOOLEAN = underlying; + assert!(handle == underlying); +} + +#[test] +fn hfont() { + unsafe { + let underlying: isize = 123; + let font: HFONT = underlying; + let object: HGDIOBJ = font; + + assert!(DeleteObject(font) == 0); + assert!(DeleteObject(object) == 0); + } +} diff --git a/crates/tests/handles/tests/win.rs b/crates/tests/handles/tests/win.rs new file mode 100644 index 0000000000..e44d940280 --- /dev/null +++ b/crates/tests/handles/tests/win.rs @@ -0,0 +1,32 @@ +use windows::{Win32::Foundation::*, Win32::Graphics::Gdi::*}; + +#[test] +fn boolean() { + let underlying: u8 = 123; + let handle: BOOLEAN = BOOLEAN(underlying); + assert!(!handle.is_invalid()); + assert!(handle.ok().unwrap() == handle); + + let copy = handle; + assert!(copy == handle); + + let clone = handle.clone(); + assert!(clone == handle); + + let default = BOOLEAN::default(); + assert!(default.is_invalid()); + + assert!(format!("{:?}", handle) == "BOOLEAN(123)"); +} + +#[test] +fn hfont() { + unsafe { + let underlying: isize = 123; + let font: HFONT = HFONT(underlying); + let object: HGDIOBJ = HGDIOBJ(font.0); + + assert!(!DeleteObject(font).as_bool()); + assert!(!DeleteObject(object).as_bool()); + } +}