Commit graph

21239 commits

Author SHA1 Message Date
Aleksey Bragin feaabba4dc Mikhail Zvyozdochkin: Fix compiling on linux (adding proper include path for halxbox)
svn path=/trunk/; revision=22784
2006-07-02 21:59:04 +00:00
Hervé Poussineau ff2f32e1fc Delete now useless code
svn path=/trunk/; revision=22782
2006-07-02 21:35:31 +00:00
Hervé Poussineau 6213ba017a Delete now useless code
svn path=/trunk/; revision=22781
2006-07-02 21:35:06 +00:00
Hervé Poussineau b4a471a78a Rename richedit to riched32 and lzexpand to lz32
svn path=/trunk/; revision=22780
2006-07-02 21:33:02 +00:00
Eric Kohl 327a05db0f Implement CM_Open_DevNode_Key and add CM_Open_DevNode_Key_Ex stub.
svn path=/trunk/; revision=22777
2006-07-02 19:20:45 +00:00
Alex Ionescu 8a2e062765 - More of the same for NtNotifyChangeDirectoryFile.
svn path=/trunk/; revision=22776
2006-07-02 19:11:26 +00:00
Alex Ionescu 363f94ff5d - NtLockFile:
- Add proper sync operation.
  - Set the APC Routine/Context in the IRP instead of ignoring them.
  - Dereference the event on failure.
  - Set the allocated buffer as AuxiliaryBuffer so the I/O manager fres it.

svn path=/trunk/; revision=22775
2006-07-02 19:01:17 +00:00
Alex Ionescu 125c2ebaac - Temporarily disable queueing IRPs to their threads, since raising to APC_LEVEL seems to cause some weird user-mode exceptions.
svn path=/trunk/; revision=22774
2006-07-02 18:47:54 +00:00
Hervé Poussineau 1dc3c727a1 Implement IopReinitializeBootDrivers, on the model of IopReinitializeDrivers
svn path=/trunk/; revision=22773
2006-07-02 18:34:21 +00:00
Alex Ionescu bd7e79620d - Move NtCancelIoFile and NtDeleteFile to file.c, they don't deal with IRPs.
- 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.
- Update NtFlushBuffersFile to new semantics (ie, usage of the new implemented functions).

svn path=/trunk/; revision=22772
2006-07-02 18:20:37 +00:00
Alex Ionescu a6a473a94d - Same changes for IoSertInformation: Lock the FO, queue the IRP, support alerted I/O, etc...
svn path=/trunk/; revision=22771
2006-07-02 16:41:49 +00:00
Alex Ionescu 588b81a0ba - Combine IoQueryVolumeInformation and IoQueryFileInformation
- 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.

svn path=/trunk/; revision=22770
2006-07-02 16:35:05 +00:00
Alex Ionescu 13ef11ff23 - Start of heavy work on iofunc.c:
- Created our new friends: IopCleanupFailedIrp, IopAbortInterruptedIrp, IopPerformSynchronousRequest, IopLockFileObject, IopUnlockFileObject, IopQueueIrpToThread, IopUpdateOperationCount.
  - 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.
- First function blessed: IopDeviceFsIoControl.
- Also simplified access rights check and fixedup some formatting.

svn path=/trunk/; revision=22769
2006-07-02 16:20:10 +00:00
Alex Ionescu fbddf0d1ac - Fix formatting of some newly added functions before starting heavy work.
svn path=/trunk/; revision=22768
2006-07-02 14:26:25 +00:00
Alex Ionescu fcb77c4c3d - 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)
- Mask out the DO_VERIFY_VOLUME flag when mounting a device.

svn path=/trunk/; revision=22767
2006-07-02 06:28:29 +00:00
Alex Ionescu 130980ccde - 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.
svn path=/trunk/; revision=22766
2006-07-02 06:18:55 +00:00
Alex Ionescu ff429eb9f3 - 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.
- 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.

svn path=/trunk/; revision=22765
2006-07-02 06:15:52 +00:00
Alex Ionescu 23be4d46c6 - 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.
- Fix a bug which was causing us to incorrectly unlock the device if it was already locked by the caller isntead of by IopMountVolume.
- 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.

svn path=/trunk/; revision=22764
2006-07-02 06:11:19 +00:00
Alex Ionescu 93454acf2b - Improve list looping to remove gotos.
- Dereference the device object in case of failure.
- Add some optimizations to quickly skip invalid raw mounting.
- Add support for VPB_RAW_MOUNT.
- Allow raw mount if this is the only device on the list.
- Make the success case go through shared exit, otherwise the device wasn't getting unlocked previously.

