Pierre Schweitzer
daf9743c7b
[NTOSKRNL] Check that caller has the priviliege to unload a driver
...
Also, probe the service name when unloading a driver if called from
user-mode. This will avoid that userland applications can trigger an
invalid read in the kernel (and thus, a BSOD).
CORE-15468
2018-12-20 08:50:51 +01:00
Eric Kohl
b67dbdbea5
[NTOSKRNL] Fix indentation. No code changes.
2018-12-19 19:18:21 +01:00
Eric Kohl
7e56b21ad6
[NTOSKRNL] Fix indentation. No code changes.
2018-12-19 19:18:20 +01:00
Eric Kohl
e8d16d0a7d
[NTOSKRNL] Fix indentation. No code changes.
2018-12-16 10:30:23 +01:00
Eric Kohl
12fdc129cf
[NTOSKRNL] IopGetDeviceProperty: Send an IRP_MN_QUERY_CAPABILITIES request to the device in order to query the power capabilities.
2018-12-10 00:37:04 +01:00
Pierre Schweitzer
67e7399164
[NTOSKRNL] Use proper enum type for IopCreateSecurityDescriptorPerType()
2018-12-04 19:20:47 +01:00
Pierre Schweitzer
73e7a5d474
[NTOSKRNL] Use the appropriated security descriptor when creating a device
...
CORE-9176
2018-12-04 19:13:57 +01:00
Pierre Schweitzer
36c38c45ee
[NTOSKRNL] Implement IopCreateDefaultDeviceSecurityDescriptor() and IopCreateSecurityDescriptorPerType()
...
CORE-9176
2018-12-04 19:13:57 +01:00
Andrew Boyarshin
198601a101
[NTOS:IO] Tiny improvement to debug message
...
Add quotes around string, since it is often empty, thus confusing in log.
2018-11-25 11:31:12 +01:00
Hermès Bélusca-Maïto
f87d9caf77
[NTOS:IO] Finally remove the dreadful IopParseDevice() hack! \o/
2018-11-25 09:00:40 +01:00
Pierre Schweitzer
a0c33934fc
[NTOSKRNL] Properly check for negative values in IoCheckEaBufferValidity()
...
CID 1441355, 1441382
2018-11-16 22:07:08 +01:00
Hermès Bélusca-Maïto
cbaa8e7dfb
[NTOS:IO] RAW-FS: Few improvements.
...
- Simplify the volume-deletion code in RawCheckForDismount().
- Fixes the OpenCount check in RawClose(): the VCB mutex must be
released when the volume has not been dismounted, either because
OpenCount != 0 or because RawCheckForDismount() returned FALSE.
- Explicitly use VCB_STATE_LOCKED instead of hardcoding its value.
- In IRP_MN_VERIFY_VOLUME handling, lock the volume before playing
with it, and again let the volume be dismounted only if OpenCount == 0
(and the IoDeleteDevice() call is done by RawCheckForDismount()).
2018-11-11 21:56:18 +01:00
Hermès Bélusca-Maïto
a5ead049d9
[NTOS:IO] RAW-FS: Minor code formatting only.
2018-11-11 21:56:17 +01:00
Pierre Schweitzer
03294dd097
[NTOSKRNL] Rewrite IoCheckEaBufferValidity() so that it's less magic
...
And make its coding style consistent with our rules
2018-10-27 22:16:37 +02:00
Pierre Schweitzer
8e51bb6510
[NTOSKRNL] Reduce noise
2018-10-27 10:04:22 +02:00
Hermès Bélusca-Maïto
cb69c4c691
[NTOS] Add some DPRINTs in IopLoadServiceModule() and IopOpenRegistryKeyEx() to investigate why these 1st-stage text-mode hacks may be, or are (respectively) still needed.
...
svn path=/branches/setup_improvements/; revision=74748
2018-10-25 00:40:03 +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
Pierre Schweitzer
0b713d4fa0
[NTOSKRNL] On open, verify and validate the hint device object if any
2018-10-05 10:49:59 +02:00
Pierre Schweitzer
779d87b483
[NTOSKRNL] Implement IopCheckTopDeviceHint()
2018-10-05 10:49:59 +02:00
Pierre Schweitzer
670a7ac718
[NTOSKRNL] In IoGetRelatedDeviceObject(), validate hint is on the stack before returning it
2018-10-05 10:49:59 +02:00
Pierre Schweitzer
161b6728ef
[NTOSKRNL] Implement IopVerifyDeviceObjectOnStack()
2018-10-05 10:49:59 +02:00
Pierre Schweitzer
2a182931b6
[NTOSKRNL] A bit of cleanup in Io*FilterContext()
2018-10-04 22:24:52 +02:00
Pierre Schweitzer
5f0d02eb52
[NTOSKRNL] Implement IoChangeFileObjectFilterContext()
2018-10-04 19:30:39 +02:00
Pierre Schweitzer
a43fb5e054
[NTOSKRNL] Implement IoGetFileObjectFilterContext()
2018-10-04 19:30:38 +02:00
Pierre Schweitzer
e19e907a2c
[NTOSKRNL] Quickly check for alignment in NtRead/WriteFile
...
This quick check based on bits and operation is for 2^ based
sector sizes (most of the cases) and will perform faster than
the modulo operation which is still used in fallback in case
the sector size wouldn't be a power of 2.
2018-10-04 10:45:10 +02:00
Pierre Schweitzer
44155053cd
[NTOSKRNL] Use captured variable to check parameters in NtRead/WriteFile
2018-10-04 10:45:10 +02:00
Pierre Schweitzer
bf59669065
[NTOSKRNL] On read/write, also check buffer respects device alignment requirements
2018-10-04 07:56:23 +02:00
Pierre Schweitzer
1bd25c5c24
[NTOSKRNL] When checking for byte offset alignment, tolerate some magic values
2018-10-04 07:53:12 +02:00
Eric Kohl
fd33402104
[NTOSKRNL] NtReadFile/NtWriteFile: If a file has been opened for non-cached access, Length and ByteOffset must be sector size aligned.
...
This fixed two ntdll apitests.
2018-10-04 01:17:58 +02:00
Pierre Schweitzer
d8f22735ed
[NTOSKRNL] In IopQueryNameInternal(), enclose output copy in a SEH statement
2018-10-03 22:55:23 +02:00
Pierre Schweitzer
15b9a6aa4c
[NTOSKRNL] Call IoCreateFileSpecifyDeviceObjectHint with the hint if it was specified
2018-10-03 21:29:12 +02:00
Pierre Schweitzer
520f404e9c
[NTOSKRNL] In IoQueryFileDosDeviceName(), in case of an error, return appropriate status
2018-10-03 17:08:42 +02:00
Pierre Schweitzer
8c6c5a92e8
[NTOSKRNL] Implement DOS name query in IopQueryNameInternal()
2018-10-03 13:56:18 +02:00
Pierre Schweitzer
769157f6ff
[NTOSKRNL] Allow FileNameInformation not to be implemented in storage stack
2018-10-03 13:52:05 +02:00
Pierre Schweitzer
46bda8a4c6
[NTOSKRNL] In IopQueryNameInternal() don't copy name if it's not valid
2018-10-03 13:50:16 +02:00
Pierre Schweitzer
4a7e89770e
[NTOSKRNL] Implement IoQueryFileDosDeviceName()
2018-10-03 11:56:21 +02:00
Pierre Schweitzer
abfddca8bb
[NTOSKRNL] Stub support for querying DOS name when parsing FO name
2018-10-03 11:45:08 +02:00
Pierre Schweitzer
a1401a7577
[NTOSKRNL] Use faster internal helper to query name
...
This only applies if we're called from kernel mode
with a synchronous file.
2018-10-03 10:22:33 +02:00
Pierre Schweitzer
1348f62f20
[NTOSKRNL] Rename IopQueryNameFile to IopQueryNameInternal
2018-10-03 10:22:33 +02:00
Thomas Faber
8fbc488050
[NTOS:IO] Implement IopAcquireFileObjectLock and use it to fix IopLockFileObject
2018-10-02 09:56:55 +02:00
Pierre Schweitzer
890a293683
[NTOSKRNL] Fix remaining access computation on open
2018-09-30 10:55:44 +02:00
Pierre Schweitzer
6d0c07c44f
[NTOSKRNL] Implement access check for secure open
2018-09-30 10:55:43 +02:00
Pierre Schweitzer
cf25432eed
[NTOSKRNL] Don't lock file object on close if we're not called by Ob
...
IopCloseFile can be called by IopDeleteFile. In that situation, it
doesn't set any process as first parameter. Furthermore, we are in a
situation where it's not required to lock the file object (see the
assert before the call).
2018-09-29 16:25:58 +02:00
Pierre Schweitzer
207ff9444e
[NTOSKRNL] Reference the file object before issuing the unlock all IRP
...
This fixes the last kmode assert triggered by httpd on ReactOS.
CORE-12045
2018-09-29 11:22:22 +02:00
Pierre Schweitzer
5472c1db82
[NTOSKRNL] Unlock file if required on last process handle close
2018-09-28 23:34:28 +02:00
Eric Kohl
e32a2cc026
[NTOSKRNL] IoGetDeviceProperty: Add support for the DevicePropertyRemovalPolicy property.
...
This could probably fix CORE-15068.
2018-09-22 11:22:22 +02:00
Eric Kohl
e1b82b5b91
[NTOSKRNL] Create the 'Device Parameters' subkey and add the 'FirmwareIdentified' value for all ACPI-enumerated devices.
2018-09-21 15:37:34 +02:00
Eric Kohl
2550325577
[NTOSKRNL] Fix the indentation of some pnp manager functions.
2018-09-21 15:08:43 +02:00
Pierre Schweitzer
108991a6fb
[NTOSKRNL] Stub IoInitializeCrashDump()
...
Also call it from NtCreatePagingFile() when we have successfully created
a paging file on the system boot partition.
2018-09-18 21:59:59 +02:00
Eric Kohl
06e7233134
[NTOSKRNL] IopGetDeviceProperty: Initialize power data struct and convert flags from device capabilities to power data
2018-08-25 19:49:29 +02:00