Commit graph

21084 commits

Author SHA1 Message Date
Alex Ionescu dec64724df [AUDIT] - These are yet more < 10 line wrappers.
[FORMATTING] - Fixup file headers, formatting and some comments.

svn path=/trunk/; revision=22726
2006-06-30 19:09:39 +00:00
Alex Ionescu f5270b0105 [FORMATTING] - Tabs->spaces and proper prototype formatting.
svn path=/trunk/; revision=22725
2006-06-30 19:01:01 +00:00
Alex Ionescu 991efbb62a [AUDIT] - Irq.c is another lame wrapper.
- Remlock's code was written by Filip Navara and is clean. My additions are based on wdm.h and only add size checks and fix two visible bugs.
- Add basic support/detection for debug I/O remove blocks (we bugcheck if we identify one though).
- Simplify IoReleaseRemoveLockAndWaitEx
- Remove locks are SYNCH events, not Notification events!
- Make sure IoConnectInterrupt returns NULL to the caller on failure.

svn path=/trunk/; revision=22724
2006-06-30 18:54:34 +00:00
Alex Ionescu ea4351d9bd [AUDIT] - iocomp.c, event.c, iowork.c, mdl.c, timer.c, symlink.c are all simple wrappers around either executive, kernel or object manager code, and they are trivial implementations usually less then 10 lines and heavily documented in public sources.
svn path=/trunk/; revision=22723
2006-06-30 18:16:27 +00:00
Alex Ionescu d1ebf29520 - Io*SymbolicLink should use OBJ_CASE_INSENSITIVE
- Use DELETE instead of SYMBOLIC_LINK_ALL_ACCESS when deleting.
- Fix formatting in timer.c
- Clear the IO_TIMER structure when creating it.

svn path=/trunk/; revision=22722
2006-06-30 18:14:54 +00:00
Alex Ionescu b42accc93a - Fix formatting/function order
- Use only one SEH block in NtRemoveIoCompletion
- Get the completion status from the IRP, not from the Mini-Packet, if the completion came from an IRP and not a Mini-Packet.

svn path=/trunk/; revision=22721
2006-06-30 17:53:00 +00:00
Hervé Poussineau cabeb71d14 Don't try to allocate 0 byte (spotted by Alex Ionescu)
svn path=/trunk/; revision=22720
2006-06-30 17:38:12 +00:00
Alex Ionescu ed3df3667f - Refactor Io*Event APIs to call an internal worker function instead of duplicating the same code twice.
- Optimize Io*Work APIs and initialize the event on allocation, not on queue!!

svn path=/trunk/; revision=22719
2006-06-30 16:56:18 +00:00
Magnus Olsen 2e185ea41a Small clean up
1. Remove goto in the code, goto is slow and should be avoid.
2. reformat for adding {} around some code.
3. remove some NULL check after I did remove goto that is not longer need it.  
 

svn path=/trunk/; revision=22718
2006-06-30 16:42:21 +00:00
Alex Ionescu f13cb8709c - Fix IRP/Completion packet lookaside allocation. We weren't setting a zone size, and I/O Completion packets were also using the wrong size.
- Rewrite I/O MDl support to use lookaside lists for allocations below 23 pages (same as on NT). This is is an incredible performance optimization because MDLs are often allocated and de-allocated during I/O operations, and using the lookaside list decreases pool fragmentation and slowdown.
- Rewrite IoBuildPartialMdl. It did not work like documented in the DDK and also had a bug documented by Microsoft as being in XP.

svn path=/trunk/; revision=22717
2006-06-30 15:59:06 +00:00
Magnus Olsen 77aa2de357 sorry I did broke the comping some typo
svn path=/trunk/; revision=22716
2006-06-30 15:53:57 +00:00
Magnus Olsen 0432c7ee70 fixing strip working right strip -sx does not working u must type strip -s -x not togther as -sx, I did add -X direcly after it will strip away local informations as well
svn path=/trunk/; revision=22715
2006-06-30 15:38:30 +00:00
Saveliy Tretiakov 90f398225a Alex Ionescu said that check for Expanded==NULL must stay...
svn path=/trunk/; revision=22714
2006-06-30 15:12:55 +00:00
Saveliy Tretiakov e6a334b469 Silence debug messages.
Check for Expanded==NULL is useless, because it's done in HeapFree (thx hpoussin).


