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
September 2016
----- 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
18 participants
342 discussions
Start a n
N
ew thread
[dchapyshev] 72840: [KERNEL32] Add check for Flags parameter. * Fixes 124 tests for kernel32:WideCharToMultiByte
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Wed Sep 28 19:53:43 2016 New Revision: 72840 URL:
http://svn.reactos.org/svn/reactos?rev=72840&view=rev
Log: [KERNEL32] Add check for Flags parameter. * Fixes 124 tests for kernel32:WideCharToMultiByte Modified: trunk/reactos/dll/win32/kernel32/winnls/string/nls.c Modified: trunk/reactos/dll/win32/kernel32/winnls/string/nls.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/winnls/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/winnls/string/nls.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/winnls/string/nls.c [iso-8859-1] Wed Sep 28 19:53:43 2016 @@ -754,6 +754,12 @@ { INT TempLength; DWORD Char; + + if (Flags) + { + SetLastError(ERROR_INVALID_FLAGS); + return 0; + } /* Does caller query for output buffer size? */ if (MultiByteCount == 0)
8 years, 2 months
1
0
0
0
[dchapyshev] 72839: [NTOS:FSRTL] Rework FsRtlIsDbcsInExpression for correct parsing some expressions * Fixes 1 test for kmtest:FsRtlExpression
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Wed Sep 28 19:01:10 2016 New Revision: 72839 URL:
http://svn.reactos.org/svn/reactos?rev=72839&view=rev
Log: [NTOS:FSRTL] Rework FsRtlIsDbcsInExpression for correct parsing some expressions * Fixes 1 test for kmtest:FsRtlExpression Modified: trunk/reactos/ntoskrnl/fsrtl/dbcsname.c trunk/reactos/ntoskrnl/fsrtl/name.c Modified: trunk/reactos/ntoskrnl/fsrtl/dbcsname.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fsrtl/dbcsname.c?…
============================================================================== --- trunk/reactos/ntoskrnl/fsrtl/dbcsname.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/fsrtl/dbcsname.c [iso-8859-1] Wed Sep 28 19:01:10 2016 @@ -160,9 +160,14 @@ FsRtlIsDbcsInExpression(IN PANSI_STRING Expression, IN PANSI_STRING Name) { - SHORT StarFound = -1, DosStarFound = -1; - PUSHORT BackTracking = NULL, DosBackTracking = NULL; - USHORT ExpressionPosition = 0, NamePosition = 0, MatchingChars, LastDot; + USHORT Offset, Position, BackTrackingPosition, OldBackTrackingPosition; + USHORT BackTrackingBuffer[16], OldBackTrackingBuffer[16] = {0}; + PUSHORT BackTrackingSwap, BackTracking = BackTrackingBuffer, OldBackTracking = OldBackTrackingBuffer; + USHORT ExpressionPosition, NamePosition = 0, MatchingChars = 1; + USHORT NameChar = 0, ExpressionChar; + BOOLEAN EndOfName = FALSE; + BOOLEAN Result; + BOOLEAN DontSkipDot; PAGED_CODE(); ASSERT(Name->Length); @@ -232,170 +237,180 @@ } } - while (NamePosition < Name->Length && ExpressionPosition < Expression->Length) - { - /* Basic check to test if chars are equal */ - if ((Expression->Buffer[ExpressionPosition] == Name->Buffer[NamePosition])) - { - NamePosition++; - ExpressionPosition++; - } - /* Check cases that eat one char */ - else if (Expression->Buffer[ExpressionPosition] == '?') - { - NamePosition++; - ExpressionPosition++; - } - /* Test star */ - else if (Expression->Buffer[ExpressionPosition] == '*') - { - /* Skip contigous stars */ - while (ExpressionPosition + 1 < Expression->Length && Expression->Buffer[ExpressionPosition + 1] == '*') - { - ExpressionPosition++; - } - - /* Save star position */ - if (!BackTracking) - { - BackTracking = ExAllocatePoolWithTag(PagedPool | POOL_RAISE_IF_ALLOCATION_FAILURE, - Expression->Length * sizeof(USHORT), 'nrSF'); - } - BackTracking[++StarFound] = ExpressionPosition++; - - /* If star is at the end, then eat all rest and leave */ - if (ExpressionPosition == Expression->Length) - { - NamePosition = Name->Length; + /* Name parsing loop */ + for (; !EndOfName; MatchingChars = BackTrackingPosition) + { + /* Reset positions */ + OldBackTrackingPosition = BackTrackingPosition = 0; + + if (NamePosition >= Name->Length) + { + EndOfName = TRUE; + if (OldBackTracking[MatchingChars - 1] == Expression->Length * 2) break; - } - /* Allow null matching */ - else if (Expression->Buffer[ExpressionPosition] != '?' && - Expression->Buffer[ExpressionPosition] != Name->Buffer[NamePosition]) - { - NamePosition++; - } - } - /* Check DOS_STAR */ - else if (Expression->Buffer[ExpressionPosition] == ANSI_DOS_STAR) - { - /* Skip contigous stars */ - while (ExpressionPosition + 1 < Expression->Length && Expression->Buffer[ExpressionPosition + 1] == ANSI_DOS_STAR) - { - ExpressionPosition++; - } - - /* Look for last dot */ - MatchingChars = 0; - LastDot = (USHORT)-1; - while (MatchingChars < Name->Length) - { - if (Name->Buffer[MatchingChars] == '.') - { - LastDot = MatchingChars; - if (LastDot > NamePosition) - break; - } - - MatchingChars++; - } - - /* If we don't have dots or we didn't find last yet - * start eating everything - */ - if (MatchingChars != Name->Length || LastDot == (USHORT)-1) - { - if (!DosBackTracking) DosBackTracking = ExAllocatePoolWithTag(PagedPool | POOL_RAISE_IF_ALLOCATION_FAILURE, - Expression->Length * sizeof(USHORT), 'nrSF'); - DosBackTracking[++DosStarFound] = ExpressionPosition++; - - /* Not the same char, start exploring */ - if (Expression->Buffer[ExpressionPosition] != Name->Buffer[NamePosition]) - NamePosition++; + } + else + { + /* If lead byte present */ + if (FsRtlIsLeadDbcsCharacter(Name->Buffer[NamePosition])) + { + NameChar = Name->Buffer[NamePosition] + + (0x100 * Name->Buffer[NamePosition + 1]); + NamePosition += sizeof(USHORT); } else { - /* Else, if we are at last dot, eat it - otherwise, null match */ - if (Name->Buffer[NamePosition] == '.') - NamePosition++; - - ExpressionPosition++; - } - } - /* Check DOS_DOT */ - else if (Expression->Buffer[ExpressionPosition] == ANSI_DOS_DOT) - { - /* We only match dots */ - if (Name->Buffer[NamePosition] == '.') - { - NamePosition++; - } - /* Try to explore later on for null matching */ - else if (ExpressionPosition + 1 < Expression->Length && - Name->Buffer[NamePosition] == Expression->Buffer[ExpressionPosition + 1]) - { - NamePosition++; - } - ExpressionPosition++; - } - /* Check DOS_QM */ - else if (Expression->Buffer[ExpressionPosition] == ANSI_DOS_QM) - { - /* We match everything except dots */ - if (Name->Buffer[NamePosition] != '.') - { - NamePosition++; - } - ExpressionPosition++; - } - /* If nothing match, try to backtrack */ - else if (StarFound >= 0) - { - ExpressionPosition = BackTracking[StarFound--]; - } - else if (DosStarFound >= 0) - { - ExpressionPosition = DosBackTracking[DosStarFound--]; - } - /* Otherwise, fail */ - else - { - break; - } - - /* Under certain circumstances, expression is over, but name isn't - * and we can backtrack, then, backtrack */ - if (ExpressionPosition == Expression->Length && - NamePosition != Name->Length && StarFound >= 0) - { - ExpressionPosition = BackTracking[StarFound--]; - } - } - /* If we have nullable matching wc at the end of the string, eat them */ - if (ExpressionPosition != Expression->Length && NamePosition == Name->Length) - { - while (ExpressionPosition < Expression->Length) - { - if (Expression->Buffer[ExpressionPosition] != ANSI_DOS_DOT && - Expression->Buffer[ExpressionPosition] != '*' && - Expression->Buffer[ExpressionPosition] != ANSI_DOS_STAR) - { + NameChar = Name->Buffer[NamePosition]; + NamePosition += sizeof(UCHAR); + } + } + + while (MatchingChars > OldBackTrackingPosition) + { + ExpressionPosition = (OldBackTracking[OldBackTrackingPosition++] + 1) / 2; + + /* Expression parsing loop */ + for (Offset = 0; ExpressionPosition < Expression->Length; ) + { + ExpressionPosition += Offset; + + if (ExpressionPosition == Expression->Length) + { + BackTracking[BackTrackingPosition++] = Expression->Length * 2; + break; + } + + /* If buffer too small */ + if (BackTrackingPosition > RTL_NUMBER_OF(BackTrackingBuffer) - 1) + { + /* Allocate memory for BackTracking */ + BackTracking = ExAllocatePoolWithTag(PagedPool | POOL_RAISE_IF_ALLOCATION_FAILURE, + (Expression->Length + 1) * sizeof(USHORT) * 2, + 'nrSF'); + /* Copy old buffer content */ + RtlCopyMemory(BackTracking, + BackTrackingBuffer, + RTL_NUMBER_OF(BackTrackingBuffer) * sizeof(USHORT)); + + /* Allocate memory for OldBackTracking */ + OldBackTracking = ExAllocatePoolWithTag(PagedPool | POOL_RAISE_IF_ALLOCATION_FAILURE, + (Expression->Length + 1) * sizeof(USHORT) * 2, + 'nrSF'); + /* Copy old buffer content */ + RtlCopyMemory(OldBackTracking, + OldBackTrackingBuffer, + RTL_NUMBER_OF(OldBackTrackingBuffer) * sizeof(USHORT)); + } + + /* If lead byte present */ + if (FsRtlIsLeadDbcsCharacter(Expression->Buffer[ExpressionPosition])) + { + ExpressionChar = Expression->Buffer[ExpressionPosition] + + (0x100 * Expression->Buffer[ExpressionPosition + 1]); + Offset = sizeof(USHORT); + } + else + { + ExpressionChar = Expression->Buffer[ExpressionPosition]; + Offset = sizeof(UCHAR); + } + + /* Basic check to test if chars are equal */ + if (ExpressionChar == NameChar && !EndOfName) + { + BackTracking[BackTrackingPosition++] = (ExpressionPosition + Offset) * 2; + } + /* Check cases that eat one char */ + else if (ExpressionChar == '?' && !EndOfName) + { + BackTracking[BackTrackingPosition++] = (ExpressionPosition + Offset) * 2; + } + /* Test star */ + else if (ExpressionChar == '*') + { + BackTracking[BackTrackingPosition++] = ExpressionPosition * 2; + BackTracking[BackTrackingPosition++] = (ExpressionPosition * 2) + 1; + continue; + } + /* Check DOS_STAR */ + else if (ExpressionChar == ANSI_DOS_STAR) + { + /* Look for last dot */ + DontSkipDot = TRUE; + if (!EndOfName && NameChar == '.') + { + for (Position = NamePosition; Position < Name->Length; ) + { + /* If lead byte not present */ + if (!FsRtlIsLeadDbcsCharacter(Name->Buffer[Position])) + { + if (Name->Buffer[Position] == '.') + { + DontSkipDot = FALSE; + break; + } + + Position += sizeof(UCHAR); + } + else + { + Position += sizeof(USHORT); + } + } + } + + if (EndOfName || NameChar != '.' || !DontSkipDot) + BackTracking[BackTrackingPosition++] = ExpressionPosition * 2; + + BackTracking[BackTrackingPosition++] = (ExpressionPosition * 2) + 1; + continue; + } + /* Check DOS_DOT */ + else if (ExpressionChar == DOS_DOT) + { + if (EndOfName) continue; + + if (NameChar == '.') + BackTracking[BackTrackingPosition++] = (ExpressionPosition + Offset) * 2; + } + /* Check DOS_QM */ + else if (ExpressionChar == ANSI_DOS_QM) + { + if (EndOfName || NameChar == '.') continue; + + BackTracking[BackTrackingPosition++] = (ExpressionPosition + Offset) * 2; + } + + /* Leave from loop */ break; } - ExpressionPosition++; - } - } - - if (BackTracking) - { + + for (Position = 0; MatchingChars > OldBackTrackingPosition && Position < BackTrackingPosition; Position++) + { + while (MatchingChars > OldBackTrackingPosition && + BackTracking[Position] > OldBackTracking[OldBackTrackingPosition]) + { + ++OldBackTrackingPosition; + } + } + } + + /* Swap pointers */ + BackTrackingSwap = BackTracking; + BackTracking = OldBackTracking; + OldBackTracking = BackTrackingSwap; + } + + /* Store result value */ + Result = (OldBackTracking[MatchingChars - 1] == Expression->Length * 2); + + /* Frees the memory if necessary */ + if (BackTracking != BackTrackingBuffer && BackTracking != OldBackTrackingBuffer) ExFreePoolWithTag(BackTracking, 'nrSF'); - } - if (DosBackTracking) - { - ExFreePoolWithTag(DosBackTracking, 'nrSF'); - } - - return (ExpressionPosition == Expression->Length && NamePosition == Name->Length); + if (OldBackTracking != BackTrackingBuffer && OldBackTracking != OldBackTrackingBuffer) + ExFreePoolWithTag(OldBackTracking, 'nrSF'); + + return Result; } /*++ Modified: trunk/reactos/ntoskrnl/fsrtl/name.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fsrtl/name.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/fsrtl/name.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/fsrtl/name.c [iso-8859-1] Wed Sep 28 19:01:10 2016 @@ -27,9 +27,9 @@ USHORT BackTrackingBuffer[16], OldBackTrackingBuffer[16] = {0}; PUSHORT BackTrackingSwap, BackTracking = BackTrackingBuffer, OldBackTracking = OldBackTrackingBuffer; UNICODE_STRING IntExpression; - USHORT ExpressionPosition = 0, NamePosition = 0, MatchingChars = 1; + USHORT ExpressionPosition, NamePosition = 0, MatchingChars = 1; BOOLEAN EndOfName = FALSE; - BOOLEAN Result = FALSE; + BOOLEAN Result; BOOLEAN DontSkipDot; WCHAR CompareChar; PAGED_CODE();
8 years, 2 months
1
0
0
0
[mjansen] 72838: [KERNEL32] Mute WC_COMPOSITECHECK DPRINT1. CORE-12058 #resolve
by mjansen@svn.reactos.org
Author: mjansen Date: Wed Sep 28 17:33:36 2016 New Revision: 72838 URL:
http://svn.reactos.org/svn/reactos?rev=72838&view=rev
Log: [KERNEL32] Mute WC_COMPOSITECHECK DPRINT1. CORE-12058 #resolve Modified: trunk/reactos/dll/win32/kernel32/winnls/string/nls.c Modified: trunk/reactos/dll/win32/kernel32/winnls/string/nls.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/winnls/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/winnls/string/nls.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/winnls/string/nls.c [iso-8859-1] Wed Sep 28 17:33:36 2016 @@ -979,7 +979,7 @@ if ((Flags & WC_COMPOSITECHECK) && WideCharCount > 1) { /* FIXME: Handle WC_COMPOSITECHECK */ - DPRINT1("WC_COMPOSITECHECK flag UNIMPLEMENTED\n"); + DPRINT("WC_COMPOSITECHECK flag UNIMPLEMENTED\n"); } uChar = ((PUSHORT) CodePageTable->WideCharTable)[*WideCharString]; @@ -1009,7 +1009,7 @@ if ((Flags & WC_COMPOSITECHECK) && WideCharCount > 1) { /* FIXME: Handle WC_COMPOSITECHECK */ - DPRINT1("WC_COMPOSITECHECK flag UNIMPLEMENTED\n"); + DPRINT("WC_COMPOSITECHECK flag UNIMPLEMENTED\n"); } uChar = ((PUSHORT)CodePageTable->WideCharTable)[*WideCharString]; @@ -1114,7 +1114,7 @@ if ((Flags & WC_COMPOSITECHECK) && WideCharCount > 1) { /* FIXME: Handle WC_COMPOSITECHECK */ - DPRINT1("WC_COMPOSITECHECK flag UNIMPLEMENTED\n"); + DPRINT("WC_COMPOSITECHECK flag UNIMPLEMENTED\n"); } if (!*UsedDefaultChar) @@ -1141,7 +1141,7 @@ if ((Flags & WC_COMPOSITECHECK) && WideCharCount > 1) { /* FIXME: Handle WC_COMPOSITECHECK */ - DPRINT1("WC_COMPOSITECHECK flag UNIMPLEMENTED\n"); + DPRINT("WC_COMPOSITECHECK flag UNIMPLEMENTED\n"); } *MultiByteString = ((PCHAR)CodePageTable->WideCharTable)[*WideCharString];
8 years, 2 months
1
0
0
0
[jimtabor] 72837: [Win32SS] - Fix menu crash, marking the menu object destroyed if the access count is more than one. Must remember these are not GDI objects. Expect a retooling of user objects soo...
by jimtabor@svn.reactos.org
Author: jimtabor Date: Wed Sep 28 16:51:53 2016 New Revision: 72837 URL:
http://svn.reactos.org/svn/reactos?rev=72837&view=rev
Log: [Win32SS] - Fix menu crash, marking the menu object destroyed if the access count is more than one. Must remember these are not GDI objects. Expect a retooling of user objects soon. Set CORE-11892. Modified: trunk/reactos/win32ss/include/ntuser.h trunk/reactos/win32ss/user/ntuser/menu.c trunk/reactos/win32ss/user/ntuser/object.c trunk/reactos/win32ss/user/ntuser/object.h trunk/reactos/win32ss/user/ntuser/window.c trunk/reactos/win32ss/user/user32/misc/misc.c Modified: trunk/reactos/win32ss/include/ntuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/include/ntuser.h?r…
============================================================================== --- trunk/reactos/win32ss/include/ntuser.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/include/ntuser.h [iso-8859-1] Wed Sep 28 16:51:53 2016 @@ -13,7 +13,8 @@ #define FIRST_USER_HANDLE 0x0020 /* first possible value for low word of user handle */ #define LAST_USER_HANDLE 0xffef /* last possible value for low word of user handle */ -#define HANDLEENTRY_INDESTROY 1 +#define HANDLEENTRY_DESTROY 1 +#define HANDLEENTRY_INDESTROY 2 typedef struct _USER_HANDLE_ENTRY { Modified: trunk/reactos/win32ss/user/ntuser/menu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/menu.c…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/menu.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/menu.c [iso-8859-1] Wed Sep 28 16:51:53 2016 @@ -322,13 +322,9 @@ BOOL FASTCALL IntDestroyMenuObject(PMENU Menu, BOOL bRecurse) { - if(Menu) + if (Menu) { PWND Window; - ULONG Error; - - /* Remove all menu items */ - IntDestroyMenu( Menu, bRecurse); if (PsGetCurrentProcessSessionId() == Menu->head.rpdesk->rpwinstaParent->dwSessionId) { @@ -350,22 +346,14 @@ } } } - if (UserObjectInDestroy(Menu->head.h)) - { - WARN("Menu already dead!\n"); - return FALSE; - } + + if (!UserMarkObjectDestroy(Menu)) return TRUE; + + /* Remove all menu items */ + IntDestroyMenu( Menu, bRecurse); + ret = UserDeleteObject(Menu->head.h, TYPE_MENU); - if (!ret) - { // Make sure it is really dead or just marked for deletion. - Error = EngGetLastError(); - ret = UserObjectInDestroy(Menu->head.h); - if (ret && EngGetLastError() == ERROR_INVALID_HANDLE) - { - EngSetLastError(Error); - ret = FALSE; - } - } // See test_subpopup_locked_by_menu tests.... + TRACE("IntDestroyMenuObject %d\n",ret); return ret; } } Modified: trunk/reactos/win32ss/user/ntuser/object.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/object…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/object.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/object.c [iso-8859-1] Wed Sep 28 16:51:53 2016 @@ -582,6 +582,28 @@ return Object; } +BOOL +FASTCALL +UserMarkObjectDestroy(PVOID Object) +{ + PUSER_HANDLE_ENTRY entry; + PHEAD ObjHead = Object; + + entry = handle_to_entry(gHandleTable, ObjHead->h); + + ASSERT(entry != NULL); + + entry->flags |= HANDLEENTRY_DESTROY; + + if (ObjHead->cLockObj > 1) + { + entry->flags &= ~HANDLEENTRY_INDESTROY; + TRACE("Count %d\n",ObjHead->cLockObj); + return FALSE; + } + + return TRUE; +} BOOL FASTCALL Modified: trunk/reactos/win32ss/user/ntuser/object.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/object…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/object.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/object.h [iso-8859-1] Wed Sep 28 16:51:53 2016 @@ -19,6 +19,7 @@ void DbgUserDumpHandleTable(); PVOID FASTCALL ValidateHandle(HANDLE handle, HANDLE_TYPE type); BOOLEAN UserDestroyObjectsForOwner(PUSER_HANDLE_TABLE Table, PVOID Owner); +BOOL FASTCALL UserMarkObjectDestroy(PVOID); static __inline VOID UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry) Modified: trunk/reactos/win32ss/user/ntuser/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/window…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/window.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/window.c [iso-8859-1] Wed Sep 28 16:51:53 2016 @@ -641,7 +641,7 @@ } UserReferenceObject(Window); - UserDeleteObject(UserHMGetHandle(Window), TYPE_WINDOW); + UserMarkObjectDestroy(Window); IntDestroyScrollBars(Window); @@ -670,6 +670,7 @@ UserFreeWindowInfo(Window->head.pti, Window); UserDereferenceObject(Window); + UserDeleteObject(UserHMGetHandle(Window), TYPE_WINDOW); return 0; } Modified: trunk/reactos/win32ss/user/user32/misc/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/misc/m…
============================================================================== --- trunk/reactos/win32ss/user/user32/misc/misc.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/misc/misc.c [iso-8859-1] Wed Sep 28 16:51:53 2016 @@ -283,7 +283,7 @@ if ( (!pEntry) || (pEntry->type != uType) || !pEntry->ptr || - (pEntry->flags & HANDLEENTRY_INDESTROY) ) + (pEntry->flags & HANDLEENTRY_DESTROY) || (pEntry->flags & HANDLEENTRY_INDESTROY) ) { switch ( uType ) { // Test (with wine too) confirms these results!
8 years, 2 months
1
0
0
0
[akhaldi] 72836: [IPHLPAPI_APITEST] Add some tests for GetNetworkParams. By Peter Hater. ROSTESTS-244
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Sep 28 14:27:48 2016 New Revision: 72836 URL:
http://svn.reactos.org/svn/reactos?rev=72836&view=rev
Log: [IPHLPAPI_APITEST] Add some tests for GetNetworkParams. By Peter Hater. ROSTESTS-244 Added: trunk/rostests/apitests/iphlpapi/GetNetworkParams.c (with props) Modified: trunk/rostests/apitests/iphlpapi/CMakeLists.txt trunk/rostests/apitests/iphlpapi/testlist.c Modified: trunk/rostests/apitests/iphlpapi/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/iphlpapi/CMakeLi…
============================================================================== --- trunk/rostests/apitests/iphlpapi/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/apitests/iphlpapi/CMakeLists.txt [iso-8859-1] Wed Sep 28 14:27:48 2016 @@ -1,5 +1,6 @@ list(APPEND SOURCE + GetNetworkParams.c icmp.c SendARP.c testlist.c) @@ -7,5 +8,5 @@ add_executable(iphlpapi_apitest ${SOURCE}) target_link_libraries(iphlpapi_apitest wine ${PSEH_LIB}) set_module_type(iphlpapi_apitest win32cui) -add_importlibs(iphlpapi_apitest iphlpapi msvcrt kernel32 ntdll) +add_importlibs(iphlpapi_apitest iphlpapi advapi32 msvcrt kernel32 ntdll) add_cd_file(TARGET iphlpapi_apitest DESTINATION reactos/bin FOR all) Added: trunk/rostests/apitests/iphlpapi/GetNetworkParams.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/iphlpapi/GetNetw…
============================================================================== --- trunk/rostests/apitests/iphlpapi/GetNetworkParams.c (added) +++ trunk/rostests/apitests/iphlpapi/GetNetworkParams.c [iso-8859-1] Wed Sep 28 14:27:48 2016 @@ -0,0 +1,275 @@ +/* + * PROJECT: ReactOS API Tests + * LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory + * PURPOSE: Tests for GetNetworkParams function + * PROGRAMMERS: Peter Hater + */ + +#include <apitest.h> + +#define WIN32_NO_STATUS +#include <iphlpapi.h> +#include <winreg.h> + +#define ROSTESTDHCPHOST "testdhcproshost" +#define ROSTESTDHCPDOMAIN "testrosdomain" + +static +INT +ReadRegistryValue(PCHAR ValueName, PCHAR Value) +{ + INT ErrorCode; + HKEY ParametersKey; + DWORD RegType; + DWORD RegSize = 0; + + /* Open the database path key */ + ErrorCode = RegOpenKeyExA(HKEY_LOCAL_MACHINE, + "System\\CurrentControlSet\\Services\\Tcpip\\Parameters", + 0, + KEY_READ, + &ParametersKey); + if (ErrorCode == NO_ERROR) + { + /* Read the actual path */ + ErrorCode = RegQueryValueExA(ParametersKey, + ValueName, + NULL, + &RegType, + NULL, + &RegSize); + if (RegSize) + { + /* Read the actual path */ + ErrorCode = RegQueryValueExA(ParametersKey, + ValueName, + NULL, + &RegType, + (LPBYTE)Value, + &RegSize); + } + + /* Close the key */ + RegCloseKey(ParametersKey); + } + return ErrorCode; +} + +static +INT +WriteRegistryValue(PCHAR ValueName, PCHAR Value) +{ + INT ErrorCode; + HKEY ParametersKey; + + /* Open the database path key */ + ErrorCode = RegOpenKeyExA(HKEY_LOCAL_MACHINE, + "System\\CurrentControlSet\\Services\\Tcpip\\Parameters", + 0, + KEY_WRITE, + &ParametersKey); + if (ErrorCode == NO_ERROR) + { + /* Read the actual path */ + ErrorCode = RegSetValueExA(ParametersKey, + ValueName, + 0, + REG_SZ, + (LPBYTE)Value, + strlen(Value) + 1); + + /* Close the key */ + RegCloseKey(ParametersKey); + } + return ErrorCode; +} + +static +INT +DeleteRegistryValue(PCHAR ValueName) +{ + INT ErrorCode; + HKEY ParametersKey; + + /* Open the database path key */ + ErrorCode = RegOpenKeyExA(HKEY_LOCAL_MACHINE, + "System\\CurrentControlSet\\Services\\Tcpip\\Parameters", + 0, + KEY_WRITE, + &ParametersKey); + if (ErrorCode == NO_ERROR) + { + /* Read the actual path */ + ErrorCode = RegDeleteValueA(ParametersKey, ValueName); + + /* Close the key */ + RegCloseKey(ParametersKey); + } + return ErrorCode; +} + +static +VOID +test_GetNetworkParams(VOID) +{ + DWORD len = 0; + INT ErrorCode; + CHAR OrigHostname[128]; + CHAR OrigDomainName[128]; + CHAR OrigDhcpHostname[128]; + CHAR OrigDhcpDomainName[128]; + BOOL OrigHostnameExists; + BOOL OrigDomainNameExists; + BOOL OrigDhcpHostnameExists; + BOOL OrigDhcpDomainNameExists; + PFIXED_INFO FixedInfo; + DWORD ApiReturn; + + memset(OrigHostname, 0, sizeof(OrigHostname)); + memset(OrigDomainName, 0, sizeof(OrigDomainName)); + memset(OrigDhcpHostname, 0, sizeof(OrigDhcpHostname)); + memset(OrigDhcpDomainName, 0, sizeof(OrigDhcpDomainName)); + /* read current registry values */ + ErrorCode = ReadRegistryValue("Hostname", OrigHostname); + ok(ErrorCode == ERROR_SUCCESS, "Failed to read registry key Hostname %d\n", ErrorCode); + OrigHostnameExists = ErrorCode == NO_ERROR; + ErrorCode = ReadRegistryValue("Domain", OrigDomainName); + ok(ErrorCode == ERROR_SUCCESS || ErrorCode == ERROR_FILE_NOT_FOUND, "Failed to read registry key DomainName %d\n", ErrorCode); + OrigDomainNameExists = ErrorCode == NO_ERROR; + ErrorCode = ReadRegistryValue("DhcpHostname", OrigDhcpHostname); + ok(ErrorCode == ERROR_SUCCESS || ErrorCode == ERROR_FILE_NOT_FOUND, "Failed to read registry key DhcpHostname %d\n", ErrorCode); + OrigDhcpHostnameExists = ErrorCode == NO_ERROR; + ErrorCode = ReadRegistryValue("DhcpDomain", OrigDhcpDomainName); + ok(ErrorCode == ERROR_SUCCESS || ErrorCode == ERROR_FILE_NOT_FOUND, "Failed to read registry key DhcpDomainName %d\n", ErrorCode); + OrigDhcpDomainNameExists = ErrorCode == NO_ERROR; + + trace("Starting values:\n"); + trace("Hostname: %s, exists %s\n", OrigHostname, OrigHostnameExists ? "yes" : "no"); + trace("Domain: %s, exists %s\n", OrigDomainName, OrigDomainNameExists ? "yes" : "no"); + trace("DhcpHostname: %s, exists %s\n", OrigDhcpHostnameExists ? OrigDhcpHostname : "", OrigDhcpHostnameExists ? "yes" : "no"); + trace("DhcpDomain: %s, exists %s\n", OrigDhcpDomainNameExists ? OrigDhcpDomainName : "", OrigDhcpDomainNameExists ? "yes" : "no"); + + ApiReturn = GetNetworkParams(NULL, &len); + ok(ApiReturn == ERROR_BUFFER_OVERFLOW, + "GetNetworkParams returned %ld, expected ERROR_BUFFER_OVERFLOW\n", + ApiReturn); + if (ApiReturn != ERROR_BUFFER_OVERFLOW) + skip("Can't determine size of FIXED_INFO. Can't proceed\n"); + FixedInfo = HeapAlloc(GetProcessHeap(), 0, len); + if (FixedInfo == NULL) + skip("FixedInfo is NULL. Can't proceed\n"); + + ApiReturn = GetNetworkParams(FixedInfo, &len); + ok(ApiReturn == NO_ERROR, + "GetNetworkParams(buf, &dwSize) returned %ld, expected NO_ERROR\n", + ApiReturn); + if (ApiReturn != NO_ERROR) + { + HeapFree(GetProcessHeap(), 0, FixedInfo); + skip("GetNetworkParams failed. Can't proceed\n"); + } + ok(FixedInfo->HostName != NULL, "FixedInfo->HostName is NULL\n"); + if (FixedInfo->HostName == NULL) + { + HeapFree(GetProcessHeap(), 0, FixedInfo); + skip("FixedInfo->HostName is NULL. Can't proceed\n"); + } + if (OrigDhcpHostnameExists) + { + /* Windows doesn't honor DHCP option 12 even if RFC requires it if it is returned by DHCP server! */ + //ok(strcmp(FixedInfo->HostName, OrigDhcpHostname) == 0, "FixedInfo->HostName is wrong '%s' != '%s'\n", FixedInfo->HostName, OrigDhcpHostname); + } + else + ok(strcmp(FixedInfo->HostName, OrigHostname) == 0, "FixedInfo->HostName is wrong '%s' != '%s'\n", FixedInfo->HostName, OrigHostname); + ok(FixedInfo->DomainName != NULL, "FixedInfo->DomainName is NULL\n"); + if (FixedInfo->DomainName == NULL) + { + HeapFree(GetProcessHeap(), 0, FixedInfo); + skip("FixedInfo->DomainName is NULL. Can't proceed\n"); + } + if(OrigDhcpDomainNameExists) + ok(strcmp(FixedInfo->DomainName, OrigDhcpDomainName) == 0, "FixedInfo->DomainName is wrong '%s' != '%s'\n", FixedInfo->DomainName, OrigDhcpDomainName); + else + ok(strcmp(FixedInfo->DomainName, OrigDomainName) == 0, "FixedInfo->DomainName is wrong '%s' != '%s'\n", FixedInfo->DomainName, OrigDomainName); + if (!OrigDhcpHostnameExists) + { + ErrorCode = WriteRegistryValue("DhcpHostname", ROSTESTDHCPHOST); + ok(ErrorCode == NO_ERROR, "Failed to write registry key DhcpHostname %d\n", ErrorCode); + } + else + { + ErrorCode = DeleteRegistryValue("DhcpHostname"); + ok(ErrorCode == NO_ERROR, "Failed to remove registry key DhcpHostname %d\n", ErrorCode); + } + if (!OrigDhcpDomainNameExists) + { + ErrorCode = WriteRegistryValue("DhcpDomain", ROSTESTDHCPDOMAIN); + ok(ErrorCode == NO_ERROR, "Failed to write registry key DhcpDomainName %d\n", ErrorCode); + } + else + { + ErrorCode = DeleteRegistryValue("DhcpDomain"); + ok(ErrorCode == NO_ERROR, "Failed to remove registry key DhcpDomainName %d\n", ErrorCode); + } + + HeapFree(GetProcessHeap(), 0, FixedInfo); + len = 0; + ApiReturn = GetNetworkParams(NULL, &len); + ok(ApiReturn == ERROR_BUFFER_OVERFLOW, + "GetNetworkParams returned %ld, expected ERROR_BUFFER_OVERFLOW\n", + ApiReturn); + if (ApiReturn != ERROR_BUFFER_OVERFLOW) + skip("Can't determine size of FIXED_INFO. Can't proceed\n"); + FixedInfo = HeapAlloc(GetProcessHeap(), 0, len); + if (FixedInfo == NULL) + skip("FixedInfo is NULL. Can't proceed\n"); + ApiReturn = GetNetworkParams(FixedInfo, &len); + ok(ApiReturn == NO_ERROR, + "GetNetworkParams(buf, &dwSize) returned %ld, expected NO_ERROR\n", + ApiReturn); + if (ApiReturn != NO_ERROR) + { + HeapFree(GetProcessHeap(), 0, FixedInfo); + skip("GetNetworkParams failed. Can't proceed\n"); + } + + /* restore registry values */ + if (OrigDhcpHostnameExists) + ErrorCode = WriteRegistryValue("DhcpHostname", OrigDhcpHostname); + else + ErrorCode = DeleteRegistryValue("DhcpHostname"); + ok(ErrorCode == NO_ERROR, "Failed to restore registry key DhcpHostname %d\n", ErrorCode); + if (OrigDhcpDomainNameExists) + ErrorCode = WriteRegistryValue("DhcpDomain", OrigDhcpDomainName); + else + ErrorCode = DeleteRegistryValue("DhcpDomain"); + ok(ErrorCode == NO_ERROR, "Failed to restore registry key DhcpDomainName %d\n", ErrorCode); + + ok(ApiReturn == NO_ERROR, + "GetNetworkParams(buf, &dwSize) returned %ld, expected NO_ERROR\n", + ApiReturn); + ok(FixedInfo->HostName != NULL, "FixedInfo->HostName is NULL\n"); + if (FixedInfo->HostName == NULL) + skip("FixedInfo->HostName is NULL. Can't proceed\n"); + if (!OrigDhcpHostnameExists) + { + /* Windows doesn't honor DHCP option 12 even if RFC requires it if it is returned by DHCP server! */ + //ok(strcmp(FixedInfo->HostName, ROSTESTDHCPHOST) == 0, "FixedInfo->HostName is wrong '%s' != '%s'\n", FixedInfo->HostName, ROSTESTDHCPHOST); + } + else + ok(strcmp(FixedInfo->HostName, OrigHostname) == 0, "FixedInfo->HostName is wrong '%s' != '%s'\n", FixedInfo->HostName, OrigHostname); + ok(FixedInfo->DomainName != NULL, "FixedInfo->DomainName is NULL\n"); + if (FixedInfo->DomainName == NULL) + skip("FixedInfo->DomainName is NULL. Can't proceed\n"); + if (!OrigDhcpDomainNameExists) + ok(strcmp(FixedInfo->DomainName, ROSTESTDHCPDOMAIN) == 0, "FixedInfo->DomainName is wrong '%s' != '%s'\n", FixedInfo->DomainName, ROSTESTDHCPDOMAIN); + else + ok(strcmp(FixedInfo->DomainName, OrigDomainName) == 0, "FixedInfo->DomainName is wrong '%s' != '%s'\n", FixedInfo->DomainName, OrigDomainName); + + HeapFree(GetProcessHeap(), 0, FixedInfo); +} + +START_TEST(GetNetworkParams) +{ + test_GetNetworkParams(); +} Propchange: trunk/rostests/apitests/iphlpapi/GetNetworkParams.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/rostests/apitests/iphlpapi/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/iphlpapi/testlis…
============================================================================== --- trunk/rostests/apitests/iphlpapi/testlist.c [iso-8859-1] (original) +++ trunk/rostests/apitests/iphlpapi/testlist.c [iso-8859-1] Wed Sep 28 14:27:48 2016 @@ -3,11 +3,13 @@ #define STANDALONE #include <apitest.h> +extern void func_GetNetworkParams(void); extern void func_icmp(void); extern void func_SendARP(void); const struct test winetest_testlist[] = { + { "GetNetworkParams", func_GetNetworkParams }, { "icmp", func_icmp }, { "SendARP", func_SendARP },
8 years, 2 months
1
0
0
0
[dchapyshev] 72835: [NTOS:FSRTL] Rework FsRtlIsNameInExpressionPrivate for correct parsing some expressions * Fixes 1 test for kmtest:FsRtlExpression and 15 tests for kernel32:file
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Tue Sep 27 23:00:20 2016 New Revision: 72835 URL:
http://svn.reactos.org/svn/reactos?rev=72835&view=rev
Log: [NTOS:FSRTL] Rework FsRtlIsNameInExpressionPrivate for correct parsing some expressions * Fixes 1 test for kmtest:FsRtlExpression and 15 tests for kernel32:file Modified: trunk/reactos/ntoskrnl/fsrtl/name.c Modified: trunk/reactos/ntoskrnl/fsrtl/name.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fsrtl/name.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/fsrtl/name.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/fsrtl/name.c [iso-8859-1] Tue Sep 27 23:00:20 2016 @@ -23,13 +23,14 @@ IN BOOLEAN IgnoreCase, IN PWCHAR UpcaseTable OPTIONAL) { - SHORT StarFound = -1, DosStarFound = -1; - USHORT BackTrackingBuffer[5], DosBackTrackingBuffer[5]; - PUSHORT BackTracking = BackTrackingBuffer, DosBackTracking = DosBackTrackingBuffer; - SHORT BackTrackingSize = RTL_NUMBER_OF(BackTrackingBuffer); - SHORT DosBackTrackingSize = RTL_NUMBER_OF(DosBackTrackingBuffer); + USHORT Offset, Position, BackTrackingPosition, OldBackTrackingPosition; + USHORT BackTrackingBuffer[16], OldBackTrackingBuffer[16] = {0}; + PUSHORT BackTrackingSwap, BackTracking = BackTrackingBuffer, OldBackTracking = OldBackTrackingBuffer; UNICODE_STRING IntExpression; - USHORT ExpressionPosition = 0, NamePosition = 0, MatchingChars, LastDot; + USHORT ExpressionPosition = 0, NamePosition = 0, MatchingChars = 1; + BOOLEAN EndOfName = FALSE; + BOOLEAN Result = FALSE; + BOOLEAN DontSkipDot; WCHAR CompareChar; PAGED_CODE(); @@ -37,7 +38,7 @@ if (!Name->Length || !Expression->Length) { /* Return TRUE if both strings are empty, otherwise FALSE */ - if (Name->Length == 0 && Expression->Length == 0) + if (!Name->Length && !Expression->Length) return TRUE; else return FALSE; @@ -103,193 +104,144 @@ } } - while ((NamePosition < Name->Length / sizeof(WCHAR)) && - (ExpressionPosition < Expression->Length / sizeof(WCHAR))) - { - /* Basic check to test if chars are equal */ - CompareChar = IgnoreCase ? UpcaseTable[Name->Buffer[NamePosition]] : - Name->Buffer[NamePosition]; - if (Expression->Buffer[ExpressionPosition] == CompareChar) - { - NamePosition++; - ExpressionPosition++; - } - /* Check cases that eat one char */ - else if (Expression->Buffer[ExpressionPosition] == L'?') - { - NamePosition++; - ExpressionPosition++; - } - /* Test star */ - else if (Expression->Buffer[ExpressionPosition] == L'*') - { - /* Skip contigous stars */ - while ((ExpressionPosition + 1 < (USHORT)(Expression->Length / sizeof(WCHAR))) && - (Expression->Buffer[ExpressionPosition + 1] == L'*')) - { - ExpressionPosition++; - } - - /* Save star position */ - StarFound++; - if (StarFound >= BackTrackingSize) - { - ASSERT(BackTracking == BackTrackingBuffer); - - BackTrackingSize = Expression->Length / sizeof(WCHAR); - BackTracking = ExAllocatePoolWithTag(PagedPool | POOL_RAISE_IF_ALLOCATION_FAILURE, - BackTrackingSize * sizeof(USHORT), - 'nrSF'); - RtlCopyMemory(BackTracking, BackTrackingBuffer, sizeof(BackTrackingBuffer)); - - } - BackTracking[StarFound] = ExpressionPosition++; - - /* If star is at the end, then eat all rest and leave */ - if (ExpressionPosition == Expression->Length / sizeof(WCHAR)) - { - NamePosition = Name->Length / sizeof(WCHAR); + /* Name parsing loop */ + for (; !EndOfName; MatchingChars = BackTrackingPosition, NamePosition++) + { + /* Reset positions */ + OldBackTrackingPosition = BackTrackingPosition = 0; + + if (NamePosition >= Name->Length / sizeof(WCHAR)) + { + EndOfName = TRUE; + if (OldBackTracking[MatchingChars - 1] == Expression->Length * 2) break; - } - - /* Allow null matching */ - if (Expression->Buffer[ExpressionPosition] != L'?' && - Expression->Buffer[ExpressionPosition] != Name->Buffer[NamePosition]) - { - NamePosition++; - } - } - /* Check DOS_STAR */ - else if (Expression->Buffer[ExpressionPosition] == DOS_STAR) - { - /* Skip contigous stars */ - while ((ExpressionPosition + 1 < (USHORT)(Expression->Length / sizeof(WCHAR))) && - (Expression->Buffer[ExpressionPosition + 1] == DOS_STAR)) - { - ExpressionPosition++; - } - - /* Look for last dot */ - MatchingChars = 0; - LastDot = (USHORT)-1; - while (MatchingChars < Name->Length / sizeof(WCHAR)) - { - if (Name->Buffer[MatchingChars] == L'.') - { - LastDot = MatchingChars; - if (LastDot > NamePosition) - break; - } - - MatchingChars++; - } - - /* If we don't have dots or we didn't find last yet - * start eating everything - */ - if (MatchingChars != Name->Length || LastDot == (USHORT)-1) - { - DosStarFound++; - if (DosStarFound >= DosBackTrackingSize) - { - ASSERT(DosBackTracking == DosBackTrackingBuffer); - - DosBackTrackingSize = Expression->Length / sizeof(WCHAR); - DosBackTracking = ExAllocatePoolWithTag(PagedPool | POOL_RAISE_IF_ALLOCATION_FAILURE, - DosBackTrackingSize * sizeof(USHORT), + } + + while (MatchingChars > OldBackTrackingPosition) + { + ExpressionPosition = (OldBackTracking[OldBackTrackingPosition++] + 1) / 2; + + /* Expression parsing loop */ + for (Offset = 0; ExpressionPosition < Expression->Length; Offset = sizeof(WCHAR)) + { + ExpressionPosition += Offset; + + if (ExpressionPosition == Expression->Length) + { + BackTracking[BackTrackingPosition++] = Expression->Length * 2; + break; + } + + /* If buffer too small */ + if (BackTrackingPosition > RTL_NUMBER_OF(BackTrackingBuffer) - 1) + { + /* Allocate memory for BackTracking */ + BackTracking = ExAllocatePoolWithTag(PagedPool | POOL_RAISE_IF_ALLOCATION_FAILURE, + (Expression->Length + sizeof(WCHAR)) * sizeof(USHORT), + 'nrSF'); + /* Copy old buffer content */ + RtlCopyMemory(BackTracking, + BackTrackingBuffer, + RTL_NUMBER_OF(BackTrackingBuffer) * sizeof(USHORT)); + + /* Allocate memory for OldBackTracking */ + OldBackTracking = ExAllocatePoolWithTag(PagedPool | POOL_RAISE_IF_ALLOCATION_FAILURE, + (Expression->Length + sizeof(WCHAR)) * sizeof(USHORT), 'nrSF'); - RtlCopyMemory(DosBackTracking, DosBackTrackingBuffer, sizeof(DosBackTrackingBuffer)); - } - DosBackTracking[DosStarFound] = ExpressionPosition++; - - /* Not the same char, start exploring */ - if (Expression->Buffer[ExpressionPosition] != Name->Buffer[NamePosition]) - NamePosition++; - } - else - { - /* Else, if we are at last dot, eat it - otherwise, null match */ - if (Name->Buffer[NamePosition] == '.') - NamePosition++; - - ExpressionPosition++; - } - } - /* Check DOS_DOT */ - else if (Expression->Buffer[ExpressionPosition] == DOS_DOT) - { - /* We only match dots */ - if (Name->Buffer[NamePosition] == L'.') - { - NamePosition++; - } - /* Try to explore later on for null matching */ - else if ((ExpressionPosition + 1 < (USHORT)(Expression->Length / sizeof(WCHAR))) && - (Name->Buffer[NamePosition] == Expression->Buffer[ExpressionPosition + 1])) - { - NamePosition++; - } - ExpressionPosition++; - } - /* Check DOS_QM */ - else if (Expression->Buffer[ExpressionPosition] == DOS_QM) - { - /* We match everything except dots */ - if (Name->Buffer[NamePosition] != L'.') - { - NamePosition++; - } - ExpressionPosition++; - } - /* If nothing match, try to backtrack */ - else if (StarFound >= 0) - { - ExpressionPosition = BackTracking[StarFound--]; - } - else if (DosStarFound >= 0) - { - ExpressionPosition = DosBackTracking[DosStarFound--]; - } - /* Otherwise, fail */ - else - { - break; - } - - /* Under certain circumstances, expression is over, but name isn't - * and we can backtrack, then, backtrack */ - if (ExpressionPosition == Expression->Length / sizeof(WCHAR) && - NamePosition != Name->Length / sizeof(WCHAR) && - StarFound >= 0) - { - ExpressionPosition = BackTracking[StarFound--]; - } - } - /* If we have nullable matching wc at the end of the string, eat them */ - if (ExpressionPosition != Expression->Length / sizeof(WCHAR) && NamePosition == Name->Length / sizeof(WCHAR)) - { - while (ExpressionPosition < Expression->Length / sizeof(WCHAR)) - { - if (Expression->Buffer[ExpressionPosition] != DOS_DOT && - Expression->Buffer[ExpressionPosition] != L'*' && - Expression->Buffer[ExpressionPosition] != DOS_STAR) - { + /* Copy old buffer content */ + RtlCopyMemory(OldBackTracking, + OldBackTrackingBuffer, + RTL_NUMBER_OF(OldBackTrackingBuffer) * sizeof(USHORT)); + } + + /* Basic check to test if chars are equal */ + CompareChar = IgnoreCase ? UpcaseTable[Name->Buffer[NamePosition]] : + Name->Buffer[NamePosition]; + if (Expression->Buffer[ExpressionPosition / sizeof(WCHAR)] == CompareChar && !EndOfName) + { + BackTracking[BackTrackingPosition++] = (ExpressionPosition + sizeof(WCHAR)) * 2; + } + /* Check cases that eat one char */ + else if (Expression->Buffer[ExpressionPosition / sizeof(WCHAR)] == L'?' && !EndOfName) + { + BackTracking[BackTrackingPosition++] = (ExpressionPosition + sizeof(WCHAR)) * 2; + } + /* Test star */ + else if (Expression->Buffer[ExpressionPosition / sizeof(WCHAR)] == L'*') + { + BackTracking[BackTrackingPosition++] = ExpressionPosition * 2; + BackTracking[BackTrackingPosition++] = (ExpressionPosition * 2) + 3; + continue; + } + /* Check DOS_STAR */ + else if (Expression->Buffer[ExpressionPosition / sizeof(WCHAR)] == DOS_STAR) + { + /* Look for last dot */ + DontSkipDot = TRUE; + if (!EndOfName && Name->Buffer[NamePosition] == '.') + { + for (Position = NamePosition - 1; Position < Name->Length; Position++) + { + if (Name->Buffer[Position] == L'.') + { + DontSkipDot = FALSE; + break; + } + } + } + + if (EndOfName || Name->Buffer[NamePosition] != L'.' || !DontSkipDot) + BackTracking[BackTrackingPosition++] = ExpressionPosition * 2; + + BackTracking[BackTrackingPosition++] = (ExpressionPosition * 2) + 3; + continue; + } + /* Check DOS_DOT */ + else if (Expression->Buffer[ExpressionPosition / sizeof(WCHAR)] == DOS_DOT) + { + if (EndOfName) continue; + + if (Name->Buffer[NamePosition] == L'.') + BackTracking[BackTrackingPosition++] = (ExpressionPosition + sizeof(WCHAR)) * 2; + } + /* Check DOS_QM */ + else if (Expression->Buffer[ExpressionPosition / sizeof(WCHAR)] == DOS_QM) + { + if (EndOfName || Name->Buffer[NamePosition] == L'.') continue; + + BackTracking[BackTrackingPosition++] = (ExpressionPosition + sizeof(WCHAR)) * 2; + } + + /* Leave from loop */ break; } - ExpressionPosition++; - } - } - - if (BackTracking != BackTrackingBuffer) - { + + for (Position = 0; MatchingChars > OldBackTrackingPosition && Position < BackTrackingPosition; Position++) + { + while (MatchingChars > OldBackTrackingPosition && + BackTracking[Position] > OldBackTracking[OldBackTrackingPosition]) + { + ++OldBackTrackingPosition; + } + } + } + + /* Swap pointers */ + BackTrackingSwap = BackTracking; + BackTracking = OldBackTracking; + OldBackTracking = BackTrackingSwap; + } + + /* Store result value */ + Result = (OldBackTracking[MatchingChars - 1] == (Expression->Length * 2)); + + /* Frees the memory if necessary */ + if (BackTracking != BackTrackingBuffer && BackTracking != OldBackTrackingBuffer) ExFreePoolWithTag(BackTracking, 'nrSF'); - } - if (DosBackTracking != DosBackTrackingBuffer) - { - ExFreePoolWithTag(DosBackTracking, 'nrSF'); - } - - return (ExpressionPosition == Expression->Length / sizeof(WCHAR) && NamePosition == Name->Length / sizeof(WCHAR)); + if (OldBackTracking != BackTrackingBuffer && OldBackTracking != OldBackTrackingBuffer) + ExFreePoolWithTag(OldBackTracking, 'nrSF'); + + return Result; } /* PUBLIC FUNCTIONS **********************************************************/
8 years, 2 months
1
0
0
0
[gadamopoulos] 72834: [SHELL32] - CDesktopBrowser: Implement support for multiple monitors. This needs to be disabled since we don't support LVM_SETWORKAREAS in comctl32 yet. Till then confine the ...
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Tue Sep 27 22:53:39 2016 New Revision: 72834 URL:
http://svn.reactos.org/svn/reactos?rev=72834&view=rev
Log: [SHELL32] - CDesktopBrowser: Implement support for multiple monitors. This needs to be disabled since we don't support LVM_SETWORKAREAS in comctl32 yet. Till then confine the desktop window in the default monitor. Modified: trunk/reactos/dll/win32/shell32/shelldesktop/CDesktopBrowser.cpp Modified: trunk/reactos/dll/win32/shell32/shelldesktop/CDesktopBrowser.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shelldes…
============================================================================== --- trunk/reactos/dll/win32/shell32/shelldesktop/CDesktopBrowser.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shelldesktop/CDesktopBrowser.cpp [iso-8859-1] Tue Sep 27 22:53:39 2016 @@ -19,6 +19,13 @@ */ #include "shelldesktop.h" + +// Support for multiple monitors is disabled till LVM_SETWORKAREAS gets implemented +#ifdef MULTIMONITOR_SUPPORT +#include <atlcoll.h> +#endif + + WINE_DEFAULT_DEBUG_CHANNEL(desktop); @@ -38,6 +45,7 @@ CComPtr<IShellView> m_ShellView; LRESULT _NotifyTray(UINT uMsg, WPARAM wParam, LPARAM lParam); + HRESULT _Resize(); public: CDesktopBrowser(); @@ -109,6 +117,72 @@ } } +#ifdef MULTIMONITOR_SUPPORT +BOOL CALLBACK MonitorEnumProc( + _In_ HMONITOR hMonitor, + _In_ HDC hdcMonitor, + _In_ LPRECT lprcMonitor, + _In_ LPARAM dwData +) +{ + CAtlList<RECT> *list = (CAtlList<RECT>*)dwData; + MONITORINFO MonitorInfo; + MonitorInfo.cbSize = sizeof(MonitorInfo); + if (::GetMonitorInfoW(hMonitor, &MonitorInfo)) + { + list->AddTail(MonitorInfo.rcWork); + } + + return TRUE; +} +#endif + +HRESULT CDesktopBrowser::_Resize() +{ + RECT rcNewSize; + +#ifdef MULTIMONITOR_SUPPORT + + UINT cMonitors = GetSystemMetrics(SM_CMONITORS); + if (cMonitors == 1) + { + SystemParametersInfoW(SPI_GETWORKAREA, 0, &rcNewSize, 0); + } + else + { + SetRect(&rcNewSize, + GetSystemMetrics(SM_XVIRTUALSCREEN), + GetSystemMetrics(SM_YVIRTUALSCREEN), + GetSystemMetrics(SM_XVIRTUALSCREEN) + GetSystemMetrics(SM_CXVIRTUALSCREEN), + GetSystemMetrics(SM_YVIRTUALSCREEN) + GetSystemMetrics(SM_CYVIRTUALSCREEN)); + } + + ::MoveWindow(m_hWnd, rcNewSize.left, rcNewSize.top, rcNewSize.right - rcNewSize.left, rcNewSize.bottom - rcNewSize.top, FALSE); + ::MoveWindow(m_hWndShellView, 0, 0, rcNewSize.right - rcNewSize.left, rcNewSize.bottom - rcNewSize.top, FALSE); + + if (cMonitors != 1) + { + CAtlList<RECT> list; + EnumDisplayMonitors(NULL, NULL, MonitorEnumProc, (LPARAM)&list); + RECT* prcWorkAreas = new RECT[list.GetCount()]; + int i = 0; + for (POSITION it = list.GetHeadPosition(); it; list.GetNext(it)) + prcWorkAreas[i++] = list.GetAt(it); + + HWND hwndListView = FindWindowExW(m_hWndShellView, NULL, WC_LISTVIEW, NULL); + + ::SendMessageW(hwndListView, LVM_SETWORKAREAS , i, (LPARAM)prcWorkAreas); + } + +#else + SystemParametersInfoW(SPI_GETWORKAREA, 0, &rcNewSize, 0); + ::MoveWindow(m_hWnd, rcNewSize.left, rcNewSize.top, rcNewSize.right - rcNewSize.left, rcNewSize.bottom - rcNewSize.top, FALSE); + ::MoveWindow(m_hWndShellView, 0, 0, rcNewSize.right - rcNewSize.left, rcNewSize.bottom - rcNewSize.top, FALSE); + +#endif + return S_OK; +} + HRESULT CDesktopBrowser::Initialize(IShellDesktopTray *ShellDesk) { CComPtr<IShellFolder> psfDesktop; @@ -117,25 +191,9 @@ if (FAILED_UNEXPECTEDLY(hRet)) return hRet; - /* Calculate the size and pos of the window */ - RECT rect; - if (!GetSystemMetrics(SM_CXVIRTUALSCREEN) || !GetSystemMetrics(SM_CYVIRTUALSCREEN)) - { - SetRect(&rect, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN)); - } - else - { - SetRect(&rect, - GetSystemMetrics(SM_XVIRTUALSCREEN), - GetSystemMetrics(SM_YVIRTUALSCREEN), - GetSystemMetrics(SM_XVIRTUALSCREEN) + GetSystemMetrics(SM_CXVIRTUALSCREEN), - GetSystemMetrics(SM_YVIRTUALSCREEN) + GetSystemMetrics(SM_CYVIRTUALSCREEN)); - } - - - m_Tray = ShellDesk; - - Create(NULL, &rect, szProgmanWindowName, WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, WS_EX_TOOLWINDOW); + m_Tray = ShellDesk; + + Create(NULL, NULL, szProgmanWindowName, WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, WS_EX_TOOLWINDOW); if (!m_hWnd) return E_FAIL; @@ -149,28 +207,14 @@ return hRet; FOLDERSETTINGS fs; - RECT rcWorkArea; - - // FIXME: Add support for multi-monitor? - SystemParametersInfoW(SPI_GETWORKAREA, 0, &rcWorkArea, 0); - - // TODO: Call GetClientRect for the tray window and make small computation - // to be sure the tray window rect is removed from the work area! -#if 0 - RECT rcTray; - HWND hWndTray; - - /* Get client rect of the taskbar */ - hRet = m_Tray->GetTrayWindow(&hWndTray); - if (SUCCEEDED(hRet)) - GetClientRect(hWndTray, &rcTray); -#endif - + RECT rcShellView = {0,0,0,0}; fs.ViewMode = FVM_ICON; fs.fFlags = FWF_DESKTOP | FWF_NOCLIENTEDGE | FWF_NOSCROLL | FWF_TRANSPARENT; - hRet = m_ShellView->CreateViewWindow(NULL, &fs, (IShellBrowser *)this, &rcWorkArea, &m_hWndShellView); + hRet = m_ShellView->CreateViewWindow(NULL, &fs, (IShellBrowser *)this, &rcShellView, &m_hWndShellView); if (FAILED_UNEXPECTEDLY(hRet)) return hRet; + + _Resize(); HWND hwndListView = FindWindowExW(m_hWndShellView, NULL, WC_LISTVIEW, NULL); SetShellWindowEx(m_hWnd, hwndListView); @@ -335,18 +379,7 @@ /* Hey, we're the desktop!!! */ ::ShowWindow(m_hWnd, SW_RESTORE); } - else - { - RECT rcDesktop; - rcDesktop.left = GetSystemMetrics(SM_XVIRTUALSCREEN); - rcDesktop.top = GetSystemMetrics(SM_YVIRTUALSCREEN); - rcDesktop.right = GetSystemMetrics(SM_CXVIRTUALSCREEN); - rcDesktop.bottom = GetSystemMetrics(SM_CYVIRTUALSCREEN); - - /* FIXME: Update work area */ - DBG_UNREFERENCED_LOCAL_VARIABLE(rcDesktop); - } - + return 0; } @@ -358,22 +391,11 @@ SendMessageW(m_hWndShellView, uMsg, wParam, lParam); } - if (uMsg == WM_SETTINGCHANGE && wParam == SPI_SETWORKAREA && - m_hWndShellView != NULL) - { - RECT rcWorkArea; - - // FIXME: Add support for multi-monitor! - // FIXME: Maybe merge with the code that retrieves the - // work area in CDesktopBrowser::CreateDeskWnd ? - SystemParametersInfoW(SPI_GETWORKAREA, 0, &rcWorkArea, 0); - - ::SetWindowPos(m_hWndShellView, NULL, - rcWorkArea.left, rcWorkArea.top, - rcWorkArea.right - rcWorkArea.left, - rcWorkArea.bottom - rcWorkArea.top, - SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOOWNERZORDER); - } + if (uMsg == WM_SETTINGCHANGE && wParam == SPI_SETWORKAREA && m_hWndShellView != NULL) + { + _Resize(); + } + return 0; }
8 years, 2 months
1
0
0
0
[janderwald] 72833: [USBAUDIO] - improve guid mess a bit - thanks amine
by janderwald@svn.reactos.org
Author: janderwald Date: Tue Sep 27 19:56:54 2016 New Revision: 72833 URL:
http://svn.reactos.org/svn/reactos?rev=72833&view=rev
Log: [USBAUDIO] - improve guid mess a bit - thanks amine Modified: trunk/reactos/drivers/usb/usbaudio/filter.c trunk/reactos/drivers/usb/usbaudio/guid.c trunk/reactos/drivers/usb/usbaudio/pin.c Modified: trunk/reactos/drivers/usb/usbaudio/filter.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbaudio/filte…
============================================================================== --- trunk/reactos/drivers/usb/usbaudio/filter.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbaudio/filter.c [iso-8859-1] Tue Sep 27 19:56:54 2016 @@ -25,9 +25,7 @@ GUID NodeTypeCapture = { STATIC_PINNAME_CAPTURE }; GUID NodeTypePlayback = { STATIC_KSCATEGORY_AUDIO }; GUID GUID_KSCATEGORY_AUDIO = { STATIC_KSCATEGORY_AUDIO }; -GUID GUID_KSDATAFORMAT_TYPE_AUDIO = { STATIC_KSDATAFORMAT_TYPE_AUDIO }; -GUID GUID_KSDATAFORMAT_SUBTYPE_PCM = { STATIC_KSDATAFORMAT_SUBTYPE_PCM }; -GUID GUID_KSDATAFORMAT_SPECIFIER_WAVEFORMATEX = { STATIC_KSDATAFORMAT_SPECIFIER_WAVEFORMATEX }; + KSPIN_INTERFACE StandardPinInterface = { {STATIC_KSINTERFACESETID_Standard}, @@ -367,9 +365,9 @@ } DataRangeAudio->DataRange.FormatSize = sizeof(KSDATARANGE_AUDIO); - DataRangeAudio->DataRange.MajorFormat = GUID_KSDATAFORMAT_TYPE_AUDIO; - DataRangeAudio->DataRange.SubFormat = GUID_KSDATAFORMAT_SUBTYPE_PCM; - DataRangeAudio->DataRange.Specifier = GUID_KSDATAFORMAT_SPECIFIER_WAVEFORMATEX; + DataRangeAudio->DataRange.MajorFormat = KSDATAFORMAT_TYPE_AUDIO; + DataRangeAudio->DataRange.SubFormat = KSDATAFORMAT_SUBTYPE_PCM; + DataRangeAudio->DataRange.Specifier = KSDATAFORMAT_SPECIFIER_WAVEFORMATEX; DataRangeAudio->MaximumChannels = 1; DataRangeAudio->MinimumBitsPerSample = StreamingFormatDescriptor->bBitResolution; DataRangeAudio->MaximumBitsPerSample = StreamingFormatDescriptor->bBitResolution; Modified: trunk/reactos/drivers/usb/usbaudio/guid.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbaudio/guid.…
============================================================================== --- trunk/reactos/drivers/usb/usbaudio/guid.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbaudio/guid.c [iso-8859-1] Tue Sep 27 19:56:54 2016 @@ -1,14 +1,11 @@ /* DO NOT USE THE PRECOMPILED HEADER FOR THIS FILE! */ -//#include <wdm.h> #include <initguid.h> -#include <portcls.h> -#include <wdmguid.h> -#include <ksmedia.h> -#include <hubbusif.h> -#include <usbbusif.h> /* FIXME */ DEFINE_GUID(KSNAME_Filter, 0x9b365890L, 0x165f, 0x11d0, 0xa1, 0x95, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4); +DEFINE_GUID(KSDATAFORMAT_TYPE_AUDIO, 0x73647561L, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71); +DEFINE_GUID(KSDATAFORMAT_SUBTYPE_PCM, 0x00000001L, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71); +DEFINE_GUID(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX, 0x05589f81L, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a); /* NO CODE HERE, THIS IS JUST REQUIRED FOR THE GUID DEFINITIONS */ Modified: trunk/reactos/drivers/usb/usbaudio/pin.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbaudio/pin.c…
============================================================================== --- trunk/reactos/drivers/usb/usbaudio/pin.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbaudio/pin.c [iso-8859-1] Tue Sep 27 19:56:54 2016 @@ -8,10 +8,6 @@ */ #include "usbaudio.h" - -GUID GUID2_KSDATAFORMAT_TYPE_AUDIO = { STATIC_KSDATAFORMAT_TYPE_AUDIO }; -GUID GUID2_KSDATAFORMAT_SUBTYPE_PCM = { STATIC_KSDATAFORMAT_SUBTYPE_PCM }; -GUID GUID2_KSDATAFORMAT_SPECIFIER_WAVEFORMATEX = { STATIC_KSDATAFORMAT_SPECIFIER_WAVEFORMATEX }; NTSTATUS NTAPI @@ -103,9 +99,9 @@ return STATUS_INSUFFICIENT_RESOURCES; } - if (IsEqualGUIDAligned(&Pin->ConnectionFormat->MajorFormat, &GUID2_KSDATAFORMAT_TYPE_AUDIO) && - IsEqualGUIDAligned(&Pin->ConnectionFormat->SubFormat, &GUID2_KSDATAFORMAT_SUBTYPE_PCM) && - IsEqualGUIDAligned(&Pin->ConnectionFormat->Specifier, &GUID2_KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)) + if (IsEqualGUIDAligned(&Pin->ConnectionFormat->MajorFormat, &KSDATAFORMAT_TYPE_AUDIO) && + IsEqualGUIDAligned(&Pin->ConnectionFormat->SubFormat, &KSDATAFORMAT_SUBTYPE_PCM) && + IsEqualGUIDAligned(&Pin->ConnectionFormat->Specifier, &KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)) { WaveFormatEx = (PKSDATAFORMAT_WAVEFORMATEX)Pin->ConnectionFormat; SampleRateBuffer[0] = (WaveFormatEx->WaveFormatEx.nSamplesPerSec >> 16) & 0xFF;
8 years, 2 months
1
0
0
0
[janderwald] 72832: [USBAUDIO] - implement USBAudioFilterCreate - partly implement USBAudioPinCreate, USBAudioPinSetDataFormat
by janderwald@svn.reactos.org
Author: janderwald Date: Tue Sep 27 19:20:00 2016 New Revision: 72832 URL:
http://svn.reactos.org/svn/reactos?rev=72832&view=rev
Log: [USBAUDIO] - implement USBAudioFilterCreate - partly implement USBAudioPinCreate, USBAudioPinSetDataFormat Modified: trunk/reactos/drivers/usb/usbaudio/filter.c trunk/reactos/drivers/usb/usbaudio/guid.c trunk/reactos/drivers/usb/usbaudio/pin.c trunk/reactos/drivers/usb/usbaudio/usbaudio.c trunk/reactos/drivers/usb/usbaudio/usbaudio.h Modified: trunk/reactos/drivers/usb/usbaudio/filter.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbaudio/filte…
============================================================================== --- trunk/reactos/drivers/usb/usbaudio/filter.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbaudio/filter.c [iso-8859-1] Tue Sep 27 19:20:00 2016 @@ -107,7 +107,38 @@ PKSFILTER Filter, PIRP Irp) { - UNIMPLEMENTED + PKSFILTERFACTORY FilterFactory; + PKSDEVICE Device; + PFILTER_CONTEXT FilterContext; + + FilterFactory = KsGetParent(Filter); + if (FilterFactory == NULL) + { + /* invalid parameter */ + return STATUS_INVALID_PARAMETER; + } + + Device = KsGetParent(FilterFactory); + if (Device == NULL) + { + /* invalid parameter */ + return STATUS_INVALID_PARAMETER; + } + + /* alloc filter context */ + FilterContext = AllocFunction(sizeof(FILTER_CONTEXT)); + if (FilterContext == NULL) + { + /* no memory */ + return STATUS_INSUFFICIENT_RESOURCES; + } + + /* init context */ + FilterContext->DeviceExtension = Device->Context; + FilterContext->LowerDevice = Device->NextDeviceObject; + Filter->Context = FilterContext; + + KsAddItemToObjectBag(Filter->Bag, FilterContext, ExFreePool); return STATUS_SUCCESS; } Modified: trunk/reactos/drivers/usb/usbaudio/guid.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbaudio/guid.…
============================================================================== --- trunk/reactos/drivers/usb/usbaudio/guid.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbaudio/guid.c [iso-8859-1] Tue Sep 27 19:20:00 2016 @@ -1,9 +1,8 @@ /* DO NOT USE THE PRECOMPILED HEADER FOR THIS FILE! */ //#include <wdm.h> +#include <initguid.h> #include <portcls.h> - -#include <initguid.h> #include <wdmguid.h> #include <ksmedia.h> #include <hubbusif.h> Modified: trunk/reactos/drivers/usb/usbaudio/pin.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbaudio/pin.c…
============================================================================== --- trunk/reactos/drivers/usb/usbaudio/pin.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbaudio/pin.c [iso-8859-1] Tue Sep 27 19:20:00 2016 @@ -9,13 +9,45 @@ #include "usbaudio.h" +GUID GUID2_KSDATAFORMAT_TYPE_AUDIO = { STATIC_KSDATAFORMAT_TYPE_AUDIO }; +GUID GUID2_KSDATAFORMAT_SUBTYPE_PCM = { STATIC_KSDATAFORMAT_SUBTYPE_PCM }; +GUID GUID2_KSDATAFORMAT_SPECIFIER_WAVEFORMATEX = { STATIC_KSDATAFORMAT_SPECIFIER_WAVEFORMATEX }; + NTSTATUS NTAPI USBAudioPinCreate( _In_ PKSPIN Pin, _In_ PIRP Irp) { - UNIMPLEMENTED + PKSFILTER Filter; + PFILTER_CONTEXT FilterContext; + PPIN_CONTEXT PinContext; + + Filter = KsPinGetParentFilter(Pin); + if (Filter == NULL) + { + /* invalid parameter */ + return STATUS_INVALID_PARAMETER; + } + + /* get filter context */ + FilterContext = Filter->Context; + + /* allocate pin context */ + PinContext = AllocFunction(sizeof(PIN_CONTEXT)); + if (!PinContext) + { + /* no memory*/ + return STATUS_INSUFFICIENT_RESOURCES; + } + + /* init pin context */ + PinContext->DeviceExtension = FilterContext->DeviceExtension; + PinContext->LowerDevice = FilterContext->LowerDevice; + + /* store pin context*/ + Pin->Context = PinContext; + return STATUS_SUCCESS; } @@ -57,10 +89,71 @@ _In_ const KSDATARANGE* DataRange, _In_opt_ const KSATTRIBUTE_LIST* AttributeRange) { - UNIMPLEMENTED - return STATUS_SUCCESS; + PURB Urb; + PUCHAR SampleRateBuffer; + PPIN_CONTEXT PinContext; + NTSTATUS Status; + PKSDATAFORMAT_WAVEFORMATEX WaveFormatEx; + + /* allocate sample rate buffer */ + SampleRateBuffer = AllocFunction(sizeof(ULONG)); + if (!SampleRateBuffer) + { + /* no memory */ + return STATUS_INSUFFICIENT_RESOURCES; + } + + if (IsEqualGUIDAligned(&Pin->ConnectionFormat->MajorFormat, &GUID2_KSDATAFORMAT_TYPE_AUDIO) && + IsEqualGUIDAligned(&Pin->ConnectionFormat->SubFormat, &GUID2_KSDATAFORMAT_SUBTYPE_PCM) && + IsEqualGUIDAligned(&Pin->ConnectionFormat->Specifier, &GUID2_KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)) + { + WaveFormatEx = (PKSDATAFORMAT_WAVEFORMATEX)Pin->ConnectionFormat; + SampleRateBuffer[0] = (WaveFormatEx->WaveFormatEx.nSamplesPerSec >> 16) & 0xFF; + SampleRateBuffer[1] = (WaveFormatEx->WaveFormatEx.nSamplesPerSec >> 8) & 0xFF; + SampleRateBuffer[2] = (WaveFormatEx->WaveFormatEx.nSamplesPerSec >> 0) & 0xFF; + } + else + { + /* not supported yet*/ + UNIMPLEMENTED; + FreeFunction(SampleRateBuffer); + return STATUS_INVALID_PARAMETER; + } + + /* allocate urb */ + Urb = AllocFunction(sizeof(struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST)); + if (!Urb) + { + /* no memory */ + FreeFunction(SampleRateBuffer); + return STATUS_INSUFFICIENT_RESOURCES; + } + + /* format urb */ + UsbBuildVendorRequest(Urb, + URB_FUNCTION_CLASS_ENDPOINT, + sizeof(struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST), + USBD_TRANSFER_DIRECTION_OUT, + 0, + 0x01, + 0x100, + 0x81, //bEndpointAddress + SampleRateBuffer, + NULL, + 3, + NULL); + + /* get pin context */ + PinContext = Pin->Context; + DbgBreakPoint(); + /* submit urb */ + Status = SubmitUrbSync(PinContext->LowerDevice, Urb); + + DPRINT1("USBAudioPinSetDataFormat Pin %p Status %x\n", Pin, Status); + FreeFunction(Urb); + FreeFunction(SampleRateBuffer); + return Status; } - NTSTATUS NTAPI Modified: trunk/reactos/drivers/usb/usbaudio/usbaudio.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbaudio/usbau…
============================================================================== --- trunk/reactos/drivers/usb/usbaudio/usbaudio.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbaudio/usbaudio.c [iso-8859-1] Tue Sep 27 19:20:00 2016 @@ -34,27 +34,12 @@ }; NTSTATUS -NTAPI -USBAudioCancelCompleteSynch( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp, - IN PVOID Context) -{ - /* signal event */ - KeSetEvent(Context, 0, FALSE); - - /* done */ - return STATUS_MORE_PROCESSING_REQUIRED; -} - -NTSTATUS SubmitUrbSync( - IN PKSDEVICE Device, + IN PDEVICE_OBJECT DeviceObject, IN PURB Urb) { PIRP Irp; KEVENT Event; - PDEVICE_EXTENSION DeviceExtension; IO_STATUS_BLOCK IoStatus; PIO_STACK_LOCATION IoStack; NTSTATUS Status; @@ -62,12 +47,9 @@ // init event KeInitializeEvent(&Event, NotificationEvent, FALSE); - // get device extension - DeviceExtension = (PDEVICE_EXTENSION)Device->Context; - // build irp Irp = IoBuildDeviceIoControlRequest(IOCTL_INTERNAL_USB_SUBMIT_URB, - DeviceExtension->LowerDevice, + DeviceObject, NULL, 0, NULL, @@ -90,11 +72,8 @@ // store urb IoStack->Parameters.Others.Argument1 = Urb; - // set completion routine - IoSetCompletionRoutine(Irp, USBAudioCancelCompleteSynch, &Event, TRUE, TRUE, TRUE); - // call driver - Status = IoCallDriver(DeviceExtension->LowerDevice, Irp); + Status = IoCallDriver(DeviceObject, Irp); // wait for the request to finish if (Status == STATUS_PENDING) @@ -169,8 +148,11 @@ return STATUS_INSUFFICIENT_RESOURCES; } + /* device extension */ + DeviceExtension = Device->Context; + /* submit configuration urb */ - Status = SubmitUrbSync(Device, Urb); + Status = SubmitUrbSync(DeviceExtension->LowerDevice, Urb); if (!NT_SUCCESS(Status)) { /* free resources */ @@ -180,7 +162,6 @@ } /* store configuration handle */ - DeviceExtension = Device->Context; DeviceExtension->ConfigurationHandle = Urb->UrbSelectConfiguration.ConfigurationHandle; /* alloc interface info */ @@ -205,6 +186,9 @@ NTSTATUS Status; ULONG Length; + /* get device extension */ + DeviceExtension = Device->Context; + /* allocate urb */ Urb = AllocFunction(sizeof(struct _URB_CONTROL_DESCRIPTOR_REQUEST)); if (!Urb) @@ -226,7 +210,7 @@ UsbBuildGetDescriptorRequest(Urb, sizeof(struct _URB_CONTROL_DESCRIPTOR_REQUEST), USB_DEVICE_DESCRIPTOR_TYPE, 0, 0, DeviceDescriptor, NULL, sizeof(USB_DEVICE_DESCRIPTOR), NULL); /* submit urb */ - Status = SubmitUrbSync(Device, Urb); + Status = SubmitUrbSync(DeviceExtension->LowerDevice, Urb); if (!NT_SUCCESS(Status)) { /* free resources */ @@ -249,7 +233,7 @@ UsbBuildGetDescriptorRequest(Urb, sizeof(struct _URB_CONTROL_DESCRIPTOR_REQUEST), USB_CONFIGURATION_DESCRIPTOR_TYPE, 0, 0, ConfigurationDescriptor, NULL, sizeof(USB_CONFIGURATION_DESCRIPTOR), NULL); /* submit urb */ - Status = SubmitUrbSync(Device, Urb); + Status = SubmitUrbSync(DeviceExtension->LowerDevice, Urb); if (!NT_SUCCESS(Status)) { /* free resources */ @@ -279,7 +263,7 @@ UsbBuildGetDescriptorRequest(Urb, sizeof(struct _URB_CONTROL_DESCRIPTOR_REQUEST), USB_CONFIGURATION_DESCRIPTOR_TYPE, 0, 0, ConfigurationDescriptor, NULL, Length, NULL); /* submit urb */ - Status = SubmitUrbSync(Device, Urb); + Status = SubmitUrbSync(DeviceExtension->LowerDevice, Urb); /* free urb */ FreeFunction(Urb); @@ -298,7 +282,7 @@ Status = USBAudioSelectConfiguration(Device, ConfigurationDescriptor); if (NT_SUCCESS(Status)) { - DeviceExtension = Device->Context; + DeviceExtension->ConfigurationDescriptor = ConfigurationDescriptor; DeviceExtension->DeviceDescriptor = DeviceDescriptor; } Modified: trunk/reactos/drivers/usb/usbaudio/usbaudio.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbaudio/usbau…
============================================================================== --- trunk/reactos/drivers/usb/usbaudio/usbaudio.h [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbaudio/usbaudio.h [iso-8859-1] Tue Sep 27 19:20:00 2016 @@ -110,6 +110,20 @@ }DEVICE_EXTENSION, *PDEVICE_EXTENSION; +typedef struct +{ + PDEVICE_EXTENSION DeviceExtension; /* device extension */ + PDEVICE_OBJECT LowerDevice; /* lower device*/ + +}FILTER_CONTEXT, *PFILTER_CONTEXT; + +typedef struct +{ + PDEVICE_EXTENSION DeviceExtension; /* device extension */ + PDEVICE_OBJECT LowerDevice; /* lower device*/ + +}PIN_CONTEXT, *PPIN_CONTEXT; + /* filter.c */ NTSTATUS @@ -129,6 +143,11 @@ IN PVOID Item); /* usbaudio.c */ + +NTSTATUS +SubmitUrbSync( + IN PDEVICE_OBJECT Device, + IN PURB Urb); NTSTATUS NTAPI
8 years, 2 months
1
0
0
0
[akhaldi] 72831: [PING] Minor fixes by Tim Crawford. Please see CORE-12022 for the list of changes.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Sep 27 18:37:45 2016 New Revision: 72831 URL:
http://svn.reactos.org/svn/reactos?rev=72831&view=rev
Log: [PING] Minor fixes by Tim Crawford. Please see CORE-12022 for the list of changes. Modified: trunk/reactos/base/applications/network/ping/lang/bg-BG.rc trunk/reactos/base/applications/network/ping/lang/cs-CZ.rc trunk/reactos/base/applications/network/ping/lang/de-DE.rc trunk/reactos/base/applications/network/ping/lang/en-US.rc trunk/reactos/base/applications/network/ping/lang/es-ES.rc trunk/reactos/base/applications/network/ping/lang/fr-FR.rc trunk/reactos/base/applications/network/ping/lang/it-IT.rc trunk/reactos/base/applications/network/ping/lang/pl-PL.rc trunk/reactos/base/applications/network/ping/lang/ro-RO.rc trunk/reactos/base/applications/network/ping/lang/ru-RU.rc trunk/reactos/base/applications/network/ping/lang/sq-AL.rc trunk/reactos/base/applications/network/ping/lang/sv-SE.rc trunk/reactos/base/applications/network/ping/lang/tr-TR.rc trunk/reactos/base/applications/network/ping/lang/uk-UA.rc trunk/reactos/base/applications/network/ping/lang/zh-CN.rc trunk/reactos/base/applications/network/ping/lang/zh-TW.rc trunk/reactos/base/applications/network/ping/ping.c trunk/reactos/base/applications/network/ping/resource.h Modified: trunk/reactos/base/applications/network/ping/lang/bg-BG.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/lang/bg-BG.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ping/lang/bg-BG.rc [iso-8859-1] Tue Sep 27 18:37:45 2016 @@ -61,4 +61,6 @@ IDS_APPROXIMATE_RTT "Approximate round-trip time in milliseconds:\n\ Minimum = %1!u!ms, Maximum = %2!u!ms, Average = %3!u!ms\n" + + IDS_WINSOCK_FAIL "Failed to initialize WinSock: %1!d!\n" END Modified: trunk/reactos/base/applications/network/ping/lang/cs-CZ.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/lang/cs-CZ.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ping/lang/cs-CZ.rc [iso-8859-1] Tue Sep 27 18:37:45 2016 @@ -61,4 +61,6 @@ IDS_APPROXIMATE_RTT "PÅibližná doba do pÅijetà odezvy v milisekundách:\n\ Minimum = %1!u!ms, Maximum = %2!u!ms, PrůmÄr = %3!u!ms\n" + + IDS_WINSOCK_FAIL "Failed to initialize WinSock: %1!d!\n" END Modified: trunk/reactos/base/applications/network/ping/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/lang/de-DE.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ping/lang/de-DE.rc [iso-8859-1] Tue Sep 27 18:37:45 2016 @@ -61,4 +61,6 @@ IDS_APPROXIMATE_RTT "Durchschnittliche Antwortzeit in Millisekunden:\n\ Minimum = %1!u!ms, Maximum = %2!u!ms, Durchschnitt = %3!u!ms\n" + + IDS_WINSOCK_FAIL "Failed to initialize WinSock: %1!d!\n" END Modified: trunk/reactos/base/applications/network/ping/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ping/lang/en-US.rc [iso-8859-1] Tue Sep 27 18:37:45 2016 @@ -61,4 +61,6 @@ IDS_APPROXIMATE_RTT "Approximate round-trip time in milliseconds:\n\ Minimum = %1!u!ms, Maximum = %2!u!ms, Average = %3!u!ms\n" + + IDS_WINSOCK_FAIL "Failed to initialize WinSock: %1!d!\n" END Modified: trunk/reactos/base/applications/network/ping/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/lang/es-ES.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ping/lang/es-ES.rc [iso-8859-1] Tue Sep 27 18:37:45 2016 @@ -61,4 +61,6 @@ IDS_APPROXIMATE_RTT "Tiempos aproximados de ida y vuelta en milisegundos:\n\ MÃnimo = %1!u!ms, Máximo = %2!u!ms, Media = %3!u!ms\n" + + IDS_WINSOCK_FAIL "Failed to initialize WinSock: %1!d!\n" END Modified: trunk/reactos/base/applications/network/ping/lang/fr-FR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/lang/fr-FR.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ping/lang/fr-FR.rc [iso-8859-1] Tue Sep 27 18:37:45 2016 @@ -61,4 +61,6 @@ IDS_APPROXIMATE_RTT "Délai approximatif de réponse en millisecondes :\n\ Minimum = %1!u!ms, Maximum = %2!u!ms, Moyenne = %3!u!ms\n" + + IDS_WINSOCK_FAIL "Failed to initialize WinSock: %1!d!\n" END Modified: trunk/reactos/base/applications/network/ping/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/lang/it-IT.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ping/lang/it-IT.rc [iso-8859-1] Tue Sep 27 18:37:45 2016 @@ -61,4 +61,6 @@ IDS_APPROXIMATE_RTT "Tempo approssimato di andata e ritorno in milli-secondi:\n\ Minimo = %1!u!ms, Massimo = %2!u!ms, Media = %3!u!ms\n" + + IDS_WINSOCK_FAIL "Failed to initialize WinSock: %1!d!\n" END Modified: trunk/reactos/base/applications/network/ping/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ping/lang/pl-PL.rc [iso-8859-1] Tue Sep 27 18:37:45 2016 @@ -61,4 +61,6 @@ IDS_APPROXIMATE_RTT "CaÅkowity, przybliżony czas podróży pakietu w millisekundach:\n\ Minimum = %1!u!ms, Maksimum = %2!u!ms, UÅredniony = %3!u!ms\n" + + IDS_WINSOCK_FAIL "Failed to initialize WinSock: %1!d!\n" END Modified: trunk/reactos/base/applications/network/ping/lang/ro-RO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/lang/ro-RO.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ping/lang/ro-RO.rc [iso-8859-1] Tue Sep 27 18:37:45 2016 @@ -61,4 +61,6 @@ IDS_APPROXIMATE_RTT "timpul aproximativ de tur-retur, in milisecunde:\n\ minim = %1!u!ms, maxim = %2!u!ms, mediu = %3!u!ms\n" + + IDS_WINSOCK_FAIL "Failed to initialize WinSock: %1!d!\n" END Modified: trunk/reactos/base/applications/network/ping/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ping/lang/ru-RU.rc [iso-8859-1] Tue Sep 27 18:37:45 2016 @@ -61,4 +61,6 @@ IDS_APPROXIMATE_RTT "ÐÑиблизиÑелÑное вÑÐµÐ¼Ñ Ð¿Ñиема-пеÑедаÑи в мÑ:\n\ ÐинималÑное = %1!u!ms, ÐакÑималÑное = %2!u!ms, СÑеднее = %3!u!ms\n" + + IDS_WINSOCK_FAIL "Failed to initialize WinSock: %1!d!\n" END Modified: trunk/reactos/base/applications/network/ping/lang/sq-AL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/lang/sq-AL.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ping/lang/sq-AL.rc [iso-8859-1] Tue Sep 27 18:37:45 2016 @@ -61,4 +61,6 @@ IDS_APPROXIMATE_RTT "Afersisht koha e matjes në mili-sekonda:\n\ Minimum = %1!u!ms, Maximum = %2!u!ms, Mesatar = %3!u!ms\n" + + IDS_WINSOCK_FAIL "Failed to initialize WinSock: %1!d!\n" END Modified: trunk/reactos/base/applications/network/ping/lang/sv-SE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/lang/sv-SE.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ping/lang/sv-SE.rc [iso-8859-1] Tue Sep 27 18:37:45 2016 @@ -61,4 +61,6 @@ IDS_APPROXIMATE_RTT "Ungefärliga slingtider i millisekunder:\n\ Minimum = %1!u!ms, Maximum = %2!u!ms, Genomsnittlig = %3!u!ms\n" + + IDS_WINSOCK_FAIL "Failed to initialize WinSock: %1!d!\n" END Modified: trunk/reactos/base/applications/network/ping/lang/tr-TR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/lang/tr-TR.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ping/lang/tr-TR.rc [iso-8859-1] Tue Sep 27 18:37:45 2016 @@ -61,4 +61,6 @@ IDS_APPROXIMATE_RTT "Mili sâniye olarak yaklaÅık gidiÅ geliÅ süreleri:\n\ En Az = %1!u!ms, En Ãok = %2!u!ms, Ortalama = %3!u!ms\n" + + IDS_WINSOCK_FAIL "Failed to initialize WinSock: %1!d!\n" END Modified: trunk/reactos/base/applications/network/ping/lang/uk-UA.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/lang/uk-UA.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ping/lang/uk-UA.rc [iso-8859-1] Tue Sep 27 18:37:45 2016 @@ -61,4 +61,6 @@ IDS_APPROXIMATE_RTT "Approximate round-trip time in milliseconds:\n\ Minimum = %1!u!ms, Maximum = %2!u!ms, Average = %3!u!ms\n" + + IDS_WINSOCK_FAIL "Failed to initialize WinSock: %1!d!\n" END Modified: trunk/reactos/base/applications/network/ping/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/lang/zh-CN.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ping/lang/zh-CN.rc [iso-8859-1] Tue Sep 27 18:37:45 2016 @@ -61,4 +61,6 @@ IDS_APPROXIMATE_RTT "Approximate round-trip time in milliseconds:\n\ Minimum = %1!u!ms, Maximum = %2!u!ms, Average = %3!u!ms\n" + + IDS_WINSOCK_FAIL "Failed to initialize WinSock: %1!d!\n" END Modified: trunk/reactos/base/applications/network/ping/lang/zh-TW.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/lang/zh-TW.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ping/lang/zh-TW.rc [iso-8859-1] Tue Sep 27 18:37:45 2016 @@ -61,4 +61,6 @@ IDS_APPROXIMATE_RTT "Approximate round-trip time in milliseconds:\n\ Minimum = %1!u!ms, Maximum = %2!u!ms, Average = %3!u!ms\n" + + IDS_WINSOCK_FAIL "Failed to initialize WinSock: %1!d!\n" END Modified: trunk/reactos/base/applications/network/ping/ping.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/ping.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ping/ping.c [iso-8859-1] Tue Sep 27 18:37:45 2016 @@ -55,6 +55,7 @@ static BOOL WINAPI ConsoleCtrlHandler(DWORD ControlType); static void PrintString(UINT id, ...); +static HANDLE hStdOut; static HANDLE hIcmpFile = INVALID_HANDLE_VALUE; static ULONG Timeout = 4000; static int Family = AF_UNSPEC; @@ -82,9 +83,12 @@ WSADATA wsaData; ULONG i; DWORD StrLen = 46; + int Status; IpOptions.Ttl = 128; + hStdOut = GetStdHandle(STD_OUTPUT_HANDLE); + if (!ParseCmdLine(argc, argv)) { return 1; @@ -92,14 +96,15 @@ if (!SetConsoleCtrlHandler(ConsoleCtrlHandler, TRUE)) { - DPRINT1("Failed to set control handler: %lu\n", GetLastError()); + DPRINT("Failed to set control handler: %lu\n", GetLastError()); return 1; } - if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) - { - DPRINT1("WSAStartup failed\n"); + Status = WSAStartup(MAKEWORD(2, 2), &wsaData); + if (Status != 0) + { + PrintString(IDS_WINSOCK_FAIL, Status); return 1; } @@ -113,7 +118,7 @@ if (WSAAddressToStringW(Target->ai_addr, (DWORD)Target->ai_addrlen, NULL, Address, &StrLen) != 0) { - DPRINT1("WSAAddressToStringW failed: %d\n", WSAGetLastError()); + DPRINT("WSAAddressToStringW failed: %d\n", WSAGetLastError()); FreeAddrInfoW(Target); WSACleanup(); @@ -132,7 +137,7 @@ if (hIcmpFile == INVALID_HANDLE_VALUE) { - DPRINT1("IcmpCreateFile failed: %lu\n", GetLastError()); + DPRINT("IcmpCreateFile failed: %lu\n", GetLastError()); FreeAddrInfoW(Target); WSACleanup(); @@ -177,12 +182,12 @@ { WCHAR Format[1024]; WCHAR Msg[1024]; - DWORD Len; + DWORD Len, written; va_list args; if (!LoadStringW(GetModuleHandleW(NULL), id, Format, _countof(Format))) { - DPRINT1("LoadStringW failed: %lu\n", GetLastError()); + DPRINT("LoadStringW failed: %lu\n", GetLastError()); return; } @@ -196,13 +201,14 @@ if (Len == 0) { - DPRINT1("FormatMessageW failed: %lu\n", GetLastError()); + DPRINT("FormatMessageW failed: %lu\n", GetLastError()); va_end(args); return; } - wprintf(L"%s", Msg); + // TODO: Handle writing to file. + WriteConsole(hStdOut, Msg, Len, &written, NULL); va_end(args); } @@ -468,9 +474,7 @@ if (Status != 0) { - DPRINT1("GetNameInfoW failed: %d\n", Status); - - return FALSE; + DPRINT("GetNameInfoW failed: %d\n", WSAGetLastError()); } } @@ -605,6 +609,8 @@ RTTMax = pEchoReply->RoundTripTime; } + wprintf(L"\n"); + RTTTotal += pEchoReply->RoundTripTime; break; Modified: trunk/reactos/base/applications/network/ping/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/resource.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ping/resource.h [iso-8859-1] Tue Sep 27 18:37:45 2016 @@ -28,3 +28,4 @@ #define IDS_TRANSMIT_FAILED 125 #define IDS_STATISTICS 126 #define IDS_APPROXIMATE_RTT 127 +#define IDS_WINSOCK_FAIL 128
8 years, 2 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
...
35
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
Results per page:
10
25
50
100
200