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
dd3f3f38
Commit
dd3f3f38
authored
Mar 28, 2023
by
Paul Gofman
Committed by
Alexandre Julliard
Mar 29, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
taskkill: Use CRT allocation functions.
parent
1210b98c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
14 deletions
+12
-14
taskkill.c
programs/taskkill/taskkill.c
+12
-14
No files found.
programs/taskkill/taskkill.c
View file @
dd3f3f38
...
...
@@ -58,13 +58,13 @@ static int taskkill_vprintfW(const WCHAR *msg, va_list va_args)
*/
len
=
WideCharToMultiByte
(
GetOEMCP
(),
0
,
msg_buffer
,
wlen
,
NULL
,
0
,
NULL
,
NULL
);
msgA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
msgA
=
malloc
(
len
);
if
(
!
msgA
)
return
0
;
WideCharToMultiByte
(
GetOEMCP
(),
0
,
msg_buffer
,
wlen
,
msgA
,
len
,
NULL
,
NULL
);
WriteFile
(
GetStdHandle
(
STD_OUTPUT_HANDLE
),
msgA
,
len
,
&
count
,
FALSE
);
HeapFree
(
GetProcessHeap
(),
0
,
msgA
);
free
(
msgA
);
}
return
count
;
...
...
@@ -127,7 +127,7 @@ static DWORD *enumerate_processes(DWORD *list_count)
{
DWORD
*
pid_list
,
alloc_bytes
=
1024
*
sizeof
(
*
pid_list
),
needed_bytes
;
pid_list
=
HeapAlloc
(
GetProcessHeap
(),
0
,
alloc_bytes
);
pid_list
=
malloc
(
alloc_bytes
);
if
(
!
pid_list
)
return
NULL
;
...
...
@@ -137,7 +137,7 @@ static DWORD *enumerate_processes(DWORD *list_count)
if
(
!
EnumProcesses
(
pid_list
,
alloc_bytes
,
&
needed_bytes
))
{
HeapFree
(
GetProcessHeap
(),
0
,
pid_list
);
free
(
pid_list
);
return
NULL
;
}
...
...
@@ -150,10 +150,10 @@ static DWORD *enumerate_processes(DWORD *list_count)
break
;
alloc_bytes
*=
2
;
realloc_list
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
pid_list
,
alloc_bytes
);
realloc_list
=
realloc
(
pid_list
,
alloc_bytes
);
if
(
!
realloc_list
)
{
HeapFree
(
GetProcessHeap
(),
0
,
pid_list
);
free
(
pid_list
);
return
NULL
;
}
pid_list
=
realloc_list
;
...
...
@@ -288,7 +288,7 @@ static int send_close_messages(void)
}
}
HeapFree
(
GetProcessHeap
(),
0
,
pid_list
);
free
(
pid_list
);
return
status_code
;
}
...
...
@@ -403,7 +403,7 @@ static int terminate_processes(void)
}
}
HeapFree
(
GetProcessHeap
(),
0
,
pid_list
);
free
(
pid_list
);
return
status_code
;
}
...
...
@@ -413,8 +413,7 @@ static BOOL add_to_task_list(WCHAR *name)
if
(
!
task_list
)
{
task_list
=
HeapAlloc
(
GetProcessHeap
(),
0
,
list_size
*
sizeof
(
*
task_list
));
task_list
=
malloc
(
list_size
*
sizeof
(
*
task_list
));
if
(
!
task_list
)
return
FALSE
;
}
...
...
@@ -423,8 +422,7 @@ static BOOL add_to_task_list(WCHAR *name)
void
*
realloc_list
;
list_size
*=
2
;
realloc_list
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
task_list
,
list_size
*
sizeof
(
*
task_list
));
realloc_list
=
realloc
(
task_list
,
list_size
*
sizeof
(
*
task_list
));
if
(
!
realloc_list
)
return
FALSE
;
...
...
@@ -521,7 +519,7 @@ int __cdecl wmain(int argc, WCHAR *argv[])
if
(
!
process_arguments
(
argc
,
argv
))
{
HeapFree
(
GetProcessHeap
(),
0
,
task_list
);
free
(
task_list
);
return
1
;
}
...
...
@@ -530,6 +528,6 @@ int __cdecl wmain(int argc, WCHAR *argv[])
else
status_code
=
send_close_messages
();
HeapFree
(
GetProcessHeap
(),
0
,
task_list
);
free
(
task_list
);
return
status_code
;
}
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