Commit graph

36 commits

Author SHA1 Message Date
Joachim Henze 4a6b865483 [0.4.13][NTOS][WIN32SS] Fix double free in ObCreateObject
Backport the following commits:
0.4.15-dev-6401-g 53b30e3f3b [NTOSKRNL][NTGDI] Formatting addendum, no functional change
0.4.15-dev-5487-g e7bbbf049e [NTOS] Fix double free on allocation failure in ObCreateObject

Just for verifying that the size didn't increase anywhere:

ntoskrnl.exe GCC8.4.0dbg RosBEWin2.2.2 master               5.124.096
ntoskrnl.exe GCC4.7.2dbg RosBEWin2.1.6 0.4.14  4.413.440 -> 4.413.440
ntoskrnl.exe GCC4.7.2dbg RosBEWin2.1.6 0.4.13  4.367.360 -> 4.367.360
ntoskrnl.exe GCC4.7.2dbg RosBEWin2.1.6 0.4.12  4.377.600 -> 4.377.600
ntoskrnl.exe GCC4.7.2dbg RosBEWin2.1.6 0.4.11  4.377.088 -> 4.377.088
ntoskrnl.exe GCC4.7.2dbg RosBEWin2.1.6 0.4.10  4.344.320 -> 4.344.320
ntoskrnl.exe GCC4.7.2dbg RosBEWin2.1.6 0.4. 9  4.311.552 -> 4.311.552
ntoskrnl.exe GCC4.7.2dbg RosBEWin2.1.6 0.4. 8  4.296.704 -> 4.296.704
ntoskrnl.exe GCC4.7.2dbg RosBEWin2.1.6 0.4. 7  4.231.168 -> 4.231.168

udfs.sys     GCC8.4.0dbg RosBEWin2.2.2 master             835.584
udfs.sys     GCC4.7.2dbg RosBEWin2.1.6 0.4.14  745.472 -> 745.472
udfs.sys     GCC4.7.2dbg RosBEWin2.1.6 0.4.13  745.472 -> 745.472
udfs.sys     GCC4.7.2dbg RosBEWin2.1.6 0.4.12  749.568 -> 749.568
udfs.sys     GCC4.7.2dbg RosBEWin2.1.6 0.4.11  749.568 -> 749.568
udfs.sys     GCC4.7.2dbg RosBEWin2.1.6 0.4.10  749.568 -> 749.568
udfs.sys     GCC4.7.2dbg RosBEWin2.1.6 0.4. 9  749.568 -> 749.568
udfs.sys     GCC4.7.2dbg RosBEWin2.1.6 0.4. 8  749.568 -> 749.568
udfs.sys     GCC4.7.2dbg RosBEWin2.1.6 0.4. 7  749.568 -> 749.568

user32.dll   GCC8.4.0dbg RosBEWin2.2.2 master               1.585.152
user32.dll   GCC4.7.2dbg RosBEWin2.1.6 0.4.14  1.448.448 -> 1.448.448
user32.dll   GCC4.7.2dbg RosBEWin2.1.6 0.4.13  1.445.376 -> 1.445.376
user32.dll   GCC4.7.2dbg RosBEWin2.1.6 0.4.12  1.455.616 -> 1.455.616
user32.dll   GCC4.7.2dbg RosBEWin2.1.6 0.4.11  1.453.056 -> 1.453.056
user32.dll   GCC4.7.2dbg RosBEWin2.1.6 0.4.10  1.434.624 -> 1.434.624
user32.dll   GCC4.7.2dbg RosBEWin2.1.6 0.4. 9  1.422.336 -> 1.422.336
user32.dll   GCC4.7.2dbg RosBEWin2.1.6 0.4. 8  1.421.824 -> 1.421.824
user32.dll   GCC4.7.2dbg RosBEWin2.1.6 0.4. 7  1.418.752 -> 1.418.752

