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
eec6aea1
Commit
eec6aea1
authored
Nov 23, 2022
by
Paul Gofman
Committed by
Alexandre Julliard
Nov 24, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wmic: Support array of BSTRs in convert_to_bstr().
parent
e3d7a3e3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
2 deletions
+41
-2
main.c
programs/wmic/main.c
+41
-2
No files found.
programs/wmic/main.c
View file @
eec6aea1
...
...
@@ -168,14 +168,53 @@ static HRESULT process_property_list( IWbemClassObject *obj, const WCHAR *propli
static
void
convert_to_bstr
(
VARIANT
*
v
)
{
BSTR
out
=
NULL
;
VARTYPE
vt
;
if
(
SUCCEEDED
(
VariantChangeType
(
v
,
v
,
0
,
VT_BSTR
)))
return
;
vt
=
V_VT
(
v
);
if
(
vt
==
(
VT_ARRAY
|
VT_BSTR
))
{
unsigned
int
i
,
count
,
len
;
BSTR
*
strings
;
WCHAR
*
ptr
;
if
(
FAILED
(
SafeArrayAccessData
(
V_ARRAY
(
v
),
(
void
**
)
&
strings
)))
{
WINE_ERR
(
"Could not access array.
\n
"
);
goto
done
;
}
count
=
V_ARRAY
(
v
)
->
rgsabound
->
cElements
;
len
=
0
;
for
(
i
=
0
;
i
<
count
;
++
i
)
len
+=
wcslen
(
strings
[
i
]
);
len
+=
count
*
2
+
2
;
if
(
count
)
len
+=
2
*
(
count
-
1
);
out
=
SysAllocStringLen
(
NULL
,
len
);
ptr
=
out
;
*
ptr
++
=
'{'
;
for
(
i
=
0
;
i
<
count
;
++
i
)
{
if
(
i
)
{
memcpy
(
ptr
,
L", "
,
2
*
sizeof
(
*
ptr
)
);
ptr
+=
2
;
}
*
ptr
++
=
'\"'
;
len
=
wcslen
(
strings
[
i
]
);
memcpy
(
ptr
,
strings
[
i
],
len
*
sizeof
(
*
ptr
)
);
ptr
+=
len
;
*
ptr
++
=
'\"'
;
}
*
ptr
++
=
'}'
;
*
ptr
=
0
;
SafeArrayUnaccessData
(
V_ARRAY
(
v
)
);
}
done:
VariantClear
(
v
);
V_VT
(
v
)
=
VT_BSTR
;
V_BSTR
(
v
)
=
SysAllocString
(
L""
);
if
(
vt
!=
VT_NULL
&&
vt
!=
VT_EMPTY
)
V_BSTR
(
v
)
=
out
?
out
:
SysAllocString
(
L""
);
if
(
vt
!=
VT_NULL
&&
vt
!=
VT_EMPTY
&&
!
out
)
WINE_FIXME
(
"Could not convert variant, vt %u.
\n
"
,
vt
);
}
...
...
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