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
f339c2fa
Commit
f339c2fa
authored
Aug 22, 2013
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 22, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oledb32: Implement Advise/Unadvise for IRowPositionChange.
parent
2139a402
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
5 deletions
+77
-5
oledb_private.h
dlls/oledb32/oledb_private.h
+10
-0
rowpos.c
dlls/oledb32/rowpos.c
+67
-5
No files found.
dlls/oledb32/oledb_private.h
View file @
f339c2fa
...
...
@@ -27,6 +27,16 @@ static inline void *heap_alloc(size_t len)
return
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
}
static
inline
void
*
heap_alloc_zero
(
size_t
len
)
{
return
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
len
);
}
static
inline
void
*
heap_realloc_zero
(
void
*
mem
,
size_t
len
)
{
return
HeapReAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
mem
,
len
);
}
static
inline
BOOL
heap_free
(
void
*
mem
)
{
return
HeapFree
(
GetProcessHeap
(),
0
,
mem
);
...
...
dlls/oledb32/rowpos.c
View file @
f339c2fa
...
...
@@ -36,6 +36,8 @@ typedef struct
{
IConnectionPoint
IConnectionPoint_iface
;
rowpos
*
container
;
IRowPositionChange
**
sinks
;
DWORD
sinks_size
;
}
rowpos_cp
;
struct
rowpos
...
...
@@ -48,6 +50,8 @@ struct rowpos
rowpos_cp
cp
;
};
static
void
rowposchange_cp_destroy
(
rowpos_cp
*
);
static
inline
rowpos
*
impl_from_IRowPosition
(
IRowPosition
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
rowpos
,
IRowPosition_iface
);
...
...
@@ -108,6 +112,7 @@ static ULONG WINAPI rowpos_Release(IRowPosition* iface)
if
(
ref
==
0
)
{
if
(
This
->
rowset
)
IRowset_Release
(
This
->
rowset
);
rowposchange_cp_destroy
(
&
This
->
cp
);
heap_free
(
This
);
}
...
...
@@ -263,18 +268,62 @@ static HRESULT WINAPI rowpos_cp_GetConnectionPointContainer(IConnectionPoint *if
return
S_OK
;
}
static
HRESULT
WINAPI
rowpos_cp_Advise
(
IConnectionPoint
*
iface
,
IUnknown
*
sink
,
DWORD
*
cookie
)
static
HRESULT
WINAPI
rowpos_cp_Advise
(
IConnectionPoint
*
iface
,
IUnknown
*
unk
sink
,
DWORD
*
cookie
)
{
rowpos_cp
*
This
=
impl_from_IConnectionPoint
(
iface
);
FIXME
(
"(%p)->(%p %p): stub
\n
"
,
This
,
sink
,
cookie
);
return
E_NOTIMPL
;
IRowPositionChange
*
sink
;
HRESULT
hr
;
DWORD
i
;
TRACE
(
"(%p)->(%p %p)
\n
"
,
This
,
unksink
,
cookie
);
hr
=
IUnknown_QueryInterface
(
unksink
,
&
IID_IRowPositionChange
,
(
void
**
)
&
sink
);
if
(
FAILED
(
hr
))
{
FIXME
(
"sink doesn't support IRowPositionChange
\n
"
);
return
CONNECT_E_CANNOTCONNECT
;
}
if
(
This
->
sinks
)
{
for
(
i
=
0
;
i
<
This
->
sinks_size
;
i
++
)
{
if
(
!
This
->
sinks
[
i
])
break
;
}
if
(
i
==
This
->
sinks_size
)
{
This
->
sinks_size
*=
2
;
This
->
sinks
=
heap_realloc_zero
(
This
->
sinks
,
This
->
sinks_size
*
sizeof
(
*
This
->
sinks
));
}
}
else
{
This
->
sinks_size
=
10
;
This
->
sinks
=
heap_alloc_zero
(
This
->
sinks_size
*
sizeof
(
*
This
->
sinks
));
i
=
0
;
}
This
->
sinks
[
i
]
=
sink
;
if
(
cookie
)
*
cookie
=
i
+
1
;
return
S_OK
;
}
static
HRESULT
WINAPI
rowpos_cp_Unadvise
(
IConnectionPoint
*
iface
,
DWORD
cookie
)
{
rowpos_cp
*
This
=
impl_from_IConnectionPoint
(
iface
);
FIXME
(
"(%p)->(%d): stub
\n
"
,
This
,
cookie
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
cookie
);
if
(
!
cookie
||
cookie
>
This
->
sinks_size
||
!
This
->
sinks
[
cookie
-
1
])
return
CONNECT_E_NOCONNECTION
;
IRowPositionChange_Release
(
This
->
sinks
[
cookie
-
1
]);
This
->
sinks
[
cookie
-
1
]
=
NULL
;
return
S_OK
;
}
static
HRESULT
WINAPI
rowpos_cp_EnumConnections
(
IConnectionPoint
*
iface
,
IEnumConnections
**
enum_c
)
...
...
@@ -300,6 +349,19 @@ static void rowposchange_cp_init(rowpos_cp *cp, rowpos *container)
{
cp
->
IConnectionPoint_iface
.
lpVtbl
=
&
rowpos_cp_vtbl
;
cp
->
container
=
container
;
cp
->
sinks
=
NULL
;
cp
->
sinks_size
=
0
;
}
void
rowposchange_cp_destroy
(
rowpos_cp
*
cp
)
{
DWORD
i
;
for
(
i
=
0
;
i
<
cp
->
sinks_size
;
i
++
)
{
if
(
cp
->
sinks
[
i
])
IRowPositionChange_Release
(
cp
->
sinks
[
i
]);
}
heap_free
(
cp
->
sinks
);
}
HRESULT
create_oledb_rowpos
(
IUnknown
*
outer
,
void
**
obj
)
...
...
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