https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a3731984199872416fa2a53fd7b3867fede3135d

commit a3731984199872416fa2a53fd7b3867fede3135d
Author:     Hermès Bélusca-Maïto <[email protected]>
AuthorDate: Mon Sep 14 05:39:48 2020 +0200
Commit:     Hermès Bélusca-Maïto <[email protected]>
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-EnYdsY
    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)

Reply via email to