ChangeLog-0.3.1

From ReactOS
Jump to: navigation, search

This is the changelog for ReactOS™ version 0.3.1 (released 10 March, 2007), an open-source operating system designed to be binary executable- and device driver-compatible with Microsoft™ Windows NT™ and subsequent Microsoft operating systems such as Windows 2000™ and Windows XP™. ReactOS is written by the ReactOS development team, and the last previous version of ReactOS was version 0.3.0 (released 27 August, 2006).

Contents

General

Generic 0.3.1 Changes

RBUILD

Translations

  • Added and updated French Translation for Control Panel, Devmgmt, Downloader, ibrowser, Notepad, Reporterror, Rundll32, Solitaire, Syssetup, Timedate.cpl and Userinit (Pierre Schweitzer)
  • Added French Translation to Ipconfig (Sylvain Petreolle)
  • Thai keyboard layout added (Dmitry G. Gorbachev)
  • Dutch Translations for Explorer, ibrowser, Mmsys.cpl, Reporterror and Welcome from i386DX
  • Patches from Signouret Jerome for Bugs #1312 and #1370: French Translations for FreeLoader's fdebug and WineMine
  • Patch from Sylvain Petreolle for Bug #1539: French Translation for Newdev.dll
  • Patches from Paolo Devoti for Bugs #1921 to #1935 and #1974 to #1976: Italian Translations for Cacls, Control Panel, Devmgmt, Downloader, Expand, Format, ImageSoft, Regsvr32, Reporterror, Rundll32, Sndvol32, Taskmgr, Userinit, Vmwinst, Winlogon and WordPad
  • Patch from Kamil Hornicek for Bug #1959: Czech translation for Control Panel
  • Swedish translation of getfirefox by Andreas Bjerkeholt
  • Patch from Sylvain Petreolle for Bug #1539: Recommit french translations
  • Patches from Apostolos Alexiadis for Bugs #1429, #1509 and #1630: Greek Translations for Calc, Expand, Explorer, Hdwwiz, Oleaut32.dll, Rundll32, Userinit
  • Patches from Apostolos Alexiadis for Bugs #1631 and #1831: Greek Keyboard layout rewrite. Punctuation stuff and other similar issues fixed
  • Patches from Artyom Reznikov for Bugs #1279, #1624 and #1635: Added and updated Ukrainian Translations for Appwiz, Comdlg32.dll, Desk.cpl, Explorer, GetFirefox, Hdwwiz, Intl.cpl, Mmsys.cpl, Notepad, Regedit, Taskmgr, Timedate.cpl, User32.dll, Welcome and Wininit.dll
  • Patches from Lars Martin Hambro for Bugs #1606, #1607, #1637, #1641 to #1644, #1674 to #1687, #1695, #1696, #1698 and #1700: Norwegian Translations for Cacls, Calc, Cmd, Expand, Explorer, Format, GetFirefox, ibrowser, Imagesoft, Msconfig, Notepad, Ntvdm, "reactos.exe" (Setup tool under Windows), Regedit's Column List Box, Regsvr32, Reporterror, Rundll32, sm, Taskmgr, Userinit, Welcome, WineFile, WineMine, Winlogon and WordPad
  • Patch from Fork for Bug #1633: Norwegian Translation for Syssetup.dll, Winmm.dll, User32.dll and Userenv.dll
  • Patch from Simon Hanae for Bug #1795 and #1876: Japanese keyboard driver added
  • Updated Italian translation of Calc by Gabriel Ilardi
  • Patch from arzi for Bug #1367: Finnish Translation for Control and "reactos.exe" (Setup tool under Windows)
  • Patch from Emil Kaczmarek for Bug #1315: Polish Translation for WineMine

ReactOS Core

