Commit graph

38 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 6ab86eb6cc [NTOS]: Use the correct access rights for ZwOpenDirectoryObject call.
svn path=/trunk/; revision=74585
2017-05-18 23:46:44 +00:00
Hermès Bélusca-Maïto 2e25bf12d0 [NTOS]: Close an opened handle after usage.
svn path=/trunk/; revision=74584
2017-05-18 23:32:00 +00:00
Pierre Schweitzer 93ff988b19 [NTOSKRNL]
Fix a bug in HalpGetFullGeometry(): properly reset the event before reusing it. We may have waited on it previously.

svn path=/trunk/; revision=69074
2015-09-06 22:10:53 +00:00
Eric Kohl da6ce53e1e [NTOSKRNL]
xHalIoReadPartitionTable: Do not return a valid partiton number for container partitions.

svn path=/trunk/; revision=68258
2015-06-24 20:22:19 +00:00
Timo Kreuzer dfd58eda6d [NTOSKRNL]
Remove explicit comparisons with TRUE
Patch by Love Nystrom, adjusted by me
CORE-8799

svn path=/trunk/; revision=65416
2014-11-15 22:47:51 +00:00
Thomas Faber 5a8c0d9fc1 [NTOS:FSTUB]
- Make sure to NULL the return pointer in the failure case of xHalIoReadPartitionTable.
CORE-8359

svn path=/trunk/; revision=63722
2014-07-19 17:50:56 +00:00
Eric Kohl a47b155648 [NTOSKRNL]
Partial revert of r63326! The correct partition numbers cause boot failures.

svn path=/trunk/; revision=63330
2014-05-17 14:42:28 +00:00
Eric Kohl 7a4fd32957 [NTOSKRNL]
xHalIoReadPartitionTable: Only used non-container partition entries have a non-zero partition number.

svn path=/trunk/; revision=63326
2014-05-17 12:55:06 +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
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
Pierre Schweitzer 1f95a6dd13 [NTOSKRNL]
Fix FstubFixupEfiPartition()
Add helper macro SET_PARTITION_LENGTH()

svn path=/trunk/; revision=53784
2011-09-21 09:11:42 +00:00
Timo Kreuzer 87779aa572 [HAL/NDK]
- Make Vector parameter in HalEnableSystemInterrupt, HalDisableSystemInterrupt and HalBeginSystemInterrupt an ULONG, not an UCHAR
[NDK]
- 64bit fixes for HANDLE_TABLE, KPROCESS, SECTION_IMAGE_INFORMATION, MMADDRESS_LIST, MMVAD_FLAGS, MMVAD, MMVAD_LONG, MMVAD_SHORT, MEMORY_DESCRIPTOR, MEMORY_ALLOCATION_DESCRIPTOR, LdrVerifyMappedImageMatchesChecksum
- KDPC_DATA::DpcQueueDepth is signed on amd64, unsigned on x86
[NTOSKRNL]
- Fix hundreds of MSVC and amd64 warnings
- add a pragma message to FstubFixupEfiPartition, since it looks broken
- Move portable Ke constants from <arch>/cpu.c to krnlinit.c
- Fixed a bug in amd64 KiGeneralProtectionFaultHandler

svn path=/trunk/; revision=53734
2011-09-18 13:11:45 +00:00
Dmitry Gorbachev 629b082a69 [NTOSKRNL]
Do not assign drive letters to unrecognized partitions. Fixes bug #2564.

svn path=/trunk/; revision=52731
2011-07-18 20:27:42 +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
Aleksey Bragin 3d60cef193 Sam Arun Raj Seeniraj:
[NTOSKRNL.EXE]
- Complemented existing stub routines ObpDeleteSymbolicLinkName() and ObpCreateSymbolicLinkName(). Now when symbolic links are created, they are checked for dos drive mapping and ObSystemDeviceMap is updated accordingly.
- Updates to ObpDeviceMapLock are protected by a guarded mutex (changed from fast mutex by Aleksey Bragin).
- Aleksey Bragin: Fix concurrent access issues in ObDereferenceDeviceMap. The DeviceMap read/write operation must be atomic (within the ObpDeviceMapLock region).

[SUBST.EXE]
- Removed hard coded strings and moved it to resource file.

[WIN32CSR.DLL]
- Added a workaround, when target path end with a trailing '\', the substituted drive fails to parse to the target, this is a bug in the object manager, but working around it in CsrDefineDosDevice() by stripping trailing '\'.