win32k.sys   GCC8.4.0dbg RosBEWin2.2.2 master               3.477.504
win32k.sys   GCC4.7.2dbg RosBEWin2.1.6 0.4.14  2.904.064 -> 2.904.064
win32k.sys   GCC4.7.2dbg RosBEWin2.1.6 0.4.13  2.895.872 -> 2.895.872
win32k.sys   GCC4.7.2dbg RosBEWin2.1.6 0.4.12  2.887.680 -> 2.887.680
win32k.sys   GCC4.7.2dbg RosBEWin2.1.6 0.4.11  2.867.200 -> 2.867.200
win32k.sys   GCC4.7.2dbg RosBEWin2.1.6 0.4.10  2.863.104 -> 2.863.104
win32k.sys   GCC4.7.2dbg RosBEWin2.1.6 0.4. 9  2.834.432 -> 2.834.432
win32k.sys   GCC4.7.2dbg RosBEWin2.1.6 0.4. 8  2.830.336 -> 2.830.336
win32k.sys   GCC4.7.2dbg RosBEWin2.1.6 0.4. 7  2.830.336 -> 2.830.336
2023-08-02 00:36:48 +02:00
Pierre Schweitzer 7898b2eaa3
[NTOSKRNL] Disable LUID mapping until it's properly implemented 2019-06-01 14:40:54 +02:00
Pierre Schweitzer 1c4e44592c
[NTOSKRNL] Save ProtectionMode value on boot 2019-05-21 19:28:16 +02:00
Pierre Schweitzer a33a69b3f4
[NTOSKRNL] Save ObjectSecurityMode value on boot 2019-05-18 10:37:24 +02:00
Thomas Faber f86360fdbc
[NTOS:CM] Do not call ZwQueryObject with a zero-size buffer. CORE-15882
Actually fixes ntdll_apitest:NtLoadUnloadKey.
2019-05-07 13:52:50 +02:00
Thomas Faber d3fa3b0ca2
[NTOS:CM] Check for correct status from ZwQueryObject. CORE-15882
Fixes regression in ntdll_apitest:NtLoadUnloadKey from d570482bc7.
2019-05-05 17:57:12 +02:00
Thomas Faber 2f1fab41fa
[NTOS:CM] Reduce the size of some unnecessarily large stack buffers. CORE-15882 2019-05-05 10:39:26 +02:00
Thomas Faber 047a3bf79a
[NTOS:CM] Simplify CmpGetRegistryPath to avoid unnecessary stack buffers. CORE-15882 2019-05-05 10:39:22 +02:00
Thomas Faber d570482bc7
[NTOS:CM] Avoid a fixed-length stack buffer in CmpCmdHiveOpen. CORE-15882 2019-05-05 10:39:18 +02:00
Thomas Faber 26ab9f8a03
[NTOS:CM] Avoid a fixed-length stack buffer in CmpAddToHiveFileList. CORE-15882 2019-05-05 10:39:14 +02:00
Hermès Bélusca-Maïto 884db2ea06
[NTOS:CM] In CmpParseKey(), do not assert but instead correctly return failure if CmpHandleExitNode() doesn't return a valid node, or CmpCreateKeyControlBlock() fails. 2019-04-22 21:09:10 +02:00
Hermès Bélusca-Maïto 83fdb9a6d9
[NTOS:CM] Set and reset the CMHIVE HiveIsLoading flag adequately. Fix an assertion in CmFlushKey() and reset the CMHIVE ViewLockOwner when releasing the view lock. 2019-02-17 01:21:35 +01:00
Timo Kreuzer 71fefa32db
[NDK][NTOS] Add global definition of INIT_FUNCTION/INIT_SECTION (#779)
* Add an NDK header to define INIT_FUNCTION/INIT_SECTION globally
* Use _declspec(allocate(x)) and _declspec(code_seg(x)) on MSVC versions that support it
* Use INIT_FUNCTION on functions only and INIT_SECTION on data only (required by MSVC)
* Place INIT_FUNCTION before the return type (required by MSVC)
* Make sure declarations and implementations share the same modifiers (required by MSVC)
* Add a global linker option to suppress warnings about defined but unused INIT section
* Merge INIT section into .text in freeldr
2018-12-30 12:19:11 +01:00
Eric Kohl 167bffd80f [NTOSKRNL] Add and call the CmpSaveBootControlSet() stub. 2018-12-16 12:49:59 +01:00
Pierre Schweitzer b9423f07d9
[NTOSKRNL] Add support for the ObUnsecureGlobalNames registry key 2018-10-27 12:01:38 +02:00
Pierre Schweitzer 8e51bb6510
[NTOSKRNL] Reduce noise 2018-10-27 10:04:22 +02:00
Hermès Bélusca-Maïto 83d5c711b3
[NTOS] Drastically reduce the hackish function CmpGetRegistryPath() for the text-mode setup case (it should ultimately completely disappear).
svn path=/branches/setup_improvements/; revision=75163
2018-10-25 00:40:03 +02:00
Hermès Bélusca-Maïto 2ed65d1555
[NTOS] Configuration Manager fixes.
- Rework CmpSetSystemValues() and remove its 1st-stage text-mode setup hack, since a real registry hive will be used for 1st-stage either.
- Lock, then unlock the registry in NtInitializeRegistry when initializing the hives & flusher.
- Call CmpInitializeHiveList() (i.e., initialize the other hives like \Software, \User, \.Default) only when we are not in setup-mode.

svn path=/branches/setup_improvements/; revision=74747
2018-10-25 00:40:02 +02:00
Hermès Bélusca-Maïto e2cb7b50b4
[NTOS] Remove some hacks that are not needed anymore, since a real registry hive will be used in 1st-stage as well.
This reverts a7c26408 (r53255) and ff75ae1b (r53694), and a hack from 6075ae9a (r46690).

svn path=/branches/setup_improvements/; revision=74745
svn path=/branches/setup_improvements/; revision=74746
2018-10-25 00:40:00 +02:00
Hermès Bélusca-Maïto 0e6bc236a1
[NTOS:CM] CmpCmdHiveOpen(): Resolve FileAttributes->RootDirectory when a hive file name is provided relative to it.
Fixes registry hive loading. CORE-13448
2018-10-22 00:39:50 +02:00
Hermès Bélusca-Maïto d61c00c252
[NTOS:CM] Implement more support for force-unloading registry hives.
CORE-13448 CORE-10705
2018-10-22 00:05:13 +02:00
Hermès Bélusca-Maïto 16752875db
[NTOS:CM] Add extra validation for the information class parameter in NtEnumerateValueKey(). 2018-10-21 18:12:08 +02:00
Hermès Bélusca-Maïto 49e08b23ce
[NTOS:CM] Improve the capture of user-mode parameters.
- Improve the capture of OBJECT_ATTRIBUTES parameters that are passed
  (by pointer) to the Cm* helper functions, and the capture of
  UNICODE_STRINGs.

- Correctly differentiate user-mode vs. kernel-mode root directory handles
  (in OBJECT_ATTRIBUTES): note that most of the Cm* APIs expect their
  parameters to be kernel-mode (pointers, handles...).

CORE-13448
2018-10-21 17:11:50 +02:00
Hermès Bélusca-Maïto 29b2fdcc4d
[NTOS:CM] Minor fixes.
- Validate the information class parameter in NtQueryValueKey().
- Call the post-callback in NtSetValueKey() only if the callback
  has been registered and the CmSetValueKey() call is executed.
2018-10-20 19:52:34 +02:00
Hermès Bélusca-Maïto 5322969186
[NTOS:CM] Reuse the saved previous-mode from the ExGetPreviousMode() calls. 2018-10-20 19:52:32 +02:00
Hermès Bélusca-Maïto 4caf391324
[NTOS][MKHIVE] Minor code formatting. 2018-10-14 15:59:34 +02:00
Serge Gautherie 7d6bda16c6
[REACTOS] Improve how some ASSERTMSG() message values are printed: enforce ending "\n".
NB: Not touching calls in "third-party" code: class and classpnp.
2018-08-08 22:03:45 +02:00
Hermès Bélusca-Maïto de87a936ce
[NTOS] Demote an ASSERT to a mere DPRINT since we only support registry hives with cluster size == 1 in any case so far (other sizes are UNIMPLEMENTED!) 2018-05-19 22:07:06 +02:00
Thomas Faber 6e750d189a
[NTOS:CM] Correctly interpret RtlCreateUnicodeString return value. CORE-14271 2018-01-31 10:37:56 +01:00
Mark Jansen 7b398514f1 [NTOS] Limit the spam from NtNotifyChangeMultipleKeys.
CORE-13125
2018-01-08 22:24:54 +01:00
Colin Finck f5d366b200
[NTOS:CM] Improve code in cmsysini.c (#216)
Based on an original patch by Timo Kreuzer, with modifications by me to adapt it to latest HEAD and use a single exit path through the Cleanup label. This reliably frees all allocated handles.

The original code returns STATUS_SUCCESS for many cases. This has been preserved.
In the future, it should be checked though whether returning success is appropriate for all these cases.

CORE-6844
2018-01-06 13:27:41 +01:00
Hermès Bélusca-Maïto 0b2bbd1125
[NTOS] Addendum to da81345: Fix checks when a hive is opened in shared mode. 2017-11-13 00:27:41 +01:00
Hermès Bélusca-Maïto da8134527b
[NTOS] Do not perform hive write operations when we are not supposed to.
- When we are in LiveCD mode (more generally, when hives are shared), load
  the system hives as volatile.
- Ignore hive write operations when everything operates in read-only mode
  and just return success instead.
- Just return success on hive file I/O if no file is associated with a
  given hive. This happens when e.g. a CM hive has a primary but no log.
2017-11-12 22:02:45 +01:00
Serge Gautherie abb6ad90f5 [MOUNTMGR][NTOSKRNL] ZwWriteFile() calls: Use explicit NULL instead of ambiguous 0. CORE-13910 2017-10-29 10:04:40 +01:00
Serge Gautherie 11baa0d723 [NTOSKRNL][ROSSYM] ZwReadFile() calls: Use explicit NULL instead of ambiguous 0. CORE-13910 2017-10-27 13:38:02 +02:00
Colin Finck c2c66aff7d Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00