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
5faa69d3
Commit
5faa69d3
authored
May 30, 2013
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
May 30, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oledb32: DBTYPE_BYTES->DBTYPE_VARIANT only uses the source length.
parent
471bdafa
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
5 deletions
+42
-5
convert.c
dlls/oledb32/convert.c
+2
-5
convert.c
dlls/oledb32/tests/convert.c
+40
-0
No files found.
dlls/oledb32/convert.c
View file @
5faa69d3
...
...
@@ -950,18 +950,15 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
case
DBTYPE_BYTES
:
{
LONG
i
;
LONG
size
;
SAFEARRAY
*
psa
=
NULL
;
SAFEARRAYBOUND
rgsabound
[
1
];
unsigned
char
*
p
=
src
;
size
=
min
(
src_len
,
dst_max_len
);
rgsabound
[
0
].
lLbound
=
0
;
rgsabound
[
0
].
cElements
=
s
ize
;
rgsabound
[
0
].
cElements
=
s
rc_len
;
psa
=
SafeArrayCreate
(
VT_UI1
,
1
,
rgsabound
);
for
(
i
=
0
;
i
<
s
ize
;
i
++
,
p
++
)
for
(
i
=
0
;
i
<
s
rc_len
;
i
++
,
p
++
)
{
hr
=
SafeArrayPutElement
(
psa
,
&
i
,
&
p
);
if
(
FAILED
(
hr
))
{
...
...
dlls/oledb32/tests/convert.c
View file @
5faa69d3
...
...
@@ -2716,11 +2716,51 @@ static void test_converttovar(void)
ok
(
S
(
cy2
).
Lo
==
S
(
cy
).
Lo
&&
S
(
cy2
).
Hi
==
S
(
cy
).
Hi
,
"got %d,%d
\n
"
,
S
(
cy2
).
Lo
,
S
(
cy2
).
Hi
);
dst_len
=
0x1234
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_BYTES
,
DBTYPE_VARIANT
,
sizeof
(
byte_src
),
&
dst_len
,
&
byte_src
,
&
dst
,
sizeof
(
dst
),
0
,
&
dst_status
,
0
,
0
,
0
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
dst_status
==
DBSTATUS_S_OK
,
"got %08x
\n
"
,
dst_status
);
ok
(
dst_len
==
sizeof
(
dst
),
"got %ld
\n
"
,
dst_len
);
ok
(
V_VT
(
&
dst
)
==
(
VT_ARRAY
|
VT_UI1
),
"got %d
\n
"
,
V_VT
(
&
dst
));
if
(
V_VT
(
&
dst
)
==
(
VT_ARRAY
|
VT_UI1
))
{
LONG
l
;
hr
=
SafeArrayGetUBound
(
V_ARRAY
(
&
dst
),
1
,
&
l
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
l
==
4
,
"got %d
\n
"
,
l
);
/* 5 elements */
}
VariantClear
(
&
dst
);
dst_len
=
0x1234
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_BYTES
,
DBTYPE_VARIANT
,
0
,
&
dst_len
,
&
byte_src
,
&
dst
,
sizeof
(
dst
),
0
,
&
dst_status
,
0
,
0
,
0
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
dst_status
==
DBSTATUS_S_OK
,
"got %08x
\n
"
,
dst_status
);
ok
(
dst_len
==
sizeof
(
dst
),
"got %ld
\n
"
,
dst_len
);
ok
(
V_VT
(
&
dst
)
==
(
VT_ARRAY
|
VT_UI1
),
"got %d
\n
"
,
V_VT
(
&
dst
));
if
(
V_VT
(
&
dst
)
==
(
VT_ARRAY
|
VT_UI1
))
{
LONG
l
;
hr
=
SafeArrayGetUBound
(
V_ARRAY
(
&
dst
),
1
,
&
l
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
l
==
-
1
,
"got %d
\n
"
,
l
);
/* 0 elements */
}
VariantClear
(
&
dst
);
dst_len
=
0x1234
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_BYTES
,
DBTYPE_VARIANT
,
2
,
&
dst_len
,
&
byte_src
,
&
dst
,
sizeof
(
dst
),
0
,
&
dst_status
,
0
,
0
,
0
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
dst_status
==
DBSTATUS_S_OK
,
"got %08x
\n
"
,
dst_status
);
ok
(
dst_len
==
sizeof
(
dst
),
"got %ld
\n
"
,
dst_len
);
ok
(
V_VT
(
&
dst
)
==
(
VT_ARRAY
|
VT_UI1
),
"got %d
\n
"
,
V_VT
(
&
dst
));
if
(
V_VT
(
&
dst
)
==
(
VT_ARRAY
|
VT_UI1
))
{
LONG
l
;
hr
=
SafeArrayGetUBound
(
V_ARRAY
(
&
dst
),
1
,
&
l
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
l
==
1
,
"got %d
\n
"
,
l
);
/* 2 elements */
}
VariantClear
(
&
dst
);
dst_len
=
0x1234
;
...
...
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