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
0f11ac36
Commit
0f11ac36
authored
Jul 25, 2012
by
Hans Leidekker
Committed by
Alexandre Julliard
Jul 25, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wbemprox: Add helpers for retrieving class instances.
parent
53d1cc1e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
31 deletions
+35
-31
services.c
dlls/wbemprox/services.c
+34
-31
wbemprox_private.h
dlls/wbemprox/wbemprox_private.h
+1
-0
No files found.
dlls/wbemprox/services.c
View file @
0f11ac36
...
...
@@ -235,40 +235,54 @@ static HRESULT WINAPI wbem_services_QueryObjectSink(
return
WBEM_E_FAILED
;
}
static
HRESULT
WINAPI
wbem_services_GetObject
(
IWbemServices
*
iface
,
const
BSTR
strObjectPath
,
LONG
lFlags
,
IWbemContext
*
pCtx
,
IWbemClassObject
**
ppObject
,
IWbemCallResult
**
ppCallResult
)
static
HRESULT
create_instance_enum
(
const
WCHAR
*
class
,
IEnumWbemClassObject
**
iter
)
{
static
const
WCHAR
selectW
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
0
};
IEnumWbemClassObject
*
iter
;
WCHAR
*
query
;
HRESULT
hr
;
TRACE
(
"%p, %s, 0x%08x, %p, %p, %p
\n
"
,
iface
,
debugstr_w
(
strObjectPath
),
lFlags
,
pCtx
,
ppObject
,
ppCallResult
);
if
(
lFlags
)
FIXME
(
"unsupported flags 0x%08x
\n
"
,
lFlags
);
query
=
heap_alloc
(
strlenW
(
class
)
*
sizeof
(
WCHAR
)
+
sizeof
(
selectW
)
);
if
(
!
query
)
return
E_OUTOFMEMORY
;
/* FIXME: parse path */
if
(
!
(
query
=
heap_alloc
(
strlenW
(
strObjectPath
)
*
sizeof
(
WCHAR
)
+
sizeof
(
selectW
)
)))
return
E_OUTOFMEMORY
;
strcpyW
(
query
,
selectW
);
strcatW
(
query
,
strObjectPath
);
strcatW
(
query
,
class
);
hr
=
exec_query
(
query
,
&
iter
);
hr
=
exec_query
(
query
,
iter
);
heap_free
(
query
);
return
hr
;
}
HRESULT
get_object
(
const
WCHAR
*
path
,
IWbemClassObject
**
obj
)
{
IEnumWbemClassObject
*
iter
;
HRESULT
hr
;
/* FIXME: parse path */
hr
=
create_instance_enum
(
path
,
&
iter
);
if
(
hr
!=
S_OK
)
return
hr
;
hr
=
WbemClassObject_create
(
NULL
,
iter
,
0
,
(
void
**
)
ppObject
);
hr
=
WbemClassObject_create
(
NULL
,
iter
,
0
,
(
void
**
)
obj
);
IEnumWbemClassObject_Release
(
iter
);
return
hr
;
}
static
HRESULT
WINAPI
wbem_services_GetObject
(
IWbemServices
*
iface
,
const
BSTR
strObjectPath
,
LONG
lFlags
,
IWbemContext
*
pCtx
,
IWbemClassObject
**
ppObject
,
IWbemCallResult
**
ppCallResult
)
{
TRACE
(
"%p, %s, 0x%08x, %p, %p, %p
\n
"
,
iface
,
debugstr_w
(
strObjectPath
),
lFlags
,
pCtx
,
ppObject
,
ppCallResult
);
if
(
lFlags
)
FIXME
(
"unsupported flags 0x%08x
\n
"
,
lFlags
);
return
get_object
(
strObjectPath
,
ppObject
);
}
static
HRESULT
WINAPI
wbem_services_GetObjectAsync
(
IWbemServices
*
iface
,
const
BSTR
strObjectPath
,
...
...
@@ -397,22 +411,11 @@ static HRESULT WINAPI wbem_services_CreateInstanceEnum(
IWbemContext
*
pCtx
,
IEnumWbemClassObject
**
ppEnum
)
{
static
const
WCHAR
selectW
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
0
};
WCHAR
*
query
;
HRESULT
hr
;
TRACE
(
"%p, %s, 0%08x, %p, %p
\n
"
,
iface
,
debugstr_w
(
strClass
),
lFlags
,
pCtx
,
ppEnum
);
if
(
lFlags
)
FIXME
(
"unsupported flags 0x%08x
\n
"
,
lFlags
);
if
(
!
(
query
=
heap_alloc
(
strlenW
(
strClass
)
*
sizeof
(
WCHAR
)
+
sizeof
(
selectW
)
)))
return
E_OUTOFMEMORY
;
strcpyW
(
query
,
selectW
);
strcatW
(
query
,
strClass
);
hr
=
exec_query
(
query
,
ppEnum
);
heap_free
(
query
);
return
hr
;
return
create_instance_enum
(
strClass
,
ppEnum
);
}
static
HRESULT
WINAPI
wbem_services_CreateInstanceEnumAsync
(
...
...
dlls/wbemprox/wbemprox_private.h
View file @
0f11ac36
...
...
@@ -142,6 +142,7 @@ HRESULT get_propval( const struct view *, UINT, const WCHAR *, VARIANT *,
CIMTYPE
*
,
LONG
*
)
DECLSPEC_HIDDEN
;
HRESULT
put_propval
(
const
struct
view
*
,
UINT
,
const
WCHAR
*
,
VARIANT
*
,
CIMTYPE
)
DECLSPEC_HIDDEN
;
HRESULT
get_properties
(
const
struct
view
*
,
SAFEARRAY
**
)
DECLSPEC_HIDDEN
;
HRESULT
get_object
(
const
WCHAR
*
,
IWbemClassObject
**
)
DECLSPEC_HIDDEN
;
HRESULT
WbemLocator_create
(
IUnknown
*
,
LPVOID
*
)
DECLSPEC_HIDDEN
;
HRESULT
WbemServices_create
(
IUnknown
*
,
const
WCHAR
*
,
LPVOID
*
)
DECLSPEC_HIDDEN
;
...
...
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