[SHELL32] Fix FS folder assoc array class order (#6047)
authorWhindmar Saksit <whindsaks@proton.me>
Sun, 24 Mar 2024 20:37:59 +0000 (21:37 +0100)
committerGitHub <noreply@github.com>
Sun, 24 Mar 2024 20:37:59 +0000 (21:37 +0100)
commita83e40f6d1ca16b8a7edceebe64580eb223a51d0
tree6202672b08d9e1941c1649ffec5bafcace5172b9
parentf6cf6954eb8916a4cc6853286a27409e07a2abff
[SHELL32] Fix FS folder assoc array class order (#6047)

Fixes the reg class key order for FS items. The existing code was close,
but for some reason used `//` as the path separator for SystemFileAssociations!

- Fixed SystemFileAssociations.

- Swapped the order of `*` and `AllFilesystemObjects`. This is the documented
  order and can also be observed in Process Monitor.
  https://learn.microsoft.com/en-us/windows/win32/shell/fa-associationarray#about-association-arrays

- Removed `(..., L"%s//%s", extension, wszClass)`, this does not seem to be
  a valid thing (`.TestAAExtWeird` in my tests).

- Adds the `Unknown` class when appropriate. Not adding the `openas` verb
  to `Unknown` rgs registration now to mimic Windows, because ROS
  `CDefaultContextMenu` lacks verb de-duplication and the menu would end up
  with two "Open With" entries. This just uses `(cidl == 1)` to simulate
  Windows, while Windows on NT6 uses `MultiSelectModel=Single`, a NT6 feature
  not implemented in ROS.

- The class order for folders was wrong and is still "wrong" in this PR,
  but I chose to use the Windows menu display order until the exact mechanics
  required in `CDefaultContextMenu` can be understood.

- Extracts the extension from ANSI PIDLs.
dll/win32/shell32/folders/CDesktopFolder.cpp
dll/win32/shell32/folders/CFSFolder.cpp
dll/win32/shell32/shfldr.h
dll/win32/shell32/shlfolder.cpp