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
4e47ccb4
Commit
4e47ccb4
authored
Jan 26, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
There is no need for a private heap in comctl32, memory allocations
should go to the standard process heap (reported by Ge van Geldorp).
parent
c91d9f0c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
74 deletions
+25
-74
comctl32undoc.c
dlls/comctl32/comctl32undoc.c
+25
-64
commctrl.c
dlls/comctl32/commctrl.c
+0
-10
No files found.
dlls/comctl32/comctl32undoc.c
View file @
4e47ccb4
...
...
@@ -57,10 +57,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
commctrl
);
extern
HANDLE
COMCTL32_hHeap
;
/* handle to the private heap */
struct
_DSA
{
INT
nItemCount
;
...
...
@@ -370,15 +366,7 @@ DPA_Merge (const HDPA hdpa1, const HDPA hdpa2, DWORD dwFlags,
LPVOID
WINAPI
Alloc
(
DWORD
dwSize
)
{
LPVOID
lpPtr
;
TRACE
(
"(0x%lx)
\n
"
,
dwSize
);
lpPtr
=
HeapAlloc
(
COMCTL32_hHeap
,
HEAP_ZERO_MEMORY
,
dwSize
);
TRACE
(
"-- ret=%p
\n
"
,
lpPtr
);
return
lpPtr
;
return
LocalAlloc
(
LMEM_ZEROINIT
,
dwSize
);
}
...
...
@@ -403,18 +391,10 @@ LPVOID WINAPI Alloc (DWORD dwSize)
LPVOID
WINAPI
ReAlloc
(
LPVOID
lpSrc
,
DWORD
dwSize
)
{
LPVOID
lpDest
;
TRACE
(
"(%p 0x%08lx)
\n
"
,
lpSrc
,
dwSize
);
if
(
lpSrc
)
lpDest
=
HeapReAlloc
(
COMCTL32_hHeap
,
HEAP_ZERO_MEMORY
,
lpSrc
,
dwSize
);
return
LocalReAlloc
(
lpSrc
,
dwSize
,
LMEM_ZEROINIT
);
else
lpDest
=
HeapAlloc
(
COMCTL32_hHeap
,
HEAP_ZERO_MEMORY
,
dwSize
);
TRACE
(
"-- ret=%p
\n
"
,
lpDest
);
return
lpDest
;
return
LocalAlloc
(
LMEM_ZEROINIT
,
dwSize
);
}
...
...
@@ -433,9 +413,7 @@ LPVOID WINAPI ReAlloc (LPVOID lpSrc, DWORD dwSize)
BOOL
WINAPI
Free
(
LPVOID
lpMem
)
{
TRACE
(
"(%p)
\n
"
,
lpMem
);
return
HeapFree
(
COMCTL32_hHeap
,
0
,
lpMem
);
return
!
LocalFree
(
lpMem
);
}
...
...
@@ -455,9 +433,7 @@ BOOL WINAPI Free (LPVOID lpMem)
DWORD
WINAPI
GetSize
(
LPVOID
lpMem
)
{
TRACE
(
"(%p)
\n
"
,
lpMem
);
return
HeapSize
(
COMCTL32_hHeap
,
0
,
lpMem
);
return
LocalSize
(
lpMem
);
}
...
...
@@ -1656,38 +1632,6 @@ DSA_DeleteAllItems (const HDSA hdsa)
*/
/**************************************************************************
* DPA_Create [COMCTL32.328] Creates a dynamic pointer array
*
* PARAMS
* nGrow [I] number of items by which the array grows when it is filled
*
* RETURNS
* Success: handle (pointer) to the pointer array.
* Failure: NULL
*/
HDPA
WINAPI
DPA_Create
(
INT
nGrow
)
{
HDPA
hdpa
;
TRACE
(
"(%d)
\n
"
,
nGrow
);
hdpa
=
Alloc
(
sizeof
(
*
hdpa
));
if
(
hdpa
)
{
hdpa
->
nGrow
=
max
(
8
,
nGrow
);
hdpa
->
hHeap
=
COMCTL32_hHeap
;
hdpa
->
nMaxCount
=
hdpa
->
nGrow
*
2
;
hdpa
->
ptrs
=
Alloc
(
hdpa
->
nMaxCount
*
sizeof
(
LPVOID
));
}
TRACE
(
"-- %p
\n
"
,
hdpa
);
return
hdpa
;
}
/**************************************************************************
* DPA_Destroy [COMCTL32.329] Destroys a dynamic pointer array
*
* PARAMS
...
...
@@ -2252,10 +2196,9 @@ DPA_CreateEx (INT nGrow, HANDLE hHeap)
if
(
hdpa
)
{
hdpa
->
nGrow
=
min
(
8
,
nGrow
);
hdpa
->
hHeap
=
hHeap
?
hHeap
:
COMCTL32_hHeap
;
hdpa
->
hHeap
=
hHeap
?
hHeap
:
GetProcessHeap
()
;
hdpa
->
nMaxCount
=
hdpa
->
nGrow
*
2
;
hdpa
->
ptrs
=
(
LPVOID
*
)
HeapAlloc
(
hHeap
,
HEAP_ZERO_MEMORY
,
hdpa
->
ptrs
=
HeapAlloc
(
hdpa
->
hHeap
,
HEAP_ZERO_MEMORY
,
hdpa
->
nMaxCount
*
sizeof
(
LPVOID
));
}
...
...
@@ -2266,6 +2209,24 @@ DPA_CreateEx (INT nGrow, HANDLE hHeap)
/**************************************************************************
* DPA_Create [COMCTL32.328] Creates a dynamic pointer array
*
* PARAMS
* nGrow [I] number of items by which the array grows when it is filled
*
* RETURNS
* Success: handle (pointer) to the pointer array.
* Failure: NULL
*/
HDPA
WINAPI
DPA_Create
(
INT
nGrow
)
{
return
DPA_CreateEx
(
nGrow
,
0
);
}
/**************************************************************************
* Notification functions
*/
...
...
dlls/comctl32/commctrl.c
View file @
4e47ccb4
...
...
@@ -115,7 +115,6 @@ extern void UPDOWN_Register(void);
extern
void
UPDOWN_Unregister
(
void
);
HANDLE
COMCTL32_hHeap
=
NULL
;
LPSTR
COMCTL32_aSubclass
=
NULL
;
HMODULE
COMCTL32_hModule
=
0
;
LANGID
COMCTL32_uiLang
=
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_NEUTRAL
);
...
...
@@ -154,10 +153,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
COMCTL32_hModule
=
(
HMODULE
)
hinstDLL
;
/* create private heap */
COMCTL32_hHeap
=
HeapCreate
(
0
,
0x10000
,
0
);
TRACE
(
"Heap created: %p
\n
"
,
COMCTL32_hHeap
);
/* add global subclassing atom (used by 'tooltip' and 'updown') */
COMCTL32_aSubclass
=
(
LPSTR
)(
DWORD
)
GlobalAddAtomA
(
"CC32SubclassInfo"
);
TRACE
(
"Subclassing atom added: %p
\n
"
,
COMCTL32_aSubclass
);
...
...
@@ -218,11 +213,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
GlobalDeleteAtom
(
LOWORD
(
COMCTL32_aSubclass
));
TRACE
(
"Subclassing atom deleted: %p
\n
"
,
COMCTL32_aSubclass
);
COMCTL32_aSubclass
=
NULL
;
/* destroy private heap */
HeapDestroy
(
COMCTL32_hHeap
);
TRACE
(
"Heap destroyed: %p
\n
"
,
COMCTL32_hHeap
);
COMCTL32_hHeap
=
NULL
;
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