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
23d264d3
Commit
23d264d3
authored
Nov 03, 2021
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Nov 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msdasql: Support CLSID_MSDASQL_ENUMERATOR interface.
Signed-off-by:
Alistair Leslie-Hughes
<
leslie_alistair@hotmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a855591f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
113 additions
and
1 deletion
+113
-1
msdasql_main.c
dlls/msdasql/msdasql_main.c
+112
-0
database.c
dlls/oledb32/tests/database.c
+1
-1
No files found.
dlls/msdasql/msdasql_main.c
View file @
23d264d3
...
@@ -72,6 +72,7 @@ static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
...
@@ -72,6 +72,7 @@ static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
}
}
static
HRESULT
create_msdasql_provider
(
REFIID
riid
,
void
**
ppv
);
static
HRESULT
create_msdasql_provider
(
REFIID
riid
,
void
**
ppv
);
static
HRESULT
create_msdasql_enumerator
(
REFIID
riid
,
void
**
ppv
);
HRESULT
WINAPI
msdasql_CreateInstance
(
IClassFactory
*
iface
,
IUnknown
*
outer
,
REFIID
riid
,
void
**
ppv
)
HRESULT
WINAPI
msdasql_CreateInstance
(
IClassFactory
*
iface
,
IUnknown
*
outer
,
REFIID
riid
,
void
**
ppv
)
{
{
...
@@ -94,7 +95,24 @@ static const IClassFactoryVtbl cfmsdasqlVtbl = {
...
@@ -94,7 +95,24 @@ static const IClassFactoryVtbl cfmsdasqlVtbl = {
ClassFactory_LockServer
ClassFactory_LockServer
};
};
HRESULT
WINAPI
enumerationcf_CreateInstance
(
IClassFactory
*
iface
,
IUnknown
*
outer
,
REFIID
riid
,
void
**
ppv
)
{
TRACE
(
"(%p %s %p)
\n
"
,
outer
,
debugstr_guid
(
riid
),
ppv
);
return
create_msdasql_enumerator
(
riid
,
ppv
);
}
static
const
IClassFactoryVtbl
enumfactoryVtbl
=
{
ClassFactory_QueryInterface
,
ClassFactory_AddRef
,
ClassFactory_Release
,
enumerationcf_CreateInstance
,
ClassFactory_LockServer
};
static
IClassFactory
cfmsdasql
=
{
&
cfmsdasqlVtbl
};
static
IClassFactory
cfmsdasql
=
{
&
cfmsdasqlVtbl
};
static
IClassFactory
enumfactory
=
{
&
enumfactoryVtbl
};
HRESULT
WINAPI
DllGetClassObject
(
REFCLSID
rclsid
,
REFIID
riid
,
void
**
ppv
)
HRESULT
WINAPI
DllGetClassObject
(
REFCLSID
rclsid
,
REFIID
riid
,
void
**
ppv
)
{
{
...
@@ -102,6 +120,8 @@ HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID riid, void **ppv )
...
@@ -102,6 +120,8 @@ HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID riid, void **ppv )
if
(
IsEqualGUID
(
&
CLSID_MSDASQL
,
rclsid
))
if
(
IsEqualGUID
(
&
CLSID_MSDASQL
,
rclsid
))
return
IClassFactory_QueryInterface
(
&
cfmsdasql
,
riid
,
ppv
);
return
IClassFactory_QueryInterface
(
&
cfmsdasql
,
riid
,
ppv
);
else
if
(
IsEqualGUID
(
&
CLSID_MSDASQL_ENUMERATOR
,
rclsid
))
return
IClassFactory_QueryInterface
(
&
enumfactory
,
riid
,
ppv
);
return
CLASS_E_CLASSNOTAVAILABLE
;
return
CLASS_E_CLASSNOTAVAILABLE
;
}
}
...
@@ -526,3 +546,95 @@ static HRESULT create_msdasql_provider(REFIID riid, void **ppv)
...
@@ -526,3 +546,95 @@ static HRESULT create_msdasql_provider(REFIID riid, void **ppv)
IUnknown_Release
(
&
provider
->
MSDASQL_iface
);
IUnknown_Release
(
&
provider
->
MSDASQL_iface
);
return
hr
;
return
hr
;
}
}
struct
msdasql_enum
{
ISourcesRowset
ISourcesRowset_iface
;
LONG
ref
;
};
static
inline
struct
msdasql_enum
*
msdasql_enum_from_ISourcesRowset
(
ISourcesRowset
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
msdasql_enum
,
ISourcesRowset_iface
);
}
static
HRESULT
WINAPI
msdasql_enum_QueryInterface
(
ISourcesRowset
*
iface
,
REFIID
riid
,
void
**
out
)
{
struct
msdasql_enum
*
enumerator
=
msdasql_enum_from_ISourcesRowset
(
iface
);
TRACE
(
"(%p)->(%s %p)
\n
"
,
enumerator
,
debugstr_guid
(
riid
),
out
);
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_ISourcesRowset
)
)
{
*
out
=
&
enumerator
->
ISourcesRowset_iface
;
}
else
{
FIXME
(
"(%s, %p)
\n
"
,
debugstr_guid
(
riid
),
out
);
*
out
=
NULL
;
return
E_NOINTERFACE
;
}
IUnknown_AddRef
((
IUnknown
*
)
*
out
);
return
S_OK
;
}
static
ULONG
WINAPI
msdasql_enum_AddRef
(
ISourcesRowset
*
iface
)
{
struct
msdasql_enum
*
enumerator
=
msdasql_enum_from_ISourcesRowset
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
enumerator
->
ref
);
TRACE
(
"(%p) ref=%u
\n
"
,
enumerator
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
msdasql_enum_Release
(
ISourcesRowset
*
iface
)
{
struct
msdasql_enum
*
enumerator
=
msdasql_enum_from_ISourcesRowset
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
enumerator
->
ref
);
TRACE
(
"(%p) ref=%u
\n
"
,
enumerator
,
ref
);
if
(
!
ref
)
{
free
(
enumerator
);
}
return
ref
;
}
static
HRESULT
WINAPI
msdasql_enum_GetSourcesRowset
(
ISourcesRowset
*
iface
,
IUnknown
*
outer
,
REFIID
riid
,
ULONG
sets
,
DBPROPSET
properties
[],
IUnknown
**
rowset
)
{
struct
msdasql_enum
*
enumerator
=
msdasql_enum_from_ISourcesRowset
(
iface
);
FIXME
(
"(%p) %p, %s, %d, %p, %p
\n
"
,
enumerator
,
outer
,
debugstr_guid
(
riid
),
sets
,
properties
,
rowset
);
return
E_NOTIMPL
;
}
static
const
ISourcesRowsetVtbl
msdsqlenum_vtbl
=
{
msdasql_enum_QueryInterface
,
msdasql_enum_AddRef
,
msdasql_enum_Release
,
msdasql_enum_GetSourcesRowset
};
static
HRESULT
create_msdasql_enumerator
(
REFIID
riid
,
void
**
ppv
)
{
struct
msdasql_enum
*
enumerator
;
HRESULT
hr
;
enumerator
=
malloc
(
sizeof
(
*
enumerator
));
if
(
!
enumerator
)
return
E_OUTOFMEMORY
;
enumerator
->
ISourcesRowset_iface
.
lpVtbl
=
&
msdsqlenum_vtbl
;
enumerator
->
ref
=
1
;
hr
=
IUnknown_QueryInterface
(
&
enumerator
->
ISourcesRowset_iface
,
riid
,
ppv
);
IUnknown_Release
(
&
enumerator
->
ISourcesRowset_iface
);
return
hr
;
}
dlls/oledb32/tests/database.c
View file @
23d264d3
...
@@ -1066,7 +1066,7 @@ static void test_odbc_enumerator(void)
...
@@ -1066,7 +1066,7 @@ static void test_odbc_enumerator(void)
IRowset
*
rowset
;
IRowset
*
rowset
;
hr
=
CoCreateInstance
(
&
CLSID_MSDASQL_ENUMERATOR
,
NULL
,
CLSCTX_ALL
,
&
IID_ISourcesRowset
,
(
void
**
)
&
source
);
hr
=
CoCreateInstance
(
&
CLSID_MSDASQL_ENUMERATOR
,
NULL
,
CLSCTX_ALL
,
&
IID_ISourcesRowset
,
(
void
**
)
&
source
);
todo_wine
ok
(
hr
==
S_OK
,
"Failed to create object 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to create object 0x%08x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
{
{
return
;
return
;
...
...
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