Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Make the matches function safe #2761

Merged
merged 4 commits into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
windows
  • Loading branch information
kennykerr committed Dec 29, 2023
commit 8aa492f04109d21fe4983274cf35b9f82eb974a0
16 changes: 8 additions & 8 deletions crates/libs/windows/src/Windows/AI/MachineLearning/impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ impl ILearningModelFeatureDescriptor_Vtbl {
IsRequired: IsRequired::<Identity, Impl, OFFSET>,
}
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <ILearningModelFeatureDescriptor as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<ILearningModelFeatureDescriptor as ::windows_core::ComInterface>::IID
}
}
pub trait ILearningModelFeatureValue_Impl: Sized {
Expand All @@ -88,8 +88,8 @@ impl ILearningModelFeatureValue_Vtbl {
}
Self { base__: ::windows_core::IInspectable_Vtbl::new::<Identity, ILearningModelFeatureValue, OFFSET>(), Kind: Kind::<Identity, Impl, OFFSET> }
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <ILearningModelFeatureValue as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<ILearningModelFeatureValue as ::windows_core::ComInterface>::IID
}
}
pub trait ILearningModelOperatorProvider_Impl: Sized {}
Expand All @@ -100,8 +100,8 @@ impl ILearningModelOperatorProvider_Vtbl {
pub const fn new<Identity: ::windows_core::IUnknownImpl<Impl = Impl>, Impl: ILearningModelOperatorProvider_Impl, const OFFSET: isize>() -> ILearningModelOperatorProvider_Vtbl {
Self { base__: ::windows_core::IInspectable_Vtbl::new::<Identity, ILearningModelOperatorProvider, OFFSET>() }
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <ILearningModelOperatorProvider as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<ILearningModelOperatorProvider as ::windows_core::ComInterface>::IID
}
}
#[doc = "Required features: `\"Foundation_Collections\"`"]
Expand Down Expand Up @@ -146,7 +146,7 @@ impl ITensor_Vtbl {
Shape: Shape::<Identity, Impl, OFFSET>,
}
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <ITensor as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<ITensor as ::windows_core::ComInterface>::IID
}
}
244 changes: 122 additions & 122 deletions crates/libs/windows/src/Windows/ApplicationModel/Activation/impl.rs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl IAppointmentParticipant_Vtbl {
SetAddress: SetAddress::<Identity, Impl, OFFSET>,
}
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <IAppointmentParticipant as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<IAppointmentParticipant as ::windows_core::ComInterface>::IID
}
}
36 changes: 18 additions & 18 deletions crates/libs/windows/src/Windows/ApplicationModel/Background/impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ impl IBackgroundCondition_Vtbl {
pub const fn new<Identity: ::windows_core::IUnknownImpl<Impl = Impl>, Impl: IBackgroundCondition_Impl, const OFFSET: isize>() -> IBackgroundCondition_Vtbl {
Self { base__: ::windows_core::IInspectable_Vtbl::new::<Identity, IBackgroundCondition, OFFSET>() }
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <IBackgroundCondition as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<IBackgroundCondition as ::windows_core::ComInterface>::IID
}
}
pub trait IBackgroundTask_Impl: Sized {
Expand All @@ -25,8 +25,8 @@ impl IBackgroundTask_Vtbl {
}
Self { base__: ::windows_core::IInspectable_Vtbl::new::<Identity, IBackgroundTask, OFFSET>(), Run: Run::<Identity, Impl, OFFSET> }
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <IBackgroundTask as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<IBackgroundTask as ::windows_core::ComInterface>::IID
}
}
pub trait IBackgroundTaskInstance_Impl: Sized {
Expand Down Expand Up @@ -148,8 +148,8 @@ impl IBackgroundTaskInstance_Vtbl {
GetDeferral: GetDeferral::<Identity, Impl, OFFSET>,
}
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <IBackgroundTaskInstance as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<IBackgroundTaskInstance as ::windows_core::ComInterface>::IID
}
}
pub trait IBackgroundTaskInstance2_Impl: Sized + IBackgroundTaskInstance_Impl {
Expand All @@ -176,8 +176,8 @@ impl IBackgroundTaskInstance2_Vtbl {
GetThrottleCount: GetThrottleCount::<Identity, Impl, OFFSET>,
}
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <IBackgroundTaskInstance2 as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<IBackgroundTaskInstance2 as ::windows_core::ComInterface>::IID
}
}
#[doc = "Required features: `\"System\"`"]
Expand Down Expand Up @@ -206,8 +206,8 @@ impl IBackgroundTaskInstance4_Vtbl {
}
Self { base__: ::windows_core::IInspectable_Vtbl::new::<Identity, IBackgroundTaskInstance4, OFFSET>(), User: User::<Identity, Impl, OFFSET> }
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <IBackgroundTaskInstance4 as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<IBackgroundTaskInstance4 as ::windows_core::ComInterface>::IID
}
}
pub trait IBackgroundTaskRegistration_Impl: Sized {
Expand Down Expand Up @@ -295,8 +295,8 @@ impl IBackgroundTaskRegistration_Vtbl {
Unregister: Unregister::<Identity, Impl, OFFSET>,
}
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <IBackgroundTaskRegistration as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<IBackgroundTaskRegistration as ::windows_core::ComInterface>::IID
}
}
pub trait IBackgroundTaskRegistration2_Impl: Sized + IBackgroundTaskRegistration_Impl {
Expand All @@ -321,8 +321,8 @@ impl IBackgroundTaskRegistration2_Vtbl {
}
Self { base__: ::windows_core::IInspectable_Vtbl::new::<Identity, IBackgroundTaskRegistration2, OFFSET>(), Trigger: Trigger::<Identity, Impl, OFFSET> }
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <IBackgroundTaskRegistration2 as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<IBackgroundTaskRegistration2 as ::windows_core::ComInterface>::IID
}
}
pub trait IBackgroundTaskRegistration3_Impl: Sized + IBackgroundTaskRegistration_Impl {
Expand Down Expand Up @@ -350,8 +350,8 @@ impl IBackgroundTaskRegistration3_Vtbl {
TaskGroup: TaskGroup::<Identity, Impl, OFFSET>,
}
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <IBackgroundTaskRegistration3 as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<IBackgroundTaskRegistration3 as ::windows_core::ComInterface>::IID
}
}
pub trait IBackgroundTrigger_Impl: Sized {}
Expand All @@ -362,7 +362,7 @@ impl IBackgroundTrigger_Vtbl {
pub const fn new<Identity: ::windows_core::IUnknownImpl<Impl = Impl>, Impl: IBackgroundTrigger_Impl, const OFFSET: isize>() -> IBackgroundTrigger_Vtbl {
Self { base__: ::windows_core::IInspectable_Vtbl::new::<Identity, IBackgroundTrigger, OFFSET>() }
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <IBackgroundTrigger as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<IBackgroundTrigger as ::windows_core::ComInterface>::IID
}
}
4 changes: 2 additions & 2 deletions crates/libs/windows/src/Windows/ApplicationModel/Chat/impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl IChatItem_Vtbl {
}
Self { base__: ::windows_core::IInspectable_Vtbl::new::<Identity, IChatItem, OFFSET>(), ItemKind: ItemKind::<Identity, Impl, OFFSET> }
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <IChatItem as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<IChatItem as ::windows_core::ComInterface>::IID
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ impl IContactField_Vtbl {
Value: Value::<Identity, Impl, OFFSET>,
}
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <IContactField as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<IContactField as ::windows_core::ComInterface>::IID
}
}
pub trait IContactFieldFactory_Impl: Sized {
Expand Down Expand Up @@ -120,8 +120,8 @@ impl IContactFieldFactory_Vtbl {
CreateField_Custom: CreateField_Custom::<Identity, Impl, OFFSET>,
}
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <IContactFieldFactory as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<IContactFieldFactory as ::windows_core::ComInterface>::IID
}
}
pub trait IContactInstantMessageFieldFactory_Impl: Sized {
Expand Down Expand Up @@ -177,8 +177,8 @@ impl IContactInstantMessageFieldFactory_Vtbl {
CreateInstantMessage_All: CreateInstantMessage_All::<Identity, Impl, OFFSET>,
}
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <IContactInstantMessageFieldFactory as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<IContactInstantMessageFieldFactory as ::windows_core::ComInterface>::IID
}
}
pub trait IContactLocationFieldFactory_Impl: Sized {
Expand Down Expand Up @@ -234,7 +234,7 @@ impl IContactLocationFieldFactory_Vtbl {
CreateLocation_All: CreateLocation_All::<Identity, Impl, OFFSET>,
}
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <IContactLocationFieldFactory as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<IContactLocationFieldFactory as ::windows_core::ComInterface>::IID
}
}
12 changes: 6 additions & 6 deletions crates/libs/windows/src/Windows/ApplicationModel/Core/impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ impl ICoreApplicationUnhandledError_Vtbl {
RemoveUnhandledErrorDetected: RemoveUnhandledErrorDetected::<Identity, Impl, OFFSET>,
}
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <ICoreApplicationUnhandledError as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<ICoreApplicationUnhandledError as ::windows_core::ComInterface>::IID
}
}
#[doc = "Required features: `\"UI_Core\"`"]
Expand Down Expand Up @@ -83,8 +83,8 @@ impl IFrameworkView_Vtbl {
Uninitialize: Uninitialize::<Identity, Impl, OFFSET>,
}
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <IFrameworkView as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<IFrameworkView as ::windows_core::ComInterface>::IID
}
}
pub trait IFrameworkViewSource_Impl: Sized {
Expand All @@ -109,7 +109,7 @@ impl IFrameworkViewSource_Vtbl {
}
Self { base__: ::windows_core::IInspectable_Vtbl::new::<Identity, IFrameworkViewSource, OFFSET>(), CreateView: CreateView::<Identity, Impl, OFFSET> }
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <IFrameworkViewSource as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<IFrameworkViewSource as ::windows_core::ComInterface>::IID
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl ICoreDropOperationTarget_Vtbl {
DropAsync: DropAsync::<Identity, Impl, OFFSET>,
}
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <ICoreDropOperationTarget as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<ICoreDropOperationTarget as ::windows_core::ComInterface>::IID
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl ISearchPaneQueryChangedEventArgs_Vtbl {
LinguisticDetails: LinguisticDetails::<Identity, Impl, OFFSET>,
}
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <ISearchPaneQueryChangedEventArgs as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<ISearchPaneQueryChangedEventArgs as ::windows_core::ComInterface>::IID
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl IUserActivityContentInfo_Vtbl {
}
Self { base__: ::windows_core::IInspectable_Vtbl::new::<Identity, IUserActivityContentInfo, OFFSET>(), ToJson: ToJson::<Identity, Impl, OFFSET> }
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <IUserActivityContentInfo as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<IUserActivityContentInfo as ::windows_core::ComInterface>::IID
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl IUserDataAccountProviderOperation_Vtbl {
}
Self { base__: ::windows_core::IInspectable_Vtbl::new::<Identity, IUserDataAccountProviderOperation, OFFSET>(), Kind: Kind::<Identity, Impl, OFFSET> }
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <IUserDataAccountProviderOperation as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<IUserDataAccountProviderOperation as ::windows_core::ComInterface>::IID
}
}
24 changes: 12 additions & 12 deletions crates/libs/windows/src/Windows/ApplicationModel/impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ impl IEnteredBackgroundEventArgs_Vtbl {
GetDeferral: GetDeferral::<Identity, Impl, OFFSET>,
}
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <IEnteredBackgroundEventArgs as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<IEnteredBackgroundEventArgs as ::windows_core::ComInterface>::IID
}
}
pub trait ILeavingBackgroundEventArgs_Impl: Sized {
Expand Down Expand Up @@ -52,8 +52,8 @@ impl ILeavingBackgroundEventArgs_Vtbl {
GetDeferral: GetDeferral::<Identity, Impl, OFFSET>,
}
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <ILeavingBackgroundEventArgs as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<ILeavingBackgroundEventArgs as ::windows_core::ComInterface>::IID
}
}
pub trait IPackageCatalogStatics2_Impl: Sized {
Expand Down Expand Up @@ -81,8 +81,8 @@ impl IPackageCatalogStatics2_Vtbl {
OpenForPackage: OpenForPackage::<Identity, Impl, OFFSET>,
}
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <IPackageCatalogStatics2 as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<IPackageCatalogStatics2 as ::windows_core::ComInterface>::IID
}
}
pub trait ISuspendingDeferral_Impl: Sized {
Expand All @@ -100,8 +100,8 @@ impl ISuspendingDeferral_Vtbl {
}
Self { base__: ::windows_core::IInspectable_Vtbl::new::<Identity, ISuspendingDeferral, OFFSET>(), Complete: Complete::<Identity, Impl, OFFSET> }
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <ISuspendingDeferral as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<ISuspendingDeferral as ::windows_core::ComInterface>::IID
}
}
pub trait ISuspendingEventArgs_Impl: Sized {
Expand Down Expand Up @@ -129,8 +129,8 @@ impl ISuspendingEventArgs_Vtbl {
SuspendingOperation: SuspendingOperation::<Identity, Impl, OFFSET>,
}
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <ISuspendingEventArgs as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<ISuspendingEventArgs as ::windows_core::ComInterface>::IID
}
}
pub trait ISuspendingOperation_Impl: Sized {
Expand Down Expand Up @@ -171,7 +171,7 @@ impl ISuspendingOperation_Vtbl {
Deadline: Deadline::<Identity, Impl, OFFSET>,
}
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <ISuspendingOperation as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<ISuspendingOperation as ::windows_core::ComInterface>::IID
}
}
4 changes: 2 additions & 2 deletions crates/libs/windows/src/Windows/Data/Json/impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ impl IJsonValue_Vtbl {
GetObject: GetObject::<Identity, Impl, OFFSET>,
}
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <IJsonValue as ::windows_core::ComInterface>::IID
pub fn matches(iid: &::windows_core::GUID) -> bool {
iid == &<IJsonValue as ::windows_core::ComInterface>::IID
}
}
Loading