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
6b5a5c64
Commit
6b5a5c64
authored
Mar 28, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
browseui: Use CRT memory allocation functions.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4d122a26
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
62 deletions
+31
-62
aclmulti.c
dlls/browseui/aclmulti.c
+12
-18
aclsource.c
dlls/browseui/aclsource.c
+2
-11
browseui_main.c
dlls/browseui/browseui_main.c
+2
-3
compcatcachedaemon.c
dlls/browseui/compcatcachedaemon.c
+2
-5
progressdlg.c
dlls/browseui/progressdlg.c
+13
-25
No files found.
dlls/browseui/aclmulti.c
View file @
6b5a5c64
...
...
@@ -34,8 +34,6 @@
#include "shlguid.h"
#include "shlobj.h"
#include "wine/heap.h"
#include "browseui.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
browseui
);
...
...
@@ -80,17 +78,6 @@ static void release_obj(struct ACLMultiSublist *obj)
IACList_Release
(
obj
->
pACL
);
}
static
void
ACLMulti_Destructor
(
ACLMulti
*
This
)
{
int
i
;
TRACE
(
"destroying %p
\n
"
,
This
);
for
(
i
=
0
;
i
<
This
->
nObjs
;
i
++
)
release_obj
(
&
This
->
objs
[
i
]);
heap_free
(
This
->
objs
);
heap_free
(
This
);
BROWSEUI_refCount
--
;
}
static
HRESULT
WINAPI
ACLMulti_QueryInterface
(
IEnumString
*
iface
,
REFIID
iid
,
LPVOID
*
ppvOut
)
{
ACLMulti
*
This
=
impl_from_IEnumString
(
iface
);
...
...
@@ -129,10 +116,18 @@ static ULONG WINAPI ACLMulti_Release(IEnumString *iface)
{
ACLMulti
*
This
=
impl_from_IEnumString
(
iface
);
ULONG
ret
;
int
i
;
ret
=
InterlockedDecrement
(
&
This
->
refCount
);
if
(
ret
==
0
)
ACLMulti_Destructor
(
This
);
{
for
(
i
=
0
;
i
<
This
->
nObjs
;
i
++
)
release_obj
(
&
This
->
objs
[
i
]);
free
(
This
->
objs
);
free
(
This
);
BROWSEUI_refCount
--
;
}
return
ret
;
}
...
...
@@ -224,7 +219,7 @@ static HRESULT WINAPI ACLMulti_Append(IObjMgr *iface, IUnknown *obj)
if
(
obj
==
NULL
)
return
E_FAIL
;
This
->
objs
=
heap_
realloc
(
This
->
objs
,
sizeof
(
This
->
objs
[
0
])
*
(
This
->
nObjs
+
1
));
This
->
objs
=
realloc
(
This
->
objs
,
sizeof
(
This
->
objs
[
0
])
*
(
This
->
nObjs
+
1
));
This
->
objs
[
This
->
nObjs
].
punk
=
obj
;
IUnknown_AddRef
(
obj
);
if
(
FAILED
(
IUnknown_QueryInterface
(
obj
,
&
IID_IEnumString
,
(
LPVOID
*
)
&
This
->
objs
[
This
->
nObjs
].
pEnum
)))
...
...
@@ -247,7 +242,7 @@ static HRESULT WINAPI ACLMulti_Remove(IObjMgr *iface, IUnknown *obj)
release_obj
(
&
This
->
objs
[
i
]);
memmove
(
&
This
->
objs
[
i
],
&
This
->
objs
[
i
+
1
],
(
This
->
nObjs
-
i
-
1
)
*
sizeof
(
struct
ACLMultiSublist
));
This
->
nObjs
--
;
This
->
objs
=
heap_
realloc
(
This
->
objs
,
sizeof
(
This
->
objs
[
0
])
*
This
->
nObjs
);
This
->
objs
=
realloc
(
This
->
objs
,
sizeof
(
This
->
objs
[
0
])
*
This
->
nObjs
);
return
S_OK
;
}
...
...
@@ -313,8 +308,7 @@ HRESULT ACLMulti_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
if
(
pUnkOuter
)
return
CLASS_E_NOAGGREGATION
;
This
=
heap_alloc_zero
(
sizeof
(
ACLMulti
));
if
(
This
==
NULL
)
if
(
!
(
This
=
calloc
(
1
,
sizeof
(
ACLMulti
))))
return
E_OUTOFMEMORY
;
This
->
IEnumString_iface
.
lpVtbl
=
&
ACLMultiVtbl
;
...
...
dlls/browseui/aclsource.c
View file @
6b5a5c64
...
...
@@ -34,8 +34,6 @@
#include "shlguid.h"
#include "shlobj.h"
#include "wine/heap.h"
#include "browseui.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
browseui
);
...
...
@@ -57,12 +55,6 @@ static inline ACLShellSource *impl_from_IEnumString(IEnumString *iface)
return
CONTAINING_RECORD
(
iface
,
ACLShellSource
,
IEnumString_iface
);
}
static
void
ACLShellSource_Destructor
(
ACLShellSource
*
This
)
{
TRACE
(
"destroying %p
\n
"
,
This
);
heap_free
(
This
);
}
static
HRESULT
WINAPI
ACLShellSource_QueryInterface
(
IEnumString
*
iface
,
REFIID
iid
,
LPVOID
*
ppvOut
)
{
ACLShellSource
*
This
=
impl_from_IEnumString
(
iface
);
...
...
@@ -106,7 +98,7 @@ static ULONG WINAPI ACLShellSource_Release(IEnumString *iface)
TRACE
(
"(%p)->(%lu)
\n
"
,
This
,
ref
);
if
(
ref
==
0
)
ACLShellSource_Destructor
(
This
);
free
(
This
);
return
ref
;
}
...
...
@@ -205,8 +197,7 @@ HRESULT ACLShellSource_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
if
(
pUnkOuter
)
return
CLASS_E_NOAGGREGATION
;
This
=
heap_alloc_zero
(
sizeof
(
ACLShellSource
));
if
(
This
==
NULL
)
if
(
!
(
This
=
calloc
(
1
,
sizeof
(
*
This
))))
return
E_OUTOFMEMORY
;
This
->
IEnumString_iface
.
lpVtbl
=
&
ACLShellSourceVtbl
;
...
...
dlls/browseui/browseui_main.c
View file @
6b5a5c64
...
...
@@ -32,7 +32,6 @@
#include "shlguid.h"
#include "rpcproxy.h"
#include "wine/heap.h"
#include "browseui.h"
#include "initguid.h"
...
...
@@ -72,7 +71,7 @@ static inline ClassFactory *impl_from_IClassFactory(IClassFactory *iface)
static
void
ClassFactory_Destructor
(
ClassFactory
*
This
)
{
TRACE
(
"Destroying class factory %p
\n
"
,
This
);
heap_
free
(
This
);
free
(
This
);
InterlockedDecrement
(
&
BROWSEUI_refCount
);
}
...
...
@@ -147,7 +146,7 @@ static const IClassFactoryVtbl ClassFactoryVtbl = {
static
HRESULT
ClassFactory_Constructor
(
LPFNCONSTRUCTOR
ctor
,
LPVOID
*
ppvOut
)
{
ClassFactory
*
This
=
heap_alloc
(
sizeof
(
ClassFactory
));
ClassFactory
*
This
=
malloc
(
sizeof
(
*
This
));
This
->
IClassFactory_iface
.
lpVtbl
=
&
ClassFactoryVtbl
;
This
->
ref
=
1
;
This
->
ctor
=
ctor
;
...
...
dlls/browseui/compcatcachedaemon.c
View file @
6b5a5c64
...
...
@@ -34,8 +34,6 @@
#include "shlguid.h"
#include "shlobj.h"
#include "wine/heap.h"
#include "browseui.h"
#include "resids.h"
...
...
@@ -57,7 +55,7 @@ static void CompCatCacheDaemon_Destructor(CompCatCacheDaemon *This)
TRACE
(
"destroying %p
\n
"
,
This
);
This
->
cs
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
This
->
cs
);
heap_
free
(
This
);
free
(
This
);
InterlockedDecrement
(
&
BROWSEUI_refCount
);
}
...
...
@@ -146,8 +144,7 @@ HRESULT CompCatCacheDaemon_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
if
(
pUnkOuter
)
return
CLASS_E_NOAGGREGATION
;
This
=
heap_alloc
(
sizeof
(
CompCatCacheDaemon
));
if
(
This
==
NULL
)
if
(
!
(
This
=
calloc
(
1
,
sizeof
(
*
This
))))
return
E_OUTOFMEMORY
;
This
->
IRunnableTask_iface
.
lpVtbl
=
&
CompCatCacheDaemonVtbl
;
...
...
dlls/browseui/progressdlg.c
View file @
6b5a5c64
...
...
@@ -34,8 +34,6 @@
#include "shlguid.h"
#include "shlobj.h"
#include "wine/heap.h"
#include "browseui.h"
#include "resids.h"
...
...
@@ -88,17 +86,8 @@ static inline ProgressDialog *impl_from_IOleWindow(IOleWindow *iface)
static
void
set_buffer
(
LPWSTR
*
buffer
,
LPCWSTR
string
)
{
IMalloc
*
malloc
;
ULONG
cb
;
if
(
string
==
NULL
)
string
=
L""
;
CoGetMalloc
(
MEMCTX_TASK
,
&
malloc
);
cb
=
(
lstrlenW
(
string
)
+
1
)
*
sizeof
(
WCHAR
);
if
(
*
buffer
==
NULL
||
cb
>
IMalloc_GetSize
(
malloc
,
*
buffer
))
*
buffer
=
IMalloc_Realloc
(
malloc
,
*
buffer
,
cb
);
memcpy
(
*
buffer
,
string
,
cb
);
free
(
*
buffer
);
*
buffer
=
wcsdup
(
string
?
string
:
L""
);
}
struct
create_params
...
...
@@ -114,7 +103,7 @@ static LPWSTR load_string(HINSTANCE hInstance, UINT uiResourceId)
LPWSTR
ret
;
LoadStringW
(
hInstance
,
uiResourceId
,
string
,
ARRAY_SIZE
(
string
));
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
string
)
+
1
)
*
sizeof
(
WCHAR
));
ret
=
malloc
(
(
lstrlenW
(
string
)
+
1
)
*
sizeof
(
WCHAR
));
lstrcpyW
(
ret
,
string
);
return
ret
;
}
...
...
@@ -277,17 +266,17 @@ static void ProgressDialog_Destructor(ProgressDialog *This)
TRACE
(
"destroying %p
\n
"
,
This
);
if
(
This
->
hwnd
)
end_dialog
(
This
);
for
(
i
=
0
;
i
<
3
;
i
++
)
heap_
free
(
This
->
lines
[
i
]);
heap_
free
(
This
->
cancelMsg
);
heap_
free
(
This
->
title
);
for
(
i
=
0
;
i
<
2
;
i
++
)
heap_
free
(
This
->
remainingMsg
[
i
]);
for
(
i
=
0
;
i
<
3
;
i
++
)
heap_
free
(
This
->
timeMsg
[
i
]);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
This
->
lines
)
;
i
++
)
free
(
This
->
lines
[
i
]);
free
(
This
->
cancelMsg
);
free
(
This
->
title
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
This
->
remainingMsg
)
;
i
++
)
free
(
This
->
remainingMsg
[
i
]);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
This
->
timeMsg
)
;
i
++
)
free
(
This
->
timeMsg
[
i
]);
This
->
cs
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
This
->
cs
);
heap_
free
(
This
);
free
(
This
);
InterlockedDecrement
(
&
BROWSEUI_refCount
);
}
...
...
@@ -635,8 +624,7 @@ HRESULT ProgressDialog_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
if
(
pUnkOuter
)
return
CLASS_E_NOAGGREGATION
;
This
=
heap_alloc_zero
(
sizeof
(
ProgressDialog
));
if
(
This
==
NULL
)
if
(
!
(
This
=
calloc
(
1
,
sizeof
(
*
This
))))
return
E_OUTOFMEMORY
;
This
->
IProgressDialog_iface
.
lpVtbl
=
&
ProgressDialogVtbl
;
...
...
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