You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-12-15 08:03:15 -08:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6ba963ad0 | ||
|
|
8ea0f4968f | ||
|
|
217f208541 | ||
|
|
54f4c57fd6 | ||
|
|
0c0b6c45da | ||
|
|
da6c42770b | ||
|
|
b7f859e90d | ||
|
|
463f0b7936 | ||
|
|
959925fc2f | ||
|
|
3e92d6c89c | ||
|
|
3bb1cddffc | ||
|
|
4741f1abc6 |
@@ -1,117 +0,0 @@
|
||||
From 51373e0350ff1b507d7b47d6e5acd84b8af9d328 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
|
||||
Date: Sat, 6 Feb 2021 12:46:30 -0700
|
||||
Subject: [PATCH] kernelbase: Add support for moving reparse points with
|
||||
MoveFile*.
|
||||
|
||||
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
---
|
||||
dlls/kernelbase/file.c | 2 +-
|
||||
dlls/ntdll/unix/file.c | 24 ++++++++++++++++++++++--
|
||||
server/fd.c | 6 ++++--
|
||||
3 files changed, 27 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c
|
||||
index 36045116e43..f1b1326353f 100644
|
||||
--- a/dlls/kernelbase/file.c
|
||||
+++ b/dlls/kernelbase/file.c
|
||||
@@ -2597,7 +2597,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH MoveFileWithProgressW( const WCHAR *source, const
|
||||
InitializeObjectAttributes( &attr, &nt_name, OBJ_CASE_INSENSITIVE, 0, NULL );
|
||||
status = NtOpenFile( &source_handle, DELETE | SYNCHRONIZE, &attr, &io,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
|
||||
- FILE_SYNCHRONOUS_IO_NONALERT );
|
||||
+ FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_REPARSE_POINT );
|
||||
RtlFreeUnicodeString( &nt_name );
|
||||
if (!set_ntstatus( status )) goto error;
|
||||
|
||||
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
|
||||
index 3c341a6d702..9076da9f763 100644
|
||||
--- a/dlls/ntdll/unix/file.c
|
||||
+++ b/dlls/ntdll/unix/file.c
|
||||
@@ -5572,6 +5572,8 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
|
||||
unsigned int flags;
|
||||
UNICODE_STRING name_str, nt_name;
|
||||
OBJECT_ATTRIBUTES attr;
|
||||
+ REPARSE_DATA_BUFFER *buffer = NULL;
|
||||
+ ULONG buffer_len = 0;
|
||||
char *unix_name;
|
||||
|
||||
if (class == FileRenameInformation)
|
||||
@@ -5586,6 +5588,20 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
|
||||
name_str.Length = info->FileNameLength;
|
||||
name_str.MaximumLength = info->FileNameLength + sizeof(WCHAR);
|
||||
InitializeObjectAttributes( &attr, &name_str, OBJ_CASE_INSENSITIVE, info->RootDirectory, NULL );
|
||||
+
|
||||
+ /* obtain all the data from the reparse point (if applicable) */
|
||||
+ status = get_reparse_point( handle, NULL, &buffer_len );
|
||||
+ if (status == STATUS_BUFFER_TOO_SMALL)
|
||||
+ {
|
||||
+ buffer = malloc( buffer_len );
|
||||
+ status = get_reparse_point( handle, buffer, &buffer_len );
|
||||
+ if (status != STATUS_SUCCESS)
|
||||
+ {
|
||||
+ free( buffer );
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
status = get_nt_and_unix_names( &attr, &nt_name, &unix_name, FILE_OPEN_IF );
|
||||
if (status == STATUS_SUCCESS || status == STATUS_NO_SUCH_FILE)
|
||||
{
|
||||
@@ -5602,8 +5618,13 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
|
||||
}
|
||||
SERVER_END_REQ;
|
||||
|
||||
+ /* rebuild reparse point in new location (if applicable) */
|
||||
+ if (buffer && status == STATUS_SUCCESS)
|
||||
+ status = create_reparse_point( handle, buffer );
|
||||
+
|
||||
+ free( unix_name );
|
||||
}
|
||||
- free( unix_name );
|
||||
+ free( buffer );
|
||||
free( nt_name.Buffer );
|
||||
}
|
||||
else status = STATUS_INVALID_PARAMETER_3;
|
||||
@@ -5646,7 +5667,6 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
|
||||
status = wine_server_call( req );
|
||||
}
|
||||
SERVER_END_REQ;
|
||||
-
|
||||
}
|
||||
free( unix_name );
|
||||
free( nt_name.Buffer );
|
||||
diff --git a/server/fd.c b/server/fd.c
|
||||
index 466259ae567..7f88fcd6e33 100644
|
||||
--- a/server/fd.c
|
||||
+++ b/server/fd.c
|
||||
@@ -2771,7 +2771,7 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr, da
|
||||
goto failed;
|
||||
}
|
||||
|
||||
- if (!stat( name, &st ))
|
||||
+ if (!lstat( name, &st ))
|
||||
{
|
||||
if (!fstat( fd->unix_fd, &st2 ) && st.st_ino == st2.st_ino && st.st_dev == st2.st_dev)
|
||||
{
|
||||
@@ -2787,7 +2787,7 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr, da
|
||||
}
|
||||
|
||||
/* can't replace directories or special files */
|
||||
- if (!S_ISREG( st.st_mode ))
|
||||
+ if (!S_ISREG( st.st_mode ) && !S_ISLNK( st.st_mode ))
|
||||
{
|
||||
set_error( STATUS_ACCESS_DENIED );
|
||||
goto failed;
|
||||
@@ -2853,6 +2853,8 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr, da
|
||||
fd->nt_name = dup_nt_name( root, nt_name, &fd->nt_namelen );
|
||||
free( fd->unix_name );
|
||||
fd->closed->unix_name = fd->unix_name = realpath( name, NULL );
|
||||
+ if (!fd->unix_name)
|
||||
+ fd->closed->unix_name = fd->unix_name = dup_fd_name( root, name ); /* dangling symlink */
|
||||
free( name );
|
||||
if (!fd->unix_name)
|
||||
set_error( STATUS_NO_MEMORY );
|
||||
--
|
||||
2.47.2
|
||||
|
||||
@@ -1,214 +0,0 @@
|
||||
From 09318135fc87cd27e9df660958dcda6fe7d6f997 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
|
||||
Date: Sat, 12 Dec 2020 17:28:31 -0700
|
||||
Subject: [PATCH] kernel32: Advertise reparse point support.
|
||||
|
||||
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
---
|
||||
dlls/mountmgr.sys/device.c | 33 ++++++++++++-
|
||||
dlls/mountmgr.sys/unixlib.c | 97 +++++++++++++++++++++++++++++++++++++
|
||||
dlls/mountmgr.sys/unixlib.h | 8 +++
|
||||
3 files changed, 137 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c
|
||||
index 6c62ac78c76..1ee82e92c97 100644
|
||||
--- a/dlls/mountmgr.sys/device.c
|
||||
+++ b/dlls/mountmgr.sys/device.c
|
||||
@@ -177,6 +177,36 @@ static void get_filesystem_serial( struct volume *volume )
|
||||
volume->serial = strtoul( buffer, NULL, 16 );
|
||||
}
|
||||
|
||||
+/* get the flags for the volume by looking at the type of underlying filesystem */
|
||||
+static DWORD get_filesystem_flags( struct volume *volume )
|
||||
+{
|
||||
+ char fstypename[256];
|
||||
+ ULONG size = sizeof(fstypename);
|
||||
+ struct get_volume_filesystem_params params = { volume->device->unix_mount, fstypename, &size };
|
||||
+
|
||||
+ if (!volume->device->unix_mount) return 0;
|
||||
+ if (MOUNTMGR_CALL( get_volume_filesystem, ¶ms )) return 0;
|
||||
+
|
||||
+ if (!strcmp("apfs", fstypename) ||
|
||||
+ !strcmp("nfs", fstypename) ||
|
||||
+ !strcmp("cifs", fstypename) ||
|
||||
+ !strcmp("ncpfs", fstypename) ||
|
||||
+ !strcmp("tmpfs", fstypename) ||
|
||||
+ !strcmp("cramfs", fstypename) ||
|
||||
+ !strcmp("devfs", fstypename) ||
|
||||
+ !strcmp("procfs", fstypename) ||
|
||||
+ !strcmp("ext2", fstypename) ||
|
||||
+ !strcmp("ext3", fstypename) ||
|
||||
+ !strcmp("ext4", fstypename) ||
|
||||
+ !strcmp("hfs", fstypename) ||
|
||||
+ !strcmp("hpfs", fstypename) ||
|
||||
+ !strcmp("ntfs", fstypename))
|
||||
+ {
|
||||
+ return FILE_SUPPORTS_REPARSE_POINTS;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
|
||||
/******************************************************************
|
||||
* VOLUME_FindCdRomDataBestVoldesc
|
||||
@@ -1704,7 +1734,8 @@ static NTSTATUS WINAPI harddisk_query_volume( DEVICE_OBJECT *device, IRP *irp )
|
||||
break;
|
||||
default:
|
||||
fsname = L"NTFS";
|
||||
- info->FileSystemAttributes = FILE_CASE_PRESERVED_NAMES | FILE_PERSISTENT_ACLS;
|
||||
+ info->FileSystemAttributes = FILE_CASE_PRESERVED_NAMES | FILE_PERSISTENT_ACLS
|
||||
+ | get_filesystem_flags( volume );
|
||||
info->MaximumComponentNameLength = 255;
|
||||
break;
|
||||
}
|
||||
diff --git a/dlls/mountmgr.sys/unixlib.c b/dlls/mountmgr.sys/unixlib.c
|
||||
index 80e7c850854..55489d9965b 100644
|
||||
--- a/dlls/mountmgr.sys/unixlib.c
|
||||
+++ b/dlls/mountmgr.sys/unixlib.c
|
||||
@@ -38,6 +38,21 @@
|
||||
#endif
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
+#ifdef HAVE_SYS_STATFS_H
|
||||
+# include <sys/statfs.h>
|
||||
+#endif
|
||||
+#ifdef HAVE_SYS_SYSCALL_H
|
||||
+# include <sys/syscall.h>
|
||||
+#endif
|
||||
+#ifdef HAVE_SYS_VFS_H
|
||||
+# include <sys/vfs.h>
|
||||
+#endif
|
||||
+#ifdef HAVE_SYS_PARAM_H
|
||||
+#include <sys/param.h>
|
||||
+#endif
|
||||
+#ifdef HAVE_SYS_MOUNT_H
|
||||
+#include <sys/mount.h>
|
||||
+#endif
|
||||
|
||||
#include "unixlib.h"
|
||||
#include "wine/debug.h"
|
||||
@@ -463,6 +478,87 @@ static NTSTATUS read_volume_file( void *args )
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
+static NTSTATUS get_volume_filesystem( void *args )
|
||||
+{
|
||||
+#if defined(__NR_renameat2) || defined(RENAME_SWAP)
|
||||
+ const struct get_volume_filesystem_params *params = args;
|
||||
+#if defined(HAVE_FSTATFS)
|
||||
+ struct statfs stfs;
|
||||
+#elif defined(HAVE_FSTATVFS)
|
||||
+ struct statvfs stfs;
|
||||
+#endif
|
||||
+ const char *fstypename = "unknown";
|
||||
+ int fd = -1;
|
||||
+
|
||||
+ if (params->volume[0] != '/')
|
||||
+ {
|
||||
+ char *path = get_dosdevices_path( params->volume );
|
||||
+ if (path) fd = open( path, O_RDONLY );
|
||||
+ free( path );
|
||||
+ }
|
||||
+ else fd = open( params->volume, O_RDONLY );
|
||||
+ if (fd == -1) return STATUS_NO_SUCH_FILE;
|
||||
+
|
||||
+#if defined(HAVE_FSTATFS)
|
||||
+ if (fstatfs(fd, &stfs))
|
||||
+ return STATUS_NO_SUCH_FILE;
|
||||
+#elif defined(HAVE_FSTATVFS)
|
||||
+ if (fstatvfs(fd, &stfs))
|
||||
+ return STATUS_NO_SUCH_FILE;
|
||||
+#endif
|
||||
+ close( fd );
|
||||
+#if defined(HAVE_FSTATFS) && defined(linux)
|
||||
+ switch (stfs.f_type)
|
||||
+ {
|
||||
+ case 0x6969: /* nfs */
|
||||
+ fstypename = "nfs";
|
||||
+ break;
|
||||
+ case 0xff534d42: /* cifs */
|
||||
+ fstypename = "cifs";
|
||||
+ break;
|
||||
+ case 0x564c: /* ncpfs */
|
||||
+ fstypename = "ncpfs";
|
||||
+ break;
|
||||
+ case 0x01021994: /* tmpfs */
|
||||
+ fstypename = "tmpfs";
|
||||
+ break;
|
||||
+ case 0x28cd3d45: /* cramfs */
|
||||
+ fstypename = "cramfs";
|
||||
+ break;
|
||||
+ case 0x1373: /* devfs */
|
||||
+ fstypename = "devfs";
|
||||
+ break;
|
||||
+ case 0x9fa0: /* procfs */
|
||||
+ fstypename = "procfs";
|
||||
+ break;
|
||||
+ case 0xef51: /* old ext2 */
|
||||
+ fstypename = "ext2";
|
||||
+ break;
|
||||
+ case 0xef53: /* ext2/3/4 */
|
||||
+ fstypename = "ext2";
|
||||
+ break;
|
||||
+ case 0x4244: /* hfs */
|
||||
+ fstypename = "hfs";
|
||||
+ break;
|
||||
+ case 0xf995e849: /* hpfs */
|
||||
+ fstypename = "hpfs";
|
||||
+ break;
|
||||
+ case 0x5346544e: /* ntfs */
|
||||
+ fstypename = "ntfs";
|
||||
+ break;
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__) || defined(__NetBSD__)
|
||||
+ fstypename = stfs.f_fstypename;
|
||||
+#endif
|
||||
+ lstrcpynA( params->fstypename, fstypename, *params->size );
|
||||
+ return STATUS_SUCCESS;
|
||||
+#else
|
||||
+ return STATUS_NOT_IMPLEMENTED;
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
static NTSTATUS match_unixdev( void *args )
|
||||
{
|
||||
const struct match_unixdev_params *params = args;
|
||||
@@ -607,6 +703,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
|
||||
write_credential,
|
||||
delete_credential,
|
||||
enumerate_credentials,
|
||||
+ get_volume_filesystem,
|
||||
};
|
||||
|
||||
C_ASSERT( ARRAYSIZE(__wine_unix_call_funcs) == unix_funcs_count );
|
||||
diff --git a/dlls/mountmgr.sys/unixlib.h b/dlls/mountmgr.sys/unixlib.h
|
||||
index 7a3d0038512..ac7e6a553c7 100644
|
||||
--- a/dlls/mountmgr.sys/unixlib.h
|
||||
+++ b/dlls/mountmgr.sys/unixlib.h
|
||||
@@ -107,6 +107,13 @@ struct read_volume_file_params
|
||||
ULONG *size;
|
||||
};
|
||||
|
||||
+struct get_volume_filesystem_params
|
||||
+{
|
||||
+ const char *volume;
|
||||
+ void *fstypename;
|
||||
+ ULONG *size;
|
||||
+};
|
||||
+
|
||||
struct match_unixdev_params
|
||||
{
|
||||
const char *device;
|
||||
@@ -173,6 +180,7 @@ enum mountmgr_funcs
|
||||
unix_write_credential,
|
||||
unix_delete_credential,
|
||||
unix_enumerate_credentials,
|
||||
+ unix_get_volume_filesystem,
|
||||
unix_funcs_count
|
||||
};
|
||||
|
||||
--
|
||||
2.40.1
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,48 +0,0 @@
|
||||
From 4039b5b7bd3e8df9052006c5755a63aab93d52ef Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Wed, 29 May 2019 15:11:42 -0600
|
||||
Subject: kernel32: Add reparse support to FindNextFile.
|
||||
|
||||
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
---
|
||||
dlls/kernelbase/file.c | 24 ++++++++++++++++++++++++
|
||||
1 file changed, 24 insertions(+)
|
||||
|
||||
diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c
|
||||
index bf6e9e17c9e..26d3dde5ad6 100644
|
||||
--- a/dlls/kernelbase/file.c
|
||||
+++ b/dlls/kernelbase/file.c
|
||||
@@ -1508,6 +1508,30 @@ BOOL WINAPI DECLSPEC_HOTPATCH FindNextFileW( HANDLE handle, WIN32_FIND_DATAW *da
|
||||
memcpy( data->cFileName, dir_info->FileName, dir_info->FileNameLength );
|
||||
data->cFileName[dir_info->FileNameLength/sizeof(WCHAR)] = 0;
|
||||
|
||||
+ /* get reparse tag */
|
||||
+ if (dir_info->FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
|
||||
+ {
|
||||
+ INT path_len = info->path.Length + dir_info->FileNameLength + sizeof(WCHAR);
|
||||
+ WCHAR *path = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, path_len );
|
||||
+ FILE_ATTRIBUTE_TAG_INFORMATION taginfo;
|
||||
+ IO_STATUS_BLOCK iosb;
|
||||
+ NTSTATUS status;
|
||||
+ HANDLE hlink;
|
||||
+
|
||||
+ if (!path) break;
|
||||
+
|
||||
+ lstrcpynW( path, info->path.Buffer, info->path.Length/sizeof(WCHAR) + 1 );
|
||||
+ lstrcatW( path, data->cFileName );
|
||||
+
|
||||
+ hlink = CreateFileW( path, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING,
|
||||
+ FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, 0 );
|
||||
+ HeapFree( GetProcessHeap(), 0, path );
|
||||
+ status = NtQueryInformationFile( hlink, &iosb, &taginfo, sizeof(taginfo),
|
||||
+ FileAttributeTagInformation );
|
||||
+ if (status == STATUS_SUCCESS) data->dwReserved0 = taginfo.ReparseTag;
|
||||
+ CloseHandle( hlink );
|
||||
+ }
|
||||
+
|
||||
if (info->level != FindExInfoBasic)
|
||||
{
|
||||
memcpy( data->cAlternateFileName, dir_info->ShortName, dir_info->ShortNameLength );
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
From 8ceb056ccdf36bdf8a8692bd5882fc686aace5f6 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Wed, 29 May 2019 15:18:50 -0600
|
||||
Subject: wcmd: Display reparse point type in directory listings.
|
||||
|
||||
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
---
|
||||
programs/cmd/directory.c | 26 ++++++++++++++++++++++++++
|
||||
1 file changed, 26 insertions(+)
|
||||
|
||||
diff --git a/programs/cmd/directory.c b/programs/cmd/directory.c
|
||||
index 8417687939a..a849807c76e 100644
|
||||
--- a/programs/cmd/directory.c
|
||||
+++ b/programs/cmd/directory.c
|
||||
@@ -395,6 +395,32 @@ static DIRECTORY_STACK *WCMD_list_directory (DIRECTORY_STACK *inputparms, int le
|
||||
WCMD_output(L"%1!*s!", cur_width - tmp_width, L"");
|
||||
}
|
||||
|
||||
+ } else if (fd[i].dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
|
||||
+ if (!bare) {
|
||||
+ const WCHAR *type;
|
||||
+
|
||||
+ switch(fd[i].dwReserved0) {
|
||||
+ case IO_REPARSE_TAG_MOUNT_POINT:
|
||||
+ type = L"<JUNCTION>";
|
||||
+ break;
|
||||
+ case IO_REPARSE_TAG_SYMLINK:
|
||||
+ default:
|
||||
+ type = (fd[i].dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? L"<SYMLINKD>" : L"<SYMLINK>";
|
||||
+ break;
|
||||
+ }
|
||||
+ WCMD_output (L"%1!10s! %2!8s! %3!-14s!", datestring, timestring, type);
|
||||
+ if (shortname) WCMD_output (L"%1!-13s!", fd[i].cAlternateFileName);
|
||||
+ if (usernames) WCMD_output (L"%1!-23s!", username);
|
||||
+ WCMD_output(L"%1",fd[i].cFileName);
|
||||
+ } else {
|
||||
+ if (!((lstrcmpW(fd[i].cFileName, L".") == 0) ||
|
||||
+ (lstrcmpW(fd[i].cFileName, L"..") == 0))) {
|
||||
+ WCMD_output (L"%1%2", recurse?inputparms->dirName : L"", fd[i].cFileName);
|
||||
+ } else {
|
||||
+ addNewLine = FALSE;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
} else if (fd[i].dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
|
||||
dir_count++;
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
From 563bc2fc3c48b2341a08a662e27e27a904702121 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Wed, 29 May 2019 15:38:30 -0600
|
||||
Subject: wcmd: Show reparse point target in directory listing.
|
||||
|
||||
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
---
|
||||
programs/cmd/directory.c | 35 +++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 35 insertions(+)
|
||||
|
||||
diff --git a/programs/cmd/directory.c b/programs/cmd/directory.c
|
||||
index a849807c76e..5b0a19b442d 100644
|
||||
--- a/programs/cmd/directory.c
|
||||
+++ b/programs/cmd/directory.c
|
||||
@@ -23,6 +23,8 @@
|
||||
|
||||
#include "wcmd.h"
|
||||
#include "wine/debug.h"
|
||||
+#include "winioctl.h"
|
||||
+#include "ddk/ntifs.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(cmd);
|
||||
|
||||
@@ -412,6 +414,39 @@ static DIRECTORY_STACK *WCMD_list_directory (DIRECTORY_STACK *inputparms, int le
|
||||
if (shortname) WCMD_output (L"%1!-13s!", fd[i].cAlternateFileName);
|
||||
if (usernames) WCMD_output (L"%1!-23s!", username);
|
||||
WCMD_output(L"%1",fd[i].cFileName);
|
||||
+ if (fd[i].dwReserved0) {
|
||||
+ REPARSE_DATA_BUFFER *buffer = NULL;
|
||||
+ WCHAR *target = NULL;
|
||||
+ INT buffer_len;
|
||||
+ HANDLE hlink;
|
||||
+ DWORD dwret;
|
||||
+ BOOL bret;
|
||||
+
|
||||
+ lstrcpyW(string, inputparms->dirName);
|
||||
+ lstrcatW(string, fd[i].cFileName);
|
||||
+ hlink = CreateFileW(string, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING,
|
||||
+ FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, 0);
|
||||
+ buffer_len = sizeof(*buffer) + 2*MAX_PATH*sizeof(WCHAR);
|
||||
+ buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, buffer_len);
|
||||
+ bret = DeviceIoControl(hlink, FSCTL_GET_REPARSE_POINT, NULL, 0, (LPVOID)buffer,
|
||||
+ buffer_len, &dwret, 0);
|
||||
+ if (bret) {
|
||||
+ INT offset;
|
||||
+ switch(buffer->ReparseTag) {
|
||||
+ case IO_REPARSE_TAG_MOUNT_POINT:
|
||||
+ offset = buffer->MountPointReparseBuffer.PrintNameOffset/sizeof(WCHAR);
|
||||
+ target = &buffer->MountPointReparseBuffer.PathBuffer[offset];
|
||||
+ break;
|
||||
+ case IO_REPARSE_TAG_SYMLINK:
|
||||
+ offset = buffer->SymbolicLinkReparseBuffer.PrintNameOffset/sizeof(WCHAR);
|
||||
+ target = &buffer->SymbolicLinkReparseBuffer.PathBuffer[offset];
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ CloseHandle(hlink);
|
||||
+ if (target) WCMD_output(L" [%1]", target);
|
||||
+ HeapFree(GetProcessHeap(), 0, buffer);
|
||||
+ }
|
||||
} else {
|
||||
if (!((lstrcmpW(fd[i].cFileName, L".") == 0) ||
|
||||
(lstrcmpW(fd[i].cFileName, L"..") == 0))) {
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
From be1665ad0d88598c409f6a1d699562c2dd0d525a Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Wed, 29 May 2019 16:01:45 -0600
|
||||
Subject: [PATCH] wcmd: Add junction point support to mklink.
|
||||
|
||||
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
---
|
||||
programs/cmd/builtins.c | 48 ++++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 47 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
|
||||
index 5b15c0f397a..6d7512275ce 100644
|
||||
--- a/programs/cmd/builtins.c
|
||||
+++ b/programs/cmd/builtins.c
|
||||
@@ -31,6 +31,9 @@
|
||||
#include "wcmd.h"
|
||||
#include <shellapi.h>
|
||||
#include "wine/debug.h"
|
||||
+#include "winternl.h"
|
||||
+#include "winioctl.h"
|
||||
+#include "ddk/ntifs.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(cmd);
|
||||
|
||||
@@ -4091,6 +4094,49 @@ RETURN_CODE WCMD_color(void)
|
||||
return errorlevel = return_code;
|
||||
}
|
||||
|
||||
+BOOL WCMD_create_junction(WCHAR *link, WCHAR *target) {
|
||||
+ static INT struct_size = offsetof(REPARSE_DATA_BUFFER, SymbolicLinkReparseBuffer.PathBuffer[0]);
|
||||
+ static INT header_size = offsetof(REPARSE_DATA_BUFFER, GenericReparseBuffer);
|
||||
+ INT buffer_size, data_size, string_len, prefix_len;
|
||||
+ WCHAR *subst_dest, *print_dest, *string;
|
||||
+ REPARSE_DATA_BUFFER *buffer;
|
||||
+ UNICODE_STRING nt_name;
|
||||
+ NTSTATUS status;
|
||||
+ HANDLE hlink;
|
||||
+ DWORD dwret;
|
||||
+ BOOL ret;
|
||||
+
|
||||
+ if (!CreateDirectoryW(link, NULL ))
|
||||
+ return FALSE;
|
||||
+ hlink = CreateFileW(link, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING,
|
||||
+ FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, 0);
|
||||
+ if (hlink == INVALID_HANDLE_VALUE)
|
||||
+ return FALSE;
|
||||
+ status = RtlDosPathNameToNtPathName_U_WithStatus(target, &nt_name, NULL, NULL);
|
||||
+ if (status)
|
||||
+ return FALSE;
|
||||
+ prefix_len = strlen("\\??\\");
|
||||
+ string = nt_name.Buffer;
|
||||
+ string_len = lstrlenW( &string[prefix_len] );
|
||||
+ data_size = (prefix_len + 2 * string_len + 2) * sizeof(WCHAR);
|
||||
+ buffer_size = struct_size + data_size;
|
||||
+ buffer = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, buffer_size );
|
||||
+ buffer->ReparseTag = IO_REPARSE_TAG_MOUNT_POINT;
|
||||
+ buffer->ReparseDataLength = struct_size - header_size + data_size;
|
||||
+ buffer->MountPointReparseBuffer.SubstituteNameLength = (prefix_len + string_len) * sizeof(WCHAR);
|
||||
+ buffer->MountPointReparseBuffer.PrintNameOffset = (prefix_len + string_len + 1) * sizeof(WCHAR);
|
||||
+ buffer->MountPointReparseBuffer.PrintNameLength = string_len * sizeof(WCHAR);
|
||||
+ subst_dest = &buffer->MountPointReparseBuffer.PathBuffer[0];
|
||||
+ print_dest = &buffer->MountPointReparseBuffer.PathBuffer[prefix_len + string_len + 1];
|
||||
+ lstrcpyW(subst_dest, string);
|
||||
+ lstrcpyW(print_dest, &string[prefix_len]);
|
||||
+ RtlFreeUnicodeString(&nt_name );
|
||||
+ ret = DeviceIoControl(hlink, FSCTL_SET_REPARSE_POINT, (LPVOID)buffer, buffer_size, NULL, 0,
|
||||
+ &dwret, 0 );
|
||||
+ HeapFree(GetProcessHeap(), 0, buffer);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
/****************************************************************************
|
||||
* WCMD_mklink
|
||||
*/
|
||||
@@ -4141,7 +4187,7 @@ RETURN_CODE WCMD_mklink(WCHAR *args)
|
||||
else if(!junction)
|
||||
ret = CreateSymbolicLinkW(file1, file2, isdir);
|
||||
else
|
||||
- TRACE("Junction links currently not supported.\n");
|
||||
+ ret = WCMD_create_junction(file1, file2);
|
||||
}
|
||||
|
||||
if (ret) return errorlevel = NO_ERROR;
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
From 0eda0c4092b0673e4b4e646388c53e2a8ecc2379 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Wed, 18 May 2016 18:08:24 +0800
|
||||
Subject: user32: Add a workaround for Windows 3.1 apps which call
|
||||
LoadImage(LR_LOADFROMFILE) with a resource id. (v2)
|
||||
|
||||
Fixes #24963.
|
||||
---
|
||||
dlls/user32/cursoricon.c | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c
|
||||
index 4f93195..95cc410 100644
|
||||
--- a/dlls/user32/cursoricon.c
|
||||
+++ b/dlls/user32/cursoricon.c
|
||||
@@ -1404,7 +1404,12 @@ static HICON CURSORICON_Load(HINSTANCE hInstance, LPCWSTR name,
|
||||
hInstance, debugstr_w(name), width, height, depth, fCursor, loadflags);
|
||||
|
||||
if ( loadflags & LR_LOADFROMFILE ) /* Load from file */
|
||||
- return CURSORICON_LoadFromFile( name, width, height, depth, fCursor, loadflags );
|
||||
+ {
|
||||
+ if (IS_INTRESOURCE(name) && GetProcessVersion(0) < 0x40000)
|
||||
+ WARN("Windows 3.1 app set LR_LOADFROMFILE without a name, fallback to loading from resource\n");
|
||||
+ else
|
||||
+ return CURSORICON_LoadFromFile( name, width, height, depth, fCursor, loadflags );
|
||||
+ }
|
||||
|
||||
if (!hInstance) hInstance = user32_module; /* Load OEM cursor/icon */
|
||||
|
||||
--
|
||||
2.8.0
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
Fixes: [24963] Workaround for Windows 3.1 apps which call LoadImage(LR_LOADFROMFILE) with a resource id
|
||||
@@ -1,4 +1,4 @@
|
||||
From 6c90ff9b852f02712c34de1ca23125bdb2c9284b Mon Sep 17 00:00:00 2001
|
||||
From 702653b1539507e6033d123a57f16f7206d78bb0 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Wed, 6 Mar 2024 20:21:36 +1100
|
||||
Subject: [PATCH] user32/msgbox: Support WM_COPY Message
|
||||
@@ -13,7 +13,7 @@ Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
3 files changed, 257 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/user32/msgbox.c b/dlls/user32/msgbox.c
|
||||
index 12eea8e92d7..9534656378d 100644
|
||||
index 009f3858c60..a21f210a2fd 100644
|
||||
--- a/dlls/user32/msgbox.c
|
||||
+++ b/dlls/user32/msgbox.c
|
||||
@@ -41,6 +41,11 @@ struct ThreadWindows
|
||||
@@ -130,10 +130,10 @@ index 12eea8e92d7..9534656378d 100644
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam))
|
||||
diff --git a/dlls/user32/tests/dialog.c b/dlls/user32/tests/dialog.c
|
||||
index 49b8f1968a0..a3004cf9443 100644
|
||||
index 20e21bea0bc..c3ba83c4893 100644
|
||||
--- a/dlls/user32/tests/dialog.c
|
||||
+++ b/dlls/user32/tests/dialog.c
|
||||
@@ -2068,6 +2068,171 @@ static void test_MessageBoxFontTest(void)
|
||||
@@ -2081,6 +2081,171 @@ static void test_MessageBoxFontTest(void)
|
||||
DestroyWindow(hDlg);
|
||||
}
|
||||
|
||||
@@ -305,9 +305,9 @@ index 49b8f1968a0..a3004cf9443 100644
|
||||
static void test_SaveRestoreFocus(void)
|
||||
{
|
||||
HWND hDlg;
|
||||
@@ -2440,6 +2605,7 @@ START_TEST(dialog)
|
||||
|
||||
if (!RegisterWindowClasses()) assert(0);
|
||||
@@ -2536,6 +2701,7 @@ START_TEST(dialog)
|
||||
return;
|
||||
}
|
||||
|
||||
+ test_MessageBox_WM_COPY_Test();
|
||||
test_dialog_custom_data();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 2f2480806c4c431aeb75308e570a317da43f3508 Mon Sep 17 00:00:00 2001
|
||||
From 26240eeb2925918d8c75a251fde5fd5ed9f9bfcf Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= <gabrielopcode@gmail.com>
|
||||
Date: Mon, 22 Jul 2019 15:29:25 +0300
|
||||
Subject: [PATCH] user32/focus: Prevent a recursive loop with the activation
|
||||
@@ -20,10 +20,10 @@ Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
|
||||
2 files changed, 30 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c
|
||||
index a4834b740d8..123a0ff9a94 100644
|
||||
index f431ab98a9f..9e07052d612 100644
|
||||
--- a/dlls/win32u/input.c
|
||||
+++ b/dlls/win32u/input.c
|
||||
@@ -1966,7 +1966,7 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new
|
||||
@@ -1992,7 +1992,7 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new
|
||||
{
|
||||
HWND previous = get_active_window();
|
||||
BOOL ret;
|
||||
@@ -32,7 +32,7 @@ index a4834b740d8..123a0ff9a94 100644
|
||||
CBTACTIVATESTRUCT cbt;
|
||||
|
||||
if (previous == hwnd)
|
||||
@@ -1975,16 +1975,24 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new
|
||||
@@ -2001,16 +2001,24 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new
|
||||
goto done;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ index a4834b740d8..123a0ff9a94 100644
|
||||
{
|
||||
- send_message( previous, WM_NCACTIVATE, FALSE, (LPARAM)hwnd );
|
||||
- send_message( previous, WM_ACTIVATE,
|
||||
- MAKEWPARAM( WA_INACTIVE, is_iconic(previous) ), (LPARAM)hwnd );
|
||||
- MAKEWPARAM( WA_INACTIVE, is_iconic(previous) ? 0x20 : 0 ), (LPARAM)hwnd );
|
||||
+ ret = FALSE;
|
||||
+
|
||||
+ /* call CBT hook chain */
|
||||
@@ -57,16 +57,16 @@ index a4834b740d8..123a0ff9a94 100644
|
||||
+ if (call_hooks( WH_CBT, HCBT_ACTIVATE, (WPARAM)hwnd, (LPARAM)&cbt, sizeof(cbt) ))
|
||||
+ goto clear_flags;
|
||||
+
|
||||
+ if (is_window(previous))
|
||||
+ if (is_window( previous ))
|
||||
+ {
|
||||
+ send_message( previous, WM_NCACTIVATE, FALSE, (LPARAM)hwnd );
|
||||
+ send_message( previous, WM_ACTIVATE,
|
||||
+ MAKEWPARAM( WA_INACTIVE, is_iconic(previous) ), (LPARAM)hwnd );
|
||||
+ MAKEWPARAM( WA_INACTIVE, is_iconic(previous) ? 0x20 : 0 ), (LPARAM)hwnd );
|
||||
+ }
|
||||
}
|
||||
|
||||
SERVER_START_REQ( set_active_window )
|
||||
@@ -2006,7 +2014,11 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new
|
||||
@@ -2032,7 +2040,11 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new
|
||||
if (send_message( hwnd, WM_QUERYNEWPALETTE, 0, 0 ))
|
||||
send_message_timeout( HWND_BROADCAST, WM_PALETTEISCHANGING, (WPARAM)hwnd, 0,
|
||||
SMTO_ABORTIFHUNG, 2000, FALSE );
|
||||
@@ -79,7 +79,7 @@ index a4834b740d8..123a0ff9a94 100644
|
||||
}
|
||||
|
||||
old_thread = previous ? get_window_thread( previous, NULL ) : 0;
|
||||
@@ -2039,7 +2051,7 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new
|
||||
@@ -2065,7 +2077,7 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ index a4834b740d8..123a0ff9a94 100644
|
||||
{
|
||||
send_message( hwnd, WM_NCACTIVATE, hwnd == NtUserGetForegroundWindow(), (LPARAM)previous );
|
||||
send_message( hwnd, WM_ACTIVATE,
|
||||
@@ -2064,13 +2076,17 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new
|
||||
@@ -2090,13 +2102,17 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,10 +108,10 @@ index a4834b740d8..123a0ff9a94 100644
|
||||
|
||||
/**********************************************************************
|
||||
diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h
|
||||
index 2f3bbdf91c0..74f5b07bd46 100644
|
||||
index c38b6d0e029..bec513cfadb 100644
|
||||
--- a/dlls/win32u/ntuser_private.h
|
||||
+++ b/dlls/win32u/ntuser_private.h
|
||||
@@ -92,6 +92,7 @@ typedef struct tagWND
|
||||
@@ -86,6 +86,7 @@ typedef struct tagWND
|
||||
#define WIN_NEEDS_SHOW_OWNEDPOPUP 0x0020 /* WM_SHOWWINDOW:SC_SHOW must be sent in the next ShowOwnedPopup call */
|
||||
#define WIN_CHILDREN_MOVED 0x0040 /* children may have moved, ignore stored positions */
|
||||
#define WIN_HAS_IME_WIN 0x0080 /* the window has been registered with imm32 */
|
||||
@@ -120,5 +120,5 @@ index 2f3bbdf91c0..74f5b07bd46 100644
|
||||
#define WND_OTHER_PROCESS ((WND *)1) /* returned by get_win_ptr on unknown window handles */
|
||||
#define WND_DESKTOP ((WND *)2) /* returned by get_win_ptr on the desktop window */
|
||||
--
|
||||
2.47.2
|
||||
2.51.0
|
||||
|
||||
|
||||
@@ -1,51 +1,24 @@
|
||||
From 4274d901461697a7fb05b0d1e0b06216061166f1 Mon Sep 17 00:00:00 2001
|
||||
From 3f2c89666f2eee64db4b634c0bfc420dfbbacc57 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Shefte <shefben@gmail.com>
|
||||
Date: Wed, 1 Mar 2023 07:37:52 +1100
|
||||
Subject: [PATCH] vcomp: Implement _vcomp_for_dynamic_init_i8
|
||||
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52012
|
||||
---
|
||||
dlls/vcomp/main.c | 135 ++++++++++++++++++++++++++++++++++++
|
||||
dlls/vcomp/vcomp.spec | 6 +-
|
||||
dlls/vcomp100/vcomp100.spec | 6 +-
|
||||
dlls/vcomp110/vcomp110.spec | 6 +-
|
||||
dlls/vcomp120/vcomp120.spec | 6 +-
|
||||
dlls/vcomp140/vcomp140.spec | 6 +-
|
||||
dlls/vcomp90/vcomp90.spec | 6 +-
|
||||
7 files changed, 153 insertions(+), 18 deletions(-)
|
||||
dlls/vcomp/main.c | 115 ++++++++++++++++++++++++++++++++++++
|
||||
dlls/vcomp/vcomp.spec | 4 +-
|
||||
dlls/vcomp100/vcomp100.spec | 4 +-
|
||||
dlls/vcomp110/vcomp110.spec | 4 +-
|
||||
dlls/vcomp120/vcomp120.spec | 4 +-
|
||||
dlls/vcomp140/vcomp140.spec | 4 +-
|
||||
dlls/vcomp90/vcomp90.spec | 4 +-
|
||||
7 files changed, 127 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c
|
||||
index 63ec0502b9b..4cde0381693 100644
|
||||
index 6a12da8d458..3b93926a405 100644
|
||||
--- a/dlls/vcomp/main.c
|
||||
+++ b/dlls/vcomp/main.c
|
||||
@@ -1034,6 +1034,26 @@ double CDECL omp_get_wtime(void)
|
||||
return GetTickCount() / 1000.0;
|
||||
}
|
||||
|
||||
+/*****************************************************
|
||||
+* omp_get_wtick - Taken from:
|
||||
+* https://gist.github.com/Randl/45bcca59720f661fa033a67d5f44bff0
|
||||
+*/
|
||||
+double CDECL omp_get_wtick (void)
|
||||
+{
|
||||
+ /*return GetTickCount();*/
|
||||
+ FILETIME createTime;
|
||||
+ FILETIME exitTime;
|
||||
+ FILETIME kernelTime;
|
||||
+ FILETIME userTime;
|
||||
+ ULARGE_INTEGER li;
|
||||
+
|
||||
+ GetProcessTimes(GetCurrentProcess(), &createTime, &exitTime, &kernelTime, &userTime);
|
||||
+ li.LowPart = userTime.dwLowDateTime;
|
||||
+ li.HighPart = userTime.dwHighDateTime;
|
||||
+
|
||||
+ return (double)li.QuadPart / 10000000.0;
|
||||
+}
|
||||
+
|
||||
void CDECL omp_set_dynamic(int val)
|
||||
{
|
||||
TRACE("(%d): stub\n", val);
|
||||
@@ -1486,6 +1506,77 @@ void CDECL _vcomp_for_dynamic_init(unsigned int flags, unsigned int first, unsig
|
||||
@@ -1341,6 +1341,77 @@ void CDECL _vcomp_for_dynamic_init(unsigned int flags, unsigned int first, unsig
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +96,7 @@ index 63ec0502b9b..4cde0381693 100644
|
||||
int CDECL _vcomp_for_dynamic_next(unsigned int *begin, unsigned int *end)
|
||||
{
|
||||
struct vcomp_thread_data *thread_data = vcomp_init_thread_data();
|
||||
@@ -1530,6 +1621,50 @@ int CDECL _vcomp_for_dynamic_next(unsigned int *begin, unsigned int *end)
|
||||
@@ -1385,6 +1456,50 @@ int CDECL _vcomp_for_dynamic_next(unsigned int *begin, unsigned int *end)
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -175,7 +148,7 @@ index 63ec0502b9b..4cde0381693 100644
|
||||
{
|
||||
TRACE("()\n");
|
||||
diff --git a/dlls/vcomp/vcomp.spec b/dlls/vcomp/vcomp.spec
|
||||
index fb67146e058..09bf45550d5 100644
|
||||
index 1a981a6c6c1..09bf45550d5 100644
|
||||
--- a/dlls/vcomp/vcomp.spec
|
||||
+++ b/dlls/vcomp/vcomp.spec
|
||||
@@ -56,9 +56,9 @@
|
||||
@@ -190,17 +163,8 @@ index fb67146e058..09bf45550d5 100644
|
||||
@ cdecl _vcomp_for_static_end()
|
||||
@ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr)
|
||||
@ cdecl _vcomp_for_static_init_i8(int64 int64 int64 int64 ptr ptr ptr ptr ptr)
|
||||
@@ -96,7 +96,7 @@
|
||||
@ cdecl omp_get_num_procs()
|
||||
@ cdecl omp_get_num_threads()
|
||||
@ cdecl omp_get_thread_num()
|
||||
-@ stub omp_get_wtick
|
||||
+@ cdecl omp_get_wtick()
|
||||
@ cdecl omp_get_wtime()
|
||||
@ cdecl omp_in_parallel()
|
||||
@ cdecl omp_init_lock(ptr)
|
||||
diff --git a/dlls/vcomp100/vcomp100.spec b/dlls/vcomp100/vcomp100.spec
|
||||
index fb67146e058..9aa43e3ba4b 100644
|
||||
index 1a981a6c6c1..c38fae6d27d 100644
|
||||
--- a/dlls/vcomp100/vcomp100.spec
|
||||
+++ b/dlls/vcomp100/vcomp100.spec
|
||||
@@ -56,9 +56,9 @@
|
||||
@@ -215,17 +179,8 @@ index fb67146e058..9aa43e3ba4b 100644
|
||||
@ cdecl _vcomp_for_static_end()
|
||||
@ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr)
|
||||
@ cdecl _vcomp_for_static_init_i8(int64 int64 int64 int64 ptr ptr ptr ptr ptr)
|
||||
@@ -96,7 +96,7 @@
|
||||
@ cdecl omp_get_num_procs()
|
||||
@ cdecl omp_get_num_threads()
|
||||
@ cdecl omp_get_thread_num()
|
||||
-@ stub omp_get_wtick
|
||||
+@ cdecl omp_get_wtick() vcomp.omp_get_wtick
|
||||
@ cdecl omp_get_wtime()
|
||||
@ cdecl omp_in_parallel()
|
||||
@ cdecl omp_init_lock(ptr)
|
||||
diff --git a/dlls/vcomp110/vcomp110.spec b/dlls/vcomp110/vcomp110.spec
|
||||
index e1cb8ab9931..d8b4d3e3f16 100644
|
||||
index d39aeb1f347..0475980a109 100644
|
||||
--- a/dlls/vcomp110/vcomp110.spec
|
||||
+++ b/dlls/vcomp110/vcomp110.spec
|
||||
@@ -57,9 +57,9 @@
|
||||
@@ -240,17 +195,8 @@ index e1cb8ab9931..d8b4d3e3f16 100644
|
||||
@ cdecl _vcomp_for_static_end()
|
||||
@ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr)
|
||||
@ cdecl _vcomp_for_static_init_i8(int64 int64 int64 int64 ptr ptr ptr ptr ptr)
|
||||
@@ -97,7 +97,7 @@
|
||||
@ cdecl omp_get_num_procs()
|
||||
@ cdecl omp_get_num_threads()
|
||||
@ cdecl omp_get_thread_num()
|
||||
-@ stub omp_get_wtick
|
||||
+@ cdecl omp_get_wtick() vcomp.omp_get_wtick
|
||||
@ cdecl omp_get_wtime()
|
||||
@ cdecl omp_in_parallel()
|
||||
@ cdecl omp_init_lock(ptr)
|
||||
diff --git a/dlls/vcomp120/vcomp120.spec b/dlls/vcomp120/vcomp120.spec
|
||||
index e1cb8ab9931..d8b4d3e3f16 100644
|
||||
index d39aeb1f347..0475980a109 100644
|
||||
--- a/dlls/vcomp120/vcomp120.spec
|
||||
+++ b/dlls/vcomp120/vcomp120.spec
|
||||
@@ -57,9 +57,9 @@
|
||||
@@ -265,17 +211,8 @@ index e1cb8ab9931..d8b4d3e3f16 100644
|
||||
@ cdecl _vcomp_for_static_end()
|
||||
@ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr)
|
||||
@ cdecl _vcomp_for_static_init_i8(int64 int64 int64 int64 ptr ptr ptr ptr ptr)
|
||||
@@ -97,7 +97,7 @@
|
||||
@ cdecl omp_get_num_procs()
|
||||
@ cdecl omp_get_num_threads()
|
||||
@ cdecl omp_get_thread_num()
|
||||
-@ stub omp_get_wtick
|
||||
+@ cdecl omp_get_wtick() vcomp.omp_get_wtick
|
||||
@ cdecl omp_get_wtime()
|
||||
@ cdecl omp_in_parallel()
|
||||
@ cdecl omp_init_lock(ptr)
|
||||
diff --git a/dlls/vcomp140/vcomp140.spec b/dlls/vcomp140/vcomp140.spec
|
||||
index e1cb8ab9931..d8b4d3e3f16 100644
|
||||
index d39aeb1f347..0475980a109 100644
|
||||
--- a/dlls/vcomp140/vcomp140.spec
|
||||
+++ b/dlls/vcomp140/vcomp140.spec
|
||||
@@ -57,9 +57,9 @@
|
||||
@@ -290,17 +227,8 @@ index e1cb8ab9931..d8b4d3e3f16 100644
|
||||
@ cdecl _vcomp_for_static_end()
|
||||
@ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr)
|
||||
@ cdecl _vcomp_for_static_init_i8(int64 int64 int64 int64 ptr ptr ptr ptr ptr)
|
||||
@@ -97,7 +97,7 @@
|
||||
@ cdecl omp_get_num_procs()
|
||||
@ cdecl omp_get_num_threads()
|
||||
@ cdecl omp_get_thread_num()
|
||||
-@ stub omp_get_wtick
|
||||
+@ cdecl omp_get_wtick() vcomp.omp_get_wtick
|
||||
@ cdecl omp_get_wtime()
|
||||
@ cdecl omp_in_parallel()
|
||||
@ cdecl omp_init_lock(ptr)
|
||||
diff --git a/dlls/vcomp90/vcomp90.spec b/dlls/vcomp90/vcomp90.spec
|
||||
index 9fac400ea0e..563f5391ed9 100644
|
||||
index a751e0b3da4..563f5391ed9 100644
|
||||
--- a/dlls/vcomp90/vcomp90.spec
|
||||
+++ b/dlls/vcomp90/vcomp90.spec
|
||||
@@ -56,9 +56,9 @@
|
||||
@@ -315,15 +243,6 @@ index 9fac400ea0e..563f5391ed9 100644
|
||||
@ cdecl _vcomp_for_static_end() vcomp._vcomp_for_static_end
|
||||
@ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) vcomp._vcomp_for_static_init
|
||||
@ cdecl _vcomp_for_static_init_i8(int64 int64 int64 int64 ptr ptr ptr ptr ptr) vcomp._vcomp_for_static_init_i8
|
||||
@@ -96,7 +96,7 @@
|
||||
@ cdecl omp_get_num_procs() vcomp.omp_get_num_procs
|
||||
@ cdecl omp_get_num_threads() vcomp.omp_get_num_threads
|
||||
@ cdecl omp_get_thread_num() vcomp.omp_get_thread_num
|
||||
-@ stub omp_get_wtick
|
||||
+@ cdecl omp_get_wtick() vcomp.omp_get_wtick
|
||||
@ cdecl omp_get_wtime() vcomp.omp_get_wtime
|
||||
@ cdecl omp_in_parallel() vcomp.omp_in_parallel
|
||||
@ cdecl omp_init_lock(ptr) vcomp.omp_init_lock
|
||||
--
|
||||
2.43.0
|
||||
2.51.0
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,120 @@
|
||||
From a10459890d798d4bab8c35d6d055327d5a0d74db Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Fri, 28 Nov 2025 08:54:08 +1100
|
||||
Subject: [PATCH] Updated vkd3d to fdfb74b20b08144e144299bc0b7b20b95421c6c8.
|
||||
|
||||
---
|
||||
libs/vkd3d/libs/vkd3d-shader/ir.c | 60 +++++++++++++++++++
|
||||
.../libs/vkd3d-shader/vkd3d_shader_private.h | 18 ++++++
|
||||
2 files changed, 78 insertions(+)
|
||||
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/ir.c b/libs/vkd3d/libs/vkd3d-shader/ir.c
|
||||
index 1a0c9d83306..3548e748c18 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/ir.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/ir.c
|
||||
@@ -1323,6 +1323,62 @@ static enum vkd3d_result vsir_program_lower_ifc(struct vsir_program *program,
|
||||
return VKD3D_OK;
|
||||
}
|
||||
|
||||
+static enum vkd3d_result vsir_program_lower_nrm(struct vsir_program *program, struct vsir_program_iterator *nrm)
|
||||
+{
|
||||
+ struct vkd3d_shader_instruction *ins = vsir_program_iterator_current(nrm);
|
||||
+ const struct vkd3d_shader_location location = ins->location;
|
||||
+ const struct vkd3d_shader_src_param *src = ins->src;
|
||||
+ const struct vkd3d_shader_dst_param *dst = ins->dst;
|
||||
+ unsigned int dot_id, rsq_id, mul_id;
|
||||
+ struct vsir_program_iterator it;
|
||||
+
|
||||
+ /* nrm DST, SRC
|
||||
+ * ->
|
||||
+ * dp3 srDOT, SRC, SRC
|
||||
+ * rsq srRSQ, srDOT
|
||||
+ * mul srMUL, srRSQ, SRC
|
||||
+ * movc DST, srDOT, srMUL, srDOT */
|
||||
+
|
||||
+ if (!(ins = vsir_program_iterator_insert_before(nrm, &it, 3)))
|
||||
+ return VKD3D_ERROR_OUT_OF_MEMORY;
|
||||
+ if (!vsir_instruction_init_with_params(program, ins, &location, VSIR_OP_DP3, 1, 2))
|
||||
+ goto fail;
|
||||
+ dot_id = program->ssa_count++;
|
||||
+ dst_param_init_ssa(&ins->dst[0], dot_id, src[0].reg.data_type, VSIR_DIMENSION_SCALAR);
|
||||
+ ins->src[0] = src[0];
|
||||
+ ins->src[1] = src[0];
|
||||
+
|
||||
+ ins = vsir_program_iterator_next(&it);
|
||||
+ if (!vsir_instruction_init_with_params(program, ins, &location, VSIR_OP_RSQ, 1, 1))
|
||||
+ goto fail;
|
||||
+ rsq_id = program->ssa_count++;
|
||||
+ dst_param_init_ssa(&ins->dst[0], rsq_id, src[0].reg.data_type, VSIR_DIMENSION_SCALAR);
|
||||
+ src_param_init_ssa(&ins->src[0], dot_id, src[0].reg.data_type, VSIR_DIMENSION_SCALAR);
|
||||
+
|
||||
+ ins = vsir_program_iterator_next(&it);
|
||||
+ if (!vsir_instruction_init_with_params(program, ins, &location, VSIR_OP_MUL, 1, 2))
|
||||
+ goto fail;
|
||||
+ mul_id = program->ssa_count++;
|
||||
+ dst_param_init_ssa(&ins->dst[0], mul_id, src[0].reg.data_type, dst[0].reg.dimension);
|
||||
+ src_param_init_ssa(&ins->src[0], rsq_id, src[0].reg.data_type, VSIR_DIMENSION_SCALAR);
|
||||
+ ins->src[1] = src[0];
|
||||
+
|
||||
+ ins = vsir_program_iterator_next(&it);
|
||||
+ if (!vsir_instruction_init_with_params(program, ins, &location, VSIR_OP_MOVC, 1, 3))
|
||||
+ goto fail;
|
||||
+ ins->dst[0] = dst[0];
|
||||
+ src_param_init_ssa(&ins->src[0], dot_id, VSIR_DATA_U32, VSIR_DIMENSION_SCALAR);
|
||||
+ src_param_init_ssa(&ins->src[1], mul_id, src[0].reg.data_type, dst[0].reg.dimension);
|
||||
+ src_param_init_ssa(&ins->src[2], dot_id, src[0].reg.data_type, VSIR_DIMENSION_SCALAR);
|
||||
+
|
||||
+ return VKD3D_OK;
|
||||
+
|
||||
+fail:
|
||||
+ vsir_program_iterator_nop_range(&it, nrm, &location);
|
||||
+
|
||||
+ return VKD3D_ERROR_OUT_OF_MEMORY;
|
||||
+}
|
||||
+
|
||||
static enum vkd3d_result vsir_program_lower_texkill(struct vsir_program *program,
|
||||
struct vsir_program_iterator *it, unsigned int *tmp_idx)
|
||||
{
|
||||
@@ -2364,6 +2420,10 @@ static enum vkd3d_result vsir_program_lower_d3dbc_instructions(struct vsir_progr
|
||||
ret = vsir_program_lower_ifc(program, &it, &tmp_idx, message_context);
|
||||
break;
|
||||
|
||||
+ case VSIR_OP_NRM:
|
||||
+ ret = vsir_program_lower_nrm(program, &it);
|
||||
+ break;
|
||||
+
|
||||
case VSIR_OP_SINCOS:
|
||||
ret = vsir_program_lower_sm1_sincos(program, &it);
|
||||
break;
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
|
||||
index 46f62a9e55c..33004dc62d9 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
|
||||
@@ -1572,6 +1572,24 @@ static inline struct vkd3d_shader_instruction *vsir_program_iterator_insert_befo
|
||||
return vsir_program_iterator_current(it);
|
||||
}
|
||||
|
||||
+static inline void vsir_program_iterator_nop_range(const struct vsir_program_iterator *first,
|
||||
+ const struct vsir_program_iterator *last, const struct vkd3d_shader_location *location)
|
||||
+{
|
||||
+ const struct vkd3d_shader_instruction_array *array = first->array;
|
||||
+ size_t first_idx = first->idx;
|
||||
+ size_t last_idx = last->idx;
|
||||
+ size_t idx;
|
||||
+
|
||||
+ VKD3D_ASSERT(last->array == array);
|
||||
+ VKD3D_ASSERT(last_idx < array->count);
|
||||
+ VKD3D_ASSERT(first_idx <= last_idx);
|
||||
+
|
||||
+ for (idx = first_idx; idx <= last_idx; ++idx)
|
||||
+ {
|
||||
+ vsir_instruction_init(&array->elements[idx], location, VSIR_OP_NOP);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
enum vkd3d_shader_config_flags
|
||||
{
|
||||
VKD3D_SHADER_CONFIG_FLAG_FORCE_VALIDATION = 0x00000001,
|
||||
--
|
||||
2.51.0
|
||||
|
||||
@@ -1,338 +0,0 @@
|
||||
From 1c19b515adc2181cff5be945b742fbd357330bbe Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Fri, 14 Nov 2025 08:07:32 +1100
|
||||
Subject: [PATCH] Updated vkd3d to 7f377879fc526dfb69966ed1672d3036e807235c.
|
||||
|
||||
---
|
||||
libs/vkd3d/include/private/vkd3d_common.h | 20 +++++++-----
|
||||
libs/vkd3d/libs/vkd3d-common/debug.c | 9 +++---
|
||||
libs/vkd3d/libs/vkd3d-shader/d3d_asm.c | 31 ++++++++++++++++++-
|
||||
libs/vkd3d/libs/vkd3d-shader/dxil.c | 13 +++++---
|
||||
libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c | 8 +++--
|
||||
libs/vkd3d/libs/vkd3d-shader/spirv.c | 13 +++++---
|
||||
.../libs/vkd3d-shader/vkd3d_shader_main.c | 4 +--
|
||||
.../libs/vkd3d-shader/vkd3d_shader_private.h | 1 +
|
||||
.../vkd3d/libs/vkd3d-utils/vkd3d_utils_main.c | 2 --
|
||||
libs/vkd3d/libs/vkd3d/vkd3d_main.c | 2 --
|
||||
10 files changed, 71 insertions(+), 32 deletions(-)
|
||||
|
||||
diff --git a/libs/vkd3d/include/private/vkd3d_common.h b/libs/vkd3d/include/private/vkd3d_common.h
|
||||
index c2e957a2fea..56f8ad4ee25 100644
|
||||
--- a/libs/vkd3d/include/private/vkd3d_common.h
|
||||
+++ b/libs/vkd3d/include/private/vkd3d_common.h
|
||||
@@ -19,6 +19,11 @@
|
||||
#ifndef __VKD3D_COMMON_H
|
||||
#define __VKD3D_COMMON_H
|
||||
|
||||
+#ifndef VKD3D_DEBUG_ENV
|
||||
+#define VKD3D_DEBUG_ENV VKD3D_DEBUG
|
||||
+#endif
|
||||
+#define VKD3D_DEBUG_ENV_NAME VKD3D_EXPAND_AND_STRINGIFY(VKD3D_DEBUG_ENV)
|
||||
+
|
||||
#include "config.h"
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include "windows.h"
|
||||
@@ -149,9 +154,10 @@ enum vkd3d_dbg_level
|
||||
VKD3D_DBG_LEVEL_TRACE,
|
||||
};
|
||||
|
||||
-enum vkd3d_dbg_level vkd3d_dbg_get_level(void);
|
||||
+enum vkd3d_dbg_level vkd3d_dbg_get_level(const char *vkd3d_dbg_env_name);
|
||||
|
||||
-void vkd3d_dbg_printf(enum vkd3d_dbg_level level, const char *function, const char *fmt, ...) VKD3D_PRINTF_FUNC(3, 4);
|
||||
+void vkd3d_dbg_printf(const char *vkd3d_dbg_env_name, enum vkd3d_dbg_level level,
|
||||
+ const char *function, const char *fmt, ...) VKD3D_PRINTF_FUNC(4, 5);
|
||||
void vkd3d_dbg_set_log_callback(PFN_vkd3d_log callback);
|
||||
|
||||
const char *vkd3d_dbg_sprintf(const char *fmt, ...) VKD3D_PRINTF_FUNC(1, 2);
|
||||
@@ -174,7 +180,7 @@ const char *debugstr_w(const WCHAR *wstr, size_t wchar_size);
|
||||
VKD3D_DBG_PRINTF_##level
|
||||
|
||||
#define VKD3D_DBG_PRINTF(...) \
|
||||
- vkd3d_dbg_printf(vkd3d_dbg_level, __FUNCTION__, __VA_ARGS__); } while (0)
|
||||
+ vkd3d_dbg_printf(VKD3D_DEBUG_ENV_NAME, vkd3d_dbg_level, __FUNCTION__, __VA_ARGS__); } while (0)
|
||||
|
||||
#define VKD3D_DBG_PRINTF_TRACE(...) VKD3D_DBG_PRINTF(__VA_ARGS__)
|
||||
#define VKD3D_DBG_PRINTF_WARN(...) VKD3D_DBG_PRINTF(__VA_ARGS__)
|
||||
@@ -183,7 +189,7 @@ const char *debugstr_w(const WCHAR *wstr, size_t wchar_size);
|
||||
|
||||
#ifdef VKD3D_ABORT_ON_ERR
|
||||
#define VKD3D_DBG_PRINTF_ERR(...) \
|
||||
- vkd3d_dbg_printf(vkd3d_dbg_level, __FUNCTION__, __VA_ARGS__); \
|
||||
+ vkd3d_dbg_printf(VKD3D_DEBUG_ENV_NAME, vkd3d_dbg_level, __FUNCTION__, __VA_ARGS__); \
|
||||
abort(); \
|
||||
} while (0)
|
||||
#else
|
||||
@@ -217,19 +223,17 @@ const char *debugstr_w(const WCHAR *wstr, size_t wchar_size);
|
||||
#endif
|
||||
|
||||
#ifndef TRACE_ON
|
||||
-#define TRACE_ON() (vkd3d_dbg_get_level() == VKD3D_DBG_LEVEL_TRACE)
|
||||
+#define TRACE_ON() (vkd3d_dbg_get_level(VKD3D_DEBUG_ENV_NAME) == VKD3D_DBG_LEVEL_TRACE)
|
||||
#endif
|
||||
|
||||
#ifndef WARN_ON
|
||||
-#define WARN_ON() (vkd3d_dbg_get_level() >= VKD3D_DBG_LEVEL_WARN)
|
||||
+#define WARN_ON() (vkd3d_dbg_get_level(VKD3D_DEBUG_ENV_NAME) >= VKD3D_DBG_LEVEL_WARN)
|
||||
#endif
|
||||
|
||||
#ifndef FIXME_ONCE
|
||||
#define FIXME_ONCE VKD3D_DBG_LOG_ONCE(FIXME, WARN)
|
||||
#endif
|
||||
|
||||
-#define VKD3D_DEBUG_ENV_NAME(name) const char *const vkd3d_dbg_env_name = name
|
||||
-
|
||||
static inline const char *debugstr_guid(const GUID *guid)
|
||||
{
|
||||
if (!guid)
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-common/debug.c b/libs/vkd3d/libs/vkd3d-common/debug.c
|
||||
index 32862024b90..b5d74ca3dc7 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-common/debug.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-common/debug.c
|
||||
@@ -40,8 +40,6 @@
|
||||
#define VKD3D_DEBUG_BUFFER_COUNT 64
|
||||
#define VKD3D_DEBUG_BUFFER_SIZE 512
|
||||
|
||||
-extern const char *const vkd3d_dbg_env_name;
|
||||
-
|
||||
static const char *const debug_level_names[] =
|
||||
{
|
||||
[VKD3D_DBG_LEVEL_NONE ] = "none",
|
||||
@@ -52,7 +50,7 @@ static const char *const debug_level_names[] =
|
||||
[VKD3D_DBG_LEVEL_TRACE] = "trace",
|
||||
};
|
||||
|
||||
-enum vkd3d_dbg_level vkd3d_dbg_get_level(void)
|
||||
+enum vkd3d_dbg_level vkd3d_dbg_get_level(const char *vkd3d_dbg_env_name)
|
||||
{
|
||||
static unsigned int level = ~0u;
|
||||
const char *vkd3d_debug;
|
||||
@@ -108,11 +106,12 @@ static uint64_t get_pthread_threadid(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
-void vkd3d_dbg_printf(enum vkd3d_dbg_level level, const char *function, const char *fmt, ...)
|
||||
+void vkd3d_dbg_printf(const char *vkd3d_dbg_env_name,
|
||||
+ enum vkd3d_dbg_level level, const char *function, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
- if (vkd3d_dbg_get_level() < level)
|
||||
+ if (vkd3d_dbg_get_level(vkd3d_dbg_env_name) < level)
|
||||
return;
|
||||
|
||||
#ifdef _WIN32
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/d3d_asm.c b/libs/vkd3d/libs/vkd3d-shader/d3d_asm.c
|
||||
index 4573cb67fb5..b316f6c8830 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/d3d_asm.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/d3d_asm.c
|
||||
@@ -398,12 +398,41 @@ static void shader_dump_resource_data_type(struct vkd3d_d3d_asm_compiler *compil
|
||||
{
|
||||
int i;
|
||||
|
||||
+ /* We want the D3D names here, not the vsir ones. */
|
||||
+ static const char * const names[] =
|
||||
+ {
|
||||
+ [VSIR_DATA_BOOL ] = "bool",
|
||||
+ [VSIR_DATA_F16 ] = "half",
|
||||
+ [VSIR_DATA_F32 ] = "float",
|
||||
+ [VSIR_DATA_F64 ] = "double",
|
||||
+ [VSIR_DATA_I8 ] = "int8",
|
||||
+ [VSIR_DATA_I16 ] = "int16",
|
||||
+ [VSIR_DATA_I32 ] = "int",
|
||||
+ [VSIR_DATA_I64 ] = "int64",
|
||||
+ [VSIR_DATA_U8 ] = "uint8",
|
||||
+ [VSIR_DATA_U16 ] = "uint16",
|
||||
+ [VSIR_DATA_U32 ] = "uint",
|
||||
+ [VSIR_DATA_U64 ] = "uint64",
|
||||
+ [VSIR_DATA_SNORM ] = "snorm",
|
||||
+ [VSIR_DATA_UNORM ] = "unorm",
|
||||
+ [VSIR_DATA_OPAQUE ] = "opaque",
|
||||
+ [VSIR_DATA_MIXED ] = "mixed",
|
||||
+ [VSIR_DATA_CONTINUED] = "<continued>",
|
||||
+ [VSIR_DATA_UNUSED ] = "<unused>",
|
||||
+ };
|
||||
+
|
||||
vkd3d_string_buffer_printf(&compiler->buffer, "(");
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
+ size_t t = type[i];
|
||||
+
|
||||
vkd3d_string_buffer_printf(&compiler->buffer, "%s", i == 0 ? "" : ",");
|
||||
- shader_print_data_type(compiler, type[i]);
|
||||
+ if (t < ARRAY_SIZE(names) && names[t])
|
||||
+ vkd3d_string_buffer_printf(&compiler->buffer, "%s", names[t]);
|
||||
+ else
|
||||
+ vkd3d_string_buffer_printf(&compiler->buffer, "%s<unhandled data type %#zx>%s",
|
||||
+ compiler->colours.error, t, compiler->colours.reset);
|
||||
}
|
||||
|
||||
vkd3d_string_buffer_printf(&compiler->buffer, ")");
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/dxil.c b/libs/vkd3d/libs/vkd3d-shader/dxil.c
|
||||
index 8d803b91f7a..9f25ae8334b 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/dxil.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/dxil.c
|
||||
@@ -6142,11 +6142,14 @@ static unsigned int sm6_value_get_texel_offset(const struct sm6_value *value, st
|
||||
}
|
||||
|
||||
static void instruction_set_texel_offset(struct vkd3d_shader_instruction *ins,
|
||||
- const struct sm6_value **operands, struct sm6_parser *sm6)
|
||||
+ const struct sm6_value **operands, unsigned int count, struct sm6_parser *sm6)
|
||||
{
|
||||
ins->texel_offset.u = sm6_value_get_texel_offset(operands[0], sm6);
|
||||
ins->texel_offset.v = sm6_value_get_texel_offset(operands[1], sm6);
|
||||
- ins->texel_offset.w = sm6_value_get_texel_offset(operands[2], sm6);
|
||||
+ if (count == 3)
|
||||
+ ins->texel_offset.w = sm6_value_get_texel_offset(operands[2], sm6);
|
||||
+ else
|
||||
+ ins->texel_offset.w = 0;
|
||||
}
|
||||
|
||||
static void sm6_parser_emit_dx_sample(struct sm6_parser *sm6, enum dx_intrinsic_opcode op,
|
||||
@@ -6228,7 +6231,7 @@ static void sm6_parser_emit_dx_sample(struct sm6_parser *sm6, enum dx_intrinsic_
|
||||
src_param_init_vector_from_reg(&src_params[0], &coord);
|
||||
src_param_init_vector_from_handle(sm6, &src_params[1], &resource->u.handle);
|
||||
src_param_init_vector_from_handle(sm6, &src_params[2], &sampler->u.handle);
|
||||
- instruction_set_texel_offset(ins, &operands[6], sm6);
|
||||
+ instruction_set_texel_offset(ins, &operands[6], 3, sm6);
|
||||
|
||||
instruction_dst_param_init_ssa_vector(ins, component_count, sm6);
|
||||
}
|
||||
@@ -6402,7 +6405,7 @@ static void sm6_parser_emit_dx_texture_gather(struct sm6_parser *sm6, enum dx_in
|
||||
if (extended_offset)
|
||||
src_param_init_vector_from_reg(&src_params[1], &offset);
|
||||
else
|
||||
- instruction_set_texel_offset(ins, &operands[6], sm6);
|
||||
+ instruction_set_texel_offset(ins, &operands[6], 2, sm6);
|
||||
src_param_init_vector_from_handle(sm6, &src_params[1 + extended_offset], &resource->u.handle);
|
||||
src_param_init_vector_from_handle(sm6, &src_params[2 + extended_offset], &sampler->u.handle);
|
||||
/* Swizzle stored in the sampler parameter is the scalar component index to be gathered. */
|
||||
@@ -6448,7 +6451,7 @@ static void sm6_parser_emit_dx_texture_load(struct sm6_parser *sm6, enum dx_intr
|
||||
ins = state->ins;
|
||||
instruction_init_with_resource(ins, is_uav ? VSIR_OP_LD_UAV_TYPED
|
||||
: is_multisample ? VSIR_OP_LD2DMS : VSIR_OP_LD, resource, sm6);
|
||||
- instruction_set_texel_offset(ins, &operands[5], sm6);
|
||||
+ instruction_set_texel_offset(ins, &operands[5], 3, sm6);
|
||||
|
||||
for (i = 0; i < VKD3D_VEC4_SIZE; ++i)
|
||||
ins->resource_data_type[i] = resource->u.handle.d->resource_data_type;
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c
|
||||
index 8bb23e0690d..f1368b151aa 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c
|
||||
@@ -5490,10 +5490,14 @@ static struct hlsl_ir_node *lower_casts_to_bool(struct hlsl_ctx *ctx,
|
||||
struct hlsl_ir_node *hlsl_add_conditional(struct hlsl_ctx *ctx, struct hlsl_block *instrs,
|
||||
struct hlsl_ir_node *condition, struct hlsl_ir_node *if_true, struct hlsl_ir_node *if_false)
|
||||
{
|
||||
+ struct hlsl_type *false_type = if_false->data_type;
|
||||
struct hlsl_type *cond_type = condition->data_type;
|
||||
struct hlsl_ir_node *operands[HLSL_MAX_OPERANDS];
|
||||
+ struct hlsl_type *true_type = if_true->data_type;
|
||||
|
||||
- VKD3D_ASSERT(hlsl_types_are_equal(if_true->data_type, if_false->data_type));
|
||||
+ VKD3D_ASSERT(hlsl_types_are_equal(true_type, false_type)
|
||||
+ || (hlsl_is_vec1(true_type) && hlsl_is_vec1(false_type)
|
||||
+ && true_type->e.numeric.type == false_type->e.numeric.type));
|
||||
|
||||
if (cond_type->e.numeric.type != HLSL_TYPE_BOOL)
|
||||
{
|
||||
@@ -5505,7 +5509,7 @@ struct hlsl_ir_node *hlsl_add_conditional(struct hlsl_ctx *ctx, struct hlsl_bloc
|
||||
operands[0] = condition;
|
||||
operands[1] = if_true;
|
||||
operands[2] = if_false;
|
||||
- return hlsl_block_add_expr(ctx, instrs, HLSL_OP3_TERNARY, operands, if_true->data_type, &condition->loc);
|
||||
+ return hlsl_block_add_expr(ctx, instrs, HLSL_OP3_TERNARY, operands, true_type, &condition->loc);
|
||||
}
|
||||
|
||||
static struct hlsl_ir_node *lower_int_division_sm4(struct hlsl_ctx *ctx,
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/spirv.c b/libs/vkd3d/libs/vkd3d-shader/spirv.c
|
||||
index 3950021a2ef..87ec827b420 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/spirv.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/spirv.c
|
||||
@@ -6668,13 +6668,18 @@ static void spirv_compiler_emit_cbv_declaration(struct spirv_compiler *compiler,
|
||||
/* Push constant buffers are handled in
|
||||
* spirv_compiler_emit_push_constant_buffers().
|
||||
*/
|
||||
- push_cb->reg = reg;
|
||||
- push_cb->size = size;
|
||||
if (size_in_bytes > push_cb->pc.size)
|
||||
{
|
||||
- WARN("Constant buffer size %u exceeds push constant size %u.\n",
|
||||
- size_in_bytes, push_cb->pc.size);
|
||||
+ spirv_compiler_warning(compiler, VKD3D_SHADER_WARNING_SPV_INVALID_SIZE,
|
||||
+ "Constant buffer cb%u, space %u, has size %u which exceeds the push constant size %u.",
|
||||
+ push_cb->pc.register_index, push_cb->pc.register_space, size_in_bytes, push_cb->pc.size);
|
||||
+ size_in_bytes = push_cb->pc.size;
|
||||
+ size = align(size_in_bytes, VKD3D_VEC4_SIZE * sizeof(uint32_t));
|
||||
+ size /= VKD3D_VEC4_SIZE * sizeof(uint32_t);
|
||||
}
|
||||
+
|
||||
+ push_cb->reg = reg;
|
||||
+ push_cb->size = size;
|
||||
return;
|
||||
}
|
||||
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c
|
||||
index c0faa30f14a..ee113f57736 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c
|
||||
@@ -23,8 +23,6 @@
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
-/* VKD3D_DEBUG_ENV_NAME("VKD3D_SHADER_DEBUG"); */
|
||||
-
|
||||
static inline int char_to_int(char c)
|
||||
{
|
||||
if ('0' <= c && c <= '9')
|
||||
@@ -268,7 +266,7 @@ void vkd3d_shader_trace_text_(const char *text, size_t size, const char *functio
|
||||
q = end;
|
||||
else
|
||||
++q;
|
||||
- vkd3d_dbg_printf(VKD3D_DBG_LEVEL_TRACE, function, "%.*s", (int)(q - p), p);
|
||||
+ vkd3d_dbg_printf(VKD3D_DEBUG_ENV_NAME, VKD3D_DBG_LEVEL_TRACE, function, "%.*s", (int)(q - p), p);
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
|
||||
index 763a4906919..97fe5238046 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
|
||||
@@ -110,6 +110,7 @@ enum vkd3d_shader_error
|
||||
VKD3D_SHADER_WARNING_SPV_INVALID_SWIZZLE = 2300,
|
||||
VKD3D_SHADER_WARNING_SPV_INVALID_UAV_FLAGS = 2301,
|
||||
VKD3D_SHADER_WARNING_SPV_IGNORING_FLAG = 2302,
|
||||
+ VKD3D_SHADER_WARNING_SPV_INVALID_SIZE = 2303,
|
||||
|
||||
VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY = 3000,
|
||||
VKD3D_SHADER_ERROR_RS_INVALID_VERSION = 3001,
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-utils/vkd3d_utils_main.c b/libs/vkd3d/libs/vkd3d-utils/vkd3d_utils_main.c
|
||||
index fea8c2440d1..6e90b48e877 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-utils/vkd3d_utils_main.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-utils/vkd3d_utils_main.c
|
||||
@@ -19,8 +19,6 @@
|
||||
#include "vkd3d_utils_private.h"
|
||||
#undef D3D12CreateDevice
|
||||
|
||||
-/* VKD3D_DEBUG_ENV_NAME("VKD3D_DEBUG"); */
|
||||
-
|
||||
static const char *debug_d3d_blob_part(D3D_BLOB_PART part)
|
||||
{
|
||||
switch (part)
|
||||
diff --git a/libs/vkd3d/libs/vkd3d/vkd3d_main.c b/libs/vkd3d/libs/vkd3d/vkd3d_main.c
|
||||
index 5215cf8ef86..4c58f0a1787 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d/vkd3d_main.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d/vkd3d_main.c
|
||||
@@ -18,8 +18,6 @@
|
||||
|
||||
#include "vkd3d_private.h"
|
||||
|
||||
-VKD3D_DEBUG_ENV_NAME("VKD3D_DEBUG");
|
||||
-
|
||||
HRESULT vkd3d_create_device(const struct vkd3d_device_create_info *create_info,
|
||||
REFIID iid, void **device)
|
||||
{
|
||||
--
|
||||
2.51.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user