Wine-Devel
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- 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
- 8 participants
- 84547 discussions
July 24, 2020
Signed-off-by: Myah Caron <qsniyg(a)protonmail.com>
---
dlls/amstream/filter.c | 24 ++++++++++++++++++++++--
dlls/amstream/tests/amstream.c | 7 +++++++
2 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/dlls/amstream/filter.c b/dlls/amstream/filter.c
index 0a06e78180..ef23edfae3 100644
--- a/dlls/amstream/filter.c
+++ b/dlls/amstream/filter.c
@@ -773,9 +773,29 @@ static HRESULT WINAPI filter_seeking_SetTimeFormat(IMediaSeeking *iface, const G
static HRESULT WINAPI filter_seeking_GetDuration(IMediaSeeking *iface, LONGLONG *duration)
{
- FIXME("iface %p, duration %p, stub!\n", iface, duration);
+ struct filter *filter = impl_from_IMediaSeeking(iface);
+ IMediaSeeking *seeking;
+ HRESULT hr;
- return E_NOTIMPL;
+ TRACE("iface %p, duration %p\n", iface, duration);
+
+ EnterCriticalSection(&filter->cs);
+
+ seeking = get_seeking(filter->seekable_stream);
+
+ if (!seeking)
+ {
+ LeaveCriticalSection(&filter->cs);
+ return E_NOTIMPL;
+ }
+
+ hr = IMediaSeeking_GetDuration(seeking, duration);
+
+ IMediaSeeking_Release(seeking);
+
+ LeaveCriticalSection(&filter->cs);
+
+ return hr;
}
static HRESULT WINAPI filter_seeking_GetStopPosition(IMediaSeeking *iface, LONGLONG *stop)
diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c
index 8adf9db934..50b2d5a761 100644
--- a/dlls/amstream/tests/amstream.c
+++ b/dlls/amstream/tests/amstream.c
@@ -4815,6 +4815,7 @@ static void test_mediastreamfilter_set_positions(void)
IAMMediaStream *stream2;
IAMMediaStream *stream3;
LONGLONG stop_position;
+ LONGLONG duration;
IMediaSeeking *seeking;
IGraphBuilder *graph;
IPin *pin1;
@@ -4905,6 +4906,12 @@ static void test_mediastreamfilter_set_positions(void)
ok(source3.stop_position == 0xdeadbeefdeadbeefULL, "Got stop position %s.\n",
wine_dbgstr_longlong(source3.stop_position));
+ duration = 0xdeadbeefdeadbeefULL;
+ hr = IMediaSeeking_GetDuration(seeking, &duration);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(duration == 0x8000000000000000ULL, "Got duration %s.\n",
+ wine_dbgstr_longlong(duration));
+
source2.set_positions_hr = E_FAIL;
source1.current_position = 0xdeadbeefdeadbeefULL;
source1.stop_position = 0xdeadbeefdeadbeefULL;
--
2.27.0
2
1
July 24, 2020
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/dsound/tests/Makefile.in | 2 +-
dlls/dsound/tests/capture.c | 37 +++------
dlls/dsound/tests/ds3d.c | 35 ++------
dlls/dsound/tests/ds3d8.c | 35 ++------
dlls/dsound/tests/dsound.c | 115 +++++++-------------------
dlls/dsound/tests/dsound8.c | 75 ++++++-----------
dlls/dsound/tests/duplex.c | 50 +++---------
dlls/dsound/tests/propset.c | 148 ++++++++++++----------------------
8 files changed, 145 insertions(+), 352 deletions(-)
diff --git a/dlls/dsound/tests/Makefile.in b/dlls/dsound/tests/Makefile.in
index a3e7c37c93..49bc4d9b55 100644
--- a/dlls/dsound/tests/Makefile.in
+++ b/dlls/dsound/tests/Makefile.in
@@ -1,5 +1,5 @@
TESTDLL = dsound.dll
-IMPORTS = ole32 version user32
+IMPORTS = dsound ole32 version user32
C_SRCS = \
capture.c \
diff --git a/dlls/dsound/tests/capture.c b/dlls/dsound/tests/capture.c
index dada067956..e326fe8d83 100644
--- a/dlls/dsound/tests/capture.c
+++ b/dlls/dsound/tests/capture.c
@@ -32,9 +32,6 @@
#define NOTIFICATIONS 5
-static HRESULT (WINAPI *pDirectSoundCaptureCreate)(LPCGUID,LPDIRECTSOUNDCAPTURE*,LPUNKNOWN)=NULL;
-static HRESULT (WINAPI *pDirectSoundCaptureEnumerateA)(LPDSENUMCALLBACKA,LPVOID)=NULL;
-
static const char * get_format_str(WORD format)
{
static char msg[32];
@@ -232,28 +229,28 @@ static void test_capture(void)
"should have failed: %08x\n",rc);
/* try with no device specified */
- rc=pDirectSoundCaptureCreate(NULL,&dsco,NULL);
+ rc = DirectSoundCaptureCreate(NULL, &dsco, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCaptureCreate(NULL) failed: %08x\n",rc);
if (rc==S_OK && dsco)
IDirectSoundCapture_test(dsco, TRUE, NULL);
/* try with default capture device specified */
- rc=pDirectSoundCaptureCreate(&DSDEVID_DefaultCapture,&dsco,NULL);
+ rc = DirectSoundCaptureCreate(&DSDEVID_DefaultCapture, &dsco, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCaptureCreate(DSDEVID_DefaultCapture) failed: %08x\n", rc);
if (rc==DS_OK && dsco)
IDirectSoundCapture_test(dsco, TRUE, NULL);
/* try with default voice capture device specified */
- rc=pDirectSoundCaptureCreate(&DSDEVID_DefaultVoiceCapture,&dsco,NULL);
+ rc = DirectSoundCaptureCreate(&DSDEVID_DefaultVoiceCapture, &dsco, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCaptureCreate(DSDEVID_DefaultVoiceCapture) failed: %08x\n", rc);
if (rc==DS_OK && dsco)
IDirectSoundCapture_test(dsco, TRUE, NULL);
/* try with a bad device specified */
- rc=pDirectSoundCaptureCreate(&DSDEVID_DefaultVoicePlayback,&dsco,NULL);
+ rc = DirectSoundCaptureCreate(&DSDEVID_DefaultVoicePlayback, &dsco, NULL);
ok(rc==DSERR_NODRIVER,
"DirectSoundCaptureCreate(DSDEVID_DefaultVoicePlatback) "
"should have failed: %08x\n",rc);
@@ -442,11 +439,11 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
/* Private dsound.dll: Error: Invalid interface buffer */
trace("*** Testing %s - %s ***\n",lpcstrDescription,lpcstrModule);
- rc=pDirectSoundCaptureCreate(lpGuid,NULL,NULL);
+ rc = DirectSoundCaptureCreate(lpGuid, NULL, NULL);
ok(rc==DSERR_INVALIDPARAM,"DirectSoundCaptureCreate() should have "
"returned DSERR_INVALIDPARAM, returned: %08x\n",rc);
- rc=pDirectSoundCaptureCreate(lpGuid,&dsco,NULL);
+ rc = DirectSoundCaptureCreate(lpGuid, &dsco, NULL);
ok((rc==DS_OK)||(rc==DSERR_NODRIVER)||(rc==E_FAIL)||(rc==DSERR_ALLOCATED),
"DirectSoundCaptureCreate() failed: %08x\n",rc);
if (rc!=DS_OK) {
@@ -669,7 +666,7 @@ EXIT:
static void test_enumerate(void)
{
HRESULT rc;
- rc=pDirectSoundCaptureEnumerateA(&dscenum_callback,NULL);
+ rc = DirectSoundCaptureEnumerateA(dscenum_callback, NULL);
ok(rc==DS_OK,"DirectSoundCaptureEnumerateA() failed: %08x\n", rc);
}
@@ -684,12 +681,12 @@ static void test_COM(void)
HRESULT hr;
ULONG refcount;
- hr = pDirectSoundCaptureCreate(NULL, &dsc, (IUnknown*)0xdeadbeef);
+ hr = DirectSoundCaptureCreate(NULL, &dsc, (IUnknown *)0xdeadbeef);
ok(hr == DSERR_NOAGGREGATION,
"DirectSoundCaptureCreate failed: %08x, expected DSERR_NOAGGREGATION\n", hr);
ok(dsc == (IDirectSoundCapture*)0xdeadbeef, "dsc = %p\n", dsc);
- hr = pDirectSoundCaptureCreate(NULL, &dsc, NULL);
+ hr = DirectSoundCaptureCreate(NULL, &dsc, NULL);
if (hr == DSERR_NODRIVER) {
skip("No driver\n");
return;
@@ -755,27 +752,11 @@ static void test_COM(void)
START_TEST(capture)
{
- HMODULE hDsound;
-
CoInitialize(NULL);
- hDsound = LoadLibraryA("dsound.dll");
- if (!hDsound) {
- skip("dsound.dll not found - skipping all tests\n");
- return;
- }
-
- pDirectSoundCaptureCreate = (void*)GetProcAddress(hDsound, "DirectSoundCaptureCreate");
- pDirectSoundCaptureEnumerateA = (void*)GetProcAddress(hDsound, "DirectSoundCaptureEnumerateA");
- if (!pDirectSoundCaptureCreate || !pDirectSoundCaptureEnumerateA) {
- skip("DirectSoundCapture{Create,Enumerate} missing - skipping all tests\n");
- return;
- }
-
test_COM();
test_capture();
test_enumerate();
- FreeLibrary(hDsound);
CoUninitialize();
}
diff --git a/dlls/dsound/tests/ds3d.c b/dlls/dsound/tests/ds3d.c
index 1b44afff8d..a6b31641d4 100644
--- a/dlls/dsound/tests/ds3d.c
+++ b/dlls/dsound/tests/ds3d.c
@@ -36,11 +36,6 @@
#define PI 3.14159265358979323846
-
-static HRESULT (WINAPI *pDirectSoundEnumerateA)(LPDSENUMCALLBACKA,LPVOID)=NULL;
-static HRESULT (WINAPI *pDirectSoundCreate)(LPCGUID,LPDIRECTSOUND*,
- LPUNKNOWN)=NULL;
-
char* wave_generate_la(WAVEFORMATEX* wfx, double duration, DWORD* size, BOOL ieee)
{
int i;
@@ -712,7 +707,7 @@ static HRESULT test_secondary(LPGUID lpGuid, int play,
int ref;
/* Create the DirectSound object */
- rc=pDirectSoundCreate(lpGuid,&dso,NULL);
+ rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate() failed: %08x\n", rc);
if (rc!=DS_OK)
return rc;
@@ -974,7 +969,7 @@ static HRESULT test_for_driver(LPGUID lpGuid)
int ref;
/* Create the DirectSound object */
- rc=pDirectSoundCreate(lpGuid,&dso,NULL);
+ rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK)
@@ -998,7 +993,7 @@ static HRESULT test_primary(LPGUID lpGuid)
int ref, i;
/* Create the DirectSound object */
- rc=pDirectSoundCreate(lpGuid,&dso,NULL);
+ rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate() failed: %08x\n", rc);
if (rc!=DS_OK)
return rc;
@@ -1081,7 +1076,7 @@ static HRESULT test_primary_3d(LPGUID lpGuid)
int ref;
/* Create the DirectSound object */
- rc=pDirectSoundCreate(lpGuid,&dso,NULL);
+ rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate() failed: %08x\n", rc);
if (rc!=DS_OK)
return rc;
@@ -1152,7 +1147,7 @@ static HRESULT test_primary_3d_with_listener(LPGUID lpGuid)
int ref;
/* Create the DirectSound object */
- rc=pDirectSoundCreate(lpGuid,&dso,NULL);
+ rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate() failed: %08x\n", rc);
if (rc!=DS_OK)
return rc;
@@ -1306,32 +1301,16 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
static void ds3d_tests(void)
{
HRESULT rc;
- rc=pDirectSoundEnumerateA(&dsenum_callback,NULL);
+ rc = DirectSoundEnumerateA(dsenum_callback, NULL);
ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %08x\n",rc);
trace("tested %u DirectSound drivers\n", driver_count);
}
START_TEST(ds3d)
{
- HMODULE hDsound;
-
CoInitialize(NULL);
- hDsound = LoadLibraryA("dsound.dll");
- if (hDsound)
- {
-
- pDirectSoundEnumerateA = (void*)GetProcAddress(hDsound,
- "DirectSoundEnumerateA");
- pDirectSoundCreate = (void*)GetProcAddress(hDsound,
- "DirectSoundCreate");
-
- ds3d_tests();
-
- FreeLibrary(hDsound);
- }
- else
- skip("dsound.dll not found - skipping all tests\n");
+ ds3d_tests();
CoUninitialize();
}
diff --git a/dlls/dsound/tests/ds3d8.c b/dlls/dsound/tests/ds3d8.c
index 00340af94b..465ba040a3 100644
--- a/dlls/dsound/tests/ds3d8.c
+++ b/dlls/dsound/tests/ds3d8.c
@@ -34,9 +34,6 @@
#include "ksmedia.h"
#include "dsound_test.h"
-static HRESULT (WINAPI *pDirectSoundEnumerateA)(LPDSENUMCALLBACKA,LPVOID)=NULL;
-static HRESULT (WINAPI *pDirectSoundCreate8)(LPCGUID,LPDIRECTSOUND8*,LPUNKNOWN)=NULL;
-
typedef struct {
char* wave;
DWORD wave_len;
@@ -544,7 +541,7 @@ static HRESULT test_secondary8(LPGUID lpGuid, BOOL play,
int ref;
/* Create the DirectSound object */
- rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
+ rc = DirectSoundCreate8(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %08x\n", rc);
if (rc!=DS_OK)
return rc;
@@ -822,7 +819,7 @@ static HRESULT test_for_driver8(LPGUID lpGuid)
int ref;
/* Create the DirectSound object */
- rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
+ rc = DirectSoundCreate8(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate8() failed: %08x\n",rc);
if (rc!=DS_OK)
@@ -846,7 +843,7 @@ static HRESULT test_primary8(LPGUID lpGuid)
int ref, i;
/* Create the DirectSound object */
- rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
+ rc = DirectSoundCreate8(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %08x\n", rc);
if (rc!=DS_OK)
return rc;
@@ -928,7 +925,7 @@ static HRESULT test_primary_3d8(LPGUID lpGuid)
int ref;
/* Create the DirectSound object */
- rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
+ rc = DirectSoundCreate8(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %08x\n", rc);
if (rc!=DS_OK)
return rc;
@@ -999,7 +996,7 @@ static HRESULT test_primary_3d_with_listener8(LPGUID lpGuid)
int ref;
/* Create the DirectSound object */
- rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
+ rc = DirectSoundCreate8(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %08x\n", rc);
if (rc!=DS_OK)
return rc;
@@ -1136,34 +1133,16 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
static void ds3d8_tests(void)
{
HRESULT rc;
- rc=pDirectSoundEnumerateA(&dsenum_callback,NULL);
+ rc = DirectSoundEnumerateA(dsenum_callback, NULL);
ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %08x\n",rc);
trace("tested %u DirectSound drivers\n", driver_count);
}
START_TEST(ds3d8)
{
- HMODULE hDsound;
-
CoInitialize(NULL);
- hDsound = LoadLibraryA("dsound.dll");
- if (hDsound)
- {
-
- pDirectSoundEnumerateA = (void*)GetProcAddress(hDsound,
- "DirectSoundEnumerateA");
- pDirectSoundCreate8 = (void*)GetProcAddress(hDsound,
- "DirectSoundCreate8");
- if (pDirectSoundCreate8)
- ds3d8_tests();
- else
- skip("DirectSoundCreate8 missing - skipping all tests\n");
-
- FreeLibrary(hDsound);
- }
- else
- skip("dsound.dll not found - skipping all tests\n");
+ ds3d8_tests();
CoUninitialize();
}
diff --git a/dlls/dsound/tests/dsound.c b/dlls/dsound/tests/dsound.c
index 2bf87eb857..a4f59efaad 100644
--- a/dlls/dsound/tests/dsound.c
+++ b/dlls/dsound/tests/dsound.c
@@ -41,12 +41,6 @@
DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
-static HRESULT (WINAPI *pDirectSoundEnumerateA)(LPDSENUMCALLBACKA,LPVOID)=NULL;
-static HRESULT (WINAPI *pDirectSoundCreate)(LPCGUID,LPDIRECTSOUND*,
- LPUNKNOWN)=NULL;
-
-static BOOL gotdx8;
-
static void IDirectSound_test(LPDIRECTSOUND dso, BOOL initialized,
LPCGUID lpGuid)
{
@@ -235,28 +229,28 @@ static void IDirectSound_tests(void)
"should have failed: %08x\n",rc);
/* try with no device specified */
- rc=pDirectSoundCreate(NULL,&dso,NULL);
+ rc = DirectSoundCreate(NULL, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate(NULL) failed: %08x\n",rc);
if (rc==S_OK && dso)
IDirectSound_test(dso, TRUE, NULL);
/* try with default playback device specified */
- rc=pDirectSoundCreate(&DSDEVID_DefaultPlayback,&dso,NULL);
+ rc = DirectSoundCreate(&DSDEVID_DefaultPlayback, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate(DSDEVID_DefaultPlayback) failed: %08x\n", rc);
if (rc==DS_OK && dso)
IDirectSound_test(dso, TRUE, NULL);
/* try with default voice playback device specified */
- rc=pDirectSoundCreate(&DSDEVID_DefaultVoicePlayback,&dso,NULL);
+ rc = DirectSoundCreate(&DSDEVID_DefaultVoicePlayback, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate(DSDEVID_DefaultVoicePlayback) failed: %08x\n", rc);
if (rc==DS_OK && dso)
IDirectSound_test(dso, TRUE, NULL);
/* try with a bad device specified */
- rc=pDirectSoundCreate(&DSDEVID_DefaultVoiceCapture,&dso,NULL);
+ rc = DirectSoundCreate(&DSDEVID_DefaultVoiceCapture, &dso, NULL);
ok(rc==DSERR_NODRIVER,"DirectSoundCreate(DSDEVID_DefaultVoiceCapture) "
"should have failed: %08x\n",rc);
if (rc==DS_OK && dso)
@@ -270,12 +264,12 @@ static HRESULT test_dsound(LPGUID lpGuid)
int ref;
/* DSOUND: Error: Invalid interface buffer */
- rc=pDirectSoundCreate(lpGuid,0,NULL);
+ rc = DirectSoundCreate(lpGuid, 0, NULL);
ok(rc==DSERR_INVALIDPARAM,"DirectSoundCreate() should have returned "
"DSERR_INVALIDPARAM, returned: %08x\n",rc);
/* Create the DirectSound object */
- rc=pDirectSoundCreate(lpGuid,&dso,NULL);
+ rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK)
@@ -292,13 +286,13 @@ static HRESULT test_dsound(LPGUID lpGuid)
IDirectSound_test(dso, FALSE, lpGuid);
/* Create a DirectSound object */
- rc=pDirectSoundCreate(lpGuid,&dso,NULL);
+ rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK,"DirectSoundCreate() failed: %08x\n",rc);
if (rc==DS_OK) {
LPDIRECTSOUND dso1=NULL;
/* Create a second DirectSound object */
- rc=pDirectSoundCreate(lpGuid,&dso1,NULL);
+ rc = DirectSoundCreate(lpGuid, &dso1, NULL);
ok(rc==DS_OK,"DirectSoundCreate() failed: %08x\n",rc);
if (rc==DS_OK) {
/* Release the second DirectSound object */
@@ -318,7 +312,7 @@ static HRESULT test_dsound(LPGUID lpGuid)
return rc;
/* Create a DirectSound object */
- rc=pDirectSoundCreate(lpGuid,&dso,NULL);
+ rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK,"DirectSoundCreate() failed: %08x\n",rc);
if (rc==DS_OK) {
LPDIRECTSOUNDBUFFER secondary;
@@ -374,7 +368,7 @@ static HRESULT test_primary(LPGUID lpGuid)
int ref;
/* Create the DirectSound object */
- rc=pDirectSoundCreate(lpGuid,&dso,NULL);
+ rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK)
@@ -545,7 +539,7 @@ static HRESULT test_primary_secondary(LPGUID lpGuid)
int f,ref,tag;
/* Create the DirectSound object */
- rc=pDirectSoundCreate(lpGuid,&dso,NULL);
+ rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK)
@@ -687,7 +681,7 @@ static HRESULT test_secondary(LPGUID lpGuid)
int ref;
/* Create the DirectSound object */
- rc=pDirectSoundCreate(lpGuid,&dso,NULL);
+ rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK)
@@ -751,30 +745,16 @@ static HRESULT test_secondary(LPGUID lpGuid)
wfx.nBlockAlign);
bufdesc.lpwfxFormat=&wfx;
rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL);
- if (gotdx8 || wfx.wBitsPerSample <= 16 || wfx.wFormatTag == WAVE_FORMAT_IEEE_FLOAT)
- {
- if (wfx.wBitsPerSample > 16)
- ok(broken((rc == DSERR_CONTROLUNAVAIL || rc == DSERR_INVALIDCALL || rc == DSERR_INVALIDPARAM /* 2003 */) && !secondary)
- || rc == DS_OK, /* driver dependent? */
- "IDirectSound_CreateSoundBuffer() "
- "should have returned (DSERR_CONTROLUNAVAIL or DSERR_INVALIDCALL) "
- "and NULL, returned: %08x %p\n", rc, secondary);
- else
- ok((rc==DS_OK && secondary!=NULL) || broken(rc == DSERR_CONTROLUNAVAIL), /* vmware drivers on w2k */
- "IDirectSound_CreateSoundBuffer() failed to create a secondary buffer %08x\n",rc);
- }
- else
- ok(rc==E_INVALIDARG, "Creating %d bpp buffer on dx < 8 returned: %p %08x\n",
- wfx.wBitsPerSample, secondary, rc);
- if (!gotdx8)
- {
- win_skip("Not doing the WAVE_FORMAT_EXTENSIBLE tests\n");
- /* Apparently they succeed with bogus values,
- * which means that older dsound doesn't look at them
- */
- goto no_wfe;
- }
+ if (wfx.wBitsPerSample > 16)
+ ok(broken((rc == DSERR_CONTROLUNAVAIL || rc == DSERR_INVALIDCALL || rc == DSERR_INVALIDPARAM /* 2003 */) && !secondary)
+ || rc == DS_OK, /* driver dependent? */
+ "IDirectSound_CreateSoundBuffer() "
+ "should have returned (DSERR_CONTROLUNAVAIL or DSERR_INVALIDCALL) "
+ "and NULL, returned: %08x %p\n", rc, secondary);
+ else
+ ok((rc==DS_OK && secondary!=NULL) || broken(rc == DSERR_CONTROLUNAVAIL), /* vmware drivers on w2k */
+ "IDirectSound_CreateSoundBuffer() failed to create a secondary buffer %08x\n",rc);
if (secondary)
IDirectSoundBuffer_Release(secondary);
@@ -853,7 +833,6 @@ static HRESULT test_secondary(LPGUID lpGuid)
ok(rc==DS_OK && secondary!=NULL,
"IDirectSound_CreateSoundBuffer() failed to create a secondary buffer %08x\n",rc);
-no_wfe:
if (rc==DS_OK && secondary!=NULL) {
if (winetest_interactive) {
trace(" Testing a secondary buffer at %dx%dx%d (fmt=%d) "
@@ -902,7 +881,7 @@ static HRESULT test_block_align(LPGUID lpGuid)
int ref;
/* Create the DirectSound object */
- rc=pDirectSoundCreate(lpGuid,&dso,NULL);
+ rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK)
@@ -973,7 +952,7 @@ static HRESULT test_frequency(LPGUID lpGuid)
48000, 96000 };
/* Create the DirectSound object */
- rc=pDirectSoundCreate(lpGuid,&dso,NULL);
+ rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK)
@@ -1104,7 +1083,7 @@ static HRESULT test_duplicate(LPGUID lpGuid)
int ref;
/* Create the DirectSound object */
- rc=pDirectSoundCreate(lpGuid,&dso,NULL);
+ rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK)
@@ -1431,11 +1410,6 @@ static void perform_invalid_fmt_tests(const char *testname, IDirectSound *dso, I
}
}
- if(!gotdx8){
- win_skip("Not doing the WAVE_FORMAT_EXTENSIBLE tests\n");
- return;
- }
-
fmtex.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX);
fmtex.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
fmtex.Format.nChannels = 2;
@@ -1510,7 +1484,7 @@ static HRESULT test_invalid_fmts(LPGUID lpGuid)
DSBUFFERDESC bufdesc;
/* Create the DirectSound object */
- rc=pDirectSoundCreate(lpGuid,&dso,NULL);
+ rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK)
@@ -1556,7 +1530,7 @@ static void test_notifications(LPGUID lpGuid)
DWORD expect, status;
int cycles;
- rc = pDirectSoundCreate(lpGuid, &dso, NULL);
+ rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc == DS_OK || rc == DSERR_NODRIVER || rc == DSERR_ALLOCATED,
"DirectSoundCreate() failed: %08x\n", rc);
if(rc != DS_OK)
@@ -1683,7 +1657,7 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
static void dsound_tests(void)
{
HRESULT rc;
- rc=pDirectSoundEnumerateA(&dsenum_callback,NULL);
+ rc = DirectSoundEnumerateA(&dsenum_callback, NULL);
ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %08x\n",rc);
}
@@ -1699,7 +1673,7 @@ static void test_hw_buffers(void)
UINT i;
HRESULT hr;
- hr = pDirectSoundCreate(NULL, &ds, NULL);
+ hr = DirectSoundCreate(NULL, &ds, NULL);
ok(hr == S_OK || hr == DSERR_NODRIVER || hr == DSERR_ALLOCATED || hr == E_FAIL,
"DirectSoundCreate failed: %08x\n", hr);
if(hr != S_OK)
@@ -1801,38 +1775,11 @@ static void test_hw_buffers(void)
START_TEST(dsound)
{
- HMODULE hDsound;
-
CoInitialize(NULL);
- hDsound = LoadLibraryA("dsound.dll");
- if (hDsound)
- {
- BOOL ret;
-
- ret = FreeLibrary(hDsound);
- ok( ret, "FreeLibrary(1) returned %d\n", GetLastError());
- }
-
- hDsound = LoadLibraryA("dsound.dll");
- if (hDsound)
- {
-
- pDirectSoundEnumerateA = (void*)GetProcAddress(hDsound,
- "DirectSoundEnumerateA");
- pDirectSoundCreate = (void*)GetProcAddress(hDsound,
- "DirectSoundCreate");
-
- gotdx8 = !!GetProcAddress(hDsound, "DirectSoundCreate8");
-
- IDirectSound_tests();
- dsound_tests();
- test_hw_buffers();
-
- FreeLibrary(hDsound);
- }
- else
- win_skip("dsound.dll not found - skipping all tests\n");
+ IDirectSound_tests();
+ dsound_tests();
+ test_hw_buffers();
CoUninitialize();
}
diff --git a/dlls/dsound/tests/dsound8.c b/dlls/dsound/tests/dsound8.c
index 8190a61736..6fe13c66fd 100644
--- a/dlls/dsound/tests/dsound8.c
+++ b/dlls/dsound/tests/dsound8.c
@@ -48,9 +48,6 @@
#include "dsound_test.h"
-static HRESULT (WINAPI *pDirectSoundEnumerateA)(LPDSENUMCALLBACKA,LPVOID)=NULL;
-static HRESULT (WINAPI *pDirectSoundCreate8)(LPCGUID,LPDIRECTSOUND8*,LPUNKNOWN)=NULL;
-
int align(int length, int align)
{
return (length / align) * align;
@@ -250,28 +247,28 @@ static void IDirectSound8_tests(void)
"should have failed: %08x\n",rc);
/* try with no device specified */
- rc=pDirectSoundCreate8(NULL,&dso,NULL);
+ rc = DirectSoundCreate8(NULL, &dso, NULL);
ok(rc==S_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate8() failed: %08x\n",rc);
if (rc==DS_OK && dso)
IDirectSound8_test(dso, TRUE, NULL);
/* try with default playback device specified */
- rc=pDirectSoundCreate8(&DSDEVID_DefaultPlayback,&dso,NULL);
+ rc = DirectSoundCreate8(&DSDEVID_DefaultPlayback, &dso, NULL);
ok(rc==S_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate8() failed: %08x\n",rc);
if (rc==DS_OK && dso)
IDirectSound8_test(dso, TRUE, NULL);
/* try with default voice playback device specified */
- rc=pDirectSoundCreate8(&DSDEVID_DefaultVoicePlayback,&dso,NULL);
+ rc = DirectSoundCreate8(&DSDEVID_DefaultVoicePlayback, &dso, NULL);
ok(rc==S_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate8() failed: %08x\n",rc);
if (rc==DS_OK && dso)
IDirectSound8_test(dso, TRUE, NULL);
/* try with a bad device specified */
- rc=pDirectSoundCreate8(&DSDEVID_DefaultVoiceCapture,&dso,NULL);
+ rc = DirectSoundCreate8(&DSDEVID_DefaultVoiceCapture, &dso, NULL);
ok(rc==DSERR_NODRIVER,"DirectSoundCreate8(DSDEVID_DefaultVoiceCapture) "
"should have failed: %08x\n",rc);
}
@@ -283,12 +280,12 @@ static HRESULT test_dsound8(LPGUID lpGuid)
int ref;
/* DSOUND: Error: Invalid interface buffer */
- rc=pDirectSoundCreate8(lpGuid,0,NULL);
+ rc = DirectSoundCreate8(lpGuid, 0, NULL);
ok(rc==DSERR_INVALIDPARAM,"DirectSoundCreate8() should have returned "
"DSERR_INVALIDPARAM, returned: %08x\n",rc);
/* Create the DirectSound8 object */
- rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
+ rc = DirectSoundCreate8(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate8() failed: %08x\n",rc);
if (rc!=DS_OK)
@@ -305,13 +302,13 @@ static HRESULT test_dsound8(LPGUID lpGuid)
IDirectSound8_test(dso, FALSE, lpGuid);
/* Create a DirectSound8 object */
- rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
+ rc = DirectSoundCreate8(lpGuid, &dso, NULL);
ok(rc==DS_OK,"DirectSoundCreate8() failed: %08x\n",rc);
if (rc==DS_OK) {
LPDIRECTSOUND8 dso1=NULL;
/* Create a second DirectSound8 object */
- rc=pDirectSoundCreate8(lpGuid,&dso1,NULL);
+ rc = DirectSoundCreate8(lpGuid, &dso1, NULL);
ok(rc==DS_OK,"DirectSoundCreate8() failed: %08x\n",rc);
if (rc==DS_OK) {
/* Release the second DirectSound8 object */
@@ -332,7 +329,7 @@ static HRESULT test_dsound8(LPGUID lpGuid)
return rc;
/* Create a DirectSound8 object */
- rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
+ rc = DirectSoundCreate8(lpGuid, &dso, NULL);
ok(rc==DS_OK,"DirectSoundCreate8() failed: %08x\n",rc);
if (rc==DS_OK) {
LPDIRECTSOUNDBUFFER secondary;
@@ -401,7 +398,7 @@ static HRESULT test_primary8(LPGUID lpGuid)
int ref;
/* Create the DirectSound object */
- rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
+ rc = DirectSoundCreate8(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate8() failed: %08x\n",rc);
if (rc!=DS_OK)
@@ -551,7 +548,7 @@ static HRESULT test_primary_secondary8(LPGUID lpGuid)
unsigned int f, tag;
/* Create the DirectSound object */
- rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
+ rc = DirectSoundCreate8(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate8() failed: %08x\n",rc);
if (rc!=DS_OK)
@@ -692,7 +689,7 @@ static HRESULT test_secondary8(LPGUID lpGuid)
int ref;
/* Create the DirectSound object */
- rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
+ rc = DirectSoundCreate8(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate8() failed: %08x\n",rc);
if (rc!=DS_OK)
@@ -938,7 +935,7 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
static void dsound8_tests(void)
{
HRESULT rc;
- rc=pDirectSoundEnumerateA(&dsenum_callback,NULL);
+ rc = DirectSoundEnumerateA(dsenum_callback, NULL);
ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %08x\n",rc);
}
@@ -954,7 +951,7 @@ static void test_hw_buffers(void)
UINT i;
HRESULT hr;
- hr = pDirectSoundCreate8(NULL, &ds, NULL);
+ hr = DirectSoundCreate8(NULL, &ds, NULL);
ok(hr == S_OK || hr == DSERR_NODRIVER || hr == DSERR_ALLOCATED || hr == E_FAIL,
"DirectSoundCreate8 failed: %08x\n", hr);
if(hr != S_OK)
@@ -1119,7 +1116,7 @@ static void test_first_device(void)
IMMDevice_Release(defdev);
IMMDeviceEnumerator_Release(devenum);
- hr = pDirectSoundEnumerateA(&default_device_cb, NULL);
+ hr = DirectSoundEnumerateA(default_device_cb, NULL);
ok(hr == S_OK, "DirectSoundEnumerateA failed: %08x\n", hr);
}
@@ -1183,7 +1180,7 @@ static void test_primary_flags(void)
DSCAPS dscaps;
/* Create a DirectSound8 object */
- rc = pDirectSoundCreate8(NULL, &dso, NULL);
+ rc = DirectSoundCreate8(NULL, &dso, NULL);
ok(rc == DS_OK || rc==DSERR_NODRIVER, "Failed: %08x\n",rc);
if (rc!=DS_OK)
@@ -1234,7 +1231,7 @@ static void test_effects(void)
DWORD resultcodes[2];
/* Create a DirectSound8 object */
- rc=pDirectSoundCreate8(NULL,&dso,NULL);
+ rc = DirectSoundCreate8(NULL, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %08x\n",rc);
if (rc!=DS_OK)
@@ -1696,7 +1693,7 @@ static void test_effects_parameters(void)
DWORD resultcodes[8];
/* Create a DirectSound8 object */
- rc = pDirectSoundCreate8(NULL, &dso, NULL);
+ rc = DirectSoundCreate8(NULL, &dso, NULL);
ok(rc == DS_OK || rc == DSERR_NODRIVER, "DirectSoundCreate8() failed: %08x\n", rc);
if (rc != DS_OK)
return;
@@ -1789,36 +1786,16 @@ cleanup:
START_TEST(dsound8)
{
- HMODULE hDsound;
-
CoInitialize(NULL);
- hDsound = LoadLibraryA("dsound.dll");
- if (hDsound)
- {
-
- pDirectSoundEnumerateA = (void*)GetProcAddress(hDsound,
- "DirectSoundEnumerateA");
- pDirectSoundCreate8 = (void*)GetProcAddress(hDsound,
- "DirectSoundCreate8");
- if (pDirectSoundCreate8)
- {
- test_COM();
- IDirectSound8_tests();
- dsound8_tests();
- test_hw_buffers();
- test_first_device();
- test_primary_flags();
- test_effects();
- test_effects_parameters();
- }
- else
- skip("DirectSoundCreate8 missing - skipping all tests\n");
-
- FreeLibrary(hDsound);
- }
- else
- skip("dsound.dll not found - skipping all tests\n");
+ test_COM();
+ IDirectSound8_tests();
+ dsound8_tests();
+ test_hw_buffers();
+ test_first_device();
+ test_primary_flags();
+ test_effects();
+ test_effects_parameters();
CoUninitialize();
}
diff --git a/dlls/dsound/tests/duplex.c b/dlls/dsound/tests/duplex.c
index b770515785..59507c566c 100644
--- a/dlls/dsound/tests/duplex.c
+++ b/dlls/dsound/tests/duplex.c
@@ -29,10 +29,6 @@
#include "dsound_test.h"
-static HRESULT (WINAPI *pDirectSoundFullDuplexCreate)(LPCGUID, LPCGUID,
- LPCDSCBUFFERDESC, LPCDSBUFFERDESC, HWND, DWORD, LPDIRECTSOUNDFULLDUPLEX *,
- LPDIRECTSOUNDCAPTUREBUFFER8*, LPDIRECTSOUNDBUFFER8*, LPUNKNOWN)=NULL;
-
static void IDirectSoundFullDuplex_test(LPDIRECTSOUNDFULLDUPLEX dsfdo,
BOOL initialized, LPCGUID lpGuidCapture,
LPCGUID lpGuidRender)
@@ -181,19 +177,17 @@ static void IDirectSoundFullDuplex_tests(void)
DSBufferDesc.lpwfxFormat = &wfex;
/* try with no device specified */
- rc=pDirectSoundFullDuplexCreate(NULL,NULL,&DSCBufferDesc,&DSBufferDesc,
- get_hwnd(),DSSCL_EXCLUSIVE ,&dsfdo,&pDSCBuffer8,
- &pDSBuffer8,NULL);
+ rc = DirectSoundFullDuplexCreate(NULL, NULL, &DSCBufferDesc, &DSBufferDesc,
+ get_hwnd(), DSSCL_EXCLUSIVE, &dsfdo, &pDSCBuffer8, &pDSBuffer8, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL||rc==DSERR_INVALIDCALL,
"DirectSoundFullDuplexCreate(NULL,NULL) failed: %08x\n",rc);
if (rc==S_OK && dsfdo)
IDirectSoundFullDuplex_test(dsfdo, TRUE, NULL, NULL);
/* try with default devices specified */
- rc=pDirectSoundFullDuplexCreate(&DSDEVID_DefaultCapture,
- &DSDEVID_DefaultPlayback,&DSCBufferDesc,
- &DSBufferDesc,get_hwnd(),DSSCL_EXCLUSIVE,&dsfdo,
- &pDSCBuffer8,&pDSBuffer8,NULL);
+ rc = DirectSoundFullDuplexCreate(&DSDEVID_DefaultCapture,
+ &DSDEVID_DefaultPlayback, &DSCBufferDesc, &DSBufferDesc, get_hwnd(),
+ DSSCL_EXCLUSIVE, &dsfdo, &pDSCBuffer8,&pDSBuffer8, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL||rc==DSERR_INVALIDCALL,
"DirectSoundFullDuplexCreate(DSDEVID_DefaultCapture,"
"DSDEVID_DefaultPlayback) failed: %08x\n", rc);
@@ -201,10 +195,9 @@ static void IDirectSoundFullDuplex_tests(void)
IDirectSoundFullDuplex_test(dsfdo, TRUE, NULL, NULL);
/* try with default voice devices specified */
- rc=pDirectSoundFullDuplexCreate(&DSDEVID_DefaultVoiceCapture,
- &DSDEVID_DefaultVoicePlayback,
- &DSCBufferDesc,&DSBufferDesc,get_hwnd(),DSSCL_EXCLUSIVE,
- &dsfdo,&pDSCBuffer8,&pDSBuffer8,NULL);
+ rc = DirectSoundFullDuplexCreate(&DSDEVID_DefaultVoiceCapture,
+ &DSDEVID_DefaultVoicePlayback, &DSCBufferDesc, &DSBufferDesc,
+ get_hwnd(), DSSCL_EXCLUSIVE, &dsfdo, &pDSCBuffer8, &pDSBuffer8, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL||rc==DSERR_INVALIDCALL,
"DirectSoundFullDuplexCreate(DSDEVID_DefaultVoiceCapture,"
"DSDEVID_DefaultVoicePlayback) failed: %08x\n", rc);
@@ -212,10 +205,9 @@ static void IDirectSoundFullDuplex_tests(void)
IDirectSoundFullDuplex_test(dsfdo, TRUE, NULL, NULL);
/* try with bad devices specified */
- rc=pDirectSoundFullDuplexCreate(&DSDEVID_DefaultVoicePlayback,
- &DSDEVID_DefaultVoiceCapture,
- &DSCBufferDesc,&DSBufferDesc,get_hwnd(),DSSCL_EXCLUSIVE,
- &dsfdo,&pDSCBuffer8,&pDSBuffer8,NULL);
+ rc = DirectSoundFullDuplexCreate(&DSDEVID_DefaultVoicePlayback,
+ &DSDEVID_DefaultVoiceCapture, &DSCBufferDesc, &DSBufferDesc,
+ get_hwnd(), DSSCL_EXCLUSIVE, &dsfdo, &pDSCBuffer8, &pDSBuffer8, NULL);
ok(rc==DSERR_NODRIVER||rc==DSERR_INVALIDCALL,
"DirectSoundFullDuplexCreate(DSDEVID_DefaultVoicePlayback,"
"DSDEVID_DefaultVoiceCapture) should have failed: %08x\n", rc);
@@ -336,26 +328,10 @@ static void test_COM(void)
START_TEST(duplex)
{
- HMODULE hDsound;
-
CoInitialize(NULL);
- hDsound = LoadLibraryA("dsound.dll");
- if (hDsound)
- {
-
- pDirectSoundFullDuplexCreate=(void*)GetProcAddress(hDsound,
- "DirectSoundFullDuplexCreate");
- if (pDirectSoundFullDuplexCreate) {
- test_COM();
- IDirectSoundFullDuplex_tests();
- } else
- skip("DirectSoundFullDuplexCreate missing - skipping all tests\n");
-
- FreeLibrary(hDsound);
- }
- else
- skip("dsound.dll not found - skipping all tests\n");
+ test_COM();
+ IDirectSoundFullDuplex_tests();
CoUninitialize();
}
diff --git a/dlls/dsound/tests/propset.c b/dlls/dsound/tests/propset.c
index 49e6f518ae..94f0d36345 100644
--- a/dlls/dsound/tests/propset.c
+++ b/dlls/dsound/tests/propset.c
@@ -49,19 +49,7 @@ DEFINE_GUID(DSPROPSETID_I3DL2_BufferProperties,
DEFINE_GUID(DSPROPSETID_ZOOMFX_BufferProperties,
0xCD5368E0,0x3450,0x11D3,0x8B,0x6E,0x00,0x10,0x5A,0x9B,0x7B,0xBC);
-static HRESULT (WINAPI *pDirectSoundEnumerateA)(LPDSENUMCALLBACKA,LPVOID)=NULL;
static HRESULT (WINAPI *pDllGetClassObject)(REFCLSID,REFIID,LPVOID*)=NULL;
-static HRESULT (WINAPI *pDirectSoundCreate)(LPCGUID,LPDIRECTSOUND*,
- LPUNKNOWN)=NULL;
-static HRESULT (WINAPI *pDirectSoundCreate8)(LPCGUID,LPDIRECTSOUND8*,
- LPUNKNOWN)=NULL;
-static HRESULT (WINAPI *pDirectSoundCaptureCreate)(LPCGUID,
- LPDIRECTSOUNDCAPTURE*,LPUNKNOWN)=NULL;
-static HRESULT (WINAPI *pDirectSoundCaptureCreate8)(LPCGUID,
- LPDIRECTSOUNDCAPTURE8*,LPUNKNOWN)=NULL;
-static HRESULT (WINAPI *pDirectSoundFullDuplexCreate)(LPCGUID,LPCGUID,
- LPCDSCBUFFERDESC,LPCDSBUFFERDESC,HWND,DWORD,LPDIRECTSOUNDFULLDUPLEX*,
- LPDIRECTSOUNDCAPTUREBUFFER8*,LPDIRECTSOUNDBUFFER8*,LPUNKNOWN)=NULL;
static BOOL CALLBACK callback(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA data,
LPVOID context)
@@ -202,67 +190,57 @@ static void propset_private_tests(void)
"returned E_NOINTERFACE, returned: %08x\n",rc);
/* and the direct sound 8 version */
- if (pDirectSoundCreate8) {
- rc = (pDllGetClassObject)(&CLSID_DirectSound8, &IID_IClassFactory, (void **)(&pcf));
- ok(pcf!=0, "DllGetClassObject(CLSID_DirectSound8, IID_IClassFactory) "
- "failed: %08x\n",rc);
- if (pcf==0)
- return;
-
- /* direct sound 8 doesn't have an IKsPropertySet */
- rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet,
- (void **)(&pps));
- ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
- "returned E_NOINTERFACE, returned: %08x\n",rc);
- }
+ rc = pDllGetClassObject(&CLSID_DirectSound8, &IID_IClassFactory, (void **)&pcf);
+ ok(pcf!=0, "DllGetClassObject(CLSID_DirectSound8, IID_IClassFactory) "
+ "failed: %08x\n",rc);
+ if (pcf==0)
+ return;
+
+ /* direct sound 8 doesn't have an IKsPropertySet */
+ rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet,
+ (void **)(&pps));
+ ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
+ "returned E_NOINTERFACE, returned: %08x\n",rc);
/* try direct sound capture next */
- if (pDirectSoundCaptureCreate) {
- rc = (pDllGetClassObject)(&CLSID_DirectSoundCapture, &IID_IClassFactory,
- (void **)(&pcf));
- ok(pcf!=0, "DllGetClassObject(CLSID_DirectSoundCapture, IID_IClassFactory) "
- "failed: %08x\n",rc);
- if (pcf==0)
- return;
-
- /* direct sound capture doesn't have an IKsPropertySet */
- rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet,
- (void **)(&pps));
- ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
- "returned E_NOINTERFACE,returned: %08x\n",rc);
- }
+ rc = pDllGetClassObject(&CLSID_DirectSoundCapture, &IID_IClassFactory, (void **)&pcf);
+ ok(pcf!=0, "DllGetClassObject(CLSID_DirectSoundCapture, IID_IClassFactory) "
+ "failed: %08x\n",rc);
+ if (pcf==0)
+ return;
+
+ /* direct sound capture doesn't have an IKsPropertySet */
+ rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet,
+ (void **)(&pps));
+ ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
+ "returned E_NOINTERFACE,returned: %08x\n",rc);
/* and the direct sound capture 8 version */
- if (pDirectSoundCaptureCreate8) {
- rc = (pDllGetClassObject)(&CLSID_DirectSoundCapture8, &IID_IClassFactory,
- (void **)(&pcf));
- ok(pcf!=0, "DllGetClassObject(CLSID_DirectSoundCapture8, "
- "IID_IClassFactory) failed: %08x\n",rc);
- if (pcf==0)
- return;
-
- /* direct sound capture 8 doesn't have an IKsPropertySet */
- rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet,
- (void **)(&pps));
- ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
- "returned E_NOINTERFACE, returned: %08x\n",rc);
- }
+ rc = pDllGetClassObject(&CLSID_DirectSoundCapture8, &IID_IClassFactory, (void **)&pcf);
+ ok(pcf!=0, "DllGetClassObject(CLSID_DirectSoundCapture8, "
+ "IID_IClassFactory) failed: %08x\n",rc);
+ if (pcf==0)
+ return;
+
+ /* direct sound capture 8 doesn't have an IKsPropertySet */
+ rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet,
+ (void **)(&pps));
+ ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
+ "returned E_NOINTERFACE, returned: %08x\n",rc);
/* try direct sound full duplex next */
- if (pDirectSoundFullDuplexCreate) {
- rc = (pDllGetClassObject)(&CLSID_DirectSoundFullDuplex, &IID_IClassFactory,
- (void **)(&pcf));
- ok(pcf!=0, "DllGetClassObject(CLSID_DirectSoundFullDuplex, "
- "IID_IClassFactory) failed: %08x\n",rc);
- if (pcf==0)
- return;
-
- /* direct sound full duplex doesn't have an IKsPropertySet */
- rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet,
- (void **)(&pps));
- ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
- "returned NOINTERFACE, returned: %08x\n",rc);
- }
+ rc = (pDllGetClassObject)(&CLSID_DirectSoundFullDuplex, &IID_IClassFactory,
+ (void **)(&pcf));
+ ok(pcf!=0, "DllGetClassObject(CLSID_DirectSoundFullDuplex, "
+ "IID_IClassFactory) failed: %08x\n",rc);
+ if (pcf==0)
+ return;
+
+ /* direct sound full duplex doesn't have an IKsPropertySet */
+ rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet,
+ (void **)(&pps));
+ ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
+ "returned NOINTERFACE, returned: %08x\n",rc);
/* try direct sound private last */
rc = (pDllGetClassObject)(&CLSID_DirectSoundPrivate, &IID_IClassFactory,
@@ -549,7 +527,7 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
trace("*** Testing %s - %s ***\n",lpcstrDescription,lpcstrModule);
driver_count++;
- rc=pDirectSoundCreate(lpGuid,&dso,NULL);
+ rc = DirectSoundCreate(lpGuid, &dso, NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
"DirectSoundCreate() failed: %08x\n",rc);
if (rc!=DS_OK) {
@@ -692,43 +670,19 @@ EXIT:
static void propset_buffer_tests(void)
{
HRESULT rc;
- rc=pDirectSoundEnumerateA(&dsenum_callback,NULL);
+ rc = DirectSoundEnumerateA(dsenum_callback, NULL);
ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %08x\n",rc);
trace("tested %u DirectSound drivers\n", driver_count);
}
START_TEST(propset)
{
- HMODULE hDsound;
-
CoInitialize(NULL);
- hDsound = LoadLibraryA("dsound.dll");
- if (hDsound)
- {
-
- pDirectSoundEnumerateA = (void*)GetProcAddress(hDsound,
- "DirectSoundEnumerateA");
- pDllGetClassObject = (void *)GetProcAddress(hDsound,
- "DllGetClassObject");
- pDirectSoundCreate = (void*)GetProcAddress(hDsound,
- "DirectSoundCreate");
- pDirectSoundCreate8 = (void*)GetProcAddress(hDsound,
- "DirectSoundCreate8");
- pDirectSoundCaptureCreate=(void*)GetProcAddress(hDsound,
- "DirectSoundCaptureCreate");
- pDirectSoundCaptureCreate8=(void*)GetProcAddress(hDsound,
- "DirectSoundCaptureCreate8");
- pDirectSoundFullDuplexCreate=(void*)GetProcAddress(hDsound,
- "DirectSoundFullDuplexCreate");
-
- propset_private_tests();
- propset_buffer_tests();
-
- FreeLibrary(hDsound);
- }
- else
- skip("dsound.dll not found - skipping all tests\n");
+ pDllGetClassObject = (void *)GetProcAddress(GetModuleHandleA("dsound"), "DllGetClassObject");
+
+ propset_private_tests();
+ propset_buffer_tests();
CoUninitialize();
}
--
2.27.0
2
9
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/winex11.drv/x11drv.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 1c6b666227f..e4015891369 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -672,7 +672,7 @@ struct x11drv_settings_handler
/* get_id() will be called to map a device name, e.g., \\.\DISPLAY1 to a driver specific id.
* Following functions use this id to identify the device.
*
- * Return FALSE if the device can not be found and TRUE on success */
+ * Return FALSE if the device cannot be found and TRUE on success */
BOOL (*get_id)(const WCHAR *device_name, ULONG_PTR *id);
/* get_modes() will be called to get a list of supported modes of the device of id in modes
--
2.20.1
1
0
July 24, 2020
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
configure.ac | 4 -
dlls/winex11.drv/xrandr.c | 255 ++------------------------------------
2 files changed, 7 insertions(+), 252 deletions(-)
diff --git a/configure.ac b/configure.ac
index 928f8ebd1b1..e82ed889545 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1255,10 +1255,6 @@ then
#include <X11/extensions/Xrandr.h>]], [[static typeof(XRRSetScreenConfigAndRate) * func; if (func) return 0;]])],
[WINE_CHECK_SONAME(Xrandr,XRRQueryExtension,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h>
-#include <X11/extensions/Xrandr.h>]], [[static typeof(XRRGetScreenResources) *f; if (f) return 0;]])],
- [AC_DEFINE(HAVE_XRRGETSCREENRESOURCES, 1,
- [Define if Xrandr has the XRRGetScreenResources function])])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h>
#include <X11/extensions/Xrandr.h>]], [[static typeof(XRRGetProviderResources) *f; if (f) return 0;]])],
[AC_DEFINE(HAVE_XRRGETPROVIDERRESOURCES, 1,
[Define if Xrandr has the XRRGetProviderResources function])],
diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c
index 5ad70ea95ac..d111b960fa6 100644
--- a/dlls/winex11.drv/xrandr.c
+++ b/dlls/winex11.drv/xrandr.c
@@ -29,7 +29,7 @@
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(xrandr);
-#ifdef HAVE_XRRGETSCREENRESOURCES
+#ifdef HAVE_XRRGETPROVIDERRESOURCES
WINE_DECLARE_DEBUG_CHANNEL(winediag);
#endif
@@ -62,22 +62,17 @@ MAKE_FUNCPTR(XRRSetScreenConfig)
MAKE_FUNCPTR(XRRSetScreenConfigAndRate)
MAKE_FUNCPTR(XRRSizes)
-#ifdef HAVE_XRRGETSCREENRESOURCES
+#ifdef HAVE_XRRGETPROVIDERRESOURCES
MAKE_FUNCPTR(XRRFreeCrtcInfo)
MAKE_FUNCPTR(XRRFreeOutputInfo)
MAKE_FUNCPTR(XRRFreeScreenResources)
MAKE_FUNCPTR(XRRGetCrtcInfo)
MAKE_FUNCPTR(XRRGetOutputInfo)
MAKE_FUNCPTR(XRRGetScreenResources)
+MAKE_FUNCPTR(XRRGetScreenResourcesCurrent)
MAKE_FUNCPTR(XRRGetScreenSizeRange)
MAKE_FUNCPTR(XRRSetCrtcConfig)
MAKE_FUNCPTR(XRRSetScreenSize)
-static typeof(XRRGetScreenResources) *pXRRGetScreenResourcesCurrent;
-static RRMode *xrandr12_modes;
-static int primary_crtc;
-#endif
-
-#ifdef HAVE_XRRGETPROVIDERRESOURCES
MAKE_FUNCPTR(XRRSelectInput)
MAKE_FUNCPTR(XRRGetOutputPrimary)
MAKE_FUNCPTR(XRRGetProviderResources)
@@ -116,20 +111,17 @@ static int load_xrandr(void)
LOAD_FUNCPTR(XRRSizes);
r = 1;
-#ifdef HAVE_XRRGETSCREENRESOURCES
+#ifdef HAVE_XRRGETPROVIDERRESOURCES
LOAD_FUNCPTR(XRRFreeCrtcInfo);
LOAD_FUNCPTR(XRRFreeOutputInfo);
LOAD_FUNCPTR(XRRFreeScreenResources);
LOAD_FUNCPTR(XRRGetCrtcInfo);
LOAD_FUNCPTR(XRRGetOutputInfo);
LOAD_FUNCPTR(XRRGetScreenResources);
+ LOAD_FUNCPTR(XRRGetScreenResourcesCurrent);
LOAD_FUNCPTR(XRRGetScreenSizeRange);
LOAD_FUNCPTR(XRRSetCrtcConfig);
LOAD_FUNCPTR(XRRSetScreenSize);
- r = 2;
-#endif
-
-#ifdef HAVE_XRRGETPROVIDERRESOURCES
LOAD_FUNCPTR(XRRSelectInput);
LOAD_FUNCPTR(XRRGetOutputPrimary);
LOAD_FUNCPTR(XRRGetProviderResources);
@@ -305,7 +297,7 @@ static void xrandr10_init_modes(void)
TRACE("Enabling XRandR\n");
}
-#ifdef HAVE_XRRGETSCREENRESOURCES
+#ifdef HAVE_XRRGETPROVIDERRESOURCES
static XRRScreenResources *xrandr_get_screen_resources(void)
{
@@ -398,54 +390,6 @@ static BOOL is_broken_driver(void)
return FALSE;
}
-static int xrandr12_get_current_mode(void)
-{
- XRRScreenResources *resources;
- XRRCrtcInfo *crtc_info;
- int i, ret = -1;
-
- if (xrandr_current_mode != -1)
- return xrandr_current_mode;
-
- if (!(resources = pXRRGetScreenResourcesCurrent( gdi_display, root_window )))
- {
- ERR("Failed to get screen resources.\n");
- return 0;
- }
-
- if (resources->ncrtc <= primary_crtc ||
- !(crtc_info = pXRRGetCrtcInfo( gdi_display, resources, resources->crtcs[primary_crtc] )))
- {
- pXRRFreeScreenResources( resources );
- ERR("Failed to get CRTC info.\n");
- return 0;
- }
-
- TRACE("CRTC %d: mode %#lx, %ux%u+%d+%d.\n", primary_crtc, crtc_info->mode,
- crtc_info->width, crtc_info->height, crtc_info->x, crtc_info->y);
-
- for (i = 0; i < xrandr_mode_count; ++i)
- {
- if (xrandr12_modes[i] == crtc_info->mode)
- {
- ret = i;
- break;
- }
- }
-
- pXRRFreeCrtcInfo( crtc_info );
- pXRRFreeScreenResources( resources );
-
- if (ret == -1)
- {
- ERR("Unknown mode, returning default.\n");
- return 0;
- }
-
- xrandr_current_mode = ret;
- return ret;
-}
-
static void get_screen_size( XRRScreenResources *resources, unsigned int *width, unsigned int *height )
{
int min_width = 0, min_height = 0, max_width, max_height;
@@ -481,99 +425,6 @@ static void set_screen_size( int width, int height )
pXRRSetScreenSize( gdi_display, root_window, width, height, mm_width, mm_height );
}
-static LONG xrandr12_set_current_mode( int mode )
-{
- unsigned int screen_width, screen_height;
- Status status = RRSetConfigFailed;
- XRRScreenResources *resources;
- XRRCrtcInfo *crtc_info;
-
- mode = mode % xrandr_mode_count;
-
- if (!(resources = pXRRGetScreenResourcesCurrent( gdi_display, root_window )))
- {
- ERR("Failed to get screen resources.\n");
- return DISP_CHANGE_FAILED;
- }
-
- if (resources->ncrtc <= primary_crtc ||
- !(crtc_info = pXRRGetCrtcInfo( gdi_display, resources, resources->crtcs[primary_crtc] )))
- {
- pXRRFreeScreenResources( resources );
- ERR("Failed to get CRTC info.\n");
- return DISP_CHANGE_FAILED;
- }
-
- TRACE("CRTC %d: mode %#lx, %ux%u+%d+%d.\n", primary_crtc, crtc_info->mode,
- crtc_info->width, crtc_info->height, crtc_info->x, crtc_info->y);
-
- /* According to the RandR spec, the entire CRTC must fit inside the screen.
- * Since we use the union of all enabled CRTCs to determine the necessary
- * screen size, this might involve shrinking the screen, so we must disable
- * the CRTC in question first. */
-
- XGrabServer( gdi_display );
-
- status = pXRRSetCrtcConfig( gdi_display, resources, resources->crtcs[primary_crtc],
- CurrentTime, crtc_info->x, crtc_info->y, None,
- crtc_info->rotation, NULL, 0 );
- if (status != RRSetConfigSuccess)
- {
- XUngrabServer( gdi_display );
- XFlush( gdi_display );
- ERR("Failed to disable CRTC.\n");
- pXRRFreeCrtcInfo( crtc_info );
- pXRRFreeScreenResources( resources );
- return DISP_CHANGE_FAILED;
- }
-
- get_screen_size( resources, &screen_width, &screen_height );
- screen_width = max( screen_width, crtc_info->x + dd_modes[mode].width );
- screen_height = max( screen_height, crtc_info->y + dd_modes[mode].height );
- set_screen_size( screen_width, screen_height );
-
- status = pXRRSetCrtcConfig( gdi_display, resources, resources->crtcs[primary_crtc],
- CurrentTime, crtc_info->x, crtc_info->y, xrandr12_modes[mode],
- crtc_info->rotation, crtc_info->outputs, crtc_info->noutput );
-
- XUngrabServer( gdi_display );
- XFlush( gdi_display );
-
- pXRRFreeCrtcInfo( crtc_info );
- pXRRFreeScreenResources( resources );
-
- if (status != RRSetConfigSuccess)
- {
- ERR("Resolution change not successful -- perhaps display has changed?\n");
- return DISP_CHANGE_FAILED;
- }
-
- xrandr_current_mode = mode;
- X11DRV_DisplayDevices_Update( TRUE );
- return DISP_CHANGE_SUCCESSFUL;
-}
-
-static XRRCrtcInfo *xrandr12_get_primary_crtc_info( XRRScreenResources *resources, int *crtc_idx )
-{
- XRRCrtcInfo *crtc_info;
- int i;
-
- for (i = 0; i < resources->ncrtc; ++i)
- {
- crtc_info = pXRRGetCrtcInfo( gdi_display, resources, resources->crtcs[i] );
- if (!crtc_info || crtc_info->mode == None)
- {
- pXRRFreeCrtcInfo( crtc_info );
- continue;
- }
-
- *crtc_idx = i;
- return crtc_info;
- }
-
- return NULL;
-}
-
static unsigned int get_frequency( const XRRModeInfo *mode )
{
unsigned int dots = mode->hTotal * mode->vTotal;
@@ -589,87 +440,6 @@ static unsigned int get_frequency( const XRRModeInfo *mode )
return (mode->dotClock + dots / 2) / dots;
}
-static int xrandr12_init_modes(void)
-{
- XRRScreenResources *resources;
- XRROutputInfo *output_info;
- XRRCrtcInfo *crtc_info;
- int ret = -1;
- int i, j;
-
- if (!(resources = xrandr_get_screen_resources()))
- return ret;
-
- if (!(crtc_info = xrandr12_get_primary_crtc_info( resources, &primary_crtc )))
- {
- pXRRFreeScreenResources( resources );
- ERR("Failed to get primary CRTC info.\n");
- return ret;
- }
-
- TRACE("CRTC %d: mode %#lx, %ux%u+%d+%d.\n", primary_crtc, crtc_info->mode,
- crtc_info->width, crtc_info->height, crtc_info->x, crtc_info->y);
-
- if (!crtc_info->noutput || !(output_info = pXRRGetOutputInfo( gdi_display, resources, crtc_info->outputs[0] )))
- {
- pXRRFreeCrtcInfo( crtc_info );
- pXRRFreeScreenResources( resources );
- ERR("Failed to get output info.\n");
- return ret;
- }
-
- TRACE("OUTPUT 0: name %s.\n", debugstr_a(output_info->name));
-
- if (!output_info->nmode)
- {
- WARN("Output has no modes.\n");
- goto done;
- }
-
- if (!(xrandr12_modes = HeapAlloc( GetProcessHeap(), 0, sizeof(*xrandr12_modes) * output_info->nmode )))
- {
- ERR("Failed to allocate xrandr mode info array.\n");
- goto done;
- }
-
- dd_modes = X11DRV_Settings_SetHandlers( "XRandR 1.2",
- xrandr12_get_current_mode,
- xrandr12_set_current_mode,
- output_info->nmode, 1 );
-
- xrandr_mode_count = 0;
- for (i = 0; i < output_info->nmode; ++i)
- {
- for (j = 0; j < resources->nmode; ++j)
- {
- XRRModeInfo *mode = &resources->modes[j];
-
- if (mode->id == output_info->modes[i])
- {
- unsigned int refresh = get_frequency( mode );
-
- TRACE("Adding mode %#lx: %ux%u(a)%u.\n", mode->id, mode->width, mode->height, refresh);
- X11DRV_Settings_AddOneMode( mode->width, mode->height, 0, refresh );
- xrandr12_modes[xrandr_mode_count++] = mode->id;
- break;
- }
- }
- }
-
- X11DRV_Settings_AddDepthModes();
- ret = 0;
-
-done:
- pXRRFreeOutputInfo( output_info );
- pXRRFreeCrtcInfo( crtc_info );
- pXRRFreeScreenResources( resources );
- return ret;
-}
-
-#endif /* HAVE_XRRGETSCREENRESOURCES */
-
-#ifdef HAVE_XRRGETPROVIDERRESOURCES
-
static RECT get_primary_rect( XRRScreenResources *resources )
{
XRROutputInfo *output_info = NULL;
@@ -1640,18 +1410,7 @@ void X11DRV_XRandR_Init(void)
TRACE("Found XRandR %d.%d.\n", major, minor);
-#ifdef HAVE_XRRGETSCREENRESOURCES
- if (ret >= 2 && (major > 1 || (major == 1 && minor >= 2)))
- {
- if (major > 1 || (major == 1 && minor >= 3))
- pXRRGetScreenResourcesCurrent = dlsym( xrandr_handle, "XRRGetScreenResourcesCurrent" );
- if (!pXRRGetScreenResourcesCurrent)
- pXRRGetScreenResourcesCurrent = pXRRGetScreenResources;
- }
-
- if (!pXRRGetScreenResourcesCurrent || is_broken_driver() || xrandr12_init_modes() < 0)
-#endif
- xrandr10_init_modes();
+ xrandr10_init_modes();
#ifdef HAVE_XRRGETPROVIDERRESOURCES
if (ret >= 4 && (major > 1 || (major == 1 && minor >= 4)))
--
2.25.1
2
1
[PATCH 2/2 resend] gdi32: Enumerate one charset per font for EnumFontFamilies.
by Myah Caron July 24, 2020
by Myah Caron July 24, 2020
July 24, 2020
Empty Message
2
1
July 24, 2020
On the Linux boxes I tested, reading scaling_cur_freq usually takes
about 12 ms per core.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47128
Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com>
---
FWIW it looks like the kernel does some kind of optimization and
returns "immediately" if the file is accessed often enough (possibly
faster than once per second?)
Heroes of the Storm calls NtPowerInformation() on the main rendering
thread about once per second and, with enough cores, it means stalling
the whole game for pretty sizeable amounts of time.
dlls/ntdll/unix/system.c | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c
index 681d56a869f4..3756bd7cee03 100644
--- a/dlls/ntdll/unix/system.c
+++ b/dlls/ntdll/unix/system.c
@@ -2907,11 +2907,12 @@ NTSTATUS WINAPI NtPowerInformation( POWER_INFORMATION_LEVEL level, void *input,
FILE* f;
for(i = 0; i < out_cpus; i++) {
- sprintf(filename, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_cur_freq", i);
+ sprintf(filename, "/sys/devices/system/cpu/cpu%d/cpufreq/cpuinfo_max_freq", i);
f = fopen(filename, "r");
- if (f && (fscanf(f, "%d", &cpu_power[i].CurrentMhz) == 1)) {
- cpu_power[i].CurrentMhz /= 1000;
+ if (f && (fscanf(f, "%d", &cpu_power[i].MaxMhz) == 1)) {
+ cpu_power[i].MaxMhz /= 1000;
fclose(f);
+ cpu_power[i].CurrentMhz = cpu_power[i].MaxMhz;
}
else {
if(i == 0) {
@@ -2921,16 +2922,6 @@ NTSTATUS WINAPI NtPowerInformation( POWER_INFORMATION_LEVEL level, void *input,
}
else
cpu_power[i].CurrentMhz = cpu_power[0].CurrentMhz;
- if(f) fclose(f);
- }
-
- sprintf(filename, "/sys/devices/system/cpu/cpu%d/cpufreq/cpuinfo_max_freq", i);
- f = fopen(filename, "r");
- if (f && (fscanf(f, "%d", &cpu_power[i].MaxMhz) == 1)) {
- cpu_power[i].MaxMhz /= 1000;
- fclose(f);
- }
- else {
cpu_power[i].MaxMhz = cpu_power[i].CurrentMhz;
if(f) fclose(f);
}
--
2.26.2
3
7
[PATCH 1/6] user32: Check invalid device names in EnumDisplaySettingsExW().
by Zhiyi Zhang July 24, 2020
by Zhiyi Zhang July 24, 2020
July 24, 2020
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/user32/sysparams.c | 33 +++++++++++++++++++++++----------
dlls/user32/tests/sysparams.c | 8 ++++----
2 files changed, 27 insertions(+), 14 deletions(-)
diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c
index d4462e589e8..79f938a3c20 100644
--- a/dlls/user32/sysparams.c
+++ b/dlls/user32/sysparams.c
@@ -590,6 +590,21 @@ static BOOL get_primary_adapter(WCHAR *name)
return FALSE;
}
+static BOOL is_valid_adapter_name(const WCHAR *name)
+{
+ long int adapter_idx;
+ WCHAR *end;
+
+ if (strncmpiW(name, ADAPTER_PREFIX, ARRAY_SIZE(ADAPTER_PREFIX)))
+ return FALSE;
+
+ adapter_idx = strtolW(name + ARRAY_SIZE(ADAPTER_PREFIX), &end, 10);
+ if (*end || adapter_idx < 1)
+ return FALSE;
+
+ return TRUE;
+}
+
/* get text metrics and/or "average" char width of the specified logfont
* for the specified dc */
static void get_text_metr_size( HDC hdc, LOGFONTW *plf, TEXTMETRICW * ptm, UINT *psz)
@@ -3307,8 +3322,7 @@ static BOOL is_detached_mode(const DEVMODEW *mode)
LONG WINAPI ChangeDisplaySettingsExW( LPCWSTR devname, LPDEVMODEW devmode, HWND hwnd,
DWORD flags, LPVOID lparam )
{
- WCHAR primary_adapter[CCHDEVICENAME], *end;
- long int display_idx;
+ WCHAR primary_adapter[CCHDEVICENAME];
BOOL def_mode = TRUE;
DEVMODEW dm;
LONG ret;
@@ -3332,14 +3346,7 @@ LONG WINAPI ChangeDisplaySettingsExW( LPCWSTR devname, LPDEVMODEW devmode, HWND
devname = primary_adapter;
}
- if (strncmpiW(devname, ADAPTER_PREFIX, ARRAY_SIZE(ADAPTER_PREFIX)))
- {
- ERR("Invalid device name %s.\n", wine_dbgstr_w(devname));
- return DISP_CHANGE_BADPARAM;
- }
-
- display_idx = strtolW(devname + ARRAY_SIZE(ADAPTER_PREFIX), &end, 10);
- if (*end || display_idx < 1)
+ if (!is_valid_adapter_name(devname))
{
ERR("Invalid device name %s.\n", wine_dbgstr_w(devname));
return DISP_CHANGE_BADPARAM;
@@ -3466,6 +3473,12 @@ BOOL WINAPI EnumDisplaySettingsExW(LPCWSTR lpszDeviceName, DWORD iModeNum,
lpszDeviceName = primary_adapter;
}
+ if (!is_valid_adapter_name(lpszDeviceName))
+ {
+ ERR("Invalid device name %s.\n", wine_dbgstr_w(lpszDeviceName));
+ return FALSE;
+ }
+
ret = USER_Driver->pEnumDisplaySettingsEx(lpszDeviceName, iModeNum, lpDevMode, dwFlags);
if (ret)
TRACE("device:%s mode index:%#x position:(%d,%d) resolution:%ux%u frequency:%uHz "
diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c
index 6750325a291..f71b73930f2 100644
--- a/dlls/user32/tests/sysparams.c
+++ b/dlls/user32/tests/sysparams.c
@@ -3154,18 +3154,18 @@ static void test_EnumDisplaySettings(void)
dm.dmSize = sizeof(dm);
SetLastError(0xdeadbeef);
ret = EnumDisplaySettingsA("invalid", ENUM_CURRENT_SETTINGS, &dm);
- todo_wine ok(!ret, "EnumDisplaySettingsA succeeded\n");
+ ok(!ret, "EnumDisplaySettingsA succeeded\n");
ok(GetLastError() == 0xdeadbeef, "Expect error 0xdeadbeef, got %#x\n", GetLastError());
- todo_wine ok(dm.dmFields == 0, "Expect dmFields unchanged, got %#x\n", dm.dmFields);
+ ok(dm.dmFields == 0, "Expect dmFields unchanged, got %#x\n", dm.dmFields);
/* Monitor device names are invalid */
memset(&dm, 0, sizeof(dm));
dm.dmSize = sizeof(dm);
SetLastError(0xdeadbeef);
ret = EnumDisplaySettingsA("\\\\.\\DISPLAY1\\Monitor0", ENUM_CURRENT_SETTINGS, &dm);
- todo_wine ok(!ret, "EnumDisplaySettingsA succeeded\n");
+ ok(!ret, "EnumDisplaySettingsA succeeded\n");
ok(GetLastError() == 0xdeadbeef, "Expect error 0xdeadbeef, got %#x\n", GetLastError());
- todo_wine ok(dm.dmFields == 0, "Expect dmFields unchanged, got %#x\n", dm.dmFields);
+ ok(dm.dmFields == 0, "Expect dmFields unchanged, got %#x\n", dm.dmFields);
/* Test that passing NULL to device name parameter means to use the primary adapter */
memset(&dm, 0, sizeof(dm));
--
2.25.1
2
2
July 24, 2020
Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=47726
Signed-off-by: Myah Caron <qsniyg(a)protonmail.com>
---
dlls/gdi32/font.c | 32 ++++++++++++++++++++++++--------
dlls/gdi32/tests/font.c | 2 +-
2 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c
index e099bec5e8..395141e575 100644
--- a/dlls/gdi32/font.c
+++ b/dlls/gdi32/font.c
@@ -117,6 +117,8 @@ struct font_enum
FONTENUMPROCW lpEnumFunc;
LPARAM lpData;
BOOL unicode;
+ BOOL singleCharset;
+ WCHAR lastFaceName[LF_FACESIZE];
HDC hdc;
INT retval;
};
@@ -927,6 +929,14 @@ static INT CALLBACK FONT_EnumInstance( const LOGFONTW *plf, const TEXTMETRICW *p
ENUMLOGFONTEXA logfont;
NEWTEXTMETRICEXA tmA;
+ if (pfe->singleCharset) {
+ if (!strncmpW(plf->lfFaceName, pfe->lastFaceName, LF_FACESIZE)) {
+ return ret;
+ }
+
+ lstrcpynW(pfe->lastFaceName, plf->lfFaceName, LF_FACESIZE);
+ }
+
if (!pfe->unicode)
{
FONT_EnumLogFontExWToA( (const ENUMLOGFONTEXW *)plf, &logfont);
@@ -944,7 +954,7 @@ static INT CALLBACK FONT_EnumInstance( const LOGFONTW *plf, const TEXTMETRICW *p
* FONT_EnumFontFamiliesEx
*/
static INT FONT_EnumFontFamiliesEx( HDC hDC, LPLOGFONTW plf, FONTENUMPROCW efproc,
- LPARAM lParam, BOOL unicode )
+ LPARAM lParam, BOOL unicode, BOOL singleCharset )
{
INT ret = 0;
DC *dc = get_dc_ptr( hDC );
@@ -959,6 +969,8 @@ static INT FONT_EnumFontFamiliesEx( HDC hDC, LPLOGFONTW plf, FONTENUMPROCW efpro
fe.lpEnumFunc = efproc;
fe.lpData = lParam;
fe.unicode = unicode;
+ fe.lastFaceName[0] = 0;
+ fe.singleCharset = singleCharset;
fe.hdc = hDC;
fe.retval = 1;
ret = physdev->funcs->pEnumFonts( physdev, plf, FONT_EnumInstance, (LPARAM)&fe );
@@ -974,7 +986,7 @@ INT WINAPI EnumFontFamiliesExW( HDC hDC, LPLOGFONTW plf,
FONTENUMPROCW efproc,
LPARAM lParam, DWORD dwFlags )
{
- return FONT_EnumFontFamiliesEx( hDC, plf, efproc, lParam, TRUE );
+ return FONT_EnumFontFamiliesEx( hDC, plf, efproc, lParam, TRUE, FALSE );
}
/***********************************************************************
@@ -993,7 +1005,7 @@ INT WINAPI EnumFontFamiliesExA( HDC hDC, LPLOGFONTA plf,
}
else plfW = NULL;
- return FONT_EnumFontFamiliesEx( hDC, plfW, (FONTENUMPROCW)efproc, lParam, FALSE );
+ return FONT_EnumFontFamiliesEx( hDC, plfW, (FONTENUMPROCW)efproc, lParam, FALSE, FALSE );
}
/***********************************************************************
@@ -1003,6 +1015,7 @@ INT WINAPI EnumFontFamiliesA( HDC hDC, LPCSTR lpFamily,
FONTENUMPROCA efproc, LPARAM lpData )
{
LOGFONTA lf, *plf;
+ LOGFONTW lfW, *plfW;
if (lpFamily)
{
@@ -1011,10 +1024,13 @@ INT WINAPI EnumFontFamiliesA( HDC hDC, LPCSTR lpFamily,
lf.lfCharSet = DEFAULT_CHARSET;
lf.lfPitchAndFamily = 0;
plf = &lf;
+
+ FONT_LogFontAToW( plf, &lfW );
+ plfW = &lfW;
}
- else plf = NULL;
+ else plfW = NULL;
- return EnumFontFamiliesExA( hDC, plf, efproc, lpData, 0 );
+ return FONT_EnumFontFamiliesEx( hDC, plfW, (FONTENUMPROCW)efproc, lpData, FALSE, TRUE );
}
/***********************************************************************
@@ -1035,7 +1051,7 @@ INT WINAPI EnumFontFamiliesW( HDC hDC, LPCWSTR lpFamily,
}
else plf = NULL;
- return EnumFontFamiliesExW( hDC, plf, efproc, lpData, 0 );
+ return FONT_EnumFontFamiliesEx( hDC, plf, efproc, lpData, TRUE, TRUE );
}
/***********************************************************************
@@ -2207,8 +2223,8 @@ static inline int get_line_width( DC *dc, int metric_size )
* ExtTextOutW (GDI32.@)
*
* Draws text using the currently selected font, background color, and text color.
- *
- *
+ *
+ *
* PARAMS
* x,y [I] coordinates of string
* flags [I]
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index 9949abdfe4..5f6bf4d6e6 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -2907,7 +2907,7 @@ static void test_EnumFontFamilies(const char *font_name, INT font_charset)
/* EnumFontFamilies should only enumerate a single charset (the first one found) for a font face */
for (i = 1; i < efdw.total; i++) {
ret = lstrcmpW(efdw.lf[i - 1].lfFaceName, efdw.lf[i].lfFaceName);
- todo_wine ok(ret != 0, "old font family (%s) == new font family(%s)\n",
+ ok(ret != 0, "old font family (%s) == new font family(%s)\n",
wine_dbgstr_w(efdw.lf[i - 1].lfFaceName), wine_dbgstr_w(efdw.lf[i].lfFaceName));
}
}
--
2.27.0
2
1
July 24, 2020
Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=47726
Signed-off-by: Myah Caron <qsniyg(a)protonmail.com>
---
dlls/gdi32/tests/font.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index ad894dfdca..9949abdfe4 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -257,7 +257,7 @@ static void test_logfont(void)
memset(&lf, 'A', sizeof(lf));
hfont = CreateFontIndirectA(&lf);
ok(hfont != 0, "CreateFontIndirectA with strange LOGFONT failed\n");
-
+
lf.lfFaceName[LF_FACESIZE - 1] = 0;
check_font("AAA...", &lf, hfont);
DeleteObject(hfont);
@@ -2903,6 +2903,13 @@ static void test_EnumFontFamilies(const char *font_name, INT font_charset)
ok(russian_charset > 0 ||
broken(russian_charset == 0), /* NT4 */
"NULL family should enumerate RUSSIAN_CHARSET\n");
+
+ /* EnumFontFamilies should only enumerate a single charset (the first one found) for a font face */
+ for (i = 1; i < efdw.total; i++) {
+ ret = lstrcmpW(efdw.lf[i - 1].lfFaceName, efdw.lf[i].lfFaceName);
+ todo_wine ok(ret != 0, "old font family (%s) == new font family(%s)\n",
+ wine_dbgstr_w(efdw.lf[i - 1].lfFaceName), wine_dbgstr_w(efdw.lf[i].lfFaceName));
+ }
}
efdw.total = 0;
--
2.27.0
2
1
[PATCH v2 resend] winapi: Update 'perl -w' to 'use warnings 'all''.
by Serge Gautherie July 24, 2020
by Serge Gautherie July 24, 2020
July 24, 2020
Signed-off-by: Serge Gautherie <winehq-git_serge_180711(a)gautherie.fr>
---
tools/winapi/c_function.pm | 1 +
tools/winapi/c_parser.pm | 1 +
tools/winapi/c_type.pm | 1 +
tools/winapi/config.pm | 1 +
tools/winapi/function.pm | 1 +
tools/winapi/make_filter | 3 ++-
tools/winapi/make_filter_options.pm | 4 +++-
tools/winapi/make_parser.pm | 1 +
tools/winapi/modules.pm | 1 +
tools/winapi/msvcmaker | 3 ++-
tools/winapi/msvcmaker_options.pm | 4 +++-
tools/winapi/nativeapi.pm | 1 +
tools/winapi/options.pm | 2 ++
tools/winapi/output.pm | 2 ++
tools/winapi/preprocessor.pm | 1 +
tools/winapi/setup.pm | 1 +
tools/winapi/tests.pm | 1 +
tools/winapi/type.pm | 1 +
tools/winapi/util.pm | 1 +
tools/winapi/winapi.pm | 1 +
tools/winapi/winapi_check | 3 ++-
tools/winapi/winapi_check_options.pm | 8 ++++++--
tools/winapi/winapi_documentation.pm | 1 +
tools/winapi/winapi_extract | 3 ++-
tools/winapi/winapi_extract_options.pm | 4 +++-
tools/winapi/winapi_function.pm | 4 +++-
tools/winapi/winapi_global.pm | 1 +
tools/winapi/winapi_local.pm | 1 +
tools/winapi/winapi_module_user.pm | 1 +
tools/winapi/winapi_parser.pm | 1 +
tools/winapi/winapi_test | 3 ++-
tools/winapi/winapi_test_options.pm | 4 +++-
32 files changed, 54 insertions(+), 12 deletions(-)
diff --git a/tools/winapi/c_function.pm b/tools/winapi/c_function.pm
index 773c6b2..4bef581 100644
--- a/tools/winapi/c_function.pm
+++ b/tools/winapi/c_function.pm
@@ -19,6 +19,7 @@
package c_function;
use strict;
+use warnings 'all';
sub new($)
{
diff --git a/tools/winapi/c_parser.pm b/tools/winapi/c_parser.pm
index d42e04a..77e524f 100644
--- a/tools/winapi/c_parser.pm
+++ b/tools/winapi/c_parser.pm
@@ -19,6 +19,7 @@
package c_parser;
use strict;
+use warnings 'all';
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
require Exporter;
diff --git a/tools/winapi/c_type.pm b/tools/winapi/c_type.pm
index c6aeb6a..ba1aec2 100644
--- a/tools/winapi/c_type.pm
+++ b/tools/winapi/c_type.pm
@@ -19,6 +19,7 @@
package c_type;
use strict;
+use warnings 'all';
use output qw($output);
diff --git a/tools/winapi/config.pm b/tools/winapi/config.pm
index fd45dc7..ceba90a 100644
--- a/tools/winapi/config.pm
+++ b/tools/winapi/config.pm
@@ -19,6 +19,7 @@
package config;
use strict;
+use warnings 'all';
use setup qw($current_dir $wine_dir $winapi_dir);
diff --git a/tools/winapi/function.pm b/tools/winapi/function.pm
index c53daa6..2bc2c4c 100644
--- a/tools/winapi/function.pm
+++ b/tools/winapi/function.pm
@@ -19,6 +19,7 @@
package function;
use strict;
+use warnings 'all';
sub new($) {
my $proto = shift;
diff --git a/tools/winapi/make_filter b/tools/winapi/make_filter
index 45665de..f080706 100755
--- a/tools/winapi/make_filter
+++ b/tools/winapi/make_filter
@@ -1,4 +1,4 @@
-#! /usr/bin/perl -w
+#!/usr/bin/perl
#
# Copyright 1999, 2000, 2001 Patrik Stridvall
#
@@ -18,6 +18,7 @@
#
use strict;
+use warnings 'all';
BEGIN {
$0 =~ m%^(.*?/?tools)/winapi/make_filter$%;
diff --git a/tools/winapi/make_filter_options.pm b/tools/winapi/make_filter_options.pm
index 0cb81cd..7008487 100644
--- a/tools/winapi/make_filter_options.pm
+++ b/tools/winapi/make_filter_options.pm
@@ -17,9 +17,11 @@
#
package make_filter_options;
-use base qw(options);
use strict;
+use warnings 'all';
+
+use base qw(options);
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
require Exporter;
diff --git a/tools/winapi/make_parser.pm b/tools/winapi/make_parser.pm
index 773c5f3..2f5788d 100644
--- a/tools/winapi/make_parser.pm
+++ b/tools/winapi/make_parser.pm
@@ -19,6 +19,7 @@
package make_parser;
use strict;
+use warnings 'all';
use setup qw($current_dir $wine_dir $winapi_dir);
diff --git a/tools/winapi/modules.pm b/tools/winapi/modules.pm
index cbf1a2a..0651a7f 100644
--- a/tools/winapi/modules.pm
+++ b/tools/winapi/modules.pm
@@ -19,6 +19,7 @@
package modules;
use strict;
+use warnings 'all';
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
require Exporter;
diff --git a/tools/winapi/msvcmaker b/tools/winapi/msvcmaker
index a18eb97..864b2b7 100755
--- a/tools/winapi/msvcmaker
+++ b/tools/winapi/msvcmaker
@@ -1,8 +1,9 @@
-#! /usr/bin/perl -w
+#!/usr/bin/perl
# Copyright 2002 Patrik Stridvall
use strict;
+use warnings 'all';
BEGIN {
$0 =~ m%^(.*?/?tools)/winapi/msvcmaker$%;
diff --git a/tools/winapi/msvcmaker_options.pm b/tools/winapi/msvcmaker_options.pm
index 32bdffd..242dcb9 100644
--- a/tools/winapi/msvcmaker_options.pm
+++ b/tools/winapi/msvcmaker_options.pm
@@ -17,9 +17,11 @@
#
package msvcmaker_options;
-use base qw(options);
use strict;
+use warnings 'all';
+
+use base qw(options);
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
require Exporter;
diff --git a/tools/winapi/nativeapi.pm b/tools/winapi/nativeapi.pm
index 4804486..bc58d96 100644
--- a/tools/winapi/nativeapi.pm
+++ b/tools/winapi/nativeapi.pm
@@ -19,6 +19,7 @@
package nativeapi;
use strict;
+use warnings 'all';
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
require Exporter;
diff --git a/tools/winapi/options.pm b/tools/winapi/options.pm
index 3daeb11..2254852 100644
--- a/tools/winapi/options.pm
+++ b/tools/winapi/options.pm
@@ -19,6 +19,7 @@
package options;
use strict;
+use warnings 'all';
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
require Exporter;
@@ -58,6 +59,7 @@ sub parse_value($$) {
package _options;
use strict;
+use warnings 'all';
use output qw($output);
diff --git a/tools/winapi/output.pm b/tools/winapi/output.pm
index f2c8d79..381570a 100644
--- a/tools/winapi/output.pm
+++ b/tools/winapi/output.pm
@@ -19,6 +19,7 @@
package output;
use strict;
+use warnings 'all';
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
require Exporter;
@@ -34,6 +35,7 @@ $output = '_output'->new;
package _output;
use strict;
+use warnings 'all';
my $stdout_isatty = -t STDOUT;
my $stderr_isatty = -t STDERR;
diff --git a/tools/winapi/preprocessor.pm b/tools/winapi/preprocessor.pm
index 3d49773..796f7df 100644
--- a/tools/winapi/preprocessor.pm
+++ b/tools/winapi/preprocessor.pm
@@ -19,6 +19,7 @@
package preprocessor;
use strict;
+use warnings 'all';
sub new($) {
my $proto = shift;
diff --git a/tools/winapi/setup.pm b/tools/winapi/setup.pm
index 60a35c5..ed08460 100644
--- a/tools/winapi/setup.pm
+++ b/tools/winapi/setup.pm
@@ -19,6 +19,7 @@
package setup;
use strict;
+use warnings 'all';
BEGIN {
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
diff --git a/tools/winapi/tests.pm b/tools/winapi/tests.pm
index 142538c..6553da3 100644
--- a/tools/winapi/tests.pm
+++ b/tools/winapi/tests.pm
@@ -19,6 +19,7 @@
package tests;
use strict;
+use warnings 'all';
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
require Exporter;
diff --git a/tools/winapi/type.pm b/tools/winapi/type.pm
index 8f66780..b18383a 100644
--- a/tools/winapi/type.pm
+++ b/tools/winapi/type.pm
@@ -19,6 +19,7 @@
package type;
use strict;
+use warnings 'all';
sub new($) {
my $proto = shift;
diff --git a/tools/winapi/util.pm b/tools/winapi/util.pm
index 6697d56..8f400da 100644
--- a/tools/winapi/util.pm
+++ b/tools/winapi/util.pm
@@ -19,6 +19,7 @@
package util;
use strict;
+use warnings 'all';
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
require Exporter;
diff --git a/tools/winapi/winapi.pm b/tools/winapi/winapi.pm
index c770465..62b4311 100644
--- a/tools/winapi/winapi.pm
+++ b/tools/winapi/winapi.pm
@@ -19,6 +19,7 @@
package winapi;
use strict;
+use warnings 'all';
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
require Exporter;
diff --git a/tools/winapi/winapi_check b/tools/winapi/winapi_check
index 61a0635..bfc9fc7 100755
--- a/tools/winapi/winapi_check
+++ b/tools/winapi/winapi_check
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
# Copyright 1999-2002 Patrik Stridvall
#
@@ -28,6 +28,7 @@
#
use strict;
+use warnings 'all';
BEGIN {
$0 =~ m%^(.*?/?tools)/winapi/winapi_check$%;
diff --git a/tools/winapi/winapi_check_options.pm b/tools/winapi/winapi_check_options.pm
index 23abb1f..8e17744 100644
--- a/tools/winapi/winapi_check_options.pm
+++ b/tools/winapi/winapi_check_options.pm
@@ -17,9 +17,11 @@
#
package winapi_check_options;
-use base qw(options);
use strict;
+use warnings 'all';
+
+use base qw(options);
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
require Exporter;
@@ -161,9 +163,11 @@ my $options_usage = "usage: winapi_check [--help] [<files>]\n";
$options = '_winapi_check_options'->new(\%options_long, \%options_short, $options_usage);
package _winapi_check_options;
-use base qw(_options);
use strict;
+use warnings 'all';
+
+use base qw(_options);
sub report_module($$) {
my $self = shift;
diff --git a/tools/winapi/winapi_documentation.pm b/tools/winapi/winapi_documentation.pm
index d959e11..2be7c8c 100644
--- a/tools/winapi/winapi_documentation.pm
+++ b/tools/winapi/winapi_documentation.pm
@@ -19,6 +19,7 @@
package winapi_documentation;
use strict;
+use warnings 'all';
use config qw($current_dir $wine_dir);
use modules qw($modules);
diff --git a/tools/winapi/winapi_extract b/tools/winapi/winapi_extract
index 1d165b9..b53fbcf 100755
--- a/tools/winapi/winapi_extract
+++ b/tools/winapi/winapi_extract
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
# Copyright 2002 Patrik Stridvall
#
@@ -18,6 +18,7 @@
#
use strict;
+use warnings 'all';
BEGIN {
$0 =~ m%^(.*?/?tools)/winapi/winapi_extract$%;
diff --git a/tools/winapi/winapi_extract_options.pm b/tools/winapi/winapi_extract_options.pm
index 0e5754e..5126ba4 100644
--- a/tools/winapi/winapi_extract_options.pm
+++ b/tools/winapi/winapi_extract_options.pm
@@ -17,9 +17,11 @@
#
package winapi_extract_options;
-use base qw(options);
use strict;
+use warnings 'all';
+
+use base qw(options);
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
require Exporter;
diff --git a/tools/winapi/winapi_function.pm b/tools/winapi/winapi_function.pm
index 633e9ea..d4cfb72 100644
--- a/tools/winapi/winapi_function.pm
+++ b/tools/winapi/winapi_function.pm
@@ -17,9 +17,11 @@
#
package winapi_function;
-use base qw(function);
use strict;
+use warnings 'all';
+
+use base qw(function);
use config qw($current_dir $wine_dir);
use util qw(normalize_set);
diff --git a/tools/winapi/winapi_global.pm b/tools/winapi/winapi_global.pm
index 38c0dfe..bb1403c 100644
--- a/tools/winapi/winapi_global.pm
+++ b/tools/winapi/winapi_global.pm
@@ -19,6 +19,7 @@
package winapi_global;
use strict;
+use warnings 'all';
use modules qw($modules);
use nativeapi qw($nativeapi);
diff --git a/tools/winapi/winapi_local.pm b/tools/winapi/winapi_local.pm
index 42dd146..a9aef17 100644
--- a/tools/winapi/winapi_local.pm
+++ b/tools/winapi/winapi_local.pm
@@ -19,6 +19,7 @@
package winapi_local;
use strict;
+use warnings 'all';
use nativeapi qw($nativeapi);
use options qw($options);
diff --git a/tools/winapi/winapi_module_user.pm b/tools/winapi/winapi_module_user.pm
index ef14453..53bce8e 100644
--- a/tools/winapi/winapi_module_user.pm
+++ b/tools/winapi/winapi_module_user.pm
@@ -19,6 +19,7 @@
package winapi_module_user;
use strict;
+use warnings 'all';
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
require Exporter;
diff --git a/tools/winapi/winapi_parser.pm b/tools/winapi/winapi_parser.pm
index 3703837..87e286f 100644
--- a/tools/winapi/winapi_parser.pm
+++ b/tools/winapi/winapi_parser.pm
@@ -19,6 +19,7 @@
package winapi_parser;
use strict;
+use warnings 'all';
use output qw($output);
use options qw($options);
diff --git a/tools/winapi/winapi_test b/tools/winapi/winapi_test
index 8b7596f..8051591 100755
--- a/tools/winapi/winapi_test
+++ b/tools/winapi/winapi_test
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
# Copyright 2002 Patrik Stridvall
#
@@ -18,6 +18,7 @@
#
use strict;
+use warnings 'all';
BEGIN {
$0 =~ m%^(.*?/?tools)/winapi/winapi_test$%;
diff --git a/tools/winapi/winapi_test_options.pm b/tools/winapi/winapi_test_options.pm
index 240e840..c422b65 100644
--- a/tools/winapi/winapi_test_options.pm
+++ b/tools/winapi/winapi_test_options.pm
@@ -17,9 +17,11 @@
#
package winapi_test_options;
-use base qw(options);
use strict;
+use warnings 'all';
+
+use base qw(options);
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
require Exporter;
--
2.10.0.windows.1
2
1