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
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
May 2010
----- 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
21 participants
438 discussions
Start a n
N
ew thread
[mjmartin] 47385: [win32k] - Remove use of TMRF_DELETEPENDING for deleting timers as this was a bad idea. Timers need to be deleted immediately as waiting for them to be deleted resulted in some processes running out of handles. Fixes richedit winetest for editor. - Add flag TMRF_TIFROMWND for timers created from user mode so the thread stored in the timer object is from the window and not caller. Fixes an issue where FireFox would not show any of its windows and looked dead. - When creating and
by mjmartin@svn.reactos.org
Author: mjmartin Date: Fri May 28 22:35:30 2010 New Revision: 47385 URL:
http://svn.reactos.org/svn/reactos?rev=47385&view=rev
Log: [win32k] - Remove use of TMRF_DELETEPENDING for deleting timers as this was a bad idea. Timers need to be deleted immediately as waiting for them to be deleted resulted in some processes running out of handles. Fixes richedit winetest for editor. - Add flag TMRF_TIFROMWND for timers created from user mode so the thread stored in the timer object is from the window and not caller. Fixes an issue where FireFox would not show any of its windows and looked dead. - When creating and deleting timers, If the window is non null and IDEvent is 0 then the IDEvent is changed to 1. - When modifying timer list use UserEnter and Leave instead of a Critical Region only. Modified: trunk/reactos/subsystems/win32/win32k/include/timer.h trunk/reactos/subsystems/win32/win32k/ntuser/timer.c Modified: trunk/reactos/subsystems/win32/win32k/include/timer.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/timer.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/timer.h [iso-8859-1] Fri May 28 22:35:30 2010 @@ -23,7 +23,6 @@ #define TMRF_ONESHOT 0x0010 #define TMRF_WAITING 0x0020 #define TMRF_TIFROMWND 0x0040 -#define TMRF_DELETEPENDING 0x8000 extern PKTIMER MasterTimer; Modified: trunk/reactos/subsystems/win32/win32k/ntuser/timer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/timer.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/timer.c [iso-8859-1] Fri May 28 22:35:30 2010 @@ -69,7 +69,8 @@ if (pTmr) { /* Set the flag, it will be removed when ready */ - pTmr->flags |= TMRF_DELETEPENDING; + RemoveEntryList(&pTmr->ptmrList); + UserDeleteObject( UserHMGetHandle(pTmr), otTimer); return TRUE; } return FALSE; @@ -215,21 +216,25 @@ Ret = IDEvent; } + if ((Window) && (IDEvent == 0)) + IDEvent = 1; + pTmr = FindTimer(Window, IDEvent, Type, FALSE); - if ((!pTmr) || (pTmr->flags & TMRF_DELETEPENDING)) + if (!pTmr) { pTmr = CreateTimer(); if (!pTmr) return 0; - if (Window && (Type & TMRF_TIFROMWND)) - pTmr->pti = Window->pti->pEThread->Tcb.Win32Thread; - else - { - if (Type & TMRF_RIT) - pTmr->pti = ptiRawInput; - else - pTmr->pti = PsGetCurrentThreadWin32Thread(); + if (Window && (Type & TMRF_TIFROMWND)) + pTmr->pti = Window->pti->pEThread->Tcb.Win32Thread; + else + { + if (Type & TMRF_RIT) + pTmr->pti = ptiRawInput; + else + pTmr->pti = PsGetCurrentThreadWin32Thread(); } + pTmr->pWnd = Window; pTmr->cmsCountdown = Elapse; pTmr->cmsRate = Elapse; @@ -237,9 +242,11 @@ pTmr->nID = IDEvent; pTmr->flags = Type|TMRF_INIT; // Set timer to Init mode. } - - pTmr->cmsCountdown = Elapse; - pTmr->cmsRate = Elapse; + else + { + pTmr->cmsCountdown = Elapse; + pTmr->cmsRate = Elapse; + } ASSERT(MasterTimer != NULL); // Start the timer thread! @@ -302,7 +309,7 @@ pti = PsGetCurrentThreadWin32Thread(); ThreadQueue = pti->MessageQueue; - KeEnterCriticalRegion(); + UserEnterExclusive(); do { @@ -325,7 +332,7 @@ pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList); } while (pTmr != FirstpTmr); - KeLeaveCriticalRegion(); + UserLeave(); return Hit; } @@ -389,25 +396,7 @@ } } } - if (pTmr->flags & TMRF_DELETEPENDING) - { - DPRINT("Removing Timer %x from List\n", pTmr); - - /* FIXME: Fix this!!!! */ -/* - if (!pTmr->pWnd) - { - DPRINT1("Clearing Bits for WindowLess Timer\n"); - IntLockWindowlessTimerBitmap(); - RtlSetBits(&WindowLessTimersBitMap, pTmr->nID, 1); - IntUnlockWindowlessTimerBitmap(); - } -*/ - RemoveEntryList(&pTmr->ptmrList); - UserDeleteObject( UserHMGetHandle(pTmr), otTimer); - } - else - pTmr->cmsCountdown = pTmr->cmsRate; + pTmr->cmsCountdown = pTmr->cmsRate; } else pTmr->cmsCountdown -= Time - TimeLast; @@ -533,21 +522,21 @@ if ((FirstpTmr == NULL) || (Window == NULL)) return FALSE; - KeEnterCriticalRegion(); + UserEnterExclusive(); do { if ((pTmr) && (pTmr->pti == pti) && (pTmr->pWnd == Window)) { - pTmr->flags &= ~TMRF_READY; - pTmr->flags |= TMRF_DELETEPENDING; + RemoveEntryList(&pTmr->ptmrList); + UserDeleteObject( UserHMGetHandle(pTmr), otTimer); TimersRemoved = TRUE; } pLE = pTmr->ptmrList.Flink; pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList); } while (pTmr != FirstpTmr); - KeLeaveCriticalRegion(); + UserLeave(); return TimersRemoved; } @@ -562,21 +551,21 @@ if (FirstpTmr == NULL) return FALSE; - KeEnterCriticalRegion(); + UserEnterExclusive(); do { if ((pTmr) && (pTmr->pti == pti)) { - pTmr->flags &= ~TMRF_READY; - pTmr->flags |= TMRF_DELETEPENDING; + RemoveEntryList(&pTmr->ptmrList); + UserDeleteObject( UserHMGetHandle(pTmr), otTimer); TimersRemoved = TRUE; } pLE = pTmr->ptmrList.Flink; pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList); } while (pTmr != FirstpTmr); - KeLeaveCriticalRegion(); + UserLeave(); return TimersRemoved; } @@ -588,8 +577,8 @@ DPRINT("IntKillTimer Window %x id %p systemtimer %s\n", Window, IDEvent, SystemTimer ? "TRUE" : "FALSE"); - if (IDEvent == 0) - return FALSE; + if ((Window) && (IDEvent == 0)) + IDEvent = 1; pTmr = FindTimer(Window, IDEvent, SystemTimer ? TMRF_SYSTEM : 0, TRUE); return pTmr ? TRUE : FALSE; @@ -692,7 +681,7 @@ DPRINT("Enter NtUserSetTimer\n"); UserEnterExclusive(); - RETURN(IntSetTimer(UserGetWindowObject(hWnd), nIDEvent, uElapse, lpTimerFunc, 0)); + RETURN(IntSetTimer(UserGetWindowObject(hWnd), nIDEvent, uElapse, lpTimerFunc, TMRF_TIFROMWND)); CLEANUP: DPRINT("Leave NtUserSetTimer, ret=%i\n", _ret_);
14 years, 5 months
1
0
0
0
[ekohl] 47384: [NTOSKRNL] - Implement SeAppendPrivileges().
by ekohl@svn.reactos.org
Author: ekohl Date: Fri May 28 21:36:57 2010 New Revision: 47384 URL:
http://svn.reactos.org/svn/reactos?rev=47384&view=rev
Log: [NTOSKRNL] - Implement SeAppendPrivileges(). Modified: trunk/reactos/ntoskrnl/se/priv.c Modified: trunk/reactos/ntoskrnl/se/priv.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/priv.c?rev=473…
============================================================================== --- trunk/reactos/ntoskrnl/se/priv.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/se/priv.c [iso-8859-1] Fri May 28 21:36:57 2010 @@ -281,15 +281,74 @@ /* PUBLIC FUNCTIONS ***********************************************************/ /* - * @unimplemented + * @implemented */ NTSTATUS NTAPI -SeAppendPrivileges(PACCESS_STATE AccessState, - PPRIVILEGE_SET Privileges) -{ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; +SeAppendPrivileges(IN OUT PACCESS_STATE AccessState, + IN PPRIVILEGE_SET Privileges) +{ + PAUX_ACCESS_DATA AuxData; + ULONG OldPrivilegeSetSize; + ULONG NewPrivilegeSetSize; + PPRIVILEGE_SET PrivilegeSet; + + PAGED_CODE(); + + /* Get the Auxiliary Data */ + AuxData = AccessState->AuxData; + + /* Calculate the size of the old privilege set */ + OldPrivilegeSetSize = sizeof(PRIVILEGE_SET) + + (AuxData->PrivilegeSet->PrivilegeCount - 1) * sizeof(LUID_AND_ATTRIBUTES); + + if (AuxData->PrivilegeSet->PrivilegeCount + + Privileges->PrivilegeCount > INITIAL_PRIVILEGE_COUNT) + { + /* Calculate the size of the new privilege set */ + NewPrivilegeSetSize = OldPrivilegeSetSize + + Privileges->PrivilegeCount * sizeof(LUID_AND_ATTRIBUTES); + + /* Allocate a new privilege set */ + PrivilegeSet = ExAllocatePool(PagedPool, NewPrivilegeSetSize); + if (PrivilegeSet == NULL) + return STATUS_INSUFFICIENT_RESOURCES; + + /* Copy original privileges from the acess state */ + RtlCopyMemory(PrivilegeSet, + AuxData->PrivilegeSet, + OldPrivilegeSetSize); + + /* Append privileges from the privilege set*/ + RtlCopyMemory((PVOID)((ULONG_PTR)PrivilegeSet + OldPrivilegeSetSize), + (PVOID)((ULONG_PTR)Privileges + sizeof(PRIVILEGE_SET) - sizeof(LUID_AND_ATTRIBUTES)), + Privileges->PrivilegeCount * sizeof(LUID_AND_ATTRIBUTES)); + + /* Adjust the number of privileges in the new privilege set */ + PrivilegeSet->PrivilegeCount += Privileges->PrivilegeCount; + + /* Free the old privilege set if it was allocated */ + if (AccessState->PrivilegesAllocated == TRUE) + ExFreePool(AuxData->PrivilegeSet); + + /* Now we are using an allocated privilege set */ + AccessState->PrivilegesAllocated = TRUE; + + /* Assign the new privileges to the access state */ + AuxData->PrivilegeSet = PrivilegeSet; + } + else + { + /* Append privileges */ + RtlCopyMemory((PVOID)((ULONG_PTR)AuxData->PrivilegeSet + OldPrivilegeSetSize), + (PVOID)((ULONG_PTR)Privileges + sizeof(PRIVILEGE_SET) - sizeof(LUID_AND_ATTRIBUTES)), + Privileges->PrivilegeCount * sizeof(LUID_AND_ATTRIBUTES)); + + /* Adjust the number of privileges in the target privilege set */ + AuxData->PrivilegeSet->PrivilegeCount += Privileges->PrivilegeCount; + } + + return STATUS_SUCCESS; } /*
14 years, 5 months
1
0
0
0
[ekohl] 47383: [FORMATTING] No code changes.
by ekohl@svn.reactos.org
Author: ekohl Date: Fri May 28 18:28:27 2010 New Revision: 47383 URL:
http://svn.reactos.org/svn/reactos?rev=47383&view=rev
Log: [FORMATTING] No code changes. Modified: trunk/reactos/ntoskrnl/se/access.c trunk/reactos/ntoskrnl/se/acl.c trunk/reactos/ntoskrnl/se/audit.c trunk/reactos/ntoskrnl/se/lsa.c trunk/reactos/ntoskrnl/se/priv.c trunk/reactos/ntoskrnl/se/sd.c trunk/reactos/ntoskrnl/se/semgr.c trunk/reactos/ntoskrnl/se/sid.c trunk/reactos/ntoskrnl/se/token.c [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/ntoskrnl/se/access.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/access.c?rev=4…
Modified: trunk/reactos/ntoskrnl/se/acl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/acl.c?rev=4738…
Modified: trunk/reactos/ntoskrnl/se/audit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/audit.c?rev=47…
Modified: trunk/reactos/ntoskrnl/se/lsa.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/lsa.c?rev=4738…
Modified: trunk/reactos/ntoskrnl/se/priv.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/priv.c?rev=473…
Modified: trunk/reactos/ntoskrnl/se/sd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/sd.c?rev=47383…
Modified: trunk/reactos/ntoskrnl/se/semgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/semgr.c?rev=47…
Modified: trunk/reactos/ntoskrnl/se/sid.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/sid.c?rev=4738…
Modified: trunk/reactos/ntoskrnl/se/token.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/token.c?rev=47…
14 years, 5 months
1
0
0
0
[ekohl] 47382: [NTOSKRNL] Implement SeFreePrivileges().
by ekohl@svn.reactos.org
Author: ekohl Date: Fri May 28 17:03:09 2010 New Revision: 47382 URL:
http://svn.reactos.org/svn/reactos?rev=47382&view=rev
Log: [NTOSKRNL] Implement SeFreePrivileges(). Modified: trunk/reactos/ntoskrnl/se/priv.c Modified: trunk/reactos/ntoskrnl/se/priv.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/priv.c?rev=473…
============================================================================== --- trunk/reactos/ntoskrnl/se/priv.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/se/priv.c [iso-8859-1] Fri May 28 17:03:09 2010 @@ -294,13 +294,14 @@ } /* - * @unimplemented + * @implemented */ VOID NTAPI SeFreePrivileges(IN PPRIVILEGE_SET Privileges) { - UNIMPLEMENTED; + PAGED_CODE(); + ExFreePool(Privileges); } /*
14 years, 5 months
1
0
0
0
[dreimer] 47381: Fix Crocodile's Patch to work on branches which do not fully clone trunk, too. Port this ix over to PS, too, but this does not work yet. (Trying to do it without a wget dependency here)
by dreimer@svn.reactos.org
Author: dreimer Date: Fri May 28 11:32:40 2010 New Revision: 47381 URL:
http://svn.reactos.org/svn/reactos?rev=47381&view=rev
Log: Fix Crocodile's Patch to work on branches which do not fully clone trunk, too. Port this ix over to PS, too, but this does not work yet. (Trying to do it without a wget dependency here) Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/sSVN.ps1 trunk/tools/RosBE/RosBE-Windows/Root/sSVN.cmd Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/sSVN.ps1 URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershe…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Powershell/sSVN.ps1 [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Powershell/sSVN.ps1 [iso-8859-1] Fri May 28 11:32:40 2010 @@ -6,16 +6,26 @@ # COPYRIGHT: Copyright 2010 Daniel Reimer <reimer.daniel(a)freenet.de> # -# Set branch to trunk if one is not already set -if ("$ENV:ROS_BRANCH" -eq "") { - $_ROS_BRANCH = "trunk" +$ROS_SVNURL = "
http://svn.reactos.org/reactos
" + +if ("$ENV:ROS_ARCH" -eq "amd64") { + $ROS_SVNURL = "$ROS_SVNURL/branches/ros-amd64-bringup" } else { - $_ROS_BRANCH = "branches/$ENV:ROS_BRANCH" -} - -# AMD64 architecture overrides branch that was previously set -if ("$ENV:ROS_ARCH" -eq "amd64") { - $_ROS_BRANCH = "branches/ros-amd64-bringup" + if ("$ENV:ROS_BRANCH" -eq "") { + $ROS_SVNURL = "$ROS_SVNURL/trunk" + } else { + $ROS_SVNURL = "$ROS_SVNURL/branches/$ENV:ROS_BRANCH" + } +} + +wget --spider --no-verbose %ROS_SVNURL%/reactos 1> NUL 2> NUL + +if (ERRORLEVEL 1) { + $rsubfolder = "" + $disapptest = 1 +} else { + $rsubfolder = "/reactos" + $disapptest = 0 } $_ROSBE_SSVNSOURCEDIR = "$pwd" @@ -24,7 +34,7 @@ $OFFSVN = IEX "& svn.exe info" | select-string "Last Changed Rev:" $OFFSVN = $OFFSVN -replace "(.*)Last Changed Rev: ",'' $OFFSVN = [CONVERT]::ToInt32($OFFSVN,10) - $ONSVN = IEX "& svn.exe info
http://svn.reactos.org/reactos/$_ROS_BRANCH/reactos
" | select-string "Last Changed Rev:" + $ONSVN = IEX "& svn.exe info $ROS_SVNURL$rsubfolder" | select-string "Last Changed Rev:" $ONSVN = $ONSVN -replace "(.*)Last Changed Rev: ",'' $ONSVN = [CONVERT]::ToInt32($ONSVN,10) "Local Revision: $OFFSVN" @@ -131,9 +141,9 @@ $dir = get-childitem if ("$dir" -eq "") { if ("$($args[1])" -ne "") { - IEX "& svn.exe -r $($args[1]) checkout
http://svn.reactos.org/reactos/$_ROS_BRANCH/reactos
." - } else { - IEX "& svn.exe checkout
http://svn.reactos.org/reactos/$_ROS_BRANCH/reactos
." + IEX "& svn.exe -r $($args[1]) checkout $ROS_SVNURL$rsubfolder ." + } else { + IEX "& svn.exe checkout $ROS_SVNURL$rsubfolder ." } } else { "ERROR: Folder is not empty. Continuing is dangerous and can cause errors. ABORTED" @@ -143,86 +153,94 @@ # Check if the folder is empty. If not, output an error. elseif ("$($args[0])" -eq "rosapps") { - if ("$($args[1])" -ne "") { - if (!(Test-Path "modules\rosapps\.")) { - new-item -path "modules" -name rosapps -type directory - } - if (Test-Path "modules\rosapps\.svn\.") { - $host.ui.RawUI.WindowTitle = "SVN RosApps Updating..." - Set-Location "modules\rosapps" - IEX "& svn.exe update -r $($args[1])" - } else { - $host.ui.RawUI.WindowTitle = "SVN RosApps Creating..." - Set-Location "modules\rosapps" - $dir = get-childitem - if ("$dir" -eq "") { - IEX "& svn.exe checkout -r $($args[1])
http://svn.reactos.org/reactos/$_ROS_BRANCH/rosapps
." - } else { - "ERROR: Folder is not empty. Continuing is dangerous and can cause errors. ABORTED" - } - } - } else { - if (!(Test-Path "modules\rosapps\.")) { - new-item -path "modules" -name rosapps -type directory - } - if (Test-Path "modules\rosapps\.svn\.") { - $host.ui.RawUI.WindowTitle = "SVN RosApps Updating..." - Set-Location "modules\rosapps" - IEX "& svn.exe update" - } else { - $host.ui.RawUI.WindowTitle = "SVN RosApps Creating..." - Set-Location "modules\rosapps" - $dir = get-childitem - if ("$dir" -eq "") { - IEX "& svn.exe checkout
http://svn.reactos.org/reactos/$_ROS_BRANCH/rosapps
." - } else { - "ERROR: Folder is not empty. Continuing is dangerous and can cause errors. ABORTED" - } - } - } - Set-Location "$_ROSBE_SSVNSOURCEDIR" + if ("$disapptest" -eq "0") { + if ("$($args[1])" -ne "") { + if (!(Test-Path "modules\rosapps\.")) { + new-item -path "modules" -name rosapps -type directory + } + if (Test-Path "modules\rosapps\.svn\.") { + $host.ui.RawUI.WindowTitle = "SVN RosApps Updating..." + Set-Location "modules\rosapps" + IEX "& svn.exe update -r $($args[1])" + } else { + $host.ui.RawUI.WindowTitle = "SVN RosApps Creating..." + Set-Location "modules\rosapps" + $dir = get-childitem + if ("$dir" -eq "") { + IEX "& svn.exe checkout -r $($args[1]) $ROS_SVNURL/rosapps ." + } else { + "ERROR: Folder is not empty. Continuing is dangerous and can cause errors. ABORTED" + } + } + } else { + if (!(Test-Path "modules\rosapps\.")) { + new-item -path "modules" -name rosapps -type directory + } + if (Test-Path "modules\rosapps\.svn\.") { + $host.ui.RawUI.WindowTitle = "SVN RosApps Updating..." + Set-Location "modules\rosapps" + IEX "& svn.exe update" + } else { + $host.ui.RawUI.WindowTitle = "SVN RosApps Creating..." + Set-Location "modules\rosapps" + $dir = get-childitem + if ("$dir" -eq "") { + IEX "& svn.exe checkout $ROS_SVNURL/rosapps ." + } else { + "ERROR: Folder is not empty. Continuing is dangerous and can cause errors. ABORTED" + } + } + } + Set-Location "$_ROSBE_SSVNSOURCEDIR" + } else { + "Rosapps and Rostests disabled." + } } # Check if the folder is empty. If not, output an error. elseif ("$($args[0])" -eq "rostests") { - if ("$($args[1])" -ne "") { - if (!(Test-Path "modules\rostests\.")) { - new-item -path "modules" -name rostests -type directory - } - if (Test-Path "modules\rostests\.svn\.") { - $host.ui.RawUI.WindowTitle = "SVN RosTests Updating..." - Set-Location "modules\rostests" - IEX "& svn.exe update -r $($args[1])" - } else { - $host.ui.RawUI.WindowTitle = "SVN RosTests Creating..." - Set-Location "modules\rostests" - $dir = get-childitem - if ("$dir" -eq "") { - IEX "& svn.exe checkout -r $($args[1])
http://svn.reactos.org/reactos/$_ROS_BRANCH/rostests
." - } else { - "ERROR: Folder is not empty. Continuing is dangerous and can cause errors. ABORTED" - } - } - } else { - if (!(Test-Path "modules\rostests\.")) { - new-item -path "modules" -name rostests -type directory - } - if (Test-Path "modules\rostests\.svn\.") { - $host.ui.RawUI.WindowTitle = "SVN RosTests Updating..." - Set-Location "modules\rostests" - IEX "& svn.exe update" - } else { - $host.ui.RawUI.WindowTitle = "SVN RosTests Creating..." - Set-Location "modules\rostests" - $dir = get-childitem - if ("$dir" -eq "") { - IEX "& svn.exe checkout
http://svn.reactos.org/reactos/$_ROS_BRANCH/rostests
." - } else { - "ERROR: Folder is not empty. Continuing is dangerous and can cause errors. ABORTED" - } - } - } - Set-Location "$_ROSBE_SSVNSOURCEDIR" + if ("$disapptest" -eq "0") { + if ("$($args[1])" -ne "") { + if (!(Test-Path "modules\rostests\.")) { + new-item -path "modules" -name rostests -type directory + } + if (Test-Path "modules\rostests\.svn\.") { + $host.ui.RawUI.WindowTitle = "SVN RosTests Updating..." + Set-Location "modules\rostests" + IEX "& svn.exe update -r $($args[1])" + } else { + $host.ui.RawUI.WindowTitle = "SVN RosTests Creating..." + Set-Location "modules\rostests" + $dir = get-childitem + if ("$dir" -eq "") { + IEX "& svn.exe checkout -r $($args[1]) $ROS_SVNURL/rostests ." + } else { + "ERROR: Folder is not empty. Continuing is dangerous and can cause errors. ABORTED" + } + } + } else { + if (!(Test-Path "modules\rostests\.")) { + new-item -path "modules" -name rostests -type directory + } + if (Test-Path "modules\rostests\.svn\.") { + $host.ui.RawUI.WindowTitle = "SVN RosTests Updating..." + Set-Location "modules\rostests" + IEX "& svn.exe update" + } else { + $host.ui.RawUI.WindowTitle = "SVN RosTests Creating..." + Set-Location "modules\rostests" + $dir = get-childitem + if ("$dir" -eq "") { + IEX "& svn.exe checkout $ROS_SVNURL/rostests ." + } else { + "ERROR: Folder is not empty. Continuing is dangerous and can cause errors. ABORTED" + } + } + } + Set-Location "$_ROSBE_SSVNSOURCEDIR" + } else { + "Rosapps and Rostests disabled." + } } # Output the revision of the local and online trees and tell the user if Modified: trunk/tools/RosBE/RosBE-Windows/Root/sSVN.cmd URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/sSV…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Root/sSVN.cmd [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Root/sSVN.cmd [iso-8859-1] Fri May 28 11:32:40 2010 @@ -14,15 +14,26 @@ setlocal enabledelayedexpansion -:: Set branch to trunk if one is not already set -if not defined ROS_BRANCH ( - set _ROS_BRANCH=trunk +set
ROS_SVNURL=http://svn.reactos.org/reactos
+ +if "%ROS_ARCH%" == "amd64" ( + set ROS_SVNURL=%ROS_SVNURL%/branches/ros-amd64-bringup ) else ( - set _ROS_BRANCH=branches/%ROS_BRANCH% -) -:: AMD64 architecture overrides branch that was previously set -if "%ROS_ARCH%" == "amd64" ( - set _ROS_BRANCH=branches/ros-amd64-bringup + if not defined ROS_BRANCH ( + set ROS_SVNURL=%ROS_SVNURL%/trunk + ) else ( + set ROS_SVNURL=%ROS_SVNURL%/branches/%ROS_BRANCH% + ) +) + +wget --spider --no-verbose %ROS_SVNURL%/reactos 1> NUL 2> NUL + +if ERRORLEVEL 1 ( + set rsubfolder= + set disapptest=1 +) else ( + set rsubfolder=/reactos + set disapptest=0 ) set _ROSBE_SSVNSOURCEDIR=%CD% @@ -44,9 +55,7 @@ if /i "%1" == "cleanup" ( title SVN Cleaning... - svn.exe cleanup - goto :EOC ) @@ -61,9 +70,9 @@ dir /b 2>nul | findstr "." >nul if errorlevel 1 ( if not "%2" == "" ( - svn.exe checkout -r %2
http://svn.reactos.org/reactos/%_ROS_BRANCH%/reactos
. - ) else ( - svn.exe checkout
http://svn.reactos.org/reactos/%_ROS_BRANCH%/reactos
. + svn.exe checkout -r %2 %ROS_SVNURL%%rsubfolder% . + ) else ( + svn.exe checkout %ROS_SVNURL%%rsubfolder% . ) ) else ( echo ERROR: Folder is not empty. Continuing is dangerous and can cause errors. ABORTED @@ -73,88 +82,96 @@ :: Check if the folder is empty. If not, output an error. if /i "%1" == "rosapps" ( - if not "%2" == "" ( - if not exist "modules\rosapps\." ( - md "modules\rosapps" - ) - if exist "modules\rosapps\.svn\." ( - title SVN RosApps Updating... - cd "modules\rosapps" - svn.exe update -r %2 - ) else ( - title SVN RosApps Creating... - cd "modules\rosapps" - dir /b 2>nul | findstr "." >nul - if errorlevel 1 ( - svn.exe checkout -r %2
http://svn.reactos.org/reactos/%_ROS_BRANCH%/rosapps
. - ) else ( - echo ERROR: Folder is not empty. Continuing is dangerous and can cause errors. ABORTED - ) - ) - ) else ( - if not exist "modules\rosapps\." ( - md "modules\rosapps" - ) - if exist "modules\rosapps\.svn\." ( - title SVN RosApps Updating... - cd "modules\rosapps" - svn.exe update - ) else ( - title SVN RosApps Creating... - cd "modules\rosapps" - dir /b 2>nul | findstr "." >nul - if errorlevel 1 ( - svn.exe checkout
http://svn.reactos.org/reactos/%_ROS_BRANCH%/rosapps
. - ) else ( - echo ERROR: Folder is not empty. Continuing is dangerous and can cause errors. ABORTED - ) - ) - ) - cd "%_ROSBE_SSVNSOURCEDIR%" - goto :EOC + if "%disapptest%" == "0" ( + if not "%2" == "" ( + if not exist "modules\rosapps\." ( + md "modules\rosapps" + ) + if exist "modules\rosapps\.svn\." ( + title SVN RosApps Updating... + cd "modules\rosapps" + svn.exe update -r %2 + ) else ( + title SVN RosApps Creating... + cd "modules\rosapps" + dir /b 2>nul | findstr "." >nul + if errorlevel 1 ( + svn.exe checkout -r %2 %ROS_SVNURL%/rosapps . + ) else ( + echo ERROR: Folder is not empty. Continuing is dangerous and can cause errors. ABORTED + ) + ) + ) else ( + if not exist "modules\rosapps\." ( + md "modules\rosapps" + ) + if exist "modules\rosapps\.svn\." ( + title SVN RosApps Updating... + cd "modules\rosapps" + svn.exe update + ) else ( + title SVN RosApps Creating... + cd "modules\rosapps" + dir /b 2>nul | findstr "." >nul + if errorlevel 1 ( + svn.exe checkout %ROS_SVNURL%/rosapps . + ) else ( + echo ERROR: Folder is not empty. Continuing is dangerous and can cause errors. ABORTED + ) + ) + ) + cd "%_ROSBE_SSVNSOURCEDIR%" + goto :EOC + ) else ( + echo Rosapps and Rostests disabled. + ) ) :: Check if the folder is empty. If not, output an error. if /i "%1" == "rostests" ( - if not "%2" == "" ( - if not exist "modules\rostests\." ( - md "modules\rostests" - ) - if exist "modules\rostests\.svn\." ( - title SVN RosTests Updating... - cd "modules\rostests" - svn.exe update -r %2 - ) else ( - title SVN RosTests Creating... - cd "modules\rostests" - dir /b 2>nul | findstr "." >nul - if errorlevel 1 ( - svn.exe checkout -r %2
http://svn.reactos.org/reactos/%_ROS_BRANCH%/rostests
. - ) else ( - echo ERROR: Folder is not empty. Continuing is dangerous and can cause errors. ABORTED - ) - ) - ) else ( - if not exist "modules\rostests\." ( - md "modules\rostests" - ) - if exist "modules\rostests\.svn\." ( - title SVN RosTests Updating... - cd "modules\rostests" - svn.exe update - ) else ( - title SVN RosTests Creating... - cd "modules\rostests" - dir /b 2>nul | findstr "." >nul - if errorlevel 1 ( - svn.exe checkout
http://svn.reactos.org/reactos/%_ROS_BRANCH/rostests
. - ) else ( - echo ERROR: Folder is not empty. Continuing is dangerous and can cause errors. ABORTED - ) - ) - ) - cd "%_ROSBE_SSVNSOURCEDIR%" - goto :EOC + if "%disapptest%" == "0" ( + if not "%2" == "" ( + if not exist "modules\rostests\." ( + md "modules\rostests" + ) + if exist "modules\rostests\.svn\." ( + title SVN RosTests Updating... + cd "modules\rostests" + svn.exe update -r %2 + ) else ( + title SVN RosTests Creating... + cd "modules\rostests" + dir /b 2>nul | findstr "." >nul + if errorlevel 1 ( + svn.exe checkout -r %2 %ROS_SVNURL%/rostests . + ) else ( + echo ERROR: Folder is not empty. Continuing is dangerous and can cause errors. ABORTED + ) + ) + ) else ( + if not exist "modules\rostests\." ( + md "modules\rostests" + ) + if exist "modules\rostests\.svn\." ( + title SVN RosTests Updating... + cd "modules\rostests" + svn.exe update + ) else ( + title SVN RosTests Creating... + cd "modules\rostests" + dir /b 2>nul | findstr "." >nul + if errorlevel 1 ( + svn.exe checkout %ROS_SVNURL%/rostests . + ) else ( + echo ERROR: Folder is not empty. Continuing is dangerous and can cause errors. ABORTED + ) + ) + ) + cd "%_ROSBE_SSVNSOURCEDIR%" + goto :EOC + ) else ( + echo Rosapps and Rostests disabled. + ) ) :: Output the revision of the local and online trees and tell the user if @@ -174,7 +191,7 @@ :UP for /f "usebackq tokens=4" %%i in (`"svn.exe info | find "Last Changed Rev:""`) do set OFFSVN=%%i - for /f "usebackq tokens=4" %%j in (`"svn.exe info
http://svn.reactos.org/reactos/%_ROS_BRANCH%/reactos
| find "Last Changed Rev:""`) do set ONSVN=%%j + for /f "usebackq tokens=4" %%j in (`"svn.exe info %ROS_SVNURL%%rsubfolder% | find "Last Changed Rev:""`) do set ONSVN=%%j echo Local Revision: !OFFSVN! echo Online HEAD Revision: !ONSVN!
14 years, 5 months
1
0
0
0
[cgutman] 47380: [MSAFD] - Fix a broken call to WSPBind that I missed in r47378
by cgutman@svn.reactos.org
Author: cgutman Date: Fri May 28 07:15:42 2010 New Revision: 47380 URL:
http://svn.reactos.org/svn/reactos?rev=47380&view=rev
Log: [MSAFD] - Fix a broken call to WSPBind that I missed in r47378 Modified: trunk/reactos/dll/win32/msafd/misc/dllmain.c Modified: trunk/reactos/dll/win32/msafd/misc/dllmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msafd/misc/dllma…
============================================================================== --- trunk/reactos/dll/win32/msafd/misc/dllmain.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msafd/misc/dllmain.c [iso-8859-1] Fri May 28 07:15:42 2010 @@ -1416,7 +1416,8 @@ BindAddress, &BindAddressLength); /* Bind it */ - WSPBind(Handle, BindAddress, BindAddressLength, NULL); + if (WSPBind(Handle, BindAddress, BindAddressLength, lpErrno) == SOCKET_ERROR) + return INVALID_SOCKET; } /* Set the Connect Data */
14 years, 5 months
1
0
0
0
[cgutman] 47379: [TCPIP] - Return STATUS_INVALID_ADDRESS if the caller tries to get a non-local address - Return STATUS_ADDRESS_ALREADY_EXISTS if the caller uses an address that is in use [MSAFD] - Translate STATUS_ADDRESS_ALREADY_EXISTS -> WSAEADDRINUSE, STATUS_LOCAL_DISCONNECT -> WSAECONNABORTED, and STATUS_REMOTE_DISCONNECT -> WSAECONNRESET [IP] - Translate OSK_EADDRINUSE -> STATUS_ADDRESS_ALREADY_EXISTS, OSK_ECONNABORTED -> STATUS_LOCAL_DISCONNECT, and OSK_ECONNRESET -> STATUS_REMOTE_DISCONN
by cgutman@svn.reactos.org
Author: cgutman Date: Fri May 28 06:39:49 2010 New Revision: 47379 URL:
http://svn.reactos.org/svn/reactos?rev=47379&view=rev
Log: [TCPIP] - Return STATUS_INVALID_ADDRESS if the caller tries to get a non-local address - Return STATUS_ADDRESS_ALREADY_EXISTS if the caller uses an address that is in use [MSAFD] - Translate STATUS_ADDRESS_ALREADY_EXISTS -> WSAEADDRINUSE, STATUS_LOCAL_DISCONNECT -> WSAECONNABORTED, and STATUS_REMOTE_DISCONNECT -> WSAECONNRESET [IP] - Translate OSK_EADDRINUSE -> STATUS_ADDRESS_ALREADY_EXISTS, OSK_ECONNABORTED -> STATUS_LOCAL_DISCONNECT, and OSK_ECONNRESET -> STATUS_REMOTE_DISCONNECT - Fixes waiting for binding during ws2_32 sock winetest Modified: trunk/reactos/dll/win32/msafd/misc/dllmain.c trunk/reactos/drivers/network/tcpip/tcpip/fileobjs.c trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c Modified: trunk/reactos/dll/win32/msafd/misc/dllmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msafd/misc/dllma…
============================================================================== --- trunk/reactos/dll/win32/msafd/misc/dllmain.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msafd/misc/dllmain.c [iso-8859-1] Fri May 28 06:39:49 2010 @@ -372,6 +372,18 @@ case STATUS_CANCELLED: DbgPrint("MSAFD: STATUS_CANCELLED\n"); return WSA_OPERATION_ABORTED; + + case STATUS_ADDRESS_ALREADY_EXISTS: + DbgPrint("MSAFD: STATUS_ADDRESS_ALREADY_EXISTS\n"); + return WSAEADDRINUSE; + + case STATUS_LOCAL_DISCONNECT: + DbgPrint("MSAFD: STATUS_LOCAL_DISCONNECT\n"); + return WSAECONNABORTED; + + case STATUS_REMOTE_DISCONNECT: + DbgPrint("MSAFD: STATUS_REMOTE_DISCONNECT\n"); + return WSAECONNRESET; default: DbgPrint("MSAFD: Unhandled NTSTATUS value: 0x%x\n", Status); Modified: trunk/reactos/drivers/network/tcpip/tcpip/fileobjs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
============================================================================== --- trunk/reactos/drivers/network/tcpip/tcpip/fileobjs.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/tcpip/fileobjs.c [iso-8859-1] Fri May 28 06:39:49 2010 @@ -265,7 +265,7 @@ !AddrLocateInterface(&AddrFile->Address)) { ExFreePoolWithTag(AddrFile, ADDR_FILE_TAG); TI_DbgPrint(MIN_TRACE, ("Non-local address given (0x%X).\n", A2S(&AddrFile->Address))); - return STATUS_INVALID_PARAMETER; + return STATUS_INVALID_ADDRESS; } TI_DbgPrint(MID_TRACE, ("Opening address %s for communication (P=%d U=%d).\n", @@ -282,7 +282,7 @@ AddrFile->Port == 0xffff) { ExFreePoolWithTag(AddrFile, ADDR_FILE_TAG); - return STATUS_INVALID_PARAMETER; + return STATUS_ADDRESS_ALREADY_EXISTS; } AddEntity(CO_TL_ENTITY, AddrFile, CO_TL_TCP); @@ -300,7 +300,7 @@ AddrFile->Port == 0xffff) { ExFreePoolWithTag(AddrFile, ADDR_FILE_TAG); - return STATUS_INVALID_PARAMETER; + return STATUS_ADDRESS_ALREADY_EXISTS; } TI_DbgPrint(MID_TRACE,("Setting port %d (wanted %d)\n", Modified: trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/transport/t…
============================================================================== --- trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1] Fri May 28 06:39:49 2010 @@ -574,10 +574,11 @@ switch( OskitError ) { case 0: Status = STATUS_SUCCESS; break; case OSK_EADDRNOTAVAIL: Status = STATUS_INVALID_ADDRESS; break; + case OSK_EADDRINUSE: Status = STATUS_ADDRESS_ALREADY_EXISTS; break; case OSK_EAFNOSUPPORT: Status = STATUS_INVALID_CONNECTION; break; case OSK_ECONNREFUSED: Status = STATUS_REMOTE_NOT_LISTENING; break; - case OSK_ECONNRESET: - case OSK_ECONNABORTED: Status = STATUS_REMOTE_DISCONNECT; break; + case OSK_ECONNRESET: Status = STATUS_REMOTE_DISCONNECT; break; + case OSK_ECONNABORTED: Status = STATUS_LOCAL_DISCONNECT; break; case OSK_EWOULDBLOCK: case OSK_EINPROGRESS: Status = STATUS_PENDING; break; case OSK_EINVAL: Status = STATUS_INVALID_PARAMETER; break;
14 years, 5 months
1
0
0
0
[cgutman] 47378: [MSAFD] - Pass a valid pointer for lpErrno to WSPBind when performing an implicit bind - Remove the hack in MsafdReturnWithErrno for dealing with stupid callers that provide don't provide a valid Errno pointer
by cgutman@svn.reactos.org
Author: cgutman Date: Fri May 28 06:07:39 2010 New Revision: 47378 URL:
http://svn.reactos.org/svn/reactos?rev=47378&view=rev
Log: [MSAFD] - Pass a valid pointer for lpErrno to WSPBind when performing an implicit bind - Remove the hack in MsafdReturnWithErrno for dealing with stupid callers that provide don't provide a valid Errno pointer Modified: trunk/reactos/dll/win32/msafd/misc/dllmain.c trunk/reactos/dll/win32/msafd/misc/sndrcv.c Modified: trunk/reactos/dll/win32/msafd/misc/dllmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msafd/misc/dllma…
============================================================================== --- trunk/reactos/dll/win32/msafd/misc/dllmain.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msafd/misc/dllmain.c [iso-8859-1] Fri May 28 06:07:39 2010 @@ -384,20 +384,17 @@ DWORD Received, LPDWORD ReturnedBytes) { - if (Errno) - { - *Errno = TranslateNtStatusError(Status); - - if (ReturnedBytes) - { - if (!*Errno) - *ReturnedBytes = Received; - else - *ReturnedBytes = 0; - } - } - - return Status ? SOCKET_ERROR : 0; + *Errno = TranslateNtStatusError(Status); + + if (ReturnedBytes) + { + if (!*Errno) + *ReturnedBytes = Received; + else + *ReturnedBytes = 0; + } + + return *Errno ? SOCKET_ERROR : 0; } /* 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] Fri May 28 06:07:39 2010 @@ -540,7 +540,8 @@ BindAddress, &BindAddressLength); /* Bind it */ - WSPBind(Handle, BindAddress, BindAddressLength, NULL); + if (WSPBind(Handle, BindAddress, BindAddressLength, lpErrno) == SOCKET_ERROR) + return SOCKET_ERROR; } RemoteAddress = HeapAlloc(GlobalHeap, 0, 0x6 + SocketAddressLength);
14 years, 5 months
1
0
0
0
[cgutman] 47377: [MSAFD] - Remove an incorrect change - Create a new function called TranslateNtStatusError to translate NTSTATUS to winsock error codes - Call the TranslateNtStatusError in MsafdReturnWithErrno and also use it to translate AFD's poll event error codes [AFD] - Track the status for each poll event in our FCB and copy it back when we get an IOCTL_AFD_ENUM_NETWORK_EVENTS IRP - Remove some useless PollReeval calls
by cgutman@svn.reactos.org
Author: cgutman Date: Fri May 28 05:55:50 2010 New Revision: 47377 URL:
http://svn.reactos.org/svn/reactos?rev=47377&view=rev
Log: [MSAFD] - Remove an incorrect change - Create a new function called TranslateNtStatusError to translate NTSTATUS to winsock error codes - Call the TranslateNtStatusError in MsafdReturnWithErrno and also use it to translate AFD's poll event error codes [AFD] - Track the status for each poll event in our FCB and copy it back when we get an IOCTL_AFD_ENUM_NETWORK_EVENTS IRP - Remove some useless PollReeval calls Modified: trunk/reactos/dll/win32/msafd/misc/dllmain.c trunk/reactos/dll/win32/msafd/misc/event.c trunk/reactos/dll/win32/msafd/msafd.h trunk/reactos/drivers/network/afd/afd/connect.c trunk/reactos/drivers/network/afd/afd/listen.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/dll/win32/msafd/misc/dllmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msafd/misc/dllma…
============================================================================== --- trunk/reactos/dll/win32/msafd/misc/dllmain.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msafd/misc/dllmain.c [iso-8859-1] Fri May 28 05:55:50 2010 @@ -318,79 +318,86 @@ return INVALID_SOCKET; } +INT +TranslateNtStatusError(NTSTATUS Status) +{ + switch (Status) + { + case STATUS_CANT_WAIT: + return WSAEWOULDBLOCK; + + case STATUS_TIMEOUT: + return WSAETIMEDOUT; + + case STATUS_SUCCESS: + return NO_ERROR; + + case STATUS_FILE_CLOSED: + case STATUS_END_OF_FILE: + return WSAESHUTDOWN; + + case STATUS_PENDING: + return WSA_IO_PENDING; + + case STATUS_BUFFER_TOO_SMALL: + case STATUS_BUFFER_OVERFLOW: + DbgPrint("MSAFD: STATUS_BUFFER_TOO_SMALL/STATUS_BUFFER_OVERFLOW\n"); + return WSAEMSGSIZE; + + case STATUS_NO_MEMORY: + case STATUS_INSUFFICIENT_RESOURCES: + DbgPrint("MSAFD: STATUS_NO_MEMORY/STATUS_INSUFFICIENT_RESOURCES\n"); + return WSAENOBUFS; + + case STATUS_INVALID_CONNECTION: + DbgPrint("MSAFD: STATUS_INVALID_CONNECTION\n"); + return WSAEAFNOSUPPORT; + + case STATUS_INVALID_ADDRESS: + DbgPrint("MSAFD: STATUS_INVALID_ADDRESS\n"); + return WSAEADDRNOTAVAIL; + + case STATUS_REMOTE_NOT_LISTENING: + DbgPrint("MSAFD: STATUS_REMOTE_NOT_LISTENING\n"); + return WSAECONNREFUSED; + + case STATUS_NETWORK_UNREACHABLE: + DbgPrint("MSAFD: STATUS_NETWORK_UNREACHABLE\n"); + return WSAENETUNREACH; + + case STATUS_INVALID_PARAMETER: + DbgPrint("MSAFD: STATUS_INVALID_PARAMETER\n"); + return WSAEINVAL; + + case STATUS_CANCELLED: + DbgPrint("MSAFD: STATUS_CANCELLED\n"); + return WSA_OPERATION_ABORTED; + + default: + DbgPrint("MSAFD: Unhandled NTSTATUS value: 0x%x\n", Status); + return WSAENETDOWN; + } +} DWORD MsafdReturnWithErrno(NTSTATUS Status, LPINT Errno, DWORD Received, LPDWORD ReturnedBytes) { - if( ReturnedBytes ) - *ReturnedBytes = 0; - if( Errno ) - { - switch (Status) - { - case STATUS_CANT_WAIT: - *Errno = WSAEWOULDBLOCK; - break; - case STATUS_TIMEOUT: - *Errno = WSAETIMEDOUT; - break; - case STATUS_SUCCESS: - /* Return Number of bytes Read */ - if( ReturnedBytes ) + if (Errno) + { + *Errno = TranslateNtStatusError(Status); + + if (ReturnedBytes) + { + if (!*Errno) *ReturnedBytes = Received; - break; - case STATUS_FILE_CLOSED: - case STATUS_END_OF_FILE: - *Errno = WSAESHUTDOWN; - break; - case STATUS_PENDING: - *Errno = WSA_IO_PENDING; - break; - case STATUS_BUFFER_TOO_SMALL: - case STATUS_BUFFER_OVERFLOW: - DbgPrint("MSAFD: STATUS_BUFFER_TOO_SMALL/STATUS_BUFFER_OVERFLOW\n"); - *Errno = WSAEMSGSIZE; - break; - case STATUS_NO_MEMORY: /* Fall through to STATUS_INSUFFICIENT_RESOURCES */ - case STATUS_INSUFFICIENT_RESOURCES: - DbgPrint("MSAFD: STATUS_NO_MEMORY/STATUS_INSUFFICIENT_RESOURCES\n"); - *Errno = WSAENOBUFS; - break; - case STATUS_INVALID_CONNECTION: - DbgPrint("MSAFD: STATUS_INVALID_CONNECTION\n"); - *Errno = WSAEAFNOSUPPORT; - break; - case STATUS_INVALID_ADDRESS: - DbgPrint("MSAFD: STATUS_INVALID_ADDRESS\n"); - *Errno = WSAEADDRNOTAVAIL; - break; - case STATUS_REMOTE_NOT_LISTENING: - DbgPrint("MSAFD: STATUS_REMOTE_NOT_LISTENING\n"); - *Errno = WSAECONNREFUSED; - break; - case STATUS_NETWORK_UNREACHABLE: - DbgPrint("MSAFD: STATUS_NETWORK_UNREACHABLE\n"); - *Errno = WSAENETUNREACH; - break; - case STATUS_INVALID_PARAMETER: - DbgPrint("MSAFD: STATUS_INVALID_PARAMETER\n"); - *Errno = WSAEINVAL; - break; - case STATUS_CANCELLED: - DbgPrint("MSAFD: STATUS_CANCELLED\n"); - *Errno = WSA_OPERATION_ABORTED; - break; - default: - DbgPrint("MSAFD: Error %x is unknown\n", Status); - *Errno = WSAEINVAL; - break; - } - } - - /* Success */ - return Status == STATUS_SUCCESS ? 0 : SOCKET_ERROR; + else + *ReturnedBytes = 0; + } + } + + return Status ? SOCKET_ERROR : 0; } /* Modified: trunk/reactos/dll/win32/msafd/misc/event.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msafd/misc/event…
============================================================================== --- trunk/reactos/dll/win32/msafd/misc/event.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msafd/misc/event.c [iso-8859-1] Fri May 28 05:55:50 2010 @@ -179,51 +179,51 @@ AFD_DbgPrint(MID_TRACE,("About to touch struct at %x (%d)\n", lpNetworkEvents, sizeof(*lpNetworkEvents))); - RtlZeroMemory(lpNetworkEvents, sizeof(*lpNetworkEvents)); + lpNetworkEvents->lNetworkEvents = 0; AFD_DbgPrint(MID_TRACE,("Zeroed struct\n")); /* Set Events to wait for */ if (EnumReq.PollEvents & AFD_EVENT_RECEIVE) { lpNetworkEvents->lNetworkEvents |= FD_READ; - lpNetworkEvents->iErrorCode[FD_READ_BIT] = EnumReq.EventStatus[FD_READ_BIT]; + lpNetworkEvents->iErrorCode[FD_READ_BIT] = TranslateNtStatusError(EnumReq.EventStatus[FD_READ_BIT]); } if (EnumReq.PollEvents & AFD_EVENT_SEND) { lpNetworkEvents->lNetworkEvents |= FD_WRITE; - lpNetworkEvents->iErrorCode[FD_WRITE_BIT] = EnumReq.EventStatus[FD_WRITE_BIT]; + lpNetworkEvents->iErrorCode[FD_WRITE_BIT] = TranslateNtStatusError(EnumReq.EventStatus[FD_WRITE_BIT]); } if (EnumReq.PollEvents & AFD_EVENT_OOB_RECEIVE) { lpNetworkEvents->lNetworkEvents |= FD_OOB; - lpNetworkEvents->iErrorCode[FD_OOB_BIT] = EnumReq.EventStatus[FD_OOB_BIT]; + lpNetworkEvents->iErrorCode[FD_OOB_BIT] = TranslateNtStatusError(EnumReq.EventStatus[FD_OOB_BIT]); } if (EnumReq.PollEvents & AFD_EVENT_ACCEPT) { lpNetworkEvents->lNetworkEvents |= FD_ACCEPT; - lpNetworkEvents->iErrorCode[FD_ACCEPT_BIT] = EnumReq.EventStatus[FD_ACCEPT_BIT]; + lpNetworkEvents->iErrorCode[FD_ACCEPT_BIT] = TranslateNtStatusError(EnumReq.EventStatus[FD_ACCEPT_BIT]); } if (EnumReq.PollEvents & (AFD_EVENT_CONNECT | AFD_EVENT_CONNECT_FAIL)) { lpNetworkEvents->lNetworkEvents |= FD_CONNECT; - lpNetworkEvents->iErrorCode[FD_CONNECT_BIT] = EnumReq.EventStatus[FD_CONNECT_BIT]; + lpNetworkEvents->iErrorCode[FD_CONNECT_BIT] = TranslateNtStatusError(EnumReq.EventStatus[FD_CONNECT_BIT]); } if (EnumReq.PollEvents & (AFD_EVENT_DISCONNECT | AFD_EVENT_ABORT | AFD_EVENT_CLOSE)) { lpNetworkEvents->lNetworkEvents |= FD_CLOSE; - lpNetworkEvents->iErrorCode[FD_CLOSE_BIT] = EnumReq.EventStatus[FD_CLOSE_BIT]; + lpNetworkEvents->iErrorCode[FD_CLOSE_BIT] = TranslateNtStatusError(EnumReq.EventStatus[FD_CLOSE_BIT]); } if (EnumReq.PollEvents & AFD_EVENT_QOS) { lpNetworkEvents->lNetworkEvents |= FD_QOS; - lpNetworkEvents->iErrorCode[FD_QOS_BIT] = EnumReq.EventStatus[FD_QOS_BIT]; + lpNetworkEvents->iErrorCode[FD_QOS_BIT] = TranslateNtStatusError(EnumReq.EventStatus[FD_QOS_BIT]); } if (EnumReq.PollEvents & AFD_EVENT_GROUP_QOS) { lpNetworkEvents->lNetworkEvents |= FD_GROUP_QOS; - lpNetworkEvents->iErrorCode[FD_GROUP_QOS_BIT] = EnumReq.EventStatus[FD_GROUP_QOS_BIT]; + lpNetworkEvents->iErrorCode[FD_GROUP_QOS_BIT] = TranslateNtStatusError(EnumReq.EventStatus[FD_GROUP_QOS_BIT]); } if( NT_SUCCESS(Status) ) *lpErrno = 0; Modified: trunk/reactos/dll/win32/msafd/msafd.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msafd/msafd.h?re…
============================================================================== --- trunk/reactos/dll/win32/msafd/msafd.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msafd/msafd.h [iso-8859-1] Fri May 28 05:55:50 2010 @@ -409,6 +409,8 @@ SOCKET Handle ); +INT TranslateNtStatusError( NTSTATUS Status ); + VOID DeleteSocketStructure( SOCKET Handle ); int GetSocketInformation( 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] Fri May 28 05:55:50 2010 @@ -247,6 +247,8 @@ if( Status == STATUS_PENDING ) Status = STATUS_SUCCESS; FCB->PollState |= AFD_EVENT_CONNECT | AFD_EVENT_SEND; + FCB->PollStatus[FD_CONNECT_BIT] = STATUS_SUCCESS; + FCB->PollStatus[FD_WRITE_BIT] = STATUS_SUCCESS; PollReeval( FCB->DeviceExt, FCB->FileObject ); return Status; @@ -291,6 +293,7 @@ if( !NT_SUCCESS(Irp->IoStatus.Status) ) { FCB->PollState |= AFD_EVENT_CONNECT_FAIL; + FCB->PollStatus[FD_CONNECT_BIT] = Irp->IoStatus.Status; AFD_DbgPrint(MID_TRACE,("Going to bound state\n")); FCB->State = SOCKET_STATE_BOUND; PollReeval( FCB->DeviceExt, FCB->FileObject ); 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] Fri May 28 05:55:50 2010 @@ -193,11 +193,10 @@ /* Trigger a select return if appropriate */ if( !IsListEmpty( &FCB->PendingConnections ) ) { FCB->PollState |= AFD_EVENT_ACCEPT; - } else { - FCB->PollState &= ~AFD_EVENT_ACCEPT; - } - - PollReeval( FCB->DeviceExt, FCB->FileObject ); + FCB->PollStatus[FD_ACCEPT_BIT] = STATUS_SUCCESS; + PollReeval( FCB->DeviceExt, FCB->FileObject ); + } else + FCB->PollState &= ~AFD_EVENT_ACCEPT; SocketStateUnlock( FCB ); @@ -293,12 +292,13 @@ AFD_DbgPrint(MID_TRACE,("Completed a wait for accept\n")); - if ( IsListEmpty( &FCB->PendingConnections ) ) + if ( !IsListEmpty( &FCB->PendingConnections ) ) + { + FCB->PollState |= AFD_EVENT_ACCEPT; + FCB->PollStatus[FD_ACCEPT_BIT] = STATUS_SUCCESS; + PollReeval( FCB->DeviceExt, FCB->FileObject ); + } else FCB->PollState &= ~AFD_EVENT_ACCEPT; - else - FCB->PollState |= AFD_EVENT_ACCEPT; - - PollReeval( FCB->DeviceExt, FCB->FileObject ); SocketStateUnlock( FCB ); return Status; @@ -402,13 +402,12 @@ ExFreePool( PendingConnObj ); - if( IsListEmpty( &FCB->PendingConnections ) ) { - FCB->PollState &= ~AFD_EVENT_ACCEPT; - } else { + if( !IsListEmpty( &FCB->PendingConnections ) ) { FCB->PollState |= AFD_EVENT_ACCEPT; - } - - PollReeval( FCB->DeviceExt, FCB->FileObject ); + FCB->PollStatus[FD_ACCEPT_BIT] = STATUS_SUCCESS; + PollReeval( FCB->DeviceExt, FCB->FileObject ); + } else + FCB->PollState &= ~AFD_EVENT_ACCEPT; SocketStateUnlock( FCB ); return Status; 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] Fri May 28 05:55:50 2010 @@ -314,6 +314,7 @@ /* A datagram socket is always sendable */ FCB->PollState |= AFD_EVENT_SEND; + FCB->PollStatus[FD_WRITE_BIT] = STATUS_SUCCESS; PollReeval( FCB->DeviceExt, FCB->FileObject ); } @@ -377,6 +378,7 @@ FCB->State = SOCKET_STATE_CLOSED; FCB->PollState = AFD_EVENT_CLOSE; + FCB->PollStatus[FD_CLOSE_BIT] = STATUS_SUCCESS; //I think we can return success here PollReeval( FCB->DeviceExt, FCB->FileObject ); InFlightRequest[0] = &FCB->ListenIrp; @@ -542,6 +544,7 @@ ExFreePool( ConnectionReturnInfo ); FCB->PollState |= AFD_EVENT_DISCONNECT; + FCB->PollStatus[FD_CLOSE_BIT] = STATUS_SUCCESS; PollReeval( FCB->DeviceExt, FCB->FileObject ); } else Status = STATUS_INVALID_PARAMETER; 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] Fri May 28 05:55:50 2010 @@ -46,6 +46,7 @@ { /* The socket has been closed */ FCB->PollState |= AFD_EVENT_DISCONNECT; + FCB->PollStatus[FD_CLOSE_BIT] = Status; FCB->Overread = TRUE; Status = STATUS_FILE_CLOSED; } @@ -53,6 +54,7 @@ { FCB->Recv.Content = FCB->ReceiveIrp.Iosb.Information; FCB->PollState |= AFD_EVENT_RECEIVE; + FCB->PollStatus[FD_READ_BIT] = STATUS_SUCCESS; } PollReeval( FCB->DeviceExt, FCB->FileObject ); } @@ -189,10 +191,10 @@ if( FCB->Recv.Content ) { FCB->PollState |= AFD_EVENT_RECEIVE; + FCB->PollStatus[FD_READ_BIT] = STATUS_SUCCESS; + PollReeval( FCB->DeviceExt, FCB->FileObject ); } else - FCB->PollState &= ~AFD_EVENT_RECEIVE; - - PollReeval( FCB->DeviceExt, FCB->FileObject ); + FCB->PollState &= ~AFD_EVENT_RECEIVE; AFD_DbgPrint(MID_TRACE,("RetStatus for irp %x is %x\n", Irp, RetStatus)); @@ -538,10 +540,10 @@ if( !IsListEmpty( &FCB->DatagramList ) ) { AFD_DbgPrint(MID_TRACE,("Signalling\n")); FCB->PollState |= AFD_EVENT_RECEIVE; + FCB->PollStatus[FD_READ_BIT] = STATUS_SUCCESS; + PollReeval( FCB->DeviceExt, FCB->FileObject ); } else - FCB->PollState &= ~AFD_EVENT_RECEIVE; - - PollReeval( FCB->DeviceExt, FCB->FileObject ); + FCB->PollState &= ~AFD_EVENT_RECEIVE; if( NT_SUCCESS(Irp->IoStatus.Status) ) { /* Now relaunch the datagram request */ @@ -608,12 +610,12 @@ Status = Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL; Irp->IoStatus.Information = DatagramRecv->Len; - if( IsListEmpty( &FCB->DatagramList ) ) - FCB->PollState &= ~AFD_EVENT_RECEIVE; - else + if( !IsListEmpty( &FCB->DatagramList ) ) { FCB->PollState |= AFD_EVENT_RECEIVE; - - PollReeval( FCB->DeviceExt, FCB->FileObject ); + FCB->PollStatus[FD_READ_BIT] = STATUS_SUCCESS; + PollReeval( FCB->DeviceExt, FCB->FileObject ); + } else + FCB->PollState &= ~AFD_EVENT_RECEIVE; UnlockBuffers( RecvReq->BufferArray, RecvReq->BufferCount, TRUE ); @@ -624,12 +626,12 @@ ( FCB, Irp, DatagramRecv, (PUINT)&Irp->IoStatus.Information ); - if( IsListEmpty( &FCB->DatagramList ) ) - FCB->PollState &= ~AFD_EVENT_RECEIVE; - else + if( !IsListEmpty( &FCB->DatagramList ) ) { FCB->PollState |= AFD_EVENT_RECEIVE; - - PollReeval( FCB->DeviceExt, FCB->FileObject ); + FCB->PollStatus[FD_READ_BIT] = STATUS_SUCCESS; + PollReeval( FCB->DeviceExt, FCB->FileObject ); + } else + FCB->PollState &= ~AFD_EVENT_RECEIVE; UnlockBuffers( RecvReq->BufferArray, RecvReq->BufferCount, TRUE ); @@ -640,12 +642,10 @@ AFD_DbgPrint(MID_TRACE,("Nonblocking\n")); Status = STATUS_CANT_WAIT; FCB->PollState &= ~AFD_EVENT_RECEIVE; - PollReeval( FCB->DeviceExt, FCB->FileObject ); UnlockBuffers( RecvReq->BufferArray, RecvReq->BufferCount, TRUE ); return UnlockAndMaybeComplete( FCB, Status, Irp, 0 ); } else { FCB->PollState &= ~AFD_EVENT_RECEIVE; - 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] Fri May 28 05:55:50 2010 @@ -325,7 +325,9 @@ } EnumReq->PollEvents = FCB->PollState; - RtlZeroMemory( EnumReq->EventStatus, sizeof(EnumReq->EventStatus) ); + RtlCopyMemory( EnumReq->EventStatus, + FCB->PollStatus, + sizeof(EnumReq->EventStatus) ); return UnlockAndMaybeComplete( FCB, STATUS_SUCCESS, Irp, 0 ); 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] Fri May 28 05:55:50 2010 @@ -142,9 +142,9 @@ FCB ); } else { FCB->PollState |= AFD_EVENT_SEND; - } - - PollReeval( FCB->DeviceExt, FCB->FileObject ); + FCB->PollStatus[FD_WRITE_BIT] = STATUS_SUCCESS; + PollReeval( FCB->DeviceExt, FCB->FileObject ); + } if( TotalBytesCopied > 0 ) { UnlockBuffers( SendReq->BufferArray, SendReq->BufferCount, FALSE ); @@ -186,6 +186,7 @@ /* Request is not in flight any longer */ FCB->PollState |= AFD_EVENT_SEND; + FCB->PollStatus[FD_WRITE_BIT] = STATUS_SUCCESS; PollReeval( FCB->DeviceExt, FCB->FileObject ); if( FCB->State == SOCKET_STATE_CLOSED ) { @@ -391,10 +392,6 @@ if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); - FCB->PollState &= ~AFD_EVENT_SEND; - - PollReeval( FCB->DeviceExt, FCB->FileObject ); - /* Check that the socket is bound */ if( FCB->State != SOCKET_STATE_BOUND ) return UnlockAndMaybeComplete @@ -425,6 +422,8 @@ /* Check the size of the Address given ... */ if( NT_SUCCESS(Status) ) { + FCB->PollState &= ~AFD_EVENT_SEND; + Status = TdiSendDatagram ( &FCB->SendIrp.InFlightRequest, FCB->AddressFile.Object, 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] Fri May 28 05:55:50 2010 @@ -192,6 +192,7 @@ UNICODE_STRING TdiDeviceName; PVOID Context; DWORD PollState; + NTSTATUS PollStatus[FD_MAX_EVENTS]; UINT ContextSize; PVOID ConnectData; UINT FilledConnectData;
14 years, 5 months
1
0
0
0
[cgutman] 47376: [MSAFD] - Zero the entire struct not just the lpNetworkEvents member - Write the error codes returned from AFD to the iErrorCode array - Fixes hundreds of ws2_32_winetest sock failures (only 104 failures now) - Dedicated to Physicus
by cgutman@svn.reactos.org
Author: cgutman Date: Fri May 28 04:25:56 2010 New Revision: 47376 URL:
http://svn.reactos.org/svn/reactos?rev=47376&view=rev
Log: [MSAFD] - Zero the entire struct not just the lpNetworkEvents member - Write the error codes returned from AFD to the iErrorCode array - Fixes hundreds of ws2_32_winetest sock failures (only 104 failures now) - Dedicated to Physicus Modified: trunk/reactos/dll/win32/msafd/misc/event.c Modified: trunk/reactos/dll/win32/msafd/misc/event.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msafd/misc/event…
============================================================================== --- trunk/reactos/dll/win32/msafd/misc/event.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msafd/misc/event.c [iso-8859-1] Fri May 28 04:25:56 2010 @@ -179,43 +179,51 @@ AFD_DbgPrint(MID_TRACE,("About to touch struct at %x (%d)\n", lpNetworkEvents, sizeof(*lpNetworkEvents))); - lpNetworkEvents->lNetworkEvents = 0; + RtlZeroMemory(lpNetworkEvents, sizeof(*lpNetworkEvents)); AFD_DbgPrint(MID_TRACE,("Zeroed struct\n")); /* Set Events to wait for */ if (EnumReq.PollEvents & AFD_EVENT_RECEIVE) { lpNetworkEvents->lNetworkEvents |= FD_READ; + lpNetworkEvents->iErrorCode[FD_READ_BIT] = EnumReq.EventStatus[FD_READ_BIT]; } if (EnumReq.PollEvents & AFD_EVENT_SEND) { lpNetworkEvents->lNetworkEvents |= FD_WRITE; + lpNetworkEvents->iErrorCode[FD_WRITE_BIT] = EnumReq.EventStatus[FD_WRITE_BIT]; } if (EnumReq.PollEvents & AFD_EVENT_OOB_RECEIVE) { lpNetworkEvents->lNetworkEvents |= FD_OOB; + lpNetworkEvents->iErrorCode[FD_OOB_BIT] = EnumReq.EventStatus[FD_OOB_BIT]; } if (EnumReq.PollEvents & AFD_EVENT_ACCEPT) { lpNetworkEvents->lNetworkEvents |= FD_ACCEPT; + lpNetworkEvents->iErrorCode[FD_ACCEPT_BIT] = EnumReq.EventStatus[FD_ACCEPT_BIT]; } if (EnumReq.PollEvents & (AFD_EVENT_CONNECT | AFD_EVENT_CONNECT_FAIL)) { lpNetworkEvents->lNetworkEvents |= FD_CONNECT; + lpNetworkEvents->iErrorCode[FD_CONNECT_BIT] = EnumReq.EventStatus[FD_CONNECT_BIT]; } if (EnumReq.PollEvents & (AFD_EVENT_DISCONNECT | AFD_EVENT_ABORT | AFD_EVENT_CLOSE)) { lpNetworkEvents->lNetworkEvents |= FD_CLOSE; + lpNetworkEvents->iErrorCode[FD_CLOSE_BIT] = EnumReq.EventStatus[FD_CLOSE_BIT]; } if (EnumReq.PollEvents & AFD_EVENT_QOS) { lpNetworkEvents->lNetworkEvents |= FD_QOS; + lpNetworkEvents->iErrorCode[FD_QOS_BIT] = EnumReq.EventStatus[FD_QOS_BIT]; } if (EnumReq.PollEvents & AFD_EVENT_GROUP_QOS) { lpNetworkEvents->lNetworkEvents |= FD_GROUP_QOS; + lpNetworkEvents->iErrorCode[FD_GROUP_QOS_BIT] = EnumReq.EventStatus[FD_GROUP_QOS_BIT]; } if( NT_SUCCESS(Status) ) *lpErrno = 0;
14 years, 5 months
1
0
0
0
← Newer
1
...
10
11
12
13
14
15
16
...
44
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
Results per page:
10
25
50
100
200