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
November 2020
----- 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
1 participants
851 discussions
Start a n
N
ew thread
Jacek Caban : server: Allow reading directly from console handle.
by Alexandre Julliard
19 Nov '20
19 Nov '20
Module: wine Branch: master Commit: c248999a8f9ca6425235c7120ee5f2d296f26756 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c248999a8f9ca6425235c712…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Nov 19 17:59:30 2020 +0100 server: Allow reading directly from console handle. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- server/console.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/server/console.c b/server/console.c index 40675d931b5..48f92dd66e6 100644 --- a/server/console.c +++ b/server/console.c @@ -98,6 +98,7 @@ static const struct object_ops console_input_ops = }; static enum server_fd_type console_get_fd_type( struct fd *fd ); +static int console_input_read( struct fd *fd, struct async *async, file_pos_t pos ); static int console_input_flush( struct fd *fd, struct async *async ); static int console_input_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ); @@ -106,7 +107,7 @@ static const struct fd_ops console_input_fd_ops = default_fd_get_poll_events, /* get_poll_events */ default_poll_event, /* poll_event */ console_get_fd_type, /* get_fd_type */ - no_fd_read, /* read */ + console_input_read, /* read */ no_fd_write, /* write */ console_input_flush, /* flush */ no_fd_get_file_info, /* get_file_info */ @@ -913,6 +914,18 @@ static int console_input_ioctl( struct fd *fd, ioctl_code_t code, struct async * } } +static int console_input_read( struct fd *fd, struct async *async, file_pos_t pos ) +{ + struct console_input *console = get_fd_user( fd ); + + if (!console->server) + { + set_error( STATUS_INVALID_HANDLE ); + return 0; + } + return queue_host_ioctl( console->server, IOCTL_CONDRV_READ_FILE, 0, async, &console->ioctl_q ); +} + static int console_input_flush( struct fd *fd, struct async *async ) { struct console_input *console = get_fd_user( fd );
1
0
0
0
Jacek Caban : kernelbase: Move Unicode conversion from ReadConsoleA to conhost.
by Alexandre Julliard
19 Nov '20
19 Nov '20
Module: wine Branch: master Commit: a66eab0dfb476ef15e32df71652d08e24ce5b482 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a66eab0dfb476ef15e32df71…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Nov 19 17:59:16 2020 +0100 kernelbase: Move Unicode conversion from ReadConsoleA to conhost. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernelbase/console.c | 17 +++-------- include/wine/condrv.h | 21 +++++++------ programs/conhost/conhost.c | 76 ++++++++++++++++++++++++++++++++++++++-------- server/console.c | 10 +++++- 4 files changed, 88 insertions(+), 36 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=a66eab0dfb476ef15e32…
1
0
0
0
Jacek Caban : conhost/tests: Add more ReadConsoleA tests.
by Alexandre Julliard
19 Nov '20
19 Nov '20
Module: wine Branch: master Commit: ee77a96daeca1e08bbe6596ad0de349d5fb484a5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ee77a96daeca1e08bbe6596a…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Nov 19 17:57:48 2020 +0100 conhost/tests: Add more ReadConsoleA tests. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/conhost/tests/tty.c | 121 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) diff --git a/programs/conhost/tests/tty.c b/programs/conhost/tests/tty.c index 9b1ab77dc0b..7cc37fa7fe1 100644 --- a/programs/conhost/tests/tty.c +++ b/programs/conhost/tests/tty.c @@ -150,9 +150,12 @@ enum req_type REQ_FILL_CHAR, REQ_GET_INPUT, REQ_READ_CONSOLE, + REQ_READ_CONSOLE_A, + REQ_READ_CONSOLE_FILE, REQ_SCROLL, REQ_SET_ACTIVE, REQ_SET_CURSOR, + REQ_SET_INPUT_CP, REQ_SET_INPUT_MODE, REQ_SET_OUTPUT_MODE, REQ_SET_TITLE, @@ -170,6 +173,7 @@ struct pseudoconsole_req COORD coord; HANDLE handle; DWORD mode; + int cp; size_t size; struct { @@ -362,6 +366,18 @@ static void child_set_output_mode(DWORD mode) ok(ret, "WriteFile failed: %u\n", GetLastError()); } +static void child_set_input_cp(int cp) +{ + struct pseudoconsole_req req; + DWORD count; + BOOL ret; + + req.type = REQ_SET_INPUT_CP; + req.u.cp = cp; + ret = WriteFile(child_pipe, &req, sizeof(req), &count, NULL); + ok(ret, "WriteFile failed: %u\n", GetLastError()); +} + static void child_read_console(HANDLE pipe, size_t size) { struct pseudoconsole_req req; @@ -374,6 +390,30 @@ static void child_read_console(HANDLE pipe, size_t size) ok(ret, "WriteFile failed: %u\n", GetLastError()); } +static void child_read_console_a(HANDLE pipe, size_t size) +{ + struct pseudoconsole_req req; + DWORD count; + BOOL ret; + + req.type = REQ_READ_CONSOLE_A; + req.u.size = size; + ret = WriteFile(pipe, &req, sizeof(req), &count, NULL); + ok(ret, "WriteFile failed: %u\n", GetLastError()); +} + +static void child_read_console_file(HANDLE pipe, size_t size) +{ + struct pseudoconsole_req req; + DWORD count; + BOOL ret; + + req.type = REQ_READ_CONSOLE_FILE; + req.u.size = size; + ret = WriteFile(pipe, &req, sizeof(req), &count, NULL); + ok(ret, "WriteFile failed: %u\n", GetLastError()); +} + #define child_expect_read_result(a,b) child_expect_read_result_(__LINE__,a,b) static void child_expect_read_result_(unsigned int line, HANDLE pipe, const WCHAR *expect) { @@ -390,6 +430,22 @@ static void child_expect_read_result_(unsigned int line, HANDLE pipe, const WCHA ok_(__FILE__,line)(!memcmp(expect, buf, count), "unexpected data %s\n", wine_dbgstr_w(buf)); } +#define child_expect_read_result_a(a,b) child_expect_read_result_a_(__LINE__,a,b) +static void child_expect_read_result_a_(unsigned int line, HANDLE pipe, const char *expect) +{ + size_t exlen = strlen(expect); + char buf[4096]; + DWORD count; + BOOL ret; + + ret = ReadFile(pipe, buf, sizeof(buf), &count, NULL); + ok_(__FILE__,line)(ret, "ReadFile failed: %u\n", GetLastError()); + todo_wine_if(exlen && expect[exlen - 1] == '\xcc') + ok_(__FILE__,line)(count == exlen, "got %u, expected %u\n", count, exlen); + buf[count] = 0; + ok_(__FILE__,line)(!memcmp(expect, buf, count), "unexpected data %s\n", wine_dbgstr_a(buf)); +} + static void expect_input(unsigned int event_type, INPUT_RECORD *record) { struct pseudoconsole_req req = { REQ_GET_INPUT }; @@ -1015,6 +1071,48 @@ static void test_read_console(void) child_expect_read_result(child_pipe, L"yz"); expect_empty_output(); + child_set_input_cp(932); + + child_read_console_a(child_pipe, 2); + write_console_pipe("\xe3\x81\x81"); + child_expect_read_result_a(child_pipe, "\x82\x9f"); + expect_empty_output(); + + child_read_console_a(child_pipe, 1); + write_console_pipe("\xe3\x81\x81""a"); + child_expect_read_result_a(child_pipe, "\x82\xcc"); + child_read_console_a(child_pipe, 1); + child_expect_read_result_a(child_pipe, "a"); + expect_empty_output(); + + child_read_console_a(child_pipe, 2); + write_console_pipe("a\xe3\x81\x81""b"); + child_expect_read_result_a(child_pipe, "a\x82\xcc"); + child_read_console_a(child_pipe, 1); + child_expect_read_result_a(child_pipe, "b"); + expect_empty_output(); + + child_read_console_file(child_pipe, 2); + write_console_pipe("\xe3\x81\x81"); + child_expect_read_result_a(child_pipe, "\x82\x9f"); + expect_empty_output(); + + child_read_console_file(child_pipe, 1); + write_console_pipe("\xe3\x81\x81""a"); + child_expect_read_result_a(child_pipe, "\x82\xcc"); + child_read_console_file(child_pipe, 1); + child_expect_read_result_a(child_pipe, "a"); + expect_empty_output(); + + child_read_console_file(child_pipe, 2); + write_console_pipe("a\xe3\x81\x81""b"); + child_expect_read_result_a(child_pipe, "a\x82\xcc"); + child_read_console_file(child_pipe, 1); + child_expect_read_result_a(child_pipe, "b"); + expect_empty_output(); + + child_set_input_cp(437); + child_set_input_mode(child_pipe, ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT | ENABLE_MOUSE_INPUT | ENABLE_INSERT_MODE | ENABLE_QUICK_EDIT_MODE | ENABLE_EXTENDED_FLAGS | ENABLE_AUTO_POSITION); @@ -1209,6 +1307,24 @@ static void child_process(HANDLE pipe) ok(ret, "WriteFile failed: %u\n", GetLastError()); break; + case REQ_READ_CONSOLE_A: + count = req->u.size; + memset(buf, 0xcc, sizeof(buf)); + ret = ReadConsoleA(input, buf, count, &count, NULL ); + ok(ret, "ReadConsoleA failed: %u\n", GetLastError()); + ret = WriteFile(pipe, buf, count, NULL, NULL); + ok(ret, "WriteFile failed: %u\n", GetLastError()); + break; + + case REQ_READ_CONSOLE_FILE: + count = req->u.size; + memset(buf, 0xcc, sizeof(buf)); + ret = ReadFile(input, buf, count, &count, NULL ); + ok(ret, "ReadFile failed: %u\n", GetLastError()); + ret = WriteFile(pipe, buf, count, NULL, NULL); + ok(ret, "WriteFile failed: %u\n", GetLastError()); + break; + case REQ_SCROLL: ret = ScrollConsoleScreenBufferW(output, &req->u.scroll.rect, NULL, req->u.scroll.dst, &req->u.scroll.fill); ok(ret, "ScrollConsoleScreenBuffer failed: %u\n", GetLastError()); @@ -1231,6 +1347,11 @@ static void child_process(HANDLE pipe) ok(ret, "SetConsoleCursorPosition failed: %u\n", GetLastError()); break; + case REQ_SET_INPUT_CP: + ret = SetConsoleCP(req->u.cp); + ok(ret, "SetConsoleCP failed: %u\n", GetLastError()); + break; + case REQ_SET_INPUT_MODE: ret = SetConsoleMode(input, req->u.mode); ok(ret, "SetConsoleMode failed: %u\n", GetLastError());
1
0
0
0
Piotr Caban : msvcrt: Don't overwrite threadmbcinfostruct structure in _setmbcp.
by Alexandre Julliard
19 Nov '20
19 Nov '20
Module: wine Branch: master Commit: 35a8f15361022d9195bd141aa67b22e06007fa16 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=35a8f15361022d9195bd141a…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Nov 19 18:57:48 2020 +0100 msvcrt: Don't overwrite threadmbcinfostruct structure in _setmbcp. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcr90/tests/msvcr90.c | 25 +++++++++++++++++++++---- dlls/msvcrt/locale.c | 19 ++++++++++--------- dlls/msvcrt/mbcs.c | 42 ++++++++++++++++++++++++++++++------------ dlls/msvcrt/msvcrt.h | 3 ++- 4 files changed, 63 insertions(+), 26 deletions(-) diff --git a/dlls/msvcr90/tests/msvcr90.c b/dlls/msvcr90/tests/msvcr90.c index ca5349e3387..08eb4a7ac64 100644 --- a/dlls/msvcr90/tests/msvcr90.c +++ b/dlls/msvcr90/tests/msvcr90.c @@ -130,6 +130,7 @@ static int (__cdecl *p_fflush_nolock)(FILE*); static size_t (__cdecl *p_mbstowcs)(wchar_t*, const char*, size_t); static size_t (__cdecl *p_wcstombs)(char*, const wchar_t*, size_t); static char* (__cdecl *p_setlocale)(int, const char*); +static int (__cdecl *p__setmbcp)(int); static int (__cdecl *p__fpieee_flt)(ULONG, EXCEPTION_POINTERS*, int (__cdecl *handler)(_FPIEEE_RECORD*)); static int (__cdecl *p__memicmp)(const char*, const char*, size_t); static int (__cdecl *p__memicmp_l)(const char*, const char*, size_t, _locale_t); @@ -160,6 +161,16 @@ struct __lc_time_data { #undef errno #define errno (*p_errno()) +typedef struct threadmbcinfostruct { + int refcount; + int mbcodepage; + int ismbcodepage; + int mblcid; + unsigned short mbulinfo[6]; + unsigned char mbctype[257]; + unsigned char mbcasemap[256]; +} threadmbcinfo; + /* type info */ typedef struct __type_info { @@ -415,6 +426,7 @@ static BOOL init(void) SET(p_mbstowcs, "mbstowcs"); SET(p_wcstombs, "wcstombs"); SET(p_setlocale, "setlocale"); + SET(p__setmbcp, "_setmbcp"); SET(p__fpieee_flt, "_fpieee_flt"); SET(p__memicmp, "_memicmp"); SET(p__memicmp_l, "_memicmp_l"); @@ -1979,9 +1991,13 @@ static void test____mb_cur_max_l_func(void) static void test__get_current_locale(void) { - _locale_t l = p__get_current_locale(), l2 = p__get_current_locale(); + _locale_t l, l2; int i; + ok(!p__setmbcp(1252), "_setmbcp failed\n"); + l = p__get_current_locale(); + l2 = p__get_current_locale(); + ok(!strcmp(l->locinfo->lc_category[LC_COLLATE].locale, "C"), "LC_COLLATE = \"%s\"\n", l->locinfo->lc_category[LC_COLLATE].locale); ok(!strcmp(l->locinfo->lc_category[LC_CTYPE].locale, "C"), @@ -1992,6 +2008,7 @@ static void test__get_current_locale(void) "LC_NUMERIC = \"%s\"\n", l->locinfo->lc_category[LC_NUMERIC].locale); ok(!strcmp(l->locinfo->lc_category[LC_TIME].locale, "C"), "LC_TIME = \"%s\"\n", l->locinfo->lc_category[LC_TIME].locale); + ok(l->mbcinfo->mbcodepage == 1252, "mbcodepage = %d\n", l->mbcinfo->mbcodepage); ok(l->locinfo->refcount == 3, "refcount = %d\n", l->locinfo->refcount); @@ -2001,6 +2018,7 @@ static void test__get_current_locale(void) p__free_locale(l2); return; } + ok(!p__setmbcp(932), "_setmbcp failed\n"); ok(!strcmp(l->locinfo->lc_category[LC_COLLATE].locale, "C"), "LC_COLLATE = \"%s\"\n", l->locinfo->lc_category[LC_COLLATE].locale); @@ -2012,6 +2030,7 @@ static void test__get_current_locale(void) "LC_NUMERIC = \"%s\"\n", l->locinfo->lc_category[LC_NUMERIC].locale); ok(!strcmp(l->locinfo->lc_category[LC_TIME].locale, "C"), "LC_TIME = \"%s\"\n", l->locinfo->lc_category[LC_TIME].locale); + ok(l->mbcinfo->mbcodepage == 1252, "mbcodepage = %d\n", l->mbcinfo->mbcodepage); ok(l->locinfo->refcount == 2, "refcount = %d\n", l->locinfo->refcount); ok(l->locinfo == l2->locinfo, "different locinfo pointers\n"); @@ -2143,9 +2162,7 @@ static void test__get_current_locale(void) p__free_locale(l2); - trace("before: %s\n", p_setlocale(LC_ALL, NULL)); - trace("current locale is: %s\n", p_setlocale(LC_MONETARY, "C")); - trace("after: %s\n", p_setlocale(LC_ALL, NULL)); + p_setlocale(LC_MONETARY, "C"); l2 = p__get_current_locale(); ok(l->locinfo->refcount == 1, "refcount = %d\n", l->locinfo->refcount); diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c index 8543b3f1713..2cedc89530e 100644 --- a/dlls/msvcrt/locale.c +++ b/dlls/msvcrt/locale.c @@ -597,14 +597,18 @@ MSVCRT_pthreadlocinfo CDECL get_locinfo(void) { return *get_locinfo_ptr(); } -/* INTERNAL: returns pthreadmbcinfo struct */ -MSVCRT_pthreadmbcinfo CDECL get_mbcinfo(void) { +MSVCRT_pthreadmbcinfo* CDECL get_mbcinfo_ptr(void) { thread_data_t *data = msvcrt_get_thread_data(); if(!data || !data->have_locale) - return MSVCRT_locale->mbcinfo; + return &MSVCRT_locale->mbcinfo; - return data->mbcinfo; + return &data->mbcinfo; +} + +/* INTERNAL: returns pthreadmbcinfo struct */ +MSVCRT_pthreadmbcinfo CDECL get_mbcinfo(void) { + return *get_mbcinfo_ptr(); } /* INTERNAL: constructs string returned by setlocale */ @@ -1964,16 +1968,13 @@ MSVCRT__locale_t CDECL MSVCRT__create_locale(int category, const char *locale) return NULL; } - loc->mbcinfo = MSVCRT_malloc(sizeof(MSVCRT_threadmbcinfo)); + loc->mbcinfo = create_mbcinfo(loc->locinfo->lc_id[MSVCRT_LC_CTYPE].wCodePage, + loc->locinfo->lc_handle[MSVCRT_LC_CTYPE], NULL); if(!loc->mbcinfo) { free_locinfo(loc->locinfo); MSVCRT_free(loc); return NULL; } - - loc->mbcinfo->refcount = 1; - _setmbcp_l(loc->locinfo->lc_id[MSVCRT_LC_CTYPE].wCodePage, - loc->locinfo->lc_handle[MSVCRT_LC_CTYPE], loc->mbcinfo); return loc; } diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c index f9a38184436..1454004610d 100644 --- a/dlls/msvcrt/mbcs.c +++ b/dlls/msvcrt/mbcs.c @@ -211,10 +211,9 @@ int CDECL ___mb_cur_max_l_func(MSVCRT__locale_t locale) /********************************************************************* * INTERNAL: _setmbcp_l */ -int _setmbcp_l(int cp, LCID lcid, MSVCRT_pthreadmbcinfo mbcinfo) +MSVCRT_threadmbcinfo* create_mbcinfo(int cp, LCID lcid, MSVCRT_threadmbcinfo *old_mbcinfo) { - const char format[] = ".%d"; - + MSVCRT_threadmbcinfo *mbcinfo; int newcp; CPINFO cpi; BYTE *bytes; @@ -225,8 +224,16 @@ int _setmbcp_l(int cp, LCID lcid, MSVCRT_pthreadmbcinfo mbcinfo) int ret; int i; + if(old_mbcinfo && cp==old_mbcinfo->mbcodepage + && (lcid==-1 || lcid==old_mbcinfo->mblcid)) { + InterlockedIncrement(&old_mbcinfo->refcount); + return old_mbcinfo; + } + + mbcinfo = MSVCRT_malloc(sizeof(MSVCRT_threadmbcinfo)); if(!mbcinfo) - mbcinfo = get_mbcinfo(); + return NULL; + mbcinfo->refcount = 1; switch (cp) { @@ -250,7 +257,7 @@ int _setmbcp_l(int cp, LCID lcid, MSVCRT_pthreadmbcinfo mbcinfo) } if(lcid == -1) { - MSVCRT_sprintf(bufA, format, newcp); + MSVCRT_sprintf(bufA, ".%d", newcp); mbcinfo->mblcid = MSVCRT_locale_to_LCID(bufA, NULL, NULL); } else { mbcinfo->mblcid = lcid; @@ -265,8 +272,8 @@ int _setmbcp_l(int cp, LCID lcid, MSVCRT_pthreadmbcinfo mbcinfo) if (!GetCPInfo(newcp, &cpi)) { WARN("Codepage %d not found\n", newcp); - *MSVCRT__errno() = MSVCRT_EINVAL; - return -1; + MSVCRT_free(mbcinfo); + return NULL; } /* setup the _mbctype */ @@ -370,10 +377,7 @@ int _setmbcp_l(int cp, LCID lcid, MSVCRT_pthreadmbcinfo mbcinfo) } mbcinfo->mbcodepage = newcp; - if(MSVCRT_locale && mbcinfo == MSVCRT_locale->mbcinfo) - memcpy(MSVCRT_mbctype, MSVCRT_locale->mbcinfo->mbctype, sizeof(MSVCRT_mbctype)); - - return 0; + return mbcinfo; } /********************************************************************* @@ -381,7 +385,21 @@ int _setmbcp_l(int cp, LCID lcid, MSVCRT_pthreadmbcinfo mbcinfo) */ int CDECL _setmbcp(int cp) { - return _setmbcp_l(cp, -1, NULL); + MSVCRT_threadmbcinfo **old_mbcinfo = get_mbcinfo_ptr(); + MSVCRT_threadmbcinfo *mbcinfo; + + mbcinfo = create_mbcinfo(cp, -1, *old_mbcinfo); + if(!mbcinfo) { + *MSVCRT__errno() = MSVCRT_EINVAL; + return -1; + } + + free_mbcinfo(*old_mbcinfo); + *old_mbcinfo = mbcinfo; + + if(mbcinfo == MSVCRT_locale->mbcinfo) + memcpy(MSVCRT_mbctype, MSVCRT_locale->mbcinfo->mbctype, sizeof(MSVCRT_mbctype)); + return 0; } /********************************************************************* diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index 503aea33bd0..6c103ee3ca2 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -1136,10 +1136,11 @@ MSVCRT__locale_t CDECL get_current_locale_noalloc(MSVCRT__locale_t locale) DECLS void CDECL free_locale_noalloc(MSVCRT__locale_t locale) DECLSPEC_HIDDEN; MSVCRT_pthreadlocinfo CDECL get_locinfo(void) DECLSPEC_HIDDEN; MSVCRT_pthreadmbcinfo CDECL get_mbcinfo(void) DECLSPEC_HIDDEN; +MSVCRT_pthreadmbcinfo* CDECL get_mbcinfo_ptr(void) DECLSPEC_HIDDEN; void __cdecl MSVCRT__free_locale(MSVCRT__locale_t); +MSVCRT_threadmbcinfo* create_mbcinfo(int, LCID, MSVCRT_threadmbcinfo*) DECLSPEC_HIDDEN; void free_locinfo(MSVCRT_pthreadlocinfo) DECLSPEC_HIDDEN; void free_mbcinfo(MSVCRT_pthreadmbcinfo) DECLSPEC_HIDDEN; -int _setmbcp_l(int, LCID, MSVCRT_pthreadmbcinfo) DECLSPEC_HIDDEN; int __cdecl __crtLCMapStringA(LCID, DWORD, const char*, int, char*, int, unsigned int, int) DECLSPEC_HIDDEN; #ifndef __WINE_MSVCRT_TEST
1
0
0
0
Jacek Caban : makedep: Use short debug file names.
by Alexandre Julliard
19 Nov '20
19 Nov '20
Module: wine Branch: master Commit: e84394764ab29864ed85ea03e5822c57b01b9dd8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e84394764ab29864ed85ea03…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Nov 19 18:43:36 2020 +0100 makedep: Use short debug file names. Fixes gitignore entries for symbol files. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/makedep.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/makedep.c b/tools/makedep.c index c30c21ff27d..cee64fd61bf 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -3077,8 +3077,8 @@ static void output_source_spec( struct makefile *make, struct incl_file *source, output_filename( "-shared" ); output_filename( source->filename ); output_filename( obj_name ); - if ((debug_file = get_debug_file( make, output_file ))) - output_filename( strmake( "-Wl,--debug-file,%s", debug_file )); + if ((debug_file = get_debug_file( make, dll_name ))) + output_filename( strmake( "-Wl,--debug-file,%s", obj_dir_path( make, debug_file ))); output_filenames( all_libs ); output_filename( make->is_cross ? "$(CROSSLDFLAGS)" : "$(LDFLAGS)" ); output( "\n" ); @@ -3293,7 +3293,7 @@ static void output_module( struct makefile *make ) strarray_add( &make->all_targets, strmake( "%s", make->module )); add_install_rule( make, make->module, strmake( "%s", make->module ), strmake( "c$(dlldir)/%s", make->module )); - debug_file = get_debug_file( make, module_path ); + debug_file = get_debug_file( make, make->module ); output( "%s:", module_path ); } else if (*dll_ext) @@ -3316,7 +3316,7 @@ static void output_module( struct makefile *make ) strarray_add( &make->all_targets, make->module ); add_install_rule( make, make->module, make->module, strmake( "p$(%s)/%s", spec_file ? "dlldir" : "bindir", make->module )); - debug_file = get_debug_file( make, module_path ); + debug_file = get_debug_file( make, make->module ); output( "%s:", module_path ); } @@ -3337,7 +3337,7 @@ static void output_module( struct makefile *make ) output_filenames( make->extradllflags ); output_filenames_obj_dir( make, make->is_cross ? make->crossobj_files : make->object_files ); output_filenames_obj_dir( make, make->res_files ); - if (debug_file) output_filename( strmake( "-Wl,--debug-file,%s", debug_file )); + if (debug_file) output_filename( strmake( "-Wl,--debug-file,%s", obj_dir_path( make, debug_file ))); output_filenames( all_libs ); output_filename( make->is_cross ? "$(CROSSLDFLAGS)" : "$(LDFLAGS)" ); output( "\n" ); @@ -3551,8 +3551,8 @@ static void output_test_module( struct makefile *make ) output_filenames( make->extradllflags ); output_filenames_obj_dir( make, make->is_cross ? make->crossobj_files : make->object_files ); output_filenames_obj_dir( make, make->res_files ); - if ((debug_file = get_debug_file( make, output_file ))) - output_filename( strmake( "-Wl,--debug-file,%s", debug_file )); + if ((debug_file = get_debug_file( make, testmodule ))) + output_filename( strmake( "-Wl,--debug-file,%s", obj_dir_path( make, debug_file ))); output_filenames( all_libs ); output_filename( make->is_cross ? "$(CROSSLDFLAGS)" : "$(LDFLAGS)" ); output( "\n" );
1
0
0
0
Zebediah Figura : qedit/tests: Test (dis)connecting while not stopped.
by Alexandre Julliard
19 Nov '20
19 Nov '20
Module: wine Branch: master Commit: d6c7cfe2da0afb2b144ea8c0d64290d2457ef74f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d6c7cfe2da0afb2b144ea8c0…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu Nov 19 11:19:35 2020 -0600 qedit/tests: Test (dis)connecting while not stopped. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/qedit/tests/nullrenderer.c | 17 +++++++++++++++++ dlls/qedit/tests/samplegrabber.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/dlls/qedit/tests/nullrenderer.c b/dlls/qedit/tests/nullrenderer.c index 754228d770b..1800f4dad4c 100644 --- a/dlls/qedit/tests/nullrenderer.c +++ b/dlls/qedit/tests/nullrenderer.c @@ -803,6 +803,7 @@ static void test_connect_pin(void) IBaseFilter *filter = create_null_renderer(); struct testfilter source; IMemAllocator *allocator; + IMediaControl *control; IFilterGraph2 *graph; IMemInputPin *input; AM_MEDIA_TYPE mt; @@ -816,6 +817,7 @@ static void test_connect_pin(void) &IID_IFilterGraph2, (void **)&graph); IFilterGraph2_AddFilter(graph, &source.filter.IBaseFilter_iface, L"source"); IFilterGraph2_AddFilter(graph, filter, L"sink"); + IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control); IBaseFilter_FindPin(filter, L"In", &pin); @@ -827,6 +829,13 @@ static void test_connect_pin(void) hr = IPin_ConnectionMediaType(pin, &mt); ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr); + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); ok(hr == S_OK, "Got hr %#x.\n", hr); @@ -839,6 +848,13 @@ static void test_connect_pin(void) ok(hr == S_OK, "Got hr %#x.\n", hr); ok(!memcmp(&mt, &req_mt, sizeof(AM_MEDIA_TYPE)), "Media types didn't match.\n"); + hr = IMediaControl_Pause(control); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, pin); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + IPin_QueryInterface(pin, &IID_IMemInputPin, (void **)&input); test_allocator(input); @@ -875,6 +891,7 @@ static void test_connect_pin(void) IMemInputPin_Release(input); IPin_Release(pin); + IMediaControl_Release(control); ref = IFilterGraph2_Release(graph); ok(!ref, "Got outstanding refcount %d.\n", ref); ref = IBaseFilter_Release(filter); diff --git a/dlls/qedit/tests/samplegrabber.c b/dlls/qedit/tests/samplegrabber.c index 8e68e3efae1..3a1d1a16ce6 100644 --- a/dlls/qedit/tests/samplegrabber.c +++ b/dlls/qedit/tests/samplegrabber.c @@ -769,6 +769,7 @@ static void test_connect_pin(void) IPin *sink, *source, *peer; IEnumMediaTypes *enummt; ISampleGrabber *grabber; + IMediaControl *control; AM_MEDIA_TYPE mt, *pmt; IFilterGraph2 *graph; HRESULT hr; @@ -781,6 +782,7 @@ static void test_connect_pin(void) IFilterGraph2_AddFilter(graph, &testsource.filter.IBaseFilter_iface, L"source"); IFilterGraph2_AddFilter(graph, &testsink.filter.IBaseFilter_iface, L"sink"); IFilterGraph2_AddFilter(graph, filter, L"sample grabber"); + IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control); IBaseFilter_FindPin(filter, L"In", &sink); IBaseFilter_FindPin(filter, L"Out", &source); IBaseFilter_QueryInterface(filter, &IID_ISampleGrabber, (void **)&grabber); @@ -802,6 +804,13 @@ static void test_connect_pin(void) hr = IPin_ConnectionMediaType(sink, &mt); ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr); + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, &req_mt); ok(hr == S_OK, "Got hr %#x.\n", hr); @@ -814,6 +823,13 @@ static void test_connect_pin(void) ok(hr == S_OK, "Got hr %#x.\n", hr); ok(compare_media_types(&mt, &req_mt), "Media types didn't match.\n"); + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, sink); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = ISampleGrabber_GetConnectedMediaType(grabber, NULL); ok(hr == E_POINTER, "Got hr %#x.\n", hr); @@ -874,6 +890,13 @@ static void test_connect_pin(void) /* Exact connection. */ + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + req_mt.bTemporalCompression = FALSE; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, &req_mt); ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr); @@ -893,6 +916,13 @@ static void test_connect_pin(void) ok(compare_media_types(&testsink.sink.pin.mt, &req_mt), "Media types didn't match.\n"); ok(compare_media_types(&testsource.source.pin.mt, &testsink.sink.pin.mt), "Media types didn't match.\n"); + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, source); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, source); ok(hr == S_OK, "Got hr %#x.\n", hr); hr = IFilterGraph2_Disconnect(graph, source); @@ -1025,6 +1055,7 @@ static void test_connect_pin(void) IPin_Release(sink); IPin_Release(source); + IMediaControl_Release(control); ref = IFilterGraph2_Release(graph); ok(!ref, "Got outstanding refcount %d.\n", ref); ISampleGrabber_Release(grabber);
1
0
0
0
Zebediah Figura : qcap/tests: Test (dis)connecting while not stopped.
by Alexandre Julliard
19 Nov '20
19 Nov '20
Module: wine Branch: master Commit: aa8e69a68bc92a90f1663c0bdff76b209cdc7467 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=aa8e69a68bc92a90f1663c0b…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu Nov 19 11:19:34 2020 -0600 qcap/tests: Test (dis)connecting while not stopped. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/qcap/tests/filewriter.c | 14 ++++++++++++++ dlls/qcap/tests/smartteefilter.c | 37 ++++++++++++++++++++++++++++++++++--- 2 files changed, 48 insertions(+), 3 deletions(-) diff --git a/dlls/qcap/tests/filewriter.c b/dlls/qcap/tests/filewriter.c index e3bdcb76560..d6dbc3faded 100644 --- a/dlls/qcap/tests/filewriter.c +++ b/dlls/qcap/tests/filewriter.c @@ -768,6 +768,13 @@ static void test_connect_pin(void) hr = IPin_ConnectionMediaType(pin, &mt); ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr); + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr); req_mt.majortype = MEDIATYPE_Stream; @@ -783,6 +790,13 @@ static void test_connect_pin(void) ok(hr == S_OK, "Got hr %#x.\n", hr); ok(!memcmp(&mt, &req_mt, sizeof(AM_MEDIA_TYPE)), "Media types didn't match.\n"); + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, pin); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + todo_wine ok(hr == VFW_E_NO_ALLOCATOR, "Got hr %#x.\n", hr); + CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC_SERVER, &IID_IMemAllocator, (void **)&allocator); diff --git a/dlls/qcap/tests/smartteefilter.c b/dlls/qcap/tests/smartteefilter.c index 1364beef161..1019fd3c1ba 100644 --- a/dlls/qcap/tests/smartteefilter.c +++ b/dlls/qcap/tests/smartteefilter.c @@ -2519,7 +2519,7 @@ static void test_source_media_types(AM_MEDIA_TYPE req_mt, const AM_MEDIA_TYPE *s } static void test_source_connection(AM_MEDIA_TYPE req_mt, IFilterGraph2 *graph, - struct testfilter *testsink, IPin *source) + IMediaControl *control, struct testfilter *testsink, IPin *source) { const AM_MEDIA_TYPE sink_mt = req_mt; AM_MEDIA_TYPE mt; @@ -2536,6 +2536,13 @@ static void test_source_connection(AM_MEDIA_TYPE req_mt, IFilterGraph2 *graph, /* Exact connection. */ + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink->sink.pin.IPin_iface, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink->sink.pin.IPin_iface, &req_mt); ok(hr == S_OK, "Got hr %#x.\n", hr); @@ -2549,6 +2556,13 @@ static void test_source_connection(AM_MEDIA_TYPE req_mt, IFilterGraph2 *graph, ok(compare_media_types(&mt, &req_mt), "Media types didn't match.\n"); ok(compare_media_types(&testsink->sink.pin.mt, &req_mt), "Media types didn't match.\n"); + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, source); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, source); ok(hr == S_OK, "Got hr %#x.\n", hr); hr = IFilterGraph2_Disconnect(graph, source); @@ -2662,6 +2676,7 @@ static void test_connect_pin(void) IPin *sink, *capture, *preview, *peer; AM_MEDIA_TYPE mt, *mts[3]; IEnumMediaTypes *enummt; + IMediaControl *control; IFilterGraph2 *graph; HRESULT hr; ULONG ref; @@ -2673,6 +2688,7 @@ static void test_connect_pin(void) IFilterGraph2_AddFilter(graph, &testsource.filter.IBaseFilter_iface, L"source"); IFilterGraph2_AddFilter(graph, &testsink.filter.IBaseFilter_iface, L"sink"); IFilterGraph2_AddFilter(graph, filter, L"sample grabber"); + IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control); IBaseFilter_FindPin(filter, L"Input", &sink); IBaseFilter_FindPin(filter, L"Capture", &capture); IBaseFilter_FindPin(filter, L"Preview", &preview); @@ -2709,6 +2725,13 @@ static void test_connect_pin(void) hr = IPin_ConnectionMediaType(sink, &mt); ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr); + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, &req_mt); ok(hr == S_OK, "Got hr %#x.\n", hr); @@ -2729,8 +2752,15 @@ static void test_connect_pin(void) test_source_media_types(req_mt, &testsource.source_mt, capture); test_source_media_types(req_mt, &testsource.source_mt, preview); - test_source_connection(req_mt, graph, &testsink, capture); - test_source_connection(req_mt, graph, &testsink, preview); + test_source_connection(req_mt, graph, control, &testsink, capture); + test_source_connection(req_mt, graph, control, &testsink, preview); + + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, sink); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); hr = IFilterGraph2_Disconnect(graph, sink); ok(hr == S_OK, "Got hr %#x.\n", hr); @@ -2750,6 +2780,7 @@ static void test_connect_pin(void) IPin_Release(sink); IPin_Release(capture); IPin_Release(preview); + IMediaControl_Release(control); ref = IFilterGraph2_Release(graph); ok(!ref, "Got outstanding refcount %d.\n", ref); ref = IBaseFilter_Release(filter);
1
0
0
0
Zebediah Figura : qasf/tests: Test (dis)connecting while not stopped.
by Alexandre Julliard
19 Nov '20
19 Nov '20
Module: wine Branch: master Commit: 2945f4670747a688ebbc21114081b438e041e5bb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2945f4670747a688ebbc2111…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu Nov 19 11:19:33 2020 -0600 qasf/tests: Test (dis)connecting while not stopped. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/qasf/tests/dmowrapper.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/dlls/qasf/tests/dmowrapper.c b/dlls/qasf/tests/dmowrapper.c index f76c0c3d9d5..bd87a3494b2 100644 --- a/dlls/qasf/tests/dmowrapper.c +++ b/dlls/qasf/tests/dmowrapper.c @@ -1445,6 +1445,8 @@ static void test_filter_state(IMediaControl *control) OAFilterState state; HRESULT hr; + got_Flush = 0; + hr = IMediaControl_GetState(control, 0, &state); ok(hr == S_OK, "Got hr %#x.\n", hr); ok(state == State_Stopped, "Got state %u.\n", state); @@ -1782,6 +1784,13 @@ static void test_connect_pin(void) hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, &req_mt); ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr); + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(!testdmo_input_mt_set, "Input type should not be set.\n"); req_mt.lSampleSize = 123; @@ -1800,6 +1809,13 @@ static void test_connect_pin(void) ok(testdmo_input_mt_set, "Input type should be set.\n"); ok(compare_media_types(&testdmo_input_mt, &req_mt), "Media types didn't match.\n"); + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, sink); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + test_sink_allocator(meminput); /* Test source connection. */ @@ -1816,6 +1832,14 @@ static void test_connect_pin(void) /* Exact connection. */ req_mt = mt2; + + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, &req_mt); ok(hr == S_OK, "Got hr %#x.\n", hr); @@ -1831,6 +1855,13 @@ static void test_connect_pin(void) ok(testdmo_output_mt_set, "Output type should be set.\n"); ok(compare_media_types(&testdmo_output_mt, &req_mt), "Media types didn't match.\n"); + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, source); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + test_filter_state(control); test_sample_processing(control, meminput);
1
0
0
0
Zebediah Figura : quartz/tests: Test (dis)connecting while not stopped.
by Alexandre Julliard
19 Nov '20
19 Nov '20
Module: wine Branch: master Commit: 6463f65adcf9303e5fc78ac6daa8700db9bf76a9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6463f65adcf9303e5fc78ac6…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu Nov 19 11:19:32 2020 -0600 quartz/tests: Test (dis)connecting while not stopped. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/tests/avidec.c | 34 ++++++++++++++++++++++++++++++++++ dlls/quartz/tests/avisplit.c | 28 ++++++++++++++++++++++++++++ dlls/quartz/tests/dsoundrender.c | 14 ++++++++++++++ dlls/quartz/tests/filesource.c | 17 +++++++++++++++++ dlls/quartz/tests/mpegsplit.c | 28 ++++++++++++++++++++++++++++ dlls/quartz/tests/videorenderer.c | 14 ++++++++++++++ dlls/quartz/tests/vmr7.c | 10 ++++++++++ dlls/quartz/tests/vmr9.c | 10 ++++++++++ 8 files changed, 155 insertions(+) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=6463f65adcf9303e5fc7…
1
0
0
0
Zebediah Figura : strmbase: Forbid disconnecting the sink if the filter is not stopped.
by Alexandre Julliard
19 Nov '20
19 Nov '20
Module: wine Branch: master Commit: 9c2cf1317099b464e0984c7925c1a7f667b3513e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9c2cf1317099b464e0984c79…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu Nov 19 11:19:31 2020 -0600 strmbase: Forbid disconnecting the sink if the filter is not stopped. Addendum to 2a6037e263ff3fae8ca82d90b0b141bea1cd473d. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/strmbase/pin.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c index c08f04730e7..d7788cda493 100644 --- a/dlls/strmbase/pin.c +++ b/dlls/strmbase/pin.c @@ -887,6 +887,13 @@ static HRESULT WINAPI sink_Disconnect(IPin *iface) EnterCriticalSection(&pin->pin.filter->csFilter); + if (pin->pin.filter->state != State_Stopped) + { + LeaveCriticalSection(&pin->pin.filter->csFilter); + WARN("Filter is not stopped; returning VFW_E_NOT_STOPPED.\n"); + return VFW_E_NOT_STOPPED; + } + if (pin->pin.peer) { if (pin->pFuncsTable->sink_disconnect)
1
0
0
0
← Newer
1
...
29
30
31
32
33
34
35
...
86
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
Results per page:
10
25
50
100
200