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
August 2009
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
21 participants
654 discussions
Start a n
N
ew thread
[cgutman] 42384: - Add a debug print
by cgutman@svn.reactos.org
Author: cgutman Date: Tue Aug 4 18:22:12 2009 New Revision: 42384 URL:
http://svn.reactos.org/svn/reactos?rev=42384&view=rev
Log: - Add a debug print Modified: trunk/reactos/base/services/dhcp/adapter.c Modified: trunk/reactos/base/services/dhcp/adapter.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/dhcp/adapter…
============================================================================== --- trunk/reactos/base/services/dhcp/adapter.c [iso-8859-1] (original) +++ trunk/reactos/base/services/dhcp/adapter.c [iso-8859-1] Tue Aug 4 18:22:12 2009 @@ -222,6 +222,7 @@ IfEntry.dwOperStatus == IF_OPER_STATUS_OPERATIONAL) return 1; + DH_DbgPrint(MID_TRACE,("Interface %d is down\n", IfEntry.dwIndex)); return 0; }
15 years, 4 months
1
0
0
0
[gschneider] 42383: _ecvt: - Rewrite the function, getting rid of alloca and unneeded code parts - Relies on working sprintf, especially allows to detect the decimal point position independent of wanted precision - Fixes all msvcrt printf winetests
by gschneider@svn.reactos.org
Author: gschneider Date: Tue Aug 4 17:17:00 2009 New Revision: 42383 URL:
http://svn.reactos.org/svn/reactos?rev=42383&view=rev
Log: _ecvt: - Rewrite the function, getting rid of alloca and unneeded code parts - Relies on working sprintf, especially allows to detect the decimal point position independent of wanted precision - Fixes all msvcrt printf winetests Removed: trunk/reactos/lib/sdk/crt/stdlib/ecvtbuf.c Modified: trunk/reactos/lib/sdk/crt/crt.rbuild trunk/reactos/lib/sdk/crt/stdlib/ecvt.c Modified: trunk/reactos/lib/sdk/crt/crt.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/crt.rbuild?rev…
============================================================================== --- trunk/reactos/lib/sdk/crt/crt.rbuild [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/crt.rbuild [iso-8859-1] Tue Aug 4 17:17:00 2009 @@ -317,7 +317,6 @@ <file>abort.c</file> <file>atexit.c</file> <file>ecvt.c</file> - <file>ecvtbuf.c</file> <file>errno.c</file> <file>fcvt.c</file> <file>fcvtbuf.c</file> Modified: trunk/reactos/lib/sdk/crt/stdlib/ecvt.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/stdlib/ecvt.c?…
============================================================================== --- trunk/reactos/lib/sdk/crt/stdlib/ecvt.c [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/stdlib/ecvt.c [iso-8859-1] Tue Aug 4 17:17:00 2009 @@ -1,7 +1,12 @@ -/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */ +/* + * PROJECT: ReactOS CRT + * LICENSE: See COPYING in the top level directory + * PURPOSE: CRT's ecvt + * FILE: lib/sdk/crt/stdlib/ecvt.c + * PROGRAMERS: Gregor Schneider (parts based on ecvtbuf.c by DJ Delorie) + */ + #include <precomp.h> - -char *ecvtbuf (double, int, int *, int *, char *); /* * @implemented @@ -9,6 +14,98 @@ char * _ecvt (double value, int ndigits, int *decpt, int *sign) { - static char ecvt_buf[DBL_MAX_10_EXP + 10]; - return ecvtbuf (value, ndigits, decpt, sign, ecvt_buf); + char *ecvtbuf, *cvtbuf; + char *s, *d; + + s = cvtbuf = (char*)malloc(ndigits + 18); /* sign, dot, null, 15 for alignment */ + d = ecvtbuf = (char*)malloc(DBL_MAX_10_EXP + 10); + + *sign = 0; + *decpt = 0; + + if (cvtbuf == NULL || ecvtbuf == NULL) + { + return NULL; + } + + sprintf(cvtbuf, "%-+.*E", ndigits, value); + /* Treat special values */ + if (strncmp(s, "NaN", 3) == 0) + { + memcpy(ecvtbuf, s, 4); + } + else if (strncmp(s + 1, "Inf", 3) == 0) + { + memcpy(ecvtbuf, s, 5); + } + else + { + /* Set the sign */ + if (*s && *s == '-') + { + *sign = 1; + } + s++; + /* Copy the first digit */ + if (*s && *s != '.') + { + if (d - ecvtbuf < ndigits) + { + *d++ = *s++; + } + else + { + s++; + } + } + /* Skip the decimal point */ + if (*s && *s == '.') + { + s++; + } + /* Copy fractional digits */ + while (*s && *s != 'E') + { + if (d - ecvtbuf < ndigits) + { + *d++ = *s++; + } + else + { + s++; + } + } + /* Skip the exponent */ + if (*s && *s == 'E') + { + s++; + } + /* Set the decimal point to the exponent value plus the one digit we copied */ + *decpt = atoi(s) + 1; + /* Handle special decimal point cases */ + if (cvtbuf[1] == '0') + { + *decpt = 0; + } + if (ndigits < 1) + { + /* Need enhanced precision*/ + char* tbuf = (char*)malloc(ndigits + 18); + sprintf(tbuf, "%-+.*E", ndigits + 2, value); + if (tbuf[1] >= '5') + { + (*decpt)++; + } + free(tbuf); + } + /* Pad with zeroes */ + while (d - ecvtbuf < ndigits) + { + *d++ = '0'; + } + /* Terminate */ + *d = '\0'; + } + free(cvtbuf); + return ecvtbuf; } Removed: trunk/reactos/lib/sdk/crt/stdlib/ecvtbuf.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/stdlib/ecvtbuf…
============================================================================== --- trunk/reactos/lib/sdk/crt/stdlib/ecvtbuf.c [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/stdlib/ecvtbuf.c (removed) @@ -1,108 +1,0 @@ -/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */ -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <float.h> -#include <malloc.h> -// #include <msvcrt/locale.h> - -void __ecvround (char *, char *, const char *, int *); - -void -__ecvround (char *numbuf, char *last_digit, const char *after_last, int *decpt) -{ - char *p; - int carry = 0; - - /* Do we have at all to round the last digit? */ - if (*after_last > '4') - { - p = last_digit; - carry = 1; - - /* Propagate the rounding through trailing '9' digits. */ - do { - int sum = *p + carry; - carry = sum > '9'; - *p-- = sum - carry * 10; - } while (carry && p >= numbuf); - - /* We have 9999999... which needs to be rounded to 100000.. */ - if (carry && p == numbuf) - { - *p = '1'; - *decpt += 1; - } - } -} - -char * -ecvtbuf (double value, int ndigits, int *decpt, int *sign, char *buf) -{ - static char INFINITY[] = "Infinity"; - char decimal = '.' /* localeconv()->decimal_point[0] */; - char *cvtbuf = (char *)_alloca (ndigits + 20); /* +3 for sign, dot, null; */ - /* two extra for rounding */ - /* 15 extra for alignment */ - char *s = cvtbuf, *d = buf; - - /* Produce two extra digits, so we could round properly. */ - sprintf (cvtbuf, "%-+.*E", ndigits + 2, value); - *decpt = 0; - - /* The sign. */ - if (*s++ == '-') - *sign = 1; - else - *sign = 0; - - /* Special values get special treatment. */ - if (strncmp (s, "Inf", 3) == 0) - { - /* SunOS docs says we have return "Infinity" for NDIGITS >= 8. */ - memcpy (buf, INFINITY, ndigits >= 8 ? 9 : 3); - if (ndigits < 8) - buf[3] = '\0'; - } - else if (strcmp (s, "NaN") == 0) - memcpy (buf, s, 4); - else - { - char *last_digit, *digit_after_last; - - /* Copy (the single) digit before the decimal. */ - while (*s && *s != decimal && d - buf < ndigits) - *d++ = *s++; - - /* If we don't see any exponent, here's our decimal point. */ - *decpt = d - buf; - if (*s) - s++; - - /* Copy the fraction digits. */ - while (*s && *s != 'E' && d - buf < ndigits) - *d++ = *s++; - - /* Remember the last digit copied and the one after it. */ - last_digit = d > buf ? d - 1 : d; - digit_after_last = s; - - /* Get past the E in exponent field. */ - while (*s && *s++ != 'E') - ; - - /* Adjust the decimal point by the exponent value. */ - *decpt += atoi (s); - - /* Pad with zeroes if needed. */ - while (d - buf < ndigits) - *d++ = '0'; - - /* Zero-terminate. */ - *d = '\0'; - - /* Round if necessary. */ - __ecvround (buf, last_digit, digit_after_last, decpt); - } - return buf; -}
15 years, 4 months
1
0
0
0
[gschneider] 42382: sprintf: - Implement higher precision exponent selection, checked against ecvt test cases to match wanted behavior - msvcrt printf winetests up by ~10 because current ecvt relies on non-correct behavior - Cleanup unneeded checks, wrong variable usages, add new header
by gschneider@svn.reactos.org
Author: gschneider Date: Tue Aug 4 17:09:47 2009 New Revision: 42382 URL:
http://svn.reactos.org/svn/reactos?rev=42382&view=rev
Log: sprintf: - Implement higher precision exponent selection, checked against ecvt test cases to match wanted behavior - msvcrt printf winetests up by ~10 because current ecvt relies on non-correct behavior - Cleanup unneeded checks, wrong variable usages, add new header Modified: trunk/reactos/lib/sdk/crt/stdio/lnx_sprintf.c Modified: trunk/reactos/lib/sdk/crt/stdio/lnx_sprintf.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/stdio/lnx_spri…
============================================================================== --- trunk/reactos/lib/sdk/crt/stdio/lnx_sprintf.c [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/stdio/lnx_sprintf.c [iso-8859-1] Tue Aug 4 17:09:47 2009 @@ -1,22 +1,18 @@ /* - * PROGRAMMERS: - * David Welch - * Eric Kohl - * Gregor Schneider - * + * COPYRIGHT: See COPYING in the top level directory + * PURPOSE: CRT's vsnprintf + * FILE: lib/sdk/crt/stdio/lnx_printf.c + * PROGRAMERS: David Welch + Eric Kohl + Gregor Schneider * TODO: * - Verify the implementation of '%Z'. */ -/* - * linux/lib/vsprintf.c - * - * Copyright (C) 1991, 1992 Linus Torvalds - */ - -/* vsprintf.c -- Lars Wirzenius & Linus Torvalds. */ -/* - * Wirzenius wrote this portably, Torvalds fucked it up :-) +/* + * Parts from linux/lib/vsprintf.c + * Lars Wirzenius & Linus Torvalds + * Wirzenius wrote this portably, Torvalds fucked it up :-) */ #include <precomp.h> @@ -156,11 +152,49 @@ unsigned int sign:1; } ieee_double_t; +static __inline void fracrnd(double *number, int prec) +{ + /* Shifts fractional digits to decimal places and compares to round table */ + /* Only suitable to determine the exponent with more precision, not for normal rounding */ + /* Incoming numbers are expected to range from approx -10.0 to 10.0 */ + int lpos = 1, ubound, sign = 1; + long decimal = abs((long)*number); + double frac = (*number - decimal) * 10; + long rt[] = + { + 0, + 9, + 99, + 999, + 9999, + 99999, + 999999, + 9999999, + 99999999, + 999999999 + }; + + if (*number < 0) + { + sign = -1; + } + ubound = min(prec, sizeof(rt)/sizeof(*rt) - 1); + while ((long)frac % 10 != 0 && lpos < ubound) + { + frac *= 10; + lpos++; + } + if (abs((long)frac) == rt[lpos]) + { + *number = sign * (decimal + 1); + } +} + static char * numberf(char * buf, char * end, double num, char exp_sign, int size, int precision, int type) { double exponent = 0.0; - double e; + double e = 0.0; long ie; int i = 0; @@ -185,9 +219,7 @@ if ( exp_sign == 'g' || exp_sign == 'G' || exp_sign == 'e' || exp_sign == 'E' ) { ie = ((unsigned int)n.n->exponent - (unsigned int)0x3ff); - if (*n.__n == 0.0) - exponent = 0.0; - else + if (num != 0.0) { exponent = ie/3.321928; } @@ -205,28 +237,25 @@ if ( exp_sign == 'e' || exp_sign == 'E' ) { - frac = modf(exponent,&e); - if (num < 0.0) - e--; - if (frac >= 0.5) - e++; - else if (frac < -0.5) - e--; - - num2 = num/pow(10.0L,(long double)e); - if (num2 < 1.0 && num2 > -1.0) - { - e--; - num2 = num/pow(10.0L,(long double)e); - } - else if (num2 < -10.0 && num2 > 10.0) - { - e++; - num2 = num/pow(10.0L,(long double)e); - } + if (num != 0.0) + { + /* Find a suitable exponent */ + frac = modf(exponent, &e); + num2 = num/pow(10.0L, (long double)e); + /* Check if rounding is possible */ + fracrnd(&num2, precision); + if (num2 < 1.0 && num2 > -1.0) + { + e--; + } + else if (num2 <= -10.0 || num2 >= 10.0) + { + e++; + } + } /* size-5 because "e+abc" is going to follow */ - buf = numberf(buf, end, num2, 'f', size-5, precision, type); + buf = numberf(buf, end, num/pow(10.0L,(long double)e), 'f', size-5, precision, type); isize = 4; while(*(buf-1) == ' ') {
15 years, 4 months
1
0
0
0
[fireball] 42381: - Uncomment missing surface unlocks.
by fireball@svn.reactos.org
Author: fireball Date: Tue Aug 4 16:07:15 2009 New Revision: 42381 URL:
http://svn.reactos.org/svn/reactos?rev=42381&view=rev
Log: - Uncomment missing surface unlocks. Modified: branches/arwinss/reactos/subsystems/win32/win32k/eng/engblt.c branches/arwinss/reactos/subsystems/win32/win32k/eng/engpoint.c Modified: branches/arwinss/reactos/subsystems/win32/win32k/eng/engblt.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/eng/engblt.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/eng/engblt.c [iso-8859-1] Tue Aug 4 16:07:15 2009 @@ -146,8 +146,8 @@ } } - //if (psurfPattern) - // SURFACE_UnlockSurface(psurfPattern); + if (psurfPattern) + SURFACE_Unlock(psurfPattern); return TRUE; } @@ -228,7 +228,7 @@ /* Pattern brush */ if (psurfPattern != NULL) { - //SURFACE_UnlockSurface(psurfPattern); + SURFACE_Unlock(psurfPattern); } return Result; Modified: branches/arwinss/reactos/subsystems/win32/win32k/eng/engpoint.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/eng/engpoint.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/eng/engpoint.c [iso-8859-1] Tue Aug 4 16:07:15 2009 @@ -291,7 +291,7 @@ pgp->psurfColor->pvBits = 0; EngDeleteSurface(pgp->psurfColor->hsurf); - //SURFACE_ShareUnlockSurface(pgp->psurfColor); + SURFACE_ShareUnlock(pgp->psurfColor); pgp->psurfColor = NULL; } @@ -302,14 +302,14 @@ pgp->psurfMask->pvBits = 0; EngDeleteSurface(pgp->psurfMask->hsurf); - //SURFACE_ShareUnlockSurface(pgp->psurfMask); + SURFACE_ShareUnlock(pgp->psurfMask); pgp->psurfMask = NULL; } if (pgp->psurfSave != NULL) { EngDeleteSurface(pgp->psurfSave->hsurf); - //SURFACE_ShareUnlockSurface(pgp->psurfSave); + SURFACE_ShareUnlock(pgp->psurfSave); pgp->psurfSave = NULL; }
15 years, 4 months
1
0
0
0
[fireball] 42380: - Use a precreated stock bitmap.
by fireball@svn.reactos.org
Author: fireball Date: Tue Aug 4 14:20:45 2009 New Revision: 42380 URL:
http://svn.reactos.org/svn/reactos?rev=42380&view=rev
Log: - Use a precreated stock bitmap. Modified: branches/arwinss/reactos/subsystems/win32/win32k/gdi/dc.c Modified: branches/arwinss/reactos/subsystems/win32/win32k/gdi/dc.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/gdi/dc.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/gdi/dc.c [iso-8859-1] Tue Aug 4 14:20:45 2009 @@ -77,8 +77,6 @@ HGDIOBJ hNewDC; PDC pNewDC; XFORM xformWorld2Vport, xformVport2World; - HBITMAP hStockBitmap; - SIZEL slSize; /* TESTING: Create primary surface */ if (!PrimarySurface.pSurface && !IntCreatePrimarySurface()) @@ -118,9 +116,7 @@ if (dc->dwType == OBJ_MEMDC) { DPRINT("Creating a memory DC %x\n", hNewDC); - slSize.cx = 1; slSize.cy = 1; - hStockBitmap = GreCreateBitmap(slSize, 1, 1, 0, NULL); - pNewDC->pBitmap = SURFACE_ShareLock(hStockBitmap); + pNewDC->pBitmap = SURFACE_ShareLock(hStockBmp); /* Set DC rectangles */ pNewDC->rcDcRect.left = 0; pNewDC->rcDcRect.top = 0;
15 years, 4 months
1
0
0
0
[fireball] 42379: - Connect a new Win32 process to the window station, as it's supposed to be done. However, desktop inheritance still needs to be checked. There is some testing code in connect_process_winstation left #if0ed out.
by fireball@svn.reactos.org
Author: fireball Date: Tue Aug 4 14:13:26 2009 New Revision: 42379 URL:
http://svn.reactos.org/svn/reactos?rev=42379&view=rev
Log: - Connect a new Win32 process to the window station, as it's supposed to be done. However, desktop inheritance still needs to be checked. There is some testing code in connect_process_winstation left #if0ed out. Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/user.h branches/arwinss/reactos/subsystems/win32/win32k/main/init.c branches/arwinss/reactos/subsystems/win32/win32k/wine/winstation.c Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/user.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/include/user.h [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/include/user.h [iso-8859-1] Tue Aug 4 14:13:26 2009 @@ -156,7 +156,7 @@ extern struct desktop *get_desktop_obj( PPROCESSINFO process, obj_handle_t handle, unsigned int access ); extern struct winstation *get_process_winstation( PPROCESSINFO process, unsigned int access ); extern struct desktop *get_thread_desktop( PTHREADINFO thread, unsigned int access ); -extern void connect_process_winstation( PPROCESSINFO process, PTHREADINFO parent ); +extern void connect_process_winstation( PPROCESSINFO process ); extern void set_process_default_desktop( PPROCESSINFO process, struct desktop *desktop, obj_handle_t handle ); extern void close_process_desktop( PPROCESSINFO process ); Modified: branches/arwinss/reactos/subsystems/win32/win32k/main/init.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/main/init.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/main/init.c [iso-8859-1] Tue Aug 4 14:13:26 2009 @@ -13,7 +13,9 @@ /* System service call table */ #include <include/napi.h> +#include "object.h" #include <handle.h> +#include <user.h> #define NDEBUG #include <debug.h> @@ -90,6 +92,7 @@ InitializeListHead(&Win32Process->Classes); Win32Process->handles = alloc_handle_table(Win32Process, 0); + connect_process_winstation(Win32Process); } else { Modified: branches/arwinss/reactos/subsystems/win32/win32k/wine/winstation.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/wine/winstation.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/wine/winstation.c [iso-8859-1] Tue Aug 4 14:13:26 2009 @@ -376,20 +376,52 @@ } /* connect a process to its window station */ -void connect_process_winstation( PPROCESSINFO process, PTHREADINFO parent ) +void connect_process_winstation( PPROCESSINFO process ) { struct winstation *winstation = NULL; struct desktop *desktop = NULL; obj_handle_t handle; + PPROCESSINFO parent = NULL; + PEPROCESS eparent; + HANDLE parent_handle; + NTSTATUS status; + +#if 0 + PRTL_USER_PROCESS_PARAMETERS ProcessParams = (process->peProcess->Peb ? process->peProcess->Peb->ProcessParameters : NULL); + PUNICODE_STRING DesktopPath; + + DesktopPath = (ProcessParams ? ((ProcessParams->DesktopInfo.Length > 0) ? &ProcessParams->DesktopInfo : NULL) : NULL); + if (DesktopPath) + { + DPRINT1("DesktopPath %wZ\n", DesktopPath); + } + /*Status = IntParseDesktopPath(Process, + DesktopPath, + &hWinSta, + &hDesk);*/ +#endif + + /* get parent process */ + parent_handle = PsGetProcessInheritedFromUniqueProcessId(process->peProcess); + if (parent_handle) + { + /* Lookup the process */ + status = PsLookupProcessByProcessId(parent_handle, &eparent); + if (NT_SUCCESS(status)) + { + /* get win32 process out of it */ + parent = PsGetProcessWin32Process(eparent); + } + } /* check for an inherited winstation handle (don't ask...) */ if ((handle = find_inherited_handle( process, &winstation_ops ))) { winstation = (struct winstation *)get_handle_obj( process, handle, 0, &winstation_ops ); } - else if (parent && parent->process->winstation) - { - handle = duplicate_handle( parent->process, parent->process->winstation, + else if (parent && parent->winstation) + { + handle = duplicate_handle( parent, parent->winstation, process, 0, 0, DUP_HANDLE_SAME_ACCESS ); winstation = (struct winstation *)get_handle_obj( process, handle, 0, &winstation_ops ); } @@ -403,17 +435,39 @@ } else if (parent && parent->desktop) { - desktop = get_desktop_obj( parent->process, parent->desktop, 0 ); + desktop = get_desktop_obj( parent, parent->desktop, 0 ); if (!desktop || desktop->winstation != winstation) goto done; - handle = duplicate_handle( parent->process, parent->desktop, + handle = duplicate_handle( parent, parent->desktop, process, 0, 0, DUP_HANDLE_SAME_ACCESS ); } if (handle) set_process_default_desktop( process, desktop, handle ); + +#if 0 + { + // set default desktop differently. Just always assign a "default" desktop + WCHAR deskbuf[8]; + struct unicode_str full_str, desktop_name; + WCHAR *full_name; + + desktop_name.str = deskbuf; + desktop_name.len = sizeof(deskbuf); + wcscpy(deskbuf, L"Default"); + + if ((full_name = build_desktop_name( &desktop_name, winstation, &full_str ))) + { + handle = open_object( winstation_namespace, &full_str, &desktop_ops, GENERIC_ALL, + OBJ_CASE_INSENSITIVE ); + ExFreePool( full_name ); + DPRINT1("handle %x\n", handle); + } + } +#endif done: if (desktop) release_object( desktop ); if (winstation) release_object( winstation ); + if (eparent) ObDereferenceObject(eparent); clear_error(); }
15 years, 4 months
1
0
0
0
[sginsberg] 42378: - Remove asm-optimized versions of RtlRandom and RtlUniform -- there is *no* reason to use hand-optimized assembly for simple routines like these -- let the compiler do its job, please. Also, we compiled random.c *and* random_asm.S, meaning we duplicated the functions -- the compiler didn't detect this and silently used the C versions. - Don't forward RtlRandomEx to RtlRandom in ntdll -- RtlRandomEx should use a different algorithm (but is simply a copy of RtlRandom right now)
by sginsberg@svn.reactos.org
Author: sginsberg Date: Tue Aug 4 13:22:50 2009 New Revision: 42378 URL:
http://svn.reactos.org/svn/reactos?rev=42378&view=rev
Log: - Remove asm-optimized versions of RtlRandom and RtlUniform -- there is *no* reason to use hand-optimized assembly for simple routines like these -- let the compiler do its job, please. Also, we compiled random.c *and* random_asm.S, meaning we duplicated the functions -- the compiler didn't detect this and silently used the C versions. - Don't forward RtlRandomEx to RtlRandom in ntdll -- RtlRandomEx should use a different algorithm (but is simply a copy of RtlRandom right now). - Revert RtlUniform back to the "slow" version -- let the compiler do its job instead of obfuscating code for a miniscule speed gain. Removed: trunk/reactos/lib/rtl/i386/random_asm.S Modified: trunk/reactos/dll/ntdll/def/ntdll_arm.def trunk/reactos/dll/ntdll/def/ntdll_i386.def trunk/reactos/lib/rtl/random.c trunk/reactos/lib/rtl/rtl.rbuild Modified: trunk/reactos/dll/ntdll/def/ntdll_arm.def URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/def/ntdll_arm.de…
============================================================================== --- trunk/reactos/dll/ntdll/def/ntdll_arm.def [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/def/ntdll_arm.def [iso-8859-1] Tue Aug 4 13:22:50 2009 @@ -621,7 +621,7 @@ RtlRaiseException RtlRaiseStatus RtlRandom -RtlRandomEx=RtlRandom +RtlRandomEx RtlReAllocateHeap RtlRealPredecessor RtlRealSuccessor Modified: trunk/reactos/dll/ntdll/def/ntdll_i386.def URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/def/ntdll_i386.d…
============================================================================== --- trunk/reactos/dll/ntdll/def/ntdll_i386.def [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/def/ntdll_i386.def [iso-8859-1] Tue Aug 4 13:22:50 2009 @@ -827,7 +827,7 @@ RtlRaiseException@4 RtlRaiseStatus@4 RtlRandom@4 -RtlRandomEx=RtlRandom@4 +RtlRandomEx@4 RtlReAllocateHeap@16 ;RtlReadMemoryStream ;RtlReadOutOfProcessMemoryStream Removed: trunk/reactos/lib/rtl/i386/random_asm.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/i386/random_asm.S?…
============================================================================== --- trunk/reactos/lib/rtl/i386/random_asm.S [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/i386/random_asm.S (removed) @@ -1,245 +1,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ranom.asm - * PURPOSE: Random number generator functions - * PROGRAMMER: Magnus Olsen (magnusolsen(a)greatlord.com) - * UPDATE HISTORY: - * Created 27/07/2005 - */ - -.intel_syntax noprefix - -/* GLOBALS ****************************************************************/ - -.globl _RtlRandom@4 // [1] (no bug) (max optimze code) -.globl _RtlUniform@4 // [2] (no bug) (max optimze code) -.globl _SavedValue // [3] (no bug) (max optimze code) - -/* FUNCTIONS ***************************************************************/ - -_RtlRandom@4: - // load pointer - mov ecx,[esp+4] - mov eax,[ecx] - - // Result = *Seed * 0xffffffed + 0x7fffffc3 // take now 3 cycles - lea edx,[eax + eax * 8] - - lea eax,[eax + edx * 2 + 2147483709 ] // + 2147483709 - neg eax - - cmp eax,-1 - je .RtlRandom_Rand1 - cmp eax, 2147483646 - je .RtlRandom_Rand1 - - cmp eax, 2147483647 - je .RtlRandom_Rand2 - - test eax,eax - jns .RtlRandom_Rand3 - - // else { - mov edx,eax - and edx,1 - add eax,edx - and eax,2147483647 - mov [ecx],eax - jmp .RtlRandom_Seed - -.RtlRandom_Rand1: - // if (Result == 0xffffffff || Result == 0x7ffffffe) - add eax, 2 - and eax, 2147483647 - mov [ecx],eax - jmp .RtlRandom_Seed - -.RtlRandom_Rand2: - // else if (Result == 0x7fffffff) - xor eax,eax - mov [ecx],eax - jmp .RtlRandom_Seed - -.RtlRandom_Rand3: - // else if ((Result & 0x80000000) == 0) - mov edx,eax - xor edx,-1 // not edx lock all clock until it finsish, but xor does not do that - and edx,1 - add eax,edx - mov [ecx],eax - -.RtlRandom_Seed: - mov eax,[ecx] - - // Result = *Seed * 0xffffffed + 0x7fffffc3 // take now 3 cycles - lea edx,[eax + eax * 8] - - lea eax,[eax + edx * 2 + 2147483709 ] // + 2147483709 09-18 - neg eax - - cmp eax,-1 - je .RtlRandom_Seed1 - cmp eax, 2147483646 - je .RtlRandom_Seed1 - - cmp eax, 2147483647 - je .RtlRandom_Seed2 - - test eax,eax - jns .RtlRandom_Seed3 - - // else { - mov edx,eax - and edx,1 - add eax,edx - and eax,2147483647 - - // end - mov edx,[ecx] - mov [ecx],eax - - mov ecx,eax // pos - and ecx, 0x7f // pos = seed & 0x7f - mov eax,ecx// - mov eax, [_SavedValue + ecx*4] - mov [_SavedValue + ecx*4], edx - ret 4 - -.RtlRandom_Seed1: - // if (Result == 0xffffffff || Result == 0x7ffffffe) - add eax, 2 - and eax, 2147483647 - - // end - mov edx,[ecx] - mov [ecx],eax - - mov ecx,eax // pos - and ecx, 0x7f // pos = seed & 0x7f - mov eax,ecx// - mov eax, [_SavedValue + ecx*4] - mov [_SavedValue + ecx*4], edx - ret 4 - -.RtlRandom_Seed2: - // else if (Result == 0x7fffffff) - xor eax,eax - - // end - mov edx,[ecx] - mov [ecx],eax - - mov ecx,eax // pos - and ecx, 0x7f // pos = seed & 0x7f - mov eax,ecx// - mov eax, [_SavedValue + ecx*4] - mov [_SavedValue + ecx*4], edx - ret 4 - -.RtlRandom_Seed3: - // else if ((Result & 0x80000000) == 0) - mov edx,eax - xor edx,-1 // not edx lock all clock until it finsish, but xor does not do that - and edx,1 - add eax,edx - - // end - mov edx,[ecx] - mov [ecx],eax - - mov ecx,eax // pos - and ecx, 0x7f // pos = seed & 0x7f - mov eax,ecx// - mov eax, [_SavedValue + ecx*4] - mov [_SavedValue + ecx*4], edx - ret 4 - -// prototype: ULONG STDCALL RtlUniform (PULONG Seed) -_RtlUniform@4: - // load pointer - mov ecx,[esp+4] - mov eax,[ecx] - - // Result = *Seed * 0xffffffed + 0x7fffffc3 // take now 3 cycles - lea edx,[eax + eax * 8] - - lea eax,[eax + edx * 2 + 2147483709 ] // + 2147483709 09-18 - neg eax - - cmp eax,-1 - je .RtlUniform_jump1 - cmp eax, 2147483646 - je .RtlUniform_jump1 - - cmp eax, 2147483647 - je .RtlUniform_jump2 - - test eax,eax - jns .RtlUniform_jump3 - - // else { - mov edx,eax - and edx,1 - add eax,edx - and eax,2147483647 - mov [ecx],eax - ret 4 - -.RtlUniform_jump1: - // if (Result == 0xffffffff || Result == 0x7ffffffe) - add eax, 2 - and eax, 2147483647 - mov [ecx],eax - ret 4 - -.RtlUniform_jump2: - // else if (Result == 0x7fffffff) - xor eax,eax - mov [ecx],eax - ret 4 - -.RtlUniform_jump3: - // else if ((Result & 0x80000000) == 0) - mov edx,eax - xor edx,-1 // not edx lock all clock until it finsish, but xor does not do that - and edx,1 - add eax,edx - mov [ecx],eax - ret 4 - -.data -// SavedValue[128] -_SavedValue: - .long 0x4c8bc0aa, 0x4c022957, 0x2232827a, 0x2f1e7626 - .long 0x7f8bdafb, 0x5c37d02a, 0x0ab48f72, 0x2f0c4ffa - .long 0x290e1954, 0x6b635f23, 0x5d3885c0, 0x74b49ff8 - .long 0x5155fa54, 0x6214ad3f, 0x111e9c29, 0x242a3a09 - .long 0x75932ae1, 0x40ac432e, 0x54f7ba7a, 0x585ccbd5 - .long 0x6df5c727, 0x0374dad1, 0x7112b3f1, 0x735fc311 - .long 0x404331a9, 0x74d97781, 0x64495118, 0x323e04be - .long 0x5974b425, 0x4862e393, 0x62389c1d, 0x28a68b82 - .long 0x0f95da37, 0x7a50bbc6, 0x09b0091c, 0x22cdb7b4 - .long 0x4faaed26, 0x66417ccd, 0x189e4bfa, 0x1ce4e8dd - .long 0x5274c742, 0x3bdcf4dc, 0x2d94e907, 0x32eac016 - .long 0x26d33ca3, 0x60415a8a, 0x31f57880, 0x68c8aa52 - .long 0x23eb16da, 0x6204f4a1, 0x373927c1, 0x0d24eb7c - .long 0x06dd7379, 0x2b3be507, 0x0f9c55b1, 0x2c7925eb - .long 0x36d67c9a, 0x42f831d9, 0x5e3961cb, 0x65d637a8 - .long 0x24bb3820, 0x4d08e33d, 0x2188754f, 0x147e409e - .long 0x6a9620a0, 0x62e26657, 0x7bd8ce81, 0x11da0abb - .long 0x5f9e7b50, 0x23e444b6, 0x25920c78, 0x5fc894f0 - .long 0x5e338cbb, 0x404237fd, 0x1d60f80f, 0x320a1743 - .long 0x76013d2b, 0x070294ee, 0x695e243b, 0x56b177fd - .long 0x752492e1, 0x6decd52f, 0x125f5219, 0x139d2e78 - .long 0x1898d11e, 0x2f7ee785, 0x4db405d8, 0x1a028a35 - .long 0x63f6f323, 0x1f6d0078, 0x307cfd67, 0x3f32a78a - .long 0x6980796c, 0x462b3d83, 0x34b639f2, 0x53fce379 - .long 0x74ba50f4, 0x1abc2c4b, 0x5eeaeb8d, 0x335a7a0d - .long 0x3973dd20, 0x0462d66b, 0x159813ff, 0x1e4643fd - .long 0x06bc5c62, 0x3115e3fc, 0x09101613, 0x47af2515 - .long 0x4f11ec54, 0x78b99911, 0x3db8dd44, 0x1ec10b9b - .long 0x5b5506ca, 0x773ce092, 0x567be81a, 0x5475b975 - .long 0x7a2cde1a, 0x494536f5, 0x34737bb4, 0x76d9750b - .long 0x2a1f6232, 0x2e49644d, 0x7dddcbe7, 0x500cebdb - .long 0x619dab9e, 0x48c626fe, 0x1cda3193, 0x52dabe9d Modified: trunk/reactos/lib/rtl/random.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/random.c?rev=42378…
============================================================================== --- trunk/reactos/lib/rtl/random.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/random.c [iso-8859-1] Tue Aug 4 13:22:50 2009 @@ -132,37 +132,16 @@ * function and our function return a random number uniformly * distributed over [0..MAXLONG-1]. */ -ULONG NTAPI -RtlUniform (PULONG Seed) +ULONG +NTAPI +RtlUniform(IN PULONG Seed) { - ULONG Result; + ULONG Result; - /* - * Instead of the algorithm stated above, we use the algorithm - * below, which is totally equivalent (see the tests), but does - * not use a division and therefore is faster. - */ - Result = *Seed * 0xffffffed + 0x7fffffc3; + /* Generate the random number */ + Result = (*Seed * 0x7fffffed + 0x7fffffc3) % MAXLONG; - if (Result == 0xffffffff || Result == 0x7ffffffe) - { - Result = (Result + 2) & MAXLONG; - } - else if (Result == 0x7fffffff) - { - Result = 0; - } - else if ((Result & 0x80000000) == 0) - { - Result = Result + (~Result & 1); - } - else - { - Result = (Result + (Result & 1)) & MAXLONG; - } - - *Seed = Result; - - return Result; + /* Return it */ + *Seed = Result; + return Result; } -/* EOF */ Modified: trunk/reactos/lib/rtl/rtl.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/rtl.rbuild?rev=423…
============================================================================== --- trunk/reactos/lib/rtl/rtl.rbuild [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/rtl.rbuild [iso-8859-1] Tue Aug 4 13:22:50 2009 @@ -13,7 +13,6 @@ <file>except_asm.s</file> <file>except.c</file> <file>interlck.S</file> - <file>random_asm.S</file> <file>rtlswap.S</file> <file>rtlmem.s</file> <file>res_asm.s</file>
15 years, 4 months
1
0
0
0
[fireball] 42377: - Merge 42376 (along with committing a merge history leftover from a previous merge).
by fireball@svn.reactos.org
Author: fireball Date: Mon Aug 3 23:06:49 2009 New Revision: 42377 URL:
http://svn.reactos.org/svn/reactos?rev=42377&view=rev
Log: - Merge 42376 (along with committing a merge history leftover from a previous merge). Modified: branches/arwinss/reactos/ (props changed) branches/arwinss/reactos/include/ndk/psfuncs.h Propchange: branches/arwinss/reactos/ ------------------------------------------------------------------------------ svn:mergeinfo = /trunk/reactos:42202,42376 Modified: branches/arwinss/reactos/include/ndk/psfuncs.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/include/ndk/psf…
============================================================================== --- branches/arwinss/reactos/include/ndk/psfuncs.h [iso-8859-1] (original) +++ branches/arwinss/reactos/include/ndk/psfuncs.h [iso-8859-1] Mon Aug 3 23:06:49 2009 @@ -155,6 +155,12 @@ PsSetProcessPriorityByClass( IN PEPROCESS Process, IN PSPROCESSPRIORITYMODE Type +); + +HANDLE +NTAPI +PsGetProcessInheritedFromUniqueProcessId( + IN PEPROCESS Process ); //
15 years, 4 months
1
0
0
0
[fireball] 42376: - Add PsGetProcessInheritedFromUniqueProcessId declaration to NDK.
by fireball@svn.reactos.org
Author: fireball Date: Mon Aug 3 23:01:48 2009 New Revision: 42376 URL:
http://svn.reactos.org/svn/reactos?rev=42376&view=rev
Log: - Add PsGetProcessInheritedFromUniqueProcessId declaration to NDK. Modified: trunk/reactos/include/ndk/psfuncs.h Modified: trunk/reactos/include/ndk/psfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/psfuncs.h?rev=…
============================================================================== --- trunk/reactos/include/ndk/psfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/psfuncs.h [iso-8859-1] Mon Aug 3 23:01:48 2009 @@ -155,6 +155,12 @@ PsSetProcessPriorityByClass( IN PEPROCESS Process, IN PSPROCESSPRIORITYMODE Type +); + +HANDLE +NTAPI +PsGetProcessInheritedFromUniqueProcessId( + IN PEPROCESS Process ); //
15 years, 4 months
1
0
0
0
[cgutman] 42375: Broadcast fixes - Treat 255.255.255.255 as an undefined address - Choose the first interface when sending a broadcast packet (fixes failing with STATUS_NETWORK_UNREACHABLE when trying to send a broadcast packet) - Fix a broadcast address check so 255.255.255.255 will also pass (fixes sending queued broadcast packets) - Now a broadcast packet can be successfully sent from an interface with a valid IP address (previously they could only be sent when the interface didn't have an NC
by cgutman@svn.reactos.org
Author: cgutman Date: Mon Aug 3 22:10:47 2009 New Revision: 42375 URL:
http://svn.reactos.org/svn/reactos?rev=42375&view=rev
Log: Broadcast fixes - Treat 255.255.255.255 as an undefined address - Choose the first interface when sending a broadcast packet (fixes failing with STATUS_NETWORK_UNREACHABLE when trying to send a broadcast packet) - Fix a broadcast address check so 255.255.255.255 will also pass (fixes sending queued broadcast packets) - Now a broadcast packet can be successfully sent from an interface with a valid IP address (previously they could only be sent when the interface didn't have an NCE entry) Modified: trunk/reactos/lib/drivers/ip/network/address.c trunk/reactos/lib/drivers/ip/network/interface.c trunk/reactos/lib/drivers/ip/network/neighbor.c Modified: trunk/reactos/lib/drivers/ip/network/address.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/add…
============================================================================== --- trunk/reactos/lib/drivers/ip/network/address.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/ip/network/address.c [iso-8859-1] Mon Aug 3 22:10:47 2009 @@ -122,7 +122,8 @@ { switch (Address->Type) { case IP_ADDRESS_V4: - return (Address->Address.IPv4Address == 0); + return (Address->Address.IPv4Address == 0 || + Address->Address.IPv4Address == 0xFFFFFFFF); case IP_ADDRESS_V6: /* FIXME: IPv6 is not supported */ Modified: trunk/reactos/lib/drivers/ip/network/interface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/int…
============================================================================== --- trunk/reactos/lib/drivers/ip/network/interface.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/ip/network/interface.c [iso-8859-1] Mon Aug 3 22:10:47 2009 @@ -152,6 +152,26 @@ return TRUE; } +static PIP_INTERFACE GetDefaultInterface(VOID) +{ + KIRQL OldIrql; + IF_LIST_ITER(CurrentIF); + + TcpipAcquireSpinLock(&InterfaceListLock, &OldIrql); + ForEachInterface(CurrentIF) { + if (CurrentIF->Context) { + TcpipReleaseSpinLock(&InterfaceListLock, OldIrql); + return CurrentIF; + } + } EndFor(CurrentIF); + TcpipReleaseSpinLock(&InterfaceListLock, OldIrql); + + /* There are no physical interfaces on the system + * so we must pick the loopback interface */ + + return Loopback; +} + PIP_INTERFACE FindOnLinkInterface(PIP_ADDRESS Address) /* * FUNCTION: Checks all on-link prefixes to find out if an address is on-link @@ -166,6 +186,9 @@ TI_DbgPrint(DEBUG_ROUTER, ("Called. Address (0x%X)\n", Address)); TI_DbgPrint(DEBUG_ROUTER, ("Address (%s)\n", A2S(Address))); + + if (AddrIsUnspecified(Address)) + return GetDefaultInterface(); TcpipAcquireSpinLock(&InterfaceListLock, &OldIrql); Modified: trunk/reactos/lib/drivers/ip/network/neighbor.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/nei…
============================================================================== --- trunk/reactos/lib/drivers/ip/network/neighbor.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/ip/network/neighbor.c [iso-8859-1] Mon Aug 3 22:10:47 2009 @@ -421,7 +421,8 @@ if (NCE == NULL) { TI_DbgPrint(MID_TRACE,("BCAST: %s\n", A2S(&Interface->Broadcast))); - if( AddrIsEqual(Address, &Interface->Broadcast) ) { + if( AddrIsEqual(Address, &Interface->Broadcast) || + AddrIsUnspecified(Address) ) { TI_DbgPrint(MID_TRACE,("Packet targeted at broadcast addr\n")); NCE = NBAddNeighbor(Interface, Address, NULL, Interface->AddressLength, NUD_CONNECTED);
15 years, 4 months
1
0
0
0
← Newer
1
...
57
58
59
60
61
62
63
...
66
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
Results per page:
10
25
50
100
200