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
cd2fafb7
Commit
cd2fafb7
authored
Jan 10, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Jan 10, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole: Defer apartment window creation until the first object is marshalled.
parent
fcba783f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
4 deletions
+29
-4
compobj.c
dlls/ole32/compobj.c
+23
-3
compobj_private.h
dlls/ole32/compobj_private.h
+2
-1
marshal.c
dlls/ole32/marshal.c
+4
-0
No files found.
dlls/ole32/compobj.c
View file @
cd2fafb7
...
...
@@ -236,9 +236,6 @@ static APARTMENT *apartment_construct(DWORD model)
{
/* FIXME: should be randomly generated by in an RPC call to rpcss */
apt
->
oxid
=
((
OXID
)
GetCurrentProcessId
()
<<
32
)
|
GetCurrentThreadId
();
apt
->
win
=
CreateWindowW
(
wszAptWinClass
,
NULL
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
OLE32_hInstance
,
NULL
);
}
else
{
...
...
@@ -422,6 +419,29 @@ static LRESULT CALLBACK apartment_wndproc(HWND hWnd, UINT msg, WPARAM wParam, LP
}
}
HRESULT
apartment_createwindowifneeded
(
struct
apartment
*
apt
)
{
if
(
!
(
apt
->
model
&
COINIT_APARTMENTTHREADED
))
return
S_OK
;
if
(
!
apt
->
win
)
{
HWND
hwnd
=
CreateWindowW
(
wszAptWinClass
,
NULL
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
OLE32_hInstance
,
NULL
);
if
(
!
hwnd
)
{
ERR
(
"CreateWindow failed with error %ld
\n
"
,
GetLastError
());
return
HRESULT_FROM_WIN32
(
GetLastError
());
}
if
(
InterlockedCompareExchangePointer
((
PVOID
*
)
&
apt
->
win
,
hwnd
,
NULL
))
/* someone beat us to it */
DestroyWindow
(
hwnd
);
}
return
S_OK
;
}
HWND
apartment_getwindow
(
struct
apartment
*
apt
)
{
assert
(
apt
->
model
&
COINIT_APARTMENTTHREADED
);
...
...
dlls/ole32/compobj_private.h
View file @
cd2fafb7
...
...
@@ -139,7 +139,7 @@ struct apartment
DWORD
tid
;
/* thread id (RO) */
OXID
oxid
;
/* object exporter ID (RO) */
LONG
ipidc
;
/* interface pointer ID counter, starts at 1 (LOCK) */
HWND
win
;
/* message window (
RO
) */
HWND
win
;
/* message window (
LOCK
) */
CRITICAL_SECTION
cs
;
/* thread safety */
LPMESSAGEFILTER
filter
;
/* message filter (CS cs) */
struct
list
proxies
;
/* imported objects (CS cs) */
...
...
@@ -230,6 +230,7 @@ static inline HRESULT apartment_getoxid(struct apartment *apt, OXID *oxid)
*
oxid
=
apt
->
oxid
;
return
S_OK
;
}
HRESULT
apartment_createwindowifneeded
(
struct
apartment
*
apt
);
HWND
apartment_getwindow
(
struct
apartment
*
apt
);
void
apartment_joinmta
(
void
);
...
...
dlls/ole32/marshal.c
View file @
cd2fafb7
...
...
@@ -98,6 +98,10 @@ HRESULT marshal_object(APARTMENT *apt, STDOBJREF *stdobjref, REFIID riid, IUnkno
if
(
hr
!=
S_OK
)
return
hr
;
hr
=
apartment_createwindowifneeded
(
apt
);
if
(
hr
!=
S_OK
)
return
hr
;
hr
=
IUnknown_QueryInterface
(
object
,
riid
,
(
void
**
)
&
iobject
);
if
(
hr
!=
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