See issue #993 for more details.

svn path=/trunk/; revision=51452
2011-04-25 16:08:00 +00:00
Pierre Schweitzer c6d8f7de70 [NTOSKRNL]
Implemented FstubFixupEfiPartition():
Purpose is to let ReactOS handle realistic partitions length in case of an EFI/GPT protective MBR.
Indeed, when formatting a disk to GPT, you add a protective MBR that contains a fake partition entry, with type 0xEE having the following property: its size is set to maximum allocatable size in MBR.
In that case, if disk is small, you may go beyond disk size.
This is why a fix to partition length may be needed when re-reading partition entry.
This is the way ReactOS creates protective MBR.
You may find some more information here: http://msdn.microsoft.com/en-us/windows/hardware/gg463525

Fixed xHalIoReadPartitionTable():
- Allocate a buffer that has the proper size (instead of allocating a buffer which is too big). Especially since this leads to partial init only some lines after.
- Remove redundant & useless affectation.
- Check/fix 0xEE partition length in case of an EFI/GPT protective MBR (see upper point).

svn path=/trunk/; revision=51002
2011-03-09 10:33:13 +00:00
Eric Kohl e5bc385e89 [NTOSKRNL]
- Use the current partition descriptor to check for container partitions. Logical units in extended partitions become visible again but you cannot access them yet.
This fixes the first half of bug #2564.

svn path=/trunk/; revision=47799
2010-06-17 19:41:52 +00:00
Eric Kohl ba16f69763 Removed outdated email addresses.
svn path=/trunk/; revision=45020
2010-01-09 22:43:16 +00:00
Stefan Ginsberg e7e6699ae1 - Use MAXUINT, MAXULONG, MAXDWORD, MAXULONGLONG and MAXULONGLONG instead of ~0 or casting -1 to unsigned.
- bintype.c: Use INVALID_SET_FILE_POINTER instead of (DWORD)-1.
- irp.c: KsGetNodeIdFromIrp returns KSFILTER_NODE (which is -1).
- basetsd.h: Add missing MAXUINT and MAXULONGLONG.
- typedefs.h: Add MAXULONG for mkhive.
- elf.inc.h and pe.c: Remove incorrect and unneeded MAXULONG define.

svn path=/trunk/; revision=43192
2009-09-27 20:07:43 +00:00
Dmitry Chapyshev 8954edb33c - Add missed checks of memory allocation failures
svn path=/trunk/; revision=42980
2009-09-02 13:02:30 +00:00
Hervé Poussineau e0d37204c6 Skip partitions drive letter assignments if no hard disk is present
svn path=/trunk/; revision=40977
2009-05-19 13:01:04 +00:00
Aleksey Bragin c41b00f625 Giannis Adamopoulos <johnyadams@hotmail.com>
- Correctly assign NtSystemRoot and remove assumption that number of partitions equals number of harddisks.
- Remove a hack from IopApplyRosCdromArcHack. Fixes LiveCD issues.
See issue #3170 for more details.

svn path=/trunk/; revision=39116
2009-01-26 20:00:59 +00:00
Hervé Poussineau d2ba8bac96 Replace some ExFreePool by ExFreePoolWithTag
svn path=/trunk/; revision=35834
2008-08-31 15:29:21 +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 550a5fa9ed - Isolate Hal* #defines, which are absent in WDK, they should not be used in kernel development.
svn path=/trunk/; revision=31376
2007-12-21 14:58:18 +00:00
Aleksey Bragin a78f0c5728 - Add eol-style:native.
svn path=/trunk/; revision=31246
2007-12-15 16:18:49 +00:00
Hervé Poussineau 03629687b8 Add back support for function pointers override in HalDispatchTable structure
Fixes detection of Xbox disk partitioning

