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
d103894e
Commit
d103894e
authored
May 23, 2013
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
May 24, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oledb32: Implemented DataConvert DBTYPE_BSTR->DBTYPE_DBTIMESTAMP.
parent
0bf9266b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
2 deletions
+39
-2
convert.c
dlls/oledb32/convert.c
+28
-2
convert.c
dlls/oledb32/tests/convert.c
+11
-0
No files found.
dlls/oledb32/convert.c
View file @
d103894e
...
...
@@ -480,8 +480,34 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
DBTIMESTAMP
*
d
=
dst
;
switch
(
src_type
)
{
case
DBTYPE_EMPTY
:
memset
(
d
,
0
,
sizeof
(
DBTIMESTAMP
));
hr
=
S_OK
;
break
;
case
DBTYPE_DBTIMESTAMP
:
memcpy
(
d
,
src
,
sizeof
(
DBTIMESTAMP
));
hr
=
S_OK
;
break
;
case
DBTYPE_EMPTY
:
memset
(
d
,
0
,
sizeof
(
DBTIMESTAMP
));
hr
=
S_OK
;
break
;
case
DBTYPE_DBTIMESTAMP
:
memcpy
(
d
,
src
,
sizeof
(
DBTIMESTAMP
));
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
;
d
->
hour
=
st
.
wHour
;
d
->
minute
=
st
.
wMinute
;
d
->
second
=
st
.
wSecond
;
d
->
fraction
=
st
.
wMilliseconds
*
1000000
;
}
VariantClear
(
&
var
);
}
break
;
case
DBTYPE_DATE
:
{
SYSTEMTIME
st
;
...
...
dlls/oledb32/tests/convert.c
View file @
d103894e
...
...
@@ -2666,12 +2666,14 @@ static void test_converttovar(void)
static
void
test_converttotimestamp
(
void
)
{
static
const
WCHAR
strW
[]
=
{
'2'
,
'0'
,
'1'
,
'3'
,
'-'
,
'0'
,
'5'
,
'-'
,
'1'
,
'4'
,
' '
,
'0'
,
'2'
,
':'
,
'0'
,
'4'
,
':'
,
'1'
,
'2'
,
0
};
DBTIMESTAMP
ts
=
{
2013
,
5
,
14
,
2
,
4
,
12
,
0
};
DBTIMESTAMP
dst
;
DBSTATUS
dst_status
;
DBLENGTH
dst_len
;
VARIANT
var
;
HRESULT
hr
;
BSTR
bstr
;
VariantInit
(
&
var
);
V_VT
(
&
var
)
=
VT_DATE
;
...
...
@@ -2682,6 +2684,15 @@ static void test_converttotimestamp(void)
ok
(
dst_status
==
DBSTATUS_S_OK
,
"got %08x
\n
"
,
dst_status
);
ok
(
dst_len
==
sizeof
(
dst
),
"got %ld
\n
"
,
dst_len
);
ok
(
!
memcmp
(
&
ts
,
&
dst
,
sizeof
(
ts
)),
"Wrong timestamp
\n
"
);
bstr
=
SysAllocString
(
strW
);
dst_len
=
0x1234
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_BSTR
,
DBTYPE_DBTIMESTAMP
,
0
,
&
dst_len
,
&
bstr
,
&
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
(
!
memcmp
(
&
ts
,
&
dst
,
sizeof
(
ts
)),
"Wrong timestamp
\n
"
);
SysFreeString
(
bstr
);
}
START_TEST
(
convert
)
...
...
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