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
deb38f46
Commit
deb38f46
authored
Oct 28, 2009
by
Huw Davies
Committed by
Alexandre Julliard
Oct 28, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oledb32: Add some conversions to DBTYPE_UI1.
parent
64a8eb60
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
0 deletions
+76
-0
convert.c
dlls/oledb32/convert.c
+26
-0
convert.c
dlls/oledb32/tests/convert.c
+50
-0
No files found.
dlls/oledb32/convert.c
View file @
deb38f46
...
...
@@ -285,6 +285,32 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
break
;
}
case
DBTYPE_UI1
:
{
BYTE
*
d
=
dst
;
switch
(
src_type
)
{
case
DBTYPE_EMPTY
:
*
d
=
0
;
hr
=
S_OK
;
break
;
case
DBTYPE_I2
:
hr
=
VarUI1FromI2
(
*
(
signed
short
*
)
src
,
d
);
break
;
case
DBTYPE_I4
:
hr
=
VarUI1FromI4
(
*
(
signed
int
*
)
src
,
d
);
break
;
case
DBTYPE_R4
:
hr
=
VarUI1FromR4
(
*
(
FLOAT
*
)
src
,
d
);
break
;
case
DBTYPE_R8
:
hr
=
VarUI1FromR8
(
*
(
double
*
)
src
,
d
);
break
;
case
DBTYPE_CY
:
hr
=
VarUI1FromCy
(
*
(
CY
*
)
src
,
d
);
break
;
case
DBTYPE_DATE
:
hr
=
VarUI1FromDate
(
*
(
DATE
*
)
src
,
d
);
break
;
case
DBTYPE_BSTR
:
hr
=
VarUI1FromStr
(
*
(
WCHAR
**
)
src
,
LOCALE_USER_DEFAULT
,
0
,
d
);
break
;
case
DBTYPE_BOOL
:
hr
=
VarUI1FromBool
(
*
(
VARIANT_BOOL
*
)
src
,
d
);
break
;
case
DBTYPE_DECIMAL
:
hr
=
VarUI1FromDec
((
DECIMAL
*
)
src
,
d
);
break
;
case
DBTYPE_I1
:
hr
=
VarUI1FromI1
(
*
(
signed
char
*
)
src
,
d
);
break
;
case
DBTYPE_UI1
:
*
d
=
*
(
BYTE
*
)
src
;
hr
=
S_OK
;
break
;
case
DBTYPE_UI2
:
hr
=
VarUI1FromUI2
(
*
(
WORD
*
)
src
,
d
);
break
;
case
DBTYPE_UI4
:
hr
=
VarUI1FromUI4
(
*
(
DWORD
*
)
src
,
d
);
break
;
case
DBTYPE_I8
:
hr
=
VarUI1FromI8
(
*
(
LONGLONG
*
)
src
,
d
);
break
;
case
DBTYPE_UI8
:
hr
=
VarUI1FromUI8
(
*
(
ULONGLONG
*
)
src
,
d
);
break
;
default:
FIXME
(
"Unimplemented conversion %04x -> UI1
\n
"
,
src_type
);
return
E_NOTIMPL
;
}
break
;
}
case
DBTYPE_FILETIME
:
{
FILETIME
*
d
=
dst
;
...
...
dlls/oledb32/tests/convert.c
View file @
deb38f46
...
...
@@ -1183,6 +1183,55 @@ static void test_converttofiletime(void)
IDataConvert_Release
(
convert
);
}
static
void
test_converttoui1
(
void
)
{
IDataConvert
*
convert
;
HRESULT
hr
;
BYTE
dst
;
BYTE
src
[
20
];
DBSTATUS
dst_status
;
DBLENGTH
dst_len
;
hr
=
CoCreateInstance
(
&
CLSID_OLEDB_CONVERSIONLIBRARY
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDataConvert
,
(
void
**
)
&
convert
);
if
(
FAILED
(
hr
))
{
win_skip
(
"Unable to load oledb conversion library
\n
"
);
return
;
}
dst
=
0x12
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_EMPTY
,
DBTYPE_UI1
,
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 %d
\n
"
,
dst_len
);
ok
(
dst
==
0
,
"got %08x
\n
"
,
dst
);
dst
=
0x12
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_NULL
,
DBTYPE_UI1
,
0
,
&
dst_len
,
src
,
&
dst
,
sizeof
(
dst
),
0
,
&
dst_status
,
0
,
0
,
0
);
ok
(
hr
==
DB_E_UNSUPPORTEDCONVERSION
,
"got %08x
\n
"
,
hr
);
ok
(
dst_status
==
DBSTATUS_E_BADACCESSOR
,
"got %08x
\n
"
,
dst_status
);
ok
(
dst_len
==
sizeof
(
dst
),
"got %d
\n
"
,
dst_len
);
ok
(
dst
==
0x12
,
"got %08x
\n
"
,
dst
);
dst
=
0x12
;
src
[
0
]
=
0x43
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_UI1
,
DBTYPE_UI1
,
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 %d
\n
"
,
dst_len
);
ok
(
dst
==
0x43
,
"got %08x
\n
"
,
dst
);
dst
=
0x12
;
src
[
0
]
=
0xfe
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_UI1
,
DBTYPE_UI1
,
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 %d
\n
"
,
dst_len
);
ok
(
dst
==
0xfe
,
"got %08x
\n
"
,
dst
);
IDataConvert_Release
(
convert
);
}
START_TEST
(
convert
)
{
OleInitialize
(
NULL
);
...
...
@@ -1194,6 +1243,7 @@ START_TEST(convert)
test_converttowstr
();
test_converttobyrefwstr
();
test_converttoguid
();
test_converttoui1
();
test_converttofiletime
();
OleUninitialize
();
}
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