svn path=/trunk/; revision=22713
2006-06-30 15:07:23 +00:00
Saveliy Tretiakov df5296300e Read configuration from registry
svn path=/trunk/; revision=22712
2006-06-30 14:53:24 +00:00
Saveliy Tretiakov 5d1d716b06 Add some registry settings for eventlog
svn path=/trunk/; revision=22711
2006-06-30 14:52:01 +00:00
Alex Ionescu 81ba9a4b08 - Name decorate and fix some formatting snafus.
svn path=/trunk/; revision=22709
2006-06-30 05:58:23 +00:00
Alex Ionescu f39a0e3e68 - Create iofunc.c and put all functions that ultimately create a system IRP to send to a device in it, thus clearing up irp.c and file.c and making the code base more modular.
- File.c now includes only functions dealing with the FILE_OBJECT itself.

svn path=/trunk/; revision=22708
2006-06-30 05:45:02 +00:00
Alex Ionescu c41f64ebf3 - More name-decoration, tracing, comments, etc.
- Handle cases where we ran out of memory while trying to allocate the IRP
- Make sure the IRP can be re-used in IoReuseIrp.

svn path=/trunk/; revision=22707
2006-06-30 04:46:53 +00:00
Alex Ionescu caaa87bbdc - Add more tracing/name decoration/comments.
- Bugcheck if cancelling and IRP that's already been completed.
- Bugcheck if attempting to call a driver with an IRP that's already past its maximum stack size.
- Make sure that when we free an IRP, it's not associated to a thread anymore, nor having any drivers that think it's valid.

svn path=/trunk/; revision=22706
2006-06-30 04:29:32 +00:00
Alex Ionescu 78277ca08f - Add more name/prototype decoration and API tracing.
- Don't handle IRP_MJ_POWER in IoBuildAsyncronousFsdRequest.
- Use IoAllocateMdl instead of being a cowboy and using MmCreateMdl.
- Handle failure/out-of-memory cases in IoBuildAsyncronousFsdRequest
- Free the input buffer on failure in IoBuildDeviceIoControlRequest
- Handle failure in IoBuildSyncronousFsdREquest.

svn path=/trunk/; revision=22705
2006-06-30 03:48:03 +00:00
Alex Ionescu 8d2254b37e - Fix I/O Completion (IopCompleteRequest/IofCompleteRequest) for the first time after the 40-thread long flame war last year:
- Don't read pointers from the file object or IRP before they are actually used, because in some parts of the code, these pointers could change before we actually use them.
  - Get rid of the #if 1/#if 0 nonsense hbirr had added.
  - Properly check for success/warning/failure cases (thanks to Filip for checking this out with me last year)
  - Handle scenarios when the IRP is marked IRP_CREATE_OPERATION
  - Bugcheck if IofCompleteRequest is called twice on the same IRP
  - Copy the master IRP's thread to the associated IRP
  - Free the Auxiliary Buffer if there is one.
  - Some formatting fixes, and majorly recomment the code to make it a lot clearer and more verbose on some of the more intricate details.
  - Remove some hacks which I don't think are needed anymore. If you notice regressions due to this patch let me know ASAP.

svn path=/trunk/; revision=22704
2006-06-30 03:15:56 +00:00
Alex Ionescu 14f7e184f3 - Completely reformat io.h to same style as ob.h and add I/O Tracing.
- Fix irp.c file header
- IopRemoveThreadIrp:
  - Get the DeviceObject and I/O Stack *before* going back to dispatch, otherwise race conditions will happen.
  - Don't complete and IRP if it's already been through two stacks.
  - Remove the IRP from the thread's IRP list before re-initializing the list, or else the IRP was lost.
  - Make sure we have an error log entry before writing to it.

svn path=/trunk/; revision=22703
2006-06-29 23:52:45 +00:00
Alex Ionescu 72dd9f4111 [FORMATTING] - Cleanup before I start working on it... there were lots of weird formatting errors caused by my old IDE back when I was working on it.
[AUDIT] - The routines in this file mostly come from documented information in "NT File System Internals" by Rajeev Nagar which has pseudo-code for a lot of them, and other WDM Books and information.

svn path=/trunk/; revision=22702
2006-06-29 23:01:09 +00:00
Christoph von Wittich 99c66c095c fixed some warnings (msvc)
svn path=/trunk/; revision=22701
2006-06-29 22:32:06 +00:00
Christoph von Wittich 23b77e8fd7 fixed some warnings (msvc)
svn path=/trunk/; revision=22700
2006-06-29 22:12:40 +00:00
Johannes Anderwald cbfccc50b9 * finished reading console options.c
* thnx for everyone helping with this commit (you know who you are)

