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
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
May 2005
----- 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
26 participants
814 discussions
Start a n
N
ew thread
[mf] 15258: replace numeric resource identifiers by their defined constants
by mf@svn.reactos.com
replace numeric resource identifiers by their defined constants Modified: trunk/reactos/subsys/system/winefile/Sv.rc Modified: trunk/reactos/subsys/system/winefile/cz.rc Modified: trunk/reactos/subsys/system/winefile/de.rc Modified: trunk/reactos/subsys/system/winefile/en.rc Modified: trunk/reactos/subsys/system/winefile/es.rc Modified: trunk/reactos/subsys/system/winefile/fr.rc Modified: trunk/reactos/subsys/system/winefile/hu.rc Modified: trunk/reactos/subsys/system/winefile/it.rc Modified: trunk/reactos/subsys/system/winefile/nl.rc Modified: trunk/reactos/subsys/system/winefile/pt.rc Modified: trunk/reactos/subsys/system/winefile/ru.rc Modified: trunk/reactos/subsys/system/winefile/si.rc Modified: trunk/reactos/subsys/system/winefile/zh.rc _____ Modified: trunk/reactos/subsys/system/winefile/Sv.rc --- trunk/reactos/subsys/system/winefile/Sv.rc 2005-05-13 09:09:07 UTC (rev 15257) +++ trunk/reactos/subsys/system/winefile/Sv.rc 2005-05-13 09:35:15 UTC (rev 15258) @@ -29,7 +29,7 @@ IDM_WINEFILE MENU FIXED IMPURE { POPUP "&Arkiv" { - MENUITEM "&Íppna\tEnter", 101 + MENUITEM "&Íppna\tEnter", ID_ACTIVATE MENUITEM "&Flytta...\tF7", ID_FILE_MOVE MENUITEM "&Kopiera...\tF8", 107 MENUITEM "&I urklipp...\tF9", 118 _____ Modified: trunk/reactos/subsys/system/winefile/cz.rc --- trunk/reactos/subsys/system/winefile/cz.rc 2005-05-13 09:09:07 UTC (rev 15257) +++ trunk/reactos/subsys/system/winefile/cz.rc 2005-05-13 09:35:15 UTC (rev 15258) @@ -28,7 +28,7 @@ IDM_WINEFILE MENU FIXED IMPURE { POPUP "&Soubor" { - MENUITEM "&Otev°Ýt\tEnter" , 101 + MENUITEM "&Otev°Ýt\tEnter" , ID_ACTIVATE MENUITEM "&P°esunout...\tF7" , ID_FILE_MOVE MENUITEM "&KopÝrovat...\tF8" , 107 MENUITEM "&Ve schrßnce...\tF9" , 118 _____ Modified: trunk/reactos/subsys/system/winefile/de.rc --- trunk/reactos/subsys/system/winefile/de.rc 2005-05-13 09:09:07 UTC (rev 15257) +++ trunk/reactos/subsys/system/winefile/de.rc 2005-05-13 09:35:15 UTC (rev 15258) @@ -30,7 +30,7 @@ IDM_WINEFILE MENU FIXED IMPURE { POPUP "&Datei" { - MENUITEM "Í&ffnen\tEingabetaste" , 101 + MENUITEM "Í&ffnen\tEingabetaste" , ID_ACTIVATE MENUITEM "&Verschieben...\tF7" , ID_FILE_MOVE MENUITEM "&Kopieren...\tF8" , 107 MENUITEM "&In Zwischenablage...\tF9" , 118 _____ Modified: trunk/reactos/subsys/system/winefile/en.rc --- trunk/reactos/subsys/system/winefile/en.rc 2005-05-13 09:09:07 UTC (rev 15257) +++ trunk/reactos/subsys/system/winefile/en.rc 2005-05-13 09:35:15 UTC (rev 15258) @@ -30,7 +30,7 @@ IDM_WINEFILE MENU FIXED IMPURE { POPUP "&File" { - MENUITEM "&Open\tEnter" , 101 + MENUITEM "&Open\tEnter" , ID_ACTIVATE MENUITEM "&Move...\tF7" , ID_FILE_MOVE MENUITEM "&Copy...\tF8" , 107 MENUITEM "&In Clipboard...\tF9" , 118 _____ Modified: trunk/reactos/subsys/system/winefile/es.rc --- trunk/reactos/subsys/system/winefile/es.rc 2005-05-13 09:09:07 UTC (rev 15257) +++ trunk/reactos/subsys/system/winefile/es.rc 2005-05-13 09:35:15 UTC (rev 15258) @@ -26,7 +26,7 @@ IDM_WINEFILE MENU FIXED IMPURE { POPUP "&Archivo" { - MENUITEM "&Abrir\tEnter" , 101 + MENUITEM "&Abrir\tEnter" , ID_ACTIVATE MENUITEM "Mo&ver...\tF7" , ID_FILE_MOVE MENUITEM "&Copiar...\tF8" , 107 MENUITEM "E&n portapapeles...\tF9" , 118 _____ Modified: trunk/reactos/subsys/system/winefile/fr.rc --- trunk/reactos/subsys/system/winefile/fr.rc 2005-05-13 09:09:07 UTC (rev 15257) +++ trunk/reactos/subsys/system/winefile/fr.rc 2005-05-13 09:35:15 UTC (rev 15258) @@ -29,7 +29,7 @@ IDM_WINEFILE MENU FIXED IMPURE { POPUP "&Fichier" { - MENUITEM "&Ouvrir\tEntrÚe" , 101 + MENUITEM "&Ouvrir\tEntrÚe" , ID_ACTIVATE MENUITEM "&DÚplacer...\tF7" , ID_FILE_MOVE MENUITEM "&Copier...\tF8" , 107 MENUITEM "P&resse-Papiers...\tF9" , 118 _____ Modified: trunk/reactos/subsys/system/winefile/hu.rc --- trunk/reactos/subsys/system/winefile/hu.rc 2005-05-13 09:09:07 UTC (rev 15257) +++ trunk/reactos/subsys/system/winefile/hu.rc 2005-05-13 09:35:15 UTC (rev 15258) @@ -29,8 +29,8 @@ IDM_WINEFILE MENU FIXED IMPURE { POPUP "&Fßjl" { - MENUITEM "&Megynitßs\tEnter" , 101 - MENUITEM "?t&helyezÚs...\tF7" , 106 + MENUITEM "&Megynitßs\tEnter" , ID_ACTIVATE + MENUITEM "?t&helyezÚs...\tF7" , ID_FILE_MOVE MENUITEM "&Mßsolßs...\tF8" , 107 MENUITEM "&Vßg¾lapon...\tF9" , 118 MENUITEM "&T÷rlÚs\tDel" , 108 _____ Modified: trunk/reactos/subsys/system/winefile/it.rc --- trunk/reactos/subsys/system/winefile/it.rc 2005-05-13 09:09:07 UTC (rev 15257) +++ trunk/reactos/subsys/system/winefile/it.rc 2005-05-13 09:35:15 UTC (rev 15258) @@ -29,7 +29,7 @@ IDM_WINEFILE MENU FIXED IMPURE { POPUP "&File" { - MENUITEM "&Apri\tInvio" , 101 + MENUITEM "&Apri\tInvio" , ID_ACTIVATE MENUITEM "&Sposta...\tF7" , ID_FILE_MOVE MENUITEM "&Copia...\tF8" , 107 MENUITEM "&Negli Appunti...\tF9" , 118 _____ Modified: trunk/reactos/subsys/system/winefile/nl.rc --- trunk/reactos/subsys/system/winefile/nl.rc 2005-05-13 09:09:07 UTC (rev 15257) +++ trunk/reactos/subsys/system/winefile/nl.rc 2005-05-13 09:35:15 UTC (rev 15258) @@ -25,8 +25,8 @@ IDM_WINEFILE MENU FIXED IMPURE { POPUP "&Bestand" { - MENUITEM "&Openen\tEnter" , 101 - MENUITEM "&Verplaatsen...\tF7" , 106 + MENUITEM "&Openen\tEnter" , ID_ACTIVATE + MENUITEM "&Verplaatsen...\tF7" , ID_FILE_MOVE MENUITEM "&KopiÙren...\tF8" , 107 MENUITEM "Naar &klembord...\tF9" , 118 MENUITEM "Ver&wijderen\tDel" , 108 _____ Modified: trunk/reactos/subsys/system/winefile/pt.rc --- trunk/reactos/subsys/system/winefile/pt.rc 2005-05-13 09:09:07 UTC (rev 15257) +++ trunk/reactos/subsys/system/winefile/pt.rc 2005-05-13 09:35:15 UTC (rev 15258) @@ -28,7 +28,7 @@ IDM_WINEFILE MENU FIXED IMPURE { POPUP "&Arquivo" { - MENUITEM "A&brir\tEnter" , 101 + MENUITEM "A&brir\tEnter" , ID_ACTIVATE MENUITEM "&Mover...\tF7" , ID_FILE_MOVE MENUITEM "&Copiar...\tF8" , 107 MENUITEM "&In Clipboard...\tF9" , 118 @@ -156,7 +156,7 @@ IDM_WINEFILE MENU FIXED IMPURE { POPUP "&Ficheiro" { - MENUITEM "A&brir\tEnter" , 101 + MENUITEM "A&brir\tEnter" , ID_ACTIVATE MENUITEM "&Mover...\tF7" , ID_FILE_MOVE MENUITEM "&Copiar...\tF8" , 107 MENUITEM "&Na Area de Transferencia...\tF9" , 118 _____ Modified: trunk/reactos/subsys/system/winefile/ru.rc --- trunk/reactos/subsys/system/winefile/ru.rc 2005-05-13 09:09:07 UTC (rev 15257) +++ trunk/reactos/subsys/system/winefile/ru.rc 2005-05-13 09:35:15 UTC (rev 15258) @@ -25,8 +25,8 @@ IDM_WINEFILE MENU FIXED IMPURE { POPUP "&ÈÓÚÙ" { - MENUITEM "&??Û¹?³\tEnter" , 101 - MENUITEM "&¤ÕÕýÕ±?Þ?³...\tF7" , 106 + MENUITEM "&??Û¹?³\tEnter" , ID_ACTIVATE + MENUITEM "&¤ÕÕýÕ±?Þ?³...\tF7" , ID_FILE_MOVE MENUITEM "&?¯´Þ¯ÔÓ?³...\tF8" , 107 MENUITEM "&? ß¾¶Õ ¯ßýÕÝÓ...\tF9" , 118 MENUITEM "&ËõÓÙÞ?³\tDel" , 108 _____ Modified: trunk/reactos/subsys/system/winefile/si.rc --- trunk/reactos/subsys/system/winefile/si.rc 2005-05-13 09:09:07 UTC (rev 15257) +++ trunk/reactos/subsys/system/winefile/si.rc 2005-05-13 09:35:15 UTC (rev 15258) @@ -26,8 +26,8 @@ IDM_WINEFILE MENU FIXED IMPURE { POPUP "&File" { - MENUITEM "&Open\tEnter" , 101 - MENUITEM "&Move...\tF7" , 106 + MENUITEM "&Open\tEnter" , ID_ACTIVATE + MENUITEM "&Move...\tF7" , ID_FILE_MOVE MENUITEM "&Copy...\tF8" , 107 MENUITEM "&In Clipboard...\tF9" , 118 MENUITEM "&Delete\tDel" , 108 _____ Modified: trunk/reactos/subsys/system/winefile/zh.rc --- trunk/reactos/subsys/system/winefile/zh.rc 2005-05-13 09:09:07 UTC (rev 15257) +++ trunk/reactos/subsys/system/winefile/zh.rc 2005-05-13 09:35:15 UTC (rev 15258) @@ -26,8 +26,8 @@ IDM_WINEFILE MENU FIXED IMPURE { POPUP "????ú¿&Fú®" { - MENUITEM "???¬ú¿&Oú®\tEnter" , 101 - MENUITEM "Êã»ú¿&Mú®...\tF7" , 106 + MENUITEM "???¬ú¿&Oú®\tEnter" , ID_ACTIVATE + MENUITEM "Êã»ú¿&Mú®...\tF7" , ID_FILE_MOVE MENUITEM "©?Íãú¿&Cú®...\tF8" , 107 MENUITEM "??Ë??¶?¨?Õú¿&Iú®...\tF9" , 118 MENUITEM "?¥?²ú¿&Dú®\tDel" , 108
19 years, 4 months
1
0
0
0
[mf] 15257: Wine compatibility changes
by mf@svn.reactos.com
Wine compatibility changes Modified: trunk/reactos/subsys/system/winefile/winefile.c _____ Modified: trunk/reactos/subsys/system/winefile/winefile.c --- trunk/reactos/subsys/system/winefile/winefile.c 2005-05-13 05:41:24 UTC (rev 15256) +++ trunk/reactos/subsys/system/winefile/winefile.c 2005-05-13 09:09:07 UTC (rev 15257) @@ -187,6 +187,15 @@ return 0; } + +#define LOCAL_ALLOC(s) HeapAlloc(GetProcessHeap(), 0, s) +#define LOCAL_FREE(p) HeapFree(GetProcessHeap(), 0, p) + +#else + +#define LOCAL_ALLOC(s) alloca(s) +#define LOCAL_FREE(p) + #endif @@ -1199,7 +1208,7 @@ len++; if (len) { - array = (Entry**) alloca(len*sizeof(Entry*)); + array = (Entry**) LOCAL_ALLOC(len*sizeof(Entry*)); p = array; for(entry=dir->down; entry; entry=entry->next) @@ -1214,6 +1223,8 @@ p[0]->next = p[1]; (*p)->next = 0; + + LOCAL_FREE(array); } } @@ -3415,7 +3426,7 @@ static IContextMenu2* s_pctxmenu2 = NULL; -#ifndef __MINGW32__ // IContextMenu3 missing in MinGW (as of 6.2.2005) +#ifndef __MINGW32__ /* IContextMenu3 missing in MinGW (as of 6.2.2005) */ static IContextMenu3* s_pctxmenu3 = NULL; #endif @@ -3423,7 +3434,7 @@ { s_pctxmenu2 = NULL; -#ifndef __MINGW32__ // IContextMenu3 missing in MinGW (as of 6.2.2005) +#ifndef __MINGW32__ /* IContextMenu3 missing in MinGW (as of 6.2.2005) */ s_pctxmenu3 = NULL; #endif } @@ -3434,7 +3445,7 @@ CtxMenu_reset(); -#ifndef __MINGW32__ // IContextMenu3 missing in MinGW (as of 6.2.2005) +#ifndef __MINGW32__ /* IContextMenu3 missing in MinGW (as of 6.2.2005) */ if ((*pcm1->lpVtbl->QueryInterface)(pcm1, &IID_IContextMenu3, (void**)&pcm) == NOERROR) s_pctxmenu3 = (LPCONTEXTMENU3)pcm; else @@ -3451,7 +3462,7 @@ static BOOL CtxMenu_HandleMenuMsg(UINT nmsg, WPARAM wparam, LPARAM lparam) { -#ifndef __MINGW32__ // IContextMenu3 missing in MinGW (as of 6.2.2005) +#ifndef __MINGW32__ /* IContextMenu3 missing in MinGW (as of 6.2.2005) */ if (s_pctxmenu3) { if (SUCCEEDED((*s_pctxmenu3->lpVtbl->HandleMenuMsg)(s_pctxmenu3, nmsg, wparam, lparam))) return TRUE; @@ -3811,7 +3822,7 @@ case WM_MEASUREITEM: draw_menu_item: - if (!wparam) // Is the message menu-related? + if (!wparam) /* Is the message menu-related? */ if (CtxMenu_HandleMenuMsg(nmsg, wparam, lparam)) return TRUE; @@ -3823,8 +3834,8 @@ break; -#ifndef __MINGW32__ // IContextMenu3 missing in MinGW (as of 6.2.2005) - case WM_MENUCHAR: // only supported by IContextMenu3 +#ifndef __MINGW32__ /* IContextMenu3 missing in MinGW (as of 6.2.2005) */ + case WM_MENUCHAR: /* only supported by IContextMenu3 */ if (s_pctxmenu3) { LRESULT lResult = 0;
19 years, 4 months
1
0
0
0
[ion] 15256: Fix IRP structure (add missing member) and optimize io completion by allowing the io completion packet to be piggybacked on the IRP. Also make io completion use the cpu lookaside lists now as well as the paged pool as a last-chance attempt
by ion@svn.reactos.com
Fix IRP structure (add missing member) and optimize io completion by allowing the io completion packet to be piggybacked on the IRP. Also make io completion use the cpu lookaside lists now as well as the paged pool as a last-chance attempt Modified: trunk/reactos/include/ddk/iotypes.h Modified: trunk/reactos/ntoskrnl/include/internal/io.h Modified: trunk/reactos/ntoskrnl/io/iocomp.c Modified: trunk/reactos/ntoskrnl/io/irp.c _____ Modified: trunk/reactos/include/ddk/iotypes.h --- trunk/reactos/include/ddk/iotypes.h 2005-05-13 04:49:54 UTC (rev 15255) +++ trunk/reactos/include/ddk/iotypes.h 2005-05-13 05:41:24 UTC (rev 15256) @@ -794,12 +794,17 @@ }; struct _ETHREAD* Thread; PCHAR AuxiliaryBuffer; - LIST_ENTRY ListEntry; - struct _IO_STACK_LOCATION* CurrentStackLocation; + struct { + LIST_ENTRY ListEntry; + union { + struct _IO_STACK_LOCATION* CurrentStackLocation; + ULONG PacketType; + }; + }; PFILE_OBJECT OriginalFileObject; } Overlay; KAPC Apc; - ULONG CompletionKey; + PVOID CompletionKey; } Tail; } IRP, *PIRP; _____ Modified: trunk/reactos/ntoskrnl/include/internal/io.h --- trunk/reactos/ntoskrnl/include/internal/io.h 2005-05-13 04:49:54 UTC (rev 15255) +++ trunk/reactos/ntoskrnl/include/internal/io.h 2005-05-13 05:41:24 UTC (rev 15256) @@ -43,13 +43,25 @@ struct _DEVICE_OBJECT_POWER_EXTENSION; -typedef struct _IO_COMPLETION_PACKET{ +/* This is like the IRP Overlay so we can optimize its insertion */ +typedef struct _IO_COMPLETION_PACKET +{ + struct { + LIST_ENTRY ListEntry; + union { + struct _IO_STACK_LOCATION *CurrentStackLocation; + ULONG PacketType; + }; + }; PVOID Key; PVOID Context; IO_STATUS_BLOCK IoStatus; - LIST_ENTRY ListEntry; } IO_COMPLETION_PACKET, *PIO_COMPLETION_PACKET; +/* Packet Types */ +#define IrpCompletionPacket 0x1 +#define IrpMiniCompletionPacket 0x2 + typedef struct _DEVOBJ_EXTENSION { CSHORT Type; USHORT Size; _____ Modified: trunk/reactos/ntoskrnl/io/iocomp.c --- trunk/reactos/ntoskrnl/io/iocomp.c 2005-05-13 04:49:54 UTC (rev 15255) +++ trunk/reactos/ntoskrnl/io/iocomp.c 2005-05-13 05:41:24 UTC (rev 15256) @@ -37,11 +37,46 @@ VOID STDCALL +IopFreeIoCompletionPacket(PIO_COMPLETION_PACKET Packet) +{ + PKPRCB Prcb = KeGetCurrentPrcb(); + PNPAGED_LOOKASIDE_LIST List; + + /* Use the P List */ + List = (PNPAGED_LOOKASIDE_LIST)Prcb->PPLookasideList[LookasideCompletionList].P ; + List->L.TotalFrees++; + + /* Check if the Free was within the Depth or not */ + if (ExQueryDepthSList(&List->L.ListHead) >= List->L.Depth) + { + /* Let the balancer know */ + List->L.FreeMisses++; + + /* Use the L List */ + List = (PNPAGED_LOOKASIDE_LIST)Prcb->PPLookasideList[LookasideCompletionList].L ; + List->L.TotalFrees++; + + /* Check if the Free was within the Depth or not */ + if (ExQueryDepthSList(&List->L.ListHead) >= List->L.Depth) + { + /* All lists failed, use the pool */ + List->L.FreeMisses++; + ExFreePool(Packet); + } + } + + /* The free was within dhe Depth */ + InterlockedPushEntrySList(&List->L.ListHead, (PSINGLE_LIST_ENTRY)Packet); +} + +VOID +STDCALL IopDeleteIoCompletion(PVOID ObjectBody) { PKQUEUE Queue = ObjectBody; PLIST_ENTRY FirstEntry; PLIST_ENTRY CurrentEntry; + PIRP Irp; PIO_COMPLETION_PACKET Packet; DPRINT("IopDeleteIoCompletion()\n"); @@ -61,8 +96,18 @@ /* Go to next Entry */ CurrentEntry = CurrentEntry->Flink; - /* Free it */ - ExFreeToNPagedLookasideList(&IoCompletionPacketLookaside, Packet); + /* Check if it's part of an IRP, or a separate packet */ + if (Packet->PacketType == IrpCompletionPacket) + { + /* Get the IRP and free it */ + Irp = CONTAINING_RECORD(Packet, IRP, Tail.Overlay.ListEntry); + IoFreeIrp(Irp); + } + else + { + /* Use common routine */ + IopFreeIoCompletionPacket(Packet); + } } while (FirstEntry != CurrentEntry); } } @@ -80,21 +125,59 @@ IN BOOLEAN Quota) { PKQUEUE Queue = (PKQUEUE)IoCompletion; + PNPAGED_LOOKASIDE_LIST List; + PKPRCB Prcb = KeGetCurrentPrcb(); PIO_COMPLETION_PACKET Packet; - /* Allocate the Packet */ - Packet = ExAllocateFromNPagedLookasideList(&IoCompletionPacketLookaside); - if (NULL == Packet) return STATUS_NO_MEMORY; + /* Get the P List */ + List = (PNPAGED_LOOKASIDE_LIST)Prcb->PPLookasideList[LookasideCompletionList].P ; + + /* Try to allocate the Packet */ + List->L.TotalAllocates++; + Packet = (PVOID)InterlockedPopEntrySList(&List->L.ListHead); + + /* Check if that failed, use the L list if it did */ + if (!Packet) + { + /* Let the balancer know */ + List->L.AllocateMisses++; + + /* Get L List */ + List = (PNPAGED_LOOKASIDE_LIST)Prcb->PPLookasideList[LookasideCompletionList].L ; + + /* Try to allocate the Packet */ + List->L.TotalAllocates++; + Packet = (PVOID)InterlockedPopEntrySList(&List->L.ListHead); + } + + /* Still failed, use pool */ + if (!Packet) + { + /* Let the balancer know */ + List->L.AllocateMisses++; + + /* Allocate from Nonpaged Pool */ + Packet = ExAllocatePoolWithTag(NonPagedPool, sizeof(*Packet), IOC_TAG); + } + + /* Make sure we have one by now... */ + if (Packet) + { + /* Set up the Packet */ + Packet->PacketType = IrpMiniCompletionPacket; + Packet->Key = KeyContext; + Packet->Context = ApcContext; + Packet->IoStatus.Status = IoStatus; + Packet->IoStatus.Information = IoStatusInformation; - /* Set up the Packet */ - Packet->Key = KeyContext; - Packet->Context = ApcContext; - Packet->IoStatus.Status = IoStatus; - Packet->IoStatus.Information = IoStatusInformation; + /* Insert the Queue */ + KeInsertQueue(Queue, &Packet->ListEntry); + } + else + { + return STATUS_INSUFFICIENT_RESOURCES; + } - /* Insert the Queue */ - KeInsertQueue(Queue, &Packet->ListEntry); - /* Return Success */ return STATUS_SUCCESS; } @@ -410,10 +493,27 @@ _SEH_TRY { - /* Return it */ - *CompletionKey = Packet->Key; - *CompletionContext = Packet->Context; - *IoStatusBlock = Packet->IoStatus; + /* Check if this is piggybacked on an IRP */ + if (Packet->PacketType == IrpCompletionPacket) + { + /* Get the IRP */ + PIRP Irp = NULL; + Irp = CONTAINING_RECORD(ListEntry, IRP, Tail.Overlay.ListEntry); + + /* Return values to user */ + *CompletionKey = Irp->Tail.CompletionKey; + *CompletionContext = Irp->Overlay.AsynchronousParameters.UserApcContext; + *IoStatusBlock = Packet->IoStatus; + IoFreeIrp(Irp); + } + else + { + /* This is a user-mode generated or API generated mini-packet */ + *CompletionKey = Packet->Key; + *CompletionContext = Packet->Context; + *IoStatusBlock = Packet->IoStatus; + IopFreeIoCompletionPacket(Packet); + } } _SEH_HANDLE { _____ Modified: trunk/reactos/ntoskrnl/io/irp.c --- trunk/reactos/ntoskrnl/io/irp.c 2005-05-13 04:49:54 UTC (rev 15255) +++ trunk/reactos/ntoskrnl/io/irp.c 2005-05-13 05:41:24 UTC (rev 15256) @@ -187,12 +187,10 @@ else if (FileObject && FileObject->CompletionContext) { /* Call the IO Completion Port if we have one, instead */ - IoSetIoCompletion(FileObject->CompletionContext->Port, - FileObject->CompletionContext->Key, - Irp->Overlay.AsynchronousParameters.UserApcContext, - Irp->IoStatus.Status, - Irp->IoStatus.Information, - FALSE); + Irp->Tail.CompletionKey = FileObject->CompletionContext->Key; + Irp->Tail.Overlay.PacketType = IrpCompletionPacket; + KeInsertQueue(FileObject->CompletionContext->Port, + &Irp->Tail.Overlay.ListEntry); Irp = NULL; } } @@ -369,7 +367,7 @@ PIRP Irp = NULL; USHORT Size = IoSizeOfIrp(StackSize); PKPRCB Prcb; - ULONG Flags = 0; + UCHAR Flags = 0; PNPAGED_LOOKASIDE_LIST List; PP_NPAGED_LOOKASIDE_NUMBER ListType = LookasideSmallIrpList;
19 years, 4 months
1
0
0
0
[ion] 15255: Implement Lookaside List allocation and release for IRPs on Per-CPU Lists, or global system lists if the per-cpu has been exhausted. This should tremendously reduce memory fragmentation and speed up I/o noticeably. Also, don't allocate IRPs with quota charge when they shouldn't.
by ion@svn.reactos.com
Implement Lookaside List allocation and release for IRPs on Per-CPU Lists, or global system lists if the per-cpu has been exhausted. This should tremendously reduce memory fragmentation and speed up I/o noticeably. Also, don't allocate IRPs with quota charge when they shouldn't. Modified: trunk/reactos/include/ddk/iodef.h Modified: trunk/reactos/ntoskrnl/io/file.c Modified: trunk/reactos/ntoskrnl/io/irp.c _____ Modified: trunk/reactos/include/ddk/iodef.h --- trunk/reactos/include/ddk/iodef.h 2005-05-13 03:34:13 UTC (rev 15254) +++ trunk/reactos/include/ddk/iodef.h 2005-05-13 04:49:54 UTC (rev 15255) @@ -134,6 +134,11 @@ IRP_RETRY_IO_COMPLETION = 0x4000 }; +#define IRP_QUOTA_CHARGED 0x01 +#define IRP_ALLOCATED_MUST_SUCCEED 0x02 +#define IRP_ALLOCATED_FIXED_SIZE 0x04 +#define IRP_LOOKASIDE_ALLOCATION 0x08 + #define SL_FORCE_ACCESS_CHECK (0x1) #define SL_OPEN_PAGING_FILE (0x2) #define SL_OPEN_TARGET_DIRECTORY (0x4) _____ Modified: trunk/reactos/ntoskrnl/io/file.c --- trunk/reactos/ntoskrnl/io/file.c 2005-05-13 03:34:13 UTC (rev 15254) +++ trunk/reactos/ntoskrnl/io/file.c 2005-05-13 04:49:54 UTC (rev 15255) @@ -210,7 +210,7 @@ KeInitializeEvent(&Event, SynchronizationEvent, FALSE); /* Allocate an IRP */ - Irp = IoAllocateIrp(DeviceObject->StackSize, TRUE); + Irp = IoAllocateIrp(DeviceObject->StackSize, FALSE); /* Set it up */ Irp->UserEvent = &Event; @@ -329,7 +329,7 @@ } /* Allocate the IRP */ - Irp = IoAllocateIrp(DeviceObject->StackSize, TRUE); + Irp = IoAllocateIrp(DeviceObject->StackSize, FALSE); /* Set the IRP */ Irp->Tail.Overlay.OriginalFileObject = FileObject; @@ -498,7 +498,7 @@ KeInitializeEvent(&Event, SynchronizationEvent, FALSE); /* Allocate an IRP */ - Irp = IoAllocateIrp(DeviceObject->StackSize, TRUE); + Irp = IoAllocateIrp(DeviceObject->StackSize, FALSE); /* Set it up */ Irp->UserEvent = &Event; @@ -1149,7 +1149,7 @@ } /* Allocate the IRP */ - Irp = IoAllocateIrp(DeviceObject->StackSize, TRUE); + Irp = IoAllocateIrp(DeviceObject->StackSize, FALSE); /* Set the IRP */ Irp->Tail.Overlay.OriginalFileObject = FileObject; @@ -1586,7 +1586,7 @@ } /* Allocate the IRP */ - if (!(Irp = IoAllocateIrp(DeviceObject->StackSize, TRUE))) + if (!(Irp = IoAllocateIrp(DeviceObject->StackSize, FALSE))) { ObDereferenceObject(FileObject); return STATUS_INSUFFICIENT_RESOURCES; @@ -1699,7 +1699,7 @@ DeviceObject = FileObject->DeviceObject; - Irp = IoAllocateIrp(DeviceObject->StackSize, TRUE); + Irp = IoAllocateIrp(DeviceObject->StackSize, FALSE); if (Irp==NULL) { ObDereferenceObject(FileObject); @@ -1795,7 +1795,7 @@ DeviceObject = IoGetRelatedDeviceObject(FileObject); Irp = IoAllocateIrp(DeviceObject->StackSize, - TRUE); + FALSE); if (Irp == NULL) { Status = STATUS_INSUFFICIENT_RESOURCES; @@ -2123,7 +2123,7 @@ } /* Allocate the IRP */ - if (!(Irp = IoAllocateIrp(DeviceObject->StackSize, TRUE))) + if (!(Irp = IoAllocateIrp(DeviceObject->StackSize, FALSE))) { ObDereferenceObject(FileObject); return STATUS_INSUFFICIENT_RESOURCES; @@ -2321,7 +2321,7 @@ } /* Allocate the IRP */ - if (!(Irp = IoAllocateIrp(DeviceObject->StackSize, TRUE))) + if (!(Irp = IoAllocateIrp(DeviceObject->StackSize, FALSE))) { ObDereferenceObject(FileObject); return STATUS_INSUFFICIENT_RESOURCES; @@ -2775,7 +2775,7 @@ } /* Allocate the IRP */ - if (!(Irp = IoAllocateIrp(DeviceObject->StackSize, TRUE))) + if (!(Irp = IoAllocateIrp(DeviceObject->StackSize, FALSE))) { ObDereferenceObject(FileObject); return STATUS_INSUFFICIENT_RESOURCES; @@ -2900,7 +2900,7 @@ DeviceObject = IoGetRelatedDeviceObject(FileObject); Irp = IoAllocateIrp(DeviceObject->StackSize, - TRUE); + FALSE); if (Irp == NULL) { Status = STATUS_INSUFFICIENT_RESOURCES; _____ Modified: trunk/reactos/ntoskrnl/io/irp.c --- trunk/reactos/ntoskrnl/io/irp.c 2005-05-13 03:34:13 UTC (rev 15254) +++ trunk/reactos/ntoskrnl/io/irp.c 2005-05-13 04:49:54 UTC (rev 15255) @@ -366,31 +366,93 @@ IoAllocateIrp(CCHAR StackSize, BOOLEAN ChargeQuota) { - PIRP Irp; + PIRP Irp = NULL; USHORT Size = IoSizeOfIrp(StackSize); - - /* Check if we shoudl charge quota */ - if (ChargeQuota) + PKPRCB Prcb; + ULONG Flags = 0; + PNPAGED_LOOKASIDE_LIST List; + PP_NPAGED_LOOKASIDE_NUMBER ListType = LookasideSmallIrpList; + + /* Figure out which Lookaside List to use */ + if ((StackSize <= 8) && (ChargeQuota == FALSE)) { - /* Irp = ExAllocatePoolWithQuotaTag(NonPagedPool,IoSizeOfIrp(StackSize), TAG_IRP); */ - /* FIXME */ - Irp = ExAllocatePoolWithTag(NonPagedPool, - Size, - TAG_IRP); + DPRINT("Using lookaside, %d\n", StackSize); + /* Set Fixed Size Flag */ + Flags = IRP_ALLOCATED_FIXED_SIZE; + + /* See if we should use big list */ + if (StackSize != 1) + { + DPRINT("Using large lookaside\n"); + Size = IoSizeOfIrp(8); + ListType = LookasideLargeIrpList; + } + + /* Get the PRCB */ + Prcb = KeGetCurrentPrcb(); + + /* Get the P List First */ + List = (PNPAGED_LOOKASIDE_LIST)Prcb->PPLookasideList[ListType].P; + + /* Attempt allocation */ + List->L.TotalAllocates++; + DPRINT("Total allocates: %d\n", List->L.TotalAllocates); + Irp = (PIRP)InterlockedPopEntrySList(&List->L.ListHead); + DPRINT("Alloc attempt on CPU list: %p\n", Irp); + + /* Check if the P List failed */ + if (!Irp) + { + /* Let the balancer know */ + List->L.AllocateMisses++; + DPRINT("Total misses: %d\n", List->L.AllocateMisses); + + /* Try the L List */ + List = (PNPAGED_LOOKASIDE_LIST)Prcb->PPLookasideList[ListType].L; + List->L.TotalAllocates++; + Irp = (PIRP)InterlockedPopEntrySList(&List->L.ListHead); + DPRINT("Alloc attempt on SYS list: %p\n", Irp); + } } + + /* Check if we have to use the pool */ + if (!Irp) + { + DPRINT("Using pool\n"); + /* Did we try lookaside and fail? */ + if (Flags & IRP_ALLOCATED_FIXED_SIZE) List->L.AllocateMisses++; + + /* Check if we shoudl charge quota */ + if (ChargeQuota) + { + /* Irp = ExAllocatePoolWithQuotaTag(NonPagedPool, Size, TAG_IRP); */ + /* FIXME */ + Irp = ExAllocatePoolWithTag(NonPagedPool, Size, TAG_IRP); + } + else + { + /* Allocate the IRP With no Quota charge */ + Irp = ExAllocatePoolWithTag(NonPagedPool, Size, TAG_IRP); + } + + /* Make sure it was sucessful */ + if (!Irp) return(NULL); + } else { - /* Allocate the IRP With no Quota charge */ - Irp = ExAllocatePoolWithTag(NonPagedPool, - Size, - TAG_IRP); + /* We have an IRP from Lookaside */ + Flags |= IRP_LOOKASIDE_ALLOCATION; } - - /* Make sure it was sucessful */ - if (Irp==NULL) return(NULL); - + + /* Set Flag */ + if (ChargeQuota) Flags |= IRP_QUOTA_CHARGED; + /* Now Initialize it */ + DPRINT("irp allocated\n"); IoInitializeIrp(Irp, Size, StackSize); + + /* Set the Allocation Flags */ + Irp->AllocationFlags = Flags; /* Return it */ return Irp; @@ -430,7 +492,7 @@ StartingOffset,IoStatusBlock); /* Allocate IRP */ - if (!(Irp = IoAllocateIrp(DeviceObject->StackSize,TRUE))) return Irp; + if (!(Irp = IoAllocateIrp(DeviceObject->StackSize, FALSE))) return Irp; /* Get the Stack */ StackPtr = IoGetNextIrpStackLocation(Irp); @@ -580,7 +642,7 @@ InternalDeviceIoControl,Event,IoStatusBlock); /* Allocate IRP */ - if (!(Irp = IoAllocateIrp(DeviceObject->StackSize,TRUE))) return Irp; + if (!(Irp = IoAllocateIrp(DeviceObject->StackSize, FALSE))) return Irp; /* Get the Stack */ StackPtr = IoGetNextIrpStackLocation(Irp); @@ -1177,8 +1239,59 @@ STDCALL IoFreeIrp(PIRP Irp) { - /* Free the pool memory associated with it */ - ExFreePoolWithTag(Irp, TAG_IRP); + PNPAGED_LOOKASIDE_LIST List; + PP_NPAGED_LOOKASIDE_NUMBER ListType = LookasideSmallIrpList; + PKPRCB Prcb; + + /* If this was a pool alloc, free it with the pool */ + if (!(Irp->AllocationFlags & IRP_ALLOCATED_FIXED_SIZE)) + { + /* Free it */ + DPRINT("Freeing pool IRP\n"); + ExFreePool(Irp); + } + else + { + DPRINT("Freeing Lookaside IRP\n"); + + /* Check if this was a Big IRP */ + if (Irp->StackCount != 1) + { + DPRINT("Large IRP\n"); + ListType = LookasideLargeIrpList; + } + + /* Get the PRCB */ + Prcb = KeGetCurrentPrcb(); + + /* Use the P List */ + List = (PNPAGED_LOOKASIDE_LIST)Prcb->PPLookasideList[ListType].P; + List->L.TotalFrees++; + + /* Check if the Free was within the Depth or not */ + if (ExQueryDepthSList(&List->L.ListHead) >= List->L.Depth) + { + /* Let the balancer know */ + List->L.FreeMisses++; + + /* Use the L List */ + List = (PNPAGED_LOOKASIDE_LIST)Prcb->PPLookasideList[ListType].L; + List->L.TotalFrees++; + + /* Check if the Free was within the Depth or not */ + if (ExQueryDepthSList(&List->L.ListHead) >= List->L.Depth) + { + /* All lists failed, use the pool */ + List->L.FreeMisses++; + ExFreePool(Irp); + } + } + + /* The free was within dhe Depth */ + InterlockedPushEntrySList(&List->L.ListHead, (PSINGLE_LIST_ENTRY)Irp); + } + + DPRINT("Free done\n"); } /* @@ -1324,7 +1437,7 @@ PIRP AssocIrp; /* Allocate the IRP */ - AssocIrp = IoAllocateIrp(StackSize,FALSE); + AssocIrp = IoAllocateIrp(StackSize, FALSE); if (AssocIrp == NULL) return NULL; /* Set the Flags */
19 years, 4 months
1
0
0
0
[ion] 15254: Fix lookaside structures, rewrite lookaside code to use new structures, remove some excess abstraction, correct export incorrectly exported as fastcall, fix up macros, add basic init code to allocate lookaside lists for IRPs as well as per-cpu lookaside lists for irps and completion packets
by ion@svn.reactos.com
Fix lookaside structures, rewrite lookaside code to use new structures, remove some excess abstraction, correct export incorrectly exported as fastcall, fix up macros, add basic init code to allocate lookaside lists for IRPs as well as per-cpu lookaside lists for irps and completion packets Modified: trunk/reactos/include/ddk/exfuncs.h Modified: trunk/reactos/include/ddk/extypes.h Modified: trunk/reactos/ntoskrnl/ex/lookas.c Modified: trunk/reactos/ntoskrnl/io/iocomp.c Modified: trunk/reactos/ntoskrnl/io/iomgr.c Modified: trunk/reactos/ntoskrnl/ntoskrnl.def _____ Modified: trunk/reactos/include/ddk/exfuncs.h --- trunk/reactos/include/ddk/exfuncs.h 2005-05-13 02:05:15 UTC (rev 15253) +++ trunk/reactos/include/ddk/exfuncs.h 2005-05-13 03:34:13 UTC (rev 15254) @@ -800,15 +800,15 @@ { PVOID Entry; - Lookaside->TotalAllocates++; - Entry = ExInterlockedPopEntrySList (&Lookaside->ListHead, - &Lookaside->Obsoleted); + Lookaside->L.TotalAllocates++; + Entry = InterlockedPopEntrySList(&Lookaside->L.ListHead); + if (Entry == NULL) { - Lookaside->AllocateMisses++; - Entry = (Lookaside->Allocate)(Lookaside->Type, - Lookaside->Size, - Lookaside->Tag); + Lookaside->L.AllocateMisses++; + Entry = (Lookaside->L.Allocate)(Lookaside->L.Type, + Lookaside->L.Size, + Lookaside->L.Tag); } return Entry; @@ -820,12 +820,13 @@ { PVOID Entry; - Lookaside->TotalAllocates++; - Entry = InterlockedPopEntrySList(&Lookaside->ListHead); + Lookaside->L.TotalAllocates++; + Entry = InterlockedPopEntrySList(&Lookaside->L.ListHead); if (Entry == NULL) { - Lookaside->AllocateMisses++; - Entry = (Lookaside->Allocate)(Lookaside->Type, - Lookaside->Size, Lookaside->Tag); + Lookaside->L.AllocateMisses++; + Entry = (Lookaside->L.Allocate)(Lookaside->L.Type, + Lookaside->L.Size, + Lookaside->L.Tag); } return Entry; } @@ -866,17 +867,16 @@ IN PVOID Entry ) { - Lookaside->TotalFrees++; - if (ExQueryDepthSList (&Lookaside->ListHead) >= Lookaside->Depth) + Lookaside->L.TotalFrees++; + if (ExQueryDepthSList (&Lookaside->L.ListHead) >= Lookaside->L.Depth) { - Lookaside->FreeMisses++; - (Lookaside->Free)(Entry); + Lookaside->L.FreeMisses++; + (Lookaside->L.Free)(Entry); } else { - ExInterlockedPushEntrySList (&Lookaside->ListHead, - (PSINGLE_LIST_ENTRY)Entry, - &Lookaside->Obsoleted); + InterlockedPushEntrySList(&Lookaside->L.ListHead, + (PSINGLE_LIST_ENTRY)Entry); } } @@ -885,12 +885,12 @@ IN PPAGED_LOOKASIDE_LIST Lookaside, IN PVOID Entry) { - Lookaside->TotalFrees++; - if (ExQueryDepthSList(&Lookaside->ListHead) >= Lookaside->Depth) { - Lookaside->FreeMisses++; - (Lookaside->Free)(Entry); + Lookaside->L.TotalFrees++; + if (ExQueryDepthSList(&Lookaside->L.ListHead) >= Lookaside->L.Depth) { + Lookaside->L.FreeMisses++; + (Lookaside->L.Free)(Entry); } else { - InterlockedPushEntrySList(&Lookaside->ListHead, (PSLIST_ENTRY)Entry); + InterlockedPushEntrySList(&Lookaside->L.ListHead, (PSLIST_ENTRY)Entry); } } _____ Modified: trunk/reactos/include/ddk/extypes.h --- trunk/reactos/include/ddk/extypes.h 2005-05-13 02:05:15 UTC (rev 15253) +++ trunk/reactos/include/ddk/extypes.h 2005-05-13 03:34:13 UTC (rev 15254) @@ -173,52 +173,65 @@ }; /* now anonymous */ } SLIST_HEADER, *PSLIST_HEADER; +typedef struct _GENERAL_LOOKASIDE +{ + SLIST_HEADER ListHead; + USHORT Depth; + USHORT MaximumDepth; + ULONG TotalAllocates; + union { + ULONG AllocateMisses; + ULONG AllocateHits; + }; + ULONG TotalFrees; + union { + ULONG FreeMisses; + ULONG FreeHits; + }; + POOL_TYPE Type; + ULONG Tag; + ULONG Size; + PALLOCATE_FUNCTION Allocate; + PFREE_FUNCTION Free; + LIST_ENTRY ListEntry; + ULONG LastTotalAllocates; + union { + ULONG LastAllocateMisses; + ULONG LastAllocateHits; + }; + ULONG Future[2]; +} GENERAL_LOOKASIDE, *PGENERAL_LOOKASIDE; + typedef struct _NPAGED_LOOKASIDE_LIST { - SLIST_HEADER ListHead; - USHORT Depth; - USHORT MaximumDepth; - ULONG TotalAllocates; - ULONG AllocateMisses; - ULONG TotalFrees; - ULONG FreeMisses; - POOL_TYPE Type; - ULONG Tag; - ULONG Size; - PALLOCATE_FUNCTION Allocate; - PFREE_FUNCTION Free; - LIST_ENTRY ListEntry; - ULONG LastTotalAllocates; - ULONG LastAllocateMisses; - ULONG Pad[2]; - KSPIN_LOCK Obsoleted; + GENERAL_LOOKASIDE L; + KSPIN_LOCK Lock__ObsoleteButDoNotDelete; } NPAGED_LOOKASIDE_LIST, *PNPAGED_LOOKASIDE_LIST; typedef struct _PAGED_LOOKASIDE_LIST { - SLIST_HEADER ListHead; - USHORT Depth; - USHORT MaximumDepth; - ULONG TotalAllocates; - ULONG AllocateMisses; - ULONG TotalFrees; - ULONG FreeMisses; - POOL_TYPE Type; - ULONG Tag; - ULONG Size; - PALLOCATE_FUNCTION Allocate; - PFREE_FUNCTION Free; - LIST_ENTRY ListEntry; - ULONG LastTotalAllocates; - ULONG LastAllocateMisses; - FAST_MUTEX Obsoleted; + GENERAL_LOOKASIDE L; + FAST_MUTEX Lock__ObsoleteButDoNotDelete; } PAGED_LOOKASIDE_LIST, *PPAGED_LOOKASIDE_LIST; -typedef struct _PP_LOOKASIDE_LIST { - struct _GENERAL_LOOKASIDE *P; - struct _GENERAL_LOOKASIDE *L; +typedef struct _PP_LOOKASIDE_LIST +{ + PGENERAL_LOOKASIDE P; + PGENERAL_LOOKASIDE L; } PP_LOOKASIDE_LIST, *PPP_LOOKASIDE_LIST; +typedef enum _PP_NPAGED_LOOKASIDE_NUMBER +{ + LookasideSmallIrpList = 0, + LookasideLargeIrpList = 1, + LookasideMdlList = 2, + LookasideCreateInfoList = 3, + LookasideNameBufferList = 4, + LookasideTwilightList = 5, + LookasideCompletionList = 6, + LookasideMaximumList = 7 +} PP_NPAGED_LOOKASIDE_NUMBER; + typedef enum _EX_POOL_PRIORITY { LowPoolPriority, LowPoolPrioritySpecialPoolOverrun = 8, _____ Modified: trunk/reactos/ntoskrnl/ex/lookas.c --- trunk/reactos/ntoskrnl/ex/lookas.c 2005-05-13 02:05:15 UTC (rev 15253) +++ trunk/reactos/ntoskrnl/ex/lookas.c 2005-05-13 03:34:13 UTC (rev 15254) @@ -1,19 +1,14 @@ -/* $Id$ - * +/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel * FILE: ntoskrnl/ex/lookas.c * PURPOSE: Lookaside lists * - * PROGRAMMERS: David Welch (welch(a)mcmail.com) + * PROGRAMMERS: Alex Ionescu (alex(a)relsoft.net) + * David Welch (welch(a)mcmail.com) * Casper S. Hornstrup (chorns(a)users.sourceforge.net) */ - -/* - * TODO: Use InterlockedXxxEntrySList for binary compatibility - */ - /* INCLUDES *****************************************************************/ #include <ntoskrnl.h> @@ -24,295 +19,165 @@ LIST_ENTRY ExpNonPagedLookasideListHead; KSPIN_LOCK ExpNonPagedLookasideListLock; - LIST_ENTRY ExpPagedLookasideListHead; KSPIN_LOCK ExpPagedLookasideListLock; -PLOOKASIDE_MINMAX_ROUTINE ExpMinMaxRoutine; - -#define LookasideListLock(l)(&(l->Obsoleted)) - /* FUNCTIONS *****************************************************************/ -static -inline -PSINGLE_LIST_ENTRY - PopEntrySList( - PSLIST_HEADER ListHead - ) +VOID +INIT_FUNCTION +ExpInitLookasideLists() { - PSINGLE_LIST_ENTRY ListEntry; - - ListEntry = ListHead->Next.Next; - if (ListEntry!=NULL) - { - ListHead->Next.Next = ListEntry->Next; - ListHead->Depth++; - ListHead->Sequence++; - } - return ListEntry; + /* Initialize Lock and Listhead */ + InitializeListHead(&ExpNonPagedLookasideListHead); + KeInitializeSpinLock(&ExpNonPagedLookasideListLock); + InitializeListHead(&ExpPagedLookasideListHead); + KeInitializeSpinLock(&ExpPagedLookasideListLock); } - -static -inline -VOID -PushEntrySList ( - PSLIST_HEADER ListHead, - PSINGLE_LIST_ENTRY Entry - ) -{ - Entry->Next = ListHead->Next.Next; - ListHead->Next.Next = Entry; - ListHead->Depth++; - ListHead->Sequence++; -} - - -VOID ExpDefaultMinMax( - POOL_TYPE PoolType, - ULONG Size, - PUSHORT MinimumDepth, - PUSHORT MaximumDepth) /* - * FUNCTION: Determines the minimum and maximum depth of a new lookaside list - * ARGUMENTS: - * Type = Type of executive pool - * Size = Size in bytes of each element in the new lookaside list - * MinimumDepth = Buffer to store minimum depth of the new lookaside list in - * MaximumDepth = Buffer to store maximum depth of the new lookaside list in + * @implemented */ -{ - /* FIXME: Could probably do some serious computing here */ - if ((PoolType == NonPagedPool) || - (PoolType == NonPagedPoolMustSucceed)) - { - *MinimumDepth = 10; - *MaximumDepth = 100; - } - else - { - *MinimumDepth = 20; - *MaximumDepth = 200; - } -} - - -PVOID STDCALL -ExpDefaultAllocate(POOL_TYPE PoolType, - ULONG NumberOfBytes, - ULONG Tag) -/* - * FUNCTION: Default allocate function for lookaside lists - * ARGUMENTS: - * Type = Type of executive pool - * NumberOfBytes = Number of bytes to allocate - * Tag = Tag to use - * RETURNS: - * Pointer to allocated memory, or NULL if there is not enough free resources - */ -{ - return ExAllocatePoolWithTag(PoolType, NumberOfBytes, Tag); -} - - -VOID STDCALL -ExpDefaultFree(PVOID Buffer) -/* - * FUNCTION: Default free function for lookaside lists - * ARGUMENTS: - * Buffer = Pointer to memory to free - */ -{ - ExFreePool(Buffer); -} - - -VOID INIT_FUNCTION -ExpInitLookasideLists() -{ - InitializeListHead(&ExpNonPagedLookasideListHead); - KeInitializeSpinLock(&ExpNonPagedLookasideListLock); - - InitializeListHead(&ExpPagedLookasideListHead); - KeInitializeSpinLock(&ExpPagedLookasideListLock); - - /* FIXME: Possibly configure the algorithm using the registry */ - ExpMinMaxRoutine = ExpDefaultMinMax; -} - - PVOID -FASTCALL -ExiAllocateFromPagedLookasideList ( - PPAGED_LOOKASIDE_LIST Lookaside - ) +STDCALL +ExiAllocateFromPagedLookasideList(IN PPAGED_LOOKASIDE_LIST Lookaside) { - PVOID Entry; + PVOID Entry; - /* Try to obtain an entry from the lookaside list. If that fails, try to - allocate a new entry with the allocate method for the lookaside list */ - - Lookaside->TotalAllocates++; - -// ExAcquireFastMutex(LookasideListLock(Lookaside)); - - Entry = PopEntrySList(&Lookaside->ListHead); - -// ExReleaseFastMutex(LookasideListLock(Lookaside)); - - if (Entry) + Lookaside->L.TotalAllocates++; + Entry = InterlockedPopEntrySList(&Lookaside->L.ListHead); + if (!Entry) + { + Lookaside->L.AllocateMisses++; + Entry = (Lookaside->L.Allocate)(Lookaside->L.Type, + Lookaside->L.Size, + Lookaside->L.Tag); + } return Entry; - - Lookaside->AllocateMisses++; - - Entry = (*Lookaside->Allocate)(Lookaside->Type, - Lookaside->Size, - Lookaside->Tag); - - return Entry; } - /* * @implemented */ VOID STDCALL -ExDeleteNPagedLookasideList ( - PNPAGED_LOOKASIDE_LIST Lookaside - ) +ExiFreeToPagedLookasideList(IN PPAGED_LOOKASIDE_LIST Lookaside, + IN PVOID Entry) { - KIRQL OldIrql; - PVOID Entry; - - /* Pop all entries off the stack and release the resources allocated - for them */ - while ((Entry = ExInterlockedPopEntrySList( - &Lookaside->ListHead, - LookasideListLock(Lookaside))) != NULL) - { - (*Lookaside->Free)(Entry); - } - - KeAcquireSpinLock(&ExpNonPagedLookasideListLock, &OldIrql); - RemoveEntryList(&Lookaside->ListEntry); - KeReleaseSpinLock(&ExpNonPagedLookasideListLock, OldIrql); + Lookaside->L.TotalFrees++; + if (ExQueryDepthSList(&Lookaside->L.ListHead) >= Lookaside->L.Depth) + { + Lookaside->L.FreeMisses++; + (Lookaside->L.Free)(Entry); + } + else + { + InterlockedPushEntrySList(&Lookaside->L.ListHead, (PSLIST_ENTRY)Entry); + } } - /* * @implemented */ VOID STDCALL -ExDeletePagedLookasideList ( - PPAGED_LOOKASIDE_LIST Lookaside - ) +ExDeleteNPagedLookasideList(PNPAGED_LOOKASIDE_LIST Lookaside) { - KIRQL OldIrql; - PVOID Entry; + KIRQL OldIrql; + PVOID Entry; - /* Pop all entries off the stack and release the resources allocated - for them */ - for (;;) - { - -// ExAcquireFastMutex(LookasideListLock(Lookaside)); - - Entry = PopEntrySList(&Lookaside->ListHead); - if (!Entry) - break; - -// ExReleaseFastMutex(LookasideListLock(Lookaside)); - - (*Lookaside->Free)(Entry); - } - - KeAcquireSpinLock(&ExpPagedLookasideListLock, &OldIrql); - RemoveEntryList(&Lookaside->ListEntry); - KeReleaseSpinLock(&ExpPagedLookasideListLock, OldIrql); + /* Pop all entries off the stack and release the resources allocated + for them */ + for (;;) + { + Entry = InterlockedPopEntrySList(&Lookaside->L.ListHead); + if (!Entry) break; + (*Lookaside->L.Free)(Entry); + } + + /* Remove from list */ + KeAcquireSpinLock(&ExpNonPagedLookasideListLock, &OldIrql); + RemoveEntryList(&Lookaside->L.ListEntry); + KeReleaseSpinLock(&ExpNonPagedLookasideListLock, OldIrql); } - +/* + * @implemented + */ VOID STDCALL -ExiFreeToPagedLookasideList ( - PPAGED_LOOKASIDE_LIST Lookaside, - PVOID Entry - ) +ExDeletePagedLookasideList(PPAGED_LOOKASIDE_LIST Lookaside) { - Lookaside->TotalFrees++; + KIRQL OldIrql; + PVOID Entry; - if (ExQueryDepthSList(&Lookaside->ListHead) >= Lookaside->Depth) - { - Lookaside->FreeMisses++; - (*Lookaside->Free)(Entry); - } - else - { -// ExAcquireFastMutex(LookasideListLock(Lookaside)); - PushEntrySList(&Lookaside->ListHead, (PSINGLE_LIST_ENTRY)Entry); -// ExReleaseFastMutex(LookasideListLock(Lookaside)); - } + /* Pop all entries off the stack and release the resources allocated + for them */ + for (;;) + { + Entry = InterlockedPopEntrySList(&Lookaside->L.ListHead); + if (!Entry) break; + (*Lookaside->L.Free)(Entry); + } + + /* Remove from list */ + KeAcquireSpinLock(&ExpPagedLookasideListLock, &OldIrql); + RemoveEntryList(&Lookaside->L.ListEntry); + KeReleaseSpinLock(&ExpPagedLookasideListLock, OldIrql); } - /* * @implemented */ VOID STDCALL -ExInitializeNPagedLookasideList ( - PNPAGED_LOOKASIDE_LIST Lookaside, - PALLOCATE_FUNCTION Allocate, - PFREE_FUNCTION Free, - ULONG Flags, - ULONG Size, - ULONG Tag, - USHORT Depth) +ExInitializeNPagedLookasideList(PNPAGED_LOOKASIDE_LIST Lookaside, + PALLOCATE_FUNCTION Allocate, + PFREE_FUNCTION Free, + ULONG Flags, + ULONG Size, + ULONG Tag, + USHORT Depth) { - DPRINT("Initializing nonpaged lookaside list at 0x%X\n", Lookaside); + DPRINT("Initializing nonpaged lookaside list at 0x%X\n", Lookaside); - Lookaside->TotalAllocates = 0; - Lookaside->AllocateMisses = 0; - Lookaside->TotalFrees = 0; - Lookaside->FreeMisses = 0; - Lookaside->Type = NonPagedPool; - Lookaside->Tag = Tag; + /* Initialize the Header */ + ExInitializeSListHead(&Lookaside->L.ListHead); + Lookaside->L.TotalAllocates = 0; + Lookaside->L.AllocateMisses = 0; + Lookaside->L.TotalFrees = 0; + Lookaside->L.FreeMisses = 0; + Lookaside->L.Type = NonPagedPool | Flags; + Lookaside->L.Tag = Tag; + Lookaside->L.Size = Size; + Lookaside->L.Depth = 4; + Lookaside->L.MaximumDepth = 256; + Lookaside->L.LastTotalAllocates = 0; + Lookaside->L.LastAllocateMisses = 0; - /* We use a field of type SINGLE_LIST_ENTRY as a link to the next entry in - the lookaside list so we must allocate at least sizeof(SINGLE_LIST_ENTRY) */ - if (Size < sizeof(SINGLE_LIST_ENTRY)) - Lookaside->Size = sizeof(SINGLE_LIST_ENTRY); - else - Lookaside->Size = Size; + /* Set the Allocate/Free Routines */ + if (Allocate) + { + Lookaside->L.Allocate = Allocate; + } + else + { + Lookaside->L.Allocate = ExAllocatePoolWithTag; + } - if (Allocate) - Lookaside->Allocate = Allocate; - else - Lookaside->Allocate = ExpDefaultAllocate; - - if (Free) - Lookaside->Free = Free; - else - Lookaside->Free = ExpDefaultFree; - - ExInitializeSListHead(&Lookaside->ListHead); - KeInitializeSpinLock(LookasideListLock(Lookaside)); - - /* Determine minimum and maximum number of entries on the lookaside list - using the configured algorithm */ - (*ExpMinMaxRoutine)( - NonPagedPool, - Lookaside->Size, - &Lookaside->Depth, - &Lookaside->MaximumDepth); - - ExInterlockedInsertTailList( - &ExpNonPagedLookasideListHead, - &Lookaside->ListEntry, - &ExpNonPagedLookasideListLock); + if (Free) + { + Lookaside->L.Free = Free; + } + else + { + Lookaside->L.Free = ExFreePool; + } + + /* Insert it into the list */ + ExInterlockedInsertTailList(&ExpNonPagedLookasideListHead, + &Lookaside->L.ListEntry, + &ExpNonPagedLookasideListLock); } @@ -321,57 +186,53 @@ */ VOID STDCALL -ExInitializePagedLookasideList ( - PPAGED_LOOKASIDE_LIST Lookaside, - PALLOCATE_FUNCTION Allocate, - PFREE_FUNCTION Free, - ULONG Flags, - ULONG Size, - ULONG Tag, - USHORT Depth - ) +ExInitializePagedLookasideList (PPAGED_LOOKASIDE_LIST Lookaside, + PALLOCATE_FUNCTION Allocate, + PFREE_FUNCTION Free, + ULONG Flags, + ULONG Size, + ULONG Tag, + USHORT Depth) { - DPRINT("Initializing paged lookaside list at 0x%X\n", Lookaside); + DPRINT("Initializing paged lookaside list at 0x%X\n", Lookaside); - Lookaside->TotalAllocates = 0; - Lookaside->AllocateMisses = 0; - Lookaside->TotalFrees = 0; - Lookaside->FreeMisses = 0; - Lookaside->Type = PagedPool; - Lookaside->Tag = Tag; + /* Initialize the Header */ + ExInitializeSListHead(&Lookaside->L.ListHead); + Lookaside->L.TotalAllocates = 0; + Lookaside->L.AllocateMisses = 0; + Lookaside->L.TotalFrees = 0; + Lookaside->L.FreeMisses = 0; + Lookaside->L.Type = PagedPool | Flags; + Lookaside->L.Tag = Tag; + Lookaside->L.Size = Size; + Lookaside->L.Depth = 4; + Lookaside->L.MaximumDepth = 256; + Lookaside->L.LastTotalAllocates = 0; + Lookaside->L.LastAllocateMisses = 0; - /* We use a field of type SINGLE_LIST_ENTRY as a link to the next entry in - the lookaside list so we must allocate at least sizeof(SINGLE_LIST_ENTRY) */ - if (Size < sizeof(SINGLE_LIST_ENTRY)) - Lookaside->Size = sizeof(SINGLE_LIST_ENTRY); - else - Lookaside->Size = Size; + /* Set the Allocate/Free Routines */ + if (Allocate) + { + Lookaside->L.Allocate = Allocate; + } + else + { + Lookaside->L.Allocate = ExAllocatePoolWithTag; + } - if (Allocate) - Lookaside->Allocate = Allocate; - else - Lookaside->Allocate = ExpDefaultAllocate; - - if (Free) - Lookaside->Free = Free; - else - Lookaside->Free = ExpDefaultFree; - - ExInitializeSListHead(&Lookaside->ListHead); - //ExInitializeFastMutex(LookasideListLock(Lookaside)); - - /* Determine minimum and maximum number of entries on the lookaside list - using the configured algorithm */ - (*ExpMinMaxRoutine)( - PagedPool, - Lookaside->Size, - &Lookaside->Depth, - &Lookaside->MaximumDepth); - - ExInterlockedInsertTailList( - &ExpPagedLookasideListHead, - &Lookaside->ListEntry, - &ExpPagedLookasideListLock); + if (Free) + { + Lookaside->L.Free = Free; + } + else + { + Lookaside->L.Free = ExFreePool; + } + + /* Insert it into the list */ + ExInterlockedInsertTailList(&ExpNonPagedLookasideListHead, + &Lookaside->L.ListEntry, + &ExpNonPagedLookasideListLock); } /* EOF */ _____ Modified: trunk/reactos/ntoskrnl/io/iocomp.c --- trunk/reactos/ntoskrnl/io/iocomp.c 2005-05-13 02:05:15 UTC (rev 15253) +++ trunk/reactos/ntoskrnl/io/iocomp.c 2005-05-13 03:34:13 UTC (rev 15254) @@ -141,15 +141,6 @@ ExIoCompletionType->OkayToClose = NULL; ExIoCompletionType->Create = NULL; ExIoCompletionType->DuplicationNotify = NULL; - - /* Initialize the Lookaside List we'll use for packets */ - ExInitializeNPagedLookasideList(&IoCompletionPacketLookaside, - NULL, - NULL, - 0, - sizeof(IO_COMPLETION_PACKET), - IOC_TAG, - 0); } NTSTATUS _____ Modified: trunk/reactos/ntoskrnl/io/iomgr.c --- trunk/reactos/ntoskrnl/io/iomgr.c 2005-05-13 02:05:15 UTC (rev 15253) +++ trunk/reactos/ntoskrnl/io/iomgr.c 2005-05-13 03:34:13 UTC (rev 15254) @@ -18,6 +18,12 @@ #define TAG_DEVICE_TYPE TAG('D', 'E', 'V', 'T') #define TAG_FILE_TYPE TAG('F', 'I', 'L', 'E') #define TAG_ADAPTER_TYPE TAG('A', 'D', 'P', 'T') +#define IO_LARGEIRP TAG('I', 'r', 'p', 'l') +#define IO_SMALLIRP TAG('I', 'r', 'p', 's') +#define IO_LARGEIRP_CPU TAG('I', 'r', 'p', 'L') +#define IO_SMALLIRP_CPU TAG('I', 'r', 'p', 'S') +#define IOC_TAG TAG('I', 'p', 'c', ' ') +#define IOC_CPU TAG('I', 'p', 'c', 'P') /* DATA ********************************************************************/ @@ -40,6 +46,9 @@ static KSPIN_LOCK CancelSpinLock; extern LIST_ENTRY ShutdownListHead; extern KSPIN_LOCK ShutdownListLock; +extern NPAGED_LOOKASIDE_LIST IoCompletionPacketLookaside; +NPAGED_LOOKASIDE_LIST IoLargeIrpLookaside; +NPAGED_LOOKASIDE_LIST IoSmallIrpLookaside; /* INIT FUNCTIONS ************************************************************/ @@ -60,6 +69,123 @@ VOID INIT_FUNCTION +IopInitLookasideLists(VOID) +{ + ULONG LargeIrpSize, SmallIrpSize; + ULONG i; + PKPRCB Prcb; + PNPAGED_LOOKASIDE_LIST CurrentList = NULL; + + /* Calculate the sizes */ + LargeIrpSize = sizeof(IRP) + (8 * sizeof(IO_STACK_LOCATION)); + SmallIrpSize = sizeof(IRP) + sizeof(IO_STACK_LOCATION); + + /* Initialize the Lookaside List for Large IRPs */ + ExInitializeNPagedLookasideList(&IoLargeIrpLookaside, + NULL, + NULL, + 0, + LargeIrpSize, + IO_LARGEIRP, + 0); + + /* Initialize the Lookaside List for Small IRPs */ + ExInitializeNPagedLookasideList(&IoSmallIrpLookaside, + NULL, + NULL, + 0, + SmallIrpSize, + IO_SMALLIRP, + 0); + + /* Initialize the Lookaside List for I\O Completion */ + ExInitializeNPagedLookasideList(&IoCompletionPacketLookaside, + NULL, + NULL, + 0, + sizeof(IO_COMPLETION_PACKET), + IOC_TAG, + 0); + + /* Now allocate the per-processor lists */ + for (i = 0; i < KeNumberProcessors; i++) + { + /* Get the PRCB for this CPU */ + Prcb = ((PKPCR)(KPCR_BASE + i * PAGE_SIZE))->Prcb; + DPRINT1("Setting up lookaside for CPU: %x, PRCB: %p\n", i, Prcb); + + /* Set the Large IRP List */ + Prcb->PPLookasideList[LookasideLargeIrpList].L = &IoLargeIrpLookaside.L; + CurrentList = ExAllocatePoolWithTag(NonPagedPool, + sizeof(NPAGED_LOOKASIDE_LIST), + IO_LARGEIRP_CPU); + if (CurrentList) + { + /* Initialize the Lookaside List for Large IRPs */ + ExInitializeNPagedLookasideList(CurrentList, + NULL, + NULL, + 0, + LargeIrpSize, + IO_LARGEIRP_CPU, + 0); + } + else + { + CurrentList = &IoLargeIrpLookaside; + } + Prcb->PPLookasideList[LookasideLargeIrpList].P = &CurrentList->L; + + /* Set the Small IRP List */ + Prcb->PPLookasideList[LookasideSmallIrpList].L = &IoSmallIrpLookaside.L; + CurrentList = ExAllocatePoolWithTag(NonPagedPool, + sizeof(NPAGED_LOOKASIDE_LIST), + IO_SMALLIRP_CPU); + if (CurrentList) + { + /* Initialize the Lookaside List for Large IRPs */ + ExInitializeNPagedLookasideList(CurrentList, + NULL, + NULL, + 0, + SmallIrpSize, + IO_SMALLIRP_CPU, + 0); + } + else + { + CurrentList = &IoSmallIrpLookaside; + } + Prcb->PPLookasideList[LookasideSmallIrpList].P = &CurrentList->L; + + /* Set the I/O Completion List */ + Prcb->PPLookasideList[LookasideCompletionList].L = &IoCompletionPacketLookaside.L; + CurrentList = ExAllocatePoolWithTag(NonPagedPool, + sizeof(NPAGED_LOOKASIDE_LIST), + IO_SMALLIRP_CPU); + if (CurrentList) + { + /* Initialize the Lookaside List for Large IRPs */ + ExInitializeNPagedLookasideList(CurrentList, + NULL, + NULL, + 0, + SmallIrpSize, + IOC_CPU, + 0); + } + else + { + CurrentList = &IoCompletionPacketLookaside; + } + Prcb->PPLookasideList[LookasideCompletionList].P = &CurrentList->L; + } + + DPRINT1("Done allocation\n"); +} + +VOID +INIT_FUNCTION IoInit (VOID) { OBJECT_ATTRIBUTES ObjectAttributes; @@ -220,6 +346,7 @@ IopInitErrorLog(); IopInitTimerImplementation(); IopInitIoCompletionImplementation(); + IopInitLookasideLists(); /* * Create link from '\DosDevices' to '\??' directory @@ -236,7 +363,7 @@ */ PnpInit(); } - + VOID INIT_FUNCTION IoInit2(BOOLEAN BootLog) _____ Modified: trunk/reactos/ntoskrnl/ntoskrnl.def --- trunk/reactos/ntoskrnl/ntoskrnl.def 2005-05-13 02:05:15 UTC (rev 15253) +++ trunk/reactos/ntoskrnl/ntoskrnl.def 2005-05-13 03:34:13 UTC (rev 15254) @@ -70,7 +70,7 @@ @ExAcquireRundownProtectionEx@8 ExAcquireSharedStarveExclusive@8 ExAcquireSharedWaitForExclusive@8 -@ExAllocateFromPagedLookasideList@4=@ExiAllocateFromPagedLookasideList@ 4 +ExAllocateFromPagedLookasideList@4=ExiAllocateFromPagedLookasideList@4 ExAllocatePool@8 ExAllocatePoolWithQuota@8 ExAllocatePoolWithQuotaTag@12
19 years, 4 months
1
0
0
0
[arty] 15253: Fixed wrong STATUS_BUFFER_TOO_SMALL return to documented success return
by arty@svn.reactos.com
Fixed wrong STATUS_BUFFER_TOO_SMALL return to documented success return in the buffer too small case. Modified: trunk/reactos/drivers/net/tcpip/tcpip/info.c Modified: trunk/reactos/drivers/net/tcpip/tcpip/main.c _____ Modified: trunk/reactos/drivers/net/tcpip/tcpip/info.c --- trunk/reactos/drivers/net/tcpip/tcpip/info.c 2005-05-12 21:46:50 UTC (rev 15252) +++ trunk/reactos/drivers/net/tcpip/tcpip/info.c 2005-05-13 02:05:15 UTC (rev 15253) @@ -16,8 +16,11 @@ PNDIS_BUFFER ClientBuf, PUINT ClientBufSize ) { UINT RememberedCBSize = *ClientBufSize; *ClientBufSize = SizeOut; + + /* The driver returns success even when it couldn't fit every available + * byte. */ if( RememberedCBSize < SizeOut ) - return TDI_BUFFER_TOO_SMALL; + return TDI_SUCCESS; else { CopyBufferToBufferChain( ClientBuf, 0, (PCHAR)DataOut, SizeOut ); return TDI_SUCCESS; @@ -88,11 +91,14 @@ Size = EntityCount * sizeof(TDIEntityID); *BufferSize = Size; + TI_DbgPrint(DEBUG_INFO,("BufSize: %d, NeededSize: %d\n", BufSize, Size)); + if (BufSize < Size) { TcpipReleaseSpinLock( &EntityListLock, OldIrql ); - /* The buffer is too small to contain requested data */ - return TDI_BUFFER_TOO_SMALL; + /* The buffer is too small to contain requested data, but we return + * success anyway, as we did everything we wanted. */ + return TDI_SUCCESS; } /* Return entity list -- Copy only the TDIEntityID parts. */ _____ Modified: trunk/reactos/drivers/net/tcpip/tcpip/main.c --- trunk/reactos/drivers/net/tcpip/tcpip/main.c 2005-05-12 21:46:50 UTC (rev 15252) +++ trunk/reactos/drivers/net/tcpip/tcpip/main.c 2005-05-13 02:05:15 UTC (rev 15253) @@ -9,7 +9,7 @@ */ #include "precomp.h" -#define NDEBUG +//#define NDEBUG #ifndef NDEBUG DWORD DebugTraceLevel = DEBUG_ULTRA & ~(DEBUG_LOCK | DEBUG_PBUFFER);
19 years, 4 months
1
0
0
0
[hpoussin] 15252: Change ASSERTs to assert on existent variables
by hpoussin@svn.reactos.com
Change ASSERTs to assert on existent variables Modified: trunk/reactos/drivers/dd/serial/devctrl.c Modified: trunk/reactos/drivers/dd/serial/pnp.c _____ Modified: trunk/reactos/drivers/dd/serial/devctrl.c --- trunk/reactos/drivers/dd/serial/devctrl.c 2005-05-12 21:45:20 UTC (rev 15251) +++ trunk/reactos/drivers/dd/serial/devctrl.c 2005-05-12 21:46:50 UTC (rev 15252) @@ -201,9 +201,11 @@ SerialGetPerfStats(IN PIRP pIrp) { PSERIAL_DEVICE_EXTENSION pDeviceExtension; + + ASSERT(Irp); pDeviceExtension = (PSERIAL_DEVICE_EXTENSION) IoGetCurrentIrpStackLocation(pIrp)->DeviceObject->DeviceExtension; - ASSERT(DeviceExtension); + /* * we assume buffer is big enough to hold SerialPerfStats structure * caller must verify this _____ Modified: trunk/reactos/drivers/dd/serial/pnp.c --- trunk/reactos/drivers/dd/serial/pnp.c 2005-05-12 21:45:20 UTC (rev 15251) +++ trunk/reactos/drivers/dd/serial/pnp.c 2005-05-12 21:46:50 UTC (rev 15252) @@ -31,7 +31,7 @@ DPRINT("Serial: SerialAddDeviceInternal called\n"); - ASSERT(DeviceObject); + ASSERT(DriverObject); ASSERT(Pdo); /* Create new device object */
19 years, 4 months
1
0
0
0
[hpoussin] 15251: White space cleanup, correct indentation
by hpoussin@svn.reactos.com
White space cleanup, correct indentation Modified: trunk/reactos/drivers/dd/serial/close.c Modified: trunk/reactos/drivers/dd/serial/info.c Modified: trunk/reactos/drivers/dd/serial/misc.c Modified: trunk/reactos/drivers/dd/serial/rw.c _____ Modified: trunk/reactos/drivers/dd/serial/close.c --- trunk/reactos/drivers/dd/serial/close.c 2005-05-12 21:41:21 UTC (rev 15250) +++ trunk/reactos/drivers/dd/serial/close.c 2005-05-12 21:45:20 UTC (rev 15251) @@ -24,6 +24,6 @@ Irp->IoStatus.Information = 0; Irp->IoStatus.Status = STATUS_SUCCESS; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + IoCompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_SUCCESS; } _____ Modified: trunk/reactos/drivers/dd/serial/info.c --- trunk/reactos/drivers/dd/serial/info.c 2005-05-12 21:41:21 UTC (rev 15250) +++ trunk/reactos/drivers/dd/serial/info.c 2005-05-12 21:45:20 UTC (rev 15251) @@ -8,7 +8,7 @@ * PROGRAMMERS: HervÚ Poussineau (poussine(a)freesurf.fr) */ -#define NDEBUG2 +#define NDEBUG #include "serial.h" NTSTATUS STDCALL @@ -44,8 +44,8 @@ StandardInfo->EndOfFile.QuadPart = 0; StandardInfo->Directory = FALSE; StandardInfo->NumberOfLinks = 0; - StandardInfo->DeletePending = FALSE; /* FIXME: should be TRUE sometimes */ - Status = STATUS_SUCCESS; + StandardInfo->DeletePending = FALSE; /* FIXME: should be TRUE sometimes */ + Status = STATUS_SUCCESS; } break; } @@ -63,7 +63,7 @@ else { PositionInfo->CurrentByteOffset.QuadPart = 0; - Status = STATUS_SUCCESS; + Status = STATUS_SUCCESS; } break; } _____ Modified: trunk/reactos/drivers/dd/serial/misc.c --- trunk/reactos/drivers/dd/serial/misc.c 2005-05-12 21:41:21 UTC (rev 15250) +++ trunk/reactos/drivers/dd/serial/misc.c 2005-05-12 21:45:20 UTC (rev 15251) @@ -20,7 +20,7 @@ { if (Irp->PendingReturned) KeSetEvent((PKEVENT)Context, IO_NO_INCREMENT, FALSE); - return STATUS_MORE_PROCESSING_REQUIRED; + return STATUS_MORE_PROCESSING_REQUIRED; } NTSTATUS _____ Modified: trunk/reactos/drivers/dd/serial/rw.c --- trunk/reactos/drivers/dd/serial/rw.c 2005-05-12 21:41:21 UTC (rev 15250) +++ trunk/reactos/drivers/dd/serial/rw.c 2005-05-12 21:45:20 UTC (rev 15251) @@ -221,8 +221,8 @@ WorkItem = IoAllocateWorkItem(DeviceObject); if (WorkItem) { - WorkItemData->IoWorkItem = WorkItem; - IoQueueWorkItem(WorkItem, SerialReadWorkItem, DelayedWorkQueue, WorkItemData); + WorkItemData->IoWorkItem = WorkItem; + IoQueueWorkItem(WorkItem, SerialReadWorkItem, DelayedWorkQueue, WorkItemData); IoMarkIrpPending(Irp); return STATUS_PENDING; }
19 years, 4 months
1
0
0
0
[hpoussin] 15250: fdo.c: don't allocate a buffer with a SERENUM_TAG, because it is freed in ntoskrnl.
by hpoussin@svn.reactos.com
fdo.c: don't allocate a buffer with a SERENUM_TAG, because it is freed in ntoskrnl. misc.c: correct comment serenum.h: remove ExFreePoolWithTag macro and use function exported by ntoskrnl Modified: trunk/reactos/drivers/bus/serenum/fdo.c Modified: trunk/reactos/drivers/bus/serenum/misc.c Modified: trunk/reactos/drivers/bus/serenum/serenum.h _____ Modified: trunk/reactos/drivers/bus/serenum/fdo.c --- trunk/reactos/drivers/bus/serenum/fdo.c 2005-05-12 21:10:10 UTC (rev 15249) +++ trunk/reactos/drivers/bus/serenum/fdo.c 2005-05-12 21:41:21 UTC (rev 15250) @@ -125,10 +125,9 @@ } NumPDO = (DeviceExtension->AttachedPdo != NULL ? 1 : 0); - DeviceRelations = (PDEVICE_RELATIONS)ExAllocatePoolWithTag( + DeviceRelations = (PDEVICE_RELATIONS)ExAllocatePool( PagedPool, - sizeof(DEVICE_RELATIONS) + sizeof(PDEVICE_OBJECT) * (NumPDO - 1), - SERENUM_TAG); + sizeof(DEVICE_RELATIONS) + sizeof(PDEVICE_OBJECT) * (NumPDO - 1)); if (!DeviceRelations) return STATUS_INSUFFICIENT_RESOURCES; _____ Modified: trunk/reactos/drivers/bus/serenum/misc.c --- trunk/reactos/drivers/bus/serenum/misc.c 2005-05-12 21:10:10 UTC (rev 15249) +++ trunk/reactos/drivers/bus/serenum/misc.c 2005-05-12 21:41:21 UTC (rev 15250) @@ -39,7 +39,7 @@ return STATUS_SUCCESS; } -/* I really want ANSI strings as last arguments because +/* I really want PCSZ strings as last arguments because * PnP ids are ANSI-encoded in PnP device string * identification */ NTSTATUS @@ -122,7 +122,7 @@ { if (Irp->PendingReturned) KeSetEvent((PKEVENT)Context, IO_NO_INCREMENT, FALSE); - return STATUS_MORE_PROCESSING_REQUIRED; + return STATUS_MORE_PROCESSING_REQUIRED; } NTSTATUS _____ Modified: trunk/reactos/drivers/bus/serenum/serenum.h --- trunk/reactos/drivers/bus/serenum/serenum.h 2005-05-12 21:10:10 UTC (rev 15249) +++ trunk/reactos/drivers/bus/serenum/serenum.h 2005-05-12 21:41:21 UTC (rev 15250) @@ -7,7 +7,6 @@ #include <debug.h> #define SR_MSR_DSR 0x20 - #define ExFreePoolWithTag(p, tag) ExFreePool(p) /* FIXME: these prototypes MUST NOT be here! */ NTSTATUS STDCALL @@ -117,9 +116,9 @@ NTSTATUS SerenumDuplicateUnicodeString( - OUT PUNICODE_STRING Destination, - IN PUNICODE_STRING Source, - IN POOL_TYPE PoolType); + OUT PUNICODE_STRING Destination, + IN PUNICODE_STRING Source, + IN POOL_TYPE PoolType); NTSTATUS SerenumInitMultiSzString(
19 years, 4 months
1
0
0
0
[greatlrd] 15249: Remove all hardcode string to En.rc
by greatlrd@svn.reactos.com
Remove all hardcode string to En.rc so it can be translaterem Added: trunk/reactos/subsys/system/expand/En.rc Modified: trunk/reactos/subsys/system/expand/expand.c Added: trunk/reactos/subsys/system/expand/expand.rc Modified: trunk/reactos/subsys/system/expand/makefile Added: trunk/reactos/subsys/system/expand/resource.h _____ Added: trunk/reactos/subsys/system/expand/En.rc --- trunk/reactos/subsys/system/expand/En.rc 2005-05-12 21:03:51 UTC (rev 15248) +++ trunk/reactos/subsys/system/expand/En.rc 2005-05-12 21:10:10 UTC (rev 15249) @@ -0,0 +1,16 @@ +#include "resource.h" +/* + * Moved all hardcoded strings to En.rc. + * By Magnus Olsen 2005 magnus(a)itkonsult-olsen.com + */ + +LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT +STRINGTABLE DISCARDABLE +{ + +IDS_Copy, "ReactOS File Expansion Utility Version 1.0\n\ +Copyright Victor Schneider 1997\n\n\ +Usage: %s infile [outfile]\n" + +IDS_FAILS "LZCopy failed: return is %ld\n" +} _____ Modified: trunk/reactos/subsys/system/expand/expand.c --- trunk/reactos/subsys/system/expand/expand.c 2005-05-12 21:03:51 UTC (rev 15248) +++ trunk/reactos/subsys/system/expand/expand.c 2005-05-12 21:10:10 UTC (rev 15249) @@ -22,18 +22,21 @@ #include <string.h> #include <windows.h> #include <lzexpand.h> +#include <tchar.h> -int main(int argc, char *argv[]) +#include "resource.h" + +_tmain(int argc, TCHAR *argv[]) { OFSTRUCT SourceOpenStruct1, SourceOpenStruct2; LONG ret; - HFILE hSourceFile, hDestFile; + HFILE hSourceFile, hDestFile; + TCHAR szMsg[RC_STRING_MAX_SIZE]; if (argc < 2) { - fprintf( stderr, "ReactOS File Expansion Utility Version 1.0\n", argv[0] ); - fprintf( stderr, "Copyright Victor Schneider 1997\n\n", argv[0] ); - fprintf( stderr, "Usage: %s infile [outfile]\n", argv[0] ); + LoadString( GetModuleHandle(NULL), IDS_Copy, (LPTSTR) szMsg,RC_STRING_MAX_SIZE); + _ftprintf( stderr, szMsg, argv[0] ); return 1; } hSourceFile = LZOpenFile(argv[1], &SourceOpenStruct1, OF_READ); @@ -41,13 +44,14 @@ hDestFile = LZOpenFile(argv[2], &SourceOpenStruct2, OF_CREATE | OF_WRITE); else { - char OriginalName[MAX_PATH]; + TCHAR OriginalName[MAX_PATH]; GetExpandedName(argv[1], OriginalName); hDestFile = LZOpenFile(OriginalName, &SourceOpenStruct2, OF_CREATE | OF_WRITE); } ret = LZCopy(hSourceFile, hDestFile); LZClose(hSourceFile); LZClose(hDestFile); - if (ret <= 0) fprintf(stderr,"LZCopy failed: return is %ld\n",ret); + LoadString( GetModuleHandle(NULL), IDS_FAILS, (LPTSTR) szMsg,RC_STRING_MAX_SIZE); + if (ret <= 0) _ftprintf(stderr,szMsg,ret); return (ret <= 0); } _____ Added: trunk/reactos/subsys/system/expand/expand.rc --- trunk/reactos/subsys/system/expand/expand.rc 2005-05-12 21:03:51 UTC (rev 15248) +++ trunk/reactos/subsys/system/expand/expand.rc 2005-05-12 21:10:10 UTC (rev 15249) @@ -0,0 +1,9 @@ +/* $Id: format.rc 15157 2005-05-09 00:05:15Z greatlrd $ */ +#include <windows.h> +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS File Expansion Utility Version 1.0 \0" +#define REACTOS_STR_INTERNAL_NAME "expand\0" +#define REACTOS_STR_ORIGINAL_FILENAME "expand.exe\0" +#include <reactos/version.rc> + +#include "En.rc" + _____ Modified: trunk/reactos/subsys/system/expand/makefile --- trunk/reactos/subsys/system/expand/makefile 2005-05-12 21:03:51 UTC (rev 15248) +++ trunk/reactos/subsys/system/expand/makefile 2005-05-12 21:10:10 UTC (rev 15249) @@ -2,8 +2,6 @@ PATH_TO_TOP = ../../.. -TARGET_NORC = yes - TARGET_TYPE = program TARGET_APPTYPE = console @@ -12,7 +10,7 @@ TARGET_INSTALLDIR = system32 -TARGET_CFLAGS = -D__USE_W32API +TARGET_CFLAGS = -D__USE_W32API TARGET_SDKLIBS = lz32.a _____ Added: trunk/reactos/subsys/system/expand/resource.h --- trunk/reactos/subsys/system/expand/resource.h 2005-05-12 21:03:51 UTC (rev 15248) +++ trunk/reactos/subsys/system/expand/resource.h 2005-05-12 21:10:10 UTC (rev 15249) @@ -0,0 +1,8 @@ + + +#define RC_STRING_MAX_SIZE 4096 +#define IDS_Copy 100 +#define IDS_FAILS 101 + + +/* EOF */
19 years, 4 months
1
0
0
0
← Newer
1
...
43
44
45
46
47
48
49
...
82
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
Results per page:
10
25
50
100
200