https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a84b0dbe6b8a4f78f271e…
commit a84b0dbe6b8a4f78f271ef0cd8331d9b5252134d
Author: Jérôme Gardou <jerome.gardou(a)reactos.org>
AuthorDate: Mon Sep 14 10:01:15 2020 +0200
Commit: Jérôme Gardou <jerome.gardou(a)reactos.org>
CommitDate: Wed Sep 16 10:35:30 2020 +0200
[LIBWINE] make wine_get_dos_file_name available
And complain loudly when we get a *real* unix file name
---
sdk/include/psdk/winbase.h | 5 ++
sdk/lib/3rdparty/libwine/CMakeLists.txt | 4 +-
sdk/lib/3rdparty/libwine/path.c | 82 +++++++++++++++++++++++++++++++++
3 files changed, 90 insertions(+), 1 deletion(-)
diff --git a/sdk/include/psdk/winbase.h b/sdk/include/psdk/winbase.h
index f803ff178de..0f653ea835f 100644
--- a/sdk/include/psdk/winbase.h
+++ b/sdk/include/psdk/winbase.h
@@ -3945,6 +3945,11 @@ QueryDepthSList(
#endif /* _SLIST_HEADER_ */
+#ifdef __WINESRC__
+/* Wine specific. Basically MultiByteToWideChar for us. */
+WCHAR * CDECL wine_get_dos_file_name(LPCSTR str);
+#endif
+
#ifdef _MSC_VER
#pragma warning(pop)
#endif
diff --git a/sdk/lib/3rdparty/libwine/CMakeLists.txt b/sdk/lib/3rdparty/libwine/CMakeLists.txt
index 809893c3bd9..bed7ca764eb 100644
--- a/sdk/lib/3rdparty/libwine/CMakeLists.txt
+++ b/sdk/lib/3rdparty/libwine/CMakeLists.txt
@@ -1,6 +1,5 @@
include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine)
-add_definitions(-D__WINESRC__)
list(APPEND SOURCE
config.c
@@ -10,12 +9,15 @@ list(APPEND SOURCE
isnan.c
loader.c
${REACTOS_SOURCE_DIR}/sdk/lib/crt/string/wctype.c
+ path.c
register.c
# string.c implements _stricmp, already shipped with crt
)
add_library(wine ${SOURCE})
add_dependencies(wine psdk)
+target_compile_definitions(wine PRIVATE __WINESRC__ _WINE)
add_library(wineldr loader.c)
add_dependencies(wineldr xdk)
+target_compile_definitions(wineldr PRIVATE __WINESRC__)
diff --git a/sdk/lib/3rdparty/libwine/path.c b/sdk/lib/3rdparty/libwine/path.c
new file mode 100644
index 00000000000..d8f11bdafc5
--- /dev/null
+++ b/sdk/lib/3rdparty/libwine/path.c
@@ -0,0 +1,82 @@
+/* Copyright 1993 Erik Bos
+ * Copyright 1996, 2004 Alexandre Julliard
+ * Copyright 2003 Eric Pouech
+ *
+ * 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>
+#include <winbase.h>
+#include <winnls.h>
+
+#include <wine/winternl.h>
+
+#include <wine/debug.h>
+WINE_DEFAULT_DEBUG_CHANNEL(path);
+
+static inline BOOL set_ntstatus( NTSTATUS status )
+{
+ if (status) SetLastError( RtlNtStatusToDosError( status ));
+ return !status;
+}
+
+/***********************************************************************
+ * wine_get_dos_file_name (KERNEL32.@) Not a Windows API
+ *
+ * Return the full DOS file name for a given Unix path.
+ * Returned buffer must be freed by caller.
+ */
+WCHAR * CDECL wine_get_dos_file_name( LPCSTR str )
+{
+ UNICODE_STRING nt_name;
+ NTSTATUS status;
+ WCHAR *buffer;
+ SIZE_T len = strlen(str) + 1;
+
+ if (str[0] != '/') /* relative path name */
+ {
+ if (!(buffer = RtlAllocateHeap( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return NULL;
+ MultiByteToWideChar( CP_UNIXCP, 0, str, len, buffer, len );
+ status = RtlDosPathNameToNtPathName_U_WithStatus( buffer, &nt_name, NULL, NULL );
+ RtlFreeHeap( GetProcessHeap(), 0, buffer );
+ if (!set_ntstatus( status )) return NULL;
+ buffer = nt_name.Buffer;
+ len = nt_name.Length / sizeof(WCHAR) + 1;
+ }
+ else
+ {
+#ifdef __REACTOS__
+ ERR("Got absolute UNIX path name in function wine_get_dos_file_name. This is not UNIX. Please fix the caller!\n");
+ ERR("File name: %s\n", str);
+#else
+ len += 8; /* \??\unix prefix */
+ if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return NULL;
+ if (!set_ntstatus( wine_unix_to_nt_file_name( str, buffer, &len )))
+ {
+ HeapFree( GetProcessHeap(), 0, buffer );
+ return NULL;
+ }
+#endif
+ }
+ if (buffer[5] == ':')
+ {
+ /* get rid of the \??\ prefix */
+ /* FIXME: should implement RtlNtPathNameToDosPathName and use that instead */
+ memmove( buffer, buffer + 4, (len - 4) * sizeof(WCHAR) );
+ }
+ else buffer[1] = '\\';
+ return buffer;
+}
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a27f0debca4c0fe8cd916…
commit a27f0debca4c0fe8cd916d2406124f9d30ae5dbe
Author: Joachim Henze <Joachim.Henze(a)reactos.org>
AuthorDate: Tue Sep 15 20:54:50 2020 +0200
Commit: Joachim Henze <Joachim.Henze(a)reactos.org>
CommitDate: Tue Sep 15 20:54:50 2020 +0200
[MMIXER] Fix NULL dereference CORE-17276
This lead to a crash of winmm:mixer
during "GCCLin_x86 on Test VBox".
The crash was exposed when new code paths
were activated by 0.4.15-dev-791-g
6d7ebc20481a587bd19e8a8049317113071b0817
I do intend to port this commit back into 0.4.14RC.
---
sdk/lib/drivers/sound/mmixer/sup.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sdk/lib/drivers/sound/mmixer/sup.c b/sdk/lib/drivers/sound/mmixer/sup.c
index 06f342b12e8..4fa8c080309 100644
--- a/sdk/lib/drivers/sound/mmixer/sup.c
+++ b/sdk/lib/drivers/sound/mmixer/sup.c
@@ -690,6 +690,8 @@ MMixerSetGetVolumeControlDetails(
/* get input */
Input = (LPMIXERCONTROLDETAILS_UNSIGNED)MixerControlDetails->paDetails;
+ if (!Input)
+ return MM_STATUS_UNSUCCESSFUL; /* to prevent dereferencing NULL */
if (bSet)
{
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6d7ebc20481a587bd19e8…
commit 6d7ebc20481a587bd19e8a8049317113071b0817
Author: Joachim Henze <Joachim.Henze(a)reactos.org>
AuthorDate: Mon Sep 14 17:12:16 2020 +0200
Commit: Joachim Henze <Joachim.Henze(a)reactos.org>
CommitDate: Mon Sep 14 17:12:16 2020 +0200
[WDMAUD.DRV] Workaround multiple issues with AC97 driver from rapps
By taking alternative code-paths in WdmAud and bypassing Sysaudio.
This relies on the patch 0.4.15-dev-765-g
b8e936a57b4770e133772cf2dd66f30671a1524b
It fixes the following bugs/regressions:
-CORE-13202 Unhandled exception from wdmaud.drv when recording sound in Scratch 1.4 leads to app-crash
-CORE-13488 A deadlock in "DiabloII" character selection screen and "The Lion King II"
-CORE-8726/CORE-9986/CORE-16564 AC97 driver is now working in the same session where driver was installed, no reboot-orgies needed anymore
-CORE-9981 almost 100% fixed, DosBox + Commander Keen6 properly plays music instead of garbled output,
same improvement for ScummVM 2.0 with Monkey Island 2
The playback is not yet *entirely* perfect, still a few hiccups now and then, but
by orders of magnitude better than before.
---
dll/win32/wdmaud.drv/wdmaud.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dll/win32/wdmaud.drv/wdmaud.c b/dll/win32/wdmaud.drv/wdmaud.c
index dfd8ea0361e..45308b3aff2 100644
--- a/dll/win32/wdmaud.drv/wdmaud.c
+++ b/dll/win32/wdmaud.drv/wdmaud.c
@@ -18,6 +18,7 @@
#include <debug.h>
#include <mmebuddy_debug.h>
+#define USE_MMIXER_LIB
#ifndef USE_MMIXER_LIB
#define FUNC_NAME(x) x##ByLegacy
#else
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a3731984199872416fa2a…
commit a3731984199872416fa2a53fd7b3867fede3135d
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Mon Sep 14 05:39:48 2020 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Mon Sep 14 05:54:13 2020 +0200
[SHELL32] Fix boot to shell, addendum to commit 14599b0a.
shell32.ShellMessageBoxW redirects to shlwapi.ShellMessageBoxWrapW.
However the latter one (shlwapi) is exported by ordinal only.
Trying to use in shell32.spec file the following syntax:
182 varargs ShellMessageBoxW() shlwapi.ShellMessageBoxWrapW
will therefore fail at runtime, because Windows/ReactOS will fail to
snap shlwapi.ShellMessageBoxWrapW.
Using instead an export by orginal:
182 varargs ShellMessageBoxW() shlwapi.#388
actually fails as well, but at link time, by both MSVC' LINK and GNU's
dlltool.
This generates a .def file containing the line:
ShellMessageBoxW=shlwapi.#388 @182
It is not clear why it fails, because according to:
https://docs.microsoft.com/en-us/cpp/build/reference/exports?view=vs-2019
and
https://devblogs.microsoft.com/oldnewthing/20121116-00/?p=6073
this should be possible.
However one encounters the same errors as those described at:
https://groups.google.com/forum/#!topic/microsoft.public.vc.language/AVnx-E…
and
https://www.xspdf.com/questions/22333.shtml
...
So instead we use another trick, that appears to be already in use in
the shell32.spec. Since the shlwapi functions are imported because we
link to it, this means that ShellMessageBoxWrapW() is already available
through this import. So we can specify it in the .spec file as is,
without a full name prefixed with "shlwapi." .
Therefore the associated shell32.ShellMessageBoxW function will instead
link to the small ShellMessageBoxWrapW() import stub that is generated
automatically.
---
dll/win32/shell32/shell32.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dll/win32/shell32/shell32.spec b/dll/win32/shell32/shell32.spec
index 110ac17c69c..f5270cc103f 100644
--- a/dll/win32/shell32/shell32.spec
+++ b/dll/win32/shell32/shell32.spec
@@ -178,7 +178,7 @@
179 stdcall SHGetNewLinkInfoA(str str ptr long long)
180 stdcall SHGetNewLinkInfoW(wstr wstr ptr long long)
181 stdcall -noname RegisterShellHook(long long)
-182 varargs ShellMessageBoxW(long long wstr wstr long) shlwapi.ShellMessageBoxWrapW
+182 varargs ShellMessageBoxW(long long wstr wstr long) ShellMessageBoxWrapW ## This is the no-named 'shlwapi.ShellMessageBoxWrapW' (i.e. 'shlwapi.#388')
183 varargs ShellMessageBoxA(long long str str long)
184 stdcall -noname ArrangeWindows(long long long long long)
185 stdcall -noname SHHandleDiskFull(ptr long)
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=aad9bb8e8addfa3d0fdc5…
commit aad9bb8e8addfa3d0fdc5a85606172690b58c425
Author: Kyle Katarn <contact(a)kcsoftwares.com>
AuthorDate: Sun Sep 13 23:16:19 2020 +0200
Commit: GitHub <noreply(a)github.com>
CommitDate: Sun Sep 13 23:16:19 2020 +0200
[TRANSLATION][SHELL32] Localization of "System Folder" in My Computer types (#3168)
Co-authored-by: Adam Stachowicz <saibamenppl(a)gmail.com>
Co-authored-by: JoseSanchezz <67137372+JoseSanchezz(a)users.noreply.github.com>
---
dll/win32/shell32/folders/CRegFolder.cpp | 3 +--
dll/win32/shell32/lang/bg-BG.rc | 2 ++
dll/win32/shell32/lang/ca-ES.rc | 2 ++
dll/win32/shell32/lang/cs-CZ.rc | 2 ++
dll/win32/shell32/lang/da-DK.rc | 2 ++
dll/win32/shell32/lang/de-DE.rc | 2 ++
dll/win32/shell32/lang/el-GR.rc | 2 ++
dll/win32/shell32/lang/en-GB.rc | 2 ++
dll/win32/shell32/lang/en-US.rc | 2 ++
dll/win32/shell32/lang/es-ES.rc | 2 ++
dll/win32/shell32/lang/et-EE.rc | 2 ++
dll/win32/shell32/lang/fi-FI.rc | 2 ++
dll/win32/shell32/lang/fr-FR.rc | 2 ++
dll/win32/shell32/lang/he-IL.rc | 2 ++
dll/win32/shell32/lang/hi-IN.rc | 2 ++
dll/win32/shell32/lang/hu-HU.rc | 2 ++
dll/win32/shell32/lang/id-ID.rc | 2 ++
dll/win32/shell32/lang/it-IT.rc | 2 ++
dll/win32/shell32/lang/ja-JP.rc | 2 ++
dll/win32/shell32/lang/ko-KR.rc | 2 ++
dll/win32/shell32/lang/nl-NL.rc | 2 ++
dll/win32/shell32/lang/no-NO.rc | 2 ++
dll/win32/shell32/lang/pl-PL.rc | 2 ++
dll/win32/shell32/lang/pt-BR.rc | 2 ++
dll/win32/shell32/lang/pt-PT.rc | 2 ++
dll/win32/shell32/lang/ro-RO.rc | 2 ++
dll/win32/shell32/lang/ru-RU.rc | 2 ++
dll/win32/shell32/lang/sk-SK.rc | 2 ++
dll/win32/shell32/lang/sl-SI.rc | 2 ++
dll/win32/shell32/lang/sq-AL.rc | 2 ++
dll/win32/shell32/lang/sv-SE.rc | 2 ++
dll/win32/shell32/lang/tr-TR.rc | 2 ++
dll/win32/shell32/lang/uk-UA.rc | 2 ++
dll/win32/shell32/lang/zh-CN.rc | 2 ++
dll/win32/shell32/lang/zh-TW.rc | 2 ++
dll/win32/shell32/shresdef.h | 2 ++
36 files changed, 71 insertions(+), 2 deletions(-)
diff --git a/dll/win32/shell32/folders/CRegFolder.cpp b/dll/win32/shell32/folders/CRegFolder.cpp
index 6dc12770212..ce7292f3964 100644
--- a/dll/win32/shell32/folders/CRegFolder.cpp
+++ b/dll/win32/shell32/folders/CRegFolder.cpp
@@ -771,8 +771,7 @@ HRESULT WINAPI CRegFolder::GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHEL
RegCloseKey(hKey);
return S_OK;
case 2: /* type */
- //return SHSetStrRet(&psd->str, resource_id); /* FIXME: translate */
- return SHSetStrRet(&psd->str, "System Folder");
+ return SHSetStrRet(&psd->str, IDS_SYSTEMFOLDER);
}
return E_FAIL;
}
diff --git a/dll/win32/shell32/lang/bg-BG.rc b/dll/win32/shell32/lang/bg-BG.rc
index c8cf53f7ab8..f256ece6cae 100644
--- a/dll/win32/shell32/lang/bg-BG.rc
+++ b/dll/win32/shell32/lang/bg-BG.rc
@@ -1007,4 +1007,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/ca-ES.rc b/dll/win32/shell32/lang/ca-ES.rc
index d7b4f1d9108..ff4656cd30c 100644
--- a/dll/win32/shell32/lang/ca-ES.rc
+++ b/dll/win32/shell32/lang/ca-ES.rc
@@ -1006,4 +1006,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/cs-CZ.rc b/dll/win32/shell32/lang/cs-CZ.rc
index fdb3815d20f..490b68aa090 100644
--- a/dll/win32/shell32/lang/cs-CZ.rc
+++ b/dll/win32/shell32/lang/cs-CZ.rc
@@ -1012,4 +1012,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/da-DK.rc b/dll/win32/shell32/lang/da-DK.rc
index cd8482376fd..0f86d9a3c26 100644
--- a/dll/win32/shell32/lang/da-DK.rc
+++ b/dll/win32/shell32/lang/da-DK.rc
@@ -1012,4 +1012,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/de-DE.rc b/dll/win32/shell32/lang/de-DE.rc
index d0a9621f396..6e94e825518 100644
--- a/dll/win32/shell32/lang/de-DE.rc
+++ b/dll/win32/shell32/lang/de-DE.rc
@@ -1007,4 +1007,6 @@ BEGIN
IDS_MOVETOTITLE "Wählen Sie den Ort, in den '%s' verschoben werden soll. Klicken Sie anschließend auf Verschieben."
IDS_MOVEITEMS "Elemente verschieben"
IDS_MOVEBUTTON "Verschieben"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/el-GR.rc b/dll/win32/shell32/lang/el-GR.rc
index 608a39b4e47..ba7f4182855 100644
--- a/dll/win32/shell32/lang/el-GR.rc
+++ b/dll/win32/shell32/lang/el-GR.rc
@@ -1006,4 +1006,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/en-GB.rc b/dll/win32/shell32/lang/en-GB.rc
index 105de0326dc..63424343e74 100644
--- a/dll/win32/shell32/lang/en-GB.rc
+++ b/dll/win32/shell32/lang/en-GB.rc
@@ -1006,4 +1006,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/en-US.rc b/dll/win32/shell32/lang/en-US.rc
index a363b8007ba..ef2dcf0590e 100644
--- a/dll/win32/shell32/lang/en-US.rc
+++ b/dll/win32/shell32/lang/en-US.rc
@@ -1006,4 +1006,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/es-ES.rc b/dll/win32/shell32/lang/es-ES.rc
index d7587de7a88..41adf26c018 100644
--- a/dll/win32/shell32/lang/es-ES.rc
+++ b/dll/win32/shell32/lang/es-ES.rc
@@ -1015,4 +1015,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/et-EE.rc b/dll/win32/shell32/lang/et-EE.rc
index 9533ddd67a0..4b308e77c23 100644
--- a/dll/win32/shell32/lang/et-EE.rc
+++ b/dll/win32/shell32/lang/et-EE.rc
@@ -1013,4 +1013,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/fi-FI.rc b/dll/win32/shell32/lang/fi-FI.rc
index 714c08ac926..30071a27944 100644
--- a/dll/win32/shell32/lang/fi-FI.rc
+++ b/dll/win32/shell32/lang/fi-FI.rc
@@ -1006,4 +1006,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/fr-FR.rc b/dll/win32/shell32/lang/fr-FR.rc
index 2cad6e6b751..acf02ca4a6b 100644
--- a/dll/win32/shell32/lang/fr-FR.rc
+++ b/dll/win32/shell32/lang/fr-FR.rc
@@ -1006,4 +1006,6 @@ BEGIN
IDS_MOVETOTITLE "Sélectionnez l'emplacement où vous souhaitez déplacer '%s', puis appuyez sur le bouton Déplacer."
IDS_MOVEITEMS "Déplacer les éléments"
IDS_MOVEBUTTON "Déplacer"
+
+ IDS_SYSTEMFOLDER "Dossier système"
END
diff --git a/dll/win32/shell32/lang/he-IL.rc b/dll/win32/shell32/lang/he-IL.rc
index a04365c04f7..b27f62e4bdc 100644
--- a/dll/win32/shell32/lang/he-IL.rc
+++ b/dll/win32/shell32/lang/he-IL.rc
@@ -1008,4 +1008,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/hi-IN.rc b/dll/win32/shell32/lang/hi-IN.rc
index 54b4dfc3dfb..d3cac589e6e 100644
--- a/dll/win32/shell32/lang/hi-IN.rc
+++ b/dll/win32/shell32/lang/hi-IN.rc
@@ -1001,4 +1001,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/hu-HU.rc b/dll/win32/shell32/lang/hu-HU.rc
index 8f887b03807..7c47db6fe45 100644
--- a/dll/win32/shell32/lang/hu-HU.rc
+++ b/dll/win32/shell32/lang/hu-HU.rc
@@ -1005,4 +1005,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/id-ID.rc b/dll/win32/shell32/lang/id-ID.rc
index 5dc7a1d0370..d48846edb55 100644
--- a/dll/win32/shell32/lang/id-ID.rc
+++ b/dll/win32/shell32/lang/id-ID.rc
@@ -1002,4 +1002,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/it-IT.rc b/dll/win32/shell32/lang/it-IT.rc
index 6bf694cb9cb..8572685eda1 100644
--- a/dll/win32/shell32/lang/it-IT.rc
+++ b/dll/win32/shell32/lang/it-IT.rc
@@ -1006,4 +1006,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/ja-JP.rc b/dll/win32/shell32/lang/ja-JP.rc
index c72797b6285..d1c420ecf1a 100644
--- a/dll/win32/shell32/lang/ja-JP.rc
+++ b/dll/win32/shell32/lang/ja-JP.rc
@@ -1003,4 +1003,6 @@ BEGIN
IDS_MOVETOTITLE "'%s' の移動先を選択して「移動」ボタンをクリックして下さい。"
IDS_MOVEITEMS "項目の移動先"
IDS_MOVEBUTTON "移動"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/ko-KR.rc b/dll/win32/shell32/lang/ko-KR.rc
index 407d8675d61..0c0fd22d783 100644
--- a/dll/win32/shell32/lang/ko-KR.rc
+++ b/dll/win32/shell32/lang/ko-KR.rc
@@ -1006,4 +1006,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/nl-NL.rc b/dll/win32/shell32/lang/nl-NL.rc
index b4c70b2ba0a..0871a744914 100644
--- a/dll/win32/shell32/lang/nl-NL.rc
+++ b/dll/win32/shell32/lang/nl-NL.rc
@@ -1006,4 +1006,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/no-NO.rc b/dll/win32/shell32/lang/no-NO.rc
index d19c455cfa8..1b159361977 100644
--- a/dll/win32/shell32/lang/no-NO.rc
+++ b/dll/win32/shell32/lang/no-NO.rc
@@ -1006,4 +1006,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/pl-PL.rc b/dll/win32/shell32/lang/pl-PL.rc
index 1d44e866ae8..2d6e65dce66 100644
--- a/dll/win32/shell32/lang/pl-PL.rc
+++ b/dll/win32/shell32/lang/pl-PL.rc
@@ -1012,4 +1012,6 @@ BEGIN
IDS_MOVETOTITLE "Zaznacz miejsce, w które chcesz przenieść '%s', a następnie kliknij przycisk Przenieś."
IDS_MOVEITEMS "Przenoszenie elementów"
IDS_MOVEBUTTON "Przenieś"
+
+ IDS_SYSTEMFOLDER "Folder systemowy"
END
diff --git a/dll/win32/shell32/lang/pt-BR.rc b/dll/win32/shell32/lang/pt-BR.rc
index 4a8e3831407..f9d40a365da 100644
--- a/dll/win32/shell32/lang/pt-BR.rc
+++ b/dll/win32/shell32/lang/pt-BR.rc
@@ -1006,4 +1006,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/pt-PT.rc b/dll/win32/shell32/lang/pt-PT.rc
index 779b5d22d43..82ca880f830 100644
--- a/dll/win32/shell32/lang/pt-PT.rc
+++ b/dll/win32/shell32/lang/pt-PT.rc
@@ -1006,4 +1006,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/ro-RO.rc b/dll/win32/shell32/lang/ro-RO.rc
index 86e775f7670..bad12b2d015 100644
--- a/dll/win32/shell32/lang/ro-RO.rc
+++ b/dll/win32/shell32/lang/ro-RO.rc
@@ -1008,4 +1008,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/ru-RU.rc b/dll/win32/shell32/lang/ru-RU.rc
index e9da9dcfc0e..0b73dc46b94 100644
--- a/dll/win32/shell32/lang/ru-RU.rc
+++ b/dll/win32/shell32/lang/ru-RU.rc
@@ -1013,4 +1013,6 @@ BEGIN
IDS_MOVETOTITLE "Выберите расположение, куда вы хотите переместить '%s', затем нажмите кнопку 'Переместить'."
IDS_MOVEITEMS "Перемещение элементов"
IDS_MOVEBUTTON "Переместить"
+
+ IDS_SYSTEMFOLDER "Системная папка"
END
diff --git a/dll/win32/shell32/lang/sk-SK.rc b/dll/win32/shell32/lang/sk-SK.rc
index 4b2263553ff..b7c2c68873e 100644
--- a/dll/win32/shell32/lang/sk-SK.rc
+++ b/dll/win32/shell32/lang/sk-SK.rc
@@ -1006,4 +1006,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/sl-SI.rc b/dll/win32/shell32/lang/sl-SI.rc
index f25073b1adf..25bb2407df3 100644
--- a/dll/win32/shell32/lang/sl-SI.rc
+++ b/dll/win32/shell32/lang/sl-SI.rc
@@ -1006,4 +1006,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/sq-AL.rc b/dll/win32/shell32/lang/sq-AL.rc
index dc503934a27..f555196609d 100644
--- a/dll/win32/shell32/lang/sq-AL.rc
+++ b/dll/win32/shell32/lang/sq-AL.rc
@@ -1010,4 +1010,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/sv-SE.rc b/dll/win32/shell32/lang/sv-SE.rc
index e7a4927acc8..89ece721224 100644
--- a/dll/win32/shell32/lang/sv-SE.rc
+++ b/dll/win32/shell32/lang/sv-SE.rc
@@ -1006,4 +1006,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/tr-TR.rc b/dll/win32/shell32/lang/tr-TR.rc
index 01a9d772838..8ba5645ac0f 100644
--- a/dll/win32/shell32/lang/tr-TR.rc
+++ b/dll/win32/shell32/lang/tr-TR.rc
@@ -1008,4 +1008,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/uk-UA.rc b/dll/win32/shell32/lang/uk-UA.rc
index 60e1d6c06df..b8c7c952a33 100644
--- a/dll/win32/shell32/lang/uk-UA.rc
+++ b/dll/win32/shell32/lang/uk-UA.rc
@@ -1006,4 +1006,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/zh-CN.rc b/dll/win32/shell32/lang/zh-CN.rc
index 7fce0c7b035..b93b3a389ab 100644
--- a/dll/win32/shell32/lang/zh-CN.rc
+++ b/dll/win32/shell32/lang/zh-CN.rc
@@ -1016,4 +1016,6 @@ BEGIN
IDS_MOVETOTITLE "Select the place where you want to move '%s' to. Then click the Move button."
IDS_MOVEITEMS "Move Items"
IDS_MOVEBUTTON "Move"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/lang/zh-TW.rc b/dll/win32/shell32/lang/zh-TW.rc
index a39f2ccc4ce..dbe437c0ea9 100644
--- a/dll/win32/shell32/lang/zh-TW.rc
+++ b/dll/win32/shell32/lang/zh-TW.rc
@@ -1016,4 +1016,6 @@ BEGIN
IDS_MOVETOTITLE "選取想要移動 '%s' 的位置,然後按一下 [移動] 按鈕。"
IDS_MOVEITEMS "移動項目"
IDS_MOVEBUTTON "移動"
+
+ IDS_SYSTEMFOLDER "System Folder"
END
diff --git a/dll/win32/shell32/shresdef.h b/dll/win32/shell32/shresdef.h
index 391b8330b2b..821d4d05a85 100644
--- a/dll/win32/shell32/shresdef.h
+++ b/dll/win32/shell32/shresdef.h
@@ -306,6 +306,8 @@
#define IDS_MOVEITEMS 30538
#define IDS_MOVEBUTTON 30539
+#define IDS_SYSTEMFOLDER 30540
+
/* Dialogs */
/* Run dialog */
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=860a985f26a41140ca063…
commit 860a985f26a41140ca063e9493dbd953ede06ec9
Author: Kyle Katarn <contact(a)kcsoftwares.com>
AuthorDate: Sun Sep 13 23:02:09 2020 +0200
Commit: GitHub <noreply(a)github.com>
CommitDate: Sun Sep 13 23:02:09 2020 +0200
[FORMAT] Fix of output text overlap in console when finished (#3177)
At the end of the format operation, text in console got overwritten and leftovers from previous line remained displayed.
---
base/system/format/format.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/base/system/format/format.c b/base/system/format/format.c
index 6685200e479..0d7e642c598 100644
--- a/base/system/format/format.c
+++ b/base/system/format/format.c
@@ -562,6 +562,7 @@ int wmain(int argc, WCHAR *argv[])
FormatEx(RootDirectory, media, FileSystem, Label, QuickFormat,
ClusterSize, FormatExCallback);
if (Error) return -1;
+ ConPuts(StdOut, L"\n");
ConResPuts(StdOut, STRING_FMT_COMPLETE);
//
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=51023e3a2e5b15d0b76e1…
commit 51023e3a2e5b15d0b76e1a39169f38ea65831783
Author: Kyle Katarn <contact(a)kcsoftwares.com>
AuthorDate: Sun Sep 13 23:01:07 2020 +0200
Commit: GitHub <noreply(a)github.com>
CommitDate: Sun Sep 13 23:01:07 2020 +0200
[FORMAT] French translation fix (#3178)
Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org>
---
base/system/format/lang/fr-FR.rc | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/base/system/format/lang/fr-FR.rc b/base/system/format/lang/fr-FR.rc
index a077d4d346d..74447b46072 100644
--- a/base/system/format/lang/fr-FR.rc
+++ b/base/system/format/lang/fr-FR.rc
@@ -13,11 +13,11 @@ BEGIN
sont fortement recommandées pour une utilisation courante\n\
NTFS peut utiliser 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K.\n\
FAT peut utiliser 8192, 16K, 32K, 64K, 128K, 256K.\n\
- La compression NTFS n'est pas possible au de là de 4096.\n\
+ La compression NTFS n'est pas possible au delà de 4096.\n\
-C Les fichiers sur le nouveau disque seront compressés automatiquement.\n\n"
STRING_COMPLETE "%lu pourcent effectués.\r"
- STRING_FORMAT_FAIL "FormatEx ne peut se finir avec succés.\n\n"
- STRING_NO_SUPPORT "Fontion Non Supportée"
+ STRING_FORMAT_FAIL "FormatEx ne peut se finir avec succès.\n\n"
+ STRING_NO_SUPPORT "Opération non supportée"
STRING_FMIFS_FAIL "Impossible de trouver les points d'entrée FMIFS.\n\n"
STRING_UNKNOW_ARG "Argument inconnu : %s\n"
STRING_DRIVE_PARM "Le disque à formater n'est pas indiqué.\n\n"
@@ -38,6 +38,6 @@ PERDUES !\nContinuer avec le formatage (O/N) ? "
STRING_VOL_COMPRESS "Le disque ne supporte pas la compression.\n"
STRING_ENTER_LABEL "Nom du disque (11 caractères, Entrée si aucun) ? "
STRING_NO_LABEL "Impossible de donner un nom au disque"
- STRING_FREE_SPACE "\nEspace disque total : %I64d octet.\n Espace disque disponible : %I64d octet.\n"
+ STRING_FREE_SPACE "\nEspace disque total : %I64d octet(s).\nEspace disque disponible : %I64d octet(s).\n"
STRING_SERIAL_NUMBER "\nNuméro de série du disque: %04X-%04X\n"
END
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=14599b0a37927355eefd4…
commit 14599b0a37927355eefd411b444d61bde11b75b2
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sun Sep 13 18:21:29 2020 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Sun Sep 13 22:44:58 2020 +0200
[SHELL32][SHLWAPI] Forward shell32.ShellMessageBoxW directly to shlwapi.ShellMessageBoxWrapW. (#3179)
This makes ShellMessageBoxW use the correct implementation where the
text buffer size is dynamic, instead of having a too small hardcoded
size.
Fixes CORE-17271.
See also PR #3172 by Kyle Katarn, supplemented with some ideas from
Mark Jansen.
However we cannot straightforwardly implement ShellMessageBoxA around
ShellMessageBoxW, by converting some parameters from ANSI to UNICODE,
because there may be some variadic ANSI strings, associated with '%s'
printf-like formatters inside the format string, that would also need
to be converted; however there is no way for us to find these and perform
the conversion ourselves.
Therefore, we re-implement ShellMessageBoxA by doing a copy-paste ANSI
adaptation of the shlwapi.ShellMessageBoxWrapW function.
Note that, on Vista+ onwards, shlwapi implements both ShellMessageBoxA/W,
and shell32 directly forwards these exports to shlwapi, thus avoiding
these workarounds.
[PSDK] Explicily use WINAPIV for the variadic ShellMessageBoxA/W functions.
[INCLUDE/REACTOS] Add ShellMessageBoxWrapW in shlwapi_undoc.h .
---
dll/win32/shell32/precomp.h | 13 ++++++
dll/win32/shell32/shell32.spec | 2 +-
dll/win32/shell32/wine/shellord.c | 90 ++++++++++++++++++++++++++++++++++++-
dll/win32/shlwapi/ordinal.c | 19 +++++++-
sdk/include/psdk/shellapi.h | 2 +
sdk/include/reactos/shlwapi_undoc.h | 10 +++++
6 files changed, 132 insertions(+), 4 deletions(-)
diff --git a/dll/win32/shell32/precomp.h b/dll/win32/shell32/precomp.h
index 84bb7e49dc5..9ae77f4b794 100644
--- a/dll/win32/shell32/precomp.h
+++ b/dll/win32/shell32/precomp.h
@@ -45,6 +45,19 @@
#undef ShellExecute
#include <undocshell.h>
+/*
+ * For versions < Vista+, redefine ShellMessageBoxW to ShellMessageBoxWrapW
+ * (this is needed to avoid a linker error). On Vista+ onwards, shell32.ShellMessageBoxW
+ * redirects to shlwapi.ShellMessageBoxW so the #define should not be needed.
+ *
+ * However our shell32 is built with _WIN32_WINNT set to 0x600 (Vista+),
+ * yet its exports (especially regarding ShellMessageBoxA/W) are Win2003
+ * compatible. So the #define is still needed, and the check be disabled.
+ */
+// #if (_WIN32_WINNT < 0x0600)
+#define ShellMessageBoxW ShellMessageBoxWrapW
+// #endif
+
#include <browseui_undoc.h>
#include <shellutils.h>
diff --git a/dll/win32/shell32/shell32.spec b/dll/win32/shell32/shell32.spec
index f24256761af..110ac17c69c 100644
--- a/dll/win32/shell32/shell32.spec
+++ b/dll/win32/shell32/shell32.spec
@@ -178,7 +178,7 @@
179 stdcall SHGetNewLinkInfoA(str str ptr long long)
180 stdcall SHGetNewLinkInfoW(wstr wstr ptr long long)
181 stdcall -noname RegisterShellHook(long long)
-182 varargs ShellMessageBoxW(long long wstr wstr long)
+182 varargs ShellMessageBoxW(long long wstr wstr long) shlwapi.ShellMessageBoxWrapW
183 varargs ShellMessageBoxA(long long str str long)
184 stdcall -noname ArrangeWindows(long long long long long)
185 stdcall -noname SHHandleDiskFull(ptr long)
diff --git a/dll/win32/shell32/wine/shellord.c b/dll/win32/shell32/wine/shellord.c
index 8cbdb2a4da4..ab0969a157b 100644
--- a/dll/win32/shell32/wine/shellord.c
+++ b/dll/win32/shell32/wine/shellord.c
@@ -331,12 +331,28 @@ BOOL WINAPI RegisterShellHook(
*
* See ShellMessageBoxA.
*
+ */
+#ifdef __REACTOS__
+/*
+ * shell32.ShellMessageBoxW directly redirects to shlwapi.ShellMessageBoxWrapW,
+ * while shell32.ShellMessageBoxA is a copy-paste ANSI adaptation of the
+ * shlwapi.ShellMessageBoxWrapW function.
+ *
+ * From Vista+ onwards, all the implementation of ShellMessageBoxA/W that
+ * were existing in shell32 has been completely moved to shlwapi, so that
+ * shell32.ShellMessageBoxA and shell32.ShellMessageBoxW are redirections
+ * to the corresponding shlwapi functions.
+ *
+ */
+#else // !__REACTOS__
+/*
* NOTE:
* shlwapi.ShellMessageBoxWrapW is a duplicate of shell32.ShellMessageBoxW
* because we can't forward to it in the .spec file since it's exported by
* ordinal. If you change the implementation here please update the code in
* shlwapi as well.
*/
+// Wine version, broken.
int ShellMessageBoxW(
HINSTANCE hInstance,
HWND hWnd,
@@ -358,12 +374,12 @@ int ShellMessageBoxW(
hInstance,hWnd,lpText,lpCaption,uType);
if (IS_INTRESOURCE(lpCaption))
- LoadStringW(hInstance, LOWORD(lpCaption), szTitle, sizeof(szTitle)/sizeof(szTitle[0]));
+ LoadStringW(hInstance, LOWORD(lpCaption), szTitle, ARRAY_SIZE(szTitle));
else
pszTitle = lpCaption;
if (IS_INTRESOURCE(lpText))
- LoadStringW(hInstance, LOWORD(lpText), szText, sizeof(szText)/sizeof(szText[0]));
+ LoadStringW(hInstance, LOWORD(lpText), szText, ARRAY_SIZE(szText));
else
pszText = lpText;
@@ -376,6 +392,7 @@ int ShellMessageBoxW(
LocalFree(pszTemp);
return ret;
}
+#endif
/*************************************************************************
* ShellMessageBoxA [SHELL32.183]
@@ -395,6 +412,18 @@ int ShellMessageBoxW(
* NOTES
* Exported by ordinal
*/
+#ifdef __REACTOS__
+/*
+ * Note that we cannot straightforwardly implement ShellMessageBoxA around
+ * ShellMessageBoxW, by converting some parameters from ANSI to UNICODE,
+ * because there may be some variadic ANSI strings, associated with '%s'
+ * printf-like formatters inside the format string, that would also need
+ * to be converted; however there is no way for us to find these and perform
+ * the conversion ourselves.
+ * Therefore, we re-implement ShellMessageBoxA by doing a copy-paste ANSI
+ * adaptation of the shlwapi.ShellMessageBoxWrapW function.
+ */
+#endif
int ShellMessageBoxA(
HINSTANCE hInstance,
HWND hWnd,
@@ -403,6 +432,62 @@ int ShellMessageBoxA(
UINT uType,
...)
{
+#ifdef __REACTOS__
+ CHAR *szText = NULL, szTitle[100];
+ LPCSTR pszText, pszTitle = szTitle;
+ LPSTR pszTemp;
+ __ms_va_list args;
+ int ret;
+
+ __ms_va_start(args, uType);
+
+ TRACE("(%p,%p,%p,%p,%08x)\n", hInstance, hWnd, lpText, lpCaption, uType);
+
+ if (IS_INTRESOURCE(lpCaption))
+ LoadStringA(hInstance, LOWORD(lpCaption), szTitle, ARRAY_SIZE(szTitle));
+ else
+ pszTitle = lpCaption;
+
+ if (IS_INTRESOURCE(lpText))
+ {
+ /* Retrieve the length of the Unicode string and obtain the maximum
+ * possible length for the corresponding ANSI string (not counting
+ * any possible NULL-terminator). */
+ const WCHAR *ptr;
+ UINT len = LoadStringW(hInstance, LOWORD(lpText), (LPWSTR)&ptr, 0);
+
+ len = WideCharToMultiByte(CP_ACP, 0, ptr, len,
+ NULL, 0, NULL, NULL);
+
+ if (len)
+ {
+ szText = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(CHAR));
+ if (szText) LoadStringA(hInstance, LOWORD(lpText), szText, len + 1);
+ }
+ pszText = szText;
+ if (!pszText) {
+ WARN("Failed to load id %d\n", LOWORD(lpText));
+ __ms_va_end(args);
+ return 0;
+ }
+ }
+ else
+ pszText = lpText;
+
+ FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
+ pszText, 0, 0, (LPSTR)&pszTemp, 0, &args);
+
+ __ms_va_end(args);
+
+ ret = MessageBoxA(hWnd, pszTemp, pszTitle, uType | MB_SETFOREGROUND);
+
+ HeapFree(GetProcessHeap(), 0, szText);
+ LocalFree(pszTemp);
+ return ret;
+
+#else // __REACTOS__
+
+// Wine version, broken.
char szText[100],szTitle[100];
LPCSTR pszText = szText, pszTitle = szTitle;
LPSTR pszTemp;
@@ -433,6 +518,7 @@ int ShellMessageBoxA(
ret = MessageBoxA(hWnd,pszTemp,pszTitle,uType);
LocalFree(pszTemp);
return ret;
+#endif
}
/*************************************************************************
diff --git a/dll/win32/shlwapi/ordinal.c b/dll/win32/shlwapi/ordinal.c
index 431ec51d2e1..b8b93a60372 100644
--- a/dll/win32/shlwapi/ordinal.c
+++ b/dll/win32/shlwapi/ordinal.c
@@ -4803,11 +4803,25 @@ DWORD WINAPI GetUIVersion(void)
*
* See shell32.ShellMessageBoxW
*
+#ifndef __REACTOS__
+ *
* NOTE:
* shlwapi.ShellMessageBoxWrapW is a duplicate of shell32.ShellMessageBoxW
* because we can't forward to it in the .spec file since it's exported by
* ordinal. If you change the implementation here please update the code in
* shell32 as well.
+ *
+#else // __REACTOS__
+ *
+ * From Vista+ onwards, all the implementation of ShellMessageBoxA/W that
+ * were existing in shell32 has been completely moved to shlwapi, so that
+ * shell32.ShellMessageBoxA and shell32.ShellMessageBoxW are redirections
+ * to the corresponding shlwapi functions.
+ *
+ * For Win2003 compatibility, if you change the implementation here please
+ * update the code of ShellMessageBoxA in shell32 as well.
+ *
+#endif
*/
INT WINAPIV ShellMessageBoxWrapW(HINSTANCE hInstance, HWND hWnd, LPCWSTR lpText,
LPCWSTR lpCaption, UINT uType, ...)
@@ -4823,7 +4837,7 @@ INT WINAPIV ShellMessageBoxWrapW(HINSTANCE hInstance, HWND hWnd, LPCWSTR lpText,
TRACE("(%p,%p,%p,%p,%08x)\n", hInstance, hWnd, lpText, lpCaption, uType);
if (IS_INTRESOURCE(lpCaption))
- LoadStringW(hInstance, LOWORD(lpCaption), szTitle, sizeof(szTitle)/sizeof(szTitle[0]));
+ LoadStringW(hInstance, LOWORD(lpCaption), szTitle, ARRAY_SIZE(szTitle));
else
pszTitle = lpCaption;
@@ -4852,6 +4866,9 @@ INT WINAPIV ShellMessageBoxWrapW(HINSTANCE hInstance, HWND hWnd, LPCWSTR lpText,
__ms_va_end(args);
+#ifdef __REACTOS__
+ uType |= MB_SETFOREGROUND;
+#endif
ret = MessageBoxW(hWnd, pszTemp, pszTitle, uType);
HeapFree(GetProcessHeap(), 0, szText);
diff --git a/sdk/include/psdk/shellapi.h b/sdk/include/psdk/shellapi.h
index b4a5ecb4f78..77e3fc5b62c 100644
--- a/sdk/include/psdk/shellapi.h
+++ b/sdk/include/psdk/shellapi.h
@@ -511,6 +511,7 @@ ShellAboutW(
_In_opt_ HICON hIcon);
int
+WINAPIV
ShellMessageBoxA(
_In_opt_ HINSTANCE hAppInst,
_In_opt_ HWND hWnd,
@@ -520,6 +521,7 @@ ShellMessageBoxA(
...);
int
+WINAPIV
ShellMessageBoxW(
_In_opt_ HINSTANCE hAppInst,
_In_opt_ HWND hWnd,
diff --git a/sdk/include/reactos/shlwapi_undoc.h b/sdk/include/reactos/shlwapi_undoc.h
index 08af85972d7..a56ed24ed9d 100644
--- a/sdk/include/reactos/shlwapi_undoc.h
+++ b/sdk/include/reactos/shlwapi_undoc.h
@@ -120,6 +120,16 @@ INT WINAPI SHUnicodeToAnsi(LPCWSTR lpSrcStr, LPSTR lpDstStr, INT iLen);
PVOID WINAPI SHLockSharedEx(HANDLE hData, DWORD dwProcessId, BOOL bWriteAccess);
+int
+WINAPIV
+ShellMessageBoxWrapW(
+ _In_opt_ HINSTANCE hAppInst,
+ _In_opt_ HWND hWnd,
+ _In_ LPCWSTR lpcText,
+ _In_opt_ LPCWSTR lpcTitle,
+ _In_ UINT fuStyle,
+ ...);
+
#ifdef __cplusplus
} /* extern "C" */
#endif /* defined(__cplusplus) */