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
8b34370d
Commit
8b34370d
authored
Feb 02, 2009
by
Aric Stewart
Committed by
Alexandre Julliard
Feb 03, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msctf: Only 1 ITfThreadMgr is created per thread.
parent
9105cd88
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
msctf.c
dlls/msctf/msctf.c
+6
-1
msctf_internal.h
dlls/msctf/msctf_internal.h
+1
-0
threadmgr.c
dlls/msctf/threadmgr.c
+11
-0
No files found.
dlls/msctf/msctf.c
View file @
8b34370d
...
...
@@ -43,6 +43,8 @@ static LONG MSCTF_refCount;
static
HINSTANCE
MSCTF_hinstance
;
DWORD
tlsIndex
=
0
;
typedef
HRESULT
(
*
LPFNCONSTRUCTOR
)(
IUnknown
*
pUnkOuter
,
IUnknown
**
ppvOut
);
static
const
struct
{
...
...
@@ -159,8 +161,11 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD fdwReason, LPVOID fImpLoad)
case
DLL_WINE_PREATTACH
:
return
FALSE
;
/* prefer native version */
case
DLL_PROCESS_ATTACH
:
DisableThreadLibraryCalls
(
hinst
);
MSCTF_hinstance
=
hinst
;
tlsIndex
=
TlsAlloc
();
break
;
case
DLL_PROCESS_DETACH
:
TlsFree
(
tlsIndex
);
break
;
}
return
TRUE
;
...
...
dlls/msctf/msctf_internal.h
View file @
8b34370d
...
...
@@ -20,6 +20,7 @@
#ifndef __WINE_MSCTF_I_H
#define __WINE_MSCTF_I_H
extern
DWORD
tlsIndex
;
extern
HRESULT
ThreadMgr_Constructor
(
IUnknown
*
pUnkOuter
,
IUnknown
**
ppOut
);
extern
HRESULT
DocumentMgr_Constructor
(
ITfDocumentMgr
**
ppOut
);
...
...
dlls/msctf/threadmgr.c
View file @
8b34370d
...
...
@@ -49,6 +49,7 @@ typedef struct tagACLMulti {
static
void
ThreadMgr_Destructor
(
ThreadMgr
*
This
)
{
TlsSetValue
(
tlsIndex
,
NULL
);
TRACE
(
"destroying %p
\n
"
,
This
);
if
(
This
->
focus
)
ITfDocumentMgr_Release
(
This
->
focus
);
...
...
@@ -227,12 +228,22 @@ HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
if
(
pUnkOuter
)
return
CLASS_E_NOAGGREGATION
;
/* Only 1 ThreadMgr is created per thread */
This
=
TlsGetValue
(
tlsIndex
);
if
(
This
)
{
ThreadMgr_AddRef
((
ITfThreadMgr
*
)
This
);
*
ppOut
=
(
IUnknown
*
)
This
;
return
S_OK
;
}
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
ThreadMgr
));
if
(
This
==
NULL
)
return
E_OUTOFMEMORY
;
This
->
ThreadMgrVtbl
=
&
ThreadMgr_ThreadMgrVtbl
;
This
->
refCount
=
1
;
TlsSetValue
(
tlsIndex
,
This
);
TRACE
(
"returning %p
\n
"
,
This
);
*
ppOut
=
(
IUnknown
*
)
This
;
...
...
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