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

MS shell32.dll fails to load desktop properly with our browseui.dll

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • Shell
    • VirtualBox 5.1.38.

    Description

      Reproducing steps:

      1. Delete our shdocvw.dll, shell32.dll, shlwapi.dll from system32.
      2. Copy MS duser.dll, linkinfo.dll, shdocvw.dll, shell32.dll, shlwapi.dll there.
      3. Register shdocvw.dll and shell32.dll via regsvr32 /i dllname.dll command.
      4. Reboot the system.

      After reboot, only taskbar with Start Menu will be visible. All other stuff will not work properly (desktop icons, context menus, explorer windows etc). However, taskbar works nearly without problems, same as if don't replace any dlls from Windows.

      In MS_shell32_no_classes_before.log appear the following lines when opening any other window besides explorer (e. g. taskmgr):

      err:(dll/win32/ole32/compobj.c:3195) class {dd313e04-feff-11d1-8ecd-0000f87a470c} not registered
      err:(dll/win32/ole32/compobj.c:3231) class {dd313e04-feff-11d1-8ecd-0000f87a470c} not registered
      err:(dll/win32/ole32/compobj.c:3274) no class object {dd313e04-feff-11d1-8ecd-0000f87a470c} could be created for context 0x403
      

      According to the browseui classes table from https://www.geoffchappell.com/studies/windows/ie/browseui/classes/index.htm, it's CUserAssist class, which contains IUserAssist interface. So this stuff seems to be required by MS shell32.dll in order to load the desktop properly. Our browseui.dll indeed currently has no this class at all.

      If to register this manually, e. g. from iuserassist1.reg and iuserassist2.reg, will appear another error, as in MS_shell32_with_classes_before.log:

      err:(dll/win32/ole32/compobj.c:1406) DllGetClassObject returned error 0x80040111 for dll L"C:\\WINDOWS\\system32\\browseui.dll"
      err:(dll/win32/ole32/compobj.c:3274) no class object {dd313e04-feff-11d1-8ecd-0000f87a470c} could be created for context 0x403
      

      In this case, the classes are registered, but our browseui.dll fails to properly load them, because, as I said above, it doesn't support them at all for now.

      ________
      Sidenote: also during investigating this bug, I found another minor issue in CCommonBrowser class. According to https://www.geoffchappell.com/studies/windows/ie/browseui/classes/ccommonbrowser.htm it can be aggregated, but our current implememtation doesn't allow aggregate it, so in that log, I also see the following error:

      fixme:(dll/win32/ole32/compobj.c:3454) Class {af604efe-8897-11d1-b944-00a0c90312e1} does not support aggregation
      

      which ideally shouldn't happen.
      In order to fix this, we need just to change the appropriate macro in dll/win32/browseui/commonbrowser.h from DECLARE_NOT_AGGREGATABLE to DECLARE_AGGREGATABLE, according to https://docs.microsoft.com/en-us/cpp/atl/reference/aggregation-and-class-factory-macros?view=vs-2019.
      I can confirm: after doing it, that error does no longer appear in the log, which is more correct. But it doesn't fix the actual bug.
      ________

      I already stubplemented CUserAssist support in my local branch, and now, after my changes, I see another output as in the MS_shell32_after.log:

      fixme:(dll/win32/ole32/compobj.c:3456) no instance created for interface {dd313e05-feff-11d1-8ecd-0000f87a470c} of class {dd313e04-feff-11d1-8ecd-0000f87a470c}, hres is 0x80004002
      

      And the problem is still not fixed after my changes.
      For some reason, it fails to load that interface anyway, and returns an error.
      According to https://docs.microsoft.com/en-us/windows/win32/seccrypto/common-hresult-values, hres 0x80004002 means E_NOINTERFACE (No such interface supported), although the interface itself is already present.
      According to https://www.geoffchappell.com/studies/windows/ie/browseui/interfaces/iuserassist.htm, all GUIDs whose are displayed in debug message are correct, but I have still no success. So either it requires the proper implementation itself, or something is wrong with my stub.
      I'll open a PR for this for the further inverstigation. Allow me some time.

      Attachments

        1. iuserassist1.reg
          0.9 kB
        2. iuserassist2.reg
          1.0 kB
        3. MS_shell32_after.log
          53 kB
        4. MS_shell32_before.png
          MS_shell32_before.png
          8 kB
        5. MS_shell32_no_classes_before.log
          46 kB
        6. MS_shell32_with_classes_before.log
          42 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Oleg Dubinskij Oleg Dubinskiy
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: