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
June 2023
----- 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
633 discussions
Start a n
N
ew thread
Rémi Bernon : winegstreamer: Lookup stream descriptors before starting streams.
by Alexandre Julliard
27 Jun '23
27 Jun '23
Module: wine Branch: master Commit: ed9a7b667f16830b01b5d4ed8ba896d0e924284c URL:
https://gitlab.winehq.org/wine/wine/-/commit/ed9a7b667f16830b01b5d4ed8ba896…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sat Apr 29 14:01:57 2023 +0200 winegstreamer: Lookup stream descriptors before starting streams. --- dlls/winegstreamer/media_source.c | 78 ++++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c index 558d7dd51f5..4de5b5ab608 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c @@ -272,30 +272,6 @@ static HRESULT wg_format_from_stream_descriptor(IMFStreamDescriptor *descriptor, return hr; } -static IMFStreamDescriptor *stream_descriptor_from_id(IMFPresentationDescriptor *pres_desc, DWORD id, BOOL *selected) -{ - ULONG sd_count; - IMFStreamDescriptor *ret; - unsigned int i; - - if (FAILED(IMFPresentationDescriptor_GetStreamDescriptorCount(pres_desc, &sd_count))) - return NULL; - - for (i = 0; i < sd_count; i++) - { - DWORD stream_id; - - if (FAILED(IMFPresentationDescriptor_GetStreamDescriptorByIndex(pres_desc, i, selected, &ret))) - return NULL; - - if (SUCCEEDED(IMFStreamDescriptor_GetStreamIdentifier(ret, &stream_id)) && stream_id == id) - return ret; - - IMFStreamDescriptor_Release(ret); - } - return NULL; -} - static HRESULT stream_descriptor_set_tag(IMFStreamDescriptor *descriptor, struct wg_parser_stream *stream, const GUID *attr, enum wg_parser_tag tag) { @@ -517,7 +493,8 @@ static HRESULT media_source_start(struct media_source *source, IMFPresentationDe GUID *format, PROPVARIANT *position) { BOOL starting = source->state == SOURCE_STOPPED, seek_message = !starting && position->vt != VT_EMPTY; - unsigned int i; + IMFStreamDescriptor **descriptors; + DWORD i, count; HRESULT hr; TRACE("source %p, descriptor %p, format %s, position %s\n", source, descriptor, @@ -533,29 +510,54 @@ static HRESULT media_source_start(struct media_source *source, IMFPresentationDe position->hVal.QuadPart = 0; } - for (i = 0; i < source->stream_count; i++) + if (!(descriptors = calloc(source->stream_count, sizeof(*descriptors)))) + return E_OUTOFMEMORY; + + if (FAILED(hr = IMFPresentationDescriptor_GetStreamDescriptorCount(descriptor, &count))) + WARN("Failed to get presentation descriptor stream count, hr %#lx\n", hr); + + for (i = 0; i < count; i++) { - struct media_stream *stream; - BOOL was_active, selected; - IMFStreamDescriptor *sd; - DWORD stream_id; + IMFStreamDescriptor *stream_descriptor; + BOOL selected; + DWORD id; - stream = source->streams[i]; - was_active = !starting && stream->active; + if (FAILED(hr = IMFPresentationDescriptor_GetStreamDescriptorByIndex(descriptor, i, + &selected, &stream_descriptor))) + WARN("Failed to get presentation stream descriptor, hr %#lx\n", hr); + else + { + if (FAILED(hr = IMFStreamDescriptor_GetStreamIdentifier(stream_descriptor, &id))) + WARN("Failed to get stream descriptor id, hr %#lx\n", hr); + else if (id >= source->stream_count) + WARN("Invalid stream descriptor id %lu, hr %#lx\n", id, hr); + else if (selected) + IMFStreamDescriptor_AddRef((descriptors[id] = stream_descriptor)); + + IMFStreamDescriptor_Release(stream_descriptor); + } + } - IMFStreamDescriptor_GetStreamIdentifier(stream->descriptor, &stream_id); - sd = stream_descriptor_from_id(descriptor, stream_id, &selected); - IMFStreamDescriptor_Release(sd); + for (i = 0; i < source->stream_count; i++) + { + struct media_stream *stream = source->streams[i]; + BOOL was_active = !starting && stream->active; if (position->vt != VT_EMPTY) stream->eos = FALSE; - if (!(stream->active = selected)) + if (!(stream->active = !!descriptors[i])) wg_parser_stream_disable(stream->wg_stream); - else if (FAILED(hr = media_stream_start(stream, was_active, seek_message, position))) - WARN("Failed to start media stream, hr %#lx\n", hr); + else + { + if (FAILED(hr = media_stream_start(stream, was_active, seek_message, position))) + WARN("Failed to start media stream, hr %#lx\n", hr); + IMFStreamDescriptor_Release(descriptors[i]); + } } + free(descriptors); + source->state = SOURCE_RUNNING; if (position->vt == VT_I8)
1
0
0
0
Rémi Bernon : winegstreamer: Keep a reference on the media source start descriptor.
by Alexandre Julliard
27 Jun '23
27 Jun '23
Module: wine Branch: master Commit: 25469b5a323417de522d41ec8b765e7d8879692a URL:
https://gitlab.winehq.org/wine/wine/-/commit/25469b5a323417de522d41ec8b765e…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed May 10 00:49:35 2023 +0200 winegstreamer: Keep a reference on the media source start descriptor. --- dlls/winegstreamer/media_source.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c index d404662e5bb..558d7dd51f5 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c @@ -174,7 +174,10 @@ static ULONG WINAPI source_async_command_Release(IUnknown *iface) if (!refcount) { if (command->op == SOURCE_ASYNC_START) + { + IMFPresentationDescriptor_Release(command->u.start.descriptor); PropVariantClear(&command->u.start.position); + } else if (command->op == SOURCE_ASYNC_REQUEST_SAMPLE) { if (command->u.request_sample.token) @@ -1376,6 +1379,7 @@ static HRESULT WINAPI media_source_Start(IMFMediaSource *iface, IMFPresentationD { struct source_async_command *command = impl_from_async_command_IUnknown(op); command->u.start.descriptor = descriptor; + IMFPresentationDescriptor_AddRef(descriptor); command->u.start.format = *time_format; PropVariantCopy(&command->u.start.position, position);
1
0
0
0
Rémi Bernon : maintainers: Assume GStreamer media source maintainership.
by Alexandre Julliard
27 Jun '23
27 Jun '23
Module: wine Branch: master Commit: b9293a3e6604de73af39a151f431615990335533 URL:
https://gitlab.winehq.org/wine/wine/-/commit/b9293a3e6604de73af39a151f43161…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Jun 26 14:07:50 2023 +0200 maintainers: Assume GStreamer media source maintainership. --- MAINTAINERS | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 7e2645d8b5d..dc5c85cc4ec 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -210,7 +210,7 @@ P: Andrew Eikum <coldpie(a)fastmail.com> F: dlls/*.acm/ F: dlls/msacm32/ -Media Foundation transforms +Media Foundation GStreamer backend M: Rémi Bernon <rbernon(a)codeweavers.com> P: Nikolay Sivov <nsivov(a)codeweavers.com> P: Zebediah Figura <z.figura12(a)gmail.com> @@ -218,6 +218,8 @@ F: dlls/mf/tests/transform.c F: dlls/winegstreamer/aac_decoder.c F: dlls/winegstreamer/color_convert.c F: dlls/winegstreamer/h264_decoder.c +F: dlls/winegstreamer/media_source.c +F: dlls/winegstreamer/mfplat.c F: dlls/winegstreamer/resampler.c F: dlls/winegstreamer/video_decoder.c F: dlls/winegstreamer/video_processor.c
1
0
0
0
Joel Holdsworth : ntdll: Implement FILE_DISPOSITION_POSIX_SEMANTICS.
by Alexandre Julliard
27 Jun '23
27 Jun '23
Module: wine Branch: master Commit: 1ccd037e00c19c40de0de08f0f6e699622fa4c4f URL:
https://gitlab.winehq.org/wine/wine/-/commit/1ccd037e00c19c40de0de08f0f6e69…
Author: Joel Holdsworth <joel(a)airwebreathe.org.uk> Date: Tue Jun 20 13:06:22 2023 +0100 ntdll: Implement FILE_DISPOSITION_POSIX_SEMANTICS. Both the Msys2 and Cygwin runtimes make use of FILE_DISPOSITON_POSIX_SEMANTICS in their implementations of the unlink() system call. This enables these routines to behave similarly to POSIX where are unlisted from the directory, if handles are still open.
https://github.com/msys2/msys2-runtime/blob/msys2-3.4.3/winsup/cygwin/sysca…
https://www.cygwin.com/git/?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/sysc…
Signed-off-by: Joel Holdsworth <joel(a)airwebreathe.org.uk> --- dlls/ntdll/tests/file.c | 1 - dlls/ntdll/unix/file.c | 2 -- server/fd.c | 36 ++++++++++++++++++++++++------------ 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index 956104d233b..d4d80efe13b 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -3076,7 +3076,6 @@ static void test_file_disposition_information(void) if ( res == STATUS_SUCCESS ) { fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND; - todo_wine ok( fileDeleted, "File should have been deleted\n" ); } CloseHandle( handle2 ); diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 91ba408bc95..eef21e12ceb 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -4768,8 +4768,6 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io, { FILE_DISPOSITION_INFORMATION_EX *info = ptr; - if (info->Flags & FILE_DISPOSITION_POSIX_SEMANTICS) - FIXME( "FILE_DISPOSITION_POSIX_SEMANTICS not supported\n" ); if (info->Flags & FILE_DISPOSITION_FORCE_IMAGE_SECTION_CHECK) FIXME( "FILE_DISPOSITION_FORCE_IMAGE_SECTION_CHECK not supported\n" ); diff --git a/server/fd.c b/server/fd.c index 6ce3343fb6f..0b0e91ebfbb 100644 --- a/server/fd.c +++ b/server/fd.c @@ -1103,10 +1103,20 @@ static void device_destroy( struct object *obj ) list_remove( &device->entry ); /* remove it from the hash table */ } - /****************************************************************/ /* inode functions */ +static void unlink_closed_fd( struct inode *inode, struct closed_fd *fd ) +{ + /* make sure it is still the same file */ + struct stat st; + if (!stat( fd->unix_name, &st ) && st.st_dev == inode->device->dev && st.st_ino == inode->ino) + { + if (S_ISDIR(st.st_mode)) rmdir( fd->unix_name ); + else unlink( fd->unix_name ); + } +} + /* close all pending file descriptors in the closed list */ static void inode_close_pending( struct inode *inode, int keep_unlinks ) { @@ -1158,15 +1168,7 @@ static void inode_destroy( struct object *obj ) list_remove( ptr ); if (fd->unix_fd != -1) close( fd->unix_fd ); if (fd->disp_flags & FILE_DISPOSITION_DELETE) - { - /* make sure it is still the same file */ - struct stat st; - if (!stat( fd->unix_name, &st ) && st.st_dev == inode->device->dev && st.st_ino == inode->ino) - { - if (S_ISDIR(st.st_mode)) rmdir( fd->unix_name ); - else unlink( fd->unix_name ); - } - } + unlink_closed_fd( inode, fd ); free( fd->unix_name ); free( fd ); } @@ -1213,7 +1215,16 @@ static void inode_add_closed_fd( struct inode *inode, struct closed_fd *fd ) { list_add_head( &inode->closed, &fd->entry ); } - else if (fd->disp_flags & FILE_DISPOSITION_ON_CLOSE) + else if ((fd->disp_flags & FILE_DISPOSITION_DELETE) && + (fd->disp_flags & FILE_DISPOSITION_POSIX_SEMANTICS)) + { + /* close the fd and unlink it at once */ + if (fd->unix_fd != -1) close( fd->unix_fd ); + unlink_closed_fd( inode, fd ); + free( fd->unix_name ); + free( fd ); + } + else if (fd->disp_flags & FILE_DISPOSITION_DELETE) { /* close the fd but keep the structure around for unlink */ if (fd->unix_fd != -1) close( fd->unix_fd ); @@ -2532,7 +2543,8 @@ static void set_fd_disposition( struct fd *fd, unsigned int flags ) if (flags & FILE_DISPOSITION_ON_CLOSE) fd->options &= ~FILE_DELETE_ON_CLOSE; - fd->closed->disp_flags = (flags & FILE_DISPOSITION_DELETE) | + fd->closed->disp_flags = + (flags & (FILE_DISPOSITION_DELETE | FILE_DISPOSITION_POSIX_SEMANTICS)) | ((fd->options & FILE_DELETE_ON_CLOSE) ? FILE_DISPOSITION_DELETE : 0); }
1
0
0
0
Joel Holdsworth : server: Replace unlink member of closed_fd with disp_flags.
by Alexandre Julliard
27 Jun '23
27 Jun '23
Module: wine Branch: master Commit: f10383e9d0ff7de7dca0b21efef02f416a0955b4 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f10383e9d0ff7de7dca0b21efef02f…
Author: Joel Holdsworth <joel(a)airwebreathe.org.uk> Date: Tue Jun 20 11:54:36 2023 +0100 server: Replace unlink member of closed_fd with disp_flags. In order to implement FILE_DISPOSITION_POSIX_SEMANTICS, it will be necessary to add additional flags to closed_fd. In preparation for this, the unlink member variable has been replaced with disp_flags which directly reflects the flags defined in the FILE_DISPOSITION_INFORMATION_EX structure. Signed-off-by: Joel Holdsworth <joel(a)airwebreathe.org.uk> --- server/fd.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/server/fd.c b/server/fd.c index dc35999c3f3..6ce3343fb6f 100644 --- a/server/fd.c +++ b/server/fd.c @@ -160,10 +160,10 @@ static inline int epoll_wait( int epfd, struct epoll_event *events, int maxevent /* closed_fd is used to keep track of the unix fd belonging to a closed fd object */ struct closed_fd { - struct list entry; /* entry in inode closed list */ - int unix_fd; /* the unix file descriptor */ - int unlink; /* whether to unlink on close: -1 - implicit FILE_DELETE_ON_CLOSE, 1 - explicit disposition */ - char *unix_name; /* name to unlink on close, points to parent fd unix_name */ + struct list entry; /* entry in inode closed list */ + int unix_fd; /* the unix file descriptor */ + unsigned int disp_flags; /* the disposition flags */ + char *unix_name; /* name to unlink on close, points to parent fd unix_name */ }; struct fd @@ -1122,7 +1122,9 @@ static void inode_close_pending( struct inode *inode, int keep_unlinks ) close( fd->unix_fd ); fd->unix_fd = -1; } - if (!keep_unlinks || !fd->unlink) /* get rid of it unless there's an unlink pending on that file */ + + /* get rid of it unless there's an unlink pending on that file */ + if (!keep_unlinks || !(fd->disp_flags & FILE_DISPOSITION_DELETE)) { list_remove( ptr ); free( fd->unix_name ); @@ -1155,7 +1157,7 @@ static void inode_destroy( struct object *obj ) struct closed_fd *fd = LIST_ENTRY( ptr, struct closed_fd, entry ); list_remove( ptr ); if (fd->unix_fd != -1) close( fd->unix_fd ); - if (fd->unlink) + if (fd->disp_flags & FILE_DISPOSITION_DELETE) { /* make sure it is still the same file */ struct stat st; @@ -1211,8 +1213,9 @@ static void inode_add_closed_fd( struct inode *inode, struct closed_fd *fd ) { list_add_head( &inode->closed, &fd->entry ); } - else if (fd->unlink) /* close the fd but keep the structure around for unlink */ + else if (fd->disp_flags & FILE_DISPOSITION_ON_CLOSE) { + /* close the fd but keep the structure around for unlink */ if (fd->unix_fd != -1) close( fd->unix_fd ); fd->unix_fd = -1; list_add_head( &inode->closed, &fd->entry ); @@ -1560,7 +1563,7 @@ static void fd_dump( struct object *obj, int verbose ) { struct fd *fd = (struct fd *)obj; fprintf( stderr, "Fd unix_fd=%d user=%p options=%08x", fd->unix_fd, fd->user, fd->options ); - if (fd->inode) fprintf( stderr, " inode=%p unlink=%d", fd->inode, fd->closed->unlink ); + if (fd->inode) fprintf( stderr, " inode=%p disp_flags=%x", fd->inode, fd->closed->disp_flags ); fprintf( stderr, "\n" ); } @@ -1673,7 +1676,7 @@ static inline void unmount_fd( struct fd *fd ) fd->unix_fd = -1; fd->no_fd_status = STATUS_VOLUME_DISMOUNTED; fd->closed->unix_fd = -1; - fd->closed->unlink = 0; + fd->closed->disp_flags = 0; /* stop using Unix locks on this fd (existing locks have been removed by close) */ fd->fs_locks = 0; @@ -1783,7 +1786,7 @@ struct fd *dup_fd_object( struct fd *orig, unsigned int access, unsigned int sha goto failed; } closed->unix_fd = fd->unix_fd; - closed->unlink = 0; + closed->disp_flags = 0; closed->unix_name = fd->unix_name; fd->closed = closed; fd->inode = (struct inode *)grab_object( orig->inode ); @@ -1977,7 +1980,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam } closed_fd->unix_fd = fd->unix_fd; - closed_fd->unlink = 0; + closed_fd->disp_flags = 0; closed_fd->unix_name = fd->unix_name; fstat( fd->unix_fd, &st ); *mode = st.st_mode; @@ -2026,7 +2029,8 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam goto error; } - fd->closed->unlink = (options & FILE_DELETE_ON_CLOSE) ? -1 : 0; + fd->closed->disp_flags = (options & FILE_DELETE_ON_CLOSE) ? + FILE_DISPOSITION_DELETE : 0; if (flags & O_TRUNC) { if (S_ISDIR(st.st_mode)) @@ -2528,9 +2532,8 @@ static void set_fd_disposition( struct fd *fd, unsigned int flags ) if (flags & FILE_DISPOSITION_ON_CLOSE) fd->options &= ~FILE_DELETE_ON_CLOSE; - fd->closed->unlink = (flags & FILE_DISPOSITION_DELETE) ? 1 : 0; - if (fd->options & FILE_DELETE_ON_CLOSE) - fd->closed->unlink = -1; + fd->closed->disp_flags = (flags & FILE_DISPOSITION_DELETE) | + ((fd->options & FILE_DELETE_ON_CLOSE) ? FILE_DISPOSITION_DELETE : 0); } /* set new name for the fd */
1
0
0
0
Joel Holdsworth : ntdll/tests: Add tests for FILE_DISPOSITION_POSIX_SEMANTICS.
by Alexandre Julliard
27 Jun '23
27 Jun '23
Module: wine Branch: master Commit: 0e6b5811c8422ee38726a12898ad9ad9587d5706 URL:
https://gitlab.winehq.org/wine/wine/-/commit/0e6b5811c8422ee38726a12898ad9a…
Author: Joel Holdsworth <joel(a)airwebreathe.org.uk> Date: Tue Jun 20 16:34:13 2023 +0100 ntdll/tests: Add tests for FILE_DISPOSITION_POSIX_SEMANTICS. Signed-off-by: Joel Holdsworth <joel(a)airwebreathe.org.uk> --- dlls/ntdll/tests/file.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index b230249fdc3..956104d233b 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -3061,6 +3061,47 @@ static void test_file_disposition_information(void) fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND; ok( fileDeleted, "File should have been deleted\n" ); + /* file is deleted after handle with FILE_DISPOSITION_POSIX_SEMANTICS is closed */ + /* FileDispositionInformationEx is only supported on Windows 10 build 1809 and later */ + GetTempFileNameA( tmp_path, "dis", 0, buffer ); + handle = CreateFileA(buffer, GENERIC_WRITE | DELETE, FILE_SHARE_DELETE, NULL, CREATE_ALWAYS, 0, 0); + ok( handle != INVALID_HANDLE_VALUE, "failed to create temp file\n" ); + handle2 = CreateFileA(buffer, DELETE, FILE_SHARE_DELETE | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0); + ok( handle2 != INVALID_HANDLE_VALUE, "failed to open temp file\n" ); + fdie.Flags = FILE_DISPOSITION_DELETE | FILE_DISPOSITION_POSIX_SEMANTICS; + res = pNtSetInformationFile( handle, &io, &fdie, sizeof fdie, FileDispositionInformationEx ); + ok( res == STATUS_INVALID_INFO_CLASS || res == STATUS_SUCCESS, + "unexpected FileDispositionInformationEx result (expected STATUS_SUCCESS or SSTATUS_INVALID_INFO_CLASS, got %lx)\n", res ); + CloseHandle( handle ); + if ( res == STATUS_SUCCESS ) + { + fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND; + todo_wine + ok( fileDeleted, "File should have been deleted\n" ); + } + CloseHandle( handle2 ); + + /* file is deleted after handle with FILE_DISPOSITION_POSIX_SEMANTICS is closed */ + /* FileDispositionInformationEx is only supported on Windows 10 build 1809 and later */ + GetTempFileNameA( tmp_path, "dis", 0, buffer ); + handle = CreateFileA(buffer, GENERIC_WRITE | DELETE, FILE_SHARE_DELETE, NULL, CREATE_ALWAYS, 0, 0); + ok( handle != INVALID_HANDLE_VALUE, "failed to create temp file\n" ); + handle2 = CreateFileA(buffer, DELETE, FILE_SHARE_DELETE | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0); + ok( handle2 != INVALID_HANDLE_VALUE, "failed to open temp file\n" ); + fdie.Flags = FILE_DISPOSITION_DELETE | FILE_DISPOSITION_POSIX_SEMANTICS; + res = pNtSetInformationFile( handle, &io, &fdie, sizeof fdie, FileDispositionInformationEx ); + ok( res == STATUS_INVALID_INFO_CLASS || res == STATUS_SUCCESS, + "unexpected FileDispositionInformationEx result (expected STATUS_SUCCESS or SSTATUS_INVALID_INFO_CLASS, got %lx)\n", res ); + CloseHandle( handle2 ); + fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND; + ok( !fileDeleted, "File shouldn't have been deleted\n" ); + CloseHandle( handle ); + if ( res == STATUS_SUCCESS ) + { + fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND; + ok( fileDeleted, "File should have been deleted\n" ); + } + /* cannot set disposition on readonly file */ GetTempFileNameA( tmp_path, "dis", 0, buffer ); DeleteFileA( buffer );
1
0
0
0
Joel Holdsworth : ntdll: Implement FILE_DISPOSITION_ON_CLOSE.
by Alexandre Julliard
27 Jun '23
27 Jun '23
Module: wine Branch: master Commit: 146333fed2d524d1badf1828dc31fc3e4bb0e179 URL:
https://gitlab.winehq.org/wine/wine/-/commit/146333fed2d524d1badf1828dc31fc…
Author: Joel Holdsworth <joel(a)airwebreathe.org.uk> Date: Tue Jun 20 12:25:14 2023 +0100 ntdll: Implement FILE_DISPOSITION_ON_CLOSE. The FILE_DELETE_ON_CLOSE can be used with the FILE_DISPOSITION_ON_CLOSE flag of FileDispositionInformationEx. Signed-off-by: Joel Holdsworth <joel(a)airwebreathe.org.uk> --- dlls/ntdll/tests/file.c | 1 - dlls/ntdll/unix/file.c | 2 -- server/fd.c | 3 +++ 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index f76448659e2..b230249fdc3 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -3163,7 +3163,6 @@ static void test_file_disposition_information(void) if ( res == STATUS_SUCCESS ) { fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND; - todo_wine ok( !fileDeleted, "File shouldn't have been deleted\n" ); DeleteFileA( buffer ); } diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 22046e63a21..91ba408bc95 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -4772,8 +4772,6 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io, FIXME( "FILE_DISPOSITION_POSIX_SEMANTICS not supported\n" ); if (info->Flags & FILE_DISPOSITION_FORCE_IMAGE_SECTION_CHECK) FIXME( "FILE_DISPOSITION_FORCE_IMAGE_SECTION_CHECK not supported\n" ); - if (info->Flags & FILE_DISPOSITION_ON_CLOSE) - FIXME( "FILE_DISPOSITION_ON_CLOSE not supported\n" ); SERVER_START_REQ( set_fd_disp_info ) { diff --git a/server/fd.c b/server/fd.c index 942585b06ae..dc35999c3f3 100644 --- a/server/fd.c +++ b/server/fd.c @@ -2525,6 +2525,9 @@ static void set_fd_disposition( struct fd *fd, unsigned int flags ) } } + if (flags & FILE_DISPOSITION_ON_CLOSE) + fd->options &= ~FILE_DELETE_ON_CLOSE; + fd->closed->unlink = (flags & FILE_DISPOSITION_DELETE) ? 1 : 0; if (fd->options & FILE_DELETE_ON_CLOSE) fd->closed->unlink = -1;
1
0
0
0
Joel Holdsworth : ntdll/tests: Add tests for FILE_DISPOSITION_ON_CLOSE.
by Alexandre Julliard
27 Jun '23
27 Jun '23
Module: wine Branch: master Commit: d89ee7c030afb0eb8be72625763f4a8c3158372c URL:
https://gitlab.winehq.org/wine/wine/-/commit/d89ee7c030afb0eb8be72625763f4a…
Author: Joel Holdsworth <joel(a)airwebreathe.org.uk> Date: Tue Jun 20 15:33:48 2023 +0100 ntdll/tests: Add tests for FILE_DISPOSITION_ON_CLOSE. Signed-off-by: Joel Holdsworth <joel(a)airwebreathe.org.uk> --- dlls/ntdll/tests/file.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index 10d66ff201a..f76448659e2 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -3150,6 +3150,24 @@ static void test_file_disposition_information(void) fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND; ok( fileDeleted, "File should have been deleted\n" ); + /* can reset delete-on-close flag through FileDispositionInformationEx */ + /* FileDispositionInformationEx is only supported on Windows 10 build 1809 and later */ + GetTempFileNameA( tmp_path, "dis", 0, buffer ); + handle = CreateFileA(buffer, GENERIC_WRITE | DELETE, 0, NULL, CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, 0); + ok( handle != INVALID_HANDLE_VALUE, "failed to create temp file\n" ); + fdie.Flags = FILE_DISPOSITION_ON_CLOSE; + res = pNtSetInformationFile( handle, &io, &fdie, sizeof fdie, FileDispositionInformationEx ); + ok( res == STATUS_INVALID_INFO_CLASS || res == STATUS_SUCCESS, + "unexpected FileDispositionInformationEx result (expected STATUS_SUCCESS or SSTATUS_INVALID_INFO_CLASS, got %lx)\n", res ); + CloseHandle( handle ); + if ( res == STATUS_SUCCESS ) + { + fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND; + todo_wine + ok( !fileDeleted, "File shouldn't have been deleted\n" ); + DeleteFileA( buffer ); + } + /* DeleteFile fails for wrong sharing mode */ GetTempFileNameA( tmp_path, "dis", 0, buffer ); handle = CreateFileA(buffer, GENERIC_WRITE | DELETE, 0, NULL, CREATE_ALWAYS, 0, 0);
1
0
0
0
Joel Holdsworth : ntdll: Implement FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE.
by Alexandre Julliard
27 Jun '23
27 Jun '23
Module: wine Branch: master Commit: 91e442b060c36e831ae1ee492ec9ddf5ba81d21b URL:
https://gitlab.winehq.org/wine/wine/-/commit/91e442b060c36e831ae1ee492ec9dd…
Author: Joel Holdsworth <joel(a)airwebreathe.org.uk> Date: Thu Jun 15 15:59:51 2023 +0100 ntdll: Implement FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE. Both the Msys2 and Cygwin runtimes make use of FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE in their implementations of the unlink() system call. This enables these routines to delete a read-only file without first modifying the attributes.
https://github.com/msys2/msys2-runtime/blob/msys2-3.4.3/winsup/cygwin/sysca…
https://www.cygwin.com/git/?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/sysc…
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=50771
Signed-off-by: Joel Holdsworth <joel(a)airwebreathe.org.uk> --- dlls/ntdll/tests/file.c | 2 -- dlls/ntdll/unix/file.c | 2 -- server/fd.c | 3 ++- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index 3db9177ec87..10d66ff201a 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -3098,14 +3098,12 @@ static void test_file_disposition_information(void) ok( handle != INVALID_HANDLE_VALUE, "failed to create temp file\n" ); fdie.Flags = FILE_DISPOSITION_DELETE | FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE; res = pNtSetInformationFile( handle, &io, &fdie, sizeof fdie, FileDispositionInformationEx ); - todo_wine ok( res == STATUS_SUCCESS || broken(res == STATUS_INVALID_INFO_CLASS), "unexpected FileDispositionInformationEx result (expected STATUS_SUCCESS or SSTATUS_INVALID_INFO_CLASS, got %lx)\n", res ); CloseHandle( handle ); if ( res == STATUS_SUCCESS ) { fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND; - todo_wine ok( fileDeleted, "File should have been deleted\n" ); } SetFileAttributesA( buffer, FILE_ATTRIBUTE_NORMAL ); diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 56b59413327..22046e63a21 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -4774,8 +4774,6 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io, FIXME( "FILE_DISPOSITION_FORCE_IMAGE_SECTION_CHECK not supported\n" ); if (info->Flags & FILE_DISPOSITION_ON_CLOSE) FIXME( "FILE_DISPOSITION_ON_CLOSE not supported\n" ); - if (info->Flags & FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE) - FIXME( "FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE not supported\n" ); SERVER_START_REQ( set_fd_disp_info ) { diff --git a/server/fd.c b/server/fd.c index 9388d36dcfd..942585b06ae 100644 --- a/server/fd.c +++ b/server/fd.c @@ -2499,7 +2499,8 @@ static void set_fd_disposition( struct fd *fd, unsigned int flags ) } if (S_ISREG( st.st_mode )) /* can't unlink files we don't have permission to write */ { - if (!(st.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH))) + if (!(flags & FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE) && + !(st.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH))) { set_error( STATUS_CANNOT_DELETE ); return;
1
0
0
0
Joel Holdsworth : ntdll/tests: Add tests for FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE.
by Alexandre Julliard
27 Jun '23
27 Jun '23
Module: wine Branch: master Commit: cbc1e4423e6d40221734544d081c718cb2a2a778 URL:
https://gitlab.winehq.org/wine/wine/-/commit/cbc1e4423e6d40221734544d081c71…
Author: Joel Holdsworth <joel(a)airwebreathe.org.uk> Date: Mon May 1 15:27:57 2023 +0100 ntdll/tests: Add tests for FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE. Signed-off-by: Joel Holdsworth <joel(a)airwebreathe.org.uk> --- dlls/ntdll/tests/file.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index b96b2e5b072..3db9177ec87 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -2957,6 +2957,7 @@ static void test_file_disposition_information(void) NTSTATUS res; IO_STATUS_BLOCK io; FILE_DISPOSITION_INFORMATION fdi; + FILE_DISPOSITION_INFORMATION_EX fdie; FILE_STANDARD_INFORMATION fsi; BOOL fileDeleted; DWORD fdi2, size; @@ -3089,6 +3090,27 @@ static void test_file_disposition_information(void) SetFileAttributesA( buffer, FILE_ATTRIBUTE_NORMAL ); DeleteFileA( buffer ); + /* set disposition on readonly file ignoring readonly attribute */ + /* FileDispositionInformationEx is only supported on Windows 10 build 1809 and later */ + GetTempFileNameA( tmp_path, "dis", 0, buffer ); + DeleteFileA( buffer ); + handle = CreateFileA(buffer, GENERIC_WRITE | DELETE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_READONLY, 0); + ok( handle != INVALID_HANDLE_VALUE, "failed to create temp file\n" ); + fdie.Flags = FILE_DISPOSITION_DELETE | FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE; + res = pNtSetInformationFile( handle, &io, &fdie, sizeof fdie, FileDispositionInformationEx ); + todo_wine + ok( res == STATUS_SUCCESS || broken(res == STATUS_INVALID_INFO_CLASS), + "unexpected FileDispositionInformationEx result (expected STATUS_SUCCESS or SSTATUS_INVALID_INFO_CLASS, got %lx)\n", res ); + CloseHandle( handle ); + if ( res == STATUS_SUCCESS ) + { + fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND; + todo_wine + ok( fileDeleted, "File should have been deleted\n" ); + } + SetFileAttributesA( buffer, FILE_ATTRIBUTE_NORMAL ); + DeleteFileA( buffer ); + /* can set disposition on file and then reset it */ GetTempFileNameA( tmp_path, "dis", 0, buffer ); handle = CreateFileA(buffer, GENERIC_WRITE | DELETE, 0, NULL, CREATE_ALWAYS, 0, 0);
1
0
0
0
← Newer
1
...
9
10
11
12
13
14
15
...
64
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
Results per page:
10
25
50
100
200