Commit graph

20 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
Pierre Schweitzer a343648323 [NTOSKRNL]
In IoWritePartitionTableEx(), don't return STATUS_SUCCESS when we cannot write GPT to higher partitions count than space available; return STATUS_INVALID_PARAMETER.

svn path=/trunk/; revision=73114
2016-11-03 21:49:55 +00:00
Pierre Schweitzer ec670d6c25 [NTOSKRNL]
For now, disable broken code in FstubReadPartitionTableEFI(). In its current state, it wrongly assumes backup GPT is broken and thus attempts to fix main GPT (?!).
Furthermore, it appears Windows 2K3 doesn't perform such checks, nor such GPT rewritings in FstubReadPartitionTableEFI().

CORE-12261

svn path=/trunk/; revision=73112
2016-11-03 21:13:30 +00:00
Pierre Schweitzer 5cabd6269f [NTOSKRNL]
Fix potential overflows

CID #701302
CID #1206856

svn path=/trunk/; revision=63023
2014-04-27 18:46:26 +00:00
Pierre Schweitzer 02d348bf34 [NTOSKRNL]
Fix overflow

CID #701303

svn path=/trunk/; revision=62668
2014-04-06 17:18:55 +00:00
Pierre Schweitzer 15743f2521 [NTOSKRNL]
- Finally fully implement FstubVerifyPartitionTableEFI(). It is capable of fixing a GPT disk.
- Fix implementation of FstubReadHeaderEFI() (which returns a pointer to the header). Fixed all the other functions accordingly. Note that you have to be careful when using Disk->Buffer. You can easily read a buffer that doesn't contain your data anylonger.
- Fix implementation of FstubReadPartitionTableEFI(). It was improperly dealing with the backup table. Now, it will look for it and replace/recreate it if not found where expected.
- Fix implementation of FstubWriteEntryEFI(). The computation of memory placement was wrong, and thus it was missing partitions and causing corruption. Thank you checksums!

In case you format a disk with GPT using Linux (with GParted, for instance), don't be surprised if once started with ReactOS your GPT is modified, and especially its backup table moved. They don't have the same sector counts.
It was a nice way to tests whether ReactOS properly write GPT. Which it does now :-).

svn path=/trunk/; revision=60811
2013-10-31 18:03:48 +00:00
Pierre Schweitzer bd3ccd4826 [NTOSKRNL]
Fix string size to store GPT GUIDs.
This was causing a buffer overflow (with ending null char) and thus a stack corruption.
The side effect of the stack corruption was that the debug code (display) was looping
forever while attempting to read partition table making ntoskrnl unable to boot with
a machine where there's a GPT disk.
Kernel is now able again to handle GPT disks (and they can be used again in user-land).

This was magically hidding before r59923 or by disabling NDEBUG. Lovely Heisenbugs :-).

svn path=/trunk/; revision=60003
2013-09-10 13:42:34 +00:00
Amine Khaldi a1bafaeaaf [NTOSKRNL]
* Fix several print specifiers.
* Add some missing variables to debug prints.

svn path=/trunk/; revision=59923
2013-08-31 16:02:13 +00:00
Thomas Faber 0dee0427aa [NTOSKRNL]
- Make MSVC analyzer happy by initializing the event before calling IoBuildDeviceIoControlRequest. Patch by Ivan Rodionov (overclocker at list dot ru).
CORE-7328 #resolve #comment Committed, thanks.

svn path=/trunk/; revision=59352
2013-06-29 05:40:09 +00:00
Hermès Bélusca-Maïto 5ff7896120 [NTOSKRNL]
Use TAG_FSTUB instead of 'BtsF'

svn path=/trunk/; revision=57500
2012-10-06 18:49:23 +00:00
Hermès Bélusca-Maïto ebd10c73a3 [NTOSKRNL]
Fix Coverity defects : CID 716579, 716580 and 716582.

svn path=/trunk/; revision=57499
2012-10-06 18:46:13 +00:00
Hermès Bélusca-Maïto 572d5fcaeb [NTOSKRNL]
Coverity code defects fixes :
- Cache: CID 701441
- Config: CIDs 716570, 716669, 716760
- Dbgk: Kdbg: CIDs 716571, 515128/9, 500432
- Ex: CIDs 500156/7, 515122, 716200/67, 701301, 514669
- Fsrtl: Fstub: CIDs 701341/2, 701288, 716770, 701302, and CIDs 716576/7/8 + 514636 + 716805 thanks to Thomas Faber
- Io: CIDs 514576, 514643, 514672/3, 716203, 716269, 716581, 716591, 716713
- Ke: CIDs 515125, 716592
- Ps: CIDs 716603/4, 701422
- Ob: Po: CIDs 514671/680, 701419/420/421, 716763, 716601/2
All the details are given in the different bug reports.

CORE-6677 CORE-6679 CORE-6680 CORE-6683 CORE-6686 CORE-6692 CORE-6693 CORE-6694 CORE-6695 CORE-6696 #comment Committed in rev.57400 #resolve #close

