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
b45e3160
Commit
b45e3160
authored
May 17, 2005
by
Juan Lang
Committed by
Alexandre Julliard
May 17, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Obvious fixes to PropVariantClear and PropVariantCopy for vector
types.
parent
012b4538
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
12 deletions
+46
-12
ole2.c
dlls/ole32/ole2.c
+46
-12
No files found.
dlls/ole32/ole2.c
View file @
b45e3160
...
...
@@ -5,6 +5,7 @@
* Copyright 1999 Francis Beaudet
* Copyright 1999 Noel Borthwick
* Copyright 1999, 2000 Marcus Meissner
* Copyright 2005 Juan Lang
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -2540,6 +2541,10 @@ HRESULT WINAPI PropVariantClear(PROPVARIANT * pvar) /* [in/out] */
}
break
;
default:
if
(
pvar
->
vt
&
VT_VECTOR
)
{
ULONG
i
;
switch
(
pvar
->
vt
&
~
VT_VECTOR
)
{
case
VT_VARIANT
:
...
...
@@ -2549,10 +2554,17 @@ HRESULT WINAPI PropVariantClear(PROPVARIANT * pvar) /* [in/out] */
OLE_FreeClipDataArray
(
pvar
->
u
.
caclipdata
.
cElems
,
pvar
->
u
.
caclipdata
.
pElems
);
break
;
case
VT_BSTR
:
for
(
i
=
0
;
i
<
pvar
->
u
.
cabstr
.
cElems
;
i
++
)
PropSysFreeString
(
pvar
->
u
.
cabstr
.
pElems
[
i
]);
break
;
case
VT_LPSTR
:
for
(
i
=
0
;
i
<
pvar
->
u
.
calpstr
.
cElems
;
i
++
)
CoTaskMemFree
(
pvar
->
u
.
calpstr
.
pElems
[
i
]);
break
;
case
VT_LPWSTR
:
case
VT_CLSID
:
FIXME
(
"Freeing of vector sub-type not supported yet
\n
"
);
for
(
i
=
0
;
i
<
pvar
->
u
.
calpwstr
.
cElems
;
i
++
)
CoTaskMemFree
(
pvar
->
u
.
calpwstr
.
pElems
[
i
]);
break
;
}
if
(
pvar
->
vt
&
~
VT_VECTOR
)
{
...
...
@@ -2561,6 +2573,9 @@ HRESULT WINAPI PropVariantClear(PROPVARIANT * pvar) /* [in/out] */
CoTaskMemFree
(
pvar
->
u
.
capropvar
.
pElems
);
}
}
else
WARN
(
"Invalid/unsupported type %d
\n
"
,
pvar
->
vt
);
}
ZeroMemory
(
pvar
,
sizeof
(
*
pvar
));
...
...
@@ -2631,7 +2646,9 @@ HRESULT WINAPI PropVariantCopy(PROPVARIANT *pvarDest, /* [out] */
if
(
pvarSrc
->
vt
&
VT_VECTOR
)
{
int
elemSize
;
switch
(
pvarSrc
->
vt
&
VT_VECTOR
)
ULONG
i
;
switch
(
pvarSrc
->
vt
&
~
VT_VECTOR
)
{
case
VT_I1
:
elemSize
=
sizeof
(
pvarSrc
->
u
.
cVal
);
break
;
case
VT_UI1
:
elemSize
=
sizeof
(
pvarSrc
->
u
.
bVal
);
break
;
...
...
@@ -2650,20 +2667,19 @@ HRESULT WINAPI PropVariantCopy(PROPVARIANT *pvarDest, /* [out] */
case
VT_FILETIME
:
elemSize
=
sizeof
(
pvarSrc
->
u
.
filetime
);
break
;
case
VT_CLSID
:
elemSize
=
sizeof
(
*
pvarSrc
->
u
.
puuid
);
break
;
case
VT_CF
:
elemSize
=
sizeof
(
*
pvarSrc
->
u
.
pclipdata
);
break
;
case
VT_BSTR
:
elemSize
=
sizeof
(
*
pvarSrc
->
u
.
bstrVal
);
break
;
case
VT_LPSTR
:
elemSize
=
sizeof
(
*
pvarSrc
->
u
.
pszVal
);
break
;
case
VT_LPWSTR
:
elemSize
=
sizeof
(
*
pvarSrc
->
u
.
pwszVal
);
break
;
case
VT_BSTR
:
case
VT_LPSTR
:
case
VT_LPWSTR
:
case
VT_VARIANT
:
default:
FIXME
(
"Invalid element type: %ul
\n
"
,
pvarSrc
->
vt
&
VT_VECTOR
);
FIXME
(
"Invalid element type: %ul
\n
"
,
pvarSrc
->
vt
&
~
VT_VECTOR
);
return
E_INVALIDARG
;
}
len
=
pvarSrc
->
u
.
capropvar
.
cElems
;
pvarDest
->
u
.
capropvar
.
pElems
=
CoTaskMemAlloc
(
len
*
elemSize
);
if
(
pvarSrc
->
vt
==
(
VT_VECTOR
|
VT_VARIANT
))
{
ULONG
i
;
for
(
i
=
0
;
i
<
len
;
i
++
)
PropVariantCopy
(
&
pvarDest
->
u
.
capropvar
.
pElems
[
i
],
&
pvarSrc
->
u
.
capropvar
.
pElems
[
i
]);
}
...
...
@@ -2673,19 +2689,37 @@ HRESULT WINAPI PropVariantCopy(PROPVARIANT *pvarDest, /* [out] */
}
else
if
(
pvarSrc
->
vt
==
(
VT_VECTOR
|
VT_BSTR
))
{
FIXME
(
"Copy BSTRs
\n
"
);
for
(
i
=
0
;
i
<
len
;
i
++
)
pvarDest
->
u
.
cabstr
.
pElems
[
i
]
=
PropSysAllocString
(
pvarSrc
->
u
.
cabstr
.
pElems
[
i
]);
}
else
if
(
pvarSrc
->
vt
==
(
VT_VECTOR
|
VT_LPSTR
))
{
FIXME
(
"Copy LPSTRs
\n
"
);
size_t
strLen
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
strLen
=
lstrlenA
(
pvarSrc
->
u
.
calpstr
.
pElems
[
i
])
+
1
;
pvarDest
->
u
.
calpstr
.
pElems
[
i
]
=
CoTaskMemAlloc
(
strLen
);
memcpy
(
pvarDest
->
u
.
calpstr
.
pElems
[
i
],
pvarSrc
->
u
.
calpstr
.
pElems
[
i
],
strLen
);
}
else
if
(
pvarSrc
->
vt
==
(
VT_VECTOR
|
VT_LPSTR
))
}
else
if
(
pvarSrc
->
vt
==
(
VT_VECTOR
|
VT_LPWSTR
))
{
size_t
strLen
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
FIXME
(
"Copy LPWSTRs
\n
"
);
strLen
=
(
lstrlenW
(
pvarSrc
->
u
.
calpwstr
.
pElems
[
i
])
+
1
)
*
sizeof
(
WCHAR
);
pvarDest
->
u
.
calpstr
.
pElems
[
i
]
=
CoTaskMemAlloc
(
strLen
);
memcpy
(
pvarDest
->
u
.
calpstr
.
pElems
[
i
],
pvarSrc
->
u
.
calpstr
.
pElems
[
i
],
strLen
);
}
}
else
CopyMemory
(
pvarDest
->
u
.
capropvar
.
pElems
,
pvarSrc
->
u
.
capropvar
.
pElems
,
len
*
elemSize
);
}
else
WARN
(
"Invalid/unsupported type %d
\n
"
,
pvarSrc
->
vt
);
}
return
S_OK
;
...
...
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