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
4303e753
Commit
4303e753
authored
Aug 10, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winepulse.drv: Convert the Unix call initialization to NtQueryVirtualMemory().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8347c686
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
33 deletions
+37
-33
mmdevdrv.c
dlls/winepulse.drv/mmdevdrv.c
+6
-3
pulse.c
dlls/winepulse.drv/pulse.c
+29
-30
unixlib.h
dlls/winepulse.drv/unixlib.h
+2
-0
No files found.
dlls/winepulse.drv/mmdevdrv.c
View file @
4303e753
...
...
@@ -47,7 +47,7 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
pulse
);
static
UINT64
pulse_handle
;
static
unixlib_handle_t
pulse_handle
;
#define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER)
...
...
@@ -82,10 +82,13 @@ BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved)
{
if
(
reason
==
DLL_PROCESS_ATTACH
)
{
DisableThreadLibraryCalls
(
dll
);
if
(
__wine_init_unix_lib
(
dll
,
reason
,
NULL
,
&
pulse_handle
))
if
(
NtQueryVirtualMemory
(
GetCurrentProcess
(),
dll
,
MemoryWineUnixFuncs
,
&
pulse_handle
,
sizeof
(
pulse_handle
),
NULL
))
return
FALSE
;
if
(
__wine_unix_call
(
pulse_handle
,
process_attach
,
NULL
))
return
FALSE
;
}
else
if
(
reason
==
DLL_PROCESS_DETACH
)
{
__wine_
init_unix_lib
(
dll
,
reason
,
NULL
,
NULL
);
__wine_
unix_call
(
pulse_handle
,
process_detach
,
NULL
);
if
(
pulse_thread
)
{
WaitForSingleObject
(
pulse_thread
,
INFINITE
);
CloseHandle
(
pulse_thread
);
...
...
dlls/winepulse.drv/pulse.c
View file @
4303e753
...
...
@@ -178,6 +178,32 @@ static int pulse_poll_func(struct pollfd *ufds, unsigned long nfds, int timeout,
return
r
;
}
static
NTSTATUS
pulse_process_attach
(
void
*
args
)
{
pthread_mutexattr_t
attr
;
pthread_mutexattr_init
(
&
attr
);
pthread_mutexattr_setprotocol
(
&
attr
,
PTHREAD_PRIO_INHERIT
);
if
(
pthread_mutex_init
(
&
pulse_mutex
,
&
attr
)
!=
0
)
pthread_mutex_init
(
&
pulse_mutex
,
NULL
);
return
STATUS_SUCCESS
;
}
static
NTSTATUS
pulse_process_detach
(
void
*
args
)
{
if
(
pulse_ctx
)
{
pa_context_disconnect
(
pulse_ctx
);
pa_context_unref
(
pulse_ctx
);
}
if
(
pulse_ml
)
pa_mainloop_quit
(
pulse_ml
,
0
);
return
STATUS_SUCCESS
;
}
static
NTSTATUS
pulse_main_loop
(
void
*
args
)
{
struct
main_loop_params
*
params
=
args
;
...
...
@@ -1929,8 +1955,10 @@ static NTSTATUS pulse_is_started(void *args)
return
STATUS_SUCCESS
;
}
static
const
unixlib_entry_t
unix
_funcs
[]
=
const
unixlib_entry_t
__wine_unix_call
_funcs
[]
=
{
pulse_process_attach
,
pulse_process_detach
,
pulse_main_loop
,
pulse_create_stream
,
pulse_release_stream
,
...
...
@@ -1953,32 +1981,3 @@ static const unixlib_entry_t unix_funcs[] =
pulse_test_connect
,
pulse_is_started
,
};
NTSTATUS
CDECL
__wine_init_unix_lib
(
HMODULE
module
,
DWORD
reason
,
const
void
*
ptr_in
,
void
*
ptr_out
)
{
pthread_mutexattr_t
attr
;
switch
(
reason
)
{
case
DLL_PROCESS_ATTACH
:
pthread_mutexattr_init
(
&
attr
);
pthread_mutexattr_setprotocol
(
&
attr
,
PTHREAD_PRIO_INHERIT
);
if
(
pthread_mutex_init
(
&
pulse_mutex
,
&
attr
)
!=
0
)
pthread_mutex_init
(
&
pulse_mutex
,
NULL
);
*
(
UINT64
*
)
ptr_out
=
(
UINT_PTR
)
&
unix_funcs
;
break
;
case
DLL_PROCESS_DETACH
:
if
(
pulse_ctx
)
{
pa_context_disconnect
(
pulse_ctx
);
pa_context_unref
(
pulse_ctx
);
}
if
(
pulse_ml
)
pa_mainloop_quit
(
pulse_ml
,
0
);
}
return
STATUS_SUCCESS
;
}
dlls/winepulse.drv/unixlib.h
View file @
4303e753
...
...
@@ -187,6 +187,8 @@ struct is_started_params
enum
unix_funcs
{
process_attach
,
process_detach
,
main_loop
,
create_stream
,
release_stream
,
...
...
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