Rebase against 8cbbb4f394678411fdb57237553f5d974527877f.

This commit is contained in:
Zebediah Figura 2020-08-06 18:17:01 -05:00
parent 3b24c1cf1d
commit 7c1249e5c0
8 changed files with 2 additions and 2194 deletions

View File

@ -1,256 +0,0 @@
From b0eec9e5d8736bfa86096fd2d69cfb73dba7a5fe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Fri, 1 Apr 2016 01:29:51 +0200
Subject: [PATCH] fsutil: Add fsutil program with support for creating hard
links.
---
programs/fsutil/Makefile.in | 3 +
programs/fsutil/fsutil.rc | 34 ++++++++++
programs/fsutil/main.c | 130 ++++++++++++++++++++++++++++++++++--
programs/fsutil/resources.h | 25 +++++++
4 files changed, 186 insertions(+), 6 deletions(-)
create mode 100644 programs/fsutil/fsutil.rc
create mode 100644 programs/fsutil/resources.h
diff --git a/programs/fsutil/Makefile.in b/programs/fsutil/Makefile.in
index 64307e83aca..e10bd433baa 100644
--- a/programs/fsutil/Makefile.in
+++ b/programs/fsutil/Makefile.in
@@ -1,6 +1,9 @@
MODULE = fsutil.exe
EXTRADLLFLAGS = -mconsole -municode -mno-cygwin
+IMPORTS = user32
C_SRCS = \
main.c
+
+RC_SRCS = fsutil.rc
diff --git a/programs/fsutil/fsutil.rc b/programs/fsutil/fsutil.rc
new file mode 100644
index 00000000000..593f8175a23
--- /dev/null
+++ b/programs/fsutil/fsutil.rc
@@ -0,0 +1,34 @@
+/*
+ * FSUTIL.EXE - Wine-compatible fsutil program
+ *
+ * Copyright 2016 Michael Müller
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "resources.h"
+
+#pragma makedep po
+
+LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
+
+STRINGTABLE
+{
+ STRING_USAGE, "---- Commands Supported ----\n\nhardlink Hardlink management\n\n"
+ STRING_UNSUPPORTED_CMD, "%1 is an unsupported command\n"
+ STRING_UNSUPPORTED_PARAM, "%1 is an unsupported parameter\n"
+ STRING_HARDLINK_USAGE, "---- Hardlink - Commands Supported ----\n\ncreate Create a hardlink.\n\n"
+ STRING_HARDLINK_CREATE_USAGE, "Syntax: fsutil hardlink create old new\n\n"
+}
diff --git a/programs/fsutil/main.c b/programs/fsutil/main.c
index eb4e3412976..ffef8aecbb1 100644
--- a/programs/fsutil/main.c
+++ b/programs/fsutil/main.c
@@ -1,5 +1,6 @@
/*
* Copyright 2016 Austin English
+ * Copyright 2016 Michael Müller
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -16,18 +17,135 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include "wine/debug.h"
+#include <windows.h>
+#include <wine/debug.h>
+
+#include "resources.h"
WINE_DEFAULT_DEBUG_CHANNEL(fsutil);
+static void output_write(const WCHAR *str, DWORD wlen)
+{
+ DWORD count, ret;
+
+ ret = WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), str, wlen, &count, NULL);
+ if (!ret)
+ {
+ DWORD len;
+ char *msgA;
+
+ /* On Windows WriteConsoleW() fails if the output is redirected. So fall
+ * back to WriteFile(), assuming the console encoding is still the right
+ * one in that case.
+ */
+ len = WideCharToMultiByte(GetConsoleOutputCP(), 0, str, wlen, NULL, 0, NULL, NULL);
+ msgA = HeapAlloc(GetProcessHeap(), 0, len * sizeof(char));
+ if (!msgA) return;
+
+ WideCharToMultiByte(GetConsoleOutputCP(), 0, str, wlen, msgA, len, NULL, NULL);
+ WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), msgA, len, &count, FALSE);
+ HeapFree(GetProcessHeap(), 0, msgA);
+ }
+}
+
+static int output_vprintf(const WCHAR* fmt, __ms_va_list va_args)
+{
+ WCHAR str[8192];
+ int len;
+
+ SetLastError(NO_ERROR);
+ len = FormatMessageW(FORMAT_MESSAGE_FROM_STRING, fmt, 0, 0, str,
+ sizeof(str)/sizeof(*str), &va_args);
+ if (len == 0 && GetLastError() != NO_ERROR)
+ WINE_FIXME("Could not format string: le=%u, fmt=%s\n", GetLastError(), wine_dbgstr_w(fmt));
+ else
+ output_write(str, len);
+ return 0;
+}
+
+static int WINAPIV output_string(int msg, ...)
+{
+ WCHAR fmt[8192];
+ __ms_va_list arguments;
+
+ LoadStringW(GetModuleHandleW(NULL), msg, fmt, sizeof(fmt)/sizeof(fmt[0]));
+ __ms_va_start(arguments, msg);
+ output_vprintf(fmt, arguments);
+ __ms_va_end(arguments);
+ return 0;
+}
+
+static BOOL output_error_string(DWORD error)
+{
+ LPWSTR pBuffer;
+ if (FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_ALLOCATE_BUFFER,
+ NULL, error, 0, (LPWSTR)&pBuffer, 0, NULL))
+ {
+ output_write(pBuffer, lstrlenW(pBuffer));
+ LocalFree(pBuffer);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static int create_hardlink(int argc, WCHAR *argv[])
+{
+ if (argc != 5)
+ {
+ output_string(STRING_HARDLINK_CREATE_USAGE);
+ return 1;
+ }
+
+ if (CreateHardLinkW(argv[3], argv[4], NULL))
+ return 0;
+
+ output_error_string(GetLastError());
+ return 1;
+}
+
+static int hardlink(int argc, WCHAR *argv[])
+{
+ static const WCHAR createW[]={'c','r','e','a','t','e',0};
+ int ret;
+
+ if (argc > 2)
+ {
+ if (!_wcsicmp(argv[2], createW))
+ return create_hardlink(argc, argv);
+ else
+ {
+ FIXME("unsupported parameter %s\n", debugstr_w(argv[2]));
+ output_string(STRING_UNSUPPORTED_PARAM, argv[2]);
+ ret = 1;
+ }
+ }
+
+ output_string(STRING_HARDLINK_USAGE);
+ return ret;
+}
+
int __cdecl wmain(int argc, WCHAR *argv[])
{
- int i;
+ static const WCHAR hardlinkW[]={'h','a','r','d','l','i','n','k',0};
+ int i, ret = 0;
- WINE_FIXME("stub:");
for (i = 0; i < argc; i++)
- WINE_FIXME(" %s", wine_dbgstr_w(argv[i]));
- WINE_FIXME("\n");
+ WINE_TRACE(" %s", wine_dbgstr_w(argv[i]));
+ WINE_TRACE("\n");
- return 0;
+ if (argc > 1)
+ {
+ if (!_wcsicmp(argv[1], hardlinkW))
+ return hardlink(argc, argv);
+ else
+ {
+ FIXME("unsupported command %s\n", debugstr_w(argv[1]));
+ output_string(STRING_UNSUPPORTED_CMD, argv[1]);
+ ret = 1;
+ }
+ }
+
+ output_string(STRING_USAGE);
+ return ret;
}
diff --git a/programs/fsutil/resources.h b/programs/fsutil/resources.h
new file mode 100644
index 00000000000..b85826ac421
--- /dev/null
+++ b/programs/fsutil/resources.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2016 Michael Müller
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <windef.h>
+
+#define STRING_USAGE 101
+#define STRING_UNSUPPORTED_CMD 102
+#define STRING_UNSUPPORTED_PARAM 103
+#define STRING_HARDLINK_USAGE 104
+#define STRING_HARDLINK_CREATE_USAGE 105
--
2.17.1

View File

@ -1 +0,0 @@
Fixes: [22749] Add stub for fsutil.exe hardlink command

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "f7895ef25a4cb2115ffbe04d28b87bcb6ee3c0b7"
echo "8cbbb4f394678411fdb57237553f5d974527877f"
}
# Show version information
@ -132,7 +132,6 @@ patch_enable_all ()
enable_dxdiagn_GetChildContainer_Leaf_Nodes="$1"
enable_explorer_Video_Registry_Key="$1"
enable_fonts_Missing_Fonts="$1"
enable_fsutil_Stub_Program="$1"
enable_gdi32_Lazy_Font_Initialization="$1"
enable_gdi32_rotation="$1"
enable_gdiplus_Performance_Improvements="$1"
@ -486,9 +485,6 @@ patch_enable ()
fonts-Missing_Fonts)
enable_fonts_Missing_Fonts="$2"
;;
fsutil-Stub_Program)
enable_fsutil_Stub_Program="$2"
;;
gdi32-Lazy_Font_Initialization)
enable_gdi32_Lazy_Font_Initialization="$2"
;;
@ -2862,21 +2858,6 @@ if test "$enable_fonts_Missing_Fonts" -eq 1; then
) >> "$patchlist"
fi
# Patchset fsutil-Stub_Program
# |
# | This patchset fixes the following Wine bugs:
# | * [#22749] Add stub for fsutil.exe hardlink command
# |
# | Modified files:
# | * programs/fsutil/Makefile.in, programs/fsutil/fsutil.rc, programs/fsutil/main.c, programs/fsutil/resources.h
# |
if test "$enable_fsutil_Stub_Program" -eq 1; then
patch_apply fsutil-Stub_Program/0001-fsutil-Add-fsutil-program-with-support-for-creating-.patch
(
printf '%s\n' '+ { "Michael Müller", "fsutil: Add fsutil program with support for creating hard links.", 1 },';
) >> "$patchlist"
fi
# Patchset gdi32-Lazy_Font_Initialization
# |
# | Modified files:

