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
October 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
1165 discussions
Start a n
N
ew thread
Gijs Vermeulen : ntdll: Don't fail when trying to remove the value of a non-existant variable in RtlSetEnvironmentVariable().
by Alexandre Julliard
26 Oct '21
26 Oct '21
Module: wine Branch: stable Commit: ebaafad23eb80261c02180282a63d6bb31a93a80 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ebaafad23eb80261c0218028…
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> (cherry picked from commit 2f2cdc8bb147f62ade1c5a2f1ae4c7b2863e6b08) Signed-off-by: Michael Stefaniuc <mstefani(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 5d1b6de5bba..f4f3ebb3d37 100644 --- a/dlls/ntdll/env.c +++ b/dlls/ntdll/env.c @@ -733,7 +733,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)); @@ -806,7 +806,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 a60d08e5967..6514591874b 100644 --- a/dlls/ntdll/tests/env.c +++ b/dlls/ntdll/tests/env.c @@ -580,7 +580,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); @@ -591,7 +591,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
26 Oct '21
26 Oct '21
Module: wine Branch: stable Commit: 43120ef41133ef8febf3ce7072b0b000e34428b8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=43120ef41133ef8febf3ce70…
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> (cherry picked from commit 09879590cb0abf899475e5bdad1aa715f8930f7a) Signed-off-by: Michael Stefaniuc <mstefani(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 4865a0a8e51..a60d08e5967 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 @@ -556,8 +474,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) @@ -618,6 +536,83 @@ static void test_RtlSetCurrentEnvironment(void) SetEnvironmentVariableA("testenv2", NULL); } +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"); @@ -625,19 +620,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
Michele Dionisio : msvcrt: Add __stdio_common_vfprintf_p and __stdio_common_vfwprintf_p.
by Alexandre Julliard
26 Oct '21
26 Oct '21
Module: wine Branch: stable Commit: 5aeb6c71d0f186331270ce7e62791687bde335f9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5aeb6c71d0f186331270ce7e…
Author: Michele Dionisio <michele.dionisio(a)gmail.com> Date: Sat Apr 17 08:42:52 2021 +0200 msvcrt: Add __stdio_common_vfprintf_p and __stdio_common_vfwprintf_p. Signed-off-by: Michele Dionisio <michele.dionisio(a)gmail.com> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 8ea43f388f760c247642b327c37e46d67c58c585) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- .../api-ms-win-crt-private-l1-1-0.spec | 4 ++-- .../api-ms-win-crt-stdio-l1-1-0.spec | 4 ++-- dlls/msvcrt/file.c | 28 ++++++++++++++++++++++ dlls/ucrtbase/ucrtbase.spec | 8 +++---- 4 files changed, 36 insertions(+), 8 deletions(-) diff --git a/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec b/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec index 136358a174c..246dde7dbdf 100644 --- a/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec +++ b/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec @@ -147,11 +147,11 @@ @ cdecl _o___std_type_info_destroy_list(ptr) ucrtbase._o___std_type_info_destroy_list @ cdecl _o___std_type_info_name(ptr ptr) ucrtbase._o___std_type_info_name @ cdecl _o___stdio_common_vfprintf(int64 ptr str ptr ptr) ucrtbase._o___stdio_common_vfprintf -@ stub _o___stdio_common_vfprintf_p +@ cdecl _o___stdio_common_vfprintf_p(int64 ptr str ptr ptr) ucrtbase._o___stdio_common_vfprintf_p @ cdecl _o___stdio_common_vfprintf_s(int64 ptr str ptr ptr) ucrtbase._o___stdio_common_vfprintf_s @ cdecl _o___stdio_common_vfscanf(int64 ptr str ptr ptr) ucrtbase._o___stdio_common_vfscanf @ cdecl _o___stdio_common_vfwprintf(int64 ptr wstr ptr ptr) ucrtbase._o___stdio_common_vfwprintf -@ stub _o___stdio_common_vfwprintf_p +@ cdecl _o___stdio_common_vfwprintf_p(int64 ptr wstr ptr ptr) ucrtbase._o___stdio_common_vfwprintf_p @ cdecl _o___stdio_common_vfwprintf_s(int64 ptr wstr ptr ptr) ucrtbase._o___stdio_common_vfwprintf_s @ cdecl _o___stdio_common_vfwscanf(int64 ptr wstr ptr ptr) ucrtbase._o___stdio_common_vfwscanf @ cdecl _o___stdio_common_vsnprintf_s(int64 ptr long long str ptr ptr) ucrtbase._o___stdio_common_vsnprintf_s diff --git a/dlls/api-ms-win-crt-stdio-l1-1-0/api-ms-win-crt-stdio-l1-1-0.spec b/dlls/api-ms-win-crt-stdio-l1-1-0/api-ms-win-crt-stdio-l1-1-0.spec index 19c06eaa67d..fce22df0357 100644 --- a/dlls/api-ms-win-crt-stdio-l1-1-0/api-ms-win-crt-stdio-l1-1-0.spec +++ b/dlls/api-ms-win-crt-stdio-l1-1-0/api-ms-win-crt-stdio-l1-1-0.spec @@ -2,11 +2,11 @@ @ cdecl __p__commode() ucrtbase.__p__commode @ cdecl __p__fmode() ucrtbase.__p__fmode @ cdecl __stdio_common_vfprintf(int64 ptr str ptr ptr) ucrtbase.__stdio_common_vfprintf -@ stub __stdio_common_vfprintf_p +@ cdecl __stdio_common_vfprintf_p(int64 ptr str ptr ptr) ucrtbase.__stdio_common_vfprintf_p @ cdecl __stdio_common_vfprintf_s(int64 ptr str ptr ptr) ucrtbase.__stdio_common_vfprintf_s @ cdecl __stdio_common_vfscanf(int64 ptr str ptr ptr) ucrtbase.__stdio_common_vfscanf @ cdecl __stdio_common_vfwprintf(int64 ptr wstr ptr ptr) ucrtbase.__stdio_common_vfwprintf -@ stub __stdio_common_vfwprintf_p +@ cdecl __stdio_common_vfwprintf_p(int64 ptr wstr ptr ptr) ucrtbase.__stdio_common_vfwprintf_p @ cdecl __stdio_common_vfwprintf_s(int64 ptr wstr ptr ptr) ucrtbase.__stdio_common_vfwprintf_s @ cdecl __stdio_common_vfwscanf(int64 ptr wstr ptr ptr) ucrtbase.__stdio_common_vfwscanf @ cdecl __stdio_common_vsnprintf_s(int64 ptr long long str ptr ptr) ucrtbase.__stdio_common_vsnprintf_s diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 73e1a82476f..91d4f11007c 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -5254,6 +5254,20 @@ int CDECL _stdio_common_vfprintf(unsigned __int64 options, FILE *file, const cha return vfprintf_helper(options & UCRTBASE_PRINTF_MASK, file, format, locale, valist); } +/********************************************************************* + * __stdio_common_vfprintf_p (UCRTBASE.@) + */ +int CDECL __stdio_common_vfprintf_p(unsigned __int64 options, FILE *file, const char *format, + _locale_t locale, __ms_va_list valist) +{ + if (options & ~UCRTBASE_PRINTF_MASK) + FIXME("options %s not handled\n", wine_dbgstr_longlong(options)); + + return vfprintf_helper((options & UCRTBASE_PRINTF_MASK) | MSVCRT_PRINTF_POSITIONAL_PARAMS + | MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER, file, format, locale, valist); +} + + /********************************************************************* * __stdio_common_vfprintf_s (UCRTBASE.@) */ @@ -5279,6 +5293,20 @@ int CDECL __stdio_common_vfwprintf(unsigned __int64 options, FILE *file, const w return vfwprintf_helper(options & UCRTBASE_PRINTF_MASK, file, format, locale, valist); } +/********************************************************************* + * __stdio_common_vfwprintf_p (UCRTBASE.@) + */ +int CDECL __stdio_common_vfwprintf_p(unsigned __int64 options, FILE *file, const wchar_t *format, + _locale_t locale, __ms_va_list valist) +{ + if (options & ~UCRTBASE_PRINTF_MASK) + FIXME("options %s not handled\n", wine_dbgstr_longlong(options)); + + return vfwprintf_helper((options & UCRTBASE_PRINTF_MASK) | MSVCRT_PRINTF_POSITIONAL_PARAMS + | MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER, file, format, locale, valist); +} + + /********************************************************************* * __stdio_common_vfwprintf_s (UCRTBASE.@) */ diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index 2631299d24c..85eacaa48cf 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -147,11 +147,11 @@ @ cdecl __std_type_info_hash(ptr) @ cdecl __std_type_info_name(ptr ptr) @ cdecl __stdio_common_vfprintf(int64 ptr str ptr ptr) _stdio_common_vfprintf -@ stub __stdio_common_vfprintf_p +@ cdecl __stdio_common_vfprintf_p(int64 ptr str ptr ptr) @ cdecl __stdio_common_vfprintf_s(int64 ptr str ptr ptr) @ cdecl __stdio_common_vfscanf(int64 ptr str ptr ptr) @ cdecl __stdio_common_vfwprintf(int64 ptr wstr ptr ptr) -@ stub __stdio_common_vfwprintf_p +@ cdecl __stdio_common_vfwprintf_p(int64 ptr wstr ptr ptr) @ cdecl __stdio_common_vfwprintf_s(int64 ptr wstr ptr ptr) @ cdecl __stdio_common_vfwscanf(int64 ptr wstr ptr ptr) @ cdecl __stdio_common_vsnprintf_s(int64 ptr long long str ptr ptr) @@ -811,11 +811,11 @@ @ cdecl _o___std_type_info_destroy_list(ptr) __std_type_info_destroy_list @ cdecl _o___std_type_info_name(ptr ptr) __std_type_info_name @ cdecl _o___stdio_common_vfprintf(int64 ptr str ptr ptr) _stdio_common_vfprintf -@ stub _o___stdio_common_vfprintf_p +@ cdecl _o___stdio_common_vfprintf_p(int64 ptr str ptr ptr) __stdio_common_vfprintf_p @ cdecl _o___stdio_common_vfprintf_s(int64 ptr str ptr ptr) __stdio_common_vfprintf_s @ cdecl _o___stdio_common_vfscanf(int64 ptr str ptr ptr) __stdio_common_vfscanf @ cdecl _o___stdio_common_vfwprintf(int64 ptr wstr ptr ptr) __stdio_common_vfwprintf -@ stub _o___stdio_common_vfwprintf_p +@ cdecl _o___stdio_common_vfwprintf_p(int64 ptr wstr ptr ptr) __stdio_common_vfwprintf_p @ cdecl _o___stdio_common_vfwprintf_s(int64 ptr wstr ptr ptr) __stdio_common_vfwprintf_s @ cdecl _o___stdio_common_vfwscanf(int64 ptr wstr ptr ptr) __stdio_common_vfwscanf @ cdecl _o___stdio_common_vsnprintf_s(int64 ptr long long str ptr ptr) __stdio_common_vsnprintf_s
1
0
0
0
David Torok : ntdll: Add NtCreateThread stub.
by Alexandre Julliard
26 Oct '21
26 Oct '21
Module: wine Branch: stable Commit: 758ecd13ab809928c8994b7988077424207de6ac URL:
https://source.winehq.org/git/wine.git/?a=commit;h=758ecd13ab809928c8994b79…
Author: David Torok <dt(a)zeroitlab.com> Date: Wed Apr 14 21:08:32 2021 +0200 ntdll: Add NtCreateThread stub. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=50952
Signed-off-by: David Torok <dt(a)zeroitlab.com> Signed-off-by: Gijs Vermeulen <gijsvrm(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 11ae0ade89d2ec50b255ac666c81cfccee8e30ea) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/ntdll/ntdll.spec | 4 ++-- dlls/ntdll/unix/thread.c | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index f3ec8fd9e39..8ffef6b5f7d 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -183,7 +183,7 @@ @ stdcall -syscall NtCreateSection(ptr long ptr ptr long long long) @ stdcall -syscall NtCreateSemaphore(ptr long ptr long long) @ stdcall -syscall NtCreateSymbolicLinkObject(ptr long ptr ptr) -@ stub NtCreateThread +@ stdcall -syscall NtCreateThread(ptr long ptr long ptr ptr ptr long) @ stdcall -syscall NtCreateThreadEx(ptr long ptr long ptr ptr long long long long ptr) @ stdcall -syscall NtCreateTimer(ptr long ptr long) @ stub NtCreateToken @@ -1189,7 +1189,7 @@ @ stdcall -private -syscall ZwCreateSection(ptr long ptr ptr long long long) NtCreateSection @ stdcall -private -syscall ZwCreateSemaphore(ptr long ptr long long) NtCreateSemaphore @ stdcall -private -syscall ZwCreateSymbolicLinkObject(ptr long ptr ptr) NtCreateSymbolicLinkObject -@ stub ZwCreateThread +@ stdcall -private -syscall ZwCreateThread(ptr long ptr long ptr ptr ptr long) NtCreateThread @ stdcall -private -syscall ZwCreateThreadEx(ptr long ptr long ptr ptr long long long long ptr) NtCreateThreadEx @ stdcall -private -syscall ZwCreateTimer(ptr long ptr long) NtCreateTimer @ stub ZwCreateToken diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index 9808fc610e3..aac80d7bee5 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -144,6 +144,16 @@ static void update_attr_list( PS_ATTRIBUTE_LIST *attr, const CLIENT_ID *id, TEB } } +/*********************************************************************** + * NtCreateThread (NTDLL.@) + */ +NTSTATUS WINAPI NtCreateThread( HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBUTES *attr, + HANDLE process, CLIENT_ID *id, CONTEXT *ctx, INITIAL_TEB *teb, + BOOLEAN suspended ) +{ + FIXME( "%p %d %p %p %p %p %p %d, stub!\n", handle, access, attr, process, id, ctx, teb, suspended ); + return STATUS_NOT_IMPLEMENTED; +} /*********************************************************************** * NtCreateThreadEx (NTDLL.@)
1
0
0
0
Dmitry Timoshkov : crypt32: Add support for importing RSA public keys with BCrypt.
by Alexandre Julliard
26 Oct '21
26 Oct '21
Module: wine Branch: stable Commit: d54b02e28139b8c7d43f6f5537ac81242a57004c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d54b02e28139b8c7d43f6f55…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Apr 12 15:21:04 2021 +0300 crypt32: Add support for importing RSA public keys with BCrypt. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=50925
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 9d1ae850dfd73c60fbe2904c443f79a050a20b96) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/crypt32/cert.c | 83 +++++++++++++++++++++++++++++++++++++++++++++ dlls/crypt32/tests/encode.c | 13 ++++++- 2 files changed, 95 insertions(+), 1 deletion(-) diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c index 95e2746a7d5..7d4041f1fb3 100644 --- a/dlls/crypt32/cert.c +++ b/dlls/crypt32/cert.c @@ -2689,11 +2689,94 @@ done: return !status; } +static BOOL CNG_ImportRSAPubKey(CERT_PUBLIC_KEY_INFO *info, BCRYPT_KEY_HANDLE *key) +{ + DWORD size, modulus_len, i; + BLOBHEADER *hdr; + RSAPUBKEY *rsapubkey; + const WCHAR *rsa_algo; + BCRYPT_ALG_HANDLE alg = NULL; + BCRYPT_RSAKEY_BLOB *rsakey; + BYTE *s, *d; + NTSTATUS status; + + if (!info->PublicKey.cbData) + { + SetLastError(NTE_BAD_ALGID); + return FALSE; + } + + if (!CryptDecodeObjectEx(X509_ASN_ENCODING, RSA_CSP_PUBLICKEYBLOB, info->PublicKey.pbData, + info->PublicKey.cbData, CRYPT_DECODE_ALLOC_FLAG, NULL, &hdr, &size)) + { + WARN("CryptDecodeObjectEx failed\n"); + return FALSE; + } + + if (hdr->aiKeyAlg == CALG_RSA_KEYX) + rsa_algo = BCRYPT_RSA_ALGORITHM; + else if (hdr->aiKeyAlg == CALG_RSA_SIGN) + rsa_algo = BCRYPT_RSA_SIGN_ALGORITHM; + else + { + FIXME("Unsupported RSA algorithm: %#x\n", hdr->aiKeyAlg); + CryptMemFree(hdr); + SetLastError(NTE_BAD_ALGID); + return FALSE; + } + + if ((status = BCryptOpenAlgorithmProvider(&alg, rsa_algo, NULL, 0))) + goto done; + + rsapubkey = (RSAPUBKEY *)(hdr + 1); + + modulus_len = size - sizeof(*hdr) - sizeof(*rsapubkey); + if (modulus_len != rsapubkey->bitlen / 8) + FIXME("RSA pubkey has wrong modulus_len %u\n", modulus_len); + + size = sizeof(*rsakey) + sizeof(ULONG) + modulus_len; + + if (!(rsakey = CryptMemAlloc(size))) + { + status = STATUS_NO_MEMORY; + goto done; + } + + rsakey->Magic = BCRYPT_RSAPUBLIC_MAGIC; + rsakey->BitLength = rsapubkey->bitlen; + rsakey->cbPublicExp = sizeof(ULONG); + rsakey->cbModulus = modulus_len; + rsakey->cbPrime1 = 0; + rsakey->cbPrime2 = 0; + + d = (BYTE *)(rsakey + 1); + /* According to MSDN modulus and pubexp are in LE while + * BCRYPT_RSAKEY_BLOB is supposed to have them in BE format */ + *(ULONG *)d = RtlUlongByteSwap(rsapubkey->pubexp); + d += sizeof(ULONG); + s = (BYTE *)(rsapubkey + 1); + for (i = 0; i < modulus_len; i++) + d[i] = s[modulus_len - i - 1]; + + status = BCryptImportKeyPair(alg, NULL, BCRYPT_RSAPUBLIC_BLOB, key, (BYTE *)rsakey, size, 0); + CryptMemFree(rsakey); + +done: + CryptMemFree(hdr); + if (alg) BCryptCloseAlgorithmProvider(alg, 0); + if (status) SetLastError(RtlNtStatusToDosError(status)); + return !status; +} + BOOL CNG_ImportPubKey(CERT_PUBLIC_KEY_INFO *pubKeyInfo, BCRYPT_KEY_HANDLE *key) { if (!strcmp(pubKeyInfo->Algorithm.pszObjId, szOID_ECC_PUBLIC_KEY)) return CNG_ImportECCPubKey(pubKeyInfo, key); + + if (!strcmp(pubKeyInfo->Algorithm.pszObjId, szOID_RSA_RSA)) + return CNG_ImportRSAPubKey(pubKeyInfo, key); + FIXME("Unsupported public key type: %s\n", debugstr_a(pubKeyInfo->Algorithm.pszObjId)); SetLastError(NTE_BAD_ALGID); return FALSE; diff --git a/dlls/crypt32/tests/encode.c b/dlls/crypt32/tests/encode.c index 38d2f84db14..7c72eba1b9b 100644 --- a/dlls/crypt32/tests/encode.c +++ b/dlls/crypt32/tests/encode.c @@ -30,6 +30,7 @@ static BOOL (WINAPI *pCryptDecodeObjectEx)(DWORD,LPCSTR,const BYTE*,DWORD,DWORD,PCRYPT_DECODE_PARA,void*,DWORD*); static BOOL (WINAPI *pCryptEncodeObjectEx)(DWORD,LPCSTR,const void*,DWORD,PCRYPT_ENCODE_PARA,void*,DWORD*); +static DWORD (WINAPI *pBCryptDestroyKey)(BCRYPT_KEY_HANDLE); struct encodedInt { @@ -8400,6 +8401,7 @@ static void testImportPublicKey(HCRYPTPROV csp, PCERT_PUBLIC_KEY_INFO info) { BOOL ret; HCRYPTKEY key; + BCRYPT_KEY_HANDLE key2; PCCERT_CONTEXT context; DWORD dwSize; ALG_ID ai; @@ -8469,6 +8471,12 @@ static void testImportPublicKey(HCRYPTPROV csp, PCERT_PUBLIC_KEY_INFO info) &context->pCertInfo->SubjectPublicKeyInfo, 0, 0, NULL, &key); ok(ret, "CryptImportPublicKeyInfoEx failed: %08x\n", GetLastError()); CryptDestroyKey(key); + + ret = CryptImportPublicKeyInfoEx2(X509_ASN_ENCODING, + &context->pCertInfo->SubjectPublicKeyInfo, 0, NULL, &key2); + ok(ret, "CryptImportPublicKeyInfoEx2 failed: %08x\n", GetLastError()); + if (pBCryptDestroyKey) pBCryptDestroyKey(key2); + CertFreeCertificateContext(context); } } @@ -8502,7 +8510,7 @@ START_TEST(encode) { static const DWORD encodings[] = { X509_ASN_ENCODING, PKCS_7_ASN_ENCODING, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING }; - HMODULE hCrypt32; + HMODULE hCrypt32, hBcrypt; DWORD i; hCrypt32 = GetModuleHandleA("crypt32.dll"); @@ -8514,6 +8522,9 @@ START_TEST(encode) return; } + hBcrypt = GetModuleHandleA("bcrypt.dll"); + pBCryptDestroyKey = (void*)GetProcAddress(hBcrypt, "BCryptDestroyKey"); + for (i = 0; i < ARRAY_SIZE(encodings); i++) { test_encodeInt(encodings[i]);
1
0
0
0
Dmitry Timoshkov : crypt32: Implement CryptImportPublicKeyInfoEx2.
by Alexandre Julliard
26 Oct '21
26 Oct '21
Module: wine Branch: stable Commit: fa4714e6045fdc4e25a0943bd9ef1936606b2755 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fa4714e6045fdc4e25a0943b…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Apr 12 15:20:57 2021 +0300 crypt32: Implement CryptImportPublicKeyInfoEx2. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit c2c7946680b61bfccd4c4f5788864d4130af9baf) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/crypt32/cert.c | 2 +- dlls/crypt32/crypt32_private.h | 2 ++ dlls/crypt32/encode.c | 9 ++++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c index aad8fa047b7..95e2746a7d5 100644 --- a/dlls/crypt32/cert.c +++ b/dlls/crypt32/cert.c @@ -2689,7 +2689,7 @@ done: return !status; } -static BOOL CNG_ImportPubKey(CERT_PUBLIC_KEY_INFO *pubKeyInfo, BCRYPT_KEY_HANDLE *key) +BOOL CNG_ImportPubKey(CERT_PUBLIC_KEY_INFO *pubKeyInfo, BCRYPT_KEY_HANDLE *key) { if (!strcmp(pubKeyInfo->Algorithm.pszObjId, szOID_ECC_PUBLIC_KEY)) return CNG_ImportECCPubKey(pubKeyInfo, key); diff --git a/dlls/crypt32/crypt32_private.h b/dlls/crypt32/crypt32_private.h index 30cf4334de4..9f8f43e7632 100644 --- a/dlls/crypt32/crypt32_private.h +++ b/dlls/crypt32/crypt32_private.h @@ -21,6 +21,8 @@ #include "wine/list.h" +BOOL CNG_ImportPubKey(CERT_PUBLIC_KEY_INFO *pubKeyInfo, BCRYPT_KEY_HANDLE *key) DECLSPEC_HIDDEN; + /* a few asn.1 tags we need */ #define ASN_BOOL (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x01) #define ASN_BITSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x03) diff --git a/dlls/crypt32/encode.c b/dlls/crypt32/encode.c index 46f4b8f25e7..02b235696ce 100644 --- a/dlls/crypt32/encode.c +++ b/dlls/crypt32/encode.c @@ -5050,8 +5050,11 @@ BOOL WINAPI CryptImportPublicKeyInfoEx2(DWORD dwCertEncodingType, PCERT_PUBLIC_KEY_INFO pInfo, DWORD dwFlags, void *pvAuxInfo, BCRYPT_KEY_HANDLE *phKey) { - FIXME_(crypt)("(%d, %p, %08x, %p, %p): stub\n", dwCertEncodingType, pInfo, + TRACE_(crypt)("(%d, %p, %08x, %p, %p)\n", dwCertEncodingType, pInfo, dwFlags, pvAuxInfo, phKey); - SetLastError(ERROR_FILE_NOT_FOUND); - return FALSE; + + if (dwFlags) + FIXME("flags %#x ignored\n", dwFlags); + + return CNG_ImportPubKey(pInfo, phKey); }
1
0
0
0
Gijs Vermeulen : dbghelp: Implement SymFromNameW().
by Alexandre Julliard
26 Oct '21
26 Oct '21
Module: wine Branch: stable Commit: fe998fb2d32d492aecab8e79b3aae6b847be9b0f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fe998fb2d32d492aecab8e79…
Author: Gijs Vermeulen <gijsvrm(a)gmail.com> Date: Thu Apr 22 12:20:18 2021 +0200 dbghelp: Implement SymFromNameW(). Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=50829
Signed-off-by: Gijs Vermeulen <gijsvrm(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 8d260b40fca92a3423b7764a8b6b803e8c74b46d) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/dbghelp/dbghelp.spec | 2 +- dlls/dbghelp/symbol.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/dlls/dbghelp/dbghelp.spec b/dlls/dbghelp/dbghelp.spec index b17c7b18655..73455c547e8 100644 --- a/dlls/dbghelp/dbghelp.spec +++ b/dlls/dbghelp/dbghelp.spec @@ -75,7 +75,7 @@ @ stdcall SymFromIndex(long int64 long ptr) @ stdcall SymFromIndexW(long int64 long ptr) @ stdcall SymFromName(long str ptr) -@ stub SymFromNameW +@ stdcall SymFromNameW(long wstr ptr) @ stub SymFromToken @ stub SymFromTokenW @ stdcall SymFunctionTableAccess(long long) diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c index 706d088aec0..61081527a36 100644 --- a/dlls/dbghelp/symbol.c +++ b/dlls/dbghelp/symbol.c @@ -1404,6 +1404,39 @@ BOOL WINAPI SymFromName(HANDLE hProcess, PCSTR Name, PSYMBOL_INFO Symbol) return FALSE; } +/*********************************************************************** + * SymFromNameW (DBGHELP.@) + */ +BOOL WINAPI SymFromNameW(HANDLE process, const WCHAR *name, SYMBOL_INFOW *symbol) +{ + SYMBOL_INFO *si; + DWORD len; + char *tmp; + BOOL ret; + + TRACE("(%p, %s, %p)\n", process, debugstr_w(name), symbol); + + len = sizeof(*si) + symbol->MaxNameLen * sizeof(WCHAR); + if (!(si = HeapAlloc(GetProcessHeap(), 0, len))) return FALSE; + + len = WideCharToMultiByte(CP_ACP, 0, name, -1, NULL, 0, NULL, NULL); + if (!(tmp = HeapAlloc(GetProcessHeap(), 0, len))) + { + HeapFree(GetProcessHeap(), 0, si); + return FALSE; + } + WideCharToMultiByte(CP_ACP, 0, name, -1, tmp, len, NULL, NULL); + + si->SizeOfStruct = sizeof(*si); + si->MaxNameLen = symbol->MaxNameLen; + if ((ret = SymFromName(process, tmp, si))) + copy_symbolW(symbol, si); + + HeapFree(GetProcessHeap(), 0, tmp); + HeapFree(GetProcessHeap(), 0, si); + return ret; +} + /*********************************************************************** * SymGetSymFromName64 (DBGHELP.@) */
1
0
0
0
Gijs Vermeulen : ntdll: Return STATUS_INFO_LENGTH_MISMATCH when len is too small in NtQueryObject(ObjectBasicInformation).
by Alexandre Julliard
26 Oct '21
26 Oct '21
Module: wine Branch: stable Commit: 74d7bd0fdfbeced966ab0c35df9aa5ddf4479651 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=74d7bd0fdfbeced966ab0c35…
Author: Gijs Vermeulen <gijsvrm(a)gmail.com> Date: Fri Apr 16 20:34:39 2021 +0200 ntdll: Return STATUS_INFO_LENGTH_MISMATCH when len is too small in NtQueryObject(ObjectBasicInformation). Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=50791
Signed-off-by: Gijs Vermeulen <gijsvrm(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 749f8c25e262cb049289e7c96bb390edcafa1021) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/ntdll/tests/om.c | 15 +++++++++++++++ dlls/ntdll/unix/file.c | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/tests/om.c b/dlls/ntdll/tests/om.c index c92b780541f..225b8969c0b 100644 --- a/dlls/ntdll/tests/om.c +++ b/dlls/ntdll/tests/om.c @@ -1333,6 +1333,7 @@ static void test_query_object(void) char buffer[1024]; NTSTATUS status; ULONG len, expected_len; + OBJECT_BASIC_INFORMATION info; OBJECT_ATTRIBUTES attr; UNICODE_STRING path, *str; char dir[MAX_PATH], tmp_path[MAX_PATH], file1[MAX_PATH + 16]; @@ -1344,6 +1345,20 @@ static void test_query_object(void) handle = CreateEventA( NULL, FALSE, FALSE, "test_event" ); + status = pNtQueryObject( handle, ObjectBasicInformation, NULL, 0, NULL ); + ok( status == STATUS_INFO_LENGTH_MISMATCH, "NtQueryObject failed %x\n", status ); + + status = pNtQueryObject( handle, ObjectBasicInformation, &info, 0, NULL ); + ok( status == STATUS_INFO_LENGTH_MISMATCH, "NtQueryObject failed %x\n", status ); + + status = pNtQueryObject( handle, ObjectBasicInformation, NULL, 0, &len ); + ok( status == STATUS_INFO_LENGTH_MISMATCH, "NtQueryObject failed %x\n", status ); + + len = 0; + status = pNtQueryObject( handle, ObjectBasicInformation, &info, sizeof(OBJECT_BASIC_INFORMATION), &len ); + ok( status == STATUS_SUCCESS, "NtQueryObject failed %x\n", status ); + ok( len >= sizeof(OBJECT_BASIC_INFORMATION), "unexpected len %u\n", len ); + len = 0; status = pNtQueryObject( handle, ObjectNameInformation, buffer, 0, &len ); ok( status == STATUS_INFO_LENGTH_MISMATCH, "NtQueryObject failed %x\n", status ); diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 955b0e0dff6..014beacb35f 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -6509,7 +6509,7 @@ NTSTATUS WINAPI NtQueryObject( HANDLE handle, OBJECT_INFORMATION_CLASS info_clas { OBJECT_BASIC_INFORMATION *p = ptr; - if (len < sizeof(*p)) return STATUS_INVALID_BUFFER_SIZE; + if (len < sizeof(*p)) return STATUS_INFO_LENGTH_MISMATCH; SERVER_START_REQ( get_object_info ) {
1
0
0
0
Anton Baskanov : amstream: Support the event parameter in IDirectDrawStreamSample::Update.
by Alexandre Julliard
26 Oct '21
26 Oct '21
Module: wine Branch: stable Commit: a0711d16fa2bdf592354be1d6d768f2048c49ecf URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a0711d16fa2bdf592354be1d…
Author: Anton Baskanov <baskanov(a)gmail.com> Date: Wed Apr 21 12:53:34 2021 +0700 amstream: Support the event parameter in IDirectDrawStreamSample::Update. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=50628
Signed-off-by: Anton Baskanov <baskanov(a)gmail.com> Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit b8a646f4997b1f695f340ed97fde716f834652e7) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/amstream/ddrawstream.c | 12 +++++------- dlls/amstream/tests/amstream.c | 17 +++++++---------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/dlls/amstream/ddrawstream.c b/dlls/amstream/ddrawstream.c index d6f07e1b10a..94f5c38301c 100644 --- a/dlls/amstream/ddrawstream.c +++ b/dlls/amstream/ddrawstream.c @@ -77,6 +77,7 @@ struct ddraw_sample STREAM_TIME end_time; BOOL continuous_update; CONDITION_VARIABLE update_cv; + HANDLE external_event; struct list entry; HRESULT update_hr; @@ -91,6 +92,8 @@ static void remove_queued_update(struct ddraw_sample *sample) sample->busy = FALSE; list_remove(&sample->entry); WakeConditionVariable(&sample->update_cv); + if (sample->external_event) + SetEvent(sample->external_event); } static void flush_update_queue(struct ddraw_stream *stream, HRESULT update_hr) @@ -1583,12 +1586,6 @@ static HRESULT WINAPI ddraw_sample_Update(IDirectDrawStreamSample *iface, return E_NOTIMPL; } - if (event) - { - FIXME("Event parameter support is not implemented!\n"); - return E_NOTIMPL; - } - EnterCriticalSection(&sample->parent->cs); if (sample->parent->state != State_Running) @@ -1612,10 +1609,11 @@ static HRESULT WINAPI ddraw_sample_Update(IDirectDrawStreamSample *iface, sample->update_hr = MS_S_NOUPDATE; sample->busy = TRUE; + sample->external_event = event; list_add_tail(&sample->parent->update_queue, &sample->entry); WakeConditionVariable(&sample->parent->update_queued_cv); - if (flags & SSUPDATE_ASYNC) + if ((flags & SSUPDATE_ASYNC) || event) { LeaveCriticalSection(&sample->parent->cs); return MS_S_PENDING; diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index c5089a82f23..3d38d195f7f 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -7796,20 +7796,17 @@ static void test_ddrawstreamsample_update(void) ok(hr == S_OK, "Got hr %#x.\n", hr); hr = IDirectDrawStreamSample_Update(stream_sample, 0, event, NULL, 0); - todo_wine ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr); + ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr); ok(WaitForSingleObject(event, 0) == WAIT_TIMEOUT, "Event should not be signaled.\n"); - if (hr == MS_S_PENDING) - { - media_sample = ammediastream_allocate_sample(&source, test_data, sizeof(test_data)); - hr = IMemInputPin_Receive(source.source.pMemInputPin, media_sample); - ok(hr == S_OK, "Got hr %#x.\n", hr); - ref = IMediaSample_Release(media_sample); - ok(!ref, "Got outstanding refcount %d.\n", ref); - } + media_sample = ammediastream_allocate_sample(&source, test_data, sizeof(test_data)); + hr = IMemInputPin_Receive(source.source.pMemInputPin, media_sample); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ref = IMediaSample_Release(media_sample); + ok(!ref, "Got outstanding refcount %d.\n", ref); - todo_wine ok(WaitForSingleObject(event, 0) == 0, "Event should be signaled.\n"); + ok(WaitForSingleObject(event, 0) == 0, "Event should be signaled.\n"); hr = IDirectDrawStreamSample_Update(stream_sample, SSUPDATE_ASYNC, NULL, NULL, 0); ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
1
0
0
0
Anton Baskanov : amstream/tests: Add a test for event parameter of IDirectDrawStreamSample::Update.
by Alexandre Julliard
26 Oct '21
26 Oct '21
Module: wine Branch: stable Commit: f16cda7e63cae5425322c0c2cb4319e76cc990cb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f16cda7e63cae5425322c0c2…
Author: Anton Baskanov <baskanov(a)gmail.com> Date: Wed Apr 21 12:53:33 2021 +0700 amstream/tests: Add a test for event parameter of IDirectDrawStreamSample::Update. Signed-off-by: Anton Baskanov <baskanov(a)gmail.com> Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 3088ce35cbcadf330fd5c66d8be7908876fd0ca3) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/amstream/tests/amstream.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index 648d5ee93c3..c5089a82f23 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -7795,6 +7795,22 @@ static void test_ddrawstreamsample_update(void) hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_RUN); ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IDirectDrawStreamSample_Update(stream_sample, 0, event, NULL, 0); + todo_wine ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr); + + ok(WaitForSingleObject(event, 0) == WAIT_TIMEOUT, "Event should not be signaled.\n"); + + if (hr == MS_S_PENDING) + { + media_sample = ammediastream_allocate_sample(&source, test_data, sizeof(test_data)); + hr = IMemInputPin_Receive(source.source.pMemInputPin, media_sample); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ref = IMediaSample_Release(media_sample); + ok(!ref, "Got outstanding refcount %d.\n", ref); + } + + todo_wine ok(WaitForSingleObject(event, 0) == 0, "Event should be signaled.\n"); + hr = IDirectDrawStreamSample_Update(stream_sample, SSUPDATE_ASYNC, NULL, NULL, 0); ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr); EXPECT_REF(stream_sample, 1);
1
0
0
0
← Newer
1
...
22
23
24
25
26
27
28
...
117
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
Results per page:
10
25
50
100
200