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
64a8eb60
Commit
64a8eb60
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 a few simple conversions to DBTYPE_GUID.
parent
0ac408f7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
0 deletions
+58
-0
convert.c
dlls/oledb32/convert.c
+14
-0
convert.c
dlls/oledb32/tests/convert.c
+44
-0
No files found.
dlls/oledb32/convert.c
View file @
64a8eb60
...
...
@@ -130,6 +130,8 @@ static int get_length(DBTYPE type)
return
sizeof
(
BSTR
);
case
DBTYPE_FILETIME
:
return
sizeof
(
FILETIME
);
case
DBTYPE_GUID
:
return
sizeof
(
GUID
);
case
DBTYPE_WSTR
:
case
DBTYPE_BYREF
|
DBTYPE_WSTR
:
return
0
;
...
...
@@ -295,6 +297,18 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
break
;
}
case
DBTYPE_GUID
:
{
GUID
*
d
=
dst
;
switch
(
src_type
)
{
case
DBTYPE_EMPTY
:
*
d
=
GUID_NULL
;
hr
=
S_OK
;
break
;
case
DBTYPE_GUID
:
*
d
=
*
(
GUID
*
)
src
;
hr
=
S_OK
;
break
;
default:
FIXME
(
"Unimplemented conversion %04x -> GUID
\n
"
,
src_type
);
return
E_NOTIMPL
;
}
break
;
}
case
DBTYPE_WSTR
:
{
BSTR
b
;
...
...
dlls/oledb32/tests/convert.c
View file @
64a8eb60
...
...
@@ -35,6 +35,8 @@
#include "wine/test.h"
DEFINE_GUID
(
GUID_NULL
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
);
static
void
test_dcinfo
(
void
)
{
IDCInfo
*
info
;
...
...
@@ -1111,6 +1113,47 @@ static void test_converttobyrefwstr(void)
IDataConvert_Release
(
convert
);
}
static
void
test_converttoguid
(
void
)
{
IDataConvert
*
convert
;
HRESULT
hr
;
GUID
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
=
IID_IDCInfo
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_EMPTY
,
DBTYPE_GUID
,
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
(
GUID
),
"got %d
\n
"
,
dst_len
);
ok
(
IsEqualGUID
(
&
dst
,
&
GUID_NULL
),
"didn't get GUID_NULL
\n
"
);
dst
=
IID_IDCInfo
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_NULL
,
DBTYPE_GUID
,
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
(
GUID
),
"got %d
\n
"
,
dst_len
);
ok
(
IsEqualGUID
(
&
dst
,
&
IID_IDCInfo
),
"dst has changed
\n
"
);
dst
=
IID_IDCInfo
;
memcpy
(
src
,
&
IID_IDataConvert
,
sizeof
(
GUID
));
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_GUID
,
DBTYPE_GUID
,
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
(
GUID
),
"got %d
\n
"
,
dst_len
);
ok
(
IsEqualGUID
(
&
dst
,
&
IID_IDataConvert
),
"didn't get IID_IDataConvert
\n
"
);
IDataConvert_Release
(
convert
);
}
static
void
test_converttofiletime
(
void
)
{
IDataConvert
*
convert
;
...
...
@@ -1150,6 +1193,7 @@ START_TEST(convert)
test_converttobstr
();
test_converttowstr
();
test_converttobyrefwstr
();
test_converttoguid
();
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