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
afa90e32
Commit
afa90e32
authored
Nov 17, 2010
by
Andreas Pflug
Committed by
Alexandre Julliard
Nov 18, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oledb32: Added conversions for R8,BOOL,DATE,DBTIMESTAMP.
parent
d7a0284f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
129 additions
and
0 deletions
+129
-0
convert.c
dlls/oledb32/convert.c
+120
-0
oledb.idl
include/oledb.idl
+9
-0
No files found.
dlls/oledb32/convert.c
View file @
afa90e32
...
...
@@ -120,13 +120,19 @@ static int get_length(DBTYPE type)
case
DBTYPE_I2
:
case
DBTYPE_UI2
:
return
2
;
case
DBTYPE_BOOL
:
return
sizeof
(
VARIANT_BOOL
);
case
DBTYPE_I4
:
case
DBTYPE_UI4
:
case
DBTYPE_R4
:
return
4
;
case
DBTYPE_I8
:
case
DBTYPE_UI8
:
case
DBTYPE_R8
:
case
DBTYPE_DATE
:
return
8
;
case
DBTYPE_DBTIMESTAMP
:
return
sizeof
(
DBTIMESTAMP
);
case
DBTYPE_CY
:
return
sizeof
(
CY
);
case
DBTYPE_BSTR
:
...
...
@@ -299,6 +305,120 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
}
break
;
}
case
DBTYPE_R8
:
{
DOUBLE
*
d
=
dst
;
switch
(
src_type
)
{
case
DBTYPE_EMPTY
:
*
d
=
0
;
hr
=
S_OK
;
break
;
case
DBTYPE_I1
:
hr
=
VarR8FromI1
(
*
(
signed
char
*
)
src
,
d
);
break
;
case
DBTYPE_I2
:
hr
=
VarR8FromI2
(
*
(
signed
short
*
)
src
,
d
);
break
;
case
DBTYPE_I4
:
hr
=
VarR8FromI4
(
*
(
signed
int
*
)
src
,
d
);
break
;
case
DBTYPE_I8
:
hr
=
VarR8FromI8
(
*
(
LONGLONG
*
)
src
,
d
);
break
;
case
DBTYPE_UI1
:
hr
=
VarR8FromUI1
(
*
(
BYTE
*
)
src
,
d
);
break
;
case
DBTYPE_UI2
:
hr
=
VarR8FromUI2
(
*
(
WORD
*
)
src
,
d
);
break
;
case
DBTYPE_UI4
:
hr
=
VarR8FromUI4
(
*
(
DWORD
*
)
src
,
d
);
break
;
case
DBTYPE_UI8
:
hr
=
VarR8FromUI8
(
*
(
ULONGLONG
*
)
src
,
d
);
break
;
case
DBTYPE_R4
:
hr
=
VarR8FromR4
(
*
(
FLOAT
*
)
src
,
d
);
break
;
case
DBTYPE_R8
:
*
d
=
*
(
DOUBLE
*
)
src
;
hr
=
S_OK
;
break
;
case
DBTYPE_CY
:
hr
=
VarR8FromCy
(
*
(
CY
*
)
src
,
d
);
break
;
case
DBTYPE_DATE
:
hr
=
VarR8FromDate
(
*
(
DATE
*
)
src
,
d
);
break
;
case
DBTYPE_BSTR
:
hr
=
VarR8FromStr
(
*
(
WCHAR
**
)
src
,
LOCALE_USER_DEFAULT
,
0
,
d
);
break
;
case
DBTYPE_BOOL
:
hr
=
VarR8FromBool
(
*
(
VARIANT_BOOL
*
)
src
,
d
);
break
;
case
DBTYPE_DECIMAL
:
hr
=
VarR8FromDec
((
DECIMAL
*
)
src
,
d
);
break
;
default:
FIXME
(
"Unimplemented conversion %04x -> R8
\n
"
,
src_type
);
return
E_NOTIMPL
;
}
break
;
}
case
DBTYPE_BOOL
:
{
VARIANT_BOOL
*
d
=
dst
;
switch
(
src_type
)
{
case
DBTYPE_EMPTY
:
*
d
=
0
;
hr
=
S_OK
;
break
;
case
DBTYPE_I1
:
hr
=
VarBoolFromI1
(
*
(
signed
char
*
)
src
,
d
);
break
;
case
DBTYPE_I2
:
hr
=
VarBoolFromI2
(
*
(
signed
short
*
)
src
,
d
);
break
;
case
DBTYPE_I4
:
hr
=
VarBoolFromI4
(
*
(
signed
int
*
)
src
,
d
);
break
;
case
DBTYPE_I8
:
hr
=
VarBoolFromI8
(
*
(
LONGLONG
*
)
src
,
d
);
break
;
case
DBTYPE_UI1
:
hr
=
VarBoolFromUI1
(
*
(
BYTE
*
)
src
,
d
);
break
;
case
DBTYPE_UI2
:
hr
=
VarBoolFromUI2
(
*
(
WORD
*
)
src
,
d
);
break
;
case
DBTYPE_UI4
:
hr
=
VarBoolFromUI4
(
*
(
DWORD
*
)
src
,
d
);
break
;
case
DBTYPE_UI8
:
hr
=
VarBoolFromUI8
(
*
(
ULONGLONG
*
)
src
,
d
);
break
;
case
DBTYPE_R4
:
hr
=
VarBoolFromR4
(
*
(
FLOAT
*
)
src
,
d
);
break
;
case
DBTYPE_R8
:
hr
=
VarBoolFromR8
(
*
(
DOUBLE
*
)
src
,
d
);
break
;
case
DBTYPE_CY
:
hr
=
VarBoolFromCy
(
*
(
CY
*
)
src
,
d
);
break
;
case
DBTYPE_DATE
:
hr
=
VarBoolFromDate
(
*
(
DATE
*
)
src
,
d
);
break
;
case
DBTYPE_BSTR
:
hr
=
VarBoolFromStr
(
*
(
WCHAR
**
)
src
,
LOCALE_USER_DEFAULT
,
0
,
d
);
break
;
case
DBTYPE_BOOL
:
*
d
=
*
(
VARIANT_BOOL
*
)
src
;
hr
=
S_OK
;
break
;
case
DBTYPE_DECIMAL
:
hr
=
VarBoolFromDec
((
DECIMAL
*
)
src
,
d
);
break
;
default:
FIXME
(
"Unimplemented conversion %04x -> BOOL
\n
"
,
src_type
);
return
E_NOTIMPL
;
}
break
;
}
case
DBTYPE_DATE
:
{
DATE
*
d
=
dst
;
switch
(
src_type
)
{
case
DBTYPE_EMPTY
:
*
d
=
0
;
hr
=
S_OK
;
break
;
case
DBTYPE_I1
:
hr
=
VarDateFromI1
(
*
(
signed
char
*
)
src
,
d
);
break
;
case
DBTYPE_I2
:
hr
=
VarDateFromI2
(
*
(
signed
short
*
)
src
,
d
);
break
;
case
DBTYPE_I4
:
hr
=
VarDateFromI4
(
*
(
signed
int
*
)
src
,
d
);
break
;
case
DBTYPE_I8
:
hr
=
VarDateFromI8
(
*
(
LONGLONG
*
)
src
,
d
);
break
;
case
DBTYPE_UI1
:
hr
=
VarDateFromUI1
(
*
(
BYTE
*
)
src
,
d
);
break
;
case
DBTYPE_UI2
:
hr
=
VarDateFromUI2
(
*
(
WORD
*
)
src
,
d
);
break
;
case
DBTYPE_UI4
:
hr
=
VarDateFromUI4
(
*
(
DWORD
*
)
src
,
d
);
break
;
case
DBTYPE_UI8
:
hr
=
VarDateFromUI8
(
*
(
ULONGLONG
*
)
src
,
d
);
break
;
case
DBTYPE_R4
:
hr
=
VarDateFromR4
(
*
(
FLOAT
*
)
src
,
d
);
break
;
case
DBTYPE_R8
:
hr
=
VarDateFromR8
(
*
(
DOUBLE
*
)
src
,
d
);
break
;
case
DBTYPE_CY
:
hr
=
VarDateFromCy
(
*
(
CY
*
)
src
,
d
);
break
;
case
DBTYPE_DATE
:
*
d
=
*
(
DATE
*
)
src
;
hr
=
S_OK
;
break
;
case
DBTYPE_BSTR
:
hr
=
VarDateFromStr
(
*
(
WCHAR
**
)
src
,
LOCALE_USER_DEFAULT
,
0
,
d
);
break
;
case
DBTYPE_BOOL
:
hr
=
VarDateFromBool
(
*
(
VARIANT_BOOL
*
)
src
,
d
);
break
;
case
DBTYPE_DECIMAL
:
hr
=
VarDateFromDec
((
DECIMAL
*
)
src
,
d
);
break
;
case
DBTYPE_DBTIMESTAMP
:
{
SYSTEMTIME
st
;
DBTIMESTAMP
*
ts
=
(
DBTIMESTAMP
*
)
src
;
st
.
wYear
=
ts
->
year
;
st
.
wMonth
=
ts
->
month
;
st
.
wDay
=
ts
->
day
;
st
.
wHour
=
ts
->
hour
;
st
.
wMinute
=
ts
->
minute
;
st
.
wSecond
=
ts
->
second
;
st
.
wMilliseconds
=
ts
->
fraction
/
1000000
;
hr
=
(
SystemTimeToVariantTime
(
&
st
,
d
)
?
S_OK
:
E_FAIL
);
break
;
}
default:
FIXME
(
"Unimplemented conversion %04x -> DATE
\n
"
,
src_type
);
return
E_NOTIMPL
;
}
break
;
}
case
DBTYPE_DBTIMESTAMP
:
{
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_DATE
:
{
SYSTEMTIME
st
;
hr
=
(
VariantTimeToSystemTime
(
*
(
double
*
)
src
,
&
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
;
break
;
}
default:
FIXME
(
"Unimplemented conversion %04x -> DBTIMESTAMP
\n
"
,
src_type
);
return
E_NOTIMPL
;
}
break
;
}
case
DBTYPE_CY
:
{
...
...
include/oledb.idl
View file @
afa90e32
...
...
@@ -40,6 +40,15 @@ typedef ULONG DBREFCOUNT;
typedef
ULONG
DB_UPARAMS
;
typedef
LONG
DB_LPARAMS
;
typedef
DWORD
DBHASHVALUE
;
typedef
struct
{
SHORT
year
;
USHORT
month
;
USHORT
day
;
USHORT
hour
;
USHORT
minute
;
USHORT
second
;
ULONG
fraction
;
}
DBTIMESTAMP
;
#
include
"dbs.idl"
...
...
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