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
6a8ac17c
Commit
6a8ac17c
authored
Jul 22, 2003
by
Mike Hearn
Committed by
Alexandre Julliard
Jul 22, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- GIT should not dereference ppv when unmarshalling interface.
- Correctly eliminate refcounting in the GIT. - Add warning when given riid does not match.
parent
cb7db104
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
git.c
dlls/ole32/git.c
+14
-10
No files found.
dlls/ole32/git.c
View file @
6a8ac17c
...
...
@@ -55,7 +55,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole);
typedef
struct
StdGITEntry
{
DWORD
cookie
;
IID
iid
;
/* IID of the interface */
IID
iid
;
/* IID of the interface */
IStream
*
stream
;
/* Holds the marshalled interface */
struct
StdGITEntry
*
next
;
...
...
@@ -107,13 +107,11 @@ static ICOM_VTABLE(IGlobalInterfaceTable) StdGlobalInterfaceTableImpl_Vtbl =
void
*
StdGlobalInterfaceTable_Construct
()
{
StdGlobalInterfaceTableImpl
*
newGIT
;
TRACE
(
"constructing
\n
"
);
newGIT
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
StdGlobalInterfaceTableImpl
));
if
(
newGIT
==
0
)
return
newGIT
;
newGIT
->
lpVtbl
=
&
StdGlobalInterfaceTableImpl_Vtbl
;
newGIT
->
ref
=
0
;
/* Initialise the reference count */
newGIT
->
ref
=
1
;
/* Initialise the reference count */
newGIT
->
firstEntry
=
NULL
;
/* we start with an empty table */
newGIT
->
lastEntry
=
NULL
;
newGIT
->
nextCookie
=
0xf100
;
/* that's where windows starts, so that's where we start */
...
...
@@ -128,6 +126,7 @@ void StdGlobalInterfaceTable_Destroy(void* self) {
FIXME
(
"Revoke held interfaces here
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
self
);
StdGlobalInterfaceTableInstance
=
NULL
;
}
/***
...
...
@@ -169,21 +168,21 @@ HRESULT WINAPI StdGlobalInterfaceTable_QueryInterface(IGlobalInterfaceTable* ifa
}
else
return
E_NOINTERFACE
;
/* Now inc the refcount */
/* we don't use refcounts for now: StdGlobalInterfaceTable_AddRef(iface); */
StdGlobalInterfaceTable_AddRef
(
iface
);
return
S_OK
;
}
ULONG
WINAPI
StdGlobalInterfaceTable_AddRef
(
IGlobalInterfaceTable
*
iface
)
{
StdGlobalInterfaceTableImpl
*
const
self
=
(
StdGlobalInterfaceTableImpl
*
)
iface
;
self
->
ref
++
;
/* self->ref++; */
return
self
->
ref
;
}
ULONG
WINAPI
StdGlobalInterfaceTable_Release
(
IGlobalInterfaceTable
*
iface
)
{
StdGlobalInterfaceTableImpl
*
const
self
=
(
StdGlobalInterfaceTableImpl
*
)
iface
;
self
->
ref
--
;
/* self->ref--; */
if
(
self
->
ref
==
0
)
{
/* Hey ho, it's time to go, so long again 'till next weeks show! */
StdGlobalInterfaceTable_Destroy
(
self
);
...
...
@@ -208,6 +207,7 @@ HRESULT WINAPI StdGlobalInterfaceTable_RegisterInterfaceInGlobal(IGlobalInterfac
if
(
pUnk
==
NULL
)
return
E_INVALIDARG
;
/* marshal the interface */
TRACE
(
"About to marshal the interface
\n
"
);
hres
=
CoMarshalInterThreadInterfaceInStream
(
riid
,
pUnk
,
&
stream
);
if
(
hres
)
return
hres
;
entry
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
StdGITEntry
));
...
...
@@ -260,10 +260,14 @@ HRESULT WINAPI StdGlobalInterfaceTable_GetInterfaceFromGlobal(IGlobalInterfaceTa
entry
=
StdGlobalInterfaceTable_FindEntry
(
iface
,
dwCookie
);
if
(
entry
==
NULL
)
return
E_INVALIDARG
;
if
(
!
IsEqualIID
(
&
entry
->
iid
,
&
riid
))
return
E_INVALIDARG
;
if
(
!
IsEqualIID
(
&
entry
->
iid
,
riid
))
{
WARN
(
"entry->iid (%s) != riid
\n
"
,
debugstr_guid
(
&
entry
->
iid
));
return
E_INVALIDARG
;
}
TRACE
(
"entry=%p
\n
"
,
entry
);
/* unmarshal the interface */
hres
=
CoGetInterfaceAndReleaseStream
(
entry
->
stream
,
riid
,
*
ppv
);
hres
=
CoGetInterfaceAndReleaseStream
(
entry
->
stream
,
riid
,
ppv
);
if
(
hres
)
return
hres
;
return
S_OK
;
...
...
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