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
00d2ca25
Commit
00d2ca25
authored
Oct 25, 2021
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Oct 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msdasql: Implement MSDASQL provider.
Signed-off-by:
Alistair Leslie-Hughes
<
leslie_alistair@hotmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a5cee97c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
97 additions
and
8 deletions
+97
-8
msdasql_main.c
dlls/msdasql/msdasql_main.c
+97
-8
No files found.
dlls/msdasql/msdasql_main.c
View file @
00d2ca25
...
...
@@ -64,11 +64,13 @@ static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
return
1
;
}
HRESULT
WINAPI
ClassFactory_CreateInstance
(
IClassFactory
*
iface
,
IUnknown
*
outer
,
REFIID
riid
,
void
**
ppv
)
static
HRESULT
create_msdasql_provider
(
REFIID
riid
,
void
**
ppv
);
HRESULT
WINAPI
msdasql_CreateInstance
(
IClassFactory
*
iface
,
IUnknown
*
outer
,
REFIID
riid
,
void
**
ppv
)
{
FIXM
E
(
"(%p %s %p)
\n
"
,
outer
,
debugstr_guid
(
riid
),
ppv
);
TRAC
E
(
"(%p %s %p)
\n
"
,
outer
,
debugstr_guid
(
riid
),
ppv
);
return
CLASS_E_CLASSNOTAVAILABLE
;
return
create_msdasql_provider
(
riid
,
ppv
)
;
}
static
HRESULT
WINAPI
ClassFactory_LockServer
(
IClassFactory
*
iface
,
BOOL
fLock
)
...
...
@@ -77,18 +79,105 @@ static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL fLock)
return
S_OK
;
}
static
const
IClassFactoryVtbl
cf
factory
Vtbl
=
{
static
const
IClassFactoryVtbl
cf
msdasql
Vtbl
=
{
ClassFactory_QueryInterface
,
ClassFactory_AddRef
,
ClassFactory_Release
,
ClassFactory
_CreateInstance
,
msdasql
_CreateInstance
,
ClassFactory_LockServer
};
static
IClassFactory
cf
factory
=
{
&
cffactory
Vtbl
};
static
IClassFactory
cf
msdasql
=
{
&
cfmsdasql
Vtbl
};
HRESULT
WINAPI
DllGetClassObject
(
REFCLSID
rclsid
,
REFIID
riid
,
void
**
ppv
)
{
FIXME
(
"%s %s %p
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
riid
),
ppv
);
return
IClassFactory_QueryInterface
(
&
cffactory
,
riid
,
ppv
);
TRACE
(
"%s %s %p
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
riid
),
ppv
);
if
(
IsEqualGUID
(
&
CLSID_MSDASQL
,
rclsid
))
return
IClassFactory_QueryInterface
(
&
cfmsdasql
,
riid
,
ppv
);
return
CLASS_E_CLASSNOTAVAILABLE
;
}
struct
msdasql
{
IUnknown
MSDASQL_iface
;
LONG
ref
;
};
static
inline
struct
msdasql
*
impl_from_IUnknown
(
IUnknown
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
msdasql
,
MSDASQL_iface
);
}
static
HRESULT
WINAPI
msdsql_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
out
)
{
struct
msdasql
*
provider
=
impl_from_IUnknown
(
iface
);
TRACE
(
"(%p)->(%s %p)
\n
"
,
provider
,
debugstr_guid
(
riid
),
out
);
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
CLSID_MSDASQL
))
{
*
out
=
&
provider
->
MSDASQL_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
msdsql_AddRef
(
IUnknown
*
iface
)
{
struct
msdasql
*
provider
=
impl_from_IUnknown
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
provider
->
ref
);
TRACE
(
"(%p) ref=%u
\n
"
,
provider
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
msdsql_Release
(
IUnknown
*
iface
)
{
struct
msdasql
*
provider
=
impl_from_IUnknown
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
provider
->
ref
);
TRACE
(
"(%p) ref=%u
\n
"
,
provider
,
ref
);
if
(
!
ref
)
{
free
(
provider
);
}
return
ref
;
}
static
const
IUnknownVtbl
msdsql_vtbl
=
{
msdsql_QueryInterface
,
msdsql_AddRef
,
msdsql_Release
};
static
HRESULT
create_msdasql_provider
(
REFIID
riid
,
void
**
ppv
)
{
struct
msdasql
*
provider
;
HRESULT
hr
;
provider
=
malloc
(
sizeof
(
struct
msdasql
));
if
(
!
provider
)
return
E_OUTOFMEMORY
;
provider
->
MSDASQL_iface
.
lpVtbl
=
&
msdsql_vtbl
;
provider
->
ref
=
1
;
hr
=
IUnknown_QueryInterface
(
&
provider
->
MSDASQL_iface
,
riid
,
ppv
);
IUnknown_Release
(
&
provider
->
MSDASQL_iface
);
return
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