Eric Kohl
9538c3ccd7
[NTOS:IO] Fix indentation. No code changes!
2020-01-02 23:25:26 +01:00
Thomas Faber
c904983b49
[NTOS:IO] Use UNICODE_STRING operations in IopUnloadDriver.
...
Fixes several overflow vulnerabilities.
2019-12-31 15:18:17 +01:00
Timo Kreuzer
53f8cbad97
[NTOS:IO] Fix list enumeration in IopShutdownBaseFileSystems
2019-12-30 15:48:38 +01:00
Eric Kohl
8faf38ed22
[NTOS:IO] Fix indentation. No code changes!
2019-12-29 14:37:13 +01:00
Victor Perevertkin
3d046e0ed2
[NTOS:IO] Fix result length for DevicePropertyRemovalPolicy request
...
in IoGetDeviceProperty.
Classpnp expects it to be sizeof(DEVICE_REMOVAL_POLICY)
see ClasspInitializeHotplugInfo in classpnp.sys
CORE-6264
2019-11-17 18:36:28 +03:00
Pierre Schweitzer
80cc287cf6
[NTOSKRNL] Declare IoRemoteBootClient in internal headers
2019-10-21 14:16:58 +02:00
Thomas Faber
934484ea3e
[NTOS:PNP] When traversing the device tree, keep a reference to the current device. CORE-15874
2019-09-26 10:26:10 +02:00
Eric Kohl
0b129da05c
[NTOSKRNL] Fix indentation. No code changes!
2019-08-24 10:02:55 +02:00
Mark Jansen
1539fb1414
[NTOSKRNL] Demote some noisy dprints
2019-08-23 13:03:36 +02:00
Serge Gautherie
87a625bd6c
[NTOS:IO] iomgr.c: Add a missing '#if defined(KDBG)'
2019-08-17 17:36:49 +02:00
Timo Kreuzer
98a8e8f862
[NTOS:IO] In IopSynchronousCall first check IrpStack->MajorFunction before checking minor
...
Minor function indices are not unique, they are subfunctions, so without first checking the major function, they are ambiguous.
2019-08-15 18:04:57 +02:00
Timo Kreuzer
e50873376d
[NTOS:IO] Improve an alignment
2019-08-15 18:04:57 +02:00
Thomas Faber
2d419e90f9
[NTOS:PNP] Reduce the default buffer size in EnumerateDevices. CORE-15882
2019-07-10 10:58:47 +02:00
Thomas Faber
b8e091a44c
[NTOS:PNP] Handle arbitrary subkey name lengths in EnumerateDevices. CORE-15882
...
This also makes it necessary to fix a bug in the previous code:
ZwEnumerateKey will not account for space for a null terminator, so to
ensure we have space, we must allocate the additional WCHAR, but not
include it in the buffer size passed to the function.
2019-07-10 10:58:45 +02:00
Bișoc George
42ce8519b6
[FASTFAT][FLTMGR][NTOS] Do not explicitly call ObfDereferenceObject() ( #1636 )
...
"Most code should not directly call the platform-specific ObfDereferenceObject() function but use the ObDereferenceObject() macro instead."
CORE-16081
2019-06-22 16:20:58 +02:00
Eric Kohl
6866c0aede
[NTOSKRNL][USETUP][UMPNPMGR] Pass user response data to NtPlugPlayControl(PlugPlayControlUserResponse).
...
- Windows requires 16 bytes of response data.
- Add the PLUGPLAY_CONTROL_USER_RESPONSE_DATA type.
- Usetup and Umpnpmgr must fail if NtPlugPlayControl(PlugPlayControlUserResponse) does not return STATUS_SUCCESS.
2019-06-12 13:48:27 +02:00
Hermès Bélusca-Maïto
9060b0cb7a
Fix build (forgot a comma ;)
2019-06-11 22:36:10 +02:00
Hermès Bélusca-Maïto
41e7c818d1
[NTOS] IoSetHardErrorOrVerifyDevice(): Check whether the IRP is not associated with any thread.
2019-06-11 22:29:34 +02:00
Eric Kohl
8319c73e2e
[NTOS:IO] Implement the PlugPlayControl.PlugPlayControlEnumerateDevice request
...
Drivers for Intel Pro/1000 NICs seem to install properly.
2019-06-08 20:42:38 +02:00
Pierre Schweitzer
9c3c0d123b
[NTOSKRNL] In case IopMountVolume call is a success, return its VPB
...
This fixes an extra (erroneous) reference being set on the VPB.
Based on a patch by Vadim Galyant
CORE-16080
2019-06-02 10:48:35 +02:00
Thomas Faber
5706f6e9f4
[NTOS:PNP] Reduce the size of the pool buffer in IopGetParentIdPrefix. CORE-15882
2019-05-05 10:39:29 +02:00
Thomas Faber
f3a280f52b
[NTOS] Use correct buffer size when calling MiResolveImageReferences. CORE-15882
2019-05-05 10:39:11 +02:00
Thomas Faber
ccb91bebbe
[NTOS:PNP] Avoid a fixed-length stack buffer in IopActionConfigureChildServices. CORE-15882
2019-05-05 10:39:07 +02:00
Thomas Faber
e1b20681f5
[NTOS:IO] Avoid a fixed-length buffer in IopGetDriverObject. CORE-15882
2019-05-05 10:39:01 +02:00
Thomas Faber
d605b5063f
[NTOS:IO] Send IRPs to the correct device in IoVolumeDeviceToDosName. CORE-15415
2019-03-30 10:13:27 +01:00
Pierre Schweitzer
ef8b1a1907
[NTOSKRNL] We don't need an event if we don't issue an IRP
2019-03-29 21:47:34 +01:00
Pierre Schweitzer
28ba29e457
[NTOSKRNL] Implement support for FileFsDriverPathInformation in NtQueryVolumeInformationFile
2019-03-29 21:42:42 +01:00
Pierre Schweitzer
092c37f845
[NTOSKRNL] Do. Not. L. E. A. K.
2019-03-29 19:51:38 +01:00
Pierre Schweitzer
d75ccd01f7
[NTOSKRNL] Only allow direct device open for FileFsDeviceInformation
2019-03-28 22:39:38 +01:00
Pierre Schweitzer
ce6488df31
[NTOSKRNL] Add a quick path for FileFsDeviceInformation in NtQueryVolumeInformationFile
...
This allows querying volume information without issuing an IRP to the owner device.
The kernel is supposed to already have all the required information to return
to the caller.
Side effect: this allows querying volume information for devices not implementing
IRP_MJ_QUERY_VOLUME_INFORMATION such as null.sys
This fixes opening null device in Python.
Fix based on debugging by Maxim Smirnov in PR #1442
CORE-14551
2019-03-28 22:39:38 +01:00
Thomas Faber
a976ebb031
[NTOS:IO] Avoid an unnecessary stack buffer in OpenRegistryHandlesFromSymbolicLink. CORE-15882
2019-03-25 08:43:47 +01:00
Thomas Faber
57225adaac
[NTOS:IO] Fix always-false condition in IoCheckEaBufferValidity.
...
Spotted by clang.
2019-03-25 08:41:51 +01:00
Thomas Faber
938f0e469d
[NTOS:IO] Enable privilege check in NtLoadDriver.
2019-03-11 08:30:14 +01:00
Thomas Faber
cf40421041
[NTOS:PNP] Correctly respect data size in PnpRegSzToString. CORE-15766
...
Spotted by Vadim Galyant.
2019-02-20 12:23:33 +01:00
Thomas Faber
63977328b1
[NTOSKRNL] Guard against negative InformationClass enum values. CORE-15651
2019-02-02 22:50:02 +01:00
Hermès Bélusca-Maïto
fefb982d64
[NTOS] Don't use TAG_IO_NAME when calling ExFreePoolWithTag() for freeing FileObject->FileName.Buffer .
...
This may look strange, since this buffer is originally allocated using
the TAG_IO_NAME tag. However, it happens that file-system drivers are
allowed to re-allocate this buffer: this is what the MS' open-sourced
CDFS driver does, see e.g. CdCommonCreate() and CdNormalizeFileNames()
in cdfs/create.c .
This fixes a pool tag mismatch 'mNoI' != 'nFdC' BSOD when resources
are freed when closing a file that has been opened with a relative name
on a CDFS-mounted volume.
2018-12-30 15:26:42 +01:00
Hermès Bélusca-Maïto
d3a97e2228
[NTOS] Code formatting only.
2018-12-30 15:26: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
aecc523b6a
[NTOS:IO] Fix indentation. No code changes.
2018-12-29 17:49:38 +01:00
Mark Jansen
ec5c0c926b
[NTOS] When checking something for NULL, let's initialize it to NULL...
2018-12-27 23:03:22 +01:00
Eric Kohl
079f7027f6
[NTOS:IO] When a device has been started, create an Enum sub key to its service key and add the device instance name to the Enum sub key.
2018-12-25 23:04:27 +01:00
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