Commit graph

30 commits

Author SHA1 Message Date
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
Hermès Bélusca-Maïto 0c9cd421ee [DISK]: Small fixes:
- 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
2017-05-08 21:34:07 +00:00
Pierre Schweitzer 021ab6e000 [DISK]
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
2017-03-02 20:03:55 +00:00
Pierre Schweitzer 2eb3e5db44 [DISK]
Fix return code when buffer is too small, as exposed in r74025.

CORE-12858

svn path=/trunk/; revision=74026
2017-03-02 19:39:07 +00:00
Amine Khaldi 5c2f126896 [DRIVERS] Spelling fixes by Josh Soref. CORE-12286
svn path=/trunk/; revision=73226
2016-11-13 15:31:39 +00:00
Pierre Schweitzer 82425d713b [DISK]
Don't overflow when computing disk size.
Patch by Vort.

CORE-12261

svn path=/trunk/; revision=73113
2016-11-03 21:38:56 +00:00
Dmitry Chapyshev 01bab59e21 [WHOAMI]
[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
2016-07-30 16:00:10 +00:00
Hermès Bélusca-Maïto 960b573f7b [REACTOS]: s/partiton/partition/
svn path=/trunk/; revision=70815
2016-02-29 01:22:02 +00:00
Pierre Schweitzer c87591d771 [DISK]
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
2016-02-24 07:55:36 +00:00
Pierre Schweitzer 24d3676235 [DISK]
- 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
2016-02-22 20:47:55 +00:00
Eric Kohl 071eb9ad40 [DISK]
Revert accidential changes.

svn path=/trunk/; revision=68062
2015-06-07 13:44:49 +00:00
Eric Kohl 62aa5d355b [DISK]
Get rid of explicit status definition. Import ntiologc.h instead.

svn path=/trunk/; revision=68059
2015-06-07 11:46:34 +00:00
Pierre Schweitzer 21cd59bc0f [DISK]
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
2014-11-02 23:11:22 +00:00
Pierre Schweitzer c009666393 [DISK]
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
2014-10-29 18:25:30 +00:00
Pierre Schweitzer 88ea664a82 [DISK]
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
2014-10-29 11:31:19 +00:00
Pierre Schweitzer 7a204076f6 [DISK]
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
2014-10-28 21:59:57 +00:00
Thomas Faber 5884949d32 [DISK]
- Fix memory leak in CreatePartitionDeviceObjects

svn path=/trunk/; revision=63721
2014-07-19 17:48:46 +00:00
Amine Khaldi 0864fd08d6 * Comment out some unused but set variables, remove some others.
svn path=/trunk/; revision=53681
2011-09-11 00:40:20 +00:00
Timo Kreuzer a34ed64ca4 [DRIVERS]
Add missing breaks. Patch by Samuel Serapion.

svn path=/trunk/; revision=50197
2010-12-28 18:20:28 +00:00
Pierre Schweitzer 3b08424abb [DISK]
Implemented support for IOCTL_DISK_GET_LENGTH_INFO

svn path=/trunk/; revision=49369
2010-10-31 08:13:33 +00:00
Pierre Schweitzer 60501a925e [DISK]
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
2010-10-19 19:27:28 +00:00
Pierre Schweitzer 466f11a06e [CLASS2]
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
2010-10-12 20:17:55 +00:00
Christoph von Wittich 82cffd5af5 fix some more typos
svn path=/trunk/; revision=38345
2008-12-25 12:27:47 +00:00
Stefan Ginsberg b137725c9a - Kill off more STDCALL
svn path=/trunk/; revision=37762
2008-11-30 11:16:55 +00:00
Aleksey Bragin 93675d12ab - Two more leftovers.
svn path=/trunk/; revision=31171
2007-12-11 21:34:04 +00:00
Aleksey Bragin bec1436ca2 - Silence non-critical debug output.
svn path=/trunk/; revision=31158
2007-12-11 18:31:13 +00:00
Aleksey Bragin 6f31706927 - Separate creating partitions objects into a different function (CreatePartitionsObject()).
- Slightly improve the logic of accessing the partitions list.

svn path=/trunk/; revision=28993
2007-09-10 16:25:48 +00:00
Dmitry Gorbachev 1a4bfcb4ce Allow installation to / booting from a disk with several partitions (hack).
svn path=/trunk/; revision=26333
2007-04-13 22:04:39 +00:00
Aleksey Bragin 96924455c4 - Make class2 and disk completely warning-free.
svn path=/trunk/; revision=26268
2007-04-05 17:36:39 +00:00
Alex Ionescu d03eaaa66d - Cleanup /storage directory and prepare for NT5+ Storage Stack and Floppy Port/Class drop.
svn path=/trunk/; revision=26250
2007-04-03 14:14:25 +00:00
Renamed from reactos/drivers/storage/disk/disk.c (Browse further)