svn path=/trunk/; revision=31211
2007-12-14 11:32:18 +00:00
Aleksey Bragin d68e72bf84 - Revert 29702 (IopParseDeviceHack is still required in 1st stage, and the Real Bug is at some other place, so no need in masking it away by doing calls which avoid buggy operation).
svn path=/trunk/; revision=29834
2007-10-23 19:19:06 +00:00
Mike Nordell 8bca67688e Don't try to open a harddisk for reading when checking for it to create the PhysicalDriveN links. Instead, request FILE_READ_ATTRIBUTES. This silences a hack-warning in IopParseDevice, that now possibly can be removed.
svn path=/trunk/; revision=29702
2007-10-20 07:36:17 +00:00
Daniel Reimer ae7da04787 Delete all Trailing spaces in code.
svn path=/trunk/; revision=29690
2007-10-19 23:21:45 +00:00
Aleksey Bragin 843bb30324 - Almost completely fix the hack in IopParseDevice which was resulting in "FIXME: Broken Parse due to invalid DesiredAccess" messages, by changing some calls to IoGetDeviceObjectPointer to use FILE_READ_ATTRIBUTES instead of FILE_READ_DATA (so that the volume doesn't get mounted).
svn path=/trunk/; revision=29334
2007-10-01 18:04:42 +00:00
Hervé Poussineau ebb26326a5 Remove some debug messages
scsiport.c: Do not try to open Device subkey if we don't have a service key
cmhardwr.c: Write BIOS information only if we succeeded to open the key

svn path=/trunk/; revision=28217
2007-08-07 11:45:30 +00:00
Alex Ionescu 8fe3cfc983 - Fix multiple bugs in HalpCalculateChsValues.
- Fix lots of typecast warnings.
- Fix potentially uninitialized variables.
- This should fix the partitioning problems/regression. Thanks to hto for finding out the source of the bug.

svn path=/trunk/; revision=25336
2007-01-07 00:50:41 +00:00
Alex Ionescu c39989df1b - Fix SleepEx.
- Put volatile statements in EX_RUNDOWN_REF, IRP, DEVICE_OBJECT, ERESOURCE, FILE_OBJECT, IO_REMOVE_LOCK, WORK_QUEUE_ITEM where required (thanks to Microsoft's changes in the WDK to mark the fields properly).
- Update FILE_OBJECT definition.
- Add some asserts to some I/O functions.
- Add stub support for File Objects created by XP+ Drivers which have File Object Extensions.
- Add some fixes to IopDeleteFile, including proper reference counting for the DO and VPB, as well as cleanup when the file is closed without a handle.
- Fix a bug in IopSecurityFile.
- Queue and unqueue IRPs in all I/O functions.
- Fully support IRP cancellation now.
- Fix critical bugs in NtDeviceIoControlFile and NtDeviceFsControlFile which were causing double queueing of IRPs and freeing of invalid memory, as well as invalid paramter checking for user-mode buffers.
- Add exhaustive validation checks to IoCreateFile, add more failure cases, and validate the EA buffer. Also support IO_ATTACH_DEVICE_API flag.
- Implement IoCreateStreamFileObjectEx and IoCreateStreamFileObjectLite and fix several bugs in the original implementation of IoCreateStreamFileObject.
- Fix a bug in RtlRaiseException.
- Update Io*ShareAccess routines to support XP+ style semantics related to special File Object flags which disable their use.
- Add validation to all Query/Set routines so that information clasess, lengths, buffers and alignment are properly checked.
- Also add an array for the proper acess rights that each query/set operation requires.
- Check backup/restore privileges during I/O File operations.
- Check traverse access during I/O File Operations.
- Check access privileges to the device during I/O file operations.
- Rename IopReferenceDeviceObject and also verify if an exclusive DO is trying to be invalidly opened.
- Support various extra security checks during I/O File/Device Parse Routine.
- Fix a bug during IopCleanupIrp so that we don't dereference the File OBject if this was a create operation.
- Fix some bogus asserts in IofCompleteRequest, and save the IRP Flags before signalling it's event, since the driver might've freed it behind our back.
- Fix a large bug in ObInsertObject which affected the insert of unnamed objects with forced security options (Such as process/threads).
- Fix the creation of the Process/Thread/Job Obejct Types to that security information is forced.
- Remove "Fix PS!!!" messages since the bug is now fixed and these objects now get proper security descriptors.
- Fix another bug in ObInsertObjet which wasn't properly validating user-mode objects and always assumed kernel mode.
- Silence multiple trace/checkpoint messages that have accumulated throughout time for various debugging purposes.

svn path=/trunk/; revision=25118
2006-12-10 18:40:30 +00:00
Aleksey Bragin 4a33b4c040 Use Uint32x32To64() function instead of ULONG * ULONG. Fixes partition length truncation.
See issue #1871 for more details.

svn path=/trunk/; revision=24769
2006-11-16 17:26:31 +00:00
Thomas Bluemel a1e3bd38a5 Fix some compilation errors
svn path=/trunk/; revision=24765
2006-11-15 20:24:55 +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