winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
November 2021
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
951 discussions
Start a n
N
ew thread
Eduard Permyakov : dsound: Correctly report hardware audio buffers as unsupported.
by Alexandre Julliard
17 Nov '21
17 Nov '21
Module: wine Branch: master Commit: 6806954251d0c8c37a5aa9f749b918aa0da98c8d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6806954251d0c8c37a5aa9f7…
Author: Eduard Permyakov <epermyakov(a)codeweavers.com> Date: Wed Nov 17 15:48:52 2021 +0300 dsound: Correctly report hardware audio buffers as unsupported. Signed-off-by: Eduard Permyakov <epermyakov(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dsound/dsound.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c index 3085d86e5b5..bcff0d8642a 100644 --- a/dlls/dsound/dsound.c +++ b/dlls/dsound/dsound.c @@ -373,12 +373,12 @@ static HRESULT DirectSoundDevice_Initialize(DirectSoundDevice ** ppDevice, LPCGU device->drvcaps.dwPrimaryBuffers = 1; device->drvcaps.dwMinSecondarySampleRate = DSBFREQUENCY_MIN; device->drvcaps.dwMaxSecondarySampleRate = DSBFREQUENCY_MAX; - device->drvcaps.dwMaxHwMixingAllBuffers = 16; + device->drvcaps.dwMaxHwMixingAllBuffers = 1; device->drvcaps.dwMaxHwMixingStaticBuffers = device->drvcaps.dwMaxHwMixingAllBuffers; device->drvcaps.dwMaxHwMixingStreamingBuffers = device->drvcaps.dwMaxHwMixingAllBuffers; - device->drvcaps.dwFreeHwMixingAllBuffers = device->drvcaps.dwMaxHwMixingAllBuffers; - device->drvcaps.dwFreeHwMixingStaticBuffers = device->drvcaps.dwMaxHwMixingStaticBuffers; - device->drvcaps.dwFreeHwMixingStreamingBuffers = device->drvcaps.dwMaxHwMixingStreamingBuffers; + device->drvcaps.dwFreeHwMixingAllBuffers = 0; + device->drvcaps.dwFreeHwMixingStaticBuffers = 0; + device->drvcaps.dwFreeHwMixingStreamingBuffers = 0; ZeroMemory(&device->volpan, sizeof(device->volpan)); @@ -435,11 +435,10 @@ static HRESULT DirectSoundDevice_CreateSoundBuffer( } if (!(dsbd->dwFlags & DSBCAPS_PRIMARYBUFFER) && - dsbd->dwFlags & DSBCAPS_LOCHARDWARE && - device->drvcaps.dwFreeHwMixingAllBuffers == 0) + dsbd->dwFlags & DSBCAPS_LOCHARDWARE) { - WARN("ran out of emulated hardware buffers\n"); - return DSERR_ALLOCATED; + WARN("unable to create hardware buffer\n"); + return DSERR_UNSUPPORTED; } if (dsbd->dwFlags & DSBCAPS_PRIMARYBUFFER) {
1
0
0
0
Zebediah Figura : ntdll: Implement thread-ID alerts using futexes if possible.
by Alexandre Julliard
17 Nov '21
17 Nov '21
Module: wine Branch: master Commit: 9d79f72142dc027392b0f4a97d69c9df601d15aa URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9d79f72142dc027392b0f4a9…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Tue Nov 16 21:50:43 2021 -0600 ntdll: Implement thread-ID alerts using futexes if possible. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/sync.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 33cd1d84dd5..59fe6bea8f5 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -2342,6 +2342,9 @@ NTSTATUS WINAPI NtQueryInformationAtom( RTL_ATOM atom, ATOM_INFORMATION_CLASS cl union tid_alert_entry { HANDLE event; +#ifdef __linux__ + int futex; +#endif }; #define TID_ALERT_BLOCK_SIZE (65536 / sizeof(union tid_alert_entry)) @@ -2376,6 +2379,11 @@ static union tid_alert_entry *get_tid_alert_entry( HANDLE tid ) entry = &tid_alert_blocks[block_idx][idx % TID_ALERT_BLOCK_SIZE]; +#ifdef __linux__ + if (use_futexes()) + return entry; +#endif + if (!entry->event) { HANDLE event; @@ -2401,10 +2409,43 @@ NTSTATUS WINAPI NtAlertThreadByThreadId( HANDLE tid ) if (!entry) return STATUS_INVALID_CID; +#ifdef __linux__ + if (use_futexes()) + { + int *futex = &entry->futex; + if (!InterlockedExchange( futex, 1 )) + futex_wake( futex, 1 ); + return STATUS_SUCCESS; + } +#endif + return NtSetEvent( entry->event, NULL ); } +#ifdef __linux__ +static LONGLONG get_absolute_timeout( const LARGE_INTEGER *timeout ) +{ + LARGE_INTEGER now; + + if (timeout->QuadPart >= 0) return timeout->QuadPart; + NtQuerySystemTime( &now ); + return now.QuadPart - timeout->QuadPart; +} + +static LONGLONG update_timeout( ULONGLONG end ) +{ + LARGE_INTEGER now; + LONGLONG timeleft; + + NtQuerySystemTime( &now ); + timeleft = end - now.QuadPart; + if (timeleft < 0) timeleft = 0; + return timeleft; +} +#endif + + /*********************************************************************** * NtWaitForAlertByThreadId (NTDLL.@) */ @@ -2417,6 +2458,41 @@ NTSTATUS WINAPI NtWaitForAlertByThreadId( const void *address, const LARGE_INTEG if (!entry) return STATUS_INVALID_CID; +#ifdef __linux__ + if (use_futexes()) + { + int *futex = &entry->futex; + ULONGLONG end; + int ret; + + if (timeout) + { + if (timeout->QuadPart == TIMEOUT_INFINITE) + timeout = NULL; + else + end = get_absolute_timeout( timeout ); + } + + while (!InterlockedExchange( futex, 0 )) + { + if (timeout) + { + LONGLONG timeleft = update_timeout( end ); + struct timespec timespec; + + timespec.tv_sec = timeleft / (ULONGLONG)TICKSPERSEC; + timespec.tv_nsec = (timeleft % TICKSPERSEC) * 100; + ret = futex_wait( futex, 0, ×pec ); + } + else + ret = futex_wait( futex, 0, NULL ); + + if (ret == -1 && errno == ETIMEDOUT) return STATUS_TIMEOUT; + } + return STATUS_ALERTED; + } +#endif + status = NtWaitForSingleObject( entry->event, FALSE, timeout ); if (!status) return STATUS_ALERTED; return status;
1
0
0
0
Zebediah Figura : ntdll/tests: Add basic tests for thread-id alert functions.
by Alexandre Julliard
17 Nov '21
17 Nov '21
Module: wine Branch: master Commit: 6d19056a8cc3debd08d0a45fbd538c70d896bf11 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6d19056a8cc3debd08d0a45f…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Tue Nov 16 21:50:42 2021 -0600 ntdll/tests: Add basic tests for thread-id alert functions. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/sync.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/dlls/ntdll/tests/sync.c b/dlls/ntdll/tests/sync.c index f2499ea648a..f930767a8b0 100644 --- a/dlls/ntdll/tests/sync.c +++ b/dlls/ntdll/tests/sync.c @@ -26,6 +26,7 @@ #include "winternl.h" #include "wine/test.h" +static NTSTATUS (WINAPI *pNtAlertThreadByThreadId)( HANDLE ); static NTSTATUS (WINAPI *pNtClose)( HANDLE ); static NTSTATUS (WINAPI *pNtCreateEvent) ( PHANDLE, ACCESS_MASK, const OBJECT_ATTRIBUTES *, EVENT_TYPE, BOOLEAN); static NTSTATUS (WINAPI *pNtCreateKeyedEvent)( HANDLE *, ACCESS_MASK, const OBJECT_ATTRIBUTES *, ULONG ); @@ -43,6 +44,7 @@ static NTSTATUS (WINAPI *pNtReleaseMutant)( HANDLE, LONG * ); static NTSTATUS (WINAPI *pNtReleaseSemaphore)( HANDLE, ULONG, ULONG * ); static NTSTATUS (WINAPI *pNtResetEvent)( HANDLE, LONG * ); static NTSTATUS (WINAPI *pNtSetEvent)( HANDLE, LONG * ); +static NTSTATUS (WINAPI *pNtWaitForAlertByThreadId)( void *, const LARGE_INTEGER * ); static NTSTATUS (WINAPI *pNtWaitForKeyedEvent)( HANDLE, const void *, BOOLEAN, const LARGE_INTEGER * ); static BOOLEAN (WINAPI *pRtlAcquireResourceExclusive)( RTL_RWLOCK *, BOOLEAN ); static BOOLEAN (WINAPI *pRtlAcquireResourceShared)( RTL_RWLOCK *, BOOLEAN ); @@ -754,10 +756,98 @@ static void test_resource(void) pRtlDeleteResource(&resource); } +static DWORD WINAPI tid_alert_thread( void *arg ) +{ + NTSTATUS ret; + + ret = pNtAlertThreadByThreadId( arg ); + ok(!ret, "got %#x\n", ret); + + ret = pNtWaitForAlertByThreadId( (void *)0x123, NULL ); + ok(ret == STATUS_ALERTED, "got %#x\n", ret); + + return 0; +} + +static void test_tid_alert( char **argv ) +{ + LARGE_INTEGER timeout = {{0}}; + char cmdline[MAX_PATH]; + STARTUPINFOA si = {0}; + PROCESS_INFORMATION pi; + HANDLE thread; + NTSTATUS ret; + DWORD tid; + + if (!pNtWaitForAlertByThreadId) + { + win_skip("NtWaitForAlertByThreadId is not available\n"); + return; + } + + ret = pNtWaitForAlertByThreadId( (void *)0x123, &timeout ); + ok(ret == STATUS_TIMEOUT, "got %#x\n", ret); + + ret = pNtAlertThreadByThreadId( 0 ); + ok(ret == STATUS_INVALID_CID, "got %#x\n", ret); + + ret = pNtAlertThreadByThreadId( (HANDLE)0xdeadbeef ); + ok(ret == STATUS_INVALID_CID, "got %#x\n", ret); + + ret = pNtAlertThreadByThreadId( (HANDLE)(DWORD_PTR)GetCurrentThreadId() ); + ok(!ret, "got %#x\n", ret); + + ret = pNtAlertThreadByThreadId( (HANDLE)(DWORD_PTR)GetCurrentThreadId() ); + ok(!ret, "got %#x\n", ret); + + ret = pNtWaitForAlertByThreadId( (void *)0x123, &timeout ); + ok(ret == STATUS_ALERTED, "got %#x\n", ret); + + ret = pNtWaitForAlertByThreadId( (void *)0x123, &timeout ); + ok(ret == STATUS_TIMEOUT, "got %#x\n", ret); + + ret = pNtWaitForAlertByThreadId( (void *)0x321, &timeout ); + ok(ret == STATUS_TIMEOUT, "got %#x\n", ret); + + thread = CreateThread( NULL, 0, tid_alert_thread, (HANDLE)(DWORD_PTR)GetCurrentThreadId(), 0, &tid ); + timeout.QuadPart = -1000 * 10000; + ret = pNtWaitForAlertByThreadId( (void *)0x123, &timeout ); + ok(ret == STATUS_ALERTED, "got %#x\n", ret); + + ret = WaitForSingleObject( thread, 100 ); + ok(ret == WAIT_TIMEOUT, "got %d\n", ret); + ret = pNtAlertThreadByThreadId( (HANDLE)(DWORD_PTR)tid ); + ok(!ret, "got %#x\n", ret); + + ret = WaitForSingleObject( thread, 1000 ); + ok(!ret, "got %d\n", ret); + + ret = pNtAlertThreadByThreadId( (HANDLE)(DWORD_PTR)tid ); + ok(!ret, "got %#x\n", ret); + + CloseHandle(thread); + + sprintf( cmdline, "%s %s subprocess", argv[0], argv[1] ); + ret = CreateProcessA( NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ); + ok(ret, "failed to create process, error %u\n", GetLastError()); + ret = pNtAlertThreadByThreadId( (HANDLE)(DWORD_PTR)pi.dwThreadId ); + todo_wine ok(ret == STATUS_ACCESS_DENIED, "got %#x\n", ret); + ok(!WaitForSingleObject( pi.hProcess, 1000 ), "wait failed\n"); + CloseHandle( pi.hProcess ); + CloseHandle( pi.hThread ); +} + START_TEST(sync) { HMODULE module = GetModuleHandleA("ntdll.dll"); + char **argv; + int argc; + + argc = winetest_get_mainargs( &argv ); + + if (argc > 2) return; + pNtAlertThreadByThreadId = (void *)GetProcAddress(module, "NtAlertThreadByThreadId"); pNtClose = (void *)GetProcAddress(module, "NtClose"); pNtCreateEvent = (void *)GetProcAddress(module, "NtCreateEvent"); pNtCreateKeyedEvent = (void *)GetProcAddress(module, "NtCreateKeyedEvent"); @@ -775,6 +865,7 @@ START_TEST(sync) pNtReleaseSemaphore = (void *)GetProcAddress(module, "NtReleaseSemaphore"); pNtResetEvent = (void *)GetProcAddress(module, "NtResetEvent"); pNtSetEvent = (void *)GetProcAddress(module, "NtSetEvent"); + pNtWaitForAlertByThreadId = (void *)GetProcAddress(module, "NtWaitForAlertByThreadId"); pNtWaitForKeyedEvent = (void *)GetProcAddress(module, "NtWaitForKeyedEvent"); pRtlAcquireResourceExclusive = (void *)GetProcAddress(module, "RtlAcquireResourceExclusive"); pRtlAcquireResourceShared = (void *)GetProcAddress(module, "RtlAcquireResourceShared"); @@ -792,4 +883,5 @@ START_TEST(sync) test_semaphore(); test_keyed_events(); test_resource(); + test_tid_alert( argv ); }
1
0
0
0
Zebediah Figura : ntdll: Implement NtAlertThreadByThreadId and NtWaitForAlertByThreadId.
by Alexandre Julliard
17 Nov '21
17 Nov '21
Module: wine Branch: master Commit: 0e931fa5fd5141bd845bacac5b89cf4c744f1c6d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0e931fa5fd5141bd845bacac…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Tue Nov 16 21:50:41 2021 -0600 ntdll: Implement NtAlertThreadByThreadId and NtWaitForAlertByThreadId. These will be used to implement RtlWaitOnAddress() and other in-process synchronization primitives, as they are on Windows. These patches went through quite a few revisions in order to ensure that they had sufficient performance and correctness compared to the current implementation. I am particularly grateful to Etienne Juvigny and Dmitry Skvortsov for performing extensive testing. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/ntdll.spec | 4 +++ dlls/ntdll/unix/loader.c | 2 ++ dlls/ntdll/unix/sync.c | 93 ++++++++++++++++++++++++++++++++++++++++++++++++ dlls/wow64/process.c | 11 ++++++ dlls/wow64/sync.c | 12 +++++++ dlls/wow64/syscall.h | 2 ++ include/winternl.h | 2 ++ 7 files changed, 126 insertions(+) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index e7c1fa1dcf3..e5a49ba1a1f 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -140,6 +140,7 @@ @ stdcall -syscall NtAdjustPrivilegesToken(long long ptr long ptr ptr) @ stdcall -syscall NtAlertResumeThread(long ptr) @ stdcall -syscall NtAlertThread(long) +@ stdcall -syscall NtAlertThreadByThreadId(ptr) @ stdcall -syscall NtAllocateLocallyUniqueId(ptr) # @ stub NtAllocateUserPhysicalPages @ stdcall -syscall NtAllocateUuids(ptr ptr ptr ptr) @@ -424,6 +425,7 @@ @ stdcall -syscall NtUnmapViewOfSection(long ptr) # @ stub NtVdmControl # @ stub NtW32Call +@ stdcall -syscall NtWaitForAlertByThreadId(ptr ptr) @ stdcall -syscall NtWaitForDebugEvent(long long ptr ptr) @ stdcall -syscall NtWaitForKeyedEvent(long ptr long ptr) @ stdcall -syscall NtWaitForMultipleObjects(long ptr long long ptr) @@ -1161,6 +1163,7 @@ @ stdcall -private -syscall ZwAdjustPrivilegesToken(long long ptr long ptr ptr) NtAdjustPrivilegesToken @ stdcall -private -syscall ZwAlertResumeThread(long ptr) NtAlertResumeThread @ stdcall -private -syscall ZwAlertThread(long) NtAlertThread +@ stdcall -private -syscall ZwAlertThreadByThreadId(ptr) NtAlertThreadByThreadId @ stdcall -private -syscall ZwAllocateLocallyUniqueId(ptr) NtAllocateLocallyUniqueId # @ stub ZwAllocateUserPhysicalPages @ stdcall -private -syscall ZwAllocateUuids(ptr ptr ptr ptr) NtAllocateUuids @@ -1443,6 +1446,7 @@ @ stdcall -private -syscall ZwUnmapViewOfSection(long ptr) NtUnmapViewOfSection # @ stub ZwVdmControl # @ stub ZwW32Call +@ stdcall -private -syscall ZwWaitForAlertByThreadId(ptr ptr) NtWaitForAlertByThreadId @ stdcall -private -syscall ZwWaitForDebugEvent(long long ptr ptr) NtWaitForDebugEvent @ stdcall -private -syscall ZwWaitForKeyedEvent(long ptr long ptr) NtWaitForKeyedEvent @ stdcall -private -syscall ZwWaitForMultipleObjects(long ptr long long ptr) NtWaitForMultipleObjects diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 99226d472da..7f36dc42579 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -132,6 +132,7 @@ static void * const syscalls[] = NtAdjustPrivilegesToken, NtAlertResumeThread, NtAlertThread, + NtAlertThreadByThreadId, NtAllocateLocallyUniqueId, NtAllocateUuids, NtAllocateVirtualMemory, @@ -334,6 +335,7 @@ static void * const syscalls[] = NtUnlockFile, NtUnlockVirtualMemory, NtUnmapViewOfSection, + NtWaitForAlertByThreadId, NtWaitForDebugEvent, NtWaitForKeyedEvent, NtWaitForMultipleObjects, diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index daf9f46f43b..33cd1d84dd5 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -33,6 +33,9 @@ #include <limits.h> #include <signal.h> #include <sys/types.h> +#ifdef HAVE_SYS_MMAN_H +#include <sys/mman.h> +#endif #ifdef HAVE_SYS_SYSCALL_H #include <sys/syscall.h> #endif @@ -74,6 +77,12 @@ static const LARGE_INTEGER zero_timeout; static pthread_mutex_t addr_mutex = PTHREAD_MUTEX_INITIALIZER; +static const char *debugstr_timeout( const LARGE_INTEGER *timeout ) +{ + if (!timeout) return "(infinite)"; + return wine_dbgstr_longlong( timeout->QuadPart ); +} + /* return a monotonic time counter, in Win32 ticks */ static inline ULONGLONG monotonic_counter(void) { @@ -2330,6 +2339,90 @@ NTSTATUS WINAPI NtQueryInformationAtom( RTL_ATOM atom, ATOM_INFORMATION_CLASS cl } +union tid_alert_entry +{ + HANDLE event; +}; + +#define TID_ALERT_BLOCK_SIZE (65536 / sizeof(union tid_alert_entry)) +static union tid_alert_entry *tid_alert_blocks[4096]; + +static unsigned int handle_to_index( HANDLE handle, unsigned int *block_idx ) +{ + unsigned int idx = (wine_server_obj_handle(handle) >> 2) - 1; + *block_idx = idx / TID_ALERT_BLOCK_SIZE; + return idx % TID_ALERT_BLOCK_SIZE; +} + +static union tid_alert_entry *get_tid_alert_entry( HANDLE tid ) +{ + unsigned int block_idx, idx = handle_to_index( tid, &block_idx ); + union tid_alert_entry *entry; + + if (block_idx > ARRAY_SIZE(tid_alert_blocks)) + { + FIXME( "tid %p is too high\n", tid ); + return NULL; + } + + if (!tid_alert_blocks[block_idx]) + { + static const size_t size = TID_ALERT_BLOCK_SIZE * sizeof(union tid_alert_entry); + void *ptr = anon_mmap_alloc( size, PROT_READ | PROT_WRITE ); + if (ptr == MAP_FAILED) return NULL; + if (InterlockedCompareExchangePointer( (void **)&tid_alert_blocks[block_idx], ptr, NULL )) + munmap( ptr, size ); /* someone beat us to it */ + } + + entry = &tid_alert_blocks[block_idx][idx % TID_ALERT_BLOCK_SIZE]; + + if (!entry->event) + { + HANDLE event; + + if (NtCreateEvent( &event, EVENT_ALL_ACCESS, NULL, SynchronizationEvent, FALSE )) + return NULL; + if (InterlockedCompareExchangePointer( &entry->event, event, NULL )) + NtClose( event ); + } + + return entry; +} + + +/*********************************************************************** + * NtAlertThreadByThreadId (NTDLL.@) + */ +NTSTATUS WINAPI NtAlertThreadByThreadId( HANDLE tid ) +{ + union tid_alert_entry *entry = get_tid_alert_entry( tid ); + + TRACE( "%p\n", tid ); + + if (!entry) return STATUS_INVALID_CID; + + return NtSetEvent( entry->event, NULL ); +} + + +/*********************************************************************** + * NtWaitForAlertByThreadId (NTDLL.@) + */ +NTSTATUS WINAPI NtWaitForAlertByThreadId( const void *address, const LARGE_INTEGER *timeout ) +{ + union tid_alert_entry *entry = get_tid_alert_entry( NtCurrentTeb()->ClientId.UniqueThread ); + NTSTATUS status; + + TRACE( "%p %s\n", address, debugstr_timeout( timeout ) ); + + if (!entry) return STATUS_INVALID_CID; + + status = NtWaitForSingleObject( entry->event, FALSE, timeout ); + if (!status) return STATUS_ALERTED; + return status; +} + + #ifdef __linux__ NTSTATUS CDECL fast_RtlpWaitForCriticalSection( RTL_CRITICAL_SECTION *crit, int timeout ) diff --git a/dlls/wow64/process.c b/dlls/wow64/process.c index d66b973385b..fbe501ed034 100644 --- a/dlls/wow64/process.c +++ b/dlls/wow64/process.c @@ -460,6 +460,17 @@ NTSTATUS WINAPI wow64_NtAlertThread( UINT *args ) } +/********************************************************************** + * wow64_NtAlertThreadByThreadId + */ +NTSTATUS WINAPI wow64_NtAlertThreadByThreadId( UINT *args ) +{ + HANDLE tid = get_handle( &args ); + + return NtAlertThreadByThreadId( tid ); +} + + /********************************************************************** * wow64_NtAssignProcessToJobObject */ diff --git a/dlls/wow64/sync.c b/dlls/wow64/sync.c index e2e9468a727..20776378a7d 100644 --- a/dlls/wow64/sync.c +++ b/dlls/wow64/sync.c @@ -1460,6 +1460,18 @@ NTSTATUS WINAPI wow64_NtTraceControl( UINT *args ) } +/********************************************************************** + * wow64_NtWaitForAlertByThreadId + */ +NTSTATUS WINAPI wow64_NtWaitForAlertByThreadId( UINT *args ) +{ + const void *address = get_ptr( &args ); + const LARGE_INTEGER *timeout = get_ptr( &args ); + + return NtWaitForAlertByThreadId( address, timeout ); +} + + /********************************************************************** * wow64_NtWaitForDebugEvent */ diff --git a/dlls/wow64/syscall.h b/dlls/wow64/syscall.h index bc403dd6d31..112711875f7 100644 --- a/dlls/wow64/syscall.h +++ b/dlls/wow64/syscall.h @@ -30,6 +30,7 @@ SYSCALL_ENTRY( NtAdjustPrivilegesToken ) \ SYSCALL_ENTRY( NtAlertResumeThread ) \ SYSCALL_ENTRY( NtAlertThread ) \ + SYSCALL_ENTRY( NtAlertThreadByThreadId ) \ SYSCALL_ENTRY( NtAllocateLocallyUniqueId ) \ SYSCALL_ENTRY( NtAllocateUuids ) \ SYSCALL_ENTRY( NtAllocateVirtualMemory ) \ @@ -231,6 +232,7 @@ SYSCALL_ENTRY( NtUnlockFile ) \ SYSCALL_ENTRY( NtUnlockVirtualMemory ) \ SYSCALL_ENTRY( NtUnmapViewOfSection ) \ + SYSCALL_ENTRY( NtWaitForAlertByThreadId ) \ SYSCALL_ENTRY( NtWaitForDebugEvent ) \ SYSCALL_ENTRY( NtWaitForKeyedEvent ) \ SYSCALL_ENTRY( NtWaitForMultipleObjects ) \ diff --git a/include/winternl.h b/include/winternl.h index eea97f1238b..cfd83f16337 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -3858,6 +3858,7 @@ NTSYSAPI NTSTATUS WINAPI NtAdjustGroupsToken(HANDLE,BOOLEAN,PTOKEN_GROUPS,ULONG NTSYSAPI NTSTATUS WINAPI NtAdjustPrivilegesToken(HANDLE,BOOLEAN,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD); NTSYSAPI NTSTATUS WINAPI NtAlertResumeThread(HANDLE,PULONG); NTSYSAPI NTSTATUS WINAPI NtAlertThread(HANDLE ThreadHandle); +NTSYSAPI NTSTATUS WINAPI NtAlertThreadByThreadId(HANDLE); NTSYSAPI NTSTATUS WINAPI NtAllocateLocallyUniqueId(PLUID lpLuid); NTSYSAPI NTSTATUS WINAPI NtAllocateUuids(PULARGE_INTEGER,PULONG,PULONG,PUCHAR); NTSYSAPI NTSTATUS WINAPI NtAllocateVirtualMemory(HANDLE,PVOID*,ULONG_PTR,SIZE_T*,ULONG,ULONG); @@ -4097,6 +4098,7 @@ NTSYSAPI NTSTATUS WINAPI NtUnlockFile(HANDLE,PIO_STATUS_BLOCK,PLARGE_INTEGER,PL NTSYSAPI NTSTATUS WINAPI NtUnlockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG); NTSYSAPI NTSTATUS WINAPI NtUnmapViewOfSection(HANDLE,PVOID); NTSYSAPI NTSTATUS WINAPI NtVdmControl(ULONG,PVOID); +NTSYSAPI NTSTATUS WINAPI NtWaitForAlertByThreadId(const void*,const LARGE_INTEGER*); NTSYSAPI NTSTATUS WINAPI NtWaitForDebugEvent(HANDLE,BOOLEAN,LARGE_INTEGER*,DBGUI_WAIT_STATE_CHANGE*); NTSYSAPI NTSTATUS WINAPI NtWaitForKeyedEvent(HANDLE,const void*,BOOLEAN,const LARGE_INTEGER*); NTSYSAPI NTSTATUS WINAPI NtWaitForSingleObject(HANDLE,BOOLEAN,const LARGE_INTEGER*);
1
0
0
0
Huw Davies : winecoreaudio: Store the channel count and period_ms directly in the audio client.
by Alexandre Julliard
17 Nov '21
17 Nov '21
Module: wine Branch: master Commit: afdaf649be96f2719c2c2f498aa43db62fc7e730 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=afdaf649be96f2719c2c2f49…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Nov 17 09:10:36 2021 -0600 winecoreaudio: Store the channel count and period_ms directly in the audio client. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winecoreaudio.drv/mmdevdrv.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/dlls/winecoreaudio.drv/mmdevdrv.c b/dlls/winecoreaudio.drv/mmdevdrv.c index ebab18df75b..1e37a2a9026 100644 --- a/dlls/winecoreaudio.drv/mmdevdrv.c +++ b/dlls/winecoreaudio.drv/mmdevdrv.c @@ -124,6 +124,7 @@ struct ACImpl { IUnknown *pUnkFTMarshal; EDataFlow dataflow; + UINT32 channel_count, period_ms; DWORD flags; HANDLE event; float *vols; @@ -1179,7 +1180,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface, ACImpl *This = impl_from_IAudioClient3(iface); HRESULT hr; OSStatus sc; - int i; + UINT32 i; TRACE("(%p)->(%x, %x, %s, %s, %p, %s)\n", This, mode, flags, wine_dbgstr_longlong(duration), wine_dbgstr_longlong(period), fmt, debugstr_guid(sessionguid)); @@ -1342,7 +1343,12 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface, This->stream->cap_buffer = HeapAlloc(GetProcessHeap(), 0, This->stream->cap_bufsize_frames * This->stream->fmt->nBlockAlign); } - This->vols = HeapAlloc(GetProcessHeap(), 0, fmt->nChannels * sizeof(float)); + This->stream->share = mode; + This->flags = flags; + This->channel_count = fmt->nChannels; + This->period_ms = period / 10000; + + This->vols = HeapAlloc(GetProcessHeap(), 0, This->channel_count * sizeof(float)); if(!This->vols){ CoTaskMemFree(This->stream->fmt); This->stream->fmt = NULL; @@ -1351,12 +1357,9 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface, return E_OUTOFMEMORY; } - for(i = 0; i < fmt->nChannels; ++i) + for(i = 0; i < This->channel_count; ++i) This->vols[i] = 1.f; - This->stream->share = mode; - This->flags = flags; - hr = get_audio_session(sessionguid, This->parent, fmt->nChannels, &This->session); if(FAILED(hr)){ @@ -1906,7 +1909,7 @@ static HRESULT WINAPI AudioClient_Start(IAudioClient3 *iface) if(This->event && !This->timer) if(!CreateTimerQueueTimer(&This->timer, g_timer_q, ca_period_cb, - This, 0, This->stream->period_ms, WT_EXECUTEINTIMERTHREAD)){ + This, 0, This->period_ms, WT_EXECUTEINTIMERTHREAD)){ This->timer = NULL; OSSpinLockUnlock(&This->stream->lock); WARN("Unable to create timer: %u\n", GetLastError()); @@ -3173,7 +3176,7 @@ static HRESULT WINAPI AudioStreamVolume_GetChannelCount( if(!out) return E_POINTER; - *out = This->stream->fmt->nChannels; + *out = This->channel_count; return S_OK; } @@ -3189,7 +3192,7 @@ static HRESULT WINAPI AudioStreamVolume_SetChannelVolume( if(level < 0.f || level > 1.f) return E_INVALIDARG; - if(index >= This->stream->fmt->nChannels) + if(index >= This->channel_count) return E_INVALIDARG; EnterCriticalSection(&g_sessions_lock); @@ -3214,7 +3217,7 @@ static HRESULT WINAPI AudioStreamVolume_GetChannelVolume( if(!level) return E_POINTER; - if(index >= This->stream->fmt->nChannels) + if(index >= This->channel_count) return E_INVALIDARG; *level = This->vols[index]; @@ -3234,7 +3237,7 @@ static HRESULT WINAPI AudioStreamVolume_SetAllVolumes( if(!levels) return E_POINTER; - if(count != This->stream->fmt->nChannels) + if(count != This->channel_count) return E_INVALIDARG; EnterCriticalSection(&g_sessions_lock); @@ -3260,7 +3263,7 @@ static HRESULT WINAPI AudioStreamVolume_GetAllVolumes( if(!levels) return E_POINTER; - if(count != This->stream->fmt->nChannels) + if(count != This->channel_count) return E_INVALIDARG; EnterCriticalSection(&g_sessions_lock);
1
0
0
0
Huw Davies : winecoreaudio: Use the global lock to protect the audio client.
by Alexandre Julliard
17 Nov '21
17 Nov '21
Module: wine Branch: master Commit: 8e90b2569c4c7660038ea83aafe6489b012a503a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8e90b2569c4c7660038ea83a…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Nov 17 09:10:16 2021 -0600 winecoreaudio: Use the global lock to protect the audio client. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winecoreaudio.drv/mmdevdrv.c | 115 +++++++++++++++++++------------------- 1 file changed, 59 insertions(+), 56 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=8e90b2569c4c7660038e…
1
0
0
0
Huw Davies : winecoreaudio: Use the global lock to lock the session.
by Alexandre Julliard
17 Nov '21
17 Nov '21
Module: wine Branch: master Commit: 28cb5534d1feb7134b4106d29174fd7e1a138b03 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=28cb5534d1feb7134b4106d2…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Nov 17 09:09:53 2021 -0600 winecoreaudio: Use the global lock to lock the session. Mainly just for simplicity. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winecoreaudio.drv/mmdevdrv.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/dlls/winecoreaudio.drv/mmdevdrv.c b/dlls/winecoreaudio.drv/mmdevdrv.c index 11be188d110..e82962db1ba 100644 --- a/dlls/winecoreaudio.drv/mmdevdrv.c +++ b/dlls/winecoreaudio.drv/mmdevdrv.c @@ -96,8 +96,6 @@ typedef struct _AudioSession { float *channel_vols; BOOL mute; - CRITICAL_SECTION lock; - struct list entry; } AudioSession; @@ -827,9 +825,6 @@ static AudioSession *create_session(const GUID *guid, IMMDevice *device, list_add_head(&g_sessions, &ret->entry); - InitializeCriticalSection(&ret->lock); - ret->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": AudioSession.lock"); - session_init_vols(ret, num_channels); ret->master_vol = 1.f; @@ -3056,13 +3051,13 @@ static HRESULT WINAPI SimpleAudioVolume_SetMasterVolume( if(context) FIXME("Notifications not supported yet\n"); - EnterCriticalSection(&session->lock); + EnterCriticalSection(&g_sessions_lock); session->master_vol = level; ret = ca_session_setvol(session, -1); - LeaveCriticalSection(&session->lock); + LeaveCriticalSection(&g_sessions_lock); return ret; } @@ -3094,13 +3089,13 @@ static HRESULT WINAPI SimpleAudioVolume_SetMute(ISimpleAudioVolume *iface, if(context) FIXME("Notifications not supported yet\n"); - EnterCriticalSection(&session->lock); + EnterCriticalSection(&g_sessions_lock); session->mute = mute; ca_session_setvol(session, -1); - LeaveCriticalSection(&session->lock); + LeaveCriticalSection(&g_sessions_lock); return S_OK; } @@ -3356,14 +3351,14 @@ static HRESULT WINAPI ChannelAudioVolume_SetChannelVolume( if(context) FIXME("Notifications not supported yet\n"); - EnterCriticalSection(&session->lock); + EnterCriticalSection(&g_sessions_lock); session->channel_vols[index] = level; WARN("CoreAudio doesn't support per-channel volume control\n"); ret = ca_session_setvol(session, index); - LeaveCriticalSection(&session->lock); + LeaveCriticalSection(&g_sessions_lock); return ret; } @@ -3408,14 +3403,14 @@ static HRESULT WINAPI ChannelAudioVolume_SetAllVolumes( if(context) FIXME("Notifications not supported yet\n"); - EnterCriticalSection(&session->lock); + EnterCriticalSection(&g_sessions_lock); for(i = 0; i < count; ++i) session->channel_vols[i] = levels[i]; ret = ca_session_setvol(session, -1); - LeaveCriticalSection(&session->lock); + LeaveCriticalSection(&g_sessions_lock); return ret; }
1
0
0
0
Huw Davies : winecoreaudio: Introduce a stream structure.
by Alexandre Julliard
17 Nov '21
17 Nov '21
Module: wine Branch: master Commit: 9281d0154478cbb6d8f857397aa6a40abd99e7ab URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9281d0154478cbb6d8f85739…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Nov 17 09:09:29 2021 -0600 winecoreaudio: Introduce a stream structure. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winecoreaudio.drv/mmdevdrv.c | 637 +++++++++++++++++++------------------- dlls/winecoreaudio.drv/unixlib.h | 23 ++ 2 files changed, 339 insertions(+), 321 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=9281d0154478cbb6d8f8…
1
0
0
0
Huw Davies : winecoreaudio: Move get_endpoint_ids to a unixlib.
by Alexandre Julliard
17 Nov '21
17 Nov '21
Module: wine Branch: master Commit: c84923b2003e21300d829de29e52056516adbab2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c84923b2003e21300d829de2…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Nov 17 09:08:49 2021 -0600 winecoreaudio: Move get_endpoint_ids to a unixlib. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winecoreaudio.drv/Makefile.in | 1 + dlls/winecoreaudio.drv/coreaudio.c | 229 ++++++++++++++++++++++++++++++++++++- dlls/winecoreaudio.drv/mmdevdrv.c | 203 +++++++++----------------------- dlls/winecoreaudio.drv/unixlib.h | 44 +++++++ 4 files changed, 322 insertions(+), 155 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=c84923b2003e21300d82…
1
0
0
0
Huw Davies : winecoreaudio: Move DriverProc to midi.c.
by Alexandre Julliard
17 Nov '21
17 Nov '21
Module: wine Branch: master Commit: 0e52d77f92b859244df681b95618c86ab6d8ddad URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0e52d77f92b859244df681b9…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Nov 17 09:08:25 2021 -0600 winecoreaudio: Move DriverProc to midi.c. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winecoreaudio.drv/coreaudio.c | 81 -------------------------------------- dlls/winecoreaudio.drv/coreaudio.h | 9 ----- dlls/winecoreaudio.drv/midi.c | 78 +++++++++++++++++++++++++++++++++++- 3 files changed, 77 insertions(+), 91 deletions(-) diff --git a/dlls/winecoreaudio.drv/coreaudio.c b/dlls/winecoreaudio.drv/coreaudio.c index 321c24b477c..1f222367bed 100644 --- a/dlls/winecoreaudio.drv/coreaudio.c +++ b/dlls/winecoreaudio.drv/coreaudio.c @@ -1,8 +1,6 @@ /* * Wine Driver for CoreAudio * - * Copyright 2005 Emmanuel Maillard - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -30,82 +28,3 @@ #include "mmddk.h" #include "coreaudio.h" #include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(coreaudio); - - -/************************************************************************** - * CoreAudio_drvLoad [internal] - */ -static LRESULT CoreAudio_drvLoad(void) -{ - TRACE("()\n"); - - if (CoreAudio_MIDIInit() != DRV_SUCCESS) - return DRV_FAILURE; - - return DRV_SUCCESS; -} - -/************************************************************************** - * CoreAudio_drvFree [internal] - */ -static LRESULT CoreAudio_drvFree(void) -{ - TRACE("()\n"); - CoreAudio_MIDIRelease(); - return DRV_SUCCESS; -} - -/************************************************************************** - * CoreAudio_drvOpen [internal] - */ -static LRESULT CoreAudio_drvOpen(LPSTR str) -{ - TRACE("(%s)\n", str); - return 1; -} - -/************************************************************************** - * CoreAudio_drvClose [internal] - */ -static DWORD CoreAudio_drvClose(DWORD dwDevID) -{ - TRACE("(%08x)\n", dwDevID); - return 1; -} - -/************************************************************************** - * DriverProc (WINECOREAUDIO.1) - */ -LRESULT CALLBACK CoreAudio_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, - LPARAM dwParam1, LPARAM dwParam2) -{ - TRACE("(%08lX, %p, %s (%08X), %08lX, %08lX)\n", - dwDevID, hDriv, wMsg == DRV_LOAD ? "DRV_LOAD" : - wMsg == DRV_FREE ? "DRV_FREE" : - wMsg == DRV_OPEN ? "DRV_OPEN" : - wMsg == DRV_CLOSE ? "DRV_CLOSE" : - wMsg == DRV_ENABLE ? "DRV_ENABLE" : - wMsg == DRV_DISABLE ? "DRV_DISABLE" : - wMsg == DRV_QUERYCONFIGURE ? "DRV_QUERYCONFIGURE" : - wMsg == DRV_CONFIGURE ? "DRV_CONFIGURE" : - wMsg == DRV_INSTALL ? "DRV_INSTALL" : - wMsg == DRV_REMOVE ? "DRV_REMOVE" : "UNKNOWN", - wMsg, dwParam1, dwParam2); - - switch(wMsg) { - case DRV_LOAD: return CoreAudio_drvLoad(); - case DRV_FREE: return CoreAudio_drvFree(); - case DRV_OPEN: return CoreAudio_drvOpen((LPSTR)dwParam1); - case DRV_CLOSE: return CoreAudio_drvClose(dwDevID); - case DRV_ENABLE: return 1; - case DRV_DISABLE: return 1; - case DRV_QUERYCONFIGURE: return 1; - case DRV_CONFIGURE: MessageBoxA(0, "CoreAudio driver!", "CoreAudio driver", MB_OK); return 1; - case DRV_INSTALL: return DRVCNF_RESTART; - case DRV_REMOVE: return DRVCNF_RESTART; - default: - return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2); - } -} diff --git a/dlls/winecoreaudio.drv/coreaudio.h b/dlls/winecoreaudio.drv/coreaudio.h index 68b52502333..e04043c4010 100644 --- a/dlls/winecoreaudio.drv/coreaudio.h +++ b/dlls/winecoreaudio.drv/coreaudio.h @@ -22,15 +22,6 @@ #include "wine/debug.h" -extern LONG CoreAudio_WaveInit(void); -extern void CoreAudio_WaveRelease(void); - -extern LONG CoreAudio_MIDIInit(void); -extern LONG CoreAudio_MIDIRelease(void); - -extern LONG CoreAudio_MixerInit(void); -extern void CoreAudio_MixerRelease(void); - /* fourcc is in native order, where MSB is the first character. */ static inline const char* wine_dbgstr_fourcc(INT32 fourcc) { diff --git a/dlls/winecoreaudio.drv/midi.c b/dlls/winecoreaudio.drv/midi.c index c299d116f12..64fc3618f61 100644 --- a/dlls/winecoreaudio.drv/midi.c +++ b/dlls/winecoreaudio.drv/midi.c @@ -8,7 +8,7 @@ * current support is limited to MIDI ports of OSS systems * 98/9 rewriting MCI code for MIDI * 98/11 split in midi.c and mcimidi.c - * Copyright 2006 Emmanuel Maillard + * Copyright 2005, 2006 Emmanuel Maillard * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -1033,3 +1033,79 @@ DWORD WINAPI CoreAudio_midMessage(UINT wDevID, UINT wMsg, DWORD dwUser, DWORD dw } return MMSYSERR_NOTSUPPORTED; } + +/************************************************************************** + * CoreAudio_drvLoad [internal] + */ +static LRESULT CoreAudio_drvLoad(void) +{ + TRACE("()\n"); + + if (CoreAudio_MIDIInit() != DRV_SUCCESS) + return DRV_FAILURE; + + return DRV_SUCCESS; +} + +/************************************************************************** + * CoreAudio_drvFree [internal] + */ +static LRESULT CoreAudio_drvFree(void) +{ + TRACE("()\n"); + CoreAudio_MIDIRelease(); + return DRV_SUCCESS; +} + +/************************************************************************** + * CoreAudio_drvOpen [internal] + */ +static LRESULT CoreAudio_drvOpen(LPSTR str) +{ + TRACE("(%s)\n", str); + return 1; +} + +/************************************************************************** + * CoreAudio_drvClose [internal] + */ +static DWORD CoreAudio_drvClose(DWORD dwDevID) +{ + TRACE("(%08x)\n", dwDevID); + return 1; +} + +/************************************************************************** + * DriverProc (WINECOREAUDIO.1) + */ +LRESULT CALLBACK CoreAudio_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, + LPARAM dwParam1, LPARAM dwParam2) +{ + TRACE("(%08lX, %p, %s (%08X), %08lX, %08lX)\n", + dwDevID, hDriv, wMsg == DRV_LOAD ? "DRV_LOAD" : + wMsg == DRV_FREE ? "DRV_FREE" : + wMsg == DRV_OPEN ? "DRV_OPEN" : + wMsg == DRV_CLOSE ? "DRV_CLOSE" : + wMsg == DRV_ENABLE ? "DRV_ENABLE" : + wMsg == DRV_DISABLE ? "DRV_DISABLE" : + wMsg == DRV_QUERYCONFIGURE ? "DRV_QUERYCONFIGURE" : + wMsg == DRV_CONFIGURE ? "DRV_CONFIGURE" : + wMsg == DRV_INSTALL ? "DRV_INSTALL" : + wMsg == DRV_REMOVE ? "DRV_REMOVE" : "UNKNOWN", + wMsg, dwParam1, dwParam2); + + switch(wMsg) { + case DRV_LOAD: return CoreAudio_drvLoad(); + case DRV_FREE: return CoreAudio_drvFree(); + case DRV_OPEN: return CoreAudio_drvOpen((LPSTR)dwParam1); + case DRV_CLOSE: return CoreAudio_drvClose(dwDevID); + case DRV_ENABLE: return 1; + case DRV_DISABLE: return 1; + case DRV_QUERYCONFIGURE: return 1; + case DRV_CONFIGURE: MessageBoxA(0, "CoreAudio driver!", "CoreAudio driver", MB_OK); return 1; + case DRV_INSTALL: return DRVCNF_RESTART; + case DRV_REMOVE: return DRVCNF_RESTART; + default: + return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2); + } +}
1
0
0
0
← Newer
1
...
36
37
38
39
40
41
42
...
96
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
Results per page:
10
25
50
100
200