Commit graph

92 commits

Author SHA1 Message Date
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
Jérôme Gardou 9ef5a7eb7a [CMAKE] Fix compilation with newer windres versions
Also use clang as preprocessor when using it
Also, use *our* headers instead of the platform ones
2021-04-27 11:54:12 +02:00
Jérôme Gardou e6bea426f3 [CSRSRV] Fix comment 2021-03-23 18:35:13 +01:00
Jérôme Gardou 7054cd10b1 [CSRSRV] Fix locking logic when destroying threads & processes 2021-03-23 18:17:44 +01:00
Serge Gautherie 63007901fd
[CSRSRV] CsrApiHandleConnectionRequest(): Remove ASSERT() redundant condition (#2858)
Detected by Cppcheck: redundantCondition.
Addendum to 835f3ef1.
2021-03-04 22:54:00 +01:00
Hermès Bélusca-Maïto 731eddfe40
[BASESRV] Re-enable and actually fix the CsrValidateMessageBuffer() checks in BaseSrvDefineDosDevice(). (#3304)
Addendum to commit 0a392b18.

The actual problem that existed all along was that the buffers being
validated with CsrValidateMessageBuffer() were not the correct ones!

What had to be checked is the string buffer **INSIDE** the UNICODE_STRING
structures! Indeed, it is these buffers that we are allocating on client side,
see https://github.com/reactos/reactos/blob/9b421af1/dll/win32/kernel32/client/dosdev.c#L324-L336

Dedicated to Pierre Schweitzer.
2020-10-30 01:58:16 +01:00
Hermès Bélusca-Maïto f4279fc356
[CSRSRV] Clarify few comments, and use MAXULONG. 2020-10-30 01:55:16 +01:00
Hermès Bélusca-Maïto c7c0b09eb6
[BASESRV] Use the correct value for the last parameter of a CsrValidateMessageBuffer() call. 2020-10-17 16:55:56 +02:00
Serge Gautherie b5af1eb44a
[CSRSRV] CsrUnhandledExceptionFilter: Check RtlAdjustPrivilege() result (#2864)
And remove unused NtRaiseHardError() Status assignment.

Detected by Cppcheck: redundantAssignment.
Related to commit d221bdfb (r55647).
2020-06-01 20:20:31 +02:00
Serge Gautherie 4425bd8db3
[CSRSRV] CsrSetProcessSecurity(): Check 1st NtQueryInformationToken() result (#2862)
Also:
* Add 1 NtClose(hToken), in an error case.
* Do not call RtlFreeHeap(..., ..., NULL).

Follow-up to #2857.
2020-06-01 14:17:29 +03:00
Serge Gautherie 8fde48b5d7
[CSRSRV] CsrGetProcessLuid(): Check 1st NtQueryInformationToken() result too (#2857)
Detected by Cppcheck: redundantAssignment.
Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2020-05-25 23:52:35 +02:00
Serge Gautherie d59d74fb69
[NTVDM] GetNextFreeVDDEntry(): Remove 'Entry' redundant initialization (#2859)
Detected by Cppcheck: redundantInitialization.
Addendum to ed874b41 (r61283).
2020-05-25 23:49:47 +02:00
Hermès Bélusca-Maïto 1815aae877
[CSRSRV] Addendum to e3a70662: Fix build.
Since indeeed the memcpy/move type of functions usually don't operate on
pointers to 'volatile' data, don't make ClientCaptureBuffer volatile.
Instead when retrieving the values of its 'Size' and 'PointerCount'
members (see the SEH block), use the so-called technique of "volatile
glasses" [1], where the pointer will be explicitly casted to "volatile TYPE*"
where needed.

[1]: https://docs.microsoft.com/archive/blogs/itgoestoeleven/why-your-user-mode-pointer-captures-are-probably-broken
2020-04-15 15:59:08 +02:00
Hermès Bélusca-Maïto e3a7066279
[CSRSRV] CsrCaptureArguments(): Tell the compiler the contents ClientCaptureBuffer points to has a volatile character.
See https://docs.microsoft.com/fr-fr/archive/blogs/itgoestoeleven/why-your-user-mode-pointer-captures-are-probably-broken
for more details.

Since the contents of ClientCaptureBuffer is in the shared memory, the
client could modify it while it is being probed and captured, and so we
have to avoid any potential compiler optimizations regarding the
captured "Length = ClientCaptureBuffer->Size" and
"PointerCount = ClientCaptureBuffer->PointerCount" values.
2020-04-15 14:14:06 +02:00
Hermès Bélusca-Maïto 7e2db77338
[CSRSRV] Improve validation of CSR API Message's capture buffers.
- Improve capture buffer validation in CsrCaptureArguments(), by
  implementing the checks done by Windows 2003 (NT 5.2) described
  in section "Server-Side Validation and Capture" of the article
  https://www.geoffchappell.com/studies/windows/win32/csrsrv/api/apireqst/capture_header.htm

- In CsrReleaseCapturedArguments(), protect the data copy back into
  the client buffer within a SEH block.
2020-04-15 02:07:00 +02:00
Hermès Bélusca-Maïto 358dd50d61
[CSRSRV] CsrCaptureArguments() and CsrReleaseCapturedArguments(): Use better names for the capture buffers.
Rename inaccurate names 'LocalCaptureBuffer' and 'RemoteCaptureBuffer'
into 'ClientCaptureBuffer' and 'ServerCaptureBuffer' respectively.
(Recall: CSRSRV is the 'Server', and any app doing LPC calls to it is
the 'Client'.)
2020-04-15 02:06:59 +02:00
Hermès Bélusca-Maïto dd77ac67d0
[CSRSRV] Protect the Server DLL entrypoint calls under SEH. 2020-04-15 02:06:58 +02:00
Hermès Bélusca-Maïto 835f3ef13d
[CSRSRV] Only when CSRSRV is compiled in debugging mode, should we display debugging messages and support debug breakpoints.
Also, trigger the less fatal breakpoints only if CSRSS/CSRSRV is being
debugged (the 'BeingDebugged' flag is set in the current PEB). This will
avoid any unhandled breakpoint exceptions when testing/fuzzing running
debug builds of ReactOS without any debugger attached.
2020-04-15 02:06:58 +02:00