Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-17313

Using shell32.dll from 2k3sp2, shutdown dialog doesn't open from Start Menu with Workstation setup

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Fix Version/s: 0.4.15
    • Component/s: RosDlls
    • Labels:
      None
    • Environment:

      VirtualBox 5.1.38.

      Description

      Reproducing steps:

      1. Install ReactOS as Workstation by selecting this option during the 2nd setup stage.
      2. Replace the following files onto versions from 2k3sp2: browselc.dll, browseui.dll, comdlg32.dll, duser.dll, linkinfo.dll, shdocvw.dll, shell32.dll, shlwapi.dll.
      3. Register and install the following dlls: browseui.dll, shdocvw.dll, shell32.dll via executing regsvr32 /i{{ dllname.dll}} for each of them.
      4. Reboot the system.
      5. After reboot, open Start Menu 3 times. The first two times it will show only Programs category (it's unrelated issue), and only after the 3rd opening it will show all menu items, although they will small and without icons (another unrelated bug).
      6. Click "Shutdown Computer".

      After the last step, if you installed ROS as Workstation, Shell will just hang, but without any assert or BSOD. Pressing/sending Ctrl-Alt-Del, then logoff and logon again will allow to use the desktop again.

      With default Server setup, the shutdown dialog will open successfully, without any issues.

      In msgina.log appears the following line when the Shell hangs:

      WARNING: calling stub ShellTurnOffDialog()
      

      and then unhandled exception.

      Although this function is completely undocumented, but judging by its name, and moreover, if it is caled by MS shell32.dll to open the turn off dialog, the purpose of this function seems to be obvious for me.

      Btw, we already have the similar ShellShutdownDialog function, which does exactly the same thing. So, since ShellTurnOffDialog has the same purpose as the first function, I guess it can simply call it with appropriate parameters. If it's undocumented, we cannot know how it exactly works, so just using already implemented function instead might be a correct solution, I think it's better than nothing in any case.

      Ftr, both these functions live in msgina.dll, so only our msgina causes the problem.

      I found the possible (and most of all correct) prototype for this here: http://diendan.congdongcviet.com/threads/t13622::tim-handle-cua-cua-so-tat-may-tren-windows-nhu-the-nao.cpp?p=69284#post69284 (look at line 32). The type of the function is DWORD, and it has one parameter of HWND type, which is a window to use.
      Simple returning ShellShutdownDialog from that function with all required parameters (hwnd as the first parameter, then NULL username, since this one is unreferenced anyway in ShellShutdownDialog, so it does nothing, and the FALSE for the 3rd one, this also will enable the logoff button) completely fixes the bug for me, and after my changes, the shutdown dialog successfully opens from Start Menu and I'm able to shutdown the system without logoff with MS Shell replaced. Since that function is same of DWORD type, it can be returned from this one.

        Attachments

          Activity

            People

            • Assignee:
              Oleg Dubinskij Oleg Dubinskiy
              Reporter:
              Oleg Dubinskij Oleg Dubinskiy
            • Votes:
              3 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: