Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
464c8845
Commit
464c8845
authored
May 19, 2014
by
Hans Leidekker
Committed by
Alexandre Julliard
May 19, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wbemprox: Handle NULL out parameter to object methods.
parent
9f17544b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
164 additions
and
80 deletions
+164
-80
process.c
dlls/wbemprox/process.c
+23
-12
reg.c
dlls/wbemprox/reg.c
+69
-36
service.c
dlls/wbemprox/service.c
+72
-32
No files found.
dlls/wbemprox/process.c
View file @
464c8845
...
...
@@ -66,7 +66,7 @@ done:
HRESULT
process_get_owner
(
IWbemClassObject
*
obj
,
IWbemClassObject
*
in
,
IWbemClassObject
**
out
)
{
VARIANT
user
,
domain
,
retval
;
IWbemClassObject
*
sig
;
IWbemClassObject
*
sig
,
*
out_params
=
NULL
;
HRESULT
hr
;
TRACE
(
"%p, %p, %p
\n
"
,
obj
,
in
,
out
);
...
...
@@ -74,29 +74,40 @@ HRESULT process_get_owner( IWbemClassObject *obj, IWbemClassObject *in, IWbemCla
hr
=
create_signature
(
class_processW
,
method_getownerW
,
PARAM_OUT
,
&
sig
);
if
(
hr
!=
S_OK
)
return
hr
;
hr
=
IWbemClassObject_SpawnInstance
(
sig
,
0
,
out
);
if
(
hr
!=
S_OK
)
if
(
out
)
{
IWbemClassObject_Release
(
sig
);
return
hr
;
hr
=
IWbemClassObject_SpawnInstance
(
sig
,
0
,
&
out_params
);
if
(
hr
!=
S_OK
)
{
IWbemClassObject_Release
(
sig
);
return
hr
;
}
}
VariantInit
(
&
user
);
VariantInit
(
&
domain
);
hr
=
get_owner
(
&
user
,
&
domain
,
&
retval
);
if
(
hr
!=
S_OK
)
goto
done
;
if
(
!
V_UI4
(
&
retval
)
)
if
(
out_params
)
{
hr
=
IWbemClassObject_Put
(
*
out
,
param_userW
,
0
,
&
user
,
CIM_STRING
);
if
(
hr
!=
S_OK
)
goto
done
;
hr
=
IWbemClassObject_Put
(
*
out
,
param_domainW
,
0
,
&
domain
,
CIM_STRING
);
if
(
hr
!=
S_OK
)
goto
done
;
if
(
!
V_UI4
(
&
retval
))
{
hr
=
IWbemClassObject_Put
(
out_params
,
param_userW
,
0
,
&
user
,
CIM_STRING
);
if
(
hr
!=
S_OK
)
goto
done
;
hr
=
IWbemClassObject_Put
(
out_params
,
param_domainW
,
0
,
&
domain
,
CIM_STRING
);
if
(
hr
!=
S_OK
)
goto
done
;
}
hr
=
IWbemClassObject_Put
(
out_params
,
param_returnvalueW
,
0
,
&
retval
,
CIM_UINT32
);
}
hr
=
IWbemClassObject_Put
(
*
out
,
param_returnvalueW
,
0
,
&
retval
,
CIM_UINT32
);
done:
VariantClear
(
&
user
);
VariantClear
(
&
domain
);
IWbemClassObject_Release
(
sig
);
if
(
hr
!=
S_OK
)
IWbemClassObject_Release
(
*
out
);
if
(
hr
==
S_OK
&&
out
)
{
*
out
=
out_params
;
IWbemClassObject_AddRef
(
out_params
);
}
if
(
out_params
)
IWbemClassObject_Release
(
out_params
);
return
hr
;
}
dlls/wbemprox/reg.c
View file @
464c8845
...
...
@@ -124,7 +124,7 @@ static HRESULT enum_key( HKEY root, const WCHAR *subkey, VARIANT *names, VARIANT
HRESULT
reg_enum_key
(
IWbemClassObject
*
obj
,
IWbemClassObject
*
in
,
IWbemClassObject
**
out
)
{
VARIANT
defkey
,
subkey
,
names
,
retval
;
IWbemClassObject
*
sig
;
IWbemClassObject
*
sig
,
*
out_params
=
NULL
;
HRESULT
hr
;
TRACE
(
"%p, %p
\n
"
,
in
,
out
);
...
...
@@ -140,28 +140,39 @@ HRESULT reg_enum_key( IWbemClassObject *obj, IWbemClassObject *in, IWbemClassObj
VariantClear
(
&
subkey
);
return
hr
;
}
hr
=
IWbemClassObject_SpawnInstance
(
sig
,
0
,
out
);
if
(
hr
!=
S_OK
)
if
(
out
)
{
VariantClear
(
&
subkey
);
IWbemClassObject_Release
(
sig
);
return
hr
;
hr
=
IWbemClassObject_SpawnInstance
(
sig
,
0
,
&
out_params
);
if
(
hr
!=
S_OK
)
{
VariantClear
(
&
subkey
);
IWbemClassObject_Release
(
sig
);
return
hr
;
}
}
VariantInit
(
&
names
);
hr
=
enum_key
(
(
HKEY
)(
INT_PTR
)
V_I4
(
&
defkey
),
V_BSTR
(
&
subkey
),
&
names
,
&
retval
);
if
(
hr
!=
S_OK
)
goto
done
;
if
(
!
V_UI4
(
&
retval
)
)
if
(
out_params
)
{
hr
=
IWbemClassObject_Put
(
*
out
,
param_namesW
,
0
,
&
names
,
CIM_STRING
|
CIM_FLAG_ARRAY
);
if
(
hr
!=
S_OK
)
goto
done
;
if
(
!
V_UI4
(
&
retval
))
{
hr
=
IWbemClassObject_Put
(
out_params
,
param_namesW
,
0
,
&
names
,
CIM_STRING
|
CIM_FLAG_ARRAY
);
if
(
hr
!=
S_OK
)
goto
done
;
}
hr
=
IWbemClassObject_Put
(
out_params
,
param_returnvalueW
,
0
,
&
retval
,
CIM_UINT32
);
}
hr
=
IWbemClassObject_Put
(
*
out
,
param_returnvalueW
,
0
,
&
retval
,
CIM_UINT32
);
done:
VariantClear
(
&
names
);
VariantClear
(
&
subkey
);
IWbemClassObject_Release
(
sig
);
if
(
hr
!=
S_OK
)
IWbemClassObject_Release
(
*
out
);
if
(
hr
==
S_OK
&&
out
)
{
*
out
=
out_params
;
IWbemClassObject_AddRef
(
out_params
);
}
if
(
out_params
)
IWbemClassObject_Release
(
out_params
);
return
hr
;
}
...
...
@@ -222,7 +233,7 @@ done:
HRESULT
reg_enum_values
(
IWbemClassObject
*
obj
,
IWbemClassObject
*
in
,
IWbemClassObject
**
out
)
{
VARIANT
defkey
,
subkey
,
names
,
types
,
retval
;
IWbemClassObject
*
sig
;
IWbemClassObject
*
sig
,
*
out_params
=
NULL
;
HRESULT
hr
;
TRACE
(
"%p, %p
\n
"
,
in
,
out
);
...
...
@@ -238,32 +249,43 @@ HRESULT reg_enum_values( IWbemClassObject *obj, IWbemClassObject *in, IWbemClass
VariantClear
(
&
subkey
);
return
hr
;
}
hr
=
IWbemClassObject_SpawnInstance
(
sig
,
0
,
out
);
if
(
hr
!=
S_OK
)
if
(
out
)
{
VariantClear
(
&
subkey
);
IWbemClassObject_Release
(
sig
);
return
hr
;
hr
=
IWbemClassObject_SpawnInstance
(
sig
,
0
,
&
out_params
);
if
(
hr
!=
S_OK
)
{
VariantClear
(
&
subkey
);
IWbemClassObject_Release
(
sig
);
return
hr
;
}
}
VariantInit
(
&
names
);
VariantInit
(
&
types
);
hr
=
enum_values
(
(
HKEY
)(
INT_PTR
)
V_I4
(
&
defkey
),
V_BSTR
(
&
subkey
),
&
names
,
&
types
,
&
retval
);
if
(
hr
!=
S_OK
)
goto
done
;
if
(
!
V_UI4
(
&
retval
)
)
if
(
out_params
)
{
hr
=
IWbemClassObject_Put
(
*
out
,
param_namesW
,
0
,
&
names
,
CIM_STRING
|
CIM_FLAG_ARRAY
);
if
(
hr
!=
S_OK
)
goto
done
;
hr
=
IWbemClassObject_Put
(
*
out
,
param_typesW
,
0
,
&
types
,
CIM_SINT32
|
CIM_FLAG_ARRAY
);
if
(
hr
!=
S_OK
)
goto
done
;
if
(
!
V_UI4
(
&
retval
))
{
hr
=
IWbemClassObject_Put
(
out_params
,
param_namesW
,
0
,
&
names
,
CIM_STRING
|
CIM_FLAG_ARRAY
);
if
(
hr
!=
S_OK
)
goto
done
;
hr
=
IWbemClassObject_Put
(
out_params
,
param_typesW
,
0
,
&
types
,
CIM_SINT32
|
CIM_FLAG_ARRAY
);
if
(
hr
!=
S_OK
)
goto
done
;
}
hr
=
IWbemClassObject_Put
(
out_params
,
param_returnvalueW
,
0
,
&
retval
,
CIM_UINT32
);
}
hr
=
IWbemClassObject_Put
(
*
out
,
param_returnvalueW
,
0
,
&
retval
,
CIM_UINT32
);
done:
VariantClear
(
&
types
);
VariantClear
(
&
names
);
VariantClear
(
&
subkey
);
IWbemClassObject_Release
(
sig
);
if
(
hr
!=
S_OK
)
IWbemClassObject_Release
(
*
out
);
if
(
hr
==
S_OK
&&
out
)
{
*
out
=
out_params
;
IWbemClassObject_AddRef
(
out_params
);
}
if
(
out_params
)
IWbemClassObject_Release
(
out_params
);
return
hr
;
}
...
...
@@ -294,7 +316,7 @@ done:
HRESULT
reg_get_stringvalue
(
IWbemClassObject
*
obj
,
IWbemClassObject
*
in
,
IWbemClassObject
**
out
)
{
VARIANT
defkey
,
subkey
,
name
,
value
,
retval
;
IWbemClassObject
*
sig
;
IWbemClassObject
*
sig
,
*
out_params
=
NULL
;
HRESULT
hr
;
TRACE
(
"%p, %p
\n
"
,
in
,
out
);
...
...
@@ -313,28 +335,39 @@ HRESULT reg_get_stringvalue( IWbemClassObject *obj, IWbemClassObject *in, IWbemC
VariantClear
(
&
subkey
);
return
hr
;
}
hr
=
IWbemClassObject_SpawnInstance
(
sig
,
0
,
out
);
if
(
hr
!=
S_OK
)
if
(
out
)
{
VariantClear
(
&
name
);
VariantClear
(
&
subkey
);
IWbemClassObject_Release
(
sig
);
return
hr
;
hr
=
IWbemClassObject_SpawnInstance
(
sig
,
0
,
&
out_params
);
if
(
hr
!=
S_OK
)
{
VariantClear
(
&
name
);
VariantClear
(
&
subkey
);
IWbemClassObject_Release
(
sig
);
return
hr
;
}
}
VariantInit
(
&
value
);
hr
=
get_stringvalue
(
(
HKEY
)(
INT_PTR
)
V_I4
(
&
defkey
),
V_BSTR
(
&
subkey
),
V_BSTR
(
&
name
),
&
value
,
&
retval
);
if
(
hr
!=
S_OK
)
goto
done
;
if
(
!
V_UI4
(
&
retval
)
)
if
(
out_params
)
{
hr
=
IWbemClassObject_Put
(
*
out
,
param_valueW
,
0
,
&
value
,
CIM_STRING
);
if
(
hr
!=
S_OK
)
goto
done
;
if
(
!
V_UI4
(
&
retval
))
{
hr
=
IWbemClassObject_Put
(
out_params
,
param_valueW
,
0
,
&
value
,
CIM_STRING
);
if
(
hr
!=
S_OK
)
goto
done
;
}
hr
=
IWbemClassObject_Put
(
out_params
,
param_returnvalueW
,
0
,
&
retval
,
CIM_UINT32
);
}
hr
=
IWbemClassObject_Put
(
*
out
,
param_returnvalueW
,
0
,
&
retval
,
CIM_UINT32
);
done:
VariantClear
(
&
name
);
VariantClear
(
&
subkey
);
IWbemClassObject_Release
(
sig
);
if
(
hr
!=
S_OK
)
IWbemClassObject_Release
(
*
out
);
if
(
hr
==
S_OK
&&
out
)
{
*
out
=
out_params
;
IWbemClassObject_AddRef
(
out_params
);
}
if
(
out_params
)
IWbemClassObject_Release
(
out_params
);
return
hr
;
}
dlls/wbemprox/service.c
View file @
464c8845
...
...
@@ -80,7 +80,7 @@ done:
HRESULT
service_pause_service
(
IWbemClassObject
*
obj
,
IWbemClassObject
*
in
,
IWbemClassObject
**
out
)
{
VARIANT
name
,
retval
;
IWbemClassObject
*
sig
;
IWbemClassObject
*
sig
,
*
out_params
=
NULL
;
HRESULT
hr
;
TRACE
(
"%p, %p, %p
\n
"
,
obj
,
in
,
out
);
...
...
@@ -94,28 +94,38 @@ HRESULT service_pause_service( IWbemClassObject *obj, IWbemClassObject *in, IWbe
VariantClear
(
&
name
);
return
hr
;
}
hr
=
IWbemClassObject_SpawnInstance
(
sig
,
0
,
out
);
if
(
hr
!=
S_OK
)
if
(
out
)
{
VariantClear
(
&
name
);
IWbemClassObject_Release
(
sig
);
return
hr
;
hr
=
IWbemClassObject_SpawnInstance
(
sig
,
0
,
&
out_params
);
if
(
hr
!=
S_OK
)
{
VariantClear
(
&
name
);
IWbemClassObject_Release
(
sig
);
return
hr
;
}
}
hr
=
control_service
(
V_BSTR
(
&
name
),
SERVICE_CONTROL_PAUSE
,
&
retval
);
if
(
hr
!=
S_OK
)
goto
done
;
hr
=
IWbemClassObject_Put
(
*
out
,
param_returnvalueW
,
0
,
&
retval
,
CIM_UINT32
);
if
(
out_params
)
hr
=
IWbemClassObject_Put
(
out_params
,
param_returnvalueW
,
0
,
&
retval
,
CIM_UINT32
);
done:
VariantClear
(
&
name
);
IWbemClassObject_Release
(
sig
);
if
(
hr
!=
S_OK
)
IWbemClassObject_Release
(
*
out
);
if
(
hr
==
S_OK
&&
out
)
{
*
out
=
out_params
;
IWbemClassObject_AddRef
(
out_params
);
}
if
(
out_params
)
IWbemClassObject_Release
(
out_params
);
return
hr
;
}
HRESULT
service_resume_service
(
IWbemClassObject
*
obj
,
IWbemClassObject
*
in
,
IWbemClassObject
**
out
)
{
VARIANT
name
,
retval
;
IWbemClassObject
*
sig
;
IWbemClassObject
*
sig
,
*
out_params
=
NULL
;
HRESULT
hr
;
TRACE
(
"%p, %p, %p
\n
"
,
obj
,
in
,
out
);
...
...
@@ -129,21 +139,31 @@ HRESULT service_resume_service( IWbemClassObject *obj, IWbemClassObject *in, IWb
VariantClear
(
&
name
);
return
hr
;
}
hr
=
IWbemClassObject_SpawnInstance
(
sig
,
0
,
out
);
if
(
hr
!=
S_OK
)
if
(
out
)
{
VariantClear
(
&
name
);
IWbemClassObject_Release
(
sig
);
return
hr
;
hr
=
IWbemClassObject_SpawnInstance
(
sig
,
0
,
&
out_params
);
if
(
hr
!=
S_OK
)
{
VariantClear
(
&
name
);
IWbemClassObject_Release
(
sig
);
return
hr
;
}
}
hr
=
control_service
(
V_BSTR
(
&
name
),
SERVICE_CONTROL_CONTINUE
,
&
retval
);
if
(
hr
!=
S_OK
)
goto
done
;
hr
=
IWbemClassObject_Put
(
*
out
,
param_returnvalueW
,
0
,
&
retval
,
CIM_UINT32
);
if
(
out_params
)
hr
=
IWbemClassObject_Put
(
out_params
,
param_returnvalueW
,
0
,
&
retval
,
CIM_UINT32
);
done:
VariantClear
(
&
name
);
IWbemClassObject_Release
(
sig
);
if
(
hr
!=
S_OK
)
IWbemClassObject_Release
(
*
out
);
if
(
hr
==
S_OK
&&
out
)
{
*
out
=
out_params
;
IWbemClassObject_AddRef
(
out_params
);
}
if
(
out_params
)
IWbemClassObject_Release
(
out_params
);
return
hr
;
}
...
...
@@ -174,7 +194,7 @@ done:
HRESULT
service_start_service
(
IWbemClassObject
*
obj
,
IWbemClassObject
*
in
,
IWbemClassObject
**
out
)
{
VARIANT
name
,
retval
;
IWbemClassObject
*
sig
;
IWbemClassObject
*
sig
,
*
out_params
=
NULL
;
HRESULT
hr
;
TRACE
(
"%p, %p, %p
\n
"
,
obj
,
in
,
out
);
...
...
@@ -188,28 +208,38 @@ HRESULT service_start_service( IWbemClassObject *obj, IWbemClassObject *in, IWbe
VariantClear
(
&
name
);
return
hr
;
}
hr
=
IWbemClassObject_SpawnInstance
(
sig
,
0
,
out
);
if
(
hr
!=
S_OK
)
if
(
out
)
{
VariantClear
(
&
name
);
IWbemClassObject_Release
(
sig
);
return
hr
;
hr
=
IWbemClassObject_SpawnInstance
(
sig
,
0
,
&
out_params
);
if
(
hr
!=
S_OK
)
{
VariantClear
(
&
name
);
IWbemClassObject_Release
(
sig
);
return
hr
;
}
}
hr
=
start_service
(
V_BSTR
(
&
name
),
&
retval
);
if
(
hr
!=
S_OK
)
goto
done
;
hr
=
IWbemClassObject_Put
(
*
out
,
param_returnvalueW
,
0
,
&
retval
,
CIM_UINT32
);
if
(
out_params
)
hr
=
IWbemClassObject_Put
(
out_params
,
param_returnvalueW
,
0
,
&
retval
,
CIM_UINT32
);
done:
VariantClear
(
&
name
);
IWbemClassObject_Release
(
sig
);
if
(
hr
!=
S_OK
)
IWbemClassObject_Release
(
*
out
);
if
(
hr
==
S_OK
&&
out
)
{
*
out
=
out_params
;
IWbemClassObject_AddRef
(
out_params
);
}
if
(
out_params
)
IWbemClassObject_Release
(
out_params
);
return
hr
;
}
HRESULT
service_stop_service
(
IWbemClassObject
*
obj
,
IWbemClassObject
*
in
,
IWbemClassObject
**
out
)
{
VARIANT
name
,
retval
;
IWbemClassObject
*
sig
;
IWbemClassObject
*
sig
,
*
out_params
=
NULL
;
HRESULT
hr
;
TRACE
(
"%p, %p, %p
\n
"
,
obj
,
in
,
out
);
...
...
@@ -223,20 +253,30 @@ HRESULT service_stop_service( IWbemClassObject *obj, IWbemClassObject *in, IWbem
VariantClear
(
&
name
);
return
hr
;
}
hr
=
IWbemClassObject_SpawnInstance
(
sig
,
0
,
out
);
if
(
hr
!=
S_OK
)
if
(
out
)
{
VariantClear
(
&
name
);
IWbemClassObject_Release
(
sig
);
return
hr
;
hr
=
IWbemClassObject_SpawnInstance
(
sig
,
0
,
&
out_params
);
if
(
hr
!=
S_OK
)
{
VariantClear
(
&
name
);
IWbemClassObject_Release
(
sig
);
return
hr
;
}
}
hr
=
control_service
(
V_BSTR
(
&
name
),
SERVICE_CONTROL_STOP
,
&
retval
);
if
(
hr
!=
S_OK
)
goto
done
;
hr
=
IWbemClassObject_Put
(
*
out
,
param_returnvalueW
,
0
,
&
retval
,
CIM_UINT32
);
if
(
out_params
)
hr
=
IWbemClassObject_Put
(
out_params
,
param_returnvalueW
,
0
,
&
retval
,
CIM_UINT32
);
done:
VariantClear
(
&
name
);
IWbemClassObject_Release
(
sig
);
if
(
hr
!=
S_OK
)
IWbemClassObject_Release
(
*
out
);
if
(
hr
==
S_OK
&&
out
)
{
*
out
=
out_params
;
IWbemClassObject_AddRef
(
out_params
);
}
if
(
out_params
)
IWbemClassObject_Release
(
out_params
);
return
hr
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment