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
March 2024
----- 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
775 discussions
Start a n
N
ew thread
Jacek Caban : widl: Always close parsed input file.
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: 3b12583db0cf68b356f20d7bbd091651af246eff URL:
https://gitlab.winehq.org/wine/wine/-/commit/3b12583db0cf68b356f20d7bbd0916…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Mar 20 13:50:01 2024 +0100 widl: Always close parsed input file. Fixes a regression from 9d537999e315a7, which removed closing the file. This causes Windows widl build to be to remove the temporary file on exit. --- tools/widl/parser.h | 1 + tools/widl/parser.l | 12 ++++++++++-- tools/widl/parser.y | 4 ++-- tools/widl/widl.c | 6 ++---- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/tools/widl/parser.h b/tools/widl/parser.h index 7fef1e755bd..8db115dd03f 100644 --- a/tools/widl/parser.h +++ b/tools/widl/parser.h @@ -42,5 +42,6 @@ int is_warning_enabled(int warning); extern char *find_input_file( const char *name, const char *parent ); extern FILE *open_input_file( const char *path ); +extern void close_all_inputs(void); #endif diff --git a/tools/widl/parser.l b/tools/widl/parser.l index 61266efb9e3..7a1ae18abdc 100644 --- a/tools/widl/parser.l +++ b/tools/widl/parser.l @@ -481,10 +481,11 @@ static void print_imports(void) fprintf( stderr, "%s:%d:\n", state->input_name, state->where.first_line ); } -void pop_import( struct location *where ) +struct location pop_import(void) { struct list *entry = list_head( &import_stack ); struct import_state *state; + struct location where; assert( entry ); state = LIST_ENTRY( entry, struct import_state, entry ); @@ -496,8 +497,9 @@ void pop_import( struct location *where ) yy_switch_to_buffer( state->buffer ); input_name = state->input_name; - *where = state->where; + where = state->where; free( state ); + return where; } void push_import( const char *import_name, struct location *where ) @@ -547,6 +549,12 @@ static void switch_to_acf(void) yy_switch_to_buffer( yy_create_buffer( file, YY_BUF_SIZE ) ); } +void close_all_inputs(void) +{ + while (!list_empty( &import_stack )) pop_import(); + if (yyin) fclose( yyin ); +} + static void reset_location( struct location *where, const char *input_name ) { where->first_line = 1; diff --git a/tools/widl/parser.y b/tools/widl/parser.y index bfd41aa9807..9b6a4c36732 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -118,7 +118,7 @@ static typelib_t *current_typelib; int parser_lex( PARSER_STYPE *yylval, PARSER_LTYPE *yylloc ); void push_import( const char *fname, PARSER_LTYPE *yylloc ); -void pop_import( PARSER_LTYPE *yylloc ); +PARSER_LTYPE pop_import(void); # define YYLLOC_DEFAULT( cur, rhs, n ) \ do { if (n) init_location( &(cur), &YYRHSLOC( rhs, 1 ), &YYRHSLOC( rhs, n ) ); \ @@ -515,7 +515,7 @@ cppquote: tCPPQUOTE '(' aSTRING ')' { $$ = $3; } import_start: tIMPORT aSTRING ';' { $$ = $2; push_import( $2, &yylloc ); } ; -import: import_start imp_statements aEOF { pop_import( &yylloc ); } +import: import_start imp_statements aEOF { yyloc = pop_import(); } ; importlib: tIMPORTLIB '(' aSTRING ')' diff --git a/tools/widl/widl.c b/tools/widl/widl.c index ea6d2ee748f..8003860f743 100644 --- a/tools/widl/widl.c +++ b/tools/widl/widl.c @@ -843,10 +843,8 @@ int main(int argc,char *argv[]) init_types(); ret = parser_parse(); - - if(ret) { - exit(1); - } + close_all_inputs(); + if (ret) exit(1); /* Everything has been done successfully, don't delete any files. */ set_everything(FALSE);
1
0
0
0
Akihiro Sagawa : dsound: Initialize MTA in IDirectSound::Initialize().
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: 6ce8a31b0b87f9dc7ce94c4cba81074510b8c384 URL:
https://gitlab.winehq.org/wine/wine/-/commit/6ce8a31b0b87f9dc7ce94c4cba8107…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Wed Mar 6 23:29:31 2024 +0900 dsound: Initialize MTA in IDirectSound::Initialize(). RE:D Cherish! (Trial ver) depends on this behavior. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53613
--- dlls/dsound/dsound.c | 3 +++ dlls/dsound/dsound_private.h | 1 + dlls/dsound/tests/dsound.c | 4 ---- dlls/dsound/tests/dsound8.c | 4 ---- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c index 57fd6c1a651..7629810db50 100644 --- a/dlls/dsound/dsound.c +++ b/dlls/dsound/dsound.c @@ -207,6 +207,8 @@ static ULONG DirectSoundDevice_Release(DirectSoundDevice * device) WaitForSingleObject(device->thread, INFINITE); CloseHandle(device->thread); } + if (device->mta_cookie) + CoDecrementMTAUsage(device->mta_cookie); EnterCriticalSection(&DSOUND_renderers_lock); list_remove(&device->entry); @@ -332,6 +334,7 @@ static HRESULT DirectSoundDevice_Initialize(DirectSoundDevice ** ppDevice, LPCGU WARN("DSOUND_ReopenDevice failed: %08lx\n", hr); return hr; } + CoIncrementMTAUsage(&device->mta_cookie); ZeroMemory(&device->drvcaps, sizeof(device->drvcaps)); diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h index 34498125317..28bba6cd64e 100644 --- a/dlls/dsound/dsound_private.h +++ b/dlls/dsound/dsound_private.h @@ -90,6 +90,7 @@ struct DirectSoundDevice int lfe_channel; float *tmp_buffer, *cp_buffer; DWORD tmp_buffer_len, cp_buffer_len; + CO_MTA_USAGE_COOKIE mta_cookie; DSVOLUMEPAN volpan; diff --git a/dlls/dsound/tests/dsound.c b/dlls/dsound/tests/dsound.c index da430bb1411..7a815e0ce0b 100644 --- a/dlls/dsound/tests/dsound.c +++ b/dlls/dsound/tests/dsound.c @@ -1879,9 +1879,7 @@ static void test_implicit_mta(void) "IDirectSound_Initialize() failed: %08lx\n", hr); if (hr == DS_OK) { check_apttype(&test_apt_data); - todo_wine ok(test_apt_data.type == APTTYPE_MTA, "got apt type %d.\n", test_apt_data.type); - todo_wine ok(test_apt_data.qualifier == APTTYPEQUALIFIER_IMPLICIT_MTA, "got apt type qualifier %d.\n", test_apt_data.qualifier); } @@ -1896,9 +1894,7 @@ static void test_implicit_mta(void) "DirectSoundCreate() failed: %08lx\n", hr); if (hr == DS_OK) { check_apttype(&test_apt_data); - todo_wine ok(test_apt_data.type == APTTYPE_MTA, "got apt type %d.\n", test_apt_data.type); - todo_wine ok(test_apt_data.qualifier == APTTYPEQUALIFIER_IMPLICIT_MTA, "got apt type qualifier %d.\n", test_apt_data.qualifier); IDirectSound_Release(dso); diff --git a/dlls/dsound/tests/dsound8.c b/dlls/dsound/tests/dsound8.c index 2bdeb49fe97..e95800af83e 100644 --- a/dlls/dsound/tests/dsound8.c +++ b/dlls/dsound/tests/dsound8.c @@ -1903,9 +1903,7 @@ static void test_implicit_mta(void) "IDirectSound8_Initialize() failed: %08lx\n", hr); if (hr == DS_OK) { check_apttype(&test_apt_data); - todo_wine ok(test_apt_data.type == APTTYPE_MTA, "got apt type %d.\n", test_apt_data.type); - todo_wine ok(test_apt_data.qualifier == APTTYPEQUALIFIER_IMPLICIT_MTA, "got apt type qualifier %d.\n", test_apt_data.qualifier); } @@ -1920,9 +1918,7 @@ static void test_implicit_mta(void) "DirectSoundCreate8() failed: %08lx\n", hr); if (hr == DS_OK) { check_apttype(&test_apt_data); - todo_wine ok(test_apt_data.type == APTTYPE_MTA, "got apt type %d.\n", test_apt_data.type); - todo_wine ok(test_apt_data.qualifier == APTTYPEQUALIFIER_IMPLICIT_MTA, "got apt type qualifier %d.\n", test_apt_data.qualifier); IDirectSound8_Release(dso);
1
0
0
0
Akihiro Sagawa : dsound/tests: Add tests for implicit MTA creation in IDirectSound::Initialize().
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: 67153fa0c3865743a1231cb186cef653237fe9c3 URL:
https://gitlab.winehq.org/wine/wine/-/commit/67153fa0c3865743a1231cb186cef6…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Wed Mar 6 23:03:40 2024 +0900 dsound/tests: Add tests for implicit MTA creation in IDirectSound::Initialize(). On recent Windows, at least Windows 7, a multithread apartment (MTA) is initialized within IDirectSound::Initialize(). --- dlls/dsound/tests/dsound.c | 87 +++++++++++++++++++++++++++++++++++++++++ dlls/dsound/tests/dsound8.c | 53 +++++++++++++++++++++++++ dlls/dsound/tests/dsound_test.h | 9 +++++ 3 files changed, 149 insertions(+) diff --git a/dlls/dsound/tests/dsound.c b/dlls/dsound/tests/dsound.c index 500bc19f655..da430bb1411 100644 --- a/dlls/dsound/tests/dsound.c +++ b/dlls/dsound/tests/dsound.c @@ -41,6 +41,40 @@ DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); +static DWORD WINAPI test_apt_thread(void *param) +{ + HRESULT hr; + struct apt_data *test_apt_data = (struct apt_data *)param; + + hr = CoGetApartmentType(&test_apt_data->type, &test_apt_data->qualifier); + if (hr == CO_E_NOTINITIALIZED) + { + test_apt_data->type = APTTYPE_UNITIALIZED; + test_apt_data->qualifier = 0; + } + + return 0; +} + +void check_apttype(struct apt_data *test_apt_data) +{ + HANDLE thread; + MSG msg; + + memset(test_apt_data, 0xde, sizeof(*test_apt_data)); + + thread = CreateThread(NULL, 0, test_apt_thread, test_apt_data, 0, NULL); + while (MsgWaitForMultipleObjects(1, &thread, FALSE, INFINITE, QS_ALLINPUT) != WAIT_OBJECT_0) + { + while (PeekMessageW(&msg, 0, 0, 0, PM_REMOVE)) + { + TranslateMessage(&msg); + DispatchMessageW(&msg); + } + } + CloseHandle(thread); +} + static void IDirectSound_test(LPDIRECTSOUND dso, BOOL initialized, LPCGUID lpGuid) { @@ -1823,10 +1857,63 @@ static void test_hw_buffers(void) IDirectSound_Release(ds); } +static void test_implicit_mta(void) +{ + HRESULT hr; + IDirectSound *dso; + struct apt_data test_apt_data; + + check_apttype(&test_apt_data); + ok(test_apt_data.type == APTTYPE_UNITIALIZED, "got apt type %d.\n", test_apt_data.type); + + /* test DirectSound object */ + hr = CoCreateInstance(&CLSID_DirectSound, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectSound, (void**)&dso); + ok(hr == S_OK, "CoCreateInstance(CLSID_DirectSound) failed: %08lx\n", hr); + + check_apttype(&test_apt_data); + ok(test_apt_data.type == APTTYPE_UNITIALIZED, "got apt type %d.\n", test_apt_data.type); + + hr = IDirectSound_Initialize(dso, NULL); + ok(hr == DS_OK || hr == DSERR_NODRIVER || hr == DSERR_ALLOCATED || hr == E_FAIL, + "IDirectSound_Initialize() failed: %08lx\n", hr); + if (hr == DS_OK) { + check_apttype(&test_apt_data); + todo_wine + ok(test_apt_data.type == APTTYPE_MTA, "got apt type %d.\n", test_apt_data.type); + todo_wine + ok(test_apt_data.qualifier == APTTYPEQUALIFIER_IMPLICIT_MTA, + "got apt type qualifier %d.\n", test_apt_data.qualifier); + } + IDirectSound_Release(dso); + + check_apttype(&test_apt_data); + ok(test_apt_data.type == APTTYPE_UNITIALIZED, "got apt type %d.\n", test_apt_data.type); + + /* test DirectSoundCreate */ + hr = DirectSoundCreate(NULL, &dso, NULL); + ok(hr == DS_OK || hr == DSERR_NODRIVER || hr == DSERR_ALLOCATED || hr == E_FAIL, + "DirectSoundCreate() failed: %08lx\n", hr); + if (hr == DS_OK) { + check_apttype(&test_apt_data); + todo_wine + ok(test_apt_data.type == APTTYPE_MTA, "got apt type %d.\n", test_apt_data.type); + todo_wine + ok(test_apt_data.qualifier == APTTYPEQUALIFIER_IMPLICIT_MTA, + "got apt type qualifier %d.\n", test_apt_data.qualifier); + IDirectSound_Release(dso); + } + + check_apttype(&test_apt_data); + ok(test_apt_data.type == APTTYPE_UNITIALIZED, "got apt type %d.\n", test_apt_data.type); +} + START_TEST(dsound) { CoInitialize(NULL); + /* Run implicit MTA tests before IDirectSound_test so that a MTA won't be created before this test is run. */ + test_implicit_mta(); IDirectSound_tests(); dsound_tests(); test_hw_buffers(); diff --git a/dlls/dsound/tests/dsound8.c b/dlls/dsound/tests/dsound8.c index 8103863e172..2bdeb49fe97 100644 --- a/dlls/dsound/tests/dsound8.c +++ b/dlls/dsound/tests/dsound8.c @@ -1881,6 +1881,57 @@ static void test_AcquireResources(void) IDirectSound_Release(dsound); } +static void test_implicit_mta(void) +{ + HRESULT hr; + IDirectSound8 *dso; + struct apt_data test_apt_data; + + check_apttype(&test_apt_data); + ok(test_apt_data.type == APTTYPE_UNITIALIZED, "got apt type %d.\n", test_apt_data.type); + + /* test DirectSound8 object */ + hr = CoCreateInstance(&CLSID_DirectSound8, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectSound8, (void**)&dso); + ok(hr == S_OK, "CoCreateInstance(CLSID_DirectSound8) failed: %08lx\n", hr); + + check_apttype(&test_apt_data); + ok(test_apt_data.type == APTTYPE_UNITIALIZED, "got apt type %d.\n", test_apt_data.type); + + hr = IDirectSound8_Initialize(dso, NULL); + ok(hr == DS_OK || hr == DSERR_NODRIVER || hr == DSERR_ALLOCATED || hr == E_FAIL, + "IDirectSound8_Initialize() failed: %08lx\n", hr); + if (hr == DS_OK) { + check_apttype(&test_apt_data); + todo_wine + ok(test_apt_data.type == APTTYPE_MTA, "got apt type %d.\n", test_apt_data.type); + todo_wine + ok(test_apt_data.qualifier == APTTYPEQUALIFIER_IMPLICIT_MTA, + "got apt type qualifier %d.\n", test_apt_data.qualifier); + } + IDirectSound8_Release(dso); + + check_apttype(&test_apt_data); + ok(test_apt_data.type == APTTYPE_UNITIALIZED, "got apt type %d.\n", test_apt_data.type); + + /* test DirectSoundCreate8 */ + hr = DirectSoundCreate8(NULL, &dso, NULL); + ok(hr == DS_OK || hr == DSERR_NODRIVER || hr == DSERR_ALLOCATED || hr == E_FAIL, + "DirectSoundCreate8() failed: %08lx\n", hr); + if (hr == DS_OK) { + check_apttype(&test_apt_data); + todo_wine + ok(test_apt_data.type == APTTYPE_MTA, "got apt type %d.\n", test_apt_data.type); + todo_wine + ok(test_apt_data.qualifier == APTTYPEQUALIFIER_IMPLICIT_MTA, + "got apt type qualifier %d.\n", test_apt_data.qualifier); + IDirectSound8_Release(dso); + } + + check_apttype(&test_apt_data); + ok(test_apt_data.type == APTTYPE_UNITIALIZED, "got apt type %d.\n", test_apt_data.type); +} + START_TEST(dsound8) { DWORD cookie; @@ -1888,6 +1939,8 @@ START_TEST(dsound8) CoInitialize(NULL); + /* Run implicit MTA tests before test COM so that a MTA won't be created before this test is run. */ + test_implicit_mta(); test_COM(); IDirectSound8_tests(); dsound8_tests(); diff --git a/dlls/dsound/tests/dsound_test.h b/dlls/dsound/tests/dsound_test.h index 04f995e359d..5ca0a8aa753 100644 --- a/dlls/dsound/tests/dsound_test.h +++ b/dlls/dsound/tests/dsound_test.h @@ -20,6 +20,7 @@ #include "wingdi.h" #include "mmreg.h" +#include "combaseapi.h" /* APTTYPE, APTTYPEQUALIFIER */ static const unsigned int formats[][4]={ { 8000, 8, 1, 0 }, @@ -74,6 +75,13 @@ static const unsigned int formats[][4]={ static const unsigned int format_tags[] = {WAVE_FORMAT_PCM, WAVE_FORMAT_IEEE_FLOAT}; +#define APTTYPE_UNITIALIZED APTTYPE_CURRENT +struct apt_data +{ + APTTYPE type; + APTTYPEQUALIFIER qualifier; +}; + /* The time slice determines how often we will service the buffer */ #define TIME_SLICE 31 #define BUFFER_LEN 400 @@ -90,3 +98,4 @@ extern void test_buffer8(LPDIRECTSOUND8,LPDIRECTSOUNDBUFFER*, extern const char * getDSBCAPS(DWORD xmask); extern int align(int length, int align); extern const char * format_string(const WAVEFORMATEX* wfx); +extern void check_apttype(struct apt_data *);
1
0
0
0
Jinoh Kang : kernelbase: Open object with DELETE access for NtMakeTemporaryObject().
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: 4b0b489f6f57ff5465162de8b2979d3f00cef724 URL:
https://gitlab.winehq.org/wine/wine/-/commit/4b0b489f6f57ff5465162de8b2979d…
Author: Jinoh Kang <jinoh.kang.kr(a)gmail.com> Date: Thu Mar 21 21:24:16 2024 +0900 kernelbase: Open object with DELETE access for NtMakeTemporaryObject(). Fixes: a4ef56e1d9a3f185f788d798851c9c961defc4e3 --- dlls/kernelbase/volume.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/kernelbase/volume.c b/dlls/kernelbase/volume.c index d39613175f9..944c275460c 100644 --- a/dlls/kernelbase/volume.c +++ b/dlls/kernelbase/volume.c @@ -400,7 +400,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH DefineDosDeviceW( DWORD flags, const WCHAR *device InitializeObjectAttributes( &attr, &nt_name, OBJ_CASE_INSENSITIVE | OBJ_PERMANENT, 0, NULL ); if (flags & DDD_REMOVE_DEFINITION) { - if (!set_ntstatus( NtOpenSymbolicLinkObject( &handle, 0, &attr ) )) + if (!set_ntstatus( NtOpenSymbolicLinkObject( &handle, DELETE, &attr ) )) return FALSE; status = NtMakeTemporaryObject( handle );
1
0
0
0
Eric Pouech : winedbg: Don't reload a minidump for a different machine.
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: a7ad588ec568c03708fe1d9abe8079c1ac6ac664 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a7ad588ec568c03708fe1d9abe8079…
Author: Eric Pouech <epouech(a)codeweavers.com> Date: Thu Mar 21 16:13:34 2024 +0100 winedbg: Don't reload a minidump for a different machine. Signed-off-by: Eric Pouech <epouech(a)codeweavers.com> --- programs/winedbg/tgt_minidump.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/programs/winedbg/tgt_minidump.c b/programs/winedbg/tgt_minidump.c index 309d5c526ab..87098491392 100644 --- a/programs/winedbg/tgt_minidump.c +++ b/programs/winedbg/tgt_minidump.c @@ -303,9 +303,10 @@ static enum dbg_start minidump_do_reload(struct tgt_process_minidump_data* data) if (MiniDumpReadDumpStream(data->mapping, SystemInfoStream, &dir, &stream, NULL)) { - MINIDUMP_SYSTEM_INFO* msi = stream; - const char *str; - char tmp[128]; + MINIDUMP_SYSTEM_INFO *msi = stream; + USHORT machine = IMAGE_FILE_MACHINE_UNKNOWN; + const char *str; + char tmp[128]; dbg_printf("WineDbg starting minidump on pid %04lx\n", pid); switch (msi->ProcessorArchitecture) @@ -314,6 +315,7 @@ static enum dbg_start minidump_do_reload(struct tgt_process_minidump_data* data) str = "Unknown"; break; case PROCESSOR_ARCHITECTURE_INTEL: + machine = IMAGE_FILE_MACHINE_I386; strcpy(tmp, "x86 ["); switch (msi->ProcessorLevel) { @@ -355,6 +357,7 @@ static enum dbg_start minidump_do_reload(struct tgt_process_minidump_data* data) str = "PowerPC"; break; case PROCESSOR_ARCHITECTURE_AMD64: + machine = IMAGE_FILE_MACHINE_AMD64; str = "X86_64"; break; case PROCESSOR_ARCHITECTURE_ARM: @@ -462,6 +465,15 @@ static enum dbg_start minidump_do_reload(struct tgt_process_minidump_data* data) code + wes[1], code + wes[2], code + wes[3]); } } + if (machine == IMAGE_FILE_MACHINE_UNKNOWN +#ifdef __x86_64__ + || machine == IMAGE_FILE_MACHINE_I386 +#endif + ) + { + dbg_printf("Cannot reload this minidump because of incompatible/unsupported machine %x\n", machine); + return FALSE; + } } dbg_curr_process = dbg_add_process(&be_process_minidump_io, pid, hProc);
1
0
0
0
Eric Pouech : winedbg: Update the CPU information displayed when reloading a minidump.
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: 70d11a59c6fef598c4dae6032db49425b12dd1c4 URL:
https://gitlab.winehq.org/wine/wine/-/commit/70d11a59c6fef598c4dae6032db494…
Author: Eric Pouech <epouech(a)codeweavers.com> Date: Thu Mar 21 16:37:34 2024 +0100 winedbg: Update the CPU information displayed when reloading a minidump. Signed-off-by: Eric Pouech <epouech(a)codeweavers.com> --- programs/winedbg/tgt_minidump.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/programs/winedbg/tgt_minidump.c b/programs/winedbg/tgt_minidump.c index c2594251d67..309d5c526ab 100644 --- a/programs/winedbg/tgt_minidump.c +++ b/programs/winedbg/tgt_minidump.c @@ -314,17 +314,20 @@ static enum dbg_start minidump_do_reload(struct tgt_process_minidump_data* data) str = "Unknown"; break; case PROCESSOR_ARCHITECTURE_INTEL: - strcpy(tmp, "Intel "); + strcpy(tmp, "x86 ["); switch (msi->ProcessorLevel) { case 3: str = "80386"; break; case 4: str = "80486"; break; case 5: str = "Pentium"; break; - case 6: str = "Pentium Pro/II or AMD Athlon"; break; + case 6: str = "Pentium Pro/II, III, Core, Atom or AMD Athlon"; break; case 15: str = "Pentium 4 or AMD Athlon64"; break; - default: str = "???"; break; + case 23: str = "AMD Zen 1 or 2"; break; + case 25: str = "AMD Zen 3 or 4"; break; + case 26: str = "AMD Zen 5"; break; + default: sprintf(tmp + strlen(tmp), "Proc-level #%x", msi->ProcessorLevel); str = NULL; break; } - strcat(tmp, str); + if (str) strcat(tmp, str); if (msi->ProcessorLevel == 3 || msi->ProcessorLevel == 4) { if (HIBYTE(msi->ProcessorRevision) == 0xFF) @@ -339,6 +342,7 @@ static enum dbg_start minidump_do_reload(struct tgt_process_minidump_data* data) else sprintf(tmp + strlen(tmp), " (%d.%d)", HIBYTE(msi->ProcessorRevision), LOBYTE(msi->ProcessorRevision)); + strcat(tmp, "]"); str = tmp; break; case PROCESSOR_ARCHITECTURE_MIPS:
1
0
0
0
Eric Pouech : winedbg: Flush expr buffer upon internal exception.
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: 97e584b695edf487f5b3dc767ef3b2b436a3b246 URL:
https://gitlab.winehq.org/wine/wine/-/commit/97e584b695edf487f5b3dc767ef3b2…
Author: Eric Pouech <epouech(a)codeweavers.com> Date: Fri Mar 8 11:20:43 2024 +0100 winedbg: Flush expr buffer upon internal exception. Signed-off-by: Eric Pouech <epouech(a)codeweavers.com> --- programs/winedbg/dbg.y | 1 + 1 file changed, 1 insertion(+) diff --git a/programs/winedbg/dbg.y b/programs/winedbg/dbg.y index f3af249ee07..6f4bb10fed8 100644 --- a/programs/winedbg/dbg.y +++ b/programs/winedbg/dbg.y @@ -630,6 +630,7 @@ void parser_handle(const char* filename, HANDLE input) } __ENDTRY; lexeme_flush(); + expr_free_all(); } while (!ret_ok); dbg_parser = prev;
1
0
0
0
Eric Pouech : winedbg: Extend 'attach' command to load minidump files.
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: 2e46d81c64f9ced49b93502b70cedd9d0c92be2f URL:
https://gitlab.winehq.org/wine/wine/-/commit/2e46d81c64f9ced49b93502b70cedd…
Author: Eric Pouech <epouech(a)codeweavers.com> Date: Tue Mar 5 10:15:49 2024 +0100 winedbg: Extend 'attach' command to load minidump files. Signed-off-by: Eric Pouech <epouech(a)codeweavers.com> --- programs/winedbg/dbg.y | 3 ++- programs/winedbg/debugger.h | 3 ++- programs/winedbg/tgt_minidump.c | 28 +++++++++++++++++++--------- programs/winedbg/winedbg.c | 2 +- programs/winedbg/winedbg.man.in | 24 +++++++++++++----------- 5 files changed, 37 insertions(+), 23 deletions(-) diff --git a/programs/winedbg/dbg.y b/programs/winedbg/dbg.y index 6e71d310c22..f3af249ee07 100644 --- a/programs/winedbg/dbg.y +++ b/programs/winedbg/dbg.y @@ -141,10 +141,11 @@ command: | tSYMBOLFILE pathname expr_rvalue { symbol_read_symtable($2, $3); } | tWHATIS expr_lvalue { dbg_printf("type = "); types_print_type(&$2.type, FALSE, NULL); dbg_printf("\n"); } | tATTACH tNUM { dbg_attach_debuggee($2); dbg_active_wait_for_first_exception(); } + | tATTACH pathname { minidump_reload($2); } | tDETACH { dbg_curr_process->process_io->close_process(dbg_curr_process, FALSE); } | tTHREAD tNUM { dbg_set_curr_thread($2); } | tKILL { dbg_curr_process->process_io->close_process(dbg_curr_process, TRUE); } - | tMINIDUMP pathname { minidump_write($2, (dbg_curr_thread && dbg_curr_thread->in_exception) ? &dbg_curr_thread->excpt_record : NULL);} + | tMINIDUMP pathname { minidump_write($2, (dbg_curr_thread && dbg_curr_thread->in_exception) ? &dbg_curr_thread->excpt_record : NULL); } | tECHO tSTRING { dbg_printf("%s\n", $2); } | tEXECFILE pathname { dbg_set_exec_file($2); } | run_command diff --git a/programs/winedbg/debugger.h b/programs/winedbg/debugger.h index 49cab156df1..096fc1e84b0 100644 --- a/programs/winedbg/debugger.h +++ b/programs/winedbg/debugger.h @@ -488,7 +488,8 @@ extern void fetch_module_name(void* name_addr, void* mod_addr, WCHAR /* tgt_minidump.c */ extern void minidump_write(const char*, const EXCEPTION_RECORD*); -extern enum dbg_start minidump_reload(int argc, char* argv[]); +extern enum dbg_start minidump_reload(const char *); +extern enum dbg_start minidump_start(int argc, char* argv[]); /* tgt_module.c */ extern enum dbg_start tgt_module_load(const char* name, BOOL keep); diff --git a/programs/winedbg/tgt_minidump.c b/programs/winedbg/tgt_minidump.c index ac8d9be71b2..c2594251d67 100644 --- a/programs/winedbg/tgt_minidump.c +++ b/programs/winedbg/tgt_minidump.c @@ -307,7 +307,7 @@ static enum dbg_start minidump_do_reload(struct tgt_process_minidump_data* data) const char *str; char tmp[128]; - dbg_printf("WineDbg starting on minidump on pid %04lx\n", pid); + dbg_printf("WineDbg starting minidump on pid %04lx\n", pid); switch (msi->ProcessorArchitecture) { case PROCESSOR_ARCHITECTURE_UNKNOWN: @@ -564,23 +564,23 @@ static void cleanup(struct tgt_process_minidump_data* data) static struct be_process_io be_process_minidump_io; -enum dbg_start minidump_reload(int argc, char* argv[]) +enum dbg_start minidump_reload(const char* filename) { struct tgt_process_minidump_data* data; enum dbg_start ret = start_error_parse; - /* try the form <myself> minidump-file */ - if (argc != 1) return start_error_parse; - - WINE_TRACE("Processing Minidump file %s\n", argv[0]); - + if (dbg_curr_process) + { + dbg_printf("Already attached to a process. Use 'detach' or 'kill' before loading a minidump file'\n"); + return start_error_init; + } data = malloc(sizeof(struct tgt_process_minidump_data)); if (!data) return start_error_init; data->mapping = NULL; data->hMap = NULL; data->hFile = INVALID_HANDLE_VALUE; - if ((data->hFile = CreateFileA(argv[0], GENERIC_READ, FILE_SHARE_READ, NULL, + if ((data->hFile = CreateFileA(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) != INVALID_HANDLE_VALUE && ((data->hMap = CreateFileMappingA(data->hFile, NULL, PAGE_READONLY, 0, 0, NULL)) != 0) && ((data->mapping = MapViewOfFile(data->hMap, FILE_MAP_READ, 0, 0, 0)) != NULL)) @@ -594,7 +594,7 @@ enum dbg_start minidump_reload(int argc, char* argv[]) } __EXCEPT_PAGE_FAULT { - dbg_printf("Unexpected fault while reading minidump %s\n", argv[0]); + dbg_printf("Unexpected fault while reading minidump %s\n", filename); dbg_curr_pid = 0; } __ENDTRY; @@ -603,6 +603,16 @@ enum dbg_start minidump_reload(int argc, char* argv[]) return ret; } +enum dbg_start minidump_start(int argc, char* argv[]) +{ + /* try the form <myself> minidump-file */ + if (argc != 1) return start_error_parse; + + WINE_TRACE("Processing Minidump file %s\n", argv[0]); + + return minidump_reload(argv[0]); +} + static BOOL tgt_process_minidump_close_process(struct dbg_process* pcs, BOOL kill) { struct tgt_process_minidump_data* data = private_data(pcs); diff --git a/programs/winedbg/winedbg.c b/programs/winedbg/winedbg.c index b642284f73b..c7f14e8238f 100644 --- a/programs/winedbg/winedbg.c +++ b/programs/winedbg/winedbg.c @@ -786,7 +786,7 @@ int main(int argc, char** argv) } if (!argc) ds = start_ok; else if ((ds = dbg_active_attach(argc, argv)) == start_error_parse && - (ds = minidump_reload(argc, argv)) == start_error_parse) + (ds = minidump_start(argc, argv)) == start_error_parse) ds = dbg_active_launch(argc, argv); switch (ds) { diff --git a/programs/winedbg/winedbg.man.in b/programs/winedbg/winedbg.man.in index 1380832537f..ec9b1bb37ea 100644 --- a/programs/winedbg/winedbg.man.in +++ b/programs/winedbg/winedbg.man.in @@ -138,18 +138,26 @@ Exits the debugger. Attach to a Wine process (\fIN\fR is its Windows ID, numeric or hexadecimal). IDs can be obtained using the \fBinfo\ process\fR command. Note the \fBinfo\ process\fR command returns hexadecimal values -.IP +.IP \fBattach\ \fIfile.mdmp\fR +Reload the state of a debuggee from the minidump \fIfile.mdmp\fR. +See the \fBminidump\fR command to save such a file. .IP \fBdetach\fR -Detach from a Wine-process. -.IP \fBthread\ \fIN\fR -Change the current thread to \fIN\fR (its Windows TID, numeric or hexadecimal). -.IP +Detach the current Wine-process. The process is no longer debugged by WineDbg, +but is still running (for a live target). +.IP \fBkill\fR +Kills the current Wine-process. The process is no longer debugged by WineDbg, +and is also terminated (for a live target). +.IP \fBminidump\fR\ \fIfile.mdmp\fR +Saves the debugging context of the debuggee into a minidump file called +\fIfile.mdmp\fR. .IP \fBrun\fR Re-run the same process with the same arguments. Note: all breakpoints of precedent process are no longer available. .IP \fBrun\ \fIarg1\ arg2...\fR Re-run the same process with arguments \fIarg1\ arg2...\fR. Note: all breakpoints of precedent process are no longer available. +.IP \fBthread\ \fIN\fR +Change the current thread to \fIN\fR (its Windows TID, numeric or hexadecimal). .PP \fIHelp commands\fR .IP \fBhelp\fR @@ -355,12 +363,6 @@ When specifying an identifier, if several symbols with this name exist, the debugger will prompt for the symbol you want to use. Pick up the one you want from its number. .PP -\fIMisc.\fR -.PP -.BI "minidump " file.mdmp -saves the debugging context of the debuggee into a minidump file called -\fIfile.mdmp\fR. -.PP \fIInformation on Wine internals\fR .IP \fBinfo\ class\fR Lists all Windows classes registered in Wine
1
0
0
0
Eric Pouech : winedbg: Add ability to set executable name.
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: 8a65cdd13d431ed47f778639decc6d345d1a99f5 URL:
https://gitlab.winehq.org/wine/wine/-/commit/8a65cdd13d431ed47f778639decc6d…
Author: Eric Pouech <epouech(a)codeweavers.com> Date: Wed Mar 20 10:21:28 2024 +0100 winedbg: Add ability to set executable name. Either from command line option, or as a command. Mostly handy for scripting. Signed-off-by: Eric Pouech <epouech(a)codeweavers.com> --- programs/winedbg/dbg.y | 3 ++- programs/winedbg/debug.l | 1 + programs/winedbg/debugger.h | 1 + programs/winedbg/tgt_active.c | 7 +++++++ programs/winedbg/winedbg.c | 14 +++++++++----- programs/winedbg/winedbg.man.in | 2 ++ 6 files changed, 22 insertions(+), 6 deletions(-) diff --git a/programs/winedbg/dbg.y b/programs/winedbg/dbg.y index fc9a2977041..6e71d310c22 100644 --- a/programs/winedbg/dbg.y +++ b/programs/winedbg/dbg.y @@ -58,7 +58,7 @@ static void parser(const char*); %token <string> tPATH tIDENTIFIER tSTRING tINTVAR %token <integer> tNUM tFORMAT %token <type> tTYPEDEF -%token tSYMBOLFILE tRUN tATTACH tDETACH tKILL tMAINTENANCE tTYPE tMINIDUMP +%token tSYMBOLFILE tEXECFILE tRUN tATTACH tDETACH tKILL tMAINTENANCE tTYPE tMINIDUMP %token tNOPROCESS tWOW /* can be prefixed by module name */ @@ -146,6 +146,7 @@ command: | tKILL { dbg_curr_process->process_io->close_process(dbg_curr_process, TRUE); } | tMINIDUMP pathname { minidump_write($2, (dbg_curr_thread && dbg_curr_thread->in_exception) ? &dbg_curr_thread->excpt_record : NULL);} | tECHO tSTRING { dbg_printf("%s\n", $2); } + | tEXECFILE pathname { dbg_set_exec_file($2); } | run_command | list_command | disassemble_command diff --git a/programs/winedbg/debug.l b/programs/winedbg/debug.l index dd7fb0db76f..a05a27dfc79 100644 --- a/programs/winedbg/debug.l +++ b/programs/winedbg/debug.l @@ -224,6 +224,7 @@ STRING \"(\\[^\n]|[^\\"\n])*\" <INITIAL>rwatch|rwatc|rwat { BEGIN(NOCMD); return tRWATCH; } <INITIAL>whatis|whati|what { BEGIN(NOCMD); return tWHATIS; } <INITIAL,NOPROCESS>run|ru|r { BEGIN(AWORD_EXPECTED); return tRUN;} +<INITIAL,NOPROCESS>exec-file { BEGIN(PATH_EXPECTED); return tEXECFILE;} <INITIAL>detach|detac|deta|det { BEGIN(NOCMD); return tDETACH; } <INITIAL>kill|kil|ki|k { BEGIN(NOCMD); return tKILL; } <INITIAL,NOPROCESS>maintenance|maint { BEGIN(MAINT_CMD); return tMAINTENANCE; } diff --git a/programs/winedbg/debugger.h b/programs/winedbg/debugger.h index c65b9bfae67..49cab156df1 100644 --- a/programs/winedbg/debugger.h +++ b/programs/winedbg/debugger.h @@ -474,6 +474,7 @@ struct list_string char* string; struct list_string* next; }; +extern void dbg_set_exec_file(const char *path); extern void dbg_run_debuggee(struct list_string* ls); extern void dbg_wait_next_exception(DWORD cont, int count, int mode); extern enum dbg_start dbg_active_attach(int argc, char* argv[]); diff --git a/programs/winedbg/tgt_active.c b/programs/winedbg/tgt_active.c index 9587ef450d2..209d82374c6 100644 --- a/programs/winedbg/tgt_active.c +++ b/programs/winedbg/tgt_active.c @@ -87,6 +87,7 @@ BOOL dbg_attach_debuggee(DWORD pid) SetEnvironmentVariableA("DBGHELP_NOLIVE", NULL); dbg_curr_process->active_debuggee = TRUE; + dbg_printf("WineDbg attached to pid %04lx\n", dbg_curr_pid); return TRUE; } @@ -670,6 +671,7 @@ static BOOL dbg_start_debuggee(LPSTR cmdLine) free(dbg_last_cmd_line); dbg_last_cmd_line = cmdLine; } + dbg_printf("WineDbg starting on pid %04lx\n", dbg_curr_pid); return TRUE; } @@ -755,6 +757,11 @@ static char *dbg_build_command_line( char **argv ) return ret; } +void dbg_set_exec_file(const char *path) +{ + free(dbg_executable); + dbg_executable = strdup(path); +} void dbg_run_debuggee(struct list_string* ls) { diff --git a/programs/winedbg/winedbg.c b/programs/winedbg/winedbg.c index 39ce6cbf8a9..b642284f73b 100644 --- a/programs/winedbg/winedbg.c +++ b/programs/winedbg/winedbg.c @@ -637,11 +637,8 @@ void dbg_start_interactive(const char* filename, HANDLE hFile) struct dbg_process* p; struct dbg_process* p2; - if (dbg_curr_process) - { - dbg_printf("WineDbg starting on pid %04lx\n", dbg_curr_pid); - if (dbg_curr_process->active_debuggee) dbg_active_wait_for_first_exception(); - } + if (dbg_curr_process && dbg_curr_process->active_debuggee) + dbg_active_wait_for_first_exception(); dbg_interactiveP = TRUE; parser_handle(filename, hFile); @@ -759,6 +756,13 @@ int main(int argc, char** argv) argc--; argv++; continue; } + if (!strcmp(argv[0], "--exec") && argc > 1) + { + argc--; argv++; + dbg_set_exec_file(argv[0]); + argc--; argv++; + continue; + } if (!strcmp(argv[0], "--file") && argc > 1) { argc--; argv++; diff --git a/programs/winedbg/winedbg.man.in b/programs/winedbg/winedbg.man.in index c58696ba1c9..1380832537f 100644 --- a/programs/winedbg/winedbg.man.in +++ b/programs/winedbg/winedbg.man.in @@ -61,6 +61,8 @@ When in \fBdefault\fR mode, the following options are available: \fBwinedbg\fR will execute the command \fIstring\fR as if it was keyed on winedbg command line, and then will exit. This can be handy for getting the pid of running processes (winedbg --command "info proc"). +.IP \fB--exec\ \fIfilename\fR +Sets the executable name, without starting the executable. .IP \fB--file\ \fIfilename\fR \fBwinedbg\fR will execute the list of commands contained in file filename as if they were keyed on winedbg command line, and then
1
0
0
0
Rémi Bernon : server: Avoid removing thread twice from its desktop thread list.
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: 5d91ab65faf9ffab3e36619aedb870a6aa17410d URL:
https://gitlab.winehq.org/wine/wine/-/commit/5d91ab65faf9ffab3e36619aedb870…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Mar 21 18:49:56 2024 +0100 server: Avoid removing thread twice from its desktop thread list. --- server/winstation.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/server/winstation.c b/server/winstation.c index 3af4c365ec3..80126ad5d60 100644 --- a/server/winstation.c +++ b/server/winstation.c @@ -403,21 +403,24 @@ static void add_desktop_thread( struct desktop *desktop, struct thread *thread ) } /* remove a user of the desktop and start the close timeout if necessary */ -static void remove_desktop_thread( struct desktop *desktop, struct thread *thread ) +static void remove_desktop_user( struct desktop *desktop, struct thread *thread ) { struct process *process; - list_remove( &thread->desktop_entry ); + assert( desktop->users > 0 ); + desktop->users--; - if (!thread->process->is_system) - { - assert( desktop->users > 0 ); - desktop->users--; + /* if we have one remaining user, it has to be the manager of the desktop window */ + if ((process = get_top_window_owner( desktop )) && desktop->users == process->running_threads && !desktop->close_timeout) + desktop->close_timeout = add_timeout_user( -TICKS_PER_SEC, close_desktop_timeout, desktop ); +} - /* if we have one remaining user, it has to be the manager of the desktop window */ - if ((process = get_top_window_owner( desktop )) && desktop->users == process->running_threads && !desktop->close_timeout) - desktop->close_timeout = add_timeout_user( -TICKS_PER_SEC, close_desktop_timeout, desktop ); - } +/* remove a thread from the list of threads attached to a desktop */ +static void remove_desktop_thread( struct desktop *desktop, struct thread *thread ) +{ + list_remove( &thread->desktop_entry ); + + if (!thread->process->is_system) remove_desktop_user( desktop, thread ); if (desktop == desktop->winstation->input_desktop) { @@ -546,7 +549,8 @@ void release_thread_desktop( struct thread *thread, int close ) if (!(desktop = get_desktop_obj( thread->process, handle, 0 ))) clear_error(); /* ignore errors */ else { - remove_desktop_thread( desktop, thread ); + if (close) remove_desktop_thread( desktop, thread ); + else remove_desktop_user( desktop, thread ); release_object( desktop ); }
1
0
0
0
← Newer
1
...
15
16
17
18
19
20
21
...
78
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
Results per page:
10
25
50
100
200