Commit graph

105 commits

Author SHA1 Message Date
Katayama Hirofumi MZ 31ce37da2a
[SHELL32][SHELL32_APITEST][SDK] Implement GUIDFromStringA (#6734)
Implementing missing features...
JIRA issue: CORE-19278
- Add GUIDFromString testcase.
- Implement GUIDFromStringA function.
- Add NULL check to GUIDFromStringW.
- Add GUIDFromStringA prototype to "undocshell.h".
2024-04-12 21:29:07 +09:00
Katayama Hirofumi MZ d05dcf6a02
[SHELL32][SDK] Fix ParseDisplayName Part 1 (#6721)
JIRA issue: CORE-19495
- Implement SHParseDisplayName and
  CDesktopFolder::ParseDisplayName.
- Add CStubFolderBase, CShellUrlStub, CFileUrlStub,
  CIDListUrlStub, and CHttpUrlStub helper classes.
- Add SHGetSpecialFolderID and
  Shell_ParseSpecialFolder helper functions.
- Add BindCtx_ContainsObject,
  BindCtx_GetUIWindow, 
  BindCtx_RegisterObjectParam, SHBindToObject,
  SHBindToObjectEx, SHCoInitializeAnyApartment,
  SHGetAttributes, SHGetNameAndFlagsW,
  SHIsFileSysBindCtx, SHSkipJunctionBinding,
  Shell_DisplayNameOf, and Shell_FailForceReturn
  helper functions.
- Modify CSIDL data.
2024-04-10 09:32:13 +09:00
Katayama Hirofumi MZ 84f15b15fb
[SHELL32][SHELL32_APITEST] FindExecutable: Add PRF_FIRSTDIRDEF flag (#6681)
Follow-up to #6635. The directory search without this flag didn't work.
JIRA issue: CORE-19493
- Add PRF_FIRSTDIRDEF flag for PathResolveW call.
- Delete needless macro definitions in PathQualifyExW.
- Remove an assertion in IsLFNDriveW.
- Fix shell32_apitest:FindExecutable testcase.
2024-03-29 11:15:38 +09:00
Katayama Hirofumi MZ ede65b88bc
[SHELL32][SHLWAPI][SDK] Implement SHRestricted etc. (#6560)
shell32!SHRestricted is necessary to make shell working well.
JIRA issue: CORE-11515
- Add dll/win32/shell32/wine/PolicyData.h to define the shell policy data.
- Define POLICYDATA structure and SHELL_NO_POLICY constant
  in <shlwapi_undoc.h>.
- Fix shell32!SHRestricted, shell32!SHSettingsChanged,
  shlwapi!SHGetRestriction, and shlwapi!SHRestrictionLookup functions.
2024-03-11 08:29:04 +09:00
Oleg Dubinskiy eb96d377d1
[SHELL32] Allow custom shortcut overlay icon (#6419)
Use correct icon index in SIC_OverlayShortcutImage() to properly load
shortcut overlay icon from registry instead of always using default icon.
This allows to use custom shortcut icon set by user, in case it was
specified there.

As FIXME comment stated, the icon indexes were not implemented in the far
past, so this workaround was badly required. But now they are implemented,
so no need to always use default resource from shell32, enable the correct
code instead.

Also adapt this to CShellLink::CreateShortcutIcon() when the shortcut icon
is being changed in its properties dialog, as well as in CNewMenu class
when displaying menu items for creating a new folder or a shortcut.

Addendum to f9a5344254. CORE-14758
2024-03-04 16:30:43 +03:00
Hermès Bélusca-Maïto ea3e66d748
[SHELL32:WINE] Improve ROS-specific registry opening in SHRestricted() (#4275) 2024-02-29 13:29:10 +01:00
Hermès Bélusca-Maïto 9513d18f93
[SHELL32:WINE] Update the table of policy restrictions (#4275)
Our shell32's wine/shpolicy.c file, synced with Wine code (and which is
currently in master still up to date with Wine!), contains outdated or
incomplete definitions that date back from Windows 98/2000.

Update the restrictions with those from shell32 v6.0 of Windows Server 2003 SP2.

References:
https://www.geoffchappell.com/studies/windows/shell/shell32/api/util/restrictions.htm
https://docs.microsoft.com/en-us/windows/win32/api/shlobj_core/ne-shlobj_core-restrictions

"NoLogoff": http://systemmanager.ru/win2k_regestry.en/93519.htm
"StartMenuLogOff": http://systemmanager.ru/win2k_regestry.en/92884.htm
"GreyMSIAds": http://systemmanager.ru/win2k_regestry.en/93177.htm
2024-02-29 13:29:08 +01:00
Hermès Bélusca-Maïto ea8ce25944
[SHELL32:WINE] Add Wine-version info to the Wine's shell32_main header. 2024-02-29 13:27:33 +01:00
Hermès Bélusca-Maïto 52dd07febd
[SHELL32:WINE] Make the wine-imported files include shell32_main.h 2024-02-29 13:26:46 +01:00
Hermès Bélusca-Maïto 72b405549c
[SHELL32] SHAddToRecentDocs(): Just use SHRestricted() to get the NoRecentDocsHistory policy...
... instead of redoing the manual work.
2024-02-29 12:54:10 +01:00
Oleg Dubinskiy f9a5344254
[SHELL32] Allow using custom desktop/folders/drives icons (#6421)
Implement proper reading the current user's icons from registry.

CORE-14758

- Load the icons specified by user in registry in the following keys:
  "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}\DefaultIcon"
  (virtual namespace folders)
  "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Icons"
  (filesystem folders and drives)
- Implement two functions HCU/HLM_GetIconW for reading the icons
  from mentioned HKCU and HKLM keys accordingly.
- Use HCR_RegGetIconW for falling back to default icons.
  This function always loads only default icons, even when
  the custom ones are specified by user.
- Refactor SIC_LoadOverlayIcon to use newly implemented HLM_GetIconW.

These changes apply to:
- virtual namespace folders and other desktop items (like My Computer,
  My Documents, Network Places, Recycle Bin, Web Browser (aka Internet
  Explorer), Control Panel and some of its items);
- normal filesystem directories;
- all types of drives (fixed disk drives, removable drives, CD-ROMs,
  RamDisks and network drives). Handle invalid drives, setting blank
  icon for them, since they cannot be recognized or mounted correctly.
  Also, load the autorun icons first to avoid overriding them by the
  icons defined in registry.

I've rechecked twice: excluding Start Menu icons, Desktop Workspace icon
and some FS folder icons that have their own desktop.ini configuration
files (we probably should write the custom icons we load to these configs,
as Windows does it, perhaps with WritePrivateProfileStringW), all other
icons can be changed now (only ones that can be changed on XP SP3 / 2003
SP2) via built-in system tools (like Desktop icons in desk.cpl) or any
3rd-party tools without modifying system resources.

Also all icons for the known file types can be changed,
same as before my changes.

Regarding Start Menu icons:
- changing them should be correctly implemented in explorer
  instead of shell32, as the former is responsible for the Start Menu
  and partially for the taskbar;
- in order to actually use all of them, we need to implement modern
  Start Menu first.

Useful reference: http://www.winfaq.de/faq_html/Content/tip0000/onlinefaq.php?h=tip0162.htm
2024-02-29 00:20:47 +03:00
Katayama Hirofumi MZ 776c3a3495
[SHELL32] SHBrowseForFolder: Fix pszDisplayName (#6549)
pszDisplayName is for display name, not for full path.
JIRA issue: CORE-5866
- If lpBrowseInfo->pszDisplayName is valid,
  use SHGetFileInfoW to get display name.
- Don't use SHGetPathFromIDListW to get
  display name. It's wrong.
2024-02-28 13:23:27 +09:00
Oleg Dubinskiy 290221ef5b
[SHELL32] Sync HCR_RegGetIconW() function to Wine 9.1 (#6418)
Import the following fixes:
- Use the number of bytes instead of the number of characters in the length
  passed to RegQueryValueExW. Calculate this by multiplying the number of
  characters on the size of one wide character in bytes, since only length
  of characters is passed to the function. This fixes ERROR_MORE_DATA
  returned from RegQueryValueExW, because the passed number of bytes was
  less than the actual length of the output buffer, since it was calculated
  incorrectly, so the function failed even when it received the correct
  number of wide characters.
  This partially imports Wine commit:
  32584bb521.
- Limit the number of characters in registry icon index buffer from 7 to 5,
  as it done in ANSI version of this function, since registry index number
  can contain up to 4 digits + space for the null-terminator.

This fixes problems when loading custom (user-defined) icons from registry,
like icons defined by the current user or for all users, instead of just
default icons from the root classes.

CORE-14758

Co-authored-by: Zhiyi Zhang <zzhang@codeweavers.com>
2024-02-02 18:10:36 +03:00
Katayama Hirofumi MZ 4bccb6e6c9
[SHELL32][SDK][SHELL32_APITEST] Add PathIsTemporaryA/W (#6067)
- Implement PathIsTemporaryA and
  PathIsTemporaryW functions.
- Add them to <undocshell.h>.
- Add PathIsTemporary testcase.
CORE-19278
2023-12-02 23:07:28 +09:00
Katayama Hirofumi MZ 2aeda3dc15
[SHELL32][SHELL32_APITEST][SDK] Implement PathIsEqualOrSubFolder (#5714)
Implement PathIsEqualOrSubFolder function.
- Add it to <undocshell.h>.
- Add PathIsEqualOrSubFolder testcase.
- Add SHGetPathCchFromIDListW as an
  extension of SHGetPathFromIDListW.
CORE-19278
2023-11-29 22:50:01 +09:00
Katayama Hirofumi MZ 128e7f5aea
[SHELL32][SDK] Implement SHStartNetConnectionDialogA (#5847)
and add SHStartNetConnectionDialog prototype to <shlobj.h>.
2023-10-28 22:29:05 +09:00
Katayama Hirofumi MZ 2e9d03da90
[SHELL32][SDK] Implement SHLimitInputCombo (#5521)
SHLimitInputCombo function sets limits on valid characters for a combobox control.
This function works like SHLimitInputEdit, but the target is a combobox instead of a textbox.
CORE-9277
2023-08-04 22:29:05 +09:00
Thamatip Chitpong 32411dece0 [SHELL32] Fix taskbar large icon for control panel applets
Addendum to 0e8cf6f (#5465).
CORE-11698
2023-08-03 16:43:08 +07:00
Jose Carlos Jesus 39d5f1bf54
[SHELL32] Enable Network Connection Rename (#5073)
CORE-18750
- Add Network Connection pidl type 0x99;
- Add binary comparison to pidl memory range.
2023-04-30 15:40:10 +02:00
Katayama Hirofumi MZ 994732c4bb
[RUNDLL32][SHELL32] Rename 'rundll32_window' as 'RunDLL' (#5229)
Improve compatibility.
- Rename window class "rundll32_window" as "RunDLL".
- Delete some shell32 codes about this window class.
CORE-13895, CORE-18350
2023-04-08 15:20:07 +09:00
Katayama Hirofumi MZ 324cda0835
[SHELL32][SHELL32_APITEST] Improve CommandLineToArgvW (#5055)
This PR will reduce the failures of CommandLineToArgvW testcase of shell32_apitest.
- Use isspace and isblank in shell32!CommandLineToArgvW.
- Strengthen shell32_apitest:CommandLineToArgvW testcase.
CORE-17787
2023-02-14 20:53:48 +09:00
Jose Carlos Jesus 45c8e4dcd0
[NEWDEV][SHELL32][SYSSETUP] Improve browse driver folder dialog (#4293)
[NEWDEV] Enable OK button in "Browse For Folder" only when driver is found

Implement BrowseCallbackProc() function which sends BFFM_ENABLEOK message
to the browse dialog whether the driver is found in the selected folder.

Pass the search path to the browse dialog depending on the current index
of the drop down combobox. If the index is not set, just get window text.
Then, automatically expand the tree view to the specified path by sending
BFFM_SETSELECTION message.

Also fix a bug in SearchDriverRecursive() where a duplicate backslash
was added to the PathWithPattern string variable.

[SHELL32] Do not add Recycle Bin to the tree view items in FillTreeView()

[SYSSETUP] Add source path to the "Installation Sources" multi-string key

Each time the ProcessSetupInf() is being called, add the source path
to the "Installation Sources" registry key, if it's not added there yet.
The driver search path combobox will be then populated using its value.
2022-11-27 18:00:46 +03:00
Katayama Hirofumi MZ 11a71418d5
[SHELL32] Implement IsLFNDriveA/W and improve PathResolve (#4866)
- Fix IsLFNDriveA and IsLFNDriveW functions.
- Add IsRemovableDrive helper function.
- Fix PathQualifyExW by using IsLFNDriveW.
CORE-11335
2022-11-10 23:18:04 +09:00
Katayama Hirofumi MZ 140aa11c36
[SHELL32] shlexec: Initial support of App Paths (#4850)
- Fix SHELL_TryAppPathW helper function by using SHRegQueryValueExW function.
- Fix SHRegQueryValueExA/W functions.
CORE-11335
2022-11-08 09:23:06 +09:00
Katayama Hirofumi MZ 1a1a8a8303
[SHELL32][INCLUDE] Fix PathResolve for double-backslash (#4833)
Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>

Fix shell32!PathResolve and shell32!PathQualifyExW functions for double-backslash. However it doesn't fix CORE-15204.
CORE-18080, CORE-15204
2022-11-04 21:44:46 +09:00
Joachim Henze e6fb0e0c25
[SHELL32] Delete old unused implementation of OLD_SHAppBarMessage() (#4800)
SHAppBarMessage() was reimplemented at a different place by
0.4.14-dev-1209-g 10d1afea18
That was a reimport from Wine.
2022-10-22 21:48:11 +02:00
Mark Jansen 6a1f287820
[SHELL32] Show file / drive properties at the position where the mouse was.
CORE-18386
2022-10-14 21:02:33 +02:00
Raymond Czerny d74ceb6559
[SHELL32] Fix visual glitch appeared after fixing CORE-18137 (#4488)
- Check if the parent window of RunDLL is the desktop,
  only in this case add the system control applet to the taskbar.
- Try loading small 16x16 icon for the taskbar button.

CORE-18175
2022-05-09 21:36:23 +03:00
Raymond Czerny 1461ca403f
[SHELL32] Show system control applet in taskbar (#4437)
Display the control panel applet in the taskbar to allow better navigation between programs.
CORE-18137

This is proceeded by manipulating the window of the current instance of 'rundll32.exe':
- Set title text
- Set icon
- Show window (minimal)
- Engaging the corresponding button in the Taskbar.
2022-05-03 16:02:58 +02:00
Russell Johnson 3e2df36561
[SHELL32] Add multiple status bar parts to the file browser (#4401)
The file browser now has a status bar like Windows Server 2003 does.
This includes the sizes of the files, as well as the location.
In certain folders (Network, Desktop, etc.) the status bar is hidden.

Currently it does not handle this in the same way as Windows Shell does,
however it's a good first step to make it work properly.

CORE-17603

Signed-off-by: Russell Johnson <russell.johnson@superdark.net>
Reviewed-by: Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Reviewed-by: Mark Jansen <mark.jansen@reactos.org>
Reviewed-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>	
Reviewed-by: Giannis Adamopoulos <gadamopoulos@reactos.org>	
Reviewed-by: Stanislav Motylkov <x86corez@gmail.com>
2022-05-03 16:52:23 +03:00
Raymond Czerny 1b5abe8837
[SHELL32] Make Control Panel applets start in single instance (#4405) (#4405)
In MS Windows all control panel applets are started in single instance.
This prevents conflicts of concurrent accesses to the configuration data.

Before starting applets, look up the dialog window of the existing instance
by checking several atoms, such as the applet path, CPLName, and CPLFlags.
If the dialog is found, it's brought to the foreground, and a new applet
instance not started.

CORE-7921 CORE-17025

Signed-off-by: Raymond Czerny <chip@raymisoft.de>
Reviewed-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Reviewed-by: Joachim Henze <joachim.henze@reactos.org>
Reviewed-by: Mark Jansen <mark.jansen@reactos.org>
2022-04-07 15:58:13 +03:00
Katayama Hirofumi MZ 6cb1e57a63
[SHELL32] Support CSIDL_FLAG_NO_ALIAS (#4381)
Adding the CSIDL_FLAG_NO_ALIAS flag to SHGetSpecialFolderLocation should return the physical PIDL if possible.
CORE-18079
2022-03-06 15:25:45 +09:00
Hermès Bélusca-Maïto 1df87d7fe9
[SHELL32:WINE][PSDK] Addendum to 0bf768a1: Add missing FARPROC16 definition for CallCPLEntry16() prototype. 2022-01-11 23:31:26 +01:00
Hermès Bélusca-Maïto 0bf768a145
[SHELL32:WINE][PSDK] Fix the prototype of CallCPLEntry16(). 2022-01-11 23:03:25 +01:00
Hermès Bélusca-Maïto 83be315abf
[SHELL32] Use wide char string literals.
Import parts of Wine commit b215536852dc5a132108db92c90a41c70b738e50
shell32: Use wide char string literals.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-09 22:39:29 +01:00
Hermès Bélusca-Maïto a6bf77e7b9
[SDK:REACTOS] Move our ROS-specific header-only UI libraries into a "ui" sub-folder. (#4205) 2022-01-06 02:17:25 +01:00
Katayama Hirofumi MZ 561fa8d29b
[SHELL32] Implement PathResolveA function (#3771)
- Follow-up of #3762.
- Add PathResolveA implementation by ANSI/Unicode string conversion.
CORE-12665
2021-07-01 08:42:29 +09:00
Hermès Bélusca-Maïto 8ec3580123 [SHELL32] Add the handy WHICH_DEFAULT value to the list of flags in shlwapi_undoc.h.
- Add as well the undocumented 0x40 dwFlags value from shlwapi!PathFileExistsDefExtW()
  to the list.

- Fix a bug (also present in Win2k3) in PathResolveW() where, specifying
  the PRF_DONTFINDLNK flag, would also erroneously exclude checking for
  the .cmd extension as well (which was obviously NOT the original
  intention, from the name of the flag and the documentation as well:
  https://docs.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-pathresolve
  ).

Addendum to 3a822e4f.
2021-06-28 02:19:30 +02:00
Katayama Hirofumi MZ 3a822e4f74
[SHELL32] Implement PathResolveW function (#3762)
- Implement PathResolveW function.
- Implement PathQualifyA/W functions using newly-defined PathQualifyExW function.
CORE-12665
2021-06-28 07:53:26 +09:00
Catalin Gabriel Draghita 2636cff09f
[SHELL32] Show Product version on About dialog bmp (#3621)
The About dialog banner will now show the correspondent Product version selected on install.
This will make it easier to tell which edition of ReactOS is installed.
2021-05-08 15:54:32 +09:00
Katayama Hirofumi MZ b66bdef370
[SHELL32] Enable auto-completion on SHBrowseForFolder (#3535)
This PR realizes auto-completion on SHBrowseForFolder. CORE-9281

- Call SHAutoComplete in WM_INITDIALOG message handling.
- Fix focus.
- Remove ES_NOHIDESEL style.
- Fix layout initialization.
2021-03-15 16:30:32 +09:00
Katayama Hirofumi MZ 2d066c93fe
[SHELL32] Fix SHBrowseForFolder new UI layout (#3533)
CORE-17507

- Change layout of resource dialogs IDD_BROWSE_FOR_FOLDER_NEW.
- Delete IDC_BROWSE_FOR_FOLDER_FOLDER control.
- Fix focus.
- Add ES_NOHIDESEL style to IDC_BROWSE_FOR_FOLDER_FOLDER_TEXT control.
- Add TVS_SHOWSELALWAYS style to IDC_BROWSE_FOR_FOLDER_TREEVIEW control.
- Fix assertion failure in LayoutUpdate function in <layout.h>.
2021-03-15 07:13:03 +09:00
Katayama Hirofumi MZ e1a5ba188e
[SHELL32] SHBrowseForFolder with BIF_EDITBOX should use new UI (#3532)
CORE-17506

- Convert some judgements against BIF_NEWDIALOGSTYLE to judgements against BIF_USENEWUI. Here BIF_USENEWUI == (BIF_NEWDIALOGSTYLE | BIF_EDITBOX).
- Remove WS_SIZEBOX window style from new UI dialog resource (IDD_BROWSE_FOR_FOLDER_NEW).
- Fix header layout.h for resizing without WS_SIZEBOX.
2021-03-14 18:35:40 +09:00
Riley Bell 3014417919 [SHELL32] Hide "This version of ReactOS is registered to:" text on condition (#3325)
When the system is not installed yet (e.g. LiveCD or 2nd installation stage)
there is no registered user and organization, so no need to show this text
label in the shell about dialog.

Co-authored-by: Stanislav Motylkov <x86corez@gmail.com>
2020-11-30 03:12:32 +03:00
Hermès Bélusca-Maïto 3c722e35b1
[CMD][SERVMAN][SHELL32][WINSPOOL][ROSAPPS][NTOS:PNP] Fix my build. 2020-11-06 01:06:11 +01:00
Katayama Hirofumi MZ de8d156e2c
[SHELL32] Resizable for SHBrowseForFolder (#3299)
Make the dialog box of SHBrowseForFolder function resizable. CORE-17341
2020-10-21 22:25:16 +09:00
Kyle Katarn da36f799c7
[SHELL32] Minimal SHRunControlPanel implementation (#3095)
CORE-9215
Co-authored-by: Stanislav Motylkov <x86corez@gmail.com>
2020-09-19 16:23:44 +02:00
Hermès Bélusca-Maïto 14599b0a37
[SHELL32][SHLWAPI] Forward shell32.ShellMessageBoxW directly to shlwapi.ShellMessageBoxWrapW. (#3179)
This makes ShellMessageBoxW use the correct implementation where the
text buffer size is dynamic, instead of having a too small hardcoded
size.

Fixes CORE-17271.
See also PR #3172 by Kyle Katarn, supplemented with some ideas from
Mark Jansen.

However we cannot straightforwardly implement ShellMessageBoxA around
ShellMessageBoxW, by converting some parameters from ANSI to UNICODE,
because there may be some variadic ANSI strings, associated with '%s'
printf-like formatters inside the format string, that would also need
to be converted; however there is no way for us to find these and perform
the conversion ourselves.
Therefore, we re-implement ShellMessageBoxA by doing a copy-paste ANSI
adaptation of the shlwapi.ShellMessageBoxWrapW function.

Note that, on Vista+ onwards, shlwapi implements both ShellMessageBoxA/W,
and shell32 directly forwards these exports to shlwapi, thus avoiding
these workarounds.

[PSDK] Explicily use WINAPIV for the variadic ShellMessageBoxA/W functions.

[INCLUDE/REACTOS] Add ShellMessageBoxWrapW in shlwapi_undoc.h .
2020-09-13 22:44:58 +02:00
Katayama Hirofumi MZ 7c134e4d14
[SHELL32] Big fix for change notification (#3048)
- Reduced the failures of SHChangeNotify testcase.
- Simplified change notification mechanism.
- Realized PIDL aliasing.
CORE-13950
2020-09-03 13:36:31 +09:00
Katayama Hirofumi MZ ed445dd775
[SHELL32] Enable CopyTo/MoveTo textbox functionality (#3075)
- The user can enter the full path of a directory in "Copy To Folder" and "Move To Folder" features.
- Fix two bugs in SHBrowseForFolder function. One is disability of text box to enter a full path. Another one is disability to choose the root item in BFFM_SETSELECTION.
- Add ES_AUTOHSCROLL style to text box. This enables the user to enter a long text.
CORE-11132
2020-08-20 11:35:14 +09:00