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
7c05d390
Commit
7c05d390
authored
Nov 02, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Nov 03, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avrt: Use CRT allocation functions.
parent
4782d0e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
main.c
dlls/avrt/main.c
+8
-9
No files found.
dlls/avrt/main.c
View file @
7c05d390
...
...
@@ -23,18 +23,17 @@
#include "winbase.h"
#include "winnls.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "avrt.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
avrt
);
static
inline
WCHAR
*
heap_
strdupAW
(
const
char
*
src
)
static
inline
WCHAR
*
strdupAW
(
const
char
*
src
)
{
int
len
;
WCHAR
*
dst
;
if
(
!
src
)
return
NULL
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
src
,
-
1
,
NULL
,
0
);
if
((
dst
=
heap_
alloc
(
len
*
sizeof
(
*
dst
))))
MultiByteToWideChar
(
CP_ACP
,
0
,
src
,
-
1
,
dst
,
len
);
if
((
dst
=
m
alloc
(
len
*
sizeof
(
*
dst
))))
MultiByteToWideChar
(
CP_ACP
,
0
,
src
,
-
1
,
dst
,
len
);
return
dst
;
}
...
...
@@ -43,7 +42,7 @@ HANDLE WINAPI AvSetMmThreadCharacteristicsA(const char *name, DWORD *index)
WCHAR
*
nameW
=
NULL
;
HANDLE
ret
;
if
(
name
&&
!
(
nameW
=
heap_
strdupAW
(
name
)))
if
(
name
&&
!
(
nameW
=
strdupAW
(
name
)))
{
SetLastError
(
ERROR_OUTOFMEMORY
);
return
NULL
;
...
...
@@ -51,7 +50,7 @@ HANDLE WINAPI AvSetMmThreadCharacteristicsA(const char *name, DWORD *index)
ret
=
AvSetMmThreadCharacteristicsW
(
nameW
,
index
);
heap_
free
(
nameW
);
free
(
nameW
);
return
ret
;
}
...
...
@@ -97,13 +96,13 @@ HANDLE WINAPI AvSetMmMaxThreadCharacteristicsA(const char *task1, const char *ta
WCHAR
*
task1W
=
NULL
,
*
task2W
=
NULL
;
HANDLE
ret
;
if
(
task1
&&
!
(
task1W
=
heap_
strdupAW
(
task1
)))
if
(
task1
&&
!
(
task1W
=
strdupAW
(
task1
)))
{
SetLastError
(
ERROR_OUTOFMEMORY
);
return
NULL
;
}
if
(
task2
&&
!
(
task2W
=
heap_
strdupAW
(
task2
)))
if
(
task2
&&
!
(
task2W
=
strdupAW
(
task2
)))
{
SetLastError
(
ERROR_OUTOFMEMORY
);
return
NULL
;
...
...
@@ -111,8 +110,8 @@ HANDLE WINAPI AvSetMmMaxThreadCharacteristicsA(const char *task1, const char *ta
ret
=
AvSetMmMaxThreadCharacteristicsW
(
task1W
,
task2W
,
index
);
heap_
free
(
task2W
);
heap_
free
(
task1W
);
free
(
task2W
);
free
(
task1W
);
return
ret
;
}
...
...
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