Commit graph

21465 commits

Author SHA1 Message Date
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
Hervé Poussineau a05350a500 - Simplify GetFileExt
svn path=/trunk/; revision=22731
2006-06-30 21:54:25 +00:00
Hervé Poussineau 1d4a994372 Pass the correct object type and desired access to ObOpenObjectByName
svn path=/trunk/; revision=22730
2006-06-30 21:49:12 +00:00
Hervé Poussineau 5179858da1 Use ObOpenObjectByPointer instead of creating ourselves the IRP_MJ_CREATE/CLEANUP/CLOSE IRPs
svn path=/trunk/; revision=22729
2006-06-30 21:47:42 +00:00
Hervé Poussineau f8b990739a In ObOpenObjectByPointer, always pass right mapping to SeCreateAccessState, instead of relying on a optional/incorrect parameter
svn path=/trunk/; revision=22728
2006-06-30 21:34:53 +00:00
Alex Ionescu d3ccc7eb41 - Better organize some APIs that were a bit all over the place. No code/formatting changes.
svn path=/trunk/; revision=22727
2006-06-30 19:37:45 +00:00
Alex Ionescu dec64724df [AUDIT] - These are yet more < 10 line wrappers.
[FORMATTING] - Fixup file headers, formatting and some comments.

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

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

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

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

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

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

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


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

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

svn path=/trunk/; revision=22707
2006-06-30 04:46:53 +00:00