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
7de279a7
Commit
7de279a7
authored
Sep 22, 2003
by
Dimitrie O. Paun
Committed by
Alexandre Julliard
Sep 22, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename COMCTL32_{Alloc,ReAlloc,Free} to {Alloc,ReAlloc,Free}.
parent
0698b918
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
233 additions
and
238 deletions
+233
-238
animate.c
dlls/comctl32/animate.c
+2
-2
comboex.c
dlls/comctl32/comboex.c
+22
-22
comctl32.h
dlls/comctl32/comctl32.h
+0
-5
datetime.c
dlls/comctl32/datetime.c
+7
-7
header.c
dlls/comctl32/header.c
+21
-21
hotkey.c
dlls/comctl32/hotkey.c
+2
-2
imagelist.c
dlls/comctl32/imagelist.c
+2
-2
ipaddress.c
dlls/comctl32/ipaddress.c
+2
-2
listview.c
dlls/comctl32/listview.c
+29
-29
monthcal.c
dlls/comctl32/monthcal.c
+7
-7
nativefont.c
dlls/comctl32/nativefont.c
+2
-2
pager.c
dlls/comctl32/pager.c
+2
-2
progress.c
dlls/comctl32/progress.c
+2
-2
propsheet.c
dlls/comctl32/propsheet.c
+18
-18
rebar.c
dlls/comctl32/rebar.c
+23
-23
status.c
dlls/comctl32/status.c
+18
-18
tab.c
dlls/comctl32/tab.c
+13
-13
toolbar.c
dlls/comctl32/toolbar.c
+0
-0
tooltips.c
dlls/comctl32/tooltips.c
+30
-30
trackbar.c
dlls/comctl32/trackbar.c
+6
-6
treeview.c
dlls/comctl32/treeview.c
+20
-20
updown.c
dlls/comctl32/updown.c
+5
-5
No files found.
dlls/comctl32/animate.c
View file @
7de279a7
...
...
@@ -781,7 +781,7 @@ static LRESULT ANIMATE_Create(HWND hWnd, WPARAM wParam, LPARAM lParam)
}
/* allocate memory for info structure */
infoPtr
=
(
ANIMATE_INFO
*
)
COMCTL32_
Alloc
(
sizeof
(
ANIMATE_INFO
));
infoPtr
=
(
ANIMATE_INFO
*
)
Alloc
(
sizeof
(
ANIMATE_INFO
));
if
(
!
infoPtr
)
{
ERR
(
"could not allocate info memory!
\n
"
);
return
0
;
...
...
@@ -810,7 +810,7 @@ static LRESULT ANIMATE_Destroy(HWND hWnd, WPARAM wParam, LPARAM lParam)
ANIMATE_Free
(
infoPtr
);
/* free animate info data */
COMCTL32_
Free
(
infoPtr
);
Free
(
infoPtr
);
SetWindowLongA
(
hWnd
,
0
,
0
);
return
0
;
...
...
dlls/comctl32/comboex.c
View file @
7de279a7
...
...
@@ -212,7 +212,7 @@ COMBOEX_NotifyItem (COMBOEX_INFO *infoPtr, INT code, NMCOMBOBOXEXW *hdr)
if
((
hdr
->
ceItem
.
mask
&
CBEIF_TEXT
)
&&
is_textW
(
wstr
))
{
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
wstr
,
-
1
,
0
,
0
,
NULL
,
NULL
);
if
(
len
>
0
)
{
astr
=
(
LPSTR
)
COMCTL32_
Alloc
((
len
+
1
)
*
sizeof
(
CHAR
));
astr
=
(
LPSTR
)
Alloc
((
len
+
1
)
*
sizeof
(
CHAR
));
if
(
!
astr
)
return
0
;
WideCharToMultiByte
(
CP_ACP
,
0
,
wstr
,
-
1
,
astr
,
len
,
0
,
0
);
hdr
->
ceItem
.
pszText
=
(
LPWSTR
)
astr
;
...
...
@@ -228,7 +228,7 @@ COMBOEX_NotifyItem (COMBOEX_INFO *infoPtr, INT code, NMCOMBOBOXEXW *hdr)
if
(
astr
&&
hdr
->
ceItem
.
pszText
==
(
LPWSTR
)
astr
)
hdr
->
ceItem
.
pszText
=
wstr
;
if
(
astr
)
COMCTL32_
Free
(
astr
);
if
(
astr
)
Free
(
astr
);
return
ret
;
}
...
...
@@ -277,9 +277,9 @@ static void COMBOEX_NotifyDragBegin(COMBOEX_INFO *infoPtr, LPCWSTR wstr)
static
void
COMBOEX_FreeText
(
CBE_ITEMDATA
*
item
)
{
if
(
is_textW
(
item
->
pszText
))
COMCTL32_
Free
(
item
->
pszText
);
if
(
is_textW
(
item
->
pszText
))
Free
(
item
->
pszText
);
item
->
pszText
=
0
;
if
(
item
->
pszTemp
)
COMCTL32_
Free
(
item
->
pszTemp
);
if
(
item
->
pszTemp
)
Free
(
item
->
pszTemp
);
item
->
pszTemp
=
0
;
}
...
...
@@ -300,14 +300,14 @@ static LPCWSTR COMBOEX_GetText(COMBOEX_INFO *infoPtr, CBE_ITEMDATA *item)
if
(
is_textW
(
nmce
.
ceItem
.
pszText
))
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
(
LPSTR
)
nmce
.
ceItem
.
pszText
,
-
1
,
NULL
,
0
);
buf
=
(
LPWSTR
)
COMCTL32_
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
buf
=
(
LPWSTR
)
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
buf
)
MultiByteToWideChar
(
CP_ACP
,
0
,
(
LPSTR
)
nmce
.
ceItem
.
pszText
,
-
1
,
buf
,
len
);
if
(
nmce
.
ceItem
.
mask
&
CBEIF_DI_SETITEM
)
{
COMBOEX_FreeText
(
item
);
item
->
pszText
=
buf
;
}
else
{
if
(
item
->
pszTemp
)
COMCTL32_
Free
(
item
->
pszTemp
);
if
(
item
->
pszTemp
)
Free
(
item
->
pszTemp
);
item
->
pszTemp
=
buf
;
}
text
=
buf
;
...
...
@@ -569,7 +569,7 @@ static INT COMBOEX_InsertItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit)
if
(
index
>
infoPtr
->
nb_items
)
index
=
infoPtr
->
nb_items
;
/* get zero-filled space and chain it in */
if
(
!
(
item
=
(
CBE_ITEMDATA
*
)
COMCTL32_
Alloc
(
sizeof
(
*
item
))))
return
-
1
;
if
(
!
(
item
=
(
CBE_ITEMDATA
*
)
Alloc
(
sizeof
(
*
item
))))
return
-
1
;
/* locate position to insert new item in */
if
(
index
==
infoPtr
->
nb_items
)
{
...
...
@@ -587,7 +587,7 @@ static INT COMBOEX_InsertItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit)
}
if
(
!
moving
)
{
ERR
(
"COMBOBOXEX item structures broken. Please report!
\n
"
);
COMCTL32_
Free
(
item
);
Free
(
item
);
return
-
1
;
}
item
->
next
=
moving
->
next
;
...
...
@@ -601,9 +601,9 @@ static INT COMBOEX_InsertItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit)
if
(
is_textW
(
cit
->
pszText
))
len
=
strlenW
(
cit
->
pszText
);
if
(
len
>
0
)
{
item
->
pszText
=
(
LPWSTR
)
COMCTL32_
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
item
->
pszText
=
(
LPWSTR
)
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
item
->
pszText
)
{
COMCTL32_
Free
(
item
);
Free
(
item
);
return
-
1
;
}
strcpyW
(
item
->
pszText
,
cit
->
pszText
);
...
...
@@ -647,14 +647,14 @@ static INT COMBOEX_InsertItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA *cit)
memcpy
(
&
citW
,
cit
,
sizeof
(
COMBOBOXEXITEMA
));
if
(
cit
->
mask
&
CBEIF_TEXT
&&
is_textA
(
cit
->
pszText
))
{
INT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
cit
->
pszText
,
-
1
,
NULL
,
0
);
wstr
=
(
LPWSTR
)
COMCTL32_
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
wstr
=
(
LPWSTR
)
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
wstr
)
return
-
1
;
MultiByteToWideChar
(
CP_ACP
,
0
,
cit
->
pszText
,
-
1
,
wstr
,
len
);
citW
.
pszText
=
wstr
;
}
ret
=
COMBOEX_InsertItemW
(
infoPtr
,
&
citW
);
if
(
wstr
)
COMCTL32_
Free
(
wstr
);
if
(
wstr
)
Free
(
wstr
);
return
ret
;
}
...
...
@@ -736,7 +736,7 @@ static BOOL COMBOEX_SetItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit)
COMBOEX_FreeText
(
item
);
if
(
is_textW
(
cit
->
pszText
))
len
=
strlenW
(
cit
->
pszText
);
if
(
len
>
0
)
{
item
->
pszText
=
(
LPWSTR
)
COMCTL32_
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
item
->
pszText
=
(
LPWSTR
)
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
item
->
pszText
)
return
FALSE
;
strcpyW
(
item
->
pszText
,
cit
->
pszText
);
}
else
if
(
cit
->
pszText
==
LPSTR_TEXTCALLBACKW
)
...
...
@@ -773,14 +773,14 @@ static BOOL COMBOEX_SetItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA *cit)
memcpy
(
&
citW
,
cit
,
sizeof
(
COMBOBOXEXITEMA
));
if
((
cit
->
mask
&
CBEIF_TEXT
)
&&
is_textA
(
cit
->
pszText
))
{
INT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
cit
->
pszText
,
-
1
,
NULL
,
0
);
wstr
=
(
LPWSTR
)
COMCTL32_
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
wstr
=
(
LPWSTR
)
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
wstr
)
return
FALSE
;
MultiByteToWideChar
(
CP_ACP
,
0
,
cit
->
pszText
,
-
1
,
wstr
,
len
);
citW
.
pszText
=
wstr
;
}
ret
=
COMBOEX_SetItemW
(
infoPtr
,
&
citW
);
if
(
wstr
)
COMCTL32_
Free
(
wstr
);
if
(
wstr
)
Free
(
wstr
);
return
ret
;
}
...
...
@@ -925,7 +925,7 @@ static LRESULT COMBOEX_Create (HWND hwnd, LPCREATESTRUCTA cs)
INT
i
;
/* allocate memory for info structure */
infoPtr
=
(
COMBOEX_INFO
*
)
COMCTL32_
Alloc
(
sizeof
(
COMBOEX_INFO
));
infoPtr
=
(
COMBOEX_INFO
*
)
Alloc
(
sizeof
(
COMBOEX_INFO
));
if
(
!
infoPtr
)
return
-
1
;
/* initialize info structure */
...
...
@@ -1060,7 +1060,7 @@ static LRESULT COMBOEX_Create (HWND hwnd, LPCREATESTRUCTA cs)
* Create an item structure to represent the data in the
* EDIT control. It is allocated zero-filled.
*/
infoPtr
->
edit
=
(
CBE_ITEMDATA
*
)
COMCTL32_
Alloc
(
sizeof
(
CBE_ITEMDATA
));
infoPtr
->
edit
=
(
CBE_ITEMDATA
*
)
Alloc
(
sizeof
(
CBE_ITEMDATA
));
if
(
!
infoPtr
->
edit
)
{
COMBOEX_Destroy
(
infoPtr
);
return
-
1
;
...
...
@@ -1273,7 +1273,7 @@ static BOOL COMBOEX_WM_DeleteItem (COMBOEX_INFO *infoPtr, DELETEITEMSTRUCT *dis)
COMBOEX_NotifyItem
(
infoPtr
,
CBEN_DELETEITEM
,
&
nmcit
);
COMBOEX_FreeText
(
olditem
);
COMCTL32_
Free
(
olditem
);
Free
(
olditem
);
return
TRUE
;
}
...
...
@@ -1360,7 +1360,7 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT *dis)
item
->
mask
&=
~
CBEIF_TEXT
;
if
(
(
len
=
GetWindowTextLengthW
(
infoPtr
->
hwndEdit
))
)
{
item
->
mask
|=
CBEIF_TEXT
;
item
->
pszText
=
(
LPWSTR
)
COMCTL32_
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
item
->
pszText
=
(
LPWSTR
)
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
item
->
pszText
)
GetWindowTextW
(
infoPtr
->
hwndEdit
,
item
->
pszText
,
len
+
1
);
...
...
@@ -1524,7 +1524,7 @@ static LRESULT COMBOEX_Destroy (COMBOEX_INFO *infoPtr)
DestroyWindow
(
infoPtr
->
hwndCombo
);
if
(
infoPtr
->
edit
)
{
COMCTL32_
Free
(
infoPtr
->
edit
);
Free
(
infoPtr
->
edit
);
infoPtr
->
edit
=
0
;
}
...
...
@@ -1535,7 +1535,7 @@ static LRESULT COMBOEX_Destroy (COMBOEX_INFO *infoPtr)
while
(
item
)
{
next
=
(
CBE_ITEMDATA
*
)
item
->
next
;
COMBOEX_FreeText
(
item
);
COMCTL32_
Free
(
item
);
Free
(
item
);
item
=
next
;
}
infoPtr
->
items
=
0
;
...
...
@@ -1545,7 +1545,7 @@ static LRESULT COMBOEX_Destroy (COMBOEX_INFO *infoPtr)
DeleteObject
(
infoPtr
->
defaultFont
);
/* free comboex info data */
COMCTL32_
Free
(
infoPtr
);
Free
(
infoPtr
);
SetWindowLongW
(
infoPtr
->
hwndSelf
,
0
,
0
);
return
0
;
}
...
...
dlls/comctl32/comctl32.h
View file @
7de279a7
...
...
@@ -162,11 +162,6 @@ LPVOID WINAPI ReAlloc (LPVOID, DWORD);
BOOL
WINAPI
Free
(
LPVOID
);
DWORD
WINAPI
GetSize
(
LPVOID
);
/* for compatibility with old code */
#define COMCTL32_Alloc(size) Alloc(size)
#define COMCTL32_ReAlloc(ptr,size) ReAlloc(ptr,size)
#define COMCTL32_Free(ptr) Free(ptr)
INT
WINAPI
Str_GetPtrA
(
LPCSTR
,
LPSTR
,
INT
);
INT
WINAPI
Str_GetPtrW
(
LPCWSTR
,
LPWSTR
,
INT
);
...
...
dlls/comctl32/datetime.c
View file @
7de279a7
...
...
@@ -356,10 +356,10 @@ DATETIME_SetFormatW (HWND hwnd, WPARAM wParam, LPARAM lParam)
int
retval
;
int
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
(
LPWSTR
)
lParam
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
buf
=
(
LPSTR
)
COMCTL32_
Alloc
(
len
);
buf
=
(
LPSTR
)
Alloc
(
len
);
WideCharToMultiByte
(
CP_ACP
,
0
,
(
LPWSTR
)
lParam
,
-
1
,
buf
,
len
,
NULL
,
NULL
);
retval
=
DATETIME_SetFormat
(
hwnd
,
0
,
(
LPARAM
)
buf
);
COMCTL32_
Free
(
buf
);
Free
(
buf
);
return
retval
;
}
else
...
...
@@ -1196,7 +1196,7 @@ DATETIME_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
/* allocate memory for info structure */
TRACE
(
"%04x %08lx
\n
"
,
wParam
,
lParam
);
infoPtr
=
(
DATETIME_INFO
*
)
COMCTL32_
Alloc
(
sizeof
(
DATETIME_INFO
));
infoPtr
=
(
DATETIME_INFO
*
)
Alloc
(
sizeof
(
DATETIME_INFO
));
if
(
infoPtr
==
NULL
)
{
ERR
(
"could not allocate info memory!
\n
"
);
return
0
;
...
...
@@ -1221,9 +1221,9 @@ DATETIME_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
UD_MAXVAL
,
UD_MINVAL
,
0
);
}
infoPtr
->
fieldspec
=
(
int
*
)
COMCTL32_
Alloc
(
32
*
sizeof
(
int
));
infoPtr
->
fieldRect
=
(
RECT
*
)
COMCTL32_
Alloc
(
32
*
sizeof
(
RECT
));
infoPtr
->
buflen
=
(
int
*
)
COMCTL32_
Alloc
(
32
*
sizeof
(
int
));
infoPtr
->
fieldspec
=
(
int
*
)
Alloc
(
32
*
sizeof
(
int
));
infoPtr
->
fieldRect
=
(
RECT
*
)
Alloc
(
32
*
sizeof
(
RECT
));
infoPtr
->
buflen
=
(
int
*
)
Alloc
(
32
*
sizeof
(
int
));
infoPtr
->
nrFieldsAllocated
=
32
;
DATETIME_SetFormat
(
hwnd
,
0
,
0
);
...
...
@@ -1249,7 +1249,7 @@ DATETIME_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
DATETIME_INFO
*
infoPtr
=
DATETIME_GetInfoPtr
(
hwnd
);
TRACE
(
"
\n
"
);
COMCTL32_
Free
(
infoPtr
);
Free
(
infoPtr
);
SetWindowLongA
(
hwnd
,
0
,
0
);
return
0
;
}
...
...
dlls/comctl32/header.c
View file @
7de279a7
...
...
@@ -599,8 +599,8 @@ HEADER_DeleteItem (HWND hwnd, WPARAM wParam)
if
(
infoPtr
->
uNumItem
==
1
)
{
TRACE
(
"Simple delete!
\n
"
);
if
(
infoPtr
->
items
[
0
].
pszText
)
COMCTL32_
Free
(
infoPtr
->
items
[
0
].
pszText
);
COMCTL32_
Free
(
infoPtr
->
items
);
Free
(
infoPtr
->
items
[
0
].
pszText
);
Free
(
infoPtr
->
items
);
infoPtr
->
items
=
0
;
infoPtr
->
uNumItem
=
0
;
}
...
...
@@ -612,11 +612,11 @@ HEADER_DeleteItem (HWND hwnd, WPARAM wParam)
TRACE
(
"Complex delete! [iItem=%d]
\n
"
,
iItem
);
if
(
infoPtr
->
items
[
iItem
].
pszText
)
COMCTL32_
Free
(
infoPtr
->
items
[
iItem
].
pszText
);
Free
(
infoPtr
->
items
[
iItem
].
pszText
);
iOrder
=
infoPtr
->
items
[
iItem
].
iOrder
;
infoPtr
->
uNumItem
--
;
infoPtr
->
items
=
COMCTL32_
Alloc
(
sizeof
(
HEADER_ITEM
)
*
infoPtr
->
uNumItem
);
infoPtr
->
items
=
Alloc
(
sizeof
(
HEADER_ITEM
)
*
infoPtr
->
uNumItem
);
/* pre delete copy */
if
(
iItem
>
0
)
{
memcpy
(
&
infoPtr
->
items
[
0
],
&
oldItems
[
0
],
...
...
@@ -635,7 +635,7 @@ HEADER_DeleteItem (HWND hwnd, WPARAM wParam)
if
(
pItem
->
iOrder
>
iOrder
)
pItem
->
iOrder
--
;
}
COMCTL32_
Free
(
oldItems
);
Free
(
oldItems
);
}
HEADER_SetItemBounds
(
hwnd
);
...
...
@@ -861,14 +861,14 @@ HEADER_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
iOrder
=
(
phdi
->
mask
&
HDI_ORDER
)
?
phdi
->
iOrder
:
nItem
;
if
(
infoPtr
->
uNumItem
==
0
)
{
infoPtr
->
items
=
COMCTL32_
Alloc
(
sizeof
(
HEADER_ITEM
));
infoPtr
->
items
=
Alloc
(
sizeof
(
HEADER_ITEM
));
infoPtr
->
uNumItem
++
;
}
else
{
HEADER_ITEM
*
oldItems
=
infoPtr
->
items
;
infoPtr
->
uNumItem
++
;
infoPtr
->
items
=
COMCTL32_
Alloc
(
sizeof
(
HEADER_ITEM
)
*
infoPtr
->
uNumItem
);
infoPtr
->
items
=
Alloc
(
sizeof
(
HEADER_ITEM
)
*
infoPtr
->
uNumItem
);
if
(
nItem
==
0
)
{
memcpy
(
&
infoPtr
->
items
[
1
],
&
oldItems
[
0
],
(
infoPtr
->
uNumItem
-
1
)
*
sizeof
(
HEADER_ITEM
));
...
...
@@ -888,7 +888,7 @@ HEADER_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
}
}
COMCTL32_
Free
(
oldItems
);
Free
(
oldItems
);
}
for
(
i
=
0
;
i
<
infoPtr
->
uNumItem
;
i
++
)
...
...
@@ -908,7 +908,7 @@ HEADER_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
phdi
->
pszText
=
""
;
if
(
phdi
->
pszText
!=
LPSTR_TEXTCALLBACKA
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
phdi
->
pszText
,
-
1
,
NULL
,
0
);
lpItem
->
pszText
=
COMCTL32_
Alloc
(
len
*
sizeof
(
WCHAR
)
);
lpItem
->
pszText
=
Alloc
(
len
*
sizeof
(
WCHAR
)
);
MultiByteToWideChar
(
CP_ACP
,
0
,
phdi
->
pszText
,
-
1
,
lpItem
->
pszText
,
len
);
}
else
...
...
@@ -962,14 +962,14 @@ HEADER_InsertItemW (HWND hwnd, WPARAM wParam, LPARAM lParam)
iOrder
=
(
phdi
->
mask
&
HDI_ORDER
)
?
phdi
->
iOrder
:
nItem
;
if
(
infoPtr
->
uNumItem
==
0
)
{
infoPtr
->
items
=
COMCTL32_
Alloc
(
sizeof
(
HEADER_ITEM
));
infoPtr
->
items
=
Alloc
(
sizeof
(
HEADER_ITEM
));
infoPtr
->
uNumItem
++
;
}
else
{
HEADER_ITEM
*
oldItems
=
infoPtr
->
items
;
infoPtr
->
uNumItem
++
;
infoPtr
->
items
=
COMCTL32_
Alloc
(
sizeof
(
HEADER_ITEM
)
*
infoPtr
->
uNumItem
);
infoPtr
->
items
=
Alloc
(
sizeof
(
HEADER_ITEM
)
*
infoPtr
->
uNumItem
);
if
(
nItem
==
0
)
{
memcpy
(
&
infoPtr
->
items
[
1
],
&
oldItems
[
0
],
(
infoPtr
->
uNumItem
-
1
)
*
sizeof
(
HEADER_ITEM
));
...
...
@@ -989,7 +989,7 @@ HEADER_InsertItemW (HWND hwnd, WPARAM wParam, LPARAM lParam)
}
}
COMCTL32_
Free
(
oldItems
);
Free
(
oldItems
);
}
for
(
i
=
0
;
i
<
infoPtr
->
uNumItem
;
i
++
)
...
...
@@ -1010,7 +1010,7 @@ HEADER_InsertItemW (HWND hwnd, WPARAM wParam, LPARAM lParam)
phdi
->
pszText
=
&
wide_null_char
;
if
(
phdi
->
pszText
!=
LPSTR_TEXTCALLBACKW
)
{
len
=
strlenW
(
phdi
->
pszText
);
lpItem
->
pszText
=
COMCTL32_
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
lpItem
->
pszText
=
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
strcpyW
(
lpItem
->
pszText
,
phdi
->
pszText
);
}
else
...
...
@@ -1122,12 +1122,12 @@ HEADER_SetItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
if
(
phdi
->
mask
&
HDI_TEXT
)
{
if
(
phdi
->
pszText
!=
LPSTR_TEXTCALLBACKA
)
{
if
(
lpItem
->
pszText
)
{
COMCTL32_
Free
(
lpItem
->
pszText
);
Free
(
lpItem
->
pszText
);
lpItem
->
pszText
=
NULL
;
}
if
(
phdi
->
pszText
)
{
INT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
phdi
->
pszText
,
-
1
,
NULL
,
0
);
lpItem
->
pszText
=
COMCTL32_
Alloc
(
len
*
sizeof
(
WCHAR
)
);
lpItem
->
pszText
=
Alloc
(
len
*
sizeof
(
WCHAR
)
);
MultiByteToWideChar
(
CP_ACP
,
0
,
phdi
->
pszText
,
-
1
,
lpItem
->
pszText
,
len
);
}
}
...
...
@@ -1189,12 +1189,12 @@ HEADER_SetItemW (HWND hwnd, WPARAM wParam, LPARAM lParam)
if
(
phdi
->
mask
&
HDI_TEXT
)
{
if
(
phdi
->
pszText
!=
LPSTR_TEXTCALLBACKW
)
{
if
(
lpItem
->
pszText
)
{
COMCTL32_
Free
(
lpItem
->
pszText
);
Free
(
lpItem
->
pszText
);
lpItem
->
pszText
=
NULL
;
}
if
(
phdi
->
pszText
)
{
INT
len
=
strlenW
(
phdi
->
pszText
);
lpItem
->
pszText
=
COMCTL32_
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
lpItem
->
pszText
=
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
strcpyW
(
lpItem
->
pszText
,
phdi
->
pszText
);
}
}
...
...
@@ -1244,7 +1244,7 @@ HEADER_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
HFONT
hOldFont
;
HDC
hdc
;
infoPtr
=
(
HEADER_INFO
*
)
COMCTL32_
Alloc
(
sizeof
(
HEADER_INFO
));
infoPtr
=
(
HEADER_INFO
*
)
Alloc
(
sizeof
(
HEADER_INFO
));
SetWindowLongA
(
hwnd
,
0
,
(
DWORD
)
infoPtr
);
infoPtr
->
hwndNotify
=
GetParent
(
hwnd
);
...
...
@@ -1286,15 +1286,15 @@ HEADER_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
lpItem
=
infoPtr
->
items
;
for
(
nItem
=
0
;
nItem
<
infoPtr
->
uNumItem
;
nItem
++
,
lpItem
++
)
{
if
((
lpItem
->
pszText
)
&&
(
lpItem
->
pszText
!=
LPSTR_TEXTCALLBACKW
))
COMCTL32_
Free
(
lpItem
->
pszText
);
Free
(
lpItem
->
pszText
);
}
COMCTL32_
Free
(
infoPtr
->
items
);
Free
(
infoPtr
->
items
);
}
if
(
infoPtr
->
himl
)
ImageList_Destroy
(
infoPtr
->
himl
);
COMCTL32_
Free
(
infoPtr
);
Free
(
infoPtr
);
SetWindowLongA
(
hwnd
,
0
,
0
);
return
0
;
}
...
...
dlls/comctl32/hotkey.c
View file @
7de279a7
...
...
@@ -215,7 +215,7 @@ HOTKEY_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
HDC
hdc
;
/* allocate memory for info structure */
infoPtr
=
(
HOTKEY_INFO
*
)
COMCTL32_
Alloc
(
sizeof
(
HOTKEY_INFO
));
infoPtr
=
(
HOTKEY_INFO
*
)
Alloc
(
sizeof
(
HOTKEY_INFO
));
SetWindowLongW
(
hwnd
,
0
,
(
DWORD
)
infoPtr
);
/* initialize info structure */
...
...
@@ -239,7 +239,7 @@ HOTKEY_Destroy (HOTKEY_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
HWND
hwnd
=
infoPtr
->
hwndSelf
;
/* free hotkey info data */
COMCTL32_
Free
(
infoPtr
);
Free
(
infoPtr
);
SetWindowLongW
(
hwnd
,
0
,
0
);
return
0
;
}
...
...
dlls/comctl32/imagelist.c
View file @
7de279a7
...
...
@@ -553,7 +553,7 @@ ImageList_Create (INT cx, INT cy, UINT flags,
TRACE
(
"(%d %d 0x%x %d %d)
\n
"
,
cx
,
cy
,
flags
,
cInitial
,
cGrow
);
himl
=
(
HIMAGELIST
)
COMCTL32_
Alloc
(
sizeof
(
struct
_IMAGELIST
));
himl
=
(
HIMAGELIST
)
Alloc
(
sizeof
(
struct
_IMAGELIST
));
if
(
!
himl
)
return
NULL
;
...
...
@@ -665,7 +665,7 @@ ImageList_Destroy (HIMAGELIST himl)
DeleteObject
(
himl
->
hbrBlend50
);
ZeroMemory
(
himl
,
sizeof
(
*
himl
));
COMCTL32_
Free
(
himl
);
Free
(
himl
);
return
TRUE
;
}
...
...
dlls/comctl32/ipaddress.c
View file @
7de279a7
...
...
@@ -161,7 +161,7 @@ static LRESULT IPADDRESS_Create (HWND hwnd)
SetWindowLongW
(
hwnd
,
GWL_STYLE
,
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
~
WS_BORDER
);
infoPtr
=
(
IPADDRESS_INFO
*
)
COMCTL32_
Alloc
(
sizeof
(
IPADDRESS_INFO
));
infoPtr
=
(
IPADDRESS_INFO
*
)
Alloc
(
sizeof
(
IPADDRESS_INFO
));
if
(
!
infoPtr
)
return
-
1
;
SetWindowLongW
(
hwnd
,
0
,
(
DWORD
)
infoPtr
);
...
...
@@ -208,7 +208,7 @@ static LRESULT IPADDRESS_Destroy (IPADDRESS_INFO *infoPtr)
}
SetWindowLongW
(
infoPtr
->
Self
,
0
,
0
);
COMCTL32_
Free
(
infoPtr
);
Free
(
infoPtr
);
return
0
;
}
...
...
dlls/comctl32/listview.c
View file @
7de279a7
...
...
@@ -465,7 +465,7 @@ static BOOL textsetptrT(LPWSTR *dest, LPWSTR src, BOOL isW)
if
(
src
==
LPSTR_TEXTCALLBACKW
)
{
if
(
is_textW
(
*
dest
))
COMCTL32_
Free
(
*
dest
);
if
(
is_textW
(
*
dest
))
Free
(
*
dest
);
*
dest
=
LPSTR_TEXTCALLBACKW
;
}
else
...
...
@@ -2519,11 +2519,11 @@ static void ranges_assert(RANGES ranges, LPCSTR desc, const char *func, int line
static
RANGES
ranges_create
(
int
count
)
{
RANGES
ranges
=
(
RANGES
)
COMCTL32_
Alloc
(
sizeof
(
struct
tagRANGES
));
RANGES
ranges
=
(
RANGES
)
Alloc
(
sizeof
(
struct
tagRANGES
));
if
(
!
ranges
)
return
NULL
;
ranges
->
hdpa
=
DPA_Create
(
count
);
if
(
ranges
->
hdpa
)
return
ranges
;
COMCTL32_
Free
(
ranges
);
Free
(
ranges
);
return
NULL
;
}
...
...
@@ -2532,7 +2532,7 @@ static void ranges_clear(RANGES ranges)
INT
i
;
for
(
i
=
0
;
i
<
DPA_GetPtrCount
(
ranges
->
hdpa
);
i
++
)
COMCTL32_
Free
(
DPA_GetPtr
(
ranges
->
hdpa
,
i
));
Free
(
DPA_GetPtr
(
ranges
->
hdpa
,
i
));
DPA_DeleteAllPtrs
(
ranges
->
hdpa
);
}
...
...
@@ -2542,7 +2542,7 @@ static void ranges_destroy(RANGES ranges)
if
(
!
ranges
)
return
;
ranges_clear
(
ranges
);
DPA_Destroy
(
ranges
->
hdpa
);
COMCTL32_
Free
(
ranges
);
Free
(
ranges
);
}
static
RANGES
ranges_clone
(
RANGES
ranges
)
...
...
@@ -2554,7 +2554,7 @@ static RANGES ranges_clone(RANGES ranges)
for
(
i
=
0
;
i
<
DPA_GetPtrCount
(
ranges
->
hdpa
);
i
++
)
{
RANGE
*
newrng
=
(
RANGE
*
)
COMCTL32_
Alloc
(
sizeof
(
RANGE
));
RANGE
*
newrng
=
(
RANGE
*
)
Alloc
(
sizeof
(
RANGE
));
if
(
!
newrng
)
goto
fail
;
*
newrng
=
*
((
RANGE
*
)
DPA_GetPtr
(
ranges
->
hdpa
,
i
));
DPA_SetPtr
(
clone
->
hdpa
,
i
,
newrng
);
...
...
@@ -2646,7 +2646,7 @@ static BOOL ranges_add(RANGES ranges, RANGE range)
TRACE
(
"Adding new range
\n
"
);
/* create the brand new range to insert */
newrgn
=
(
RANGE
*
)
COMCTL32_
Alloc
(
sizeof
(
RANGE
));
newrgn
=
(
RANGE
*
)
Alloc
(
sizeof
(
RANGE
));
if
(
!
newrgn
)
goto
fail
;
*
newrgn
=
range
;
...
...
@@ -2658,7 +2658,7 @@ static BOOL ranges_add(RANGES ranges, RANGE range)
/* and get it over with */
if
(
DPA_InsertPtr
(
ranges
->
hdpa
,
index
,
newrgn
)
==
-
1
)
{
COMCTL32_
Free
(
newrgn
);
Free
(
newrgn
);
goto
fail
;
}
}
...
...
@@ -2695,7 +2695,7 @@ static BOOL ranges_add(RANGES ranges, RANGE range)
mrgrgn
=
DPA_GetPtr
(
ranges
->
hdpa
,
mergeindex
);
chkrgn
->
lower
=
min
(
chkrgn
->
lower
,
mrgrgn
->
lower
);
chkrgn
->
upper
=
max
(
chkrgn
->
upper
,
mrgrgn
->
upper
);
COMCTL32_
Free
(
mrgrgn
);
Free
(
mrgrgn
);
DPA_DeletePtr
(
ranges
->
hdpa
,
mergeindex
);
if
(
mergeindex
<
index
)
index
--
;
}
while
(
1
);
...
...
@@ -2757,13 +2757,13 @@ static BOOL ranges_del(RANGES ranges, RANGE range)
{
RANGE
tmprgn
=
*
chkrgn
,
*
newrgn
;
if
(
!
(
newrgn
=
(
RANGE
*
)
COMCTL32_
Alloc
(
sizeof
(
RANGE
))))
goto
fail
;
if
(
!
(
newrgn
=
(
RANGE
*
)
Alloc
(
sizeof
(
RANGE
))))
goto
fail
;
newrgn
->
lower
=
chkrgn
->
lower
;
newrgn
->
upper
=
range
.
lower
;
chkrgn
->
lower
=
range
.
upper
;
if
(
DPA_InsertPtr
(
ranges
->
hdpa
,
index
,
newrgn
)
==
-
1
)
{
COMCTL32_
Free
(
newrgn
);
Free
(
newrgn
);
goto
fail
;
}
chkrgn
=
&
tmprgn
;
...
...
@@ -3374,7 +3374,7 @@ static BOOL set_sub_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL i
SUBITEM_INFO
*
tmpSubItem
;
INT
i
;
lpSubItem
=
(
SUBITEM_INFO
*
)
COMCTL32_
Alloc
(
sizeof
(
SUBITEM_INFO
));
lpSubItem
=
(
SUBITEM_INFO
*
)
Alloc
(
sizeof
(
SUBITEM_INFO
));
if
(
!
lpSubItem
)
return
FALSE
;
/* we could binary search here, if need be...*/
for
(
i
=
1
;
i
<
DPA_GetPtrCount
(
hdpaSubItems
);
i
++
)
...
...
@@ -3384,7 +3384,7 @@ static BOOL set_sub_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL i
}
if
(
DPA_InsertPtr
(
hdpaSubItems
,
i
,
lpSubItem
)
==
-
1
)
{
COMCTL32_
Free
(
lpSubItem
);
Free
(
lpSubItem
);
return
FALSE
;
}
lpSubItem
->
iSubItem
=
lpLVItem
->
iSubItem
;
...
...
@@ -4047,8 +4047,8 @@ static BOOL LISTVIEW_DeleteAllItems(LISTVIEW_INFO *infoPtr)
for
(
j
=
0
;
j
<
DPA_GetPtrCount
(
hdpaSubItems
);
j
++
)
{
hdrItem
=
(
ITEMHDR
*
)
DPA_GetPtr
(
hdpaSubItems
,
j
);
if
(
is_textW
(
hdrItem
->
pszText
))
COMCTL32_
Free
(
hdrItem
->
pszText
);
COMCTL32_
Free
(
hdrItem
);
if
(
is_textW
(
hdrItem
->
pszText
))
Free
(
hdrItem
->
pszText
);
Free
(
hdrItem
);
}
DPA_Destroy
(
hdpaSubItems
);
DPA_DeletePtr
(
infoPtr
->
hdpaItems
,
i
);
...
...
@@ -4152,7 +4152,7 @@ static BOOL LISTVIEW_DeleteColumn(LISTVIEW_INFO *infoPtr, INT nColumn)
if
(
!
Header_DeleteItem
(
infoPtr
->
hwndHeader
,
nColumn
))
return
FALSE
;
COMCTL32_
Free
(
DPA_GetPtr
(
infoPtr
->
hdpaColumns
,
nColumn
));
Free
(
DPA_GetPtr
(
infoPtr
->
hdpaColumns
,
nColumn
));
DPA_DeletePtr
(
infoPtr
->
hdpaColumns
,
nColumn
);
if
(
!
(
infoPtr
->
dwStyle
&
LVS_OWNERDATA
))
...
...
@@ -4188,10 +4188,10 @@ static BOOL LISTVIEW_DeleteColumn(LISTVIEW_INFO *infoPtr, INT nColumn)
{
/* free string */
if
(
is_textW
(
lpDelItem
->
hdr
.
pszText
))
COMCTL32_
Free
(
lpDelItem
->
hdr
.
pszText
);
Free
(
lpDelItem
->
hdr
.
pszText
);
/* free item */
COMCTL32_
Free
(
lpDelItem
);
Free
(
lpDelItem
);
/* free dpa memory */
DPA_DeletePtr
(
hdpaSubItems
,
nSubItem
);
...
...
@@ -4324,8 +4324,8 @@ static BOOL LISTVIEW_DeleteItem(LISTVIEW_INFO *infoPtr, INT nItem)
for
(
i
=
0
;
i
<
DPA_GetPtrCount
(
hdpaSubItems
);
i
++
)
{
hdrItem
=
(
ITEMHDR
*
)
DPA_GetPtr
(
hdpaSubItems
,
i
);
if
(
is_textW
(
hdrItem
->
pszText
))
COMCTL32_
Free
(
hdrItem
->
pszText
);
COMCTL32_
Free
(
hdrItem
);
if
(
is_textW
(
hdrItem
->
pszText
))
Free
(
hdrItem
->
pszText
);
Free
(
hdrItem
);
}
DPA_Destroy
(
hdpaSubItems
);
}
...
...
@@ -5955,7 +5955,7 @@ static INT LISTVIEW_InsertItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
if
(
!
is_assignable_item
(
lpLVItem
,
infoPtr
->
dwStyle
))
return
-
1
;
if
(
!
(
lpItem
=
(
ITEM_INFO
*
)
COMCTL32_
Alloc
(
sizeof
(
ITEM_INFO
)))
)
if
(
!
(
lpItem
=
(
ITEM_INFO
*
)
Alloc
(
sizeof
(
ITEM_INFO
)))
)
return
-
1
;
/* insert item in listview control data structure */
...
...
@@ -6044,7 +6044,7 @@ undo:
fail:
DPA_DeletePtr
(
hdpaSubItems
,
0
);
DPA_Destroy
(
hdpaSubItems
);
COMCTL32_
Free
(
lpItem
);
Free
(
lpItem
);
return
-
1
;
}
...
...
@@ -6270,7 +6270,7 @@ static INT LISTVIEW_InsertColumnT(LISTVIEW_INFO *infoPtr, INT nColumn,
if
(
nNewColumn
!=
nColumn
)
ERR
(
"nColumn=%d, nNewColumn=%d
\n
"
,
nColumn
,
nNewColumn
);
/* create our own column info */
if
(
!
(
lpColumnInfo
=
COMCTL32_
Alloc
(
sizeof
(
COLUMN_INFO
))))
goto
fail
;
if
(
!
(
lpColumnInfo
=
Alloc
(
sizeof
(
COLUMN_INFO
))))
goto
fail
;
if
(
DPA_InsertPtr
(
infoPtr
->
hdpaColumns
,
nNewColumn
,
lpColumnInfo
)
==
-
1
)
goto
fail
;
if
(
lpColumn
->
mask
&
LVCF_FMT
)
lpColumnInfo
->
fmt
=
lpColumn
->
fmt
;
...
...
@@ -6305,7 +6305,7 @@ fail:
if
(
lpColumnInfo
)
{
DPA_DeletePtr
(
infoPtr
->
hdpaColumns
,
nNewColumn
);
COMCTL32_
Free
(
lpColumnInfo
);
Free
(
lpColumnInfo
);
}
return
-
1
;
}
...
...
@@ -7171,7 +7171,7 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
TRACE
(
"(lpcs=%p)
\n
"
,
lpcs
);
/* initialize info pointer */
infoPtr
=
(
LISTVIEW_INFO
*
)
COMCTL32_
Alloc
(
sizeof
(
LISTVIEW_INFO
));
infoPtr
=
(
LISTVIEW_INFO
*
)
Alloc
(
sizeof
(
LISTVIEW_INFO
));
if
(
!
infoPtr
)
return
-
1
;
SetWindowLongW
(
hwnd
,
0
,
(
LONG
)
infoPtr
);
...
...
@@ -7256,7 +7256,7 @@ fail:
DPA_Destroy
(
infoPtr
->
hdpaPosX
);
DPA_Destroy
(
infoPtr
->
hdpaPosY
);
DPA_Destroy
(
infoPtr
->
hdpaColumns
);
COMCTL32_
Free
(
infoPtr
);
Free
(
infoPtr
);
return
-
1
;
}
...
...
@@ -7888,7 +7888,7 @@ static LRESULT LISTVIEW_NCDestroy(LISTVIEW_INFO *infoPtr)
SetWindowLongW
(
infoPtr
->
hwndSelf
,
0
,
0
);
/* free listview info pointer*/
COMCTL32_
Free
(
infoPtr
);
Free
(
infoPtr
);
return
0
;
}
...
...
@@ -9134,7 +9134,7 @@ static LRESULT EditLblWndProcT(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPara
if
(
len
)
{
if
(
(
buffer
=
COMCTL32_
Alloc
((
len
+
1
)
*
(
isW
?
sizeof
(
WCHAR
)
:
sizeof
(
CHAR
))))
)
if
(
(
buffer
=
Alloc
((
len
+
1
)
*
(
isW
?
sizeof
(
WCHAR
)
:
sizeof
(
CHAR
))))
)
{
if
(
isW
)
GetWindowTextW
(
hwnd
,
buffer
,
len
+
1
);
else
GetWindowTextA
(
hwnd
,
(
CHAR
*
)
buffer
,
len
+
1
);
...
...
@@ -9143,7 +9143,7 @@ static LRESULT EditLblWndProcT(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPara
}
LISTVIEW_EndEditLabelT
(
infoPtr
,
buffer
,
isW
);
if
(
buffer
)
COMCTL32_
Free
(
buffer
);
if
(
buffer
)
Free
(
buffer
);
}
...
...
dlls/comctl32/monthcal.c
View file @
7de279a7
...
...
@@ -975,7 +975,7 @@ MONTHCAL_SetRange(HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr
->
monthRange
=
infoPtr
->
maxDate
.
wMonth
-
infoPtr
->
minDate
.
wMonth
;
if
(
infoPtr
->
monthRange
!=
prev
)
{
infoPtr
->
monthdayState
=
COMCTL32_
ReAlloc
(
infoPtr
->
monthdayState
,
infoPtr
->
monthdayState
=
ReAlloc
(
infoPtr
->
monthdayState
,
infoPtr
->
monthRange
*
sizeof
(
MONTHDAYSTATE
));
}
...
...
@@ -1302,7 +1302,7 @@ static void MONTHCAL_GoToNextMonth(HWND hwnd, MONTHCAL_INFO *infoPtr)
nmds
.
nmhdr
.
idFrom
=
GetWindowLongA
(
hwnd
,
GWL_ID
);
nmds
.
nmhdr
.
code
=
MCN_GETDAYSTATE
;
nmds
.
cDayState
=
infoPtr
->
monthRange
;
nmds
.
prgDayState
=
COMCTL32_
Alloc
(
infoPtr
->
monthRange
*
sizeof
(
MONTHDAYSTATE
));
nmds
.
prgDayState
=
Alloc
(
infoPtr
->
monthRange
*
sizeof
(
MONTHDAYSTATE
));
SendMessageA
(
GetParent
(
hwnd
),
WM_NOTIFY
,
(
WPARAM
)
nmds
.
nmhdr
.
idFrom
,
(
LPARAM
)
&
nmds
);
...
...
@@ -1332,7 +1332,7 @@ static void MONTHCAL_GoToPrevMonth(HWND hwnd, MONTHCAL_INFO *infoPtr)
nmds
.
nmhdr
.
idFrom
=
GetWindowLongA
(
hwnd
,
GWL_ID
);
nmds
.
nmhdr
.
code
=
MCN_GETDAYSTATE
;
nmds
.
cDayState
=
infoPtr
->
monthRange
;
nmds
.
prgDayState
=
COMCTL32_
Alloc
nmds
.
prgDayState
=
Alloc
(
infoPtr
->
monthRange
*
sizeof
(
MONTHDAYSTATE
));
SendMessageA
(
GetParent
(
hwnd
),
WM_NOTIFY
,
...
...
@@ -1869,7 +1869,7 @@ MONTHCAL_Create(HWND hwnd, WPARAM wParam, LPARAM lParam)
LOGFONTA
logFont
;
/* allocate memory for info structure */
infoPtr
=
(
MONTHCAL_INFO
*
)
COMCTL32_
Alloc
(
sizeof
(
MONTHCAL_INFO
));
infoPtr
=
(
MONTHCAL_INFO
*
)
Alloc
(
sizeof
(
MONTHCAL_INFO
));
SetWindowLongA
(
hwnd
,
0
,
(
DWORD
)
infoPtr
);
if
(
infoPtr
==
NULL
)
{
...
...
@@ -1897,7 +1897,7 @@ MONTHCAL_Create(HWND hwnd, WPARAM wParam, LPARAM lParam)
MONTHCAL_CopyTime
(
&
infoPtr
->
todaysDate
,
&
infoPtr
->
maxDate
);
infoPtr
->
maxSelCount
=
7
;
infoPtr
->
monthRange
=
3
;
infoPtr
->
monthdayState
=
COMCTL32_
Alloc
infoPtr
->
monthdayState
=
Alloc
(
infoPtr
->
monthRange
*
sizeof
(
MONTHDAYSTATE
));
infoPtr
->
titlebk
=
GetSysColor
(
COLOR_ACTIVECAPTION
);
infoPtr
->
titletxt
=
GetSysColor
(
COLOR_WINDOW
);
...
...
@@ -1921,8 +1921,8 @@ MONTHCAL_Destroy(HWND hwnd, WPARAM wParam, LPARAM lParam)
/* free month calendar info data */
if
(
infoPtr
->
monthdayState
)
COMCTL32_
Free
(
infoPtr
->
monthdayState
);
COMCTL32_
Free
(
infoPtr
);
Free
(
infoPtr
->
monthdayState
);
Free
(
infoPtr
);
SetWindowLongA
(
hwnd
,
0
,
0
);
return
0
;
}
...
...
dlls/comctl32/nativefont.c
View file @
7de279a7
...
...
@@ -54,7 +54,7 @@ NATIVEFONT_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
NATIVEFONT_INFO
*
infoPtr
;
/* allocate memory for info structure */
infoPtr
=
(
NATIVEFONT_INFO
*
)
COMCTL32_
Alloc
(
sizeof
(
NATIVEFONT_INFO
));
infoPtr
=
(
NATIVEFONT_INFO
*
)
Alloc
(
sizeof
(
NATIVEFONT_INFO
));
SetWindowLongA
(
hwnd
,
0
,
(
DWORD
)
infoPtr
);
...
...
@@ -74,7 +74,7 @@ NATIVEFONT_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
/* free comboex info data */
COMCTL32_
Free
(
infoPtr
);
Free
(
infoPtr
);
SetWindowLongA
(
hwnd
,
0
,
0
);
return
0
;
...
...
dlls/comctl32/pager.c
View file @
7de279a7
...
...
@@ -838,7 +838,7 @@ PAGER_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
DWORD
dwStyle
=
GetWindowLongA
(
hwnd
,
GWL_STYLE
);
/* allocate memory for info structure */
infoPtr
=
(
PAGER_INFO
*
)
COMCTL32_
Alloc
(
sizeof
(
PAGER_INFO
));
infoPtr
=
(
PAGER_INFO
*
)
Alloc
(
sizeof
(
PAGER_INFO
));
SetWindowLongA
(
hwnd
,
0
,
(
DWORD
)
infoPtr
);
/* set default settings */
...
...
@@ -878,7 +878,7 @@ PAGER_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
PAGER_INFO
*
infoPtr
=
PAGER_GetInfoPtr
(
hwnd
);
/* free pager info data */
COMCTL32_
Free
(
infoPtr
);
Free
(
infoPtr
);
SetWindowLongA
(
hwnd
,
0
,
0
);
return
0
;
}
...
...
dlls/comctl32/progress.c
View file @
7de279a7
...
...
@@ -294,7 +294,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
SWP_FRAMECHANGED
|
SWP_NOSIZE
|
SWP_NOMOVE
|
SWP_NOZORDER
|
SWP_NOACTIVATE
);
/* allocate memory for info struct */
infoPtr
=
(
PROGRESS_INFO
*
)
COMCTL32_
Alloc
(
sizeof
(
PROGRESS_INFO
));
infoPtr
=
(
PROGRESS_INFO
*
)
Alloc
(
sizeof
(
PROGRESS_INFO
));
if
(
!
infoPtr
)
return
-
1
;
SetWindowLongW
(
hwnd
,
0
,
(
DWORD
)
infoPtr
);
...
...
@@ -313,7 +313,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
case
WM_DESTROY
:
TRACE
(
"Progress Ctrl destruction, hwnd=%p
\n
"
,
hwnd
);
COMCTL32_
Free
(
infoPtr
);
Free
(
infoPtr
);
SetWindowLongW
(
hwnd
,
0
,
0
);
return
0
;
...
...
dlls/comctl32/propsheet.c
View file @
7de279a7
...
...
@@ -531,7 +531,7 @@ BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEW lppsp,
pTitle
=
lppsp
->
pszTitle
;
len
=
strlenW
(
pTitle
);
psInfo
->
proppage
[
index
].
pszText
=
COMCTL32_
Alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
);
psInfo
->
proppage
[
index
].
pszText
=
Alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
);
strcpyW
(
(
LPWSTR
)
psInfo
->
proppage
[
index
].
pszText
,
pTitle
);
}
...
...
@@ -604,7 +604,7 @@ int PROPSHEET_CreateDialog(PropSheetInfo* psInfo)
*/
resSize
=
SizeofResource
(
COMCTL32_hModule
,
hRes
);
temp
=
COMCTL32_
Alloc
(
resSize
);
temp
=
Alloc
(
resSize
);
if
(
!
temp
)
return
-
1
;
...
...
@@ -651,7 +651,7 @@ int PROPSHEET_CreateDialog(PropSheetInfo* psInfo)
}
}
COMCTL32_
Free
(
temp
);
Free
(
temp
);
return
ret
;
}
...
...
@@ -1433,7 +1433,7 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
* Make a copy of the dialog template to make it writable
*/
}
temp
=
COMCTL32_
Alloc
(
resSize
);
temp
=
Alloc
(
resSize
);
if
(
!
temp
)
return
FALSE
;
...
...
@@ -1483,7 +1483,7 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
(
LPARAM
)
ppshpage
);
/* Free a no more needed copy */
if
(
temp
)
COMCTL32_
Free
(
temp
);
Free
(
temp
);
ppInfo
[
index
].
hwndPage
=
hwndPage
;
...
...
@@ -2101,12 +2101,12 @@ static void PROPSHEET_SetTitleW(HWND hwndDlg, DWORD dwStyle, LPCWSTR lpszText)
int
lentitle
=
strlenW
(
lpszText
);
int
lenprop
=
strlenW
(
psInfo
->
strPropertiesFor
);
dest
=
COMCTL32_
Alloc
(
(
lentitle
+
lenprop
+
1
)
*
sizeof
(
WCHAR
));
dest
=
Alloc
(
(
lentitle
+
lenprop
+
1
)
*
sizeof
(
WCHAR
));
strcpyW
(
dest
,
psInfo
->
strPropertiesFor
);
strcatW
(
dest
,
lpszText
);
SetWindowTextW
(
hwndDlg
,
dest
);
COMCTL32_
Free
(
dest
);
Free
(
dest
);
}
else
SetWindowTextW
(
hwndDlg
,
lpszText
);
...
...
@@ -2201,7 +2201,7 @@ static BOOL PROPSHEET_AddPage(HWND hwndDlg,
/*
* Allocate and fill in a new PropPageInfo entry.
*/
psInfo
->
proppage
=
(
PropPageInfo
*
)
COMCTL32_
ReAlloc
(
psInfo
->
proppage
,
psInfo
->
proppage
=
(
PropPageInfo
*
)
ReAlloc
(
psInfo
->
proppage
,
sizeof
(
PropPageInfo
)
*
(
psInfo
->
nPages
+
1
));
if
(
!
PROPSHEET_CollectPageInfo
(
ppsp
,
psInfo
,
psInfo
->
nPages
))
...
...
@@ -2328,7 +2328,7 @@ static BOOL PROPSHEET_RemovePage(HWND hwndDlg,
SendMessageW
(
hwndTabControl
,
TCM_DELETEITEM
,
index
,
0
);
psInfo
->
nPages
--
;
psInfo
->
proppage
=
COMCTL32_
Alloc
(
sizeof
(
PropPageInfo
)
*
psInfo
->
nPages
);
psInfo
->
proppage
=
Alloc
(
sizeof
(
PropPageInfo
)
*
psInfo
->
nPages
);
if
(
index
>
0
)
memcpy
(
&
psInfo
->
proppage
[
0
],
&
oldPages
[
0
],
index
*
sizeof
(
PropPageInfo
));
...
...
@@ -2337,7 +2337,7 @@ static BOOL PROPSHEET_RemovePage(HWND hwndDlg,
memcpy
(
&
psInfo
->
proppage
[
index
],
&
oldPages
[
index
+
1
],
(
psInfo
->
nPages
-
index
)
*
sizeof
(
PropPageInfo
));
COMCTL32_
Free
(
oldPages
);
Free
(
oldPages
);
return
FALSE
;
}
...
...
@@ -2450,8 +2450,8 @@ static void PROPSHEET_CleanUp(HWND hwndDlg)
}
}
COMCTL32_
Free
(
psInfo
->
proppage
);
COMCTL32_
Free
(
psInfo
->
strPropertiesFor
);
Free
(
psInfo
->
proppage
);
Free
(
psInfo
->
strPropertiesFor
);
ImageList_Destroy
(
psInfo
->
hImageList
);
GlobalFree
((
HGLOBAL
)
psInfo
);
...
...
@@ -2473,7 +2473,7 @@ INT WINAPI PropertySheetA(LPCPROPSHEETHEADERA lppsh)
PROPSHEET_CollectSheetInfoA
(
lppsh
,
psInfo
);
psInfo
->
proppage
=
(
PropPageInfo
*
)
COMCTL32_
Alloc
(
sizeof
(
PropPageInfo
)
*
psInfo
->
proppage
=
(
PropPageInfo
*
)
Alloc
(
sizeof
(
PropPageInfo
)
*
lppsh
->
nPages
);
pByte
=
(
BYTE
*
)
psInfo
->
ppshheader
.
u3
.
ppsp
;
...
...
@@ -2518,7 +2518,7 @@ INT WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
PROPSHEET_CollectSheetInfoW
(
lppsh
,
psInfo
);
psInfo
->
proppage
=
(
PropPageInfo
*
)
COMCTL32_
Alloc
(
sizeof
(
PropPageInfo
)
*
psInfo
->
proppage
=
(
PropPageInfo
*
)
Alloc
(
sizeof
(
PropPageInfo
)
*
lppsh
->
nPages
);
pByte
=
(
BYTE
*
)
psInfo
->
ppshheader
.
u3
.
ppsp
;
...
...
@@ -2555,7 +2555,7 @@ INT WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
HPROPSHEETPAGE
WINAPI
CreatePropertySheetPageA
(
LPCPROPSHEETPAGEA
lpPropSheetPage
)
{
PROPSHEETPAGEW
*
ppsp
=
COMCTL32_
Alloc
(
sizeof
(
PROPSHEETPAGEW
));
PROPSHEETPAGEW
*
ppsp
=
Alloc
(
sizeof
(
PROPSHEETPAGEW
));
memcpy
(
ppsp
,
lpPropSheetPage
,
min
(
lpPropSheetPage
->
dwSize
,
sizeof
(
PROPSHEETPAGEA
)));
...
...
@@ -2587,7 +2587,7 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(
*/
HPROPSHEETPAGE
WINAPI
CreatePropertySheetPageW
(
LPCPROPSHEETPAGEW
lpPropSheetPage
)
{
PROPSHEETPAGEW
*
ppsp
=
COMCTL32_
Alloc
(
sizeof
(
PROPSHEETPAGEW
));
PROPSHEETPAGEW
*
ppsp
=
Alloc
(
sizeof
(
PROPSHEETPAGEW
));
memcpy
(
ppsp
,
lpPropSheetPage
,
min
(
lpPropSheetPage
->
dwSize
,
sizeof
(
PROPSHEETPAGEW
)));
...
...
@@ -2638,7 +2638,7 @@ BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage)
if
((
psp
->
dwFlags
&
PSP_USETITLE
)
&&
HIWORD
(
psp
->
pszTitle
))
HeapFree
(
GetProcessHeap
(),
0
,
(
LPVOID
)
psp
->
pszTitle
);
COMCTL32_
Free
(
hPropPage
);
Free
(
hPropPage
);
return
TRUE
;
}
...
...
@@ -2774,7 +2774,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case
WM_INITDIALOG
:
{
PropSheetInfo
*
psInfo
=
(
PropSheetInfo
*
)
lParam
;
WCHAR
*
strCaption
=
(
WCHAR
*
)
COMCTL32_
Alloc
(
MAX_CAPTION_LENGTH
*
sizeof
(
WCHAR
));
WCHAR
*
strCaption
=
(
WCHAR
*
)
Alloc
(
MAX_CAPTION_LENGTH
*
sizeof
(
WCHAR
));
HWND
hwndTabCtrl
=
GetDlgItem
(
hwnd
,
IDC_TABCONTROL
);
LPCPROPSHEETPAGEW
ppshpage
;
int
idx
;
...
...
dlls/comctl32/rebar.c
View file @
7de279a7
...
...
@@ -1716,8 +1716,8 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient)
/* indexes by row */
if
(
infoPtr
->
uNumRows
!=
origrows
)
{
if
(
infoPtr
->
rows
)
COMCTL32_
Free
(
infoPtr
->
rows
);
infoPtr
->
rows
=
COMCTL32_
Alloc
(
sizeof
(
REBAR_ROW
)
*
infoPtr
->
uNumRows
);
if
(
infoPtr
->
rows
)
Free
(
infoPtr
->
rows
);
infoPtr
->
rows
=
Alloc
(
sizeof
(
REBAR_ROW
)
*
infoPtr
->
uNumRows
);
}
row
=
0
;
...
...
@@ -2525,7 +2525,7 @@ REBAR_DeleteBand (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
TRACE
(
" simple delete!
\n
"
);
if
((
lpBand
->
fMask
&
RBBIM_CHILD
)
&&
lpBand
->
hwndChild
)
childhwnd
=
lpBand
->
hwndChild
;
COMCTL32_
Free
(
infoPtr
->
bands
);
Free
(
infoPtr
->
bands
);
infoPtr
->
bands
=
NULL
;
infoPtr
->
uNumBands
=
0
;
}
...
...
@@ -2537,7 +2537,7 @@ REBAR_DeleteBand (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
childhwnd
=
lpBand
->
hwndChild
;
infoPtr
->
uNumBands
--
;
infoPtr
->
bands
=
COMCTL32_
Alloc
(
sizeof
(
REBAR_BAND
)
*
infoPtr
->
uNumBands
);
infoPtr
->
bands
=
Alloc
(
sizeof
(
REBAR_BAND
)
*
infoPtr
->
uNumBands
);
if
(
uBand
>
0
)
{
memcpy
(
&
infoPtr
->
bands
[
0
],
&
oldBands
[
0
],
uBand
*
sizeof
(
REBAR_BAND
));
...
...
@@ -2548,7 +2548,7 @@ REBAR_DeleteBand (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
(
infoPtr
->
uNumBands
-
uBand
)
*
sizeof
(
REBAR_BAND
));
}
COMCTL32_
Free
(
oldBands
);
Free
(
oldBands
);
}
if
(
childhwnd
)
...
...
@@ -2997,13 +2997,13 @@ REBAR_InsertBandA (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
REBAR_DumpBandInfo
(
lprbbi
);
if
(
infoPtr
->
uNumBands
==
0
)
{
infoPtr
->
bands
=
(
REBAR_BAND
*
)
COMCTL32_
Alloc
(
sizeof
(
REBAR_BAND
));
infoPtr
->
bands
=
(
REBAR_BAND
*
)
Alloc
(
sizeof
(
REBAR_BAND
));
uIndex
=
0
;
}
else
{
REBAR_BAND
*
oldBands
=
infoPtr
->
bands
;
infoPtr
->
bands
=
(
REBAR_BAND
*
)
COMCTL32_
Alloc
((
infoPtr
->
uNumBands
+
1
)
*
sizeof
(
REBAR_BAND
));
(
REBAR_BAND
*
)
Alloc
((
infoPtr
->
uNumBands
+
1
)
*
sizeof
(
REBAR_BAND
));
if
(((
INT
)
uIndex
==
-
1
)
||
(
uIndex
>
infoPtr
->
uNumBands
))
uIndex
=
infoPtr
->
uNumBands
;
...
...
@@ -3019,7 +3019,7 @@ REBAR_InsertBandA (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
(
infoPtr
->
uNumBands
-
uIndex
-
1
)
*
sizeof
(
REBAR_BAND
));
}
COMCTL32_
Free
(
oldBands
);
Free
(
oldBands
);
}
infoPtr
->
uNumBands
++
;
...
...
@@ -3040,7 +3040,7 @@ REBAR_InsertBandA (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
if
((
lprbbi
->
fMask
&
RBBIM_TEXT
)
&&
(
lprbbi
->
lpText
))
{
INT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lprbbi
->
lpText
,
-
1
,
NULL
,
0
);
if
(
len
>
1
)
{
lpBand
->
lpText
=
(
LPWSTR
)
COMCTL32_
Alloc
(
len
*
sizeof
(
WCHAR
));
lpBand
->
lpText
=
(
LPWSTR
)
Alloc
(
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
lprbbi
->
lpText
,
-
1
,
lpBand
->
lpText
,
len
);
}
}
...
...
@@ -3078,13 +3078,13 @@ REBAR_InsertBandW (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
REBAR_DumpBandInfo
((
LPREBARBANDINFOA
)
lprbbi
);
if
(
infoPtr
->
uNumBands
==
0
)
{
infoPtr
->
bands
=
(
REBAR_BAND
*
)
COMCTL32_
Alloc
(
sizeof
(
REBAR_BAND
));
infoPtr
->
bands
=
(
REBAR_BAND
*
)
Alloc
(
sizeof
(
REBAR_BAND
));
uIndex
=
0
;
}
else
{
REBAR_BAND
*
oldBands
=
infoPtr
->
bands
;
infoPtr
->
bands
=
(
REBAR_BAND
*
)
COMCTL32_
Alloc
((
infoPtr
->
uNumBands
+
1
)
*
sizeof
(
REBAR_BAND
));
(
REBAR_BAND
*
)
Alloc
((
infoPtr
->
uNumBands
+
1
)
*
sizeof
(
REBAR_BAND
));
if
(((
INT
)
uIndex
==
-
1
)
||
(
uIndex
>
infoPtr
->
uNumBands
))
uIndex
=
infoPtr
->
uNumBands
;
...
...
@@ -3100,7 +3100,7 @@ REBAR_InsertBandW (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
(
infoPtr
->
uNumBands
-
uIndex
-
1
)
*
sizeof
(
REBAR_BAND
));
}
COMCTL32_
Free
(
oldBands
);
Free
(
oldBands
);
}
infoPtr
->
uNumBands
++
;
...
...
@@ -3121,7 +3121,7 @@ REBAR_InsertBandW (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
if
((
lprbbi
->
fMask
&
RBBIM_TEXT
)
&&
(
lprbbi
->
lpText
))
{
INT
len
=
lstrlenW
(
lprbbi
->
lpText
);
if
(
len
>
0
)
{
lpBand
->
lpText
=
(
LPWSTR
)
COMCTL32_
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
lpBand
->
lpText
=
(
LPWSTR
)
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
strcpyW
(
lpBand
->
lpText
,
lprbbi
->
lpText
);
}
}
...
...
@@ -3339,7 +3339,7 @@ REBAR_MoveBand (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
/* allocate new space and copy rest of bands into it */
infoPtr
->
bands
=
(
REBAR_BAND
*
)
COMCTL32_
Alloc
((
infoPtr
->
uNumBands
)
*
sizeof
(
REBAR_BAND
));
(
REBAR_BAND
*
)
Alloc
((
infoPtr
->
uNumBands
)
*
sizeof
(
REBAR_BAND
));
/* pre insert copy */
if
(
uTo
>
0
)
{
...
...
@@ -3356,7 +3356,7 @@ REBAR_MoveBand (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
(
infoPtr
->
uNumBands
-
uTo
-
1
)
*
sizeof
(
REBAR_BAND
));
}
COMCTL32_
Free
(
oldBands
);
Free
(
oldBands
);
TRACE
(
"moved band %d to index %d
\n
"
,
uFrom
,
uTo
);
REBAR_DumpBand
(
infoPtr
);
...
...
@@ -3397,12 +3397,12 @@ REBAR_SetBandInfoA (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
REBAR_CommonSetupBand
(
infoPtr
->
hwndSelf
,
lprbbi
,
lpBand
);
if
(
lprbbi
->
fMask
&
RBBIM_TEXT
)
{
if
(
lpBand
->
lpText
)
{
COMCTL32_
Free
(
lpBand
->
lpText
);
Free
(
lpBand
->
lpText
);
lpBand
->
lpText
=
NULL
;
}
if
(
lprbbi
->
lpText
)
{
INT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lprbbi
->
lpText
,
-
1
,
NULL
,
0
);
lpBand
->
lpText
=
(
LPWSTR
)
COMCTL32_
Alloc
(
len
*
sizeof
(
WCHAR
));
lpBand
->
lpText
=
(
LPWSTR
)
Alloc
(
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
lprbbi
->
lpText
,
-
1
,
lpBand
->
lpText
,
len
);
}
}
...
...
@@ -3442,12 +3442,12 @@ REBAR_SetBandInfoW (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
REBAR_CommonSetupBand
(
infoPtr
->
hwndSelf
,
(
LPREBARBANDINFOA
)
lprbbi
,
lpBand
);
if
(
lprbbi
->
fMask
&
RBBIM_TEXT
)
{
if
(
lpBand
->
lpText
)
{
COMCTL32_
Free
(
lpBand
->
lpText
);
Free
(
lpBand
->
lpText
);
lpBand
->
lpText
=
NULL
;
}
if
(
lprbbi
->
lpText
)
{
INT
len
=
lstrlenW
(
lprbbi
->
lpText
);
lpBand
->
lpText
=
(
LPWSTR
)
COMCTL32_
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
lpBand
->
lpText
=
(
LPWSTR
)
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
strcpyW
(
lpBand
->
lpText
,
lprbbi
->
lpText
);
}
}
...
...
@@ -3678,7 +3678,7 @@ REBAR_Destroy (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
/* delete text strings */
if
(
lpBand
->
lpText
)
{
COMCTL32_
Free
(
lpBand
->
lpText
);
Free
(
lpBand
->
lpText
);
lpBand
->
lpText
=
NULL
;
}
/* destroy child window */
...
...
@@ -3686,7 +3686,7 @@ REBAR_Destroy (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
}
/* free band array */
COMCTL32_
Free
(
infoPtr
->
bands
);
Free
(
infoPtr
->
bands
);
infoPtr
->
bands
=
NULL
;
}
...
...
@@ -3698,7 +3698,7 @@ REBAR_Destroy (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
SetWindowLongA
(
infoPtr
->
hwndSelf
,
0
,
0
);
/* free rebar info data */
COMCTL32_
Free
(
infoPtr
);
Free
(
infoPtr
);
TRACE
(
"destroyed!
\n
"
);
return
0
;
}
...
...
@@ -3861,7 +3861,7 @@ REBAR_NCCreate (HWND hwnd, WPARAM wParam, LPARAM lParam)
}
/* allocate memory for info structure */
infoPtr
=
(
REBAR_INFO
*
)
COMCTL32_
Alloc
(
sizeof
(
REBAR_INFO
));
infoPtr
=
(
REBAR_INFO
*
)
Alloc
(
sizeof
(
REBAR_INFO
));
SetWindowLongA
(
hwnd
,
0
,
(
DWORD
)
infoPtr
);
/* initialize info structure - initial values are 0 */
...
...
dlls/comctl32/status.c
View file @
7de279a7
...
...
@@ -589,16 +589,16 @@ STATUSBAR_SetParts (STATUSWINDOWINFO *infoPtr, INT count, LPINT parts)
if
(
oldNumParts
>
infoPtr
->
numParts
)
{
for
(
i
=
infoPtr
->
numParts
;
i
<
oldNumParts
;
i
++
)
{
if
(
infoPtr
->
parts
[
i
].
text
&&
!
(
infoPtr
->
parts
[
i
].
style
&
SBT_OWNERDRAW
))
COMCTL32_
Free
(
infoPtr
->
parts
[
i
].
text
);
Free
(
infoPtr
->
parts
[
i
].
text
);
}
}
else
if
(
oldNumParts
<
infoPtr
->
numParts
)
{
tmp
=
COMCTL32_
Alloc
(
sizeof
(
STATUSWINDOWPART
)
*
infoPtr
->
numParts
);
tmp
=
Alloc
(
sizeof
(
STATUSWINDOWPART
)
*
infoPtr
->
numParts
);
if
(
!
tmp
)
return
FALSE
;
for
(
i
=
0
;
i
<
oldNumParts
;
i
++
)
{
tmp
[
i
]
=
infoPtr
->
parts
[
i
];
}
if
(
infoPtr
->
parts
)
COMCTL32_
Free
(
infoPtr
->
parts
);
Free
(
infoPtr
->
parts
);
infoPtr
->
parts
=
tmp
;
}
if
(
oldNumParts
==
infoPtr
->
numParts
)
{
...
...
@@ -684,11 +684,11 @@ STATUSBAR_SetTextT (STATUSWINDOWINFO *infoPtr, INT nPart, WORD style,
if
(
text
&&
!
isW
)
{
LPCSTR
atxt
=
(
LPCSTR
)
text
;
DWORD
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
atxt
,
-
1
,
NULL
,
0
);
ntext
=
COMCTL32_
Alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
);
ntext
=
Alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
);
if
(
!
ntext
)
return
FALSE
;
MultiByteToWideChar
(
CP_ACP
,
0
,
atxt
,
-
1
,
ntext
,
len
);
}
else
if
(
text
)
{
ntext
=
COMCTL32_
Alloc
(
(
strlenW
(
text
)
+
1
)
*
sizeof
(
WCHAR
)
);
ntext
=
Alloc
(
(
strlenW
(
text
)
+
1
)
*
sizeof
(
WCHAR
)
);
if
(
!
ntext
)
return
FALSE
;
strcpyW
(
ntext
,
text
);
}
else
ntext
=
0
;
...
...
@@ -696,7 +696,7 @@ STATUSBAR_SetTextT (STATUSWINDOWINFO *infoPtr, INT nPart, WORD style,
/* check if text is unchanged -> no need to redraw */
if
(
text
)
{
if
(
!
changed
&&
part
->
text
&&
!
lstrcmpW
(
ntext
,
part
->
text
))
{
if
(
!
isW
)
COMCTL32_
Free
(
ntext
);
if
(
!
isW
)
Free
(
ntext
);
return
TRUE
;
}
}
else
{
...
...
@@ -705,7 +705,7 @@ STATUSBAR_SetTextT (STATUSWINDOWINFO *infoPtr, INT nPart, WORD style,
}
if
(
part
->
text
)
COMCTL32_
Free
(
part
->
text
);
Free
(
part
->
text
);
part
->
text
=
ntext
;
}
InvalidateRect
(
infoPtr
->
Self
,
&
part
->
bound
,
FALSE
);
...
...
@@ -793,11 +793,11 @@ STATUSBAR_WMDestroy (STATUSWINDOWINFO *infoPtr)
TRACE
(
"
\n
"
);
for
(
i
=
0
;
i
<
infoPtr
->
numParts
;
i
++
)
{
if
(
infoPtr
->
parts
[
i
].
text
&&
!
(
infoPtr
->
parts
[
i
].
style
&
SBT_OWNERDRAW
))
COMCTL32_
Free
(
infoPtr
->
parts
[
i
].
text
);
Free
(
infoPtr
->
parts
[
i
].
text
);
}
if
(
infoPtr
->
part0
.
text
&&
!
(
infoPtr
->
part0
.
style
&
SBT_OWNERDRAW
))
COMCTL32_
Free
(
infoPtr
->
part0
.
text
);
COMCTL32_
Free
(
infoPtr
->
parts
);
Free
(
infoPtr
->
part0
.
text
);
Free
(
infoPtr
->
parts
);
/* delete default font */
if
(
infoPtr
->
hDefaultFont
)
...
...
@@ -807,7 +807,7 @@ STATUSBAR_WMDestroy (STATUSWINDOWINFO *infoPtr)
if
(
infoPtr
->
hwndToolTip
)
DestroyWindow
(
infoPtr
->
hwndToolTip
);
COMCTL32_
Free
(
infoPtr
);
Free
(
infoPtr
);
SetWindowLongW
(
infoPtr
->
Self
,
0
,
0
);
return
0
;
}
...
...
@@ -824,7 +824,7 @@ STATUSBAR_WMCreate (HWND hwnd, LPCREATESTRUCTA lpCreate)
HDC
hdc
;
TRACE
(
"
\n
"
);
infoPtr
=
(
STATUSWINDOWINFO
*
)
COMCTL32_
Alloc
(
sizeof
(
STATUSWINDOWINFO
));
infoPtr
=
(
STATUSWINDOWINFO
*
)
Alloc
(
sizeof
(
STATUSWINDOWINFO
));
if
(
!
infoPtr
)
goto
create_fail
;
SetWindowLongW
(
hwnd
,
0
,
(
DWORD
)
infoPtr
);
...
...
@@ -855,7 +855,7 @@ STATUSBAR_WMCreate (HWND hwnd, LPCREATESTRUCTA lpCreate)
infoPtr
->
part0
.
hIcon
=
0
;
/* initialize first part */
infoPtr
->
parts
=
COMCTL32_
Alloc
(
sizeof
(
STATUSWINDOWPART
));
infoPtr
->
parts
=
Alloc
(
sizeof
(
STATUSWINDOWPART
));
if
(
!
infoPtr
->
parts
)
goto
create_fail
;
infoPtr
->
parts
[
0
].
bound
=
rect
;
infoPtr
->
parts
[
0
].
text
=
0
;
...
...
@@ -867,7 +867,7 @@ STATUSBAR_WMCreate (HWND hwnd, LPCREATESTRUCTA lpCreate)
infoPtr
->
bUnicode
=
TRUE
;
if
(
lpCreate
->
lpszName
&&
(
len
=
strlenW
((
LPCWSTR
)
lpCreate
->
lpszName
)))
{
infoPtr
->
parts
[
0
].
text
=
COMCTL32_
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
infoPtr
->
parts
[
0
].
text
=
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
infoPtr
->
parts
[
0
].
text
)
goto
create_fail
;
strcpyW
(
infoPtr
->
parts
[
0
].
text
,
(
LPCWSTR
)
lpCreate
->
lpszName
);
}
...
...
@@ -876,7 +876,7 @@ STATUSBAR_WMCreate (HWND hwnd, LPCREATESTRUCTA lpCreate)
if
(
lpCreate
->
lpszName
&&
(
len
=
strlen
((
LPCSTR
)
lpCreate
->
lpszName
)))
{
DWORD
lenW
=
MultiByteToWideChar
(
CP_ACP
,
0
,
(
LPCSTR
)
lpCreate
->
lpszName
,
-
1
,
NULL
,
0
);
infoPtr
->
parts
[
0
].
text
=
COMCTL32_
Alloc
(
lenW
*
sizeof
(
WCHAR
));
infoPtr
->
parts
[
0
].
text
=
Alloc
(
lenW
*
sizeof
(
WCHAR
));
if
(
!
infoPtr
->
parts
[
0
].
text
)
goto
create_fail
;
MultiByteToWideChar
(
CP_ACP
,
0
,
(
LPCSTR
)
lpCreate
->
lpszName
,
-
1
,
infoPtr
->
parts
[
0
].
text
,
lenW
);
...
...
@@ -1032,11 +1032,11 @@ STATUSBAR_WMSetText (STATUSWINDOWINFO *infoPtr, LPCSTR text)
part
=
&
infoPtr
->
parts
[
0
];
/* duplicate string */
if
(
part
->
text
)
COMCTL32_
Free
(
part
->
text
);
Free
(
part
->
text
);
part
->
text
=
0
;
if
(
infoPtr
->
bUnicode
)
{
if
(
text
&&
(
len
=
strlenW
((
LPCWSTR
)
text
)))
{
part
->
text
=
COMCTL32_
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
part
->
text
=
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
part
->
text
)
return
FALSE
;
strcpyW
(
part
->
text
,
(
LPCWSTR
)
text
);
}
...
...
@@ -1044,7 +1044,7 @@ STATUSBAR_WMSetText (STATUSWINDOWINFO *infoPtr, LPCSTR text)
else
{
if
(
text
&&
(
len
=
lstrlenA
(
text
)))
{
DWORD
lenW
=
MultiByteToWideChar
(
CP_ACP
,
0
,
text
,
-
1
,
NULL
,
0
);
part
->
text
=
COMCTL32_
Alloc
(
lenW
*
sizeof
(
WCHAR
));
part
->
text
=
Alloc
(
lenW
*
sizeof
(
WCHAR
));
if
(
!
part
->
text
)
return
FALSE
;
MultiByteToWideChar
(
CP_ACP
,
0
,
text
,
-
1
,
part
->
text
,
lenW
);
}
...
...
dlls/comctl32/tab.c
View file @
7de279a7
...
...
@@ -2425,7 +2425,7 @@ TAB_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
if
(
infoPtr
->
uNumItem
==
0
)
{
infoPtr
->
items
=
COMCTL32_
Alloc
(
sizeof
(
TAB_ITEM
));
infoPtr
->
items
=
Alloc
(
sizeof
(
TAB_ITEM
));
infoPtr
->
uNumItem
++
;
infoPtr
->
iSelected
=
0
;
}
...
...
@@ -2433,7 +2433,7 @@ TAB_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
TAB_ITEM
*
oldItems
=
infoPtr
->
items
;
infoPtr
->
uNumItem
++
;
infoPtr
->
items
=
COMCTL32_
Alloc
(
sizeof
(
TAB_ITEM
)
*
infoPtr
->
uNumItem
);
infoPtr
->
items
=
Alloc
(
sizeof
(
TAB_ITEM
)
*
infoPtr
->
uNumItem
);
/* pre insert copy */
if
(
iItem
>
0
)
{
...
...
@@ -2451,7 +2451,7 @@ TAB_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
if
(
iItem
<=
infoPtr
->
iSelected
)
infoPtr
->
iSelected
++
;
COMCTL32_
Free
(
oldItems
);
Free
(
oldItems
);
}
infoPtr
->
items
[
iItem
].
mask
=
pti
->
mask
;
...
...
@@ -2499,7 +2499,7 @@ TAB_InsertItemW (HWND hwnd, WPARAM wParam, LPARAM lParam)
TAB_DumpItemExternalW
(
pti
,
iItem
);
if
(
infoPtr
->
uNumItem
==
0
)
{
infoPtr
->
items
=
COMCTL32_
Alloc
(
sizeof
(
TAB_ITEM
));
infoPtr
->
items
=
Alloc
(
sizeof
(
TAB_ITEM
));
infoPtr
->
uNumItem
++
;
infoPtr
->
iSelected
=
0
;
}
...
...
@@ -2507,7 +2507,7 @@ TAB_InsertItemW (HWND hwnd, WPARAM wParam, LPARAM lParam)
TAB_ITEM
*
oldItems
=
infoPtr
->
items
;
infoPtr
->
uNumItem
++
;
infoPtr
->
items
=
COMCTL32_
Alloc
(
sizeof
(
TAB_ITEM
)
*
infoPtr
->
uNumItem
);
infoPtr
->
items
=
Alloc
(
sizeof
(
TAB_ITEM
)
*
infoPtr
->
uNumItem
);
/* pre insert copy */
if
(
iItem
>
0
)
{
...
...
@@ -2525,7 +2525,7 @@ TAB_InsertItemW (HWND hwnd, WPARAM wParam, LPARAM lParam)
if
(
iItem
<=
infoPtr
->
iSelected
)
infoPtr
->
iSelected
++
;
COMCTL32_
Free
(
oldItems
);
Free
(
oldItems
);
}
infoPtr
->
items
[
iItem
].
mask
=
pti
->
mask
;
...
...
@@ -2785,7 +2785,7 @@ TAB_DeleteItem (HWND hwnd, WPARAM wParam, LPARAM lParam)
TAB_ITEM
*
oldItems
=
infoPtr
->
items
;
infoPtr
->
uNumItem
--
;
infoPtr
->
items
=
COMCTL32_
Alloc
(
sizeof
(
TAB_ITEM
)
*
infoPtr
->
uNumItem
);
infoPtr
->
items
=
Alloc
(
sizeof
(
TAB_ITEM
)
*
infoPtr
->
uNumItem
);
if
(
iItem
>
0
)
memcpy
(
&
infoPtr
->
items
[
0
],
&
oldItems
[
0
],
iItem
*
sizeof
(
TAB_ITEM
));
...
...
@@ -2794,7 +2794,7 @@ TAB_DeleteItem (HWND hwnd, WPARAM wParam, LPARAM lParam)
memcpy
(
&
infoPtr
->
items
[
iItem
],
&
oldItems
[
iItem
+
1
],
(
infoPtr
->
uNumItem
-
iItem
)
*
sizeof
(
TAB_ITEM
));
COMCTL32_
Free
(
oldItems
);
Free
(
oldItems
);
/* Readjust the selected index */
if
((
iItem
==
infoPtr
->
iSelected
)
&&
(
iItem
>
0
))
...
...
@@ -2821,7 +2821,7 @@ TAB_DeleteAllItems (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
hwnd
);
COMCTL32_
Free
(
infoPtr
->
items
);
Free
(
infoPtr
->
items
);
infoPtr
->
uNumItem
=
0
;
infoPtr
->
iSelected
=
-
1
;
if
(
infoPtr
->
iHotTracked
>=
0
)
...
...
@@ -2947,7 +2947,7 @@ TAB_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
HFONT
hOldFont
;
DWORD
dwStyle
;
infoPtr
=
(
TAB_INFO
*
)
COMCTL32_
Alloc
(
sizeof
(
TAB_INFO
));
infoPtr
=
(
TAB_INFO
*
)
Alloc
(
sizeof
(
TAB_INFO
));
SetWindowLongA
(
hwnd
,
0
,
(
DWORD
)
infoPtr
);
...
...
@@ -3042,9 +3042,9 @@ TAB_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
if
(
infoPtr
->
items
)
{
for
(
iItem
=
0
;
iItem
<
infoPtr
->
uNumItem
;
iItem
++
)
{
if
(
infoPtr
->
items
[
iItem
].
pszText
)
COMCTL32_
Free
(
infoPtr
->
items
[
iItem
].
pszText
);
Free
(
infoPtr
->
items
[
iItem
].
pszText
);
}
COMCTL32_
Free
(
infoPtr
->
items
);
Free
(
infoPtr
->
items
);
}
if
(
infoPtr
->
hwndToolTip
)
...
...
@@ -3056,7 +3056,7 @@ TAB_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
if
(
infoPtr
->
iHotTracked
>=
0
)
KillTimer
(
hwnd
,
TAB_HOTTRACK_TIMER
);
COMCTL32_
Free
(
infoPtr
);
Free
(
infoPtr
);
SetWindowLongA
(
hwnd
,
0
,
0
);
return
0
;
}
...
...
dlls/comctl32/toolbar.c
View file @
7de279a7
This diff is collapsed.
Click to expand it.
dlls/comctl32/tooltips.c
View file @
7de279a7
...
...
@@ -216,7 +216,7 @@ TOOLTIPS_GetTipText (HWND hwnd, TOOLTIPS_INFO *infoPtr, INT nTool)
INT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
ttnmdi
.
szText
,
80
,
NULL
,
0
);
toolPtr
->
hinst
=
0
;
toolPtr
->
lpszText
=
COMCTL32_
Alloc
(
len
*
sizeof
(
WCHAR
));
toolPtr
->
lpszText
=
Alloc
(
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
ttnmdi
.
szText
,
80
,
toolPtr
->
lpszText
,
len
);
}
...
...
@@ -232,7 +232,7 @@ TOOLTIPS_GetTipText (HWND hwnd, TOOLTIPS_INFO *infoPtr, INT nTool)
INT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
ttnmdi
.
lpszText
,
-
1
,
NULL
,
0
);
toolPtr
->
hinst
=
0
;
toolPtr
->
lpszText
=
COMCTL32_
Alloc
(
len
*
sizeof
(
WCHAR
));
toolPtr
->
lpszText
=
Alloc
(
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
ttnmdi
.
lpszText
,
-
1
,
toolPtr
->
lpszText
,
len
);
}
...
...
@@ -679,16 +679,16 @@ TOOLTIPS_AddToolA (HWND hwnd, WPARAM wParam, LPARAM lParam)
(
lpToolInfo
->
uFlags
&
TTF_IDISHWND
)
?
" TTF_IDISHWND"
:
""
);
if
(
infoPtr
->
uNumTools
==
0
)
{
infoPtr
->
tools
=
COMCTL32_
Alloc
(
sizeof
(
TTTOOL_INFO
));
infoPtr
->
tools
=
Alloc
(
sizeof
(
TTTOOL_INFO
));
toolPtr
=
infoPtr
->
tools
;
}
else
{
TTTOOL_INFO
*
oldTools
=
infoPtr
->
tools
;
infoPtr
->
tools
=
COMCTL32_
Alloc
(
sizeof
(
TTTOOL_INFO
)
*
(
infoPtr
->
uNumTools
+
1
));
Alloc
(
sizeof
(
TTTOOL_INFO
)
*
(
infoPtr
->
uNumTools
+
1
));
memcpy
(
infoPtr
->
tools
,
oldTools
,
infoPtr
->
uNumTools
*
sizeof
(
TTTOOL_INFO
));
COMCTL32_
Free
(
oldTools
);
Free
(
oldTools
);
toolPtr
=
&
infoPtr
->
tools
[
infoPtr
->
uNumTools
];
}
...
...
@@ -714,7 +714,7 @@ TOOLTIPS_AddToolA (HWND hwnd, WPARAM wParam, LPARAM lParam)
INT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpToolInfo
->
lpszText
,
-
1
,
NULL
,
0
);
TRACE
(
"add text
\"
%s
\"
!
\n
"
,
lpToolInfo
->
lpszText
);
toolPtr
->
lpszText
=
COMCTL32_
Alloc
(
len
*
sizeof
(
WCHAR
));
toolPtr
->
lpszText
=
Alloc
(
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
lpToolInfo
->
lpszText
,
-
1
,
toolPtr
->
lpszText
,
len
);
}
...
...
@@ -757,16 +757,16 @@ TOOLTIPS_AddToolW (HWND hwnd, WPARAM wParam, LPARAM lParam)
(
lpToolInfo
->
uFlags
&
TTF_IDISHWND
)
?
" TTF_IDISHWND"
:
""
);
if
(
infoPtr
->
uNumTools
==
0
)
{
infoPtr
->
tools
=
COMCTL32_
Alloc
(
sizeof
(
TTTOOL_INFO
));
infoPtr
->
tools
=
Alloc
(
sizeof
(
TTTOOL_INFO
));
toolPtr
=
infoPtr
->
tools
;
}
else
{
TTTOOL_INFO
*
oldTools
=
infoPtr
->
tools
;
infoPtr
->
tools
=
COMCTL32_
Alloc
(
sizeof
(
TTTOOL_INFO
)
*
(
infoPtr
->
uNumTools
+
1
));
Alloc
(
sizeof
(
TTTOOL_INFO
)
*
(
infoPtr
->
uNumTools
+
1
));
memcpy
(
infoPtr
->
tools
,
oldTools
,
infoPtr
->
uNumTools
*
sizeof
(
TTTOOL_INFO
));
COMCTL32_
Free
(
oldTools
);
Free
(
oldTools
);
toolPtr
=
&
infoPtr
->
tools
[
infoPtr
->
uNumTools
];
}
...
...
@@ -792,7 +792,7 @@ TOOLTIPS_AddToolW (HWND hwnd, WPARAM wParam, LPARAM lParam)
INT
len
=
lstrlenW
(
lpToolInfo
->
lpszText
);
TRACE
(
"add text %s!
\n
"
,
debugstr_w
(
lpToolInfo
->
lpszText
));
toolPtr
->
lpszText
=
COMCTL32_
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
toolPtr
->
lpszText
=
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
strcpyW
(
toolPtr
->
lpszText
,
lpToolInfo
->
lpszText
);
}
}
...
...
@@ -845,7 +845,7 @@ TOOLTIPS_DelToolA (HWND hwnd, WPARAM wParam, LPARAM lParam)
if
((
toolPtr
->
hinst
)
&&
(
toolPtr
->
lpszText
))
{
if
(
(
toolPtr
->
lpszText
!=
LPSTR_TEXTCALLBACKW
)
&&
(
HIWORD
((
INT
)
toolPtr
->
lpszText
)
!=
0
)
)
COMCTL32_
Free
(
toolPtr
->
lpszText
);
Free
(
toolPtr
->
lpszText
);
}
/* remove subclassing */
...
...
@@ -860,13 +860,13 @@ TOOLTIPS_DelToolA (HWND hwnd, WPARAM wParam, LPARAM lParam)
/* delete tool from tool list */
if
(
infoPtr
->
uNumTools
==
1
)
{
COMCTL32_
Free
(
infoPtr
->
tools
);
Free
(
infoPtr
->
tools
);
infoPtr
->
tools
=
NULL
;
}
else
{
TTTOOL_INFO
*
oldTools
=
infoPtr
->
tools
;
infoPtr
->
tools
=
COMCTL32_
Alloc
(
sizeof
(
TTTOOL_INFO
)
*
(
infoPtr
->
uNumTools
-
1
));
Alloc
(
sizeof
(
TTTOOL_INFO
)
*
(
infoPtr
->
uNumTools
-
1
));
if
(
nTool
>
0
)
memcpy
(
&
infoPtr
->
tools
[
0
],
&
oldTools
[
0
],
...
...
@@ -876,7 +876,7 @@ TOOLTIPS_DelToolA (HWND hwnd, WPARAM wParam, LPARAM lParam)
memcpy
(
&
infoPtr
->
tools
[
nTool
],
&
oldTools
[
nTool
+
1
],
(
infoPtr
->
uNumTools
-
nTool
-
1
)
*
sizeof
(
TTTOOL_INFO
));
COMCTL32_
Free
(
oldTools
);
Free
(
oldTools
);
}
/* destroying tool that mouse was on on last relayed mouse move */
...
...
@@ -920,7 +920,7 @@ TOOLTIPS_DelToolW (HWND hwnd, WPARAM wParam, LPARAM lParam)
if
((
toolPtr
->
hinst
)
&&
(
toolPtr
->
lpszText
))
{
if
(
(
toolPtr
->
lpszText
!=
LPSTR_TEXTCALLBACKW
)
&&
(
HIWORD
((
INT
)
toolPtr
->
lpszText
)
!=
0
)
)
COMCTL32_
Free
(
toolPtr
->
lpszText
);
Free
(
toolPtr
->
lpszText
);
}
/* remove subclassing */
...
...
@@ -935,13 +935,13 @@ TOOLTIPS_DelToolW (HWND hwnd, WPARAM wParam, LPARAM lParam)
/* delete tool from tool list */
if
(
infoPtr
->
uNumTools
==
1
)
{
COMCTL32_
Free
(
infoPtr
->
tools
);
Free
(
infoPtr
->
tools
);
infoPtr
->
tools
=
NULL
;
}
else
{
TTTOOL_INFO
*
oldTools
=
infoPtr
->
tools
;
infoPtr
->
tools
=
COMCTL32_
Alloc
(
sizeof
(
TTTOOL_INFO
)
*
(
infoPtr
->
uNumTools
-
1
));
Alloc
(
sizeof
(
TTTOOL_INFO
)
*
(
infoPtr
->
uNumTools
-
1
));
if
(
nTool
>
0
)
memcpy
(
&
infoPtr
->
tools
[
0
],
&
oldTools
[
0
],
...
...
@@ -951,7 +951,7 @@ TOOLTIPS_DelToolW (HWND hwnd, WPARAM wParam, LPARAM lParam)
memcpy
(
&
infoPtr
->
tools
[
nTool
],
&
oldTools
[
nTool
+
1
],
(
infoPtr
->
uNumTools
-
nTool
-
1
)
*
sizeof
(
TTTOOL_INFO
));
COMCTL32_
Free
(
oldTools
);
Free
(
oldTools
);
}
/* destroying tool that mouse was on on last relayed mouse move */
...
...
@@ -1642,13 +1642,13 @@ TOOLTIPS_SetToolInfoA (HWND hwnd, WPARAM wParam, LPARAM lParam)
else
{
if
(
(
toolPtr
->
lpszText
)
&&
(
HIWORD
((
INT
)
toolPtr
->
lpszText
)
!=
0
)
)
{
COMCTL32_
Free
(
toolPtr
->
lpszText
);
Free
(
toolPtr
->
lpszText
);
toolPtr
->
lpszText
=
NULL
;
}
if
(
lpToolInfo
->
lpszText
)
{
INT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpToolInfo
->
lpszText
,
-
1
,
NULL
,
0
);
toolPtr
->
lpszText
=
COMCTL32_
Alloc
(
len
*
sizeof
(
WCHAR
));
toolPtr
->
lpszText
=
Alloc
(
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
lpToolInfo
->
lpszText
,
-
1
,
toolPtr
->
lpszText
,
len
);
}
...
...
@@ -1699,12 +1699,12 @@ TOOLTIPS_SetToolInfoW (HWND hwnd, WPARAM wParam, LPARAM lParam)
else
{
if
(
(
toolPtr
->
lpszText
)
&&
(
HIWORD
((
INT
)
toolPtr
->
lpszText
)
!=
0
)
)
{
COMCTL32_
Free
(
toolPtr
->
lpszText
);
Free
(
toolPtr
->
lpszText
);
toolPtr
->
lpszText
=
NULL
;
}
if
(
lpToolInfo
->
lpszText
)
{
INT
len
=
lstrlenW
(
lpToolInfo
->
lpszText
);
toolPtr
->
lpszText
=
COMCTL32_
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
toolPtr
->
lpszText
=
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
strcpyW
(
toolPtr
->
lpszText
,
lpToolInfo
->
lpszText
);
}
}
...
...
@@ -1814,13 +1814,13 @@ TOOLTIPS_UpdateTipTextA (HWND hwnd, WPARAM wParam, LPARAM lParam)
else
{
if
(
(
toolPtr
->
lpszText
)
&&
(
HIWORD
((
INT
)
toolPtr
->
lpszText
)
!=
0
)
)
{
COMCTL32_
Free
(
toolPtr
->
lpszText
);
Free
(
toolPtr
->
lpszText
);
toolPtr
->
lpszText
=
NULL
;
}
if
(
lpToolInfo
->
lpszText
)
{
INT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpToolInfo
->
lpszText
,
-
1
,
NULL
,
0
);
toolPtr
->
lpszText
=
COMCTL32_
Alloc
(
len
*
sizeof
(
WCHAR
));
toolPtr
->
lpszText
=
Alloc
(
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
lpToolInfo
->
lpszText
,
-
1
,
toolPtr
->
lpszText
,
len
);
}
...
...
@@ -1871,12 +1871,12 @@ TOOLTIPS_UpdateTipTextW (HWND hwnd, WPARAM wParam, LPARAM lParam)
else
{
if
(
(
toolPtr
->
lpszText
)
&&
(
HIWORD
((
INT
)
toolPtr
->
lpszText
)
!=
0
)
)
{
COMCTL32_
Free
(
toolPtr
->
lpszText
);
Free
(
toolPtr
->
lpszText
);
toolPtr
->
lpszText
=
NULL
;
}
if
(
lpToolInfo
->
lpszText
)
{
INT
len
=
lstrlenW
(
lpToolInfo
->
lpszText
);
toolPtr
->
lpszText
=
COMCTL32_
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
toolPtr
->
lpszText
=
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
strcpyW
(
toolPtr
->
lpszText
,
lpToolInfo
->
lpszText
);
}
}
...
...
@@ -1910,7 +1910,7 @@ TOOLTIPS_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
HWND
hParent
;
/* allocate memory for info structure */
infoPtr
=
(
TOOLTIPS_INFO
*
)
COMCTL32_
Alloc
(
sizeof
(
TOOLTIPS_INFO
));
infoPtr
=
(
TOOLTIPS_INFO
*
)
Alloc
(
sizeof
(
TOOLTIPS_INFO
));
SetWindowLongA
(
hwnd
,
0
,
(
DWORD
)
infoPtr
);
/* initialize info structure */
...
...
@@ -1968,7 +1968,7 @@ TOOLTIPS_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
if
(
(
toolPtr
->
lpszText
!=
LPSTR_TEXTCALLBACKW
)
&&
(
HIWORD
((
INT
)
toolPtr
->
lpszText
)
!=
0
)
)
{
COMCTL32_
Free
(
toolPtr
->
lpszText
);
Free
(
toolPtr
->
lpszText
);
toolPtr
->
lpszText
=
NULL
;
}
}
...
...
@@ -1983,14 +1983,14 @@ TOOLTIPS_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
}
}
}
COMCTL32_
Free
(
infoPtr
->
tools
);
Free
(
infoPtr
->
tools
);
}
/* delete font */
DeleteObject
(
infoPtr
->
hFont
);
/* free tool tips info data */
COMCTL32_
Free
(
infoPtr
);
Free
(
infoPtr
);
SetWindowLongA
(
hwnd
,
0
,
0
);
return
0
;
}
...
...
dlls/comctl32/trackbar.c
View file @
7de279a7
...
...
@@ -115,14 +115,14 @@ static void TRACKBAR_RecalculateTics (TRACKBAR_INFO *infoPtr)
nrTics
=
(
infoPtr
->
lRangeMax
-
infoPtr
->
lRangeMin
)
/
infoPtr
->
uTicFreq
;
else
{
nrTics
=
0
;
COMCTL32_
Free
(
infoPtr
->
tics
);
Free
(
infoPtr
->
tics
);
infoPtr
->
tics
=
NULL
;
infoPtr
->
uNumTics
=
0
;
return
;
}
if
(
nrTics
!=
infoPtr
->
uNumTics
)
{
infoPtr
->
tics
=
COMCTL32_
ReAlloc
(
infoPtr
->
tics
,
infoPtr
->
tics
=
ReAlloc
(
infoPtr
->
tics
,
(
nrTics
+
1
)
*
sizeof
(
DWORD
));
if
(
!
infoPtr
->
tics
)
{
infoPtr
->
uNumTics
=
0
;
...
...
@@ -908,7 +908,7 @@ static LRESULT
TRACKBAR_ClearTics
(
TRACKBAR_INFO
*
infoPtr
,
BOOL
fRedraw
)
{
if
(
infoPtr
->
tics
)
{
COMCTL32_
Free
(
infoPtr
->
tics
);
Free
(
infoPtr
->
tics
);
infoPtr
->
tics
=
NULL
;
infoPtr
->
uNumTics
=
0
;
}
...
...
@@ -1192,7 +1192,7 @@ TRACKBAR_SetTic (TRACKBAR_INFO *infoPtr, LONG lPos)
TRACE
(
"lPos=%ld
\n
"
,
lPos
);
infoPtr
->
uNumTics
++
;
infoPtr
->
tics
=
COMCTL32_
ReAlloc
(
infoPtr
->
tics
,
infoPtr
->
tics
=
ReAlloc
(
infoPtr
->
tics
,
(
infoPtr
->
uNumTics
)
*
sizeof
(
DWORD
));
if
(
!
infoPtr
->
tics
)
{
infoPtr
->
uNumTics
=
0
;
...
...
@@ -1285,7 +1285,7 @@ TRACKBAR_Create (HWND hwnd, LPCREATESTRUCTW lpcs)
TRACKBAR_INFO
*
infoPtr
;
DWORD
oldStyle
,
newStyle
;
infoPtr
=
(
TRACKBAR_INFO
*
)
COMCTL32_
Alloc
(
sizeof
(
TRACKBAR_INFO
));
infoPtr
=
(
TRACKBAR_INFO
*
)
Alloc
(
sizeof
(
TRACKBAR_INFO
));
if
(
!
infoPtr
)
return
-
1
;
SetWindowLongW
(
hwnd
,
0
,
(
DWORD
)
infoPtr
);
...
...
@@ -1348,7 +1348,7 @@ TRACKBAR_Destroy (TRACKBAR_INFO *infoPtr)
if
(
infoPtr
->
hwndToolTip
)
DestroyWindow
(
infoPtr
->
hwndToolTip
);
COMCTL32_
Free
(
infoPtr
);
Free
(
infoPtr
);
SetWindowLongW
(
infoPtr
->
hwndSelf
,
0
,
0
);
return
0
;
}
...
...
dlls/comctl32/treeview.c
View file @
7de279a7
...
...
@@ -486,7 +486,7 @@ TREEVIEW_TVItemFromItem(TREEVIEW_INFO *infoPtr, UINT mask, TVITEMA *tvItem, TREE
if
(
infoPtr
->
bNtfUnicode
)
{
INT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
item
->
pszText
,
-
1
,
NULL
,
0
);
if
(
len
>
1
)
{
tvItem
->
pszText
=
(
LPSTR
)
COMCTL32_
Alloc
(
len
*
sizeof
(
WCHAR
));
tvItem
->
pszText
=
(
LPSTR
)
Alloc
(
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
item
->
pszText
,
-
1
,
(
LPWSTR
)
tvItem
->
pszText
,
len
*
sizeof
(
WCHAR
)
);
}
}
...
...
@@ -525,8 +525,8 @@ TREEVIEW_SendTreeviewNotify(TREEVIEW_INFO *infoPtr, UINT code, UINT action,
(
WPARAM
)
GetWindowLongA
(
hwnd
,
GWL_ID
),
(
LPARAM
)
&
nmhdr
);
if
(
infoPtr
->
bNtfUnicode
)
{
COMCTL32_
Free
(
nmhdr
.
itemOld
.
pszText
);
COMCTL32_
Free
(
nmhdr
.
itemNew
.
pszText
);
Free
(
nmhdr
.
itemOld
.
pszText
);
Free
(
nmhdr
.
itemNew
.
pszText
);
}
return
ret
;
}
...
...
@@ -658,7 +658,7 @@ TREEVIEW_BeginLabelEditNotify(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *editItem)
if
(
infoPtr
->
bNtfUnicode
)
{
INT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
editItem
->
pszText
,
-
1
,
NULL
,
0
);
if
(
len
>
1
)
{
tvdi
.
item
.
pszText
=
allocated
=
(
LPSTR
)
COMCTL32_
Alloc
(
len
*
sizeof
(
WCHAR
));
tvdi
.
item
.
pszText
=
allocated
=
(
LPSTR
)
Alloc
(
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
editItem
->
pszText
,
-
1
,
(
LPWSTR
)
tvdi
.
item
.
pszText
,
len
*
sizeof
(
WCHAR
)
);
tvdi
.
item
.
cchTextMax
=
len
*
sizeof
(
WCHAR
);
}
...
...
@@ -676,7 +676,7 @@ TREEVIEW_BeginLabelEditNotify(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *editItem)
tvdi
.
hdr
.
idFrom
,
(
LPARAM
)
&
tvdi
);
if
(
allocated
)
COMCTL32_
Free
(
allocated
);
Free
(
allocated
);
return
ret
;
}
...
...
@@ -725,7 +725,7 @@ TREEVIEW_UpdateDispInfo(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
(
LPWSTR
)
callback
.
item
.
pszText
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
buflen
=
max
((
len
+
1
)
*
sizeof
(
WCHAR
),
TEXT_CALLBACK_SIZE
);
newText
=
(
LPWSTR
)
COMCTL32_
ReAlloc
(
wineItem
->
pszText
,
buflen
);
newText
=
(
LPWSTR
)
ReAlloc
(
wineItem
->
pszText
,
buflen
);
TRACE
(
"returned wstr %s, len=%d, buflen=%d
\n
"
,
debugstr_w
((
LPWSTR
)
callback
.
item
.
pszText
),
len
,
buflen
);
...
...
@@ -744,7 +744,7 @@ TREEVIEW_UpdateDispInfo(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
else
{
int
len
=
max
(
lstrlenA
(
callback
.
item
.
pszText
)
+
1
,
TEXT_CALLBACK_SIZE
);
LPSTR
newText
=
COMCTL32_
ReAlloc
(
wineItem
->
pszText
,
len
);
LPSTR
newText
=
ReAlloc
(
wineItem
->
pszText
,
len
);
TRACE
(
"returned str %s, len=%d
\n
"
,
debugstr_a
(
callback
.
item
.
pszText
),
len
);
...
...
@@ -768,7 +768,7 @@ TREEVIEW_UpdateDispInfo(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
(
LPWSTR
)
callback
.
item
.
pszText
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
buflen
=
max
((
len
+
1
)
*
sizeof
(
WCHAR
),
TEXT_CALLBACK_SIZE
);
newText
=
(
LPWSTR
)
COMCTL32_
Alloc
(
buflen
);
newText
=
(
LPWSTR
)
Alloc
(
buflen
);
TRACE
(
"same buffer wstr %s, len=%d, buflen=%d
\n
"
,
debugstr_w
((
LPWSTR
)
callback
.
item
.
pszText
),
len
,
buflen
);
...
...
@@ -782,7 +782,7 @@ TREEVIEW_UpdateDispInfo(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
wineItem
->
pszText
,
buflen
,
NULL
,
NULL
);
wineItem
->
cchTextMax
=
buflen
;
if
(
oldText
)
COMCTL32_
Free
(
oldText
);
Free
(
oldText
);
}
}
}
...
...
@@ -969,14 +969,14 @@ TREEVIEW_UpdateSubTree(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *root)
static
TREEVIEW_ITEM
*
TREEVIEW_AllocateItem
(
TREEVIEW_INFO
*
infoPtr
)
{
TREEVIEW_ITEM
*
newItem
=
COMCTL32_
Alloc
(
sizeof
(
TREEVIEW_ITEM
));
TREEVIEW_ITEM
*
newItem
=
Alloc
(
sizeof
(
TREEVIEW_ITEM
));
if
(
!
newItem
)
return
NULL
;
if
(
DPA_InsertPtr
(
infoPtr
->
items
,
INT_MAX
,
newItem
)
==
-
1
)
{
COMCTL32_
Free
(
newItem
);
Free
(
newItem
);
return
NULL
;
}
...
...
@@ -989,7 +989,7 @@ static void
TREEVIEW_FreeItem
(
TREEVIEW_INFO
*
infoPtr
,
TREEVIEW_ITEM
*
item
)
{
DPA_DeletePtr
(
infoPtr
->
items
,
DPA_GetPtrIndex
(
infoPtr
->
items
,
item
));
COMCTL32_
Free
(
item
);
Free
(
item
);
if
(
infoPtr
->
selectedItem
==
item
)
infoPtr
->
selectedItem
=
NULL
;
if
(
infoPtr
->
hotItem
==
item
)
...
...
@@ -1087,7 +1087,7 @@ TREEVIEW_DoSetItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
if
(
tvItem
->
pszText
!=
LPSTR_TEXTCALLBACKA
)
{
int
len
=
lstrlenA
(
tvItem
->
pszText
)
+
1
;
LPSTR
newText
=
COMCTL32_
ReAlloc
(
wineItem
->
pszText
,
len
);
LPSTR
newText
=
ReAlloc
(
wineItem
->
pszText
,
len
);
if
(
newText
==
NULL
)
return
FALSE
;
...
...
@@ -1103,7 +1103,7 @@ TREEVIEW_DoSetItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
{
callbackSet
|=
TVIF_TEXT
;
wineItem
->
pszText
=
COMCTL32_
ReAlloc
(
wineItem
->
pszText
,
wineItem
->
pszText
=
ReAlloc
(
wineItem
->
pszText
,
TEXT_CALLBACK_SIZE
);
wineItem
->
cchTextMax
=
TEXT_CALLBACK_SIZE
;
TRACE
(
"setting callback, item %p
\n
"
,
...
...
@@ -1394,7 +1394,7 @@ TREEVIEW_InsertItemW(TREEVIEW_INFO *infoPtr, LPARAM lParam)
{
int
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
tvisW
->
DUMMYUNIONNAME
.
item
.
pszText
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
tvisA
.
DUMMYUNIONNAME
.
item
.
pszText
=
COMCTL32_
Alloc
(
len
);
tvisA
.
DUMMYUNIONNAME
.
item
.
pszText
=
Alloc
(
len
);
WideCharToMultiByte
(
CP_ACP
,
0
,
tvisW
->
DUMMYUNIONNAME
.
item
.
pszText
,
-
1
,
tvisA
.
DUMMYUNIONNAME
.
item
.
pszText
,
len
,
NULL
,
NULL
);
}
...
...
@@ -1415,7 +1415,7 @@ TREEVIEW_InsertItemW(TREEVIEW_INFO *infoPtr, LPARAM lParam)
if
(
tvisA
.
DUMMYUNIONNAME
.
item
.
pszText
!=
LPSTR_TEXTCALLBACKA
)
{
COMCTL32_
Free
(
tvisA
.
DUMMYUNIONNAME
.
item
.
pszText
);
Free
(
tvisA
.
DUMMYUNIONNAME
.
item
.
pszText
);
}
return
lRes
;
...
...
@@ -1487,7 +1487,7 @@ TREEVIEW_RemoveItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem)
infoPtr
->
uNumItems
--
;
if
(
wineItem
->
pszText
!=
LPSTR_TEXTCALLBACKA
)
COMCTL32_
Free
(
wineItem
->
pszText
);
Free
(
wineItem
->
pszText
);
TREEVIEW_FreeItem
(
infoPtr
,
wineItem
);
}
...
...
@@ -3714,7 +3714,7 @@ TREEVIEW_EndEditLabelNow(TREEVIEW_INFO *infoPtr, BOOL bCancel)
{
if
(
strcmp
(
tmpText
,
editedItem
->
pszText
)
!=
0
)
{
if
(
NULL
==
COMCTL32_
ReAlloc
(
editedItem
->
pszText
,
iLength
+
1
))
if
(
NULL
==
ReAlloc
(
editedItem
->
pszText
,
iLength
+
1
))
{
ERR
(
"OutOfMemory, cannot allocate space for label
\n
"
);
DestroyWindow
(
infoPtr
->
hwndEdit
);
...
...
@@ -4737,7 +4737,7 @@ TREEVIEW_Create(HWND hwnd)
TRACE
(
"wnd %p, style %lx
\n
"
,
hwnd
,
GetWindowLongA
(
hwnd
,
GWL_STYLE
));
infoPtr
=
(
TREEVIEW_INFO
*
)
COMCTL32_
Alloc
(
sizeof
(
TREEVIEW_INFO
));
infoPtr
=
(
TREEVIEW_INFO
*
)
Alloc
(
sizeof
(
TREEVIEW_INFO
));
if
(
infoPtr
==
NULL
)
{
...
...
@@ -4890,7 +4890,7 @@ TREEVIEW_Destroy(TREEVIEW_INFO *infoPtr)
SetWindowLongA
(
infoPtr
->
hwnd
,
0
,
(
LONG
)
NULL
);
DeleteObject
(
infoPtr
->
hBoldFont
);
COMCTL32_
Free
(
infoPtr
);
Free
(
infoPtr
);
return
0
;
}
...
...
dlls/comctl32/updown.c
View file @
7de279a7
...
...
@@ -715,7 +715,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam,
{
case
WM_CREATE
:
SetWindowLongW
(
hwnd
,
GWL_STYLE
,
dwStyle
&
~
WS_BORDER
);
infoPtr
=
(
UPDOWN_INFO
*
)
COMCTL32_
Alloc
(
sizeof
(
UPDOWN_INFO
));
infoPtr
=
(
UPDOWN_INFO
*
)
Alloc
(
sizeof
(
UPDOWN_INFO
));
SetWindowLongW
(
hwnd
,
0
,
(
DWORD
)
infoPtr
);
/* initialize the info struct */
...
...
@@ -738,11 +738,11 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam,
break
;
case
WM_DESTROY
:
if
(
infoPtr
->
AccelVect
)
COMCTL32_
Free
(
infoPtr
->
AccelVect
);
if
(
infoPtr
->
AccelVect
)
Free
(
infoPtr
->
AccelVect
);
if
(
infoPtr
->
Buddy
)
RemovePropA
(
infoPtr
->
Buddy
,
BUDDY_UPDOWN_HWND
);
COMCTL32_
Free
(
infoPtr
);
Free
(
infoPtr
);
SetWindowLongW
(
hwnd
,
0
,
0
);
TRACE
(
"UpDown Ctrl destruction, hwnd=%p
\n
"
,
hwnd
);
break
;
...
...
@@ -834,12 +834,12 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam,
case
UDM_SETACCEL
:
TRACE
(
"UpDown Ctrl new accel info, hwnd=%p
\n
"
,
hwnd
);
if
(
infoPtr
->
AccelVect
)
{
COMCTL32_
Free
(
infoPtr
->
AccelVect
);
Free
(
infoPtr
->
AccelVect
);
infoPtr
->
AccelCount
=
0
;
infoPtr
->
AccelVect
=
0
;
}
if
(
wParam
==
0
)
return
TRUE
;
infoPtr
->
AccelVect
=
COMCTL32_
Alloc
(
wParam
*
sizeof
(
UDACCEL
));
infoPtr
->
AccelVect
=
Alloc
(
wParam
*
sizeof
(
UDACCEL
));
if
(
infoPtr
->
AccelVect
==
0
)
return
FALSE
;
memcpy
(
infoPtr
->
AccelVect
,
(
void
*
)
lParam
,
wParam
*
sizeof
(
UDACCEL
));
return
TRUE
;
...
...
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