[ros-kernel] Little Patch
Waldo Alvarez Cañizares
wac at lab.matcom.uh.cu
Thu Feb 12 13:23:34 CET 2004
Hi Vizzini:
________________________________
From: ros-kernel-bounces at reactos.com on behalf of Vizzini
Sent: Wed 2/11/2004 5:46 PM
To: ReactOS Kernel List
Subject: Re: [ros-kernel] Little Patch
On Wed, 2004-02-11 at 15:52, Waldo Alvarez Cañizares wrote:
> Hi guys:
>
> This is a little patch to avoid CreateIoDevice from making requests of size 0 to the non-paged pool when DeviceExtension is not used by drivers. I have seen that request with size 0 to ExAllocatePoolWithTag from somewhere too, win32k I think, I still have to investigate from where it is coming. There is a call to deallocate a block at address 0 too.
Waldo,
Thanks for the patch. A couple of quick points:
1) no patch attached
2) winmail.dat attached (i hate those!)
Sorry, is not my fault. Sh.. I already hate this server. I talked with my admins already so probably they fix it soon. I think next time I'm going to put the diff in the body of the message. Is that OK?
3) please diff against current cvs if you want someone like me to commit
it for you.
Ok. I'll do it that way, but usually I do not have too much time on the internet and downloading snapshots > 10 Mb is not something you can do frequently. Ok this is what i'm going to do. I'll check the web CVS interface to see if the file changed. Well 8 Weeks ago, Feb 12 2004 - Dec 15 2003 is about 8 Weeks. Lots of chances that it is the same version. I'll try to download an snapshot today to get in sync.
4) Use diff -u (don't know if you did or not; just a preemptive warning)
I saw Eric complaint about it so I did it that way. Thanks anyway. What I would like to know is where should I position the directories. I'm still learning to use diff.
-Vizzini
Just in case it wans't modified here it is:
Regards
Waldo
-------------------> cut here <-----------------------------
--- reactos\ntoskrnl\io\device.c Mon Dec 15 12:50:24 2003
+++ ros\ntoskrnl\io\device.c Wed Feb 11 12:47:44 2004
@@ -701,21 +701,26 @@
CreatedDeviceObject->CurrentIrp = NULL;
CreatedDeviceObject->Flags = 0;
- CreatedDeviceObject->DeviceExtension =
+ if (DeviceExtensionSize > 0)
+ {
+ CreatedDeviceObject->DeviceExtension =
ExAllocatePoolWithTag(NonPagedPool, DeviceExtensionSize,
TAG_DEVICE_EXTENSION);
- if (DeviceExtensionSize > 0 && CreatedDeviceObject->DeviceExtension == NULL)
+
+ if (CreatedDeviceObject->DeviceExtension == NULL)
{
ExFreePool(CreatedDeviceObject);
DPRINT("IoCreateDevice() ExAllocatePoolWithTag failed, returning: 0x%08X\n", STATUS_INSUFFICIENT_RESOURCES);
return(STATUS_INSUFFICIENT_RESOURCES);
}
- if (DeviceExtensionSize > 0)
- {
- RtlZeroMemory(CreatedDeviceObject->DeviceExtension,
- DeviceExtensionSize);
- }
+ RtlZeroMemory(CreatedDeviceObject->DeviceExtension,
+ DeviceExtensionSize);
+ }
+ else
+ {
+ CreatedDeviceObject->DeviceExtension = NULL;
+ }
CreatedDeviceObject->AttachedDevice = NULL;
CreatedDeviceObject->DeviceType = DeviceType;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 6254 bytes
Desc: not available
Url : http://reactos.com:8080/pipermail/ros-kernel/attachments/20040212/90af8f8e/attachment.bin
More information about the Ros-kernel
mailing list