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
a1baa22d
Commit
a1baa22d
authored
May 24, 2013
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
May 27, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oledb32: DataConvert Support NULL variant in, DBTYPE_VARIANT->DBTYPE_WSTR.
parent
65a47e3d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
convert.c
dlls/oledb32/convert.c
+2
-1
convert.c
dlls/oledb32/tests/convert.c
+19
-0
No files found.
dlls/oledb32/convert.c
View file @
a1baa22d
...
@@ -787,7 +787,8 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
...
@@ -787,7 +787,8 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
hr
=
IDataConvert_DataConvert
(
iface
,
src_type
,
DBTYPE_BSTR
,
src_len
,
&
bstr_len
,
hr
=
IDataConvert_DataConvert
(
iface
,
src_type
,
DBTYPE_BSTR
,
src_len
,
&
bstr_len
,
src
,
&
b
,
sizeof
(
BSTR
),
src_status
,
dst_status
,
src
,
&
b
,
sizeof
(
BSTR
),
src_status
,
dst_status
,
precision
,
scale
,
flags
);
precision
,
scale
,
flags
);
if
(
hr
!=
S_OK
)
return
hr
;
if
(
hr
!=
S_OK
||
*
dst_status
==
DBSTATUS_S_ISNULL
)
return
hr
;
bstr_len
=
SysStringLen
(
b
);
bstr_len
=
SysStringLen
(
b
);
*
dst_len
=
bstr_len
*
sizeof
(
WCHAR
);
/* Doesn't include size for '\0' */
*
dst_len
=
bstr_len
*
sizeof
(
WCHAR
);
/* Doesn't include size for '\0' */
*
dst_status
=
DBSTATUS_S_OK
;
*
dst_status
=
DBSTATUS_S_OK
;
...
...
dlls/oledb32/tests/convert.c
View file @
a1baa22d
...
@@ -1017,6 +1017,7 @@ static void test_converttowstr(void)
...
@@ -1017,6 +1017,7 @@ static void test_converttowstr(void)
static
const
WCHAR
hexunpacked_w
[]
=
{
'5'
,
'7'
,
'0'
,
'0'
,
'6'
,
'9'
,
'0'
,
'0'
,
'6'
,
'E'
,
'0'
,
'0'
,
'6'
,
'5'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
0
};
static
const
WCHAR
hexunpacked_w
[]
=
{
'5'
,
'7'
,
'0'
,
'0'
,
'6'
,
'9'
,
'0'
,
'0'
,
'6'
,
'E'
,
'0'
,
'0'
,
'6'
,
'5'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
0
};
static
const
WCHAR
hexpacked_w
[]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
0
};
static
const
WCHAR
hexpacked_w
[]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
0
};
BSTR
b
;
BSTR
b
;
VARIANT
v
;
memset
(
dst
,
0xcc
,
sizeof
(
dst
));
memset
(
dst
,
0xcc
,
sizeof
(
dst
));
dst_len
=
0x1234
;
dst_len
=
0x1234
;
...
@@ -1470,6 +1471,24 @@ static void test_converttowstr(void)
...
@@ -1470,6 +1471,24 @@ static void test_converttowstr(void)
ok
(
dst_len
==
0
,
"got %ld
\n
"
,
dst_len
);
ok
(
dst_len
==
0
,
"got %ld
\n
"
,
dst_len
);
ok
(
dst
[
0
]
==
0
,
"not null terminated
\n
"
);
ok
(
dst
[
0
]
==
0
,
"not null terminated
\n
"
);
ok
(
dst
[
1
]
==
0xcccc
,
"clobbered buffer
\n
"
);
ok
(
dst
[
1
]
==
0xcccc
,
"clobbered buffer
\n
"
);
b
=
SysAllocStringLen
(
NULL
,
0
);
V_VT
(
&
v
)
=
VT_BSTR
;
V_BSTR
(
&
v
)
=
b
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_VARIANT
,
DBTYPE_WSTR
,
0
,
&
dst_len
,
&
v
,
&
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
==
0
,
"got %ld
\n
"
,
dst_len
);
ok
(
dst
!=
NULL
,
"got %p
\n
"
,
dst
);
ok
(
dst
!=
b
,
"got %p src %p
\n
"
,
dst
,
b
);
ok
(
!
lstrcmpW
(
b
,
dst
),
"got %s
\n
"
,
wine_dbgstr_w
(
dst
));
VariantClear
(
&
v
);
V_VT
(
&
v
)
=
VT_NULL
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_VARIANT
,
DBTYPE_WSTR
,
0
,
&
dst_len
,
&
v
,
&
dst
,
sizeof
(
dst
),
0
,
&
dst_status
,
0
,
0
,
0
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
dst_status
==
DBSTATUS_S_ISNULL
,
"got %08x
\n
"
,
dst_status
);
ok
(
dst_len
==
0
,
"got %ld
\n
"
,
dst_len
);
}
}
static
void
test_converttostr
(
void
)
static
void
test_converttostr
(
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