Commit graph

86790 commits

Author SHA1 Message Date
Hermès Bélusca-Maïto
c306a27941
[MOUNTMGR] Fix the buffer returned by IOCTL_MOUNTMGR_QUERY_DOS_VOLUME_PATH (#6990)
The buffer returned by MountMgrQueryDosVolumePath()
should be a multi-string containing one single string.
2025-01-21 19:16:01 +01:00
Hermès Bélusca-Maïto
8bb7cd286b
[MOUNTMGR] Fix three more bugs in MountMgrQueryDosVolumePath() (#6990)
- When trying to find a device, don't fail with STATUS_NOT_FOUND if no
  associated symbolic links are present. Instead, that test was wrong,
  and should go out of the search loop to do the drive-letter processing.

  Addendum to commit f9f5a78715.

- In addition, when using the associated-device method, fix the list
  used to retrieve the corresponding device.

- In the TryWithVolumeName: block, reset DeviceString to NULL after
  freeing, so that we can correctly fail with STATUS_NOT_FOUND if no
  suitable device was found, before initializing the output data.
2025-01-21 19:16:01 +01:00
Hermès Bélusca-Maïto
28c3533d11
[MOUNTMGR] Simplify a bit the code in MountMgrQueryDosVolumePath(s) (#6990) 2025-01-21 19:16:00 +01:00
Hermès Bélusca-Maïto
e72a9a78b0
[MOUNTMGR] Fix some other bugs (#6990)
- Use FIELD_OFFSET to correct structure and member instead of hardcoding
  sizeof-s of fields until the member of interest.

- Fix a bug in MountMgrQueryDosVolumePath() where the FIELD_OFFSET used
  in the entry structure size validation was incorrect.

  FIELD_OFFSET(MOUNTMGR_TARGET_NAME, DeviceNameLength) is == 0 since
  DeviceNameLength is the first member of the MOUNTMGR_TARGET_NAME
  structure. The intended member was DeviceName.

  Addendum to commit f9f5a78715.
2025-01-21 19:15:59 +01:00
Hermès Bélusca-Maïto
be97a36f25
[MOUNTMGR] Simplify MountMgrQueryDosVolumePath() code (#6990)
- Use a variable of correct type instead of casting every time.
- Remove one level of indentation by returning early.
2025-01-21 19:15:59 +01:00
Hermès Bélusca-Maïto
bae799382a
[KMTESTS] Improve IoVolumeDeviceToDosName() tests (#6990)
- Limit the HarddiskVolume loop to 32 trials (instead of an unknown
  number of them). Ideally the list of volumes has to be queried from
  the volume manager, instead of hardcoding them (TODO).

- Verify that the buffer returned by IoVolumeDeviceToDosName() is
  indeed a unicode multi-string (ends with two NULs), and, in the
  case it specifies a volume GUID, that it's a valid one.
2025-01-21 19:15:58 +01:00
Hermès Bélusca-Maïto
cc1deb2902
[MOUNTMGR_APITEST] Add tests for mountmgr IOCTL_MOUNTMGR_QUERY_DOS_VOLUME_PATH(S) (#6990)
These tests verify the output of IOCTL_MOUNTMGR_QUERY_DOS_VOLUME_PATH,
IOCTL_MOUNTMGR_QUERY_DOS_VOLUME_PATHS and IOCTL_MOUNTMGR_QUERY_POINTS,
as well as their consistency.

References:
https://www.osronline.com/article.cfm%5Eid=107.htm
https://community.osr.com/t/obtaining-volume-name-with-deviceobject/15121/3
2025-01-21 19:15:57 +01:00
Hermès Bélusca-Maïto
bb264f6828
[MOUNTMGR_APITEST] Improve QueryPoints.c test (#6990)
- Use %lu instead of %lx for printf-ing last-errors;

- Don't call GetLastError() within ok, or after a previous invocation,
  when the aim is to retrieve the last-error set by a tested API.
  Instead, store its value in a local variable, that is then used in
  the ok() tests.

- Use win_skip() only for functionality that _may_ not be implemented
  in Windows/ReactOS yet, but not for unexpected situations leading to
  tests being skipped.

- Add comments; improve buffer size specifications.

- Reformat the file license header.
2025-01-21 19:15:57 +01:00
Hermès Bélusca-Maïto
2da5db933c
[MOUNTMGR_APITEST] Add utils.c for some utility functions (#6990)
And update the precompiled header.
2025-01-21 19:15:50 +01:00
Whindmar Saksit
357505e752
[PSDK] Avoid CO_E_NOTINITIALIZED macro redefinition warning (#7649)
Addendum to commit 0e88f0485c
2025-01-21 19:15:09 +01:00
Whindmar Saksit
c8b2c4c94d
[RAPPS] Check Let's Encrypt issuer prefix (#7650) 2025-01-21 13:06:55 +01:00
Doug Lyons
690643fc77
[SHELL32] SHELL_FindExecutable: Fix last regression from PR#7588 (#7643)
Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Co-authored-by: Stanislav Motylkov <x86corez@gmail.com>
2025-01-20 19:10:04 -06:00
Katayama Hirofumi MZ
853b8ebd02
[EXPLORER] Use STDMETHODIMP and override (#7645)
Follow the standard way.
JIRA issue: CORE-19469
- Use STDMETHODIMP and override keyword
  instead of virtual HRESULT STDMETHODCALLTYPE.
- Delete CTaskBand::ProcessMessage and
  CTaskBand::ContainsWindow methods.
  I think they are useless.
2025-01-21 10:03:52 +09:00
Katayama Hirofumi MZ
56988ffbf8
[EXPLORER] Support Unicode on Start Button InvokeCommand (#7644)
Support Unicode on Start Button
context menu for international text
support.
JIRA issue: N/A
- Support Unicode in
  CStartMenuBtnCtxMenu::InvokeCommand
  method by using
  CMINVOKECOMMANDINFOEX structure.
2025-01-20 22:26:33 +09:00
Katayama Hirofumi MZ
d4f283b67b
[FREETYPE][NTGDI] Use Face->num_faces instead of ttc_header.count (#7646)
Supporting raster fonts. Using
num_faces is the generic way.
JIRA issue: CORE-16165
- Use FT_FaceRec.num_faces instead
  of TT_Face.ttc_header.count in
  counting the font faces in
  IntGdiLoadFontsFromMemory function.
2025-01-20 22:09:16 +09:00
Daniel Victor
d72864de95 [FREELDR] Fix wrong segment register at lgdt instruction in amd64.S 2025-01-20 08:34:44 +02:00
Katayama Hirofumi MZ
2186ce3d58 [SHELL32][SDK] Follow-up of #7622; LPWSTR to PWSTR etc.
And LPCWSTR to PCWSTR. CORE-19278
2025-01-20 10:12:35 +09:00
Katayama Hirofumi MZ
84607161b4
[SHELL32][SHELL32_APITEST][SDK] Implement SHGetUnreadMailCountW (#7622)
Implementing missing features...
JIRA issue: CORE-19278
- Modify shell32.spec.
- Move function definition from stubs.cpp into utils.cpp.
- Add SHELL_ReadSingleUnreadMailCount helper function.
- Add prototype to <shellapi.h>.
2025-01-20 09:51:27 +09:00
Katayama Hirofumi MZ
157e18b215
[SHELL32][SHELL32_APITEST][SDK] Implement StrRStrA/W (#7621)
Implementing missing features...
JIRA issue: CORE-19278
- Move function definitions from stubs.cpp to utils.cpp.
- Add prototypes to <undocshell.h>.
2025-01-20 08:50:26 +09:00
Katayama Hirofumi MZ
aa52c3f5eb
[SHELL32][SHELL32_APITEST][SDK] Implement SHEnumerateUnreadMailAccountsW (#7619)
Implementing missing features...
JIRA issue: CORE-19278
- Move function definition from stubs.cpp into utils.cpp.
- Add prototype to <shellapi.h>.
2025-01-20 08:32:07 +09:00
Katayama Hirofumi MZ
0bb8b46ba8 [SHELL32] Follow-up of #7620: Simplify string handling
CORE-19278
2025-01-20 08:28:58 +09:00
Whindmar Saksit
b87c6b8799
[SHELL32] Temporarily disable LVS_EX_DOUBLEBUFFER in DefView (#7642)
Hackfix for CORE-19624 and CORE-19818 until ListView is fixed
2025-01-19 23:20:34 +01:00
Whindmar Saksit
aebaa14eba
[SHELL32] Allow DnD to create shortcuts across different drives (#7607)
CORE-17871 CORE-18271
2025-01-19 21:00:55 +01:00
Katayama Hirofumi MZ
17eff53f35
[REGEDIT] Add ES_AUTOHSCROLL to address bar window (#7638)
Enable horizontal scroll on address bar.
JIRA issue: CORE-19743
- Add ES_AUTOHSCROLL style to the
  address bar window on its creation.
2025-01-20 01:01:30 +09:00
Katayama Hirofumi MZ
2da2fba042
[SHELL32][SHELL32_APITEST][SDK] Implement SHSetUnreadMailCountW (#7620)
Implementing missing features...
JIRA issue: CORE-19278
- Move function definition from
  stubs.cpp into utils.cpp.
- Add prototype to <shellapi.h>.
2025-01-19 21:26:19 +09:00
Timo Kreuzer
dc25409cbf [SPEC2DEF] Implement support for debug-only exports 2025-01-19 09:02:58 +02:00
Timo Kreuzer
93ba586ec3 [NTDLL] Make _alloca_probe(_16) private
This avoids a linker error due to a duplicated symbol in ntdll and the statically linked chkstk library. This happens when the linker first resolves _chkstk from the CRT or the chkstk library (which also pulls in _alloca_probe(_16)) and then tries to resolve _alloca_probe(_16) from ntdll.
2025-01-19 09:02:58 +02:00
Timo Kreuzer
c2c4d853c2 [EXPLORER-OLD] Fix build when _DEBUG is defined 2025-01-19 09:02:58 +02:00
Timo Kreuzer
888540c2d3 [BROWSEUI] Check if ATL windows are valid, before destroying them
Prevents ATL assertion failure.
2025-01-19 09:02:58 +02:00
Timo Kreuzer
40b45515a4 [IERNONCE] Check m_RegKey before deleting a value from it
This fixes an assert, when _DEBUG is defined.
2025-01-19 09:02:58 +02:00
Timo Kreuzer
a6a07059c1 [CRT] crtdbg.h: Add missing inttrin.h include for __debugbreak() 2025-01-19 09:02:58 +02:00
Timo Kreuzer
8a63d7e898 [CMAKE] Build host-tools as release by default
This setting can be overwritten by defining the CMake variable HOST_BUILD_TYPE.
The target build type is passed to the host build as TARGET_BUILD_TYPE CMake variable.
This improves time to build cab+iso:
MSVC x86: 37s -> 28s
GCC x86: 32s -> 16s
2025-01-19 09:02:58 +02:00
Timo Kreuzer
7a15da2a8c [CMAKE] Fix definition of NDEBUG on MSVC release builds
Prevents redefinition warnings.
2025-01-19 09:02:58 +02:00
Oleg Dubinskiy
c7d1aa3e92
[SHELL32] SHELL_FindExecutable: improve path handling code (#7633)
Follow-up of 42d5dfd3de.
- Revert "shell32: Fix ShellExecute for non-filespec paths." 0bad544aab.
- Apply "shell32: Look for the file name without extension also for the path search case." 38b6640be9.
- Clear leading/trailing whitespaces (an improvement by Doug Lyons).
- Update the comment for xlpFile buffer definition, to match the current code behaviour.
This fixes some failures for the following tests:
- shell32_apitest:ShellExecCmdLine: 12 failures less,
- shell32_apitest:ShellExecuteEx: 5 failures less,
- shell32_winetest:shlexec: crash fixed, now 13 failures as before,
- wshom_winetest:wshom: crash fixed, now 2 failures less too (0 failures).
I've also tested: the problem which was intended to be fixed by the guilty commit (CORE-19953) still remains fixed after this change.
CORE-19964
2025-01-18 21:51:58 +01:00
Timo Kreuzer
fe7a58d92e [RTL] Update CountOfOwnedCriticalSections in the TEB
Useful for debugging.
Motivation: With SMP on x64 I found a number of instances where critical sections would be left abandoned, causing lockups. From what I can tell it was exceptions inside rpcrt4, which leave the process in a blocked state. Might or might not be related to x64 / SMP.

For real value, you still need to put checks at certain places manually, but this is not super straight forward, because there can be false positives, e.g. when a process is terminated due to an exception, where the abandoned lock is acceptable, and we have this during testing. It's difficult to 100% distinguish this from silent and very bad lock leaks.

Problematic code:

    __try
    {
        SomeFunction(); // throws an exception with a CS held, e.g. heap code
    }
    __except(1)
    {
        DPRINT1("Oops. let's just pretend it's all ok!\n");
    }
2025-01-18 21:15:17 +02:00
Esme Povirk
848ad61bba
[SHLWAPI][WINESYNC] Import PathRemoveBlanks wine fix + adaptation for ReactOS (#7636)
kernelbase: Always remove trailing spaces in PathRemoveBlanks.

Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 404cd8a92bd99332a7ef8ec96edbf5aeea8cab76 by Esme Povirk <esme@codeweavers.com>

Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
2025-01-18 16:39:37 +01:00
Jacek Caban
f189d8c454
[SHLWAPI][WINESYNC] Import PathUndecorate wine fix + adaptation for ReactOS (#7636)
shlwapi: Fix PathUndecorate[AW] implementation.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id f3c1d663a4a4a99b5c07000cb0ad9cc55d1e1c88 by Jacek Caban <jacek@codeweavers.com>

Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
2025-01-18 16:39:36 +01:00
Katayama Hirofumi MZ
9d1c0efb1f
[BROWSEUI_APITEST] Don't hardcode C:\Windows (#7634)
Avoid hardcoding and fix tests.
JIRA issue: CORE-13235
- Remove hardcoded "C:\\Windows\\system32",
  using GetSystemDirectoryW call in
  SHExplorerParseCmdLine testcase.
2025-01-18 22:58:05 +09:00
Katayama Hirofumi MZ
82b7d4f3da
[FREETYPE][NTGDI] Fix ftGdiGetTextMetricsW return for raster fonts (#7635)
Try to get ready to support raster fonts.
JIRA issue: CORE-17327
- Fix the return value of
  ftGdiGetTextMetricsW function
  for raster fonts.
2025-01-18 22:33:00 +09:00
Katayama Hirofumi MZ
dad3a0938a
[SHELL32][SHELL32_APITEST][SDK] Implement ShellExec_RunDLL (#7615)
Implementing missing features...
JIRA issue: CORE-19278
- Modify shell32.spec.
- Move function definitions
  from stubs.cpp into shlexec.cpp.
- Add prototypes to <undocshell.h>.
2025-01-17 22:51:18 +09:00
Timo Kreuzer
a25e7ee9d7 [WKSSVC] Stubplement support for level 1101 in NetrWkstaUserGetInfo
Fixes crash in netapi32_winetest:wksta introduced in 45b008d
2025-01-17 12:54:29 +02:00
Timo Kreuzer
132d571fe2 [WKSSVC] Plug memory leaks in NetrWkstaUserGetInfo 2025-01-17 12:54:29 +02:00
Timo Kreuzer
1c1c4e5d94 [WKSSVC] Fix returned error value in NetrWkstaUserGetInfo 2025-01-17 12:54:29 +02:00
Timo Kreuzer
2e7f8711e9 [WKSSVC] Improve formatting 2025-01-17 12:54:29 +02:00
Katayama Hirofumi MZ
b68104a8a0
[SHELL32][SHELL32_APITEST][SDK] Implement SHShouldShowWizards (#7614)
Implementing missing features...
JIRA issue: CORE-19278
- Move function definition from
  stubs.cpp into utils.cpp.
- Add prototype to <undocshell.h>.
2025-01-17 13:36:20 +09:00
Doug Lyons
b1257cefe1
[NTGDI] Silence some debug log spam from GreGetObjectOwner when input parameter is NULL. (#7606)
CORE-19962
Co-authored-by: Timo Kreuzer <timo.kreuzer@reactos.org>
2025-01-16 19:11:19 -06:00
Katayama Hirofumi MZ
fcbcaa10a7
[SHELL32][SHELL32_APITEST][SDK] Implement SHGetUserDisplayName (#7612)
Implemementing missing features...
JIRA issue: CORE-19278
- Add netapi32 and secur32 delay importing.
- Move function definition from stubs.cpp into utils.cpp.
- Include some security headers in utils.cpp.
- Adapt <secext.h> to C++.
- Add prototype to <undocshell.h>.
2025-01-17 09:33:52 +09:00
Serge Gautherie
ee5ff8ce0c
[SDK:REACTOS] acpi.h: Update FACS and FADT types to ACPI v6.4 (#6042)
- FACS: Reduce size by 1 char.
- FADT: Add 3 new fields.
- Update reserved fields. Use offsets.
- Improve documentation.

Addendum to 0331781 (r46610).
2025-01-16 10:55:39 -08:00
Vitaly Orekhov
abe20f6120
[PSDK] Add definitions of desired Native Wi-Fi data access permissions (#7626)
The `WLAN_READ_ACCESS`, `WLAN_WRITE_ACCESS` and `WLAN_EXECUTE_ACCESS` flags are for controlling
whether we can (or not) return data via Wlan[Get|Query]* or modify via WlanSet* function families.

https://learn.microsoft.com/en-us/windows/win32/nativewifi/native-wifi-api-permissions
2025-01-16 18:25:57 +01:00
Marcin Jabłoński
e3e520d154
[TELNET] Fix Unicode character printing (#7597)
CORE-18304

The included Telnet client does not support displaying messages with Unicode characters in them.
This is a problem, because even though localisation for the program was made for ReactOS,
it doesn't work properly.

- Make the `printm` function load and format messages using wide character APIs instead of the narrow ones.
- Add format specifiers to the resource files (this is necessary, as there are a lot of places, where narrow strings
  are used in the program, and passed as parameters to `printm`).
2025-01-16 18:24:04 +01:00