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

Support STRICT_TYPED_ITEMIDS

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • Major
    • None
    • Shell

    Description

      PSDK headers support strict typing that distinguishes between the different pidl pointer types:

      • ITEMIDLIST_RELATIVE / PIDLIST_RELATIVE
      • ITEMID_CHILD / PITEMID_CHILD
      • ITEMIDLIST_ABSOLUTE / PIDLIST_ABSOLUTE

      Our code base needs to be updated in steps to use these types before we can switch to their strictly-typed versions.

      This is marked starter-project because it's easy to fix this in small parts. Here's how:

      • Find an instance of ITEMIDLIST in one of the .h/.idl files in sdk/include/psdk, e.g. shobjidl.idl
      • Determine which method of which interface you're looking at (e.g. IShellView2::HandleRename)
      • Look up the method on MSDN or in Microsoft's headers and determine the proper parameter type
      • git grep for instances of this method (if it's named something like Next or Initialize you may need to write a regular expression that only finds the particular method you're looking for; or simply pick a different one) and replace the parameters

      Example:

      interface IShellView2 : IShellView
      {
      [...]
          HRESULT HandleRename(
              [in] LPCITEMIDLIST new_pidl
          );
      [...]
      }
      

      IShellView2::HandleRename at MSDN: https://docs.microsoft.com/gl-es/windows/win32/api/shobjidl_core/nf-shobjidl_core-ishellview2-handlerename
      HandleRename grep: https://git.reactos.org/?p=reactos.git&a=search&h=HEAD&st=grep&s=HandleRename
      Replacement: LPCITEMIDLIST -> PCUITEMID_CHILD

      OR (more advanced):

      • git grep for ITEMIDLIST, either globally or limited to a particular module or subtree
      • Determine the correct type for the parameter or variable you found, by looking at assignments to it or interpreting it contextually
      • Make the replacement, ensuring that users of the variable or callers of the function use matching types. It may make sense to do all the replacements throughout a whole module at the same time

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ThFabba ThFabba
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: