Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9cd9cfd2
Commit
9cd9cfd2
authored
Aug 09, 2004
by
Mike McCormack
Committed by
Alexandre Julliard
Aug 09, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Heap function in preference to malloc/free.
parent
d161a8f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
12 deletions
+18
-12
dialogs.c
dlls/shell32/dialogs.c
+16
-9
systray.c
dlls/shell32/systray.c
+2
-3
No files found.
dlls/shell32/dialogs.c
View file @
9cd9cfd2
...
...
@@ -142,7 +142,7 @@ INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lPar
HWND
htxt
=
NULL
;
if
((
ic
=
GetWindowTextLengthA
(
htxt
=
GetDlgItem
(
hwnd
,
12298
))))
{
psz
=
malloc
(
ic
+
2
)
;
psz
=
HeapAlloc
(
GetProcessHeap
,
0
,
(
ic
+
2
)
)
;
GetWindowTextA
(
htxt
,
psz
,
ic
+
1
)
;
if
(
ShellExecuteA
(
NULL
,
"open"
,
psz
,
NULL
,
NULL
,
SW_SHOWNORMAL
)
<
(
HINSTANCE
)
33
)
...
...
@@ -160,12 +160,12 @@ INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lPar
LocalFree
((
HLOCAL
)
pszSysMsg
)
;
MessageBoxA
(
hwnd
,
szMsg
,
"Nix"
,
MB_OK
|
MB_ICONEXCLAMATION
)
;
free
(
psz
)
;
HeapFree
(
GetProcessHeap
(),
0
,
psz
)
;
SendMessageA
(
htxt
,
CB_SETEDITSEL
,
0
,
MAKELPARAM
(
0
,
-
1
))
;
return
TRUE
;
}
FillList
(
htxt
,
psz
)
;
free
(
psz
)
;
HeapFree
(
GetProcessHeap
(),
0
,
psz
)
;
EndDialog
(
hwnd
,
0
)
;
}
}
...
...
@@ -254,13 +254,14 @@ void FillList (HWND hCb, char *pszLatest)
if
(
icList
>
0
)
{
pszList
=
malloc
(
icList
)
;
pszList
=
HeapAlloc
(
GetProcessHeap
(),
0
,
icList
)
;
if
(
ERROR_SUCCESS
!=
RegQueryValueExA
(
hkey
,
"MRUList"
,
NULL
,
NULL
,
pszList
,
&
icList
))
MessageBoxA
(
hCb
,
"Unable to grab MRUList !"
,
"Nix"
,
MB_OK
)
;
}
else
{
pszList
=
malloc
(
icList
=
1
)
;
icList
=
1
;
pszList
=
HeapAlloc
(
GetProcessHeap
(),
0
,
icList
)
;
pszList
[
0
]
=
0
;
}
...
...
@@ -273,7 +274,10 @@ void FillList (HWND hCb, char *pszLatest)
if
(
ERROR_SUCCESS
!=
RegQueryValueExA
(
hkey
,
szIndex
,
NULL
,
NULL
,
NULL
,
&
icCmd
))
MessageBoxA
(
hCb
,
"Unable to grab size of index"
,
"Nix"
,
MB_OK
)
;
pszCmd
=
realloc
(
pszCmd
,
icCmd
)
;
if
(
pszCmd
)
pszCmd
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
pszCmd
,
icCmd
)
;
else
pszCmd
=
HeapAlloc
(
GetProcessHeap
(),
0
,
icCmd
)
;
if
(
ERROR_SUCCESS
!=
RegQueryValueExA
(
hkey
,
szIndex
,
NULL
,
NULL
,
pszCmd
,
&
icCmd
))
MessageBoxA
(
hCb
,
"Unable to grab index"
,
"Nix"
,
MB_OK
)
;
...
...
@@ -339,7 +343,10 @@ void FillList (HWND hCb, char *pszLatest)
SendMessageA
(
hCb
,
CB_SETEDITSEL
,
0
,
MAKELPARAM
(
0
,
-
1
))
;
cMatch
=
++
cMax
;
pszList
=
realloc
(
pszList
,
++
icList
)
;
if
(
pszList
)
pszList
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
pszList
,
++
icList
)
;
else
pszList
=
HeapAlloc
(
GetProcessHeap
(),
0
,
++
icList
)
;
memmove
(
&
pszList
[
1
],
pszList
,
icList
-
1
)
;
pszList
[
0
]
=
cMatch
;
szIndex
[
0
]
=
cMatch
;
...
...
@@ -348,8 +355,8 @@ void FillList (HWND hCb, char *pszLatest)
RegSetValueExA
(
hkey
,
"MRUList"
,
0
,
REG_SZ
,
pszList
,
strlen
(
pszList
)
+
1
)
;
free
(
pszCmd
)
;
free
(
pszList
)
;
HeapFree
(
GetProcessHeap
(),
0
,
pszCmd
)
;
HeapFree
(
GetProcessHeap
(),
0
,
pszList
)
;
}
...
...
dlls/shell32/systray.c
View file @
9cd9cfd2
...
...
@@ -28,7 +28,6 @@
# include <unistd.h>
#endif
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include "windef.h"
...
...
@@ -289,7 +288,7 @@ static BOOL SYSTRAY_Add(PNOTIFYICONDATAA pnid)
ptrayItem
=
&
((
*
ptrayItem
)
->
nextTrayItem
);
}
/* Allocate SystrayItem for element and add to end of list. */
(
*
ptrayItem
)
=
(
SystrayItem
*
)
malloc
(
sizeof
(
SystrayItem
)
);
(
*
ptrayItem
)
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
SystrayItem
)
);
/* Initialize and set data for the tray element. */
SYSTRAY_ItemInit
(
(
*
ptrayItem
)
);
...
...
@@ -337,7 +336,7 @@ static BOOL SYSTRAY_Delete(PNOTIFYICONDATAA pnid)
TRACE
(
"%p: %p %s
\n
"
,
*
ptrayItem
,
(
*
ptrayItem
)
->
notifyIcon
.
hWnd
,
(
*
ptrayItem
)
->
notifyIcon
.
szTip
);
SYSTRAY_ItemTerm
(
*
ptrayItem
);
free
(
*
ptrayItem
);
HeapFree
(
GetProcessHeap
(),
0
,
*
ptrayItem
);
*
ptrayItem
=
next
;
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