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
June
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
September 2021
----- 2025 -----
June 2025
May 2025
April 2025
March 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
1030 discussions
Start a n
N
ew thread
Zebediah Figura : ntdll: Do not fill the IOSB if a device IRP failed synchronously.
by Alexandre Julliard
14 Sep '21
14 Sep '21
Module: wine Branch: master Commit: 5af74129bd5d5f5c37ba25393da74c077fcb4676 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5af74129bd5d5f5c37ba2539…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Tue Sep 14 01:02:44 2021 -0500 ntdll: Do not fill the IOSB if a device IRP failed synchronously. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/volume.c | 16 ++++++++-------- dlls/ntdll/unix/server.c | 1 + dlls/ntoskrnl.exe/tests/ntoskrnl.c | 28 ++++++++++++++-------------- server/async.c | 10 +++++++++- 4 files changed, 32 insertions(+), 23 deletions(-) diff --git a/dlls/kernel32/tests/volume.c b/dlls/kernel32/tests/volume.c index cb35de6add1..723dfabb817 100644 --- a/dlls/kernel32/tests/volume.c +++ b/dlls/kernel32/tests/volume.c @@ -1641,8 +1641,8 @@ static void test_mountmgr_query_points(void) status = NtDeviceIoControlFile( file, NULL, NULL, NULL, &io, IOCTL_MOUNTMGR_QUERY_POINTS, NULL, 0, NULL, 0 ); ok(status == STATUS_INVALID_PARAMETER, "got %#x\n", status); - todo_wine ok(io.Status == 0xdeadf00d, "got status %#x\n", io.Status); - todo_wine ok(io.Information == 0xdeadf00d, "got information %#Ix\n", io.Information); + ok(io.Status == 0xdeadf00d, "got status %#x\n", io.Status); + ok(io.Information == 0xdeadf00d, "got information %#Ix\n", io.Information); memset( input, 0, sizeof(*input) ); @@ -1651,16 +1651,16 @@ static void test_mountmgr_query_points(void) status = NtDeviceIoControlFile( file, NULL, NULL, NULL, &io, IOCTL_MOUNTMGR_QUERY_POINTS, input, sizeof(*input) - 1, NULL, 0 ); ok(status == STATUS_INVALID_PARAMETER, "got %#x\n", status); - todo_wine ok(io.Status == 0xdeadf00d, "got status %#x\n", io.Status); - todo_wine ok(io.Information == 0xdeadf00d, "got information %#Ix\n", io.Information); + ok(io.Status == 0xdeadf00d, "got status %#x\n", io.Status); + ok(io.Information == 0xdeadf00d, "got information %#Ix\n", io.Information); io.Status = 0xdeadf00d; io.Information = 0xdeadf00d; status = NtDeviceIoControlFile( file, NULL, NULL, NULL, &io, IOCTL_MOUNTMGR_QUERY_POINTS, input, sizeof(*input), NULL, 0 ); ok(status == STATUS_INVALID_PARAMETER, "got %#x\n", status); - todo_wine ok(io.Status == 0xdeadf00d, "got status %#x\n", io.Status); - todo_wine ok(io.Information == 0xdeadf00d, "got information %#Ix\n", io.Information); + ok(io.Status == 0xdeadf00d, "got status %#x\n", io.Status); + ok(io.Information == 0xdeadf00d, "got information %#Ix\n", io.Information); io.Status = 0xdeadf00d; io.Information = 0xdeadf00d; @@ -1668,8 +1668,8 @@ static void test_mountmgr_query_points(void) status = NtDeviceIoControlFile( file, NULL, NULL, NULL, &io, IOCTL_MOUNTMGR_QUERY_POINTS, input, sizeof(*input), output, sizeof(*output) - 1 ); ok(status == STATUS_INVALID_PARAMETER, "got %#x\n", status); - todo_wine ok(io.Status == 0xdeadf00d, "got status %#x\n", io.Status); - todo_wine ok(io.Information == 0xdeadf00d, "got information %#Ix\n", io.Information); + ok(io.Status == 0xdeadf00d, "got status %#x\n", io.Status); + ok(io.Information == 0xdeadf00d, "got information %#Ix\n", io.Information); ok(output->Size == 0xcccccccc, "got size %u\n", output->Size); ok(output->NumberOfMountPoints == 0xcccccccc, "got count %u\n", output->NumberOfMountPoints); diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c index d0cfd4cd46c..08733fba710 100644 --- a/dlls/ntdll/unix/server.c +++ b/dlls/ntdll/unix/server.c @@ -385,6 +385,7 @@ static void invoke_system_apc( const apc_call_t *call, apc_result_t *result, BOO if (result->async_io.status != STATUS_PENDING) { result->async_io.total = info; + /* the server will pass us NULL if a call failed synchronously */ set_async_iosb( call->async_io.sb, result->async_io.status, info ); } break; diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index bd34e37e176..edc4a607225 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -690,8 +690,8 @@ static void do_return_status(ULONG ioctl, struct return_status_params *params) ok(ret == expect_status, "got %#x\n", ret); if (NT_ERROR(params->iosb_status)) { - todo_wine ok(io.Status == 0xdeadf00d, "got %#x\n", io.Status); - todo_wine ok(io.Information == 0xdeadf00d, "got size %Iu\n", io.Information); + ok(io.Status == 0xdeadf00d, "got %#x\n", io.Status); + ok(io.Information == 0xdeadf00d, "got size %Iu\n", io.Information); } else { @@ -726,8 +726,8 @@ static void do_return_status(ULONG ioctl, struct return_status_params *params) "got %#x\n", ret); if (!params->pending && NT_ERROR(params->iosb_status)) { - todo_wine ok(io.Status == 0xdeadf00d, "got %#x\n", io.Status); - todo_wine ok(io.Information == 0xdeadf00d, "got size %Iu\n", io.Information); + ok(io.Status == 0xdeadf00d, "got %#x\n", io.Status); + ok(io.Information == 0xdeadf00d, "got size %Iu\n", io.Information); ret = WaitForSingleObject(event, 0); ok(ret == WAIT_TIMEOUT, "got %d\n", ret); } @@ -778,8 +778,8 @@ static void do_return_status(ULONG ioctl, struct return_status_params *params) "got %#x\n", ret); if (!params->pending && NT_ERROR(params->iosb_status)) { - todo_wine ok(io.Status == 0xdeadf00d, "got %#x\n", io.Status); - todo_wine ok(io.Information == 0xdeadf00d, "got size %Iu\n", io.Information); + ok(io.Status == 0xdeadf00d, "got %#x\n", io.Status); + ok(io.Information == 0xdeadf00d, "got size %Iu\n", io.Information); ret = WaitForSingleObject(event, 0); ok(ret == WAIT_TIMEOUT, "got %d\n", ret); } @@ -810,8 +810,8 @@ static void do_return_status(ULONG ioctl, struct return_status_params *params) "got %#x\n", ret); if (!params->pending && NT_ERROR(params->iosb_status)) { - todo_wine ok(io.Status == 0xdeadf00d, "got %#x\n", io.Status); - todo_wine ok(io.Information == 0xdeadf00d, "got size %Iu\n", io.Information); + ok(io.Status == 0xdeadf00d, "got %#x\n", io.Status); + ok(io.Information == 0xdeadf00d, "got size %Iu\n", io.Information); ret = WaitForSingleObject(file, 0); ok(ret == WAIT_TIMEOUT, "got %d\n", ret); } @@ -846,8 +846,8 @@ static void do_return_status(ULONG ioctl, struct return_status_params *params) "got %#x\n", ret); if (!params->pending && NT_ERROR(params->iosb_status)) { - todo_wine ok(io.Status == 0xdeadf00d, "got %#x\n", io.Status); - todo_wine ok(io.Information == 0xdeadf00d, "got size %Iu\n", io.Information); + ok(io.Status == 0xdeadf00d, "got %#x\n", io.Status); + ok(io.Information == 0xdeadf00d, "got size %Iu\n", io.Information); ret = WaitForSingleObject(event, 0); ok(ret == WAIT_TIMEOUT, "got %d\n", ret); } @@ -915,8 +915,8 @@ static void do_return_status(ULONG ioctl, struct return_status_params *params) ok(ret == params->ret_status, "got %#x\n", ret); if (!params->pending && NT_ERROR(params->iosb_status)) { - todo_wine ok(io.Status == 0xdeadf00d, "got %#x\n", io.Status); - todo_wine ok(io.Information == 0xdeadf00d, "got size %Iu\n", io.Information); + ok(io.Status == 0xdeadf00d, "got %#x\n", io.Status); + ok(io.Information == 0xdeadf00d, "got size %Iu\n", io.Information); } else { @@ -1151,8 +1151,8 @@ static void test_blocking_irp(void) io.Information = 0xdeadf00d; status = NtQueryVolumeInformationFile(file, &io, buffer, sizeof(buffer), FileFsFullSizeInformation); ok(status == STATUS_DEVICE_NOT_READY, "got %#x\n", status); - todo_wine ok(io.Status == 0xdeadf00d, "got iosb status %#x\n", io.Status); - todo_wine ok(io.Information == 0xdeadf00d, "got information %#Ix\n", io.Information); + ok(io.Status == 0xdeadf00d, "got iosb status %#x\n", io.Status); + ok(io.Information == 0xdeadf00d, "got information %#Ix\n", io.Information); CloseHandle(file); diff --git a/server/async.c b/server/async.c index bdc7620e9a1..1a564ff1a69 100644 --- a/server/async.c +++ b/server/async.c @@ -184,9 +184,17 @@ void async_terminate( struct async *async, unsigned int status ) memset( &data, 0, sizeof(data) ); data.type = APC_ASYNC_IO; data.async_io.user = async->data.user; - data.async_io.sb = async->data.iosb; data.async_io.result = iosb ? iosb->result : 0; + /* this can happen if the initial status was unknown (i.e. for device + * files). the client should not fill the IOSB in this case; pass it as + * NULL to communicate that. + * note that we check the IOSB status and not the initial status */ + if (NT_ERROR( status ) && (!is_fd_overlapped( async->fd ) || !async->pending)) + data.async_io.sb = 0; + else + data.async_io.sb = async->data.iosb; + /* if there is output data, the client needs to make an extra request * to retrieve it; use STATUS_ALERTED to signal this case */ if (iosb && iosb->out_data)
1
0
0
0
Zebediah Figura : server: Pass the async result size as part of apc_call_t.
by Alexandre Julliard
14 Sep '21
14 Sep '21
Module: wine Branch: master Commit: 1ee382c706bed683e7263c867fd6599dd6920103 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1ee382c706bed683e7263c86…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Tue Sep 14 01:02:43 2021 -0500 server: Pass the async result size as part of apc_call_t. Only really an optimization (plus it makes the code a little conceptually simpler). Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/file.c | 1 - dlls/ntdll/unix/server.c | 2 +- dlls/ntdll/unix/socket.c | 15 ++++----------- include/wine/server_protocol.h | 5 ++--- server/async.c | 9 ++++----- server/protocol.def | 2 +- server/request.h | 3 +-- server/trace.c | 5 ++--- 8 files changed, 15 insertions(+), 27 deletions(-) diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 712f94ec43f..5da9ca560f6 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -4690,7 +4690,6 @@ static NTSTATUS irp_completion( void *user, ULONG_PTR *info, NTSTATUS status ) req->user_arg = wine_server_client_ptr( async ); wine_server_set_reply( req, async->buffer, async->size ); status = virtual_locked_server_call( req ); - *info = reply->size; } SERVER_END_REQ; } diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c index 986eb6c3250..d0cfd4cd46c 100644 --- a/dlls/ntdll/unix/server.c +++ b/dlls/ntdll/unix/server.c @@ -378,7 +378,7 @@ static void invoke_system_apc( const apc_call_t *call, apc_result_t *result, BOO case APC_ASYNC_IO: { struct async_fileio *user = wine_server_get_ptr( call->async_io.user ); - ULONG_PTR info = 0; + ULONG_PTR info = call->async_io.result; result->type = call->type; result->async_io.status = user->callback( user, &info, call->async_io.status ); diff --git a/dlls/ntdll/unix/socket.c b/dlls/ntdll/unix/socket.c index 8469def786a..db58d2e5b12 100644 --- a/dlls/ntdll/unix/socket.c +++ b/dlls/ntdll/unix/socket.c @@ -565,7 +565,6 @@ static NTSTATUS try_recv( int fd, struct async_recv_ioctl *async, ULONG_PTR *siz static NTSTATUS async_recv_proc( void *user, ULONG_PTR *info, NTSTATUS status ) { struct async_recv_ioctl *async = user; - ULONG_PTR information = 0; int fd, needs_close; TRACE( "%#x\n", status ); @@ -575,19 +574,15 @@ static NTSTATUS async_recv_proc( void *user, ULONG_PTR *info, NTSTATUS status ) if ((status = server_get_unix_fd( async->io.handle, 0, &fd, &needs_close, NULL, NULL ))) return status; - status = try_recv( fd, async, &information ); - TRACE( "got status %#x, %#lx bytes read\n", status, information ); + status = try_recv( fd, async, info ); + TRACE( "got status %#x, %#lx bytes read\n", status, *info ); if (status == STATUS_DEVICE_NOT_READY) status = STATUS_PENDING; if (needs_close) close( fd ); } - if (status != STATUS_PENDING) - { - *info = information; - release_fileio( &async->io ); - } + if (status != STATUS_PENDING) release_fileio( &async->io ); return status; } @@ -704,7 +699,6 @@ static ULONG_PTR fill_poll_output( struct async_poll_ioctl *async, NTSTATUS stat static NTSTATUS async_poll_proc( void *user, ULONG_PTR *info, NTSTATUS status ) { struct async_poll_ioctl *async = user; - ULONG_PTR information = 0; if (status == STATUS_ALERTED) { @@ -716,12 +710,11 @@ static NTSTATUS async_poll_proc( void *user, ULONG_PTR *info, NTSTATUS status ) } SERVER_END_REQ; - information = fill_poll_output( async, status ); + *info = fill_poll_output( async, status ); } if (status != STATUS_PENDING) { - *info = information; free( async->input ); release_fileio( &async->io ); } diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index e22da223894..e5437576193 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -492,6 +492,7 @@ typedef union unsigned int status; client_ptr_t user; client_ptr_t sb; + data_size_t result; } async_io; struct { @@ -2896,9 +2897,7 @@ struct get_async_result_request struct get_async_result_reply { struct reply_header __header; - data_size_t size; /* VARARG(out_data,bytes); */ - char __pad_12[4]; }; @@ -6257,7 +6256,7 @@ union generic_reply /* ### protocol_version begin ### */ -#define SERVER_PROTOCOL_VERSION 729 +#define SERVER_PROTOCOL_VERSION 730 /* ### protocol_version end ### */ diff --git a/server/async.c b/server/async.c index 7cffd24a18b..bdc7620e9a1 100644 --- a/server/async.c +++ b/server/async.c @@ -185,11 +185,11 @@ void async_terminate( struct async *async, unsigned int status ) data.type = APC_ASYNC_IO; data.async_io.user = async->data.user; data.async_io.sb = async->data.iosb; + data.async_io.result = iosb ? iosb->result : 0; - /* if the result is nonzero or there is output data, the client needs to - * make an extra request to retrieve them; use STATUS_ALERTED to signal - * this case */ - if (iosb && (iosb->result || iosb->out_data)) + /* if there is output data, the client needs to make an extra request + * to retrieve it; use STATUS_ALERTED to signal this case */ + if (iosb && iosb->out_data) data.async_io.status = STATUS_ALERTED; else data.async_io.status = status; @@ -719,6 +719,5 @@ DECL_HANDLER(get_async_result) iosb->out_data = NULL; } } - reply->size = iosb->result; set_error( iosb->status ); } diff --git a/server/protocol.def b/server/protocol.def index 02c1f269be7..cc1887dae2d 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -508,6 +508,7 @@ typedef union unsigned int status; /* I/O status */ client_ptr_t user; /* user pointer */ client_ptr_t sb; /* status block */ + data_size_t result; /* result size */ } async_io; struct { @@ -2156,7 +2157,6 @@ enum message_type @REQ(get_async_result) client_ptr_t user_arg; /* user arg used to identify async */ @REPLY - data_size_t size; /* result size (input or output depending on the operation) */ VARARG(out_data,bytes); /* iosb output data */ @END diff --git a/server/request.h b/server/request.h index f3567cd967f..6fe708e065f 100644 --- a/server/request.h +++ b/server/request.h @@ -1396,8 +1396,7 @@ C_ASSERT( FIELD_OFFSET(struct cancel_async_request, only_thread) == 24 ); C_ASSERT( sizeof(struct cancel_async_request) == 32 ); C_ASSERT( FIELD_OFFSET(struct get_async_result_request, user_arg) == 16 ); C_ASSERT( sizeof(struct get_async_result_request) == 24 ); -C_ASSERT( FIELD_OFFSET(struct get_async_result_reply, size) == 8 ); -C_ASSERT( sizeof(struct get_async_result_reply) == 16 ); +C_ASSERT( sizeof(struct get_async_result_reply) == 8 ); C_ASSERT( FIELD_OFFSET(struct read_request, async) == 16 ); C_ASSERT( FIELD_OFFSET(struct read_request, pos) == 56 ); C_ASSERT( sizeof(struct read_request) == 64 ); diff --git a/server/trace.c b/server/trace.c index da8c74cea2b..cfa6eefc36c 100644 --- a/server/trace.c +++ b/server/trace.c @@ -181,7 +181,7 @@ static void dump_apc_call( const char *prefix, const apc_call_t *call ) case APC_ASYNC_IO: dump_uint64( "APC_ASYNC_IO,user=", &call->async_io.user ); dump_uint64( ",sb=", &call->async_io.sb ); - fprintf( stderr, ",status=%s", get_status_name(call->async_io.status) ); + fprintf( stderr, ",status=%s,result=%u", get_status_name(call->async_io.status), call->async_io.result ); break; case APC_VIRTUAL_ALLOC: dump_uint64( "APC_VIRTUAL_ALLOC,addr==", &call->virtual_alloc.addr ); @@ -2845,8 +2845,7 @@ static void dump_get_async_result_request( const struct get_async_result_request static void dump_get_async_result_reply( const struct get_async_result_reply *req ) { - fprintf( stderr, " size=%u", req->size ); - dump_varargs_bytes( ", out_data=", cur_size ); + dump_varargs_bytes( " out_data=", cur_size ); } static void dump_read_request( const struct read_request *req )
1
0
0
0
Henri Verbeet : wined3d: Use wined3d_mask_from_size() in wined3d_fixup_alpha().
by Alexandre Julliard
14 Sep '21
14 Sep '21
Module: wine Branch: master Commit: 554a4a111a0ed9e49ff0461ad0d76c9a3156657a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=554a4a111a0ed9e49ff0461a…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Fri Sep 10 21:32:51 2021 +0200 wined3d: Use wined3d_mask_from_size() in wined3d_fixup_alpha(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/texture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 6663e788e9c..08b57cf1a36 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -2358,7 +2358,7 @@ static void wined3d_fixup_alpha(const struct wined3d_format *format, const uint8 unsigned int x, y; byte_count = format->byte_count; - alpha_mask = ((1u << format->alpha_size) - 1) << format->alpha_offset; + alpha_mask = wined3d_mask_from_size(format->alpha_size) << format->alpha_offset; switch (byte_count) {
1
0
0
0
Henri Verbeet : wined3d: Use WGL_SWAP_COPY_ARB for swapchains with COPY swap effects, if available.
by Alexandre Julliard
14 Sep '21
14 Sep '21
Module: wine Branch: master Commit: 4261369e5d8f1d71e8d207474751585fe9f90cc5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4261369e5d8f1d71e8d20747…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Fri Sep 10 21:32:50 2021 +0200 wined3d: Use WGL_SWAP_COPY_ARB for swapchains with COPY swap effects, if available. Avoiding the (slow) GDI present path. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/adapter_gl.c | 7 +++++-- dlls/wined3d/context_gl.c | 30 ++++++++++++++++++------------ dlls/wined3d/swapchain.c | 5 ++++- dlls/wined3d/wined3d_private.h | 1 + 4 files changed, 28 insertions(+), 15 deletions(-) diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index 902b9620f30..e5cca225b6f 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -4120,8 +4120,8 @@ static void wined3d_adapter_init_fb_cfgs(struct wined3d_adapter_gl *adapter_gl, { UINT attrib_count = 0; GLint cfg_count; - int attribs[11]; - int values[11]; + int attribs[12]; + int values[12]; int attribute; attribute = WGL_NUMBER_PIXEL_FORMATS_ARB; @@ -4139,6 +4139,7 @@ static void wined3d_adapter_init_fb_cfgs(struct wined3d_adapter_gl *adapter_gl, attribs[attrib_count++] = WGL_PIXEL_TYPE_ARB; attribs[attrib_count++] = WGL_DOUBLE_BUFFER_ARB; attribs[attrib_count++] = WGL_AUX_BUFFERS_ARB; + attribs[attrib_count++] = WGL_SWAP_METHOD_ARB; for (i = 0, adapter_gl->pixel_format_count = 0; i < cfg_count; ++i) { @@ -4160,6 +4161,7 @@ static void wined3d_adapter_init_fb_cfgs(struct wined3d_adapter_gl *adapter_gl, cfg->iPixelType = values[8]; cfg->doubleBuffer = values[9]; cfg->auxBuffers = values[10]; + cfg->swap_method = values[11]; cfg->numSamples = 0; /* Check multisample support. */ @@ -4225,6 +4227,7 @@ static void wined3d_adapter_init_fb_cfgs(struct wined3d_adapter_gl *adapter_gl, cfg->iPixelType = (pfd.iPixelType == PFD_TYPE_RGBA) ? WGL_TYPE_RGBA_ARB : WGL_TYPE_COLORINDEX_ARB; cfg->doubleBuffer = (pfd.dwFlags & PFD_DOUBLEBUFFER) ? 1 : 0; cfg->auxBuffers = pfd.cAuxBuffers; + cfg->swap_method = WGL_SWAP_UNDEFINED_ARB; cfg->numSamples = 0; TRACE("iPixelFormat=%d, iPixelType=%#x, doubleBuffer=%d, RGBA=%d/%d/%d/%d, " diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index f6d046c410a..0e4b900efe0 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -1663,7 +1663,7 @@ static void wined3d_context_gl_enter(struct wined3d_context_gl *context_gl) /* This function takes care of wined3d pixel format selection. */ static int context_choose_pixel_format(const struct wined3d_device *device, HDC hdc, const struct wined3d_format *color_format, const struct wined3d_format *ds_format, - BOOL auxBuffers) + bool aux_buffers, bool swap_effect_copy) { unsigned int cfg_count = wined3d_adapter_gl(device->adapter)->pixel_format_count; unsigned int current_value; @@ -1671,9 +1671,9 @@ static int context_choose_pixel_format(const struct wined3d_device *device, HDC int iPixelFormat = 0; unsigned int i; - TRACE("device %p, dc %p, color_format %s, ds_format %s, aux_buffers %#x.\n", + TRACE("device %p, dc %p, color_format %s, ds_format %s, aux_buffers %#x, swap_effect_copy %#x.\n", device, hdc, debug_d3dformat(color_format->id), debug_d3dformat(ds_format->id), - auxBuffers); + aux_buffers, swap_effect_copy); current_value = 0; for (i = 0; i < cfg_count; ++i) @@ -1705,21 +1705,23 @@ static int context_choose_pixel_format(const struct wined3d_device *device, HDC continue; value = 1; + if (swap_effect_copy && cfg->swap_method == WGL_SWAP_COPY_ARB) + value += 1; /* We try to locate a format which matches our requirements exactly. In case of * depth it is no problem to emulate 16-bit using e.g. 24-bit, so accept that. */ if (cfg->depthSize == ds_format->depth_size) - value += 1; - if (cfg->stencilSize == ds_format->stencil_size) value += 2; - if (cfg->alphaSize == color_format->alpha_size) + if (cfg->stencilSize == ds_format->stencil_size) value += 4; - /* We like to have aux buffers in backbuffer mode */ - if (auxBuffers && cfg->auxBuffers) + if (cfg->alphaSize == color_format->alpha_size) value += 8; + /* We like to have aux buffers in backbuffer mode */ + if (aux_buffers && cfg->auxBuffers) + value += 16; if (cfg->redSize == color_format->red_size && cfg->greenSize == color_format->green_size && cfg->blueSize == color_format->blue_size) - value += 16; + value += 32; if (value > current_value) { @@ -1898,6 +1900,7 @@ HGLRC context_create_wgl_attribs(const struct wined3d_gl_info *gl_info, HDC hdc, static BOOL wined3d_context_gl_create_wgl_ctx(struct wined3d_context_gl *context_gl, struct wined3d_swapchain_gl *swapchain_gl) { + enum wined3d_swap_effect swap_effect = swapchain_gl->s.state.desc.swap_effect; const struct wined3d_format *colour_format, *ds_format; struct wined3d_context *context = &context_gl->c; const struct wined3d_gl_info *gl_info; @@ -1905,6 +1908,7 @@ static BOOL wined3d_context_gl_create_wgl_ctx(struct wined3d_context_gl *context struct wined3d_adapter *adapter; unsigned int target_bind_flags; struct wined3d_device *device; + bool swap_effect_copy; HGLRC ctx, share_ctx; unsigned int i; @@ -1915,6 +1919,8 @@ static BOOL wined3d_context_gl_create_wgl_ctx(struct wined3d_context_gl *context target = &context->current_rt.texture->resource; target_bind_flags = target->bind_flags; + swap_effect_copy = swap_effect == WINED3D_SWAP_EFFECT_COPY || swap_effect == WINED3D_SWAP_EFFECT_COPY_VSYNC; + if (wined3d_settings.offscreen_rendering_mode == ORM_BACKBUFFER) { static const enum wined3d_format_id ds_formats[] = @@ -1951,7 +1957,7 @@ static BOOL wined3d_context_gl_create_wgl_ctx(struct wined3d_context_gl *context { ds_format = wined3d_get_format(adapter, ds_formats[i], WINED3D_BIND_DEPTH_STENCIL); if ((context_gl->pixel_format = context_choose_pixel_format(device, - context_gl->dc, colour_format, ds_format, TRUE))) + context_gl->dc, colour_format, ds_format, true, swap_effect_copy))) { swapchain_gl->s.ds_format = ds_format; break; @@ -1964,7 +1970,7 @@ static BOOL wined3d_context_gl_create_wgl_ctx(struct wined3d_context_gl *context else { context_gl->pixel_format = context_choose_pixel_format(device, - context_gl->dc, colour_format, swapchain_gl->s.ds_format, TRUE); + context_gl->dc, colour_format, swapchain_gl->s.ds_format, true, swap_effect_copy); } } else @@ -1980,7 +1986,7 @@ static BOOL wined3d_context_gl_create_wgl_ctx(struct wined3d_context_gl *context colour_format = wined3d_get_format(adapter, WINED3DFMT_B8G8R8A8_UNORM, target_bind_flags); ds_format = wined3d_get_format(adapter, WINED3DFMT_UNKNOWN, WINED3D_BIND_DEPTH_STENCIL); context_gl->pixel_format = context_choose_pixel_format(device, - context_gl->dc, colour_format, ds_format, FALSE); + context_gl->dc, colour_format, ds_format, false, swap_effect_copy); } if (!context_gl->pixel_format) diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 47158d15aa2..3ae698649cf 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -594,6 +594,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, { struct wined3d_swapchain_gl *swapchain_gl = wined3d_swapchain_gl(swapchain); struct wined3d_texture *back_buffer = swapchain->back_buffers[0]; + const struct wined3d_pixel_format *pixel_format; const struct wined3d_gl_info *gl_info; struct wined3d_context_gl *context_gl; struct wined3d_context *context; @@ -609,7 +610,9 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, TRACE("Presenting DC %p.\n", context_gl->dc); - if (context_gl->dc == swapchain_gl->backup_dc || swapchain_present_is_partial_copy(swapchain, dst_rect)) + pixel_format = &wined3d_adapter_gl(swapchain->device->adapter)->pixel_formats[context_gl->pixel_format]; + if (context_gl->dc == swapchain_gl->backup_dc || (pixel_format->swap_method != WGL_SWAP_COPY_ARB + && swapchain_present_is_partial_copy(swapchain, dst_rect))) { swapchain_blit_gdi(swapchain, context, src_rect, dst_rect); } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 6a2513515f5..54864d9170d 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2847,6 +2847,7 @@ struct wined3d_pixel_format BOOL doubleBuffer; int auxBuffers; int numSamples; + int swap_method; }; enum wined3d_pci_vendor
1
0
0
0
Henri Verbeet : wined3d: Use GDI blits for partial presents with COPY swap effects.
by Alexandre Julliard
14 Sep '21
14 Sep '21
Module: wine Branch: master Commit: 6181b0ea270dfe0be2a0246bb391568559cc01af URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6181b0ea270dfe0be2a0246b…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Fri Sep 10 21:32:49 2021 +0200 wined3d: Use GDI blits for partial presents with COPY swap effects. The GL/Vulkan backbuffer contents are undefined after a buffer swap. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/swapchain.c | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 802116495e5..47158d15aa2 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -568,6 +568,27 @@ static void wined3d_swapchain_gl_rotate(struct wined3d_swapchain *swapchain, str device_invalidate_state(swapchain->device, STATE_FRAMEBUFFER); } +static bool swapchain_present_is_partial_copy(struct wined3d_swapchain *swapchain, const RECT *dst_rect) +{ + enum wined3d_swap_effect swap_effect = swapchain->state.desc.swap_effect; + RECT client_rect; + unsigned int t; + + if (swap_effect != WINED3D_SWAP_EFFECT_COPY && swap_effect != WINED3D_SWAP_EFFECT_COPY_VSYNC) + return false; + + GetClientRect(swapchain->win_handle, &client_rect); + + t = client_rect.right - client_rect.left; + if ((dst_rect->left && dst_rect->right) || abs(dst_rect->right - dst_rect->left) != t) + return true; + t = client_rect.bottom - client_rect.top; + if ((dst_rect->top && dst_rect->bottom) || abs(dst_rect->bottom - dst_rect->top) != t) + return true; + + return false; +} + static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT *src_rect, const RECT *dst_rect, unsigned int swap_interval, DWORD flags) { @@ -588,7 +609,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, TRACE("Presenting DC %p.\n", context_gl->dc); - if (context_gl->dc == swapchain_gl->backup_dc) + if (context_gl->dc == swapchain_gl->backup_dc || swapchain_present_is_partial_copy(swapchain, dst_rect)) { swapchain_blit_gdi(swapchain, context, src_rect, dst_rect); } @@ -1208,10 +1229,14 @@ static void swapchain_vk_present(struct wined3d_swapchain *swapchain, const RECT context_vk = wined3d_context_vk(context_acquire(swapchain->device, back_buffer, 0)); - wined3d_texture_load_location(back_buffer, 0, &context_vk->c, back_buffer->resource.draw_binding); - - if (swapchain_vk->vk_swapchain) + if (!swapchain_vk->vk_swapchain || swapchain_present_is_partial_copy(swapchain, dst_rect)) + { + swapchain_blit_gdi(swapchain, &context_vk->c, src_rect, dst_rect); + } + else { + wined3d_texture_load_location(back_buffer, 0, &context_vk->c, back_buffer->resource.draw_binding); + if ((vr = wined3d_swapchain_vk_blit(swapchain_vk, context_vk, src_rect, dst_rect, swap_interval))) { if (vr == VK_ERROR_OUT_OF_DATE_KHR || vr == VK_SUBOPTIMAL_KHR) @@ -1228,10 +1253,6 @@ static void swapchain_vk_present(struct wined3d_swapchain *swapchain, const RECT } } } - else - { - swapchain_blit_gdi(swapchain, &context_vk->c, src_rect, dst_rect); - } wined3d_swapchain_vk_rotate(swapchain, context_vk);
1
0
0
0
Henri Verbeet : wined3d: Get rid of the "render_to_fbo" field from the wined3d_swapchain structure.
by Alexandre Julliard
14 Sep '21
14 Sep '21
Module: wine Branch: master Commit: 830522e196b16c476842562b3fdc6d5d405bdc0b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=830522e196b16c476842562b…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Fri Sep 10 21:32:48 2021 +0200 wined3d: Get rid of the "render_to_fbo" field from the wined3d_swapchain structure. It's effectively always true when using ORM_FBO, now that the "AlwaysOffscreen" setting is gone. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/resource.c | 2 +- dlls/wined3d/swapchain.c | 69 +++++++++--------------------------------- dlls/wined3d/wined3d_private.h | 2 +- 3 files changed, 16 insertions(+), 57 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 6215da8ce0f..3d24d375bc8 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -435,7 +435,7 @@ BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) /* If the swapchain is rendered to an FBO, the backbuffer is * offscreen, otherwise onscreen */ - return swapchain->render_to_fbo; + return wined3d_settings.offscreen_rendering_mode == ORM_FBO; } void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 693557448fe..802116495e5 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -532,7 +532,7 @@ static void wined3d_swapchain_gl_rotate(struct wined3d_swapchain *swapchain, str unsigned int i; static const DWORD supported_locations = WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_RB_MULTISAMPLE; - if (swapchain->state.desc.backbuffer_count < 2 || !swapchain->render_to_fbo) + if (swapchain->state.desc.backbuffer_count < 2 || wined3d_settings.offscreen_rendering_mode != ORM_FBO) return; texture_prev = wined3d_texture_gl(swapchain->back_buffers[0]); @@ -572,12 +572,10 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT *src_rect, const RECT *dst_rect, unsigned int swap_interval, DWORD flags) { struct wined3d_swapchain_gl *swapchain_gl = wined3d_swapchain_gl(swapchain); - const struct wined3d_swapchain_desc *desc = &swapchain->state.desc; struct wined3d_texture *back_buffer = swapchain->back_buffers[0]; const struct wined3d_gl_info *gl_info; struct wined3d_context_gl *context_gl; struct wined3d_context *context; - BOOL render_to_fbo; context = context_acquire(swapchain->device, swapchain->front_buffer, 0); context_gl = wined3d_context_gl(context); @@ -588,51 +586,30 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, return; } - gl_info = context_gl->gl_info; - - swapchain_gl_set_swap_interval(swapchain, context_gl, swap_interval); - TRACE("Presenting DC %p.\n", context_gl->dc); if (context_gl->dc == swapchain_gl->backup_dc) + { swapchain_blit_gdi(swapchain, context, src_rect, dst_rect); - - if (!(render_to_fbo = swapchain->render_to_fbo) - && (src_rect->left || src_rect->top - || src_rect->right != desc->backbuffer_width - || src_rect->bottom != desc->backbuffer_height - || dst_rect->left || dst_rect->top - || dst_rect->right != desc->backbuffer_width - || dst_rect->bottom != desc->backbuffer_height)) - render_to_fbo = TRUE; - - /* Rendering to a window of different size, presenting partial rectangles, - * or rendering to a different window needs help from FBO_blit or a textured - * draw. Render the swapchain to a FBO in the future. - * - * Note that FBO_blit from the backbuffer to the frontbuffer cannot solve - * all these issues - this fails if the window is smaller than the backbuffer. - */ - if (!swapchain->render_to_fbo && render_to_fbo && wined3d_settings.offscreen_rendering_mode == ORM_FBO) - { - wined3d_texture_load_location(back_buffer, 0, context, WINED3D_LOCATION_TEXTURE_RGB); - wined3d_texture_invalidate_location(back_buffer, 0, WINED3D_LOCATION_DRAWABLE); - swapchain->render_to_fbo = TRUE; - swapchain_update_draw_bindings(swapchain); } else { + gl_info = context_gl->gl_info; + + swapchain_gl_set_swap_interval(swapchain, context_gl, swap_interval); + wined3d_texture_load_location(back_buffer, 0, context, back_buffer->resource.draw_binding); - } - if (swapchain->render_to_fbo) - swapchain_blit(swapchain, context, src_rect, dst_rect); + if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) + swapchain_blit(swapchain, context, src_rect, dst_rect); - if (swapchain_gl->context_count > 1) - gl_info->gl_ops.gl.p_glFinish(); + if (swapchain_gl->context_count > 1) + gl_info->gl_ops.gl.p_glFinish(); + + /* call wglSwapBuffers through the gl table to avoid confusing the Steam overlay */ + gl_info->gl_ops.wgl.p_wglSwapBuffers(context_gl->dc); + } - /* call wglSwapBuffers through the gl table to avoid confusing the Steam overlay */ - gl_info->gl_ops.wgl.p_wglSwapBuffers(context_gl->dc); wined3d_context_gl_submit_command_fence(context_gl); wined3d_swapchain_gl_rotate(swapchain, context); @@ -1350,22 +1327,6 @@ static const struct wined3d_swapchain_ops swapchain_no3d_ops = swapchain_gdi_frontbuffer_updated, }; -static void swapchain_update_render_to_fbo(struct wined3d_swapchain *swapchain) -{ - if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) - return; - - if (!swapchain->state.desc.backbuffer_count) - { - TRACE("Single buffered rendering.\n"); - swapchain->render_to_fbo = FALSE; - return; - } - - TRACE("Rendering to FBO.\n"); - swapchain->render_to_fbo = TRUE; -} - static void wined3d_swapchain_apply_sample_count_override(const struct wined3d_swapchain *swapchain, enum wined3d_format_id format_id, enum wined3d_multisample_type *type, DWORD *quality) { @@ -1528,7 +1489,6 @@ static HRESULT wined3d_swapchain_init(struct wined3d_swapchain *swapchain, struc swapchain->state.desc = *desc; wined3d_swapchain_apply_sample_count_override(swapchain, swapchain->state.desc.backbuffer_format, &swapchain->state.desc.multisample_type, &swapchain->state.desc.multisample_quality); - swapchain_update_render_to_fbo(swapchain); TRACE("Creating front buffer.\n"); @@ -2073,7 +2033,6 @@ HRESULT CDECL wined3d_swapchain_resize_buffers(struct wined3d_swapchain *swapcha } } - swapchain_update_render_to_fbo(swapchain); swapchain_update_draw_bindings(swapchain); return WINED3D_OK; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 4b9fc8d9ae8..6a2513515f5 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -5278,7 +5278,7 @@ struct wined3d_swapchain struct wined3d_texture **back_buffers; struct wined3d_texture *front_buffer; struct wined3d_gamma_ramp orig_gamma; - BOOL render_to_fbo, reapply_mode; + bool reapply_mode; const struct wined3d_format *ds_format; struct wined3d_palette *palette; RECT front_buffer_update;
1
0
0
0
Henri Verbeet : wined3d: Do not attempt to restore GL contexts corresponding to wined3d contexts in wined3d_context_gl_cleanup().
by Alexandre Julliard
14 Sep '21
14 Sep '21
Module: wine Branch: master Commit: b535dea0aafd37ff45bc55293e73ed59313c4d5d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b535dea0aafd37ff45bc5529…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Fri Sep 10 21:32:47 2021 +0200 wined3d: Do not attempt to restore GL contexts corresponding to wined3d contexts in wined3d_context_gl_cleanup(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/context_gl.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index da7c70a8863..f6d046c410a 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -1347,6 +1347,7 @@ static void wined3d_context_gl_cleanup(struct wined3d_context_gl *context_gl) struct wined3d_so_statistics_query *so_statistics_query; struct wined3d_timestamp_query *timestamp_query; struct wined3d_occlusion_query *occlusion_query; + struct wined3d_context_gl *current; struct fbo_entry *entry, *entry2; struct wined3d_fence *fence; HGLRC restore_ctx; @@ -1356,10 +1357,22 @@ static void wined3d_context_gl_cleanup(struct wined3d_context_gl *context_gl) restore_ctx = wglGetCurrentContext(); restore_dc = wglGetCurrentDC(); - if (restore_ctx == context_gl->gl_ctx) - restore_ctx = NULL; - else if (context_gl->valid) + if (context_gl->valid && context_gl->gl_ctx != restore_ctx) + { + /* Attempting to restore a GL context corresponding to a wined3d + * context is not particularly useful. Worse, when we're called from + * wined3d_context_gl_destroy(), we subsequently clear the "current + * D3D context" TLS value, which would cause + * wined3d_context_gl_enter() to consider the GL context a non-D3D + * context. */ + if ((current = wined3d_context_gl_get_current()) && current->gl_ctx == restore_ctx) + restore_ctx = NULL; wined3d_context_gl_set_gl_context(context_gl); + } + else + { + restore_ctx = NULL; + } if (context_gl->valid) {
1
0
0
0
Connor McAdams : user32/tests: Fix ShowWindow() message sequences to support winevents.
by Alexandre Julliard
14 Sep '21
14 Sep '21
Module: wine Branch: master Commit: 0c92fa4472854da7faf6efd5e12729e8e506740a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0c92fa4472854da7faf6efd5…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Fri Sep 10 13:06:40 2021 -0400 user32/tests: Fix ShowWindow() message sequences to support winevents. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/msg.c | 89 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 81 insertions(+), 8 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=0c92fa4472854da7faf6…
1
0
0
0
Connor McAdams : user32/tests: Mark some winevents optional in the ShowWindow sequences.
by Alexandre Julliard
14 Sep '21
14 Sep '21
Module: wine Branch: master Commit: 7dc032e851a9a891c5fe9e68807efe39e015d8cb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7dc032e851a9a891c5fe9e68…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Fri Sep 10 13:06:39 2021 -0400 user32/tests: Mark some winevents optional in the ShowWindow sequences. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/msg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index d480b903e1f..6c2f2b46f66 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -13425,7 +13425,7 @@ static const struct message WmHide_3[] = { { WM_WINDOWPOSCHANGING, sent|wparam, SWP_HIDEWINDOW|SWP_NOSIZE|SWP_NOMOVE }, { WM_WINDOWPOSCHANGED, sent|wparam, SWP_HIDEWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE }, { HCBT_SETFOCUS, hook|optional }, - { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 }, + { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam|optional, OBJID_CLIENT, 0 }, { 0 } }; static const struct message WmShowMinimized_1[] = { @@ -13441,7 +13441,7 @@ static const struct message WmShowMinimized_1[] = { static const struct message WmMinimize_1[] = { { HCBT_MINMAX, hook|lparam, 0, SW_MINIMIZE }, { HCBT_SETFOCUS, hook|optional }, /* win2000 doesn't send it */ - { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 }, + { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam|optional, OBJID_CLIENT, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED }, { WM_WINDOWPOSCHANGED, sent|wparam, SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED }, { WM_MOVE, sent|defwinproc },
1
0
0
0
Connor McAdams : user32/tests: Add optional message to fix ShowWindow test.
by Alexandre Julliard
14 Sep '21
14 Sep '21
Module: wine Branch: master Commit: a4e4ef1926c7e06ad3ec61b6f51031f017d6bb41 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a4e4ef1926c7e06ad3ec61b6…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Fri Sep 10 13:06:38 2021 -0400 user32/tests: Add optional message to fix ShowWindow test. Windows 7 sometimes sends an optional WM_WINDOWPOSCHANGED message along with the optional WM_WINDOWPOSCHANGING message. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/msg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 9133d76554c..d480b903e1f 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -13462,7 +13462,8 @@ static const struct message WmMinimize_3[] = { { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED, 0, SWP_NOACTIVATE }, { HCBT_ACTIVATE, hook|optional }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, - { WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED, 0, SWP_NOACTIVATE }, + { WM_WINDOWPOSCHANGED, sent|optional }, + { WM_WINDOWPOSCHANGED, sent|optional }, { WM_MOVE, sent|defwinproc }, { WM_SIZE, sent|wparam|lparam|defwinproc, SIZE_MINIMIZED, 0 }, { 0 }
1
0
0
0
← Newer
1
...
63
64
65
66
67
68
69
...
103
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
Results per page:
10
25
50
100
200