- Check for malformed disk identifier, which must be at least 9 WCHARs long (as done by disk_new);
- Prevent possible memory leaks (missing ExFreePool's) + closing registry key.
Investigated by Lesan Ilie during tests; as part of CORE-13131.
- Make one of our hacks more readable (by me).
(We also note that this driver uses the ExAllocate/FreePool functions in the old-school way).
svn path=/trunk/; revision=74509
Fix size checking for IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, and only copy what's possible to fit in the buffer.
Also, make the code a bit more readable.
CORE-12858
svn path=/trunk/; revision=74027
[ARP]
[TRACERT]
- Incorrect to compare the variable of BOOL type with TRUE. Any non-zero value is considered to be "true".
[FREELDR]
- Variable is assigned values twice
- The 'strlen' function was called multiple times inside the body of a loop
- It is inefficient to identify an empty string by using 'strlen(str) > 0' construct. A more efficient way is to check: str[0] != 0
[NTOBJSHEX]
[SLAYER]
[CMICONTROL]
- It is inefficient to identify an empty string by using 'strlen(str) > 0' construct. A more efficient way is to check: str[0] != 0
[SHELL32]
- There is no sense in testing the pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error
- Verifying that a pointer value is not NULL is not required. The 'if (ptr != NULL)' check can be removed
- Fix copy-paste error in CMenuFocusManager::PlaceHooks()
[SRCLIENT]
- Remove unneeded check. A part of conditional expression is always false.
[DISK]
[ATAPI]
- Variable is assigned values twice
* All bugs found by PVS-Studio
svn path=/trunk/; revision=72059
Also had the nasty partition number hack to IOCTL_DISK_GET_PARTITION_INFO_EX.
It is required for some file system to work in ReactOS (teasing :-))
svn path=/trunk/; revision=70781
- Remove one hack that seems not to be required anylonger.
- Add a comment to highlight the usage of the infamous partition 0 hack (who's the IopParseDevice() hack friend!)
svn path=/trunk/; revision=70771
Add a hack to forcibly set sector size in case of weird input. This is noisy on purpose.
Also, be more informative in case of read rejection. Are we reading beyond partition or do we have invalid sector size?
With the hack, the invalid sector size should disappear.
This is to help debugging the recent errors with the removal of IopParseDevice() hack
svn path=/trunk/; revision=65205
Revert r65097 and r65090.
Thanks to r65104, now the FSCTLs go to the right place: the FSDs!
Thanks to Thomas for pointing out that NTFSinfo was really talking with the FSD on Windows and not to disk.sys
CORE-8725
svn path=/trunk/; revision=65105
Actually, sysinternals used to release the source code of NTFSInfo (thanks Christoph!), so we know a bit more about the interface of the user FS request.
So, implement a bit more of the interface to validate it properly works (and so far, it does!)
CORE-8725
svn path=/trunk/; revision=65097
Get ready to enter into the 10th dimension... So:
- Implement support for IRP_MJ_FILE_SYSTEM_CONTROL. Yes... You read well! So, implemented a ScsiDiskFileSystemControl() function. The way it is added to the DriverObject is a big hack, class2 is not supposed to have such requests, so, we do it in its back. Fear!
- Stubplement the NtfsRussinovichism() function. This is the only function we're supposed to call with IRP MJ FSCTRL and with IRP MN USRFSRQST. Its purpose (when its implemented) is to reply back to the M. Russinovich tools (NFI & NTFSInfo) so that they can directly dump NTFS information without going into NTFS driver. They kind of bypass it.
We do all agree this is a ugly hack. But it exists in Windows, as these tools work in Windows. And it would be useful they actually work in ReactOS.
Soon, we'll be able to publish a book "ReactOS Internals" where we speak about undocumented FS controls to dump NTFS information to show how well our NTFS works ;-).
svn path=/trunk/; revision=65090
Hackplemented support for IOCTL_DISK_GET_PARTITION_INFO_EX. It will work fine for MBR partitions but will fake returns for GPT partitions.
svn path=/trunk/; revision=49210
Switch use from DISK_GEOMETRY to DISK_GEOMETRY_EX. It's needed to handle some Windows 2003's kernel routines.
[CDROM]
Reflect changes in Class2.
[DISK]
Reflect changes in Class2.
Also added support for IOCTL_DISK_GET_DRIVE_GEOMETRY_EX.
svn path=/trunk/; revision=49129