View File

@ -1,41 +0,0 @@
From c7189e9d48079b0f3993ed8de8f774f3e0a7a97e Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Tue, 7 Jan 2020 22:14:49 +1100
Subject: [PATCH] xaudio2_7: Support older XACT3Engine interfaces
---
dlls/xaudio2_7/xact_dll.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/dlls/xaudio2_7/xact_dll.c b/dlls/xaudio2_7/xact_dll.c
index 07f866606d..91e3ef0afd 100644
--- a/dlls/xaudio2_7/xact_dll.c
+++ b/dlls/xaudio2_7/xact_dll.c
@@ -39,6 +39,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(xact3);
static HINSTANCE instance;
+#if XACT3_VER >= 0x0301 && XACT3_VER <= 0x304
+DEFINE_GUID(IID_IXACT3Engine301, 0xe72c1b9a, 0xd717, 0x41c0, 0x81, 0xa6, 0x50, 0xeb, 0x56, 0xe8, 0x06, 0x49);
+#endif
+
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, void *pReserved)
{
TRACE("(%p, %d, %p)\n", hinstDLL, reason, pReserved);
@@ -852,7 +856,12 @@ static HRESULT WINAPI IXACT3EngineImpl_QueryInterface(IXACT3Engine *iface,
TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppvObject);
if(IsEqualGUID(riid, &IID_IUnknown) ||
- IsEqualGUID(riid, &IID_IXACT3Engine)){
+#if XACT3_VER >= 0x0301 && XACT3_VER <= 0x304
+ IsEqualGUID(riid, &IID_IXACT3Engine301)
+#else
+ IsEqualGUID(riid, &IID_IXACT3Engine)
+#endif
+ ){
*ppvObject = &This->IXACT3Engine_iface;
}
else
--
2.25.1

View File

@ -1,93 +0,0 @@
From 2335980b1a1e36ce475a99b08498747021b5284c Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 8 Jan 2020 10:39:02 +1100
Subject: [PATCH] xaudio2_7: IXACT3Engine CreateSoundBank return correct
HRESULT values.
---
dlls/xaudio2_7/xact_dll.c | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/dlls/xaudio2_7/xact_dll.c b/dlls/xaudio2_7/xact_dll.c
index 1f580519d4..9cec216002 100644
--- a/dlls/xaudio2_7/xact_dll.c
+++ b/dlls/xaudio2_7/xact_dll.c
@@ -1005,21 +1005,23 @@ static HRESULT WINAPI IXACT3EngineImpl_CreateSoundBank(IXACT3Engine *iface,
XACT3EngineImpl *This = impl_from_IXACT3Engine(iface);
XACT3SoundBankImpl *sb;
FACTSoundBank *fsb;
- HRESULT hr;
+ UINT ret;
TRACE("(%p)->(%p, %u, 0x%x, 0x%x, %p)\n", This, pvBuffer, dwSize, dwFlags,
dwAllocAttributes, ppSoundBank);
- hr = FACTAudioEngine_CreateSoundBank(This->fact_engine, pvBuffer, dwSize,
+ ret = FACTAudioEngine_CreateSoundBank(This->fact_engine, pvBuffer, dwSize,
dwFlags, dwAllocAttributes, &fsb);
- if(FAILED(hr))
- return hr;
+ if (ret != 0) {
+ ERR("Failed to CreateSoundBank: %d\n", ret);
+ return E_FAIL;
+ }
sb = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*sb));
if (!sb){
FACTSoundBank_Destroy(fsb);
ERR("Failed to allocate XACT3SoundBankImpl!");
- return hr;
+ return E_OUTOFMEMORY;
}
sb->IXACT3SoundBank_iface.lpVtbl = &XACT3SoundBank_Vtbl;
@@ -1028,7 +1030,7 @@ static HRESULT WINAPI IXACT3EngineImpl_CreateSoundBank(IXACT3Engine *iface,
TRACE("Created SoundBank: %p\n", sb);
- return hr;
+ return S_OK;
}
static HRESULT WINAPI IXACT3EngineImpl_CreateInMemoryWaveBank(IXACT3Engine *iface,
@@ -1038,21 +1040,23 @@ static HRESULT WINAPI IXACT3EngineImpl_CreateInMemoryWaveBank(IXACT3Engine *ifac
XACT3EngineImpl *This = impl_from_IXACT3Engine(iface);
XACT3WaveBankImpl *wb;
FACTWaveBank *fwb;
- HRESULT hr;
+ UINT ret;
TRACE("(%p)->(%p, %u, 0x%x, 0x%x, %p)\n", This, pvBuffer, dwSize, dwFlags,
dwAllocAttributes, ppWaveBank);
- hr = FACTAudioEngine_CreateInMemoryWaveBank(This->fact_engine, pvBuffer,
+ ret = FACTAudioEngine_CreateInMemoryWaveBank(This->fact_engine, pvBuffer,
dwSize, dwFlags, dwAllocAttributes, &fwb);
- if(FAILED(hr))
- return hr;
+ if (ret != 0) {
+ ERR("Failed to CreateInMemoryWaveBank: %d\n", ret);
+ return E_FAIL;
+ }
wb = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*wb));
if (!wb){
FACTWaveBank_Destroy(fwb);
ERR("Failed to allocate XACT3WaveBankImpl!");
- return hr;
+ return E_OUTOFMEMORY;
}
wb->IXACT3WaveBank_iface.lpVtbl = &XACT3WaveBank_Vtbl;
@@ -1061,7 +1065,7 @@ static HRESULT WINAPI IXACT3EngineImpl_CreateInMemoryWaveBank(IXACT3Engine *ifac
TRACE("Created in-memory WaveBank: %p\n", wb);
- return hr;
+ return S_OK;
}
static HRESULT WINAPI IXACT3EngineImpl_CreateStreamingWaveBank(IXACT3Engine *iface,
--
2.25.1

View File

@ -1,106 +0,0 @@
From 25c1fa51fd49839fe0858493537c1c3c7cdfea30 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Thu, 9 Jan 2020 09:06:01 +1100
Subject: [PATCH] xaudio2_7: unwrap structure based of it's type.
---
dlls/xaudio2_7/xact_dll.c | 54 ++++++++++++++++++++++++++++++++++-----
1 file changed, 47 insertions(+), 7 deletions(-)
diff --git a/dlls/xaudio2_7/xact_dll.c b/dlls/xaudio2_7/xact_dll.c
index b089f71d4ac..252c44767db 100644
--- a/dlls/xaudio2_7/xact_dll.c
+++ b/dlls/xaudio2_7/xact_dll.c
@@ -1144,42 +1144,82 @@ static HRESULT WINAPI IXACT3EngineImpl_PrepareStreamingWave(IXACT3Engine *iface,
return S_OK;
}
+enum { NOTIFY_SoundBank = 0x01,
+ NOTIFY_WaveBank = 0x02,
+ NOTIFY_Cue = 0x04,
+ NOTIFY_Wave = 0x08,
+ NOTIFY_cueIndex = 0x10,
+ NOTIFY_waveIndex = 0x20 };
+
static inline void unwrap_notificationdesc(FACTNotificationDescription *fd,
const XACT_NOTIFICATION_DESCRIPTION *xd)
{
+ DWORD flags = 0;
memset(fd, 0, sizeof(*fd));
/* We have to unwrap the FACT object first! */
- FIXME("Type %d\n", xd->type);
+ TRACE("Type %d\n", xd->type);
+ /* Supports SoundBank, Cue index, Cue instance */
+ if (xd->type == XACTNOTIFICATIONTYPE_CUEPREPARED || xd->type == XACTNOTIFICATIONTYPE_CUEPLAY ||
+ xd->type == XACTNOTIFICATIONTYPE_CUESTOP || xd->type == XACTNOTIFICATIONTYPE_CUEDESTROYED ||
+ xd->type == XACTNOTIFICATIONTYPE_MARKER || xd->type == XACTNOTIFICATIONTYPE_LOCALVARIABLECHANGED)
+ {
+ flags = NOTIFY_SoundBank | NOTIFY_cueIndex | NOTIFY_Cue;
+ }
+ /* Supports WaveBank */
+ else if (xd->type == XACTNOTIFICATIONTYPE_WAVEBANKDESTROYED || xd->type == XACTNOTIFICATIONTYPE_WAVEBANKPREPARED ||
+ xd->type == XACTNOTIFICATIONTYPE_WAVEBANKSTREAMING_INVALIDCONTENT)
+ {
+ flags = NOTIFY_WaveBank;
+ }
+ /* Supports NOTIFY_SoundBank */
+ else if (xd->type == XACTNOTIFICATIONTYPE_SOUNDBANKDESTROYED)
+ {
+ flags = NOTIFY_SoundBank;
+ }
+ /* Supports WaveBank, Wave index, Wave instance */
+ else if (xd->type == XACTNOTIFICATIONTYPE_WAVEPREPARED || xd->type == XACTNOTIFICATIONTYPE_WAVEDESTROYED)
+ {
+ flags = NOTIFY_WaveBank | NOTIFY_waveIndex | NOTIFY_Wave;
+ }
+ /* Supports SoundBank, SoundBank, Cue index, Cue instance, WaveBank, Wave instance */
+ else if (xd->type == XACTNOTIFICATIONTYPE_WAVEPLAY || xd->type == XACTNOTIFICATIONTYPE_WAVESTOP ||
+ xd->type == XACTNOTIFICATIONTYPE_WAVELOOPED)
+ {
+ flags = NOTIFY_SoundBank | NOTIFY_cueIndex | NOTIFY_Cue | NOTIFY_WaveBank | NOTIFY_Wave;
+ }
fd->type = xd->type;
fd->flags = xd->flags;
- fd->cueIndex = xd->cueIndex;
- fd->waveIndex = xd->waveIndex;
fd->pvContext = xd->pvContext;
- if (xd->pCue != NULL)
+ if (flags & NOTIFY_cueIndex)
+ fd->cueIndex = xd->cueIndex;
+ if (flags & NOTIFY_waveIndex)
+ fd->waveIndex = xd->waveIndex;
+
+ if (flags & NOTIFY_Cue && xd->pCue != NULL)
{
XACT3CueImpl *cur = impl_from_IXACT3Cue(xd->pCue);
if (cur)
fd->pCue = cur->fact_cue;
}
- if (xd->pSoundBank != NULL)
+ if (flags & NOTIFY_SoundBank && xd->pSoundBank != NULL)
{
XACT3SoundBankImpl *sound = impl_from_IXACT3SoundBank(xd->pSoundBank);
if (sound)
fd->pSoundBank = sound->fact_soundbank;
}
- if (xd->pWaveBank != NULL)
+ if (flags & NOTIFY_WaveBank && xd->pWaveBank != NULL)
{
XACT3WaveBankImpl *bank = impl_from_IXACT3WaveBank(xd->pWaveBank);
if (bank)
fd->pWaveBank = bank->fact_wavebank;
}
- if (xd->pWave != NULL)
+ if (flags & NOTIFY_Wave && xd->pWave != NULL)
{
XACT3WaveImpl *wave = impl_from_IXACT3Wave(xd->pWave);
FIXME("Wave %p\n", wave);
--
2.25.1

View File

@ -1 +1 @@
f7895ef25a4cb2115ffbe04d28b87bcb6ee3c0b7
8cbbb4f394678411fdb57237553f5d974527877f