Commit graph

1759 commits

Author SHA1 Message Date
Serge Gautherie db416e3914 [REACTOS] InitImageList(): Fix error checks
And simplify code a bit.
2021-04-24 20:35:48 +02:00
Eric Kohl 0f27609813 [UMPNPMGR] Fix DPRINT in PNP_GetDeviceStatus() 2021-04-24 17:06:08 +02:00
Eric Kohl b24f463a33 [UMPNPMGR] Start the device in SetupDeviceInstance 2021-04-24 17:04:11 +02:00
Eric Kohl d5b20cb118 [UMPNPMGR] Implement PNP_SetDeviceProblem
CORE-17527
2021-04-24 11:59:22 +02:00
George Bișoc c0c431b0ee
[TRANSLATION][WINLOGON] Small Romanian & Italian translation update
Small translation update as per the pushed 5f03339 commit.
2021-04-22 18:12:22 +02:00
Hervé Poussineau 1ff3d1c395 [DHCPCSVC] Change automatic address assignment to use hardware address
According to RFC 3927, the pseudo-random number generation algorithm MUST be chosen
so that different hosts do not generate the same sequence of numbers, and that the
pseudo-random number generator SHOULD be seeded using a value derived from the
IEEE 802 MAC address, so that a host will usually select the same IPv4 Link-Local
address each time it is booted.
2021-04-20 18:28:36 +02:00
Serge Gautherie 0dedb9b474
[WINLOGON][MPR][SDK] WNetClearConnections: Fix function parameter type (#3480)
Addendum to 62f79fae93.

Signed-off-by: Serge Gautherie <reactos-git_serge_171003@gautherie.fr>
2021-04-18 21:58:44 +03:00
Arnav Bhatt 5f03339239
[WINLOGON] Show "Restarting..." message when restarting (#3593)
Signed-off-by: Arnav Bhatt <arnavbhatt288@gmail.com>
2021-04-18 21:48:30 +03:00
George Bișoc 0e3fce082e
[TRANSLATION][RAPPS] Fix the unrecognised escape sequence in the Hungarian translation
This is an addendum to ea04edc. The author has forgotten the newline escape sequence, whoops...
2021-04-15 17:23:25 +02:00
Tibor Lajos Füzi ea04edce2d [TRANSLATION] Add/update Hungarian translation for solitaire, spider solitaire, rapps, usetup, cpl/timedate, shell32, user32 2021-04-14 16:16:24 +02:00
Chan Chilung 6b700c6af1
[TRANSLATION] Chinese Traditional (zh-TW) translation update (#3526)
*Add Chinese Traditional translation for:
- [THEMES]
- [HIVESFT]
- [HIVEDEF]
- [HIVECLS]
- [SCREENSAVERS]
- [VGAFONTEDIT]
- [KERNEL32]
- [TASKLIST]
- [MYDOCS]
- [MSXML3R]
- INFs

*Chinese Traditional translation update for:
PR 3399
- [MSGINA]
- [SHELL32]

PR 3422
- [SOLITAIRE]

Others...

*Wine translation sync
2021-04-11 10:59:19 +02:00
Jose Carlos Jesus 415e93ae13
[CHKDSK][USERINIT] Add and improve Portuguese (pt-PT) translation (#3553) 2021-04-11 10:40:58 +03:00
Serge Gautherie d3fc345730 [CMD] de-DE: Fix 'Paramater' typo 2021-04-11 09:30:28 +03:00
Serge Gautherie 0236666968 [UMANDLG] DlgProc(): Fix 'paramater' typo, in documentation 2021-04-11 09:30:28 +03:00
George Bișoc aea948a79e [OSK] Handle the warning dialog box in its own thread
The dialog box at the startup of On-Screen Keyboard is displayed alongside with main window. While the Microsoft's OSK in XP is written in MFC and OSK is actually a mere window whereas our OSK is a dialog, the main dialog procedure call is superseded until the user does something with the warning dialog box on startup.

Just create a thread for it and handle the dialog box on startup in its own thread.
2021-04-10 10:05:08 +02:00
Victor Perevertkin 74ec94e12c [CMAKE] Some options are only supported by GCC, don't use them for clang
These are (so far):
-Wno-format-overflow
-Wno-nonnull-compare
-Wno-old-style-declaration
-Wno-unused-but-set-variable
2021-04-09 03:58:19 +03:00
George Bișoc 3ee9535e05
[USETUP] Display some contents in the page whilst installing the bootloader (#3559)
CORE-17523
2021-04-07 10:11:07 +02:00
Serge Gautherie 28dadda8be [CMAKE] Properly generate all Bison and Flex files at build time
This fully reverts 09c4d0a.

Addendum to 5375e33.
CORE-15991
2021-04-03 21:50:08 +03:00
Mark Jansen 97a23a5f3d
[SERVICES] Fix booting with DPH enabled
RegSetValueExW tries to read one extra character after the buffer,
to see if a REG_SZ is null terminated
2021-04-03 01:54:57 +02:00
Mark Jansen 5028c3adec
[UMPNPMGR] Fix remaining length calculation 2021-04-03 01:43:48 +02:00
Katayama Hirofumi MZ bebdfda8b7
[NOTEPAD][WORDPAD][MSPAINT]... Use newer file open dialog (#3571)
Use new-style file open/save-as dialog.
- Add OFN_EXPLORER flag to OPENFILENAME structure in notepad, wordpad, mspaint, clipbrd, mmc, mplay32, mscutils, regedit, winhlp32, progman, shellbtrfs, cryptui, shell32, setupapi, vgafontedit, infinst, and vfdlib modules.
2021-04-01 22:50:32 +09:00
Serge Gautherie 4cd92f0d01
[SYSSETUP][TIMEDATE] Use exact setTimer() timeouts, to stay in sync (#3355)
CORE-13121
2021-03-21 12:01:22 +09:00
Victor Perevertkin 16173c0798
[UMPNPMGR] Fix GCC build
Addendum to 420c4a7abf
2021-03-19 09:14:05 +03:00
Victor Perevertkin 420c4a7abf
[UMPNPMGR] Install drivers for all devices available on boot
Don't wait for their events to appear, just retrieve the list and
install drivers. This fixes the installation of manually reported device
nodes

CORE-17212 CORE-17398
2021-03-19 08:59:42 +03:00
Victor Perevertkin abbc5ba45a
[UMPNPMGR][USETUP] Use PlugPlayControlStartDevice in usetup and umpnpmgr
Instead of PlugPlayControlResetDevice, PlugPlayControlStartDevice should
be used for a newly installed device.
For usetup, add a device status check before starting attempt, so we're
not touching devices which are already started.

CORE-17463 CORE-17490
2021-03-16 03:17:58 +03:00
Victor Perevertkin 029accdcf7
[NDK] Change the data structure for PlugPlayControlResetDevice control class
PlugPlayControlResetDevice shares the input structure with several other
control classes.
Source: ProcessHacker sources e9c8121f41/ntpnpapi.h
2021-03-16 03:17:42 +03:00
Katayama Hirofumi MZ 9259ded8ae
[ATL][SHELL32][EXPLORER] Disable ATLASSERT (#3527)
We are not ready for enabling ATLASSERT. Enabling ATL assertions takes time to realize. CORE-17505
- Disable ATLASSERT by undefining _DEBUG.
- Revert currently non-fixable codes.
2021-03-11 20:26:45 +09:00
Mark Jansen 1952e5b795
Fix some assertions now that they are enabled (#3524)
Fix some assertions, hack out some others (they need more ATL work).
CORE-17505
2021-03-11 07:43:06 +09:00
Katayama Hirofumi MZ 98203cea23
[CMAKE] Define _DEBUG for better ATL debugging (Retry) (#3519)
CORE-17505
2021-03-10 22:59:13 +09:00
Chan Chilung 6a31fe6ca7
[TRANSLATION][INF] Update Chinese Traditional (zh-TW) translation (#3468)
- Add / improve Chinese Traditional Translations for INFs.

- Name changing (removed Aobi in my name)

Add Chinese Traditional translation for:
- cmdutils/at
- cmdutils/comp
- hotplug.cpl
- rosapps' sysutils/ctm

Chinese Traditional (zh-TW) translation update for:
- cmdutils/find
- cmdutils/help
- cmdutils/label
- cmdutils/whoami
- mspaint
- shutdown
- taskmgr
- diskpart
- format
- appwiz.cpl
- input.cpl
- powercfg.cpl
- shimgvw
- user32
2021-03-09 16:51:37 +01:00
Victor Perevertkin fc2b105e5d
[CMAKE] Use remove_target_compile_option when disabling manually enabled warnings 2021-03-03 06:04:25 +03:00
Piotr Hetnarowicz fa0c63bc48
[SOLITAIRE] Update Polish [pl-PL] translation (#3496) 2021-03-02 19:10:26 +01:00
Tibor Lajos Füzi 9dff498b21
[SOLITAIRE] Add undo feature & fix occasionally invisible cards (#3422)
Two issues are addressed:

CORE-2189: missing undo feature

Works the same way as solitaire in windows xp:
- only 1 action can be undone;
- the player gets -2 points in standard score mode;
- the undo action resets when the player clicks on a row stack to turn the top card.

CORE-11148: invisible cards

This happens in 3-card mode, when only 1 card left in the deck. The fix for this is to modify the pile stack to contain all the face-up cards. It was actually already in the code somewhere else, so I turned it into a separate function.
2021-02-28 22:31:19 +01:00
Eric Kohl 95188553ba [WKSSVC] Get version info and authentication package on startup 2021-02-27 19:07:47 +01:00
He Yang 633ece9025
[TASKLIST] Implement tasklist command-line utility (#3440)
Add command-line program "tasklist" for ReactOS.
It works fine on Windows as well.
2021-02-24 19:05:15 +09:00
George Bișoc 950f78635a
[USETUP] Display the "check the FS" section as a MUI page (#3474) 2021-02-22 16:48:03 +01:00
George Bișoc b00ecdcab9
Replace my E-mail with the ReactOS org one (#3475)
From now on for ReactOS related contributions only the organization e-mail shall be used and also reverse the order of my real full name.
2021-02-22 18:26:55 +03:00
Hervé Poussineau 796a536a22 Revert "Disable some C++ code, which doesn't compile for me"
This reverts commit 83d9920cb9.
2021-02-16 00:13:18 +01:00
Hervé Poussineau 83d9920cb9 Disable some C++ code, which doesn't compile for me 2021-02-16 00:12:25 +01:00
Eric Kohl 87a4624e20 [WKSSVC][NETAPI32] Implement NetrWkstaGetInfo and get rid of the old NetWkstaGetInfo implementation 2021-02-13 23:19:29 +01:00
Robert Naumann b774ec5ca6 [NOTEPAD] Implement File->New Window
*Windows starts a new own's instance too, when clicking on "New Window" (Tested by @HBelusca)
2021-02-12 20:14:03 +01:00
Piotr Hetnarowicz 61f4b120fc
rapps pl-PL lang update (#3454)
rapps pl-PL lang update
2021-02-12 19:42:52 +09:00
Aobi Chan CL 3692b5ff25
[TRANSLATION] Chinese Traditional (zh-TW) translation improvement (#3430)
- CACLS, FONTSUB, NOTEPAD, SOLITAIRE, VCDCONTROLTOOL, WORDPAD: Update Chinese Traditional translation.
- CALC, PING, SYSTEMINFO Add Chinese Traditional translation.
- PING, SYSTEMINFO: Update zh-TW.rc to make it less Windows like (maybe).
- WRITE, WINFILE: Translation sync to Wine.

+ Update media/doc/For_Chinese_Translation.txt
2021-02-07 22:14:19 +01:00
Eric Kohl 560b66a2d5 [NET] Remove the NAME, PRINT and SEND options because we will most likely never have a messenger service 2021-02-07 13:45:25 +01:00
Serge Gautherie 32f7474f38
[SETUPLIB] Fix 'unlock' copypasta in debug print (#3448)
Addendum to 76ac898.
2021-02-05 16:10:15 +03:00
Jérôme Gardou 76ac898bc5 [SETUPLIB] Lock the volume before writing MBR boot code 2021-02-03 09:41:22 +01:00
Hermès Bélusca-Maïto 3405cab9dd
[USETUP] Only check whether the system partition is of recognized type and if not, install FreeLdr on floppy/removable media. 2021-02-01 01:48:15 +01:00
Hermès Bélusca-Maïto 74c0a37e2f
[SETUPLIB][REACTOS][USETUP] Move partition types information to its dedicated file; update MBR partition types and add GPT GUID partition types. 2021-02-01 01:48:14 +01:00
Hermès Bélusca-Maïto 8f61f5c004
[USETUP] Add partition and disk description helpers to get standardized description strings. Replace and simplify USETUP code. 2021-02-01 01:48:10 +01:00
Victor Perevertkin 6f389a35db
[SETUPLIB] Add a workaround for installing from USB drives 2021-01-27 05:15:15 +03:00
Reinhart Previano Koentjoro 9c8ed68544
[CMD] Improve Indonesian (id-ID) translation (#3417) 2021-01-12 13:14:08 +03:00
Stanislav Motylkov f77f5a30cf
[RAPPS] Fix pinned certificate issuer check 2021-01-11 19:16:16 +03:00
Mas Ahmad Muhammad 4ca7926093
[TRANSLATION] Fix format for Indonesian translation (#3418)
- USETUP: Fix alignment on translation.
- SHELL32: Update and fix translation.
2021-01-07 18:47:10 +01:00
Joachim Henze ab45955a5a [CMD] Consume only one line for the version header CORE-17420
Necessary because our version string got longer during 0.4.15-dev'ing.
We added the target platform.
2021-01-06 01:34:54 +01:00
Hermès Bélusca-Maïto 68182b2a52
[USETUP] Partial revert of 8b94515b for the ESCAPE key in the UpgradeRepairPage() screen.
The AsciiChar of the ESCAPE key should be 0x1B instead of zero; however
this is not the case due to the hacked keyboard layout currently being
used. This will be fixed later ...
2021-01-04 16:13:28 +01:00
Victor Perevertkin e12233daf6
[USETUP] Do not put ImagePath to the service registry entry
It is supposed to be there already
2021-01-04 16:50:33 +03:00
Hermès Bélusca-Maïto 0abff65a55
[USETUP] Minor improvements when initializing the console.
- Use NT values for uninitialized handle values.
- Cache the STD_INPUT_HANDLE.
- Free the console if GetConsoleScreenBufferInfo() fails in CONSOLE_Init().
2021-01-03 00:27:54 +01:00
Hermès Bélusca-Maïto 8b94515bd3
[USETUP] Fix handling of the ESCAPE key.
Its AsciiChar is not zero in Console-compatible code.
2021-01-03 00:27:50 +01:00
George Bișoc c11d342f42
[OSK] Adjust the resource size, width and heigh properties of buttons (#3403)
For French (fr-FR) and French Canadian (fr-CA) translations.

CORE-17039
2020-12-31 01:48:34 +03:00
Tibor Lajos Füzi 82f0061ddc
[TRANSLATION] Hungarian (hu-HU) translation update (#3388)
For mspaint, notepad, wordpad, cmd, cmdutils/help, appwiz, devmgr, newdev

Co-authored-by: Stanislav Motylkov <x86corez@gmail.com>
2020-12-31 01:42:34 +03:00
Stanislav Motylkov 740beb65e6
[DXDIAG] If ProcessorNameString not found, fall back to Identifier
It also should have its own routine for detecting CPU name, add a comment.
Windows XP and 2003 does have CPU name strings in dxdiagn.dll.

CORE-17413
2020-12-30 19:38:26 +03:00
Jérôme Gardou 6fcd9f3184 [FTP] Always link agains oldnames 2020-12-28 12:13:30 +01:00
Hermès Bélusca-Maïto e8c9a73bb8
[USETUP] Free allocated memory after loading the new text-mode font from the .CAB file. 2020-12-27 00:51:56 +01:00
Jérôme Gardou b805a7dd50 [UMANDLG] Define Globals variable in only one translation unit 2020-12-22 13:15:01 +01:00
Eric Kohl 94f01f5b64 [WINLOGON] Add hidden logon/logoff SFC notification 2020-12-21 20:42:40 +01:00
Oleg Dubinskiy 9de8787187
[REGEDIT] Display search finished messagebox when using Find Next (F3) menu item (#3371)
This repeats behaviour of Windows Regedit. CORE-17368
2020-12-21 20:48:52 +03:00
Victor Perevertkin ff13301eb2
[UMPNPMGR] Set the data type in all cases of PNP_GetDeviceRegProp
CORE-14187
2020-12-06 19:48:38 +03:00
Victor Perevertkin dd56e065bc
[REACTOS] Enable PnP storage stack
- Use PnP storage class drivers
- Make partmgr an upper filter driver for Disk class
- Fill upper filters in txtsetup and usetup/devinst
- Add cdrom driver to the critical device database

CORE-6264
2020-12-05 22:30:43 +03:00
Hervé Poussineau b483be4af2 [UMPNPMGR] Remove invalid prototype of inline function
This fixes eede1b9b7a.
2020-12-01 18:51:42 +01:00
Stanislav Motylkov 5cb9f8765b
[SMSS] Revert commit 131bc73
This is now fixed properly by de16ef3.
2020-11-26 13:06:20 +03:00
Stanislav Motylkov 131bc73555
[SMSS] Fix x64 build. Addendum to a0721eb
This part is specific for x86 architecture.
2020-11-26 03:50:16 +03:00
Hermès Bélusca-Maïto a0721ebdd3
[SMSS] Use the new IsNEC_98 macro defined for user-mode. 2020-11-26 00:29:34 +01:00
Hermès Bélusca-Maïto a59cecd89d
[SETUPLIB] Add two hacks in partlist.c for temporarily setting consistently the disk partition style.
Add two hacks in UpdateDiskLayout() and WritePartitions() so that the
disk partition style is consistently set to a known value MBR, especially
when that disk was previously new and uninitialized (RAW).
A proper fix will be developed later when support for GPT is added.
2020-11-24 04:37:52 +01:00
Hermès Bélusca-Maïto 05cd77028c
[SETUPLIB][USETUP] Cleanup some code in USETUP. Redefine FormatPartition() and ChkdskPartition() helpers
so that they wrap the needed init steps for formatting/chkdsk'ing.

These helpers now accept a PPARTENTRY, together with the usual
formatting/chkdsk parameters. The helpers now determine the actual
NT path to use, and can perform the init steps on the partition
before performing the actual operation.

In particular, FormatPartition() is now made GPT-compliant. The
partition type retrieved by FileSystemToMBRPartitionType() is now
used as a hint for choosing FAT32 over FAT12/16, and only in the
case of a MBR partition that is *NOT* a recognized OEM partition,
it is used for updating the corresponding partition type. (OEM
partitions must retain their original type.)

The OEM partition types we (and NT) can recognize are specified
e.g. in the Microsoft Open-Specification [MS-DMRP] Appendix B
https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dmrp/5f5043a3-9e6d-40cc-a05b-1a4a3617df32

Introduce an IsOEMPartition() macro to help checking for these types
(its name is based on the Is***Partition() macros from ntdddisk.h,
and from a dmdskmgr.dll export of similar name).
2020-11-24 03:24:41 +01:00
Hermès Bélusca-Maïto 9735a8379f
[SETUPLIB] Make InferFileSystem() compatible for both MBR and GPT disks. Simplify the FSREC interface a bit.
Instead of providing an MBR partition type to InferFileSystem(), make
it call IOCTL_DISK_GET_PARTITION_INFO(_EX) to determine whether the
partition pointed by the path/handle is MBR or GPT. Then, only if it's
MBR, we retrieve its partition type in order to "guess" an adequate file
system name, in case the latter was not recognized already via regular
ways (via GetFileSystemName() / NtQueryVolumeInformationFile()).

- Remove the GetFileSystemNameByHandle() and InferFileSystemByHandle()
  functions. Instead, make the other GetFileSystemName*() and
  InferFileSystem*() functions accept a HANDLE as an alternative to the
  already-existing partition path string. These parameters are exclusive
  to each other.

- Rename SetPartitionType() -> SetMBRPartitionType(),
  and FileSystemToPartitionType() -> FileSystemToMBRPartitionType()
  in order to really clarify what they do (since this code is meant
  for MBR partitions only, not GPT ones).
2020-11-24 03:24:36 +01:00
Hermès Bélusca-Maïto 8d3e80e437
[FSLIB][FMIFS][AUTOCHK][SETUPLIB] Use more Windows-compatible (but not fully compatible yet) Format() and Chkdsk() ULIB functions.
[AUTOCHK] Add also support for scanning FATX volumes.

The Format(), FormatEx(), Chkdsk(), ChkdskEx() functions exposed by the
U*.DLL user-mode FS library dlls are different (and have different
prototypes) than the similarly-named functions exported by FMIFS.DLL .

In particular, what we used to call "xxxChkdskEx()" and "xxxFormatEx()"
in our U*.DLL libraries actually correspond more, from their arguments,
to the "Chkdsk()" and "Format()" functions in Windows' U*.DLL . Their
*Ex() counterparts instead take most of the parameters through a
structure passed by pointer.

On FMIFS.DLL side, while FMIFS!Chkdsk() calls U*.DLL!Chkdsk() and
FMIFS!ChkdskEx() calls U*.DLL!ChkdskEx() (and we do not implement these
*Ex() functions at the moment), both FMIFS!Format() and FMIFS!FormatEx()
call U*.DLL!Format() instead, while FMIFS!FormatEx2() calls
U*.DLL!FormatEx() (that we do not implement yet either) !!

To improve that, refactor the calls to these U*.DLL functions so as to
respect the more compatible prototypes: They contain the correct number
of parameters in a compatible order. However, some of the parameters do
not have the same types yet: the strings are kept here in PUNICODE_STRINGS,
while on Windows they are passed via an undocumented DSTRING struct, and
the FMIFS callback is instead a MESSAGE struct/class on Windows.
Finally, the MEDIA_TYPE parameter in U*.DLL!Format() is equivalent, yet
not fully 100% in 1-to-1 correspondence, with the FMIFS_MEDIA_FLAG used
in the corresponding FMIFS.DLL functions.

One thing to notice is that the U*.DLL!Format() (and the Ex) functions
support a BOOLEAN (a flag resp.) for telling that a backwards-compatible
FS version should be used instead of the (default) latest FS version.
This is used e.g. by the FAT FS, where by default FAT32 is selected
(depending also on other constraints like, the disk and the partition
sizes), unless that bit is set in which case, FAT16 (or 12) is used.
2020-11-22 21:57:07 +01:00
He Yang 02c566b524
[TRANSLATION][CMD] Update zh-CN translation (partially) (#3330) 2020-11-21 18:05:22 +01:00
Aobi Chan CL fc3ccb3948
[TRANSLATION] Improve zh-TW translation (#3218)
- Added zh-TW translation for the following modules: credui, crypt32, getuname, mapi32, themeui, shlwapi.
- Modify zh-TW translation for other files.
- Moving Traditional Chinese translation back to Zh.rc for files came from Wine (comdlg32).

Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2020-11-21 18:03:37 +01:00
Stanislav Motylkov 059ba9b0c0
[RAPPS] Properly use FormatMessageW with WinInet message table
Addendum to fb1582d. CORE-17375 CORE-17377
2020-11-20 21:30:29 +03:00
Jérôme Gardou 7a52db76c5 [RAPPS] Do not implicitly cast pointer to BOOL 2020-11-16 16:58:10 +01:00
Oleg Dubinskiy 6aae5f4fdd
[REGEDIT] Make "finished find" messagebox owned by Regedit window (#3369)
Same behaviour as in MS Regedit.
CORE-17367
2020-11-14 19:21:10 +01:00
Jose Carlos Jesus a012c3d507
[CMD] Add new portuguese (PT) translation (#3260) 2020-11-07 17:27:52 +01:00
Hermès Bélusca-Maïto ce2c1f6321
[RAPPS.COM] Use HeapAlloc/Free instead of the deprecated LocalAlloc/Free.
And fix my build.
2020-11-06 01:06:12 +01: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
Hermès Bélusca-Maïto ec0853ba70
[SERVMAN] Fix trailing whitespace. 2020-11-06 01:06:10 +01:00
Hermès Bélusca-Maïto f1a4a6e704
[USETUP] Introduce two helpers for formatting displayed disk and partition sizes in order to reduce code duplication. 2020-11-04 23:26:54 +01:00
Hermès Bélusca-Maïto 13dd01b44c
[USETUP] Use pointers to const strings where meaningful. 2020-11-04 23:26:53 +01:00
Mark Jansen c3b3fcd111
[RAPPS] Abort screenshot iteration on the first not found
This should decrease startup time / db parse time
2020-10-25 20:30:03 +01:00
Mark Jansen 964c22c1ca
[RAPPS][RAPPS.COM] Introduce a rapps console shim
rapps.com will be launched when running 'rapps' from cmd or
from run, and since it is a console application, explorer/ cmd will
wait for it.
This rapps.com passes the commandline to rapps.exe,
and wait for rapps.exe to exit before closing.

CORE-17281
2020-10-25 15:44:33 +01:00
Jérôme Gardou ab825334dd Apply suggestions from code review
Beautification and clarity

Co-authored-by: Victor Perevertkin <victor@perevertkin.ru>
Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2020-10-20 21:44:54 +02:00
Jérôme Gardou c004b53d77 Apply suggestions from code review
Style fixes

Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
Co-authored-by: Victor Perevertkin <victor@perevertkin.ru>
2020-10-20 21:44:54 +02:00
Jérôme Gardou 00ed72d7e8 [CMAKE] Get rid of add_compile_flags
Use add_compile_options and the like instead
2020-10-20 21:44:54 +02:00
Jérôme Gardou ed61512236 [CMAKE] Get rid of add_compile_flags_language macro
in favor of add_compile_options and the like with generator expressions
Also take this as an opportunity to remove the C++11 standard hack, GCC 8 now defaults to C++14
2020-10-20 21:44:54 +02:00
Jérôme Gardou 7e116f0ef3 [CMAKE] Get rid of replace_compile_flags
Introduce a finer-grained remove_target_compile_option instead
2020-10-20 21:44:54 +02:00
Jérôme Gardou 907025a018 [CMAKE] Introduce the atl_classes interface library
This takes care of adding the relvant include directory and the _ATL_NO_EXCEPTIONS define, if needed
2020-10-20 21:44:54 +02:00
Jérôme Gardou d6ea8659c8 [CMAKE] Get rid of the set_cpp macro
Instead of messing with global variables and the like, we introduce two target properties:
 - WITH_CXX_EXCEPTIONS: if you want to use C++ exceptions
 - WITH_CXX_RTTI: if you need RTTI in your module
You can use the newly introduced set_target_cpp_properties function, with WITH_EXCEPTIONS and WITH_RTTI arguments
We also introduce two libraries :
 - cpprt: for C++ runtime routines
 - cppstl: for the C++ standard template library

NB: On GCC, this requires to create imported libraries with the related built-in libraries:libsupc++, limingwex, libstdc++

Finally, we manage the relevant flags with the ad-hoc generator expressions

So, if you don't need exceptions, nor RTTI, nor use any runtime at all: you simply have nothing else to do than add your C++ file to your module
2020-10-20 21:44:54 +02:00
Hermès Bélusca-Maïto 6c94e4f487
[USETUP] Work around GCC's complaints (will be fixed properly later on). 2020-10-20 01:32:30 +02:00
Hermès Bélusca-Maïto 08924c1850
[USETUP][SETUPLIB] Continue hiding the FAT32 format in the format list, but take it into account anyway later on.
The formatter will select it anyway as soon as the partition size
permits it. We make it available internally however so as to "emulate"
FMIFS functionality.

Now rely on the partition filesystem for InstallVBRToPartition() instead
of the unreliable and deprecated partition type.
2020-10-20 01:19:58 +02:00
Hermès Bélusca-Maïto 593bcce999
[SETUPLIB] Code re-organization in bootsup.c and fsutil.c.
- Move the actual VBR bootcode installation helpers into fsutil.c
  (they depend on the selected filesystem).

- Introduce InstallBootCodeToDisk() and InstallBootCodeToFile()
  and bootcode.c helpers, in order to replace the several functions
  that were duplicating the same code.
2020-10-18 20:56:16 +02:00
Hermès Bélusca-Maïto b51b8ee2d5
[SETUPLIB] Move the filesystem recognition helpers to their own file. 2020-10-18 20:56:16 +02:00
Stanislav Motylkov 8a4273b6ee
[FREELDR] Add variable for default text color
On PC/AT-compatible machines it's Gray, and on NEC PC-98 series it's White.
2020-10-17 19:28:08 +03:00
Stanislav Motylkov 9be9750dc8
[SETUPLIB] Fix some copy-pasta comments, no code changes 2020-10-17 00:48:30 +03:00
Omer I.S c758d15d0a
[RAPPS] Update Hebrew (he-IL) translation (#3297) 2020-10-15 17:12:50 +03:00
chirsz a91a709a8d
[CMD] Fix a typo in filename completion (#3293)
Fix filename completion that could cause a incorrect result when the path
contains "dots". (See also HBelusca@d12169b.)
See CORE-8623 and CORE-1901 (bug introduced in r25896 / 54cf74f).

For example:

- The current directory is `C:\Documents and Settings\Administrator\`, and you
  input `".` and press TAB. The completion result would be `".Administrator"`,
  which even does not exist.

- You input "some(file).ext", and you remove the final quote (or the quote
  and "ext") and you attempt to complete the file name.

- Import two additional fixes from HBelusca@a826730: Fix the search ordering
  in the comparisons between szSearch1, szSearch2 and szSearch3.

Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2020-10-11 21:57:08 +02:00
Mark Jansen 7a2c1f7d0b
[RAPPS] Re-add support for icons named after the ini file 2020-10-11 17:01:06 +02:00
Mark Jansen 12caaece25
[RAPPS] Fix certificate pinning error displaying garbage 2020-10-11 17:01:06 +02:00
Mark Jansen 12489f691b
[RAPPS] Bump the rapps user agent version 2020-10-11 17:01:06 +02:00
Mark Jansen d564b4afc3
[RAPPS] Update rapps DB location to the new database 2020-10-11 17:01:06 +02:00
Mark Jansen 26da451ba5
[RAPPS] Delete icons and temp screenshot when cleaning up the db 2020-10-11 17:01:05 +02:00
Mark Jansen a3a12271e1
[RAPPS] Add directory extraction capabilities for the .cab file 2020-10-11 17:01:05 +02:00
Mark Jansen 4f25a47677
[RAPPS] Add support for a rapps db with the file:/// scheme
This makes it easier to test locally
2020-10-11 17:01:05 +02:00
Hermès Bélusca-Maïto 87e2ec585f
[SMSS] Use RTL string-safe functions in critical places. Add validity checks for returned NtQueryValueKey() data. (#2704)
- Not all the wcscpy() / swprintf() calls have been converted to their
  string-safe equivalents. Instead I used the string-safe functions only
  for places where strings of unknown length were copied into fixed-size
  internal buffers. On the contrary, for known-fixed-length strings being
  copied or numbers being converted to string representations in large
  enough buffers, I kept the original function calls.

- Verify the registry data that has been returned by NtQueryValueKey():
  * When expecting (not multi) strings, check whether the data type is
    either REG_SZ or REG_EXPAND_SZ.
  * When expecting DWORD values, check whether the data type is
    REG_DWORD and whether the data length is (greater or) equal to
    sizeof(ULONG).
2020-10-10 16:25:22 +02:00
Hermès Bélusca-Maïto 0ff9b0ff7e
[WINLOGON] Display the shutdown message popup dialog on the current input desktop. (#3259)
CORE-17050

Display the shutdown message popup dialog on the current input desktop,
and periodically monitor for any change of the input desktop. When the
latter changes, close the dialog and recreate it on the new input desktop.

In addition, retain the current dialog position and restore it when the
dialog is recreated on the new desktop.
2020-10-05 02:26:03 +02:00
Hermès Bélusca-Maïto be7bfc813d
[WINLOGON] Minor formatting only.
Add also original author's name (from original PR #458).
2020-10-05 02:26:02 +02:00
Hermès Bélusca-Maïto 434fa562ce
[USETUP] Do a trick to avoid visual "blinking" during screen clearing. (#3255)
CORE-17312

Hide everything under the same foreground & background colors, so that
the actual color and text blanking reset does not create a visual "blinking".
Then, blank the text and finally reset the actual foreground &
background colors.

We do this because we cannot do the screen scrolling trick that would
allow to change both the text and the colors at the same time (the
function is currently not available in our console "emulation" layer).
2020-10-02 00:20:21 +02:00
Hermès Bélusca-Maïto 66302e477c
[USETUP] Minor formatting only. 2020-10-02 00:04:11 +02:00
Hermès Bélusca-Maïto ffc96d26ec
[UMPNPMGR][USETUP] Fix the way device-install events are queued and dequeued. Fixes CORE-16103.
Dedicated to the hard work of Joachim Henze! xD

This reverts part of commit 043a98dd (see also commit b2aeafca).

Contrary to what I assumed in commit 043a98dd (and was also assumed in
the older commit b2aeafca), we cannot use the singled-linked lists to
queue and dequeue the PnP device-install events, because:

- the events must be treated from the oldest to the newest ones, for
  consistency, otherwise this creates problems, as shown by e.g. CORE-16103;

- the system singled-linked lists only offer access to the top of the
  list (like a stack) instead of to both the top and the bottom of the
  list, as would be required for a queue. Using the SLISTs would mean
  that only the newest-received events would be treated first, while the
  oldest (which were the first received) events would be treated last,
  and this is wrong.

Therefore one must use e.g. the standard doubly-linked list. Also, using
locked operations (insertion & removal) on the list of device-install
events is necessary, because these operations are done concurrently by
two different threads: PnpEventThread() and DeviceInstallThread().
Since the interlocked linked list functions are not available in user-mode,
we need to use instead locking access through e.g. a mutex.
2020-10-01 01:52:09 +02:00
Hermès Bélusca-Maïto f5ba9de2ee
[CMD] Fix substring-substitute regression from commit cdc8e45b (use signed offsets). 2020-09-28 00:41:17 +02:00
Hermès Bélusca-Maïto 895dccd4ac
[CMD] Cleanup all batch contexts if the execution loop stopped due to EXIT. 2020-09-27 20:26:36 +02:00
Hermès Bélusca-Maïto f0fccb752f
[CMD] Fix batch/CALL arguments initialization.
- Move initialization of bc->raw_params also in BatchParams().

- The bc->raw_params, i.e. the unparsed batch/CALL parameters obtained
  with %*, has any leading and trailing whitespace trimmed
  (since Windows 2000+).
2020-09-27 19:06:10 +02:00
Hermès Bélusca-Maïto 37bda06eed
[CMD] CALL: Fix the implementation of the CALL command, make it more compatible with Windows' CMD.
- Fail if no parameter is provided.

- The "CALL :label args..." syntax is available only when command extensions
  are enabled. Fail if this syntax is used outside of a batch context.

- Reparse the CALL command parameter with the command parser, in order
  to accurately parse and interpret it as a possible command (including
  escape carets, etc...) and not duplicate the logic.
  ** CURRENT Windows' CMD-compatibility LIMITATION ** (may be lifted in
  a "ROS-specific" running mode of CMD): only allow standard commands to
  be specified as parameter of the CALL command.

  This reparsing behaviour can be observed in Windows' CMD, by dumping
  the interpreted commands after enabling the cmd!fDumpParse flag from
  a debugger (using public symbols).

- When reparsing, we should tell the parser to NOT ignore lines that
  start with a colon, because in this situation these are to be
  considered as valid "commands" (for parsing "CALL :label").

  * For Windows' CMD-compatibility, the remaining escape carets need to
    be doubled again so that, after the new parser step, they are escaped
    back to their original form. But then we also need to do it the "buggy"
    way à la Windows, where carets in quotes are doubled either! However
    when being re-parsed, since they are in quotes they remain doubled!!
    (see "Phase 6" in https://stackoverflow.com/a/4095133/13530036 ).

  * A MSCMD_CALL_QUIRKS define allows to disable this buggy behaviour,
    and instead tell the parser to not not interpret the escape carets.

- When initializing a new batch context when the "CALL :label" syntax is
  used, ensure that we reuse the same batch file position pointer as its
  parent, so as to have correct call label ordering behaviour.

  That is,

  :label
  ECHO hi
  CALL :label
  :label
  ECHO bye

  should display:

  hi
  bye
  bye

  i.e., the CALL calls the second label instead of the first one (and
  thus entering into an infinite loop).

  Finally, the "CALL :label" syntax strips the first ':' away, so, as a
  side-effect, the command "CALL :EOF" fails (otherwise it would perform
  a "GOTO :EOF" and succeeds), while "CALL ::EOF" succeeds.

Fixes some cmd_winetests.
2020-09-27 19:05:23 +02:00
Hermès Bélusca-Maïto d029a626e9
[CMD] Make the command-line parser more compatible with Windows' CMD one.
All these modifications have been verified with Windows' CMD, either
by using written cmd_rostests and the existing cmd_winetests, or
manually by enabling the flags cmd!fDumpTokens and cmd!fDumpParse
(available in the public symbols) and analyzing how the tokens are
being parsed, as well as the generated command tree.

See also the following links for more details (but remember that these
observations have to be double-checked in Windows' CMD!):

* Parser rules: https://stackoverflow.com/a/4095133/13530036
* Discussion: https://www.dostips.com/forum/viewtopic.php?f=3&t=8355
* Numbers parsing: https://www.dostips.com/forum/viewtopic.php?t=3758
* Label names vs. GOTO and CALL: https://www.dostips.com/forum/viewtopic.php?f=3&t=3803
  and: https://www.dostips.com/forum/viewtopic.php?f=3&t=3803&p=55405#p55405

- Fix REM command parsing. A C_COMMAND-like structure should still
  be built, so that it can show up during batch command echo. However
  some specific handling needs to be done, so use instead a new C_REM
  command type.
  Escape carets are parsed differently than usual: they are explicitly
  kept in the command line and don't participate in line continuations.
  Also, the Windows' CMD behaviour is to discards everything before the
  last line continuation.

- Prefix operator '@' (the "silent" operator) is parsed as a separate
  command. Thus, the command @@foo@bar is parsed as: '@', '@', 'foo@bar'.

- Improve the checks for numbered redirection.
  For this purpose, we check whether this is a number, that is in first
  position in the current parsing buffer or is preceded by a whitespace-
  like separator, including standard command operators (excepting '@' !)
  and double-quotes.

- Empty command blocks, i.e. "( )", standing by themselves, or present
  in IF or FOR commands, are considered invalid. (The closing parenthesis
  is considered "unexpected".)

- Ignore single closing parenthesis when being outside of command blocks,
  thus interpreting it as a command, and ignore explicitly everything
  following on the same line, including line continuations.
  This very specific situation can happen e.g. while running in batch mode,
  when jumping to a label present inside a command block.
  See the code for a thorough explanation.

- Detect whether a parenthesized block is not terminated at the end
  of a command stream (getting a NUL character instead of a newline),
  and if so, bail out early instead of entering into an infinite loop.

- Perform a similar check for the parenthesized list in FOR commands.

- Initialize the static 'InsideBlock' value to a known value.

- The '&' operator (multi-commmand) is allowed to have an empty RHS.
  When such situation occurs, turn the CurrentTokenType to TOK_END
  so as to avoid a parse error later on.

- The main body of a IF statement, or its 'else' clause, as well as
  the main body of a FOR statement, must not be empty, otherwise this
  is considered a syntax error. If so, call ParseError() that sets
  the 'bParseError' flag, and forcing all batch execution to stop.
2020-09-27 02:27:15 +02:00
Adam Słaboń 50ff453434
[TRANSLATION] Polish translation update (#3233) 2020-09-26 21:42:36 +03:00
Mark Jansen 3da04a9b68
[RAPPS] Remove string casts after the conutils fix 2020-09-25 22:03:28 +02:00
Kyle Katarn b9754fa5d6
[SETUP][MMSYS][SHELL32] Adding missing French translation (and update existing ones) (#3232)
Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2020-09-25 01:39:31 +02:00
Hermès Bélusca-Maïto 17e094cd34
[CMD] SET: Diverse fixes for the arithmetic-expression parser (/A option).
- Detect whether a division by zero is done, and fail if so.

- Detect whether an invalid number is provided:
  * If _tcstol() fails with errno == ERANGE, we've got an overflow or
    underflow.
  * If the next character where _tcstol() is not a whitespace but is a
    character compatible with the first character of an identifier, the
    number is invalid.

- Add + to the list of existing unary operators (!,~,-), and parse them
  where many of these are present. Indeed, expressions like: +3, -+-+3,
  !!-+3 (or with other unary ops, etc.) are valid.

- Operators constituted of more than one characters, can contain
  whitespace separating their constituting characters.
  Thus, "a + = 3" is equivalent to "a += 3" (and the same for -=, *=,
  /=, %=, &=, |= and ^=), and "a < < 3" is equivalent to "a << 3" (and
  the same for >>, <<= and >>=).

- After evaluating everything, if unparsed data remains, fail and bail out.

- Return Windows' CMD-compatible errorlevels.

See https://ss64.com/nt/set.html for more details.

Fixes some cmd_winetests.
2020-09-23 00:22:48 +02:00
Hermès Bélusca-Maïto 87a5403318
[CMD] Add a MSCMD_BATCH_ECHO define for enabling Windows' CMD.EXE way of preserving/restoring the echo flag across batch calls.
Observation shows that this is done only when the top-level batch file
is being run (and then terminates); the echo flag is not restored to its
previous state when a child batch file terminates and gives main back to
its parent batch.
2020-09-23 00:22:47 +02:00
Hermès Bélusca-Maïto 141378cfc8
[CMD] ASSOC: Simplify the code and make it more robust; fix returned ERRORLEVEL values.
- Make sure that non-administrator users can list associations, and
  display appropriate error messages when e.g. they don't have sufficient
  privileges to perform an operation.

- Make the helper functions all return Win32 values, used as the
  ERRORVALUE, except when a specific extension association fails to be
  displayed, in which case the ERRORVALUE is normalized to 1.

- Since the 'param' is a modifiable string (that can be modified by the
  command, independently of the way it's called), just use it to isolate
  the extension by zeroing out the equls-sign separator.
2020-09-23 00:22:47 +02:00
Hermès Bélusca-Maïto 63316df520
[CMD] Change ERRORLEVEL behaviour for commands ASSOC, PATH, PROMPT and SET.
Commands APPEND/DPATH and FTYPE are also concerned by this; however
we do not implement them in our CMD.EXE yet.

These commands set the ERRORLEVEL differently, whether or not they are
run manually from the command-line/from a .BAT file, or from a .CMD file:

- From command-line/.BAT file, these commands set the ERRORLEVEL only if
  an error occurs. So, if two commands are run consecutively and the first
  one fails, the ERRORLEVEL will remain set even if the second command
  succeeds.

- However, when being run from a .CMD file, these command will always
  set the ERRORLEVEL. In the example case described above, the second
  command that succeeds will reset the ERRORLEVEL to 0.

This behaviour is determined from the top-level batch/script file being
run. This means that, if a .BAT file is first started, then starts a
.CMD file, the commands will still behave the .BAT way; on the opposite,
if a .CMD file is first started, then starts a .BAT file, these commands
will still behave the .CMD way.

To implement this we introduce one global BATCH_TYPE enum variable that
is initialized to the corresponding batch/script file type when the
top-level script is loaded. It is reset to "none" when that script
terminates.

See https://ss64.com/nt/errorlevel.html for more details,
section "Old style .bat Batch files vs .cmd Batch scripts",
and https://groups.google.com/forum/#!msg/microsoft.public.win2000.cmdprompt.admin/XHeUq8oe2wk/LIEViGNmkK0J
(comment by Mark Zbikowski).
2020-09-23 00:22:46 +02:00
Hermès Bélusca-Maïto a5d7a2cd61
[CMD] Code style and formatting fixes for assoc.c and path.c 2020-09-23 00:22:45 +02:00
Hermès Bélusca-Maïto 0695ecbfd6
[CMD] FOR: Additional Windows' CMD compatibility "fixes" for FOR /F token parsing command.
This compatibility behaviour implements the buggy behaviour of FOR /F
token parsing that can be observed in Windows' CMD, and that is tested
by the cmd_winetests.
It can be disabled at compile time via the MSCMD_FOR_QUIRKS define.

It fixes additional cmd_winetests, in concert with commit cb2a9c31.

Explanation of the implemented buggy behaviour
==============================================

In principle, the "tokens=x,y,m-n[*]" option describes a list of token
numbers (must be between 1 and 31) that will be assigned into variables.
Theoretically this option does not cumulate: only the latest 'tokens='
specification should be taken into account.

However things are not that simple in practice. First, not all of the
"tokens=" option state is reset when more than one specification is
provided. Second, when specifying a token range, e.g. "1-5", Windows'
CMD just ignores without error ranges that are not specified in
increasing order. Thus for example, a range "5-1" is ignored without
error. Then, token numbers strictly greater than 31 are just ignored,
and if they appear in a range, the whole range is ignored.

Another bug is the following one: suppose that the 'tokens'
specification reads:
  "tokens=1-5,1-30" , or: "tokens=1-5,3" ,
i.e. more than one range, that overlap partially. Then the actual total
number of variables will not be of the larger range size, but will be
the sum, instead.
Thus, in the first example, a total of 5 + 30 == 35 variables (> 31) is
allocated, while in the second example, a total of 5 + 1 == 6 variables
is allocated, even if they won't all store data !!
In the first example, only the first 30 FOR variables will be used, and
the 5 others will contain an empty string. In the second example, only
the first 5 FOR variables will be used, and the other one will be empty.

We also see that due to that, the "Variables" buffer of fixed size
cannot always be used (since it can contain at most 32 variables).

Last but not least, when more than one "tokens=" specification is
provided, for example:
  "tokens=1-31 tokens=1-20"
a total number of 31 FOR variables (because 31 is the max of 31 and 20)
is allocated, **but** only 20 are actually used, and the 11 others
return an empty string.

And in the specification: "tokens=1-31,* tokens=1-20", a total of
31 + 1 + 20 = 52 variables is initialized, but only the first 20 will
be used, and no "remaining-line" token (the '*' one) is used.
2020-09-21 03:31:01 +02:00
Hermès Bélusca-Maïto e904471023
[CMD] IF: Fix x64 warning C4267. 2020-09-21 03:31:01 +02:00
Oleg Dubinskiy b62948ef77 [RAPPS] Use RegDeleteKeyExW for deleting the apps strings from registry only if it is available in advapi32
Otherwise, use `RegDeleteKeyW` instead, on Windows versions whose don't have the Ex function (XP SP3 x32, Server 2003 SP0 and earlier).
It will fix regression with Rapps startup there, due to that missing function.
CORE-17264
2020-09-20 19:23:06 +02:00
Oleg Dubinskiy 7eb90143f8
[RAPPS] Display custom applications icons for installed applications CORE-17257 (#3144)
* [RAPPS] Display custom applications icons for installed applications
- Implement `RetrieveIcon` helper function in `CInstalledApplicationInfo` class, which retrueves the current app's icon from registry, same as it done for `CAvailableApplicationInfo`.
- Use it for loading the icon in `CAppsListView::AddInstalledApplication` function, via `ExtractIconW`. Load default Rapps icon only when the app has no its custom icon.
- Retrieve `DisplayIcon` value from registry in `CInstalledApps::Enum` function, same as other registry values (like app name, description, etc).Store it in `szDisplayIcon` string, which is used in `CInstalledApplicationInfo::RetrieveIcon` for retrieving the data of that value.
- Increase `LISTVIEW_ICON_SIZE` macro from 24 to 32, so 32x32 icon size is now used instead of 24x24. This makes displayed icons more accurate, since most of apps contain 32x32 icon, so they look a bit distorted with 24x24 size.
2020-09-20 19:19:59 +02:00
Mark Jansen 7119b13a28
[CREATECABFILE] Update rapps example scripts for new usage 2020-09-20 17:30:26 +02:00
Katayama Hirofumi MZ a9f60321f0
[MORE] Implement 'Q' key for 'Quit' (#3210)
Implement 'Quit' action for keyboard key 'Q'. CORE-4019
2020-09-20 07:16:21 +09:00
Hermès Bélusca-Maïto 5d5a1a455c
[CMD] FOR: Fix a bug when parsing the "delims=" option in FOR loops.
Suppose the following FOR-loop command, to be run from the command-line
(if using a batch file, double each percent '%' sign):

  FOR %l IN ("a,b,c,d,e" "f,g,h,i,j") DO (
    FOR /F "delims=, tokens=1-3*" %a IN (%l) DO @echo %a-%b-%c-%d
  )

The outermost FOR-loop enumerates the two strings "a,b,c,d,e" and
"f,g,h,i,j" (placed in %l), and parse each of these in turn, splitting
them at each specified delimiter (here only one character) ',' and storing
the results in consecutive tokens %a, %b, %c, %d, with the last token %d
containing all the remaining string (non-split).
The expected result is:

  a-b-c-d,e
  f-g-h-i,j

However, due to the way the delimiters string specified by the "delims="
option is stored (no stack/heap duplication of the FOR-option substring,
but reading from it directly), during the first run of the innermost
FOR-loop, the option string "delims=, tokens=1-3*" was truncated to just
after the ',' due to the erroneous "delims=" parsing, so that when this
FOR-loop ran for a second time (to deal with the second string), the option
string was already erroneously truncated, without the "tokens=..." part,
so that the parsing results were not stored in the tokens and resulting in:

  a-b-c-d,e
  f-%b-%c-%d

instead. The solution is to save where the "delims=" string needs to be
cut, but wait until running the actual FOR-loop to terminate it (and
saving the original character too), run the FOR-loop body, and then
restore the original character where termination took place. This allows
having the FOR-loop option string valid for the next execution of the
FOR-loop.
2020-09-19 19:44:56 +02:00
Hermès Bélusca-Maïto 5cf0517be1
[CMD] Code formatting in SubstituteVar(). 2020-09-19 19:44:55 +02:00
Hermès Bélusca-Maïto cdc8e45b48
[CMD] Fix delayed expansion of variables.
CORE-13682

- Split SubstituteVars() into its main loop and a helper SubstituteVar()
  that just substitutes only one variable.

- Use this new helper as the basis of the proper implementation of the
  delayed expansion of variables.

- Fix a bug introduced in commit 495c82cc, when GetBatchVar() fails.
2020-09-19 19:44:55 +02:00
Hermès Bélusca-Maïto cb2a9c31a6
[CMD] Some fixes for getting the enhanced '%~XXX' batch/FOR variables.
CORE-11857 CORE-13736

It will be followed with a separate fix for the FOR-loop code.
Fixes some cmd_winetests.

A NULL pointer can be returned for a valid existing batch/FOR variable,
in which case the enhanced-variable getter should return an empty string.
This situation can happen e.g. when forcing a FOR-loop to tokenize a
text line with not enough tokens in it.
2020-09-19 19:44:54 +02:00
He Yang fbbc3efd60
[RAPPS] Update help command (#3209)
Add missing FIND and INFO commands to the usage help string.
2020-09-19 15:20:14 +03:00
Aobi Chan CL e160524395
[TRANSLATION] Chinese Traditional translation improvements (#3085)
- Add Chinese Traditional language support for CHARMAP_NEW, DRWTSN32, UTILMAN, CHKDSK.
- Improve translation for CLIPBRD, MSCONFIG(_NEW), NOTEPAD, SHUTDOWN, SNDREC32, WINHLP32, DISKPART, FORMAT, REGSVR32, RUNDLL32, USERINIT, DESK.CPL and TIMEDATE.CPL.
2020-09-18 00:50:27 +02:00
Kyle Katarn ac2b2ef8c7
[CMD] HISTORY: Fix command output (missing linefeed) (#3205)
CORE-12603

Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2020-09-18 00:17:08 +02:00
Kyle Katarn 579f501215
[RAPPS] Fix of unhandled exception when trying to modify/uninstall without selection (#3185)
CORE-17279
2020-09-15 22:50:12 +02:00
Serge Gautherie a04831677e
[PROGMAN][CRT][USER32] Do not use LoadLibraryEx() NT6+ flags (#3152)
CORE-12004
2020-09-13 23:42:09 +02:00
Jose Carlos Jesus b52189873d
[TRANSLATION][SCREENSAVERS][SYSSETUP] Add Portuguese (PT) translation (#3156) 2020-09-13 23:14:05 +02:00
Kyle Katarn f07ace6aa2
[RAPPS][CONSRV] French translation update (#3160)
Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2020-09-13 23:12:52 +02:00
Kyle Katarn 860a985f26
[FORMAT] Fix of output text overlap in console when finished (#3177)
At the end of the format operation, text in console got overwritten and leftovers from previous line remained displayed.
2020-09-13 23:02:09 +02:00
Kyle Katarn 51023e3a2e
[FORMAT] French translation fix (#3178)
Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2020-09-13 23:01:07 +02:00
Hermès Bélusca-Maïto c58a601602
[CMD] Document the two extra file attributes the enhanced batch/FOR variables %~aX could handle on Windows >= 8.
They are currently specified for documentation purposes (i.e. what
Windows 8+ CMD.EXE can report) but not used yet, since ReactOS does not
support them.
2020-09-13 22:50:11 +02:00
Hermès Bélusca-Maïto 95466904db
[CMD] SHIFT: Use _istdigit(). 2020-09-13 22:50:10 +02:00
Hermès Bélusca-Maïto 00ce3c48fe
[CMD] Use pointers to const strings in error functions, where applicable. 2020-09-13 22:50:09 +02:00
Hermès Bélusca-Maïto 3f8f3a2bba
[CMD] Minor formatting only. 2020-09-13 22:50:09 +02:00
He Yang 5077e400d5
[RAPPS] Update Chinese Simplified (zh-CN) translation (#3155)
Addendum to 7a11c65.
2020-09-13 22:00:08 +03:00
Katayama Hirofumi MZ f1e2c3f70e [MSPAINT] Improve Japanese (ja-JP) translation 3 2020-09-13 17:33:57 +09:00
Katayama Hirofumi MZ b88717f5c4 [MSPAINT] Improve Japanese (ja-JP) translation 2 2020-09-13 17:15:05 +09:00
Katayama Hirofumi MZ bd7ad59a48 [MSPAINT] Improve Japanese (ja-JP) translation 2020-09-13 17:01:49 +09:00
Mark Jansen ee69ca786a [CERTUTIL] Add skeleton application with support for -hashfile 2020-09-11 15:29:28 +02:00
Kyle Katarn d54e50f3dc
[EXPLORER] Registry key not closed on error (#3136)
CORE-14519
2020-09-08 21:55:45 +02:00
Kyle Katarn 2c7ccf4bc9
[SOLITAIRE] French translation update (#3138)
Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2020-09-08 21:52:24 +02:00
He Yang e1974d21dc
[RAPPS] settings read/write refactor (#3101)
* [RAPPS] move settings-related stuff to a separate file
* [RAPPS] refactor reg read/write
* [RAPPS] add params for Load/SaveSettings, no longer use global vars
2020-09-06 17:10:18 +02:00
He Yang ce0110195b
[RAPPS] improve ConInitStdStreams initialization logic (#3098) 2020-09-06 17:10:18 +02:00
He Yang 7a11c65561
[RAPPS] cmdline enhancement (#3087)
* [RAPPS] now command-line option supports begin with both / and -
* [RAPPS] Add help command with /?
* [RAPPS] add /find command
* [RAPPS] add /info option
* [RAPPS] add copyright and contact e-mail
2020-09-06 17:10:18 +02:00
赫杨 997650d424
[RAPPS] Display package name in UI too 2020-09-06 17:10:17 +02:00
赫杨 a4ac3c84b2
[RAPPS] now /INSTALL option use PkgName instead of software name
currently, PkgName is the name of ini file in DB (without suffix)
2020-09-06 17:10:17 +02:00
赫杨 da8810ab88
[RAPPS] add m_szPkgName for AvailableApps 2020-09-06 17:10:17 +02:00
赫杨 c5e111427c
[RAPPS] reduce the chance assert failed 2020-09-06 17:10:16 +02:00
赫杨 4c524ee3d5
[RAPPS] some renaming 2020-09-06 17:10:16 +02:00
赫杨 d29fba7f7a
[RAPPS] fix the bug that Toolbar is not working 2020-09-06 17:10:16 +02:00
赫杨 36870a02f7
[RAPPS] update some file-header
update some header to newer format, update purpose and add my name to those file I've modified
2020-09-06 17:10:16 +02:00
He Yang 4c7bd34a47
[RAPPS] appview displaymode support (#3008)
* [RAPPS] add function to set view-mode
* [RAPPS] move toolbar and searchbar into appview
* [RAPPS] remove settings and exit button from toolbar
* [RAPPS] add code to switch between list and tile mode
* [RAPPS] add auto-arrange for listview
* [RAPPS] adjust the minimum size of AppView
* [RAPPS] now image list of listview is stored inside the class
* [RAPPS] add list mode, and old list-mode are detail mode now
* [RAPPS] add check for unimplemented view mode
2020-09-06 17:10:08 +02:00
He Yang e44c9b6630
[RAPPS] application-view refactor (#3003)
* [RAPPS] separate application-view from gui.cpp
* [RAPPS] make the code looks more clear
* [RAPPS] fix &  improve tab-order handle
* [RAPPS] now double-click / right-click & install an item will install exactly this app
* [RAPPS] add handling for DWORD timestamp for InstallDate
* [RAPPS] make the code setting column style more clear
* [RAPPS] change the owner of popup-menu
* [RAPPS] now the popup menu (the one when right-click listview) now belongs to application-view
2020-09-06 17:09:21 +02:00
He Yang 10c0ff7416
[RAPPS] listview refactor (#2970)
This makes it easier to maintain the listview, and better separates the application list and listview.

* [RAPPS] fix memory leak when cleanup. some renaming are also done
* [RAPPS] move the code adding apps info inside class CAppsListView
* [RAPPS] add table view, create listview and AppInfoDisplay inside it
* [RAPPS] rename INSTALLED_INFO as CInstalledApplicationInfo
now it corresponds with CAvailableApplicationInfo
* [RAPPS] add CInstalledApps
* [RAPPS] optimize the speed when refreshing listview
* [RAPPS] correctly handle Enum for InstalledApps
* [RAPPS] make check all working properly (this also fixes some bugs)
the old version has some bugs when check all items after switching tags in tree-view
* [RAPPS] add handling for wow64
* [RAPPS] use an inline function to replace INSERT_TEXT macro
* [RAPPS] fix the bug that StatusBar won't update when switching tags
* [RAPPS] now TableView always reset bIsAscending in SetDisplayMode
* [RAPPS] rename TableView to ApplicationView
* [RAPPS] now bIsAscending would be reset when switching column in listview
2020-09-06 17:09:20 +02:00
He Yang 4482d0f455
[RAPPS] move icon to a field in .txt file (#2941)
* [RAPPS] move icon to a field in .txt file
* [RAPPS] add function PathAppendNoDirEscapeW, apply it.
2020-09-06 17:09:20 +02:00
He Yang e636373016
[RAPPS] rename snapshot to screenshot, filename to location (#2939) 2020-09-06 17:09:20 +02:00
赫杨 cfb0963c1f
[RAPPS] update broken-img icon 2020-09-06 17:09:20 +02:00
He Yang e506581454
[RAPPS] snapshot url support (#2925)
* [RAPPS] add snapshot url support
* [RAPPS] fix snapshot prev window won't update if size not changed
* [RAPPS] fix crash after cancel download
* [RAPPS] show broken-img if failed to create file / make network request
* [RAPPS] create a snapshots folder if it does not exist
* [RAPPS] add a helper function to perform callback
* [RAPPS] check bIsCancelled when handling ERROR_INVALID_HANDLE
* [RAPPS] remove W suffix for AsyncInetDownload
* [RAPPS] add assert for unknown event
* [RAPPS] Improve AsyncInetDownload error handling
* [RAPPS] move DisplayFailed to private, fix crash when cancelling
* [RAPPS] check for ERROR_INTERNET_OPERATION_CANCELLED
* [RAPPS] improve error logging
* [RAPPS] remove \r in error logging
* [RAPPS] rewrite AsyncInet
2020-09-06 17:09:19 +02:00
He Yang fbf119fde1
[RAPPS] Screenshot preview and other trivial fixes (#2894)
* add one more layer of window
* using Path* API to operate path
* always use rappmgr.cab as file name when downloading db. ignore the URL
* add snapshot preview window
* show a broken-image icon when failed to load image
* add a padding between image and content, and make sure always some space is reserved for richedit
* hide the padding if snapshot window does not have a width
* some work to avoid blinking when window resizing
* add WM_PRINTCLIENT handling
2020-09-06 17:09:19 +02:00
He Yang eacaf65459
[RAPPS] add a layer of window above the richedit (#2871)
* add one more layer of window
* use ATL to create window
* set pLink to NULL to avoid wild pointer
2020-09-06 17:09:12 +02:00
Katayama Hirofumi MZ fb529605a6
[EXPLORER] Implement HSHELL_ACTIVATESHELLWINDOW (#3125)
Implement HSHELL_ACTIVATESHELLWINDOW shell hook.
2020-09-05 18:46:49 +09:00
Hermès Bélusca-Maïto 050df0f56d
[CMD] Code formatting for IsValidPathName, IsExistingFile, IsExistingDirectory, and use INVALID_FILE_ATTRIBUTES instead of an hardcoded value. 2020-09-04 00:24:45 +02:00
Kyle Katarn a5634138c3
[SETUP] French translation of missing elements (#3111)
Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2020-09-03 21:20:54 +02:00
Hermès Bélusca-Maïto c81bf4f823
[CMD] IF: Add extra validity checks in ExecuteIf(). 2020-09-03 16:05:55 +02:00
Kyle Katarn 038daa6367
[SHELL32][PAINT][DRIVERS][SHELLEXT] French translation update (#3092)
Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2020-09-03 15:16:44 +02:00
Catalin Gabriel Draghita 0ab63f9590
[BASE] Improve Spanish (es-ES) translation (#3088) 2020-08-25 18:10:23 +03:00
Jose Carlos Jesus ea5c612b00
[REACTOS][USETUP] Update Portuguese PT translation (#3081)
Co-authored-by: Stanislav Motylkov <x86corez@gmail.com>
2020-08-23 14:34:28 +02:00
Aobi Chan CL 018d4d39a3
[TRANSLATION] Chinese Traditional translation for "Problem with Shortcut" dialog and improvements (#3079)
- Translation for: setup-reactos, welcome, explorer, appwiz, hdwwiz, intl, mmsys, netid, shell32, syssetup, tapiui.
- Update zh-TW.rc of shell32 (#3075)
- Just found more Simplified Chinese characters, fixed them. (装 > 裝)
2020-08-23 14:28:55 +02:00
Thomas Faber 44ae567e39
[TELNET] Don't build this for clang due to compiler errors. CORE-17202 2020-08-23 12:07:38 +02:00
Adam Stachowicz ca68686a98
[CMD] Update Polish (pl-PL) translation (#3082)
Addendum to 7c175d4.
2020-08-20 12:25:52 +03:00
Stanislav Motylkov fa120ac0cd
[CMD] Update Russian (ru-RU) translation
Addendum to 7c175d4.
2020-08-20 02:04:17 +03:00
Hermès Bélusca-Maïto 6925ca37ab
[CMD] Add mention of the /Y switch in MORE command help; re-position the STRING_PAUSE_HELP1 string. 2020-08-19 21:39:23 +02:00
Hermès Bélusca-Maïto 6a8754c83a
[CMD] TYPE: Rewrite the command so as to fix some of its behaviour.
- Display the names of the files being TYPEd only if more than one file
  has been specified on the command-line, or if a file specification
  (with wildcards) is present (even just for one).
  These names are displayed on STDERR while the files are TYPEd on
  STDOUT, therefore allowing concatenating files by just redirecting
  STDOUT to a destination, without corrupting it with the displayed file
  names. Also, add a /N option to force not displaying these file names.

- When file specifications (with wildcards) are being processed, silently
  ignore any directories matching them. If no corresponding files have
  been found, display a file-not-found error.

- When explicitly directory names are specified, don't do any special
  treatment; the CreateFile() call will fail and return the appropriate
  error.

- Fix the returned errorlevel values.

See https://ss64.com/nt/type.html for more information.

Fixes some cmd_winetests.

- When reading from a file, retrieve its original size so that
  we can stop reading it once we are beyond its original ending.
  This allows avoiding an infinite read loop in case the output of
  the file is redirected back to it.

  Fixes CORE-17208

- Move the FileGetString() helper to the only file where it is
  actually used.
2020-08-19 21:39:22 +02:00
Hermès Bélusca-Maïto 3d4af22328
[CMD] CHDIR: Some features are available only when extensions are enabled. Update the SetRootPath() as well. 2020-08-19 21:39:21 +02:00
Hermès Bélusca-Maïto fe9aa42d5f
[CMD] SET: Fix displaying the environment variables with a given prefix.
- Restore any truncated space in the name prefix, before displaying
  any error message.

- When trimming the name prefix from "special" characters (spaces, comma
  and semicolon), so that e.g. "set ,; ,;FOO" displays all the variables
  starting by "FOO", save also a pointer to the original name prefix, that
  we will use for variables lookup as well.

  This is done, because the SET command allows setting an environment variable
  whose name actually contains these characters (e.g. "set ,; ,;FOO=42"),
  however, by trimming the characters, doing "set ,; ,;FOO" would not allow
  seeing such variables.
  With the fix, it is now possible to show them.
2020-08-19 21:39:18 +02:00
Hermès Bélusca-Maïto 8cea82b14c
[CMD] REPLACE: Fix a memory leak. 2020-08-19 20:36:13 +02:00
Hermès Bélusca-Maïto 1cb7e08522
[CMD] SETLOCAL / ENDLOCAL: Save / Restore as well the current drive and current directory.
That's an actual fact, done on original MS-DOS COMMAND.COM, FreeCOM,
Windows' CMD.EXE, etc., but is strangely undocumented on MSDN documentation.

See https://www.dostips.com/forum/viewtopic.php?t=4436

Fixes some cmd_winetests.
2020-08-19 20:36:13 +02:00
Hermès Bélusca-Maïto e8e31267c5
[CMD] setlocal.c : Code style and formatting fixes 2020-08-19 20:36:13 +02:00
Hermès Bélusca-Maïto 90159e1e51
[CMD] Implement provisional support for the HIGHESTNUMANODENUMBER environment-like variable.
This variable is available only in Win7+, even if the underlying API
GetNumaHighestNodeNumber() is available in Win2003+
2020-08-19 20:36:12 +02:00
Hermès Bélusca-Maïto 04e0fe0652
[CMD] The "special" environment-like variables are available only when extensions are enabled.
The "special" variables are: CD, DATE, TIME, RANDOM,
CMDCMDLINE, CMDEXTVERSION, ERRORLEVEL (and on Win7+,
HIGHESTNUMANODENUMBER).
2020-08-19 20:36:12 +02:00
Hermès Bélusca-Maïto 41a93a4e58
[CMD] FOR: Some functionality is available only when extensions are enabled.
This is basically all the advanced functionality enabled with the /D,
/R, /L and /F flags, and the usage of enhanced variables.
2020-08-19 20:36:11 +02:00