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
39166cca
Commit
39166cca
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_UI4;.
parent
deb38f46
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
0 deletions
+85
-0
convert.c
dlls/oledb32/convert.c
+26
-0
convert.c
dlls/oledb32/tests/convert.c
+59
-0
No files found.
dlls/oledb32/convert.c
View file @
39166cca
...
@@ -311,6 +311,32 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
...
@@ -311,6 +311,32 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
break
;
break
;
}
}
case
DBTYPE_UI4
:
{
DWORD
*
d
=
dst
;
switch
(
src_type
)
{
case
DBTYPE_EMPTY
:
*
d
=
0
;
hr
=
S_OK
;
break
;
case
DBTYPE_I2
:
hr
=
VarUI4FromI2
(
*
(
signed
short
*
)
src
,
d
);
break
;
case
DBTYPE_I4
:
hr
=
VarUI4FromI4
(
*
(
signed
int
*
)
src
,
d
);
break
;
case
DBTYPE_R4
:
hr
=
VarUI4FromR4
(
*
(
FLOAT
*
)
src
,
d
);
break
;
case
DBTYPE_R8
:
hr
=
VarUI4FromR8
(
*
(
double
*
)
src
,
d
);
break
;
case
DBTYPE_CY
:
hr
=
VarUI4FromCy
(
*
(
CY
*
)
src
,
d
);
break
;
case
DBTYPE_DATE
:
hr
=
VarUI4FromDate
(
*
(
DATE
*
)
src
,
d
);
break
;
case
DBTYPE_BSTR
:
hr
=
VarUI4FromStr
(
*
(
WCHAR
**
)
src
,
LOCALE_USER_DEFAULT
,
0
,
d
);
break
;
case
DBTYPE_BOOL
:
hr
=
VarUI4FromBool
(
*
(
VARIANT_BOOL
*
)
src
,
d
);
break
;
case
DBTYPE_DECIMAL
:
hr
=
VarUI4FromDec
((
DECIMAL
*
)
src
,
d
);
break
;
case
DBTYPE_I1
:
hr
=
VarUI4FromI1
(
*
(
signed
char
*
)
src
,
d
);
break
;
case
DBTYPE_UI1
:
hr
=
VarUI4FromUI1
(
*
(
BYTE
*
)
src
,
d
);
break
;
case
DBTYPE_UI2
:
hr
=
VarUI4FromUI2
(
*
(
WORD
*
)
src
,
d
);
break
;
case
DBTYPE_UI4
:
*
d
=
*
(
DWORD
*
)
src
;
hr
=
S_OK
;
break
;
case
DBTYPE_I8
:
hr
=
VarUI4FromI8
(
*
(
LONGLONG
*
)
src
,
d
);
break
;
case
DBTYPE_UI8
:
hr
=
VarUI4FromUI8
(
*
(
ULONGLONG
*
)
src
,
d
);
break
;
default:
FIXME
(
"Unimplemented conversion %04x -> UI1
\n
"
,
src_type
);
return
E_NOTIMPL
;
}
break
;
}
case
DBTYPE_FILETIME
:
case
DBTYPE_FILETIME
:
{
{
FILETIME
*
d
=
dst
;
FILETIME
*
d
=
dst
;
...
...
dlls/oledb32/tests/convert.c
View file @
39166cca
...
@@ -1232,6 +1232,64 @@ static void test_converttoui1(void)
...
@@ -1232,6 +1232,64 @@ static void test_converttoui1(void)
IDataConvert_Release
(
convert
);
IDataConvert_Release
(
convert
);
}
}
static
void
test_converttoui4
(
void
)
{
IDataConvert
*
convert
;
HRESULT
hr
;
DWORD
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
=
0x12345678
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_EMPTY
,
DBTYPE_UI4
,
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
=
0x12345678
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_NULL
,
DBTYPE_UI4
,
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
==
0x12345678
,
"got %08x
\n
"
,
dst
);
dst
=
0x12345678
;
*
(
DWORD
*
)
src
=
0x87654321
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_UI4
,
DBTYPE_UI4
,
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
==
0x87654321
,
"got %08x
\n
"
,
dst
);
dst
=
0x12345678
;
*
(
signed
short
*
)
src
=
0x4321
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_I2
,
DBTYPE_UI4
,
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
==
0x4321
,
"got %08x
\n
"
,
dst
);
dst
=
0x12345678
;
*
(
signed
short
*
)
src
=
-
1
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_I2
,
DBTYPE_UI4
,
0
,
&
dst_len
,
src
,
&
dst
,
sizeof
(
dst
),
0
,
&
dst_status
,
0
,
0
,
0
);
ok
(
hr
==
DB_E_ERRORSOCCURRED
,
"got %08x
\n
"
,
hr
);
todo_wine
ok
(
dst_status
==
DBSTATUS_E_SIGNMISMATCH
,
"got %08x
\n
"
,
dst_status
);
ok
(
dst_len
==
sizeof
(
dst
),
"got %d
\n
"
,
dst_len
);
ok
(
dst
==
0x12345678
,
"got %08x
\n
"
,
dst
);
IDataConvert_Release
(
convert
);
}
START_TEST
(
convert
)
START_TEST
(
convert
)
{
{
OleInitialize
(
NULL
);
OleInitialize
(
NULL
);
...
@@ -1244,6 +1302,7 @@ START_TEST(convert)
...
@@ -1244,6 +1302,7 @@ START_TEST(convert)
test_converttobyrefwstr
();
test_converttobyrefwstr
();
test_converttoguid
();
test_converttoguid
();
test_converttoui1
();
test_converttoui1
();
test_converttoui4
();
test_converttofiletime
();
test_converttofiletime
();
OleUninitialize
();
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