svn path=/trunk/; revision=57400
2012-09-27 17:16:31 +00:00
Amine Khaldi 934c32a726 [NTOSKRNL]
* Remove some redundant definitions now that they've been added in r55220. Fixes build.

svn path=/trunk/; revision=55224
2012-01-26 20:06:08 +00:00
Rafal Harabien 2861515d78 [NTOSKRNL]
- Use tags when allocation and freeing memory and define them in tag.h
- Fix some wrongly used tags when freeing
- Our new memory manager doesn't check tags when ExFreePoolWithTag is used. It will be fixed after testing

svn path=/trunk/; revision=52043
2011-06-01 13:39:36 +00:00
Pierre Schweitzer 1d0887e1ac [NTOSKRNL]
Silent FstubEx* debug prints on popular demand (ie, Timo)

svn path=/trunk/; revision=50024
2010-12-13 22:24:49 +00:00
Pierre Schweitzer 538b9e4fbf [NTOSKRNL]
Implemented FstubAdjustPartitionCount(), FstubConvertExtendedToLayout(), FstubCopyEntryEFI(), FstubCreateDiskMBR(), FstubCreateDiskEFI(), FstubCreateDiskRaw(), FstubDbgPrintSetPartitionEx(), FstubReadHeaderEFI(), FstubReadPartitionTableEFI(), FstubSetPartitionInformationEFI(), FstubVerifyPartitionTableEFI(), FstubWriteBootSectorEFI(), FstubWriteEntryEFI(), FstubWriteHeaderEFI(), FstubWritePartitionTableEFI(), FstubWritePartitionTableMBR(), FstubWriteSector()

Implemented IoCreateDisk(), IoGetBootDiskInformation(), IoReadDiskSignature(), IoSetPartitionInformationEx(), IoVerifyPartitionTable(), IoWritePartitionTableEx()

To sum up, this commit finishes FSTUB API implementation in the ReactOS kernel. This means one important thing: now ReactOS kernel knows about a bit about EFI and about GPT. No need to say that it's the first step into EFI support. But a lot more work is needed. Especially since the kernel is the only real entity in ReactOS to handle GPT. All the rest of the OS doesn't know anything about GPT.

A small note about FstubVerifyPartitionTableEFI(). This function is supposed to check whether a disk formated with GPT is valid, and if it's not, to fix it. First step is implemented. Second step isn't yet supported.

A general note about all that stuff: on GPT, backup table isn't properly handled for the moment, as ReactOS is experiencing disk geometry issues. That means it's not having the proper disk sectors count and then, can't find the backup table (which is located on last disk sector).

References:
http://www.intel.com/technology/efi/
http://developer.apple.com/library/mac/#technotes/tn2006/tn2166.html
http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.35.y.git;a=blob;f=fs/partitions/efi.h;hb=HEAD
http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.35.y.git;a=blob;f=fs/partitions/efi.c;hb=HEAD

svn path=/trunk/; revision=49212
2010-10-19 20:34:48 +00:00
Pierre Schweitzer 82e5bca0e7 [NTOSKRNL]
Implemented FstubAllocateDiskInformation(), FstubDbgGuidToString(), FstubDbgPrintDriveLayoutEx(), FstubDbgPrintPartitionEx(), FstubDetectPartitionStyle(), FstubFreeDiskInformation(), FstubGetDiskGeometry(), FstubReadPartitionTableMBR(), FstubReadSector()

Stubbed FstubReadPartitionTableEFI()

This leads to a correct & working implementation of IoReadPartitionTableEx(). As this state, it only handles MBR partition tables as EFI/GPT as been stubbed out.

EFI/GPT support will come later.

svn path=/trunk/; revision=49130
2010-10-12 20:22:29 +00:00
Stefan Ginsberg 12f349df1d - Remove the (now deprecated) ntoskrnl/internal/debug.h header and fix all its includers to use the global debug.h
svn path=/trunk/; revision=35806
2008-08-30 16:31:06 +00:00
Aleksey Bragin a78f0c5728 - Add eol-style:native.
svn path=/trunk/; revision=31246
2007-12-15 16:18:49 +00:00
Alex Ionescu 4d578c637e - FSTUB Patch for Mount Manager Support, Part 1:
- Create new /fstub directory in the kernel tree and move iomgr's xhal functions there.
  - Delete disk.c entirely from iomgr.c and spread it across fstub.
  - Entirely reimplement from scratch IoWritePartitionTable, IoReadPartitionTable, IoSetPartitionInformation, HalExamineMbr. Lots of bug fixes in terms of wrong assumptions and compatibility with weird partition tables.
  - Fix prototype of IoAssignDriveLetters, but for now, keep the old code (xHalIoAssignDriveLetters) because this has not been rewritten yet.
  - Move some functions to fstubex.c for future implementation, and some to volume.c. Move the HAL table to halstub.c
  - Make use of the hal.h file commited earlier.
  - Move IoAssignDriveLetters from halfuncs to iofuncs.h
  - Implement missing functions in HAL (IoRead/Write/Set PartitionInfo) and make them call into the ntoskrnl exports.

svn path=/trunk/; revision=24737
2006-11-12 22:51:06 +00:00