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
d7278752
Commit
d7278752
authored
May 13, 2013
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
May 13, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oledb32: Implement GetConversionSize DBTYPE_VARIANT->DBTYPE_WSTR.
parent
489707f9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
0 deletions
+42
-0
convert.c
dlls/oledb32/convert.c
+14
-0
convert.c
dlls/oledb32/tests/convert.c
+28
-0
No files found.
dlls/oledb32/convert.c
View file @
d7278752
...
...
@@ -1113,6 +1113,20 @@ static HRESULT WINAPI convert_GetConversionSize(IDataConvert* iface,
{
switch
(
src_type
)
{
case
DBTYPE_VARIANT
:
{
VARIANT
v
;
VariantInit
(
&
v
);
if
((
hr
=
VariantChangeType
(
&
v
,
(
VARIANT
*
)
src
,
0
,
VT_BSTR
))
==
S_OK
)
{
*
dst_len
=
(
SysStringLen
(
V_BSTR
(
&
v
))
+
1
)
*
sizeof
(
WCHAR
);
VariantClear
(
&
v
);
}
else
return
hr
;
}
break
;
case
DBTYPE_STR
:
if
(
src_len
)
*
dst_len
=
(
*
src_len
+
1
)
*
sizeof
(
WCHAR
);
...
...
dlls/oledb32/tests/convert.c
View file @
d7278752
...
...
@@ -2339,6 +2339,7 @@ static void test_getconversionsize(void)
BSTR
str
;
static
WCHAR
strW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
0
};
static
char
strTest
[]
=
"test"
;
VARIANT
var
;
/* same way as CanConvert fails here */
dst_len
=
0
;
...
...
@@ -2394,6 +2395,33 @@ static void test_getconversionsize(void)
hr
=
IDataConvert_GetConversionSize
(
convert
,
DBTYPE_STR
,
DBTYPE_WSTR
,
&
src_len
,
&
dst_len
,
strTest
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
dst_len
==
42
,
"%ld
\n
"
,
dst_len
);
dst_len
=
0
;
V_VT
(
&
var
)
=
VT_BSTR
;
V_BSTR
(
&
var
)
=
SysAllocString
(
strW
);
hr
=
IDataConvert_GetConversionSize
(
convert
,
DBTYPE_VARIANT
,
DBTYPE_WSTR
,
NULL
,
&
dst_len
,
&
var
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
dst_len
==
10
,
"%ld
\n
"
,
dst_len
);
VariantClear
(
&
var
);
dst_len
=
0
;
src_len
=
20
;
V_VT
(
&
var
)
=
VT_BSTR
;
V_BSTR
(
&
var
)
=
SysAllocString
(
strW
);
hr
=
IDataConvert_GetConversionSize
(
convert
,
DBTYPE_VARIANT
,
DBTYPE_WSTR
,
&
src_len
,
&
dst_len
,
&
var
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
dst_len
==
10
,
"%ld
\n
"
,
dst_len
);
VariantClear
(
&
var
);
dst_len
=
0
;
src_len
=
20
;
V_VT
(
&
var
)
=
VT_I4
;
V_I4
(
&
var
)
=
4
;
hr
=
IDataConvert_GetConversionSize
(
convert
,
DBTYPE_VARIANT
,
DBTYPE_WSTR
,
&
src_len
,
&
dst_len
,
&
var
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
dst_len
==
110
,
"%ld
\n
"
,
dst_len
);
VariantClear
(
&
var
);
}
static
void
test_converttovar
(
void
)
...
...
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