Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
434e94a6
Commit
434e94a6
authored
Aug 28, 2019
by
Hans Leidekker
Committed by
Alexandre Julliard
Aug 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wbemprox: Implement IWbemQualifierSet::GetNames.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8e2e8974
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
12 deletions
+60
-12
qualifier.c
dlls/wbemprox/qualifier.c
+49
-12
query.c
dlls/wbemprox/tests/query.c
+11
-0
No files found.
dlls/wbemprox/qualifier.c
View file @
434e94a6
...
...
@@ -101,19 +101,32 @@ static HRESULT create_qualifier_enum( const WCHAR *class, const WCHAR *member, c
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'_'
,
'_'
,
'Q'
,
'U'
,
'A'
,
'L'
,
'I'
,
'F'
,
'I'
,
'E'
,
'R'
,
'S'
,
' '
,
'W'
,
'H'
,
'E'
,
'R'
,
'E'
,
' '
,
'C'
,
'l'
,
'a'
,
's'
,
's'
,
'='
,
'\''
,
'%'
,
's'
,
'\''
,
' '
,
'A'
,
'N'
,
'D'
,
' '
,
'M'
,
'e'
,
'm'
,
'b'
,
'e'
,
'r'
,
'='
,
'\''
,
'%'
,
's'
,
'\''
,
0
};
static
const
WCHAR
noneW
[]
=
{
'_'
,
'_'
,
'N'
,
'O'
,
'N'
,
'E'
,
0
};
static
const
WCHAR
fmt3W
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'_'
,
'_'
,
'Q'
,
'U'
,
'A'
,
'L'
,
'I'
,
'F'
,
'I'
,
'E'
,
'R'
,
'S'
,
' '
,
'W'
,
'H'
,
'E'
,
'R'
,
'E'
,
' '
,
'C'
,
'l'
,
'a'
,
's'
,
's'
,
'='
,
'\''
,
'%'
,
's'
,
'\''
,
0
};
WCHAR
*
query
;
HRESULT
hr
;
int
len
;
if
(
!
member
)
member
=
noneW
;
len
=
lstrlenW
(
class
)
+
lstrlenW
(
member
);
if
(
name
)
len
+=
lstrlenW
(
name
)
+
ARRAY_SIZE
(
fmtW
);
else
len
+=
ARRAY_SIZE
(
fmt2W
);
if
(
member
&&
name
)
{
len
=
lstrlenW
(
class
)
+
lstrlenW
(
member
)
+
lstrlenW
(
name
)
+
ARRAY_SIZE
(
fmtW
);
if
(
!
(
query
=
heap_alloc
(
len
*
sizeof
(
WCHAR
)
)))
return
E_OUTOFMEMORY
;
if
(
name
)
swprintf
(
query
,
len
,
fmtW
,
class
,
member
,
name
);
else
swprintf
(
query
,
len
,
fmt2W
,
class
,
member
);
swprintf
(
query
,
len
,
fmtW
,
class
,
member
,
name
);
}
else
if
(
member
)
{
len
=
lstrlenW
(
class
)
+
lstrlenW
(
member
)
+
ARRAY_SIZE
(
fmt2W
);
if
(
!
(
query
=
heap_alloc
(
len
*
sizeof
(
WCHAR
)
)))
return
E_OUTOFMEMORY
;
swprintf
(
query
,
len
,
fmt2W
,
class
,
member
);
}
else
{
len
=
lstrlenW
(
class
)
+
ARRAY_SIZE
(
fmt3W
);
if
(
!
(
query
=
heap_alloc
(
len
*
sizeof
(
WCHAR
)
)))
return
E_OUTOFMEMORY
;
swprintf
(
query
,
len
,
fmt3W
,
class
);
}
hr
=
exec_query
(
query
,
iter
);
heap_free
(
query
);
...
...
@@ -123,7 +136,6 @@ static HRESULT create_qualifier_enum( const WCHAR *class, const WCHAR *member, c
static
HRESULT
get_qualifier_value
(
const
WCHAR
*
class
,
const
WCHAR
*
member
,
const
WCHAR
*
name
,
VARIANT
*
val
,
LONG
*
flavor
)
{
static
const
WCHAR
qualifiersW
[]
=
{
'_'
,
'_'
,
'Q'
,
'U'
,
'A'
,
'L'
,
'I'
,
'F'
,
'I'
,
'E'
,
'R'
,
'S'
,
0
};
static
const
WCHAR
intvalueW
[]
=
{
'I'
,
'n'
,
't'
,
'e'
,
'g'
,
'e'
,
'r'
,
'V'
,
'a'
,
'l'
,
'u'
,
'e'
,
0
};
static
const
WCHAR
strvalueW
[]
=
{
'S'
,
't'
,
'r'
,
'i'
,
'n'
,
'g'
,
'V'
,
'a'
,
'l'
,
'u'
,
'e'
,
0
};
static
const
WCHAR
boolvalueW
[]
=
{
'B'
,
'o'
,
'o'
,
'l'
,
'V'
,
'a'
,
'l'
,
'u'
,
'e'
,
0
};
...
...
@@ -137,7 +149,7 @@ static HRESULT get_qualifier_value( const WCHAR *class, const WCHAR *member, con
hr
=
create_qualifier_enum
(
class
,
member
,
name
,
&
iter
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
create_class_object
(
qualifiersW
,
iter
,
0
,
NULL
,
&
obj
);
hr
=
create_class_object
(
NULL
,
iter
,
0
,
NULL
,
&
obj
);
IEnumWbemClassObject_Release
(
iter
);
if
(
FAILED
(
hr
))
return
hr
;
...
...
@@ -179,7 +191,12 @@ static HRESULT WINAPI qualifier_set_Get(
{
struct
qualifier_set
*
set
=
impl_from_IWbemQualifierSet
(
iface
);
FIXME
(
"%p, %s, %08x, %p, %p
\n
"
,
iface
,
debugstr_w
(
wszName
),
lFlags
,
pVal
,
plFlavor
);
TRACE
(
"%p, %s, %08x, %p, %p
\n
"
,
iface
,
debugstr_w
(
wszName
),
lFlags
,
pVal
,
plFlavor
);
if
(
lFlags
)
{
FIXME
(
"flags %08x not supported
\n
"
,
lFlags
);
return
E_NOTIMPL
;
}
return
get_qualifier_value
(
set
->
class
,
set
->
member
,
wszName
,
pVal
,
plFlavor
);
}
...
...
@@ -206,8 +223,28 @@ static HRESULT WINAPI qualifier_set_GetNames(
LONG
lFlags
,
SAFEARRAY
**
pNames
)
{
FIXME
(
"%p, %08x, %p
\n
"
,
iface
,
lFlags
,
pNames
);
struct
qualifier_set
*
set
=
impl_from_IWbemQualifierSet
(
iface
);
IEnumWbemClassObject
*
iter
;
IWbemClassObject
*
obj
;
HRESULT
hr
;
TRACE
(
"%p, %08x, %p
\n
"
,
iface
,
lFlags
,
pNames
);
if
(
lFlags
)
{
FIXME
(
"flags %08x not supported
\n
"
,
lFlags
);
return
E_NOTIMPL
;
}
hr
=
create_qualifier_enum
(
set
->
class
,
set
->
member
,
NULL
,
&
iter
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
create_class_object
(
NULL
,
iter
,
0
,
NULL
,
&
obj
);
IEnumWbemClassObject_Release
(
iter
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IWbemClassObject_GetNames
(
obj
,
NULL
,
0
,
NULL
,
pNames
);
IWbemClassObject_Release
(
obj
);
return
hr
;
}
static
HRESULT
WINAPI
qualifier_set_BeginEnumeration
(
...
...
dlls/wbemprox/tests/query.c
View file @
434e94a6
...
...
@@ -46,6 +46,8 @@ static HRESULT exec_query( IWbemServices *services, const WCHAR *str, IEnumWbemC
for
(;;)
{
VARIANT
var
;
IWbemQualifierSet
*
qualifiers
;
SAFEARRAY
*
names
;
IEnumWbemClassObject_Next
(
*
result
,
10000
,
1
,
&
obj
,
&
count
);
if
(
!
count
)
break
;
...
...
@@ -60,6 +62,15 @@ static HRESULT exec_query( IWbemServices *services, const WCHAR *str, IEnumWbemC
trace
(
"description: %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
var
)));
VariantClear
(
&
var
);
}
hr
=
IWbemClassObject_GetQualifierSet
(
obj
,
&
qualifiers
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
IWbemQualifierSet_GetNames
(
qualifiers
,
0
,
&
names
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
SafeArrayDestroy
(
names
);
IWbemQualifierSet_Release
(
qualifiers
);
IWbemClassObject_Release
(
obj
);
}
}
...
...
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