From 0542346d3beeed7cf0d0af79e66789dae241daea Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Tue, 9 May 2023 18:30:42 +0200 Subject: [PATCH] wbemprox: Avoid assigning COM objects to interface variables. --- dlls/wbemprox/class.c | 4 ++-- dlls/wbemprox/qualifier.c | 2 +- dlls/wbemprox/services.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/wbemprox/class.c b/dlls/wbemprox/class.c index d9848986044..1570a5e534a 100644 --- a/dlls/wbemprox/class.c +++ b/dlls/wbemprox/class.c @@ -78,7 +78,7 @@ static HRESULT WINAPI enum_class_object_QueryInterface( if ( IsEqualGUID( riid, &IID_IEnumWbemClassObject ) || IsEqualGUID( riid, &IID_IUnknown ) ) { - *ppvObject = ec; + *ppvObject = &ec->IEnumWbemClassObject_iface; } else if ( IsEqualGUID( riid, &IID_IClientSecurity ) ) { @@ -324,7 +324,7 @@ static HRESULT WINAPI class_object_QueryInterface( if ( IsEqualGUID( riid, &IID_IWbemClassObject ) || IsEqualGUID( riid, &IID_IUnknown ) ) { - *ppvObject = co; + *ppvObject = &co->IWbemClassObject_iface; } else if (IsEqualGUID( riid, &IID_IClientSecurity )) { diff --git a/dlls/wbemprox/qualifier.c b/dlls/wbemprox/qualifier.c index 9a8947ede80..167a8142223 100644 --- a/dlls/wbemprox/qualifier.c +++ b/dlls/wbemprox/qualifier.c @@ -79,7 +79,7 @@ static HRESULT WINAPI qualifier_set_QueryInterface( if ( IsEqualGUID( riid, &IID_IWbemQualifierSet ) || IsEqualGUID( riid, &IID_IUnknown ) ) { - *ppvObject = set; + *ppvObject = &set->IWbemQualifierSet_iface; } else { diff --git a/dlls/wbemprox/services.c b/dlls/wbemprox/services.c index 203b0e90784..436097c1e8d 100644 --- a/dlls/wbemprox/services.c +++ b/dlls/wbemprox/services.c @@ -52,7 +52,7 @@ static HRESULT WINAPI client_security_QueryInterface( if ( IsEqualGUID( riid, &IID_IClientSecurity ) || IsEqualGUID( riid, &IID_IUnknown ) ) { - *ppvObject = cs; + *ppvObject = &cs->IClientSecurity_iface; } else { @@ -264,7 +264,7 @@ static HRESULT WINAPI wbem_services_QueryInterface( if ( IsEqualGUID( riid, &IID_IWbemServices ) || IsEqualGUID( riid, &IID_IUnknown ) ) { - *ppvObject = ws; + *ppvObject = &ws->IWbemServices_iface; } else if ( IsEqualGUID( riid, &IID_IClientSecurity ) ) { -- 2.11.4.GIT