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
8df71a6c
Commit
8df71a6c
authored
Mar 25, 2005
by
Dimitrie O. Paun
Committed by
Alexandre Julliard
Mar 25, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use {Alloc,ReAlloc,Free}() instead of Heap{Alloc,ReAlloc,Free}().
parent
0b3b3511
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
68 additions
and
73 deletions
+68
-73
animate.c
dlls/comctl32/animate.c
+12
-13
commctrl.c
dlls/comctl32/commctrl.c
+8
-8
imagelist.c
dlls/comctl32/imagelist.c
+5
-5
listview.c
dlls/comctl32/listview.c
+4
-5
propsheet.c
dlls/comctl32/propsheet.c
+13
-13
syslink.c
dlls/comctl32/syslink.c
+15
-18
toolbar.c
dlls/comctl32/toolbar.c
+11
-11
No files found.
dlls/comctl32/animate.c
View file @
8df71a6c
...
...
@@ -190,19 +190,19 @@ static void ANIMATE_Free(ANIMATE_INFO *infoPtr)
FreeResource
(
infoPtr
->
hRes
);
infoPtr
->
hRes
=
0
;
}
HeapFree
(
GetProcessHeap
(),
0
,
infoPtr
->
lpIndex
);
Free
(
infoPtr
->
lpIndex
);
infoPtr
->
lpIndex
=
NULL
;
if
(
infoPtr
->
hic
)
{
fnIC
.
fnICClose
(
infoPtr
->
hic
);
infoPtr
->
hic
=
0
;
}
HeapFree
(
GetProcessHeap
(),
0
,
infoPtr
->
inbih
);
Free
(
infoPtr
->
inbih
);
infoPtr
->
inbih
=
NULL
;
HeapFree
(
GetProcessHeap
(),
0
,
infoPtr
->
outbih
);
Free
(
infoPtr
->
outbih
);
infoPtr
->
outbih
=
NULL
;
HeapFree
(
GetProcessHeap
(),
0
,
infoPtr
->
indata
);
Free
(
infoPtr
->
indata
);
infoPtr
->
indata
=
NULL
;
HeapFree
(
GetProcessHeap
(),
0
,
infoPtr
->
outdata
);
Free
(
infoPtr
->
outdata
);
infoPtr
->
outdata
=
NULL
;
if
(
infoPtr
->
hbmPrevFrame
)
{
...
...
@@ -557,7 +557,7 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr)
return
FALSE
;
}
infoPtr
->
inbih
=
HeapAlloc
(
GetProcessHeap
(),
0
,
mmckInfo
.
cksize
);
infoPtr
->
inbih
=
Alloc
(
mmckInfo
.
cksize
);
if
(
!
infoPtr
->
inbih
)
{
WARN
(
"Can't alloc input BIH
\n
"
);
return
FALSE
;
...
...
@@ -604,8 +604,7 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr)
/* FIXME: should handle the 'rec ' LIST when present */
infoPtr
->
lpIndex
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
infoPtr
->
mah
.
dwTotalFrames
*
sizeof
(
DWORD
));
infoPtr
->
lpIndex
=
Alloc
(
infoPtr
->
mah
.
dwTotalFrames
*
sizeof
(
DWORD
));
if
(
!
infoPtr
->
lpIndex
)
return
FALSE
;
...
...
@@ -627,7 +626,7 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr)
infoPtr
->
ash
.
dwSuggestedBufferSize
=
insize
;
}
infoPtr
->
indata
=
HeapAlloc
(
GetProcessHeap
(),
0
,
infoPtr
->
ash
.
dwSuggestedBufferSize
);
infoPtr
->
indata
=
Alloc
(
infoPtr
->
ash
.
dwSuggestedBufferSize
);
if
(
!
infoPtr
->
indata
)
return
FALSE
;
...
...
@@ -658,7 +657,7 @@ static BOOL ANIMATE_GetAviCodec(ANIMATE_INFO *infoPtr)
outSize
=
fnIC
.
fnICSendMessage
(
infoPtr
->
hic
,
ICM_DECOMPRESS_GET_FORMAT
,
(
DWORD
)
infoPtr
->
inbih
,
0L
);
infoPtr
->
outbih
=
HeapAlloc
(
GetProcessHeap
(),
0
,
outSize
);
infoPtr
->
outbih
=
Alloc
(
outSize
);
if
(
!
infoPtr
->
outbih
)
return
FALSE
;
...
...
@@ -669,7 +668,7 @@ static BOOL ANIMATE_GetAviCodec(ANIMATE_INFO *infoPtr)
return
FALSE
;
}
infoPtr
->
outdata
=
HeapAlloc
(
GetProcessHeap
(),
0
,
infoPtr
->
outbih
->
biSizeImage
);
infoPtr
->
outdata
=
Alloc
(
infoPtr
->
outbih
->
biSizeImage
);
if
(
!
infoPtr
->
outdata
)
return
FALSE
;
...
...
@@ -757,12 +756,12 @@ static BOOL ANIMATE_OpenA(ANIMATE_INFO *infoPtr, HINSTANCE hInstance, LPSTR lpsz
return
ANIMATE_OpenW
(
infoPtr
,
hInstance
,
(
LPWSTR
)
lpszName
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszName
,
-
1
,
NULL
,
0
);
lpwszName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
lpwszName
=
Alloc
(
len
*
sizeof
(
WCHAR
));
if
(
!
lpwszName
)
return
FALSE
;
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszName
,
-
1
,
lpwszName
,
len
);
result
=
ANIMATE_OpenW
(
infoPtr
,
hInstance
,
lpwszName
);
HeapFree
(
GetProcessHeap
(),
0
,
lpwszName
);
Free
(
lpwszName
);
return
result
;
}
...
...
dlls/comctl32/commctrl.c
View file @
8df71a6c
...
...
@@ -514,12 +514,12 @@ void WINAPI DrawStatusTextA (HDC hdc, LPRECT lprc, LPCSTR text, UINT style)
if
(
text
)
{
if
(
(
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
text
,
-
1
,
NULL
,
0
))
)
{
if
(
(
textW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
))
)
if
(
(
textW
=
Alloc
(
len
*
sizeof
(
WCHAR
)
))
)
MultiByteToWideChar
(
CP_ACP
,
0
,
text
,
-
1
,
textW
,
len
);
}
}
DrawStatusTextW
(
hdc
,
lprc
,
textW
,
style
);
HeapFree
(
GetProcessHeap
(),
0
,
textW
);
Free
(
textW
);
}
...
...
@@ -1107,7 +1107,7 @@ BOOL WINAPI SetWindowSubclass (HWND hWnd, SUBCLASSPROC pfnSubclass,
stack
=
(
LPSUBCLASS_INFO
)
GetPropW
(
hWnd
,
COMCTL32_wSubclass
);
if
(
!
stack
)
{
/* allocate stack */
stack
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
SUBCLASS_INFO
));
stack
=
Alloc
(
sizeof
(
SUBCLASS_INFO
));
if
(
!
stack
)
{
ERR
(
"Failed to allocate our Subclassing stack
\n
"
);
return
FALSE
;
...
...
@@ -1136,14 +1136,14 @@ BOOL WINAPI SetWindowSubclass (HWND hWnd, SUBCLASSPROC pfnSubclass,
}
}
proc
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
SUBCLASSPROCS
));
proc
=
Alloc
(
sizeof
(
SUBCLASSPROCS
));
if
(
!
proc
)
{
ERR
(
"Failed to allocate subclass entry in stack
\n
"
);
if
(
IsWindowUnicode
(
hWnd
))
SetWindowLongPtrW
(
hWnd
,
GWLP_WNDPROC
,
(
DWORD_PTR
)
stack
->
origproc
);
else
SetWindowLongPtrA
(
hWnd
,
GWLP_WNDPROC
,
(
DWORD_PTR
)
stack
->
origproc
);
HeapFree
(
GetProcessHeap
(),
0
,
stack
);
Free
(
stack
);
RemovePropW
(
hWnd
,
COMCTL32_wSubclass
);
return
FALSE
;
}
...
...
@@ -1243,7 +1243,7 @@ BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR u
if
(
stack
->
stackpos
==
proc
)
stack
->
stackpos
=
stack
->
stackpos
->
next
;
HeapFree
(
GetProcessHeap
(),
0
,
proc
);
Free
(
proc
);
ret
=
TRUE
;
break
;
}
...
...
@@ -1258,7 +1258,7 @@ BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR u
SetWindowLongPtrW
(
hWnd
,
GWLP_WNDPROC
,
(
DWORD_PTR
)
stack
->
origproc
);
else
SetWindowLongPtrA
(
hWnd
,
GWLP_WNDPROC
,
(
DWORD_PTR
)
stack
->
origproc
);
HeapFree
(
GetProcessHeap
(),
0
,
stack
);
Free
(
stack
);
RemovePropW
(
hWnd
,
COMCTL32_wSubclass
);
}
...
...
@@ -1300,7 +1300,7 @@ LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
SetWindowLongPtrW
(
hWnd
,
GWLP_WNDPROC
,
(
DWORD_PTR
)
stack
->
origproc
);
else
SetWindowLongPtrA
(
hWnd
,
GWLP_WNDPROC
,
(
DWORD_PTR
)
stack
->
origproc
);
HeapFree
(
GetProcessHeap
(),
0
,
stack
);
Free
(
stack
);
RemovePropW
(
hWnd
,
COMCTL32_wSubclass
);
}
return
ret
;
...
...
dlls/comctl32/imagelist.c
View file @
8df71a6c
...
...
@@ -1598,11 +1598,11 @@ ImageList_LoadImageA (HINSTANCE hi, LPCSTR lpbmp, INT cx, INT cGrow,
uType
,
uFlags
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpbmp
,
-
1
,
NULL
,
0
);
lpbmpW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
lpbmpW
=
Alloc
(
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
lpbmp
,
-
1
,
lpbmpW
,
len
);
himl
=
ImageList_LoadImageW
(
hi
,
lpbmpW
,
cx
,
cGrow
,
clrMask
,
uType
,
uFlags
);
HeapFree
(
GetProcessHeap
(),
0
,
lpbmpW
);
Free
(
lpbmpW
);
return
himl
;
}
...
...
@@ -2790,7 +2790,7 @@ static HBITMAP ImageList_CreateImage(HDC hdc, HIMAGELIST himl, UINT width, UINT
BYTE
temp
;
colors
=
1
<<
himl
->
uBitsPixel
;
bmi
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
BITMAPINFOHEADER
)
+
bmi
=
Alloc
(
sizeof
(
BITMAPINFOHEADER
)
+
sizeof
(
PALETTEENTRY
)
*
colors
);
pal
=
(
LPPALETTEENTRY
)
bmi
->
bmiColors
;
...
...
@@ -2807,7 +2807,7 @@ static HBITMAP ImageList_CreateImage(HDC hdc, HIMAGELIST himl, UINT width, UINT
}
else
{
bmi
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
BITMAPINFOHEADER
));
bmi
=
Alloc
(
sizeof
(
BITMAPINFOHEADER
));
}
bmi
->
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFOHEADER
);
...
...
@@ -2824,7 +2824,7 @@ static HBITMAP ImageList_CreateImage(HDC hdc, HIMAGELIST himl, UINT width, UINT
hbmNewBitmap
=
CreateDIBSection
(
hdc
,
bmi
,
DIB_RGB_COLORS
,
&
bits
,
0
,
0
);
HeapFree
(
GetProcessHeap
(),
0
,
bmi
);
Free
(
bmi
);
}
else
/*if (ilc == ILC_COLORDDB)*/
{
...
...
dlls/comctl32/listview.c
View file @
8df71a6c
...
...
@@ -440,7 +440,7 @@ static inline LPWSTR textdupTtoW(LPCWSTR text, BOOL isW)
if
(
!
isW
&&
is_textT
(
text
,
isW
))
{
INT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
(
LPCSTR
)
text
,
-
1
,
NULL
,
0
);
wstr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
wstr
=
Alloc
(
len
*
sizeof
(
WCHAR
));
if
(
wstr
)
MultiByteToWideChar
(
CP_ACP
,
0
,
(
LPCSTR
)
text
,
-
1
,
wstr
,
len
);
}
TRACE
(
" wstr=%s
\n
"
,
text
==
LPSTR_TEXTCALLBACKW
?
"(callback)"
:
debugstr_w
(
wstr
));
...
...
@@ -449,7 +449,7 @@ static inline LPWSTR textdupTtoW(LPCWSTR text, BOOL isW)
static
inline
void
textfreeT
(
LPWSTR
wstr
,
BOOL
isW
)
{
if
(
!
isW
&&
is_textT
(
wstr
,
isW
))
HeapFree
(
GetProcessHeap
(),
0
,
wstr
);
if
(
!
isW
&&
is_textT
(
wstr
,
isW
))
Free
(
wstr
);
}
/*
...
...
@@ -852,8 +852,7 @@ static BOOL notify_dispinfoT(LISTVIEW_INFO *infoPtr, INT notificationCode, LPNML
*
pdi
->
item
.
pszText
=
0
;
/* make sure we don't process garbage */
}
pszTempBuf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
convertToUnicode
?
sizeof
(
WCHAR
)
:
sizeof
(
CHAR
))
*
cchTempBufMax
);
pszTempBuf
=
Alloc
(
(
convertToUnicode
?
sizeof
(
WCHAR
)
:
sizeof
(
CHAR
))
*
cchTempBufMax
);
if
(
!
pszTempBuf
)
return
FALSE
;
if
(
convertToUnicode
)
...
...
@@ -886,7 +885,7 @@ static BOOL notify_dispinfoT(LISTVIEW_INFO *infoPtr, INT notificationCode, LPNML
savPszText
,
savCchTextMax
);
pdi
->
item
.
pszText
=
savPszText
;
/* restores our buffer */
pdi
->
item
.
cchTextMax
=
savCchTextMax
;
HeapFree
(
GetProcessHeap
(),
0
,
pszTempBuf
);
Free
(
pszTempBuf
);
}
return
bResult
;
}
...
...
dlls/comctl32/propsheet.c
View file @
8df71a6c
...
...
@@ -323,7 +323,7 @@ static void PROPSHEET_AtoW(LPCWSTR *tostr, LPCSTR frstr)
TRACE
(
"<%s>
\n
"
,
frstr
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
frstr
,
-
1
,
0
,
0
);
*
tostr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
*
tostr
=
Alloc
(
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
frstr
,
-
1
,
(
LPWSTR
)
*
tostr
,
len
);
}
...
...
@@ -357,7 +357,7 @@ static BOOL PROPSHEET_CollectSheetInfoA(LPCPROPSHEETHEADERA lppsh,
if
(
HIWORD
(
lppsh
->
pszCaption
))
{
int
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lppsh
->
pszCaption
,
-
1
,
NULL
,
0
);
psInfo
->
ppshheader
.
pszCaption
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
psInfo
->
ppshheader
.
pszCaption
=
Alloc
(
len
*
sizeof
(
WCHAR
)
);
MultiByteToWideChar
(
CP_ACP
,
0
,
lppsh
->
pszCaption
,
-
1
,
(
LPWSTR
)
psInfo
->
ppshheader
.
pszCaption
,
len
);
}
}
...
...
@@ -411,7 +411,7 @@ static BOOL PROPSHEET_CollectSheetInfoW(LPCPROPSHEETHEADERW lppsh,
if
(
HIWORD
(
lppsh
->
pszCaption
))
{
int
len
=
strlenW
(
lppsh
->
pszCaption
);
psInfo
->
ppshheader
.
pszCaption
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
WCHAR
)
);
psInfo
->
ppshheader
.
pszCaption
=
Alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
);
strcpyW
(
(
WCHAR
*
)
psInfo
->
ppshheader
.
pszCaption
,
lppsh
->
pszCaption
);
}
}
...
...
@@ -2422,7 +2422,7 @@ static BOOL PROPSHEET_RemovePage(HWND hwndDlg,
PROPSHEETPAGEW
*
psp
=
(
PROPSHEETPAGEW
*
)
psInfo
->
proppage
[
index
].
hpage
;
if
((
psp
->
dwFlags
&
PSP_USETITLE
)
&&
psInfo
->
proppage
[
index
].
pszText
)
HeapFree
(
GetProcessHeap
(),
0
,
(
LPVOID
)
psInfo
->
proppage
[
index
].
pszText
);
Free
(
(
LPVOID
)
psInfo
->
proppage
[
index
].
pszText
);
DestroyPropertySheetPage
(
psInfo
->
proppage
[
index
].
hpage
);
}
...
...
@@ -2693,7 +2693,7 @@ static void PROPSHEET_CleanUp(HWND hwndDlg)
TRACE
(
"
\n
"
);
if
(
!
psInfo
)
return
;
if
(
HIWORD
(
psInfo
->
ppshheader
.
pszCaption
))
HeapFree
(
GetProcessHeap
(),
0
,
(
LPVOID
)
psInfo
->
ppshheader
.
pszCaption
);
Free
(
(
LPVOID
)
psInfo
->
ppshheader
.
pszCaption
);
for
(
i
=
0
;
i
<
psInfo
->
nPages
;
i
++
)
{
...
...
@@ -2714,7 +2714,7 @@ static void PROPSHEET_CleanUp(HWND hwndDlg)
if
(
psp
)
{
if
((
psp
->
dwFlags
&
PSP_USETITLE
)
&&
psInfo
->
proppage
[
i
].
pszText
)
HeapFree
(
GetProcessHeap
(),
0
,
(
LPVOID
)
psInfo
->
proppage
[
i
].
pszText
);
Free
(
(
LPVOID
)
psInfo
->
proppage
[
i
].
pszText
);
DestroyPropertySheetPage
(
psInfo
->
proppage
[
i
].
hpage
);
}
...
...
@@ -2865,7 +2865,7 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(
{
int
len
=
strlen
(
lpPropSheetPage
->
u
.
pszTemplate
);
ppsp
->
u
.
pszTemplate
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
+
1
);
ppsp
->
u
.
pszTemplate
=
Alloc
(
len
+
1
);
strcpy
(
(
LPSTR
)
ppsp
->
u
.
pszTemplate
,
lpPropSheetPage
->
u
.
pszTemplate
);
}
if
(
(
ppsp
->
dwFlags
&
PSP_USEICONID
)
&&
HIWORD
(
ppsp
->
u2
.
pszIcon
)
)
...
...
@@ -2900,20 +2900,20 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage
{
int
len
=
strlenW
(
lpPropSheetPage
->
u
.
pszTemplate
);
ppsp
->
u
.
pszTemplate
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
WCHAR
)
);
ppsp
->
u
.
pszTemplate
=
Alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
);
strcpyW
(
(
WCHAR
*
)
ppsp
->
u
.
pszTemplate
,
lpPropSheetPage
->
u
.
pszTemplate
);
}
if
(
(
ppsp
->
dwFlags
&
PSP_USEICONID
)
&&
HIWORD
(
ppsp
->
u2
.
pszIcon
)
)
{
int
len
=
strlenW
(
lpPropSheetPage
->
u2
.
pszIcon
);
ppsp
->
u2
.
pszIcon
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
WCHAR
)
);
ppsp
->
u2
.
pszIcon
=
Alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
);
strcpyW
(
(
WCHAR
*
)
ppsp
->
u2
.
pszIcon
,
lpPropSheetPage
->
u2
.
pszIcon
);
}
if
((
ppsp
->
dwFlags
&
PSP_USETITLE
)
&&
HIWORD
(
ppsp
->
pszTitle
))
{
int
len
=
strlenW
(
lpPropSheetPage
->
pszTitle
);
ppsp
->
pszTitle
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
WCHAR
)
);
ppsp
->
pszTitle
=
Alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
);
strcpyW
(
(
WCHAR
*
)
ppsp
->
pszTitle
,
lpPropSheetPage
->
pszTitle
);
}
else
if
(
!
(
ppsp
->
dwFlags
&
PSP_USETITLE
)
)
...
...
@@ -2941,13 +2941,13 @@ BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage)
return
FALSE
;
if
(
!
(
psp
->
dwFlags
&
PSP_DLGINDIRECT
)
&&
HIWORD
(
psp
->
u
.
pszTemplate
)
)
HeapFree
(
GetProcessHeap
(),
0
,
(
LPVOID
)
psp
->
u
.
pszTemplate
);
Free
(
(
LPVOID
)
psp
->
u
.
pszTemplate
);
if
(
(
psp
->
dwFlags
&
PSP_USEICONID
)
&&
HIWORD
(
psp
->
u2
.
pszIcon
)
)
HeapFree
(
GetProcessHeap
(),
0
,
(
LPVOID
)
psp
->
u2
.
pszIcon
);
Free
(
(
LPVOID
)
psp
->
u2
.
pszIcon
);
if
((
psp
->
dwFlags
&
PSP_USETITLE
)
&&
HIWORD
(
psp
->
pszTitle
))
HeapFree
(
GetProcessHeap
(),
0
,
(
LPVOID
)
psp
->
pszTitle
);
Free
(
(
LPVOID
)
psp
->
pszTitle
);
Free
(
hPropPage
);
...
...
dlls/comctl32/syslink.c
View file @
8df71a6c
...
...
@@ -33,6 +33,7 @@
#include "winuser.h"
#include "winnls.h"
#include "commctrl.h"
#include "comctl32.h"
#include "wine/unicode.h"
#include "wine/debug.h"
...
...
@@ -40,10 +41,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(progress);
INT
WINAPI
StrCmpNIW
(
LPCWSTR
,
LPCWSTR
,
INT
);
#define SYSLINK_Alloc(size) HeapAlloc(GetProcessHeap(), 0, (size))
#define SYSLINK_Free(ptr) HeapFree(GetProcessHeap(), 0, (ptr))
#define SYSLINK_ReAlloc(ptr, size) HeapReAlloc(GetProcessHeap(), 0, ptr, (size))
typedef
struct
{
int
nChars
;
...
...
@@ -115,8 +112,8 @@ static VOID SYSLINK_FreeDocItem (PDOC_ITEM DocItem)
{
if
(
DocItem
->
Type
==
slLink
)
{
SYSLINK_
Free
(
DocItem
->
u
.
Link
.
szID
);
SYSLINK_
Free
(
DocItem
->
u
.
Link
.
szUrl
);
Free
(
DocItem
->
u
.
Link
.
szID
);
Free
(
DocItem
->
u
.
Link
.
szUrl
);
}
if
(
DocItem
->
Type
==
slLink
&&
DocItem
->
u
.
Link
.
hRgn
!=
NULL
)
...
...
@@ -127,7 +124,7 @@ static VOID SYSLINK_FreeDocItem (PDOC_ITEM DocItem)
/* we don't free Text because it's just a pointer to a character in the
entire window text string */
SYSLINK_
Free
(
DocItem
);
Free
(
DocItem
);
}
/***********************************************************************
...
...
@@ -138,7 +135,7 @@ static PDOC_ITEM SYSLINK_AppendDocItem (SYSLINK_INFO *infoPtr, LPWSTR Text, UINT
SL_ITEM_TYPE
type
,
PDOC_ITEM
LastItem
)
{
PDOC_ITEM
Item
;
Item
=
SYSLINK_
Alloc
(
sizeof
(
DOC_ITEM
)
+
((
textlen
+
1
)
*
sizeof
(
WCHAR
)));
Item
=
Alloc
(
sizeof
(
DOC_ITEM
)
+
((
textlen
+
1
)
*
sizeof
(
WCHAR
)));
if
(
Item
==
NULL
)
{
ERR
(
"Failed to alloc DOC_ITEM structure!
\n
"
);
...
...
@@ -371,7 +368,7 @@ CheckParameter:
{
nc
=
min
(
lenId
,
strlenW
(
lpID
));
nc
=
min
(
nc
,
MAX_LINKID_TEXT
);
Last
->
u
.
Link
.
szID
=
SYSLINK_
Alloc
((
MAX_LINKID_TEXT
+
1
)
*
sizeof
(
WCHAR
));
Last
->
u
.
Link
.
szID
=
Alloc
((
MAX_LINKID_TEXT
+
1
)
*
sizeof
(
WCHAR
));
if
(
Last
->
u
.
Link
.
szID
!=
NULL
)
{
lstrcpynW
(
Last
->
u
.
Link
.
szID
,
lpID
,
nc
+
1
);
...
...
@@ -384,7 +381,7 @@ CheckParameter:
{
nc
=
min
(
lenUrl
,
strlenW
(
lpUrl
));
nc
=
min
(
nc
,
L_MAX_URL_LENGTH
);
Last
->
u
.
Link
.
szUrl
=
SYSLINK_
Alloc
((
L_MAX_URL_LENGTH
+
1
)
*
sizeof
(
WCHAR
));
Last
->
u
.
Link
.
szUrl
=
Alloc
((
L_MAX_URL_LENGTH
+
1
)
*
sizeof
(
WCHAR
));
if
(
Last
->
u
.
Link
.
szUrl
!=
NULL
)
{
lstrcpynW
(
Last
->
u
.
Link
.
szUrl
,
lpUrl
,
nc
+
1
);
...
...
@@ -451,7 +448,7 @@ CheckParameter:
{
nc
=
min
(
lenId
,
strlenW
(
lpID
));
nc
=
min
(
nc
,
MAX_LINKID_TEXT
);
Last
->
u
.
Link
.
szID
=
SYSLINK_
Alloc
((
MAX_LINKID_TEXT
+
1
)
*
sizeof
(
WCHAR
));
Last
->
u
.
Link
.
szID
=
Alloc
((
MAX_LINKID_TEXT
+
1
)
*
sizeof
(
WCHAR
));
if
(
Last
->
u
.
Link
.
szID
!=
NULL
)
{
lstrcpynW
(
Last
->
u
.
Link
.
szID
,
lpID
,
nc
+
1
);
...
...
@@ -464,7 +461,7 @@ CheckParameter:
{
nc
=
min
(
lenUrl
,
strlenW
(
lpUrl
));
nc
=
min
(
nc
,
L_MAX_URL_LENGTH
);
Last
->
u
.
Link
.
szUrl
=
SYSLINK_
Alloc
((
L_MAX_URL_LENGTH
+
1
)
*
sizeof
(
WCHAR
));
Last
->
u
.
Link
.
szUrl
=
Alloc
((
L_MAX_URL_LENGTH
+
1
)
*
sizeof
(
WCHAR
));
if
(
Last
->
u
.
Link
.
szUrl
!=
NULL
)
{
lstrcpynW
(
Last
->
u
.
Link
.
szUrl
,
lpUrl
,
nc
+
1
);
...
...
@@ -737,11 +734,11 @@ static VOID SYSLINK_Render (SYSLINK_INFO *infoPtr, HDC hdc)
if
(
bl
!=
NULL
)
{
bl
=
SYSLINK_
ReAlloc
(
bl
,
++
nBlocks
*
sizeof
(
DOC_TEXTBLOCK
));
bl
=
ReAlloc
(
bl
,
++
nBlocks
*
sizeof
(
DOC_TEXTBLOCK
));
}
else
{
bl
=
SYSLINK_
Alloc
(
++
nBlocks
*
sizeof
(
DOC_TEXTBLOCK
));
bl
=
Alloc
(
++
nBlocks
*
sizeof
(
DOC_TEXTBLOCK
));
}
if
(
bl
!=
NULL
)
...
...
@@ -1039,7 +1036,7 @@ static LRESULT SYSLINK_SetItem (SYSLINK_INFO *infoPtr, PLITEM Item)
{
if
(
!
di
->
u
.
Link
.
szID
)
{
di
->
u
.
Link
.
szID
=
SYSLINK_
Alloc
((
MAX_LINKID_TEXT
+
1
)
*
sizeof
(
WCHAR
));
di
->
u
.
Link
.
szID
=
Alloc
((
MAX_LINKID_TEXT
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
Item
->
szID
)
{
ERR
(
"Unable to allocate memory for link id
\n
"
);
...
...
@@ -1056,7 +1053,7 @@ static LRESULT SYSLINK_SetItem (SYSLINK_INFO *infoPtr, PLITEM Item)
{
if
(
!
di
->
u
.
Link
.
szUrl
)
{
di
->
u
.
Link
.
szUrl
=
SYSLINK_
Alloc
((
MAX_LINKID_TEXT
+
1
)
*
sizeof
(
WCHAR
));
di
->
u
.
Link
.
szUrl
=
Alloc
((
MAX_LINKID_TEXT
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
Item
->
szUrl
)
{
ERR
(
"Unable to allocate memory for link url
\n
"
);
...
...
@@ -1609,7 +1606,7 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
case
WM_CREATE
:
/* allocate memory for info struct */
infoPtr
=
(
SYSLINK_INFO
*
)
SYSLINK_
Alloc
(
sizeof
(
SYSLINK_INFO
));
infoPtr
=
Alloc
(
sizeof
(
SYSLINK_INFO
));
if
(
!
infoPtr
)
return
-
1
;
SetWindowLongPtrW
(
hwnd
,
0
,
(
DWORD_PTR
)
infoPtr
);
...
...
@@ -1633,8 +1630,8 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
SYSLINK_ClearDoc
(
infoPtr
);
if
(
infoPtr
->
Font
!=
0
)
DeleteObject
(
infoPtr
->
Font
);
if
(
infoPtr
->
LinkFont
!=
0
)
DeleteObject
(
infoPtr
->
LinkFont
);
SYSLINK_Free
(
infoPtr
);
SetWindowLongPtrW
(
hwnd
,
0
,
0
);
Free
(
infoPtr
);
return
0
;
default:
...
...
dlls/comctl32/toolbar.c
View file @
8df71a6c
...
...
@@ -4430,7 +4430,7 @@ TOOLBAR_Restore(TOOLBAR_INFO *infoPtr, LPTBSAVEPARAMSW lpSave)
res
=
ERROR_FILE_NOT_FOUND
;
if
(
!
res
)
{
nmtbr
.
pData
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwSize
);
nmtbr
.
pData
=
Alloc
(
dwSize
);
nmtbr
.
cbData
=
(
UINT
)
dwSize
;
if
(
!
nmtbr
.
pData
)
res
=
ERROR_OUTOFMEMORY
;
}
...
...
@@ -4503,7 +4503,7 @@ TOOLBAR_Restore(TOOLBAR_INFO *infoPtr, LPTBSAVEPARAMSW lpSave)
if
(
infoPtr
->
nNumButtons
>
0
)
ret
=
TRUE
;
}
}
HeapFree
(
GetProcessHeap
(),
0
,
nmtbr
.
pData
);
Free
(
nmtbr
.
pData
);
RegCloseKey
(
hkey
);
return
ret
;
...
...
@@ -4535,12 +4535,12 @@ TOOLBAR_SaveRestoreA (HWND hwnd, WPARAM wParam, LPTBSAVEPARAMSA lpSave)
if
(
lpSave
==
NULL
)
return
0
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpSave
->
pszSubKey
,
-
1
,
NULL
,
0
);
pszSubKey
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
pszSubKey
=
Alloc
(
len
*
sizeof
(
WCHAR
));
if
(
pszSubKey
)
goto
exit
;
MultiByteToWideChar
(
CP_ACP
,
0
,
lpSave
->
pszSubKey
,
-
1
,
pszSubKey
,
len
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpSave
->
pszValueName
,
-
1
,
NULL
,
0
);
pszValueName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
pszValueName
=
Alloc
(
len
*
sizeof
(
WCHAR
));
if
(
!
pszValueName
)
goto
exit
;
MultiByteToWideChar
(
CP_ACP
,
0
,
lpSave
->
pszValueName
,
-
1
,
pszValueName
,
len
);
...
...
@@ -4550,8 +4550,8 @@ TOOLBAR_SaveRestoreA (HWND hwnd, WPARAM wParam, LPTBSAVEPARAMSA lpSave)
result
=
TOOLBAR_SaveRestoreW
(
hwnd
,
wParam
,
&
SaveW
);
exit:
HeapFree
(
GetProcessHeap
(),
0
,
pszValueName
);
HeapFree
(
GetProcessHeap
(),
0
,
pszSubKey
);
Free
(
pszValueName
);
Free
(
pszSubKey
);
return
result
;
}
...
...
@@ -5534,7 +5534,7 @@ TOOLBAR_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
DestroyWindow
(
infoPtr
->
hwndToolTip
);
/* delete temporary buffer for tooltip text */
HeapFree
(
GetProcessHeap
(),
0
,
infoPtr
->
pszTooltipText
);
Free
(
infoPtr
->
pszTooltipText
);
/* delete button data */
if
(
infoPtr
->
buttons
)
...
...
@@ -6288,7 +6288,7 @@ static LRESULT TOOLBAR_TTGetDispInfo (TOOLBAR_INFO *infoPtr, NMTTDISPINFOW *lpnm
TRACE
(
"button index = %d
\n
"
,
index
);
HeapFree
(
GetProcessHeap
(),
0
,
infoPtr
->
pszTooltipText
);
Free
(
infoPtr
->
pszTooltipText
);
infoPtr
->
pszTooltipText
=
NULL
;
if
(
index
<
0
)
...
...
@@ -6318,7 +6318,7 @@ static LRESULT TOOLBAR_TTGetDispInfo (TOOLBAR_INFO *infoPtr, NMTTDISPINFOW *lpnm
/* need to allocate temporary buffer in infoPtr as there
* isn't enough space in buffer passed to us by the
* tooltip control */
infoPtr
->
pszTooltipText
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
infoPtr
->
pszTooltipText
=
Alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
infoPtr
->
pszTooltipText
)
{
memcpy
(
infoPtr
->
pszTooltipText
,
tbgit
.
pszText
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
...
...
@@ -6356,7 +6356,7 @@ static LRESULT TOOLBAR_TTGetDispInfo (TOOLBAR_INFO *infoPtr, NMTTDISPINFOW *lpnm
/* need to allocate temporary buffer in infoPtr as there
* isn't enough space in buffer passed to us by the
* tooltip control */
infoPtr
->
pszTooltipText
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
infoPtr
->
pszTooltipText
=
Alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
infoPtr
->
pszTooltipText
)
{
MultiByteToWideChar
(
CP_ACP
,
0
,
tbgit
.
pszText
,
len
+
1
,
infoPtr
->
pszTooltipText
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
...
...
@@ -6386,7 +6386,7 @@ static LRESULT TOOLBAR_TTGetDispInfo (TOOLBAR_INFO *infoPtr, NMTTDISPINFOW *lpnm
/* need to allocate temporary buffer in infoPtr as there
* isn't enough space in buffer passed to us by the
* tooltip control */
infoPtr
->
pszTooltipText
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
infoPtr
->
pszTooltipText
=
Alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
infoPtr
->
pszTooltipText
)
{
memcpy
(
infoPtr
->
pszTooltipText
,
pszText
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
...
...
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