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
ff1cd359
Commit
ff1cd359
authored
Feb 02, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/header: Use HeapAlloc() wrappers.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d886eda2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
23 deletions
+23
-23
header.c
dlls/comctl32/header.c
+23
-23
No files found.
dlls/comctl32/header.c
View file @
ff1cd359
...
...
@@ -42,6 +42,7 @@
#include "vssym32.h"
#include "uxtheme.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
header
);
...
...
@@ -141,7 +142,7 @@ static void HEADER_StoreHDItemInHeader(HEADER_ITEM *lpItem, UINT mask, const HDI
if
(
mask
&
HDI_TEXT
)
{
F
ree
(
lpItem
->
pszText
);
heap_f
ree
(
lpItem
->
pszText
);
lpItem
->
pszText
=
NULL
;
if
(
phdi
->
pszText
!=
LPSTR_TEXTCALLBACKW
)
/* covers != TEXTCALLBACKA too */
...
...
@@ -338,7 +339,7 @@ static HRGN create_sort_arrow( INT x, INT y, INT h, BOOL is_up )
if
(
size
>
sizeof
(
buffer
))
{
data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
data
=
heap_alloc
(
size
);
if
(
!
data
)
return
NULL
;
}
data
->
rdh
.
dwSize
=
sizeof
(
data
->
rdh
);
...
...
@@ -364,7 +365,7 @@ static HRGN create_sort_arrow( INT x, INT y, INT h, BOOL is_up )
data
->
rdh
.
nCount
++
;
}
rgn
=
ExtCreateRegion
(
NULL
,
size
,
data
);
if
(
data
!=
(
RGNDATA
*
)
buffer
)
HeapFree
(
GetProcessHeap
(),
0
,
data
);
if
(
data
!=
(
RGNDATA
*
)
buffer
)
heap_free
(
data
);
return
rgn
;
}
...
...
@@ -985,7 +986,7 @@ HEADER_PrepareCallbackItems(const HEADER_INFO *infoPtr, INT iItem, INT reqMask)
if
(
mask
&
HDI_TEXT
&&
lpItem
->
pszText
!=
NULL
)
{
ERR
(
"(): function called without a call to FreeCallbackItems
\n
"
);
F
ree
(
lpItem
->
pszText
);
heap_f
ree
(
lpItem
->
pszText
);
lpItem
->
pszText
=
NULL
;
}
...
...
@@ -996,13 +997,13 @@ HEADER_PrepareCallbackItems(const HEADER_INFO *infoPtr, INT iItem, INT reqMask)
{
dispInfo
.
hdr
.
code
=
HDN_GETDISPINFOW
;
if
(
mask
&
HDI_TEXT
)
pvBuffer
=
Alloc
(
MAX_HEADER_TEXT_LEN
*
sizeof
(
WCHAR
));
pvBuffer
=
heap_alloc_zero
(
MAX_HEADER_TEXT_LEN
*
sizeof
(
WCHAR
));
}
else
{
dispInfo
.
hdr
.
code
=
HDN_GETDISPINFOA
;
if
(
mask
&
HDI_TEXT
)
pvBuffer
=
Alloc
(
MAX_HEADER_TEXT_LEN
*
sizeof
(
CHAR
));
pvBuffer
=
heap_alloc_zero
(
MAX_HEADER_TEXT_LEN
*
sizeof
(
CHAR
));
}
dispInfo
.
pszText
=
pvBuffer
;
dispInfo
.
cchTextMax
=
(
pvBuffer
!=
NULL
?
MAX_HEADER_TEXT_LEN
:
0
);
...
...
@@ -1033,7 +1034,7 @@ HEADER_PrepareCallbackItems(const HEADER_INFO *infoPtr, INT iItem, INT reqMask)
else
{
Str_SetPtrAtoW
(
&
lpItem
->
pszText
,
(
LPSTR
)
dispInfo
.
pszText
);
F
ree
(
pvBuffer
);
heap_f
ree
(
pvBuffer
);
}
}
...
...
@@ -1059,7 +1060,7 @@ HEADER_FreeCallbackItems(HEADER_ITEM *lpItem)
{
if
(
lpItem
->
callbackMask
&
HDI_TEXT
)
{
F
ree
(
lpItem
->
pszText
);
heap_f
ree
(
lpItem
->
pszText
);
lpItem
->
pszText
=
NULL
;
}
...
...
@@ -1181,15 +1182,15 @@ HEADER_DeleteItem (HEADER_INFO *infoPtr, INT iItem)
TRACE
(
"%d: order=%d, iOrder=%d, ->iOrder=%d
\n
"
,
i
,
infoPtr
->
order
[
i
],
infoPtr
->
items
[
i
].
iOrder
,
infoPtr
->
items
[
infoPtr
->
order
[
i
]].
iOrder
);
iOrder
=
infoPtr
->
items
[
iItem
].
iOrder
;
F
ree
(
infoPtr
->
items
[
iItem
].
pszText
);
heap_f
ree
(
infoPtr
->
items
[
iItem
].
pszText
);
infoPtr
->
uNumItem
--
;
memmove
(
&
infoPtr
->
items
[
iItem
],
&
infoPtr
->
items
[
iItem
+
1
],
(
infoPtr
->
uNumItem
-
iItem
)
*
sizeof
(
HEADER_ITEM
));
memmove
(
&
infoPtr
->
order
[
iOrder
],
&
infoPtr
->
order
[
iOrder
+
1
],
(
infoPtr
->
uNumItem
-
iOrder
)
*
sizeof
(
INT
));
infoPtr
->
items
=
ReA
lloc
(
infoPtr
->
items
,
sizeof
(
HEADER_ITEM
)
*
infoPtr
->
uNumItem
);
infoPtr
->
order
=
ReA
lloc
(
infoPtr
->
order
,
sizeof
(
INT
)
*
infoPtr
->
uNumItem
);
infoPtr
->
items
=
heap_rea
lloc
(
infoPtr
->
items
,
sizeof
(
HEADER_ITEM
)
*
infoPtr
->
uNumItem
);
infoPtr
->
order
=
heap_rea
lloc
(
infoPtr
->
order
,
sizeof
(
INT
)
*
infoPtr
->
uNumItem
);
/* Correct the orders */
for
(
i
=
0
;
i
<
infoPtr
->
uNumItem
;
i
++
)
...
...
@@ -1419,8 +1420,8 @@ HEADER_InsertItemT (HEADER_INFO *infoPtr, INT nItem, const HDITEMW *phdi, BOOL b
iOrder
=
infoPtr
->
uNumItem
;
infoPtr
->
uNumItem
++
;
infoPtr
->
items
=
ReA
lloc
(
infoPtr
->
items
,
sizeof
(
HEADER_ITEM
)
*
infoPtr
->
uNumItem
);
infoPtr
->
order
=
ReA
lloc
(
infoPtr
->
order
,
sizeof
(
INT
)
*
infoPtr
->
uNumItem
);
infoPtr
->
items
=
heap_rea
lloc
(
infoPtr
->
items
,
sizeof
(
HEADER_ITEM
)
*
infoPtr
->
uNumItem
);
infoPtr
->
order
=
heap_rea
lloc
(
infoPtr
->
order
,
sizeof
(
INT
)
*
infoPtr
->
uNumItem
);
/* make space for the new item */
memmove
(
&
infoPtr
->
items
[
nItem
+
1
],
&
infoPtr
->
items
[
nItem
],
...
...
@@ -1539,8 +1540,8 @@ HEADER_SetItemT (HEADER_INFO *infoPtr, INT nItem, const HDITEMW *phdi, BOOL bUni
HEADER_CopyHDItemForNotify
(
infoPtr
,
&
hdNotify
,
phdi
,
bUnicode
,
&
pvScratch
);
if
(
HEADER_SendNotifyWithHDItemT
(
infoPtr
,
HDN_ITEMCHANGINGW
,
nItem
,
&
hdNotify
))
{
F
ree
(
pvScratch
);
return
FALSE
;
heap_f
ree
(
pvScratch
);
return
FALSE
;
}
lpItem
=
&
infoPtr
->
items
[
nItem
];
...
...
@@ -1556,7 +1557,7 @@ HEADER_SetItemT (HEADER_INFO *infoPtr, INT nItem, const HDITEMW *phdi, BOOL bUni
InvalidateRect
(
infoPtr
->
hwndSelf
,
NULL
,
FALSE
);
F
ree
(
pvScratch
);
heap_f
ree
(
pvScratch
);
return
TRUE
;
}
...
...
@@ -1579,7 +1580,7 @@ HEADER_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
HFONT
hOldFont
;
HDC
hdc
;
infoPtr
=
Alloc
(
sizeof
(
HEADER_INFO
));
infoPtr
=
heap_alloc_zero
(
sizeof
(
*
infoPtr
));
SetWindowLongPtrW
(
hwnd
,
0
,
(
DWORD_PTR
)
infoPtr
);
infoPtr
->
hwndSelf
=
hwnd
;
...
...
@@ -1633,16 +1634,15 @@ HEADER_NCDestroy (HEADER_INFO *infoPtr)
if
(
infoPtr
->
items
)
{
lpItem
=
infoPtr
->
items
;
for
(
nItem
=
0
;
nItem
<
infoPtr
->
uNumItem
;
nItem
++
,
lpItem
++
)
{
Free
(
lpItem
->
pszText
);
}
Free
(
infoPtr
->
items
);
for
(
nItem
=
0
;
nItem
<
infoPtr
->
uNumItem
;
nItem
++
,
lpItem
++
)
heap_free
(
lpItem
->
pszText
);
heap_free
(
infoPtr
->
items
);
}
F
ree
(
infoPtr
->
order
);
heap_f
ree
(
infoPtr
->
order
);
SetWindowLongPtrW
(
infoPtr
->
hwndSelf
,
0
,
0
);
Free
(
infoPtr
);
heap_free
(
infoPtr
);
return
0
;
}
...
...
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