Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- 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
January 2022
- 86 participants
- 2418 messages
[tools 1/2] testbot/SetWinLocale: Use Powershell to collect all the locales at once.
by Francois Gouget
The new Powershell script can also be used independently on Windows.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/bin/SetWinLocale | 103 +++++++++++++++++++-------------
testbot/bin/SetWinLocale.ps1 | 110 +++++++++++++++++++++++++++++++++++
2 files changed, 171 insertions(+), 42 deletions(-)
create mode 100644 testbot/bin/SetWinLocale.ps1
diff --git a/testbot/bin/SetWinLocale b/testbot/bin/SetWinLocale
index 42a106b77d..25023bb94f 100755
--- a/testbot/bin/SetWinLocale
+++ b/testbot/bin/SetWinLocale
@@ -3,7 +3,7 @@
#
# Sets the locale of the specified Windows machine.
#
-# Copyright 2018, 2021 Francois Gouget
+# Copyright 2018, 2021-2022 Francois Gouget
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -41,12 +41,7 @@ use WineTestBot::Log;
use WineTestBot::TestAgent;
use WineTestBot::Utils;
-my $HKCU_INTERNATIONAL = "HKCU\\Control Panel\\International";
-my $HKCU_GEO = "HKCU\\Control Panel\\International\\Geo";
my $HKCU_USER_PROFILE = "HKCU\\Control Panel\\International\\User Profile";
-my $HKCU_DESKTOP = "HKCU\\Control Panel\\Desktop";
-my $HKLM_LANGUAGE = "HKLM\\SYSTEM\\CurrentControlSet\\Control\\Nls\\Language";
-my $HKLM_LOCALE = "HKLM\\SYSTEM\\CurrentControlSet\\Control\\Nls\\Locale";
my $HKLM_CODE_PAGE = "HKLM\\System\\CurrentControlSet\\Control\\Nls\\CodePage";
@@ -74,11 +69,26 @@ sub Debug(@)
print STDERR @_ if ($Debug);
}
+my $TA;
+sub Cleanup()
+{
+ return if (!$TA);
+ if ($Debug)
+ {
+ Debug("Not deleting the $name0* files for debugging\n");
+ }
+ else
+ {
+ $TA->Rm("$name0.out", "$name0.ps1");
+ }
+}
+
my $Start = Time();
sub FatalError(@)
{
- Error( @_);
+ Error(@_);
Debug(Elapsed($Start), " Aborting\n");
+ Cleanup();
exit(1);
}
@@ -487,7 +497,7 @@ if (defined $Usage)
exit 0;
}
-my $TA = TestAgent->new($OptHostName, $AgentPort);
+$TA = TestAgent->new($OptHostName, $AgentPort);
#
@@ -558,42 +568,44 @@ sub RegSetValue($$$$)
# Show the host's locale settings
#
-sub GetWinSettings($)
+if (open(my $fh, "<", "$0.ps1"))
{
- my ($All) = @_;
- my $Settings;
+ my $Script = join("", <$fh>);
+ close($fh);
- if ($OptLocale or $All)
- {
- my $Values = RegGetValues($HKCU_INTERNATIONAL, "Locale*");
- map { $Settings->{$_} = $Values->{$_} } ("Locale", "LocaleName");
- }
- if ($OptCountry or $All)
- {
- my $Values = RegGetValues($HKCU_GEO, "N*");
- $Settings->{Country} = $Values->{Nation};
- $Settings->{CountryName} = $Values->{Name};
- }
- if (($OptKeyboard || $OptDefault) or $All)
- {
- my $Values = RegGetValues($HKCU_USER_PROFILE, "*");
- $Settings->{InputMethod} = $Values->{InputMethodOverride};
- $Settings->{Languages} = $Values->{Languages};
- }
- if ($OptMUI or $All)
- {
- my $Values = RegGetValues($HKCU_DESKTOP, "*PreferredUILanguages*");
- map { $Settings->{$_} = $Values->{$_} } ("PreferredUILanguages", "PreferredUILanguagesPending", "PreviousPreferredUILanguages");
- }
- if ($OptSystem or $All)
+ $Script =~ s~\n~\r\n~g;
+ if (!$TA->SendFileFromString($Script, "$name0.ps1", 0))
{
- $Settings->{SysLanguage} = RegGetValue($HKLM_LANGUAGE, "Default");
- $Settings->{SysLocale} = RegGetValue($HKLM_LOCALE, "(Default)");
+ FatalError("could not send the batch file:", $TA->GetLastError(), "\n");
}
- if ($OptUTF8 or $All)
+}
+else
+{
+ FatalError("could not open '$0.ps1' for reading: $!\n");
+}
+
+sub GetWinSettings()
+{
+ my $Cmd = ["powershell.exe", "-ExecutionPolicy", "ByPass", "-File",
+ "$name0.ps1", "settings"];
+ my $Ret = $TA->RunAndWait($Cmd, 0, 30, undef, "$name0.out", "$name0.out");
+ FatalError("failed to run @$Cmd: ", $TA->GetLastError(), "\n") if ($Ret < 0);
+ my $Out = $TA->GetFileToString("$name0.out") if (!$Ret);
+
+ my ($Settings, $Key);
+ foreach my $Line (split /\n/, $Out || "")
{
- my $Values = RegGetValues($HKLM_CODE_PAGE, "*CP");
- map { $Settings->{$_} = $Values->{$_} } ("ACP", "MACCP", "OEMCP");
+ $Line =~ s/\r$//;
+ if ($Line =~ /^([a-zA-Z]+)=\[(.*)\]$/)
+ {
+ my ($Name, $Value) = ($1, $2);
+ $Settings->{$Name} = [split /, /, $Value];
+ }
+ elsif ($Line =~ /^([a-zA-Z]+)=(.*)$/)
+ {
+ my ($Name, $Value) = ($1, $2);
+ $Settings->{$Name} = $Value eq "<undef>" ? undef : $Value;
+ }
}
return $Settings;
}
@@ -609,6 +621,8 @@ sub Value2Str($)
sub ShowWinSettings($)
{
my ($Settings) = @_;
+
+ print "Current account:\n";
print "Locale (--locale) = ", Value2Str($Settings->{Locale}), "\n";
print "LocaleName (--locale) = ", Value2Str($Settings->{LocaleName}), "\n";
print "Geo:Nation (--country) = ", Value2Str($Settings->{Country}), "\n";
@@ -618,6 +632,9 @@ sub ShowWinSettings($)
print "PreferredUILanguages (--mui) = ", Value2Str($Settings->{PreferredUILanguages}), "\n";
print " ...Pending (--mui) = ", Value2Str($Settings->{PreferredUILanguagesPending}), "\n";
print " Previous... (--mui) = ", Value2Str($Settings->{PreviousPreferredUILanguages}), "\n";
+
+ print "\n";
+ print "System settings:\n";
print "Nls:Language (--system) = ", Value2Str($Settings->{SysLanguage}), "\n";
print "Nls:Locale (--system) = ", Value2Str($Settings->{SysLocale}), "\n";
print "ACP (--utf8) = ", Value2Str($Settings->{ACP}), "\n";
@@ -627,7 +644,8 @@ sub ShowWinSettings($)
if ($OptShow)
{
- ShowWinSettings(GetWinSettings("all"));
+ ShowWinSettings(GetWinSettings());
+ Cleanup();
exit(0);
}
@@ -856,7 +874,7 @@ sub CheckSetting($$$$;$)
my ($Settings, $VName, $Expected, $For, $IgnoreCase) = @_;
my $Value = $Settings->{$VName};
- if (defined $Value)
+ if (defined $Value and $Value !~ /^<.+>$/)
{
if ((!$IgnoreCase and $Value ne $Expected) or
($IgnoreCase and uc($Value) ne uc($Expected)))
@@ -868,7 +886,7 @@ sub CheckSetting($$$$;$)
}
Debug(Elapsed($Start), " Checking the new locale settings\n");
-my $Settings = GetWinSettings($Debug);
+my $Settings = GetWinSettings();
ShowWinSettings($Settings) if ($Debug);
if ($OptLocale)
{
@@ -901,6 +919,7 @@ if ($KeyboardIds)
CheckSetting($Settings, "InputMethod", $KeyboardIds->[0], "for --keyboard $OptKeyboard", 1);
}
+Cleanup();
exit(1) if (!$Success);
Debug(Elapsed($Start), " All done!\n");
exit(0);
diff --git a/testbot/bin/SetWinLocale.ps1 b/testbot/bin/SetWinLocale.ps1
new file mode 100644
index 0000000000..8d6b3a94bc
--- /dev/null
+++ b/testbot/bin/SetWinLocale.ps1
@@ -0,0 +1,110 @@
+# Shows the Windows locale settings
+#
+# Copyright 2022 Francois Gouget
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+$Name0 = (Get-Item $MyInvocation.InvocationName).Basename
+
+
+#
+# Dump the Windows locales settings
+#
+
+$HKCU_INTERNATIONAL = "HKCU:\Control Panel\International"
+$HKCU_GEO = "HKCU:\Control Panel\International\Geo"
+$HKCU_USER_PROFILE = "HKCU:\Control Panel\International\User Profile"
+$HKCU_DESKTOP = "HKCU:\Control Panel\Desktop"
+$HKLM_LANGUAGE = "HKLM:\SYSTEM\CurrentControlSet\Control\Nls\Language"
+$HKLM_LOCALE = "HKLM:\SYSTEM\CurrentControlSet\Control\Nls\Locale"
+$HKLM_CODE_PAGE = "HKLM:\System\CurrentControlSet\Control\Nls\CodePage"
+$CODE_PAGES = "ACP", "MACCP", "OEMCP"
+
+
+function ShowSetting([string]$Key, [string]$VName, [string]$SName)
+{
+ if ($SName -eq "") { $SName = $VName }
+ # Don't use Get-ItemPropertyValue because it ignores -ErrorAction and is
+ # not available on Windows 7.
+ $Value = Get-ItemProperty -Path $Key -Name $VName -ErrorAction SilentlyContinue
+ $Value = if ($Value -eq $null) { "<undef>" } else { $Value.$($VName) }
+ if ($Value.GetType().Name -eq "Object[]")
+ {
+ $Value = "[" + ($Value -join ", ") + "]"
+ }
+ Write-Output "$SName=$Value"
+}
+
+function ShowSettings()
+{
+ Write-Output "Current account:"
+ ShowSetting $HKCU_INTERNATIONAL "Locale"
+ ShowSetting $HKCU_INTERNATIONAL "LocaleName"
+ ShowSetting $HKCU_GEO "Nation" "Country"
+ ShowSetting $HKCU_GEO "Name" "CountryName"
+ ShowSetting $HKCU_USER_PROFILE "InputMethodOverride" "InputMethod"
+ ShowSetting $HKCU_USER_PROFILE "Languages"
+ ShowSetting $HKCU_DESKTOP "PreferredUILanguages"
+ ShowSetting $HKCU_DESKTOP "PreferredUILanguagesPending"
+ ShowSetting $HKCU_DESKTOP "PreviousPreferredUILanguages"
+
+ Write-Output ""
+ Write-Output "System settings:"
+ ShowSetting $HKLM_LANGUAGE "Default" "SysLanguage"
+ try
+ {
+ ShowSetting $HKLM_LOCALE "(Default)" "SysLocale"
+ }
+ catch
+ {
+ # On Windows 7 Get-ItemProperty confuses the key's default value
+ # with the value called "(Default)"!
+ Write-Output "SysLocale=<cannot-get-on-windows-7>"
+ }
+ foreach ($CodePage in $CODE_PAGES)
+ {
+ ShowSetting $HKLM_CODE_PAGE $CodePage
+ }
+
+ exit 0
+}
+
+
+#
+# Main
+#
+
+function ShowUsage()
+{
+ Write-Output "Usage: $Name0 settings"
+ Write-Output "or $Name0 -?"
+ Write-Output ""
+ Write-Output "Shows the Windows locales."
+ Write-Output ""
+ Write-Output "Where:"
+ Write-Output " settings Show the current Windows locale settings."
+ Write-Output " -? Shows this help message."
+}
+
+$Action = $args[0]
+if ($Action -eq "settings") { ShowSettings }
+$Rc = 0
+if ($Action -and $Action -ne "-?" -and $Action -ne "-h" -and $Action -ne "help")
+{
+ echo "$Name0:error: unknown action $Action"
+ $Rc = 2
+}
+ShowUsage
+exit $Rc
--
2.30.2
Jan. 27, 2022
[PATCH] comctl32/tests: Add some tests for TBBUTTON.iBitmap for separators.
by Nikolay Sivov
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52465
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/comctl32/tests/toolbar.c | 92 +++++++++++++++++++++++++++++++++++
1 file changed, 92 insertions(+)
diff --git a/dlls/comctl32/tests/toolbar.c b/dlls/comctl32/tests/toolbar.c
index 1c52c70f2aa..cfe4f16f430 100644
--- a/dlls/comctl32/tests/toolbar.c
+++ b/dlls/comctl32/tests/toolbar.c
@@ -2705,6 +2705,96 @@ static void init_functions(void)
#undef X
}
+static void test_BTNS_SEP(void)
+{
+ TBBUTTON buttons[1], button;
+ LRESULT ret;
+ HWND hwnd;
+
+ rebuild_toolbar(&hwnd);
+
+ /* 0 iBitmap */
+ memset(buttons, 0, sizeof(buttons));
+ buttons[0].idCommand = 5;
+ buttons[0].fsStyle = BTNS_SEP;
+ buttons[0].fsState = TBSTATE_ENABLED;
+ buttons[0].iString = -1;
+
+ ret = SendMessageA(hwnd, TB_ADDBUTTONSA, 1, (LPARAM)buttons);
+ ok(ret == 1, "Unexpected return value.\n");
+ ret = SendMessageA(hwnd, TB_AUTOSIZE, 0, 0);
+ ok(!ret, "Unexpected return value.\n");
+
+ memset(&button, 0, sizeof(button));
+ ret = SendMessageA(hwnd, TB_GETBUTTON, 0, (LPARAM)&button);
+ ok(ret == 1, "Unexpected return value.\n");
+todo_wine
+ ok(button.iBitmap == 8, "Unexpected iBitmap value %d.\n", button.iBitmap);
+
+ rebuild_toolbar(&hwnd);
+
+ /* Nonzero iBitmap */
+ memset(buttons, 0, sizeof(buttons));
+ buttons[0].idCommand = 5;
+ buttons[0].fsStyle = BTNS_SEP;
+ buttons[0].fsState = TBSTATE_ENABLED;
+ buttons[0].iString = -1;
+ buttons[0].iBitmap = 2;
+
+ ret = SendMessageA(hwnd, TB_ADDBUTTONSA, 1, (LPARAM)buttons);
+ ok(ret == 1, "Unexpected return value.\n");
+ ret = SendMessageA(hwnd, TB_AUTOSIZE, 0, 0);
+ ok(!ret, "Unexpected return value.\n");
+
+ memset(&button, 0, sizeof(button));
+ ret = SendMessageA(hwnd, TB_GETBUTTON, 0, (LPARAM)&button);
+ ok(ret == 1, "Unexpected return value.\n");
+ ok(button.iBitmap == 2, "Unexpected iBitmap value %d.\n", button.iBitmap);
+
+ rebuild_toolbar(&hwnd);
+
+ /* Exceeds default width */
+ memset(buttons, 0, sizeof(buttons));
+ buttons[0].idCommand = 5;
+ buttons[0].fsStyle = BTNS_SEP;
+ buttons[0].fsState = TBSTATE_ENABLED;
+ buttons[0].iString = -1;
+ buttons[0].iBitmap = 32;
+
+ ret = SendMessageA(hwnd, TB_ADDBUTTONSA, 1, (LPARAM)buttons);
+ ok(ret == 1, "Unexpected return value.\n");
+ ret = SendMessageA(hwnd, TB_AUTOSIZE, 0, 0);
+ ok(!ret, "Unexpected return value.\n");
+
+ memset(&button, 0, sizeof(button));
+ ret = SendMessageA(hwnd, TB_GETBUTTON, 0, (LPARAM)&button);
+ ok(ret == 1, "Unexpected return value.\n");
+ ok(button.iBitmap == 32, "Unexpected iBitmap value %d.\n", button.iBitmap);
+
+ rebuild_toolbar(&hwnd);
+
+ /* Negative */
+ memset(buttons, 0, sizeof(buttons));
+ buttons[0].idCommand = 5;
+ buttons[0].fsStyle = BTNS_SEP;
+ buttons[0].fsState = TBSTATE_ENABLED;
+ buttons[0].iString = -1;
+ buttons[0].iBitmap = -3;
+
+ ret = SendMessageA(hwnd, TB_ADDBUTTONSA, 1, (LPARAM)buttons);
+ ok(ret == 1, "Unexpected return value.\n");
+ ret = SendMessageA(hwnd, TB_AUTOSIZE, 0, 0);
+ ok(!ret, "Unexpected return value.\n");
+
+ memset(&button, 0, sizeof(button));
+ ret = SendMessageA(hwnd, TB_GETBUTTON, 0, (LPARAM)&button);
+ ok(ret == 1, "Unexpected return value.\n");
+todo_wine
+ ok(button.iBitmap == 8, "Unexpected iBitmap value %d.\n", button.iBitmap);
+
+ DestroyWindow(hwnd);
+}
+
START_TEST(toolbar)
{
ULONG_PTR ctx_cookie;
@@ -2755,12 +2845,14 @@ START_TEST(toolbar)
test_save();
test_drawtext_flags();
test_imagelist();
+ test_BTNS_SEP();
if (!load_v6_module(&ctx_cookie, &ctx))
return;
test_create(TRUE);
test_visual();
+ test_BTNS_SEP();
PostQuitMessage(0);
while(GetMessageA(&msg,0,0,0)) {
--
2.34.1
Jan. 27, 2022
[PATCH 2/2] mfmediaengine: Implement audio renderer configuration methods.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/mfmediaengine/main.c | 72 +++++++++++++++++++++---
dlls/mfmediaengine/tests/mfmediaengine.c | 44 +++++++++++++++
2 files changed, 108 insertions(+), 8 deletions(-)
diff --git a/dlls/mfmediaengine/main.c b/dlls/mfmediaengine/main.c
index ae844c60e54..5c00c10f718 100644
--- a/dlls/mfmediaengine/main.c
+++ b/dlls/mfmediaengine/main.c
@@ -29,6 +29,8 @@
#include "mferror.h"
#include "dxgi.h"
#include "d3d11.h"
+#include "mmdeviceapi.h"
+#include "audiosessiontypes.h"
#include "wine/debug.h"
@@ -2495,30 +2497,78 @@ static HRESULT WINAPI media_engine_EnableHorizontalMirrorMode(IMFMediaEngineEx *
static HRESULT WINAPI media_engine_GetAudioStreamCategory(IMFMediaEngineEx *iface, UINT32 *category)
{
- FIXME("%p, %p stub.\n", iface, category);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
+ HRESULT hr;
- return E_NOTIMPL;
+ TRACE("%p, %p.\n", iface, category);
+
+ EnterCriticalSection(&engine->cs);
+
+ if (engine->flags & FLAGS_ENGINE_SHUT_DOWN)
+ hr = MF_E_SHUTDOWN;
+ else
+ hr = IMFAttributes_GetUINT32(engine->attributes, &MF_MEDIA_ENGINE_AUDIO_CATEGORY, category);
+
+ LeaveCriticalSection(&engine->cs);
+
+ return hr;
}
static HRESULT WINAPI media_engine_SetAudioStreamCategory(IMFMediaEngineEx *iface, UINT32 category)
{
- FIXME("%p, %u stub.\n", iface, category);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
+ HRESULT hr;
- return E_NOTIMPL;
+ TRACE("%p, %u.\n", iface, category);
+
+ EnterCriticalSection(&engine->cs);
+
+ if (engine->flags & FLAGS_ENGINE_SHUT_DOWN)
+ hr = MF_E_SHUTDOWN;
+ else
+ hr = IMFAttributes_SetUINT32(engine->attributes, &MF_MEDIA_ENGINE_AUDIO_CATEGORY, category);
+
+ LeaveCriticalSection(&engine->cs);
+
+ return hr;
}
static HRESULT WINAPI media_engine_GetAudioEndpointRole(IMFMediaEngineEx *iface, UINT32 *role)
{
- FIXME("%p, %p stub.\n", iface, role);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
+ HRESULT hr;
- return E_NOTIMPL;
+ TRACE("%p, %p.\n", iface, role);
+
+ EnterCriticalSection(&engine->cs);
+
+ if (engine->flags & FLAGS_ENGINE_SHUT_DOWN)
+ hr = MF_E_SHUTDOWN;
+ else
+ hr = IMFAttributes_GetUINT32(engine->attributes, &MF_MEDIA_ENGINE_AUDIO_ENDPOINT_ROLE, role);
+
+ LeaveCriticalSection(&engine->cs);
+
+ return hr;
}
static HRESULT WINAPI media_engine_SetAudioEndpointRole(IMFMediaEngineEx *iface, UINT32 role)
{
- FIXME("%p, %u stub.\n", iface, role);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
+ HRESULT hr;
- return E_NOTIMPL;
+ TRACE("%p, %u.\n", iface, role);
+
+ EnterCriticalSection(&engine->cs);
+
+ if (engine->flags & FLAGS_ENGINE_SHUT_DOWN)
+ hr = MF_E_SHUTDOWN;
+ else
+ hr = IMFAttributes_SetUINT32(engine->attributes, &MF_MEDIA_ENGINE_AUDIO_ENDPOINT_ROLE, role);
+
+ LeaveCriticalSection(&engine->cs);
+
+ return hr;
}
static HRESULT WINAPI media_engine_GetRealTimeMode(IMFMediaEngineEx *iface, BOOL *enabled)
@@ -2867,6 +2917,12 @@ static HRESULT init_media_engine(DWORD flags, IMFAttributes *attributes, struct
if (FAILED(hr = IMFAttributes_CopyAllItems(attributes, engine->attributes)))
return hr;
+ /* Set default audio configuration */
+ if (FAILED(IMFAttributes_GetItem(engine->attributes, &MF_MEDIA_ENGINE_AUDIO_CATEGORY, NULL)))
+ IMFAttributes_SetUINT32(engine->attributes, &MF_MEDIA_ENGINE_AUDIO_CATEGORY, AudioCategory_Other);
+ if (FAILED(IMFAttributes_GetItem(engine->attributes, &MF_MEDIA_ENGINE_AUDIO_ENDPOINT_ROLE, NULL)))
+ IMFAttributes_SetUINT32(engine->attributes, &MF_MEDIA_ENGINE_AUDIO_ENDPOINT_ROLE, eMultimedia);
+
IMFAttributes_GetUINT64(attributes, &MF_MEDIA_ENGINE_PLAYBACK_HWND, &playback_hwnd);
hr = IMFAttributes_GetUINT32(attributes, &MF_MEDIA_ENGINE_VIDEO_OUTPUT_FORMAT, &output_format);
if (playback_hwnd) /* FIXME: handle MF_MEDIA_ENGINE_PLAYBACK_VISUAL */
diff --git a/dlls/mfmediaengine/tests/mfmediaengine.c b/dlls/mfmediaengine/tests/mfmediaengine.c
index 3368484f58e..8584554a2b6 100644
--- a/dlls/mfmediaengine/tests/mfmediaengine.c
+++ b/dlls/mfmediaengine/tests/mfmediaengine.c
@@ -29,6 +29,8 @@
#include "mferror.h"
#include "dxgi.h"
#include "initguid.h"
+#include "mmdeviceapi.h"
+#include "audiosessiontypes.h"
#include "wine/heap.h"
#include "wine/test.h"
@@ -297,6 +299,7 @@ static void test_Shutdown(void)
IMFMediaTimeRange *time_range;
IMFMediaEngine *media_engine;
unsigned int state;
+ UINT32 value;
DWORD cx, cy;
double val;
HRESULT hr;
@@ -448,6 +451,18 @@ todo_wine
hr = IMFMediaEngineEx_SetSourceFromByteStream(media_engine_ex, NULL, NULL);
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
+ hr = IMFMediaEngineEx_GetAudioStreamCategory(media_engine_ex, &value);
+ ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
+
+ hr = IMFMediaEngineEx_GetAudioEndpointRole(media_engine_ex, &value);
+ ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
+
+ hr = IMFMediaEngineEx_SetAudioStreamCategory(media_engine_ex, AudioCategory_ForegroundOnlyMedia);
+ ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
+
+ hr = IMFMediaEngineEx_SetAudioEndpointRole(media_engine_ex, eConsole);
+ ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
+
IMFMediaEngineEx_Release(media_engine_ex);
}
@@ -800,6 +815,34 @@ static void test_SetSourceFromByteStream(void)
IMFMediaEngineNotify_Release(¬ify->IMFMediaEngineNotify_iface);
}
+static void test_audio_configuration(void)
+{
+ struct media_engine_notify *notify;
+ IMFMediaEngineEx *media_engine;
+ UINT32 value;
+ HRESULT hr;
+
+ notify = create_callback();
+
+ media_engine = create_media_engine_ex(¬ify->IMFMediaEngineNotify_iface);
+ if (!media_engine)
+ {
+ IMFMediaEngineNotify_Release(¬ify->IMFMediaEngineNotify_iface);
+ return;
+ }
+
+ hr = IMFMediaEngineEx_GetAudioStreamCategory(media_engine, &value);
+ ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(value == AudioCategory_Other, "Unexpected value %u.\n", value);
+
+ hr = IMFMediaEngineEx_GetAudioEndpointRole(media_engine, &value);
+ ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(value == eMultimedia, "Unexpected value %u.\n", value);
+
+ IMFMediaEngineEx_Release(media_engine);
+ IMFMediaEngineNotify_Release(¬ify->IMFMediaEngineNotify_iface);
+}
+
START_TEST(mfmediaengine)
{
HRESULT hr;
@@ -829,6 +872,7 @@ START_TEST(mfmediaengine)
test_error();
test_time_range();
test_SetSourceFromByteStream();
+ test_audio_configuration();
IMFMediaEngineClassFactory_Release(factory);
--
2.34.1
Jan. 27, 2022
[PATCH 1/2] mfmediaengine: Implement SetSourceFromByteStream().
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/mfmediaengine/main.c | 102 +++++++++++++++--------
dlls/mfmediaengine/tests/mfmediaengine.c | 47 +++++++++++
2 files changed, 114 insertions(+), 35 deletions(-)
diff --git a/dlls/mfmediaengine/main.c b/dlls/mfmediaengine/main.c
index 3fb8e2b9433..ae844c60e54 100644
--- a/dlls/mfmediaengine/main.c
+++ b/dlls/mfmediaengine/main.c
@@ -1202,10 +1202,10 @@ static void media_engine_start_playback(struct media_engine *engine)
static HRESULT WINAPI media_engine_load_handler_Invoke(IMFAsyncCallback *iface, IMFAsyncResult *result)
{
struct media_engine *engine = impl_from_load_handler_IMFAsyncCallback(iface);
+ IUnknown *object = NULL, *state;
unsigned int start_playback;
MF_OBJECT_TYPE obj_type;
IMFMediaSource *source;
- IUnknown *object = NULL;
HRESULT hr;
EnterCriticalSection(&engine->cs);
@@ -1216,7 +1216,15 @@ static HRESULT WINAPI media_engine_load_handler_Invoke(IMFAsyncCallback *iface,
start_playback = engine->flags & FLAGS_ENGINE_PLAY_PENDING;
media_engine_set_flag(engine, FLAGS_ENGINE_SOURCE_PENDING | FLAGS_ENGINE_PLAY_PENDING, FALSE);
- if (FAILED(hr = IMFSourceResolver_EndCreateObjectFromURL(engine->resolver, result, &obj_type, &object)))
+ if (SUCCEEDED(IMFAsyncResult_GetState(result, &state)))
+ {
+ hr = IMFSourceResolver_EndCreateObjectFromByteStream(engine->resolver, result, &obj_type, &object);
+ IUnknown_Release(state);
+ }
+ else
+ hr = IMFSourceResolver_EndCreateObjectFromURL(engine->resolver, result, &obj_type, &object);
+
+ if (FAILED(hr))
WARN("Failed to create source object, hr %#x.\n", hr);
if (object)
@@ -1384,50 +1392,60 @@ static HRESULT WINAPI media_engine_SetSourceElements(IMFMediaEngineEx *iface, IM
return E_NOTIMPL;
}
-static HRESULT WINAPI media_engine_SetSource(IMFMediaEngineEx *iface, BSTR url)
+static HRESULT media_engine_set_source(struct media_engine *engine, IMFByteStream *bytestream, BSTR url)
{
- struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
+ IPropertyStore *props = NULL;
+ unsigned int flags;
HRESULT hr = S_OK;
- TRACE("%p, %s.\n", iface, debugstr_w(url));
+ SysFreeString(engine->current_source);
+ engine->current_source = NULL;
+ if (url)
+ engine->current_source = SysAllocString(url);
- EnterCriticalSection(&engine->cs);
+ engine->ready_state = MF_MEDIA_ENGINE_READY_HAVE_NOTHING;
- if (engine->flags & FLAGS_ENGINE_SHUT_DOWN)
- hr = MF_E_SHUTDOWN;
- else
+ IMFMediaEngineNotify_EventNotify(engine->callback, MF_MEDIA_ENGINE_EVENT_PURGEQUEUEDEVENTS, 0, 0);
+
+ engine->network_state = MF_MEDIA_ENGINE_NETWORK_NO_SOURCE;
+
+ if (url || bytestream)
{
- SysFreeString(engine->current_source);
- engine->current_source = NULL;
- if (url)
- engine->current_source = SysAllocString(url);
+ flags = MF_RESOLUTION_MEDIASOURCE;
+ if (engine->flags & MF_MEDIA_ENGINE_DISABLE_LOCAL_PLUGINS)
+ flags |= MF_RESOLUTION_DISABLE_LOCAL_PLUGINS;
- engine->ready_state = MF_MEDIA_ENGINE_READY_HAVE_NOTHING;
+ IMFAttributes_GetUnknown(engine->attributes, &MF_MEDIA_ENGINE_SOURCE_RESOLVER_CONFIG_STORE,
+ &IID_IPropertyStore, (void **)&props);
+ if (bytestream)
+ hr = IMFSourceResolver_BeginCreateObjectFromByteStream(engine->resolver, bytestream, url, flags,
+ props, NULL, &engine->load_handler, (IUnknown *)bytestream);
+ else
+ hr = IMFSourceResolver_BeginCreateObjectFromURL(engine->resolver, url, flags, props, NULL,
+ &engine->load_handler, NULL);
+ if (SUCCEEDED(hr))
+ media_engine_set_flag(engine, FLAGS_ENGINE_SOURCE_PENDING, TRUE);
- IMFMediaEngineNotify_EventNotify(engine->callback, MF_MEDIA_ENGINE_EVENT_PURGEQUEUEDEVENTS, 0, 0);
+ if (props)
+ IPropertyStore_Release(props);
+ }
- engine->network_state = MF_MEDIA_ENGINE_NETWORK_NO_SOURCE;
+ return hr;
+}
- if (url)
- {
- IPropertyStore *props = NULL;
- unsigned int flags;
+static HRESULT WINAPI media_engine_SetSource(IMFMediaEngineEx *iface, BSTR url)
+{
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
+ HRESULT hr;
- flags = MF_RESOLUTION_MEDIASOURCE;
- if (engine->flags & MF_MEDIA_ENGINE_DISABLE_LOCAL_PLUGINS)
- flags |= MF_RESOLUTION_DISABLE_LOCAL_PLUGINS;
+ TRACE("%p, %s.\n", iface, debugstr_w(url));
- IMFAttributes_GetUnknown(engine->attributes, &MF_MEDIA_ENGINE_SOURCE_RESOLVER_CONFIG_STORE,
- &IID_IPropertyStore, (void **)&props);
- hr = IMFSourceResolver_BeginCreateObjectFromURL(engine->resolver, url, flags, props, NULL,
- &engine->load_handler, NULL);
- if (SUCCEEDED(hr))
- media_engine_set_flag(engine, FLAGS_ENGINE_SOURCE_PENDING, TRUE);
+ EnterCriticalSection(&engine->cs);
- if (props)
- IPropertyStore_Release(props);
- }
- }
+ if (engine->flags & FLAGS_ENGINE_SHUT_DOWN)
+ hr = MF_E_SHUTDOWN;
+ else
+ hr = media_engine_set_source(engine, NULL, url);
LeaveCriticalSection(&engine->cs);
@@ -2257,9 +2275,23 @@ static HRESULT WINAPI media_engine_OnVideoStreamTick(IMFMediaEngineEx *iface, LO
static HRESULT WINAPI media_engine_SetSourceFromByteStream(IMFMediaEngineEx *iface, IMFByteStream *bytestream, BSTR url)
{
- FIXME("%p, %p, %s stub.\n", iface, bytestream, debugstr_w(url));
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
+ HRESULT hr;
- return E_NOTIMPL;
+ TRACE("%p, %p, %s.\n", iface, bytestream, debugstr_w(url));
+
+ EnterCriticalSection(&engine->cs);
+
+ if (engine->flags & FLAGS_ENGINE_SHUT_DOWN)
+ hr = MF_E_SHUTDOWN;
+ else if (!bytestream || !url)
+ hr = E_POINTER;
+ else
+ hr = media_engine_set_source(engine, bytestream, url);
+
+ LeaveCriticalSection(&engine->cs);
+
+ return hr;
}
static HRESULT WINAPI media_engine_GetStatistics(IMFMediaEngineEx *iface, MF_MEDIA_ENGINE_STATISTIC stat_id, PROPVARIANT *stat)
diff --git a/dlls/mfmediaengine/tests/mfmediaengine.c b/dlls/mfmediaengine/tests/mfmediaengine.c
index 1f0a2eda1b3..3368484f58e 100644
--- a/dlls/mfmediaengine/tests/mfmediaengine.c
+++ b/dlls/mfmediaengine/tests/mfmediaengine.c
@@ -165,6 +165,20 @@ static IMFMediaEngine *create_media_engine(IMFMediaEngineNotify *callback)
return media_engine;
}
+static IMFMediaEngineEx *create_media_engine_ex(IMFMediaEngineNotify *callback)
+{
+ IMFMediaEngine *engine = create_media_engine(callback);
+ IMFMediaEngineEx *engine_ex = NULL;
+
+ if (engine)
+ {
+ IMFMediaEngine_QueryInterface(engine, &IID_IMFMediaEngineEx, (void **)&engine_ex);
+ IMFMediaEngine_Release(engine);
+ }
+
+ return engine_ex;
+}
+
static void test_factory(void)
{
IMFMediaEngineClassFactory *factory, *factory2;
@@ -279,6 +293,7 @@ static void test_CreateInstance(void)
static void test_Shutdown(void)
{
struct media_engine_notify *notify;
+ IMFMediaEngineEx *media_engine_ex;
IMFMediaTimeRange *time_range;
IMFMediaEngine *media_engine;
unsigned int state;
@@ -428,6 +443,14 @@ todo_wine
hr = IMFMediaEngine_GetVideoAspectRatio(media_engine, &cx, &cy);
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
+ if (SUCCEEDED(IMFMediaEngine_QueryInterface(media_engine, &IID_IMFMediaEngineEx, (void **)&media_engine_ex)))
+ {
+ hr = IMFMediaEngineEx_SetSourceFromByteStream(media_engine_ex, NULL, NULL);
+ ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
+
+ IMFMediaEngineEx_Release(media_engine_ex);
+ }
+
IMFMediaEngine_Release(media_engine);
IMFMediaEngineNotify_Release(¬ify->IMFMediaEngineNotify_iface);
}
@@ -754,6 +777,29 @@ todo_wine {
IMFMediaTimeRange_Release(range);
}
+static void test_SetSourceFromByteStream(void)
+{
+ struct media_engine_notify *notify;
+ IMFMediaEngineEx *media_engine;
+ HRESULT hr;
+
+ notify = create_callback();
+
+ media_engine = create_media_engine_ex(¬ify->IMFMediaEngineNotify_iface);
+ if (!media_engine)
+ {
+ win_skip("IMFMediaEngineEx is not supported.\n");
+ IMFMediaEngineNotify_Release(¬ify->IMFMediaEngineNotify_iface);
+ return;
+ }
+
+ hr = IMFMediaEngineEx_SetSourceFromByteStream(media_engine, NULL, NULL);
+ ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+
+ IMFMediaEngineEx_Release(media_engine);
+ IMFMediaEngineNotify_Release(¬ify->IMFMediaEngineNotify_iface);
+}
+
START_TEST(mfmediaengine)
{
HRESULT hr;
@@ -782,6 +828,7 @@ START_TEST(mfmediaengine)
test_mute();
test_error();
test_time_range();
+ test_SetSourceFromByteStream();
IMFMediaEngineClassFactory_Release(factory);
--
2.34.1
Jan. 27, 2022
Re: [PATCH v2 4/5] secur32: Switch back to non-blocking mode for DTLS sessions.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=106160
Your paranoid android.
=== w1064 (32 bit report) ===
secur32:
schannel.c:1442: Test failed: got 00090317
schannel.c:1452: Test failed: DecryptMessage failed: 80090317
=== w1064 (64 bit report) ===
secur32:
schannel.c:1442: Test failed: got 00090317
schannel.c:1452: Test failed: DecryptMessage failed: 80090317
Jan. 27, 2022
Re: [PATCH v2 3/5] secur32: Properly handle NULL pInput argument for DTLS contexts in schan_InitializeSecurityContextW.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=106159
Your paranoid android.
=== w1064 (32 bit report) ===
secur32:
schannel.c:1442: Test failed: got 00090317
schannel.c:1452: Test failed: DecryptMessage failed: 80090317
=== w1064 (64 bit report) ===
secur32:
schannel.c:1442: Test failed: got 00090317
schannel.c:1452: Test failed: DecryptMessage failed: 80090317
Jan. 27, 2022
Re: [PATCH v2 2/5] secur32: Clear SECBUFFER_ALERT output buffer count in schan_InitializeSecurityContextW.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=106158
Your paranoid android.
=== w1064 (32 bit report) ===
secur32:
schannel.c:1442: Test failed: got 00090317
schannel.c:1452: Test failed: DecryptMessage failed: 80090317
=== w1064 (64 bit report) ===
secur32:
schannel.c:1442: Test failed: got 00090317
schannel.c:1452: Test failed: DecryptMessage failed: 80090317
Jan. 27, 2022
Re: [PATCH] winevulkan: Enable VK_EXT_pipeline_creation_feedback.
by Henri Verbeet
On Wed, 26 Jan 2022 at 18:02, Georg Lehmann <dadschoorse(a)gmail.com> wrote:
> On 26.01.22 17:37, Henri Verbeet wrote:
> > On Wed, 26 Jan 2022 at 17:35, Georg Lehmann <dadschoorse(a)gmail.com> wrote:
> >>
> >> We did previously not support this extension because it runs into 32bit
> >> alignment issues. But it is core in 1.3, so we already enabled the
> >> functionality. Additionally vkd3d-proton wants to use the extension and it
> >> does not care about 32bit.
> >>
> > Shouldn't that have blocked 1.3 support instead?
>
> Maybe. 32bit winevulkan has a ton of small issues, only exposing a
> non-broken subset is not really possible. E.g.
> VkPhysicalDeviceVulkan11Properties is also broken due to alignment and
> we don't ignore invalid pointers in a lot of situations where we should.
> We would not even be conformant for 1.0 without any extensions.
>
But these issues aren't inherently unfixable or hard to fix, right?
> I think the best policy is to make everything work that is actually
> needed, there aren't a ton of 32bit Vulkan applications. It's mostly
> dxvk and possibly wined3d in the future as far as I understand.
>
It's true that there aren't a lot of 32-bit Vulkan applications, but
there certainly are a few. Current wined3d will indeed largely use the
host Vulkan implementation directly, but that wouldn't be true for PE
builds.
Jan. 27, 2022
Re: Arbitrary DOS device name
by Daniel Kucera
On 2022-01-27 08:32, Stefan Dösinger wrote:
>> Am 27.01.2022 um 01:36 schrieb Daniel Kucera <wine(a)danman.eu>:
>>
>> How do I load it in wine now?
>
> Have a look at how mountmgr.sys is loaded. Tiere is a service in
> HKLM\System\CurrentControlSet\Services\MountMgr
>
> Regarding potentially loading the original driver: Do you have a
> Windows installation with the driver installed? Look at where it is
> installed in the registry, maybe Wine has the necessary infrastructure
> to load it if you add it manually. Though all that is not exactly my
> area of expertise :-/
I have copied the original driver to C: and installed like this:
wine sc create DSO6CDE binPath= C:\\Hantek6000BAMD64.Sys type= kernel
This have resulted in ~ the same registry contents of
HKLM\System\CurrentControlSet\Services\DSO6CDE as on my Windows
installation but the driver doesn't work unfortunately.
For future reference, to install my driver I had to:
- build it (make)
- cp hantek.sys.so /usr/lib/x86_64-linux-gnu/wine/
- cp hantek.sys.fake ~/.wine/drive_c/windows/system32/drivers/hantek.sys
- wine sc create Hantek binPath=
C:\\windows\\system32\\drivers\\hantek.sys type= kernel start= auto
Now when I run the app, I can see trace from the driver:
$ WINEDEBUG=trace+hantek wine Scope.exe
002b:trace:hantek:DriverEntry (000000000011FCA0,
L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Hantek")
hantek
002b:trace:hantek:DriverEntry created device hantek
Now just the implementation... :)
Thank you for your help.
Jan. 27, 2022
Re: [PATCH 1/3] wined3d: Handle discarded buffers in buffer_resource_sub_resource_map().
by Henri Verbeet
On Wed, 26 Jan 2022 at 17:17, Zebediah Figura (she/her)
<zfigura(a)codeweavers.com> wrote:
>
> On 1/26/22 07:47, Henri Verbeet wrote:
> > On Tue, 25 Jan 2022 at 03:21, Zebediah Figura <zfigura(a)codeweavers.com> wrote:
> >> @@ -927,10 +928,13 @@ static HRESULT buffer_resource_sub_resource_map(struct wined3d_resource *resourc
> >>
> >> count = ++resource->map_count;
> >>
> >> - if (buffer->buffer_object)
> >> + context = context_acquire(device, NULL, 0);
> >> +
> >> + wined3d_buffer_get_memory(buffer, context, &addr);
> >> +
> >> + if (addr.buffer_object)
> >> {
> > I think that potentially changes the location we map in some cases.
> > (In particular, when buffer->buffer_object is non-NULL, but
> > WINED3D_LOCATION_BUFFER is not current.) I don't know for sure whether
> > that would cause issues for applications, but this code is sensitive
> > enough that I'd prefer avoiding wined3d_buffer_get_memory() here
> > unless we have a good reason not to.
>
> I guess I see the point here—if we are using a BO in the first place, we
> probably want to actually use the BO instead of reusing sysmem.
>
> Note though that this doesn't seem to preclude
> wined3d_buffer_get_memory(); it just means we want to keep the check for
> buffer->buffer_object instead of addr.buffer_object.
>
I suppose, but I'm not sure there's much of a point in that case.
Conceptually, wined3d_buffer_get_memory() is for cases where we don't
particularly care which location is current.
> > What is the issue exactly? Is it that buffer->buffer_object may not
> > have been created yet for discarded resources?
>
> More generally, no location may yet have been prepared. In particular
> after patch 3/3 no location will be prepared on creation.
It probably makes sense to check for WINED3D_BUFFER_USE_BO instead of
buffer->buffer_object then, and add wined3d_buffer_prepare_location()
calls to paths that don't already call wined3d_buffer_load_location().
Jan. 27, 2022