ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
November 2009
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
23 participants
444 discussions
Start a n
N
ew thread
[cgutman] 44266: - Remove memtrack and use tags instead (ExAllocatePoolWithTag/ExFreePoolWithTag) - Cleanup DriverEntry - Remove DEFINE_TAG - Remove checkpoints in TiCreateFileObject
by cgutman@svn.reactos.org
Author: cgutman Date: Sun Nov 22 00:53:43 2009 New Revision: 44266 URL:
http://svn.reactos.org/svn/reactos?rev=44266&view=rev
Log: - Remove memtrack and use tags instead (ExAllocatePoolWithTag/ExFreePoolWithTag) - Cleanup DriverEntry - Remove DEFINE_TAG - Remove checkpoints in TiCreateFileObject Added: trunk/reactos/drivers/network/tcpip/include/tags.h (with props) Removed: trunk/reactos/drivers/network/tcpip/include/irp.h trunk/reactos/drivers/network/tcpip/include/memtrack.h trunk/reactos/drivers/network/tcpip/tcpip/irp.c trunk/reactos/lib/drivers/ip/network/memtrack.c trunk/reactos/lib/drivers/oskittcp/include/memtrack.h Modified: trunk/reactos/drivers/network/tcpip/datalink/lan.c trunk/reactos/drivers/network/tcpip/include/address.h trunk/reactos/drivers/network/tcpip/include/debug.h trunk/reactos/drivers/network/tcpip/include/dispatch.h trunk/reactos/drivers/network/tcpip/include/ip.h trunk/reactos/drivers/network/tcpip/include/neighbor.h trunk/reactos/drivers/network/tcpip/include/precomp.h trunk/reactos/drivers/network/tcpip/include/routines.h trunk/reactos/drivers/network/tcpip/include/titypes.h trunk/reactos/drivers/network/tcpip/tcpip.rbuild trunk/reactos/drivers/network/tcpip/tcpip/buffer.c trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c trunk/reactos/drivers/network/tcpip/tcpip/fileobjs.c trunk/reactos/drivers/network/tcpip/tcpip/iinfo.c trunk/reactos/drivers/network/tcpip/tcpip/main.c trunk/reactos/drivers/network/tcpip/tcpip/ninfo.c trunk/reactos/lib/drivers/ip/ip.rbuild trunk/reactos/lib/drivers/ip/network/address.c trunk/reactos/lib/drivers/ip/network/ip.c trunk/reactos/lib/drivers/ip/network/neighbor.c trunk/reactos/lib/drivers/ip/network/ports.c trunk/reactos/lib/drivers/ip/network/receive.c trunk/reactos/lib/drivers/ip/network/router.c trunk/reactos/lib/drivers/ip/network/routines.c trunk/reactos/lib/drivers/ip/network/transmit.c trunk/reactos/lib/drivers/ip/transport/datagram/datagram.c trunk/reactos/lib/drivers/ip/transport/tcp/accept.c trunk/reactos/lib/drivers/ip/transport/tcp/event.c trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c Modified: trunk/reactos/drivers/network/tcpip/datalink/lan.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/data…
============================================================================== --- trunk/reactos/drivers/network/tcpip/datalink/lan.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/datalink/lan.c [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -108,7 +108,7 @@ * Adapter = Pointer to LAN_ADAPTER structure to free */ { - exFreePool(Adapter); + ExFreePoolWithTag(Adapter, LAN_ADAPTER_TAG); } @@ -249,7 +249,7 @@ Adapter = WorkItem->Adapter; BytesTransferred = WorkItem->BytesTransferred; - exFreePool(WorkItem); + ExFreePoolWithTag(WorkItem, WQ_CONTEXT_TAG); IPInitializePacket(&IPPacket, 0); @@ -300,7 +300,8 @@ PNDIS_PACKET Packet, NDIS_STATUS Status, UINT BytesTransferred) { - PLAN_WQ_ITEM WQItem = exAllocatePool(NonPagedPool, sizeof(LAN_WQ_ITEM)); + PLAN_WQ_ITEM WQItem = ExAllocatePoolWithTag(NonPagedPool, sizeof(LAN_WQ_ITEM), + WQ_CONTEXT_TAG); PLAN_ADAPTER Adapter = (PLAN_ADAPTER)BindingContext; TI_DbgPrint(DEBUG_DATALINK,("called\n")); @@ -312,7 +313,7 @@ WQItem->BytesTransferred = BytesTransferred; if (!ChewCreate( LanReceiveWorker, WQItem )) - exFreePool(WQItem); + ExFreePoolWithTag(WQItem, WQ_CONTEXT_TAG); } VOID NTAPI ProtocolTransferDataComplete( @@ -768,9 +769,9 @@ BOOLEAN Deallocate) { NTSTATUS Status; UNICODE_STRING Ustr = *ResultFirst; - PWSTR new_string = ExAllocatePoolWithTag + PWSTR new_string = ExAllocatePool (PagedPool, - (ResultFirst->Length + Second->Length + sizeof(WCHAR)), TAG_STRING); + (ResultFirst->Length + Second->Length + sizeof(WCHAR))); if( !new_string ) { return STATUS_NO_MEMORY; } @@ -1087,7 +1088,7 @@ TI_DbgPrint(DEBUG_DATALINK, ("Called.\n")); - IF = exAllocatePool(NonPagedPool, sizeof(LAN_ADAPTER)); + IF = ExAllocatePoolWithTag(NonPagedPool, sizeof(LAN_ADAPTER), LAN_ADAPTER_TAG); if (!IF) { TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); return NDIS_STATUS_RESOURCES; @@ -1125,7 +1126,7 @@ KeWaitForSingleObject(&IF->Event, UserRequest, KernelMode, FALSE, NULL); else if (NdisStatus != NDIS_STATUS_SUCCESS) { TI_DbgPrint(DEBUG_DATALINK,("denying adapter %wZ\n", AdapterName)); - exFreePool(IF); + ExFreePoolWithTag(IF, LAN_ADAPTER_TAG); return NdisStatus; } @@ -1150,7 +1151,7 @@ default: /* Unsupported media */ TI_DbgPrint(MIN_TRACE, ("Unsupported media.\n")); - exFreePool(IF); + ExFreePoolWithTag(IF, LAN_ADAPTER_TAG); return NDIS_STATUS_NOT_SUPPORTED; } @@ -1162,7 +1163,7 @@ sizeof(UINT)); if (NdisStatus != NDIS_STATUS_SUCCESS) { TI_DbgPrint(DEBUG_DATALINK,("denying adapter %wZ (NDISCall)\n", AdapterName)); - exFreePool(IF); + ExFreePoolWithTag(IF, LAN_ADAPTER_TAG); return NdisStatus; } @@ -1174,7 +1175,7 @@ sizeof(UINT)); if (NdisStatus != NDIS_STATUS_SUCCESS) { TI_DbgPrint(MIN_TRACE, ("Query for maximum packet size failed.\n")); - exFreePool(IF); + ExFreePoolWithTag(IF, LAN_ADAPTER_TAG); return NdisStatus; } @@ -1197,7 +1198,7 @@ IF->HWAddressLength); if (NdisStatus != NDIS_STATUS_SUCCESS) { TI_DbgPrint(MIN_TRACE, ("Query for current hardware address failed.\n")); - exFreePool(IF); + ExFreePoolWithTag(IF, LAN_ADAPTER_TAG); return NdisStatus; } @@ -1209,7 +1210,7 @@ sizeof(UINT)); if (NdisStatus != NDIS_STATUS_SUCCESS) { TI_DbgPrint(MIN_TRACE, ("Query for maximum link speed failed.\n")); - exFreePool(IF); + ExFreePoolWithTag(IF, LAN_ADAPTER_TAG); return NdisStatus; } @@ -1219,7 +1220,7 @@ /* Bind adapter to IP layer */ if( !BindAdapter(IF, RegistryPath) ) { TI_DbgPrint(DEBUG_DATALINK,("denying adapter %wZ (BindAdapter)\n", AdapterName)); - exFreePool(IF); + ExFreePoolWithTag(IF, LAN_ADAPTER_TAG); return NDIS_STATUS_NOT_ACCEPTED; } Modified: trunk/reactos/drivers/network/tcpip/include/address.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/incl…
============================================================================== --- trunk/reactos/drivers/network/tcpip/include/address.h [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/include/address.h [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -15,7 +15,6 @@ */ #define AddrInitIPv4(IPAddress, RawAddress) \ { \ - INIT_TAG((IPAddress), '4VPI'); \ (IPAddress)->Type = IP_ADDRESS_V4; \ (IPAddress)->Address.IPv4Address = (RawAddress); \ } Modified: trunk/reactos/drivers/network/tcpip/include/debug.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/incl…
============================================================================== --- trunk/reactos/drivers/network/tcpip/include/debug.h [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/include/debug.h [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -71,8 +71,6 @@ #define CP CHECKPOINT -#include <memtrack.h> - #define ASSERT_KM_POINTER(_x) \ ASSERT(((PVOID)_x) != (PVOID)0xcccccccc); \ ASSERT(((PVOID)_x) >= (PVOID)0x80000000); Modified: trunk/reactos/drivers/network/tcpip/include/dispatch.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/incl…
============================================================================== --- trunk/reactos/drivers/network/tcpip/include/dispatch.h [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/include/dispatch.h [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -72,6 +72,8 @@ VOID DispDoDisconnect( PVOID Data); +NTSTATUS IRPFinish( PIRP Irp, NTSTATUS Status ); + #endif /* __DISPATCH_H */ /* EOF */ Modified: trunk/reactos/drivers/network/tcpip/include/ip.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/incl…
============================================================================== --- trunk/reactos/drivers/network/tcpip/include/ip.h [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/include/ip.h [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -21,7 +21,6 @@ /* IP style address */ typedef struct IP_ADDRESS { - DEFINE_TAG UCHAR Type; /* Type of IP address */ union { IPv4_RAW_ADDRESS IPv4Address;/* IPv4 address (in network byte order) */ @@ -76,7 +75,6 @@ /* Structure for an IP packet */ typedef struct _IP_PACKET { - DEFINE_TAG OBJECT_FREE_ROUTINE Free; /* Routine used to free resources for the object */ UCHAR Type; /* Type of IP packet (see IP_ADDRESS_xx above) */ UCHAR Flags; /* Flags for packet (see IP_PACKET_FLAG_xx below)*/ @@ -150,7 +148,6 @@ /* Information about an IP interface */ typedef struct _IP_INTERFACE { - DEFINE_TAG LIST_ENTRY ListEntry; /* Entry on list */ OBJECT_FREE_ROUTINE Free; /* Routine used to free resources used by the object */ KSPIN_LOCK Lock; /* Spin lock for this object */ Removed: trunk/reactos/drivers/network/tcpip/include/irp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/incl…
============================================================================== --- trunk/reactos/drivers/network/tcpip/include/irp.h [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/include/irp.h (removed) @@ -1,13 +1,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS TCP/IP protocol driver - * FILE: include/irp.h - * PURPOSE: IRP routines - */ -#ifndef __IRP_H -#define __IRP_H - -VOID IRPRemember( PIRP Irp, PCHAR File, UINT Line ); -NTSTATUS IRPFinish( PIRP Irp, NTSTATUS Status ); - -#endif/*__IRP_H*/ Removed: trunk/reactos/drivers/network/tcpip/include/memtrack.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/incl…
============================================================================== --- trunk/reactos/drivers/network/tcpip/include/memtrack.h [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/include/memtrack.h (removed) @@ -1,79 +1,0 @@ -#ifndef MEMTRACK_H -#define MEMTRACK_H - -#include <pool.h> - -#ifndef FOURCC -#define FOURCC(a,b,c,d) (((a)<<24)|((b)<<16)|((c)<<8)|(d)) -#endif - -#define FBSD_MALLOC FOURCC('d','s','b','f') -#define EXALLOC_TAG FOURCC('E','x','A','l') -#define IRP_TAG FOURCC('P','I','R','P') -#define NPLOOK_TAG FOURCC('N','P','L','A') - -#define AllocatePacketWithBuffer(x,y,z) AllocatePacketWithBufferX(x,y,z,__FILE__,__LINE__) -#define FreeNdisPacket(x) FreeNdisPacketX(x,__FILE__,__LINE__) - -#if DBG -#define MTMARK() TrackDumpFL(__FILE__, __LINE__) -#define exAllocatePool(x,y) ExAllocatePoolX(x,y,__FILE__,__LINE__) -#define exAllocatePoolWithTag(x,y,z) ExAllocatePoolX(x,y,__FILE__,__LINE__) -#define exFreePool(x) ExFreePoolX(x,__FILE__,__LINE__) -#define exAllocateFromNPagedLookasideList(x) ExAllocateFromNPagedLookasideListX(x,__FILE__,__LINE__) -#define exFreeToNPagedLookasideList(x,y) ExFreeToNPagedLookasideListX(x,y,__FILE__,__LINE__) - -typedef struct _ALLOCATION_TRACKER { - LIST_ENTRY Entry; - ULONG Tag; - PVOID Thing; - PCHAR FileName; - ULONG LineNo; -} ALLOCATION_TRACKER, *PALLOCATION_TRACKER; - -VOID TrackingInit(); -VOID TrackWithTag( ULONG Tag, PVOID Thing, PCHAR File, ULONG Line ); -#define Track(Tag,Thing) TrackWithTag(Tag,Thing,__FILE__,__LINE__) -VOID UntrackFL( PCHAR File, ULONG Line, PVOID Thing, ULONG Tag ); -#define Untrack(Thing) UntrackFL(__FILE__,__LINE__,Thing) -VOID TrackDumpFL( PCHAR File, ULONG Line ); -#define TrackDump() TrackDumpFL(__FILE__,__LINE__) - -static __inline PVOID ExAllocateFromNPagedLookasideListX( PNPAGED_LOOKASIDE_LIST List, PCHAR File, ULONG Line ) { - PVOID Out = ExAllocateFromNPagedLookasideList( List ); - if( Out ) TrackWithTag( NPLOOK_TAG, Out, File, Line ); - return Out; -} - -static __inline VOID ExFreeToNPagedLookasideListX( PNPAGED_LOOKASIDE_LIST List, PVOID Thing, PCHAR File, ULONG Line ) { - UntrackFL(File, Line, Thing, NPLOOK_TAG); - ExFreeToNPagedLookasideList( List, Thing ); -} - -static __inline PVOID ExAllocatePoolX( POOL_TYPE type, SIZE_T size, PCHAR File, ULONG Line ) { - PVOID Out = ExAllocatePool( type, size ); - if( Out ) TrackWithTag( EXALLOC_TAG, Out, File, Line ); - return Out; -} - -static __inline VOID ExFreePoolX( PVOID Data, PCHAR File, ULONG Line ) { - UntrackFL(File, Line, Data, EXALLOC_TAG); - ExFreePool( Data ); -} - -#else -#define MTMARK() -#define Track(x,y) -#define TrackingInit() -#define TrackDump() -#define Untrack(x) -#define exAllocatePoolWithTag(x,y,z) ExAllocatePoolWithTag(x,y,z) -#define exAllocatePool(x,y) ExAllocatePool(x,y) -#define exFreePool(x) ExFreePool(x) -#define exAllocateFromNPagedLookasideList(x) ExAllocateFromNPagedLookasideList(x) -#define exFreeToNPagedLookasideList(x,y) ExFreeToNPagedLookasideList(x,y) -#define TrackWithTag(w,x,y,z) -#define UntrackFL(w,x,y,z) -#endif - -#endif/*MEMMTRAC_H*/ Modified: trunk/reactos/drivers/network/tcpip/include/neighbor.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/incl…
============================================================================== --- trunk/reactos/drivers/network/tcpip/include/neighbor.h [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/include/neighbor.h [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -27,7 +27,6 @@ /* Information about a neighbor */ typedef struct NEIGHBOR_CACHE_ENTRY { - DEFINE_TAG struct NEIGHBOR_CACHE_ENTRY *Next; /* Pointer to next entry */ UCHAR State; /* State of NCE */ UINT EventTimer; /* Ticks since last event */ Modified: trunk/reactos/drivers/network/tcpip/include/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/incl…
============================================================================== --- trunk/reactos/drivers/network/tcpip/include/precomp.h [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/include/precomp.h [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -1,6 +1,7 @@ #include <limits.h> #include <ntddk.h> #include <ntifs.h> +#include <tags.h> #include <tdi.h> #include <tdistat.h> #include <tcpip.h> @@ -23,13 +24,11 @@ #include <udp.h> #include <tcp.h> #include <arp.h> -#include <irp.h> #include <tilists.h> #include <dispatch.h> #include <fileobjs.h> #include <lock.h> #include <wait.h> -#include <memtrack.h> #include <oskittcp.h> #include <interface.h> #include <ports.h> Modified: trunk/reactos/drivers/network/tcpip/include/routines.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/incl…
============================================================================== --- trunk/reactos/drivers/network/tcpip/include/routines.h [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/include/routines.h [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -49,9 +49,10 @@ PNDIS_PACKET Packet, UINT Size); -NDIS_STATUS AllocatePacketWithBufferX( PNDIS_PACKET *NdisPacket, - PCHAR Data, UINT Len, - PCHAR File, UINT Line ); +NDIS_STATUS AllocatePacketWithBuffer( PNDIS_PACKET *NdisPacket, + PCHAR Data, UINT Len ); + +VOID FreeNdisPacket( PNDIS_PACKET Packet ); void GetDataPtr( PNDIS_PACKET Packet, UINT Offset, Added: trunk/reactos/drivers/network/tcpip/include/tags.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/incl…
============================================================================== --- trunk/reactos/drivers/network/tcpip/include/tags.h (added) +++ trunk/reactos/drivers/network/tcpip/include/tags.h [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -1,0 +1,39 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS TCP/IP protocol driver + * FILE: include/tags.h + * PURPOSE: Memory tags + */ +#ifndef __TAGS_H +#define __TAGS_H + +#define CONN_ENDPT_TAG 'pEnC' +#define ADDR_FILE_TAG 'FrdA' +#define CONTROL_CHANNEL_TAG 'CnoC' +#define TRANS_CONTEXT_TAG 'noCT' +#define TDI_ENTITY_TAG 'EidT' +#define DATAGRAM_SEND_TAG 'StaD' +#define DATAGRAM_RECV_TAG 'RtaD' +#define QUERY_CONTEXT_TAG 'noCQ' +#define IP_ADDRESS_TAG 'dAPI' +#define IP_INTERFACE_TAG 'FIPI' +#define DATAGRAM_REASSEMBLY_TAG 'RDPI' +#define DATAGRAM_FRAGMENT_TAG 'GFPI' +#define DATAGRAM_HOLE_TAG 'LHPI' +#define OSKITTCP_CONTEXT_TAG 'TKSO' +#define NEIGHBOR_PACKET_TAG 'kPbN' +#define NCE_TAG ' ECN' +#define PORT_SET_TAG 'teSP' +#define PACKET_BUFFER_TAG 'fuBP' +#define FRAGMENT_DATA_TAG 'taDF' +#define FIB_TAG ' BIF' +#define IFC_TAG ' CFI' +#define TDI_BUCKET_TAG 'BidT' +#define FBSD_TAG 'DSBF' +#define OSK_OTHER_TAG 'OKSO' +#define OSK_LARGE_TAG 'LKSO' +#define OSK_SMALL_TAG 'SKSO' +#define LAN_ADAPTER_TAG ' NAL' +#define WQ_CONTEXT_TAG 'noCW' + +#endif Propchange: trunk/reactos/drivers/network/tcpip/include/tags.h ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/drivers/network/tcpip/include/titypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/incl…
============================================================================== --- trunk/reactos/drivers/network/tcpip/include/titypes.h [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/include/titypes.h [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -9,10 +9,6 @@ #if DBG - -#define DEFINE_TAG ULONG Tag; -#define INIT_TAG(_Object, _Tag) \ - ((_Object)->Tag = (_Tag)) #define DEBUG_REFCHECK(Object) { \ if ((Object)->RefCount <= 0) { \ @@ -64,9 +60,6 @@ #else /* DBG */ -#define DEFINE_TAG -#define INIT_TAG(Object, Tag) - /* * VOID ReferenceObject( * PVOID Object) @@ -149,7 +142,6 @@ /* Transport address file context structure. The FileObject->FsContext2 field holds a pointer to this structure */ typedef struct _ADDRESS_FILE { - DEFINE_TAG LIST_ENTRY ListEntry; /* Entry on list */ KSPIN_LOCK Lock; /* Spin lock to manipulate this structure */ OBJECT_FREE_ROUTINE Free; /* Routine to use to free resources for the object */ Modified: trunk/reactos/drivers/network/tcpip/tcpip.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
============================================================================== --- trunk/reactos/drivers/network/tcpip/tcpip.rbuild [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/tcpip.rbuild [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -28,7 +28,6 @@ <file>fileobjs.c</file> <file>iinfo.c</file> <file>info.c</file> - <file>irp.c</file> <file>lock.c</file> <file>main.c</file> <file>ninfo.c</file> Modified: trunk/reactos/drivers/network/tcpip/tcpip/buffer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
============================================================================== --- trunk/reactos/drivers/network/tcpip/tcpip/buffer.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/tcpip/buffer.c [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -318,13 +318,16 @@ PCHAR NewBuf; if( Copy ) { - NewBuf = exAllocatePool( NonPagedPool, Length ); + NewBuf = ExAllocatePoolWithTag( NonPagedPool, Length, PACKET_BUFFER_TAG ); if( !NewBuf ) return NDIS_STATUS_RESOURCES; RtlCopyMemory( NewBuf, Data, Length ); } else NewBuf = Data; NdisAllocateBuffer( &Status, &Buffer, GlobalBufferPool, NewBuf, Length ); - if( Status != NDIS_STATUS_SUCCESS ) return Status; + if( Status != NDIS_STATUS_SUCCESS ) { + if (Copy) ExFreePoolWithTag(NewBuf, PACKET_BUFFER_TAG); + return Status; + } NdisChainBufferAtFront( Packet, Buffer ); @@ -342,33 +345,30 @@ SkipToOffset( Buffer, Offset, DataOut, Size ); } -NDIS_STATUS AllocatePacketWithBufferX( PNDIS_PACKET *NdisPacket, - PCHAR Data, UINT Len, - PCHAR File, UINT Line ) { +NDIS_STATUS AllocatePacketWithBuffer( PNDIS_PACKET *NdisPacket, + PCHAR Data, UINT Len ) { PNDIS_PACKET Packet; PNDIS_BUFFER Buffer; NDIS_STATUS Status; PCHAR NewData; - NewData = exAllocatePool( NonPagedPool, Len ); + NewData = ExAllocatePoolWithTag( NonPagedPool, Len, PACKET_BUFFER_TAG ); if( !NewData ) return NDIS_STATUS_RESOURCES; if( Data ) RtlCopyMemory(NewData, Data, Len); NdisAllocatePacket( &Status, &Packet, GlobalPacketPool ); if( Status != NDIS_STATUS_SUCCESS ) { - exFreePool( NewData ); + ExFreePoolWithTag( NewData, PACKET_BUFFER_TAG ); return Status; } - TrackWithTag(NDIS_PACKET_TAG, Packet, File, Line); NdisAllocateBuffer( &Status, &Buffer, GlobalBufferPool, NewData, Len ); if( Status != NDIS_STATUS_SUCCESS ) { - exFreePool( NewData ); + ExFreePoolWithTag( NewData, PACKET_BUFFER_TAG ); FreeNdisPacket( Packet ); return Status; } - TrackWithTag(NDIS_BUFFER_TAG, Buffer, File, Line); NdisChainBufferAtFront( Packet, Buffer ); *NdisPacket = Packet; @@ -377,10 +377,8 @@ } -VOID FreeNdisPacketX -( PNDIS_PACKET Packet, - PCHAR File, - UINT Line ) +VOID FreeNdisPacket +( PNDIS_PACKET Packet ) /* * FUNCTION: Frees an NDIS packet * ARGUMENTS: @@ -400,13 +398,11 @@ NdisGetNextBuffer(Buffer, &NextBuffer); NdisQueryBuffer(Buffer, &Data, &Length); TI_DbgPrint(DEBUG_PBUFFER, ("Freeing ndis buffer (0x%X)\n", Buffer)); - UntrackFL(File,Line,Buffer,NDIS_BUFFER_TAG); NdisFreeBuffer(Buffer); TI_DbgPrint(DEBUG_PBUFFER, ("Freeing exal buffer (0x%X)\n", Data)); - exFreePool(Data); + ExFreePoolWithTag(Data, PACKET_BUFFER_TAG); } /* Finally free the NDIS packet discriptor */ - UntrackFL(File,Line,Packet,NDIS_PACKET_TAG); NdisFreePacket(Packet); } Modified: trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
============================================================================== --- trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -11,6 +11,25 @@ #include "precomp.h" #include <pseh/pseh2.h> + + +NTSTATUS IRPFinish( PIRP Irp, NTSTATUS Status ) { + KIRQL OldIrql; + + Irp->IoStatus.Status = Status; + + if( Status == STATUS_PENDING ) + IoMarkIrpPending( Irp ); + else { + IoAcquireCancelSpinLock(&OldIrql); + (void)IoSetCancelRoutine( Irp, NULL ); + IoReleaseCancelSpinLock(OldIrql); + + IoCompleteRequest( Irp, IO_NETWORK_INCREMENT ); + } + + return Status; +} NTSTATUS DispPrepareIrpForCancel( PTRANSPORT_CONTEXT Context, @@ -1253,7 +1272,7 @@ QueryContext->Irp->IoStatus.Information = ByteCount; QueryContext->Irp->IoStatus.Status = Status; - exFreePool(QueryContext); + ExFreePoolWithTag(QueryContext, QUERY_CONTEXT_TAG); } @@ -1316,7 +1335,7 @@ IrpSp->Parameters.DeviceIoControl.Type3InputBuffer; OutputBuffer = Irp->UserBuffer; - QueryContext = exAllocatePool(NonPagedPool, sizeof(TI_QUERY_CONTEXT)); + QueryContext = ExAllocatePoolWithTag(NonPagedPool, sizeof(TI_QUERY_CONTEXT), QUERY_CONTEXT_TAG); if (QueryContext) { _SEH2_TRY { InputMdl = IoAllocateMdl(InputBuffer, @@ -1379,7 +1398,7 @@ IoFreeMdl(OutputMdl); } - exFreePool(QueryContext); + ExFreePoolWithTag(QueryContext, QUERY_CONTEXT_TAG); } else Status = STATUS_INSUFFICIENT_RESOURCES; } else if( InputBufferLength == @@ -1392,7 +1411,7 @@ Size = 0; - QueryContext = exAllocatePool(NonPagedPool, sizeof(TI_QUERY_CONTEXT)); + QueryContext = ExAllocatePoolWithTag(NonPagedPool, sizeof(TI_QUERY_CONTEXT), QUERY_CONTEXT_TAG); if (!QueryContext) return STATUS_INSUFFICIENT_RESOURCES; _SEH2_TRY { @@ -1412,7 +1431,7 @@ if( !NT_SUCCESS(Status) || !InputMdl ) { if( InputMdl ) IoFreeMdl( InputMdl ); - exFreePool(QueryContext); + ExFreePoolWithTag(QueryContext, QUERY_CONTEXT_TAG); return Status; } Modified: trunk/reactos/drivers/network/tcpip/tcpip/fileobjs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
============================================================================== --- trunk/reactos/drivers/network/tcpip/tcpip/fileobjs.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/tcpip/fileobjs.c [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -153,7 +153,7 @@ * Object = Pointer to address file object to free */ { - exFreePool(Object); + ExFreePoolWithTag(Object, ADDR_FILE_TAG); } @@ -165,7 +165,7 @@ * Object = Pointer to address file object to free */ { - exFreePool(Object); + ExFreePoolWithTag(Object, CONTROL_CHANNEL_TAG); } @@ -189,7 +189,8 @@ TI_DbgPrint(MID_TRACE, ("Called (Proto %d).\n", Protocol)); - AddrFile = exAllocatePool(NonPagedPool, sizeof(ADDRESS_FILE)); + AddrFile = ExAllocatePoolWithTag(NonPagedPool, sizeof(ADDRESS_FILE), + ADDR_FILE_TAG); if (!AddrFile) { TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); return STATUS_INSUFFICIENT_RESOURCES; @@ -212,7 +213,7 @@ if (!AddrIsUnspecified(&AddrFile->Address) && !AddrLocateInterface(&AddrFile->Address)) { - exFreePool(AddrFile); + ExFreePoolWithTag(AddrFile, ADDR_FILE_TAG); TI_DbgPrint(MIN_TRACE, ("Non-local address given (0x%X).\n", A2S(&AddrFile->Address))); return STATUS_INVALID_PARAMETER; } @@ -230,7 +231,7 @@ AddrFile->Port != Address->Address[0].Address[0].sin_port) || AddrFile->Port == 0xffff) { - exFreePool(AddrFile); + ExFreePoolWithTag(AddrFile, ADDR_FILE_TAG); return STATUS_INVALID_PARAMETER; } @@ -248,7 +249,7 @@ AddrFile->Port != Address->Address[0].Address[0].sin_port) || AddrFile->Port == 0xffff) { - exFreePool(AddrFile); + ExFreePoolWithTag(AddrFile, ADDR_FILE_TAG); return STATUS_INVALID_PARAMETER; } @@ -346,7 +347,7 @@ while ((CurrentEntry = ExInterlockedRemoveHeadList(&AddrFile->ReceiveQueue, &AddrFile->Lock))) { ReceiveRequest = CONTAINING_RECORD(CurrentEntry, DATAGRAM_RECEIVE_REQUEST, ListEntry); (*ReceiveRequest->Complete)(ReceiveRequest->Context, STATUS_CANCELLED, 0); - /* exFreePool(ReceiveRequest); FIXME: WTF? */ + /* ExFreePoolWithTag(ReceiveRequest, DATAGRAM_RECV_TAG); FIXME: WTF? */ } TI_DbgPrint(DEBUG_ADDRFILE, ("Aborting send requests on address file at (0x%X).\n", AddrFile)); @@ -355,7 +356,7 @@ while ((CurrentEntry = ExInterlockedRemoveHeadList(&AddrFile->ReceiveQueue, &AddrFile->Lock))) { SendRequest = CONTAINING_RECORD(CurrentEntry, DATAGRAM_SEND_REQUEST, ListEntry); (*SendRequest->Complete)(SendRequest->Context, STATUS_CANCELLED, 0); - exFreePool(SendRequest); + ExFreePoolWithTag(SendRequest, DATAGRAM_SEND_TAG); } /* Protocol specific handling */ @@ -454,7 +455,8 @@ PCONTROL_CHANNEL ControlChannel; TI_DbgPrint(MID_TRACE, ("Called.\n")); - ControlChannel = exAllocatePool(NonPagedPool, sizeof(*ControlChannel)); + ControlChannel = ExAllocatePoolWithTag(NonPagedPool, sizeof(*ControlChannel), + CONTROL_CHANNEL_TAG); if (!ControlChannel) { TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); @@ -494,7 +496,7 @@ PCONTROL_CHANNEL ControlChannel = Request->Handle.ControlChannel; NTSTATUS Status = STATUS_SUCCESS; - exFreePool(ControlChannel); + ExFreePoolWithTag(ControlChannel, CONTROL_CHANNEL_TAG); Request->Handle.ControlChannel = NULL; return Status; Modified: trunk/reactos/drivers/network/tcpip/tcpip/iinfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
============================================================================== --- trunk/reactos/drivers/network/tcpip/tcpip/iinfo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/tcpip/iinfo.c [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -32,7 +32,7 @@ Interface, IF, ID.tei_entity, ID.tei_instance)); OutData = - (PIFENTRY)exAllocatePool( NonPagedPool, + (PIFENTRY)ExAllocatePool( NonPagedPool, sizeof(IFENTRY) + MAX_IFDESCR_LEN ); if( !OutData ) return TDI_NO_RESOURCES; /* Out of memory */ @@ -99,7 +99,7 @@ ID.tei_entity, ID.tei_instance, Size)); Status = InfoCopyOut( (PCHAR)OutData, Size, Buffer, BufferSize ); - exFreePool( OutData ); + ExFreePool( OutData ); TI_DbgPrint(DEBUG_INFO,("Returning %x\n", Status)); @@ -117,14 +117,14 @@ if (MemSize != 0) { - ArpEntries = exAllocatePoolWithTag( NonPagedPool, MemSize, FOURCC('A','R','P','t') ); + ArpEntries = ExAllocatePool( NonPagedPool, MemSize ); if( !ArpEntries ) return STATUS_NO_MEMORY; NBCopyNeighbors( Interface, ArpEntries ); Status = InfoCopyOut( (PVOID)ArpEntries, MemSize, Buffer, BufferSize ); - exFreePool( ArpEntries ); + ExFreePool( ArpEntries ); } else { Removed: trunk/reactos/drivers/network/tcpip/tcpip/irp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
============================================================================== --- trunk/reactos/drivers/network/tcpip/tcpip/irp.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/tcpip/irp.c (removed) @@ -1,37 +1,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS TCP/IP protocol driver - * FILE: tcpip/dispatch.h - * PURPOSE: TDI dispatch routines - * PROGRAMMERS: arty - * REVISIONS: - * CSH 01/08-2000 Created - * TODO: Validate device object in all dispatch routines - */ - -#include "precomp.h" - -VOID IRPRemember( PIRP Irp, PCHAR File, UINT Line ) { - TrackWithTag( IRP_TAG, Irp, File, Line ); -} - -NTSTATUS IRPFinish( PIRP Irp, NTSTATUS Status ) { - KIRQL OldIrql; - - UntrackFL( __FILE__, __LINE__, Irp, IRP_TAG ); - - Irp->IoStatus.Status = Status; - - if( Status == STATUS_PENDING ) - IoMarkIrpPending( Irp ); - else { - IoAcquireCancelSpinLock(&OldIrql); - (void)IoSetCancelRoutine( Irp, NULL ); - IoReleaseCancelSpinLock(OldIrql); - - IoCompleteRequest( Irp, IO_NETWORK_INCREMENT ); - } - - return Status; -} - Modified: trunk/reactos/drivers/network/tcpip/tcpip/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
============================================================================== --- trunk/reactos/drivers/network/tcpip/tcpip/main.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/tcpip/main.c [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -119,30 +119,25 @@ TI_DbgPrint(DEBUG_IRP, ("Called. DeviceObject is at (0x%X), IRP is at (0x%X).\n", DeviceObject, Irp)); EaInfo = Irp->AssociatedIrp.SystemBuffer; -CP + /* Parameter check */ /* No EA information means that we're opening for SET/QUERY_INFORMATION * style calls. */ -#if 0 - if (!EaInfo) { - TI_DbgPrint(MIN_TRACE, ("No EA information in IRP.\n")); - return STATUS_INVALID_PARAMETER; - } -#endif -CP + /* Allocate resources here. We release them again if something failed */ - Context = exAllocatePool(NonPagedPool, sizeof(TRANSPORT_CONTEXT)); + Context = ExAllocatePoolWithTag(NonPagedPool, sizeof(TRANSPORT_CONTEXT), + TRANS_CONTEXT_TAG); if (!Context) { TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); return STATUS_INSUFFICIENT_RESOURCES; } -CP + Context->CancelIrps = FALSE; -CP + IrpSp = IoGetCurrentIrpStackLocation(Irp); IrpSp->FileObject->FsContext = Context; Request.RequestContext = Irp; -CP + /* Branch to the right handler */ if (EaInfo && (EaInfo->EaNameLength == TDI_TRANSPORT_ADDRESS_LENGTH) && @@ -150,7 +145,7 @@ (&EaInfo->EaName, TdiTransportAddress, TDI_TRANSPORT_ADDRESS_LENGTH) == TDI_TRANSPORT_ADDRESS_LENGTH)) { /* This is a request to open an address */ -CP + /* XXX This should probably be done in IoCreateFile() */ /* Parameter checks */ @@ -169,10 +164,10 @@ TI_DbgPrint(MIN_TRACE, ("AddressType: %\n", Address->Address[0].AddressType)); } - exFreePool(Context); + ExFreePoolWithTag(Context, TRANS_CONTEXT_TAG); return STATUS_INVALID_PARAMETER; } -CP + /* Open address file object */ /* Protocol depends on device object so find the protocol */ @@ -186,21 +181,21 @@ Status = TiGetProtocolNumber(&IrpSp->FileObject->FileName, &Protocol); if (!NT_SUCCESS(Status)) { TI_DbgPrint(MIN_TRACE, ("Raw IP protocol number is invalid.\n")); - exFreePool(Context); + ExFreePoolWithTag(Context, TRANS_CONTEXT_TAG); return STATUS_INVALID_PARAMETER; } } else { TI_DbgPrint(MIN_TRACE, ("Invalid device object at (0x%X).\n", DeviceObject)); - exFreePool(Context); + ExFreePoolWithTag(Context, TRANS_CONTEXT_TAG); return STATUS_INVALID_PARAMETER; } -CP + Status = FileOpenAddress(&Request, Address, Protocol, NULL); if (NT_SUCCESS(Status)) { IrpSp->FileObject->FsContext2 = (PVOID)TDI_TRANSPORT_ADDRESS_FILE; Context->Handle.AddressHandle = Request.Handle.AddressHandle; } -CP + } else if (EaInfo && (EaInfo->EaNameLength == TDI_CONNECTION_CONTEXT_LENGTH) && (RtlCompareMemory @@ -208,12 +203,12 @@ TDI_CONNECTION_CONTEXT_LENGTH) == TDI_CONNECTION_CONTEXT_LENGTH)) { /* This is a request to open a connection endpoint */ -CP + /* Parameter checks */ if (EaInfo->EaValueLength < sizeof(PVOID)) { TI_DbgPrint(MIN_TRACE, ("Parameters are invalid.\n")); - exFreePool(Context); + ExFreePoolWithTag(Context, TRANS_CONTEXT_TAG); return STATUS_INVALID_PARAMETER; } @@ -221,7 +216,7 @@ if (DeviceObject != TCPDeviceObject) { TI_DbgPrint(MIN_TRACE, ("Bad device object.\n")); - exFreePool(Context); + ExFreePoolWithTag(Context, TRANS_CONTEXT_TAG); return STATUS_INVALID_PARAMETER; } @@ -244,7 +239,7 @@ } if (!NT_SUCCESS(Status)) - exFreePool(Context); + ExFreePoolWithTag(Context, TRANS_CONTEXT_TAG); TI_DbgPrint(DEBUG_IRP, ("Leaving. Status = (0x%X).\n", Status)); @@ -323,8 +318,6 @@ PIO_STACK_LOCATION IrpSp; NTSTATUS Status; - IRPRemember(Irp, __FILE__, __LINE__); - // DbgPrint("Called. DeviceObject is at (0x%X), IRP is at (0x%X).\n", DeviceObject, Irp); IrpSp = IoGetCurrentIrpStackLocation(Irp); @@ -367,8 +360,6 @@ BOOLEAN Complete = TRUE; PIO_STACK_LOCATION IrpSp; - IRPRemember(Irp, __FILE__, __LINE__); - IrpSp = IoGetCurrentIrpStackLocation(Irp); TI_DbgPrint(DEBUG_IRP, ("Called. DeviceObject is at (0x%X), IRP is at (0x%X) MN (%d).\n", @@ -470,8 +461,6 @@ { NTSTATUS Status; PIO_STACK_LOCATION IrpSp; - - IRPRemember(Irp, __FILE__, __LINE__); IrpSp = IoGetCurrentIrpStackLocation(Irp); @@ -541,8 +530,6 @@ } TcpipReleaseSpinLock(&AddressFileListLock, OldIrql); #endif - ChewShutdown(); - /* Cancel timer */ KeCancelTimer(&IPTimer); @@ -580,11 +567,13 @@ if (RawIPDeviceObject) IoDeleteDevice(RawIPDeviceObject); - if (IPDeviceObject) - IoDeleteDevice(IPDeviceObject); + if (IPDeviceObject) { + ChewShutdown(); + IoDeleteDevice(IPDeviceObject); + } if (EntityList) - exFreePool(EntityList); + ExFreePoolWithTag(EntityList, TDI_ENTITY_TAG); TI_DbgPrint(MAX_TRACE, ("Leaving.\n")); } @@ -635,17 +624,22 @@ TI_DbgPrint(MAX_TRACE, ("Called.\n")); - TrackingInit(); - /* TdiInitialize() ? */ /* FIXME: Create symbolic links in Win32 namespace */ + + /* Initialize our periodic timer and its associated DPC object. When the + timer expires, the IPTimeout deferred procedure call (DPC) is queued */ + ExInitializeWorkItem( &IpWorkItem, IPTimeout, NULL ); + KeInitializeDpc(&IPTimeoutDpc, IPTimeoutDpcFn, NULL); + KeInitializeTimer(&IPTimer); /* Create IP device object */ Status = IoCreateDevice(DriverObject, 0, &strIpDeviceName, FILE_DEVICE_NETWORK, 0, FALSE, &IPDeviceObject); if (!NT_SUCCESS(Status)) { TI_DbgPrint(MIN_TRACE, ("Failed to create IP device object. Status (0x%X).\n", Status)); + TiUnload(DriverObject); return Status; } @@ -656,8 +650,7 @@ FILE_DEVICE_NETWORK, 0, FALSE, &RawIPDeviceObject); if (!NT_SUCCESS(Status)) { TI_DbgPrint(MIN_TRACE, ("Failed to create RawIP device object. Status (0x%X).\n", Status)); - ChewShutdown(); - IoDeleteDevice(IPDeviceObject); + TiUnload(DriverObject); return Status; } @@ -666,9 +659,7 @@ FILE_DEVICE_NETWORK, 0, FALSE, &UDPDeviceObject); if (!NT_SUCCESS(Status)) { TI_DbgPrint(MIN_TRACE, ("Failed to create UDP device object. Status (0x%X).\n", Status)); - ChewShutdown(); - IoDeleteDevice(IPDeviceObject); - IoDeleteDevice(RawIPDeviceObject); + TiUnload(DriverObject); return Status; } @@ -677,23 +668,18 @@ FILE_DEVICE_NETWORK, 0, FALSE, &TCPDeviceObject); if (!NT_SUCCESS(Status)) { TI_DbgPrint(MIN_TRACE, ("Failed to create TCP device object. Status (0x%X).\n", Status)); - ChewShutdown(); - IoDeleteDevice(IPDeviceObject); - IoDeleteDevice(RawIPDeviceObject); - IoDeleteDevice(UDPDeviceObject); + TiUnload(DriverObject); return Status; } /* Setup network layer and transport layer entities */ KeInitializeSpinLock(&EntityListLock); - EntityList = exAllocatePool(NonPagedPool, sizeof(TDIEntityID) * MAX_TDI_ENTITIES ); + EntityList = ExAllocatePoolWithTag(NonPagedPool, + sizeof(TDIEntityID) * MAX_TDI_ENTITIES, + TDI_ENTITY_TAG ); if (!EntityList) { TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); - ChewShutdown(); - IoDeleteDevice(IPDeviceObject); - IoDeleteDevice(RawIPDeviceObject); - IoDeleteDevice(UDPDeviceObject); - IoDeleteDevice(TCPDeviceObject); + TiUnload(DriverObject); return STATUS_INSUFFICIENT_RESOURCES; } @@ -703,25 +689,14 @@ /* Allocate NDIS packet descriptors */ NdisAllocatePacketPool(&NdisStatus, &GlobalPacketPool, 100, sizeof(PACKET_CONTEXT)); if (NdisStatus != NDIS_STATUS_SUCCESS) { - ChewShutdown(); - IoDeleteDevice(IPDeviceObject); - IoDeleteDevice(RawIPDeviceObject); - IoDeleteDevice(UDPDeviceObject); - IoDeleteDevice(TCPDeviceObject); - exFreePool(EntityList); + TiUnload(DriverObject); return STATUS_INSUFFICIENT_RESOURCES; } /* Allocate NDIS buffer descriptors */ NdisAllocateBufferPool(&NdisStatus, &GlobalBufferPool, 100); if (NdisStatus != NDIS_STATUS_SUCCESS) { - ChewShutdown(); - IoDeleteDevice(IPDeviceObject); - IoDeleteDevice(RawIPDeviceObject); - IoDeleteDevice(UDPDeviceObject); - IoDeleteDevice(TCPDeviceObject); - exFreePool(EntityList); - NdisFreePacketPool(GlobalPacketPool); + TiUnload(DriverObject); return STATUS_INSUFFICIENT_RESOURCES; } @@ -743,64 +718,26 @@ /* Initialize transport level protocol subsystems */ Status = RawIPStartup(); if( !NT_SUCCESS(Status) ) { - IPShutdown(); - ChewShutdown(); - IoDeleteDevice(IPDeviceObject); - IoDeleteDevice(RawIPDeviceObject); - IoDeleteDevice(UDPDeviceObject); - IoDeleteDevice(TCPDeviceObject); - exFreePool(EntityList); - NdisFreePacketPool(GlobalPacketPool); - NdisFreeBufferPool(GlobalBufferPool); - return Status; + TiUnload(DriverObject); + return Status; } Status = UDPStartup(); if( !NT_SUCCESS(Status) ) { - RawIPShutdown(); - IPShutdown(); - ChewShutdown(); - IoDeleteDevice(IPDeviceObject); - IoDeleteDevice(RawIPDeviceObject); - IoDeleteDevice(UDPDeviceObject); - IoDeleteDevice(TCPDeviceObject); - exFreePool(EntityList); - NdisFreePacketPool(GlobalPacketPool); - NdisFreeBufferPool(GlobalBufferPool); - return Status; + TiUnload(DriverObject); + return Status; } Status = TCPStartup(); if( !NT_SUCCESS(Status) ) { - UDPShutdown(); - RawIPShutdown(); - IPShutdown(); - ChewShutdown(); - IoDeleteDevice(IPDeviceObject); - IoDeleteDevice(RawIPDeviceObject); - IoDeleteDevice(UDPDeviceObject); - IoDeleteDevice(TCPDeviceObject); - exFreePool(EntityList); - NdisFreePacketPool(GlobalPacketPool); - NdisFreeBufferPool(GlobalBufferPool); - return Status; + TiUnload(DriverObject); + return Status; } Status = ICMPStartup(); if( !NT_SUCCESS(Status) ) { - TCPShutdown(); - UDPShutdown(); - RawIPShutdown(); - IPShutdown(); - ChewShutdown(); - IoDeleteDevice(IPDeviceObject); - IoDeleteDevice(RawIPDeviceObject); - IoDeleteDevice(UDPDeviceObject); - IoDeleteDevice(TCPDeviceObject); - exFreePool(EntityList); - NdisFreePacketPool(GlobalPacketPool); - NdisFreeBufferPool(GlobalBufferPool); - return Status; + TiUnload(DriverObject); + return Status; } /* Use direct I/O */ @@ -817,33 +754,11 @@ DriverObject->DriverUnload = TiUnload; - /* Initialize our periodic timer and its associated DPC object. When the - timer expires, the IPTimeout deferred procedure call (DPC) is queued */ - ExInitializeWorkItem( &IpWorkItem, IPTimeout, NULL ); - KeInitializeDpc(&IPTimeoutDpc, IPTimeoutDpcFn, NULL); - KeInitializeTimer(&IPTimer); - - /* Start the periodic timer with an initial and periodic - relative expiration time of IP_TIMEOUT milliseconds */ - DueTime.QuadPart = -(LONGLONG)IP_TIMEOUT * 10000; - KeSetTimerEx(&IPTimer, DueTime, IP_TIMEOUT, &IPTimeoutDpc); - /* Open loopback adapter */ Status = LoopRegisterAdapter(NULL, NULL); if (!NT_SUCCESS(Status)) { TI_DbgPrint(MIN_TRACE, ("Failed to create loopback adapter. Status (0x%X).\n", Status)); - TCPShutdown(); - UDPShutdown(); - RawIPShutdown(); - IPShutdown(); - ChewShutdown(); - IoDeleteDevice(IPDeviceObject); - IoDeleteDevice(RawIPDeviceObject); - IoDeleteDevice(UDPDeviceObject); - IoDeleteDevice(TCPDeviceObject); - exFreePool(EntityList); - NdisFreePacketPool(GlobalPacketPool); - NdisFreeBufferPool(GlobalBufferPool); + TiUnload(DriverObject); return Status; } @@ -860,24 +775,17 @@ NULL, 0, NULL); - TCPShutdown(); - UDPShutdown(); - RawIPShutdown(); - IPShutdown(); - ChewShutdown(); - IoDeleteDevice(IPDeviceObject); - IoDeleteDevice(RawIPDeviceObject); - IoDeleteDevice(UDPDeviceObject); - IoDeleteDevice(TCPDeviceObject); - exFreePool(EntityList); - NdisFreePacketPool(GlobalPacketPool); - NdisFreeBufferPool(GlobalBufferPool); - return Status; - } + TiUnload(DriverObject); + return Status; + } + + /* Start the periodic timer with an initial and periodic + relative expiration time of IP_TIMEOUT milliseconds */ + DueTime.QuadPart = -(LONGLONG)IP_TIMEOUT * 10000; + KeSetTimerEx(&IPTimer, DueTime, IP_TIMEOUT, &IPTimeoutDpc); return STATUS_SUCCESS; } - VOID NTAPI IPAddInterface( Modified: trunk/reactos/drivers/network/tcpip/tcpip/ninfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
============================================================================== --- trunk/reactos/drivers/network/tcpip/tcpip/ninfo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/tcpip/ninfo.c [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -22,9 +22,9 @@ UINT RtCount = CountFIBs(IF); UINT Size = sizeof( IPROUTE_ENTRY ) * RtCount; PFIB_ENTRY RCache = - exAllocatePool( NonPagedPool, sizeof( FIB_ENTRY ) * RtCount ), + ExAllocatePool( NonPagedPool, sizeof( FIB_ENTRY ) * RtCount ), RCacheCur = RCache; - PIPROUTE_ENTRY RouteEntries = exAllocatePool( NonPagedPool, Size ), + PIPROUTE_ENTRY RouteEntries = ExAllocatePool( NonPagedPool, Size ), RtCurrent = RouteEntries; UINT i; @@ -32,8 +32,8 @@ RtCount, RCache)); if( !RCache || !RouteEntries ) { - if( RCache ) exFreePool( RCache ); - if( RouteEntries ) exFreePool( RouteEntries ); + if( RCache ) ExFreePool( RCache ); + if( RouteEntries ) ExFreePool( RouteEntries ); return TDI_NO_RESOURCES; } @@ -83,8 +83,8 @@ Status = InfoCopyOut( (PCHAR)RouteEntries, Size, Buffer, BufferSize ); - exFreePool( RouteEntries ); - exFreePool( RCache ); + ExFreePool( RouteEntries ); + ExFreePool( RCache ); TI_DbgPrint(DEBUG_INFO, ("Returning %08x\n", Status)); @@ -118,7 +118,7 @@ return TDI_INVALID_PARAMETER; } - IPEntry = exAllocatePool(NonPagedPool, sizeof(IPADDR_ENTRY)); + IPEntry = ExAllocatePool(NonPagedPool, sizeof(IPADDR_ENTRY)); if (!IPEntry) { TcpipReleaseSpinLock(&EntityListLock, OldIrql); @@ -143,7 +143,7 @@ InfoCopyOut((PCHAR)IPEntry, sizeof(IPADDR_ENTRY), Buffer, BufferSize); - exFreePool(IPEntry); + ExFreePool(IPEntry); return TDI_SUCCESS; } Modified: trunk/reactos/lib/drivers/ip/ip.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/ip.rbuild?r…
============================================================================== --- trunk/reactos/lib/drivers/ip/ip.rbuild [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/ip/ip.rbuild [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -17,7 +17,6 @@ <file>interface.c</file> <file>ip.c</file> <file>loopback.c</file> - <file>memtrack.c</file> <file>neighbor.c</file> <file>ports.c</file> <file>receive.c</file> Modified: trunk/reactos/lib/drivers/ip/network/address.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/add…
============================================================================== --- trunk/reactos/lib/drivers/ip/network/address.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/ip/network/address.c [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -106,7 +106,7 @@ * Nothing */ { - exFreePool(Object); + ExFreePoolWithTag(Object, IP_ADDRESS_TAG); } Modified: trunk/reactos/lib/drivers/ip/network/ip.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/ip.…
============================================================================== --- trunk/reactos/lib/drivers/ip/network/ip.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/ip/network/ip.c [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -39,7 +39,7 @@ * Object = Pointer to an interface structure */ { - exFreePool(Object); + ExFreePoolWithTag(Object, IP_INTERFACE_TAG); } PIP_PACKET IPInitializePacket( @@ -55,8 +55,6 @@ { /* FIXME: Is this needed? */ RtlZeroMemory(IPPacket, sizeof(IP_PACKET)); - - INIT_TAG(IPPacket, 'TKPI'); IPPacket->Free = DontFreePacket; IPPacket->Type = Type; @@ -139,13 +137,12 @@ } #endif - IF = exAllocatePool(NonPagedPool, sizeof(IP_INTERFACE)); + IF = ExAllocatePoolWithTag(NonPagedPool, sizeof(IP_INTERFACE), + IP_INTERFACE_TAG); if (!IF) { TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); return NULL; } - - INIT_TAG(IF, 'ECAF'); RtlZeroMemory(IF, sizeof(IP_INTERFACE)); @@ -165,10 +162,11 @@ TcpipInitializeSpinLock(&IF->Lock); - IF->TCPContext = exAllocatePool - ( NonPagedPool, sizeof(OSK_IFADDR) + 2 * sizeof( struct sockaddr_in ) ); + IF->TCPContext = ExAllocatePoolWithTag + ( NonPagedPool, sizeof(OSK_IFADDR) + 2 * sizeof( struct sockaddr_in ), + OSKITTCP_CONTEXT_TAG ); if (!IF->TCPContext) { - exFreePool(IF); + ExFreePoolWithTag(IF, IP_INTERFACE_TAG); return NULL; } @@ -194,8 +192,8 @@ RemoveTDIInterfaceEntity( IF ); #endif - exFreePool(IF->TCPContext); - exFreePool(IF); + ExFreePoolWithTag(IF->TCPContext, OSKITTCP_CONTEXT_TAG); + ExFreePoolWithTag(IF, IP_INTERFACE_TAG); } VOID IPAddInterfaceRoute( PIP_INTERFACE IF ) { @@ -361,7 +359,7 @@ NULL, /* Free routine */ 0, /* Flags */ sizeof(IPDATAGRAM_REASSEMBLY), /* Size of each entry */ - 'RDPI', /* Tag */ + DATAGRAM_REASSEMBLY_TAG, /* Tag */ 0); /* Depth */ ExInitializeNPagedLookasideList( @@ -370,7 +368,7 @@ NULL, /* Free routine */ 0, /* Flags */ sizeof(IP_FRAGMENT), /* Size of each entry */ - 'GFPI', /* Tag */ + DATAGRAM_FRAGMENT_TAG, /* Tag */ 0); /* Depth */ ExInitializeNPagedLookasideList( @@ -379,7 +377,7 @@ NULL, /* Free routine */ 0, /* Flags */ sizeof(IPDATAGRAM_HOLE), /* Size of each entry */ - 'LHPI', /* Tag */ + DATAGRAM_HOLE_TAG, /* Tag */ 0); /* Depth */ /* Start routing subsystem */ Removed: trunk/reactos/lib/drivers/ip/network/memtrack.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/mem…
============================================================================== --- trunk/reactos/lib/drivers/ip/network/memtrack.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/ip/network/memtrack.c (removed) @@ -1,153 +1,0 @@ -#define MEMTRACK_NO_POOL -#include "precomp.h" - - -#if DBG -#define TRACK_TAG 'KCrT' - -static LIST_ENTRY AllocatedObjectsList; -static KSPIN_LOCK AllocatedObjectsLock; -static NPAGED_LOOKASIDE_LIST AllocatedObjectsLookasideList; - -VOID TrackingInit() { - TcpipInitializeSpinLock( &AllocatedObjectsLock ); - InitializeListHead( &AllocatedObjectsList ); - ExInitializeNPagedLookasideList(&AllocatedObjectsLookasideList, - NULL, - NULL, - 0, - sizeof(ALLOCATION_TRACKER), - TRACK_TAG, - 0 ); -} - -VOID ShowTrackedThing( PCHAR What, PALLOCATION_TRACKER Thing, BOOLEAN ForceShow ) { - - if (ForceShow) - { - DbgPrint("[%s] Thing %08x %c%c%c%c (%s:%d)\n", - What, - Thing->Thing, - ((PCHAR)&Thing->Tag)[3], - ((PCHAR)&Thing->Tag)[2], - ((PCHAR)&Thing->Tag)[1], - ((PCHAR)&Thing->Tag)[0], - Thing->FileName, - Thing->LineNo); - } - else - { - TI_DbgPrint(MAX_TRACE, - ("[%s] Thing %08x %c%c%c%c (%s:%d)\n", - What, - Thing->Thing, - ((PCHAR)&Thing->Tag)[3], - ((PCHAR)&Thing->Tag)[2], - ((PCHAR)&Thing->Tag)[1], - ((PCHAR)&Thing->Tag)[0], - Thing->FileName, - Thing->LineNo)); - } -} - -VOID TrackWithTag( ULONG Tag, PVOID Thing, PCHAR FileName, ULONG LineNo ) { - PALLOCATION_TRACKER TrackedThing = - ExAllocateFromNPagedLookasideList( &AllocatedObjectsLookasideList ); - - KIRQL OldIrql; - PLIST_ENTRY Entry; - PALLOCATION_TRACKER ThingInList; - - if (!TrackedThing) return; - - TrackedThing->Tag = Tag; - TrackedThing->Thing = Thing; - TrackedThing->FileName = FileName; - TrackedThing->LineNo = LineNo; - - ShowTrackedThing( "Alloc", TrackedThing, FALSE ); - - TcpipAcquireSpinLock( &AllocatedObjectsLock, &OldIrql ); - Entry = AllocatedObjectsList.Flink; - while( Entry != &AllocatedObjectsList ) { - ThingInList = CONTAINING_RECORD(Entry, ALLOCATION_TRACKER, Entry); - if( ThingInList->Thing == Thing ) { - RemoveEntryList(Entry); - - ShowTrackedThing( "Double Alloc (Item in list)", ThingInList, TRUE ); - ShowTrackedThing( "Double Alloc (Item not in list)", TrackedThing, TRUE ); - - ExFreeToNPagedLookasideList( &AllocatedObjectsLookasideList, - ThingInList ); - - break; - } - Entry = Entry->Flink; - } - - InsertHeadList( &AllocatedObjectsList, &TrackedThing->Entry ); - - TcpipReleaseSpinLock( &AllocatedObjectsLock, OldIrql ); -} - -VOID UntrackFL( PCHAR File, ULONG Line, PVOID Thing, ULONG Tag ) { - KIRQL OldIrql; - PLIST_ENTRY Entry; - PALLOCATION_TRACKER ThingInList; - - TcpipAcquireSpinLock( &AllocatedObjectsLock, &OldIrql ); - Entry = AllocatedObjectsList.Flink; - while( Entry != &AllocatedObjectsList ) { - ThingInList = CONTAINING_RECORD(Entry, ALLOCATION_TRACKER, Entry); - if( ThingInList->Thing == Thing ) { - RemoveEntryList(Entry); - - ShowTrackedThing( "Free ", ThingInList, FALSE ); - - if ( ThingInList->Tag != Tag ) { - DbgPrint("UNTRACK: TAG DOES NOT MATCH (%x)\n", Thing); - ShowTrackedThing("Tag Mismatch (Item in list)", ThingInList, TRUE); - ASSERT( FALSE ); - } - - ExFreeToNPagedLookasideList( &AllocatedObjectsLookasideList, - ThingInList ); - - TcpipReleaseSpinLock( &AllocatedObjectsLock, OldIrql ); - - return; - } - Entry = Entry->Flink; - } - TcpipReleaseSpinLock( &AllocatedObjectsLock, OldIrql ); - - DbgPrint("[Double Free] Thing %08x %c%c%c%c (%s:%d)\n", - Thing, - ((PCHAR)&Tag)[3], - ((PCHAR)&Tag)[2], - ((PCHAR)&Tag)[1], - ((PCHAR)&Tag)[0], - File, - Line); - - ASSERT( FALSE ); -} - -VOID TrackDumpFL( PCHAR File, ULONG Line ) { - KIRQL OldIrql; - PLIST_ENTRY Entry; - PALLOCATION_TRACKER Thing; - - TI_DbgPrint(MAX_TRACE,("Dump: %s:%d\n", File, Line)); - - TcpipAcquireSpinLock( &AllocatedObjectsLock, &OldIrql ); - Entry = AllocatedObjectsList.Flink; - while( Entry != &AllocatedObjectsList ) { - Thing = CONTAINING_RECORD(Entry, ALLOCATION_TRACKER, Entry); - ShowTrackedThing( "Dump ", Thing, FALSE ); - Entry = Entry->Flink; - } - TcpipReleaseSpinLock( &AllocatedObjectsLock, OldIrql ); -} - -#endif /* DBG */ Modified: trunk/reactos/lib/drivers/ip/network/neighbor.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/nei…
============================================================================== --- trunk/reactos/lib/drivers/ip/network/neighbor.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/ip/network/neighbor.c [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -21,7 +21,7 @@ ASSERT_KM_POINTER(Packet->Complete); Packet->Complete( Packet->Context, Packet->Packet, Status ); TI_DbgPrint(MID_TRACE, ("Completed\n")); - exFreePool( Packet ); + ExFreePoolWithTag( Packet, NEIGHBOR_PACKET_TAG ); TI_DbgPrint(MID_TRACE, ("Freed\n")); } @@ -84,7 +84,7 @@ Packet->Packet, ErrorCode ); - exFreePool( Packet ); + ExFreePoolWithTag( Packet, NEIGHBOR_PACKET_TAG ); } } @@ -128,7 +128,7 @@ *PrevNCE = NCE->Next; NBFlushPacketQueue(NCE, NDIS_STATUS_REQUEST_ABORTED); - exFreePool(NCE); + ExFreePoolWithTag(NCE, NCE_TAG); continue; } @@ -179,7 +179,7 @@ /* Flush wait queue */ NBFlushPacketQueue( CurNCE, NDIS_STATUS_NOT_ACCEPTED ); - exFreePool(CurNCE); + ExFreePoolWithTag(CurNCE, NCE_TAG); CurNCE = NextNCE; } @@ -241,15 +241,14 @@ "LinkAddress (0x%X) LinkAddressLength (%d) State (0x%X)\n", Interface, Address, LinkAddress, LinkAddressLength, State)); - NCE = exAllocatePool - (NonPagedPool, sizeof(NEIGHBOR_CACHE_ENTRY) + LinkAddressLength); + NCE = ExAllocatePoolWithTag + (NonPagedPool, sizeof(NEIGHBOR_CACHE_ENTRY) + LinkAddressLength, + NCE_TAG); if (NCE == NULL) { TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); return NULL; } - - INIT_TAG(NCE, ' ECN'); NCE->Interface = Interface; NCE->Address = *Address; @@ -452,7 +451,8 @@ (DEBUG_NCACHE, ("Called. NCE (0x%X) NdisPacket (0x%X).\n", NCE, NdisPacket)); - Packet = exAllocatePool( NonPagedPool, sizeof(NEIGHBOR_PACKET) ); + Packet = ExAllocatePoolWithTag( NonPagedPool, sizeof(NEIGHBOR_PACKET), + NEIGHBOR_PACKET_TAG ); if( !Packet ) return FALSE; /* FIXME: Should we limit the number of queued packets? */ @@ -514,7 +514,7 @@ *PrevNCE = CurNCE->Next; NBFlushPacketQueue( CurNCE, NDIS_STATUS_REQUEST_ABORTED ); - exFreePool(CurNCE); + ExFreePoolWithTag(CurNCE, NCE_TAG); break; } Modified: trunk/reactos/lib/drivers/ip/network/ports.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/por…
============================================================================== --- trunk/reactos/lib/drivers/ip/network/ports.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/ip/network/ports.c [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -17,7 +17,8 @@ PortSet->PortsToOversee = PortsToManage; PortSet->ProtoBitBuffer = - exAllocatePool( NonPagedPool, (PortSet->PortsToOversee + 7) / 8 ); + ExAllocatePoolWithTag( NonPagedPool, (PortSet->PortsToOversee + 7) / 8, + PORT_SET_TAG ); if(!PortSet->ProtoBitBuffer) return STATUS_INSUFFICIENT_RESOURCES; RtlInitializeBitMap( &PortSet->ProtoBitmap, PortSet->ProtoBitBuffer, @@ -28,7 +29,7 @@ } VOID PortsShutdown( PPORT_SET PortSet ) { - exFreePool( PortSet->ProtoBitBuffer ); + ExFreePoolWithTag( PortSet->ProtoBitBuffer, PORT_SET_TAG ); } VOID DeallocatePort( PPORT_SET PortSet, ULONG Port ) { Modified: trunk/reactos/lib/drivers/ip/network/receive.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/rec…
============================================================================== --- trunk/reactos/lib/drivers/ip/network/receive.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/ip/network/receive.c [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -35,7 +35,7 @@ TI_DbgPrint(DEBUG_IP, ("Called. First (%d) Last (%d).\n", First, Last)); - Hole = exAllocateFromNPagedLookasideList(&IPHoleList); + Hole = ExAllocateFromNPagedLookasideList(&IPHoleList); if (!Hole) { TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); return NULL; @@ -76,7 +76,7 @@ TI_DbgPrint(DEBUG_IP, ("Freeing hole descriptor at (0x%X).\n", CurrentH)); /* And free the hole descriptor */ - exFreeToNPagedLookasideList(&IPHoleList, CurrentH); + ExFreeToNPagedLookasideList(&IPHoleList, CurrentH); CurrentEntry = NextEntry; } @@ -92,18 +92,18 @@ TI_DbgPrint(DEBUG_IP, ("Freeing fragment data at (0x%X).\n", CurrentF->Data)); /* Free the fragment data buffer */ - exFreePool(CurrentF->Data); + ExFreePoolWithTag(CurrentF->Data, FRAGMENT_DATA_TAG); TI_DbgPrint(DEBUG_IP, ("Freeing fragment at (0x%X).\n", CurrentF)); /* And free the fragment descriptor */ - exFreeToNPagedLookasideList(&IPFragmentList, CurrentF); + ExFreeToNPagedLookasideList(&IPFragmentList, CurrentF); CurrentEntry = NextEntry; } TI_DbgPrint(DEBUG_IP, ("Freeing IPDR data at (0x%X).\n", IPDR)); - exFreeToNPagedLookasideList(&IPDRList, IPDR); + ExFreeToNPagedLookasideList(&IPDRList, IPDR); } @@ -205,7 +205,7 @@ RtlCopyMemory(&IPPacket->DstAddr, &IPDR->DstAddr, sizeof(IP_ADDRESS)); /* Allocate space for full IP datagram */ - IPPacket->Header = exAllocatePool(NonPagedPool, IPPacket->TotalSize); + IPPacket->Header = ExAllocatePoolWithTag(NonPagedPool, IPPacket->TotalSize, PACKET_BUFFER_TAG); if (!IPPacket->Header) { TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); (*IPPacket->Free)(IPPacket); @@ -297,7 +297,7 @@ TI_DbgPrint(DEBUG_IP, ("Starting new assembly.\n")); /* We don't have a reassembly structure, create one */ - IPDR = exAllocateFromNPagedLookasideList(&IPDRList); + IPDR = ExAllocateFromNPagedLookasideList(&IPDRList); if (!IPDR) /* We don't have the resources to process this packet, discard it */ return; @@ -308,7 +308,7 @@ Hole = CreateHoleDescriptor(0, 65536); if (!Hole) { /* We don't have the resources to process this packet, discard it */ - exFreeToNPagedLookasideList(&IPDRList, IPDR); + ExFreeToNPagedLookasideList(&IPDRList, IPDR); return; } AddrInitIPv4(&IPDR->SrcAddr, IPv4Header->SrcAddr); @@ -361,7 +361,7 @@ NewHole = CreateHoleDescriptor(Hole->First, FragFirst - 1); if (!NewHole) { /* We don't have the resources to process this packet, discard it */ - exFreeToNPagedLookasideList(&IPHoleList, Hole); + ExFreeToNPagedLookasideList(&IPHoleList, Hole); Cleanup(&IPDR->Lock, OldIrql, IPDR); return; } @@ -374,7 +374,7 @@ NewHole = CreateHoleDescriptor(FragLast + 1, Hole->Last); if (!NewHole) { /* We don't have the resources to process this packet, discard it */ - exFreeToNPagedLookasideList(&IPHoleList, Hole); + ExFreeToNPagedLookasideList(&IPHoleList, Hole); Cleanup(&IPDR->Lock, OldIrql, IPDR); return; } @@ -383,7 +383,7 @@ InsertTailList(&IPDR->HoleListHead, &NewHole->ListEntry); } - exFreeToNPagedLookasideList(&IPHoleList, Hole); + ExFreeToNPagedLookasideList(&IPHoleList, Hole); /* If this is the first fragment, save the IP header */ if (FragFirst == 0) { @@ -397,7 +397,7 @@ /* Create a buffer, copy the data into it and put it in the fragment list */ - Fragment = exAllocateFromNPagedLookasideList(&IPFragmentList); + Fragment = ExAllocateFromNPagedLookasideList(&IPFragmentList); if (!Fragment) { /* We don't have the resources to process this packet, discard it */ Cleanup(&IPDR->Lock, OldIrql, IPDR); @@ -407,10 +407,10 @@ TI_DbgPrint(DEBUG_IP, ("Fragment descriptor allocated at (0x%X).\n", Fragment)); Fragment->Size = IPPacket->TotalSize - IPPacket->HeaderSize; - Fragment->Data = exAllocatePool(NonPagedPool, Fragment->Size); + Fragment->Data = ExAllocatePoolWithTag(NonPagedPool, Fragment->Size, FRAGMENT_DATA_TAG); if (!Fragment->Data) { /* We don't have the resources to process this packet, discard it */ - exFreeToNPagedLookasideList(&IPFragmentList, Fragment); + ExFreeToNPagedLookasideList(&IPFragmentList, Fragment); Cleanup(&IPDR->Lock, OldIrql, IPDR); return; } @@ -465,7 +465,7 @@ IF->Stats.InBytes += Datagram.TotalSize; /* We're done with this datagram */ - exFreePool(Datagram.Header); + ExFreePoolWithTag(Datagram.Header, PACKET_BUFFER_TAG); TI_DbgPrint(MAX_TRACE, ("Freeing datagram at (0x%X).\n", Datagram)); (*Datagram.Free)(&Datagram); } else Modified: trunk/reactos/lib/drivers/ip/network/router.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/rou…
============================================================================== --- trunk/reactos/lib/drivers/ip/network/router.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/ip/network/router.c [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -51,7 +51,7 @@ * Object = Pointer to an forward information base structure */ { - exFreePool(Object); + ExFreePoolWithTag(Object, FIB_TAG); } @@ -217,13 +217,11 @@ A2S(Netmask), A2S(&Router->Address))); - FIBE = exAllocatePool(NonPagedPool, sizeof(FIB_ENTRY)); + FIBE = ExAllocatePoolWithTag(NonPagedPool, sizeof(FIB_ENTRY), FIB_TAG); if (!FIBE) { TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); return NULL; } - - INIT_TAG(Router, 'TUOR'); RtlCopyMemory( &FIBE->NetworkAddress, NetworkAddress, sizeof(FIBE->NetworkAddress) ); Modified: trunk/reactos/lib/drivers/ip/network/routines.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/rou…
============================================================================== --- trunk/reactos/lib/drivers/ip/network/routines.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/ip/network/routines.c [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -115,11 +115,11 @@ if (IPPacket->NdisPacket) { NdisQueryPacket(IPPacket->NdisPacket, NULL, NULL, NULL, &Length); - Buffer = exAllocatePool(NonPagedPool, Length); + Buffer = ExAllocatePool(NonPagedPool, Length); if (Buffer) { Length = CopyPacketToBuffer(Buffer, IPPacket->NdisPacket, 0, Length); DisplayTCPHeader(Buffer, Length); - exFreePool(Buffer); + ExFreePool(Buffer); } } else { Buffer = IPPacket->Header; Modified: trunk/reactos/lib/drivers/ip/network/transmit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/tra…
============================================================================== --- trunk/reactos/lib/drivers/ip/network/transmit.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/ip/network/transmit.c [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -42,7 +42,7 @@ { FreeNdisPacket(IFC->NdisPacket); IFC->Complete(IFC->Context, IFC->Datagram, Status); - exFreePool(IFC); + ExFreePoolWithTag(IFC, IFC_TAG); } } else { TI_DbgPrint(MAX_TRACE, ("Calling completion handler.\n")); @@ -50,7 +50,7 @@ /* There are no more fragments to transmit, so call completion handler */ FreeNdisPacket(IFC->NdisPacket); IFC->Complete(IFC->Context, IFC->Datagram, NdisStatus); - exFreePool(IFC); + ExFreePoolWithTag(IFC, IFC_TAG); } } @@ -178,7 +178,7 @@ TI_DbgPrint(MAX_TRACE, ("Fragment buffer is %d bytes\n", BufferSize)); - IFC = exAllocatePool(NonPagedPool, sizeof(IPFRAGMENT_CONTEXT)); + IFC = ExAllocatePoolWithTag(NonPagedPool, sizeof(IPFRAGMENT_CONTEXT), IFC_TAG); if (IFC == NULL) return STATUS_INSUFFICIENT_RESOURCES; @@ -187,7 +187,7 @@ ( &IFC->NdisPacket, NULL, BufferSize ); if( !NT_SUCCESS(NdisStatus) ) { - exFreePool( IFC ); + ExFreePoolWithTag( IFC, IFC_TAG ); return NdisStatus; } @@ -215,14 +215,14 @@ if (!PrepareNextFragment(IFC)) { FreeNdisPacket(IFC->NdisPacket); - exFreePool(IFC); + ExFreePoolWithTag(IFC, IFC_TAG); return NDIS_STATUS_FAILURE; } if (!NT_SUCCESS((NdisStatus = IPSendFragment(IFC->NdisPacket, NCE, IFC)))) { FreeNdisPacket(IFC->NdisPacket); - exFreePool(IFC); + ExFreePoolWithTag(IFC, IFC_TAG); } return NdisStatus; Modified: trunk/reactos/lib/drivers/ip/transport/datagram/datagram.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/transport/d…
============================================================================== --- trunk/reactos/lib/drivers/ip/transport/datagram/datagram.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/ip/transport/datagram/datagram.c [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -35,7 +35,7 @@ if (ReceiveRequest->Irp == Irp) { RemoveEntryList(&ReceiveRequest->ListEntry); - exFreePool(ReceiveRequest); + ExFreePoolWithTag(ReceiveRequest, DATAGRAM_RECV_TAG); break; } } @@ -197,7 +197,7 @@ (PDATAGRAM_RECEIVE_REQUEST)Context; TI_DbgPrint(MAX_TRACE,("Called (%08x:%08x)\n", Status, Count)); ReceiveRequest->UserComplete( ReceiveRequest->UserContext, Status, Count ); - exFreePool( ReceiveRequest ); + ExFreePoolWithTag( ReceiveRequest, DATAGRAM_RECV_TAG ); TI_DbgPrint(MAX_TRACE,("Done\n")); } @@ -236,7 +236,8 @@ KeAcquireSpinLock(&AddrFile->Lock, &OldIrql); - ReceiveRequest = exAllocatePool(NonPagedPool, sizeof(DATAGRAM_RECEIVE_REQUEST)); + ReceiveRequest = ExAllocatePoolWithTag(NonPagedPool, sizeof(DATAGRAM_RECEIVE_REQUEST), + DATAGRAM_RECV_TAG); if (ReceiveRequest) { /* Initialize a receive request */ @@ -250,7 +251,7 @@ &ReceiveRequest->RemotePort); if (!NT_SUCCESS(Status)) { - exFreePool(ReceiveRequest); + ExFreePoolWithTag(ReceiveRequest, DATAGRAM_RECV_TAG); KeReleaseSpinLock(&AddrFile->Lock, OldIrql); return Status; } Modified: trunk/reactos/lib/drivers/ip/transport/tcp/accept.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/transport/t…
============================================================================== --- trunk/reactos/lib/drivers/ip/transport/tcp/accept.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/ip/transport/tcp/accept.c [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -118,7 +118,7 @@ if( Bucket->AssociatedEndpoint == Connection ) { RemoveEntryList( &Bucket->Entry ); - exFreePool( Bucket ); + ExFreePoolWithTag( Bucket, TDI_BUCKET_TAG ); break; } @@ -148,7 +148,8 @@ KeReleaseSpinLock(&Listener->Lock, OldIrql); if( Status == STATUS_PENDING ) { - Bucket = exAllocatePool( NonPagedPool, sizeof(*Bucket) ); + Bucket = ExAllocatePoolWithTag( NonPagedPool, sizeof(*Bucket), + TDI_BUCKET_TAG ); if( Bucket ) { Bucket->AssociatedEndpoint = Connection; Modified: trunk/reactos/lib/drivers/ip/transport/tcp/event.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/transport/t…
============================================================================== --- trunk/reactos/lib/drivers/ip/transport/tcp/event.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/ip/transport/tcp/event.c [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -126,8 +126,6 @@ #define SIGNATURE_LARGE 'LLLL' #define SIGNATURE_SMALL 'SSSS' #define SIGNATURE_OTHER 'OOOO' -#define TCP_TAG ' PCT' - static NPAGED_LOOKASIDE_LIST LargeLookasideList; static NPAGED_LOOKASIDE_LIST SmallLookasideList; @@ -139,14 +137,14 @@ NULL, 0, LARGE_SIZE + sizeof( ULONG ), - TCP_TAG, + OSK_LARGE_TAG, 0 ); ExInitializeNPagedLookasideList( &SmallLookasideList, NULL, NULL, 0, SMALL_SIZE + sizeof( ULONG ), - TCP_TAG, + OSK_SMALL_TAG, 0 ); return STATUS_SUCCESS; @@ -216,13 +214,13 @@ v = ExAllocateFromNPagedLookasideList( &LargeLookasideList ); Signature = SIGNATURE_LARGE; } else { - v = ExAllocatePool( NonPagedPool, Bytes + sizeof(ULONG) ); + v = ExAllocatePoolWithTag( NonPagedPool, Bytes + sizeof(ULONG), + OSK_OTHER_TAG ); Signature = SIGNATURE_OTHER; } if( v ) { *((ULONG *) v) = Signature; v = (void *)((char *) v + sizeof(ULONG)); - TrackWithTag( FOURCC('f','b','s','d'), v, (PCHAR)File, Line ); } return v; @@ -232,7 +230,6 @@ void *data, OSK_PCHAR File, OSK_UINT Line ) { ULONG Signature; - UntrackFL( (PCHAR)File, Line, data, FOURCC('f','b','s','d') ); data = (void *)((char *) data - sizeof(ULONG)); Signature = *((ULONG *) data); if ( SIGNATURE_SMALL == Signature ) { @@ -240,7 +237,7 @@ } else if ( SIGNATURE_LARGE == Signature ) { ExFreeToNPagedLookasideList( &LargeLookasideList, data ); } else if ( SIGNATURE_OTHER == Signature ) { - ExFreePool( data ); + ExFreePoolWithTag( data, OSK_OTHER_TAG ); } else { ASSERT( FALSE ); } Modified: trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/transport/t…
============================================================================== --- trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1] Sun Nov 22 00:53:43 2009 @@ -33,7 +33,7 @@ Complete(Bucket->Request.RequestContext, Bucket->Status, Bucket->Information); - exFreePool(Bucket); + ExFreePoolWithTag(Bucket, TDI_BUCKET_TAG); } if (!Connection->SocketContext) @@ -315,7 +315,8 @@ PCONNECTION_ENDPOINT TCPAllocateConnectionEndpoint( PVOID ClientContext ) { PCONNECTION_ENDPOINT Connection = - exAllocatePool(NonPagedPool, sizeof(CONNECTION_ENDPOINT)); + ExAllocatePoolWithTag(NonPagedPool, sizeof(CONNECTION_ENDPOINT), + CONN_ENDPT_TAG); if (!Connection) return Connection; @@ -351,7 +352,7 @@ RemoveEntryList(&Connection->ListEntry); TcpipReleaseSpinLock(&ConnectionEndpointListLock, OldIrql); - exFreePool( Connection ); + ExFreePoolWithTag( Connection, CONN_ENDPT_TAG ); } NTSTATUS TCPSocket( PCONNECTION_ENDPOINT Connection, @@ -667,7 +668,7 @@ if (Status == STATUS_PENDING) { - Bucket = exAllocatePool( NonPagedPool, sizeof(*Bucket) ); + Bucket = ExAllocatePoolWithTag( NonPagedPool, sizeof(*Bucket), TDI_BUCKET_TAG ); if( !Bucket ) { return STATUS_NO_MEMORY; @@ -776,7 +777,7 @@ /* Keep this request around ... there was no data yet */ if( Status == STATUS_PENDING ) { /* Freed in TCPSocketState */ - Bucket = exAllocatePool( NonPagedPool, sizeof(*Bucket) ); + Bucket = ExAllocatePoolWithTag( NonPagedPool, sizeof(*Bucket), TDI_BUCKET_TAG ); if( !Bucket ) { TI_DbgPrint(DEBUG_TCP,("Failed to allocate bucket\n")); return STATUS_NO_MEMORY; @@ -835,7 +836,7 @@ /* Keep this request around ... there was no data yet */ if( Status == STATUS_PENDING ) { /* Freed in TCPSocketState */ - Bucket = exAllocatePool( NonPagedPool, sizeof(*Bucket) ); + Bucket = ExAllocatePoolWithTag( NonPagedPool, sizeof(*Bucket), TDI_BUCKET_TAG ); if( !Bucket ) { TI_DbgPrint(DEBUG_TCP,("Failed to allocate bucket\n")); return STATUS_NO_MEMORY; @@ -927,7 +928,7 @@ if( Bucket->Request.RequestContext == Irp ) { RemoveEntryList( &Bucket->Entry ); - exFreePool( Bucket ); + ExFreePoolWithTag( Bucket, TDI_BUCKET_TAG ); break; } } Removed: trunk/reactos/lib/drivers/oskittcp/include/memtrack.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/oskittcp/inclu…
============================================================================== --- trunk/reactos/lib/drivers/oskittcp/include/memtrack.h [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/oskittcp/include/memtrack.h (removed) @@ -1,80 +1,0 @@ -#ifndef MEMTRACK_H -#define MEMTRACK_H - -#ifndef FOURCC -#define FOURCC(a,b,c,d) (((a)<<24)|((b)<<16)|((c)<<8)|(d)) -#endif - -#define FBSD_MALLOC FOURCC('d','s','b','f') -#define EXALLOC_TAG FOURCC('E','x','A','l') - -#if DBG -#define MTMARK() TrackDumpFL(__FILE__, __LINE__) -#define NdisAllocateBuffer(x,y,z,a,b) { \ - NdisAllocateBuffer(x,y,z,a,b); \ - if( *x == NDIS_STATUS_SUCCESS ) { \ - Track(NDIS_BUFFER_TAG, *y); \ - } \ -} -#define NdisAllocatePacket(x,y,z) { \ - NdisAllocatePacket(x,y,z); \ - if( *x == NDIS_STATUS_SUCCESS ) { \ - Track(NDIS_PACKET_TAG, *y); \ - } \ -} -#define FreeNdisPacket(x) { TI_DbgPrint(MID_TRACE,("Deleting Packet %x\n", x)); FreeNdisPacketX(x); } -#define NdisFreePacket(x) { Untrack(x); NdisFreePacket(x); } -#define NdisFreeBuffer(x) { Untrack(x); NdisFreeBuffer(x); } -#define exAllocatePool(x,y) ExAllocatePoolX(x,y,__FILE__,__LINE__) -#define exAllocatePoolWithTag(x,y,z) ExAllocatePoolX(x,y,__FILE__,__LINE__) -#define exFreePool(x) ExFreePoolX(x,__FILE__,__LINE__) - -extern LIST_ENTRY AllocatedObjectsHead; -extern KSPIN_LOCK AllocatedObjectsLock; - -typedef struct _ALLOCATION_TRACKER { - LIST_ENTRY Entry; - DWORD Tag; - PVOID Thing; - PCHAR FileName; - DWORD LineNo; -} ALLOCATION_TRACKER, *PALLOCATION_TRACKER; - -VOID TrackingInit(); -VOID TrackWithTag( DWORD Tag, PVOID Thing, PCHAR File, DWORD Line ); -#define Track(Tag,Thing) TrackWithTag(Tag,Thing,__FILE__,__LINE__) -VOID UntrackFL( PCHAR File, DWORD Line, PVOID Thing ); -#define Untrack(Thing) UntrackFL(__FILE__,__LINE__,Thing) -VOID TrackDumpFL( PCHAR File, DWORD Line ); -#define TrackDump() TrackDumpFL(__FILE__,__LINE__) -VOID TrackTag( DWORD Tag ); - -static __inline PVOID ExAllocatePoolX( POOL_TYPE type, SIZE_T size, PCHAR File, ULONG Line ) { - PVOID Out = ExAllocatePool( type, size ); - if( Out ) TrackWithTag( EXALLOC_TAG, Out, File, Line ); - return Out; -} -static __inline VOID ExFreePoolX( PVOID Data, PCHAR File, ULONG Line ) { - UntrackFL(File, Line, Data); - ExFreePool(Data); -} - -#define MEMTRACK_MAX_TAGS_TO_TRACK 64 -#else -#define MTMARK() -#define Track(x,y) -#define TrackingInit() -#define TrackDump() -#define Untrack(x) -#define TrackTag(x) -#define FreeNdisPacket FreeNdisPacketX -#define exFreePool(x) ExFreePool(x) -#define exAllocatePool(x,y) ExAllocatePool(x,y) -#define exAllocatePoolWithTag(x,y,z) ExAllocatePoolWithTag(x,y,z) -#define exAllocateFromNPagedLookasideList(x) ExAllocateFromNPagedLookasideList(x) -#define exFreeToNPagedLookasideList(x,y) ExFreeToNPagedLookasideList(x,y) -#define TrackWithTag(w,x,y,z) -#define UntrackFL(w,x,y,z) -#endif - -#endif/*MEMMTRAC_H*/
15 years, 1 month
1
0
0
0
[spetreolle] 44265: Ext3fsd : fix zillions of signedness warnings (PUCHAR => PCHAR)
by spetreolle@svn.reactos.org
Author: spetreolle Date: Sat Nov 21 23:29:03 2009 New Revision: 44265 URL:
http://svn.reactos.org/svn/reactos?rev=44265&view=rev
Log: Ext3fsd : fix zillions of signedness warnings (PUCHAR => PCHAR) Modified: branches/arty-newcc/drivers/filesystems/Ext3Fsd/debug.c branches/arty-newcc/drivers/filesystems/Ext3Fsd/include/ext2fs.h Modified: branches/arty-newcc/drivers/filesystems/Ext3Fsd/debug.c URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/drivers/filesystems/…
============================================================================== --- branches/arty-newcc/drivers/filesystems/Ext3Fsd/debug.c [iso-8859-1] (original) +++ branches/arty-newcc/drivers/filesystems/Ext3Fsd/debug.c [iso-8859-1] Sat Nov 21 23:29:03 2009 @@ -36,7 +36,7 @@ /* Static Definitions ****************************************************/ -static PUCHAR IrpMjStrings[] = { +static PCHAR IrpMjStrings[] = { "IRP_MJ_CREATE", "IRP_MJ_CREATE_NAMED_PIPE", "IRP_MJ_CLOSE", @@ -67,7 +67,7 @@ "IRP_MJ_PNP" }; -static PUCHAR FileInformationClassStrings[] = { +static PCHAR FileInformationClassStrings[] = { "Unknown FileInformationClass 0", "FileDirectoryInformation", "FileFullDirectoryInformation", @@ -107,7 +107,7 @@ "FileTrackingInformation" }; -static PUCHAR FsInformationClassStrings[] = { +static PCHAR FsInformationClassStrings[] = { "Unknown FsInformationClass 0", "FileFsVolumeInformation", "FileFsLabelInformation", @@ -742,7 +742,7 @@ } } -PUCHAR +PCHAR Ext2NtStatusToString ( IN NTSTATUS Status ) { switch (Status) { Modified: branches/arty-newcc/drivers/filesystems/Ext3Fsd/include/ext2fs.h URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/drivers/filesystems/…
============================================================================== --- branches/arty-newcc/drivers/filesystems/Ext3Fsd/include/ext2fs.h [iso-8859-1] (original) +++ branches/arty-newcc/drivers/filesystems/Ext3Fsd/include/ext2fs.h [iso-8859-1] Sat Nov 21 23:29:03 2009 @@ -1361,7 +1361,7 @@ IN BOOLEAN bPrint ); -PUCHAR +PCHAR Ext2NtStatusToString (IN NTSTATUS Status ); //
15 years, 1 month
1
0
0
0
[khornicek] 44264: - consider dest. palette in GreRealizeBrush
by khornicek@svn.reactos.org
Author: khornicek Date: Sat Nov 21 23:05:52 2009 New Revision: 44264 URL:
http://svn.reactos.org/svn/reactos?rev=44264&view=rev
Log: - consider dest. palette in GreRealizeBrush Modified: branches/arwinss/reactos/subsystems/win32/win32k/gre/brushobj.c Modified: branches/arwinss/reactos/subsystems/win32/win32k/gre/brushobj.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/gre/brushobj.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/gre/brushobj.c [iso-8859-1] Sat Nov 21 23:05:52 2009 @@ -300,10 +300,14 @@ RECTL rclDest; HPALETTE hPalette; LONG lWidth; + SURFACE *pSurfDest; rclDest = (RECTL){0, 0, psurfPattern->SurfObj.sizlBitmap.cx, psurfPattern->SurfObj.sizlBitmap.cy}; - hPalette = NULL;//pDC->pBitmap->hDIBPalette; // FIXME: use dest surface palette! + pSurfDest = CONTAINING_RECORD(OutputObj, SURFACE, SurfObj); + + hPalette = pSurfDest->hDIBPalette; + if (!hPalette) hPalette = pPrimarySurface->DevInfo.hpalDefault; lWidth = DIB_GetDIBWidthBytes(psurfPattern->SurfObj.sizlBitmap.cx, BitsPerFormat(OutputObj->iBitmapFormat));
15 years, 1 month
1
0
0
0
[khornicek] 44263: - palette support for dib sections
by khornicek@svn.reactos.org
Author: khornicek Date: Sat Nov 21 22:54:17 2009 New Revision: 44263 URL:
http://svn.reactos.org/svn/reactos?rev=44263&view=rev
Log: - palette support for dib sections Modified: branches/arwinss/reactos/subsystems/win32/win32k/gdi/bitmap.c branches/arwinss/reactos/subsystems/win32/win32k/gdi/dc.c branches/arwinss/reactos/subsystems/win32/win32k/gre/brushobj.c branches/arwinss/reactos/subsystems/win32/win32k/gre/surfobj.c branches/arwinss/reactos/subsystems/win32/win32k/include/brushobj.h branches/arwinss/reactos/subsystems/win32/win32k/swm/winman.c Modified: branches/arwinss/reactos/subsystems/win32/win32k/gdi/bitmap.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/gdi/bitmap.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/gdi/bitmap.c [iso-8859-1] Sat Nov 21 22:54:17 2009 @@ -130,6 +130,9 @@ SIZEL szSize; ULONG ulFormat; HBITMAP hbmDIB; + RGBQUAD *lpRGB = NULL; + PDC pDC; + SURFACE *dibSurf; /* Get DIB section size */ szSize.cx = dib->dsBm.bmWidth; @@ -145,6 +148,52 @@ BMF_DONTCACHE | BMF_USERMEM | BMF_NOZEROINIT | 0, dib->dsBm.bmBits); + + dib->dsBmih.biClrUsed = 0; + /* set number of entries in bmi.bmiColors table */ + if (dib->dsBmih.biBitCount == 1) + { + dib->dsBmih.biClrUsed = 2; + } + else if (dib->dsBmih.biBitCount == 4) + { + dib->dsBmih.biClrUsed = 16; + } + else if (dib->dsBmih.biBitCount == 8) + { + dib->dsBmih.biClrUsed = 256; + } + + dibSurf = SURFACE_Lock(hbmDIB); + + if (dib->dsBmih.biClrUsed != 0) + { + if (usage == DIB_PAL_COLORS) + { + pDC = DC_Lock(physDev); + lpRGB = DIB_MapPaletteColors(pDC, bmi); + DC_Unlock(pDC); + dibSurf->hDIBPalette = PALETTE_AllocPaletteIndexedRGB(dib->dsBmih.biClrUsed, lpRGB); + } + else + { + dibSurf->hDIBPalette = PALETTE_AllocPaletteIndexedRGB(dib->dsBmih.biClrUsed, bmi->bmiColors); + } + } + else + { + dibSurf->hDIBPalette = PALETTE_AllocPalette(PAL_BITFIELDS, 0, NULL, + dib->dsBitfields[0], + dib->dsBitfields[1], + dib->dsBitfields[2]); + } + + SURFACE_Unlock(dibSurf); + + if (lpRGB) + { + ExFreePoolWithTag(lpRGB, TAG_COLORMAP); + } /* Map handles */ GDI_AddHandleMapping(hbmDIB, hbitmap); Modified: branches/arwinss/reactos/subsystems/win32/win32k/gdi/dc.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/gdi/dc.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/gdi/dc.c [iso-8859-1] Sat Nov 21 22:54:17 2009 @@ -303,7 +303,7 @@ case BS_SOLID: DPRINT("BS_SOLID\n" ); - pDC->pFillBrush = GreCreateSolidBrush(pLogBrush->lbColor); + pDC->pFillBrush = GreCreateSolidBrush(pDC->pBitmap->hDIBPalette, pLogBrush->lbColor); break; case BS_HATCHED: Modified: branches/arwinss/reactos/subsystems/win32/win32k/gre/brushobj.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/gre/brushobj.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/gre/brushobj.c [iso-8859-1] Sat Nov 21 22:54:17 2009 @@ -187,7 +187,7 @@ PBRUSHGDI NTAPI -GreCreateSolidBrush(COLORREF crColor) +GreCreateSolidBrush(HPALETTE hDIBPalette, COLORREF crColor) { PBRUSHGDI pBrush; XLATEOBJ *pXlate; @@ -201,8 +201,11 @@ pBrush->flAttrs |= GDIBRUSH_IS_SOLID; /* Set color */ - // FIXME: Take hDIBPalette in account if it exists! - hPalette = pPrimarySurface->DevInfo.hpalDefault; + if(hDIBPalette) + hPalette = hDIBPalette; + else + hPalette = pPrimarySurface->DevInfo.hpalDefault; + pXlate = IntEngCreateXlate(0, PAL_RGB, hPalette, NULL); pBrush->BrushObj.iSolidColor = XLATEOBJ_iXlate(pXlate, crColor); EngDeleteXlate(pXlate); Modified: branches/arwinss/reactos/subsystems/win32/win32k/gre/surfobj.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/gre/surfobj.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/gre/surfobj.c [iso-8859-1] Sat Nov 21 22:54:17 2009 @@ -333,7 +333,7 @@ PBRUSHGDI pOldBrush = pDC->pFillBrush; /* Create a solid brush with this color */ - pDC->pFillBrush = GreCreateSolidBrush(crColor); + pDC->pFillBrush = GreCreateSolidBrush(pDC->pBitmap->hDIBPalette, crColor); /* Put pixel */ GrePatBlt(pDC, x, y, 1, 1, PATCOPY, pDC->pFillBrush); Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/brushobj.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/include/brushobj.h [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/include/brushobj.h [iso-8859-1] Sat Nov 21 22:54:17 2009 @@ -60,7 +60,7 @@ GreCreateHatchedBrush(INT iHatchStyle, COLORREF crColor); PBRUSHGDI NTAPI -GreCreateSolidBrush(COLORREF crColor); +GreCreateSolidBrush(HPALETTE hDIBPalette, COLORREF crColor); PBRUSHGDI NTAPI GreCreatePatternBrush(HBITMAP hbmPattern); Modified: branches/arwinss/reactos/subsystems/win32/win32k/swm/winman.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/swm/winman.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/swm/winman.c [iso-8859-1] Sat Nov 21 22:54:17 2009 @@ -878,7 +878,7 @@ RosGdiCreateDC(&RosDc, &ScreenDc, L"", L"", L"", NULL); /* Create a pen and select it */ - Brush = GreCreateSolidBrush(RGB(0xFF, 0, 0)); + Brush = GreCreateSolidBrush(NULL, RGB(0xFF, 0, 0)); /* Get a pointer to the DC */ pDC = DC_Lock(ScreenDc); @@ -897,7 +897,7 @@ /* Clear the area */ BrushBack = pDC->pFillBrush; - pDC->pFillBrush = GreCreateSolidBrush(RGB(0,0,0)); + pDC->pFillBrush = GreCreateSolidBrush(NULL, RGB(0,0,0)); GreRectangle(pDC, 0, 0, 800/4, 600/4); GreFreeBrush(pDC->pFillBrush); pDC->pFillBrush = BrushBack;
15 years, 1 month
1
0
0
0
[fireball] 44262: - Merge 44261: "Don't export unnecessary stub. Fixes Firefox 3.5.5 startup."
by fireball@svn.reactos.org
Author: fireball Date: Sat Nov 21 21:42:54 2009 New Revision: 44262 URL:
http://svn.reactos.org/svn/reactos?rev=44262&view=rev
Log: - Merge 44261: "Don't export unnecessary stub. Fixes Firefox 3.5.5 startup." Modified: branches/arwinss/reactos/dll/win32/kernel32/kernel32.pspec (contents, props changed) Modified: branches/arwinss/reactos/dll/win32/kernel32/kernel32.pspec URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/kerne…
============================================================================== --- branches/arwinss/reactos/dll/win32/kernel32/kernel32.pspec [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/kernel32/kernel32.pspec [iso-8859-1] Sat Nov 21 21:42:54 2009 @@ -627,7 +627,7 @@ @ stdcall LocalShrink(long long) @ stdcall LocalSize(long) @ stdcall LocalUnlock(long) -@ stub LocaleNameToLCID ; missing in XP SP3 +;@ stub LocaleNameToLCID ; missing in XP SP3 @ stdcall LockFile(long long long long long) @ stdcall LockFileEx(long long long long long ptr) @ stdcall LockResource(long) Propchange: branches/arwinss/reactos/dll/win32/kernel32/kernel32.pspec ------------------------------------------------------------------------------ --- svn:mergeinfo (added) +++ svn:mergeinfo Sat Nov 21 21:42:54 2009 @@ -1,0 +1,2 @@ +/branches/ros-amd64-bringup/reactos/dll/win32/kernel32/kernel32.pspec:34711-34712,34743,34812,34839,34842,34917,35323-35324,35347-35348,35361,35436,35509,35515,35588,35739,35746,35771,35789,35823,35902,35904-35906,35942,35947-35949,35952-35953,35966,36013,36360,36388-36389,36570,36614,36930,37323,37434,37472,37475,37536,37820-37821,37869,37873,37990-37991,38013-38014,38148,38151,38265,38268,39151,39333,39345,40991,41000,41027-41028,41050,41052,41082-41086,41549,43080,43426,43454 +/trunk/reactos/dll/win32/kernel32/kernel32.pspec:42000-43670,44261
15 years, 1 month
1
0
0
0
[fireball] 44261: [kernel32] - Don't export unnecessary stub. Fixes Firefox 3.5.5 startup.
by fireball@svn.reactos.org
Author: fireball Date: Sat Nov 21 21:41:24 2009 New Revision: 44261 URL:
http://svn.reactos.org/svn/reactos?rev=44261&view=rev
Log: [kernel32] - Don't export unnecessary stub. Fixes Firefox 3.5.5 startup. Modified: trunk/reactos/dll/win32/kernel32/kernel32.pspec Modified: trunk/reactos/dll/win32/kernel32/kernel32.pspec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/kernel3…
============================================================================== --- trunk/reactos/dll/win32/kernel32/kernel32.pspec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/kernel32.pspec [iso-8859-1] Sat Nov 21 21:41:24 2009 @@ -627,7 +627,7 @@ @ stdcall LocalShrink(long long) @ stdcall LocalSize(long) @ stdcall LocalUnlock(long) -@ stub LocaleNameToLCID ; missing in XP SP3 +;@ stub LocaleNameToLCID ; missing in XP SP3 @ stdcall LockFile(long long long long long) @ stdcall LockFileEx(long long long long long ptr) @ stdcall LockResource(long)
15 years, 1 month
1
0
0
0
[fireball] 44260: [ntoskrnl/se] - Factor out working code from SeAccessCheck into SepAccessCheck, taking out addition parameter - LowerImpersonationLevel. The lowest level for SeAccessCheck remains SecurityImpersonation, but for NtAccessCheck it's lowered to SecurityIdentification. Name of this patch's author has been lost. See issue #4169 for more details.
by fireball@svn.reactos.org
Author: fireball Date: Sat Nov 21 18:58:33 2009 New Revision: 44260 URL:
http://svn.reactos.org/svn/reactos?rev=44260&view=rev
Log: [ntoskrnl/se] - Factor out working code from SeAccessCheck into SepAccessCheck, taking out addition parameter - LowerImpersonationLevel. The lowest level for SeAccessCheck remains SecurityImpersonation, but for NtAccessCheck it's lowered to SecurityIdentification. Name of this patch's author has been lost. See issue #4169 for more details. Modified: trunk/reactos/ntoskrnl/se/semgr.c Modified: trunk/reactos/ntoskrnl/se/semgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/semgr.c?rev=44…
============================================================================== --- trunk/reactos/ntoskrnl/se/semgr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/se/semgr.c [iso-8859-1] Sat Nov 21 18:58:33 2009 @@ -348,6 +348,273 @@ } } +BOOLEAN NTAPI +SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor, + IN PSECURITY_SUBJECT_CONTEXT SubjectSecurityContext, + IN BOOLEAN SubjectContextLocked, + IN ACCESS_MASK DesiredAccess, + IN ACCESS_MASK PreviouslyGrantedAccess, + OUT PPRIVILEGE_SET* Privileges, + IN PGENERIC_MAPPING GenericMapping, + IN KPROCESSOR_MODE AccessMode, + OUT PACCESS_MASK GrantedAccess, + OUT PNTSTATUS AccessStatus, + SECURITY_IMPERSONATION_LEVEL LowestImpersonationLevel) +{ + LUID_AND_ATTRIBUTES Privilege; + ACCESS_MASK CurrentAccess, AccessMask; + PACCESS_TOKEN Token; + ULONG i; + PACL Dacl; + BOOLEAN Present; + BOOLEAN Defaulted; + PACE CurrentAce; + PSID Sid; + NTSTATUS Status; + PAGED_CODE(); + + /* Check if this is kernel mode */ + if (AccessMode == KernelMode) + { + /* Check if kernel wants everything */ + if (DesiredAccess & MAXIMUM_ALLOWED) + { + /* Give it */ + *GrantedAccess = GenericMapping->GenericAll; + *GrantedAccess |= (DesiredAccess &~ MAXIMUM_ALLOWED); + *GrantedAccess |= PreviouslyGrantedAccess; + } + else + { + /* Give the desired and previous access */ + *GrantedAccess = DesiredAccess | PreviouslyGrantedAccess; + } + + /* Success */ + *AccessStatus = STATUS_SUCCESS; + return TRUE; + } + + /* Check if we didn't get an SD */ + if (!SecurityDescriptor) + { + /* Automatic failure */ + *AccessStatus = STATUS_ACCESS_DENIED; + return FALSE; + } + + /* Check for invalid impersonation */ + if ((SubjectSecurityContext->ClientToken) && + (SubjectSecurityContext->ImpersonationLevel < LowestImpersonationLevel)) + { + *AccessStatus = STATUS_BAD_IMPERSONATION_LEVEL; + return FALSE; + } + + /* Check for no access desired */ + if (!DesiredAccess) + { + /* Check if we had no previous access */ + if (!PreviouslyGrantedAccess) + { + /* Then there's nothing to give */ + *AccessStatus = STATUS_ACCESS_DENIED; + return FALSE; + } + + /* Return the previous access only */ + *GrantedAccess = PreviouslyGrantedAccess; + *AccessStatus = STATUS_SUCCESS; + *Privileges = NULL; + return TRUE; + } + + /* Acquire the lock if needed */ + if (!SubjectContextLocked) SeLockSubjectContext(SubjectSecurityContext); + + /* Map given accesses */ + RtlMapGenericMask(&DesiredAccess, GenericMapping); + if (PreviouslyGrantedAccess) + RtlMapGenericMask(&PreviouslyGrantedAccess, GenericMapping); + + + + CurrentAccess = PreviouslyGrantedAccess; + + + + Token = SubjectSecurityContext->ClientToken ? + SubjectSecurityContext->ClientToken : SubjectSecurityContext->PrimaryToken; + + /* Get the DACL */ + Status = RtlGetDaclSecurityDescriptor(SecurityDescriptor, + &Present, + &Dacl, + &Defaulted); + if (!NT_SUCCESS(Status)) + { + if (SubjectContextLocked == FALSE) + { + SeUnlockSubjectContext(SubjectSecurityContext); + } + + *AccessStatus = Status; + return FALSE; + } + + /* RULE 1: Grant desired access if the object is unprotected */ + if (Present == TRUE && Dacl == NULL) + { + if (SubjectContextLocked == FALSE) + { + SeUnlockSubjectContext(SubjectSecurityContext); + } + + *GrantedAccess = DesiredAccess; + *AccessStatus = STATUS_SUCCESS; + return TRUE; + } + + CurrentAccess = PreviouslyGrantedAccess; + + /* RULE 2: Check token for 'take ownership' privilege */ + Privilege.Luid = SeTakeOwnershipPrivilege; + Privilege.Attributes = SE_PRIVILEGE_ENABLED; + + if (SepPrivilegeCheck(Token, + &Privilege, + 1, + PRIVILEGE_SET_ALL_NECESSARY, + AccessMode)) + { + CurrentAccess |= WRITE_OWNER; + if ((DesiredAccess & ~VALID_INHERIT_FLAGS) == + (CurrentAccess & ~VALID_INHERIT_FLAGS)) + { + if (SubjectContextLocked == FALSE) + { + SeUnlockSubjectContext(SubjectSecurityContext); + } + + *GrantedAccess = CurrentAccess; + *AccessStatus = STATUS_SUCCESS; + return TRUE; + } + } + + /* RULE 3: Check whether the token is the owner */ + Status = RtlGetOwnerSecurityDescriptor(SecurityDescriptor, + &Sid, + &Defaulted); + if (!NT_SUCCESS(Status)) + { + DPRINT1("RtlGetOwnerSecurityDescriptor() failed (Status %lx)\n", Status); + if (SubjectContextLocked == FALSE) + { + SeUnlockSubjectContext(SubjectSecurityContext); + } + + *AccessStatus = Status; + return FALSE; + } + + if (Sid && SepSidInToken(Token, Sid)) + { + CurrentAccess |= (READ_CONTROL | WRITE_DAC); + if ((DesiredAccess & ~VALID_INHERIT_FLAGS) == + (CurrentAccess & ~VALID_INHERIT_FLAGS)) + { + if (SubjectContextLocked == FALSE) + { + SeUnlockSubjectContext(SubjectSecurityContext); + } + + *GrantedAccess = CurrentAccess; + *AccessStatus = STATUS_SUCCESS; + return TRUE; + } + } + + /* Fail if DACL is absent */ + if (Present == FALSE) + { + if (SubjectContextLocked == FALSE) + { + SeUnlockSubjectContext(SubjectSecurityContext); + } + + *GrantedAccess = 0; + *AccessStatus = STATUS_ACCESS_DENIED; + return FALSE; + } + + /* RULE 4: Grant rights according to the DACL */ + CurrentAce = (PACE)(Dacl + 1); + for (i = 0; i < Dacl->AceCount; i++) + { + Sid = (PSID)(CurrentAce + 1); + if (CurrentAce->Header.AceType == ACCESS_DENIED_ACE_TYPE) + { + if (SepSidInToken(Token, Sid)) + { + if (SubjectContextLocked == FALSE) + { + SeUnlockSubjectContext(SubjectSecurityContext); + } + + *GrantedAccess = 0; + *AccessStatus = STATUS_ACCESS_DENIED; + return FALSE; + } + } + + else if (CurrentAce->Header.AceType == ACCESS_ALLOWED_ACE_TYPE) + { + if (SepSidInToken(Token, Sid)) + { + AccessMask = CurrentAce->AccessMask; + RtlMapGenericMask(&AccessMask, GenericMapping); + CurrentAccess |= AccessMask; + } + } + else + { + DPRINT1("Unknown Ace type 0x%lx\n", CurrentAce->Header.AceType); + } + CurrentAce = (PACE)((ULONG_PTR)CurrentAce + CurrentAce->Header.AceSize); + } + + if (SubjectContextLocked == FALSE) + { + SeUnlockSubjectContext(SubjectSecurityContext); + } + + DPRINT("CurrentAccess %08lx\n DesiredAccess %08lx\n", + CurrentAccess, DesiredAccess); + + *GrantedAccess = CurrentAccess & DesiredAccess; + + if (DesiredAccess & MAXIMUM_ALLOWED) + { + *GrantedAccess = CurrentAccess; + *AccessStatus = STATUS_SUCCESS; + return TRUE; + } + else if ((*GrantedAccess & ~VALID_INHERIT_FLAGS) == + (DesiredAccess & ~VALID_INHERIT_FLAGS)) + { + *AccessStatus = STATUS_SUCCESS; + return TRUE; + } + else + { + DPRINT1("Denying access for caller: granted 0x%lx, desired 0x%lx (generic mapping %p)\n", + *GrantedAccess, DesiredAccess, GenericMapping); + *AccessStatus = STATUS_ACCESS_DENIED; + return FALSE; + } +} + /* PUBLIC FUNCTIONS ***********************************************************/ /* @@ -365,258 +632,18 @@ OUT PACCESS_MASK GrantedAccess, OUT PNTSTATUS AccessStatus) { - LUID_AND_ATTRIBUTES Privilege; - ACCESS_MASK CurrentAccess, AccessMask; - PACCESS_TOKEN Token; - ULONG i; - PACL Dacl; - BOOLEAN Present; - BOOLEAN Defaulted; - PACE CurrentAce; - PSID Sid; - NTSTATUS Status; - PAGED_CODE(); - - /* Check if this is kernel mode */ - if (AccessMode == KernelMode) - { - /* Check if kernel wants everything */ - if (DesiredAccess & MAXIMUM_ALLOWED) - { - /* Give it */ - *GrantedAccess = GenericMapping->GenericAll; - *GrantedAccess |= (DesiredAccess &~ MAXIMUM_ALLOWED); - *GrantedAccess |= PreviouslyGrantedAccess; - } - else - { - /* Give the desired and previous access */ - *GrantedAccess = DesiredAccess | PreviouslyGrantedAccess; - } - - /* Success */ - *AccessStatus = STATUS_SUCCESS; - return TRUE; - } - - /* Check if we didn't get an SD */ - if (!SecurityDescriptor) - { - /* Automatic failure */ - *AccessStatus = STATUS_ACCESS_DENIED; - return FALSE; - } - - /* Check for invalid impersonation */ - if ((SubjectSecurityContext->ClientToken) && - (SubjectSecurityContext->ImpersonationLevel < SecurityImpersonation)) - { - *AccessStatus = STATUS_BAD_IMPERSONATION_LEVEL; - return FALSE; - } - - /* Check for no access desired */ - if (!DesiredAccess) - { - /* Check if we had no previous access */ - if (!PreviouslyGrantedAccess) - { - /* Then there's nothing to give */ - *AccessStatus = STATUS_ACCESS_DENIED; - return FALSE; - } - - /* Return the previous access only */ - *GrantedAccess = PreviouslyGrantedAccess; - *AccessStatus = STATUS_SUCCESS; - *Privileges = NULL; - return TRUE; - } - - /* Acquire the lock if needed */ - if (!SubjectContextLocked) SeLockSubjectContext(SubjectSecurityContext); - - /* Map given accesses */ - RtlMapGenericMask(&DesiredAccess, GenericMapping); - if (PreviouslyGrantedAccess) - RtlMapGenericMask(&PreviouslyGrantedAccess, GenericMapping); - - - - CurrentAccess = PreviouslyGrantedAccess; - - - - Token = SubjectSecurityContext->ClientToken ? - SubjectSecurityContext->ClientToken : SubjectSecurityContext->PrimaryToken; - - /* Get the DACL */ - Status = RtlGetDaclSecurityDescriptor(SecurityDescriptor, - &Present, - &Dacl, - &Defaulted); - if (!NT_SUCCESS(Status)) - { - if (SubjectContextLocked == FALSE) - { - SeUnlockSubjectContext(SubjectSecurityContext); - } - - *AccessStatus = Status; - return FALSE; - } - - /* RULE 1: Grant desired access if the object is unprotected */ - if (Present == TRUE && Dacl == NULL) - { - if (SubjectContextLocked == FALSE) - { - SeUnlockSubjectContext(SubjectSecurityContext); - } - - *GrantedAccess = DesiredAccess; - *AccessStatus = STATUS_SUCCESS; - return TRUE; - } - - CurrentAccess = PreviouslyGrantedAccess; - - /* RULE 2: Check token for 'take ownership' privilege */ - Privilege.Luid = SeTakeOwnershipPrivilege; - Privilege.Attributes = SE_PRIVILEGE_ENABLED; - - if (SepPrivilegeCheck(Token, - &Privilege, - 1, - PRIVILEGE_SET_ALL_NECESSARY, - AccessMode)) - { - CurrentAccess |= WRITE_OWNER; - if ((DesiredAccess & ~VALID_INHERIT_FLAGS) == - (CurrentAccess & ~VALID_INHERIT_FLAGS)) - { - if (SubjectContextLocked == FALSE) - { - SeUnlockSubjectContext(SubjectSecurityContext); - } - - *GrantedAccess = CurrentAccess; - *AccessStatus = STATUS_SUCCESS; - return TRUE; - } - } - - /* RULE 3: Check whether the token is the owner */ - Status = RtlGetOwnerSecurityDescriptor(SecurityDescriptor, - &Sid, - &Defaulted); - if (!NT_SUCCESS(Status)) - { - DPRINT1("RtlGetOwnerSecurityDescriptor() failed (Status %lx)\n", Status); - if (SubjectContextLocked == FALSE) - { - SeUnlockSubjectContext(SubjectSecurityContext); - } - - *AccessStatus = Status; - return FALSE; - } - - if (Sid && SepSidInToken(Token, Sid)) - { - CurrentAccess |= (READ_CONTROL | WRITE_DAC); - if ((DesiredAccess & ~VALID_INHERIT_FLAGS) == - (CurrentAccess & ~VALID_INHERIT_FLAGS)) - { - if (SubjectContextLocked == FALSE) - { - SeUnlockSubjectContext(SubjectSecurityContext); - } - - *GrantedAccess = CurrentAccess; - *AccessStatus = STATUS_SUCCESS; - return TRUE; - } - } - - /* Fail if DACL is absent */ - if (Present == FALSE) - { - if (SubjectContextLocked == FALSE) - { - SeUnlockSubjectContext(SubjectSecurityContext); - } - - *GrantedAccess = 0; - *AccessStatus = STATUS_ACCESS_DENIED; - return FALSE; - } - - /* RULE 4: Grant rights according to the DACL */ - CurrentAce = (PACE)(Dacl + 1); - for (i = 0; i < Dacl->AceCount; i++) - { - Sid = (PSID)(CurrentAce + 1); - if (CurrentAce->Header.AceType == ACCESS_DENIED_ACE_TYPE) - { - if (SepSidInToken(Token, Sid)) - { - if (SubjectContextLocked == FALSE) - { - SeUnlockSubjectContext(SubjectSecurityContext); - } - - *GrantedAccess = 0; - *AccessStatus = STATUS_ACCESS_DENIED; - return FALSE; - } - } - - else if (CurrentAce->Header.AceType == ACCESS_ALLOWED_ACE_TYPE) - { - if (SepSidInToken(Token, Sid)) - { - AccessMask = CurrentAce->AccessMask; - RtlMapGenericMask(&AccessMask, GenericMapping); - CurrentAccess |= AccessMask; - } - } - else - { - DPRINT1("Unknown Ace type 0x%lx\n", CurrentAce->Header.AceType); - } - CurrentAce = (PACE)((ULONG_PTR)CurrentAce + CurrentAce->Header.AceSize); - } - - if (SubjectContextLocked == FALSE) - { - SeUnlockSubjectContext(SubjectSecurityContext); - } - - DPRINT("CurrentAccess %08lx\n DesiredAccess %08lx\n", - CurrentAccess, DesiredAccess); - - *GrantedAccess = CurrentAccess & DesiredAccess; - - if (DesiredAccess & MAXIMUM_ALLOWED) - { - *GrantedAccess = CurrentAccess; - *AccessStatus = STATUS_SUCCESS; - return TRUE; - } - else if ((*GrantedAccess & ~VALID_INHERIT_FLAGS) == - (DesiredAccess & ~VALID_INHERIT_FLAGS)) - { - *AccessStatus = STATUS_SUCCESS; - return TRUE; - } - else - { - DPRINT1("Denying access for caller: granted 0x%lx, desired 0x%lx (generic mapping %p)\n", - *GrantedAccess, DesiredAccess, GenericMapping); - *AccessStatus = STATUS_ACCESS_DENIED; - return FALSE; - } + /* Call the internal function */ + return SepAccessCheck(SecurityDescriptor, + SubjectSecurityContext, + SubjectContextLocked, + DesiredAccess, + PreviouslyGrantedAccess, + Privileges, + GenericMapping, + AccessMode, + GrantedAccess, + AccessStatus, + SecurityImpersonation); } /* SYSTEM CALLS ***************************************************************/ @@ -691,16 +718,17 @@ SeLockSubjectContext(&SubjectSecurityContext); /* Now perform the access check */ - SeAccessCheck(SecurityDescriptor, - &SubjectSecurityContext, - TRUE, - DesiredAccess, - 0, - &PrivilegeSet, //FIXME - GenericMapping, - PreviousMode, - GrantedAccess, - AccessStatus); + SepAccessCheck(SecurityDescriptor, + &SubjectSecurityContext, + TRUE, + DesiredAccess, + 0, + &PrivilegeSet, //FIXME + GenericMapping, + PreviousMode, + GrantedAccess, + AccessStatus, + SecurityIdentification); /* Unlock subject context and dereference the token */ SeUnlockSubjectContext(&SubjectSecurityContext);
15 years, 1 month
1
0
0
0
[tkreuzer] 44259: ULONG -> ULONG_PTR
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Nov 21 16:56:05 2009 New Revision: 44259 URL:
http://svn.reactos.org/svn/reactos?rev=44259&view=rev
Log: ULONG -> ULONG_PTR Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/anonmem.c Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/anonmem.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/anonmem.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/anonmem.c [iso-8859-1] Sat Nov 21 16:56:05 2009 @@ -737,10 +737,10 @@ MemoryAreaLength = (ULONG_PTR)MemoryArea->EndingAddress - (ULONG_PTR)MemoryArea->StartingAddress; - if (((ULONG)BaseAddress + RegionSize) > (ULONG)MemoryArea->EndingAddress) + if (((ULONG_PTR)BaseAddress + RegionSize) > (ULONG_PTR)MemoryArea->EndingAddress) { DPRINT("BaseAddress + RegionSize %x is larger than MemoryArea's EndingAddress %x\n", - (ULONG)BaseAddress + RegionSize, MemoryArea->EndingAddress); + (ULONG_PTR)BaseAddress + RegionSize, MemoryArea->EndingAddress); MmUnlockAddressSpace(AddressSpace); ObDereferenceObject(Process);
15 years, 1 month
1
0
0
0
[tkreuzer] 44258: - MmArmAccessFault: Don't assume that PDE's are accessible, instead use MiIsPdeForAddressValid - Use HYPER_SPACE_END / MI_PFN_DATABASE constants instead of hardcoded values - Remove the MmAccessFault hack, it works now.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Nov 21 16:52:28 2009 New Revision: 44258 URL:
http://svn.reactos.org/svn/reactos?rev=44258&view=rev
Log: - MmArmAccessFault: Don't assume that PDE's are accessible, instead use MiIsPdeForAddressValid - Use HYPER_SPACE_END / MI_PFN_DATABASE constants instead of hardcoded values - Remove the MmAccessFault hack, it works now. Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/mm.h branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/i386/mm.h branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S branches/ros-amd64-bringup/reactos/ntoskrnl/mm/ARM3/pagfault.c branches/ros-amd64-bringup/reactos/ntoskrnl/mm/amd64/init.c Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/mm.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/mm.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/mm.h [iso-8859-1] Sat Nov 21 16:52:28 2009 @@ -18,6 +18,7 @@ #define MI_SYSTEM_PTE_START (PVOID)0xFFFFFAA000000000ULL #define MI_PAGED_POOL_START (PVOID)0xFFFFFA8000000000ULL #define MI_NON_PAGED_SYSTEM_START_MIN 0xFFFFFAA000000000ULL +#define MI_PFN_DATABASE (PVOID)0xFFFFFAC000000000ULL #define MI_NONPAGED_POOL_END (PVOID)0xFFFFFAE000000000ULL #define MI_DEBUG_MAPPING (PVOID)0xFFFFFFFF80000000ULL // FIXME #define MI_HIGHEST_SYSTEM_ADDRESS (PVOID)0xFFFFFFFFFFFFFFFFULL @@ -78,6 +79,15 @@ Temp <<= 25; Temp >>= 16; return (PVOID)Temp; +} + +BOOLEAN +FORCEINLINE +MiIsPdeForAddressValid(PVOID Address) +{ + return ((MiAddressToPxe(Address)->u.Hard.Valid) && + (MiAddressToPpe(Address)->u.Hard.Valid) && + (MiAddressToPde(Address)->u.Hard.Valid)); } //#define ADDR_TO_PAGE_TABLE(v) (((ULONG)(v)) / (1024 * PAGE_SIZE)) Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/i386/mm.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/i386/mm.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/i386/mm.h [iso-8859-1] Sat Nov 21 16:52:28 2009 @@ -34,6 +34,7 @@ // Convert a PTE into a corresponding address // #define MiPteToAddress(PTE) ((PVOID)((ULONG)(PTE) << 10)) +#define MiIsPdeForAddressValid(Pde) (MiAddressToPde(Address)->u.Hard.Valid) #define ADDR_TO_PAGE_TABLE(v) (((ULONG)(v)) / (1024 * PAGE_SIZE)) #define ADDR_TO_PDE_OFFSET(v) ((((ULONG)(v)) / (1024 * PAGE_SIZE))) Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S [iso-8859-1] Sat Nov 21 16:52:28 2009 @@ -544,10 +544,7 @@ mov r8b, [rbp + KTRAP_FRAME_SegCs] // Mode and r8b, 1 mov r9, rbp // TrapInformation -// call _MmAccessFault - - // HACK - mov eax, STATUS_ACCESS_VIOLATION + call _MmAccessFault /* Check for success */ test eax, eax Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/ARM3/pagfault.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/ARM3/pagfault.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/ARM3/pagfault.c [iso-8859-1] Sat Nov 21 16:52:28 2009 @@ -200,7 +200,7 @@ IN PVOID TrapInformation) { KIRQL OldIrql = KeGetCurrentIrql(), LockIrql; - PMMPTE PointerPde, PointerPte; + PMMPTE PointerPte; MMPTE TempPte; PETHREAD CurrentThread; NTSTATUS Status; @@ -210,7 +210,6 @@ // Get the PTE and PDE // PointerPte = MiAddressToPte(Address); - PointerPde = MiAddressToPde(Address); // // Check for dispatch-level snafu @@ -239,7 +238,7 @@ // // Is the PDE valid? // - if (!PointerPde->u.Hard.Valid == 0) + if (!MiIsPdeForAddressValid(Address)) { // // Debug spew (eww!) @@ -254,7 +253,7 @@ // // Now we SHOULD be good // - if (PointerPde->u.Hard.Valid == 0) + if (!MiIsPdeForAddressValid(Address)) { // // FIXFIX: Do the S-LIST hack @@ -297,9 +296,8 @@ // // Check for a fault on the page table or hyperspace itself - // FIXME: Use MmHyperSpaceEnd - // - if ((Address >= (PVOID)PTE_BASE) && (Address <= (PVOID)0xC0800000)) + // + if ((Address >= (PVOID)PTE_BASE) && (Address <= (PVOID)HYPER_SPACE_END)) { // // This might happen...not sure yet Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/amd64/init.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/amd64/init.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/amd64/init.c [iso-8859-1] Sat Nov 21 16:52:28 2009 @@ -242,6 +242,7 @@ } VOID +NTAPI MxMapPage(PVOID Address) { MMPTE TmplPte, *Pte; @@ -286,8 +287,8 @@ MxPfnSizeInBytes = ROUND_TO_PAGES((MmHighestPhysicalPage + 1) * sizeof(MMPFN)); MxPfnAllocation = MxPfnSizeInBytes >> PAGE_SHIFT; - /* Sinply start at hardcoded address */ - MmPfnDatabase = (PVOID)0xFFFFFAC000000000ULL; + /* Simply start at hardcoded address */ + MmPfnDatabase = MI_PFN_DATABASE; /* Loop the memory descriptors */ for (ListEntry = LoaderBlock->MemoryDescriptorListHead.Flink; @@ -363,8 +364,7 @@ MiInitializePageTable() { ULONG64 PageFrameOffset; - PMMPTE Pte, StartPte, EndPte; - MMPTE TmplPte; + MMPTE TmplPte, *Pte; PFN_NUMBER PageCount; /* HACK: don't use freeldr debug print anymore */ @@ -382,12 +382,10 @@ __writecr4(__readcr4() | CR4_PGE); ASSERT(__readcr4() & CR4_PGE); - /* Set user mode address range */ - StartPte = MiAddressToPxe(0); - EndPte = MiAddressToPxe(MmHighestUserAddress); - /* Loop the user mode PXEs */ - for (Pte = StartPte; Pte <= EndPte; Pte++) + for (Pte = MiAddressToPxe(0); + Pte <= MiAddressToPxe(MmHighestUserAddress); + Pte++) { /* Zero the PXE, clear all mappings */ Pte->u.Long = 0; @@ -405,12 +403,10 @@ /* Create PDPTs (72 KB) for shared system address space, * skip page tables and hyperspace */ - /* Set the range */ - StartPte = MiAddressToPxe((PVOID)(HYPER_SPACE_END + 1)); - EndPte = MiAddressToPxe(MI_HIGHEST_SYSTEM_ADDRESS); - /* Loop the PXEs */ - for (Pte = StartPte; Pte <= EndPte; Pte++) + for (Pte = MiAddressToPxe((PVOID)(HYPER_SPACE_END + 1)); + Pte <= MiAddressToPxe(MI_HIGHEST_SYSTEM_ADDRESS); + Pte++) { /* Is the PXE already valid? */ if (!Pte->u.Hard.Valid) @@ -764,7 +760,6 @@ ExAllocatePoolWithTag(NonPagedPool, Size, ' mM'); ASSERT(MmPagedPoolInfo.PagedPoolAllocationMap); - DPRINT1("BitMapSize = 0x%lx, Size = 0x%lx\n", BitMapSize, Size); // Initialize it such that at first, only the first page's worth of PTEs is // marked as allocated (incidentially, the first PDE we allocated earlier). RtlInitializeBitMap(MmPagedPoolInfo.PagedPoolAllocationMap, @@ -781,9 +776,6 @@ ExAllocatePoolWithTag(NonPagedPool, Size, ' mM'); ASSERT(MmPagedPoolInfo.EndOfPagedPoolBitmap); - DPRINT1("PagedPoolAllocationMap=%p, EndOfPagedPoolBitmap=%p\n", - MmPagedPoolInfo.PagedPoolAllocationMap, MmPagedPoolInfo.EndOfPagedPoolBitmap); - /* Initialize the bitmap */ RtlInitializeBitMap(MmPagedPoolInfo.EndOfPagedPoolBitmap, (PULONG)(MmPagedPoolInfo.EndOfPagedPoolBitmap + 1),
15 years, 1 month
1
0
0
0
[tkreuzer] 44257: PFN_TYPE -> PFN_NUMBER
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Nov 21 16:43:26 2009 New Revision: 44257 URL:
http://svn.reactos.org/svn/reactos?rev=44257&view=rev
Log: PFN_TYPE -> PFN_NUMBER Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/cc/copy.c branches/ros-amd64-bringup/reactos/ntoskrnl/cc/view.c branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/mm.h branches/ros-amd64-bringup/reactos/ntoskrnl/mm/ARM3/iosup.c branches/ros-amd64-bringup/reactos/ntoskrnl/mm/amd64/page.c branches/ros-amd64-bringup/reactos/ntoskrnl/mm/anonmem.c branches/ros-amd64-bringup/reactos/ntoskrnl/mm/arm/stubs.c branches/ros-amd64-bringup/reactos/ntoskrnl/mm/balance.c branches/ros-amd64-bringup/reactos/ntoskrnl/mm/freelist.c branches/ros-amd64-bringup/reactos/ntoskrnl/mm/i386/page.c branches/ros-amd64-bringup/reactos/ntoskrnl/mm/i386/pagepae.c branches/ros-amd64-bringup/reactos/ntoskrnl/mm/marea.c branches/ros-amd64-bringup/reactos/ntoskrnl/mm/mmfault.c branches/ros-amd64-bringup/reactos/ntoskrnl/mm/mpw.c branches/ros-amd64-bringup/reactos/ntoskrnl/mm/pagefile.c branches/ros-amd64-bringup/reactos/ntoskrnl/mm/powerpc/page.c branches/ros-amd64-bringup/reactos/ntoskrnl/mm/rmap.c branches/ros-amd64-bringup/reactos/ntoskrnl/mm/section.c Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/cc/copy.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/cc/copy.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/cc/copy.c [iso-8859-1] Sat Nov 21 16:43:26 2009 @@ -15,7 +15,7 @@ /* GLOBALS *******************************************************************/ -static PFN_TYPE CcZeroPage = 0; +static PFN_NUMBER CcZeroPage = 0; #define MAX_ZERO_LENGTH (256 * 1024) #define MAX_RW_LENGTH (256 * 1024) @@ -98,7 +98,7 @@ PCACHE_SEGMENT current2; ULONG current_size; ULONG i; - PPFN_TYPE MdlPages; + PPFN_NUMBER MdlPages; /* * Count the maximum number of bytes we could read starting @@ -119,7 +119,7 @@ Mdl->MdlFlags |= (MDL_PAGES_LOCKED | MDL_IO_PAGE_READ); current2 = current; current_size = 0; - MdlPages = (PPFN_TYPE)(Mdl + 1); + MdlPages = (PPFN_NUMBER)(Mdl + 1); while (current2 != NULL && !current2->Valid && current_size < MAX_RW_LENGTH) { PVOID address = current2->BaseAddress; @@ -619,7 +619,7 @@ Mdl->MdlFlags |= (MDL_PAGES_LOCKED | MDL_IO_PAGE_READ); for (i = 0; i < ((Mdl->Size - sizeof(MDL)) / sizeof(ULONG)); i++) { - ((PPFN_TYPE)(Mdl + 1))[i] = CcZeroPage; + ((PPFN_NUMBER)(Mdl + 1))[i] = CcZeroPage; } KeInitializeEvent(&Event, NotificationEvent, FALSE); Status = IoSynchronousPageWrite(FileObject, Mdl, &WriteOffset, &Event, &Iosb); Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/cc/view.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/cc/view.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/cc/view.c [iso-8859-1] Sat Nov 21 16:43:26 2009 @@ -330,8 +330,8 @@ KeReleaseGuardedMutex(&ViewLock); for (i = 0; i < current->Bcb->CacheSegmentSize / PAGE_SIZE; i++) { - PFN_TYPE Page; - Page = (PFN_TYPE)(MmGetPhysicalAddress((char*)current->BaseAddress + i * PAGE_SIZE).QuadPart >> PAGE_SHIFT); + PFN_NUMBER Page; + Page = (PFN_NUMBER)(MmGetPhysicalAddress((char*)current->BaseAddress + i * PAGE_SIZE).QuadPart >> PAGE_SHIFT); Status = MmPageOutPhysicalAddress(Page); } KeAcquireGuardedMutex(&ViewLock); @@ -842,7 +842,7 @@ #else static VOID CcFreeCachePage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address, - PFN_TYPE Page, SWAPENTRY SwapEntry, BOOLEAN Dirty) + PFN_NUMBER Page, SWAPENTRY SwapEntry, BOOLEAN Dirty) { ASSERT(SwapEntry == 0); if (Page != 0) @@ -861,7 +861,7 @@ ULONG i; ULONG RegionSize; ULONG Base; - PFN_TYPE Page; + PFN_NUMBER Page; KIRQL oldIrql; #endif DPRINT("Freeing cache segment 0x%p\n", CacheSeg); Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/mm.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] Sat Nov 21 16:43:26 2009 @@ -54,7 +54,6 @@ struct _MM_RMAP_ENTRY; struct _MM_PAGEOP; typedef ULONG SWAPENTRY; -typedef ULONG PFN_TYPE, *PPFN_TYPE; // // MmDbgCopyMemory Flags @@ -499,7 +498,7 @@ PVOID Context, PMEMORY_AREA MemoryArea, PVOID Address, - PFN_TYPE Page, + PFN_NUMBER Page, SWAPENTRY SwapEntry, BOOLEAN Dirty ); @@ -721,7 +720,7 @@ NTAPI MmBuildMdlFromPages( PMDL Mdl, - PULONG Pages + PPFN_NUMBER Pages ); /* mminit.c ******************************************************************/ @@ -771,7 +770,7 @@ NTAPI MmReadFromSwapPage( SWAPENTRY SwapEntry, - PFN_TYPE Page + PFN_NUMBER Page ); BOOLEAN @@ -782,7 +781,7 @@ NTAPI MmWriteToSwapPage( SWAPENTRY SwapEntry, - PFN_TYPE Page + PFN_NUMBER Page ); NTSTATUS @@ -950,18 +949,18 @@ PVOID NTAPI -ExAllocatePageWithPhysPage(PFN_TYPE Page); +ExAllocatePageWithPhysPage(PFN_NUMBER Page); NTSTATUS NTAPI MiCopyFromUserPage( - PFN_TYPE Page, + PFN_NUMBER Page, PVOID SourceAddress ); NTSTATUS NTAPI -MiZeroPage(PFN_TYPE Page); +MiZeroPage(PFN_NUMBER Page); /* memsafe.s *****************************************************************/ @@ -1032,7 +1031,7 @@ NTAPI MmReleasePageMemoryConsumer( ULONG Consumer, - PFN_TYPE Page + PFN_NUMBER Page ); NTSTATUS @@ -1040,7 +1039,7 @@ MmRequestPageMemoryConsumer( ULONG Consumer, BOOLEAN MyWait, - PPFN_TYPE AllocatedPage + PPFN_NUMBER AllocatedPage ); VOID @@ -1056,18 +1055,18 @@ VOID NTAPI MmSetRmapListHeadPage( - PFN_TYPE Page, + PFN_NUMBER Page, struct _MM_RMAP_ENTRY* ListHead ); struct _MM_RMAP_ENTRY* NTAPI -MmGetRmapListHeadPage(PFN_TYPE Page); +MmGetRmapListHeadPage(PFN_NUMBER Page); VOID NTAPI MmInsertRmap( - PFN_TYPE Page, + PFN_NUMBER Page, struct _EPROCESS *Process, PVOID Address ); @@ -1075,7 +1074,7 @@ VOID NTAPI MmDeleteAllRmaps( - PFN_TYPE Page, + PFN_NUMBER Page, PVOID Context, VOID (*DeleteMapping)(PVOID Context, struct _EPROCESS *Process, PVOID Address) ); @@ -1083,7 +1082,7 @@ VOID NTAPI MmDeleteRmap( - PFN_TYPE Page, + PFN_NUMBER Page, struct _EPROCESS *Process, PVOID Address ); @@ -1094,23 +1093,23 @@ VOID NTAPI -MmSetCleanAllRmaps(PFN_TYPE Page); - -VOID -NTAPI -MmSetDirtyAllRmaps(PFN_TYPE Page); +MmSetCleanAllRmaps(PFN_NUMBER Page); + +VOID +NTAPI +MmSetDirtyAllRmaps(PFN_NUMBER Page); BOOLEAN NTAPI -MmIsDirtyPageRmap(PFN_TYPE Page); - -NTSTATUS -NTAPI -MmWritePagePhysicalAddress(PFN_TYPE Page); - -NTSTATUS -NTAPI -MmPageOutPhysicalAddress(PFN_TYPE Page); +MmIsDirtyPageRmap(PFN_NUMBER Page); + +NTSTATUS +NTAPI +MmWritePagePhysicalAddress(PFN_NUMBER Page); + +NTSTATUS +NTAPI +MmPageOutPhysicalAddress(PFN_NUMBER Page); /* freelist.c **********************************************************/ @@ -1118,7 +1117,7 @@ FORCEINLINE PMMPFN -MiGetPfnEntry(IN PFN_TYPE Pfn) +MiGetPfnEntry(IN PFN_NUMBER Pfn) { PMMPFN Page; extern RTL_BITMAP MiPfnBitMap; @@ -1149,33 +1148,33 @@ return Pfn1 - MmPfnDatabase; } -PFN_TYPE -NTAPI -MmGetLRUNextUserPage(PFN_TYPE PreviousPage); - -PFN_TYPE +PFN_NUMBER +NTAPI +MmGetLRUNextUserPage(PFN_NUMBER PreviousPage); + +PFN_NUMBER NTAPI MmGetLRUFirstUserPage(VOID); VOID NTAPI -MmInsertLRULastUserPage(PFN_TYPE Page); - -VOID -NTAPI -MmRemoveLRUUserPage(PFN_TYPE Page); - -VOID -NTAPI -MmLockPage(PFN_TYPE Page); - -VOID -NTAPI -MmUnlockPage(PFN_TYPE Page); +MmInsertLRULastUserPage(PFN_NUMBER Page); + +VOID +NTAPI +MmRemoveLRUUserPage(PFN_NUMBER Page); + +VOID +NTAPI +MmLockPage(PFN_NUMBER Page); + +VOID +NTAPI +MmUnlockPage(PFN_NUMBER Page); ULONG NTAPI -MmGetLockCountPage(PFN_TYPE Page); +MmGetLockCountPage(PFN_NUMBER Page); VOID NTAPI @@ -1189,7 +1188,7 @@ VOID ); -PFN_TYPE +PFN_NUMBER NTAPI MmGetContinuousPages( ULONG NumberOfBytes, @@ -1260,7 +1259,7 @@ MmCreateVirtualMappingForKernel( PVOID Address, ULONG flProtect, - PPFN_TYPE Pages, + PPFN_NUMBER Pages, ULONG PageCount ); @@ -1277,7 +1276,7 @@ struct _EPROCESS* Process, PVOID Address, ULONG flProtect, - PPFN_TYPE Pages, + PPFN_NUMBER Pages, ULONG PageCount ); @@ -1287,7 +1286,7 @@ struct _EPROCESS* Process, PVOID Address, ULONG flProtect, - PPFN_TYPE Pages, + PPFN_NUMBER Pages, ULONG PageCount ); @@ -1322,7 +1321,7 @@ struct _EPROCESS *Process, PVOID Address, BOOLEAN* WasDirty, - PPFN_TYPE Page + PPFN_NUMBER Page ); VOID @@ -1362,7 +1361,7 @@ VOID NTAPI MmTransferOwnershipPage( - PFN_TYPE Page, + PFN_NUMBER Page, ULONG NewConsumer ); @@ -1373,7 +1372,7 @@ PVOID Address ); -PFN_TYPE +PFN_NUMBER NTAPI MmAllocPage( ULONG Consumer, @@ -1387,34 +1386,34 @@ PHYSICAL_ADDRESS LowestAddress, PHYSICAL_ADDRESS HighestAddress, ULONG NumberOfPages, - PPFN_TYPE Pages -); - -VOID -NTAPI -MmDereferencePage(PFN_TYPE Page); - -VOID -NTAPI -MmReferencePage(PFN_TYPE Page); + PPFN_NUMBER Pages +); + +VOID +NTAPI +MmDereferencePage(PFN_NUMBER Page); + +VOID +NTAPI +MmReferencePage(PFN_NUMBER Page); ULONG NTAPI -MmGetReferenceCountPage(PFN_TYPE Page); +MmGetReferenceCountPage(PFN_NUMBER Page); BOOLEAN NTAPI -MmIsPageInUse(PFN_TYPE Page); +MmIsPageInUse(PFN_NUMBER Page); VOID NTAPI MmSetSavedSwapEntryPage( - PFN_TYPE Page, + PFN_NUMBER Page, SWAPENTRY SavedSwapEntry); SWAPENTRY NTAPI -MmGetSavedSwapEntryPage(PFN_TYPE Page); +MmGetSavedSwapEntryPage(PFN_NUMBER Page); VOID NTAPI @@ -1434,7 +1433,7 @@ PVOID Address ); -PFN_TYPE +PFN_NUMBER NTAPI MmGetPfnForProcess( struct _EPROCESS *Process, @@ -1478,7 +1477,7 @@ PVOID Address, BOOLEAN FreePage, BOOLEAN* WasDirty, - PPFN_TYPE Page + PPFN_NUMBER Page ); BOOLEAN @@ -1490,11 +1489,11 @@ VOID NTAPI -MmMarkPageMapped(PFN_TYPE Page); - -VOID -NTAPI -MmMarkPageUnmapped(PFN_TYPE Page); +MmMarkPageMapped(PFN_NUMBER Page); + +VOID +NTAPI +MmMarkPageUnmapped(PFN_NUMBER Page); VOID NTAPI Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/ARM3/iosup.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/ARM3/iosup.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/ARM3/iosup.c [iso-8859-1] Sat Nov 21 16:43:26 2009 @@ -50,7 +50,7 @@ IN MEMORY_CACHING_TYPE CacheType) { - PFN_TYPE Pfn, PageCount; + PFN_NUMBER Pfn, PageCount; PMMPTE PointerPte; PVOID BaseAddress; MMPTE TempPte; Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/amd64/page.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/amd64/page.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/amd64/page.c [iso-8859-1] Sat Nov 21 16:43:26 2009 @@ -131,7 +131,7 @@ /* FUNCTIONS ***************************************************************/ -PFN_TYPE +PFN_NUMBER NTAPI MmGetPfnForProcess(PEPROCESS Process, PVOID Address) @@ -321,7 +321,7 @@ VOID NTAPI -MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPFN_TYPE Page) +MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPFN_NUMBER Page) { UNIMPLEMENTED; } @@ -340,7 +340,7 @@ PVOID Address, BOOLEAN FreePage, BOOLEAN* WasDirty, - PPFN_TYPE Page) + PPFN_NUMBER Page) { PFN_NUMBER Pfn; PMMPTE Pte; @@ -412,7 +412,7 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, PVOID Address, ULONG flProtect, - PPFN_TYPE Pages, + PPFN_NUMBER Pages, ULONG PageCount) { UNIMPLEMENTED; @@ -424,7 +424,7 @@ MmCreateVirtualMapping(PEPROCESS Process, PVOID Address, ULONG flProtect, - PPFN_TYPE Pages, + PPFN_NUMBER Pages, ULONG PageCount) { UNIMPLEMENTED; Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/anonmem.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/anonmem.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/anonmem.c [iso-8859-1] Sat Nov 21 16:43:26 2009 @@ -53,7 +53,7 @@ PMM_PAGEOP PageOp) { SWAPENTRY SwapEntry; - PFN_TYPE Page; + PFN_NUMBER Page; NTSTATUS Status; PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace); @@ -135,7 +135,7 @@ PVOID Address, PMM_PAGEOP PageOp) { - PFN_TYPE Page; + PFN_NUMBER Page; BOOLEAN WasDirty; SWAPENTRY SwapEntry; NTSTATUS Status; @@ -253,7 +253,7 @@ * NOTES: This function is called with the address space lock held. */ { - PFN_TYPE Page; + PFN_NUMBER Page; NTSTATUS Status; PMM_REGION Region; PMM_PAGEOP PageOp; @@ -476,7 +476,7 @@ for (i=0; i < PAGE_ROUND_UP(RegionSize)/PAGE_SIZE; i++) { - PFN_TYPE Page; + PFN_NUMBER Page; if (MmIsPageSwapEntry(Process, (char*)BaseAddress + (i * PAGE_SIZE))) @@ -872,7 +872,7 @@ MmFreeVirtualMemoryPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address, - PFN_TYPE Page, + PFN_NUMBER Page, SWAPENTRY SwapEntry, BOOLEAN Dirty) { Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/arm/stubs.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/arm/stubs.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/arm/stubs.c [iso-8859-1] Sat Nov 21 16:43:26 2009 @@ -430,7 +430,7 @@ MmDisableVirtualMapping(IN PEPROCESS Process, IN PVOID Address, OUT PBOOLEAN WasDirty, - OUT PPFN_TYPE Page) + OUT PPFN_NUMBER Page) { // // TODO @@ -557,7 +557,7 @@ MmCreateVirtualMappingUnsafe(IN PEPROCESS Process, IN PVOID Address, IN ULONG Protection, - IN PPFN_TYPE Pages, + IN PPFN_NUMBER Pages, IN ULONG PageCount) { // @@ -588,7 +588,7 @@ MmCreateVirtualMapping(IN PEPROCESS Process, IN PVOID Address, IN ULONG Protection, - IN PPFN_TYPE Pages, + IN PPFN_NUMBER Pages, IN ULONG PageCount) { ULONG i; @@ -644,7 +644,7 @@ IN PVOID Address, IN BOOLEAN FreePage, OUT PBOOLEAN WasDirty, - OUT PPFN_TYPE Page) + OUT PPFN_NUMBER Page) { PMMPTE PointerPte; MMPTE Pte; @@ -712,7 +712,7 @@ return 0; } -PFN_TYPE +PFN_NUMBER NTAPI MmGetPfnForProcess(IN PEPROCESS Process, IN PVOID Address) Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/balance.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/balance.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/balance.c [iso-8859-1] Sat Nov 21 16:43:26 2009 @@ -23,7 +23,7 @@ /* TYPES ********************************************************************/ typedef struct _MM_ALLOCATION_REQUEST { - PFN_TYPE Page; + PFN_NUMBER Page; LIST_ENTRY ListEntry; KEVENT Event; } @@ -101,7 +101,7 @@ NTSTATUS NTAPI -MmReleasePageMemoryConsumer(ULONG Consumer, PFN_TYPE Page) +MmReleasePageMemoryConsumer(ULONG Consumer, PFN_NUMBER Page) { PMM_ALLOCATION_REQUEST Request; PLIST_ENTRY Entry; @@ -170,8 +170,8 @@ NTSTATUS MmTrimUserMemory(ULONG Target, ULONG Priority, PULONG NrFreedPages) { - PFN_TYPE CurrentPage; - PFN_TYPE NextPage; + PFN_NUMBER CurrentPage; + PFN_NUMBER NextPage; NTSTATUS Status; (*NrFreedPages) = 0; @@ -235,10 +235,10 @@ NTSTATUS NTAPI MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN CanWait, - PPFN_TYPE AllocatedPage) + PPFN_NUMBER AllocatedPage) { ULONG OldUsed; - PFN_TYPE Page; + PFN_NUMBER Page; KIRQL OldIrql; /* Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/freelist.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/freelist.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/freelist.c [iso-8859-1] Sat Nov 21 16:43:26 2009 @@ -105,7 +105,7 @@ /* FUNCTIONS *************************************************************/ -PFN_TYPE +PFN_NUMBER NTAPI MmGetLRUFirstUserPage(VOID) { @@ -128,7 +128,7 @@ VOID NTAPI -MmInsertLRULastUserPage(PFN_TYPE Pfn) +MmInsertLRULastUserPage(PFN_NUMBER Pfn) { KIRQL oldIrql; PPHYSICAL_PAGE Page; @@ -142,9 +142,9 @@ KeReleaseQueuedSpinLock(LockQueuePfnLock, oldIrql); } -PFN_TYPE -NTAPI -MmGetLRUNextUserPage(PFN_TYPE PreviousPfn) +PFN_NUMBER +NTAPI +MmGetLRUNextUserPage(PFN_NUMBER PreviousPfn) { PLIST_ENTRY NextListEntry; PHYSICAL_PAGE* PageDescriptor; @@ -169,7 +169,7 @@ VOID NTAPI -MmRemoveLRUUserPage(PFN_TYPE Page) +MmRemoveLRUUserPage(PFN_NUMBER Page) { RemoveEntryList(&MiGetPfnEntry(Page)->ListEntry); } @@ -815,7 +815,7 @@ VOID NTAPI -MmSetRmapListHeadPage(PFN_TYPE Pfn, struct _MM_RMAP_ENTRY* ListHead) +MmSetRmapListHeadPage(PFN_NUMBER Pfn, struct _MM_RMAP_ENTRY* ListHead) { KIRQL oldIrql; @@ -826,7 +826,7 @@ struct _MM_RMAP_ENTRY* NTAPI -MmGetRmapListHeadPage(PFN_TYPE Pfn) +MmGetRmapListHeadPage(PFN_NUMBER Pfn) { KIRQL oldIrql; struct _MM_RMAP_ENTRY* ListHead; @@ -840,7 +840,7 @@ VOID NTAPI -MmSetSavedSwapEntryPage(PFN_TYPE Pfn, SWAPENTRY SwapEntry) +MmSetSavedSwapEntryPage(PFN_NUMBER Pfn, SWAPENTRY SwapEntry) { KIRQL oldIrql; @@ -851,7 +851,7 @@ SWAPENTRY NTAPI -MmGetSavedSwapEntryPage(PFN_TYPE Pfn) +MmGetSavedSwapEntryPage(PFN_NUMBER Pfn) { SWAPENTRY SwapEntry; KIRQL oldIrql; @@ -865,7 +865,7 @@ VOID NTAPI -MmReferencePage(PFN_TYPE Pfn) +MmReferencePage(PFN_NUMBER Pfn) { PPHYSICAL_PAGE Page; @@ -889,7 +889,7 @@ ULONG NTAPI -MmGetReferenceCountPage(PFN_TYPE Pfn) +MmGetReferenceCountPage(PFN_NUMBER Pfn) { KIRQL oldIrql; ULONG RCount; @@ -914,7 +914,7 @@ BOOLEAN NTAPI -MmIsPageInUse(PFN_TYPE Pfn) +MmIsPageInUse(PFN_NUMBER Pfn) { DPRINT("MmIsPageInUse(PhysicalAddress %x)\n", Pfn << PAGE_SHIFT); @@ -924,7 +924,7 @@ VOID NTAPI -MmDereferencePage(PFN_TYPE Pfn) +MmDereferencePage(PFN_NUMBER Pfn) { PPHYSICAL_PAGE Page; @@ -984,7 +984,7 @@ ULONG NTAPI -MmGetLockCountPage(PFN_TYPE Pfn) +MmGetLockCountPage(PFN_NUMBER Pfn) { KIRQL oldIrql; ULONG CurrentLockCount; @@ -1010,7 +1010,7 @@ VOID NTAPI -MmLockPage(PFN_TYPE Pfn) +MmLockPage(PFN_NUMBER Pfn) { PPHYSICAL_PAGE Page; @@ -1029,7 +1029,7 @@ VOID NTAPI -MmUnlockPage(PFN_TYPE Pfn) +MmUnlockPage(PFN_NUMBER Pfn) { PPHYSICAL_PAGE Page; @@ -1046,11 +1046,11 @@ Page->LockCount--; } -PFN_TYPE +PFN_NUMBER NTAPI MmAllocPage(ULONG Consumer, SWAPENTRY SwapEntry) { - PFN_TYPE PfnOffset; + PFN_NUMBER PfnOffset; PLIST_ENTRY ListEntry; PPHYSICAL_PAGE PageDescriptor; BOOLEAN NeedClear = FALSE; @@ -1112,7 +1112,7 @@ NTSTATUS NTAPI -MiZeroPage(PFN_TYPE Page) +MiZeroPage(PFN_NUMBER Page) { KIRQL Irql; PVOID TempAddress; @@ -1137,7 +1137,7 @@ KIRQL oldIrql; PLIST_ENTRY ListEntry; PPHYSICAL_PAGE PageDescriptor; - PFN_TYPE Pfn; + PFN_NUMBER Pfn; ULONG Count; /* Free initial kernel memory */ Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/i386/page.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/i386/page.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/i386/page.c [iso-8859-1] Sat Nov 21 16:43:26 2009 @@ -183,7 +183,7 @@ { NTSTATUS Status; ULONG i, j; - PFN_TYPE Pfn[2]; + PFN_NUMBER Pfn[2]; PULONG_PTR PageDirectory; DPRINT("MmCopyMmInfo(Src %x, Dest %x)\n", MinWs, Process); @@ -225,7 +225,7 @@ { ULONG PdeOffset = ADDR_TO_PDE_OFFSET(Address); NTSTATUS Status; - PFN_TYPE Pfn; + PFN_NUMBER Pfn; ULONG Entry; PULONG Pt, PageDir; @@ -348,7 +348,7 @@ return 0; } -PFN_TYPE +PFN_NUMBER NTAPI MmGetPfnForProcess(PEPROCESS Process, PVOID Address) @@ -364,7 +364,7 @@ VOID NTAPI -MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPFN_TYPE Page) +MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPFN_NUMBER Page) /* * FUNCTION: Delete a virtual mapping */ @@ -426,13 +426,13 @@ VOID NTAPI MmDeleteVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN FreePage, - BOOLEAN* WasDirty, PPFN_TYPE Page) + BOOLEAN* WasDirty, PPFN_NUMBER Page) /* * FUNCTION: Delete a virtual mapping */ { BOOLEAN WasValid = FALSE; - PFN_TYPE Pfn; + PFN_NUMBER Pfn; ULONG Pte; PULONG Pt; @@ -705,7 +705,7 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, PVOID Address, ULONG flProtect, - PPFN_TYPE Pages, + PPFN_NUMBER Pages, ULONG PageCount) { ULONG Attributes; @@ -824,7 +824,7 @@ MmCreateVirtualMapping(PEPROCESS Process, PVOID Address, ULONG flProtect, - PPFN_TYPE Pages, + PPFN_NUMBER Pages, ULONG PageCount) { ULONG i; Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/i386/pagepae.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/i386/pagepae.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/i386/pagepae.c [iso-8859-1] Sat Nov 21 16:43:26 2009 @@ -348,7 +348,7 @@ { NTSTATUS Status; ULONG i, j; - PFN_TYPE Pfn[7]; + PFN_NUMBER Pfn[7]; ULONG Count; DPRINT("MmCopyMmInfo(Src %x, Dest %x)\n", MinWs, Process); @@ -459,7 +459,7 @@ { PEPROCESS CurrentProcess = PsGetCurrentProcess(); ULONG i; - PFN_TYPE Pfn; + PFN_NUMBER Pfn; DPRINT("ProcessId %d, Address %x\n", Process->UniqueProcessId, Address); if (Process != NULL && Process != CurrentProcess) @@ -521,7 +521,7 @@ MmGetPageTableForProcessForPAE(PEPROCESS Process, PVOID Address, BOOLEAN Create) { NTSTATUS Status; - PFN_TYPE Pfn; + PFN_NUMBER Pfn; ULONGLONG Entry; ULONGLONG ZeroEntry = 0LL; PULONGLONG Pt; @@ -636,7 +636,7 @@ { ULONG PdeOffset = ADDR_TO_PDE_OFFSET(Address); NTSTATUS Status; - PFN_TYPE Pfn; + PFN_NUMBER Pfn; ULONG Entry; PULONG Pt, PageDir; @@ -780,7 +780,7 @@ return 0; } -PFN_TYPE +PFN_NUMBER NTAPI MmGetPfnForProcess(PEPROCESS Process, PVOID Address) @@ -810,7 +810,7 @@ VOID NTAPI -MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPFN_TYPE Page) +MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPFN_NUMBER Page) /* * FUNCTION: Delete a virtual mapping */ @@ -931,13 +931,13 @@ VOID NTAPI MmDeleteVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN FreePage, - BOOLEAN* WasDirty, PPFN_TYPE Page) + BOOLEAN* WasDirty, PPFN_NUMBER Page) /* * FUNCTION: Delete a virtual mapping */ { BOOLEAN WasValid = FALSE; - PFN_TYPE Pfn; + PFN_NUMBER Pfn; DPRINT("MmDeleteVirtualMapping(%x, %x, %d, %x, %x)\n", Process, Address, FreePage, WasDirty, Page); @@ -1510,7 +1510,7 @@ NTAPI MmCreateVirtualMappingForKernel(PVOID Address, ULONG flProtect, - PPFN_TYPE Pages, + PPFN_NUMBER Pages, ULONG PageCount) { ULONG Attributes; @@ -1727,7 +1727,7 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, PVOID Address, ULONG flProtect, - PPFN_TYPE Pages, + PPFN_NUMBER Pages, ULONG PageCount) { ULONG Attributes; @@ -1933,7 +1933,7 @@ MmCreateVirtualMapping(PEPROCESS Process, PVOID Address, ULONG flProtect, - PPFN_TYPE Pages, + PPFN_NUMBER Pages, ULONG PageCount) { ULONG i; @@ -2114,7 +2114,7 @@ PVOID NTAPI -MmCreateHyperspaceMapping(PFN_TYPE Page) +MmCreateHyperspaceMapping(PFN_NUMBER Page) { PVOID Address; ULONG i; @@ -2241,11 +2241,11 @@ return Address; } -PFN_TYPE -NTAPI -MmChangeHyperspaceMapping(PVOID Address, PFN_TYPE NewPage) -{ - PFN_TYPE Pfn; +PFN_NUMBER +NTAPI +MmChangeHyperspaceMapping(PVOID Address, PFN_NUMBER NewPage) +{ + PFN_NUMBER Pfn; ASSERT (IS_HYPERSPACE(Address)); if (Ke386Pae) { @@ -2263,11 +2263,11 @@ return Pfn; } -PFN_TYPE +PFN_NUMBER NTAPI MmDeleteHyperspaceMapping(PVOID Address) { - PFN_TYPE Pfn; + PFN_NUMBER Pfn; ASSERT (IS_HYPERSPACE(Address)); if (Ke386Pae) { Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/marea.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/marea.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/marea.c [iso-8859-1] Sat Nov 21 16:43:26 2009 @@ -754,7 +754,7 @@ { BOOLEAN Dirty = FALSE; SWAPENTRY SwapEntry = 0; - PFN_TYPE Page = 0; + PFN_NUMBER Page = 0; if (MmIsPageSwapEntry(Process, (PVOID)Address)) { @@ -1044,7 +1044,7 @@ for (i = 0; i < PAGE_ROUND_UP(Length) / PAGE_SIZE; i++) { - PFN_TYPE Page; + PFN_NUMBER Page; Status = MmRequestPageMemoryConsumer(Consumer, TRUE, &Page); if (!NT_SUCCESS(Status)) Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/mmfault.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/mmfault.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/mmfault.c [iso-8859-1] Sat Nov 21 16:43:26 2009 @@ -304,7 +304,7 @@ MmCommitPagedPoolAddress(PVOID Address, BOOLEAN Locked) { NTSTATUS Status; - PFN_TYPE AllocatedPage; + PFN_NUMBER AllocatedPage; KIRQL OldIrql; Status = MmRequestPageMemoryConsumer(MC_PPOOL, FALSE, &AllocatedPage); Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/mpw.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/mpw.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/mpw.c [iso-8859-1] Sat Nov 21 16:43:26 2009 @@ -26,8 +26,8 @@ NTSTATUS NTAPI MmWriteDirtyPages(ULONG Target, PULONG Actual) { - PFN_TYPE Page; - PFN_TYPE NextPage; + PFN_NUMBER Page; + PFN_NUMBER NextPage; NTSTATUS Status; Page = MmGetLRUFirstUserPage(); Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/pagefile.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/pagefile.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/pagefile.c [iso-8859-1] Sat Nov 21 16:43:26 2009 @@ -119,9 +119,9 @@ VOID NTAPI -MmBuildMdlFromPages(PMDL Mdl, PPFN_TYPE Pages) -{ - memcpy(Mdl + 1, Pages, sizeof(PFN_TYPE) * (PAGE_ROUND_UP(Mdl->ByteOffset+Mdl->ByteCount)/PAGE_SIZE)); +MmBuildMdlFromPages(PMDL Mdl, PPFN_NUMBER Pages) +{ + memcpy(Mdl + 1, Pages, sizeof(PFN_NUMBER) * (PAGE_ROUND_UP(Mdl->ByteOffset+Mdl->ByteCount)/PAGE_SIZE)); /* FIXME: this flag should be set by the caller perhaps? */ Mdl->MdlFlags |= MDL_IO_PAGE_READ; @@ -215,7 +215,7 @@ NTSTATUS NTAPI -MmWriteToSwapPage(SWAPENTRY SwapEntry, PFN_TYPE Page) +MmWriteToSwapPage(SWAPENTRY SwapEntry, PFN_NUMBER Page) { ULONG i, offset; LARGE_INTEGER file_offset; @@ -276,7 +276,7 @@ NTSTATUS NTAPI -MmReadFromSwapPage(SWAPENTRY SwapEntry, PFN_TYPE Page) +MmReadFromSwapPage(SWAPENTRY SwapEntry, PFN_NUMBER Page) { ULONG i, offset; LARGE_INTEGER file_offset; Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/powerpc/page.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/powerpc/page.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/powerpc/page.c [iso-8859-1] Sat Nov 21 16:43:26 2009 @@ -191,17 +191,17 @@ return Addr; } -PFN_TYPE +PFN_NUMBER NTAPI MmGetPfnForProcess(PEPROCESS Process, PVOID Address) { - return((PFN_TYPE)MmGetPhysicalAddressProcess(Process, Address) >> PAGE_SHIFT); -} - -VOID -NTAPI -MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPFN_TYPE Page) + return((PFN_NUMBER)MmGetPhysicalAddressProcess(Process, Address) >> PAGE_SHIFT); +} + +VOID +NTAPI +MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPFN_NUMBER Page) /* * FUNCTION: Delete a virtual mapping */ @@ -221,7 +221,7 @@ VOID NTAPI MmDeleteVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN FreePage, - BOOLEAN* WasDirty, PPFN_TYPE Page) + BOOLEAN* WasDirty, PPFN_NUMBER Page) /* * FUNCTION: Delete a virtual mapping */ @@ -358,7 +358,7 @@ NTAPI MmCreateVirtualMappingForKernel(PVOID Address, ULONG flProtect, - PPFN_TYPE Pages, + PPFN_NUMBER Pages, ULONG PageCount) { ULONG i; @@ -424,7 +424,7 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, PVOID Address, ULONG flProtect, - PPFN_TYPE Pages, + PPFN_NUMBER Pages, ULONG PageCount) { ULONG Attributes; @@ -498,7 +498,7 @@ MmCreateVirtualMapping(PEPROCESS Process, PVOID Address, ULONG flProtect, - PPFN_TYPE Pages, + PPFN_NUMBER Pages, ULONG PageCount) { ULONG i; @@ -573,7 +573,7 @@ PVOID NTAPI -MmCreateHyperspaceMapping(PFN_TYPE Page) +MmCreateHyperspaceMapping(PFN_NUMBER Page) { PVOID Address; ppc_map_info_t info = { 0 }; @@ -587,11 +587,11 @@ return Address; } -PFN_TYPE -NTAPI -MmChangeHyperspaceMapping(PVOID Address, PFN_TYPE NewPage) -{ - PFN_TYPE OldPage; +PFN_NUMBER +NTAPI +MmChangeHyperspaceMapping(PVOID Address, PFN_NUMBER NewPage) +{ + PFN_NUMBER OldPage; ppc_map_info_t info = { 0 }; info.proc = 0; @@ -604,7 +604,7 @@ return NewPage; } -PFN_TYPE +PFN_NUMBER NTAPI MmDeleteHyperspaceMapping(PVOID Address) { @@ -616,7 +616,7 @@ MmuUnmapPage(&info, 1); - return (PFN_TYPE)info.phys; + return (PFN_NUMBER)info.phys; } VOID @@ -658,7 +658,7 @@ } /* Use our primitive allocator */ -PFN_TYPE MmPPCPrimitiveAllocPage() +PFN_NUMBER MmPPCPrimitiveAllocPage() { paddr_t Result = MmuGetPage(); DbgPrint("Got Page %x\n", Result); Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/rmap.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/rmap.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/rmap.c [iso-8859-1] Sat Nov 21 16:43:26 2009 @@ -54,7 +54,7 @@ NTSTATUS NTAPI -MmWritePagePhysicalAddress(PFN_TYPE Page) +MmWritePagePhysicalAddress(PFN_NUMBER Page) { PMM_RMAP_ENTRY entry; PMEMORY_AREA MemoryArea; @@ -188,7 +188,7 @@ NTSTATUS NTAPI -MmPageOutPhysicalAddress(PFN_TYPE Page) +MmPageOutPhysicalAddress(PFN_NUMBER Page) { PMM_RMAP_ENTRY entry; PMEMORY_AREA MemoryArea; @@ -312,7 +312,7 @@ VOID NTAPI -MmSetCleanAllRmaps(PFN_TYPE Page) +MmSetCleanAllRmaps(PFN_NUMBER Page) { PMM_RMAP_ENTRY current_entry; @@ -333,7 +333,7 @@ VOID NTAPI -MmSetDirtyAllRmaps(PFN_TYPE Page) +MmSetDirtyAllRmaps(PFN_NUMBER Page) { PMM_RMAP_ENTRY current_entry; @@ -354,7 +354,7 @@ BOOLEAN NTAPI -MmIsDirtyPageRmap(PFN_TYPE Page) +MmIsDirtyPageRmap(PFN_NUMBER Page) { PMM_RMAP_ENTRY current_entry; @@ -380,7 +380,7 @@ VOID NTAPI -MmInsertRmap(PFN_TYPE Page, PEPROCESS Process, +MmInsertRmap(PFN_NUMBER Page, PEPROCESS Process, PVOID Address) { PMM_RMAP_ENTRY current_entry; @@ -450,7 +450,7 @@ VOID NTAPI -MmDeleteAllRmaps(PFN_TYPE Page, PVOID Context, +MmDeleteAllRmaps(PFN_NUMBER Page, PVOID Context, VOID (*DeleteMapping)(PVOID Context, PEPROCESS Process, PVOID Address)) { @@ -491,7 +491,7 @@ VOID NTAPI -MmDeleteRmap(PFN_TYPE Page, PEPROCESS Process, +MmDeleteRmap(PFN_NUMBER Page, PEPROCESS Process, PVOID Address) { PMM_RMAP_ENTRY current_entry, previous_entry; Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/section.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/section.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/section.c [iso-8859-1] Sat Nov 21 16:43:26 2009 @@ -463,7 +463,7 @@ PFILE_OBJECT FileObject; PBCB Bcb; SWAPENTRY SavedSwapEntry; - PFN_TYPE Page; + PFN_NUMBER Page; BOOLEAN IsImageSection; ULONG FileOffset; @@ -578,7 +578,7 @@ NTSTATUS NTAPI -MiCopyFromUserPage(PFN_TYPE DestPage, PVOID SourceAddress) +MiCopyFromUserPage(PFN_NUMBER DestPage, PVOID SourceAddress) { PEPROCESS Process; KIRQL Irql; @@ -599,7 +599,7 @@ NTAPI MiReadPage(PMEMORY_AREA MemoryArea, ULONG SegOffset, - PPFN_TYPE Page) + PPFN_NUMBER Page) /* * FUNCTION: Read a page for a section backed memory area. * PARAMETERS: @@ -780,7 +780,7 @@ BOOLEAN Locked) { ULONG Offset; - PFN_TYPE Page; + PFN_NUMBER Page; NTSTATUS Status; PVOID PAddress; PROS_SECTION_OBJECT Section; @@ -1318,8 +1318,8 @@ { PMM_SECTION_SEGMENT Segment; PROS_SECTION_OBJECT Section; - PFN_TYPE OldPage; - PFN_TYPE NewPage; + PFN_NUMBER OldPage; + PFN_NUMBER NewPage; NTSTATUS Status; PVOID PAddress; ULONG Offset; @@ -1494,7 +1494,7 @@ { MM_SECTION_PAGEOUT_CONTEXT* PageOutContext; BOOLEAN WasDirty; - PFN_TYPE Page; + PFN_NUMBER Page; PageOutContext = (MM_SECTION_PAGEOUT_CONTEXT*)Context; if (Process) @@ -1541,7 +1541,7 @@ PVOID Address, PMM_PAGEOP PageOp) { - PFN_TYPE Page; + PFN_NUMBER Page; MM_SECTION_PAGEOUT_CONTEXT Context; SWAPENTRY SwapEntry; ULONG Entry; @@ -1901,7 +1901,7 @@ ULONG Offset; PROS_SECTION_OBJECT Section; PMM_SECTION_SEGMENT Segment; - PFN_TYPE Page; + PFN_NUMBER Page; SWAPENTRY SwapEntry; ULONG Entry; BOOLEAN Private; @@ -2078,7 +2078,7 @@ { ULONG Offset; ULONG Entry; - PFN_TYPE Page; + PFN_NUMBER Page; Offset = (ULONG_PTR)Address - (ULONG_PTR)MemoryArea->StartingAddress + MemoryArea->Data.SectionData.ViewOffset; @@ -2187,7 +2187,7 @@ ULONG Offset; ULONG Entry; ULONG SavedSwapEntry; - PFN_TYPE Page; + PFN_NUMBER Page; Page = 0; @@ -3936,7 +3936,7 @@ static VOID MmFreeSectionPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address, - PFN_TYPE Page, SWAPENTRY SwapEntry, BOOLEAN Dirty) + PFN_NUMBER Page, SWAPENTRY SwapEntry, BOOLEAN Dirty) { ULONG Entry; PFILE_OBJECT FileObject;
15 years, 1 month
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
45
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Results per page:
10
25
50
100
200