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
2c10f747
Commit
2c10f747
authored
Jul 07, 2023
by
Brendan Shanks
Committed by
Alexandre Julliard
Jul 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winepulse: Set zero_bits correctly for large address aware applications on Wow64.
parent
e0727a40
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
pulse.c
dlls/winepulse.drv/pulse.c
+15
-12
No files found.
dlls/winepulse.drv/pulse.c
View file @
2c10f747
...
@@ -119,6 +119,8 @@ static const REFERENCE_TIME DefaultPeriod = 100000;
...
@@ -119,6 +119,8 @@ static const REFERENCE_TIME DefaultPeriod = 100000;
static
pthread_mutex_t
pulse_mutex
;
static
pthread_mutex_t
pulse_mutex
;
static
pthread_cond_t
pulse_cond
=
PTHREAD_COND_INITIALIZER
;
static
pthread_cond_t
pulse_cond
=
PTHREAD_COND_INITIALIZER
;
static
ULONG_PTR
zero_bits
=
0
;
static
NTSTATUS
pulse_not_implemented
(
void
*
args
)
static
NTSTATUS
pulse_not_implemented
(
void
*
args
)
{
{
return
STATUS_SUCCESS
;
return
STATUS_SUCCESS
;
...
@@ -237,6 +239,16 @@ static NTSTATUS pulse_process_attach(void *args)
...
@@ -237,6 +239,16 @@ static NTSTATUS pulse_process_attach(void *args)
if
(
pthread_mutex_init
(
&
pulse_mutex
,
&
attr
)
!=
0
)
if
(
pthread_mutex_init
(
&
pulse_mutex
,
&
attr
)
!=
0
)
pthread_mutex_init
(
&
pulse_mutex
,
NULL
);
pthread_mutex_init
(
&
pulse_mutex
,
NULL
);
#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
;
return
STATUS_SUCCESS
;
}
}
...
@@ -1077,15 +1089,6 @@ static HRESULT pulse_stream_connect(struct pulse_stream *stream, const char *pul
...
@@ -1077,15 +1089,6 @@ static HRESULT pulse_stream_connect(struct pulse_stream *stream, const char *pul
return
S_OK
;
return
S_OK
;
}
}
static
ULONG_PTR
zero_bits
(
void
)
{
#ifdef _WIN64
return
!
NtCurrentTeb
()
->
WowTebOffset
?
0
:
0x7fffffff
;
#else
return
0
;
#endif
}
static
HRESULT
get_device_period_helper
(
EDataFlow
flow
,
const
char
*
pulse_name
,
REFERENCE_TIME
*
def
,
REFERENCE_TIME
*
min
)
static
HRESULT
get_device_period_helper
(
EDataFlow
flow
,
const
char
*
pulse_name
,
REFERENCE_TIME
*
def
,
REFERENCE_TIME
*
min
)
{
{
struct
list
*
list
=
(
flow
==
eRender
)
?
&
g_phys_speakers
:
&
g_phys_sources
;
struct
list
*
list
=
(
flow
==
eRender
)
?
&
g_phys_speakers
:
&
g_phys_sources
;
...
@@ -1183,7 +1186,7 @@ static NTSTATUS pulse_create_stream(void *args)
...
@@ -1183,7 +1186,7 @@ static NTSTATUS pulse_create_stream(void *args)
size
=
stream
->
real_bufsize_bytes
=
size
=
stream
->
real_bufsize_bytes
=
stream
->
bufsize_frames
*
2
*
pa_frame_size
(
&
stream
->
ss
);
stream
->
bufsize_frames
*
2
*
pa_frame_size
(
&
stream
->
ss
);
if
(
NtAllocateVirtualMemory
(
GetCurrentProcess
(),
(
void
**
)
&
stream
->
local_buffer
,
if
(
NtAllocateVirtualMemory
(
GetCurrentProcess
(),
(
void
**
)
&
stream
->
local_buffer
,
zero_bits
()
,
&
size
,
MEM_COMMIT
,
PAGE_READWRITE
))
zero_bits
,
&
size
,
MEM_COMMIT
,
PAGE_READWRITE
))
hr
=
E_OUTOFMEMORY
;
hr
=
E_OUTOFMEMORY
;
}
else
{
}
else
{
UINT32
i
,
capture_packets
;
UINT32
i
,
capture_packets
;
...
@@ -1197,7 +1200,7 @@ static NTSTATUS pulse_create_stream(void *args)
...
@@ -1197,7 +1200,7 @@ static NTSTATUS pulse_create_stream(void *args)
size
=
stream
->
real_bufsize_bytes
+
capture_packets
*
sizeof
(
ACPacket
);
size
=
stream
->
real_bufsize_bytes
+
capture_packets
*
sizeof
(
ACPacket
);
if
(
NtAllocateVirtualMemory
(
GetCurrentProcess
(),
(
void
**
)
&
stream
->
local_buffer
,
if
(
NtAllocateVirtualMemory
(
GetCurrentProcess
(),
(
void
**
)
&
stream
->
local_buffer
,
zero_bits
()
,
&
size
,
MEM_COMMIT
,
PAGE_READWRITE
))
zero_bits
,
&
size
,
MEM_COMMIT
,
PAGE_READWRITE
))
hr
=
E_OUTOFMEMORY
;
hr
=
E_OUTOFMEMORY
;
else
{
else
{
ACPacket
*
cur_packet
=
(
ACPacket
*
)((
char
*
)
stream
->
local_buffer
+
stream
->
real_bufsize_bytes
);
ACPacket
*
cur_packet
=
(
ACPacket
*
)((
char
*
)
stream
->
local_buffer
+
stream
->
real_bufsize_bytes
);
...
@@ -1841,7 +1844,7 @@ static BOOL alloc_tmp_buffer(struct pulse_stream *stream, SIZE_T bytes)
...
@@ -1841,7 +1844,7 @@ static BOOL alloc_tmp_buffer(struct pulse_stream *stream, SIZE_T bytes)
stream
->
tmp_buffer_bytes
=
0
;
stream
->
tmp_buffer_bytes
=
0
;
}
}
if
(
NtAllocateVirtualMemory
(
GetCurrentProcess
(),
(
void
**
)
&
stream
->
tmp_buffer
,
if
(
NtAllocateVirtualMemory
(
GetCurrentProcess
(),
(
void
**
)
&
stream
->
tmp_buffer
,
zero_bits
()
,
&
bytes
,
MEM_COMMIT
,
PAGE_READWRITE
))
zero_bits
,
&
bytes
,
MEM_COMMIT
,
PAGE_READWRITE
))
return
FALSE
;
return
FALSE
;
stream
->
tmp_buffer_bytes
=
bytes
;
stream
->
tmp_buffer_bytes
=
bytes
;
...
...
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