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
992d1e15
Commit
992d1e15
authored
Jun 28, 2012
by
Hans Leidekker
Committed by
Alexandre Julliard
Jun 28, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wbemprox: Add reference counting to the query object.
parent
0ceee481
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
6 deletions
+20
-6
class.c
dlls/wbemprox/class.c
+2
-1
query.c
dlls/wbemprox/query.c
+15
-4
wbemprox_private.h
dlls/wbemprox/wbemprox_private.h
+3
-1
No files found.
dlls/wbemprox/class.c
View file @
992d1e15
...
...
@@ -60,7 +60,7 @@ static ULONG WINAPI enum_class_object_Release(
if
(
!
refs
)
{
TRACE
(
"destroying %p
\n
"
,
ec
);
fre
e_query
(
ec
->
query
);
releas
e_query
(
ec
->
query
);
heap_free
(
ec
);
}
return
refs
;
...
...
@@ -198,6 +198,7 @@ HRESULT EnumWbemClassObject_create(
ec
->
IEnumWbemClassObject_iface
.
lpVtbl
=
&
enum_class_object_vtbl
;
ec
->
refs
=
1
;
ec
->
query
=
query
;
addref_query
(
query
);
ec
->
index
=
0
;
*
ppObj
=
&
ec
->
IEnumWbemClassObject_iface
;
...
...
dlls/wbemprox/query.c
View file @
992d1e15
...
...
@@ -395,16 +395,17 @@ static HRESULT execute_view( struct view *view )
return
S_OK
;
}
static
struct
query
*
alloc
_query
(
void
)
static
struct
query
*
create
_query
(
void
)
{
struct
query
*
query
;
if
(
!
(
query
=
heap_alloc
(
sizeof
(
*
query
)
)))
return
NULL
;
list_init
(
&
query
->
mem
);
query
->
refs
=
1
;
return
query
;
}
void
free_query
(
struct
query
*
query
)
static
void
free_query
(
struct
query
*
query
)
{
struct
list
*
mem
,
*
next
;
...
...
@@ -416,13 +417,23 @@ void free_query( struct query *query )
heap_free
(
query
);
}
void
addref_query
(
struct
query
*
query
)
{
InterlockedIncrement
(
&
query
->
refs
);
}
void
release_query
(
struct
query
*
query
)
{
if
(
!
InterlockedDecrement
(
&
query
->
refs
))
free_query
(
query
);
}
HRESULT
exec_query
(
const
WCHAR
*
str
,
IEnumWbemClassObject
**
result
)
{
HRESULT
hr
;
struct
query
*
query
;
*
result
=
NULL
;
if
(
!
(
query
=
alloc
_query
()))
return
E_OUTOFMEMORY
;
if
(
!
(
query
=
create
_query
()))
return
E_OUTOFMEMORY
;
hr
=
parse_query
(
str
,
&
query
->
view
,
&
query
->
mem
);
if
(
hr
!=
S_OK
)
goto
done
;
hr
=
execute_view
(
query
->
view
);
...
...
@@ -430,7 +441,7 @@ HRESULT exec_query( const WCHAR *str, IEnumWbemClassObject **result )
hr
=
EnumWbemClassObject_create
(
NULL
,
query
,
(
void
**
)
result
);
done:
if
(
hr
!=
S_OK
)
fre
e_query
(
query
);
releas
e_query
(
query
);
return
hr
;
}
...
...
dlls/wbemprox/wbemprox_private.h
View file @
992d1e15
...
...
@@ -106,11 +106,13 @@ struct view
struct
query
{
LONG
refs
;
struct
view
*
view
;
struct
list
mem
;
};
void
free_query
(
struct
query
*
)
DECLSPEC_HIDDEN
;
void
addref_query
(
struct
query
*
)
DECLSPEC_HIDDEN
;
void
release_query
(
struct
query
*
query
)
DECLSPEC_HIDDEN
;
HRESULT
exec_query
(
const
WCHAR
*
,
IEnumWbemClassObject
**
)
DECLSPEC_HIDDEN
;
HRESULT
parse_query
(
const
WCHAR
*
,
struct
view
**
,
struct
list
*
)
DECLSPEC_HIDDEN
;
HRESULT
create_view
(
const
struct
property
*
,
const
WCHAR
*
,
const
struct
expr
*
,
...
...
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