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
March 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
28 participants
483 discussions
Start a n
N
ew thread
[tkreuzer] 40276: Patch by Evgeniy Boltik: Always calculate a palette for the DIB in NtGdiGetDIBitsInternal, when dealing with 15 or 16 bit depth. Fixes broken taskbar icons on 16bpp.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Mar 29 04:25:47 2009 New Revision: 40276 URL:
http://svn.reactos.org/svn/reactos?rev=40276&view=rev
Log: Patch by Evgeniy Boltik: Always calculate a palette for the DIB in NtGdiGetDIBitsInternal, when dealing with 15 or 16 bit depth. Fixes broken taskbar icons on 16bpp. Modified: trunk/reactos/subsystems/win32/win32k/objects/dibobj.c Modified: trunk/reactos/subsystems/win32/win32k/objects/dibobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dibobj.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dibobj.c [iso-8859-1] Sun Mar 29 04:25:47 2009 @@ -659,8 +659,10 @@ ColorPtr = ((PBYTE)Info + Info->bmiHeader.biSize); rgbQuads = (RGBQUAD *)ColorPtr; - /* Copy palette information */ - if (Info->bmiHeader.biBitCount == BitsPerFormat(psurf->SurfObj.iBitmapFormat)) + /* Copy palette information + * Always create a palette for 15 & 16 bit. */ + if (Info->bmiHeader.biBitCount == BitsPerFormat(psurf->SurfObj.iBitmapFormat) && + Info->bmiHeader.biBitCount != 15 && Info->bmiHeader.biBitCount != 16) { hDestPalette = hSourcePalette; bPaletteMatch = TRUE;
15 years, 9 months
1
0
0
0
[cgutman] 40275: - Fix some TDI flags
by cgutman@svn.reactos.org
Author: cgutman Date: Sun Mar 29 04:22:31 2009 New Revision: 40275 URL:
http://svn.reactos.org/svn/reactos?rev=40275&view=rev
Log: - Fix some TDI flags Modified: trunk/reactos/dll/win32/msafd/misc/sndrcv.c Modified: trunk/reactos/dll/win32/msafd/misc/sndrcv.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msafd/misc/sndrc…
============================================================================== --- trunk/reactos/dll/win32/msafd/misc/sndrcv.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msafd/misc/sndrcv.c [iso-8859-1] Sun Mar 29 04:22:31 2009 @@ -130,18 +130,15 @@ { RecvInfo.TdiFlags |= TDI_RECEIVE_EXPEDITED; } - else - { - RecvInfo.TdiFlags |= TDI_RECEIVE_NORMAL; - } if (*ReceiveFlags & MSG_PEEK) { RecvInfo.TdiFlags |= TDI_RECEIVE_PEEK; } - if (*ReceiveFlags & MSG_PARTIAL) { - RecvInfo.TdiFlags |= TDI_RECEIVE_NORMAL; + if (*ReceiveFlags & MSG_PARTIAL) + { + RecvInfo.TdiFlags |= TDI_RECEIVE_PARTIAL; } } @@ -285,10 +282,6 @@ { RecvInfo.TdiFlags |= TDI_RECEIVE_EXPEDITED; } - else - { - RecvInfo.TdiFlags |= TDI_RECEIVE_NORMAL; - } if (*ReceiveFlags & MSG_PEEK) { @@ -297,7 +290,7 @@ if (*ReceiveFlags & MSG_PARTIAL) { - RecvInfo.TdiFlags |= TDI_RECEIVE_NORMAL; + RecvInfo.TdiFlags |= TDI_RECEIVE_PARTIAL; } }
15 years, 9 months
1
0
0
0
[jimtabor] 40274: - Add The rest to W32PROCESS.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Sun Mar 29 03:28:38 2009 New Revision: 40274 URL:
http://svn.reactos.org/svn/reactos?rev=40274&view=rev
Log: - Add The rest to W32PROCESS. Modified: trunk/reactos/subsystems/win32/win32k/include/win32.h Modified: trunk/reactos/subsystems/win32/win32k/include/win32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/win32.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/win32.h [iso-8859-1] Sun Mar 29 03:28:38 2009 @@ -64,6 +64,20 @@ typedef struct _W32PROCESS { + PEPROCESS peProcess; + DWORD RefCount; + ULONG Flags; /* W32PF_flags; */ + PKEVENT InputIdleEvent; + DWORD StartCursorHideTime; + DWORD NextStart; + PVOID pDCAttrList; + PVOID pBrushAttrList; + DWORD W32Pid; + LONG GDIObjects; + LONG UserObjects; + DWORD cSimpleLock; /* Locking Process during access to structure. */ + PVOID pvAvlTable; /* Pointer to AVL Table. */ +/* ReactOS */ LIST_ENTRY ClassList; LIST_ENTRY MenuListHead; FAST_MUTEX PrivateFontListLock; @@ -71,17 +85,6 @@ FAST_MUTEX DriverObjListLock; LIST_ENTRY DriverObjListHead; struct _KBL* KeyboardLayout; - - ULONG Flags; - PKEVENT InputIdleEvent; - PVOID pDCAttrList; - PVOID pBrushAttrList; - DWORD W32Pid; - LONG GDIObjects; - LONG UserObjects; - DWORD cSimpleLock; /* Locking Process during access to structure. */ - PVOID pvAvlTable; /* Pointer to AVL Table. */ - W32HEAP_USER_MAPPING HeapMappings; PW32PROCESSINFO ProcessInfo; } W32PROCESS, *PW32PROCESS;
15 years, 9 months
1
0
0
0
[jimtabor] 40273: - Add Lock point and AVL table pointer to W32PROCESS. This is for EngAllocUserMem and friends.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Sun Mar 29 03:06:07 2009 New Revision: 40273 URL:
http://svn.reactos.org/svn/reactos?rev=40273&view=rev
Log: - Add Lock point and AVL table pointer to W32PROCESS. This is for EngAllocUserMem and friends. Modified: trunk/reactos/subsystems/win32/win32k/include/win32.h Modified: trunk/reactos/subsystems/win32/win32k/include/win32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/win32.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/win32.h [iso-8859-1] Sun Mar 29 03:06:07 2009 @@ -71,10 +71,16 @@ FAST_MUTEX DriverObjListLock; LIST_ENTRY DriverObjListHead; struct _KBL* KeyboardLayout; - ULONG Flags; - LONG GDIObjects; - LONG UserObjects; - PKEVENT InputIdleEvent; + + ULONG Flags; + PKEVENT InputIdleEvent; + PVOID pDCAttrList; + PVOID pBrushAttrList; + DWORD W32Pid; + LONG GDIObjects; + LONG UserObjects; + DWORD cSimpleLock; /* Locking Process during access to structure. */ + PVOID pvAvlTable; /* Pointer to AVL Table. */ W32HEAP_USER_MAPPING HeapMappings; PW32PROCESSINFO ProcessInfo;
15 years, 9 months
1
0
0
0
[jmorlan] 40272: - Implement CMD /A and /U switches. - CLS: Fill console with current color rather than original; if standard output is not a console, print a form-feed character. - COLOR: If standard output is not a console, do nothing.
by jmorlan@svn.reactos.org
Author: jmorlan Date: Sat Mar 28 22:36:22 2009 New Revision: 40272 URL:
http://svn.reactos.org/svn/reactos?rev=40272&view=rev
Log: - Implement CMD /A and /U switches. - CLS: Fill console with current color rather than original; if standard output is not a console, print a form-feed character. - COLOR: If standard output is not a console, do nothing. Modified: trunk/reactos/base/shell/cmd/cls.c trunk/reactos/base/shell/cmd/cmd.c trunk/reactos/base/shell/cmd/color.c trunk/reactos/base/shell/cmd/console.c Modified: trunk/reactos/base/shell/cmd/cls.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cls.c?rev=4…
============================================================================== --- trunk/reactos/base/shell/cmd/cls.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/cls.c [iso-8859-1] Sat Mar 28 22:36:22 2009 @@ -32,6 +32,7 @@ INT cmd_cls (LPTSTR param) { + HANDLE hOutput = GetStdHandle(STD_OUTPUT_HANDLE); CONSOLE_SCREEN_BUFFER_INFO csbi; COORD coPos; DWORD dwWritten; @@ -42,17 +43,22 @@ return 0; } - GetConsoleScreenBufferInfo(hConsole, &csbi); - - coPos.X = 0; - coPos.Y = 0; - FillConsoleOutputAttribute(hConsole, wColor, - csbi.dwSize.X * csbi.dwSize.Y, - coPos, &dwWritten); - FillConsoleOutputCharacter(hConsole, _T(' '), - csbi.dwSize.X * csbi.dwSize.Y, - coPos, &dwWritten); - SetConsoleCursorPosition(hConsole, coPos); + if (GetConsoleScreenBufferInfo(hOutput, &csbi)) + { + coPos.X = 0; + coPos.Y = 0; + FillConsoleOutputAttribute(hOutput, csbi.wAttributes, + csbi.dwSize.X * csbi.dwSize.Y, + coPos, &dwWritten); + FillConsoleOutputCharacter(hOutput, _T(' '), + csbi.dwSize.X * csbi.dwSize.Y, + coPos, &dwWritten); + SetConsoleCursorPosition(hOutput, coPos); + } + else + { + ConOutChar(_T('\f')); + } return 0; } Modified: trunk/reactos/base/shell/cmd/cmd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.c?rev=4…
============================================================================== --- trunk/reactos/base/shell/cmd/cmd.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/cmd.c [iso-8859-1] Sat Mar 28 22:36:22 2009 @@ -157,6 +157,7 @@ BOOL bIgnoreEcho = FALSE; /* Set this to TRUE to prevent a newline, when executing a command */ INT nErrorLevel = 0; /* Errorlevel of last launched external program */ BOOL bChildProcessRunning = FALSE; +BOOL bUnicodeOutput = FALSE; BOOL bDisableBatchEcho = FALSE; BOOL bDelayedExpansion = FALSE; DWORD dwChildProcessId = 0; @@ -171,7 +172,6 @@ static NtReadVirtualMemoryProc NtReadVirtualMemoryPtr = NULL; #ifdef INCLUDE_CMD_COLOR -WORD wColor; /* current color */ WORD wDefColor; /* default color */ #endif @@ -1818,6 +1818,10 @@ } bCanExit = FALSE; } + else if (option == _T('A')) + { + bUnicodeOutput = FALSE; + } else if (option == _T('C') || option == _T('K') || option == _T('R')) { /* Remainder of command line is a command to be run */ @@ -1840,10 +1844,13 @@ { /* process /t (color) argument */ wDefColor = (WORD)_tcstoul(&ptr[3], &ptr, 16); - wColor = wDefColor; - SetScreenColor (wColor, TRUE); + SetScreenColor(wDefColor, TRUE); } #endif + else if (option == _T('U')) + { + bUnicodeOutput = TRUE; + } else if (option == _T('V')) { bDelayedExpansion = _tcsnicmp(&ptr[2], _T(":OFF"), 4); @@ -1956,8 +1963,7 @@ ConErrFormatMessage(GetLastError()); return(1); } - wColor = Info.wAttributes; - wDefColor = wColor; + wDefColor = Info.wAttributes; InputCodePage= GetConsoleCP(); OutputCodePage = GetConsoleOutputCP(); Modified: trunk/reactos/base/shell/cmd/color.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/color.c?rev…
============================================================================== --- trunk/reactos/base/shell/cmd/color.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/color.c [iso-8859-1] Sat Mar 28 22:36:22 2009 @@ -30,6 +30,7 @@ VOID SetScreenColor (WORD wColor, BOOL bNoFill) { + HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); DWORD dwWritten; CONSOLE_SCREEN_BUFFER_INFO csbi; COORD coPos; @@ -65,6 +66,8 @@ */ INT CommandColor (LPTSTR rest) { + WORD wColor; + if (_tcsncmp (rest, _T("/?"), 2) == 0) { ConOutResPaging(TRUE,STRING_COLOR_HELP1); @@ -84,6 +87,7 @@ if ( _tcslen(&rest[0])==1) { + HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); if ( (_tcscmp(&rest[0], _T("0")) >=0 ) && (_tcscmp(&rest[0], _T("9")) <=0 ) ) { SetConsoleTextAttribute (hConsole, (WORD)_ttoi(rest)); Modified: trunk/reactos/base/shell/cmd/console.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/console.c?r…
============================================================================== --- trunk/reactos/base/shell/cmd/console.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/console.c [iso-8859-1] Sat Mar 28 22:36:22 2009 @@ -128,61 +128,45 @@ SetConsoleMode (hFile, dwOldMode); } -static VOID ConChar(TCHAR c, DWORD nStdHandle) +static VOID ConWrite(TCHAR *str, DWORD len, DWORD nStdHandle) { DWORD dwWritten; - CHAR cc; + HANDLE hOutput = GetStdHandle(nStdHandle); + + if (WriteConsole(hOutput, str, len, &dwWritten, NULL)) + return; + + /* We're writing to a file or pipe instead of the console. Convert the + * string from TCHARs to the desired output format, if the two differ */ + if (bUnicodeOutput) + { +#ifndef _UNICODE + WCHAR buffer[len]; + len = MultiByteToWideChar(OutputCodePage, 0, str, len, buffer, len, NULL, NULL); + str = (PVOID)buffer; +#endif + WriteFile(hOutput, str, len * sizeof(WCHAR), &dwWritten, NULL); + } + else + { #ifdef _UNICODE - CHAR as[2]; - WCHAR ws[2]; - ws[0] = c; - ws[1] = 0; - WideCharToMultiByte( OutputCodePage, 0, ws, 2, as, 2, NULL, NULL); - cc = as[0]; -#else - cc = c; + CHAR buffer[len * MB_LEN_MAX]; + len = WideCharToMultiByte(OutputCodePage, 0, str, len, buffer, len * MB_LEN_MAX, NULL, NULL); + str = (PVOID)buffer; #endif - WriteFile (GetStdHandle (nStdHandle), - &cc, - 1, - &dwWritten, - NULL); + WriteFile(hOutput, str, len, &dwWritten, NULL); + } } VOID ConOutChar (TCHAR c) { - ConChar(c, STD_OUTPUT_HANDLE); + ConWrite(&c, 1, STD_OUTPUT_HANDLE); } VOID ConPuts(LPTSTR szText, DWORD nStdHandle) { - DWORD dwWritten; - HANDLE hStdHandle; - PCHAR pBuf; - INT len; - - len = _tcslen(szText); -#ifdef _UNICODE - pBuf = cmd_alloc(len * 2 + 1); - len = WideCharToMultiByte(OutputCodePage, 0, szText, len + 1, pBuf, len * 2 + 1, NULL, NULL) - 1; -#else - pBuf = szText; -#endif - hStdHandle = GetStdHandle(nStdHandle); - - WriteFile (hStdHandle, - pBuf, - len, - &dwWritten, - NULL); - WriteFile (hStdHandle, - _T("\n"), - 1, - &dwWritten, - NULL); -#ifdef _UNICODE - cmd_free(pBuf); -#endif + ConWrite(szText, _tcslen(szText), nStdHandle); + ConWrite(_T("\n"), 1, nStdHandle); } VOID ConOutResPaging(BOOL NewPage, UINT resID) @@ -208,28 +192,8 @@ VOID ConPrintf(LPTSTR szFormat, va_list arg_ptr, DWORD nStdHandle) { - INT len; - PCHAR pBuf; TCHAR szOut[OUTPUT_BUFFER_SIZE]; - DWORD dwWritten; - - len = _vstprintf(szOut, szFormat, arg_ptr); -#ifdef _UNICODE - pBuf = cmd_alloc(len * 2 + 1); - len = WideCharToMultiByte(OutputCodePage, 0, szOut, len + 1, pBuf, len * 2 + 1, NULL, NULL) - 1; -#else - pBuf = szOut; -#endif - - WriteFile (GetStdHandle (nStdHandle), - pBuf, - len, - &dwWritten, - NULL); - -#ifdef _UNICODE - cmd_free(pBuf); -#endif + ConWrite(szOut, _vstprintf(szOut, szFormat, arg_ptr), nStdHandle); } INT ConPrintfPaging(BOOL NewPage, LPTSTR szFormat, va_list arg_ptr, DWORD nStdHandle) @@ -398,7 +362,7 @@ VOID ConErrChar (TCHAR c) { - ConChar(c, STD_ERROR_HANDLE); + ConWrite(&c, 1, STD_ERROR_HANDLE); }
15 years, 9 months
1
0
0
0
[cgutman] 40271: - Fix a typo
by cgutman@svn.reactos.org
Author: cgutman Date: Sat Mar 28 20:52:50 2009 New Revision: 40271 URL:
http://svn.reactos.org/svn/reactos?rev=40271&view=rev
Log: - Fix a typo Modified: trunk/reactos/drivers/network/ndis/ndis/memory.c Modified: trunk/reactos/drivers/network/ndis/ndis/memory.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
============================================================================== --- trunk/reactos/drivers/network/ndis/ndis/memory.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/ndis/ndis/memory.c [iso-8859-1] Sat Mar 28 20:52:50 2009 @@ -268,7 +268,8 @@ if (Memory->Adapter->DriverHandle->MiniportCharacteristics.AllocateCompleteHandler) Memory->Adapter->DriverHandle->MiniportCharacteristics.AllocateCompleteHandler( - Memory->Adapter, Memory->VirtualAddress, &Memory->PhysicalAddress, Memory->Length, Memory->Context); + Memory->Adapter->MiniportAdapterContext, Memory->VirtualAddress, + &Memory->PhysicalAddress, Memory->Length, Memory->Context); ExFreePool(Memory); }
15 years, 9 months
1
0
0
0
[cgutman] 40270: - Implement NdisMAllocateSharedMemoryAsync - Zero the entire packet in NdisAllocatePacket
by cgutman@svn.reactos.org
Author: cgutman Date: Sat Mar 28 20:49:27 2009 New Revision: 40270 URL:
http://svn.reactos.org/svn/reactos?rev=40270&view=rev
Log: - Implement NdisMAllocateSharedMemoryAsync - Zero the entire packet in NdisAllocatePacket Modified: trunk/reactos/drivers/network/ndis/include/miniport.h trunk/reactos/drivers/network/ndis/ndis/50stubs.c trunk/reactos/drivers/network/ndis/ndis/buffer.c trunk/reactos/drivers/network/ndis/ndis/memory.c Modified: trunk/reactos/drivers/network/ndis/include/miniport.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/inclu…
============================================================================== --- trunk/reactos/drivers/network/ndis/include/miniport.h [iso-8859-1] (original) +++ trunk/reactos/drivers/network/ndis/include/miniport.h [iso-8859-1] Sat Mar 28 20:49:27 2009 @@ -58,11 +58,13 @@ /* a miniport's shared memory */ typedef struct _MINIPORT_SHARED_MEMORY { - PDMA_ADAPTER AdapterObject; - ULONG Length; - PHYSICAL_ADDRESS PhysicalAddress; - PVOID VirtualAddress; - BOOLEAN Cached; + PDMA_ADAPTER AdapterObject; + ULONG Length; + PHYSICAL_ADDRESS PhysicalAddress; + PVOID VirtualAddress; + BOOLEAN Cached; + PNDIS_MINIPORT_BLOCK Adapter; + PVOID Context; } MINIPORT_SHARED_MEMORY, *PMINIPORT_SHARED_MEMORY; /* A structure of WrapperConfigurationContext (not compatible with the Modified: trunk/reactos/drivers/network/ndis/ndis/50stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
============================================================================== --- trunk/reactos/drivers/network/ndis/ndis/50stubs.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/ndis/ndis/50stubs.c [iso-8859-1] Sat Mar 28 20:49:27 2009 @@ -661,23 +661,6 @@ UNIMPLEMENTED } - -/* - * @unimplemented - */ -NDIS_STATUS -EXPORT -NdisMAllocateSharedMemoryAsync( - IN NDIS_HANDLE MiniportAdapterHandle, - IN ULONG Length, - IN BOOLEAN Cached, - IN PVOID Context) -{ - UNIMPLEMENTED - - return NDIS_STATUS_FAILURE; -} - /* * @unimplemented */ @@ -701,6 +684,8 @@ * Length = Number of bytes to copy */ { + UNIMPLEMENTED + *Status = NDIS_STATUS_FAILURE; } Modified: trunk/reactos/drivers/network/ndis/ndis/buffer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
============================================================================== --- trunk/reactos/drivers/network/ndis/ndis/buffer.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/ndis/ndis/buffer.c [iso-8859-1] Sat Mar 28 20:49:27 2009 @@ -424,7 +424,7 @@ KeReleaseSpinLock(&Pool->SpinLock.SpinLock, OldIrql); - RtlZeroMemory(&Temp->Private, sizeof(NDIS_PACKET_PRIVATE)); + RtlZeroMemory(Temp, sizeof(NDIS_PACKET)); Temp->Private.Pool = Pool; *Packet = Temp; Modified: trunk/reactos/drivers/network/ndis/ndis/memory.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
============================================================================== --- trunk/reactos/drivers/network/ndis/ndis/memory.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/ndis/ndis/memory.c [iso-8859-1] Sat Mar 28 20:49:27 2009 @@ -245,6 +245,74 @@ ZwClose(ThreadHandle); } +VOID +NTAPI +NdisMAllocateSharedMemoryPassive( + PVOID Context) +/* + * FUNCTION: Allocate a common buffer + * ARGUMENTS: + * Context: Pointer to a miniport shared memory context + * NOTES: + * - Called by NdisMAllocateSharedMemoryAsync to do the actual work + */ +{ + PMINIPORT_SHARED_MEMORY Memory = (PMINIPORT_SHARED_MEMORY)Context; + + NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); + + ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL); + + Memory->VirtualAddress = Memory->AdapterObject->DmaOperations->AllocateCommonBuffer( + Memory->AdapterObject, Memory->Length, &Memory->PhysicalAddress, Memory->Cached); + + if (Memory->Adapter->DriverHandle->MiniportCharacteristics.AllocateCompleteHandler) + Memory->Adapter->DriverHandle->MiniportCharacteristics.AllocateCompleteHandler( + Memory->Adapter, Memory->VirtualAddress, &Memory->PhysicalAddress, Memory->Length, Memory->Context); + + ExFreePool(Memory); +} + + +/* + * @implemented + */ +NDIS_STATUS +EXPORT +NdisMAllocateSharedMemoryAsync( + IN NDIS_HANDLE MiniportAdapterHandle, + IN ULONG Length, + IN BOOLEAN Cached, + IN PVOID Context) +{ + HANDLE ThreadHandle; + PLOGICAL_ADAPTER Adapter = (PLOGICAL_ADAPTER)MiniportAdapterHandle; + PMINIPORT_SHARED_MEMORY Memory; + + NDIS_DbgPrint(MAX_TRACE,("Called.\n")); + + ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL); + + /* Must be NonpagedPool because by definition we're at DISPATCH_LEVEL */ + Memory = ExAllocatePool(NonPagedPool, sizeof(MINIPORT_SHARED_MEMORY)); + + if(!Memory) + { + NDIS_DbgPrint(MID_TRACE, ("Insufficient resources\n")); + return NDIS_STATUS_FAILURE; + } + + Memory->AdapterObject = Adapter->NdisMiniportBlock.SystemAdapterObject; + Memory->Length = Length; + Memory->Cached = Cached; + Memory->Adapter = &Adapter->NdisMiniportBlock; + Memory->Context = Context; + + PsCreateSystemThread(&ThreadHandle, THREAD_ALL_ACCESS, 0, 0, 0, NdisMAllocateSharedMemoryPassive, Memory); + ZwClose(ThreadHandle); + + return NDIS_STATUS_PENDING; +} /* * @implemented
15 years, 9 months
1
0
0
0
[fireball] 40269: - Remove a header structure from memory regions allocated with EngAllocUserMem. Modern versions of Windows (at least XP and higher) don't do this and instead save this information elsewhere. Confirmed by Alexandre Julliard's test case for calling WriteFile with the DIB section bits as buffer (5 less failures now) and by arguing with Evgeniy Boltik.
by fireball@svn.reactos.org
Author: fireball Date: Sat Mar 28 20:06:17 2009 New Revision: 40269 URL:
http://svn.reactos.org/svn/reactos?rev=40269&view=rev
Log: - Remove a header structure from memory regions allocated with EngAllocUserMem. Modern versions of Windows (at least XP and higher) don't do this and instead save this information elsewhere. Confirmed by Alexandre Julliard's test case for calling WriteFile with the DIB section bits as buffer (5 less failures now) and by arguing with Evgeniy Boltik. Modified: trunk/reactos/subsystems/win32/win32k/eng/mem.c Modified: trunk/reactos/subsystems/win32/win32k/eng/mem.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/eng/mem.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/eng/mem.c [iso-8859-1] Sat Mar 28 20:06:17 2009 @@ -31,13 +31,6 @@ #define NDEBUG #include <debug.h> - -typedef struct _USERMEMHEADER - { - ULONG Tag; - ULONG MemSize; - } -USERMEMHEADER, *PUSERMEMHEADER; /* * @implemented @@ -76,8 +69,7 @@ { PVOID NewMem = NULL; NTSTATUS Status; - SIZE_T MemSize = sizeof(USERMEMHEADER) + cj; - PUSERMEMHEADER Header; + SIZE_T MemSize = cj; Status = ZwAllocateVirtualMemory(NtCurrentProcess(), &NewMem, 0, &MemSize, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); @@ -86,11 +78,9 @@ return NULL; } - Header = (PUSERMEMHEADER) NewMem; - Header->Tag = Tag; - Header->MemSize = cj; + /* TODO: Add allocation info to AVL tree (stored inside W32PROCESS structure) */ - return (PVOID)(Header + 1); + return NewMem; } /* @@ -99,10 +89,12 @@ VOID APIENTRY EngFreeUserMem(PVOID pv) { - PUSERMEMHEADER Header = ((PUSERMEMHEADER) pv) - 1; + PVOID BaseAddress = pv; SIZE_T MemSize = 0; - ZwFreeVirtualMemory(NtCurrentProcess(), (PVOID *) &Header, &MemSize, MEM_RELEASE); + ZwFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &MemSize, MEM_RELEASE); + + /* TODO: Remove allocation info from AVL tree */ }
15 years, 9 months
1
0
0
0
[fireball] 40268: - Pass correct allocation flags to ZwAllocateVirtualMemory. - Don't provide region size when freeing virtual memory (spotted by Evgeniy Boltik, confirmed by MSDN).
by fireball@svn.reactos.org
Author: fireball Date: Sat Mar 28 19:53:51 2009 New Revision: 40268 URL:
http://svn.reactos.org/svn/reactos?rev=40268&view=rev
Log: - Pass correct allocation flags to ZwAllocateVirtualMemory. - Don't provide region size when freeing virtual memory (spotted by Evgeniy Boltik, confirmed by MSDN). Modified: trunk/reactos/subsystems/win32/win32k/eng/mem.c Modified: trunk/reactos/subsystems/win32/win32k/eng/mem.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/eng/mem.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/eng/mem.c [iso-8859-1] Sat Mar 28 19:53:51 2009 @@ -79,7 +79,7 @@ SIZE_T MemSize = sizeof(USERMEMHEADER) + cj; PUSERMEMHEADER Header; - Status = ZwAllocateVirtualMemory(NtCurrentProcess(), &NewMem, 0, &MemSize, MEM_COMMIT, PAGE_READWRITE); + Status = ZwAllocateVirtualMemory(NtCurrentProcess(), &NewMem, 0, &MemSize, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); if (! NT_SUCCESS(Status)) { @@ -100,7 +100,7 @@ EngFreeUserMem(PVOID pv) { PUSERMEMHEADER Header = ((PUSERMEMHEADER) pv) - 1; - SIZE_T MemSize = sizeof(USERMEMHEADER) + Header->MemSize; + SIZE_T MemSize = 0; ZwFreeVirtualMemory(NtCurrentProcess(), (PVOID *) &Header, &MemSize, MEM_RELEASE); }
15 years, 9 months
1
0
0
0
[cgutman] 40267: - Remove a useless parameter from UnlockAndMaybeComplete - Fix a few listening bugs
by cgutman@svn.reactos.org
Author: cgutman Date: Sat Mar 28 18:49:29 2009 New Revision: 40267 URL:
http://svn.reactos.org/svn/reactos?rev=40267&view=rev
Log: - Remove a useless parameter from UnlockAndMaybeComplete - Fix a few listening bugs Modified: trunk/reactos/drivers/network/afd/afd/bind.c trunk/reactos/drivers/network/afd/afd/connect.c trunk/reactos/drivers/network/afd/afd/context.c trunk/reactos/drivers/network/afd/afd/info.c trunk/reactos/drivers/network/afd/afd/listen.c trunk/reactos/drivers/network/afd/afd/lock.c trunk/reactos/drivers/network/afd/afd/main.c trunk/reactos/drivers/network/afd/afd/read.c trunk/reactos/drivers/network/afd/afd/select.c trunk/reactos/drivers/network/afd/afd/write.c trunk/reactos/drivers/network/afd/include/afd.h Modified: trunk/reactos/drivers/network/afd/afd/bind.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/bi…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/bind.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/bind.c [iso-8859-1] Sat Mar 28 18:49:29 2009 @@ -56,7 +56,7 @@ if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); if( !(BindReq = LockRequest( Irp, IrpSp )) ) return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, - Irp, 0, NULL ); + Irp, 0 ); if( FCB->LocalAddress ) ExFreePool( FCB->LocalAddress ); FCB->LocalAddress = TaCopyTransportAddress( &BindReq->Address ); @@ -67,7 +67,7 @@ if( NT_SUCCESS(Status) ) FCB->State = SOCKET_STATE_BOUND; - else return UnlockAndMaybeComplete( FCB, Status, Irp, 0, NULL ); + else return UnlockAndMaybeComplete( FCB, Status, Irp, 0 ); AFD_DbgPrint(MID_TRACE,("FCB->Flags %x\n", FCB->Flags)); @@ -76,7 +76,7 @@ TdiBuildConnectionInfo( &FCB->AddressFrom, FCB->LocalAddress ); - if( !FCB->AddressFrom ) return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0, NULL ); + if( !FCB->AddressFrom ) return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0 ); AFD_DbgPrint(MID_TRACE,("Calling TdiReceiveDatagram\n")); @@ -95,6 +95,6 @@ if( Status == STATUS_PENDING ) Status = STATUS_SUCCESS; } - return UnlockAndMaybeComplete( FCB, Status, Irp, 0, NULL ); + return UnlockAndMaybeComplete( FCB, Status, Irp, 0 ); } Modified: trunk/reactos/drivers/network/afd/afd/connect.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/co…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/connect.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/connect.c [iso-8859-1] Sat Mar 28 18:49:29 2009 @@ -179,7 +179,7 @@ if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); if( !(ConnectReq = LockRequest( Irp, IrpSp )) ) return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, - 0, NULL ); + 0 ); AFD_DbgPrint(MID_TRACE,("Connect request:\n")); #if 0 @@ -207,10 +207,10 @@ if( NT_SUCCESS(Status) ) FCB->State = SOCKET_STATE_BOUND; else - return UnlockAndMaybeComplete( FCB, Status, Irp, 0, NULL ); + return UnlockAndMaybeComplete( FCB, Status, Irp, 0 ); } else return UnlockAndMaybeComplete - ( FCB, STATUS_NO_MEMORY, Irp, 0, NULL ); + ( FCB, STATUS_NO_MEMORY, Irp, 0 ); /* Drop through to SOCKET_STATE_BOUND */ @@ -264,5 +264,5 @@ break; } - return UnlockAndMaybeComplete( FCB, Status, Irp, 0, NULL ); -} + return UnlockAndMaybeComplete( FCB, Status, Irp, 0 ); +} Modified: trunk/reactos/drivers/network/afd/afd/context.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/co…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/context.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/context.c [iso-8859-1] Sat Mar 28 18:49:29 2009 @@ -33,7 +33,7 @@ AFD_DbgPrint(MID_TRACE,("Returning %x\n", Status)); - return UnlockAndMaybeComplete( FCB, Status, Irp, 0, NULL ); + return UnlockAndMaybeComplete( FCB, Status, Irp, 0 ); } NTSTATUS NTAPI @@ -52,7 +52,7 @@ FCB->Context = ExAllocatePool( PagedPool, IrpSp->Parameters.DeviceIoControl.InputBufferLength ); - if( !FCB->Context ) return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0, NULL ); + if( !FCB->Context ) return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0 ); FCB->ContextSize = IrpSp->Parameters.DeviceIoControl.InputBufferLength; @@ -60,5 +60,5 @@ IrpSp->Parameters.DeviceIoControl.Type3InputBuffer, FCB->ContextSize ); - return UnlockAndMaybeComplete( FCB, STATUS_SUCCESS, Irp, 0, NULL ); + return UnlockAndMaybeComplete( FCB, STATUS_SUCCESS, Irp, 0 ); } Modified: trunk/reactos/drivers/network/afd/afd/info.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/in…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/info.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/info.c [iso-8859-1] Sat Mar 28 18:49:29 2009 @@ -66,7 +66,7 @@ AFD_DbgPrint(MID_TRACE,("Returning %x\n", Status)); - return UnlockAndMaybeComplete( FCB, Status, Irp, 0, NULL ); + return UnlockAndMaybeComplete( FCB, Status, Irp, 0 ); } NTSTATUS NTAPI @@ -80,8 +80,7 @@ if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); if( FCB->AddressFile.Object == NULL && FCB->Connection.Object == NULL ) { - return UnlockAndMaybeComplete( FCB, STATUS_INVALID_PARAMETER, Irp, 0, - NULL ); + return UnlockAndMaybeComplete( FCB, STATUS_INVALID_PARAMETER, Irp, 0 ); } Mdl = IoAllocateMdl @@ -108,7 +107,7 @@ } else Status = STATUS_INSUFFICIENT_RESOURCES; - return UnlockAndMaybeComplete( FCB, Status, Irp, 0, NULL ); + return UnlockAndMaybeComplete( FCB, Status, Irp, 0 ); } NTSTATUS NTAPI @@ -124,7 +123,7 @@ if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); if (FCB->RemoteAddress == NULL || FCB->Connection.Object == NULL) { - return UnlockAndMaybeComplete( FCB, STATUS_INVALID_PARAMETER, Irp, 0, NULL ); + return UnlockAndMaybeComplete( FCB, STATUS_INVALID_PARAMETER, Irp, 0 ); } if(NT_SUCCESS(Status = TdiBuildNullConnectionInfo @@ -164,5 +163,5 @@ ExFreePool(ConnInfo); } - return UnlockAndMaybeComplete( FCB, Status, Irp, 0, NULL ); + return UnlockAndMaybeComplete( FCB, Status, Irp, 0 ); } Modified: trunk/reactos/drivers/network/afd/afd/listen.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/li…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/listen.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/listen.c [iso-8859-1] Sat Mar 28 18:49:29 2009 @@ -41,15 +41,7 @@ PollReeval( DeviceExt, NewFileObject ); } - if( Irp->MdlAddress ) UnlockRequest( Irp, IoGetCurrentIrpStackLocation( Irp ) ); - - Irp->IoStatus.Information = 0; - Irp->IoStatus.Status = Status; - IoCompleteRequest( Irp, IO_NETWORK_INCREMENT ); - - SocketStateUnlock( FCB ); - - return Status; + return UnlockAndMaybeComplete( FCB, Status, Irp, 0 ); } static NTSTATUS SatisfyPreAccept( PIRP Irp, PAFD_TDI_OBJECT_QELT Qelt ) { @@ -197,12 +189,12 @@ if( !(ListenReq = LockRequest( Irp, IrpSp )) ) return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, - 0, NULL ); + 0 ); if( FCB->State != SOCKET_STATE_BOUND ) { Status = STATUS_INVALID_PARAMETER; AFD_DbgPrint(MID_TRACE,("Could not listen an unbound socket\n")); - return UnlockAndMaybeComplete( FCB, Status, Irp, 0, NULL ); + return UnlockAndMaybeComplete( FCB, Status, Irp, 0 ); } FCB->DelayedAccept = ListenReq->UseDelayedAcceptance; @@ -213,7 +205,7 @@ AFD_DbgPrint(MID_TRACE,("Status from warmsocket %x\n", Status)); - if( !NT_SUCCESS(Status) ) return UnlockAndMaybeComplete( FCB, Status, Irp, 0, NULL ); + if( !NT_SUCCESS(Status) ) return UnlockAndMaybeComplete( FCB, Status, Irp, 0 ); TdiBuildNullConnectionInfo ( &FCB->ListenIrp.ConnectionCallInfo, @@ -223,7 +215,7 @@ FCB->LocalAddress->Address[0].AddressType ); if( !FCB->ListenIrp.ConnectionReturnInfo || !FCB->ListenIrp.ConnectionCallInfo ) - return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0, NULL ); + return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0 ); FCB->State = SOCKET_STATE_LISTENING; @@ -235,11 +227,11 @@ ListenComplete, FCB ); - if( NT_SUCCESS(Status) || Status == STATUS_PENDING ) + if( Status == STATUS_PENDING ) Status = STATUS_SUCCESS; AFD_DbgPrint(MID_TRACE,("Returning %x\n", Status)); - return UnlockAndMaybeComplete( FCB, Status, Irp, 0, NULL ); + return UnlockAndMaybeComplete( FCB, Status, Irp, 0 ); } NTSTATUS AfdWaitForListen( PDEVICE_OBJECT DeviceObject, PIRP Irp, @@ -298,11 +290,15 @@ Status = WarmSocketForConnection( FCB ); if( Status == STATUS_SUCCESS ) { - TdiBuildNullConnectionInfo - ( &FCB->ListenIrp.ConnectionReturnInfo, - FCB->LocalAddress->Address[0].AddressType ); - - if( !FCB->ListenIrp.ConnectionReturnInfo ) return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0, NULL ); + TdiBuildNullConnectionInfo + ( &FCB->ListenIrp.ConnectionCallInfo, + FCB->LocalAddress->Address[0].AddressType ); + TdiBuildNullConnectionInfo + ( &FCB->ListenIrp.ConnectionReturnInfo, + FCB->LocalAddress->Address[0].AddressType ); + + if( !FCB->ListenIrp.ConnectionReturnInfo || !FCB->ListenIrp.ConnectionCallInfo ) + return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0 ); Status = TdiListen( &FCB->ListenIrp.InFlightRequest, FCB->Connection.Object, @@ -311,8 +307,15 @@ &FCB->ListenIrp.Iosb, ListenComplete, FCB ); - } else return UnlockAndMaybeComplete( FCB, Status, Irp, 0, NULL ); - FCB->NeedsNewListen = FALSE; + + if( Status == STATUS_PENDING ) + Status = STATUS_SUCCESS; + + if( !NT_SUCCESS(Status) ) + return UnlockAndMaybeComplete( FCB, Status, Irp, 0 ); + + FCB->NeedsNewListen = FALSE; + } else return UnlockAndMaybeComplete( FCB, Status, Irp, 0 ); } for( PendingConn = FCB->PendingConnections.Flink; @@ -338,7 +341,7 @@ (PVOID *)&NewFileObject, NULL ); - if( !NT_SUCCESS(Status) ) UnlockAndMaybeComplete( FCB, Status, Irp, 0, NULL ); + if( !NT_SUCCESS(Status) ) UnlockAndMaybeComplete( FCB, Status, Irp, 0 ); ASSERT(NewFileObject != FileObject); ASSERT(NewFileObject->FsContext != FCB); @@ -362,5 +365,5 @@ } } - return UnlockAndMaybeComplete( FCB, STATUS_UNSUCCESSFUL, Irp, 0, NULL ); -} + return UnlockAndMaybeComplete( FCB, STATUS_UNSUCCESSFUL, Irp, 0 ); +} Modified: trunk/reactos/drivers/network/afd/afd/lock.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/lo…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/lock.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/lock.c [iso-8859-1] Sat Mar 28 18:49:29 2009 @@ -285,8 +285,7 @@ NTSTATUS NTAPI UnlockAndMaybeComplete ( PAFD_FCB FCB, NTSTATUS Status, PIRP Irp, - UINT Information, - PIO_COMPLETION_ROUTINE Completion ) { + UINT Information ) { Irp->IoStatus.Status = Status; Irp->IoStatus.Information = Information; @@ -300,8 +299,6 @@ } else { if ( Irp->MdlAddress ) UnlockRequest( Irp, IoGetCurrentIrpStackLocation( Irp ) ); SocketStateUnlock( FCB ); - if( Completion ) - Completion( FCB->DeviceExt->DeviceObject, Irp, FCB ); IoCompleteRequest( Irp, IO_NETWORK_INCREMENT ); } return Status; @@ -323,5 +320,5 @@ &Irp->Tail.Overlay.ListEntry ); IoMarkIrpPending(Irp); Irp->IoStatus.Status = STATUS_PENDING; - return UnlockAndMaybeComplete( FCB, STATUS_PENDING, Irp, 0, NULL ); -} + return UnlockAndMaybeComplete( FCB, STATUS_PENDING, Irp, 0 ); +} Modified: trunk/reactos/drivers/network/afd/afd/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/ma…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/main.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/main.c [iso-8859-1] Sat Mar 28 18:49:29 2009 @@ -270,7 +270,7 @@ if( !(DisReq = LockRequest( Irp, IrpSp )) ) return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, - Irp, 0, NULL ); + Irp, 0 ); if (NULL == FCB->RemoteAddress) { @@ -283,7 +283,7 @@ if( !NT_SUCCESS(Status) || !ConnInfo ) return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, - Irp, 0, NULL ); + Irp, 0 ); } if( DisReq->DisconnectType & AFD_DISCONNECT_SEND ) @@ -303,7 +303,7 @@ if (ConnInfo) ExFreePool( ConnInfo ); - return UnlockAndMaybeComplete( FCB, Status, Irp, 0, NULL ); + return UnlockAndMaybeComplete( FCB, Status, Irp, 0 ); } static NTSTATUS NTAPI Modified: trunk/reactos/drivers/network/afd/afd/read.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/re…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/read.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/read.c [iso-8859-1] Sat Mar 28 18:49:29 2009 @@ -284,14 +284,14 @@ AFD_DbgPrint(MID_TRACE,("Called recv on wrong kind of socket (s%x)\n", FCB->State)); return UnlockAndMaybeComplete( FCB, STATUS_INVALID_PARAMETER, - Irp, 0, NULL ); + Irp, 0 ); } if( FCB->Flags & AFD_ENDPOINT_CONNECTIONLESS ) { AFD_DbgPrint(MID_TRACE,("Receive on connection-less sockets not implemented\n")); return UnlockAndMaybeComplete( FCB, STATUS_NOT_IMPLEMENTED, - Irp, 0, NULL ); + Irp, 0 ); } FCB->EventsFired &= ~AFD_EVENT_RECEIVE; @@ -299,7 +299,7 @@ if( !(RecvReq = LockRequest( Irp, IrpSp )) ) return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, - Irp, 0, NULL ); + Irp, 0 ); AFD_DbgPrint(MID_TRACE,("Recv flags %x\n", RecvReq->AfdFlags)); @@ -310,7 +310,7 @@ if( !RecvReq->BufferArray ) { return UnlockAndMaybeComplete( FCB, STATUS_ACCESS_VIOLATION, - Irp, 0, NULL ); + Irp, 0 ); } Irp->IoStatus.Status = STATUS_PENDING; @@ -330,7 +330,7 @@ RemoveEntryList( &Irp->Tail.Overlay.ListEntry ); UnlockBuffers( RecvReq->BufferArray, RecvReq->BufferCount, FALSE ); return UnlockAndMaybeComplete( FCB, Status, Irp, - TotalBytesCopied, NULL ); + TotalBytesCopied ); } else if( Status == STATUS_PENDING ) { AFD_DbgPrint(MID_TRACE,("Leaving read irp\n")); IoMarkIrpPending( Irp ); @@ -576,10 +576,10 @@ /* Check that the socket is bound */ if( FCB->State != SOCKET_STATE_BOUND ) return UnlockAndMaybeComplete - ( FCB, STATUS_INVALID_PARAMETER, Irp, 0, NULL ); + ( FCB, STATUS_INVALID_PARAMETER, Irp, 0 ); if( !(RecvReq = LockRequest( Irp, IrpSp )) ) return UnlockAndMaybeComplete - ( FCB, STATUS_NO_MEMORY, Irp, 0, NULL ); + ( FCB, STATUS_NO_MEMORY, Irp, 0 ); AFD_DbgPrint(MID_TRACE,("Recv flags %x\n", RecvReq->AfdFlags)); @@ -591,7 +591,7 @@ if( !RecvReq->BufferArray ) { /* access violation in userspace */ return UnlockAndMaybeComplete - ( FCB, STATUS_ACCESS_VIOLATION, Irp, 0, NULL ); + ( FCB, STATUS_ACCESS_VIOLATION, Irp, 0 ); } if( !IsListEmpty( &FCB->DatagramList ) ) { @@ -615,7 +615,7 @@ UnlockBuffers( RecvReq->BufferArray, RecvReq->BufferCount, TRUE ); return UnlockAndMaybeComplete - ( FCB, Status, Irp, Irp->IoStatus.Information, NULL ); + ( FCB, Status, Irp, Irp->IoStatus.Information ); } else { Status = SatisfyPacketRecvRequest ( FCB, Irp, DatagramRecv, @@ -631,14 +631,14 @@ UnlockBuffers( RecvReq->BufferArray, RecvReq->BufferCount, TRUE ); return UnlockAndMaybeComplete - ( FCB, Status, Irp, Irp->IoStatus.Information, NULL ); + ( FCB, Status, Irp, Irp->IoStatus.Information ); } } else if( RecvReq->AfdFlags & AFD_IMMEDIATE ) { AFD_DbgPrint(MID_TRACE,("Nonblocking\n")); Status = STATUS_CANT_WAIT; PollReeval( FCB->DeviceExt, FCB->FileObject ); UnlockBuffers( RecvReq->BufferArray, RecvReq->BufferCount, TRUE ); - return UnlockAndMaybeComplete( FCB, Status, Irp, 0, NULL ); + return UnlockAndMaybeComplete( FCB, Status, Irp, 0 ); } else { PollReeval( FCB->DeviceExt, FCB->FileObject ); return LeaveIrpUntilLater( FCB, Irp, FUNCTION_RECV ); Modified: trunk/reactos/drivers/network/afd/afd/select.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/se…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/select.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/select.c [iso-8859-1] Sat Mar 28 18:49:29 2009 @@ -281,7 +281,7 @@ if ( !EventSelectInfo ) { return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, - 0, NULL ); + 0 ); } AFD_DbgPrint(MID_TRACE,("Called (Event %x Triggers %x)\n", EventSelectInfo->EventObject, @@ -310,7 +310,7 @@ AFD_DbgPrint(MID_TRACE,("Returning %x\n", Status)); return UnlockAndMaybeComplete( FCB, Status, Irp, - 0, NULL ); + 0 ); } NTSTATUS NTAPI @@ -329,14 +329,14 @@ if ( !EnumReq ) { return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, - 0, NULL ); + 0 ); } EnumReq->PollEvents = FCB->PollState; RtlZeroMemory( EnumReq->EventStatus, sizeof(EnumReq->EventStatus) ); return UnlockAndMaybeComplete( FCB, STATUS_SUCCESS, Irp, - 0, NULL ); + 0 ); } /* * * NOTE ALWAYS CALLED AT DISPATCH_LEVEL * * */ Modified: trunk/reactos/drivers/network/afd/afd/write.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/wr…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/write.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/write.c [iso-8859-1] Sat Mar 28 18:49:29 2009 @@ -148,8 +148,7 @@ AFD_DbgPrint(MID_TRACE,("Dismissing request: %x\n", Status)); - return UnlockAndMaybeComplete( FCB, Status, NextIrp, TotalBytesCopied, - NULL ); + return UnlockAndMaybeComplete( FCB, Status, NextIrp, TotalBytesCopied ); } else if( NextIrp ) { AFD_DbgPrint(MID_TRACE,("Could not do any more with Irp %x\n", NextIrp)); @@ -220,11 +219,10 @@ /* Check that the socket is bound */ if( FCB->State != SOCKET_STATE_BOUND ) return UnlockAndMaybeComplete( FCB, STATUS_INVALID_PARAMETER, Irp, - 0, NULL ); + 0 ); if( !(SendReq = LockRequest( Irp, IrpSp )) ) - return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0, - NULL ); + return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0 ); /* Must lock buffers before handing off user data */ SendReq->BufferArray = LockBuffers( SendReq->BufferArray, @@ -234,7 +232,7 @@ if( !SendReq->BufferArray ) { return UnlockAndMaybeComplete( FCB, STATUS_ACCESS_VIOLATION, - Irp, 0, NULL ); + Irp, 0 ); } TdiBuildConnectionInfo( &TargetAddress, FCB->RemoteAddress ); @@ -258,13 +256,12 @@ AFD_DbgPrint(MID_TRACE,("Dismissing request: %x\n", Status)); return UnlockAndMaybeComplete( FCB, Status, Irp, - SendReq->BufferArray[0].len, - NULL ); + SendReq->BufferArray[0].len ); } if( !(SendReq = LockRequest( Irp, IrpSp )) ) return UnlockAndMaybeComplete - ( FCB, STATUS_NO_MEMORY, Irp, TotalBytesCopied, NULL ); + ( FCB, STATUS_NO_MEMORY, Irp, TotalBytesCopied ); SendReq->BufferArray = LockBuffers( SendReq->BufferArray, SendReq->BufferCount, @@ -273,7 +270,7 @@ if( !SendReq->BufferArray ) { return UnlockAndMaybeComplete( FCB, STATUS_ACCESS_VIOLATION, - Irp, 0, NULL ); + Irp, 0 ); } AFD_DbgPrint(MID_TRACE,("Socket state %d\n", FCB->State)); @@ -283,7 +280,7 @@ AFD_DbgPrint(MID_TRACE,("Nonblocking\n")); UnlockBuffers( SendReq->BufferArray, SendReq->BufferCount, FALSE ); return UnlockAndMaybeComplete - ( FCB, STATUS_CANT_WAIT, Irp, 0, NULL ); + ( FCB, STATUS_CANT_WAIT, Irp, 0 ); } else { AFD_DbgPrint(MID_TRACE,("Queuing request\n")); return LeaveIrpUntilLater( FCB, Irp, FUNCTION_SEND ); @@ -326,7 +323,7 @@ AFD_DbgPrint(MID_TRACE,("Empty send\n")); return UnlockAndMaybeComplete - ( FCB, Status, Irp, TotalBytesCopied, NULL ); + ( FCB, Status, Irp, TotalBytesCopied ); } AFD_DbgPrint(MID_TRACE,("Completed %d bytes\n", TotalBytesCopied)); @@ -350,7 +347,7 @@ Status, TotalBytesCopied)); return UnlockAndMaybeComplete - ( FCB, Status, Irp, TotalBytesCopied, NULL ); + ( FCB, Status, Irp, TotalBytesCopied ); } } @@ -358,7 +355,7 @@ AFD_DbgPrint(MID_TRACE,("Nonblocking\n")); UnlockBuffers( SendReq->BufferArray, SendReq->BufferCount, FALSE ); return UnlockAndMaybeComplete - ( FCB, STATUS_CANT_WAIT, Irp, 0, NULL ); + ( FCB, STATUS_CANT_WAIT, Irp, 0 ); } else { AFD_DbgPrint(MID_TRACE,("Queuing request\n")); return LeaveIrpUntilLater( FCB, Irp, FUNCTION_SEND ); @@ -386,10 +383,10 @@ /* Check that the socket is bound */ if( FCB->State != SOCKET_STATE_BOUND ) return UnlockAndMaybeComplete - ( FCB, STATUS_INVALID_PARAMETER, Irp, 0, NULL ); + ( FCB, STATUS_INVALID_PARAMETER, Irp, 0 ); if( !(SendReq = LockRequest( Irp, IrpSp )) ) return UnlockAndMaybeComplete - ( FCB, STATUS_NO_MEMORY, Irp, 0, NULL ); + ( FCB, STATUS_NO_MEMORY, Irp, 0 ); SendReq->BufferArray = LockBuffers( SendReq->BufferArray, SendReq->BufferCount, @@ -398,7 +395,7 @@ if( !SendReq->BufferArray ) return UnlockAndMaybeComplete( FCB, STATUS_ACCESS_VIOLATION, - Irp, 0, NULL ); + Irp, 0 ); AFD_DbgPrint (MID_TRACE,("RemoteAddress #%d Type %d\n", @@ -431,6 +428,6 @@ AFD_DbgPrint(MID_TRACE,("Dismissing request: %x\n", Status)); return UnlockAndMaybeComplete - ( FCB, Status, Irp, SendReq->BufferArray[0].len, NULL ); + ( FCB, Status, Irp, SendReq->BufferArray[0].len ); } Modified: trunk/reactos/drivers/network/afd/include/afd.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/includ…
============================================================================== --- trunk/reactos/drivers/network/afd/include/afd.h [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/include/afd.h [iso-8859-1] Sat Mar 28 18:49:29 2009 @@ -263,8 +263,7 @@ UINT SocketAcquireStateLock( PAFD_FCB FCB ); NTSTATUS NTAPI UnlockAndMaybeComplete ( PAFD_FCB FCB, NTSTATUS Status, PIRP Irp, - UINT Information, - PIO_COMPLETION_ROUTINE Completion ); + UINT Information ); VOID SocketStateUnlock( PAFD_FCB FCB ); NTSTATUS LostSocket( PIRP Irp ); PAFD_HANDLE LockHandles( PAFD_HANDLE HandleArray, UINT HandleCount );
15 years, 9 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
...
49
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
Results per page:
10
25
50
100
200