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
dd279bd0
Commit
dd279bd0
authored
Oct 31, 2021
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Oct 31, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msdasql: Implement ICommandText GetDBSession.
Signed-off-by:
Alistair Leslie-Hughes
<
leslie_alistair@hotmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3dd785de
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
2 deletions
+34
-2
session.c
dlls/msdasql/session.c
+17
-2
provider.c
dlls/msdasql/tests/provider.c
+17
-0
No files found.
dlls/msdasql/session.c
View file @
dd279bd0
...
...
@@ -285,6 +285,7 @@ struct command
ICommandPrepare
ICommandPrepare_iface
;
LONG
refs
;
WCHAR
*
query
;
IUnknown
*
session
;
};
static
inline
struct
command
*
impl_from_ICommandText
(
ICommandText
*
iface
)
...
...
@@ -393,6 +394,8 @@ static ULONG WINAPI command_Release(ICommandText *iface)
if
(
!
refs
)
{
TRACE
(
"destroying %p
\n
"
,
command
);
if
(
command
->
session
)
IUnknown_Release
(
command
->
session
);
heap_free
(
command
->
query
);
heap_free
(
command
);
}
...
...
@@ -417,8 +420,18 @@ static HRESULT WINAPI command_Execute(ICommandText *iface, IUnknown *outer, REFI
static
HRESULT
WINAPI
command_GetDBSession
(
ICommandText
*
iface
,
REFIID
riid
,
IUnknown
**
session
)
{
struct
command
*
command
=
impl_from_ICommandText
(
iface
);
FIXME
(
"%p, %s, %p
\n
"
,
command
,
debugstr_guid
(
riid
),
session
);
return
E_NOTIMPL
;
TRACE
(
"%p, %s, %p
\n
"
,
command
,
debugstr_guid
(
riid
),
session
);
if
(
!
session
)
return
E_INVALIDARG
;
*
session
=
NULL
;
if
(
!
command
->
session
)
return
S_FALSE
;
return
IUnknown_QueryInterface
(
command
->
session
,
riid
,
(
void
**
)
session
);
}
static
HRESULT
WINAPI
command_GetCommandText
(
ICommandText
*
iface
,
GUID
*
dialect
,
LPOLESTR
*
commandstr
)
...
...
@@ -656,6 +669,8 @@ static HRESULT WINAPI createcommand_CreateCommand(IDBCreateCommand *iface, IUnkn
command
->
ICommandPrepare_iface
.
lpVtbl
=
&
commandprepareVtbl
;
command
->
refs
=
1
;
IUnknown_QueryInterface
(
&
session
->
session_iface
,
&
IID_IUnknown
,
(
void
**
)
&
command
->
session
);
hr
=
ICommandText_QueryInterface
(
&
command
->
ICommandText_iface
,
riid
,
(
void
**
)
out
);
ICommandText_Release
(
&
command
->
ICommandText_iface
);
return
hr
;
...
...
dlls/msdasql/tests/provider.c
View file @
dd279bd0
...
...
@@ -206,6 +206,22 @@ if (0)
ICommandText_Release
(
comand_text
);
}
static
void
test_command_dbsession
(
IUnknown
*
cmd
,
IUnknown
*
session
)
{
ICommandText
*
comand_text
;
HRESULT
hr
;
IUnknown
*
sess
;
hr
=
IUnknown_QueryInterface
(
cmd
,
&
IID_ICommandText
,
(
void
**
)
&
comand_text
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
ICommandText_GetDBSession
(
comand_text
,
&
IID_IUnknown
,
&
sess
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
session
==
sess
,
"different session pointers
\n
"
);
ICommandText_Release
(
comand_text
);
}
static
void
test_sessions
(
void
)
{
IDBProperties
*
props
;
...
...
@@ -281,6 +297,7 @@ static void test_sessions(void)
{
test_command_interfaces
(
cmd
);
test_command_text
(
cmd
);
test_command_dbsession
(
cmd
,
session
);
IUnknown_Release
(
cmd
);
}
...
...
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