Commit graph

109 commits

Author SHA1 Message Date
Hermès Bélusca-Maïto 3a49e26f13
[KERNEL32][PSDK][NTVDM][CONSRV] Use now-documented ReadConsoleInputEx() flag names.
Addendum to commit b8b8819c7 (r60920)

ReadConsoleInputEx() and its flags used to be undocumented.
In the meantime they became documented on MSDN, see:
https://learn.microsoft.com/en-us/windows/console/readconsoleinputex

We can therefore adopt these now-documented flag names.
2024-03-06 12:28:27 +01:00
Serge Gautherie f7d612f3e3
[BASESRV][CSRLIB][NTVDM] Add missing \n to DPRINT() calls (#5951)
and promote 1 DPRINT().
2023-12-16 23:57:35 +01:00
Andrei Miloiu 9b69ef3692
[NTVDM] Update Romanian (ro-RO) translation (#6104) 2023-12-09 20:10:47 +01:00
Serge Gautherie 3fb5957de1
[NTOS:EX][CSRSRV][WIN32K] Make a few #define more explicit/strict (#5907)
- Add parentheses around macro parameters.
- Add casts on return value for the Interlocked*UL ("Unsigned Long") macros.
2023-11-13 20:55:48 +01:00
Timo Kreuzer 2b7246fd3c [CMAKE] Add support for "IMAGEBASE default" and use it for test/sample dlls 2023-11-10 19:20:24 +02:00
Andriy Shevchenko 2ea03b5b22
[REACTOS] Fix typos in comments (#5591)
Fixing typos in code comments enhances code readability and comprehension for developers and collaborators.
2023-08-22 16:20:29 +03:00
Adam Słaboń 2ffcda90b2 [CMAKE][MVDM] Fix CMAKE_ASM16_COMPILER for non-x86 MSVC builds
Ensure that CMAKE_ASM16_COMPILER is 32-bit MASM.
It is used only for compiling 16-bit x86 ASM code on non-x86 builds.

Original patch by serrox. CORE-10452, CORE-17604

Co-authored-by: Sergey Chernov <serrox@ya.ru>
2023-08-05 16:20:22 +02:00
Andrew Dent e5993f13f0
[REACTOS] Optimize PNG images (#5492)
* [PIFMGR] Optimize png images

- Lossless optimization with `pngslim`. Saves ~50%.
- Restricted to RGBA color mode (‘c6’), for maximum compatibility at the cost of some compression.

* [ROSAPPS] Optimize png image

- Lossless optimization with `pngslim`. Saves ~10%.

* [MSTSC] Optimize png image

- Lossless optimization with `pngslim`. Saves ~56%.
- Restricted to RGBA color mode (‘c6’), for maximum compatibility at the cost of some compression.

* [Themes] Optimize png image

- Lossless optimization with `pngslim`. Saves ~20%.
- Restricted to RGB color mode (‘c2’), for maximum compatibility.
2023-07-30 22:32:34 +02:00
Hermès Bélusca-Maïto 06a0451415
[SMSS][CSRSRV] Undefine CreateProcess symbol. Name the union inside SB_API_MSG.
Undefine CreateProcess because it can be #define'd (to CreateProcessA/W)
if winbase.h is included prior (as it is in SMSS).
2022-11-14 00:10:32 +01:00
Hermès Bélusca-Maïto 9c8a8cf2aa
[CSRSRV][NTOS:PS] Misc typos fixes. 2022-11-14 00:10:30 +01:00
Hermès Bélusca-Maïto bcbfcd2278
[CSRSRV] Minimally-adapt CSRSRV to make it able to host other subsystems than Win32.
This is really ReactOS-specific, so I surround them with __REACTOS__
(even if this is our code) to differentiate these from Win2k3 behaviour,
even though they were strongly inspired by what was possible in the beta
versions of NT 3.1 (pre-3.10.404).
Interestingly, Windows 7+ partially re-introduced that functionality
(just in differencing "Windows=On" from "Off").

See https://reactos.org/wiki/User:Hbelusca/CSRSS for more information.
2022-11-08 23:46:32 +01:00
Hermès Bélusca-Maïto d8cc88ca80
[KERNEL32][BASESRV] Fix interoperability with Win2k3 regarding NLS section security. (#4828)
Partially revert some aspects of commits 5696e4ba4 and bf40c7a31.
(See PR #4340.)

In order for Win2k3 kernel32.dll to operate with our basesrv.dll (or our
kernel32.dll to operate with Win2k3 basesrv.dll), we need in particular
to have the CreateNlsSecurityDescriptor() helper to exactly take the
expected parameters. Namely, a pointer to a **user-allocated**
SECURITY_DESCRIPTOR buffer, its size (and an access mask).

The function expects its caller to provide all this, and the caller expects
the function to initialize the security descriptor buffer. Note that the
function does *NOT* allocate a new descriptor buffer to be returned!

Indeed, with the way it currently is in master, using Win2k3 kernel32
with our basesrv is now failing with the errors:
```
NLSAPI: Could NOT Create ACL - c0000023.
(subsystems/win/basesrv/nls.c:279) NLS: CreateNlsSecurityDescriptor FAILED!: c0000023
NLSAPI: Could NOT initialize Server - c0000023.
(dll/ntdll/ldr/ldrinit.c:867) LDR: DLL_PROCESS_ATTACH for dll "kernel32.dll" (InitRoutine: 77E40D95) failed
```
(and, if we ever attempted to increase the so-claimed "dummy parameter"
descriptor size in the basesrv call, we would end up with its stack
corrupted and a crash).
Conversely, using our kernel32 with Win2k3 basesrv, would end up with
basesrv receiving a wrongly-initialized descriptor that would not work
(the buffer not being initialized with the contents of a descriptor, but
instead receiving some address to a descriptor allocated somewhere else).
2022-11-01 02:34:04 +01:00
Hermès Bélusca-Maïto 6259be3afa
[CSRLIB] Remove old hack in CsrpConnectToServer(). ObjectDirectory cannot be NULL (otherwise it's caller's bug). 2022-10-29 18:52:34 +02:00
Hermès Bélusca-Maïto 141daf4de8
[CSRLIB] Add comments regarding the calculation of the data and total message lengths in CsrClientCallServer(). 2022-10-29 17:36:09 +02:00
Hermès Bélusca-Maïto 8cd01eaf25
[CSRLIB] Add SAL annotations to the CSR client functions. 2022-10-29 17:17:30 +02:00
Hermès Bélusca-Maïto d2aeaba5f8
[CSR][NTDLL] Move the CSR subsystem into its own "csr" sub-directory. (#4802)
Move CSRSS, CSRSRV there, as well as CSR client calls from NTDLL into a "CSRLIB" library.
2022-10-29 17:17:29 +02:00
Hermès Bélusca-Maïto 426598c6f7
[CSRSRV] Remove deprecated dependency on smdll. (#4799) 2022-10-26 00:41:13 +02:00
Victor Perevertkin 447ef2aa4a
[CMAKE] Do not use USE_CLANG_CL variable in CMake scripts 2022-05-27 01:37:37 +03:00
Luke Luo de972e2bc2
[TRANSLATION] Improve Simplified Chinese (zh-CN) translation (#4513)
- Changed some wording according to the translation requirements.
- Fixed some mistakes.
- Changed my name.

Reviewed-by: He Yang <1160386205@qq.com>
Reviewed-by: Stanislav Motylkov <x86corez@gmail.com>
2022-05-20 15:38:24 +03:00
George Bișoc 5696e4ba4d
[KERNEL32][BASESRV] Implement NLS section security
Implement code that deals with the security side of NLS, more specifically, create two security descriptors for NLS directory and NLS section names and let the server use such code.
2022-05-06 10:09:49 +02:00
Hermès Bélusca-Maïto ff293a1877
[CSRSRV] Acquire the necessary SE_INC_BASE_PRIORITY_PRIVILEGE at shutdown (#4461)
When increasing the base priority at shutdown, acquire the necessary
SE_INC_BASE_PRIORITY_PRIVILEGE in CsrSetToShutdownPriority(),
called by CsrShutdownProcesses(), which is necessary due to the increase
of process base priority (i.e. increase of scheduling) being done.

Dedicated to George Bișoc :)

The Shutdown privilege is however unnecessary (or unwanted) since this
has been already dealt with by the shutdown caller. Also, it will be
needed only by the caller of NtShutdownSystem() -- that we don't call
at all here.
2022-04-23 19:15:22 +02:00
Hermès Bélusca-Maïto 944b942eb2
[CSRSRV] Use the PROCESS_PRIORITY_NORMAL_FOREGROUND constant instead of hardcoding its value (== 9). 2022-04-20 03:53:45 +02:00
Wu Haotian 0c42866e64
[TRANSLATION] Review & update Simplified Chinese (zh-CN) translation (#3933)
Reviewed all Chinese Simplified translation files and updated those
inappropriate or outdated ones.

Co-authored-by: Liu Wenyuan <15816141883@163.com>
Reviewed-by: Chan Chilung <eason066@gmail.com>
Reviewed-by: He Yang <1160386205@qq.com>
Reviewed-by: Zheng Jianping <robsean@126.com>
Reviewed-by: Luo Yufan <njlyf2011@hotmail.com>
Reviewed-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Reviewed-by: Stanislav Motylkov <x86corez@gmail.com>
2022-03-31 20:30:52 +03:00
Chan Chilung 2752c42f0b
[TRANSLATION] Update Hong Kong Chinese (zh-HK) translation - Part 2 (#4347)
- Added zh-HK translation for following files:
  - [BASE/SERVICES/W32TIME]
  - [BASE/SYSTEM/...] (except CMD console only applications)
  - [FDEBUG]
  - [DLL/CPL/...] (except Wine related applications)
  - [DLL/SHELLEXT/...]
  - [DLL/WIN32/...] (not all applications are translated, and Wine related applications are excluded from this part)
  - [MODULES/ROSAPPS/APPLICATIONS/...] (not all applications are translated)
  - [SCREENSAVERS]
  - [NTVDM]
  - [USERSRV]
- Translation Improvement
- Fix header for zh-TW and zh-HK translation files

Reviewed-by: Luo Yufan <njlyf2011@hotmail.com>
Reviewed-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Reviewed-by: Stanislav Motylkov <x86corez@gmail.com>
2022-03-31 17:10:21 +03:00
Chan Chilung 171a920680
[TRANSLATION] Update Chinese Traditional (zh-TW) translation (#4154)
- Added translation for:
  - [W32TIME]
  - [MODE]
  - [TIMEOUT]
  - [MODEMUI]
  - [ARPING]
  - [FRAGINATOR]
  - and more
- Updated existing translation
- [WINNLS] Update cht (zh-TW) and zhh (zh-HK)
- [DOC] Update rules in Chinese translation notes.txt
- Wine translation sync

Some of the punctuation use in WIne has been converted to half-width,
so the punctuation will no longer synced.
2022-01-14 20:22:46 +03:00
Hermès Bélusca-Maïto 957e566a23
[APITESTS][NTVDM][SPOOLSV] Add the missing ENABLE_EXPORTS property as these EXE targets have function exports.
This became a requirement, following a previous CMake update.
Otherwise the built EXEs would not export their intended functions.

Addendum to commit d8e92b5a (see PR #1335)
CORE-15406

[LOADCONFIG] The GCC rant had nothing to do with GCC, but everything with CMake...

[SPOOLSV] Add the missing exported stubs.
2021-12-04 01:17:32 +01:00
Hermès Bélusca-Maïto addf1e87fe
[NTVDM] Log explicitly calls to Long FileName support functions in DOS INT 21h. Use MAXDWORD instead of hardcoded values. 2021-12-03 23:26:24 +01:00
Hermès Bélusca-Maïto 81d5e650de
[NTVDM] Improve DOS file search implementation. Addendum to commit 86ba2faa (r67619).
We get file matches when their attributes match and we can obtain
a valid 8.3 file name. This last condition is of upmost importance.
We cannot reliably use GetShortPathName() on the filename returned by
FindFirstFile()/FindNextFile() because the result is uncertain (one
either needs to build a full path before calling the function just to
get the final short path form, or change the current working directory
to the one where the search is being made, etc.)

The Find*file() functions return anyway the short file. name (in the
cAlternateFileName member) if the file does have such 8.3 filename and
its real name (in cFileName) is longer. Otherwise, cFileName could
already be *THE* short filename because it has the correct format for
it. Check this latter case with RtlIsNameLegalDOS8Dot3() and use it if
so. Otherwise this means the file has a long filename that cannot be
converted to short filename format (because e.g. it is in a volume where
short filenames are unavailable), and we skip such files: they wouldn't
be accessible from DOS anyways.

- Doxygen-document demFileFindFirst(), demFileFindNext() and associated
  flags and structures. Update their annotations.

This fixes TurboC 2.x installation.
2021-12-03 23:26:23 +01:00
Hermès Bélusca-Maïto fcbdab0037
[NTVDM] Trivial english typos fixes. 2021-12-03 23:26:22 +01:00
Hermès Bélusca-Maïto 2693a26e3e
[NTVDM] Create the CMOS ram file in NTVDM's own directory, instead of in whatever current directory we are running.
This fixes the age-long annoyance that wherever you ran a DOS program
with NTVDM, its cmos.ram file would be created in the same current
directory the DOS program was being started.

This created at least two problems:
- useless pollution of directories with cmos.ram files;
- for installers, e.g. of Turbo C 1.x that enumerate the install files
  from their directories to be copied/extracted somewhere, the cmos.ram
  file could then be enumerated along and cause the installation to
  interrupt and/or fail.

Now the cmos.ram file is created in the same directory NTVDM resides
(usually in System32...).
Also, debug-print out only loading errors instead of successes as well.
2021-11-28 00:26:46 +01:00
Hermès Bélusca-Maïto e0a272c95b
[NTVDM] DosCreateProcess(): Add failure checks when building the OTVDM command-line.
Addendum to commit 0609db55
2021-11-28 00:26:46 +01:00
Hermès Bélusca-Maïto 1bd0e3f9f9
[NTVDM] Retrieve the full directory of the current running NTVDM instance, to be used as a base path for opening other NTVDM system files. 2021-11-28 00:26:45 +01:00
Hermès Bélusca-Maïto 86eebc2a31
[NTVDM] disk.c: Simplify some code; unmount only present disks during cleanup (avoids useless debug-print errors). 2021-11-28 00:26:45 +01:00
Hermès Bélusca-Maïto 6823878a02
[NTVDM] Sort out some global/emulator header info, and NDK headers inclusions. 2021-11-28 00:26:44 +01:00
Hermès Bélusca-Maïto 695900f51f
[NTVDM] Silence noisy DPRINTs when starting processes; they can be re-enabled by recompiling in "advanced debugging" mode. 2021-11-28 00:26:43 +01:00
Hermès Bélusca-Maïto b849a696ef
[NTVDM] In non-STANDALONE builds, check whether we are started as a VDM and bail out if not. 2021-11-28 00:26:43 +01:00
Doug Lyons 0609db55d7
[NTVDM] Use strsafe functions for concantenation of strings in otvdm code. (#4124) 2021-11-25 21:06:05 +01:00
Doug Lyons 0f05abec82
[NTVDM] Add otya128's WineVDM integration code into ReactOS (#4113)
This is an interim solution until a more integrated solution with NTVDM is developed.
CORE-17852
2021-11-23 23:50:05 +01:00
Hermès Bélusca-Maïto 6a4ca215ab
[NTVDM] Log the command line used when starting NTVDM. 2021-11-22 03:10:14 +01:00
Hermès Bélusca-Maïto c17aeec031
[CSRSRV] Update the status.h file with updated information. 2021-11-22 00:13:35 +01:00
Hermès Bélusca-Maïto 7353af1e3d
[NTDLL:CSR][CSRSRV] Start to deprecate CSR functions removed on Windows 2003.
The server-side CsrSrvIdentifyAlertableThread and CsrSrvSetPriorityClass
functions are completely removed in Win2k3+, and are since stubbed by
CsrSrvUnusedFunction instead. They however were present up to Windows XP,
albeit with an extremely minimal implementation.

The corresponding client-side CsrIdentifyAlertableThread and CsrSetPriorityClass
now become just stubs that either trivially succeed or fail, respectively.

See https://www.geoffchappell.com/studies/windows/win32/csrsrv/api/srvinit/apidispatch.htm
for more information.

- Fix typo "al*T*ertable" --> "alertable".
- Remove ROS-specific CSRSS_IDENTIFY_ALERTABLE_THREAD that was
  deprecated since ages (at least before 2005)!
2021-11-22 00:13:34 +01:00
Hermès Bélusca-Maïto 9393fc320e
[FORMATTING] Remove trailing whitespace. Addendum to 34593d93.
Excluded: 3rd-party code (incl. wine) and most of the win32ss.
2021-09-13 03:52:22 +02:00
Hermès Bélusca-Maïto bbabe2489e
[FORMATTING][TRANSLATION] Remove trailing whitespace. Addendum to 34593d93.
Excluded: 3rd-party code (incl. wine).
2021-09-13 03:52:21 +02:00
Süleyman Poyraz 53221834c5
[TRANSLATION] Add and improve Turkish (tr-TR) translation (#3561)
Reviewed-by: Can Taşan <ctasan99@hotmail.com>
Reviewed-by: Ercan Ersoy <ercanersoy@ercanersoy.net>
Signed-off-by: Süleyman Poyraz <zaryob.dev@gmail.com>
2021-09-12 00:34:11 +03:00
Timo Kreuzer 5d8e834897 [REACTOS] Fix a number of MSVC warnings 2021-07-23 22:03:48 +02:00
George Bișoc e8277e51e2
[CSRSS] Fix MSVC AMD64 build 2021-06-25 12:42:02 +02:00
George Bișoc 03636df1e3
[CSRSS] Enable compilation of raise hard error function call code
With introduction of 74e527b, a330b56 and subsequently 2791ecd ReactOS can now properly set IOPL (I/O privilege level) for user mode trusted processes. With that said, enable the compilation of raise hard error function call code back.
2021-06-25 11:55:35 +02:00
George Bișoc f144ba8d8b
[CSRSS] Do not give IOPL to the Client/Server native process if ran on a AMD64 system
ProcessUserModeIOPL is strictly implemented for 32-bit architecture so it doesn't make any sense for CSRSS to gather user mode I/O privilege when that won't work anyway.
2021-06-25 10:33:28 +02:00
Hermès Bélusca-Maïto abd4c818dc
[CSRSRV] Fix uninitialized variable warning detected by Clang. (#3619)
CORE-17545

subsystems/win32/csrsrv/api.c:63:9: warning: variable 'ServerDll' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized]
    if ((ServerId >= CSR_SERVER_DLL_MAX) ||
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
subsystems/win32/csrsrv/api.c:67:76: note: uninitialized use occurs here
        DPRINT1("CSRSS: %lx is invalid ServerDllIndex (%08x)\n", ServerId, ServerDll);
                                                                           ^~~~~~~~~
2021-05-05 17:24:14 +02:00
Hermès Bélusca-Maïto c5b87ac6ac
[CSRSRV] Display some other DPRINTs only when CSRSRV is compiled in debugging mode.
Addendum to 835f3ef1.
2021-05-05 17:24:13 +02:00