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
d911374b
Commit
d911374b
authored
Jun 28, 2011
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Jul 07, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oledb32: Add DBTYPE_UI2 support to DataConvert.
parent
9f333b71
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
0 deletions
+68
-0
convert.c
dlls/oledb32/convert.c
+25
-0
convert.c
dlls/oledb32/tests/convert.c
+43
-0
No files found.
dlls/oledb32/convert.c
View file @
d911374b
...
...
@@ -533,6 +533,31 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
}
break
;
}
case
DBTYPE_UI2
:
{
WORD
*
d
=
dst
;
switch
(
src_type
)
{
case
DBTYPE_EMPTY
:
*
d
=
0
;
hr
=
S_OK
;
break
;
case
DBTYPE_I2
:
hr
=
VarUI2FromI2
(
*
(
signed
short
*
)
src
,
d
);
break
;
case
DBTYPE_I4
:
hr
=
VarUI2FromI4
(
*
(
signed
int
*
)
src
,
d
);
break
;
case
DBTYPE_R4
:
hr
=
VarUI2FromR4
(
*
(
FLOAT
*
)
src
,
d
);
break
;
case
DBTYPE_R8
:
hr
=
VarUI2FromR8
(
*
(
double
*
)
src
,
d
);
break
;
case
DBTYPE_CY
:
hr
=
VarUI2FromCy
(
*
(
CY
*
)
src
,
d
);
break
;
case
DBTYPE_DATE
:
hr
=
VarUI2FromDate
(
*
(
DATE
*
)
src
,
d
);
break
;
case
DBTYPE_BSTR
:
hr
=
VarUI2FromStr
(
*
(
WCHAR
**
)
src
,
LOCALE_USER_DEFAULT
,
0
,
d
);
break
;
case
DBTYPE_BOOL
:
hr
=
VarUI2FromBool
(
*
(
VARIANT_BOOL
*
)
src
,
d
);
break
;
case
DBTYPE_DECIMAL
:
hr
=
VarUI2FromDec
((
DECIMAL
*
)
src
,
d
);
break
;
case
DBTYPE_I1
:
hr
=
VarUI2FromI1
(
*
(
signed
char
*
)
src
,
d
);
break
;
case
DBTYPE_UI1
:
hr
=
VarUI2FromUI1
(
*
(
BYTE
*
)
src
,
d
);
break
;
case
DBTYPE_UI2
:
*
d
=
*
(
WORD
*
)
src
;
hr
=
S_OK
;
break
;
case
DBTYPE_UI4
:
hr
=
VarUI2FromUI4
(
*
(
DWORD
*
)
src
,
d
);
break
;
case
DBTYPE_I8
:
hr
=
VarUI2FromI8
(
*
(
LONGLONG
*
)
src
,
d
);
break
;
case
DBTYPE_UI8
:
hr
=
VarUI2FromUI8
(
*
(
ULONGLONG
*
)
src
,
d
);
break
;
default:
FIXME
(
"Unimplemented conversion %04x -> UI2
\n
"
,
src_type
);
return
E_NOTIMPL
;
}
break
;
}
case
DBTYPE_UI4
:
{
...
...
dlls/oledb32/tests/convert.c
View file @
d911374b
...
...
@@ -610,6 +610,49 @@ todo_wine
ok
(
dst_len
==
sizeof
(
dst
),
"got %ld
\n
"
,
dst_len
);
ok
(
dst
==
10
,
"got %08x
\n
"
,
dst
);
/* */
dst_len
=
dst
=
0x1234
;
*
(
WORD
*
)
src
=
0x4321
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_UI2
,
DBTYPE_UI2
,
0
,
&
dst_len
,
src
,
&
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
(
dst
==
0x4321
,
"got %08x
\n
"
,
dst
);
dst_len
=
dst
=
0x1234
;
*
(
DWORD
*
)
src
=
0xabcd1234
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_UI4
,
DBTYPE_UI2
,
0
,
&
dst_len
,
src
,
&
dst
,
sizeof
(
dst
),
0
,
&
dst_status
,
0
,
0
,
0
);
todo_wine
ok
(
hr
==
DB_E_DATAOVERFLOW
,
"got %08x
\n
"
,
hr
);
ok
(
dst_status
==
DBSTATUS_E_DATAOVERFLOW
,
"got %08x
\n
"
,
dst_status
);
ok
(
dst_len
==
sizeof
(
dst
),
"got %ld
\n
"
,
dst_len
);
ok
(
dst
==
0x1234
,
"got %08x
\n
"
,
dst
);
dst_len
=
dst
=
0x1234
;
*
(
DWORD
*
)
src
=
0x1234abcd
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_UI4
,
DBTYPE_UI2
,
0
,
&
dst_len
,
src
,
&
dst
,
sizeof
(
dst
),
0
,
&
dst_status
,
0
,
0
,
0
);
todo_wine
ok
(
hr
==
DB_E_DATAOVERFLOW
,
"got %08x
\n
"
,
hr
);
ok
(
dst_status
==
DBSTATUS_E_DATAOVERFLOW
,
"got %08x
\n
"
,
dst_status
);
ok
(
dst_len
==
sizeof
(
dst
),
"got %ld
\n
"
,
dst_len
);
ok
(
dst
==
0x1234
,
"got %08x
\n
"
,
dst
);
dst_len
=
dst
=
0x1234
;
*
(
DWORD
*
)
src
=
0x4321
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_UI4
,
DBTYPE_UI2
,
0
,
&
dst_len
,
src
,
&
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
(
dst
==
0x4321
,
"got %08x
\n
"
,
dst
);
dst_len
=
dst
=
0x1234
;
memcpy
(
src
,
ten
,
sizeof
(
ten
));
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_WSTR
,
DBTYPE_UI2
,
0
,
&
dst_len
,
src
,
&
dst
,
sizeof
(
dst
),
0
,
&
dst_status
,
0
,
0
,
DBDATACONVERT_LENGTHFROMNTS
);
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
(
dst
==
10
,
"got %08x
\n
"
,
dst
);
IDataConvert_Release
(
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