svn path=/trunk/; revision=22699
2006-06-29 21:40:22 +00:00
Johannes Anderwald e7fdae5613 * fix resource inconsistency (pointed out by Lohnegrim)
* halfplemented reading console options

svn path=/trunk/; revision=22698
2006-06-29 20:19:26 +00:00
Alex Ionescu 9478fc9049 - Activate the Grim Reaper and remove a hard-coded bugcheck. This fixes random bugchecks and especially bugchecks on shutdown.
svn path=/trunk/; revision=22697
2006-06-29 19:24:10 +00:00
Alex Ionescu 4c630fdc31 - Fixes in ObCreateObjectType to pass Fireball's (and some of my own local) ob tests:
- Fix a check in ObpFreeObject which was causing a bugcheck if the object had a handle database (fixes another kmtest failure/crash).
  - Verify parameters passed to ObCreateObjectType based on behaviour seen on Windows 2003 (I might've missed some, these are the ones I tested for). This fixes 2 of the kmtest failures.
  - Also make sure the object type's name doesn't have a slash in the name.
  - Also make sure we don't allow creating two object types with the same name.
  - Also use our own local copy of the object name and copy it.

svn path=/trunk/; revision=22696
2006-06-29 19:03:24 +00:00
Johannes Anderwald 3dd2bff814 * compile console with pch support
svn path=/trunk/; revision=22695
2006-06-29 18:19:51 +00:00
Johannes Anderwald de285c4081 * add ReactOS Console configuration DLL
svn path=/trunk/; revision=22693
2006-06-29 18:10:15 +00:00
Alex Ionescu ec719832c0 - Fix the last two Ob reference counting bugs:
- Don't de-reference the object when duplicating it (not sure why this was left there). This fixes all the "misbehaving object: Event" messages in the console and fixes those regressions.
  - Don't reference the object when doing a lookup (not sure why this was there either). This made it impossible to kill named objects, since ObpDeleteNameCheck did a lookup before killing them, and the lookup ended up adding a reference.
- Cm still needs fixing!

svn path=/trunk/; revision=22692
2006-06-29 18:07:53 +00:00
Saveliy Tretiakov 0e79c3011a Fix thread synchronization, use critical sections.
Rewrite some functions (optimize).


svn path=/trunk/; revision=22691
2006-06-29 17:36:04 +00:00
Brandon Turner 410ae9c26b Unicode fixes and error checking.
svn path=/trunk/; revision=22690
2006-06-29 15:08:10 +00:00
Johannes Anderwald cdbfb24b12 * fix building of win32k_test
svn path=/trunk/; revision=22689
2006-06-29 14:39:53 +00:00
Johannes Anderwald 92f587b398 * auto select items which are started automatically
* read disabled autostart items

svn path=/trunk/; revision=22688
2006-06-29 13:33:59 +00:00
Alex Ionescu 1c69156be9 - Cleanup the checks for mishbeaving objects a bit, and now quit the Dereference routine instead of doing the dereference. This has the advantage making console applications work again (note: this is NOT a fix. I'm just making the situation less bad until I fix ObDuplicateObject since that seems to be messing Events up, and until Cm gets fixed).
svn path=/trunk/; revision=22686
2006-06-29 05:20:16 +00:00
Alex Ionescu d02a403c94 - This patch finally enables closing handles for real, when NtClose is called. This means that File handles, processes, and all other NT Objects finally die (no more "file in use" and unkillable processes). On the other hand, this makes the registry code unhappy and unravelled a bug in ObDuplicateObject.
- Booting/installing still works, but the system will possibly be unstable. However I'm choosing to commit this because it shows correct Ob behavior and will allow Art to fix Cm's referencing properly.
- Implement ObCheckObjectAccess and call it to perform access verification checks.
- Properly create devices, processes and controllers with an extra reference count, so that when the code closes their handle they don't die.
- Check for invalid uses of ObfDereferenceObject for our current debugging purposes.
- Add SEH to NtQueryObject.

svn path=/trunk/; revision=22685
2006-06-29 05:05:27 +00:00
Art Yerkes 61cb74d018 Fixed reference counting in CmiConnectHive and CmiDisconnectHive.
No longer need hacks to check reference counts.
Deleted a ton of wierd code.
Fixed bug where we allocated uninitialized memory for child nodes we never
populated.
Now reference counting mirrors pointers exactly:
 - Hold one reference for the parent key pointer
 - Hold one reference for the list entry in the connected hive list

svn path=/trunk/; revision=22684
2006-06-29 03:48:43 +00:00
Brandon Turner c6661f1f9e expand %* to batch file params.
bug: #1629

svn path=/trunk/; revision=22683
2006-06-29 02:48:52 +00:00
Alex Ionescu bbfd29210c - Add some hacks to Cm to allow creating registry keys that finish with a backslash (this works under NT).
- Also add a REALLY nasty hack that forces OBJ_CASE_INSENSITIVE on all Registry APIs... this is needed because we seem to completely mess up case sensitivity otherwise and any user-mode caller that doesn't specify that flag will fail.
- These two fixes fix all the WINE failures for the "ntdll reg" test and should increase compatibility with some applications.
- Runtime Library Registry Wrappers Fixes and Optimizations:
  - Use an array of registry paths instead of duplicating them
  - Fix implenmentation of RTL_REGISTRY_HANDLE.
  - Verify all Appends for failure before continuing.
  - Use the strict minimum key permissions isntead of KEY_ALL_ACCESS.
  - Don't use OBJ_OPENIF
  - Use CAPS for \\REGISTRY\\USER (required to match a Windows quirk exposed by a WINE test)
  - Use the correct length in RtlpNtQueryValueKey
  - Generic cleanups, formatting and commenting.

svn path=/trunk/; revision=22682
2006-06-29 00:30:36 +00:00
Alex Ionescu 96c859e6a6 - Sync RtlBitmap* implementation with WINE: Fixes 278 regression failures (for a total of 0 now).
- Also adds implementations for RtlFindMostSignificantBit , RtlFindLeastSignificantBit, RtlFindNextForwardRunClear, RtlFindClearRuns.
- The RtlBitmap* package is essential for compatibility with NTFS.SYS and other File System Drivers, but these fixes should not really improve user-mode app. compat.

svn path=/trunk/; revision=22679
2006-06-28 20:51:51 +00:00
Aleksey Bragin 81f5e26099 Mikhail Zvyozdochkin: Fix compilation of msafd without precompiled header (also fixes compilation process on linux)
svn path=/trunk/; revision=22678
2006-06-28 20:27:41 +00:00
Alex Ionescu 78a7bd2051 [AUDIT] - Unlock these files, they're just lame wrappers around the NT Kernel APIs that handle them and they're tested by WINE tests.
svn path=/trunk/; revision=22677
2006-06-28 19:52:45 +00:00
Alex Ionescu abee505e57 - Rewrite all synch object wrappers in kernel32 to use a single unified method of implementation:
- A->W converstion through static TEB buffer.
  - Failure if opening without a name.
  - Special warning code for objects that already exist (fixes some WINE test failures and probably makes a myriad of applications work).
  - Use BasepConvertObjectAttributes when creating an object to remove code duplication.
- InitializeCrticalSectionAndSpinCount shouldn't raise an exception on failure.
- Optimize WaitForMultipleObjects to cache 8 objects on the stack instead of only 3.
- Reformat and comment all the files to ROS standards.

svn path=/trunk/; revision=22676
2006-06-28 17:08:35 +00:00
Alex Ionescu 561c27e0d3 - Implement, export and NDKize: DbgUiGetThreadDebugObject, DbgUiDebugActiveProcess, DbgUiStopDebugging, NtSetInformationDebugObject.
- Make CheckRemoteDebuggerPresent fail if no process was specified.
- Implement DebugActiveProcess, DebugActiveProcessStop, DebugBreakProcess, DebugSetProcessKillOnExit.
- Add *.vcproj to ignore lists.

svn path=/trunk/; revision=22675
2006-06-28 17:02:37 +00:00
Aleksey Bragin 1a65517f18 [FORMATTING]
- Amend file header slightly
- Add functions headers

svn path=/trunk/; revision=22674
2006-06-28 15:56:09 +00:00
Aleksey Bragin 76b7211579 [FORMATTING]
- Amend file header slightly
- Add function header
- STDCALL -> NTAPI

svn path=/trunk/; revision=22673
2006-06-28 14:02:39 +00:00
Aleksey Bragin 981fde0f9f [AUDIT]
- Add proper function headers, including links to publically-available documentation
- One internal function is subject to further review/audit

svn path=/trunk/; revision=22672
2006-06-28 13:53:30 +00:00