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
e0727a40
Commit
e0727a40
authored
Jul 07, 2023
by
Brendan Shanks
Committed by
Alexandre Julliard
Jul 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineoss: Set zero_bits correctly for large address aware applications on Wow64.
parent
5cf597ba
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
14 deletions
+21
-14
oss.c
dlls/wineoss.drv/oss.c
+21
-14
No files found.
dlls/wineoss.drv/oss.c
View file @
e0727a40
...
@@ -72,6 +72,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(oss);
...
@@ -72,6 +72,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(oss);
static
const
REFERENCE_TIME
def_period
=
100000
;
static
const
REFERENCE_TIME
def_period
=
100000
;
static
const
REFERENCE_TIME
min_period
=
50000
;
static
const
REFERENCE_TIME
min_period
=
50000
;
static
ULONG_PTR
zero_bits
=
0
;
static
NTSTATUS
oss_not_implemented
(
void
*
args
)
static
NTSTATUS
oss_not_implemented
(
void
*
args
)
{
{
return
STATUS_SUCCESS
;
return
STATUS_SUCCESS
;
...
@@ -221,6 +223,20 @@ static void get_default_device(EDataFlow flow, char device[OSS_DEVNODE_SIZE])
...
@@ -221,6 +223,20 @@ static void get_default_device(EDataFlow flow, char device[OSS_DEVNODE_SIZE])
return
;
return
;
}
}
static
NTSTATUS
oss_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
oss_main_loop
(
void
*
args
)
static
NTSTATUS
oss_main_loop
(
void
*
args
)
{
{
struct
main_loop_params
*
params
=
args
;
struct
main_loop_params
*
params
=
args
;
...
@@ -550,15 +566,6 @@ static HRESULT setup_oss_device(AUDCLNT_SHAREMODE share, int fd,
...
@@ -550,15 +566,6 @@ static HRESULT setup_oss_device(AUDCLNT_SHAREMODE share, int fd,
return
ret
;
return
ret
;
}
}
static
ULONG_PTR
zero_bits
(
void
)
{
#ifdef _WIN64
return
!
NtCurrentTeb
()
->
WowTebOffset
?
0
:
0x7fffffff
;
#else
return
0
;
#endif
}
static
NTSTATUS
oss_create_stream
(
void
*
args
)
static
NTSTATUS
oss_create_stream
(
void
*
args
)
{
{
struct
create_stream_params
*
params
=
args
;
struct
create_stream_params
*
params
=
args
;
...
@@ -653,7 +660,7 @@ static NTSTATUS oss_create_stream(void *args)
...
@@ -653,7 +660,7 @@ static NTSTATUS oss_create_stream(void *args)
if
(
params
->
share
==
AUDCLNT_SHAREMODE_EXCLUSIVE
)
if
(
params
->
share
==
AUDCLNT_SHAREMODE_EXCLUSIVE
)
stream
->
bufsize_frames
-=
stream
->
bufsize_frames
%
stream
->
period_frames
;
stream
->
bufsize_frames
-=
stream
->
bufsize_frames
%
stream
->
period_frames
;
size
=
stream
->
bufsize_frames
*
params
->
fmt
->
nBlockAlign
;
size
=
stream
->
bufsize_frames
*
params
->
fmt
->
nBlockAlign
;
if
(
NtAllocateVirtualMemory
(
GetCurrentProcess
(),
(
void
**
)
&
stream
->
local_buffer
,
zero_bits
()
,
if
(
NtAllocateVirtualMemory
(
GetCurrentProcess
(),
(
void
**
)
&
stream
->
local_buffer
,
zero_bits
,
&
size
,
MEM_COMMIT
,
PAGE_READWRITE
)){
&
size
,
MEM_COMMIT
,
PAGE_READWRITE
)){
params
->
result
=
E_OUTOFMEMORY
;
params
->
result
=
E_OUTOFMEMORY
;
goto
exit
;
goto
exit
;
...
@@ -988,7 +995,7 @@ static NTSTATUS oss_get_render_buffer(void *args)
...
@@ -988,7 +995,7 @@ static NTSTATUS oss_get_render_buffer(void *args)
stream
->
tmp_buffer
=
NULL
;
stream
->
tmp_buffer
=
NULL
;
}
}
size
=
frames
*
stream
->
fmt
->
nBlockAlign
;
size
=
frames
*
stream
->
fmt
->
nBlockAlign
;
if
(
NtAllocateVirtualMemory
(
GetCurrentProcess
(),
(
void
**
)
&
stream
->
tmp_buffer
,
zero_bits
()
,
if
(
NtAllocateVirtualMemory
(
GetCurrentProcess
(),
(
void
**
)
&
stream
->
tmp_buffer
,
zero_bits
,
&
size
,
MEM_COMMIT
,
PAGE_READWRITE
)){
&
size
,
MEM_COMMIT
,
PAGE_READWRITE
)){
stream
->
tmp_buffer_frames
=
0
;
stream
->
tmp_buffer_frames
=
0
;
return
oss_unlock_result
(
stream
,
&
params
->
result
,
E_OUTOFMEMORY
);
return
oss_unlock_result
(
stream
,
&
params
->
result
,
E_OUTOFMEMORY
);
...
@@ -1098,7 +1105,7 @@ static NTSTATUS oss_get_capture_buffer(void *args)
...
@@ -1098,7 +1105,7 @@ static NTSTATUS oss_get_capture_buffer(void *args)
stream
->
tmp_buffer
=
NULL
;
stream
->
tmp_buffer
=
NULL
;
}
}
size
=
*
frames
*
stream
->
fmt
->
nBlockAlign
;
size
=
*
frames
*
stream
->
fmt
->
nBlockAlign
;
if
(
NtAllocateVirtualMemory
(
GetCurrentProcess
(),
(
void
**
)
&
stream
->
tmp_buffer
,
zero_bits
()
,
if
(
NtAllocateVirtualMemory
(
GetCurrentProcess
(),
(
void
**
)
&
stream
->
tmp_buffer
,
zero_bits
,
&
size
,
MEM_COMMIT
,
PAGE_READWRITE
)){
&
size
,
MEM_COMMIT
,
PAGE_READWRITE
)){
stream
->
tmp_buffer_frames
=
0
;
stream
->
tmp_buffer_frames
=
0
;
return
oss_unlock_result
(
stream
,
&
params
->
result
,
E_OUTOFMEMORY
);
return
oss_unlock_result
(
stream
,
&
params
->
result
,
E_OUTOFMEMORY
);
...
@@ -1690,7 +1697,7 @@ static NTSTATUS oss_aux_message(void *args)
...
@@ -1690,7 +1697,7 @@ static NTSTATUS oss_aux_message(void *args)
unixlib_entry_t
__wine_unix_call_funcs
[]
=
unixlib_entry_t
__wine_unix_call_funcs
[]
=
{
{
oss_
not_implemented
,
oss_
process_attach
,
oss_not_implemented
,
oss_not_implemented
,
oss_main_loop
,
oss_main_loop
,
oss_get_endpoint_ids
,
oss_get_endpoint_ids
,
...
@@ -2127,7 +2134,7 @@ static NTSTATUS oss_wow64_aux_message(void *args)
...
@@ -2127,7 +2134,7 @@ static NTSTATUS oss_wow64_aux_message(void *args)
unixlib_entry_t
__wine_unix_call_wow64_funcs
[]
=
unixlib_entry_t
__wine_unix_call_wow64_funcs
[]
=
{
{
oss_
not_implemented
,
oss_
process_attach
,
oss_not_implemented
,
oss_not_implemented
,
oss_wow64_main_loop
,
oss_wow64_main_loop
,
oss_wow64_get_endpoint_ids
,
oss_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