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
8f8212b8
Commit
8f8212b8
authored
Sep 25, 2012
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Oct 03, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oledb32: Add support for IDBInitialize interface in IDataInitialize.
parent
be246e31
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
184 additions
and
3 deletions
+184
-3
datainit.c
dlls/oledb32/datainit.c
+109
-0
Makefile.in
dlls/oledb32/tests/Makefile.in
+2
-1
convert.c
dlls/oledb32/tests/convert.c
+0
-1
database.c
dlls/oledb32/tests/database.c
+73
-0
marshal.c
dlls/oledb32/tests/marshal.c
+0
-1
No files found.
dlls/oledb32/datainit.c
View file @
8f8212b8
...
...
@@ -47,6 +47,110 @@ static inline datainit *impl_from_IDataInitialize(IDataInitialize *iface)
return
CONTAINING_RECORD
(
iface
,
datainit
,
IDataInitialize_iface
);
}
typedef
struct
{
IDBInitialize
IDBInitialize_iface
;
LONG
ref
;
}
dbinit
;
static
inline
dbinit
*
impl_from_IDBInitialize
(
IDBInitialize
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
dbinit
,
IDBInitialize_iface
);
}
static
HRESULT
WINAPI
dbinit_QueryInterface
(
IDBInitialize
*
iface
,
REFIID
riid
,
void
**
obj
)
{
dbinit
*
This
=
impl_from_IDBInitialize
(
iface
);
TRACE
(
"(%p)->(%s, %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
obj
);
*
obj
=
NULL
;
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
IsEqualIID
(
riid
,
&
IID_IDBInitialize
))
{
*
obj
=
iface
;
}
else
{
FIXME
(
"interface %s not implemented
\n
"
,
debugstr_guid
(
riid
));
return
E_NOINTERFACE
;
}
IDBInitialize_AddRef
(
iface
);
return
S_OK
;
}
static
ULONG
WINAPI
dbinit_AddRef
(
IDBInitialize
*
iface
)
{
dbinit
*
This
=
impl_from_IDBInitialize
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
dbinit_Release
(
IDBInitialize
*
iface
)
{
dbinit
*
This
=
impl_from_IDBInitialize
(
iface
);
LONG
ref
;
TRACE
(
"(%p)
\n
"
,
This
);
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
ref
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
ref
;
}
static
HRESULT
WINAPI
dbinit_Initialize
(
IDBInitialize
*
iface
)
{
dbinit
*
This
=
impl_from_IDBInitialize
(
iface
);
FIXME
(
"(%p) stub
\n
"
,
This
);
return
S_OK
;
}
static
HRESULT
WINAPI
dbinit_Uninitialize
(
IDBInitialize
*
iface
)
{
dbinit
*
This
=
impl_from_IDBInitialize
(
iface
);
FIXME
(
"(%p) stub
\n
"
,
This
);
return
S_OK
;
}
static
const
IDBInitializeVtbl
dbinit_vtbl
=
{
dbinit_QueryInterface
,
dbinit_AddRef
,
dbinit_Release
,
dbinit_Initialize
,
dbinit_Uninitialize
};
static
HRESULT
create_db_init
(
void
**
obj
)
{
dbinit
*
This
;
TRACE
(
"()
\n
"
);
*
obj
=
NULL
;
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
This
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
This
->
IDBInitialize_iface
.
lpVtbl
=
&
dbinit_vtbl
;
This
->
ref
=
1
;
*
obj
=
&
This
->
IDBInitialize_iface
;
return
S_OK
;
}
static
HRESULT
WINAPI
datainit_QueryInterface
(
IDataInitialize
*
iface
,
REFIID
riid
,
void
**
obj
)
{
datainit
*
This
=
impl_from_IDataInitialize
(
iface
);
...
...
@@ -102,6 +206,11 @@ static HRESULT WINAPI datainit_GetDataSource(IDataInitialize *iface, IUnknown *p
FIXME
(
"(%p)->(%p %d %s %s %p)
\n
"
,
This
,
pUnkOuter
,
dwClsCtx
,
debugstr_w
(
pwszInitializationString
),
debugstr_guid
(
riid
),
ppDataSource
);
if
(
IsEqualIID
(
riid
,
&
IID_IDBInitialize
))
{
return
create_db_init
(
(
LPVOID
*
)
ppDataSource
);
}
return
E_NOTIMPL
;
}
...
...
dlls/oledb32/tests/Makefile.in
View file @
8f8212b8
TESTDLL
=
oledb32.dll
IMPORTS
=
oleaut32 ole32 user32 gdi32 advapi32
IMPORTS
=
uuid
oleaut32 ole32 user32 gdi32 advapi32
C_SRCS
=
\
convert.c
\
database.c
\
marshal.c
IDL_I_SRCS
=
convert.idl
...
...
dlls/oledb32/tests/convert.c
View file @
8f8212b8
...
...
@@ -35,7 +35,6 @@
#include "wine/test.h"
DEFINE_GUID
(
GUID_NULL
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
);
static
void
test_dcinfo
(
void
)
{
...
...
dlls/oledb32/tests/database.c
0 → 100644
View file @
8f8212b8
/* OLEDB Database tests
*
* Copyright 2012 Alistair Leslie-Hughes
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#define COBJMACROS
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "windef.h"
#include "winbase.h"
#include "ole2.h"
#include "msdadc.h"
#include "msdasc.h"
#include "wine/test.h"
void
test_database
(
void
)
{
HRESULT
hr
;
IDBInitialize
*
dbinit
=
NULL
;
IDataInitialize
*
datainit
=
NULL
;
hr
=
CoCreateInstance
(
&
CLSID_MSDAINITIALIZE
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDataInitialize
,(
void
**
)
&
datainit
);
if
(
FAILED
(
hr
))
{
win_skip
(
"Unable to load oledb library
\n
"
);
return
;
}
hr
=
IDataInitialize_GetDataSource
(
datainit
,
NULL
,
CLSCTX_INPROC_SERVER
,
NULL
,
&
IID_IDBInitialize
,
(
IUnknown
**
)
&
dbinit
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
IDBProperties
*
props
=
NULL
;
hr
=
IDBInitialize_QueryInterface
(
dbinit
,
&
IID_IDBProperties
,
(
void
**
)
&
props
);
todo_wine
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
IDBProperties_Release
(
props
);
}
IDBInitialize_Release
(
dbinit
);
}
IDataInitialize_Release
(
datainit
);
}
START_TEST
(
database
)
{
OleInitialize
(
NULL
);
test_database
();
OleUninitialize
();
}
dlls/oledb32/tests/marshal.c
View file @
8f8212b8
...
...
@@ -27,7 +27,6 @@
#include "windef.h"
#include "winbase.h"
#include "initguid.h"
#include "objbase.h"
#include "oledb.h"
...
...
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