svn path=/trunk/; revision=22763
2006-07-02 05:52:47 +00:00
Alex Ionescu 320000e093 - If the device to be mounted is an attachee, find the base device object
- Reference the device object being mounted.
- If the file system being mounted is an atachee, find its base device object too, and increase the IRP Stack for each attached FSD.
- Fix IRP parameters with this new information.

svn path=/trunk/; revision=22762
2006-07-02 05:44:27 +00:00
Alex Ionescu e5811a1b35 - Mount the FS inline to avoid sending 6 parameters to a function only called once.
- Set the right IRP flags for a mount operation.
- Don't ignore AllowRawMount flag.
- Don't waste time passing or clearing unused flags/data on the IRP/Io Stack.

svn path=/trunk/; revision=22761
2006-07-02 05:37:55 +00:00
Alex Ionescu 2dfe23b2f6 - Respect DeviceIsLocked flag and Alertable in IopMountVolume
- Don't mount if the VPB is alread ymoutned or being removed
- Bugcheck the system if we failed to mount the boot partition.

svn path=/trunk/; revision=22760
2006-07-02 05:30:45 +00:00
Alex Ionescu e3ec87ef6d - Fix the hack in the previous commit which broke FS support.
svn path=/trunk/; revision=22759
2006-07-02 04:33:45 +00:00
Alex Ionescu 8da2913330 - Simplify/modularize FS registration by using distinct lists for each type of FS (Tape/Disk/Network/Cdrom).
- Optimize by using directly the device queue instead of allocating a structure for each FS registered.
- Hack IopMountVolume to manage this new model. Improved version coming in next patch to deal with some bugs.

svn path=/trunk/; revision=22758
2006-07-02 02:04:04 +00:00
Alex Ionescu 23e06403c7 - Get rid of the stupid LIST_FOR_EACH macros in FS Notifcation APIs.
- Each new change request should be queued at the end of the list, not at the head.
- Also, reference the device object for each registration, since one more object is holding a pointer to it, likewise, dereference the object on deregistration.
- 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.

svn path=/trunk/; revision=22757
2006-07-02 01:44:53 +00:00
Alex Ionescu fe8b3cfda1 - Implement some functions to handle VPB Referencing/Dereferencing.
- IoVerifyVolume:
  - Send the IRP to the base FSD, in case the current FSD is an attachee
  - Set correct flags in the IRP to notify that this is a mount operation using PAGING I/O semantics.
  - Don't ignore AllowRawMount parameter.
  - We want to mount the File System on *FAILURE*, not on SUCCESS!
  - Add reference/dereferencing to the VPB.

svn path=/trunk/; revision=22756
2006-07-02 01:35:45 +00:00
Alex Ionescu 042e74885b - Some small changes to some prototypes/names for upcoming functionality.
svn path=/trunk/; revision=22755
2006-07-02 01:29:12 +00:00
Alex Ionescu bc0260bc30 - Correct function name
svn path=/trunk/; revision=22754
2006-07-02 01:23:18 +00:00
Magnus Olsen b5cc6d65cd remove STYLEX DS_SHELLFONT
svn path=/trunk/; revision=22753
2006-07-02 01:11:07 +00:00
Magnus Olsen 573f5162e1 revert Revision: 22668 this change is also incorrect. now the rc file is more less okay again
svn path=/trunk/; revision=22752
2006-07-02 00:45:08 +00:00
Magnus Olsen 7d6b93dd57 revert complete wrong changes 22742
svn path=/trunk/; revision=22751
2006-07-02 00:10:13 +00:00
Magnus Olsen 766a36d23a Adding langues type (LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US) to en.rc some forget adding it. it is wrong type as well fixing it later. it should be LANG_NETURAL.
svn path=/trunk/; revision=22750
2006-07-01 23:59:33 +00:00
Alex Ionescu e7423e0ba3 [FORMATTING] - Cleanup formatting before starting to work on the file.
svn path=/trunk/; revision=22749
2006-07-01 22:47:52 +00:00
Alex Ionescu 3ea25ef417 - Add some more functions that just build IRPs to send to devices into iofunc.c from vpb.c
- Add IoCheckQuerySetvolumeInformation to util.c from vpb.c with other similar functions
- Add the actual VPB functions in vpc.c to fs.c, and rename fs.c to volume.c, because it already contained Volume APIs, and now with VPB, even more so. It also still contains the FileSystem stuff, which is of course also generically part of "volumes".
- Delete vpb.c, rename fs.c to volume.c.

svn path=/trunk/; revision=22748
2006-07-01 21:58:29 +00:00
Alex Ionescu 9bb57a0fc7 - Move efi.c to \ex, because the functions are related to environmental variables, not I/O.
- Create \wmi directory and put wmi.c, since it's the start of a large chunk of the XP+ kernel dedicated to WMI support.
- Separate \io into \iomgr and \pnpmgr

