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
433c17c0
Commit
433c17c0
authored
Jan 27, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Add support for writing VT_BSTR properties.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
12a1ca5c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
12 deletions
+53
-12
stg_prop.c
dlls/ole32/stg_prop.c
+53
-12
No files found.
dlls/ole32/stg_prop.c
View file @
433c17c0
...
...
@@ -623,15 +623,24 @@ static HRESULT PropertyStorage_PropVariantCopy(PROPVARIANT *prop, const PROPVARI
assert
(
prop
);
assert
(
propvar
);
if
(
propvar
->
vt
==
VT_LPSTR
)
switch
(
propvar
->
vt
)
{
hr
=
PropertyStorage_StringCopy
(
propvar
->
u
.
pszVal
,
srcCP
,
&
prop
->
u
.
pszVal
,
targetCP
);
case
VT_LPSTR
:
hr
=
PropertyStorage_StringCopy
(
propvar
->
u
.
pszVal
,
srcCP
,
&
prop
->
u
.
pszVal
,
targetCP
);
if
(
SUCCEEDED
(
hr
))
prop
->
vt
=
VT_LPSTR
;
}
break
;
case
VT_BSTR
:
if
((
prop
->
u
.
bstrVal
=
SysAllocStringLen
(
propvar
->
u
.
bstrVal
,
SysStringLen
(
propvar
->
u
.
bstrVal
))))
prop
->
vt
=
VT_BSTR
;
else
PropVariantCopy
(
prop
,
propvar
);
hr
=
E_OUTOFMEMORY
;
break
;
default:
hr
=
PropVariantCopy
(
prop
,
propvar
);
}
return
hr
;
}
...
...
@@ -1881,11 +1890,11 @@ end:
static
HRESULT
PropertyStorage_WritePropertyToStream
(
PropertyStorage_impl
*
This
,
DWORD
propNum
,
DWORD
propid
,
const
PROPVARIANT
*
var
,
DWORD
*
sectionOffset
)
{
DWORD
len
,
dwType
,
dwTemp
,
bytesWritten
;
HRESULT
hr
;
LARGE_INTEGER
seek
;
PROPERTYIDOFFSET
propIdOffset
;
ULONG
count
;
DWORD
dwType
,
bytesWritten
;
assert
(
var
);
assert
(
sectionOffset
);
...
...
@@ -1938,8 +1947,6 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This,
case
VT_I4
:
case
VT_UI4
:
{
DWORD
dwTemp
;
StorageUtl_WriteDWord
(
&
dwTemp
,
0
,
var
->
u
.
lVal
);
hr
=
IStream_Write
(
This
->
stm
,
&
dwTemp
,
sizeof
(
dwTemp
),
&
count
);
bytesWritten
=
count
;
...
...
@@ -1947,8 +1954,6 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This,
}
case
VT_LPSTR
:
{
DWORD
len
,
dwTemp
;
if
(
This
->
codePage
==
CP_UNICODE
)
len
=
(
lstrlenW
(
var
->
u
.
pwszVal
)
+
1
)
*
sizeof
(
WCHAR
);
else
...
...
@@ -1961,9 +1966,45 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This,
bytesWritten
=
count
+
sizeof
(
DWORD
);
break
;
}
case
VT_BSTR
:
{
if
(
This
->
codePage
==
CP_UNICODE
)
{
len
=
SysStringByteLen
(
var
->
u
.
bstrVal
)
+
sizeof
(
WCHAR
);
StorageUtl_WriteDWord
(
&
dwTemp
,
0
,
len
);
hr
=
IStream_Write
(
This
->
stm
,
&
dwTemp
,
sizeof
(
dwTemp
),
&
count
);
if
(
SUCCEEDED
(
hr
))
hr
=
IStream_Write
(
This
->
stm
,
var
->
u
.
bstrVal
,
len
,
&
count
);
}
else
{
char
*
str
;
len
=
WideCharToMultiByte
(
This
->
codePage
,
0
,
var
->
u
.
bstrVal
,
SysStringLen
(
var
->
u
.
bstrVal
)
+
1
,
NULL
,
0
,
NULL
,
NULL
);
str
=
heap_alloc
(
len
);
if
(
!
str
)
{
hr
=
E_OUTOFMEMORY
;
goto
end
;
}
WideCharToMultiByte
(
This
->
codePage
,
0
,
var
->
u
.
bstrVal
,
SysStringLen
(
var
->
u
.
bstrVal
),
str
,
len
,
NULL
,
NULL
);
StorageUtl_WriteDWord
(
&
dwTemp
,
0
,
len
);
hr
=
IStream_Write
(
This
->
stm
,
&
dwTemp
,
sizeof
(
dwTemp
),
&
count
);
if
(
SUCCEEDED
(
hr
))
hr
=
IStream_Write
(
This
->
stm
,
str
,
len
,
&
count
);
heap_free
(
str
);
}
bytesWritten
=
count
+
sizeof
(
DWORD
);
break
;
}
case
VT_LPWSTR
:
{
DWORD
len
=
lstrlenW
(
var
->
u
.
pwszVal
)
+
1
,
dwTemp
;
len
=
lstrlenW
(
var
->
u
.
pwszVal
)
+
1
;
StorageUtl_WriteDWord
(
&
dwTemp
,
0
,
len
);
hr
=
IStream_Write
(
This
->
stm
,
&
dwTemp
,
sizeof
(
dwTemp
),
&
count
);
...
...
@@ -1985,7 +2026,7 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This,
}
case
VT_CF
:
{
DWORD
cf_hdr
[
2
]
,
len
;
DWORD
cf_hdr
[
2
];
len
=
var
->
u
.
pclipdata
->
cbSize
;
StorageUtl_WriteDWord
(
&
cf_hdr
[
0
],
0
,
len
+
8
);
...
...
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