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

Implement compatibility tab in explorer

    XMLWordPrintable

Details

    • New Feature
    • Resolution: Fixed
    • Major
    • 0.4.6
    • Other
    • None

    Description

      Current status:
      The tab is implemented (but disabled, since it does not actually have any effect if a property is applied).
      The only thing that is missing is the functionality that allows a user to apply any of the implemented shims (at the 'Edit compatibility modes...' button).

      A windows-like 'compatibility' tab should be implemented.

      In newer windows versions this is implemented as shell extension (acppage.dll).

      This uses the functions SetPermLayerState, SdbGetPermLayerKeys.

      apphelp.dll	SdbpGetPermLayersInternal + 0x109
      apphelp.dll	SdbGetPermLayerKeys + 0x1b5
      acppage.dll	GetLayerInfo + 0x78
      acppage.dll	CLayerUIPropPage::OnRefresh + 0x7f

      apphelp.dll	SdbpGetPermLayersInternal + 0x172
      apphelp.dll	SdbGetPermLayerKeys + 0x1b5
      apphelp.dll	SdbpSetPermLayerState + 0xce
      apphelp.dll	SetPermLayerState + 0x1a
      acppage.dll	UpdateLayerKey + 0xbb
      acppage.dll	SetLayerInfo + 0x41
      acppage.dll	CLayerUIPropPage::OnApply + 0xe3

      Current status: Most of the UI logic is implemented, currently it's blocked by the lack of documentation for SetPermLayerState and SdbGetPermLayerKeys.

      C:/Windows/diagnostics/system/PCW/ has some interesting scripts.
      Some snippets:

      const int MAX_PATH = 260;
       
      [DllImport("acppage.dll", EntryPoint = "GetExeFromLnk", CharSet = CharSet.Unicode)]
      [return:MarshalAs(UnmanagedType.Bool)]
      public static extern bool GetExeFromLnk(String pszLnk, StringBuilder pszExe, int cchSize);
       
       
      $CompatibilityModes.Add("Version_WINVISTA", "VISTARTM")
      $CompatibilityModes.Add("Version_WINVISTA1", "VISTASP1")
      $CompatibilityModes.Add("Version_WINVISTA2", "VISTASP2")
      $CompatibilityModes.Add("Version_WIN2003", "WINSRV03SP1")
      $CompatibilityModes.Add("Version_WIN2008SP1", "WINSRV08SP1")
      $CompatibilityModes.Add("Version_WINXP", "WINXPSP2")
      $CompatibilityModes.Add("Version_WINXP3", "WINXPSP3")
      $CompatibilityModes.Add("Version_WIN2000", "WIN2000")
      $CompatibilityModes.Add("Version_WINNT4", "NT4SP5")
      $CompatibilityModes.Add("Version_WIN98", "WIN98")
      $CompatibilityModes.Add("Version_WIN95", "WIN95")
      $CompatibilityModes.Add("Version_MSIAUTO", "MSIAUTO")
      $CompatibilityModes.Add("Version_UNKNOWN", "WINXPSP2")
      $CompatibilityModes.Add("Display_256COLOR", "256COLOR")
      $CompatibilityModes.Add("Display_640x480", "640X480")
      $CompatibilityModes.Add("Display_DISABLEDWM", "DISABLEDWM")
      $CompatibilityModes.Add("Display_HIGHDPIAWARE", "HIGHDPIAWARE")
      $CompatibilityModes.Add("Display_DISABLETHEMES", "DISABLETHEMES")
      $CompatibilityModes.Add("Access_RUNASADMIN", "RUNASADMIN")
       
       
      const int GPLK_USER = 0x00000001;
      const int MAX_LAYER_LENGTH = 256;
      const uint LAYER_APPLY_TO_SYSTEM_EXES = 0x00000001;
       
      [DllImport("apphelp.dll", EntryPoint = "SetPermLayerState", CharSet = CharSet.Unicode)]
      [return:MarshalAs(UnmanagedType.Bool)]
      public static extern bool SetPermLayerState(String wszPath, String wszLayer, uint dwFlags, bool bMachine, bool bEnable);
       
       
      [DllImport("apphelp.dll", EntryPoint = "SdbGetPermLayerKeys", CharSet = CharSet.Unicode)]
      [return:MarshalAs(UnmanagedType.Bool)]
      public static extern bool SdbGetPermLayerKeys(String pwszPath, StringBuilder pwszLayers, out uint pdwBytes, uint dwFlags);
       
      [DllImport("apphelp.dll", EntryPoint = "SdbSetPermLayerKeys", CharSet = CharSet.Unicode)]
      [return:MarshalAs(UnmanagedType.Bool)]
      public static extern bool SdbSetPermLayerKeys(String wszPath, String wszLayers, bool bMachine);

      Attachments

        Issue Links

          Activity

            People

              learn_more Mark Jansen
              learn_more Mark Jansen
              Votes:
              4 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: