Commit graph

55 commits

Author SHA1 Message Date
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
Hermès Bélusca-Maïto
37b2c1450c
[CSRSRV] s/LPWSTR/PWSTR/ as the former is not NT type. 2020-04-15 02:06:57 +02:00
Julen Urizar Compains
f7cab5a1d4
[TRANSLATION] Multiple minor fixes and addings. (#2516)
- Applications: eventvwr, fltmgr, servman.
- rosapps: arping, CTM, fontsub, fraginator, imagesoft, systeminfo, vcdcontroltool, vgafontedit.
- CPLs: desk.cpl.
- ReactOS Setup GUI app.
- Screensavers: butterflies, maze, Starfield.
- System: NTVDM, printing/monitors/localmon; the freeze dialog in user32, the error strings in usersrv.
2020-04-09 18:13:46 +02:00
Hermès Bélusca-Maïto
93beefacbe
[CMAKE][FREELDR] Take the global defines into account when compiling ASM files.
Now the SARCH_xxx can be used in ASM files too.
Dedicated to Dmitry Borisov ;)
2020-03-06 22:55:12 +01:00
Mas4hmad
228eeb7d79 [TRANSLATION] Update Indonesian Translation (#2268)
- Update Indonesian translation for:
  BROWSEUI.DLL, COMCTL32.DLL, DEVMGR.DLL, IEFRAME.DLL, NETID.DLL, SHELL32.DLL,
  SYSSETUP.DLL, TIMEDATE.CPL, APPWIZ.CPL, ACCESS.CPL, DESK.CPL and TASKMGR.EXE.

- Add Indonesian translation for: MSHTML.DLL, OLEAUT32.DLL, INPUT.CPL and NTVDM.EXE.
2020-01-26 18:29:38 +01:00
Timo Kreuzer
08c6d21e1f [REACTOS] Fix warning C4146: unary minus operator applied to unsigned type, result still unsigned 2019-07-27 11:21:28 +02:00
Pierre Schweitzer
222ace7c6c [BASESRV] Implement LUID mapped drive arrival/removal notification
CORE-16114
2019-06-30 23:07:54 +02:00
Hermès Bélusca-Maïto
6c5d38c22a
[NTVDM] Fix whitespace. 2019-06-23 02:12:24 +02:00
Pierre Schweitzer
f3c71baa0c
[BASESRV] Handle failures instead of asserting 2019-05-18 13:37:55 +02:00
Pierre Schweitzer
8159b205b6
[BASESRV] Take ObjectSecurityMode and ProtectionMode into account when creating DACLs 2019-05-18 11:05:30 +02:00
Pierre Schweitzer
e1e6cfd312
[BASESRV] Misc fixes: use BaseSrvHeap and silent a DPRINT 2019-05-09 08:57:43 +02:00
Pierre Schweitzer
bd7b0c96c6
[BASESRV] Make Buffer MAX_PATH big again 2019-05-08 20:39:57 +02:00
Pierre Schweitzer
20f5797386
[BASESVR] Take SessionId into account while creating BNO directory 2019-05-08 20:35:31 +02:00
Pierre Schweitzer
a802726577
[BASESRV] Fix the BNO string buffer usage
This avoids reinitializing it before use.
2019-05-08 20:08:13 +02:00
Pierre Schweitzer
0a392b188a
[BASESRV] Rewrite DOS devices management
This will notably bring support for DOS mapping with LUID devices
(not yet supported in the kernel, though).
This also reduces complexity (and thus memory usage) with the "history"
thing. Multiple targets are stored in the link target as MULTI_SZ string.

This fixes regressions introduced with kernel32 fixes/rewrites.
2019-05-08 18:34:28 +02:00
Pierre Schweitzer
eea0beca35
[BASESRV] Enable the ProtectionMode query code
And make it global
2019-05-08 18:34:28 +02:00
Pierre Schweitzer
6e4f0365e3
[BASESRV] Make SessionId global 2019-05-08 18:34:28 +02:00
Jérôme Gardou
23373acbb9 [CMAKE] Use modules instead of shared libraries
There is no need to compile our DLLs as shared libraries since we are
managing symbols exports and imports through spec files.

On my system, this reduces the configure-time by a factor of two.
2019-04-06 17:43:38 +02:00
Timo Kreuzer
0493e8e432 [MVDM] hack-fix Clang-CL build 2019-02-12 19:31:33 +01:00
Andrew Cook
5bfe6a5376 [mvdm] Fix missing pointer dereference
Original code compared against the pointer value rather
than the first byte
2019-02-09 11:53:55 +01:00
Hermès Bélusca-Maïto
19f6fc2525
[MVDM] Use again the correct CMAKE_C_COMPILER to pre-process the ASM code (addendum to 09c06a2f). 2019-01-27 02:40:10 +01:00
Luo Yufan
95564d5e30 [TRANSLATION] Update Chinese translation. (#1223)
[CLIPBRD][SOLITAIRE][RAPPS][REGEDIT][WINHLP32][WORDPAD][FDEBUG][SYSDM][BROWSEUI][DEVMGR][IEFRAME][OLEDLG][SHELL32][SYSSETUP][INF][WINFILE][NTVDM][USER32]
2019-01-07 00:35:11 +09:00
David Quintana
01e5cb0c04
Resource file strings cleanup (#581)
[CMDUTILS/AT] Fix missing translation strings in certain files.
[NOTEPAD] Fix SUBLANG code to brazillian.
[RAPPS] Fix missing translation strings in certain files.
[FDEBUG] Fix translation string ID.
[CPL/INPUT] Fix missing translation strings in certain files.
[ACPPAGE] Fix incorrect resource IDs.
[NETSHELL] Fix incorrect resource IDs.
[DEVMGR] Fix missing translation strings in certain files.
[LSASRV] Fix missing translation strings in certain files.
[RASDLG] Fix missing translation strings in certain files.
[SHELL32] Fix missing translation strings and incorrect resource IDs.
[TAPIUI] Fix missing translation strings in certain files.
[WINFILE] Fix incorrect resource IDs.
[NTVDM] Fix missing translation strings in certain files.
[USERSRV] Fix missing translation strings in certain files.
[BROWSEUI] One more missing string.
[FLTMC] Fix missing translation strings in certain files.

Detected using the TransDiffer tool (early alpha).
This doesn't include everything anymore, but I wanted to get the PR out of the way.
2019-01-05 15:44:16 +01:00
Ercan Ersoy
44323e610f [TRANSLATION] Turkish translations of many components. (#1026) 2018-11-11 18:13:48 +01:00
Pierre Schweitzer
827ed4b146 [NTVDM] Allow opening files with write access on CDROM
Some applications, run on a CDROM, may attempt to open
a file with write access. CDFS driver will deny such
request in ReactOS (but also in Windows NT). Then, to
restore that behavior from old Windows (9X), our ntvdm,
as Microsoft ntvdm will attempt to reopen the file only
with read access, if opening failed because of denied access
and if the file is on a CDROM.

CORE-15211
2018-10-20 17:27:53 +02:00
Mark Jansen
44898a4ea4
[NTVDM] Implement INT21, AX=4408, Determine if a block device is removable. 2018-10-20 00:14:44 +02:00
Katayama Hirofumi MZ
31019e8c0c [TRANSLATION] Update Romanian translation (#851)
Translation from Stefan Fulea.
CORE-15023
2018-09-14 11:04:36 +02:00
Adam Słaboń
af3d426685 [TRANSLATION] Polish translation update (#781)
In addition: fix the encoding of the comdlg32 and ntvdm polish resource files.
2018-08-20 17:00:33 +02:00
Timo Kreuzer
cf77354dce [REACTOS] Fix 64 bit issues 2018-08-04 19:19:34 +02:00
Timo Kreuzer
807331436e [MVDM] Fix 64 bit issues 2018-08-04 19:19:34 +02:00
Thomas Faber
536623950c
[CMAKE] Fix command.com livecd.lst entry. CORE-14509
Spotted by Hermès.
2018-03-30 21:22:33 +02:00
Thomas Faber
f9e1e23dab
[CMAKE] Avoid use of the LOCATION property for asm16 files. CORE-14509
In particular, ntvdm needs to post-process command.com, so this adds
a BINARY_PATH property to such files instead.
2018-03-30 20:28:25 +02:00
Hermès Bélusca-Maïto
19b18ce238
[MVDM] Update some of the file headers to their new versions. 2018-03-25 16:19:29 +02:00
Erdem Ersoy
ba3f074320 [TRANSLATIONS] Update the email address and add a note in the Turkish translation document (#271) 2018-01-07 22:09:42 +01:00
Amine Khaldi
5ef2c4515e [NTVDM] Move the def file out of the source files list. Rename some variables and functions. #179 2017-12-24 00:04:15 +01:00
Amine Khaldi
d822478e06 [NTVDM] Missed this file. 2017-12-23 23:59:39 +01:00
Amine Khaldi
9716814879 [NTVDM] Deduplicate IsConsoleHandle() using the correct version pointed by Hermès. #179 2017-12-23 23:56:04 +01:00
Amine Khaldi
09c06a2f45 [CLANG-CL] Initial commit that allows us to compile ReactOS with clang-cl. 2017-11-23 14:09:57 +01:00