winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
April 2021
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
865 discussions
Start a n
N
ew thread
Francois Gouget : windows.globalization/tests: Load GetUserDefaultGeoName() dynamically.
by Alexandre Julliard
21 Apr '21
21 Apr '21
Module: wine Branch: master Commit: 0e0f3ef87281b7f26ca0de88a9934f5a68587c4e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0e0f3ef87281b7f26ca0de88…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Wed Apr 21 20:24:48 2021 +0200 windows.globalization/tests: Load GetUserDefaultGeoName() dynamically. Many windows versions before Windows 10 1709 have windows.globalization.dll but not GetUserDefaultGeoName(). Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windows.globalization/tests/globalization.c | 25 ++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/dlls/windows.globalization/tests/globalization.c b/dlls/windows.globalization/tests/globalization.c index aa51b8b83f9..7746e93dc1a 100644 --- a/dlls/windows.globalization/tests/globalization.c +++ b/dlls/windows.globalization/tests/globalization.c @@ -34,6 +34,11 @@ #include "wine/test.h" + +/* kernel32.dll */ +static INT (WINAPI *pGetUserDefaultGeoName)(LPWSTR, int); + +/* combase.dll */ static HRESULT (WINAPI *pRoGetActivationFactory)(HSTRING, REFIID, void **); static HRESULT (WINAPI *pRoInitialize)(RO_INIT_TYPE); static void (WINAPI *pRoUninitialize)(void); @@ -41,6 +46,7 @@ static HRESULT (WINAPI *pWindowsCreateString)(LPCWSTR, UINT32, HSTRING *); static HRESULT (WINAPI *pWindowsDeleteString)(HSTRING); static WCHAR *(WINAPI *pWindowsGetStringRawBuffer)(HSTRING, UINT32 *); + static void test_GlobalizationPreferences(void) { static const WCHAR *class_name = L"Windows.System.UserProfile.GlobalizationPreferences"; @@ -54,11 +60,10 @@ static void test_GlobalizationPreferences(void) BOOLEAN found; HRESULT hr; UINT32 len; - WCHAR *buf, locale[LOCALE_NAME_MAX_LENGTH], country[16]; + WCHAR *buf, locale[LOCALE_NAME_MAX_LENGTH]; UINT32 i, size; GetUserDefaultLocaleName(locale, LOCALE_NAME_MAX_LENGTH); - GetUserDefaultGeoName(country, 16); hr = pRoInitialize(RO_INIT_MULTITHREADED); ok(hr == S_OK, "RoInitialize failed, hr %#x\n", hr); @@ -100,9 +105,14 @@ static void test_GlobalizationPreferences(void) buf = pWindowsGetStringRawBuffer(tmp_str, &len); ok(buf != NULL && len > 0, "WindowsGetStringRawBuffer returned buf %p, len %u\n", buf, len); - ok(wcslen(country) == len && !memcmp(buf, country, len), - "IGlobalizationPreferencesStatics_get_HomeGeographicRegion returned len %u, str %s, expected %s\n", - len, wine_dbgstr_w(buf), wine_dbgstr_w(country)); + if (pGetUserDefaultGeoName) + { + WCHAR country[16]; + pGetUserDefaultGeoName(country, ARRAY_SIZE(country)); + ok(wcslen(country) == len && !memcmp(buf, country, len), + "IGlobalizationPreferencesStatics_get_HomeGeographicRegion returned len %u, str %s, expected %s\n", + len, wine_dbgstr_w(buf), wine_dbgstr_w(country)); + } pWindowsDeleteString(tmp_str); @@ -224,7 +234,7 @@ static void test_GlobalizationPreferences(void) START_TEST(globalization) { - HMODULE combase; + HMODULE combase, kernel32; if (!(combase = LoadLibraryW(L"combase.dll"))) { @@ -247,5 +257,8 @@ START_TEST(globalization) LOAD_FUNCPTR(WindowsGetStringRawBuffer); #undef LOAD_FUNCPTR + kernel32 = GetModuleHandleA("kernel32"); + pGetUserDefaultGeoName = (void*)GetProcAddress(kernel32, "GetUserDefaultGeoName"); + test_GlobalizationPreferences(); }
1
0
0
0
Francois Gouget : windows.globalization/tests: PRoActivateInstance() is unused. Remove it.
by Alexandre Julliard
21 Apr '21
21 Apr '21
Module: wine Branch: master Commit: 34d37ad6e51f1b2fff29e97811caeeef6f36ce88 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=34d37ad6e51f1b2fff29e978…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Wed Apr 21 20:24:39 2021 +0200 windows.globalization/tests: PRoActivateInstance() is unused. Remove it. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windows.globalization/tests/globalization.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/dlls/windows.globalization/tests/globalization.c b/dlls/windows.globalization/tests/globalization.c index b824cfdf8ae..aa51b8b83f9 100644 --- a/dlls/windows.globalization/tests/globalization.c +++ b/dlls/windows.globalization/tests/globalization.c @@ -34,7 +34,6 @@ #include "wine/test.h" -static HRESULT (WINAPI *pRoActivateInstance)(HSTRING, IInspectable **); static HRESULT (WINAPI *pRoGetActivationFactory)(HSTRING, REFIID, void **); static HRESULT (WINAPI *pRoInitialize)(RO_INIT_TYPE); static void (WINAPI *pRoUninitialize)(void); @@ -240,7 +239,6 @@ START_TEST(globalization) return; \ } - LOAD_FUNCPTR(RoActivateInstance); LOAD_FUNCPTR(RoGetActivationFactory); LOAD_FUNCPTR(RoInitialize); LOAD_FUNCPTR(RoUninitialize);
1
0
0
0
Francois Gouget : ws2_32/tests: Load GetHostNameW() dynamically.
by Alexandre Julliard
21 Apr '21
21 Apr '21
Module: wine Branch: master Commit: 6ccd501503770d00d327fd0a292b05ec9bf1a640 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6ccd501503770d00d327fd0a…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Wed Apr 21 20:15:52 2021 +0200 ws2_32/tests: Load GetHostNameW() dynamically. It is not available on Windows 7 and lower. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ws2_32/tests/sock.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 5a1a271b099..61af5b0183a 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -71,6 +71,7 @@ static int (WINAPI *pGetAddrInfoExW)(const WCHAR *name, const WCHAR *servname, struct timeval *timeout, OVERLAPPED *overlapped, LPLOOKUPSERVICE_COMPLETION_ROUTINE completion_routine, HANDLE *handle); static int (WINAPI *pGetAddrInfoExOverlappedResult)(OVERLAPPED *overlapped); +static int (WINAPI *pGetHostNameW)(WCHAR *, int); static PCSTR (WINAPI *pInetNtop)(INT,LPVOID,LPSTR,ULONG); static PCWSTR(WINAPI *pInetNtopW)(INT,LPVOID,LPWSTR,ULONG); static int (WINAPI *pInetPtonA)(INT,LPCSTR,LPVOID); @@ -1203,6 +1204,7 @@ static void Init (void) pFreeAddrInfoExW = (void *)GetProcAddress(hws2_32, "FreeAddrInfoExW"); pGetAddrInfoExW = (void *)GetProcAddress(hws2_32, "GetAddrInfoExW"); pGetAddrInfoExOverlappedResult = (void *)GetProcAddress(hws2_32, "GetAddrInfoExOverlappedResult"); + pGetHostNameW = (void *)GetProcAddress(hws2_32, "GetHostNameW"); pInetNtop = (void *)GetProcAddress(hws2_32, "inet_ntop"); pInetNtopW = (void *)GetProcAddress(hws2_32, "InetNtopW"); pInetPtonA = (void *)GetProcAddress(hws2_32, "inet_pton"); @@ -4328,26 +4330,31 @@ static void test_GetHostNameW(void) WCHAR name[256]; int ret, len; + if (!pGetHostNameW) + { + win_skip("GetHostNameW() not present\n"); + return; + } WSASetLastError(0xdeadbeef); - ret = GetHostNameW(NULL, 256); + ret = pGetHostNameW(NULL, 256); ok(ret == -1, "GetHostNameW() returned %d\n", ret); ok(WSAGetLastError() == WSAEFAULT, "GetHostNameW with null buffer " "failed with %d, expected %d\n", WSAGetLastError(), WSAEFAULT); - ret = GetHostNameW(name, sizeof(name)); + ret = pGetHostNameW(name, sizeof(name)); ok(ret == 0, "GetHostNameW() call failed: %d\n", WSAGetLastError()); len = wcslen(name); WSASetLastError(0xdeadbeef); wcscpy(name, L"deadbeef"); - ret = GetHostNameW(name, len); + ret = pGetHostNameW(name, len); ok(ret == -1, "GetHostNameW() returned %d\n", ret); ok(!wcscmp(name, L"deadbeef"), "name changed unexpected!\n"); ok(WSAGetLastError() == WSAEFAULT, "GetHostNameW with insufficient length " "failed with %d, expected %d\n", WSAGetLastError(), WSAEFAULT); len++; - ret = GetHostNameW(name, len); + ret = pGetHostNameW(name, len); ok(ret == 0, "GetHostNameW() call failed: %d\n", WSAGetLastError()); }
1
0
0
0
Gijs Vermeulen : ntdll: Don't fail when trying to remove the value of a non-existant variable in RtlSetEnvironmentVariable().
by Alexandre Julliard
21 Apr '21
21 Apr '21
Module: wine Branch: master Commit: 2f2cdc8bb147f62ade1c5a2f1ae4c7b2863e6b08 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2f2cdc8bb147f62ade1c5a2f…
Author: Gijs Vermeulen <gijsvrm(a)gmail.com> Date: Wed Apr 21 20:21:36 2021 +0200 ntdll: Don't fail when trying to remove the value of a non-existant variable in RtlSetEnvironmentVariable(). Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=51035
Signed-off-by: Gijs Vermeulen <gijsvrm(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/env.c | 3 +-- dlls/ntdll/tests/env.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/env.c b/dlls/ntdll/env.c index 1ed52b9728f..c11960db165 100644 --- a/dlls/ntdll/env.c +++ b/dlls/ntdll/env.c @@ -276,7 +276,7 @@ NTSTATUS WINAPI RtlSetEnvironmentVariable(PWSTR* penv, PUNICODE_STRING name, { INT varlen, len, old_size; LPWSTR p, env; - NTSTATUS nts = STATUS_VARIABLE_NOT_FOUND; + NTSTATUS nts = STATUS_SUCCESS; TRACE("(%p, %s, %s)\n", penv, debugstr_us(name), debugstr_us(value)); @@ -352,7 +352,6 @@ NTSTATUS WINAPI RtlSetEnvironmentVariable(PWSTR* penv, PUNICODE_STRING name, memcpy( p, value->Buffer, value->Length ); p[value->Length / sizeof(WCHAR)] = 0; } - nts = STATUS_SUCCESS; done: if (!penv) RtlReleasePebLock(); diff --git a/dlls/ntdll/tests/env.c b/dlls/ntdll/tests/env.c index eed8ae38c14..da61d11c1f2 100644 --- a/dlls/ntdll/tests/env.c +++ b/dlls/ntdll/tests/env.c @@ -621,7 +621,7 @@ static void test_RtlSetEnvironmentVariable(void) query_env_var(env, L"cat", NULL); status = set_env_var(&env, L"cat", NULL); - todo_wine ok(!status, "got %#x\n", status); + ok(!status, "got %#x\n", status); status = set_env_var(&env, L"foo", L"meouw"); ok(!status, "got %#x\n", status); @@ -632,7 +632,7 @@ static void test_RtlSetEnvironmentVariable(void) query_env_var(env, L"foo", NULL); status = set_env_var(&env, L"horse", NULL); - todo_wine ok(!status, "got %#x\n", status); + ok(!status, "got %#x\n", status); query_env_var(env, L"horse", NULL); status = set_env_var(&env, L"me=too", L"also");
1
0
0
0
Gijs Vermeulen : ntdll/tests: Refactor RtlSetEnvironmentVariable() tests.
by Alexandre Julliard
21 Apr '21
21 Apr '21
Module: wine Branch: master Commit: 09879590cb0abf899475e5bdad1aa715f8930f7a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=09879590cb0abf899475e5bd…
Author: Gijs Vermeulen <gijsvrm(a)gmail.com> Date: Wed Apr 21 20:21:35 2021 +0200 ntdll/tests: Refactor RtlSetEnvironmentVariable() tests. Signed-off-by: Gijs Vermeulen <gijsvrm(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/env.c | 169 +++++++++++++++++++++++-------------------------- 1 file changed, 80 insertions(+), 89 deletions(-) diff --git a/dlls/ntdll/tests/env.c b/dlls/ntdll/tests/env.c index 63a9a0e463c..eed8ae38c14 100644 --- a/dlls/ntdll/tests/env.c +++ b/dlls/ntdll/tests/env.c @@ -24,12 +24,8 @@ static NTSTATUS (WINAPI *pRtlMultiByteToUnicodeN)( LPWSTR dst, DWORD dstlen, LPDWORD reslen, LPCSTR src, DWORD srclen ); -static NTSTATUS (WINAPI *pRtlCreateEnvironment)(BOOLEAN, PWSTR*); -static NTSTATUS (WINAPI *pRtlDestroyEnvironment)(PWSTR); static NTSTATUS (WINAPI *pRtlQueryEnvironmentVariable_U)(PWSTR, PUNICODE_STRING, PUNICODE_STRING); static NTSTATUS (WINAPI* pRtlQueryEnvironmentVariable)(WCHAR*, WCHAR*, SIZE_T, WCHAR*, SIZE_T, SIZE_T*); -static void (WINAPI *pRtlSetCurrentEnvironment)(PWSTR, PWSTR*); -static NTSTATUS (WINAPI *pRtlSetEnvironmentVariable)(PWSTR*, PUNICODE_STRING, PUNICODE_STRING); static NTSTATUS (WINAPI *pRtlExpandEnvironmentStrings_U)(LPWSTR, PUNICODE_STRING, PUNICODE_STRING, PULONG); static NTSTATUS (WINAPI *pRtlCreateProcessParameters)(RTL_USER_PROCESS_PARAMETERS**, const UNICODE_STRING*, const UNICODE_STRING*, @@ -169,84 +165,6 @@ static void testQuery(void) else win_skip("RtlQueryEnvironmentVariable not available, skipping tests\n"); } -static void testSetHelper(LPWSTR* env, const char* var, const char* val, NTSTATUS ret, NTSTATUS alt) -{ - WCHAR bvar[256], bval1[256], bval2[256]; - UNICODE_STRING uvar; - UNICODE_STRING uval; - NTSTATUS nts; - - uvar.Length = strlen(var) * sizeof(WCHAR); - uvar.MaximumLength = uvar.Length + sizeof(WCHAR); - uvar.Buffer = bvar; - pRtlMultiByteToUnicodeN( bvar, sizeof(bvar), NULL, var, strlen(var)+1 ); - if (val) - { - uval.Length = strlen(val) * sizeof(WCHAR); - uval.MaximumLength = uval.Length + sizeof(WCHAR); - uval.Buffer = bval1; - pRtlMultiByteToUnicodeN( bval1, sizeof(bval1), NULL, val, strlen(val)+1 ); - } - nts = pRtlSetEnvironmentVariable(env, &uvar, val ? &uval : NULL); - ok(nts == ret || (alt && nts == alt), "Setting var %s=%s (%x/%x)\n", var, val, nts, ret); - if (nts == STATUS_SUCCESS) - { - uval.Length = 0; - uval.MaximumLength = sizeof(bval2); - uval.Buffer = bval2; - nts = pRtlQueryEnvironmentVariable_U(*env, &uvar, &uval); - switch (nts) - { - case STATUS_SUCCESS: - ok(lstrcmpW(bval1, bval2) == 0, "Cannot get value written to environment\n"); - break; - case STATUS_VARIABLE_NOT_FOUND: - ok(val == NULL || - broken(strchr(var,'=') != NULL), /* variable containing '=' may be set but not found again on NT4 */ - "Couldn't find variable, but didn't delete it. val = %s\n", val); - break; - default: - ok(0, "Wrong ret %u for %s\n", nts, var); - break; - } - } -} - -static void testSet(void) -{ - LPWSTR env; - char tmp[16]; - int i; - - ok(pRtlCreateEnvironment(FALSE, &env) == STATUS_SUCCESS, "Creating environment\n"); - - testSetHelper(&env, "cat", "dog", STATUS_SUCCESS, 0); - testSetHelper(&env, "cat", "horse", STATUS_SUCCESS, 0); - testSetHelper(&env, "cat", "zz", STATUS_SUCCESS, 0); - testSetHelper(&env, "cat", NULL, STATUS_SUCCESS, 0); - testSetHelper(&env, "cat", NULL, STATUS_SUCCESS, STATUS_VARIABLE_NOT_FOUND); - testSetHelper(&env, "foo", "meouw", STATUS_SUCCESS, 0); - testSetHelper(&env, "me=too", "also", STATUS_SUCCESS, STATUS_INVALID_PARAMETER); - testSetHelper(&env, "me", "too=also", STATUS_SUCCESS, 0); - testSetHelper(&env, "=too", "also", STATUS_SUCCESS, 0); - testSetHelper(&env, "=", "also", STATUS_SUCCESS, 0); - - for (i = 0; i < 128; i++) - { - sprintf(tmp, "zork%03d", i); - testSetHelper(&env, tmp, "is alive", STATUS_SUCCESS, 0); - } - - for (i = 0; i < 128; i++) - { - sprintf(tmp, "zork%03d", i); - testSetHelper(&env, tmp, NULL, STATUS_SUCCESS, 0); - } - testSetHelper(&env, "fOo", NULL, STATUS_SUCCESS, 0); - - ok(pRtlDestroyEnvironment(env) == STATUS_SUCCESS, "Destroying environment\n"); -} - static void testExpand(void) { static const struct test @@ -565,8 +483,8 @@ static NTSTATUS set_env_var(WCHAR **env, const WCHAR *var, const WCHAR *value) { UNICODE_STRING var_string, value_string; RtlInitUnicodeString(&var_string, var); - RtlInitUnicodeString(&value_string, value); - return RtlSetEnvironmentVariable(env, &var_string, &value_string); + if (value) RtlInitUnicodeString(&value_string, value); + return RtlSetEnvironmentVariable(env, &var_string, value ? &value_string : NULL); } static void check_env_var_(int line, const char *var, const char *value) @@ -659,6 +577,83 @@ static void test_RtlSetCurrentEnvironment(void) ok( size > get_env_length(env) * sizeof(WCHAR), "got wrong size %lu\n", size ); } +static void query_env_var_(int line, WCHAR *env, const WCHAR *var, const WCHAR *value) +{ + UNICODE_STRING var_string, value_string; + WCHAR value_buffer[9]; + NTSTATUS status; + + RtlInitUnicodeString(&var_string, var); + value_string.Buffer = value_buffer; + value_string.MaximumLength = sizeof(value_buffer); + + status = RtlQueryEnvironmentVariable_U(env, &var_string, &value_string); + if (value) + { + ok_(__FILE__, line)(!status, "got %#x\n", status); + ok_(__FILE__, line)(value_string.Length/sizeof(WCHAR) == wcslen(value), + "wrong size %u\n", value_string.Length/sizeof(WCHAR)); + ok_(__FILE__, line)(!wcscmp(value_string.Buffer, value), "wrong value %s\n", debugstr_w(value_string.Buffer)); + } + else + ok_(__FILE__, line)(status == STATUS_VARIABLE_NOT_FOUND, "got %#x\n", status); +} +#define query_env_var(a, b, c) query_env_var_(__LINE__, a, b, c) + +static void test_RtlSetEnvironmentVariable(void) +{ + NTSTATUS status; + WCHAR *env; + + status = RtlCreateEnvironment(FALSE, &env); + ok(!status, "got %#x\n", status); + + status = set_env_var(&env, L"cat", L"dog"); + ok(!status, "got %#x\n", status); + query_env_var(env, L"cat", L"dog"); + + status = set_env_var(&env, L"cat", L"horse"); + ok(!status, "got %#x\n", status); + query_env_var(env, L"cat", L"horse"); + + status = set_env_var(&env, L"cat", NULL); + ok(!status, "got %#x\n", status); + query_env_var(env, L"cat", NULL); + + status = set_env_var(&env, L"cat", NULL); + todo_wine ok(!status, "got %#x\n", status); + + status = set_env_var(&env, L"foo", L"meouw"); + ok(!status, "got %#x\n", status); + query_env_var(env, L"foo", L"meouw"); + + status = set_env_var(&env, L"fOo", NULL); + ok(!status, "got %#x\n", status); + query_env_var(env, L"foo", NULL); + + status = set_env_var(&env, L"horse", NULL); + todo_wine ok(!status, "got %#x\n", status); + query_env_var(env, L"horse", NULL); + + status = set_env_var(&env, L"me=too", L"also"); + ok(status == STATUS_INVALID_PARAMETER, "got %#x\n", status); + + status = set_env_var(&env, L"me", L"too=also"); + ok(!status, "got %#x\n", status); + query_env_var(env, L"me", L"too=also"); + + status = set_env_var(&env, L"=too", L"also"); + ok(!status, "got %#x\n", status); + query_env_var(env, L"=too", L"also"); + + status = set_env_var(&env, L"=", L"also"); + ok(!status, "got %#x\n", status); + query_env_var(env, L"=", L"also"); + + status = RtlDestroyEnvironment(env); + ok(!status, "got %#x\n", status); +} + START_TEST(env) { HMODULE mod = GetModuleHandleA("ntdll.dll"); @@ -666,19 +661,15 @@ START_TEST(env) initial_env = NtCurrentTeb()->Peb->ProcessParameters->Environment; pRtlMultiByteToUnicodeN = (void *)GetProcAddress(mod,"RtlMultiByteToUnicodeN"); - pRtlCreateEnvironment = (void*)GetProcAddress(mod, "RtlCreateEnvironment"); - pRtlDestroyEnvironment = (void*)GetProcAddress(mod, "RtlDestroyEnvironment"); pRtlQueryEnvironmentVariable_U = (void*)GetProcAddress(mod, "RtlQueryEnvironmentVariable_U"); pRtlQueryEnvironmentVariable = (void*)GetProcAddress(mod, "RtlQueryEnvironmentVariable"); - pRtlSetCurrentEnvironment = (void*)GetProcAddress(mod, "RtlSetCurrentEnvironment"); - pRtlSetEnvironmentVariable = (void*)GetProcAddress(mod, "RtlSetEnvironmentVariable"); pRtlExpandEnvironmentStrings_U = (void*)GetProcAddress(mod, "RtlExpandEnvironmentStrings_U"); pRtlCreateProcessParameters = (void*)GetProcAddress(mod, "RtlCreateProcessParameters"); pRtlDestroyProcessParameters = (void*)GetProcAddress(mod, "RtlDestroyProcessParameters"); testQuery(); - testSet(); testExpand(); test_process_params(); test_RtlSetCurrentEnvironment(); + test_RtlSetEnvironmentVariable(); }
1
0
0
0
Zebediah Figura : wined3d: Pass a wined3d_device_context to wined3d_device_get_primitive_type().
by Alexandre Julliard
21 Apr '21
21 Apr '21
Module: wine Branch: master Commit: 5cd23ae872fc407d3edd2d2c08b97f32628d880a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5cd23ae872fc407d3edd2d2c…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Apr 20 19:53:57 2021 -0500 wined3d: Pass a wined3d_device_context to wined3d_device_get_primitive_type(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/device.c | 7 ++++--- dlls/wined3d/device.c | 8 ++++---- dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index c2d2ccd0259..ee6ecd2c29c 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1900,14 +1900,14 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_GSGetShader(ID3D11DeviceCo static void STDMETHODCALLTYPE d3d11_immediate_context_IAGetPrimitiveTopology(ID3D11DeviceContext1 *iface, D3D11_PRIMITIVE_TOPOLOGY *topology) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); enum wined3d_primitive_type primitive_type; unsigned int patch_vertex_count; TRACE("iface %p, topology %p.\n", iface, topology); wined3d_mutex_lock(); - wined3d_device_get_primitive_type(device->wined3d_device, &primitive_type, &patch_vertex_count); + wined3d_device_context_get_primitive_type(context->wined3d_context, &primitive_type, &patch_vertex_count); wined3d_mutex_unlock(); d3d11_primitive_topology_from_wined3d_primitive_type(primitive_type, patch_vertex_count, topology); @@ -5259,7 +5259,8 @@ static void STDMETHODCALLTYPE d3d10_device_IAGetPrimitiveTopology(ID3D10Device1 TRACE("iface %p, topology %p.\n", iface, topology); wined3d_mutex_lock(); - wined3d_device_get_primitive_type(device->wined3d_device, (enum wined3d_primitive_type *)topology, NULL); + wined3d_device_context_get_primitive_type(device->immediate_context.wined3d_context, + (enum wined3d_primitive_type *)topology, NULL); wined3d_mutex_unlock(); } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 623f969d690..bf4c37756a7 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4500,13 +4500,13 @@ void CDECL wined3d_device_context_set_primitive_type(struct wined3d_device_conte state->patch_vertex_count = patch_vertex_count; } -void CDECL wined3d_device_get_primitive_type(const struct wined3d_device *device, +void CDECL wined3d_device_context_get_primitive_type(const struct wined3d_device_context *context, enum wined3d_primitive_type *primitive_type, unsigned int *patch_vertex_count) { - const struct wined3d_state *state = device->cs->c.state; + const struct wined3d_state *state = context->state; - TRACE("device %p, primitive_type %p, patch_vertex_count %p.\n", - device, primitive_type, patch_vertex_count); + TRACE("context %p, primitive_type %p, patch_vertex_count %p.\n", + context, primitive_type, patch_vertex_count); *primitive_type = state->primitive_type; if (patch_vertex_count) diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 54f93e87679..203ffd67b89 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -77,7 +77,6 @@ @ cdecl wined3d_device_get_max_frame_latency(ptr) @ cdecl wined3d_device_get_npatch_mode(ptr) @ cdecl wined3d_device_get_pixel_shader(ptr) -@ cdecl wined3d_device_get_primitive_type(ptr ptr ptr) @ cdecl wined3d_device_get_ps_resource_view(ptr long) @ cdecl wined3d_device_get_ps_sampler(ptr long) @ cdecl wined3d_device_get_raster_status(ptr long ptr) @@ -163,6 +162,7 @@ @ cdecl wined3d_device_context_get_depth_stencil_view(ptr) @ cdecl wined3d_device_context_get_index_buffer(ptr ptr ptr) @ cdecl wined3d_device_context_get_predication(ptr ptr) +@ cdecl wined3d_device_context_get_primitive_type(ptr ptr ptr) @ cdecl wined3d_device_context_get_rasterizer_state(ptr) @ cdecl wined3d_device_context_get_rendertarget_view(ptr long) @ cdecl wined3d_device_context_get_sampler(ptr long long) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 3e31de44711..de96ff0601b 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2408,8 +2408,6 @@ struct wined3d_device_context * __cdecl wined3d_device_get_immediate_context(str unsigned int __cdecl wined3d_device_get_max_frame_latency(const struct wined3d_device *device); float __cdecl wined3d_device_get_npatch_mode(const struct wined3d_device *device); struct wined3d_shader * __cdecl wined3d_device_get_pixel_shader(const struct wined3d_device *device); -void __cdecl wined3d_device_get_primitive_type(const struct wined3d_device *device, - enum wined3d_primitive_type *primitive_topology, unsigned int *patch_vertex_count); struct wined3d_shader_resource_view * __cdecl wined3d_device_get_ps_resource_view(const struct wined3d_device *device, UINT idx); struct wined3d_sampler * __cdecl wined3d_device_get_ps_sampler(const struct wined3d_device *device, UINT idx); @@ -2555,6 +2553,8 @@ struct wined3d_buffer * __cdecl wined3d_device_context_get_index_buffer(const st enum wined3d_format_id *format, unsigned int *offset); struct wined3d_query * __cdecl wined3d_device_context_get_predication(struct wined3d_device_context *context, BOOL *value); +void __cdecl wined3d_device_context_get_primitive_type(const struct wined3d_device_context *context, + enum wined3d_primitive_type *primitive_topology, unsigned int *patch_vertex_count); struct wined3d_rasterizer_state * __cdecl wined3d_device_context_get_rasterizer_state( struct wined3d_device_context *context); struct wined3d_rendertarget_view * __cdecl wined3d_device_context_get_rendertarget_view(
1
0
0
0
Zebediah Figura : wined3d: Pass a wined3d_device_context to wined3d_device_set_primitive_type().
by Alexandre Julliard
21 Apr '21
21 Apr '21
Module: wine Branch: master Commit: ea5041c68a72acd59b5ad740114c267c55a5de28 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ea5041c68a72acd59b5ad740…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Apr 20 19:53:56 2021 -0500 wined3d: Pass a wined3d_device_context to wined3d_device_set_primitive_type(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/device.c | 10 +++++----- dlls/d3d8/device.c | 12 ++++++++---- dlls/d3d9/device.c | 12 ++++++++---- dlls/ddraw/device.c | 18 ++++++++++++------ dlls/ddraw/executebuffer.c | 6 +++--- dlls/wined3d/device.c | 8 ++++---- dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 4 ++-- 8 files changed, 43 insertions(+), 29 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=ea5041c68a72acd59b5a…
1
0
0
0
Zebediah Figura : wined3d: Pass a wined3d_device_context to wined3d_device_get_stream_output().
by Alexandre Julliard
21 Apr '21
21 Apr '21
Module: wine Branch: master Commit: bba5923bbea92e637bf89b19e3e0a92231609f36 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bba5923bbea92e637bf89b19…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Apr 20 19:53:55 2021 -0500 wined3d: Pass a wined3d_device_context to wined3d_device_get_stream_output(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/device.c | 7 ++++--- dlls/wined3d/device.c | 10 +++++----- dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 4 ++-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 2b923d65d23..f1361f306ff 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -2190,7 +2190,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMGetDepthStencilState(ID3 static void STDMETHODCALLTYPE d3d11_immediate_context_SOGetTargets(ID3D11DeviceContext1 *iface, UINT buffer_count, ID3D11Buffer **buffers) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); unsigned int i; TRACE("iface %p, buffer_count %u, buffers %p.\n", iface, buffer_count, buffers); @@ -2201,7 +2201,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_SOGetTargets(ID3D11DeviceC struct wined3d_buffer *wined3d_buffer; struct d3d_buffer *buffer_impl; - if (!(wined3d_buffer = wined3d_device_get_stream_output(device->wined3d_device, i, NULL))) + if (!(wined3d_buffer = wined3d_device_context_get_stream_output(context->wined3d_context, i, NULL))) { buffers[i] = NULL; continue; @@ -5501,7 +5501,8 @@ static void STDMETHODCALLTYPE d3d10_device_SOGetTargets(ID3D10Device1 *iface, struct wined3d_buffer *wined3d_buffer; struct d3d_buffer *buffer_impl; - if (!(wined3d_buffer = wined3d_device_get_stream_output(device->wined3d_device, i, &offsets[i]))) + if (!(wined3d_buffer = wined3d_device_context_get_stream_output( + device->immediate_context.wined3d_context, i, &offsets[i]))) { buffers[i] = NULL; continue; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 711ca0fe735..19ab5b1e52a 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1229,10 +1229,10 @@ void CDECL wined3d_device_set_stream_output(struct wined3d_device *device, UINT wined3d_device_context_set_stream_output(&device->cs->c, idx, buffer, offset); } -struct wined3d_buffer * CDECL wined3d_device_get_stream_output(struct wined3d_device *device, - UINT idx, UINT *offset) +struct wined3d_buffer * CDECL wined3d_device_context_get_stream_output(struct wined3d_device_context *context, + unsigned int idx, unsigned int *offset) { - TRACE("device %p, idx %u, offset %p.\n", device, idx, offset); + TRACE("context %p, idx %u, offset %p.\n", context, idx, offset); if (idx >= WINED3D_MAX_STREAM_OUTPUT_BUFFERS) { @@ -1241,8 +1241,8 @@ struct wined3d_buffer * CDECL wined3d_device_get_stream_output(struct wined3d_de } if (offset) - *offset = device->cs->c.state->stream_output[idx].offset; - return device->cs->c.state->stream_output[idx].buffer; + *offset = context->state->stream_output[idx].offset; + return context->state->stream_output[idx].buffer; } HRESULT CDECL wined3d_device_set_stream_source(struct wined3d_device *device, UINT stream_idx, diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index a66adbd12d8..aae9474c03a 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -84,7 +84,6 @@ @ cdecl wined3d_device_get_render_state(ptr long) @ cdecl wined3d_device_get_software_vertex_processing(ptr) @ cdecl wined3d_device_get_state(ptr) -@ cdecl wined3d_device_get_stream_output(ptr long ptr) @ cdecl wined3d_device_get_swapchain(ptr long) @ cdecl wined3d_device_get_swapchain_count(ptr) @ cdecl wined3d_device_get_unordered_access_view(ptr long) @@ -171,6 +170,7 @@ @ cdecl wined3d_device_context_get_scissor_rects(ptr ptr ptr) @ cdecl wined3d_device_context_get_shader(ptr long) @ cdecl wined3d_device_context_get_shader_resource_view(ptr long long) +@ cdecl wined3d_device_context_get_stream_output(ptr long ptr) @ cdecl wined3d_device_context_get_stream_source(ptr long ptr ptr ptr) @ cdecl wined3d_device_context_get_unordered_access_view(ptr long long) @ cdecl wined3d_device_context_get_vertex_declaration(ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 41c578971f5..657f8cd6758 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2418,8 +2418,6 @@ HRESULT __cdecl wined3d_device_get_raster_status(const struct wined3d_device *de DWORD __cdecl wined3d_device_get_render_state(const struct wined3d_device *device, enum wined3d_render_state state); BOOL __cdecl wined3d_device_get_software_vertex_processing(const struct wined3d_device *device); struct wined3d_state * __cdecl wined3d_device_get_state(struct wined3d_device *device); -struct wined3d_buffer * __cdecl wined3d_device_get_stream_output(struct wined3d_device *device, - UINT idx, UINT *offset); struct wined3d_swapchain * __cdecl wined3d_device_get_swapchain(const struct wined3d_device *device, UINT swapchain_idx); UINT __cdecl wined3d_device_get_swapchain_count(const struct wined3d_device *device); @@ -2571,6 +2569,8 @@ struct wined3d_shader * __cdecl wined3d_device_context_get_shader(const struct w enum wined3d_shader_type type); struct wined3d_shader_resource_view * __cdecl wined3d_device_context_get_shader_resource_view( const struct wined3d_device_context *context, enum wined3d_shader_type shader_type, unsigned int idx); +struct wined3d_buffer * __cdecl wined3d_device_context_get_stream_output(struct wined3d_device_context *context, + unsigned int idx, unsigned int *offset); HRESULT __cdecl wined3d_device_context_get_stream_source(const struct wined3d_device_context *context, unsigned int stream_idx, struct wined3d_buffer **buffer, unsigned int *offset, unsigned int *stride); struct wined3d_unordered_access_view * __cdecl wined3d_device_context_get_unordered_access_view(
1
0
0
0
Zebediah Figura : wined3d: Pass a wined3d_device_context to wined3d_device_get_stream_source().
by Alexandre Julliard
21 Apr '21
21 Apr '21
Module: wine Branch: master Commit: 4d459f4395f1df87255d0bcb8a10c76b0404b81f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4d459f4395f1df87255d0bcb…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Apr 20 19:53:54 2021 -0500 wined3d: Pass a wined3d_device_context to wined3d_device_get_stream_source(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/device.c | 6 +++--- dlls/wined3d/device.c | 10 +++++----- dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 66fa1b24014..2b923d65d23 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1799,7 +1799,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_IAGetInputLayout(ID3D11Dev static void STDMETHODCALLTYPE d3d11_immediate_context_IAGetVertexBuffers(ID3D11DeviceContext1 *iface, UINT start_slot, UINT buffer_count, ID3D11Buffer **buffers, UINT *strides, UINT *offsets) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); unsigned int i; TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p, strides %p, offsets %p.\n", @@ -1811,7 +1811,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_IAGetVertexBuffers(ID3D11D struct wined3d_buffer *wined3d_buffer = NULL; struct d3d_buffer *buffer_impl; - if (FAILED(wined3d_device_get_stream_source(device->wined3d_device, start_slot + i, + if (FAILED(wined3d_device_context_get_stream_source(context->wined3d_context, start_slot + i, &wined3d_buffer, &offsets[i], &strides[i]))) { FIXME("Failed to get vertex buffer %u.\n", start_slot + i); @@ -5174,7 +5174,7 @@ static void STDMETHODCALLTYPE d3d10_device_IAGetVertexBuffers(ID3D10Device1 *ifa struct wined3d_buffer *wined3d_buffer = NULL; struct d3d_buffer *buffer_impl; - if (FAILED(wined3d_device_get_stream_source(device->wined3d_device, start_slot + i, + if (FAILED(wined3d_device_context_get_stream_source(device->immediate_context.wined3d_context, start_slot + i, &wined3d_buffer, &offsets[i], &strides[i]))) ERR("Failed to get vertex buffer.\n"); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 9e74ab00081..711ca0fe735 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1254,13 +1254,13 @@ HRESULT CDECL wined3d_device_set_stream_source(struct wined3d_device *device, UI return wined3d_device_context_set_stream_source(&device->cs->c, stream_idx, buffer, offset, stride); } -HRESULT CDECL wined3d_device_get_stream_source(const struct wined3d_device *device, - UINT stream_idx, struct wined3d_buffer **buffer, UINT *offset, UINT *stride) +HRESULT CDECL wined3d_device_context_get_stream_source(const struct wined3d_device_context *context, + unsigned int stream_idx, struct wined3d_buffer **buffer, unsigned int *offset, unsigned int *stride) { const struct wined3d_stream_state *stream; - TRACE("device %p, stream_idx %u, buffer %p, offset %p, stride %p.\n", - device, stream_idx, buffer, offset, stride); + TRACE("context %p, stream_idx %u, buffer %p, offset %p, stride %p.\n", + context, stream_idx, buffer, offset, stride); if (stream_idx >= WINED3D_MAX_STREAMS) { @@ -1268,7 +1268,7 @@ HRESULT CDECL wined3d_device_get_stream_source(const struct wined3d_device *devi return WINED3DERR_INVALIDCALL; } - stream = &device->cs->c.state->streams[stream_idx]; + stream = &context->state->streams[stream_idx]; *buffer = stream->buffer; if (offset) *offset = stream->offset; diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 9dfeb64b180..a66adbd12d8 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -85,7 +85,6 @@ @ cdecl wined3d_device_get_software_vertex_processing(ptr) @ cdecl wined3d_device_get_state(ptr) @ cdecl wined3d_device_get_stream_output(ptr long ptr) -@ cdecl wined3d_device_get_stream_source(ptr long ptr ptr ptr) @ cdecl wined3d_device_get_swapchain(ptr long) @ cdecl wined3d_device_get_swapchain_count(ptr) @ cdecl wined3d_device_get_unordered_access_view(ptr long) @@ -172,6 +171,7 @@ @ cdecl wined3d_device_context_get_scissor_rects(ptr ptr ptr) @ cdecl wined3d_device_context_get_shader(ptr long) @ cdecl wined3d_device_context_get_shader_resource_view(ptr long long) +@ cdecl wined3d_device_context_get_stream_source(ptr long ptr ptr ptr) @ cdecl wined3d_device_context_get_unordered_access_view(ptr long long) @ cdecl wined3d_device_context_get_vertex_declaration(ptr) @ cdecl wined3d_device_context_get_viewports(ptr ptr ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 07e8ba0f540..41c578971f5 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2420,8 +2420,6 @@ BOOL __cdecl wined3d_device_get_software_vertex_processing(const struct wined3d_ struct wined3d_state * __cdecl wined3d_device_get_state(struct wined3d_device *device); struct wined3d_buffer * __cdecl wined3d_device_get_stream_output(struct wined3d_device *device, UINT idx, UINT *offset); -HRESULT __cdecl wined3d_device_get_stream_source(const struct wined3d_device *device, - UINT stream_idx, struct wined3d_buffer **buffer, UINT *offset, UINT *stride); struct wined3d_swapchain * __cdecl wined3d_device_get_swapchain(const struct wined3d_device *device, UINT swapchain_idx); UINT __cdecl wined3d_device_get_swapchain_count(const struct wined3d_device *device); @@ -2573,6 +2571,8 @@ struct wined3d_shader * __cdecl wined3d_device_context_get_shader(const struct w enum wined3d_shader_type type); struct wined3d_shader_resource_view * __cdecl wined3d_device_context_get_shader_resource_view( const struct wined3d_device_context *context, enum wined3d_shader_type shader_type, unsigned int idx); +HRESULT __cdecl wined3d_device_context_get_stream_source(const struct wined3d_device_context *context, + unsigned int stream_idx, struct wined3d_buffer **buffer, unsigned int *offset, unsigned int *stride); struct wined3d_unordered_access_view * __cdecl wined3d_device_context_get_unordered_access_view( const struct wined3d_device_context *context, enum wined3d_pipeline pipeline, unsigned int idx); struct wined3d_vertex_declaration * __cdecl wined3d_device_context_get_vertex_declaration(
1
0
0
0
Connor McAdams : winex11.drv: Add mutable pixel format awareness.
by Alexandre Julliard
21 Apr '21
21 Apr '21
Module: wine Branch: master Commit: 6d04e6c3a9c4c8b1cc2d1ba337c33cc56d1a8ab2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6d04e6c3a9c4c8b1cc2d1ba3…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Tue Apr 20 13:43:50 2021 -0400 winex11.drv: Add mutable pixel format awareness. Add the ability to check if the pixel format on the current window was previously set by wglSetPixelFormatWine(), and if was, allow the application to change it with a regular wglSetPixelFormat call. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/opengl.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index c44c587bf14..fd39b58bb3b 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -249,6 +249,7 @@ struct gl_drawable SIZE pixmap_size; /* pixmap size for GLXPixmap drawables */ int swap_interval; BOOL refresh_swap_interval; + BOOL mutable_pf; }; enum glx_swap_control_method @@ -1306,7 +1307,8 @@ static GLXContext create_glxcontext(Display *display, struct wgl_context *contex /*********************************************************************** * create_gl_drawable */ -static struct gl_drawable *create_gl_drawable( HWND hwnd, const struct wgl_pixel_format *format, BOOL known_child ) +static struct gl_drawable *create_gl_drawable( HWND hwnd, const struct wgl_pixel_format *format, BOOL known_child, + BOOL mutable_pf ) { struct gl_drawable *gl, *prev; XVisualInfo *visual = format->visual; @@ -1326,6 +1328,7 @@ static struct gl_drawable *create_gl_drawable( HWND hwnd, const struct wgl_pixel gl->refresh_swap_interval = TRUE; gl->format = format; gl->ref = 1; + gl->mutable_pf = mutable_pf; if (!known_child && !GetWindow( hwnd, GW_CHILD ) && GetAncestor( hwnd, GA_PARENT ) == GetDesktopWindow()) /* childless top-level window */ { @@ -1384,13 +1387,13 @@ static struct gl_drawable *create_gl_drawable( HWND hwnd, const struct wgl_pixel /*********************************************************************** * set_win_format */ -static BOOL set_win_format( HWND hwnd, const struct wgl_pixel_format *format ) +static BOOL set_win_format( HWND hwnd, const struct wgl_pixel_format *format, BOOL mutable_pf ) { struct gl_drawable *gl; if (!format->visual) return FALSE; - if (!(gl = create_gl_drawable( hwnd, format, FALSE ))) return FALSE; + if (!(gl = create_gl_drawable( hwnd, format, FALSE, mutable_pf ))) return FALSE; TRACE( "created GL drawable %lx for win %p %s\n", gl->drawable, hwnd, debugstr_fbconfig( format->fbconfig )); @@ -1437,12 +1440,14 @@ static BOOL set_pixel_format(HDC hdc, int format, BOOL allow_change) if ((gl = get_gl_drawable( hwnd, hdc ))) { int prev = pixel_format_index( gl->format ); + BOOL mutable_pf = gl->mutable_pf; release_gl_drawable( gl ); - return prev == format; /* cannot change it if already set */ + if (!mutable_pf) + return prev == format; /* cannot change it if already set */ } } - return set_win_format( hwnd, fmt ); + return set_win_format( hwnd, fmt, allow_change ); } @@ -1461,7 +1466,7 @@ void sync_gl_drawable( HWND hwnd, BOOL known_child ) if (!known_child) break; /* Still a childless top-level window */ /* fall through */ case DC_GL_PIXMAP_WIN: - if (!(new = create_gl_drawable( hwnd, old->format, known_child ))) break; + if (!(new = create_gl_drawable( hwnd, old->format, known_child, old->mutable_pf ))) break; mark_drawable_dirty( old, new ); XFlush( gdi_display ); TRACE( "Recreated GL drawable %lx to replace %lx\n", new->drawable, old->drawable ); @@ -1498,7 +1503,7 @@ void set_gl_drawable_parent( HWND hwnd, HWND parent ) return; } - if ((new = create_gl_drawable( hwnd, old->format, FALSE ))) + if ((new = create_gl_drawable( hwnd, old->format, FALSE, old->mutable_pf ))) { mark_drawable_dirty( old, new ); release_gl_drawable( new );
1
0
0
0
← Newer
1
...
22
23
24
25
26
27
28
...
87
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
Results per page:
10
25
50
100
200