Wine-devel
Threads by month
- ----- 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
July 2020
- 75 participants
- 841 discussions
[PATCH 2/2 resend] gdi32: Enumerate one charset per font for EnumFontFamilies.
by Myah Caron 24 Jul '20
by Myah Caron 24 Jul '20
24 Jul '20
Empty Message
2
1
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 24 Jul '20
by Zhiyi Zhang 24 Jul '20
24 Jul '20
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
24 Jul '20
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
24 Jul '20
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
24 Jul '20
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
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
5
15
24 Jul '20
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/user32/tests/monitor.c | 1 -
dlls/user32/tests/sysparams.c | 23 +--
dlls/winex11.drv/xrandr.c | 376 ++++++++++++++++++++++++++++++++--
3 files changed, 372 insertions(+), 28 deletions(-)
diff --git a/dlls/user32/tests/monitor.c b/dlls/user32/tests/monitor.c
index badbfdaacf3..005627f28b0 100644
--- a/dlls/user32/tests/monitor.c
+++ b/dlls/user32/tests/monitor.c
@@ -318,7 +318,6 @@ static void _expect_dm(INT line, DEVMODEA expected, const CHAR *device, DWORD te
ok(get_primary_adapter(primary_adapter), "Failed to get primary adapter name.\n");
is_primary = !lstrcmpA(primary_adapter, device);
- todo_wine_if(expected.dmFields & DM_POSITION)
ok_(__FILE__, line)((dm.dmFields & expected.dmFields) == expected.dmFields,
"Device %s test %d expect dmFields to contain %#x, got %#x\n", device, test, expected.dmFields, dm.dmFields);
/* Wine doesn't support changing color depth yet */
diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c
index f71b73930f2..f544e1a4df2 100644
--- a/dlls/user32/tests/sysparams.c
+++ b/dlls/user32/tests/sysparams.c
@@ -3115,7 +3115,7 @@ static BOOL CALLBACK test_enum_display_settings(HMONITOR hmonitor, HDC hdc, LPRE
ret = EnumDisplaySettingsA(mi.szDevice, ENUM_CURRENT_SETTINGS, &dm);
ok(ret, "EnumDisplaySettingsA failed, error %#x\n", GetLastError());
- todo_wine ok((dm.dmFields & (DM_POSITION | DM_PELSWIDTH | DM_PELSHEIGHT)) == (DM_POSITION | DM_PELSWIDTH | DM_PELSHEIGHT),
+ ok((dm.dmFields & (DM_POSITION | DM_PELSWIDTH | DM_PELSHEIGHT)) == (DM_POSITION | DM_PELSWIDTH | DM_PELSHEIGHT),
"Unexpected dmFields %#x.\n", dm.dmFields);
/* Wine currently reports primary adapter positions for all adapters, same for other todo_wines in this function */
ret = get_primary_adapter_name(primary_adapter);
@@ -3187,7 +3187,7 @@ static void test_EnumDisplaySettings(void)
ok(ret, "EnumDisplaySettingsA failed, error %#x\n", GetLastError());
ok(dm.dmSize == FIELD_OFFSET(DEVMODEA, dmICMMethod), "Expect dmSize %u, got %u\n",
FIELD_OFFSET(DEVMODEA, dmICMMethod), dm.dmSize);
- todo_wine ok((dm.dmFields & setting_fields) == setting_fields, "Expect dmFields to contain %#x, got %#x\n",
+ ok((dm.dmFields & setting_fields) == setting_fields, "Expect dmFields to contain %#x, got %#x\n",
setting_fields, dm.dmFields);
memset(&dm, 0, sizeof(dm));
@@ -3196,7 +3196,7 @@ static void test_EnumDisplaySettings(void)
ok(ret, "EnumDisplaySettingsA failed, error %#x\n", GetLastError());
ok(dm.dmSize == FIELD_OFFSET(DEVMODEA, dmICMMethod), "Expect dmSize %u, got %u\n",
FIELD_OFFSET(DEVMODEA, dmICMMethod), dm.dmSize);
- todo_wine ok((dm.dmFields & setting_fields) == setting_fields, "Expect dmFields to contain %#x, got %#x\n",
+ ok((dm.dmFields & setting_fields) == setting_fields, "Expect dmFields to contain %#x, got %#x\n",
setting_fields, dm.dmFields);
memset(&dmW, 0, sizeof(dmW));
@@ -3204,7 +3204,7 @@ static void test_EnumDisplaySettings(void)
ok(ret, "EnumDisplaySettingsW failed, error %#x\n", GetLastError());
ok(dmW.dmSize == FIELD_OFFSET(DEVMODEW, dmICMMethod), "Expect dmSize %u, got %u\n",
FIELD_OFFSET(DEVMODEW, dmICMMethod), dmW.dmSize);
- todo_wine ok((dmW.dmFields & setting_fields) == setting_fields, "Expect dmFields to contain %#x, got %#x\n",
+ ok((dmW.dmFields & setting_fields) == setting_fields, "Expect dmFields to contain %#x, got %#x\n",
setting_fields, dmW.dmFields);
memset(&dmW, 0, sizeof(dmW));
@@ -3213,7 +3213,7 @@ static void test_EnumDisplaySettings(void)
ok(ret, "EnumDisplaySettingsW failed, error %#x\n", GetLastError());
ok(dmW.dmSize == FIELD_OFFSET(DEVMODEW, dmICMMethod), "Expect dmSize %u, got %u\n",
FIELD_OFFSET(DEVMODEW, dmICMMethod), dmW.dmSize);
- todo_wine ok((dmW.dmFields & setting_fields) == setting_fields, "Expect dmFields to contain %#x, got %#x\n",
+ ok((dmW.dmFields & setting_fields) == setting_fields, "Expect dmFields to contain %#x, got %#x\n",
setting_fields, dmW.dmFields);
/* EnumDisplaySettingsExA/W need dmSize to be at least FIELD_OFFSET(DEVMODEA/W, dmFields) + 1 to have valid dmFields */
@@ -3271,7 +3271,7 @@ static void test_EnumDisplaySettings(void)
dm.dmSize = sizeof(dm);
ret = EnumDisplaySettingsExA(NULL, ENUM_CURRENT_SETTINGS, &dm, 0);
ok(ret, "EnumDisplaySettingsExA failed, error %#x\n", GetLastError());
- todo_wine ok((dm.dmFields & setting_fields) == setting_fields, "Expect dmFields to contain %#x, got %#x\n",
+ ok((dm.dmFields & setting_fields) == setting_fields, "Expect dmFields to contain %#x, got %#x\n",
setting_fields, dm.dmFields);
ok(dm.dmBitsPerPel == val, "Expect dmBitsPerPel %d, got %d\n", val, dm.dmBitsPerPel);
@@ -3314,12 +3314,11 @@ static void test_EnumDisplaySettings(void)
{
if (mode == ENUM_CURRENT_SETTINGS)
{
- todo_wine ok((dm.dmFields & setting_fields) == setting_fields,
+ ok((dm.dmFields & setting_fields) == setting_fields,
"Expect dmFields to contain %#x, got %#x\n", setting_fields, dm.dmFields);
}
else
{
- todo_wine_if(mode != ENUM_REGISTRY_SETTINGS)
ok((dm.dmFields & mode_fields) == mode_fields, "Expect dmFields to contain %#x, got %#x\n",
mode_fields, dm.dmFields);
}
@@ -3330,10 +3329,10 @@ static void test_EnumDisplaySettings(void)
if (mode == ENUM_CURRENT_SETTINGS && !attached)
{
- todo_wine ok(dm.dmBitsPerPel == 0, "Expect dmBitsPerPel zero, got %u\n", dm.dmBitsPerPel);
- todo_wine ok(dm.dmPelsWidth == 0, "Expect dmPelsWidth zero, got %u\n", dm.dmPelsWidth);
- todo_wine ok(dm.dmPelsHeight == 0, "Expect dmPelsHeight zero, got %u\n", dm.dmPelsHeight);
- todo_wine ok(dm.dmDisplayFrequency == 0, "Expect dmDisplayFrequency zero, got %u\n", dm.dmDisplayFrequency);
+ ok(dm.dmBitsPerPel == 0, "Expect dmBitsPerPel zero, got %u\n", dm.dmBitsPerPel);
+ ok(dm.dmPelsWidth == 0, "Expect dmPelsWidth zero, got %u\n", dm.dmPelsWidth);
+ ok(dm.dmPelsHeight == 0, "Expect dmPelsHeight zero, got %u\n", dm.dmPelsHeight);
+ ok(dm.dmDisplayFrequency == 0, "Expect dmDisplayFrequency zero, got %u\n", dm.dmDisplayFrequency);
}
else if (mode != ENUM_REGISTRY_SETTINGS)
{
diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c
index 4bbba15a259..5ad70ea95ac 100644
--- a/dlls/winex11.drv/xrandr.c
+++ b/dlls/winex11.drv/xrandr.c
@@ -22,6 +22,10 @@
#include "config.h"
#include "wine/port.h"
+
+#define NONAMELESSSTRUCT
+#define NONAMELESSUNION
+
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(xrandr);
@@ -31,6 +35,7 @@ WINE_DECLARE_DEBUG_CHANNEL(winediag);
#ifdef SONAME_LIBXRANDR
+#include <assert.h>
#include <X11/Xlib.h>
#include <X11/extensions/Xrandr.h>
#include "x11drv.h"
@@ -845,7 +850,9 @@ done:
return ret;
}
-static BOOL xrandr14_get_gpus( struct x11drv_gpu **new_gpus, int *count )
+/* Get a list of GPUs reported by XRandR 1.4. Set get_properties to FALSE if GPU properties are
+ * not needed to avoid unnecessary querying */
+static BOOL xrandr14_get_gpus2( struct x11drv_gpu **new_gpus, int *count, BOOL get_properties )
{
static const WCHAR wine_adapterW[] = {'W','i','n','e',' ','A','d','a','p','t','e','r',0};
struct x11drv_gpu *gpus = NULL;
@@ -907,9 +914,12 @@ static BOOL xrandr14_get_gpus( struct x11drv_gpu **new_gpus, int *count )
}
gpus[i].id = provider_resources->providers[i];
- if (!get_gpu_properties_from_vulkan( &gpus[i], provider_info ))
- MultiByteToWideChar( CP_UTF8, 0, provider_info->name, -1, gpus[i].name, ARRAY_SIZE(gpus[i].name) );
- /* FIXME: Add an alternate method of getting PCI IDs, for systems that don't support Vulkan */
+ if (get_properties)
+ {
+ if (!get_gpu_properties_from_vulkan( &gpus[i], provider_info ))
+ MultiByteToWideChar( CP_UTF8, 0, provider_info->name, -1, gpus[i].name, ARRAY_SIZE(gpus[i].name) );
+ /* FIXME: Add an alternate method of getting PCI IDs, for systems that don't support Vulkan */
+ }
pXRRFreeProviderInfo( provider_info );
}
@@ -937,6 +947,11 @@ done:
return ret;
}
+static BOOL xrandr14_get_gpus( struct x11drv_gpu **new_gpus, int *count )
+{
+ return xrandr14_get_gpus2( new_gpus, count, TRUE );
+}
+
static void xrandr14_free_gpus( struct x11drv_gpu *gpus )
{
heap_free( gpus );
@@ -1284,11 +1299,330 @@ static void xrandr14_register_event_handlers(void)
"XRandR ProviderChange" );
}
+/* XRandR 1.4 display settings handler */
+static BOOL xrandr14_get_id( const WCHAR *device_name, ULONG_PTR *id )
+{
+ INT gpu_count, adapter_count, display_count = 0;
+ INT gpu_idx, adapter_idx, display_idx;
+ struct x11drv_adapter *adapters;
+ struct x11drv_gpu *gpus;
+ WCHAR *end;
+
+ /* Parse \\.\DISPLAY%d */
+ display_idx = strtolW( device_name + 11, &end, 10 ) - 1;
+ if (*end)
+ return FALSE;
+
+ if (!xrandr14_get_gpus2( &gpus, &gpu_count, FALSE ))
+ return FALSE;
+
+ for (gpu_idx = 0; gpu_idx < gpu_count; ++gpu_idx)
+ {
+ if (!xrandr14_get_adapters( gpus[gpu_idx].id, &adapters, &adapter_count ))
+ {
+ xrandr14_free_gpus( gpus );
+ return FALSE;
+ }
+
+ adapter_idx = display_idx - display_count;
+ if (adapter_idx < adapter_count)
+ {
+ *id = adapters[adapter_idx].id;
+ xrandr14_free_adapters( adapters );
+ xrandr14_free_gpus( gpus );
+ return TRUE;
+ }
+
+ display_count += adapter_count;
+ xrandr14_free_adapters( adapters );
+ }
+ xrandr14_free_gpus( gpus );
+ return FALSE;
+}
+
+static void add_xrandr14_mode( DEVMODEW *mode, XRRModeInfo *info, DWORD depth, DWORD frequency )
+{
+ mode->dmSize = sizeof(*mode);
+ mode->dmDriverExtra = sizeof(RRMode);
+ mode->dmFields = DM_DISPLAYORIENTATION | DM_BITSPERPEL | DM_PELSWIDTH |
+ DM_PELSHEIGHT | DM_DISPLAYFLAGS;
+ if (frequency)
+ {
+ mode->dmFields |= DM_DISPLAYFREQUENCY;
+ mode->dmDisplayFrequency = frequency;
+ }
+ mode->u1.s2.dmDisplayOrientation = DMDO_DEFAULT;
+ mode->dmBitsPerPel = depth;
+ mode->dmPelsWidth = info->width;
+ mode->dmPelsHeight = info->height;
+ mode->u2.dmDisplayFlags = 0;
+ memcpy( (BYTE *)mode + sizeof(*mode), &info->id, sizeof(info->id) );
+}
+
+static BOOL xrandr14_get_modes( ULONG_PTR id, DWORD flags, DEVMODEW **new_modes, UINT *mode_count )
+{
+ XRRScreenResources *screen_resources;
+ XRROutputInfo *output_info = NULL;
+ RROutput output = (RROutput)id;
+ UINT depth_idx, mode_idx = 0;
+ XRRModeInfo *mode_info;
+ DEVMODEW *mode, *modes;
+ BOOL ret = FALSE;
+ DWORD frequency;
+ INT i, j;
+
+ screen_resources = xrandr_get_screen_resources();
+ if (!screen_resources)
+ goto done;
+
+ output_info = pXRRGetOutputInfo( gdi_display, screen_resources, output );
+ if (!output_info)
+ goto done;
+
+ if (output_info->connection != RR_Connected)
+ {
+ ret = TRUE;
+ *new_modes = NULL;
+ *mode_count = 0;
+ goto done;
+ }
+
+ /* Allocate space for display modes in different color depths.
+ * Store a RRMode at the end of each DEVMODEW as private driver data */
+ modes = heap_calloc( output_info->nmode * DEPTH_COUNT, sizeof(*modes) + sizeof(RRMode) );
+ if (!modes)
+ goto done;
+
+ for (i = 0; i < output_info->nmode; ++i)
+ {
+ for (j = 0; j < screen_resources->nmode; ++j)
+ {
+ if (output_info->modes[i] != screen_resources->modes[j].id)
+ continue;
+
+ mode_info = &screen_resources->modes[j];
+ frequency = get_frequency( mode_info );
+
+ for (depth_idx = 0; depth_idx < DEPTH_COUNT; ++depth_idx)
+ {
+ mode = (DEVMODEW *)((BYTE *)modes + (sizeof(*modes) + sizeof(RRMode)) * mode_idx);
+ add_xrandr14_mode( mode, mode_info, depths[depth_idx], frequency );
+ ++mode_idx;
+ }
+
+ break;
+ }
+ }
+
+ ret = TRUE;
+ *new_modes = modes;
+ *mode_count = mode_idx;
+done:
+ if (output_info)
+ pXRRFreeOutputInfo( output_info );
+ if (screen_resources)
+ pXRRFreeScreenResources( screen_resources );
+ return ret;
+}
+
+static void xrandr14_free_modes( DEVMODEW *modes )
+{
+ heap_free( modes );
+}
+
+static BOOL xrandr14_get_current_mode( ULONG_PTR id, DEVMODEW *mode )
+{
+ XRRScreenResources *screen_resources;
+ XRROutputInfo *output_info = NULL;
+ RROutput output = (RROutput)id;
+ XRRModeInfo *mode_info = NULL;
+ XRRCrtcInfo *crtc_info = NULL;
+ BOOL ret = FALSE;
+ RECT primary;
+ INT mode_idx;
+
+ screen_resources = xrandr_get_screen_resources();
+ if (!screen_resources)
+ goto done;
+
+ output_info = pXRRGetOutputInfo( gdi_display, screen_resources, output );
+ if (!output_info)
+ goto done;
+
+ if (output_info->crtc)
+ {
+ crtc_info = pXRRGetCrtcInfo( gdi_display, screen_resources, output_info->crtc );
+ if (!crtc_info)
+ goto done;
+ }
+
+ /* Detached */
+ if (output_info->connection != RR_Connected || !output_info->crtc || !crtc_info->mode)
+ {
+ mode->dmFields = DM_DISPLAYORIENTATION | DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT |
+ DM_DISPLAYFLAGS | DM_DISPLAYFREQUENCY | DM_POSITION;
+ mode->u1.s2.dmDisplayOrientation = DMDO_DEFAULT;
+ mode->dmBitsPerPel = 0;
+ mode->dmPelsWidth = 0;
+ mode->dmPelsHeight = 0;
+ mode->u2.dmDisplayFlags = 0;
+ mode->dmDisplayFrequency = 0;
+ mode->u1.s2.dmPosition.x = 0;
+ mode->u1.s2.dmPosition.y = 0;
+ ret = TRUE;
+ goto done;
+ }
+
+ /* Attached */
+ for (mode_idx = 0; mode_idx < screen_resources->nmode; ++mode_idx)
+ {
+ if (crtc_info->mode == screen_resources->modes[mode_idx].id)
+ {
+ mode_info = &screen_resources->modes[mode_idx];
+ break;
+ }
+ }
+
+ if (!mode_info)
+ goto done;
+
+ mode->dmFields = DM_DISPLAYORIENTATION | DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT |
+ DM_DISPLAYFLAGS | DM_DISPLAYFREQUENCY | DM_POSITION;
+ mode->u1.s2.dmDisplayOrientation = DMDO_DEFAULT;
+ mode->dmBitsPerPel = screen_bpp;
+ mode->dmPelsWidth = mode_info->width;
+ mode->dmPelsHeight = mode_info->height;
+ mode->u2.dmDisplayFlags = 0;
+ mode->dmDisplayFrequency = get_frequency( mode_info );
+ /* Convert RandR coordinates to virtual screen coordinates */
+ primary = get_primary_rect( screen_resources );
+ mode->u1.s2.dmPosition.x = crtc_info->x - primary.left;
+ mode->u1.s2.dmPosition.y = crtc_info->y - primary.top;
+ ret = TRUE;
+done:
+ if (crtc_info)
+ pXRRFreeCrtcInfo( crtc_info );
+ if (output_info)
+ pXRRFreeOutputInfo( output_info );
+ if (screen_resources)
+ pXRRFreeScreenResources( screen_resources );
+ return ret;
+}
+
+static LONG xrandr14_set_current_mode( ULONG_PTR id, DEVMODEW *mode )
+{
+ unsigned int screen_width, screen_height;
+ RROutput output = (RROutput)id, *outputs;
+ XRRScreenResources *screen_resources;
+ XRROutputInfo *output_info = NULL;
+ XRRCrtcInfo *crtc_info = NULL;
+ LONG ret = DISP_CHANGE_FAILED;
+ INT crtc_idx, output_count;
+ Rotation rotation;
+ RRCrtc crtc = 0;
+ Status status;
+ RRMode rrmode;
+
+ if (mode->dmFields & DM_BITSPERPEL && mode->dmBitsPerPel != screen_bpp)
+ WARN("Cannot change screen color depth from %ubits to %ubits!\n", screen_bpp, mode->dmBitsPerPel);
+
+ screen_resources = xrandr_get_screen_resources();
+ if (!screen_resources)
+ return ret;
+
+ XGrabServer( gdi_display );
+
+ output_info = pXRRGetOutputInfo( gdi_display, screen_resources, output );
+ if (!output_info || output_info->connection != RR_Connected)
+ goto done;
+
+ /* Attached */
+ if (output_info->crtc)
+ {
+ crtc = output_info->crtc;
+ }
+ /* Detached, need to find a free CRTC */
+ else
+ {
+ for (crtc_idx = 0; crtc_idx < output_info->ncrtc; ++crtc_idx)
+ {
+ crtc_info = pXRRGetCrtcInfo( gdi_display, screen_resources, output_info->crtcs[crtc_idx] );
+ if (!crtc_info)
+ goto done;
+
+ if (!crtc_info->noutput)
+ {
+ crtc = output_info->crtcs[crtc_idx];
+ pXRRFreeCrtcInfo( crtc_info );
+ crtc_info = NULL;
+ break;
+ }
+
+ pXRRFreeCrtcInfo( crtc_info );
+ crtc_info = NULL;
+ }
+
+ /* Failed to find a free CRTC */
+ if (crtc_idx == output_info->ncrtc)
+ goto done;
+ }
+
+ crtc_info = pXRRGetCrtcInfo( gdi_display, screen_resources, crtc );
+ if (!crtc_info)
+ goto done;
+
+ assert( mode->dmDriverExtra == sizeof(RRMode) );
+ memcpy( &rrmode, (BYTE *)mode + sizeof(*mode), sizeof(rrmode) );
+
+ if (crtc_info->noutput)
+ {
+ outputs = crtc_info->outputs;
+ output_count = crtc_info->noutput;
+ rotation = crtc_info->rotation;
+ }
+ else
+ {
+ outputs = &output;
+ output_count = 1;
+ rotation = RR_Rotate_0;
+ }
+
+ /* 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. */
+ status = pXRRSetCrtcConfig( gdi_display, screen_resources, crtc, CurrentTime, 0, 0, None,
+ RR_Rotate_0, NULL, 0 );
+ if (status != RRSetConfigSuccess)
+ goto done;
+
+ get_screen_size( screen_resources, &screen_width, &screen_height );
+ screen_width = max( screen_width, crtc_info->x + mode->dmPelsWidth );
+ screen_height = max( screen_height, crtc_info->y + mode->dmPelsHeight );
+ set_screen_size( screen_width, screen_height );
+
+ status = pXRRSetCrtcConfig( gdi_display, screen_resources, crtc, CurrentTime,
+ crtc_info->x, crtc_info->y, rrmode, rotation, outputs, output_count );
+ if (status == RRSetConfigSuccess)
+ ret = DISP_CHANGE_SUCCESSFUL;
+
+done:
+ XUngrabServer( gdi_display );
+ XFlush( gdi_display );
+ if (crtc_info)
+ pXRRFreeCrtcInfo( crtc_info );
+ if (output_info)
+ pXRRFreeOutputInfo( output_info );
+ pXRRFreeScreenResources( screen_resources );
+ return ret;
+}
+
#endif
void X11DRV_XRandR_Init(void)
{
- struct x11drv_display_device_handler handler;
+ struct x11drv_display_device_handler display_handler;
+ struct x11drv_settings_handler settings_handler;
int event_base, error_base, minor, ret;
static int major;
Bool ok;
@@ -1322,16 +1656,28 @@ void X11DRV_XRandR_Init(void)
#ifdef HAVE_XRRGETPROVIDERRESOURCES
if (ret >= 4 && (major > 1 || (major == 1 && minor >= 4)))
{
- handler.name = "XRandR 1.4";
- handler.priority = 200;
- handler.get_gpus = xrandr14_get_gpus;
- handler.get_adapters = xrandr14_get_adapters;
- handler.get_monitors = xrandr14_get_monitors;
- handler.free_gpus = xrandr14_free_gpus;
- handler.free_adapters = xrandr14_free_adapters;
- handler.free_monitors = xrandr14_free_monitors;
- handler.register_event_handlers = xrandr14_register_event_handlers;
- X11DRV_DisplayDevices_SetHandler( &handler );
+ display_handler.name = "XRandR 1.4";
+ display_handler.priority = 200;
+ display_handler.get_gpus = xrandr14_get_gpus;
+ display_handler.get_adapters = xrandr14_get_adapters;
+ display_handler.get_monitors = xrandr14_get_monitors;
+ display_handler.free_gpus = xrandr14_free_gpus;
+ display_handler.free_adapters = xrandr14_free_adapters;
+ display_handler.free_monitors = xrandr14_free_monitors;
+ display_handler.register_event_handlers = xrandr14_register_event_handlers;
+ X11DRV_DisplayDevices_SetHandler( &display_handler );
+
+ if (is_broken_driver())
+ return;
+
+ settings_handler.name = "XRandR 1.4";
+ settings_handler.priority = 300;
+ settings_handler.get_id = xrandr14_get_id;
+ settings_handler.get_modes = xrandr14_get_modes;
+ settings_handler.free_modes = xrandr14_free_modes;
+ settings_handler.get_current_mode = xrandr14_get_current_mode;
+ settings_handler.set_current_mode = xrandr14_set_current_mode;
+ X11DRV_Settings_SetHandler( &settings_handler );
}
#endif
}
--
2.25.1
2
1
[PATCH 10/10] xactengine3_7: Implement IXACT3Engine::RegisterNotification and IXACT3Engine::UnRegisterNotification functions.
by Vijay Kiran Kamuju 24 Jul '20
by Vijay Kiran Kamuju 24 Jul '20
24 Jul '20
Based on patch from Ethan Lee.
Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com>
1
0
[PATCH 09/10] xactengine3_7: Implement IXACT3WaveBank::Play function.
by Vijay Kiran Kamuju 24 Jul '20
by Vijay Kiran Kamuju 24 Jul '20
24 Jul '20
Based on patch from Ethan Lee.
Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com>
1
0