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
33563cf1
Commit
33563cf1
authored
Oct 28, 2021
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Oct 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msdasql: Add IGetDataSource support to session.
Signed-off-by:
Alistair Leslie-Hughes
<
leslie_alistair@hotmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bc52edc1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
0 deletions
+52
-0
session.c
dlls/msdasql/session.c
+47
-0
provider.c
dlls/msdasql/tests/provider.c
+5
-0
No files found.
dlls/msdasql/session.c
View file @
33563cf1
...
...
@@ -37,6 +37,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msdasql);
struct
msdasql_session
{
IUnknown
session_iface
;
IGetDataSource
IGetDataSource_iface
;
LONG
refs
;
};
...
...
@@ -45,6 +46,11 @@ static inline struct msdasql_session *impl_from_IUnknown( IUnknown *iface )
return
CONTAINING_RECORD
(
iface
,
struct
msdasql_session
,
session_iface
);
}
static
inline
struct
msdasql_session
*
impl_from_IGetDataSource
(
IGetDataSource
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
msdasql_session
,
IGetDataSource_iface
);
}
static
HRESULT
WINAPI
session_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
struct
msdasql_session
*
session
=
impl_from_IUnknown
(
iface
);
...
...
@@ -57,6 +63,11 @@ static HRESULT WINAPI session_QueryInterface(IUnknown *iface, REFIID riid, void
TRACE
(
"(%p)->(IID_IUnknown %p)
\n
"
,
iface
,
ppv
);
*
ppv
=
&
session
->
session_iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IGetDataSource
,
riid
))
{
TRACE
(
"(%p)->(IID_IGetDataSource %p)
\n
"
,
iface
,
ppv
);
*
ppv
=
&
session
->
IGetDataSource_iface
;
}
if
(
*
ppv
)
{
...
...
@@ -96,6 +107,41 @@ static const IUnknownVtbl unkfactoryVtbl =
session_Release
,
};
HRESULT
WINAPI
datasource_QueryInterface
(
IGetDataSource
*
iface
,
REFIID
riid
,
void
**
out
)
{
struct
msdasql_session
*
session
=
impl_from_IGetDataSource
(
iface
);
return
IUnknown_QueryInterface
(
&
session
->
session_iface
,
riid
,
out
);
}
ULONG
WINAPI
datasource_AddRef
(
IGetDataSource
*
iface
)
{
struct
msdasql_session
*
session
=
impl_from_IGetDataSource
(
iface
);
return
IUnknown_AddRef
(
&
session
->
session_iface
);
}
ULONG
WINAPI
datasource_Release
(
IGetDataSource
*
iface
)
{
struct
msdasql_session
*
session
=
impl_from_IGetDataSource
(
iface
);
return
IUnknown_Release
(
&
session
->
session_iface
);
}
HRESULT
WINAPI
datasource_GetDataSource
(
IGetDataSource
*
iface
,
REFIID
riid
,
IUnknown
**
datasource
)
{
struct
msdasql_session
*
session
=
impl_from_IGetDataSource
(
iface
);
FIXME
(
"%p, %s, %p stub
\n
"
,
session
,
debugstr_guid
(
riid
),
datasource
);
return
E_NOTIMPL
;
}
static
const
IGetDataSourceVtbl
datasourceVtbl
=
{
datasource_QueryInterface
,
datasource_AddRef
,
datasource_Release
,
datasource_GetDataSource
};
HRESULT
create_db_session
(
REFIID
riid
,
void
**
unk
)
{
struct
msdasql_session
*
session
;
...
...
@@ -106,6 +152,7 @@ HRESULT create_db_session(REFIID riid, void **unk)
return
E_OUTOFMEMORY
;
session
->
session_iface
.
lpVtbl
=
&
unkfactoryVtbl
;
session
->
IGetDataSource_iface
.
lpVtbl
=
&
datasourceVtbl
;
session
->
refs
=
1
;
hr
=
IUnknown_QueryInterface
(
&
session
->
session_iface
,
riid
,
unk
);
...
...
dlls/msdasql/tests/provider.c
View file @
33563cf1
...
...
@@ -159,6 +159,7 @@ static void test_sessions(void)
IUnknown
*
session
=
NULL
;
IOpenRowset
*
openrowset
=
NULL
;
IDBCreateCommand
*
create_command
=
NULL
;
IGetDataSource
*
datasource
=
NULL
;
IUnknown
*
cmd
=
NULL
;
HRESULT
hr
;
BSTR
connect_str
;
...
...
@@ -203,6 +204,10 @@ static void test_sessions(void)
hr
=
IDBCreateSession_CreateSession
(
dbsession
,
NULL
,
&
IID_IUnknown
,
&
session
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IUnknown_QueryInterface
(
session
,
&
IID_IGetDataSource
,
(
void
**
)
&
datasource
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
IGetDataSource_Release
(
datasource
);
hr
=
IUnknown_QueryInterface
(
session
,
&
IID_IOpenRowset
,
(
void
**
)
&
openrowset
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
...
...
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