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
4ee48f26
Commit
4ee48f26
authored
Nov 17, 2022
by
Alex Henrie
Committed by
Alexandre Julliard
Nov 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
schedsvc: Use standard C functions for memory allocation in atsvc.c.
parent
caf39cd1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
21 deletions
+21
-21
atsvc.c
dlls/schedsvc/atsvc.c
+21
-21
No files found.
dlls/schedsvc/atsvc.c
View file @
4ee48f26
...
...
@@ -354,15 +354,15 @@ static DWORD load_unicode_strings(const char *data, DWORD limit, struct job_t *j
switch
(
i
)
{
case
0
:
job
->
info
.
Command
=
heap_strdupW
((
const
WCHAR
*
)
data
);
job
->
info
.
Command
=
wcsdup
((
const
WCHAR
*
)
data
);
break
;
case
1
:
job
->
params
=
heap_strdupW
((
const
WCHAR
*
)
data
);
job
->
params
=
wcsdup
((
const
WCHAR
*
)
data
);
break
;
case
2
:
job
->
curdir
=
heap_strdupW
((
const
WCHAR
*
)
data
);
job
->
curdir
=
wcsdup
((
const
WCHAR
*
)
data
);
break
;
default:
...
...
@@ -504,7 +504,7 @@ static BOOL load_job_data(const char *data, DWORD size, struct job_t *info)
return
FALSE
;
}
info
->
trigger
=
heap_
alloc
(
info
->
trigger_count
*
sizeof
(
info
->
trigger
[
0
]));
info
->
trigger
=
m
alloc
(
info
->
trigger_count
*
sizeof
(
info
->
trigger
[
0
]));
if
(
!
info
->
trigger
)
{
TRACE
(
"not enough memory for trigger data
\n
"
);
...
...
@@ -596,24 +596,24 @@ static BOOL load_job(const WCHAR *name, struct job_t *info)
static
void
free_job_info
(
AT_ENUM
*
info
)
{
heap_
free
(
info
->
Command
);
free
(
info
->
Command
);
}
static
void
free_job
(
struct
job_t
*
job
)
{
free_job_info
(
&
job
->
info
);
heap_
free
(
job
->
name
);
heap_
free
(
job
->
params
);
heap_
free
(
job
->
curdir
);
heap_
free
(
job
->
trigger
);
heap_
free
(
job
);
free
(
job
->
name
);
free
(
job
->
params
);
free
(
job
->
curdir
);
free
(
job
->
trigger
);
free
(
job
);
}
void
add_job
(
const
WCHAR
*
name
)
{
struct
job_t
*
job
;
job
=
heap_alloc_zero
(
sizeof
(
*
job
));
job
=
calloc
(
1
,
sizeof
(
*
job
));
if
(
!
job
)
return
;
if
(
!
load_job
(
name
,
job
))
...
...
@@ -623,7 +623,7 @@ void add_job(const WCHAR *name)
}
EnterCriticalSection
(
&
at_job_list_section
);
job
->
name
=
heap_strdupW
(
name
);
job
->
name
=
wcsdup
(
name
);
job
->
info
.
JobId
=
current_jobid
++
;
list_add_tail
(
&
at_job_list
,
&
job
->
entry
);
LeaveCriticalSection
(
&
at_job_list_section
);
...
...
@@ -920,7 +920,7 @@ void update_process_status(DWORD pid)
{
CloseHandle
(
runjob
->
process
);
list_remove
(
&
runjob
->
entry
);
heap_
free
(
runjob
);
free
(
runjob
);
job
->
data
.
exit_code
=
exit_code
;
job
->
data
.
status
=
SCHED_S_TASK_TERMINATED
;
...
...
@@ -969,7 +969,7 @@ void check_task_state(void)
if
(
job
->
instance_count
)
FIXME
(
"process %s is already running
\n
"
,
debugstr_w
(
job
->
info
.
Command
));
runjob
=
heap_
alloc
(
sizeof
(
*
runjob
));
runjob
=
m
alloc
(
sizeof
(
*
runjob
));
if
(
runjob
)
{
static
WCHAR
winsta0
[]
=
{
'W'
,
'i'
,
'n'
,
'S'
,
't'
,
'a'
,
'0'
,
0
};
...
...
@@ -1179,9 +1179,9 @@ static void free_container(AT_ENUM_CONTAINER *container)
DWORD
i
;
for
(
i
=
0
;
i
<
container
->
EntriesRead
;
i
++
)
heap_
free
(
container
->
Buffer
[
i
].
Command
);
free
(
container
->
Buffer
[
i
].
Command
);
heap_
free
(
container
->
Buffer
);
free
(
container
->
Buffer
);
}
DWORD
__cdecl
NetrJobEnum
(
ATSVC_HANDLE
server_name
,
AT_ENUM_CONTAINER
*
container
,
...
...
@@ -1197,7 +1197,7 @@ DWORD __cdecl NetrJobEnum(ATSVC_HANDLE server_name, AT_ENUM_CONTAINER *container
container
->
EntriesRead
=
0
;
allocated
=
64
;
container
->
Buffer
=
heap_
alloc
(
allocated
*
sizeof
(
AT_ENUM
));
container
->
Buffer
=
m
alloc
(
allocated
*
sizeof
(
AT_ENUM
));
if
(
!
container
->
Buffer
)
return
ERROR_NOT_ENOUGH_MEMORY
;
EnterCriticalSection
(
&
at_job_list_section
);
...
...
@@ -1215,7 +1215,7 @@ DWORD __cdecl NetrJobEnum(ATSVC_HANDLE server_name, AT_ENUM_CONTAINER *container
AT_ENUM
*
new_buffer
;
allocated
*=
2
;
new_buffer
=
heap_
realloc
(
container
->
Buffer
,
allocated
*
sizeof
(
AT_ENUM
));
new_buffer
=
realloc
(
container
->
Buffer
,
allocated
*
sizeof
(
AT_ENUM
));
if
(
!
new_buffer
)
{
free_container
(
container
);
...
...
@@ -1226,7 +1226,7 @@ DWORD __cdecl NetrJobEnum(ATSVC_HANDLE server_name, AT_ENUM_CONTAINER *container
}
container
->
Buffer
[
container
->
EntriesRead
]
=
job
->
info
;
container
->
Buffer
[
container
->
EntriesRead
].
Command
=
heap_strdupW
(
job
->
info
.
Command
);
container
->
Buffer
[
container
->
EntriesRead
].
Command
=
wcsdup
(
job
->
info
.
Command
);
container
->
EntriesRead
++
;
}
...
...
@@ -1249,7 +1249,7 @@ DWORD __cdecl NetrJobGetInfo(ATSVC_HANDLE server_name, DWORD jobid, AT_INFO **in
job
=
find_job
(
jobid
,
NULL
,
NULL
);
if
(
job
)
{
AT_INFO
*
info_ret
=
heap_
alloc
(
sizeof
(
*
info_ret
));
AT_INFO
*
info_ret
=
m
alloc
(
sizeof
(
*
info_ret
));
if
(
!
info_ret
)
ret
=
ERROR_NOT_ENOUGH_MEMORY
;
else
...
...
@@ -1258,7 +1258,7 @@ DWORD __cdecl NetrJobGetInfo(ATSVC_HANDLE server_name, DWORD jobid, AT_INFO **in
info_ret
->
DaysOfMonth
=
job
->
info
.
DaysOfMonth
;
info_ret
->
DaysOfWeek
=
job
->
info
.
DaysOfWeek
;
info_ret
->
Flags
=
job
->
info
.
Flags
;
info_ret
->
Command
=
heap_strdupW
(
job
->
info
.
Command
);
info_ret
->
Command
=
wcsdup
(
job
->
info
.
Command
);
*
info
=
info_ret
;
ret
=
ERROR_SUCCESS
;
}
...
...
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