Kernel and Executive (NTOSKRNL)

  • Implemented ObReferenceProcessHandleTable (Alex Ionescu)
  • Implemented ObDereferenceProcessHandleTable (Alex Ionescu)
  • Implemented ObpReferenceProcessObjectByHandle (Alex Ionescu)
  • Simplified ObDuplicateObject (Alex Ionescu)
  • Patch from (Dmitry G. Gorbachev) for Bug #1953: fixes invalid sync after loading BLUE.SYS
  • Various warnings fixed (Thomas Weidenmueller)
  • Cleanup of locking and lookup macros (Alex Ionescu)
  • Adjustments in SeAccessCheck, returning STATUS_SUCCESS (Alex Ionescu)
  • Various optimizations of lookup context and lock (Alex Ionescu)
  • Patch from Thomas Weidenmueller for Bug #1667: NTOSKRNL: Fix GCC4 warning and return correct error code in NtSignalAndWaitForSingleObject
  • Fix incorrect loop of race conditions in the rundown protection implementation, requiring the value to have been changed and inactive before slow path is taken (Alex Ionescu)
  • Fix locking bugs in guarded mutex implementation where operations were not reattempted (Alex Ionescu)
  • Fix inverted result bug in KeTrytoAcquireGuardedMutex (Alex Ionescu)
  • Fix KiMask32Array, value off and caused errors in priority/affinity masks (Alex Ionescu)
  • Patch from Art Yerkes for memory management page referencing.
  • Handle leaks fixed in ExDestroyHandleEntry (Alex Ionescu)
  • Imitate success for WMI calls and add a stubbed wmilib.sys, so that drivers relying on WMI can feel comfortable (Aleksey Bragin)
  • Improve IoRegisterDeviceInterface() error-handling abilities and fix its behaviour so it's compatible with 3rd party drivers (Aleksey Bragin, Hervé Poussineau)
  • NDK 0.98, now with versioned headers. Too many changes to list, see the TinyKRNL SVN Logs for more detailed information. Thanks to Andrew (Wax), Thomas and Aleksey for testing. (Alex Ionescu)
  • Check the Image Config Data in MmCreatePeb for address abusing (bug #1487). (Alex Ionescu)
  • Speed-up the ElfpIsPowerOf2 function (bug #1464). (Alex Ionescu)
  • Use the Spare0 array, present in EPROCESS instead of ReactOS-specific members for Process Locking (temporary fix until pushlocks are used). (Alex Ionescu)
  • Use EPROCESS's AddressCreationLock instead of the MADDRESS_SPACE Lock. (Alex Ionescu)
  • Overlay MADDRES_SPACE over MM_AVL_NODE. Even though our structures are currently incompatible, they represent the same thing (The EPROCESS's Address space). (Alex Ionescu)
  • Get rid of ROS_EPROCESS and all the ugly type-casting that was being done, now that the last two hacks allow us to properly use EPROCESS. (Alex Ionescu)
  • Use the proper HANDLE_TABLE and HANDLE_TABLE_ENTRY structures. (Alex Ionescu)
  • Cleanup the formatting, code and function headers of most of the Object Manager interfaces. (Alex Ionescu)
  • SymTest: The Symbolic Link kernel implementation tester. Tests for really wacky symlink API properties. 8 failures on ROS. (Alex Ionescu)
  • SymLink Rewrite: Use OBJECT_SYMBOLIC_LINK structure as used by Windows NT (and added the structure to the NDK) (Alex Ionescu)
  • SymLink Rewrite: Changed code to use the new names in the structure (Alex Ionescu)
  • SymLink Rewrite: Only free the symlink's name if it has one, to avoid a bugcheck. (Alex Ionescu)
  • SymLink Rewrite: Optimize parsing: if the new name is actually shorter then the target name, then don't allocate from pool, but re-use the buffer. This improves symlink parsing speed. Also fix a bug which made it depend on the incorrect implementation of NtCreateSymbolicLinkObject (Alex Ionescu)
  • SymLink Rewrite: Re-align the link target maximum length in NtCreateSymbolicLinkObject if it's odd, and fail if the length is odd, smaller then the maximum, or if the maximum is zero. (Alex Ionescu)
  • SymLink Rewrite: Originally allocate the symlink name in Paged Pool. (Alex Ionescu)
  • SymLink Rewrite: Initialize new members of the structure. (Alex Ionescu)
  • SymLink Rewrite: Fail in no-memory case, instead of continuing. (Alex Ionescu)
  • SymLink Rewrite: Properly probe the LinkTarget in NtQuerySymbolicLinkObject. (Alex Ionescu)
  • SymLink Rewrite: Properly handle which length is chosen for the copy and for the return in NtQuerySymbolicObject. (Alex Ionescu)
  • SymLink Rewrite: Lock the symbolic link object type while querying it. Eventually many more parts of Ob need to do this kind of locking. (Alex Ionescu)
  • Fix some NDK bugs (Alex Ionescu)
  • Rewrote the Object Directory implementation to follow the NT Structures in the NDK. This got rid of the last remaining OBJECT_HEADER difference and switched over to OBJECT_DIRECTORY. (Alex Ionescu)
  • Wipe out PROS_OBJECT_HEADER and use OBJECT_HEADER since we are now compatible. (Alex Ionescu)
  • Cleanup profiling and debugging code, add function comment headers and comment the functions in obdir.c (Alex Ionescu)
  • Remove directory object parsing. Directory objects don't have parse routines. Instead, inline the lookup in ObFindObject (this hasn't been optimized yet, a lot of the code is now setting a = b, c = a, c = b. (Alex Ionescu)
  • Get rid of OB_ROS_PARSE_METHOD and use OB_PARSE_METHOD instead. Hacked the current parse methods to keep using a PWSTR, however they should be modified to use the UNICODE_STRING instead. (Alex Ionescu)
  • Fix ObReferenceObjectByName and ObOpenObjectByName not to ignore the AccessState and ParseContext parameters. (Alex Ionescu)
  • Change ObFindObject's prototype to be able to accommodate these two parameters so that they can be sent to the parse routine. (Alex Ionescu)
  • Rewrite Desktop/WindowsStation parsing to follow the NT Object Model, with some minor hacks to respect ROS's current parsing semantics. (Alex Ionescu)
  • Thanks to this, the long-lasting ExpDesktopCreate hack is gone, and so is OB_ROS_FIND_METHOD and OB_ROS_CREATE_METHOD in win32k. Next patch can fully remove WIN32_CALLOUT_DATA and use the NT type instead. (Alex Ionescu)
  • Convert all Win32k Object callback functions to the correct NT prototypes. (Alex Ionescu)
  • Get rid of ROS-internal WIN32_CALLOUT_DATA and use the real WIN32_CALLOUTS_FPNS type. (Alex Ionescu)
  • Get rid of the callout.h hack. (Alex Ionescu)
  • Get rid of the intriguing idea that exported/public APIs should have prototypes with inversed parameters (fix ObOpenObjectByName and all its callers). (Alex Ionescu)
  • Isolate ObFindObject into CmFindObject for the registry routines. Because of their well-known abuse of Ob, it's better to give them their internal routine so that when/if Ob ever gets fixed to parse properly, it won't force a re-write of Cm's object routines. (Alex Ionescu)
  • Add SecurityQoS and PreviousMode parameters to ObFindObject, so that these can be sent to the parse routine. Also don't send OBJECT_CREATE_INFORMATION to it, but each needed member separately. This avoids having to create a "Fake" structure in some calls which don't actually use the captured information. (Alex Ionescu)
  • Also remove RemainingPath and stop exposing it to public APIs. Move all ObInsertObject/ObOpen,ReferenceByName hacks to ObFindObject, and add a small one there. Basically trade 4 hacks for 1. (Alex Ionescu)
  • Re-implement delayed object deletion by using an optimized Object Reaper based on OBJECT_HEADER->NextToFree. Thanks to Thomas for the algorithm. (Alex Ionescu)
  • Refactor object deletion into two operations: Removal and de-allocation (this is needed for failure during allocation, which we don't do yet). (Alex Ionescu)
  • After freeing an object header structure, also clear the pointer so we don't attempt it again. (Alex Ionescu)
  • Clear the handle database if there is one (Alex Ionescu)
  • Make sure the create info flag is set before deleting captured attributes. (Alex Ionescu)
  • Use the allocation pool tag when de-allocating. (Alex Ionescu)
  • Use OBJECT_TYPE accounting for tracking the numbef of objects. (Alex Ionescu)
  • Remove the object from it's typelist if it has creator information. (Alex Ionescu)
  • Call the security procedure to delete the security descriptor. (Alex Ionescu)
  • Set the CreatorUniqueProcess (Alex Ionescu)
  • Do a privilege check of OB_FLAG_PERMANENT is being used, and de-allocate the object if this failed. (Alex Ionescu)
  • Send the PreviousMode to ObpAllocateObject so that it can honor it and set the OB_FLAG_KERNEL_MODE flag. (Alex Ionescu)
  • Use OBJECT_TYPE accounting to increase TotalNumberOfObjects. (Alex Ionescu)
  • Fail ObCreateObject in low-memory situations instead of ignoring it. (Alex Ionescu)
  • Respect OBJECT_TYPE.TypeInfo.InvalidAttributes if an attempt to create an object with invalid attributes is detected. (Alex Ionescu)
  • Respect PagedPoolCharge and NonPagedPoolCharge parameters and save them in the OBJECT_CREATE_INFORMATION structure. (Alex Ionescu)
  • Implement Per-Processor Lookaside List based allocation and de-allocation of the Object Create Information (object attributes capture) and of the object name. I counted over 4000 allocations for only 30 seconds of runtime, so this change greatly reduces pool fragmentation and increases speed. (Implementation is similar to the IRP lookaside list implementation, but inlined for speed). (Alex Ionescu)
  • Fix some cases where we weren't freeing captured information properly. This patch should also decrease memory leaks/usage. (Alex Ionescu)
  • Fix ExChangeHandle not to send NULL but the actual context to the callback function (fix by Thomas Weidenmueller <w3seek@reactos.org>) (Alex Ionescu)
  • Re-implement NtSetInformationObject based on ExChangeHandle and using ObpSetHandleAttributes as a callback. (Alex Ionescu)
  • Re-implement NtQueryObject's ObjectHandleInformation case to simply return the information that's already in HandleAttributes; there is no point in querying for it all over again. (Alex Ionescu)
  • Fix NtSetInformationObject not to allow a user-mode call to modify kernel-mode handle attributes. Add FIXME for Inheritance permissions check. (Alex Ionescu)
  • Fix NtQueryObject to properly return OBJ_PERMANENT and OBJ_EXCLUSIVE; these flags are not stored in Handle Attributes. (Alex Ionescu)
  • Fix NtQueryObject not to attempt referencing the handle if the caller specified AllTypesInformation, because then a handle is not needed. (Alex Ionescu)
  • Simplify ObGetObjectPointerCode and ObfReferenceObject. (Alex Ionescu)
  • Fix ObReferenceObjectByPointer to actually work like documented instead of doing random incorrect checks. Also add special case for Symbolic Link objects as documented by Caz Yokoyama at Microsoft. (Alex Ionescu)
  • ObReferenceObjectByHandle: Remove MAXIMUM_ALLOWED<->GENERIC_ALL conversion, I could find no mention of this in the docs. (Alex Ionescu)
  • ObReferenceObjectByHandle: Remove GENERIC_ACCESS <-> RtlMapGenericMask conversion, I could find no mention of this in the docs, and this mapping is only required when creating handles, not when referencing pointers. (Alex Ionescu)
  • ObReferenceObjectByHandle: Do not attach/detach from the system process, this isn't required since we're merely getting a kernel pointer from the handle netry. (Alex Ionescu)
  • ObReferenceObjectByHandle: Directly increase the pointer count instead of calling ObReferenceObject, since we already have the object header in a variable. (Alex Ionescu)
  • ObReferenceObjectByHandle: Cache ObpKernelHandleTable/Process->ObjectTable and use those directly instead of always de-referencing the process. (Alex Ionescu)
  • Rename ObpCreateTypeObject to ObCreateObjectType and fix definition. The latter is actually exported in NT, and there's no reason not to export it while having our own internally renamed version. (Alex Ionescu)
  • Added stub exports for ObCloseHandle, ObReferenceSecurityDesciptor, ObSetHandleAttributes, ObSetSecurityObjectByPointer so that someday someone can know what needs to be implemented. (Alex Ionescu)
  • Removed ObGetObjectPointerCount. It is not exported in newer OSes and was always undocumented. (Alex Ionescu)
  • Move ObQueryObjecctAuditingByHandle to security.c and optimized it not to attach to the system process, as well as to cache the handle table instead of dereferencing the owner process all the time. (Alex Ionescu)
  • Fix bug in IoCreateFile which my (correct) ObReferenceObjectByHandle bugfix patch uncovered. Bootcd/installation works again. (Alex Ionescu)
  • Make sure callers of NtMakeTemporaryObject have DELETE privileges, otherwise they could end up illegaly killing objects (in certain situations) (Alex Ionescu)
  • Make sure callers of NtMakePermanentObject have SeCreatePermanentPrivilege. (Alex Ionescu)
  • Implement ObpDeleteNameCheck as described in Gl00my's Ob Documentation (using such documentation falls under US Reverse Engineering Law * Clean rooming). (Alex Ionescu)
  • Remove duplicated code in ObpDecrementHandleCount and ObpSetPermanentObject and have them use ObpDeleteNameCheck instead. (Alex Ionescu)
  • Name-check is now properly done. (Alex Ionescu)
  • The keep-alive reference is now deleted when going from permanent->temporary object. (Alex Ionescu)
  • The parent directory is now dereferenced and cleared when deleting the object. (Alex Ionescu)
  • The security procedure is now called to delete the SD, and the name buffer is freed. (Alex Ionescu)
  • Remove ObGetObjectHandleCount, it's not a public function. (Alex Ionescu)
  • Modified ObpDecrementHandleCount to accept Process and GrantedAccess paraemters since the definition for the Close Procedure Callback requires them (and we were currently sending NULL). Also send 0 for process handle count, since we don't yet parse/support per-process handle databases. (Alex Ionescu)
  • Minor optimization: All objects have an object type, don't actually check if the object has one when decrementing a handle. (Alex Ionescu)
  • Minor accounting fix: Decrement the total number of handles for the object type whose handle count is being decreased. (Alex Ionescu)
  • Call the OkayToClose Procedure, if one is present, to allow the object owner a chance to disallow closing this handle. I believe this is required for properly protecting Winsta/Desktop handles (instead of using the regular protection mode, since that one can be bypassed). (Alex Ionescu)
  • Make ObpCreateHandleTable return NTSTATUS instead of VOID, so that it can return STATUS_INSUFFIENT_RESOURCES if the handle table couldn't be allocated. (Alex Ionescu)
  • Clone ObpCreateHandle to CmpCreateHandle. I am about to fix its implementation and since Cm* currently abuses Ob I feel it safer to give it its own internal function. (Alex Ionescu)
  • Make ObpCreateHandle internal to Ob as it should be. Change NtCreateProcessTokenEx to use ObOpenObjectByPointer, it has no business manually trying to create a handle. Same goes for ExpLoadInitialProcess. (Alex Ionescu)
  • Add some trace macros to monitor handle/pointer counts for fixing regressions/bugs later. (Alex Ionescu)
  • Change ObpCreateHandle to use an ACCESS_STATE structure instead of DesiredAccess. This is to help moving to an updated model where creating and incrementing a handle are 2 operations, so that code can be refactored (similar to how we now have Delete/Decrement as 2 operations). (Alex Ionescu)
  • Fix functions that were not creating an ACCESS_STATE Structure to create one locally now, or use the one passed as a parameter, if available. (Alex Ionescu)
  • Change ObpCreateHandle to the one documented and explained in the Gl00my documentation. It also fits the re-factored split create/increment model better, supports open reasons, and allows (to do) type-checking and extra object referencing from within one routine. (Alex Ionescu)
  • Add code to ObOpenObjectByName to detect the OpenReason. Experimental, since I'm not sure when to clear the flag. (Alex Ionescu)
  • ObpCreateHandle: Honour ObjectType passed to the function and fail if it doesn't match. (Alex Ionescu)
  • ObpCreateHandle: Use table-based logic instead of process-based logic for Kernel vs User-mode handles (same change that's been done all over the place, since it requires only one dereference of the process object). (Alex Ionescu)
  • ObpCreateHandle: Do the GENERIC/MAXIMUM_ALLOWED logic directly inside the ACCESS_STATE structure. (Alex Ionescu)
  • ObpCreateHandle: Increase the object type's number of handles as well. (Alex Ionescu)
  • ObpCreateHandle: Set the handle table entry's ObAttributes correctly; the old code seems to have been messing that up. (Alex Ionescu)
  • ObpCreateHandle: Honour the AdditionalReferences parameter and do referencing bias if requested. (Alex Ionescu)
  • ObpCreateHandle: Honour the ReturnedObject parameter to return the object pointer back to the caller. (Alex Ionescu)
  • ObpCreateHandle: If we failed because a handle couldn't be allocated, use the distinguied STATUS_INSUFFICIENT_RESOURCES error code instead of the generic STATUS_UNSCUCESFFUL, and backout all the changes we made by calling ObpDecrementHandleCount. (Alex Ionescu)
  • Split ObpCreateHandle into two distinct operations: Incrementing and Creating (like we have Delete/Decrement). No code additions, just splitting. (Alex Ionescu)
  • Because of the split, we can now directly only do an Increment when duplicating the handle, since we don't need to create a brand new one. Also, when inheriting, we can now properly do an increment as well, instead of simply manually increasing the handle count (because for each inherited handle, access checks and openprocedure should've still been called). (Alex Ionescu)
  • Use PagedPool instead of NonPagedPool memory, and also tag the allocation for debugging. (Alex Ionescu)
  • Send needed data to the security procedure instead of NULL/0, including the Generic Mapping, and the actual Security Decriptor. (Alex Ionescu)
  • Only un-assign the descriptor in case of failure, not all the time (the whole point of the API is to assign it!) (Alex Ionescu)
  • Tell the caller that memory was NOT allocated if we failed to get the security descriptor. (Alex Ionescu)
  • ObInsertObject: Create the ACCESS_STATE structure much earlier. (Alex Ionescu)
  • ObInsertObject: Actually send the access state and parse context to ObFindObject, when called from ObInsertObject (this should fix some hidden regressions, since they finally get an access state with access masks now). (Alex Ionescu)
  • ObInsertObject: Remove some deprecated hacks. (Alex Ionescu)
  • ObInsertObject: If inserting the handle failed, cleanup the name and remove it from the directory entry. (Alex Ionescu)
  • ObInsertObject: Fix a memory leak because we weren't deleting the access state. (Alex Ionescu)
  • Fix ObGetObjectSecurity to use the object type's pool type instead of assuming PagedPool. (Alex Ionescu)
  • Re-wrote the way ObInsertObject handles security as described in Chapters 6 and 9 of Gl00my (ie: made it use ObGetObjectSecurity and ObAssignObjectSecurity; ironically, these functions already existed/are exported and could've been used since the start instead of duplicating code). (Alex Ionescu)
  • Fix ObpReferenceCachedSecurityDescriptor only to touch the cached entry if it actually gets a non-NULL descriptor. Also improved it to return the referenced SD, instead of requiring the caller to do it manually. (Alex Ionescu)
  • ObFindObject should return the actual object being inserted, in the insert case (otherwise it always returns the root-directory instead.) (Alex Ionescu)
  • Add check for optimized case for objects with no name and no security, but not implemented (ObpIncrementUnnamedHandleCount in Gl00my docs), since I need a better translation then babelfish's. (Alex Ionescu)
  • Fix ObInsertObject to save the Security Descriptor in the Access State structure. Gl00my mentions this isn't absorbed by SeCreateAccessCheck and I just noticed that too. (Alex Ionescu)
  • We only need to perform security checks for a new object, in ObInsertObject, not if the object already existed. (Alex Ionescu)
  • Added proper backout+failure code in ObInsertObject if lookup failed, and also look out for mismatch/exists/collision cases (implemented using simple logic). (Alex Ionescu)
  • Rename ObpDeleteHandle to ObpCloseHandleTableEntry and change semantics so that it deals directly with the entry and table. This re-factoring optimizes the case where we already have the entry and don't want to use the handle to get the kernel table and then attach/detach/enter/exit critcal regions (such as when sweeping). (Alex Ionescu)
  • Implement ObCloseHandle, a new XP Export (Alex Ionescu)
  • Take old NtClose code and write it in ObpCloseHandle, which is the master function that Ntclose/ObCloseHandle share. (Alex Ionescu)
  • Complete patch requires ExSweepHandleTable to be modified to return the Handle instead of the entry, so that sweeping can be fixed to properly destroy handles and call their OkayToClose, instead of just decrementing a count. (Alex Ionescu)
  • Add Object Header Quota structure/define (Alex Ionescu)
  • Give Files/Devices a parse routine and currently stubplement it for debugging purposes and trying to figure out a way to kill the IopCreateFile hack. (Alex Ionescu)
  • Implement ObpChargeQuotaForObject. Using a memory breakpoint in WinDBG I've finally found where the OB_FLAG_CREATE_INFO flag gets masked out. Also attempted a very naive quota charging implementation, but it's a guess and probably wrong (but at least it does...something.) (Alex Ionescu)
  • Remove the heart (but not the brain) of the IopCreateFile hack. A much 'nicer' hack now detects if a filename can't be found, and instead of inserting it into the object directory (wrong!), calling IopCreateFile (wrong!), then having it fail, only to then remove the newly inserted object entry (wrong wrong wrong!), IopCreateFile is now *only* called for real files, otherwise Ob detects the invalid name and fails nicely and quickly. (Alex Ionescu)
  • Add the OPEN_PACKET structure to internal headers. Used for the I/O Parse Routine. (Alex Ionescu)
  • Gut down IopCreateFile to the strict minimum so that only the critical parts remain. (Alex Ionescu)
  • NT Compatiblity fix in ObFindObject: stop parsing if remaining path is null, this means that the parse routine is done parsing and that -this* is the final object. (Alex Ionescu)
  • Fix the CmpObjectDelete bugcheck by hacking away some code reponsible for it. The bugcheck is probably the result of the current ref-count bug. (Alex Ionescu)
  • Remove some more code in IoCreateFile/IopCreateFile to help with deprecating it later. (Alex Ionescu)
  • Update sweep callback to send the handle number. Patch by Thomas Weidenmueller (w3seek@reactos.org) (Alex Ionescu)
  • Export ObCloseHandle since it's implemented now (Alex Ionescu)
  • Implement ObpCreateUnnamedHandle and ObpIncrementUnnamedHandleCount as optimizations for ObInsertObject with unnamed objects. (Alex Ionescu)
  • Fix definitions of OB_QUERYNAME_METHOD and OB_OKAYTOCLOSE_METHOD. Add fixme for OB_SECURITY_METHOD, will change it later. (Alex Ionescu)
  • Simplified NtDuplicateObject to a simple stub around ObDuplicateObject, there is no need to have lengthy hacks for NtCurrentProcess/NtCurrentThread(). (Alex Ionescu)
  • Cleanup ObDuplicateObject to use normal Ob routines instead of grovelling through handle table structures and manually touching the handle count: It now calls ObpIncrementHandleCount and all the underlying operations are done on the duplicated handle. Also access state creation is done if the duplicated handle has different desired access. (Alex Ionescu)
  • Get rid of a dozen of debug prints that have been straying along for a long time (some for years), most of which I must shamefully admit I am responsible for. (Alex Ionescu)
  • Fix a critical bug subsystem bug in smss and don't hang the system 15 seconds on boot-up. (Alex Ionescu)
  • Rebase some problematic modules (and fix wshtcpip's rbuild file) to avoid relocations on bootup and some process startup. (Alex Ionescu)
  • Enable lsass startup in winlogon and the registry. (Alex Ionescu)
  • Only show debug log header when actually debugging to a file. (Alex Ionescu)
  • Bring out the champagne... one of my first-ever and most ancient ReactOS TODOs: the IopCreateFile hack has been totally removed and we now have a file/device parse routine. It's still nothing like NT's but it's not a hack anymore, and actually works like it should. (Alex Ionescu)
  • Pretty much the last Ob implementation/optimization patch (Except for a minor fix by Thomas to fix handle sweeping), re-implemented the ObFindObject routine by using some code that I had written almost 2 years ago with help from Thomas and Filip, plus some fixes discovered today while testing. (Alex Ionescu)
  • Fixed symbolic link and desktop/winsta parse procedures to become NT-compatible now that ObFindObject is as well. Also fixed file/device parse routine for these changes. (Alex Ionescu)
  • ObFindObject now supports STATUS_REPARSE_OBJECT, and has an optimized path for parsing when a root directory is given, as well as is entirely unicode_string-based. (Alex Ionescu)
  • Cleaned up ob.h and added ob_x.h for the inlined functions. (Alex Ionescu)
  • Implemented new Ob tracing system. (Alex Ionescu)
  • Enable ROS_LEAN_AND_MEAN if you want 50% smaller binaries and a 20 MB reduction in memory usage. (Alex Ionescu) (Note: ROS_LEAN_AND_MEAN may not work due to hidden bugs in debug symbols)
  • Create a new module type: exportdriver for drivers which also export files. Not supremely useful right now, but it helps us decrease compilation time of normal drivers by not running useless commands on them. Later we'll also strip out their export table. We can also make exportdrivers automatically read their .def file instead of specfiygone one. (Alex Ionescu)
  • Fix some referencing/bugs in Ob functions that I wrote which were known fixmes. (Alex Ionescu)
  • Remove every instance of ObDereferenceObject after an ObInsertObject that I could find. This temporarily will make the object leaks even worse, but it's better to increase leaks and then fix the ref bug, then to decrease references while missing spots that forgot to reference them (you'd end up with hard to debug randomly dying objects). (Alex Ionescu)
  • Handle mount failure (such as when a CDROM isn't actually inside the drive) instead of assuming success and setting a NULL device object. Fixes regression seen by Arty/James when winefiling, dir d:-ing or hardware device wizarding. (Alex Ionescu)
  • Check for valid access in NtSignalAndWaitForSingleObject and don't check if ResultLength isn't NULL in NtQueryObject, because it's not optional. (Alex Ionescu)
  • ObpCreateUnnamedHandle/ObpCreateHandle => Reference the object before calling ExCreateHandle. (Alex Ionescu)
  • Fix two critical bugs in ObInsertObject: We were creating a handle for the wrong object (in ObInsertObject) and we were not passing the ReferencedObject parameter to ObpCreateHandle, so that object was never being returned properly to the caller. (Alex Ionescu)
  • ObfDereferenceObject shouldn't check for the OB_FLAG_PERMANENT flag, or else it would never be possible to kill permanent objects while in kernel mode (permanent objects only apply to user-mode handles). (Alex Ionescu)
  • Fix another critical bug in ObInsertObject: don't overwrite the lookup status with the handle creation status. If the lookup returned something like OBJECT_NAME_EXISTS (which is a success + warning), we don't want to overwrite it with ObpCreateHandle's STATUS_SUCCESS. This should fix a large number of regressions (and also fixes many WINE ntdll "om" tests). (Alex Ionescu)
  • We also now correctly dereference the object in ObInsertObject, which should reduce one source of leaks (But there is still one). OTOH, this makes the Cm code crash at shutdown (I'll fix this ASAP, this fix is worth having atm.) (Alex Ionescu)
  • Catch illegal call to Ob functions when ObjectAttributes == NULL and return distinguished status code for this situation (STATUS_INVALID_PARAMETER), instead of failing due to access violation. (Alex Ionescu)
  • Add some hacks to Cm to allow creating registry keys that finish with a backslash (this works under NT). (Alex Ionescu)
  • 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. (Alex Ionescu)
  • Implement ObCheckObjectAccess and call it to perform access verification checks. (Alex Ionescu)
  • Properly create devices, processes and controllers with an extra reference count, so that when the code closes their handle they don't die. (Alex Ionescu)
  • Check for invalid uses of ObfDereferenceObject for our current debugging purposes. (Alex Ionescu)
  • Add SEH to NtQueryObject. (Alex Ionescu)
  • ObCreateObjectType: Fix a check in ObpFreeObject which was causing a bugcheck if the object had a handle database (fixes another kmtest failure/crash). (Alex Ionescu)
  • ObCreateObjectType: 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. (Alex Ionescu)
  • ObCreateObjectType: Also make sure the object type's name doesn't have a slash in the name. (Alex Ionescu)
  • ObCreateObjectType: Also make sure we don't allow creating two object types with the same name. (Alex Ionescu)
  • ObCreateObjectType: Also use our own local copy of the object name and copy it. (Alex Ionescu)
  • IopRemoveThreadIrp: Get the DeviceObject and I/O Stack *before* going back to dispatch, otherwise race conditions will happen. (Alex Ionescu)
  • IopRemoveThreadIrp: Don't complete and IRP if it's already been through two stacks. (Alex Ionescu)
  • IopRemoveThreadIrp: Remove the IRP from the thread's IRP list before re-initializing the list, or else the IRP was lost. (Alex Ionescu)
  • IopRemoveThreadIrp: Make sure we have an error log entry before writing to it. (Alex Ionescu)
  • IopCompleteRequest: 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. (Alex Ionescu)
  • IopCompleteRequest: Get rid of the #if 1/#if 0 nonsense hbirr had added. (Alex Ionescu)
  • IopCompleteRequest: Properly check for success/warning/failure cases (thanks to Filip for checking this out with me last year) (Alex Ionescu)
  • IopCompleteRequest: Handle scenarios when the IRP is marked IRP_CREATE_OPERATION (Alex Ionescu)
  • IopCompleteRequest: Bugcheck if IofCompleteRequest is called twice on the same IRP (Alex Ionescu)
  • IopCompleteRequest: Copy the master IRP's thread to the associated IRP (Alex Ionescu)
  • IopCompleteRequest: Free the Auxiliary Buffer if there is one. (Alex Ionescu)
  • Add more name/prototype decoration and API tracing. (Alex Ionescu)
  • Don't handle IRP_MJ_POWER in IoBuildAsyncronousFsdRequest. (Alex Ionescu)
  • Use IoAllocateMdl instead of being a cowboy and using MmCreateMdl. (Alex Ionescu)
  • Handle failure/out-of-memory cases in IoBuildAsyncronousFsdRequest (Alex Ionescu)
  • Free the input buffer on failure in IoBuildDeviceIoControlRequest (Alex Ionescu)
  • Handle failure in IoBuildSyncronousFsdREquest. (Alex Ionescu)
  • Bugcheck if cancelling and IRP that's already been completed. (Alex Ionescu)
  • Bugcheck if attempting to call a driver with an IRP that's already past its maximum stack size. (Alex Ionescu)
  • 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. (Alex Ionescu)
  • Fix IRP/Completion packet lookaside allocation. We weren't setting a zone size, and I/O Completion packets were also using the wrong size. (Alex Ionescu)
  • 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. (Alex Ionescu)
  • Rewrite IoBuildPartialMdl. It did not work like documented in the DDK and also had a bug documented by Microsoft as being in XP. (Alex Ionescu)
  • Refactor Io*Event APIs to call an internal worker function instead of duplicating the same code twice. (Alex Ionescu)
  • Optimize Io*Work APIs and initialize the event on allocation, not on queue!! (Alex Ionescu)
  • Use only one SEH block in NtRemoveIoCompletion (Alex Ionescu)
  • Get the completion status from the IRP, not from the Mini-Packet, if the completion came from an IRP and not a Mini-Packet. (Alex Ionescu)
  • Io*SymbolicLink should use OBJ_CASE_INSENSITIVE (Alex Ionescu)
  • Use DELETE instead of SYMBOLIC_LINK_ALL_ACCESS when deleting. (Alex Ionescu)
  • Clear the IO_TIMER structure when creating it. (Alex Ionescu)
  • Add basic support/detection for debug I/O remove blocks (we bugcheck if we identify one though). (Alex Ionescu)
  • Simplify IoReleaseRemoveLockAndWaitEx (Alex Ionescu)
  • Remove locks are SYNCH events, not Notification events! (Alex Ionescu)
  • Make sure IoConnectInterrupt returns NULL to the caller on failure. (Alex Ionescu)
  • Add some missing IO_ERROR definitions to the DDK and add some tags (Alex Ionescu)
  • Fix IoSetThreadHardErrorMode... it was reading the TEB instead of the PETHREAD. (Alex Ionescu)
  • Optimize Error Logging: Use a static work item instead of allocating one each time, and don't use a spinlock for the buffer count, when we can use interlocked functions instead. (Alex Ionescu)
  • Log Entries can have Device AND/OR Driver Objects, not just a single one. They must also be referenced/dereferenced on allocation/free. (Alex Ionescu)
  • Rewrite IopLogWorker to properly deal with Device/Driver objects and querying their names, as well as with additional strings that the caller might be sending. (Alex Ionescu)
  • IopGetDevicePointer: Close the handle if we were able to acquire it. (Alex Ionescu)
  • IoAttachDevice/IoAttachDeviceByPointer: Fail with STATUS_NO_SUCH_DEVICE if we couldn't attach. (Alex Ionescu)
  • IoAttachDEviceTodEviceStackSafe: VPBs don't get inherited. (Alex Ionescu)
  • IoCreateDevice: Only set OBJ_PERMAMENT if the caller requested it. (Alex Ionescu)
  • IoCreateDevice: Return a NULL Device object if we failed to create it. (Alex Ionescu)
  • IoCreateDevice: Set alignment requirement to 0, x86 doesn't need it. (Alex Ionescu)
  • Add IoGetDevObjExtension for getting the PEXTENDED_DEVOBJ_EXTENSION from a device object instead of always doing a huge typecast. (Alex Ionescu)
  • Implement device unloading through IopUnloadDevice and device referencing through IopReferenceDeviceObject and IopDereferenceDeviceObject, and make IoDeleteDevice and IoDetachDevice unload the device on 0 reference count. Doesn't fully work yet. (Alex Ionescu)
  • Simplify IoGetAttachedDEvice/IoGetAttachedDeviceReference not to use an extra stack variable. (Alex Ionescu)
  • Fix some bugs in IoGetRelatedDeviceObject: We should make sure that FO_DIRECT_DEVICE_OPEN isn't set when reading from the VPB's DO, otherwise we return the FO's DO directly. Also check for attachment before trying to get any attached device. (Alex Ionescu)
  • Implement IoRegisterLastchanceShutdownNotification based on IoRegisterShutdownNotification (Alex Ionescu)
  • Modify IoUnregisterShudownNotification to loop both lists now. (Alex Ionescu)
  • Used the lock in IoShutdownREgisteredDevices when looping the list, and changed it to send IRP_MJ_SHUTDOWN to the attached DO. Also fixed a memory leak where the shutdown entry wasn't being freed, and optimized the function only to initialize the event once (And simply clear it each time). (Alex Ionescu) (Alex Ionescu)
  • Clear the current IRP before parsing the Device Queues (Alex Ionescu)
  • Respect Cancelable parameter in IoStartNextPacket(ByKey) instead of ignoring it (acquire the cancel lock when it's requested) (Alex Ionescu)
  • Raise IRQL to DISPATCH_LEVEL in IoStartPacket instead of expecting the caller to do it and crashing. Also only use Cancel Lock if a Cancel Function was specified. (Alex Ionescu)
  • Actually handle the case where the IRP Was cancelled right after insert and the Cancel Routine has to be called. (Alex Ionescu)
  • Add definitions for additional DOE flags to NDK. (Alex Ionescu)
  • Implement IoSetStartIoAttributes (Alex Ionescu)
  • Obey StartIo Flags set by IoSetStartIoAttributes and change Packet functions to Windows XP/2003 semantics by supporting non-cancelable packets and deferred Start I/O calling. (Alex Ionescu)
  • Implement some functions to handle VPB Referencing/Dereferencing. (Alex Ionescu)
  • IoVerifyVolume: Send the IRP to the base FSD, in case the current FSD is an attachee (Alex Ionescu)
  • IoVerifyVolume: Set correct flags in the IRP to notify that this is a mount operation using PAGING I/O semantics. (Alex Ionescu)
  • IoVerifyVolume: Don't ignore AllowRawMount parameter. (Alex Ionescu)
  • IoVerifyVolume: We want to mount the File System on *FAILURE*, not on SUCCESS! (Alex Ionescu)
  • IoVerifyVolume: Add reference/dereferencing to the VPB. (Alex Ionescu)
  • IoVerifyVolume: Get rid of the stupid LIST_FOR_EACH macros in FS Notifcation APIs. (Alex Ionescu)
  • Each new change request should be queued at the end of the list, not at the head. (Alex Ionescu)
  • Also, reference the device object for each registration, since one more object is holding a pointer to it, likewise, dereference the object on deregistration. (Alex Ionescu)
  • IopLoadFileSystem should use the base FSD in case the device object is an attachee. Also, use IoBuildDEviceIoControlRequest to minimize the IRP setup to only a couple of lines. (Alex Ionescu)
  • Simplify/modularize FS registration by using distinct lists for each type of FS (Tape/Disk/Network/Cdrom). (Alex Ionescu)
  • Optimize by using directly the device queue instead of allocating a structure for each FS registered. (Alex Ionescu)
  • Hack IopMountVolume to manage this new model. Improved version coming in next patch to deal with some bugs. (Alex Ionescu)
  • Respect DeviceIsLocked flag and Alertable in IopMountVolume (Alex Ionescu)
  • Don't mount if the VPB is alread ymoutned or being removed (Alex Ionescu)
  • Bugcheck the system if we failed to mount the boot partition. (Alex Ionescu)
  • Mount the FS inline to avoid sending 6 parameters to a function only called once. (Alex Ionescu)
  • Set the right IRP flags for a mount operation. (Alex Ionescu)
  • Don't ignore AllowRawMount flag. (Alex Ionescu)
  • Don't waste time passing or clearing unused flags/data on the IRP/Io Stack. (Alex Ionescu)
  • If the device to be mounted is an attachee, find the base device object (Alex Ionescu)
  • Reference the device object being mounted. (Alex Ionescu)
  • If the file system being mounted is an atachee, find its base device object too, and increase the IRP Stack for each attached FSD. (Alex Ionescu)
  • Fix IRP parameters with this new information. (Alex Ionescu)
  • Improve list looping to remove gotos. (Alex Ionescu)
  • Dereference the device object in case of failure. (Alex Ionescu)
  • Add some optimizations to quickly skip invalid raw mounting. (Alex Ionescu)
  • Add support for VPB_RAW_MOUNT. (Alex Ionescu)
  • Allow raw mount if this is the only device on the list. (Alex Ionescu)
  • Make the success case go through shared exit, otherwise the device wasn't getting unlocked previously. (Alex Ionescu)
  • Implement IopInitailizeVpbForMount for the purpose of setting up the VPB for a newly mounted DO. It properly references the VPB and sets up its stack size and flags, adding support for VPB_RAW_MOUNT. Also sets the VPB pointer in the DevObjExtension. (Alex Ionescu)
  • Fix a bug which was causing us to incorrectly unlock the device if it was already locked by the caller instead of by IopMountVolume. (Alex Ionescu)
  • When loading the file system, make sure to unlock the device object if we had locked it in IopMountVolume, as well as to re-lock it afterwards. Also handle a potential race condition due to this unloacking, in which the VPB might've become mounted behind our back, and simply return success if this happened. (Alex Ionescu)
  • Use IoIsErrorUserInoduced to check if we couldn't mount the device because it was not actually inserted, was unrocognized, write-protected, etc... and completely break out of the mounting procedure if so. (Alex Ionescu)
  • Also use FsRtlIsTotalDeviceFailure to check if the error was a fatal device error (like a CRC error) and abandon mounting in this case as well. (Alex Ionescu)
  • Small optimization: don't bother to get the File System Listhead we'll parse if we're going to fail because of wrong VPB flags later... get the list only after we're sure we need it. (Alex Ionescu)
  • Move IoGetBaseFileSystemDeviceObject to device.c and make it check for FO_DIRECT_DEVICE_OPEN, which it wasn't before (and also code it in a less confusing way like the other IoGetXxxDeviceObject APIs) (Alex Ionescu)
  • Mask out the DO_VERIFY_VOLUME flag when mounting a device. (Alex Ionescu)
  • Start of heavy work on iofunc.c: (Alex Ionescu)
  • Created our new friends: IopCleanupFailedIrp, IopAbortInterruptedIrp, IopPerformSynchronousRequest, IopLockFileObject, IopUnlockFileObject, IopQueueIrpToThread, IopUpdateOperationCount. (Alex Ionescu)
  • What does this mean: We actually queue IRPs to their thread! We actually respect I/O transfers being interrupted/alerted! We actually respect I/O operation counts! We actually LOCK FILE OBJECTS instead of randomly using them! We now support Deferred (read: MUCH faster) I/O completion. (Alex Ionescu)
  • First function blessed: IopDeviceFsIoControl. (Alex Ionescu)
  • Also simplified access rights check and fixedup some formatting. (Alex Ionescu)
  • Combine IoQueryVolumeInformation and IoQueryFileInformation (Alex Ionescu)
  • Fix them to lock the fileobject for synch operations, use IopCleanupFailedIrp, queue the IRP in the thread's list, support aborting the I/o operation through IopAbortInterruptedIrp, and properly wait for comlpetion. (Alex Ionescu)
  • Same changes for IoSertInformation: Lock the FO, queue the IRP, support alerted I/O, etc... (Alex Ionescu)
  • Create IopFinalizeAsynchronousIo to deal with Sync APIs working on Async file objects, which need to be waited on differently and have the IOSB copied manually. (Alex Ionescu)
  • Update NtFlushBuffersFile to new semantics (ie, usage of the new implemented functions). (Alex Ionescu)
  • NtLockFile: Add proper sync operation. (Alex Ionescu)
  • NtLockFile: Set the APC Routine/Context in the IRP instead of ignoring them. (Alex Ionescu)
  • NtLockFile: Dereference the event on failure. (Alex Ionescu)
  • NtLockFile: Set the allocated buffer as AuxiliaryBuffer so the I/O manager fres it. (Alex Ionescu)
  • Add proper sync handling to NtUnlockFile. (Alex Ionescu)
  • Fix sync usage in NtQueryVolumeInformationFile, set the right IRP flags so that the I/O manager can handle copying the data back and freeing the buffer, and enable deferred completion. (Alex Ionescu)
  • Same sort of changes for NtSetVolumeInformationFile. (Alex Ionescu)
  • NtReadFile: Allow async i/o access on mailslots, without a byte offset. (Alex Ionescu)
  • NtReadFile: Fix sync semantics just like for the other functions until now. (Alex Ionescu)
  • NtReadFile: Fix a potential object leak in a failure case. (Alex Ionescu)
  • NtReadFile: Don't call IoBuildSyncronousFsdRequest since we want to build the IRP ourselves. (Alex Ionescu)
  • NtReadFile: Use deferred I/O as an optimization. (Alex Ionescu)
  • NtWriteFile: Allow async i/o access on mailslots, without a byte offset. (Alex Ionescu)
  • NtWriteFile: Fix sync semantics just like for the other functions until now. (Alex Ionescu)
  • NtWriteFile: Fix a potential object leak in a failure case. (Alex Ionescu)
  • NtWriteFile: Don't call IoBuildSyncronousFsdRequest since we want to build the IRP ourselves. (Alex Ionescu)
  • NtWriteFile: Use deferred I/O as an optimization. (Alex Ionescu)
  • NtQueryDirectoryFile: Setup a buffer/MDL and the correct IRP flags so that that I/O manager can handle allocation, copy, free for us. (Alex Ionescu)
  • NtQueryDirectoryFile: Setup the search pattern as an auxiliary buffer so that the I/O Mgr can track that one for us as well. (Alex Ionescu)
  • NtQueryDirectoryFile: Update to use the correct sync semantics/routines. (Alex Ionescu)
  • NtQueryDirectoryFile: Use deferred I/O completion. (Alex Ionescu)
  • Fix NtQueryInformationFile to use correct sync/async semantics and use deferred I/O completion. This routine doesn't use IopSyncronous/Asyncronous helper routines because it can be optimized to handle some Information classes in-line (not currently being done). (Alex Ionescu)
  • Fix NtSetInformationFile to use correct sync/async semantics and use deferred I/O completion. This routine doesn't use IopSyncronous/Asyncronous helper routines because it can be optimized to handle some Information classes in-line (not currently being done except for Completion Ports, like the previous code). (Alex Ionescu)
  • Add locking in IopDeleteFile, and only check for completion context or name if the file has a DO, otherwise those shouldn't exist. (Alex Ionescu)
  • Added support for device objects as well in IopSecurityFile, since the code is similar. Also fixed sync semantics for file objects, and made other little small fixes. (Alex Ionescu)
  • Fix and combine the creation of I/O Object Types, it was a complete mess with missing attributes and dangerous bugs (Adapters and Controllers had IopParseDevice as a parse routine and the same pool charge as a deivice object, etc.) (Alex Ionescu)
  • Fix IopQueryNameFile to properly validate and calculate lengths at each step of the way and to support incomplete buffers. Previously, dangerous assumptions were made about the buffers and the actual required length was never returned. (Alex Ionescu)
  • Finally fix IoCreateStreamFileObject. I had fixed it a long time ago but back then it was causing regressions. It now properly creates a handle for the FO and sets the right flags. (Alex Ionescu)
  • The FO's lock is a Synch event, not a notification event! (Alex Ionescu)
  • Fix IopcloseFile... I'm not sure it was working right after the Ob changes, so it's possible some devices weren't getting IRP_MJ_CLEANUP... also made it lock the FO and detect malformed FOs (more spam for you on the debug logs!) -* but this is one problem I'm planning on fixing. (Alex Ionescu)
  • IoCreateFile: Start with empty object (Alex Ionescu)
  • IoCreateFile: Set the type/size in the object header (Alex Ionescu)
  • IoCreateFile: Don't rudely ignore the following flags: FILE_WRITE_THROUGH, FILE_SEQUENTIAL_ONLY, FILE_RANDOM_ACCESS, OBJ_CASE_INSENSITIVE; they are not merely decorative. (Alex Ionescu)
  • IoCreateFile: Set correct IRP flags for IRP_CREATE_OPERATION so that the I/O manager knows how to deal with the request (also set SYNCH_API flag). (Alex Ionescu)
  • IoCreateFile: Deferred mode not yet enabled. (Alex Ionescu)
  • IoCreateFile: Simplify the way we set the parameters for pipes/mailslots/files. (Alex Ionescu)
  • IoCreateFile: Don't close the handle of an invalid FO. (Alex Ionescu)
  • Make IoCreateFile use deferred I/O completion. (Alex Ionescu)
  • Simplify IopParseDevice by removing duplicate code. (Alex Ionescu)
  • Begin attempt at usage of the OPEN_PACKET for I/O Create operations. Currently we only build it and verify it, and I've fixed up IopCreateFile. (Alex Ionescu)
  • Move the code in IoCreateFile inside IopParseDevice where it belongs. Currently only a raw move and hacks to make it not regress anything, but in the future we can now finally start applying some important fixes for proper communication with FSDs and setting a myriad of flags and settings required. Will also allow for some nice optimizations in the future. (Alex Ionescu)
  • Allocate a copy of the EA buffer even for kernel-mode requests, also make the call use a tagged buffer. (Alex Ionescu)
  • Detect if the FSD is reparsing, which we don't support now (we'll bugcheck for now, so we can quickly detect this later instead of handling it wrong). (Alex Ionescu)
  • Use a simpler and more robust way to detect direct device opens and save it in a variable that's read when needed, instead of having multiple large code paths. (Alex Ionescu)
  • Implement IopCheckVpbMounted and use it in IopParseDevice as documented in NT File System Internals. (Alex Ionescu)
  • Add some missing ref/deref calls for DOs and VPBs. (Alex Ionescu)
  • Add some more proper handling of ref/dereferencing in IopParseDevice. (Alex Ionescu)
  • Add proper failure case for IRP allocation failure (Alex Ionescu)
  • Only initialize the FO's lock for Synch I/O (Alex Ionescu)
  • Add some missing comments (Alex Ionescu)
  • Fixup some formatting (Alex Ionescu)
  • Massively improve File I/O by using deferred I/O completion for MJ_(MAILSLOT/FILE/NAMEDPIPE)CREATE and manually completing the IRP. (Alex Ionescu)
  • Uber-optimize IopQueryAttributesFile by using the OPEN_PACKET mechanism to query file attributes, instead of doing lots of slow native calls. (Alex Ionescu)
  • Modify IopParseDevice to detect when OPEN_PACKET optimizations are in use (query or deletion (deletion not yet implemented)) and have some codepaths be slightly different and use DUMMY_FILE_OBJECT. (Alex Ionescu)
  • Implement QueryOnly case in IopParseDevice to handle attribute queries. (Alex Ionescu)
  • Add a missing dereference, and remove an extra DO reference. (Alex Ionescu)
  • Remove a ROS hack in IopCloseFile. (Alex Ionescu)
  • Add support for cases when the FSD that actually did the FO create wasn't the one to whom we went the IRP. (Alex Ionescu)
  • Also add support for detecting volume opens and setting the FO_VOLUME_OPEN flag. (Alex Ionescu)
  • Implement IoFastQueryNetworkAttributes which is now a piece of cake thanks to a properly implemented IopParseDevice. (Alex Ionescu)
  • Implemented NtDeleteFile, also a piece of cake now that we have IopParseDevice done. (Alex Ionescu)
  • Don't use FILE_ATTRIBUTE_NORMAL for mailslots/namedpipes. (Alex Ionescu)
  • Zero out the OPEN_PACKET and only set non-zero members in functions that use it. (Alex Ionescu)
  • NtCancelIoFile: Don't use macro-based list looping. (Alex Ionescu)
  • NtCancelIoFile: Update operation counts. (Alex Ionescu)
  • NtCancelIoFile: Wait 10ms instead of 100ms. (Alex Ionescu)
  • Allocate Re-Init entries with a tag (Alex Ionescu)
  • IoAllocateDriverObjectExtension and IoGetDriverObjectExtension: They were using the wrong structure (a made up one). (Alex Ionescu)
  • IoAllocateDriverObjectExtension and IoGetDriverObjectExtension: They were saving the extension where the Driver Object's base address should be. (Alex Ionescu)
  • IoAllocateDriverObjectExtension and IoGetDriverObjectExtension: Fix Memory leaks. (Alex Ionescu)
  • IoAllocateDriverObjectExtension and IoGetDriverObjectExtension: Fix sometimes holding the lock too long. (Alex Ionescu)
  • Created EXTENDED_DRIVER_OBJECT structure in NDK, since parts of the documented one are hidden (much like EXTENDED_DEVICE_OBJECT). (Alex Ionescu)
  • Fixed IopDeleteDriver to free what it should. (Alex Ionescu)
  • Fixed IoCreateDriver to handle more failure cases. (Alex Ionescu)
  • Simplify IopReinitializeBootDrivers and IopReinitializeDrivers. (Alex Ionescu)
  • For some strange reason, boot drivers were re-initailized *after* system drivers. (Alex Ionescu)
  • Process Manager Rewrite: Architectural changes to match information in Windows Internals 4 and other documented sources of information (Windows Internals II by Probert). Code should match Win2003 layout. (Alex Ionescu)
  • Process Manager Rewrite: Handle almost any possible process/thread sub structure and add its cleanup code stubs, so that when we actually implement them, we won't forget to clean them up in the process code. (Alex Ionescu)
  • Process Manager Rewrite: Add interlocked usage of process and thread flags in order to make everything more thread-safe. (Alex Ionescu)
  • Process Manager Rewrite: Better handle cases where threads die instantly, race conditions, and other weird issues. (Alex Ionescu)
  • Process Manager Rewrite: Better handle process termination and thread termination. (Alex Ionescu)
  • Process Manager Rewrite: Implement NtCreateProcessEx and update PspCreateProcess/NtCreateProcess. (Alex Ionescu)
  • Process Manager Rewrite: Improve cleanup of process object in PspProcessDelete. (Alex Ionescu)
  • Process Manager Rewrite: Optimize some things like User Thread startup. (Alex Ionescu)
  • Process Manager Rewrite: Add some extra asserts, paged_code checks and also user-mode security check. (Alex Ionescu)
  • Process Manager Rewrite: Implement helper API PsGetNextProcessThread (Alex Ionescu)
  • Process Manager Rewrite: Optimize thread reaper (thanks Filip) (Alex Ionescu)
  • Process Manager Rewrite: Do proper referencing/dereferencing of thread/processes (thanks Thomas) (Alex Ionescu)
  • Fix up some stuff in Kernel Gates support. (Alex Ionescu)
  • Fix up some implementation bugs in Executive Rundown support. (Alex Ionescu)
  • Implement Fast Referencing and fix EX_FAST_REF definition. (Alex Ionescu)
  • Implement ObReferenceEx and ObDereferenceEx. (Alex Ionescu)
  • Split off ObpDeferObjectCompletion. A new win2003/vista API requires direct acess to being able to defer deletes. (Alex Ionescu)
  • Fix some bugs in Process Token management and make it all properly use Fast Referencing. (Alex Ionescu)
  • When duplicating a token in a new process, don't de-reference it before it's even created, and also insert it. (Alex Ionescu)
  • Change ExpChangeRundown macro to fix warnings in msvc. (Alex Ionescu)
  • Fix KiAcquireMutexContended, it was broken in contended cases. (Alex Ionescu)
  • Inline Acquiring/Leaving guarded regions and the gmutex code, instead of going through 3-4 indirect calls. (Alex Ionescu)
  • Add a mountain of ASSERTs to detect incorrect usage/state. (Alex Ionescu)
  • Set ->SpecialApcDisable in the Guarded Mutex. (Alex Ionescu)
  • Fix broken KTHREAD definition. SpecialApcDisable and KernelApcDisable were incorrectly marked as USHORT instead of SHORT, which could cause severe trouble under optimized builds (At least under MSVC, since MSVC wouldn't allow a negative number in an unsigned short). (Alex Ionescu)
  • Use GM_LOCK_BIT_V. (Alex Ionescu)
  • Fix broken KeTryToAcquireGuardedMutex prototype. (Alex Ionescu)
  • Fix broken KGUARDED_MUTEX typedef and add bit values. (Alex Ionescu)
  • Fix broken Interlocked* prototypes in regards to volatileness. (Alex Ionescu)
  • Add ASSERT_QUEUE macro. (Alex Ionescu)
  • Cleanup queue.c (Alex Ionescu)
  • Add some ASSERTs (Alex Ionescu)
  • Properly check for SPecialApcDisable before aborting a wait. (Alex Ionescu)
  • Fix a bug in KiWaitQueue which was causing us not to remove the queue from the thread's wait list. (Alex Ionescu)
  • Add some TIMER values to the ddk. (Alex Ionescu)
  • Add DPC Settings (Queue Depths, Rates, etc) (Alex Ionescu)
  • Cleanup System/Run Time Update code. (Alex Ionescu)
  • Always increase kernel time in PRCB when inside kernel-mode code. (Alex Ionescu)
  • Get rid of superflous interlocked commands when not needed. (Alex Ionescu)
  • Improve detection of DPC vs non-DPC time. (Alex Ionescu)
  • Respect and apply DPC queue/rate rules. (Alex Ionescu)
  • Allow future use of non-fulltick time increments. (Alex Ionescu)
  • Don't make the timer signaled in KeSetTimerEx if it already expired. (Alex Ionescu)
  • Only call KiWaitTest on timers if they have waiters. (Alex Ionescu)
  • Fix list looping in KiExpireTimers. (Alex Ionescu)
  • Add checks for special apc disabled (guarded regions) in wait code. (Alex Ionescu)
  • Set the right wait status in KiAbortWaitThread. (Alex Ionescu)
  • Don't ignore priority boost (increments) when aborting waits. (Alex Ionescu)
  • When satisfying a mutant, insert if into the the head of the back-link, not the forward-link. (Alex Ionescu)
  • Fix utterly messed up unblocking/readying thread logic. (Alex Ionescu)
  • KiUnblockThread becomes KiReadyThread and doesn't perform priority modifications anymore. Also removed a large block of code that was #if 0ed out. (Alex Ionescu)
  • KiAbortWaitThread now does priority modifications (and better then before), then calls KiReadyThread. (Alex Ionescu)
  • Inserting a queue now *READIES A THREAD ONLY* instead of removing all its waits! (Alex Ionescu)
  • Add KiCheckThreadStackSwap and KiAddThreadToWaitList macros (Alex Ionescu)
  • Initialize PRCBs' Wait Lists (Alex Ionescu)
  • Fix a ghastly implementation fault where the the queue code was correctly removing the thread from its wait list, but where this wait list was actually connected to the _SCHEDULER_ and ended up removing a thread behind its back, causing bizarre issues and w3seek's ASSERT(State == Ready) bug. Fixed this by using the macros above and PRCB Wait List and properly inserting a waiting thread into that list, and then removing it when unblocking it or removing a queue. (Alex Ionescu)
  • Fix a serious bug in Kernel Queues. A condition existed where an inserted kernel queue with a timeout would crash the system once the thread waiting on it had its wait aborted or completed. (Alex Ionescu)
  • Implement Safe Referencing (an internal method for referencing objects when race conditions are possible) (Alex Ionescu)
  • Implement two Vista APIs and export them: ObIsKernelHandle and ObDeleteObjectDeferDelete. ZOMG! Vista APIs in the kernel! (Alex Ionescu)
  • Add IN/OUT annotations for KeWaitForSIngleObject (Alex Ionescu)
  • Set the wait block outside the loop, small optimization in case we get alerted by an APC and have to loop again. (Alex Ionescu)
  • Set the wait block pointer in the KTHREAD structure only *after* checking if a wait is actually needed. That way, if the object is already signaled, we don't set anything in the WaitBlockList. (Alex Ionescu)
  • Small optimization: only set the caller's WAitBlock as the next wait block if a timer wasn't specificed, else we ended up overwriting the value. (Alex Ionescu)
  • Small optimziation: don't write the thread in the wait block, this is a wait for a signle object so this isn't needed. (Alex Ionescu)
  • Remove some debug prints that are not needed anymore (Alex Ionescu)
  • NtCurrentTeb now returns the TEB instead of the KCPR, so re-enable the codepath that set the CurrentLocale and IdealProcessor in the TEB from the KTHREAD. (Alex Ionescu)
  • Fixed a bug in PspUserThreadStartup which was causing us to notify the debugger for system threads or hidden threads, instead of vice-versa. (Alex Ionescu)
  • Threads were incorrectly created with KernelMode access instead of PreviousMode. (Alex Ionescu)
  • Initialize the thread's rundown protection and use the process's. (Alex Ionescu)
  • Handle failure when TEB = NULL. (Alex Ionescu)
  • The LPC Semaphore has a limit of 1, not 0x7FFF. (Alex Ionescu)
  • Added very basic and skeletal NUMA code when creating a thread and process, currently only does some basic affinity checks and settings. (Alex Ionescu)
  • Added a table and helper function (KeFindNextRightSetAffinity) for calculating affinity masks and sets. (Alex Ionescu)
  • Split KeInitailizeThread into KeStartThread and KeInitThread, and modified Ps code to use the calls. Now added a failure case where Init fails, but we don't have to backout the entire effects of a "Start". (Alex Ionescu)
  • Fix definition of OBJECT_DIRECTORY_INFORMATION (Alex Ionescu)
  • Implement most of NtQueryDirectoryObject. It lacks the last step of converting the absolute buffer to a relative one. I have no idea why the old code was re-implemented in a recent commit when I clearly said I would fix this tonight. (Alex Ionescu)
  • Fix two small bugs in NtQueryDirectoryObject. (Alex Ionescu)
  • RDISK Count, Windowstation list enumeration now work on startup. (Alex Ionescu)
  • Explorer's object viewer now works again. (Alex Ionescu)
  • Factor out NtSet/GetContextThread implementation into PsGet/SetContexThread, new exported kernel APIs available to drivers, and export them. (Alex Ionescu)
  • If the caller didn't request extended registers, don't probe the full CONTEXT structure. (Alex Ionescu)
  • Use the proper trap frame in the kernel APC responsible for the context read/write. (Alex Ionescu)
  • Always go through the APC instead of directly calling the Ke routine. (Alex Ionescu)
  • Set default locale to 0x409 instead of 0x0. (Alex Ionescu)
  • Fix a bug in one of the alert APIs which was probing for a valid pointer even if the caller had given NULL (which is valid if the caller doesn't want the previous state returned). (Alex Ionescu)
  • Pushlocks need to be acquired in a -critical-, not -guarded* region. (Alex Ionescu)
  • PsDisableImpersonation should return FALSE if it was already disbled. (Alex Ionescu)
  • Don't forget to reference the token in PsReferenceEffectiveToken. (Alex Ionescu)
  • PsImpersonateClient should still return success if it was given no token. (Alex Ionescu)
  • PsImperstonateClient should de-reference the token if there is already active impersonation info. (Alex Ionescu)
  • Fix a bug in PspSystemStartup. (Alex Ionescu)
  • Properly hold object references towards a thread that's being created. (Alex Ionescu)
  • Set the Thread->GrantedAccess value. (Alex Ionescu)
  • Update NtOpenThread to use an Access State since these work now and Ob respects them, and also add a special hack present on NT: If the SeDEbugPrivilege is present, then the caller will get full thread access regardless of his rights. (Alex Ionescu)
  • Simplify PsGetNextProcess so it works like PsGetNextProcessThread. (Alex Ionescu)
  • Reformat and annotate parts of process.c (Alex Ionescu)
  • Remove PsGetWin32Process, PsGetWin32Thread and implement/export the real functions PsGetCurrentProcessWin32Process, PsGetCurrentThreadWin32Thread, change win32k to use them. (Alex Ionescu)
  • Initailize and use process rundown. (Alex Ionescu)
  • Set corrent GrantedAccess. (Alex Ionescu)
  • Remove an extra incorrect reference we were adding to processes. (Alex Ionescu)
  • Implement PsIsProcessBeingDebugged. (Alex Ionescu)
  • Make the same changes to NtOpenProcess that we did previously to NtOpenThread. (Alex Ionescu)
  • Fix Win32K thread rundown bug, fixes shutdown crash and other bugchecks where some ASSERT(Class->windows) wasn't 0. (Alex Ionescu)
  • Close the right debug handle instead of some random value. (Alex Ionescu)
  • Change FAST_MUTEX PsActiveProcessMutex to KGUARDED_MUTEX. (Alex Ionescu)
  • Define PS Flags and use them, isntead of magic numbers. (Alex Ionescu)
  • Add Pushlock support for GCC (Thanks Thomas!) (Alex Ionescu)
  • Remove a bunch of deprecated crap from ps.h (Alex Ionescu)
  • Get rid of PsLockProcess, PsUnlockProcess. Use the process pushlock instead. (Alex Ionescu)
  • When assigning the job, only acquiring rundown protection is enough. (Alex Ionescu)
  • Use interlocked intrinsics for setting the ExceptionPort instead of locking the entire process object. (Alex Ionescu)
  • Disable locking in ProcessSessionInformation for NtSetInformationProcess. The whole API seems wrong anyway, on my XP machine calling it does not change the session or change any token data. To verify later... (Alex Ionescu)
  • Refactor NtSuspend/ResumeThread into PsSuspend/ResumeThread. (Alex Ionescu)
  • Implement NtSuspend/ResumeProcess with PsSuspend/ResumeProcess. (Alex Ionescu)
  • Improve the previous code to use rundown protection and be thread-safe. (Alex Ionescu)
  • Fix a bug in PsGetNextProcess(Thread) since we now use safe referencing and the lookup loop can continue. (Alex Ionescu)
  • Kernel, Memory Manager and Process Manager APIs for: Process Quantum. (Alex Ionescu)
  • Kernel, Memory Manager and Process Manager APIs for: Fixed and Variable Quantum Tables. (Alex Ionescu)
  • Kernel, Memory Manager and Process Manager APIs for: Long and Short Quantum Variability. (Alex Ionescu)
  • Kernel, Memory Manager and Process Manager APIs for: Priority Separation and Separation Masks. (Alex Ionescu)
  • Kernel, Memory Manager and Process Manager APIs for: Foreground Quantum Table. (Alex Ionescu)
  • Kernel, Memory Manager and Process Manager APIs for: Process Priority, Priority Modes and Priority Classes. (Alex Ionescu)
  • Kernel, Memory Manager and Process Manager APIs for: Virtual Memory Priority (Alex Ionescu)
  • Kernel, Memory Manager and Process Manager APIs for: Job Scheduling Classes (Alex Ionescu)
  • Implement PsSetProcessPriorityByClass. (Alex Ionescu)
  • Add bugcheck CRITICAL_OBJECT_TERMINATED (Alex Ionescu)
  • Implement PspCatchCriticalBreak and fix the 5 or so FIXMEs that depended on it. (Alex Ionescu)
  • Give winlogon SE_ASSIGNPRIMARYTOKEN_PRIVILEGE because it was lacking it and would fail under this kernel patch. (Alex Ionescu)
  • PspAssignPrimaryToken was good enough for actually *assigning* the token, but when NtSetInfoProcess is called with ProcessPrimaryToken, we want to do a lot more then just randomly assigning it. Added PspSetPrimaryToken which first verifies if the token being assigned is a child token and if not, checks for SeAssignPrimaryTokenPrivilege. Also added a fixme for more code that's needed, to actually re-calculate the process's granted access towards itself. Also added thread-safety. (Alex Ionescu)
  • Implement KiRecalculateDueTime to handle cases where a timeout wait has been interupted by an APC or alerted, and it needs to be recalculated in the relative case. (This fixes the "contact alex" bugcheck). (Alex Ionescu)
  • CT_ACTIVE_IMPERSTIONATION_INFO_BIT -> CT_ACTIVE_IMPERSONATION_INFO_BIT (Alex Ionescu)
  • Added Process and Thread locking inlined functions for Ps Security functions. (Alex Ionescu)
  • Thread safety is your friend! Huge rework of almost all the functions in ps/security.c to use the process/thread pushlocks and use interlocked operations when dealing with the ActiveImpersonationInfo thread flag. (Alex Ionescu)
  • Added PAGED_CODE(). (Alex Ionescu)
  • Added checks for Processes with Jobs for the day that will happen. (Alex Ionescu)
  • PsAssignImpersoonationToken with a NULL token handle means simply to revert to self. (Alex Ionescu)
  • Don't ignore the HandleAttributes in NtOpenProcessTokenEx. (Alex Ionescu)
  • Use SeTokenType to make sure the token passed is an impersonation token. (Alex Ionescu)
  • Remove some fixed bugs in krnlfun.c, add more TODOs. (Alex Ionescu)
  • ImperstionationLocale -> ImpersonationLocale. (Alex Ionescu)
  • Implement PspWriteTebImpersonationInfo for setting the impersonation locale and impersonation status in the TEB (since User-mode needs to read this value and we don't want to NtQueryInformationThread for it each time to read the ETHERAD flag). (Alex Ionescu)
  • Complete the implementation of PspSetPrimaryToken to recalculate a process's access rights to itself based on a new primary token. (Alex Ionescu)
  • SeAccessCheck should assume failure if no SD was passed. Also fixes bugcheck on startup since processes don't currently have SDs. (Alex Ionescu)
  • Refactor SeCaptureSubjectContext into SeCaptureSubjectContextEx and SeCreateAccessState into SeCreateAccessStateEx. The *Ex routines allow specifying a custom process/thread which isn't the current one. This is useful when creating a new process or thread since we're not actually in it. (Alex Ionescu)
  • Implemented a bit more security calls in PspCreateProcess as seen in WI II. We now create an AccessState. (Alex Ionescu)
  • Also write the PID in the ObjectTable. (Alex Ionescu)
  • Make use of PsChangeQuantumTable on system startup to setup the raw priority separation. (Alex Ionescu)
  • Call PspComputeQuantumAndPriority in PspCreateProcess to calculate process base priority and quantum for child threads. (Alex Ionescu)
  • Add security code to calculate process's access rights to itself, as documented in WI II. (Alex Ionescu)
  • Acquire Process lock when touching the thread list entry and incrementing the process' active threads. (Alex Ionescu)
  • Set the Thread Create Time on creation, I had forgotten this! (Alex Ionescu)
  • Handle failures for thread-safety/race conditions. If the process was deleted or the thread terminated behind our back, then go through a manual un-initalization code path. (Alex Ionescu)
  • Just like previous process patch, add code to now create an access state with SeCreateAccessStateEx. (Alex Ionescu)
  • Handle failure of ObInsertObject. (Alex Ionescu)
  • Add ObGetObjectSecurity calls like in PspCreateProcess to check the thread's level of access towards itself. (Alex Ionescu)
  • Add code to handle two more failure (the last, afaics) cases. (Alex Ionescu)
  • Implement XP-style process name auditing to store the full name of the process in EPROCESS instead of only the first 16 ascii characters. This is required for one of the newer Info process classes. Implemented SeInitializeProcessAuditName and SeLocateProcessImageName. (Alex Ionescu)
  • Remove #ifed out code in PspCreateProcess which was attempting to create the name structure. Add code to MmCreateProcessAddressSpace to initialize the audit name after the 16-byte name. (Alex Ionescu)
  • Implement some helper APIs for better code refactoring. (Alex Ionescu)
  • Remove PspGetImagePath and use the new SeLocateProcessImageName instead. It's still not fully XP-compatible, because it should return the entire name with the \Device\HardDisk0 path, but that is easily fixable by modifying the OB Type info for the device object to also use IopQueryNameFile (TODO). (Alex Ionescu)
  • Generate KUSER_SHARED_DATA cookie if it doesn't already exist when a user-mode thread runs. (Alex Ionescu)
  • Set DRVO_INITAILIZED flag for intiailized driver objects. (Alex Ionescu)
  • Loop the list of devices created by the driver's DriverEntry and remove the DO_DEVICE_INITIALIZING flag. (Alex Ionescu)
  • Enable IopReferenceDeviceObject in IopParseDevice (not much use for now except OS "Correctness" and identifying broken drivers). DO referencing isn't fully used in the kernel yet. (Alex Ionescu)
  • Fix broken drivers: i8042 and videoprt. NDIS might be broken too, but downloading worked fine for me, so it's not hitting the check in IopParseDevice. (Alex Ionescu)
  • Fix Broken Installers and other I/O programs that couldn't, for example, create temporary directories. (Alex Ionescu)
  • Fix Firefox installers and other apps crashing due to a bug in NtSetInformationFile. (Alex Ionescu)
  • Fix File Objects being referenced twice resulting in IRP_MJ_CLOSE/CLEANUP never being sent and several memory leaks. (Alex Ionescu)
  • Fix File Object Lock being incorrectly created and then misused by mm/section code. (Alex Ionescu)
  • Fix creation of File Object before setting up the IRP, to properly cleanup during failures. (Alex Ionescu)
  • Add failure code if ObCreateObject fails. (Alex Ionescu)
  • Add SEH to all iofunc.c functions that required it. (note: Some SEH might seem "useless" to have been added. This is because we don't use Pool Quotas yet, which generate exceptions which will later need to be handled). (Alex Ionescu)
  • Implement IopExceptionCleanup as a generic cleanup handler for SEH exceptions. (Alex Ionescu)
  • Add another paramter to IopCleanupFailedIrp to free an optional buffer being specified to it. This way we don't leak some allocated buffers when IRP allocation fails. (Alex Ionescu)
  • Create inlined IopUnQueueIrpFromThread to match IopQueueIrpToThread. (Alex Ionescu)
  • Fix IRP Cancellation and enable all calls to IopQueueIrpToThread and IopUnqueueIrpFromThread. This seems to work properly now and the kernel fun entry for it has been removed. All remaining Io TODOs are now low priority. (Alex Ionescu)
  • Properly disable impersonation in PsDisableImpersonation if it was previously enabled, instead of not disabling it. (fix a wrong check). Thanks to Arty. (Alex Ionescu)
  • Add support for APC-delivery after context-switch (not yet programmed) (Alex Ionescu)
  • Detect and crash if context switch is done inside a DPC. (Alex Ionescu)
  • Switch kernel stack a bit earlier (Alex Ionescu)
  • Don't switch address space if we're still in the same process, and fix some duplicated code that was mixed up together. (Alex Ionescu)
  • Move LDT setup out-of-line. (Alex Ionescu)
  • Don't use EFLAGS to store the Wait IRQL, just push directly, it's cleaner. (Alex Ionescu)
  • Detect if kernel APCs are pending and request APC_LEVEL software interrupt from HAL if they are, returning with the right apc status. (Alex Ionescu)
  • Also update INT21 VDM Descriptor handler when updating LDT descriptor. (Alex Ionescu)
  • Remove some FPU deprecated constants and use the new ones. (Alex Ionescu)
  • Deliver APCs on return from context switch with pending kernel APCs. (Alex Ionescu)
  • Detect NPX/FPU in simple assembly and XMMI/SSE2 by using CPU Feature flags, replacing the old asm+c mess. (Alex Ionescu)
  • Handle FPU/SSE saving in the CONTEXT<->KTRAP_FRAME routines directly, and using KiFlushNPXState assembly function. (Alex Ionescu)
  • Implement a naive Trap 7 (FPU Fault) handler in assembly that properly does most of the work required to handle an FPU fault. Not yet complete however since it almost ignores user-mode faults (just like trunk). FPU isn't done in ctx switching yet. (Alex Ionescu)
  • Fixes to CONTEXT<->KTRAP_FRAME conversion. (Alex Ionescu)
  • Implement generic exception dispatcher for traps (kind-of analogous to KiKernelTrapHandler/KiUserTrapHandler but in assembly and more generic/compact). (Alex Ionescu)
  • Switch Traps 0, 1 to it. (Alex Ionescu)
  • Trap 2 is NMI, bugcheck immediately since we can't handle them yet. (Alex Ionescu)
  • Switch 4, 5, 6 to common ASM dispatcher as well. (Alex Ionescu)
  • Convert 8, 9, 10, 15/F (Alex Ionescu)
  • Call KiSystemFatalException directly instead of duplicating the code 5 times. (Alex Ionescu)
  • Gutted out KiTrapHandler. Now it is only a gateway for GPF/UD for V86 mode. (Alex Ionescu)
  • Removed all the code in userptrap.c and removed KiKernelTrapHandler. (Alex Ionescu)
  • Set Traps 11, 12, 16 and 17 as unhandled for now(Segment fault, stack fault, fpu fault and alignment fault). We weren't really "handling" them in the past either. (Alex Ionescu)
  • I probably need to implement GPF handler for non-V86 mode to support Lazy segment loading and fix the vmware syscall bug that has been haunting me for two years. (Alex Ionescu)
  • Implement GENERATE_IDT_STUBS/GENERATE_INT_HANDLERS (Alex Ionescu)
  • Generate actual Unexpected Interrupt entries in the IDT for INTs > 0x30 (basically IRQs). (Alex Ionescu)
  • Generated all 208 Unexpected Interrupt Handlers for all INTs (using a single macro line) and implement a "Tail" function to handle them instead of bugchecking like before (they're now sent to HAL properly). (Alex Ionescu)
  • Implement INT_PROLOG macro to create KTRAP_FRAME for interrupts (similar to traps). (Alex Ionescu)
  • Get rid of the peculiar idea that the HAL should manually hack into ntoskrnl through a hack export and hackishly call the registered device interrupt handlers. This is why computers have a PIC in the first place... (Alex Ionescu)
  • Call KiDispatchInterrupt through an interrupt gate instead of directly. (Alex Ionescu)
  • Switch PRIMARY_VECTOR_BASE to 0x30 instead of 0x40, as it should be. (Alex Ionescu)
  • Fix function definitions of HalQueryRealTimeClock, HalGetEnvironmentVariable. They were defined in the NDK in one way, but implemented another way, and since the HAL didn't include its own NDK file, the compiler didn't realize this. Calls of these functions might've experienced serious problems. (Alex Ionescu)
  • Also fix HalHandleNmi and HalInitSystem definitions. (Alex Ionescu)
  • Add stub code to actually setup the Clock Interrupt. (Alex Ionescu)
  • Enable the code in KeInitializeInterrupt that copies the Interrupt Template to the KINTERRUPT object and modifies the template pointer to point to the KINTERRUPT. (Alex Ionescu)
  • Add the template code in trap.s. (Alex Ionescu)
  • Implement Chained and Normal generic interrupt handlers. (Alex Ionescu)
  • Make generated handlers have a proper .func symbol for symbol data. (Alex Ionescu)
  • Make IDT writable, the page shouldn't be read-only. (Alex Ionescu)
  • Change some symbol names. (Alex Ionescu)
  • Completely re-implement IRQ support (KeInitialize/Connect/Disconnect) interrupt using the same model as NT. Implementation was done by analyzing various of my systems at runtime with WinDBG and tracing through some of the code and dumping relevant objects. (Alex Ionescu)
  • Uses new code added to trap.s for generic dispatching, as well as the NT implementation which copies a "template" into the ->DispatchCode array of every KINTERRUPT object. (Alex Ionescu)
  • Also adds support for chained interrupts, but this hasn't been tested yet. Floating interrupts are not supported on NT it seems, so I haven't implemented those at all. (Alex Ionescu)
  • Write a basic Clock Interrupt handler in the HAL (doesn't deal with changing increments yet, just like current ROS). It will call KeUpdateSystemTime once ready. (Alex Ionescu)
  • Implement KeDisconnectInterrupt with the new implementation. (Alex Ionescu)
  • Put Clock Interrupt initialization in the right place (might still be too late: must investigate more). (Alex Ionescu)
  • Added a debug print when unexpected interrupts are called, just noticed this happens on my checked machine, and it's a useful tracing tool. (Alex Ionescu)
  • Update KeUpdateSystemTime to use variable increments. (Alex Ionescu)
  • Update KeTickCount properly instead of an ugly timecast hack. (Alex Ionescu)
  • Also update UserSharedData->TickCount. (Alex Ionescu)
  • Get rid of KiRawTicks. (Alex Ionescu)
  • Properly update KiTickOffset at the end. (Alex Ionescu)
  • Make KeUpdateSystemTime independent, so that it returns and exits from the current ROSterrupt by itself. (Alex Ionescu)
  • Make KeUpdateRunTime increase the interrupt count, check for V86 as well as for user-mode by using the CS and EFLAGS (isntead of PreviousMode), also only request DPCs if DpcInterruptRequested isn't already set, and only perform Quantum End if this isn't the idle thread. (Alex Ionescu)
  • Add clock.S which will have the clock interrupt handlers of the kernel (UpdateSystemTime and UpdateRunTime) and ultimately replace the only reason irqhand.S is still around (the clock interrupt). Implement the current version of KeUpdateSystemTime in assembly, with stack optimizations since we'll be called from the HAL later. (Alex Ionescu)
  • Fix incorrect KPCR_PRCB_DPC_ROUTINE_ACTIVE which was totally wrong (And could've caused a crash in the context swicher) (Alex Ionescu)
  • Also fix the definition of KRCB which was off-by-4 after about offset ~0x500. It wasn't causing problems because assembly code only used < 0x500. (Alex Ionescu)
  • Write the ASM implementation of KeUpdateRunTime (not used yet). (Alex Ionescu)
  • Enable clock.S versions of KeUpdateSystem/RunTime and export them properly. (Alex Ionescu)
  • Enable systimer.S to call into kernel's KeUpdateSystemTime. (Alex Ionescu)
  • Enable Hal's Clock Interrupt during Phase 1. (Alex Ionescu)
  • Remove most of the code that was still left in irq.c (Alex Ionescu)
  • Only one large problem remains now, which is the spurious firing of the clock interrupt before we're ready to handle it... I will try to fix this today. (Alex Ionescu)
  • If SeCaptureSubjectContextEx is called without a process, at least NULL-initialize the context to catch dereferences of invalid pointers. (Alex Ionescu)
  • Remove code in the page fault handler which was corrupting the trap frame. (Alex Ionescu)
  • Remove some ROS hacks that dealt with the fact the trap frame was getting corrupted, since now it isn't anymore. (Alex Ionescu)
  • Enable code that checks for Teb->GdiBatchCount during win32k system calls. The bugs that were mentionned in the #if 0 are fixed. (Alex Ionescu)
  • Fix some bugs in KiChainedDispatch. (Alex Ionescu)
  • Complete and utter reimplementation of V86 Mode for Ke386CallBios. Details below. Tested on QEMU/VMWARE. May give you a breakpoint/crash on real hardware * please let me know the V86 opcode displayed on the debug log/screen if this is the case *if you see such a message*. (Alex Ionescu)
  • Got rid of all the previous related assembly code and implemented Ki386SetupAndExitToV86Mode and Ki386BiosCallREturnAddress. (Alex Ionescu)
  • Implemented GPF (Trap 13) code for V86 faults (which will happen in V86 mode). Implement a generic Ki386HandleOpcodeV86 handler that increments counts and calls the right opcode handler. (Alex Ionescu)
  • Implemented an Opcode Table Entry Index and Opcode Table array for mapping opcodes that caused a GPF to their V86 handlers/emulators. (Alex Ionescu)
  • Implemented handlers for PUSHF, POPF, CLI, STI, IRETD and INTnn, which is what QEMU/VMWare and *most* VIDEO ROM BIOS code should use. (Alex Ionescu)
  • Created a /vdm tree and moved all NTVDM/VDM specific code there. (Alex Ionescu)
  • Halfplemented VdmStart/EndExecution APIs which the BIOS ROM V86 implementation is built upon. Currently don't handle VDM at all, only this V86 mode. (Alex Ionescu)
  • Also added code for NtVdmControl and fixed up CSRSS and ACPI's calls to this API. (Alex Ionescu)
  • Added detection and FIXMEs for support of VMEs in VMWare, Bochs and real hardware (VME is not yet supported). (Alex Ionescu)
  • Add about two dozen new bugcheck codes and strings. (Alex Ionescu)
  • Use KdDebuggerNotPresent to determine if KDBG is there or not. KdDebuggerEnable is now set whenever booting with debugging -* even if only serial port or screen debugging. (Alex Ionescu)
  • Bugcheck Rewrite: Moved stack dump routines to bug.c and cleaned them up. Next step is to remove most of them and implement them properly as part of RtlCaptureStackBackTrace and RtlWalkFrameChain. (Alex Ionescu)
  • Bugcheck Rewrite: Use InbvDisplayString for everything now. BSODs will only truly show on screen. (however, part of the KeBugCheckWithTf improvements, a special "if debugger enabled" BSOD will also be displayed for debugging purposes). (Alex Ionescu)
  • Bugcheck Rewrite: Do checksum calculation in bugcheck callbacks. (Alex Ionescu)
  • Bugcheck Rewrite: Detect and display which drivers belong to which EIP. (Alex Ionescu)
  • Bugcheck Rewrite: Implemented code to select the proper verbose BSOD message depending on the bug check code. (Alex Ionescu)
  • Bugcheck Rewrite: Also implemented code to detect a variety of "known" bug check codes and to recover more data on them, and/or modify them accordingly. Sadly ROS doesn't yet make use of most of these codes. (Alex Ionescu)
  • Bugcheck Rewrite: Factored out and split some code into individual routines. (Alex Ionescu)
  • Bugcheck Rewrite: Look and functionality is now identical to Windows XP. (Alex Ionescu)
  • Bugcheck Rewrite: Stack trace will only be shown if KDBG isn't connected. If KDBG is connected you can do "bt" anyway (which is more powerful (Alex Ionescu)
  • Some fixes to KiDispatchException: Add support for forwarding exception back to user-mode, protect against V86 or invalid-stack faults, handle stack overflow exception while handling usermode exception (Thanks KJK for the SEH_FILTER help). Decrement EIP by one when hitting an INT3, to get the correct address. (Alex Ionescu)
  • Fix KeRaiseUserException (can't use "return" from SEH_HANDLE). (Alex Ionescu)
  • Rewrote RtlCompareMemory. (Alex Ionescu)
  • Rewrote RtlCompareMemoryUlong (Alex Ionescu)
  • Rewrote RtlFillMemory (Alex Ionescu)
  • Rewrote RtlFillMemoryUlong (Alex Ionescu)
  • Rewrote RtlFillMemoryUlongUlong (Alex Ionescu)
  • Rewrote RtlMoveMemory (Alex Ionescu)
  • Rewrote RtlZeroMemory (Alex Ionescu)
  • Rewrote RtlPrefetchMemoryNonTemporal (Alex Ionescu)
  • Rewrote RtlUshortByteSwap (Alex Ionescu)
  • Rewrote RtlUlongByteSwap (Alex Ionescu)
  • Rewrote RtlUlonglongByteSwap (Alex Ionescu)
  • Implement more parts of the GPF Handler. (Alex Ionescu)
  • Add support for lazy loading. (Alex Ionescu)
  • QEMU + -kernel-qemu seems to work now. (Alex Ionescu)
  • Hack away the Win32k bug that's been there for ages (copy to user-mode from kernel-mode failing due to probe due to incorrect previous mode). It's not the right fix, but nobody seems to be willing to fix it, and it doesn't make anything less stable, sicne the actually copy is in SEH anyway. It opens a security vuln. (wow, not like we have 15000) in exchange for fixing dozens of win32k bugs and failures. (Alex Ionescu)
  • Don't do fast system calls with the wrong DS/ES selectors. (Alex Ionescu)
  • Properly load DS/ES on system startup and GDT load (Alex Ionescu)
  • Use proper DS/ES during deprecated IRQ handling. (Alex Ionescu)
  • Always use GS as 0 for all of the above. (Alex Ionescu)
  • *FINALLY* fixes the oldest bug there ever was -> DS/ES corruption noticed in VMWare (And recently in QEMU+KERNELKQEMU, since it behaves internally like vmware). Hacks in trap code have FINALLY been removed! (Alex Ionescu)
  • Add support for recovering from user-mode win32k callback fault. (Alex Ionescu)
  • Also add support for debug register saving/reloading during user-mode callbacks and return. (Alex Ionescu)
  • Multiple changes to low-level Kernel initalization sequence to bring it a bit closer to Windows. (Alex Ionescu)
  • Main difference is new CPU detection algorithms for ID, cache, etc, as well as using KF_ Kernel Feature bits instead of x86 CPU features (For portability). (Alex Ionescu)
  • Start support for an initial boot thread. (Alex Ionescu)
  • Initialization rewrite: Initialize bugcheck lists, timer DPC, profile list/locks, timer lists, the swap lists and syscall table as part of KiInitSystem (portable). (Alex Ionescu)
  • Initialization rewrite: Add more initialization for the initial/idle process+thread (some code disabled due to dispatcher problems). (Alex Ionescu)
  • Initialization rewrite: Add code to support future Timer implementation (based on tick-hashes) (Alex Ionescu)
  • Initialization rewrite: Separate post-boostrap initialization code in KiInitializeKernel. (Alex Ionescu)
  • Initialization rewrite: Add some support for future SMP paths. (Alex Ionescu)
  • Initialization rewrite: Create a DPC stack. (Alex Ionescu)
  • Move machine-specific initializations to KeInit2. (Alex Ionescu)
  • Initialize bugcheck messages much earlier, separate clock initialization from KeInit2. (Alex Ionescu)
  • Completely move out and isolate ROS/FREELDR PE loading hacks to KiRosPrepareForSystemStartup so that KiSystemStartup is clean of them. (Alex Ionescu)
  • Add missing volatile statements to KPROCESS, KTHREAD, KPRCB and KDPC_DATA. (Alex Ionescu)
  • Fix KDPC definition in DDK. You can always count on the w32api to get even the simplest structures wrong. (Alex Ionescu)
  • Fix memory overwrite bug in KiInitSpinlocks. (Alex Ionescu)
  • DPC Rewrite: Re-factor KiDispatchInterrupt to separate DPC delivery routine (so that it can stay in C, since KiDispatch should be done in ASM so we can switch stacks). (Alex Ionescu)
  • DPC Rewrite: Use interrupt enable/disable instead of raising to HIGH_LEVEL. (Alex Ionescu)
  • DPC Rewrite: Better use and pairing of locks. (Alex Ionescu)
  • DPC Rewrite: Fix a lot of race conditions in DPC dispatching, due to the fact almost all data we're touching is ultra-volatile and can change at any time depending on various locks being held/released + interrupt state. (Alex Ionescu)
  • DPC Rewrite: Add stub code/support for tick-hased table-based timer implementation and deferred threads. (Alex Ionescu)
  • DPC Rewrite: Implement KiDispatchInterrupt in assembly since it's 1) Perf-critical 2) Requires us to switch the stack to the DPC stack, which is unsafe (and impossible, unless inlining) in C. (Alex Ionescu)
  • Fix KTSS definition. (Alex Ionescu)
  • Add GetSegment inlines (ie: GetSs, GetDs, etc) (Alex Ionescu)
  • Fix up definition of KiBootGdt to use KGDTENTRY instead of USHORT. Also define KiGdtDescriptor using KDESCRIPTOR. (Alex Ionescu)
  • Remove GDT initialization code completely. The GDT is already initialized on boot. (Alex Ionescu)
  • Remove tss.c and add KiInitializeTss(2) to setup a TSS and proper IOPM/Interrupt Direction map settings for V86/VDM. (Alex Ionescu)
  • Copy the TSS code over but prettyify it to use NT/NDK structures instead of ugly USHORT typecasts. (Alex Ionescu)
  • Remove LDT initialization, LDT shouldn't be initialized at bootup. (Alex Ionescu)
  • Cleanup formatting of GDT-related exported function stubs in gdt.c and rename file to abios.c. Those routines deal specifically with the ABIOS GDT selectors and are for ABIOS support. (Alex Ionescu)
  • Add Ke386SetFs, Ds, Es (using Ke386SetSeg) and Ke386SetTr new inlined commands. (Alex Ionescu)
  • Also setup an NMI Task gate after the double fault task gate. Will be useful when we hand to handle NMIs later. (Alex Ionescu)
  • Setup FS in KiSystemStartup and initialize the TSS before the PCR. Also add a bit more support for SMP systems (To skip boot-cpu-only initialization). (Alex Ionescu)
  • Also setup DS/ES directly in KiSystemStartup. (Alex Ionescu)
  • Initialize KD at phase 0 in KiSystemStartup, not in KiInitializeKernel, and also check for debug break at this time. (Alex Ionescu)
  • Add Ke386SetInterruptDescriptorTable inlined function to set the IDT. (Alex Ionescu)
  • Rename and fixup initial stacks, instead of using 16 different variables all with confusining meanings and values. Define P0BootStack as the initial kernel stack, and KiDoubleFaultStack as the double-fault trap (and initial DPC) stack. (Alex Ionescu)
  • Fix call to KiInitializePcr which was setting an incorrect DPC stack. (Alex Ionescu)
  • Make space on the initial stack for a KTRAP_FRAME as well, not only for the FPU save area. (Alex Ionescu)
  • Also push initial CR0 NPX state on the initial stack. (Alex Ionescu)
  • Load the IDT and GDT directly in KiRosPrepareForSystemStartup. (Alex Ionescu)
  • Fix definition of SYNCH_LEVEL. (Alex Ionescu)
  • Implement KeAcquireInStackQueuedSpinLockRaiseToSynch for UP systems. (Alex Ionescu)
  • Implement KiAcquireApcLock, KiAcquireApcLockAtDpcLevel, KiReleaseApcLock, KiReleaseApcLockFromDpcLevel. (Alex Ionescu)
  • KeResumeThread, KeSuspendThread, KeAlertThread, KeForceResumeThread, KeTestAlertThread, KeAlertResumeThread are now the first to use the new APC In-Stack Queued Spinlock for sychronization. (Alex Ionescu)
  • Implement KiAcquireProcessLock, KiReleaseProcessLock. (Alex Ionescu)
  • Update KeFreezeAllThreads to use the Process and APC In-Stack Queued Spinlock. (Alex Ionescu)
  • Update KeTerminateThread to use the Process Lock. Call KiRundownThread to cleanup the NPX thread. Add some assertions for Stack in/out-paging. Use KiSetThreadSwapBusy for proper SMP vs UP building. (Alex Ionescu)
  • NUMA Node semantics in KeStartThread only need to be done for CONFIG_SMP builds, so #ifed them appropriately. Also made it use the Process In-Stack QSL. (Alex Ionescu)
  • Remove KeSetPreviousMode, KeDisableThreadApcQueueing. (Alex Ionescu)
  • Stargint reorganizing some public functions to the bottom of the file. (Alex Ionescu)
  • Don't hold lock during KeSetKernelStackSwapEnable. (Alex Ionescu)
  • Update KeRevertToUserAffinityThread, KeSetSystemAffinityThread to use new lock functions, and add code to support future scheduler. (Alex Ionescu)
  • Update KeSetIdealProcessorThread to properly do Ideal CPU logic instead of blindgly setting it (most importantly, respect UserIdealProcessor and SystemAffinityActive seettings). (Alex Ionescu)
  • Reposition and update KeQueryBasePriorityThread to use the new locks. (Alex Ionescu)
  • Update KeSetAFfinityThread, KeSetPriorityThread with new locks and assertions (plus the current ROS scheduler hack). (Alex Ionescu)
  • Update the last remaining old function, KeSetBasePriority. Use new locks and assertions, and also make use of KiComputeNewPriority. (Alex Ionescu)
  • Get completely rid of old Dispatcher Lock macros and use new ones. (Alex Ionescu)
  • apc.c -> Also multiple optimizations to use the APC lock instead of the full-fledged dispatcher lock. (Alex Ionescu)
  • gate.c -> Use APC lock as well, the full dispatcher lock isn't required because a thread can only wait on one and only one gate. (Alex Ionescu)
  • process.c -> Optimize the code to use the Process and/or APC lock instead of the dispatcher lock. Also delay acquiring the locks after some checks, to make the exit paths simpler. (Alex Ionescu)
  • Remove KeGetCurrentProcess. This API doesn't exist. (Alex Ionescu)
  • Add assertions to relevant functions in process.c and re-format some code. (Alex Ionescu)
  • Check for invalid APC state in KeDetachProcess. (Alex Ionescu)
  • Decrease process stack count while holding the Dispatcher Lock at DPC level. (Alex Ionescu)
  • Implement KiSwapProcess in ctxswitch.S and add SMP-support and LDT swap support for the future, as well as updating the IOPM base in the TSS. (Alex Ionescu)
  • KPROCSES Flags are LONG, not ULONG. (Alex Ionescu)
  • Add some missing decoration. (Alex Ionescu)
  • NUMA node semantics for KeInitializeProcess are only required on SMP builds. (Alex Ionescu)
  • Allow KeInitailizeProcess to receive an argument specifying if alignment faults should be enabled or not. (Alex Ionescu)
  • Use KiComputeIopmOffset to get the IopmOFfset instead of setting -1 (Alex Ionescu)
  • We only need to update the page directory for the current stack, not the whole ETHREAD. (the page fault will be handled). (Alex Ionescu)
  • Release dispatcher lock from DPC level in KiAttachProcess. (Alex Ionescu)
  • Add missing decoration/assert to KeAttachProcess, and only acquire APC lock after we've made the invalid attach test. Also acquire dispatcher lock at DPC level here and in KeStackAttachProcess. (Alex Ionescu)
  • Loop in KeUnStachDetachProcess to avoid the case where we acquired the APC lock while a kernel APC was pending. Keep releaing the loop and re-attemping acquire until it has been delivered. (Alex Ionescu)
  • Add Decoration for *ServiceTable* functions. (Alex Ionescu)
  • Re-organize apc.c into private/public functions (no code change). (Alex Ionescu)
  • Force Ring 3 state into User APC TrapFrame to maintain system integrity and coherency. Also respect IOPL. (Alex Ionescu)
  • Use SEH handling routine just like when handling exceptions, to properly re-direct a crash here. Thanks to KJK again for showing me how to write these kinds of routines. (Alex Ionescu)
  • Re-implement KiRequestApcInterrupt in ke_x.h. Make it work by CPU number (as documented) instead of comparing PRCBs. (Alex Ionescu)
  • Make NtQueueApcThread use POOL_QUOTA_FAIL_INSTEAD_OF_RAISE and add that flag to our DDK. Also fix the check for SystemThread by looking at the flag, not checking if TEB == NULL. Also fix a memory leak and comment header. (Alex Ionescu)
  • Fix comment header in KiInitalizeUserApc. (Alex Ionescu)
  • Cleanup RepairList, KiMoveApcState. (Alex Ionescu)
  • Fixup comments for KeAreApcsDisabled. (Alex Ionescu)
  • Implement and add comment header to KeAreAllApcsDisabled. (Alex Ionescu)
  • Fix KeRemoveQueueApc comment header and clean up function. (Alex Ionescu)
  • Acquire dispatcher lock at DPC level during ApcListEntry read/write. (Alex Ionescu)
  • Fix for Windows Kernel APC Data-Free Local Privilege Escalation Vulnerability (re-initialize the list head after cleaning it, so that the list is circular). (Alex Ionescu)
  • Optimize KeFlushQueueApc: we can check if the Kernel-Mode APC list is empty without acquiring the lock. If it's empty, we can quit immediately, if not, then we'll acquire and check it again. For user APCs we always need to acquire the lock, though. (Alex Ionescu)
  • Fix comment headers for KeFlushQueueApc, KeInsertQueueApc. (Alex Ionescu)
  • ASSERTify KeInsertQueueApc and some formatting fixes. (Alex Ionescu)
  • Add new KAPC_ENVIRONMENT mode: InsertApcEnvironment. (Alex Ionescu)
  • Fixup KeInitalizeApc like all the other functions. (Alex Ionescu)
  • Don't use an expensive 48-byte RtlZeroMemory instead of just clearing two members. (Alex Ionescu)
  • Fix lock acquisition/release mismathces in KiInsertQueueApc. (Alex Ionescu)
  • Support and document InsertApcEnvironment KAPC_ENVIRONMENT type. (Alex Ionescu)
  • Fixup formatting and ASSERTify. (Alex Ionescu)
  • Acquire dispatcher lock when insereting an APC into another thread. (Alex Ionescu)
  • Use delayed interrupt request on SMP systems (and fixup KiRequestApcInterrupt accordingly). (Alex Ionescu)
  • Fix KiDeliverApc prototype for PPC compatibilty. (Alex Ionescu)
  • Fixup comment header for KiDeliverApc and KiInsertQueueApc. (Alex Ionescu)
  • Set APC trap frame during APC delivery. We actually weren't doing this before (I'm kind of amazed at ROS's previous functionality due to importance of this bug!). (Alex Ionescu)
  • Use proper in-stack queued spinlock mechanisms. (Alex Ionescu)
  • Make sure that the Kernel APC list didn't become empty while we acquired the APC lock after the first verification. (Alex Ionescu)
  • Validate IRQL on return from APC routines, to catch bad code. (Alex Ionescu)
  • Fix a critical bug in KiComputeNewPriority. (Alex Ionescu)
  • Fix a bug in KiSetPriorityThread which wasn't setting *released = FALSE, which left the var uninitailized and usually = TRUE on the stack. (Alex Ionescu)
  • Half-copy KiQuantumEnd from my new scheduler code. Main difference is usage of newly created locks, support for quantum-disable and RT threads, and usage of KiComputeNewPriority. (Alex Ionescu)
  • Add the actual missing code to KiQuantumEnd. It's asserted to make sure it'll never execute (yet). (Alex Ionescu)
  • Add KiExitDispatcher from my new scheduler code. Same as KiQuantumEnd, added an assertion to make sure it doesn't enter in code paths that shouldn't yet happen. (Alex Ionescu)
  • Implement and export HalClearSoftawareInterrupt (currently implemented to match the hacked ROS version, no new version written yet). (Alex Ionescu)
  • CPU Idle Loop Rewrite: Runs with interrupts off most of the time, except when it does interrupt cycling at each iteration. (Alex Ionescu)
  • CPU Idle Loop Rewrite: Calls KiRetireDpcList directly, instead of going through KiDispatchInterrupt. (Alex Ionescu)
  • CPU Idle Loop Rewrite: Support for new scheduler and immediate thread switch. (Alex Ionescu)
  • CPU Idle Loop Rewrite: Support for Idle Scheduler. (Alex Ionescu)
  • CPU Idle Loop Rewrite: Support for HAL/ACPI/CPU Driver-defined "Idle Function". currently disabled and STI+HLT harcoded instead. (Alex Ionescu)
  • Removed ps/idle.c and dumped the hack code directly in psmgr.c wher eit's used. (Alex Ionescu)
  • Implement HalProcessorIdle. (Alex Ionescu)
  • Fix KiIdleLoop to actuall load the PCR in EBX. It was using a completely random value. (Alex Ionescu)
  • Call the Processor Idle Routine now, isntead of hard-coding STI+HLT. This routine had already been setup during bootup by PoInitailizePrcb. (Alex Ionescu)
  • Implemented PopIdle0 and made it call HalProcessorIdle. No performance/throttling is done yet. (Alex Ionescu)
  • Implement KiReleaseProcessLockFromDpcLevel and use it in KeTerminateThread. We were lowering to PASSIVE during thread termination, and then doing a context switch at PASSIVE, which you can guess is pretty bad. (Alex Ionescu)
  • Implement KiAcquireDeviceQueueLock/KiReleaseDeviceQueueLock for locking KDEVICE_QUEUEs, since they can be used from Threaded DPCs which don't execute at DISPATCH_LEVEL, so the lock needs to be acquired differently. (Alex Ionescu)
  • Add ASSERT_DEVICE_QUEUE and ASSERTify + reformat kqueue.c. (Alex Ionescu)
  • Implement KeRemoveByKeyDeviceQueueIfBusy. (Alex Ionescu)
  • Cleanup exception.c (Alex Ionescu)
  • Remove dangerous/broken KeGetCurrentIrql() define. (Alex Ionescu)
  • Handle STATUS_CALLBACK_POP_STACK and add the status to ntstatus.h (Alex Ionescu)
  • Also handle future support for GDI Batch flushing. (Alex Ionescu)
  • Implement KxAcquireSpinLock/KxReleaseSpinLock for inline acquisition of spinlocks, SMP, UP and DBG. (on DBG builds, we OR the spinlock value with the KTHREAD address, then compare on release.) (Alex Ionescu)
  • Make In-Stack QSLs a complete no-op in UP, we were still touching some fields. (Alex Ionescu)
  • Added inlined routines for setting/getting CR, and also getting GDTR, IDTR, LDTR, TR. Used to implement KiSaveProcessorControlState. (Alex Ionescu)
  • Implemented KeSaveStateForHibernate. (Alex Ionescu)
  • Fix KeSetPriorityAndQuantumProcess to use Queued Spinlocks and KiAcquireProcess/ThreadLock when needed. (Alex Ionescu)
  • Implement KiUnlinkThread to unlink a thread from its wait blocks, handle queue and timer activation/removal. (Alex Ionescu)
  • Don't play with priorities in KiAbortWaitThread anymore, since we'll soon support Win2003 delayed "adjust increment" functionality, so that the code is not repeated many times. (Alex Ionescu)
  • Rename KiAbortWaitThread to KiUnwaitThread, make it use KiUnlinkThread and delayed adjustment. (Alex Ionescu)
  • Implement KxUnwaitThread and KxUnwaitThreadForEvent, optimized versions of KiWaitTest that can be used in special circumstances (notification events, thread termination, process signalling). (Alex Ionescu)
  • Optimize KeSetEvent by handling signaled notification events without acquiring the dispatcher lock, and by using new inlined routines described above. (Alex Ionescu)
  • Reimplement KeSetEventBoostPriority properly to actually do boosting. (Alex Ionescu)
  • Fixup KeRundownQueue with a more typical/proper LIST_ENTRY loop. (Alex Ionescu)
  • Implement KiAcquireDispatcherObject, KiReleaseDispatcherObject, used on SMP for dispatcher objects which use the volatile long member in the dispatcher header (such as gates). (Alex Ionescu)
  • Implement KiTryThreadLock which tries to acquire the lock but exits if it can't, isntead of looping. (Alex Ionescu)
  • Re-factor KeWaitForGate to make it SMP-safe by acquiring various locks when required. (Alex Ionescu)
  • Fixed up KeSignalGateBoostPriority so it can also be SMP-safe, and also fix what exactly happens when the gate is signaled (directly make the other thread ready instead of doing a KiUnwaitThread on it). (Alex Ionescu)
  • Split KxAcquireSpinLock/KxReleaseSpinLock into SMP vs UP like the other routines. (Alex Ionescu)
  • Implement KeReadyThread that wraps KiReadyThread so that \ps doesn't have to worry about dispatcher lock. (Alex Ionescu)
  • Make sure all a process's threads are ready if they're on the ready queue, during attachment. (Alex Ionescu)
  • Merge in KiReadyThread from scheduler code, with a small code change to keep working with ROS's scheduler lists instead. (Alex Ionescu)
  • Converted some macros to inlined functions. (Alex Ionescu)
  • Modified KeDelayExecutionThread and KeWaitForSingleObject to be much simpler and readable, reducing some of the loops and continues, and 4th-level indentation. Also packed up common wait initialization at the beginning of the function, and into two new inline functions: KxDelayThreadWait and KxSingleThreadWait. No actual semantic changes, just re-ordering. (Alex Ionescu)
  • Rename KiUnwakeQueue to KiActivateWaiterQueue. (Alex Ionescu)
  • Implement most of the Ring 3/0 Invalid Opcode handler. Stops apps like mIRC from BSODing the system anymore. (Alex Ionescu)
  • Fix one of the oldest hacks in ReactOS: KeGetCurrentThread() and PsGetcurrentProcess used to be NULL during early boot stage. We also didn't have an official idle therad/process. Also system intialization was not in its sepearte thread. Changes: (Alex Ionescu)
  • Implemented SeAssignPrimaryToken. (Alex Ionescu)
  • Setup Boot/System Token for Idle Process in SeInit2. (Alex Ionescu)
  • Remove ROS hack in SeCaptureSubjectContextEx. (Alex Ionescu)
  • Call SeAssignPrimaryToken in PspInitializeProcessSecurty when called for the Initial Process creation. (Alex Ionescu)
  • Implement PsInitiailizeQuotaSystem and set PspDefauptQuotaBlock for the idle process so that it can be used for the initial process. (Alex Ionescu)
  • Rewrite Process Manager Phase 0 initialization from scratch, to create a new initial system process and thread which will be used for Phase 1 (in ROS, phase 2) initialization of the executive. (Alex Ionescu)
  • Fix a bug in PspCreateProcess which was using an uninitialized value of SectionObject in some cases, instead of NULL. (Alex Ionescu)
  • Call PsInitailizeQuotaSystem from ObInit, and also create the system handle table inside the idle process, and make it the ObpKernelHandleTable. (Alex Ionescu)
  • Do Executive Phase 0 Initialization at APC_LEVEL. (Alex Ionescu)
  • Start idle thread at HIGH_PRIORITY then lower it to 0 once the Initial Thread is setup, so that it can run, then keep priority to 0 at DISPATCH_LEVEL and jump into idle loop code. (Alex Ionescu)
  • Add NtYieldExecution to idle loop code since it's now being used. (Alex Ionescu)
  • Fix IoGetCurrentProcess which was previously hacked. (Alex Ionescu)
  • Remove some checks for Thread == NULL in ke_x.h, since this is now impossible. (Alex Ionescu)
  • Split Phase 0/1 initialization in ex\init.c, since one runs in a separate thread now. Also don't lower IRQL to PASSIVE_LEVEL anymore (run at APC_LEVEL). (Alex Ionescu)
  • Optimize PspLookupUserEntrypoints to use static ANSI_STRINGs instead of building them at runtime. (Alex Ionescu)
  • Fix mapping/loading of the System DLL so that it's loaded as executable code, not read-only code. Also fix a handle leak of the section, and re-factor some code into smaller shared functions to reduce code duplication. (Alex Ionescu)
  • Create a KD-compatible KiDebugRoutine and piggyback KDBG on it. (Alex Ionescu)
  • Create separate GDB entry hack routine. (Alex Ionescu)
  • Fix booting with /BREAK and continuing after an INT3/ASSERTion. (Alex Ionescu)
  • A missing "return" statement to KiDispatchException which was causing all user-mode exceptions to become second-chance and thus crash the app. mIRC works again, and probably numerous other apps (mozilla as well i think, since it had the same issue) (Alex Ionescu)
  • Fix a bug in KeRaiseUserExceptionDispatcher which was causing us not to set the Exception Address (EIP) in the EH record. (Alex Ionescu)
  • Fix a terrible stack corruption bug in KeRaiseUserExceptionDispatcher which was causing us to eventually fuck up the stack in user mode (0x14 bytes instead of 0x50 bytes were reserved). (Alex Ionescu)
  • Protect User-mode Callbacks with SEH, and use STATUS_POP_CALLBACK_STACK. (Alex Ionescu)
  • Fix another nasty stack corruption bug in user-mode APC delivery. (Alex Ionescu)
  • Protect User-mode APC delivery with SEH. (Alex Ionescu)
  • Fix SEH handlers to return EXCEPTION_EXECUTE_HANDLER isntead of ExceptionContinueSearch. (Alex Ionescu)
  • Fix some insidious bugs in exception handling, mostly related to the art of unwinding (RtlUnwind). (Alex Ionescu)
  • Can't name specifics, but probably fixes multiple SEH/application bugs/regressions since about 6-8 months ago. Fixes my personal SEH test from 22 failures/crashes/BSODs to 22 succeesses... (Alex Ionescu)
  • Also fixes some crashes in kernel-kqemu mode. (Alex Ionescu)
  • Add code to wait for SwapBusy == FALSE on SMP. (Alex Ionescu)
  • Add stub code to check for new PCR fields in 2003. Currently disabled because thread swap code still uses XP fields. (Alex Ionescu)
  • Check for active DPCs at the end of thread swap, not at the beginning. (Alex Ionescu)
  • Set PRCB->IdleThread outside of the thread swap routine. (Alex Ionescu)
  • Don't set the thread state to running inside the swap routine, we already do it outside. (Alex Ionescu)
  • Stop doing cli/sti doing context switching (For now, since it's only needed for FPU, which isn't yet done). (Alex Ionescu)
  • Stop using XP KPCR fields for storing stack values, they're not used inside the kernel anymore and now have 2003 values (WMI tracing, etc). (Alex Ionescu)
  • Move parts of the process switch (LDT reload) out-of-line. (Alex Ionescu)
  • Don't update CR3 in KTSS, it's not used. (Alex Ionescu)
  • Don't read a useless stack pointer anymore. (Alex Ionescu)
  • Update KTSS_ESP0 near the end of context switching, not at the beginning anymore. (Alex Ionescu)
  • Same for IOPM and I/O Redirection Map Base Address. (Alex Ionescu)
  • Fix some bugs in LDT switch (EDI->EBP) (Alex Ionescu)
  • Turn simple bugcheck into BugCheckEx with information that the helpfile says it should have. (Alex Ionescu)
  • Assert that the current CPU is the one the thread is supposed to be running on. (Alex Ionescu)
  • Get CR0, read the KTHREAD NPX State, disable interrupts and verify if the NPX state is dirty. If it is, then reload CR0 with the new value. Re-enable interrupts. This sequence should make FPU work during context switching, but I haven't tested yet. At the very least, it should get rid of TRAP_FAULT_UNKNOWN blue screen. (Alex Ionescu)
  • Set TEB in the same time as the selector is being configured, not way earlier. (Alex Ionescu)
  • On SMP systems, update KPROCESS->ActiveProcessors and assert their validty. Needed for a similar assertion and check in KiSwapProcess which we already have. (Alex Ionescu)
  • Also on SMP, make sure to clear the KTHREAD's swap-busy lock after the actual swap has been done. (Alex Ionescu)
  • Implement Trap 16: Math Coprocessor Fault. Happens during Floating Point precision error test that I wrote. Simply calls shared NPX handler in KiTrap7. (Alex Ionescu)
  • Implement some extra checks in KiTrap7 and start coding the NPX shared handler. We *almost* have full FPU support now... (trying to get this done for tomorrow morning so that Greatlord can sent me the 15 000$ he promised...) (Alex Ionescu)
  • Implement FPU Exception Handler. (Alex Ionescu)
  • We can now properly handle FPU faults (wrote a small test for invalid fpu precision). (Alex Ionescu)
  • Use LOADER_PARAMETER_BLOCK everywhere in ReactOS except freeldr.c (Alex Ionescu)
  • Implemented KiRosFrldrLpbtoNtLpb to do a lightweight conversion and setup. Next patches will try to get rid of PLOADER_MODULE and use LDR_DATA_TABLE_ENTRY as well as increase bootstrap compatibility. (Alex Ionescu)
  • Fix some bugs in intrin.h (missing __inline__ statments in some locations, which were causing warnings due to "static"). (Alex Ionescu)
  • Remove intrinsics in winddk.h since they're now properly done in intrin.h (thanks KJK!!!) (Alex Ionescu)
  • Make freeldr.c setup the boot KTSS like NTLDR does, so that the GDT entry for it is valid (and remove the code that was doing this from Ki386InitializeTss) (Alex Ionescu)
  • Refactor KiSystemStartup to use 100% dynamic pointers and machine data queried from the Loader Block or actual GDT/IDT/Selectors in memory, isntead of hard-coded ntoskrnl offsets. This makes it possible to be loaded by NTLDR, which sets these system structures up by itself. (we do it in freeldr.c, as hacks). (Alex Ionescu)
  • Add loop around the KiFreezeExecutionLock before continuing OS boot. (Alex Ionescu)
  • Only check for break-in on the Boot CPU. (Alex Ionescu)
  • Set priority to 0 *Before* lowering to DISPATCH_LEVEL. (Alex Ionescu)
  • Also force interrupts to be enabled before lowering IRQL. (Alex Ionescu)
  • Also set the idle thread's wait irql to DISPATCH_LEVEL (might fix some odd crashes) and set it as Running on UP builds (on SMP builds this is done in other code). (Alex Ionescu)
  • Save processor state in the PKPRCB in KiInitializeKernel. (Alex Ionescu)
  • Set the booting CPU as idle if no next thread was scheduled. (Alex Ionescu)
  • Raise IRQL to HIGH_LEVEL upon exiting KiInitializeKernel to match the re-lowering to DISPATCH_LEVEL in KiSystemStartup (and subsequent interrupt flush). (Alex Ionescu)
  • KiRosFrldrLpbtoNtLpb: Create a LDR_DATA_TABLE entry for each module (driver, hal, kernel) and properly fill it out and insert it into the loader block. (Alex Ionescu)
  • KiRosFrldrLpbtoNtLpb: Use the NLS data block to hold pointers to the NLS tables. (Alex Ionescu)
  • KiRosFrldrLpbtoNtLpb: Use the ->RegistryBase/Length loader block members to hold pointers to the SYSTEM hive. (Alex Ionescu)
  • KiRosFrldrLpbtoNtLpb: Create a MEMORY_ALLOCATION_DESCRIPTOR for each type of memory currently used (LoaderNlsData, LoaderRegistrydata, LoaderSystemCode, LoaderHalCode, LoaderBootDriver). (Alex Ionescu)
  • Revert LOADER_PARAMETER_BLOCK change, it actually really is PNLS_DATA_BLOCK. (Alex Ionescu)
  • Fully use KeLoaderBlock->InLoadOrderListHead for driver loading and symbol lookups, instead of KeLoaderModules/KeLoaderModuleCount. Still not 100% compatible with NTLDR (since it uses BootDriverListHead with a special structure), but much closer to a portable design that doesn't rely on static kernel data. (Alex Ionescu)
  • Change some internal functions to use UNICODE_STRING instead of PCHAR since this is how LdrEntry->BaseDllName is, and also it's closer to NT Design. (Alex Ionescu)
  • Remove all the remaining code in boot.S and make KiRosPrepareForSystemStartup fastcall. Now NtProcessStartup just does a jmp to KiRosPrepareForSystemStartup without any other code. (Alex Ionescu)
  • Use freeldr's stack during all of freeldr.c, and only switch to the boot stack in KiSystemStartup before calling KiInitializeKernel. This is what NT does as well (it piggybacks on NTLDR's stack until then). This allowed us to clean boot.S and now we can boot from NTLDR properly. (Alex Ionescu)
  • Add two more lines in boot.S which detect boot-by-NTLDR and jump into KiSystemService (I thought FreeLdr didn't use the entrypoint, but it looks like it does, so this hack is needed). Detection is done by checking for the high bit in the PLOADER_PARAMETER_BLOCK pointer, which will be set on NT. (Alex Ionescu)
  • Fix a double bug in KiSystemStartup. First, we were setting KPCR->Number instead of KPRCB->Number. Second, we were using KeGetPcr instead of __writefsdword. It worked on ROS because KeGetPcr is hard-coded to ROS's KPCR buffer. (Alex Ionescu)
  • Clear KPCR->TEB during bootstrap as well. (Alex Ionescu)
  • Use KPCR_PROCESSOR_NUMBER instead of 0x130. (Alex Ionescu)
  • Put IDT in RW .data section (Alex Ionescu)
  • Fix Ki386InitializeTss to properly set Boot TSS descriptor data (set it to 32-bits). Also properly setup the DF/NMI Task Gates in the IDT. (Alex Ionescu)
  • Fix Ki386InitializeTss to use dynamic GDT calculated from KiGetMachineBootPointers instead of static internal address. Now NTLDR boots us all the way to HalInitializeProcessor. (Alex Ionescu)
  • Use __readfsdword instead of de-referencing the Boot PCR, which is not queried for Application CPUs. (And put the Goto back where it was). Thanks to Thomas Weidenmueller for noticing. (Alex Ionescu)
  • Implement ExpIsLoaderValid to validate the LOADER_PARAMETER_BLOCK's extension for the right size and version (we currently support 5.2 and over). (Alex Ionescu)
  • Add code in KiRosFrldrLpbToNtLpb to setup a LOADER_PARAMETER_EXTENSION and set the right version and size. (Alex Ionescu)
  • Initialize the per-CPU PRCB Paged/NPaged lookaslide pool lists. (Alex Ionescu)
  • Add code to support application CPUs booting in ExpInitializeExecutive, and pass the loaderblock as a parameter. (Alex Ionescu)
  • Add setupblk.h from TinyKRNL with all the definitions for NT's SETUPLDR structures (SETUP_LOADER_BLOCK and hardware configuration stuff). Update KiRosFrldrLpbToNtLpb to setup the Flags field of this block to "Text-Mode Setup Active" when we know that we're in ROS text mode. (Alex Ionescu)
  • Update ExpInitializeExecutive to check for a valid setup block and detect text-mode and network installation modes. Use ExpInTextModeSetup instead of SetupMode variable, to make detection compatible with NTLDR. (Alex Ionescu)
  • Do MmInit1 much earlier in the boot phase (right at the beginning of ExpInitalizeExecutive). This gives us access to things like SharedUserData, which NT has since NTLDR. Will try moving it up even higher. (Alex Ionescu)
  • Fix a bug in ExInitPoolLookasidePointers which was making us overwrite low-memory. (Alex Ionescu)
  • Initialize NLS tables during Phase 0, so that the associated APIs can work earlier. (Alex Ionescu)
  • Bugcheck if HAL Phase 0 initialization failed, and force interrupts enabled after the HAL is ready. (Alex Ionescu)
  • Un-optimize KeGetPcr and make it use fs:20h instead of hard-coding the 0xFF.... address, because someone decided that ROS should have a different KPCR address then NT. (Alex Ionescu)
  • This gets NTLDR working with ReactOS and I can boot all the way to MmInit1 (which fails due to missing KeMemoryMap & freeldr data). (Alex Ionescu)
  • KiRosFrldrLpbToNtLpb: Removing the ARC Boot path and splitting it into the ARC Boot Device Name, the ARC HAL Device Name, and the NT Boot and HAL Path Names, saved in their respective LoaderBlock pointers. (Alex Ionescu)
  • KiRosFrldrLpbToNtLpb: Converting every slash to a space. ("/DEBUGPORT" -> " DEBUGPORT") (Alex Ionescu)
  • KiRosFrldrLpbToNtLpb: Now we can fully parse and read NTLDR command lines. (Alex Ionescu)
  • Use LoaderBlock->ArcDeviceNamePath & friends instead of the command line. (Alex Ionescu)
  • Stop depending on slashes, and instead use strstr for parameters. (Alex Ionescu)
  • Implement Phase 0 Ex initialization (Resource, Lookaside initialization) and generic Ex initialization routine. (Alex Ionescu)
  • Clear the crypto exponent on boot-up. (Alex Ionescu)
  • Set default global flags for checked builds. (Alex Ionescu)
  • Set NtSystemRoot (SharedUserData) to C:<NT BOOT PATH> on startup. (Alex Ionescu)
  • Cleanup lookas.c file and implement routines to initialize the system lookaside list in phase 0. (Alex Ionescu)
  • Setup memory limits in shared user data. (Alex Ionescu)
  • Loop security descriptors to find NLS data and make a copy of it in kernel pool, because the NLS buffer from NTLDR will be freed on NT. Also discovered a bug in Freeldr where it doesn't allocate ths NLS files sequentially, leaving a hole of 0x1000 between them. Added a hack to compensate (won't break NTLDR booting, just will waste 8 KB of memory). (Alex Ionescu)
  • Allocate the system call count table on checked builds. (Alex Ionescu)
  • Refactor Ob/Se booting to match more closely NT, and so that we can do Se initialization in one shot. (Alex Ionescu)
  • Combine SeInit1 and SeInit2 into SeInit since both can be done together now. (Alex Ionescu)
  • Call PsInitSystem instead of PspInitPhase0, since PsInitsystem is the "external" phase-choosing routine. (Alex Ionescu)
  • Implement ExComputeTickCountMultiplier to create a 24-bit precision remainder + whole integer of the ms/clock tick used in SharedUserData. (Alex Ionescu)
  • Set the OS version and Machine Type (i386/PPC (<3 Arty) in SharedUserData. (Alex Ionescu)
  • Move some HAL calls in Phase 2 (actually Phase 1...), same for KeInit2. (Alex Ionescu)
  • Break into KDBG a bit earlier. (Alex Ionescu)
  • Make Kernel initialization (KeInit2) portable/more complete. KeInit2 becomes KeInitSystem, the portable part, with a call to KiInitMachineDependent, the arch-specific part. (Alex Ionescu)
  • Do all CPU configuration through IPIs and synchronize with potential multiple CPUs. (Alex Ionescu)
  • Add mtrr.c and patpge.c for future support of MTRR, AMD K6 MTRR, PGE and PAT support, with initilization calls in each of them (which only print out a "Sorry" message). (Alex Ionescu)
  • Add some stubbed code for extra initizliation to do later once some detection things are fixed. (Alex Ionescu)
  • Add KF_XMMI64 feature flag for SSE2 and detect it. (Alex Ionescu)
  • Detect Hyper-Threading and set Local APIC ID (put back Thomas's code that he added in an old revision and that I had accidentally removed and forgotten to re-convert into the new KiGetFeatureBits function). (Alex Ionescu)
  • Add code to set the kernel MX Csr Mask in the FX Save Area. (Alex Ionescu)
  • Startup the sysenter handler on the DPC stack. (Alex Ionescu)
  • Detect and notify users with broken Pentiums. (Alex Ionescu)
  • Do some NPX checks to forcefully disable any FPU flags that might be set (SSE, MMX, 3DNOW) if the NPX is disabled. (Alex Ionescu)
  • Fix KUSER_SHARED_DATA in winddk.h (Alex Ionescu)
  • Scanfor NOEXECUTE/EXECUTE/OPTIN/OPTOUT/ALWAYSON/ALWAYSOFF load strings and set the appropriate NX policy in KUSER_SHARED_DATA as well as kernel CPU Feature flags. (Alex Ionescu)
  • Implement XPSP2+ syscall stub that uses indirect pointer instead of executable code inside KUSER_SHARED_DATA. (Alex Ionescu)
  • Implement ExpInitNls to initialize the NLS Section using the new semantics recently implemented. Works pretty much like the previous code in rtl/nls.c except it uses the new variable names as well as maps a view of the NLS Table into the system process.c (Alex Ionescu)
  • Delete rtl/nls.c and all the associated deprecated code. (Alex Ionescu)
  • Do MmInit1 and SharedUserData stuff *after* initializing the initial thread, to avoid an ASSERT during bootup. (Alex Ionescu)
  • Use KeLoaderBlock for registry hive loading. (Alex Ionescu)
  • Get rid of the CACHED_MODULE array and associated structures and stop using them, get rid of ParseAndCacheLoadedModules. Stop using KeLoadedModules and KeLoadedModuleCount outside of freeldr.c. (Alex Ionescu)
  • Except for MmInit1, the kernel should now be totally isolated from FreeLDR-specific data. (Alex Ionescu)
  • Rewrite ExpLoadInitialProcess by inlining and simplifying what the call to RtlCreateProcsesParameters should do, and also create our own custom environment with the same arguments that NT's smss gets. (Alex Ionescu)
  • This optimizes booting as well as gets use the differnet SESSIONY_INITIALIZATION_FAILED, where Y is a number representing which step of the process parameter/envieonment creation failed. (Alex Ionescu)
  • Put all Phase 1 Ex* Initialization in ExpInitSystemPhase1 and clean up associated deprecated calls. (Alex Ionescu)
  • Call ExpInitializePushLocks since we weren't doing this before. (Alex Ionescu)
  • Get rid of the completely convoluted way that Phase 1 initialization was being ended, with umpteen events and waits and timeouts all synchronized from user-mode and do a simple 5-second wait to determine if smss started OK or not. (Alex Ionescu)
  • Promote the Phase 1 initialization thread by jumping directly into the zero-page thread, and remove manual zero-page thread initialization code since we simply jump into its main routine. (Alex Ionescu)
  • Make ExpInitNls responsible for NLS initialization in Phase 0 as well, to clean up the code in ExpInitailizeExecutive a bit. (Alex Ionescu)
  • Initialize the system time/clock in Phase 1, not in Phase 0. (Alex Ionescu)
  • Do HAL Phase1 initialization as the first step in Phase 1 initialization, then initialize the system clock (since the HAL's RTC is now configured). (Alex Ionescu)
  • Do Ob Phase 1 init in Phase 1 initialization, not in phase 0. (Alex Ionescu)
  • Do Ke Phase 1 init after HAL, Ob and Ex phase 1 inits. (Alex Ionescu)
  • Initialize NLS for Phase 1 after Ke Phase 1, instead of much later. (Alex Ionescu)
  • Implement ExInitializePushLock and ExConvertPushLockSharedToExclusive macros. (Alex Ionescu)
  • FreeLDR: Create the loader entry for ntoskrnl now that FreeLDR PE-loads it since last year. This lets us remove a large hack in ntoskrnl which was manually creating the entry and filling it in. (Alex Ionescu)
  • Rename some LastKrnl... addresses into MmFreeLdr to easily identify them, and remove the need to use MmFreeLdrMemLower and MmFreeLdrPageDirectoryStart. (Alex Ionescu)
  • Remove the static KERNEL_BASE definition based on a GCC-specific external. Everything now uses the actual module entry's saved base address. (Alex Ionescu)
  • Fix a Ps Initialization hack and properly set the boot PDE. (Alex Ionescu)
  • Add a hack for NTLDR's lack of MmFreeLdrMemHigher and MmFreeLdrPageDirectoryEnd. (Alex Ionescu)
  • In NTLDR boot, try to get the first kernel physical address from the loader entries. (Alex Ionescu)
  • Fixup HAL's image base in the loader parameter block, since we load it at a different place then freeldr tells us. (Alex Ionescu)
  • Stub LdrVerifyMappedImageMatchesChecksum. (Alex Ionescu)
  • Separate locating the system DLL from initializing it. (Alex Ionescu)
  • Implement split-phase PsInitSystem for Phase 0 and 1, and make system dll initialization as part of phase 1. (Alex Ionescu)
  • Add MmVerifyImageIsOkForMpUse and MmCheckSystemImage to validate the system DLL. (Alex Ionescu)
  • Add a separate bugcheck for each failure in PsLocateSystemDll, matching with the NT bugchecks that would occur. (Alex Ionescu)
  • Inline and make some slight correctiions to KiInitailizeSystemClock, since it's based on the Ex subsystem, not Ke. Add code for boot-time timezone bias, but currently disabled because I need to implement a function to read configuration registry data at startup. (Alex Ionescu)
  • Improve Init bugchecks to give the exact module that failed. Add Kd initilization in the same block as the other subsystems. (Alex Ionescu)
  • Rename and re-arrange some initlization calls. (Alex Ionescu)
  • More re-shuffling of initialization calls, including enabling access to the blue screen much much earlier (no point in doing it so late, but this change is not that useful since soon we'll have bootvid). (Alex Ionescu)
  • Split Po init in two, so the early Po init (which we'll need to do eventually) doesn't depent on the later Po init (which uses a PnP notification which depends on the Io system). (Alex Ionescu)
  • Make I/O initialize quite a bit later. (Alex Ionescu)
  • Part 1 of ARC boot cleanups/changes: Create a valid \\SystemRoot symbolic link as the system is booting, which points to the ARC name, then, once drivers have loaded, re-assign it to the proper NT Device name. Added proper security descriptors and flags to symbolic links, as well as proper bugchecks when required. (Alex Ionescu)
  • Kept and cleaned up the ROS hack for CD-ROM boot. (Alex Ionescu)
  • Part 2 of ARC boot changes: Major modifications done to the existing code, as well as re-formatting and cleanup. Floppy ARC names are not created anymore (they don't exist), and CD-ROM ARC name is only created 1) when there is a boot CD and 2) only for the boot CD. This mimics NT functionality. (Alex Ionescu)
  • Optimize some code paths, mostly by not querying the whole GET_DRIVE_GEOMETRY IRP twice and reducing some buffer usage. Also re-factor some code better into smaller functions. (Alex Ionescu)
  • Document and work around currently FreeLDR incompatibility (lack of ARC_DISK_INFORMATION) data in LoaderBlock. (Alex Ionescu)
  • Have FreeLDR fill out ARC_DISK_SIGNATURE information for each detected disk, as it's filling the registry. (Alex Ionescu)
  • Add code to KiRosFrldrLpbToLpb to convert this array to the official ARC_DISK_INFORMATION structure that contains LIST_ENTRYies for each ARC_DISK_SIGNATURE, and initialize the ArcDiskSignatureListHead. (Alex Ionescu)
  • Greatly simplify and optimize IoCreateArcNames by using ARC data from FreeLDR/NTLDR (now nearly 100% compatible!) instead of querying registry data (which FreeLdr had already set up, so we cached those values like ntldr does). (Alex Ionescu)
  • Part 2.5 of ARC Boot changes. Re-factor IoCreateArcNames not to use a list-entry of detected disk from pool that gets looped and de-referenced, but instead use a simple loop which calls a function that gets disk information one-by-one (IopGetDiskInformation), so that it's used on the spot instead of allocated, linked, and retrieved later. (Alex Ionescu)
  • Inline IopAssignArcNamesToDisk to reduce some stack size abuse and too much parameter shuffling (Alex Ionescu)
  • Optimize IopApplyRosCdromArcHack by not searching for the second copy of ntoskrnl if we already found the first. (Alex Ionescu)
  • Also optimize stack usage by only using an ANSI buffer instead of having another Unicode buffer and unicode strings. Saves 530 bytes of stack. (Alex Ionescu)
  • ARC Boot Rewrite: Rename IoCreateArcNames to IopCreateArcNames and set it to NTAPI, as well as pass the loader block as a parameter. (Alex Ionescu)
  • ARC Boot Rewrite: Reduce buffers to 128 bytes, since ARC Paths don't get longer then that. (Alex Ionescu)
  • ARC Boot Rewrite: Optimize stack usage by using a single ANSI_STRING instead of 3 or 4. (Alex Ionescu)
  • ARC Boot Rewrite: Optimize stack usage by using a single ansi buffer, not 2 or more. (Alex Ionescu)
  • Remove InitSharedUserDataPage since this entire function is not needed anymore due to the recent ARC improvements. (Alex Ionescu)
  • Call IoAssignDriverLetters with the proper parameters, and give it a chance to update the SystemRoot path (although our version doesn't yet do this). (Alex Ionescu)
  • Fix a pretty bad stack/memory corruption bug related to IoReassignSystemRoot. (Alex Ionescu)
  • Combine IoInit2 and IoInit3 into IoInitSystem, and make it return a BOOLEAN, and handle error with the appropriate IO1_INIT_FAILED bugcheck. Will combine IoInit1 soon. (Alex Ionescu)
  • Initialize the registry in one shot, and allow it to fail and do the associated CONFIG_INIT_FAILED bugcheck. (Alex Ionescu)
  • Initialize Io in one shot, with IoInitSystem. (Alex Ionescu)
  • Locate the system DLL a bit later, since on the boot CD this creates a small incompatibility due to the wrong path being in use. (Alex Ionescu)
  • Bootvid rewrite by Filip Navara (with some fixes by myself) (Alex Ionescu)
  • HAL DMA enhancements by Filip Navara. (Alex Ionescu)
  • CSRSS Console enhancements by Filip Navara. (Alex Ionescu)
  • Win32k Primitive Queue/Input/Painting/Focus enhancements by Filip Navara. (Alex Ionescu)
  • Other misc win32k/CSR bug fixes by Filip Navara. (Alex Ionescu)
  • Merge some parts of IoInitSystem in the same main function instead of calling out to 10 external modules. (Alex Ionescu)
  • Re-factor some code into smaller functions. (Alex Ionescu)
  • Don't create some Object Directories twice, since now ExpCreateSystemRootLink does some of them. (Alex Ionescu)
  • Add some failure paths to I/O Init. (Alex Ionescu)
  • Implement a function to mark the boot partition DO_SYSTEM_BOOT_PARTITION in order to better catch some bugchecks. (Alex Ionescu)
  • Combine PnpInit1/2 since they were called one after the other. (Alex Ionescu)
  • Load RAW driver while loading boot drivers. (Alex Ionescu)
  • Cleanup IoInitSystem a bit more. (Alex Ionescu)
  • Set OBJ_OPENLINK invalid for core object types. (Alex Ionescu)
  • Initialize symbolic link in-line with other core object types. (Alex Ionescu)
  • Use the SePublicDefaultUnrestrictedSd directly instead of building another SD. (Alex Ionescu)
  • Create core directory objects with Nt* functions instead of Ob*, to insure full accounting and error-handling. (Alex Ionescu)
  • Create core objects with OBJ_CASE_INSENSITIVE. (Alex Ionescu)
  • Fix the huge ObInit hack which was manually inserting Directory and Type object types in the type directory, and now loop the type list. Now we don't skip the Process, Token, Thread, Job, Section types anymore. (Alex Ionescu)
  • Support Quota Information during object allocation and deallocation isntead of ignoring it. (Alex Ionescu)
  • Use interlocked decrement when touching the object type (since it's a shared structure. We don't use the lock yet, but we won't for this anyways, since it's a simple lockable operation). (Alex Ionescu)
  • Use the right object key when freeing the object. (Alex Ionescu)
  • Modify the allocation function for a more optimized way of allocating objects instead of having to keep track of two sets of variables. (Alex Ionescu)
  • Add various accounting variables. (Alex Ionescu)
  • Make sure to properly handle allocations without object create info (ie, for object types). Now they get creator info and name info (which allowed us to cleanp the hack in ObInit). (Alex Ionescu)
  • Add checks to see if Quota informatio is needed. (Alex Ionescu)
  • Clear CreatorBackTraceIndex during allocation. (Alex Ionescu)
  • Remove CreatorUniqueProcess hack from back when the idle thread was NULL. (Alex Ionescu)
  • Do not zero out the header during allocation anymore, since this slows down the routine (instead, simply zero out the 2 fields that are NULL). (Alex Ionescu)
  • Locate and clearly display that the fact we zero objects on creation is a HACK that needs to be fixed. (The Token code makes this assumption). (Alex Ionescu)
  • Update HighWaterNumberOfObjects when needed. (Alex Ionescu)
  • If caller didn't give pool charges, use the one from the object type. (Alex Ionescu)
  • Clear the Total/HighWater* values for newly created object types instead of using random values. (Alex Ionescu)
  • Properly typecast the WCHAR tag as CHAR. (Alex Ionescu)
  • Insert each new object type in the ObTypeObjectType Type List. (Alex Ionescu)
  • Set the Index member of each new object type and insert each new object type in the ObpObjectTypes array. This is crucial for object type enumeration when implemented. (Alex Ionescu)
  • Fixup the way we insert new object types into the tree. Allow failure and don't return a type if we couldn't insert it, and only reference the type directory object if it actually exists. (Alex Ionescu)
  • Move DOS Devices\"??" initialization in its own routine. (Alex Ionescu)
  • Use Nt APIs for all operations instead of raw I/O. (Alex Ionescu)
  • Create GLOBALROOT link to \ (Alex Ionescu)
  • Create \??\Global link to \?? (Alex Ionescu)
  • Implement Object Type Resource Lock, since object types are shared across all objects and thread-safety is critical. Used it everywhere where I think it's needed. Thomas, can you check if I missed anything please? (Alex Ionescu)
  • Use interlocked increase/decrease for accounting variables inside the Object Type instead of acquiring a full lock or not being thread safe. (Alex Ionescu)
  • Clear the creator type list of an object if it lost all its handles. (Alex Ionescu)
  • Fix a bug in NtduplicateObject which was potentially derefernecing a garbage pointer (thanks Prefast!). (Alex Ionescu)
  • Fix SD charges to 2048 bytes instead of 2000. (Alex Ionescu)
  • Fix a memory leak in ObOpenObjectByName. Object Create Information is now freed. (Alex Ionescu)
  • Implement NtCreateDebugObject, NtDebugContinue, NtDebugActiveProcess, NtRemoveProcessDebug, NtSetInformationDebugObject, NtWaitForDebugEvent. (Alex Ionescu)
  • Of course, the entire backend is stubbed out. (Alex Ionescu)
  • Implement Debug object initialization (not called yet) and close(not done) and delete (done) callbacks. (Alex Ionescu)
  • Fixup DEBUG_OBJECT definition. (Alex Ionescu)
  • Implement DbgkpCloseObject. (Alex Ionescu)
  • Implement DbgkpOpenHandles. (Alex Ionescu)
  • Fix various bugs in the code and flag usage. (Alex Ionescu)
  • Enable calling DbgkClearProcessDebugObject when terminating a process. (Alex Ionescu)
  • Define DBGKM_APINUMBER (Alex Ionescu)
  • Implement DbgkpSendApiMessageLpc, DbgkpSendApiMessage, DbgkCopyProcessDebugPort, DbgkForwardException, DbgkFreeDebugEvent, DbgpWakeTarget. (Alex Ionescu)
  • Close original handle in DbgkOpenHandles. (Alex Ionescu)
  • Implement DbgkpConvertKernelToUserStateChange. I just remembered that there's actually 3 debug subsystems in NT: Win32, Native and Kernel, so this structure will still need to be heavily parsed at the Win32 level (in kernel32) before user-mode debuggers can work (so I'll have to write a small native-mode debugger test app to test this implementation first). (Alex Ionescu)
  • Implement DbgkpMarkProcessPeb. (Alex Ionescu)
  • Implement DbgkpQueueMessage. This is the main bi-directional communication routine for the newer non-LPC Debug Object. (Alex Ionescu)
  • Implement DbgkPostFakeProcessCreateMessages (and stub DbgkpPostFakeThreadMessages and DbgkpPostFakeModuleMessages). These are required when attaching to a process after threads have been created and modules loaded, so that the debugger can have a valid state. (Alex Ionescu)
  • Add one of the basic OBJECT_ATTRIBUTES flags and don't fail any 3rd-party driver or application that might've been using it. (Alex Ionescu)
  • Add missing member to DBGKM_LOAD_DLL. (Alex Ionescu)
  • Implement DbgkPostFakeModuleMessages. (Alex Ionescu)
  • Stub MmGetFileNameForAddress but write documentation on how to implement it (thanks to Filip Navara). For now it always returns ntdll.dll as a testhack. (Alex Ionescu)
  • Fix KeFreezeAllThreads prototype and define it in the internal headers. (Alex Ionescu)
  • Fix two bugs in KeSetBasePriorityThread and KeSetPriorityThread which were using an undefined value for "Lock Released" if the priority wasn't changing, potentially causing a missing spinlock release when none was required (and thus eventually freezing the scheduler) (Alex Ionescu)
  • Implement KeThawAllThreads based on KeFreezeAllThreads. (Alex Ionescu)
  • Fix a bug in KeFreezeAllThreads which was causing us never to actually parse the next flink. (Alex Ionescu)
  • Fix a bug in KeFreezeAllThreads which was causing us never to leave the critical region we entered at the beginning. (Alex Ionescu)
  • Implement helper routine DbgkpSectionToFileHandle and stub MmGetFileNameForSection (easy ObQueryNameString-based implementation to do later). (Alex Ionescu)
  • Implement helpers DbgkpSuspendProcess and DbgkpResumeProcess based on KeFreeze/ThawAllThreads. (Alex Ionescu)
  • Implement DbgkExitProcess, DbgkExitThread, DbgkMapViewOfSection, DbgkUnmapViewOfSection. Apart from DbgkCreateThread, these are the main notification APIs that Dbgk uses for user-mode debug events. (Mm code needs to be changed to call the map/unmap notifications. Ps already calls the exit/create ones). (Alex Ionescu)
  • Properly implement inline versions of KeGetCurrentThread and KeGetPreviousMode/ExGetPreviousMode, as well as KeGetPcr. This should significantly increase performance. (KeGetPreviousMode is reduced to 2 lines of code instead of 15 lines with 2 expensive jumps). (Alex Ionescu)
  • Make CSRSS register the default hard error port on startup. (Alex Ionescu)
  • Stubplement the System Hard Error handler (it simply bugchecks) (Alex Ionescu)
  • Fully implement ExRaiseHardError when called from user-mode so that the strings and parameters are properly captured into user-mode memory. (Alex Ionescu)
  • Almost completely implement ExpRaiseHardError which is responsible for actually doing the error. However, ROS LPC is screwed up so sending the LPC Message crashes since the port isn't in a listening state or something. (Alex Ionescu)
  • Would appreciate some advice on how to get the LPC message to CSRSS. (Alex Ionescu)
  • Fix Get/SetErrorMode. The Native API uses an inverted value of SEM_FAILCRITICALERRORS, so this must be handled in win32. (Alex Ionescu)
  • Cleanup formatting of RaiseException, and only normalize the paramter count if we're actualy going to use it. (Alex Ionescu)
  • Fix flags in DbgkpSectionToFileHandle (Alex Ionescu)
  • Implement DbgkpCreateThread. (Alex Ionescu)
  • Implement DbgkpSetProcessDebugObject. (Alex Ionescu)
  • Implement MmAddVerifierThunks, MmIsDriverVerifying, MmIsVerifierEnabled. (Alex Ionescu)
  • Implement IoSetCompletionRoutineEx, which is a safe way to set completion routines that almost all newer drivers will be using (XP+). (Alex Ionescu)
  • FSTUB Patch for Mount Manager Support: Delete disk.c entirely from iomgr.c and spread it across fstub. (Alex Ionescu)
  • FSTUB Patch for Mount Manager Support: Entirely reimplement from scratch IoWritePartitionTable, IoReadPartitionTable, IoSetPartitionInformation, HalExamineMbr. Lots of bug fixes in terms of wrong assumptions and compatibility with weird partition tables. (Alex Ionescu)
  • FSTUB Patch for Mount Manager Support: Fix prototype of IoAssignDriveLetters, but for now, keep the old code (xHalIoAssignDriveLetters) because this has not been rewritten yet. (Alex Ionescu)
  • FSTUB Patch for Mount Manager Support: Implement missing functions in HAL (IoRead/Write/Set PartitionInfo) and make them call into the ntoskrnl exports. (Alex Ionescu)
  • Remove the "deprecated" directory from ntoskrnl since it now truly is. (Alex Ionescu)
  • Remove KeInitInterrupts hack. (Alex Ionescu)
  • Remove KiDispatchInterrupt2 export hack from kernel and stop using it from the HAL. (Alex Ionescu)
  • HAL can now be built/tested with Windows/TinyKRNL since the export hack is gone and interrupts are sent properly through the IDT. (Alex Ionescu)
  • Remove a bunch of completed krnlfun entries. (Alex Ionescu)
  • Fix progressbar during bootcd bug. (Alex Ionescu)
  • Swap the IDT where we should, in KiSystemStartup instead of the freeldr.c hackfile. This, coupled with the previous patch, should make NTLDR-booting even more succesful since interrupts won't crash/be ignored. (Alex Ionescu)
  • Implement DbgkPostFakeThreadMessages. (Alex Ionescu)
  • Add Dbgk-calls to NtMap/UnmapViewOfSection to nodify debugging services of new DLL image load. (Alex Ionescu)
  • Forgot to actually initialize Dbgk during system initialization, so any API would crash. (Alex Ionescu)
  • Fix some stupid bugs in NtCreateDebugObject. (Alex Ionescu)
  • Implement an unhandled case in DbgkSetProcessDebugPort. The event queue is now properly parsed during connect and the event is signaled to start flushing the queue. (Alex Ionescu)
  • Fix a bug in NtWaitForDebugEvent. (Alex Ionescu)
  • Fix DbgkSectionHandleToFileHandle. (Alex Ionescu)
  • Implement MmGetFileNameForSection. (Alex Ionescu)
  • Fix some bugs in NtWaitForDebugEvent which caused debug events to be sent in the wrong order and also more then one event to be sent at the same time (and thus some events skipped). (Alex Ionescu)
  • Test app now properly receives the "create process" event along with valid process/thread handles and the image base. No file handle sent yet because of the I/O Manager File Object bug. (Alex Ionescu)
  • There's still a bug in NtContinueDebugEvent due to wrong Client IDs being sent (Alex Ionescu)
  • Client IDs were OK, I incorrectly assumed they weren't due to the concidence they were equal to the thead/process handles. Actual bug was NtDebugContinue not accepting a valid status value. This is fixed now. (Alex Ionescu)
  • Fix critical I/O bugs in IopParseFile which were causing the file object's device object pointer to be associated to the FSD (File System Device) instead of the Disk Driver, as well as the dereference of the FSD after the Disk Driver had been referenced (causing too many derefs for one, and to many refs for the other). Also fix a bug in IopQueryDeviceInformation which was querying the Disk Driver instead of the FSD. (Alex Ionescu)
  • This also fixes IopQueryNameFile to properly return the entire name of the file now, instead of only the FSD part (probably fixes a dozen regressions). (Alex Ionescu)
  • Fix a bug in DbgkOpenHandles which was causing file handles to get lost. (Alex Ionescu)
  • Properly set and check the image notification flag for the process in DbgkCreateThread. Patch by hto. See issue #1879 for more details. (Alex Ionescu)
  • Implement support for DEBUG_PROCESS in CreateProcess so that processes can be started with a debugger (works and tested with a new test app). (Alex Ionescu)
  • Fix a bug in DbgkCreateThread which wasn't saving the initial thread information in the right place. The process create event is now fully supported and properly returns the entrypoint of the application. (Alex Ionescu)
  • Write DLL Being mapped into NtTib->ArbitraryUserPointer so that the debugger can pick it up. (Alex Ionescu)
  • Fix bugs in DbgkWakeTarget, DbgkCreateThread, DbgkMapViewOfSection and call from NtMapViewOfSection. (Alex Ionescu)
  • Fix missing "break" statement in DbgkFreeDebugEvent, causing a handle leak, and in DbgkpOpenHandles, causing user-mode to get a kernel-mode handle for DLL images instead of the correct duplicated one. (Alex Ionescu)
  • Currently struggling with the fact that ArbitraryUserPointer seems to be reset to zero before it's read for the debug event, so DLL names don't come through. (Alex Ionescu)
  • Implement V86 trap fixup during traps and interrupts. (Alex Ionescu)
  • Implement DR register save/restore during traps, interrupts and system calls. (Alex Ionescu)
  • Clear capacity data buffer before reading it to avoid 0xCCCCCCCC values and manually set failure code if nobody filled it in (a hack, but I don't understand our pre-Nixon-era storage stack to "properly" fix it, so this is good enough and kills off the 0xCCCCCCCC byte non-paged pool allocations. (Alex Ionescu)
  • Fix IopSecurityFile to send the IRP to the right device. (Alex Ionescu)
  • Fix IoSetInformation to send the IRP to the right device. (Alex Ionescu)
  • After the major fix in 24996, the functions that had been written to work with the I/O bug stopped working (by sending the IRP to the wrong device object, which, due to the bug was the ""right"" object), this is now fixed and the bootcd works again. (Alex Ionescu)
  • Fix SleepEx. (Alex Ionescu)
  • 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). (Alex Ionescu)
  • Update FILE_OBJECT definition. (Alex Ionescu)
  • Add some asserts to some I/O functions. (Alex Ionescu)
  • Add stub support for File Objects created by XP+ Drivers which have File Object Extensions. (Alex Ionescu)
  • 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. (Alex Ionescu)
  • Fix a bug in IopSecurityFile. (Alex Ionescu)
  • Queue and unqueue IRPs in all I/O functions. (Alex Ionescu)
  • Fully support IRP cancellation now. (Alex Ionescu)
  • 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. (Alex Ionescu)
  • Add exhaustive validation checks to IoCreateFile, add more failure cases, and validate the EA buffer. Also support IO_ATTACH_DEVICE_API flag. (Alex Ionescu)
  • Implement IoCreateStreamFileObjectEx and IoCreateStreamFileObjectLite and fix several bugs in the original implementation of IoCreateStreamFileObject. (Alex Ionescu)
  • Update Io*ShareAccess routines to support XP+ style semantics related to special File Object flags which disable their use. (Alex Ionescu)
  • Add validation to all Query/Set routines so that information clasess, lengths, buffers and alignment are properly checked. (Alex Ionescu)
  • Also add an array for the proper acess rights that each query/set operation requires. (Alex Ionescu)
  • Check backup/restore privileges during I/O File operations. (Alex Ionescu)
  • Check traverse access during I/O File Operations. (Alex Ionescu)
  • Check access privileges to the device during I/O file operations. (Alex Ionescu)
  • Rename IopReferenceDeviceObject and also verify if an exclusive DO is trying to be invalidly opened. (Alex Ionescu)
  • Support various extra security checks during I/O File/Device Parse Routine. (Alex Ionescu)
  • Fix a bug during IopCleanupIrp so that we don't dereference the File OBject if this was a create operation. (Alex Ionescu)
  • 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. (Alex Ionescu)
  • Fix a large bug in ObInsertObject which affected the insert of unnamed objects with forced security options (Such as process/threads). (Alex Ionescu)
  • Fix the creation of the Process/Thread/Job Obejct Types to that security information is forced. (Alex Ionescu)
  • Remove "Fix PS!!!" messages since the bug is now fixed and these objects now get proper security descriptors. (Alex Ionescu)
  • Fix another bug in ObInsertObjet which wasn't properly validating user-mode objects and always assumed kernel mode. (Alex Ionescu)
  • Silence multiple trace/checkpoint messages that have accumulated throughout time for various debugging purposes. (Alex Ionescu)
  • Fix critical bugs in exception handling: Unwinding was completely broken, using the wrong SEH protector to detect collided unwinding. The correct protector itself also had a broken check. (Alex Ionescu)
  • Fix architectural bug in the entire TrapFrame<->Context conversion system and Ring Privilege Transitions (Inter-ring and intra-ring) which was lacking proper sanitation and validation of segments, flags and debug registers. Among other things, IOPL is now respected, CS is not KGDT_R0_CODE | RPL_MASK anymore, and the GPF code is now properly being called. This completely fixes exception handling being totally broken and crashing firefox installer, mirc, and other applications. (Alex Ionescu)
  • Rewrite the page fault handler base code in assembly instead of relying on a broken C routine. Detect VDM, V8086, detecting expected/normal fault in ExpInterlockedPopEntrySList and faults in the system handler code. Rewrite MmAccessFault to be the main function that calls out to other sub-fault functions, and use the same prototype as NT. (Alex Ionescu)
  • Fix the KGDT boot table to have proper granularity and big flags, and extend it to 256 entries. (Alex Ionescu)
  • Create proper thread context in RtlInitializeContext and cleanup Rtl Thread routines. (Alex Ionescu)
  • Remove all int3 and breakpoints from trap handlers, and replace them with a much better "UNHANDLED_PATH" macro which freezes the system, beeps, and displays a message with the line of code that's unhandled. This is to clearly tell the user that something is unhandled, instead of nesting infinite exceptions due to the int3. (Alex Ionescu)
  • Fix a bug in INT_PROLOG. (Alex Ionescu)
  • Sanitize EFLAGS and Code Segments in KeContextToTrapFrame and KeTrapFrameToContext. (Alex Ionescu)
  • Implement KiUpdateDr7 and KiRecordDr7 as well as DR_MASK and other DR-validation macros and functions to protect against DR-vulnerabilites as well as to properly account for each active hardware breakpoint in a per-thread fashion by using the dispatcher header. (Alex Ionescu)
  • Allow CR0_EM when running in a VDM. (Alex Ionescu)
  • Fix FPU/NPX Register handling in KeContextToTrapFrame and KeTrapFrameToContext, and also speed it up by manual copying instead of a memory move. (Alex Ionescu)
  • Properly give IOPL 3 to user-mode threads if they requested it. (Alex Ionescu)
  • Detect GPF during GPF. (Alex Ionescu)
  • Detect pagefault with a trap-frame spread over two or more pages and nested. (Alex Ionescu)
  • Properly sanitize and set correct trap frame in KiInitailizeUserApc. (Alex Ionescu)
  • Return STATUS_ACCESS_VIOLATION during page faults instead of STATUS_UNSUCESSFUL. (Alex Ionescu)
  • Fix assert in VdmSwapContext, as well as Code Selector check which was broken. (Alex Ionescu)
  • Fix delayed object deletion (ObDeferDeleteObject) and the Ob Repear Routine and list. (Alex Ionescu)
  • Update Kernel Fun. (Alex Ionescu)
  • NtWaitForMultipleObjects/NtWaitForSingleObject: Fail if memory allocation failed. (Alex Ionescu)
  • NtWaitForMultipleObjects/NtWaitForSingleObject: Don't overwrite original captured handle value when decoding to kernel handle. (Alex Ionescu)
  • NtWaitForMultipleObjects/NtWaitForSingleObject: Use PAGED_CODE. (Alex Ionescu)
  • NtWaitForMultipleObjects/NtWaitForSingleObject: Check timeout validity first before probing the entire handle array. (Alex Ionescu)
  • Fix a critical bug in NtSignalAndWaitForObject which was using the wrong object type (waitable object instead of signalled objecT). (Alex Ionescu)
  • Fix OB_SECURITY_METHOD prototype, callers, and implementors. (Alex Ionescu)
  • Add call to SeOpenObjectAuditAlarm in ObCheckObjectAccess. (Alex Ionescu)
  • Start adding Ob Callout validation on checked builds. For now only done around security functions. (Alex Ionescu)
  • Set *MemoryAllocated to FALSE in ObGetObjectSecurity early on to avoid inconcistent state if the callback failed. (Alex Ionescu)
  • Implement new XP function ObSetSecurityObjectByPointer and simplify NtSetSecurityObject by making it use it. (Alex Ionescu)
  • More Win 2003 SecurityDescriptor Cache functions to sdcache instead of obsecure.c. (Alex Ionescu)
  • Fix a bug in KeLeaveCriticalRegion which was delivering APCs even if Special APCs were disabled. The check is now fixed. Thanks to Dominique Cote for the bug report. (Alex Ionescu)
  • Fix multiple bugs in HalpCalculateChsValues. (Alex Ionescu)
  • Fix lots of typecast warnings. (Alex Ionescu)
  • Fix potentially uninitialized variables. (Alex Ionescu)
  • This should fix the partitioning problems/regression. Thanks to hto for finding out the source of the bug. (Alex Ionescu)
  • Fix a bug in ExReleasePushLock which broken contention checking. (Alex Ionescu)
  • Fix some length calculation bugs in IopQueryFile. (Alex Ionescu)

Hardware Abstraction Layer (HAL)

  • Export KeAcquire/ReleaseQueuedSpinlocks (Aleksey Bragin)
  • Fix wrong prototype of HalEndSystemInterrupt (Aleksey Bragin)
  • Stall the CPU after each I/O command to simulate I/O delay. (Alex Ionescu)
  • Make HalMakeBeep a bit nicer by making the PUCHAR typedef part of the TIMER constants. (Alex Ionescu)
  • Flush write buffers before rebooting. (Alex Ionescu)
  • Refactor sending the reset command since it's not always a matter of using the keyboard port. (Alex Ionescu)
  • HalReturnToFirmware does a HalpReboot no matter what parameter is sent. (Alex Ionescu)
  • Implement HalSystemVectorDispatchEntry, KeFlushWriteBuffer, HalFlushCommonBuffer, HalAllocateCrashDumpRegisters. (Alex Ionescu)
  • Add lots of missing PCI definitions to the DDK, and to the internal file pci.h (Alex Ionescu)
  • Make HAL compilable with the WDK thanks to a nice hack/trick I found. (Alex Ionescu)
  • Delete HAL cruft files. (Alex Ionescu)
  • Implement (or cleanup + mark as implemented, these are 4 line functions) HalDisplayString, HalAcquireDisplayOwnership, HalSetDisplayParameters, HalQueryDisplayParameters, HalInitailizeProcessor, HalAllProcessorsStarted, HalStartNextProcessor, HalProcessorIdle, HalRequestIpi. (Alex Ionescu)
  • Fix some prototype definitions and cleanup some formatting. (Alex Ionescu)
  • Export ExiTryToAcquireFastMutex from ntoskrnl, I had forgotten to export this ages ago when adding the other Exi*FastMutex* stuff. (Alex Ionescu)
  • Remove fmutex.c and fastmutex functions from HAL. The whole point of having the Exi ones in the kernel was that HAL calls them through forward exports now (so any old driver can still link with HAL). Now we don't duplicate the implementation anymore. (Alex Ionescu)
  • Remove DriverEntry, it's useless. Also move HalReportResourceUsage to halinit because it's a call-once-on-boot function much akin a HalInitPhase2 function, so delete resource.c (Alex Ionescu)
  • Keep track of interrupt affinity and active processor mask each time a new CPU initializes. (Alex Ionescu)
  • Reorganize HAL exports and export KeTRyToAcquireQueuedSpinlock and KeTryToAcquireQueuedSpinLockRaisetoSynch. (Alex Ionescu)
  • Add stub for HalSetTimeIncrement. (Alex Ionescu)
  • Cleanup CMOS-related routines (Get/Set environment value and get/set RTC). Fixup some prototypes as well. Inline HalpReadCmos/HalpWriteCmos instead of having a separate function. (Alex Ionescu)
  • Fixup wrong protypes for various Queued Spinlock functions. (Alex Ionescu)
  • HAL Initialization Rewrite: Initailize the clock increment separately from the calibration of stall execution. (Alex Ionescu)
  • HAL Initialization Rewrite: Raise IRQL to the current IRQL (basically a no-op) to force a standard PIC state. Will be needed for the new IRQ implementation when it'll work. (Alex Ionescu)
  • HAL Initialization Rewrite: Scan commandline for PCILOCK and BREAK parameters during hal initalization. The former is not supported, only saved, while the latter causes a breakpoint just like the windows implemetnation. (Alex Ionescu)
  • HAL Initialization Rewrite: Get the bus type (ISA, EISA, MCA) on startup to support bootup from NTLDR. (Alex Ionescu)
  • HAL Initialization Rewrite: Validate HAL to match the kernel (checked kernel and UP kernel). Also make the kernel set the proper PRCB flags for this. (Alex Ionescu)
  • HAL Initialization Rewrite: Initialize the CMOS lock. (Alex Ionescu)
  • HAL Initialization Rewrite: Setup HAL Dispatch table and enable call to HalQuerySystemInformation in the kernel since it now works. (Alex Ionescu)
  • Rewrite bus functions to get rid of the idea of "Bus handlers". This is a deprecated NT4 concept that ReactOS copied and only slows down performance. (Alex Ionescu)
  • Support custom private dispatch table PCI functions. (Alex Ionescu)
  • Provide default PCI functions. (Alex Ionescu)
  • Rewrite PCI functions using clean structures and code instead of magic macros and undocumented magic values. Use simple macros to generate PCI bus operations for write/read uchar, ushort and ulong. (Alex Ionescu)
  • Simplify function definitions for CMOS access. (Alex Ionescu)
  • Unify some dupli/tripi-cated code. (Alex Ionescu)
  • Fix definition of HaliSetSystemInformation. (Alex Ionescu)
  • Fix definitions of Bus Handler functions (add NTAPI). (Alex Ionescu)
  • Add official BUS_HANDLER definition to NDK. (Alex Ionescu)
  • Fix definition of HAL_PRIVATE_DISPATCH. (Alex Ionescu)
  • Remove some derecated code (isa.c and mca.c). (Alex Ionescu)
  • Fix prototype/definition of HalCalibratePerformanceCounter and properly implement it. (Alex Ionescu)
  • Implement KeStallExecutionProcessor in its own assembly file isntead of using inlined GCC assembly, and align the loop to 16 bytes for more streamlined execution speed. (Alex Ionescu)
  • Mask out clock interrupt during Phase 0 and Initialize clock interrupt on HAL Phase 1. This enables the HAL clock interrupt which was already written. (Alex Ionescu)
  • Make the clock interrupt use HalpCurrentTimeIncrement instead of hardcoding a value. (Alex Ionescu)
  • Re-implement HalpInitializeClock to allow for dynamic increments from 1ms to 15ms with appropriate rollovers and to call KeSetTimeIncrement to update timer values with the kernel. (Alex Ionescu)
  • Implement HalSetTimeIncrement to allow changing the clock ms increment (but this isn't yet respected). (Alex Ionescu)
  • Remove system/runtime update routines from the deprecated IRQ implementation and use the newer assembly ones already written, since we're now using the HAL clock interrupt. Remove other unused code. (Alex Ionescu)
  • Fix more bugs in new hal IRQ implementation (that still isn't used yet due to regressions) and implement HalClearSoftwareInterrupt. (Alex Ionescu)
  • There's no such thing as Phase 2 HAL init. (Alex Ionescu)
  • Only map the 0x0 physical address in HalpReboot when enabling warm-reboot, there's no need to map it during init and keep it allocated during the whole time. (Alex Ionescu)
  • Implement a working version of KeQueryPerformanceCounter based on the C implementation (without the strange MHZed-based code) and also support updating the performance timer during a clock interrupt, otherwise the value might become stale during the query. (Alex Ionescu)
  • Update clock interrupt handler to update the performance counter, and also detect if someone changed the clock rate (but don't yet support this). (Alex Ionescu)
  • Finally figured out a way to make the old HAL IRQ implementation work with the new Ke Interrupt implementation without requiring my new HAL IRQ code (which doesn't work). (Alex Ionescu)
  • Add profil.c and stub HalStartProfileInterrupt, HalStopProfileInterrupt and HalSetProfileInterval, and export these functions. (Alex Ionescu)
  • KdComPortInUse is exported by HAL, not kdcom, so make the change. (Alex Ionescu)
  • Register the KD support routines that kdcom on NT uses and implement most of them (except support for PCI Debug Cards). (Alex Ionescu)
  • I can now get Windows to recognize the HAL but it freezes during loading (Due to broken IRQL implementation) and WinDBG won't connect to it. (Alex Ionescu)

Run Time Library (RTL)

  • Patch from Thomas Weidenmueller for Bug #1620: Fix a locking bug in the vectored exception handling
  • Patch from (Thomas Weidenmueller) for Bug #1671: Fix checking the SACL data area in the Win64 version of RtlSelfRelativeToAbsoluteSD2
  • Hackplement RtlSetUserValueHeap and RtlGetUserInfoHeap, they are needed for being able to build higher-level heap management around the Heap APIs (either for developers or the OS). Case in point, needed for my Global* rewrite in kernel32. The current APIs are utter hacks, but they work (eventually we should get rid of the Wine Windows 95 heap implementation and replace it). (Alex Ionescu)
  • Fix implementation of RtlSetUserValueHeap and RtlGetUserInfoHeap to write their flags to the subheap and not the actual main heap structure (since those flags are valid for each allocation). (Alex Ionescu)
  • Make heap allocations 8-byte aligned again. (Alex Ionescu)
  • There are more then only the 3 or 4 heap flags WINE's Windows 95 code supports(there are about 18), so it's a bit stupid to mask them all out, especially since that breaks settable/tag flags. (Alex Ionescu)
  • Stubbed RtlUsageHeap, RtlQueryTagHeap, RtlExtendHeap, RtlCreateTagHeap. (Alex Ionescu)
  • Fix all the failures in the RTLSTR Wine test by merging our old rtl string routines with Wine's. We now pass all 2300 something tests. (Alex Ionescu)
  • Sync RtlBitmap* implementation with WINE: Fixes 278 regression failures (for a total of 0 now). (Alex Ionescu)
  • Also adds implementations for RtlFindMostSignificantBit , RtlFindLeastSignificantBit, RtlFindNextForwardRunClear, RtlFindClearRuns. (Alex Ionescu)
  • Runtime Library Registry Wrappers: Use an array of registry paths instead of duplicating them (Alex Ionescu)
  • Runtime Library Registry Wrappers: Fix implenmentation of RTL_REGISTRY_HANDLE. (Alex Ionescu)
  • Runtime Library Registry Wrappers: Verify all Appends for failure before continuing. (Alex Ionescu)
  • Runtime Library Registry Wrappers: Use the strict minimum key permissions isntead of KEY_ALL_ACCESS. (Alex Ionescu)
  • Runtime Library Registry Wrappers: Don't use OBJ_OPENIF (Alex Ionescu)
  • Runtime Library Registry Wrappers: Use CAPS for \\REGISTRY\\USER (required to match a Windows quirk exposed by a WINE test)* Runtime Library Registry Wrappers: (Alex Ionescu)
  • Runtime Library Registry Wrappers: Use the correct length in RtlpNtQueryValueKey (Alex Ionescu)
  • Implement RtlCaptureStackBackTrace and RtlWalkFrameChain and add definitions to ntifs.h (Alex Ionescu)
  • Get rid of KeRosGetStackFrames and replace usage by RtlWalkFrameChain or RtlCaptureStackBackTrace, depending. (Alex Ionescu)
  • Re-implement the routines in intel syntax and also cleanup the formatting. (Alex Ionescu)
  • Also re-implement the way the routines work, by following Matt Pietrek's c code that he wrote in one of his articles after looking at the disassembly. (Alex Ionescu)
  • Also used a patch for mingw found on Google which contained some implementations in C. (Alex Ionescu)
  • New changes mostly add protection during unwinding, faster speed, and add implementations for __except_handler2 and _abnormal_termination which were not previously present. (Alex Ionescu)
  • Added some generic table routines to rtlfuncs.h so that they can be used in user-mode. (Alex Ionescu)
  • Implemented RtlInsertElementGenericTable and RtlInsertElementGenericTableFull (Splay-Tree versions). Also implemented a helper function RtlpFindGenericTableNodeOrParent when we're not given one and need to locate it manually. (Alex Ionescu)
  • Defined structure for generic table entries so that we can properly return user data and do the right allocations. (Alex Ionescu)
  • Implement RtlIsGenericTableEmpty, RtlNumberGenericTableElements. (Alex Ionescu)
  • Implement RtlLookupElementGenericTable. (Alex Ionescu)
  • Implement RtlDeleteElementGenericTable (Alex Ionescu)
  • Implement RtlLookupElementGenericTableFull. (Alex Ionescu)
  • Implement RtlEnumerateGenericTable. (Alex Ionescu)
  • Implement RtlENumerateGEnericTableWithoutSplaying. (Alex Ionescu)
  • Implement RtlGetElementGenericTable using ordered node/element. (Alex Ionescu)
  • Fix a bug in RtlRaiseException. (Alex Ionescu)

Kernel Mode Drivers

  • USB: Support hubs (Hervé Poussineau)
  • vbemp: read EDID information about screen (not used yet) (Hervé Poussineau)
  • Serial: Implement IOCTL_SERIAL_WAIT_ON_MASK (Hervé Poussineau)
  • Imported and fixed a number of bugs in USB driver stack for Windows NT4 by Zhiming/Woodhead (Aleksey Bragin)
  • VFAT: VfatGetNameInformation: Return the file name length even if the buffer is too small, that's the whole point of the "Query length before comitting a buffer" principle. (Alex Ionescu)
  • VFAT: VfatGetNameInformation: FSDs are not supposed to null-terminate the buffer, nor expect the caller to send a buffer large enough for null-termination. (Alex Ionescu)
  • VFAT: VfatGetNameInformation: Added a hack in IopQueryFile to handle another VFAT bug which makes it return the total number of bytes written in IoStatus.Information instead of the total number of bytes *left untouched*.There are probably many other broken things due to this. (Alex Ionescu)
  • CDFS: A long long time ago there was a stupid kernel that created MDLs for R/W requests even when the length of the buffer was 0. He had another stupid friend called CDFS which attempted to read the MDL before checking if the buffer size is also 0. When cdfs's friend, the kernel, grew smarter and stopped allocating MDLs, cdfs didn't catch on and cried every time this happened. CDFS now caught up. (thanks to Greatlord for finding the regression). (Alex Ionescu)
  • TCPIP: Fixed a bug in TCP/IP that was making it complete IRP_MJ_CREATE with STATUS_SUCCESS yet with the IRP marked as pending. (Alex Ionescu)

NT System Library (ntdll)

  • Implement, export and NDKize: DbgUiGetThreadDebugObject, DbgUiDebugActiveProcess, DbgUiStopDebugging, NtSetInformationDebugObject. (Alex Ionescu)
  • Stub DbgUiConvertStateChangeStructure (this isn't done in kernel32 anymore) and export it. (Alex Ionescu)
  • Implement and export DbgUiSetThreadDebugObject. (Alex Ionescu)
  • Fix DbgUi* APIs to use DbgSsReserved[1], and not [0]. Still trying to figure out what [0] is for. (Alex Ionescu)
  • Implement DbgUiConvertStateChangeStructure. Win32/Native Debugging should be fully implemented now (and waiting on the kernel to support it.) (Alex Ionescu)
  • Fix ntdll and usetup not to use OBJ_OPENLINK on symbolic links. This attribute is for registry keys, not symlinks. (Alex Ionescu)

Services

Win32™ Personality

User mode subsystem server (CSRSS)

Kernel-mode subsystem server (Win32K)

  • Fix BSOD in IntPrepareDriver (Bug #1321) (Hervé Poussineau)
  • New keyboard driver and layout structure implemented (James Tabor)
  • Have IntSystemParametersInfo send WM_SETTINGCHANGE when needed (Timo Kreuzer)
  • Patch from (Timo Kreuzer) for Bug #843: Removed focus from windows, workaround
  • NtUserSetFocus accepts Null window (Timo Kreuzer)
  • Same StretchBlt code for 8, 16, 32 bpp DIBs. It does not use putpixel anymore for 8bpp and 32bpp. Minor cleanups (Magnus Olsen)
  • Last part of the new strectsblt. Remove all mul and div from the loop (speed increase). (Magnus Olsen)
  • Commit FreeType cache glyth patch by Royce Mitchell. Modified by tinus to work with trunk, final fixes made by Timo Kreuzer. Text output receives speed increase from this fix. See Bug #511 for more details. (Magnus Olsen)
  • Implemented NtUserDrawCaption, NtGdiGetPath, NtGdiPathToRegion, NtGdiFlattenPath, NtGdiCloseFigure, NtGdiStrokePath, NtGdiStrokeAndFillPath, NtGdiPolyDraw (Saveliy Tretiakov)
  • Remove hack from Aleksey in changedisplay(), which hard coded the display number. With this patch we are now extract the display number from the desktop and use it. (Johannes Anderwald) and (Magnus Olsen)
  • Patch from Thomas Weidenmueller for Bug #1507: This patch fixes more issues with NtUserFindWindowEx. (one example of bugs have been fixed with this patch is the tray icon)
  • Fix strechblt dib16 and dib32, can be compiled with -O2 (gcc). See Bug #1520 for details (Magnus Olsen)
  • Patch from Thomas Weidenmueller: Patch to fix a couple of argument probing bugs in NtQuerySymbolicLinkObject and NtCreateSymbolicLinkObject
  • Fix two failures from wine gdi32 test. When HDC is NULL to NtGdiCreateDIBitmap we to need create a hdc and delete the hdc when we are done. (Magnus Olsen)
  • Implement SPI_GETFLATMENU and SPI_SETFLATMENU , not fully tested (Magnus Olsen)
  • Implement SPI_GETWHEELSCROLLLINES and SPI_GETWHEELSCROLLCHARS. Further additions to Win32k may be necessary to fully implement the two (Magnus Olsen)
  • Implement SPI_SETSCREENSAVERRUNNING, SPI_SETSCREENSAVETIMEOUT, SPI_GETSCREENSAVERRUNNING, SPI_GETSCREENSAVETIMEOUT (Magnus Olsen)
  • Clean up NtGdiDdCreateDirectDrawObject and test. Fix create hdc when it is NULL (Magnus Olsen)
  • Rewrote NtGdiDdQueryDirectDrawObject. gdientry2 now working more or less. Create surface not yet fully implemented. A few more steps before dx hal working out of the box from win32k and gdi32. Thanks to DrFred for helping debugging between ddraw.dll and gdi32.dll with his sniffer apps, Alex for GdiEntry2, W3seek, Filip, GvG for helping me understand how our win32k works and some other info. It is now possible to load a graphic driver directx hal support in ROS. But I do not know how well it works yet (Magnus Olsen)
  • Added alpha blend support for 32bpp icons with alpha channels (Ged Murphy)
  • Improve compatibility in IntCallWndProcA/W, at least mIRC.exe works with this change (Aleksey Bragin)
  • Improve classes, fix bugs IntMapDesktopView() function (Aleksey Bragin)
  • Audit NCI interface, fixing a few wrong entries (Aleksey Bragin)

WINLOGON

Control Panel Applets

  • Added currency controls with format information (Eric Kohl)
  • Hit-testing added for caption buttons in Display properties – Appearance tab(Eric Kohl)

SYSDM

  • Sysdm has been overhauled and now looks more like XP's (Ged Murphy)
  • Patch from Colin Finck for Bug #1858: Added CPU detection and make a better layout of the system info.

Win32™ Applications

Calc

  • Andrey Janzen (virus126 at gmail dot com) patch fixing copy\paste bug in calc
  • Fixed Bug #2019. 5.01 can be typed in calc now. It used to remove the zero so the result was 5.1. (Magnus Olsen)
  • Fix compiling error in calc.c (Magnus Olsen)

Cmd

Device Manager

Downloader

  • Added the Download! Utility for downloading various free software (Maarten Bosma)

Explorer

  • Explorer does not leak icons and bitmaps anymore (see Bug #1554) (Timo Kreuzer)

Imagesoft

  • Implemented brightness, contrast, blur, sharpness, etc. (Ged Murphy)

ipconfig

sc

  • rewrote parts of the sc code, adding more functionality (Ged Murphy)

Service Manager

  • rewrote most of the service manager code (Ged Murphy)

Userinit

  • Read the shell name from HKCU, if it does not exist fall back to HKLM, if this does not exist use "explorer.exe" and "cmd.exe" (ie allows to specify a custom shell) (Hervé Poussineau)

WineMine

Win32™ Libraries

ADVAPI32

COMCTL32

  • Implemented TOOLTIPS_NotifyFormat, now returns the type of the string (Timo Kreuzer)
  • Fix LISTVIEW_Callback() crash problem, which was caused by a bug in GCC. Now avoided in all modules by using -fno-sibling-call-optimisation (Aleksey Bragin)

CRT

  • Fix the calc bug, modf is compelete wrong, replace it with DJGPP C version of modf with small changes from me so it compile in ReactOS. Old modf did not clear the st reg before it was used, did not load the reg right, did not handler all cases (Magnus Olsen)
  • Reporting djgpp fgets to fgetws, with wine test the old version failed on reading the string. Now we do not have a any bug in fgetws, according wine test. Test run in win2k and Reactos to be 100% sure it was not a Wine test problem. (Magnus Olsen)
  • Fixing a ultoa bug, replacing both version with wine, copy the code from wine 0.9.0; I did add a NULL check for the string so it can not bsod. wine ntdll string only report one error, left to fix, I run wine test on windows 2000 and reactos to compare the result. Fireball report wine_ntdll_test string crach on windows xp, but it does not crash in windows 2000. (Magnus Olsen)
  • Fixing a i64ltoa bug, replacing both version with wine, copy the code from wine cvs 2005-05-21, bug report by wine test (Magnus Olsen)
  • Replace the following _wtol, _wtoi, _i64tow, _ui64tow, _ltow, _ultow, _ui64toa, _itow, _ltow, ultow with Wine from Wine CVS 2006-05-21 because we failed on Wine test on all of these. In Windows 2000 wine test ntdll string did not fail. (Magnus Olsen)
  • Import cprintf from Wine CVS 2006-05-23 as Bug #1529 suggested. It makes most of msvcrt string test work, only one failure left to fix. (Magnus Olsen)
  • Replace djgpp hell bugs fcvtbuf with project http://www.jbox.dk/sanos/source/lib/fcvt.c.html with small modifications to match ReactOS arch. Floating point to string conversion routines Copyright (C) 2002 Michael Ringgaard. All rights reserved.
  • Replace _swab with Wine CVS 2006-05-11 version, this will take care of our problem with overlapped memory with swab, and this also provides two more Wine msvcrt tests. 100% pass with Wine msvcrt string test. (Magnus Olsen)
  • One more Wine msvcrt printf test pass, now it is 62 fails instead of 63 fails (Magnus Olsen)
  • Start implementing float into sprintf, snprintf and other printf APIs. These commits are markers for further implementation, such as for *printf api (the main api functions). Changes made to sprintf.c must be mirrored into swprintf.c or changes into swprintf.c must be mirrored into swprintf.c, other wise the effect of the bugfix or change will not be executed in Reactos, as whether ANSII or unicode versions are being used. (Magnus Olsen)
  • swprintf/sprintf commits for full support of %e %E %f %g %G, numberf function remains to be done (Magnus Olsen)
  • Small rewrite to pass wine test, no bugs in ungetc according to Wine test of msvcrt. (Magnus Olsen)
  • Fix so fread return right value of bytes/chars it reads, passing one more wine test in msvcrt file(Magnus Olsen)
  • Remove stub for _wenviron, already implemented in crt.a (Magnus Olsen)
  • Redirect __p__mbctype to _mbctype, idea copied from Wine (Magnus Olsen)
  • Redirect __p__tzname to _tzname, idea copied from Wine (Magnus Olsen)
  • Fix 24 bugs in *printf string version. Now failing 34 test in wine_test msvcrt printf (Magnus Olsen)
  • Fix one more Wine msvcrt printf test (Magnus Olsen)
  • Fix 2 more errors in msvcrt *printf API (Magnus Olsen)
  • Implement datatype I32 for *printf string version. We have a *printf for files as well. Now failing 29 Wine tests in msvcrt printf (Magnus Olsen)
  • Fix two more bugs in *printf strings version. One more Wine test passed (Magnus Olsen)
  • Fix some bugs for %c in the string version of printf (Magnus Olsen)
  • Use uppercaps for %p instead of lowercaps when it formats the string. Now failing 27 Wine tests (Magnus Olsen)
  • Implement %Fp. Now failing 25 Wine test for string version of *printf API (Magnus Olsen)

FMIFS

GDI32

  • Implemented NtGdiPolyDraw, based on Wine's Implementation (Saveliy Tretiakov)
  • Fix a bug in DdDeleteDirectDrawObject, zero the DirectDraw handler. If it is successful memory is freed (Magnus Olsen)
  • Start implementation of gdientry2, for the moment it returns incorrect info and does not fill some stuff right (Magnus Olsen)

KERNEL32

  • Update ActiveContext functions (Aleksey Bragin)
  • Call some APIs with the right DesiredAccess instead of allways sending _ALL_ACCESS. (for example, only use SECTION_MAP_READ | QUERY unless the caller wants r/w. (Alex Ionescu)
  • Flush ITLB when writing to process memory. (Alex Ionescu)
  • Entirely rewrite Kernel32 Probe functions to um, actually probe (ported Thomas's code in the kernel and adjusted for user-mode and then checked with WINE's code). I can't begin to fathom what the previous routines were supposed to be doing. (Alex Ionescu)
  • Cache system static information, such as PAGE_SIZE at kernel32 startup, so we can reference it in our code without always quertying the system for it. (Alex Ionescu)
  • Rewrote Base Heap implementation nearly from scratch, currently only for Global Heap (Local Heap is as broken as before, since it still calls the Global Heap APIs). For detailed implementation notes, see baseheap.h (Alex Ionescu)
  • Main changes include using the RtlHandle package instead of duplicating an internal implementation, as well as using the RtlHeap* APIs that allow for setting User Flags/Values for associating Base Heap Flags/Handles with the actual RTL-managed block. (Alex Ionescu)
  • Fixup Local* Heap implementation so that calls which have different semantics don't call the Global APIs (ie: LocalAlloc/LocalReAlloc and LocalFlags). The rest can be shared beteween them. Also fix some prototypes. (Alex Ionescu)
  • Rename all the defintions to BASE_HEAP instead of GLOBAL_HEAP, since they apply just as well to the Local Heap. (Alex Ionescu)
  • Reformat heap.c to ROS standards (Alex Ionescu)
  • HeapCreate should mask out NT flags and tag allocations with CLASS 1. (Alex Ionescu)
  • Implemented HeapCreateTagsW, HeapExtend, HeapQueryTagW, HeapSummary, HeapUsage. (Alex Ionescu)
  • Sync with WINE's latest Heap implementation and try to remove some of the differences we had, and also document the ones which must be kept (our support for RTL_HEAP_COMMIT_ROUTINE and usage of user/kernel-mode lock APIs, etc). This reduces the heap/alloc regression tests to only 1 issue (which I'm working on fixing). (Alex Ionescu)
  • Fix a typo in a comparison (& vs &&) which was breaking GlobalReAlloc in some cases. (Alex Ionescu)
  • Fix a missing | (OR) in GlobalAlloc which created an invalid handle if the first allocation was of size 0. (Alex Ionescu)
  • Same fixes for LocalAlloc/LocalReAlloc (Alex Ionescu)
  • Create the BNO Global and Local symbolic links in kernel32. (Alex Ionescu)
  • Make CheckRemoteDebuggerPresent fail if no process was specified. (Alex Ionescu)
  • Implement DebugActiveProcess, DebugActiveProcessStop, DebugBreakProcess, DebugSetProcessKillOnExit. (Alex Ionescu)
  • Rewrite all synch object wrappers in kernel32 to use a single unified method of implementation. (Alex Ionescu)
  • A->W converstion through static TEB buffer. (Alex Ionescu)
  • Failure if opening without a name. (Alex Ionescu)
  • Special warning code for objects that already exist (fixes some WINE test failures and probably makes a myriad of applications work). (Alex Ionescu)
  • Use BasepConvertObjectAttributes when creating an object to remove code duplication. (Alex Ionescu)
  • InitializeCrticalSectionAndSpinCount shouldn't raise an exception on failure. (Alex Ionescu)
  • Optimize WaitForMultipleObjects to cache 8 objects on the stack instead of only 3. (Alex Ionescu)
  • Define DBGSS_THREAD_DATA and DbgSsGet/SetThreadData. This is what is located in DbgSsReserved[0] (an internal high-level structure that subsystem debuggers can use for whatever purposes they need). DbgSsReserved[1] is the actual native debug object used only by DbgUi in ntdll. (Alex Ionescu)
  • Implement SaveThreadHandle, SaveProcesHandle, MarkThreadHandle, MarkProcessHandle, RemoveHandles and CloseAllProcessHandles to deal with this structure. (Alex Ionescu)
  • Call these functions when required, except for WaitForDebugEvent which will set them up once implemented. (Alex Ionescu)
  • Implement WaitForDebugEvent. Calls out to DbgUiConvertWaitStateStructure which is still unimplemented. (Alex Ionescu)

NEWDEV

SETUPAPI

USER32

  • Fix some window focus issues (Timo Kreuzer)
  • Patch from Thomas Weidenmueller for Bug #1486: Convert WM_MDICREATE messages from/to unicode
  • Fix two user mode crash for menu. Do not try reading from NULL pointer and compare the value. This increases success in user32_winetest.exe, but other user mode crashes with menu remain. (Magnus Olsen)
  • Fix the radio buttons to use the new Marlett font. (Ged Murphy)
  • Added support for selection of 32bpp icons and cursors (Ged Murphy)
  • Implement GetTabbedTextExtentA() based on Wine (Aleksey Bragin)
  • Update TEXT_TabbedTextOut from Wine (Aleksey Bragin)
  • Update other text outputting routines (Aleksey Bragin)
  • Update buttons code and more work towards easier code sharing with Wine (Aleksey Bragin)
  • Improve debugging abilities by making user32.dll using a generic way of displaying debug messages (TRACE/WARN/ERR) and adding a messages spy (Aleksey Bragin)

3rd Party Software

  • Update Zlib from 1.1.4 to 1.2.3 to fix some memory leaks (Magnus Olsen)
  • Updated DejaVu Font to Version 2.13 (Magnus Olsen)
  • Updated Buslogic Driver to Version 1.2.0.4 (see Bug #1891) (Christoph von Wittich)
  • Freetype, small speed increase, remove Freetype ROS glue C version of memcpy, memcmp, isalnum, labs and replace it from reactos string.a. We got asm version of most of them, so that is the reason to the speed increase of Freetype (Magnus Olsen)
  • Cleanup zlib and libxml2 so they consume less space in the tree (Aleksey Bragin)

FreeLdr

  • Improved Compatibility with Intel Macs (Michael Steil)
  • Patch from Colin Finck for Bug #1856: Adds the "ProcessorNameString" value to the "CentralProcessor" registry key
  • Patch from Dmitry G. Gorbachev and Magnus Olsen for Bug #1874: Patch does not use the RDMSR and WRMSR measure method, which we need for dual core and the CPU supports it. See Intel documentations AP-485. The patch is from Dmitry G. Gorbachev, detections of RTSC support for single and dual core by me, adding check if the CPU support RDMSR and WRMSR and send a true or false value to GetCpuSpeed, so we know which method we should use. Dmitry's patch should be used when it is false, otherwise we should use the RDMSR and WRMSR measure method. See Bug #1874 for more details. (Magnus Olsen)
  • Partly rewritten debug print implementation (Aleksey Bragin)
  • PE Loader Improvements: Add PE routines for traversing the import table and fixing up the imports. (Alex Ionescu)
  • PE Loader Improvements: Add routine for getting the LOADER_MODULE for a freeldr module by name. (Alex Ionescu)
  • PE Loader Improvements: Add the ability to load a not-yet-loaded-driver that's in an import entry (ie: dependencies). Only used for HAL now. (Alex Ionescu)
  • PE Loader Improvements: Map HAL in the same was as the kernel, instead of relocating it as a hack from within the kernel. (Alex Ionescu)
  • PE Loader Improvements: Refactor some routines to better share code. Don't read freed memory anymore. (Alex Ionescu)
  • PE Loader Improvements: Use LdrRelocateImageWithBias instead of quintuplicating relocation code. (Alex Ionescu)
  • PE Loader Improvements: Parse kernel and HAL imports while PE-loading from within freeldr. (Alex Ionescu)
  • Remove dozens of freeldr.c hacks from the kernel. Remove slow code which was making two copies of the parameter block and wasting over 30 KB in static strings that were immediately copied to other strings... (Alex Ionescu)
  • Don't use HalModuleObject and NtoskrnlModuleObject anymore. Remove LdrSafePEProcessModule and other similar boot-time hacks. Reimplement MmGetSystemRoutineAddress. (Alex Ionescu)
  • Change kdcom.sys to kdcom.dll. (Alex Ionescu)
  • Remove all kdcom exports and files from HAL and link with kdcom.dll instead. (Alex Ionescu)
  • Add support in freeldr for loading kdcom.dll (and theoretically any other import, such as the Code Integrity DLL for kernel-mode signing, but for now I've only tested this one). (Alex Ionescu)
  • Refactor some of the HAL loading code to make it generic for any image. (Alex Ionescu)
  • Load HAL manually when loading kernel, before processing imports, to make sure that HAL is index 1 in the loader modules and loads before KDCOM. (Alex Ionescu)

Testing

Changelogs / Versions
0.0.x Series 0.0.8 | 0.0.9 | 0.0.10 | 0.0.11 | 0.0.12 | 0.0.13 | 0.0.14 | 0.0.15 | 0.0.16 | 0.0.17 | 0.0.18 | 0.0.19 | 0.0.20 | 0.0.21
0.1.x Series 0.1.0 | 0.1.1 | 0.1.2 | 0.1.3 | 0.1.4 | 0.1.5
0.2.x Series 0.2.0 | 0.2.1 | 0.2.2 | 0.2.3 | 0.2.4 | 0.2.5 | 0.2.6 | 0.2.7 | 0.2.8 | 0.2.9
0.3.x Series 0.3.0 | 0.3.1 | 0.3.2 | 0.3.3 | 0.3.4 | 0.3.5 | 0.3.6 | 0.3.7 | 0.3.8 | 0.3.9 | 0.3.10 | 0.3.11 | 0.3.12 | 0.3.13 | 0.3.14 | 0.3.15 | 0.3.16
Personal tools
Namespaces

Variants
Actions
Navigation
Tools