Author: sir_richard
Date: Sat Oct 16 15:48:42 2010
New Revision: 49172
URL: http://svn.reactos.org/svn/reactos?rev=49172&view=rev
Log:
!!! The previous commit message had a typo, these are the Windows XP DDK Samples, not the Server 2003 DDK samples !!!
[CLASSPNP/CDROM_NEW]: Remove useless files.
Removed:
trunk/reactos/drivers/storage/class/cdrom_new/sources
trunk/reactos/drivers/storage/classpnp/sources
Removed: trunk/reactos/drivers/storage/class/cdrom_new/sources
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/class/cdro…
==============================================================================
--- trunk/reactos/drivers/storage/class/cdrom_new/sources [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/class/cdrom_new/sources (removed)
@@ -1,32 +1,0 @@
-!IF 0
-
-Copyright (C) Microsoft Corporation, 1996 - 1999
-
-Module Name:
-
- sources.
-
-!ENDIF
-
-TARGETNAME=cdrom
-TARGETPATH=obj
-TARGETTYPE=DRIVER
-
-TARGETLIBS=\
- $(DDK_LIB_PATH)\classpnp.lib \
- $(DDK_LIB_PATH)\ntoskrnl.lib
-
-INCLUDES=..\inc;..\..\inc
-
-SOURCES=\
- data.c \
- cdrom.c \
- ioctl.c \
- mmc.c \
- scsicdrm.rc \
- sec.c
-
-RUN_WPP=$(SOURCES)\
- -km\
- -func:TraceLog((LEVEL,MSG,...))
-
Removed: trunk/reactos/drivers/storage/classpnp/sources
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/classpnp/s…
==============================================================================
--- trunk/reactos/drivers/storage/classpnp/sources [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/classpnp/sources (removed)
@@ -1,85 +1,0 @@
-!IF 0
-
-Copyright (C) Microsoft Corporation, 1996 - 1999
-
-Module Name:
-
- sources.
-
-!ENDIF
-
-TARGETNAME=classpnp
-TARGETPATH=obj
-TARGETTYPE=EXPORT_DRIVER
-
-!IFNDEF MSC_WARNING_LEVEL
-MSC_WARNING_LEVEL=/W3
-!ENDIF
-
-MSC_WARNING_LEVEL=$(MSC_WARNING_LEVEL) /WX
-
-PASS1_PUBLISH={$(O)\classpnp.lib=$(DDK_LIB_PATH)\classpnp.lib}
-
-INCLUDES=..\inc;..\..\inc
-
-#
-# Specify whether to break into the debugger if synchronous irps
-# sent via ClassSendSrbSynchronous() do not complete within the
-# given timeout period
-#
-C_DEFINES=$(C_DEFINES) -DCLASS_GLOBAL_BREAK_ON_LOST_IRPS=0
-
-#
-# Specifies the number of seconds for breaking for above
-# Implementation details are within the source.
-#
-C_DEFINES=$(C_DEFINES) -DCLASS_GLOBAL_SECONDS_TO_WAIT_FOR_SYNCHRONOUS_SRB=100
-
-#
-# Specifies that retried requests shall be delayed as
-# specified by ClassInterpretSenseInfo().
-# Implementation details are within the source.
-#
-C_DEFINES=$(C_DEFINES) -DCLASS_GLOBAL_USE_DELAYED_RETRY=1
-
-#
-# You can enable buffering of debug prints to a global buffer by setting
-# this to 1. This allows debug prints while tracking timing issues.
-# Implementation details are within the source.
-#
-C_DEFINES=$(C_DEFINES) -DCLASS_GLOBAL_BUFFERED_DEBUG_PRINT=0
-
-#
-# This is the maximum size for each debug print string sent to DebugPrint(()),
-# including the trailing NUL character.
-# Implementation details are within the source.
-#
-C_DEFINES=$(C_DEFINES) -DCLASS_GLOBAL_BUFFERED_DEBUG_PRINT_BUFFER_SIZE=512
-
-#
-# This is the number of unique buffers allocated for buffered printing.
-# Implementation details are within the source.
-#
-C_DEFINES=$(C_DEFINES) -DCLASS_GLOBAL_BUFFERED_DEBUG_PRINT_BUFFERS=512
-
-
-SOURCES=autorun.c \
- class.c \
- classwmi.c \
- create.c \
- data.c \
- dictlib.c \
- lock.c \
- power.c \
- xferpkt.c \
- clntirp.c \
- retry.c \
- utils.c \
- obsolete.c \
- debug.c \
- class.rc
-
-DLLDEF=$(O)\class.def
-
-
-
Author: sir_richard
Date: Sat Oct 16 14:20:30 2010
New Revision: 49169
URL: http://svn.reactos.org/svn/reactos?rev=49169&view=rev
Log:
[RTL]: Fix a bug introduced Mon Dec 6 00:25:14 1999 UTC (10 years, 10 months ago) in revision 828. NtFreeVirtualMemory takes a pointer to the address to free, not the address instead. For the last 11 years, freeing the process parameter block resulted in freeing whatever the first value in the structure is, which is MaximumLength and initialized to 0x1000. ReactOS would then free whatever random address was in that area. In real Windows, it is illegal to free an allocation in the middle of the base address, and this call failed with the new VAD code. ReactOS either leaked the memory or freed random data, who knows.
[RTL]: Make the PPB live in the Heap instead of having its own virtual allocation, fixing the issue above. Stop rounding it to a PAGE_SIZE, and just use the space required.
Modified:
trunk/reactos/lib/rtl/ppb.c
Modified: trunk/reactos/lib/rtl/ppb.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/ppb.c?rev=49169&r1…
==============================================================================
--- trunk/reactos/lib/rtl/ppb.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/ppb.c [iso-8859-1] Sat Oct 16 14:20:30 2010
@@ -53,9 +53,7 @@
PUNICODE_STRING ShellInfo,
PUNICODE_STRING RuntimeData)
{
- NTSTATUS Status = STATUS_SUCCESS;
PRTL_USER_PROCESS_PARAMETERS Param = NULL;
- SIZE_T RegionSize = 0;
ULONG Length = 0;
PWCHAR Dest;
UNICODE_STRING EmptyString;
@@ -121,23 +119,16 @@
Length += ALIGN(RuntimeData->MaximumLength, sizeof(ULONG));
/* Calculate the required block size */
- RegionSize = ROUND_UP(Length, PAGE_SIZE);
-
- Status = ZwAllocateVirtualMemory(NtCurrentProcess(),
- (PVOID*)&Param,
- 0,
- &RegionSize,
- MEM_RESERVE | MEM_COMMIT,
- PAGE_READWRITE);
- if (!NT_SUCCESS(Status))
+ Param = RtlAllocateHeap(RtlGetProcessHeap(), 0, Length);
+ if (!Param)
{
RtlReleasePebLock();
- return Status;
+ return STATUS_INSUFFICIENT_RESOURCES;
}
DPRINT ("Process parameters allocated\n");
- Param->MaximumLength = RegionSize;
+ Param->MaximumLength = Length;
Param->Length = Length;
Param->Flags = RTL_USER_PROCESS_PARAMETERS_NORMALIZED;
Param->Environment = Environment;
@@ -219,15 +210,12 @@
/*
* @implemented
*/
-NTSTATUS NTAPI
-RtlDestroyProcessParameters(PRTL_USER_PROCESS_PARAMETERS ProcessParameters)
-{
- SIZE_T RegionSize = 0;
-
- return ZwFreeVirtualMemory (NtCurrentProcess (),
- (PVOID)ProcessParameters,
- &RegionSize,
- MEM_RELEASE);
+NTSTATUS
+NTAPI
+RtlDestroyProcessParameters(IN PRTL_USER_PROCESS_PARAMETERS ProcessParameters)
+{
+ RtlFreeHeap(RtlGetProcessHeap(), 0, ProcessParameters);
+ return STATUS_SUCCESS;
}
/*