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
789f344c
Commit
789f344c
authored
Mar 09, 2007
by
Rob Shearman
Committed by
Alexandre Julliard
Mar 09, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Make RegisteredClass list into a standard Wine list.
parent
15a0b7fa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
51 deletions
+18
-51
compobj.c
dlls/ole32/compobj.c
+18
-51
No files found.
dlls/ole32/compobj.c
View file @
789f344c
...
...
@@ -117,6 +117,7 @@ static LONG s_COMLockCount = 0;
*/
typedef
struct
tagRegisteredClass
{
struct
list
entry
;
CLSID
classIdentifier
;
LPUNKNOWN
classObject
;
DWORD
runContext
;
...
...
@@ -124,10 +125,9 @@ typedef struct tagRegisteredClass
DWORD
dwCookie
;
LPSTREAM
pMarshaledData
;
/* FIXME: only really need to store OXID and IPID */
void
*
RpcRegistration
;
struct
tagRegisteredClass
*
nextClass
;
}
RegisteredClass
;
static
RegisteredClass
*
firstRegisteredClass
=
NULL
;
static
struct
list
RegisteredClassList
=
LIST_INIT
(
RegisteredClassList
)
;
static
CRITICAL_SECTION
csRegisteredClassList
;
static
CRITICAL_SECTION_DEBUG
class_cs_debug
=
...
...
@@ -1445,21 +1445,16 @@ static HRESULT COM_GetRegisteredClassObject(
LPUNKNOWN
*
ppUnk
)
{
HRESULT
hr
=
S_FALSE
;
RegisteredClass
*
curClass
;
EnterCriticalSection
(
&
csRegisteredClassList
);
RegisteredClass
*
curClass
;
/*
* Sanity check
*/
assert
(
ppUnk
!=
0
);
/*
* Iterate through the whole list and try to match the class ID.
*/
curClass
=
firstRegisteredClass
;
EnterCriticalSection
(
&
csRegisteredClassList
);
while
(
curClass
!=
0
)
LIST_FOR_EACH_ENTRY
(
curClass
,
&
RegisteredClassList
,
RegisteredClass
,
entry
)
{
/*
* Check if we have a match on the class ID and context.
...
...
@@ -1475,20 +1470,12 @@ static HRESULT COM_GetRegisteredClassObject(
IUnknown_AddRef
(
curClass
->
classObject
);
hr
=
S_OK
;
goto
end
;
break
;
}
/*
* Step to the next class in the list.
*/
curClass
=
curClass
->
nextClass
;
}
end:
LeaveCriticalSection
(
&
csRegisteredClassList
);
/*
* If we get to here, we haven't found our class.
*/
return
hr
;
}
...
...
@@ -1569,8 +1556,6 @@ HRESULT WINAPI CoRegisterClassObject(
if
(
newClass
==
NULL
)
return
E_OUTOFMEMORY
;
EnterCriticalSection
(
&
csRegisteredClassList
);
newClass
->
classIdentifier
=
*
rclsid
;
newClass
->
runContext
=
dwClsContext
;
newClass
->
connectFlags
=
flags
;
...
...
@@ -1582,7 +1567,6 @@ HRESULT WINAPI CoRegisterClassObject(
* unique. FIXME: not on 64-bit platforms.
*/
newClass
->
dwCookie
=
(
DWORD
)
newClass
;
newClass
->
nextClass
=
firstRegisteredClass
;
/*
* Since we're making a copy of the object pointer, we have to increase its
...
...
@@ -1591,7 +1575,8 @@ HRESULT WINAPI CoRegisterClassObject(
newClass
->
classObject
=
pUnk
;
IUnknown_AddRef
(
newClass
->
classObject
);
firstRegisteredClass
=
newClass
;
EnterCriticalSection
(
&
csRegisteredClassList
);
list_add_tail
(
&
RegisteredClassList
,
&
newClass
->
entry
);
LeaveCriticalSection
(
&
csRegisteredClassList
);
*
lpdwRegister
=
newClass
->
dwCookie
;
...
...
@@ -1647,30 +1632,20 @@ HRESULT WINAPI CoRevokeClassObject(
DWORD
dwRegister
)
{
HRESULT
hr
=
E_INVALIDARG
;
RegisteredClass
**
prevClassLink
;
RegisteredClass
*
curClass
;
RegisteredClass
*
curClass
;
TRACE
(
"(%08x)
\n
"
,
dwRegister
);
EnterCriticalSection
(
&
csRegisteredClassList
);
/*
* Iterate through the whole list and try to match the cookie.
*/
curClass
=
firstRegisteredClass
;
prevClassLink
=
&
firstRegisteredClass
;
while
(
curClass
!=
0
)
LIST_FOR_EACH_ENTRY
(
curClass
,
&
RegisteredClassList
,
RegisteredClass
,
entry
)
{
/*
* Check if we have a match on the cookie.
*/
if
(
curClass
->
dwCookie
==
dwRegister
)
{
/*
* Remove the class from the chain.
*/
*
prevClassLink
=
curClass
->
nextClass
;
list_remove
(
&
curClass
->
entry
);
if
(
curClass
->
runContext
&
CLSCTX_LOCAL_SERVER
)
RPC_StopLocalServer
(
curClass
->
RpcRegistration
);
...
...
@@ -1684,7 +1659,6 @@ HRESULT WINAPI CoRevokeClassObject(
{
LARGE_INTEGER
zero
;
memset
(
&
zero
,
0
,
sizeof
(
zero
));
/* FIXME: stop local server thread */
IStream_Seek
(
curClass
->
pMarshaledData
,
zero
,
STREAM_SEEK_SET
,
NULL
);
CoReleaseMarshalData
(
curClass
->
pMarshaledData
);
}
...
...
@@ -1695,21 +1669,12 @@ HRESULT WINAPI CoRevokeClassObject(
HeapFree
(
GetProcessHeap
(),
0
,
curClass
);
hr
=
S_OK
;
goto
end
;
break
;
}
/*
* Step to the next class in the list.
*/
prevClassLink
=
&
(
curClass
->
nextClass
);
curClass
=
curClass
->
nextClass
;
}
end:
LeaveCriticalSection
(
&
csRegisteredClassList
);
/*
* If we get to here, we haven't found our class.
*/
return
hr
;
}
...
...
@@ -2384,9 +2349,11 @@ static void COM_RevokeAllClasses(void)
{
EnterCriticalSection
(
&
csRegisteredClassList
);
while
(
firstRegisteredClass
!=
0
)
while
(
list_head
(
&
RegisteredClassList
)
)
{
CoRevokeClassObject
(
firstRegisteredClass
->
dwCookie
);
RegisteredClass
*
curClass
=
LIST_ENTRY
(
list_head
(
&
RegisteredClassList
),
RegisteredClass
,
entry
);
CoRevokeClassObject
(
curClass
->
dwCookie
);
}
LeaveCriticalSection
(
&
csRegisteredClassList
);
...
...
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