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
24e56bee
Commit
24e56bee
authored
May 20, 2013
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
May 22, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oledb32: Implement DataConvert DBTYPE_VARIANT(V_DATE)->DBTYPE_DBDATE.
parent
4bd39812
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
3 deletions
+29
-3
convert.c
dlls/oledb32/convert.c
+19
-3
convert.c
dlls/oledb32/tests/convert.c
+10
-0
No files found.
dlls/oledb32/convert.c
View file @
24e56bee
...
@@ -421,6 +421,21 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
...
@@ -421,6 +421,21 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
switch
(
src_type
)
switch
(
src_type
)
{
{
case
DBTYPE_DBDATE
:
memcpy
(
d
,
src
,
sizeof
(
DBDATE
));
hr
=
S_OK
;
break
;
case
DBTYPE_DBDATE
:
memcpy
(
d
,
src
,
sizeof
(
DBDATE
));
hr
=
S_OK
;
break
;
case
DBTYPE_VARIANT
:
if
(
V_VT
((
VARIANT
*
)
src
)
==
VT_DATE
)
{
SYSTEMTIME
st
;
hr
=
(
VariantTimeToSystemTime
(
V_DATE
((
VARIANT
*
)
src
),
&
st
)
?
S_OK
:
E_FAIL
);
d
->
year
=
st
.
wYear
;
d
->
month
=
st
.
wMonth
;
d
->
day
=
st
.
wDay
;
}
else
{
FIXME
(
"Unimplemented variant type %d -> DBDATE
\n
"
,
V_VT
((
VARIANT
*
)
src
));
return
E_NOTIMPL
;
}
break
;
default:
FIXME
(
"Unimplemented conversion %04x -> DBDATE
\n
"
,
src_type
);
return
E_NOTIMPL
;
default:
FIXME
(
"Unimplemented conversion %04x -> DBDATE
\n
"
,
src_type
);
return
E_NOTIMPL
;
}
}
break
;
break
;
...
@@ -446,7 +461,6 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
...
@@ -446,7 +461,6 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
break
;
break
;
}
}
case
DBTYPE_VARIANT
:
case
DBTYPE_VARIANT
:
{
if
(
V_VT
((
VARIANT
*
)
src
)
==
VT_DATE
)
if
(
V_VT
((
VARIANT
*
)
src
)
==
VT_DATE
)
{
{
SYSTEMTIME
st
;
SYSTEMTIME
st
;
...
@@ -458,11 +472,13 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
...
@@ -458,11 +472,13 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
d
->
minute
=
st
.
wMinute
;
d
->
minute
=
st
.
wMinute
;
d
->
second
=
st
.
wSecond
;
d
->
second
=
st
.
wSecond
;
d
->
fraction
=
st
.
wMilliseconds
*
1000000
;
d
->
fraction
=
st
.
wMilliseconds
*
1000000
;
break
;
}
}
else
else
{
FIXME
(
"Unimplemented variant type %d -> DBTIMESTAMP
\n
"
,
V_VT
((
VARIANT
*
)
src
));
FIXME
(
"Unimplemented variant type %d -> DBTIMESTAMP
\n
"
,
V_VT
((
VARIANT
*
)
src
));
}
return
E_NOTIMPL
;
}
break
;
default:
FIXME
(
"Unimplemented conversion %04x -> DBTIMESTAMP
\n
"
,
src_type
);
return
E_NOTIMPL
;
default:
FIXME
(
"Unimplemented conversion %04x -> DBTIMESTAMP
\n
"
,
src_type
);
return
E_NOTIMPL
;
}
}
break
;
break
;
...
...
dlls/oledb32/tests/convert.c
View file @
24e56bee
...
@@ -2462,6 +2462,7 @@ static void test_converttodbdate(void)
...
@@ -2462,6 +2462,7 @@ static void test_converttodbdate(void)
DBDATE
ts
=
{
2013
,
5
,
14
};
DBDATE
ts
=
{
2013
,
5
,
14
};
DBDATE
dst
;
DBDATE
dst
;
DBSTATUS
dst_status
;
DBSTATUS
dst_status
;
VARIANT
var
;
dst_len
=
0
;
dst_len
=
0
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_DBDATE
,
DBTYPE_DBDATE
,
sizeof
(
ts
),
&
dst_len
,
&
ts
,
&
dst
,
2
,
0
,
&
dst_status
,
0
,
0
,
0
);
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_DBDATE
,
DBTYPE_DBDATE
,
sizeof
(
ts
),
&
dst_len
,
&
ts
,
&
dst
,
2
,
0
,
&
dst_status
,
0
,
0
,
0
);
...
@@ -2470,6 +2471,15 @@ static void test_converttodbdate(void)
...
@@ -2470,6 +2471,15 @@ static void test_converttodbdate(void)
ok
(
dst_len
==
sizeof
(
DBDATE
),
"got %ld
\n
"
,
dst_len
);
ok
(
dst_len
==
sizeof
(
DBDATE
),
"got %ld
\n
"
,
dst_len
);
ok
(
!
memcmp
(
&
ts
,
&
dst
,
sizeof
(
DBDATE
)
),
"bytes differ
\n
"
);
ok
(
!
memcmp
(
&
ts
,
&
dst
,
sizeof
(
DBDATE
)
),
"bytes differ
\n
"
);
VariantInit
(
&
var
);
V_VT
(
&
var
)
=
VT_DATE
;
V_DATE
(
&
var
)
=
41408
.
086250
;
dst_len
=
0
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_VARIANT
,
DBTYPE_DBDATE
,
sizeof
(
var
),
&
dst_len
,
&
var
,
&
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
"
);
}
}
...
...
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