svn path=/trunk/; revision=22747
2006-07-01 21:51:06 +00:00
Alex Ionescu 6446e5f7e9 - Add definitions for additional DOE flags to NDK.
- I/O Packet APIs improvements Part 2:
  - Implement IoSetStartIoAttributes
  - 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.

svn path=/trunk/; revision=22746
2006-07-01 21:29:50 +00:00
Eric Kohl e61c9cc0d7 Enable CM_Connect_MachineW to connect to the local machine.
svn path=/trunk/; revision=22745
2006-07-01 21:01:59 +00:00
Alex Ionescu 51989fa847 - Move IopInitialize/StartDevice to PnP Manager
- I/O Packet APIs fixes Part 1:
  - Clear the current IRP before parsing the Device Queues
  - Respect Cancelable parameter in IoStartNextPacket(ByKey) instead of ignoring it (acquire the cancel lock when it's requested)
  - 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.
  - Actually handle the case where the IRP Was cancelled right after insert and the Cancel Routine has to be called.

svn path=/trunk/; revision=22744
2006-07-01 18:56:09 +00:00
Alex Ionescu 036139907e - Implement IoRegisterLastchanceShutdownNotification based on IoRegisterShutdownNotification
- Modify IoUnregisterShudownNotification to loop both lists now.
- 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).
- Moved IoSynchronousInvalidateDeviceRelations to PnP

svn path=/trunk/; revision=22743
2006-07-01 18:26:22 +00:00
Johannes Anderwald f39240e913 * DS_SHELLFONT is an style not an EXSTYLE.
svn path=/trunk/; revision=22742
2006-07-01 18:04:00 +00:00
Alex Ionescu fcb5f1cfb6 - Use IoGetDevObjExtension and STDCALL->NTAPI.
- 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.

svn path=/trunk/; revision=22741
2006-07-01 17:51:45 +00:00
Alex Ionescu 28692c3bed - Add IoGetDevObjExtension for getting the PEXTENDED_DEVOBJ_EXTENSION from a device object instead of always doing a huge typecast.
- 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.
- Simplify IoGetAttachedDEvice/IoGetAttachedDeviceReference not to use an extra stack variable.

svn path=/trunk/; revision=22740
2006-07-01 17:40:03 +00:00
Magnus Olsen 903f298c70 No change in the source code. It if only to test if new slave build server works or not
svn path=/trunk/; revision=22739
2006-07-01 12:08:35 +00:00
Johannes Anderwald c5ca23f46b move english resource code into own file
svn path=/trunk/; revision=22738
2006-07-01 09:59:38 +00:00
Saveliy Tretiakov 36e0982b7e Reduce code dublication
svn path=/trunk/; revision=22737
2006-07-01 06:52:41 +00:00
Alex Ionescu ff6b13eb13 - IopGetDevicePointer: Close the handle if we were able to acquire it.
- IoAttachDevice/IoAttachDeviceByPointer: Fail with STATUS_NO_SUCH_DEVICE if we couldn't attach.
- IoAttachDEviceTodEviceStackSafe: VPBs don't get inherited.
- IoCreateDevice: Only set OBJ_PERMAMENT if the caller requested it.
- IoCreateDevice: Return a NULL Device object if we failed to create it.
- IoCreateDevice: Set alignment requirement to 0, x86 doesn't need it.

svn path=/trunk/; revision=22736
2006-07-01 04:21:19 +00:00
Alex Ionescu 7a5dbe8152 [FORMATTING] - Fix STDCALL->NTAPI and some other commenting/formatting issues.
[AUDIT] - File doesn't even have a function over 3 lines long, no reason to lock it.

svn path=/trunk/; revision=22735
2006-07-01 03:45:00 +00:00
Alex Ionescu c31f4054ec - Add some missing IO_ERROR definitions to the DDK and add some tags
- Fix IoSetThreadHardErrorMode... it was reading the TEB instead of the PETHREAD.
- 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.
- Log Entries can have Device AND/OR Driver Objects, not just a single one. They must also be referenced/dereferenced on allocation/free.
- 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.

svn path=/trunk/; revision=22734
2006-07-01 03:36:15 +00:00
Magnus Olsen 3f9f57f91e 1. revert my last changes to this file
2. Did solv the heapfree null check with if statement

svn path=/trunk/; revision=22733
2006-06-30 22:26:19 +00:00
Magnus Olsen 11963867d1 CreateServiceA
1. Do not try todo HeapFree when pointer is NULL in cleanup:
2. Remove goto cleanup code
3. Rewrote the code so it does not need goto 

 

svn path=/trunk/; revision=22732
2006-06-30 22:07:54 +00:00