Module: wine
Branch: master
Commit: a7937e83b2f8606aa777098eb5e738241a5458e1
URL: https://gitlab.winehq.org/wine/wine/-/commit/a7937e83b2f8606aa777098eb5e738…
Author: Tim Clem <tclem(a)codeweavers.com>
Date: Tue Aug 9 13:10:15 2022 -0700
kernelbase: Don't assume the length of the process image name.
NtQueryInformationProcess(ProcessImageFileNameWin32) may return an
empty string in some circumstances, which leads
QueryFullProcessImageNameW to crash if called with flags including
PROCESS_NAME_NATIVE, as that path assumed the image name had a length
of at least 2.
---
dlls/kernelbase/debug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/kernelbase/debug.c b/dlls/kernelbase/debug.c
index 9e954e3ffbe..cd8e0d7f87d 100644
--- a/dlls/kernelbase/debug.c
+++ b/dlls/kernelbase/debug.c
@@ -1575,7 +1575,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH QueryFullProcessImageNameW( HANDLE process, DWORD
if (status) goto cleanup;
- if (flags & PROCESS_NAME_NATIVE)
+ if (flags & PROCESS_NAME_NATIVE && result->Length > 2 * sizeof(WCHAR))
{
WCHAR drive[3];
WCHAR device[1024];
Module: wine
Branch: master
Commit: 9cfd5d00ca5a0643e15279d7ea7ca7db5be698a4
URL: https://gitlab.winehq.org/wine/wine/-/commit/9cfd5d00ca5a0643e15279d7ea7ca7…
Author: David Gow <david(a)ingeniumdigital.com>
Date: Sun Jul 31 09:58:09 2022 +0800
quartz: Open files with FILE_SHARE_DELETE in FileSource.
Some games (such as Digimon Survive) create temporary video files and
will hang if deleting them fails. Open the files with FILE_SHARE_DELETE,
which will allow this deletion to go ahead even if the FileSource hasn't
yet been closed.
Note that many windows codec packs do themselves open files without
FILE_SHARE_DELETE, so a similar hang can be observed in some windows
configurations.
I haven't checked that this is the file share mode used on windows
(alas, I don't have a windows machine available), so I haven't removed
the FIXME comment. Equally, I also updated the CreateFileW() call
in get_media_type(), but that _may_ be unnecessary.
Signed-off-by: David Gow <david(a)ingeniumdigital.com>
---
dlls/quartz/filesource.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c
index 6ffae606df4..0579f564af7 100644
--- a/dlls/quartz/filesource.c
+++ b/dlls/quartz/filesource.c
@@ -214,7 +214,7 @@ BOOL get_media_type(const WCHAR *filename, GUID *majortype, GUID *subtype, GUID
}
}
- if ((file = CreateFileW(filename, GENERIC_READ, FILE_SHARE_READ, NULL,
+ if ((file = CreateFileW(filename, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_DELETE, NULL,
OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE)
{
WARN("Failed to open file %s, error %lu.\n", debugstr_w(filename), GetLastError());
@@ -464,7 +464,7 @@ static HRESULT WINAPI FileSource_Load(IFileSourceFilter * iface, LPCOLESTR pszFi
/* open file */
/* FIXME: check the sharing values that native uses */
- hFile = CreateFileW(pszFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL);
+ hFile = CreateFileW(pszFileName, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL);
if (hFile == INVALID_HANDLE_VALUE)
{