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
5cf597ba
Commit
5cf597ba
authored
Jul 07, 2023
by
Brendan Shanks
Committed by
Alexandre Julliard
Jul 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winealsa: Set zero_bits correctly for large address aware applications on Wow64.
parent
73fc9e74
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
14 deletions
+21
-14
alsa.c
dlls/winealsa.drv/alsa.c
+21
-14
No files found.
dlls/winealsa.drv/alsa.c
View file @
5cf597ba
...
...
@@ -91,6 +91,8 @@ static const WCHAR drv_keyW[] = {'S','o','f','t','w','a','r','e','\\',
'W'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'D'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
's'
,
'\\'
,
'w'
,
'i'
,
'n'
,
'e'
,
'a'
,
'l'
,
's'
,
'a'
,
'.'
,
'd'
,
'r'
,
'v'
};
static
ULONG_PTR
zero_bits
=
0
;
static
NTSTATUS
alsa_not_implemented
(
void
*
args
)
{
return
STATUS_SUCCESS
;
...
...
@@ -476,6 +478,20 @@ static WCHAR *alsa_get_card_name(int card)
return
ret
;
}
static
NTSTATUS
alsa_process_attach
(
void
*
args
)
{
#ifdef _WIN64
if
(
NtCurrentTeb
()
->
WowTebOffset
)
{
SYSTEM_BASIC_INFORMATION
info
;
NtQuerySystemInformation
(
SystemEmulationBasicInformation
,
&
info
,
sizeof
(
info
),
NULL
);
zero_bits
=
(
ULONG_PTR
)
info
.
HighestUserAddress
|
0x7fffffff
;
}
#endif
return
STATUS_SUCCESS
;
}
static
NTSTATUS
alsa_main_loop
(
void
*
args
)
{
struct
main_loop_params
*
params
=
args
;
...
...
@@ -781,15 +797,6 @@ static void silence_buffer(struct alsa_stream *stream, BYTE *buffer, UINT32 fram
memset
(
buffer
,
0
,
frames
*
stream
->
fmt
->
nBlockAlign
);
}
static
ULONG_PTR
zero_bits
(
void
)
{
#ifdef _WIN64
return
!
NtCurrentTeb
()
->
WowTebOffset
?
0
:
0x7fffffff
;
#else
return
0
;
#endif
}
static
NTSTATUS
alsa_create_stream
(
void
*
args
)
{
struct
create_stream_params
*
params
=
args
;
...
...
@@ -1004,7 +1011,7 @@ static NTSTATUS alsa_create_stream(void *args)
stream
->
fmt
=
&
fmtex
->
Format
;
size
=
stream
->
bufsize_frames
*
params
->
fmt
->
nBlockAlign
;
if
(
NtAllocateVirtualMemory
(
GetCurrentProcess
(),
(
void
**
)
&
stream
->
local_buffer
,
zero_bits
()
,
&
size
,
if
(
NtAllocateVirtualMemory
(
GetCurrentProcess
(),
(
void
**
)
&
stream
->
local_buffer
,
zero_bits
,
&
size
,
MEM_COMMIT
,
PAGE_READWRITE
)){
params
->
result
=
E_OUTOFMEMORY
;
goto
exit
;
...
...
@@ -1718,7 +1725,7 @@ static NTSTATUS alsa_get_render_buffer(void *args)
stream
->
tmp_buffer
=
NULL
;
}
size
=
frames
*
stream
->
fmt
->
nBlockAlign
;
if
(
NtAllocateVirtualMemory
(
GetCurrentProcess
(),
(
void
**
)
&
stream
->
tmp_buffer
,
zero_bits
()
,
&
size
,
if
(
NtAllocateVirtualMemory
(
GetCurrentProcess
(),
(
void
**
)
&
stream
->
tmp_buffer
,
zero_bits
,
&
size
,
MEM_COMMIT
,
PAGE_READWRITE
)){
stream
->
tmp_buffer_frames
=
0
;
return
alsa_unlock_result
(
stream
,
&
params
->
result
,
E_OUTOFMEMORY
);
...
...
@@ -1821,7 +1828,7 @@ static NTSTATUS alsa_get_capture_buffer(void *args)
stream
->
tmp_buffer
=
NULL
;
}
size
=
*
frames
*
stream
->
fmt
->
nBlockAlign
;
if
(
NtAllocateVirtualMemory
(
GetCurrentProcess
(),
(
void
**
)
&
stream
->
tmp_buffer
,
zero_bits
()
,
&
size
,
if
(
NtAllocateVirtualMemory
(
GetCurrentProcess
(),
(
void
**
)
&
stream
->
tmp_buffer
,
zero_bits
,
&
size
,
MEM_COMMIT
,
PAGE_READWRITE
)){
stream
->
tmp_buffer_frames
=
0
;
return
alsa_unlock_result
(
stream
,
&
params
->
result
,
E_OUTOFMEMORY
);
...
...
@@ -2499,7 +2506,7 @@ static NTSTATUS alsa_get_prop_value(void *args)
unixlib_entry_t
__wine_unix_call_funcs
[]
=
{
alsa_
not_implemented
,
alsa_
process_attach
,
alsa_not_implemented
,
alsa_main_loop
,
alsa_get_endpoint_ids
,
...
...
@@ -2953,7 +2960,7 @@ static NTSTATUS alsa_wow64_get_prop_value(void *args)
unixlib_entry_t
__wine_unix_call_wow64_funcs
[]
=
{
alsa_
not_implemented
,
alsa_
process_attach
,
alsa_not_implemented
,
alsa_wow64_main_loop
,
alsa_wow64_get_endpoint_ids
,
...
...
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