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
0d6eadc4
Commit
0d6eadc4
authored
May 23, 2013
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
May 23, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oledb32: Implement DataConvert DBTYPE_VARIANT->DBTYPE_DATE.
parent
8e2cd615
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
convert.c
dlls/oledb32/convert.c
+21
-0
convert.c
dlls/oledb32/tests/convert.c
+11
-0
No files found.
dlls/oledb32/convert.c
View file @
0d6eadc4
...
...
@@ -428,6 +428,27 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
switch
(
src_type
)
{
case
DBTYPE_DBDATE
:
memcpy
(
d
,
src
,
sizeof
(
DBDATE
));
hr
=
S_OK
;
break
;
case
DBTYPE_BSTR
:
{
VARIANT
var
;
BSTR
s
=
*
(
WCHAR
**
)
src
;
VariantInit
(
&
var
);
V_VT
(
&
var
)
=
VT_BSTR
;
V_BSTR
(
&
var
)
=
SysAllocString
(
s
);
if
((
hr
=
VariantChangeType
(
&
var
,
&
var
,
0
,
VT_DATE
))
==
S_OK
)
{
SYSTEMTIME
st
;
hr
=
(
VariantTimeToSystemTime
(
V_DATE
(
&
var
),
&
st
)
?
S_OK
:
E_FAIL
);
d
->
year
=
st
.
wYear
;
d
->
month
=
st
.
wMonth
;
d
->
day
=
st
.
wDay
;
}
VariantClear
(
&
var
);
}
break
;
case
DBTYPE_VARIANT
:
if
(
V_VT
((
VARIANT
*
)
src
)
==
VT_DATE
)
{
...
...
dlls/oledb32/tests/convert.c
View file @
0d6eadc4
...
...
@@ -2467,10 +2467,12 @@ static void test_converttodbdate(void)
{
DBLENGTH
dst_len
;
HRESULT
hr
;
static
WCHAR
strW
[]
=
{
'2'
,
'0'
,
'1'
,
'3'
,
'-'
,
'0'
,
'5'
,
'-'
,
'1'
,
'4'
,
0
};
DBDATE
ts
=
{
2013
,
5
,
14
};
DBDATE
dst
;
DBSTATUS
dst_status
;
VARIANT
var
;
BSTR
bstr
;
dst_len
=
0
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_DBDATE
,
DBTYPE_DBDATE
,
sizeof
(
ts
),
&
dst_len
,
&
ts
,
&
dst
,
2
,
0
,
&
dst_status
,
0
,
0
,
0
);
...
...
@@ -2488,6 +2490,15 @@ static void test_converttodbdate(void)
ok
(
dst_status
==
DBSTATUS_S_OK
,
"got %08x
\n
"
,
dst_status
);
ok
(
dst_len
==
sizeof
(
DBDATE
),
"got %ld
\n
"
,
dst_len
);
ok
(
!
memcmp
(
&
ts
,
&
dst
,
sizeof
(
DBDATE
)
),
"bytes differ
\n
"
);
dst_len
=
0
;
bstr
=
SysAllocString
(
strW
);
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_BSTR
,
DBTYPE_DBDATE
,
0
,
&
dst_len
,
&
bstr
,
&
dst
,
2
,
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
(
DBDATE
),
"got %ld
\n
"
,
dst_len
);
ok
(
!
memcmp
(
&
ts
,
&
dst
,
sizeof
(
DBDATE
)
),
"bytes differ
\n
"
);
SysFreeString
(
bstr
);
}
...
...
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