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
161f1b7b
Commit
161f1b7b
authored
Sep 01, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Sep 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msctf: Use CRT allocation functions.
parent
da74da29
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
79 additions
and
81 deletions
+79
-81
categorymgr.c
dlls/msctf/categorymgr.c
+4
-4
compartmentmgr.c
dlls/msctf/compartmentmgr.c
+11
-11
context.c
dlls/msctf/context.c
+13
-13
displayattributemgr.c
dlls/msctf/displayattributemgr.c
+2
-2
documentmgr.c
dlls/msctf/documentmgr.c
+4
-4
inputprocessor.c
dlls/msctf/inputprocessor.c
+11
-11
langbarmgr.c
dlls/msctf/langbarmgr.c
+2
-3
msctf.c
dlls/msctf/msctf.c
+13
-14
range.c
dlls/msctf/range.c
+2
-2
threadmgr.c
dlls/msctf/threadmgr.c
+17
-17
No files found.
dlls/msctf/categorymgr.c
View file @
161f1b7b
...
...
@@ -50,7 +50,7 @@ static inline CategoryMgr *impl_from_ITfCategoryMgr(ITfCategoryMgr *iface)
static
void
CategoryMgr_Destructor
(
CategoryMgr
*
This
)
{
TRACE
(
"destroying %p
\n
"
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
static
HRESULT
WINAPI
CategoryMgr_QueryInterface
(
ITfCategoryMgr
*
iface
,
REFIID
iid
,
LPVOID
*
ppvOut
)
...
...
@@ -332,13 +332,13 @@ static HRESULT WINAPI CategoryMgr_RegisterGUID ( ITfCategoryMgr *iface,
}
}
while
(
id
);
checkguid
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
GUID
));
checkguid
=
malloc
(
sizeof
(
GUID
));
*
checkguid
=
*
rguid
;
id
=
generate_Cookie
(
COOKIE_MAGIC_GUIDATOM
,
checkguid
);
if
(
!
id
)
{
HeapFree
(
GetProcessHeap
(),
0
,
checkguid
);
free
(
checkguid
);
return
E_FAIL
;
}
...
...
@@ -413,7 +413,7 @@ HRESULT CategoryMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
if
(
pUnkOuter
)
return
CLASS_E_NOAGGREGATION
;
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
CategoryMgr
));
This
=
calloc
(
1
,
sizeof
(
CategoryMgr
));
if
(
This
==
NULL
)
return
E_OUTOFMEMORY
;
...
...
dlls/msctf/compartmentmgr.c
View file @
161f1b7b
...
...
@@ -106,10 +106,10 @@ HRESULT CompartmentMgr_Destructor(ITfCompartmentMgr *iface)
CompartmentValue
*
value
=
LIST_ENTRY
(
cursor
,
CompartmentValue
,
entry
);
list_remove
(
cursor
);
ITfCompartment_Release
(
value
->
compartment
);
HeapFree
(
GetProcessHeap
(),
0
,
value
);
free
(
value
);
}
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
return
S_OK
;
}
...
...
@@ -187,7 +187,7 @@ static HRESULT WINAPI CompartmentMgr_GetCompartment(ITfCompartmentMgr *iface,
}
}
value
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
CompartmentValue
));
value
=
malloc
(
sizeof
(
CompartmentValue
));
value
->
guid
=
*
rguid
;
value
->
owner
=
0
;
hr
=
Compartment_Constructor
(
value
,
&
value
->
compartment
);
...
...
@@ -199,7 +199,7 @@ static HRESULT WINAPI CompartmentMgr_GetCompartment(ITfCompartmentMgr *iface,
}
else
{
HeapFree
(
GetProcessHeap
(),
0
,
value
);
free
(
value
);
*
ppcomp
=
NULL
;
}
return
hr
;
...
...
@@ -222,7 +222,7 @@ static HRESULT WINAPI CompartmentMgr_ClearCompartment(ITfCompartmentMgr *iface,
return
E_UNEXPECTED
;
list_remove
(
cursor
);
ITfCompartment_Release
(
value
->
compartment
);
HeapFree
(
GetProcessHeap
(),
0
,
value
);
free
(
value
);
return
S_OK
;
}
}
...
...
@@ -261,7 +261,7 @@ HRESULT CompartmentMgr_Constructor(IUnknown *pUnkOuter, REFIID riid, IUnknown **
if
(
pUnkOuter
&&
!
IsEqualIID
(
riid
,
&
IID_IUnknown
))
return
CLASS_E_NOAGGREGATION
;
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
CompartmentMgr
));
This
=
calloc
(
1
,
sizeof
(
CompartmentMgr
));
if
(
This
==
NULL
)
return
E_OUTOFMEMORY
;
...
...
@@ -280,7 +280,7 @@ HRESULT CompartmentMgr_Constructor(IUnknown *pUnkOuter, REFIID riid, IUnknown **
HRESULT
hr
;
hr
=
ITfCompartmentMgr_QueryInterface
(
&
This
->
ITfCompartmentMgr_iface
,
riid
,
(
void
**
)
ppOut
);
if
(
FAILED
(
hr
))
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
return
hr
;
}
}
...
...
@@ -291,7 +291,7 @@ HRESULT CompartmentMgr_Constructor(IUnknown *pUnkOuter, REFIID riid, IUnknown **
static
void
CompartmentEnumGuid_Destructor
(
CompartmentEnumGuid
*
This
)
{
TRACE
(
"destroying %p
\n
"
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
static
HRESULT
WINAPI
CompartmentEnumGuid_QueryInterface
(
IEnumGUID
*
iface
,
REFIID
iid
,
LPVOID
*
ppvOut
)
...
...
@@ -412,7 +412,7 @@ static HRESULT CompartmentEnumGuid_Constructor(struct list *values, IEnumGUID **
{
CompartmentEnumGuid
*
This
;
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
CompartmentEnumGuid
));
This
=
calloc
(
1
,
sizeof
(
CompartmentEnumGuid
));
if
(
This
==
NULL
)
return
E_OUTOFMEMORY
;
...
...
@@ -435,7 +435,7 @@ static void Compartment_Destructor(Compartment *This)
TRACE
(
"destroying %p
\n
"
,
This
);
VariantClear
(
&
This
->
variant
);
free_sinks
(
&
This
->
CompartmentEventSink
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
static
HRESULT
WINAPI
Compartment_QueryInterface
(
ITfCompartment
*
iface
,
REFIID
iid
,
LPVOID
*
ppvOut
)
...
...
@@ -606,7 +606,7 @@ static HRESULT Compartment_Constructor(CompartmentValue *valueData, ITfCompartme
{
Compartment
*
This
;
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
Compartment
));
This
=
calloc
(
1
,
sizeof
(
Compartment
));
if
(
This
==
NULL
)
return
E_OUTOFMEMORY
;
...
...
dlls/msctf/context.c
View file @
161f1b7b
...
...
@@ -128,7 +128,7 @@ static void Context_Destructor(Context *This)
if
(
This
->
defaultCookie
)
{
cookie
=
remove_Cookie
(
This
->
defaultCookie
);
HeapFree
(
GetProcessHeap
(),
0
,
cookie
);
free
(
cookie
);
This
->
defaultCookie
=
0
;
}
...
...
@@ -139,7 +139,7 @@ static void Context_Destructor(Context *This)
free_sinks
(
&
This
->
pTextLayoutSink
);
CompartmentMgr_Destructor
(
This
->
CompartmentMgr
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
static
HRESULT
WINAPI
Context_QueryInterface
(
ITfContext
*
iface
,
REFIID
iid
,
LPVOID
*
ppvOut
)
...
...
@@ -338,7 +338,7 @@ static HRESULT WINAPI Context_SetSelection (ITfContext *iface,
if
(
get_Cookie_magic
(
ec
)
!=
COOKIE_MAGIC_EDITCOOKIE
)
return
TF_E_NOLOCK
;
acp
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
TS_SELECTION_ACP
)
*
ulCount
);
acp
=
malloc
(
sizeof
(
TS_SELECTION_ACP
)
*
ulCount
);
if
(
!
acp
)
return
E_OUTOFMEMORY
;
...
...
@@ -346,13 +346,13 @@ static HRESULT WINAPI Context_SetSelection (ITfContext *iface,
if
(
FAILED
(
TF_SELECTION_to_TS_SELECTION_ACP
(
&
pSelection
[
i
],
&
acp
[
i
])))
{
TRACE
(
"Selection Conversion Failed
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
acp
);
free
(
acp
);
return
E_FAIL
;
}
hr
=
ITextStoreACP_SetSelection
(
This
->
pITextStoreACP
,
ulCount
,
acp
);
HeapFree
(
GetProcessHeap
(),
0
,
acp
);
free
(
acp
);
return
hr
;
}
...
...
@@ -896,14 +896,14 @@ static HRESULT WINAPI TextStoreACPSink_OnLockGranted(ITextStoreACPSink *iface,
return
S_OK
;
}
cookie
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
EditCookie
));
cookie
=
malloc
(
sizeof
(
EditCookie
));
if
(
!
cookie
)
return
E_OUTOFMEMORY
;
sinkcookie
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
EditCookie
));
sinkcookie
=
malloc
(
sizeof
(
EditCookie
));
if
(
!
sinkcookie
)
{
HeapFree
(
GetProcessHeap
(),
0
,
cookie
);
free
(
cookie
);
return
E_OUTOFMEMORY
;
}
...
...
@@ -929,14 +929,14 @@ static HRESULT WINAPI TextStoreACPSink_OnLockGranted(ITextStoreACPSink *iface,
}
sinkcookie
=
remove_Cookie
(
sc
);
}
HeapFree
(
GetProcessHeap
(),
0
,
sinkcookie
);
free
(
sinkcookie
);
ITfEditSession_Release
(
This
->
currentEditSession
);
This
->
currentEditSession
=
NULL
;
/* Edit Cookie is only valid during the edit session */
cookie
=
remove_Cookie
(
ec
);
HeapFree
(
GetProcessHeap
(),
0
,
cookie
);
free
(
cookie
);
return
hr
;
}
...
...
@@ -1043,14 +1043,14 @@ HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfDocumentMgr
Context
*
This
;
EditCookie
*
cookie
;
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
Context
));
This
=
calloc
(
1
,
sizeof
(
Context
));
if
(
This
==
NULL
)
return
E_OUTOFMEMORY
;
cookie
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
EditCookie
));
cookie
=
malloc
(
sizeof
(
EditCookie
));
if
(
cookie
==
NULL
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
return
E_OUTOFMEMORY
;
}
...
...
dlls/msctf/displayattributemgr.c
View file @
161f1b7b
...
...
@@ -46,7 +46,7 @@ static void DisplayAttributeMgr_Destructor(DisplayAttributeMgr *This)
{
TRACE
(
"destroying %p
\n
"
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
static
HRESULT
WINAPI
DisplayAttributeMgr_QueryInterface
(
ITfDisplayAttributeMgr
*
iface
,
REFIID
iid
,
LPVOID
*
ppvOut
)
...
...
@@ -130,7 +130,7 @@ HRESULT DisplayAttributeMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
if
(
pUnkOuter
)
return
CLASS_E_NOAGGREGATION
;
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
DisplayAttributeMgr
));
This
=
malloc
(
sizeof
(
DisplayAttributeMgr
));
if
(
This
==
NULL
)
return
E_OUTOFMEMORY
;
...
...
dlls/msctf/documentmgr.c
View file @
161f1b7b
...
...
@@ -96,7 +96,7 @@ static void DocumentMgr_Destructor(DocumentMgr *This)
ITfContext_Release
(
This
->
contextStack
[
1
]);
free_sinks
(
&
This
->
TransitoryExtensionSink
);
CompartmentMgr_Destructor
(
This
->
CompartmentMgr
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
static
HRESULT
WINAPI
DocumentMgr_QueryInterface
(
ITfDocumentMgr
*
iface
,
REFIID
iid
,
LPVOID
*
ppvOut
)
...
...
@@ -356,7 +356,7 @@ HRESULT DocumentMgr_Constructor(ITfThreadMgrEventSink *ThreadMgrSink, ITfDocumen
DocumentMgr
*
This
;
DWORD
cookie
;
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
DocumentMgr
));
This
=
calloc
(
1
,
sizeof
(
DocumentMgr
));
if
(
This
==
NULL
)
return
E_OUTOFMEMORY
;
...
...
@@ -380,7 +380,7 @@ HRESULT DocumentMgr_Constructor(ITfThreadMgrEventSink *ThreadMgrSink, ITfDocumen
static
void
EnumTfContext_Destructor
(
EnumTfContext
*
This
)
{
TRACE
(
"destroying %p
\n
"
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
static
HRESULT
WINAPI
EnumTfContext_QueryInterface
(
IEnumTfContexts
*
iface
,
REFIID
iid
,
LPVOID
*
ppvOut
)
...
...
@@ -500,7 +500,7 @@ static HRESULT EnumTfContext_Constructor(DocumentMgr *mgr, IEnumTfContexts **ppO
{
EnumTfContext
*
This
;
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
EnumTfContext
));
This
=
calloc
(
1
,
sizeof
(
EnumTfContext
));
if
(
This
==
NULL
)
return
E_OUTOFMEMORY
;
...
...
dlls/msctf/inputprocessor.c
View file @
161f1b7b
...
...
@@ -135,7 +135,7 @@ static ULONG WINAPI EnumTfInputProcessorProfiles_Release(IEnumTfInputProcessorPr
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
return
ref
;
}
...
...
@@ -209,7 +209,7 @@ static void InputProcessorProfiles_Destructor(InputProcessorProfiles *This)
TRACE
(
"destroying %p
\n
"
,
This
);
free_sinks
(
&
This
->
LanguageProfileNotifySink
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
static
void
add_userkey
(
REFCLSID
rclsid
,
LANGID
langid
,
...
...
@@ -825,7 +825,7 @@ static HRESULT WINAPI InputProcessorProfileMgr_EnumProfiles(ITfInputProcessorPro
TRACE
(
"(%p)->(%x %p)
\n
"
,
This
,
langid
,
ppEnum
);
enum_profiles
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
enum_profiles
));
enum_profiles
=
malloc
(
sizeof
(
*
enum_profiles
));
if
(
!
enum_profiles
)
return
E_OUTOFMEMORY
;
...
...
@@ -958,7 +958,7 @@ HRESULT InputProcessorProfiles_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut
if
(
pUnkOuter
)
return
CLASS_E_NOAGGREGATION
;
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
InputProcessorProfiles
));
This
=
calloc
(
1
,
sizeof
(
InputProcessorProfiles
));
if
(
This
==
NULL
)
return
E_OUTOFMEMORY
;
...
...
@@ -982,7 +982,7 @@ static void ProfilesEnumGuid_Destructor(ProfilesEnumGuid *This)
{
TRACE
(
"destroying %p
\n
"
,
This
);
RegCloseKey
(
This
->
key
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
static
HRESULT
WINAPI
ProfilesEnumGuid_QueryInterface
(
IEnumGUID
*
iface
,
REFIID
iid
,
LPVOID
*
ppvOut
)
...
...
@@ -1109,7 +1109,7 @@ static HRESULT ProfilesEnumGuid_Constructor(IEnumGUID **ppOut)
{
ProfilesEnumGuid
*
This
;
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
ProfilesEnumGuid
));
This
=
calloc
(
1
,
sizeof
(
ProfilesEnumGuid
));
if
(
This
==
NULL
)
return
E_OUTOFMEMORY
;
...
...
@@ -1119,7 +1119,7 @@ static HRESULT ProfilesEnumGuid_Constructor(IEnumGUID **ppOut)
if
(
RegCreateKeyExW
(
HKEY_LOCAL_MACHINE
,
szwSystemTIPKey
,
0
,
NULL
,
0
,
KEY_READ
|
KEY_WRITE
,
NULL
,
&
This
->
key
,
NULL
)
!=
ERROR_SUCCESS
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
return
E_FAIL
;
}
...
...
@@ -1138,7 +1138,7 @@ static void EnumTfLanguageProfiles_Destructor(EnumTfLanguageProfiles *This)
if
(
This
->
langkey
)
RegCloseKey
(
This
->
langkey
);
ITfCategoryMgr_Release
(
This
->
catmgr
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
static
HRESULT
WINAPI
EnumTfLanguageProfiles_QueryInterface
(
IEnumTfLanguageProfiles
*
iface
,
REFIID
iid
,
LPVOID
*
ppvOut
)
...
...
@@ -1343,7 +1343,7 @@ static HRESULT EnumTfLanguageProfiles_Constructor(LANGID langid, EnumTfLanguageP
HRESULT
hr
;
EnumTfLanguageProfiles
*
This
;
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
EnumTfLanguageProfiles
));
This
=
calloc
(
1
,
sizeof
(
EnumTfLanguageProfiles
));
if
(
This
==
NULL
)
return
E_OUTOFMEMORY
;
...
...
@@ -1354,14 +1354,14 @@ static HRESULT EnumTfLanguageProfiles_Constructor(LANGID langid, EnumTfLanguageP
hr
=
CategoryMgr_Constructor
(
NULL
,(
IUnknown
**
)
&
This
->
catmgr
);
if
(
FAILED
(
hr
))
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
return
hr
;
}
if
(
RegCreateKeyExW
(
HKEY_LOCAL_MACHINE
,
szwSystemTIPKey
,
0
,
NULL
,
0
,
KEY_READ
|
KEY_WRITE
,
NULL
,
&
This
->
tipkey
,
NULL
)
!=
ERROR_SUCCESS
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
return
E_FAIL
;
}
...
...
dlls/msctf/langbarmgr.c
View file @
161f1b7b
...
...
@@ -45,8 +45,7 @@ static inline LangBarMgr *impl_from_ITfLangBarMgr(ITfLangBarMgr *iface)
static
void
LangBarMgr_Destructor
(
LangBarMgr
*
This
)
{
TRACE
(
"destroying %p
\n
"
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
static
HRESULT
WINAPI
LangBarMgr_QueryInterface
(
ITfLangBarMgr
*
iface
,
REFIID
iid
,
LPVOID
*
ppvOut
)
...
...
@@ -185,7 +184,7 @@ HRESULT LangBarMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
if
(
pUnkOuter
)
return
CLASS_E_NOAGGREGATION
;
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
LangBarMgr
));
This
=
malloc
(
sizeof
(
LangBarMgr
));
if
(
This
==
NULL
)
return
E_OUTOFMEMORY
;
...
...
dlls/msctf/msctf.c
View file @
161f1b7b
...
...
@@ -103,7 +103,7 @@ static inline ClassFactory *impl_from_IClassFactory(IClassFactory *iface)
static
void
ClassFactory_Destructor
(
ClassFactory
*
This
)
{
TRACE
(
"Destroying class factory %p
\n
"
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
static
HRESULT
WINAPI
ClassFactory_QueryInterface
(
IClassFactory
*
iface
,
REFIID
riid
,
LPVOID
*
ppvOut
)
...
...
@@ -172,7 +172,7 @@ static const IClassFactoryVtbl ClassFactoryVtbl = {
static
HRESULT
ClassFactory_Constructor
(
LPFNCONSTRUCTOR
ctor
,
LPVOID
*
ppvOut
)
{
ClassFactory
*
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
ClassFactory
));
ClassFactory
*
This
=
malloc
(
sizeof
(
ClassFactory
));
This
->
IClassFactory_iface
.
lpVtbl
=
&
ClassFactoryVtbl
;
This
->
ref
=
1
;
This
->
ctor
=
ctor
;
...
...
@@ -196,7 +196,7 @@ DWORD generate_Cookie(DWORD magic, LPVOID data)
{
if
(
!
array_size
)
{
cookies
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
CookieInternal
)
*
10
);
cookies
=
calloc
(
10
,
sizeof
(
CookieInternal
)
);
if
(
!
cookies
)
{
ERR
(
"Out of memory, Unable to alloc cookies array
\n
"
);
...
...
@@ -206,8 +206,7 @@ DWORD generate_Cookie(DWORD magic, LPVOID data)
}
else
{
CookieInternal
*
new_cookies
=
HeapReAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
cookies
,
sizeof
(
CookieInternal
)
*
(
array_size
*
2
));
CookieInternal
*
new_cookies
=
_recalloc
(
cookies
,
array_size
*
2
,
sizeof
(
CookieInternal
));
if
(
!
new_cookies
)
{
ERR
(
"Out of memory, Unable to realloc cookies array
\n
"
);
...
...
@@ -284,13 +283,13 @@ HRESULT advise_sink(struct list *sink_list, REFIID riid, DWORD cookie_magic, IUn
{
Sink
*
sink
;
sink
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
sink
));
sink
=
malloc
(
sizeof
(
*
sink
));
if
(
!
sink
)
return
E_OUTOFMEMORY
;
if
(
FAILED
(
IUnknown_QueryInterface
(
unk
,
riid
,
(
void
**
)
&
sink
->
interfaces
.
pIUnknown
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
sink
);
free
(
sink
);
return
CONNECT_E_CANNOTCONNECT
;
}
...
...
@@ -304,7 +303,7 @@ static void free_sink(Sink *sink)
{
list_remove
(
&
sink
->
entry
);
IUnknown_Release
(
sink
->
interfaces
.
pIUnknown
);
HeapFree
(
GetProcessHeap
(),
0
,
sink
);
free
(
sink
);
}
HRESULT
unadvise_sink
(
DWORD
cookie
)
...
...
@@ -382,8 +381,8 @@ static void deactivate_remove_conflicting_ts(REFCLSID catid)
{
deactivate_given_ts
(
ats
->
ats
);
list_remove
(
&
ats
->
entry
);
HeapFree
(
GetProcessHeap
(),
0
,
ats
->
ats
);
HeapFree
(
GetProcessHeap
(),
0
,
ats
);
free
(
ats
->
ats
);
free
(
ats
);
/* we are guaranteeing there is only 1 */
break
;
}
...
...
@@ -400,7 +399,7 @@ HRESULT add_active_textservice(TF_LANGUAGEPROFILE *lp)
if
(
!
tm
)
return
E_UNEXPECTED
;
actsvr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
ActivatedTextService
));
actsvr
=
malloc
(
sizeof
(
ActivatedTextService
));
if
(
!
actsvr
)
return
E_OUTOFMEMORY
;
ITfThreadMgrEx_QueryInterface
(
tm
,
&
IID_ITfClientId
,
(
void
**
)
&
clientid
);
...
...
@@ -409,7 +408,7 @@ HRESULT add_active_textservice(TF_LANGUAGEPROFILE *lp)
if
(
!
actsvr
->
tid
)
{
HeapFree
(
GetProcessHeap
(),
0
,
actsvr
);
free
(
actsvr
);
return
E_OUTOFMEMORY
;
}
...
...
@@ -440,11 +439,11 @@ HRESULT add_active_textservice(TF_LANGUAGEPROFILE *lp)
if
(
activated
>
0
)
activate_given_ts
(
actsvr
,
tm
);
entry
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
AtsEntry
));
entry
=
malloc
(
sizeof
(
AtsEntry
));
if
(
!
entry
)
{
HeapFree
(
GetProcessHeap
(),
0
,
actsvr
);
free
(
actsvr
);
return
E_OUTOFMEMORY
;
}
...
...
dlls/msctf/range.c
View file @
161f1b7b
...
...
@@ -61,7 +61,7 @@ static void Range_Destructor(Range *This)
{
TRACE
(
"destroying %p
\n
"
,
This
);
ITfContext_Release
(
This
->
context
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
static
HRESULT
WINAPI
Range_QueryInterface
(
ITfRangeACP
*
iface
,
REFIID
iid
,
LPVOID
*
ppvOut
)
...
...
@@ -329,7 +329,7 @@ HRESULT Range_Constructor(ITfContext *context, DWORD anchorStart, DWORD anchorEn
{
Range
*
This
;
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
Range
));
This
=
calloc
(
1
,
sizeof
(
Range
));
if
(
This
==
NULL
)
return
E_OUTOFMEMORY
;
...
...
dlls/msctf/threadmgr.c
View file @
161f1b7b
...
...
@@ -181,8 +181,8 @@ static void ThreadMgr_Destructor(ThreadMgr *This)
{
PreservedKey
*
key
=
LIST_ENTRY
(
cursor
,
PreservedKey
,
entry
);
list_remove
(
cursor
);
HeapFree
(
GetProcessHeap
(),
0
,
key
->
description
);
HeapFree
(
GetProcessHeap
(),
0
,
key
);
free
(
key
->
description
);
free
(
key
);
}
LIST_FOR_EACH_SAFE
(
cursor
,
cursor2
,
&
This
->
CreatedDocumentMgrs
)
...
...
@@ -190,19 +190,19 @@ static void ThreadMgr_Destructor(ThreadMgr *This)
DocumentMgrEntry
*
mgr
=
LIST_ENTRY
(
cursor
,
DocumentMgrEntry
,
entry
);
list_remove
(
cursor
);
FIXME
(
"Left Over ITfDocumentMgr. Should we do something with it?
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
mgr
);
free
(
mgr
);
}
LIST_FOR_EACH_SAFE
(
cursor
,
cursor2
,
&
This
->
AssociatedFocusWindows
)
{
AssociatedWindow
*
wnd
=
LIST_ENTRY
(
cursor
,
AssociatedWindow
,
entry
);
list_remove
(
cursor
);
HeapFree
(
GetProcessHeap
(),
0
,
wnd
);
free
(
wnd
);
}
CompartmentMgr_Destructor
(
This
->
CompartmentMgr
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
static
HRESULT
WINAPI
ThreadMgr_QueryInterface
(
ITfThreadMgrEx
*
iface
,
REFIID
iid
,
LPVOID
*
ppvOut
)
...
...
@@ -315,7 +315,7 @@ static HRESULT WINAPI ThreadMgr_CreateDocumentMgr(ITfThreadMgrEx *iface, ITfDocu
HRESULT
hr
;
TRACE
(
"(%p)
\n
"
,
iface
);
mgrentry
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
DocumentMgrEntry
));
mgrentry
=
malloc
(
sizeof
(
DocumentMgrEntry
));
if
(
mgrentry
==
NULL
)
return
E_OUTOFMEMORY
;
...
...
@@ -327,7 +327,7 @@ static HRESULT WINAPI ThreadMgr_CreateDocumentMgr(ITfThreadMgrEx *iface, ITfDocu
list_add_head
(
&
This
->
CreatedDocumentMgrs
,
&
mgrentry
->
entry
);
}
else
HeapFree
(
GetProcessHeap
(),
0
,
mgrentry
);
free
(
mgrentry
);
return
hr
;
}
...
...
@@ -465,7 +465,7 @@ ITfDocumentMgr *pdimNew, ITfDocumentMgr **ppdimPrev)
}
}
wnd
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
AssociatedWindow
));
wnd
=
malloc
(
sizeof
(
AssociatedWindow
));
wnd
->
hwnd
=
hwnd
;
wnd
->
docmgr
=
pdimNew
;
list_add_head
(
&
This
->
AssociatedFocusWindows
,
&
wnd
->
entry
);
...
...
@@ -875,7 +875,7 @@ static HRESULT WINAPI KeystrokeMgr_PreserveKey(ITfKeystrokeMgr *iface,
return
TF_E_ALREADY_EXISTS
;
}
newkey
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
PreservedKey
));
newkey
=
malloc
(
sizeof
(
PreservedKey
));
if
(
!
newkey
)
return
E_OUTOFMEMORY
;
...
...
@@ -885,10 +885,10 @@ static HRESULT WINAPI KeystrokeMgr_PreserveKey(ITfKeystrokeMgr *iface,
newkey
->
description
=
NULL
;
if
(
cchDesc
)
{
newkey
->
description
=
HeapAlloc
(
GetProcessHeap
(),
0
,
cchDesc
*
sizeof
(
WCHAR
));
newkey
->
description
=
malloc
(
cchDesc
*
sizeof
(
WCHAR
));
if
(
!
newkey
->
description
)
{
HeapFree
(
GetProcessHeap
(),
0
,
newkey
);
free
(
newkey
);
return
E_OUTOFMEMORY
;
}
memcpy
(
newkey
->
description
,
pchDesc
,
cchDesc
*
sizeof
(
WCHAR
));
...
...
@@ -922,8 +922,8 @@ static HRESULT WINAPI KeystrokeMgr_UnpreserveKey(ITfKeystrokeMgr *iface,
return
CONNECT_E_NOCONNECTION
;
list_remove
(
&
key
->
entry
);
HeapFree
(
GetProcessHeap
(),
0
,
key
->
description
);
HeapFree
(
GetProcessHeap
(),
0
,
key
);
free
(
key
->
description
);
free
(
key
);
return
S_OK
;
}
...
...
@@ -1354,7 +1354,7 @@ HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
return
S_OK
;
}
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
ThreadMgr
));
This
=
calloc
(
1
,
sizeof
(
ThreadMgr
));
if
(
This
==
NULL
)
return
E_OUTOFMEMORY
;
...
...
@@ -1395,7 +1395,7 @@ HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
static
void
EnumTfDocumentMgr_Destructor
(
EnumTfDocumentMgr
*
This
)
{
TRACE
(
"destroying %p
\n
"
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
static
HRESULT
WINAPI
EnumTfDocumentMgr_QueryInterface
(
IEnumTfDocumentMgrs
*
iface
,
REFIID
iid
,
LPVOID
*
ppvOut
)
...
...
@@ -1520,7 +1520,7 @@ static HRESULT EnumTfDocumentMgr_Constructor(struct list* head, IEnumTfDocumentM
{
EnumTfDocumentMgr
*
This
;
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
EnumTfDocumentMgr
));
This
=
calloc
(
1
,
sizeof
(
EnumTfDocumentMgr
));
if
(
This
==
NULL
)
return
E_OUTOFMEMORY
;
...
...
@@ -1546,7 +1546,7 @@ void ThreadMgr_OnDocumentMgrDestruction(ITfThreadMgr *iface, ITfDocumentMgr *mgr
if
(
mgrentry
->
docmgr
==
mgr
)
{
list_remove
(
cursor
);
HeapFree
(
GetProcessHeap
(),
0
,
mgrentry
);
free
(
mgrentry
);
found
=
TRUE
;
break
;
}
...
...
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