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
46a2ec02
Commit
46a2ec02
authored
Jul 24, 2011
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 25, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32/autocomplete: Remove redundant memory initialization.
parent
5354b974
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
autocomplete.c
dlls/shell32/autocomplete.c
+7
-8
No files found.
dlls/shell32/autocomplete.c
View file @
46a2ec02
...
...
@@ -287,7 +287,7 @@ static HRESULT WINAPI IAutoComplete2_fnInit(
LONG
len
;
/* pwszRegKeyPath contains the key as well as the value, so we split */
key
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
(
lstrlenW
(
pwzsRegKeyPath
)
+
1
)
*
sizeof
(
WCHAR
));
key
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
pwzsRegKeyPath
)
+
1
)
*
sizeof
(
WCHAR
));
strcpyW
(
key
,
pwzsRegKeyPath
);
value
=
strrchrW
(
key
,
'\\'
);
*
value
=
0
;
...
...
@@ -301,7 +301,7 @@ static HRESULT WINAPI IAutoComplete2_fnInit(
if
(
res
==
ERROR_SUCCESS
)
{
res
=
RegQueryValueW
(
hKey
,
value
,
result
,
&
len
);
if
(
res
==
ERROR_SUCCESS
)
{
This
->
quickComplete
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
len
*
sizeof
(
WCHAR
));
This
->
quickComplete
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
strcpyW
(
This
->
quickComplete
,
result
);
}
RegCloseKey
(
hKey
);
...
...
@@ -310,7 +310,7 @@ static HRESULT WINAPI IAutoComplete2_fnInit(
}
if
((
pwszQuickComplete
)
&&
(
!
This
->
quickComplete
))
{
This
->
quickComplete
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
(
lstrlenW
(
pwszQuickComplete
)
+
1
)
*
sizeof
(
WCHAR
));
This
->
quickComplete
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
pwszQuickComplete
)
+
1
)
*
sizeof
(
WCHAR
));
lstrcpyW
(
This
->
quickComplete
,
pwszQuickComplete
);
}
...
...
@@ -493,7 +493,7 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
/* If quickComplete is set and control is pressed, replace the string */
control
=
GetKeyState
(
VK_CONTROL
)
&
0x8000
;
if
(
control
&&
This
->
quickComplete
)
{
hwndQCText
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
hwndQCText
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
This
->
quickComplete
)
+
lstrlenW
(
hwndText
))
*
sizeof
(
WCHAR
));
sel
=
sprintfW
(
hwndQCText
,
This
->
quickComplete
,
hwndText
);
SendMessageW
(
hwnd
,
WM_SETTEXT
,
0
,
(
LPARAM
)
hwndQCText
);
...
...
@@ -536,7 +536,7 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
int
len
;
len
=
SendMessageW
(
This
->
hwndListBox
,
LB_GETTEXTLEN
,
sel
,
0
);
msg
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
msg
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
SendMessageW
(
This
->
hwndListBox
,
LB_GETTEXT
,
sel
,
(
LPARAM
)
msg
);
SendMessageW
(
hwnd
,
WM_SETTEXT
,
0
,
(
LPARAM
)
msg
);
SendMessageW
(
hwnd
,
EM_SETSEL
,
lstrlenW
(
msg
),
lstrlenW
(
msg
));
...
...
@@ -573,8 +573,7 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
SendMessageW
(
This
->
hwndListBox
,
LB_RESETCONTENT
,
0
,
0
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
txtbackup
);
This
->
txtbackup
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
(
lstrlenW
(
hwndText
)
+
1
)
*
sizeof
(
WCHAR
));
This
->
txtbackup
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
hwndText
)
+
1
)
*
sizeof
(
WCHAR
));
lstrcpyW
(
This
->
txtbackup
,
hwndText
);
/* Returns if there is no text to search and we doesn't want to display all the entries */
...
...
@@ -664,7 +663,7 @@ static LRESULT APIENTRY ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
if
(
sel
<
0
)
break
;
len
=
SendMessageW
(
This
->
hwndListBox
,
LB_GETTEXTLEN
,
sel
,
0
);
msg
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
msg
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
SendMessageW
(
hwnd
,
LB_GETTEXT
,
sel
,
(
LPARAM
)
msg
);
SendMessageW
(
This
->
hwndEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
msg
);
SendMessageW
(
This
->
hwndEdit
,
EM_SETSEL
,
0
,
lstrlenW
(
msg
));
...
...
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