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
July 2011
----- 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
24 participants
517 discussions
Start a n
N
ew thread
[akhaldi] 52903: [FTP] * Introduce a PCH.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Jul 26 21:51:36 2011 New Revision: 52903 URL:
http://svn.reactos.org/svn/reactos?rev=52903&view=rev
Log: [FTP] * Introduce a PCH. Added: trunk/reactos/base/applications/network/ftp/precomp.h (with props) Modified: trunk/reactos/base/applications/network/ftp/CMakeLists.txt trunk/reactos/base/applications/network/ftp/cmds.c trunk/reactos/base/applications/network/ftp/cmdtab.c trunk/reactos/base/applications/network/ftp/domacro.c trunk/reactos/base/applications/network/ftp/fake.c trunk/reactos/base/applications/network/ftp/ftp.c trunk/reactos/base/applications/network/ftp/main.c trunk/reactos/base/applications/network/ftp/ruserpass.c Modified: trunk/reactos/base/applications/network/ftp/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ftp/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ftp/CMakeLists.txt [iso-8859-1] Tue Jul 26 21:51:36 2011 @@ -13,6 +13,7 @@ set_module_type(ftp win32cui) add_importlibs(ftp ws2_32 iphlpapi msvcrt kernel32) +add_pch(ftp precomp.h) if(MSVC) target_link_libraries(ftp oldnames) Modified: trunk/reactos/base/applications/network/ftp/cmds.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ftp/cmds.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ftp/cmds.c [iso-8859-1] Tue Jul 26 21:51:36 2011 @@ -24,26 +24,8 @@ */ //#include <sys/param.h> //#include <sys/wait.h> -#include <sys/stat.h> -#ifndef _WIN32 -#include <sys/socket.h> -#include <arpa/ftp.h> -#include <netinet/in.h> -#include <netdb.h> -#else -#include <winsock.h> -#endif - -#include <signal.h> -#include <direct.h> -#include <stdio.h> -#include <errno.h> -#include <ctype.h> -#include <time.h> - -#include "ftp_var.h" -#include "pathnames.h" -#include "prototypes.h" + +#include "precomp.h" extern char *globerr; extern char home[]; Modified: trunk/reactos/base/applications/network/ftp/cmdtab.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ftp/cmdtab.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ftp/cmdtab.c [iso-8859-1] Tue Jul 26 21:51:36 2011 @@ -19,7 +19,7 @@ static char sccsid[] = "@(#)cmdtab.c 5.9 (Berkeley) 3/21/89"; #endif /* not lint */ -#include "ftp_var.h" +#include "precomp.h" /* * User FTP -- Command Tables. Modified: trunk/reactos/base/applications/network/ftp/domacro.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ftp/domacro.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ftp/domacro.c [iso-8859-1] Tue Jul 26 21:51:36 2011 @@ -19,13 +19,8 @@ static char sccsid[] = "@(#)domacro.c 1.6 (Berkeley) 2/28/89"; #endif /* not lint */ -#include "ftp_var.h" -#include "prototypes.h" - -#include <signal.h> -#include <stdio.h> +#include "precomp.h" //#include <errno.h> -#include <ctype.h> //#include <sys/ttychars.h> void domacro(int argc, const char *argv[]) Modified: trunk/reactos/base/applications/network/ftp/fake.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ftp/fake.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ftp/fake.c [iso-8859-1] Tue Jul 26 21:51:36 2011 @@ -1,8 +1,4 @@ -#include <stdio.h> -#include <time.h> -#include <winsock.h> -#include "fake.h" -#include "prototypes.h" +#include "precomp.h" #define MAX_ASCII 100 Modified: trunk/reactos/base/applications/network/ftp/ftp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ftp/ftp.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ftp/ftp.c [iso-8859-1] Tue Jul 26 21:51:36 2011 @@ -21,33 +21,9 @@ #ifndef lint static char sccsid[] = "@(#)ftp.c 5.28 (Berkeley) 4/20/89"; #endif /* not lint */ -#include <io.h> - -#include <sys/stat.h> - -#ifndef _WIN32 -#include <sys/param.h> -#include <sys/socket.h> -#include <sys/time.h> -#include <sys/file.h> -#include <sys/ioctl.h> -#include <netinet/in.h> -#include <arpa/ftp.h> -#include <arpa/telnet.h> -#include <pwd.h> -#include <varargs.h> -#include <netdb.h> -#else -#include <winsock.h> -#endif - -#include <stdio.h> -#include <signal.h> -#include <errno.h> -#include <fcntl.h> - -#include "ftp_var.h" -#include "prototypes.h" + +#include "precomp.h" + #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 64 #endif Modified: trunk/reactos/base/applications/network/ftp/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ftp/main.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ftp/main.c [iso-8859-1] Tue Jul 26 21:51:36 2011 @@ -28,26 +28,7 @@ /* * FTP User Program -- Command Interface. */ -#ifndef _WIN32 -#include <netdb.h> -#include <sys/socket.h> -#include <sys/ioctl.h> -#include <arpa/ftp.h> -#include <errno.h> -#include <pwd.h> -#endif -#include "ftp_var.h" -#include "prototypes.h" -#include <sys/types.h> - -#include <io.h> -#include <fcntl.h> - -#include <signal.h> -#include <stdio.h> -#include <stdlib.h> -#include <ctype.h> - +#include "precomp.h" #if defined(sun) && !defined(FD_SET) typedef int uid_t; Added: trunk/reactos/base/applications/network/ftp/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ftp/precomp.h (added) +++ trunk/reactos/base/applications/network/ftp/precomp.h [iso-8859-1] Tue Jul 26 21:51:36 2011 @@ -1,0 +1,36 @@ + +#include <sys/stat.h> +#include <sys/types.h> + +#ifndef _WIN32 +#include <sys/param.h> +#include <sys/socket.h> +#include <sys/time.h> +#include <sys/file.h> +#include <sys/ioctl.h> +#include <netinet/in.h> +#include <arpa/ftp.h> +#include <arpa/telnet.h> +#include <pwd.h> +#include <varargs.h> +#include <netdb.h> +#else +#include <winsock.h> +#endif + +#include <signal.h> +#include <direct.h> +#include <io.h> +#include <stdio.h> +#include <stdlib.h> +#include <errno.h> +#include <ctype.h> +#include <time.h> + +#include "ftp_var.h" +#include "pathnames.h" +#include "prototypes.h" + +#include "fake.h" + +#include <fcntl.h> Propchange: trunk/reactos/base/applications/network/ftp/precomp.h ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/base/applications/network/ftp/ruserpass.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ftp/ruserpass.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ftp/ruserpass.c [iso-8859-1] Tue Jul 26 21:51:36 2011 @@ -19,15 +19,8 @@ static char sccsid[] = "@(#)ruserpass.c 5.1 (Berkeley) 3/1/89"; #endif /* not lint */ -#include <sys/types.h> -#include <stdio.h> +#include "precomp.h" //#include <utmp.h> -#include <ctype.h> -#include <sys/stat.h> -#include <errno.h> -#include "ftp_var.h" -#include "prototypes.h" -#include <winsock.h> struct utmp *getutmp(); static FILE *cfile;
13 years, 5 months
1
0
0
0
[akhaldi] 52902: [FINGER] * Introduce a PCH.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Jul 26 21:49:14 2011 New Revision: 52902 URL:
http://svn.reactos.org/svn/reactos?rev=52902&view=rev
Log: [FINGER] * Introduce a PCH. Added: trunk/reactos/base/applications/network/finger/precomp.h (with props) Modified: trunk/reactos/base/applications/network/finger/CMakeLists.txt trunk/reactos/base/applications/network/finger/err.c trunk/reactos/base/applications/network/finger/finger.c trunk/reactos/base/applications/network/finger/getopt.c trunk/reactos/base/applications/network/finger/net.c Modified: trunk/reactos/base/applications/network/finger/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/finger/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/finger/CMakeLists.txt [iso-8859-1] Tue Jul 26 21:49:14 2011 @@ -9,5 +9,6 @@ finger.rc) set_module_type(finger win32cui) +add_pch(finger precomp.h) add_importlibs(finger ws2_32 msvcrt kernel32) add_cd_file(TARGET finger DESTINATION reactos/system32 FOR all) Modified: trunk/reactos/base/applications/network/finger/err.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/finger/err.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/finger/err.c [iso-8859-1] Tue Jul 26 21:49:14 2011 @@ -35,17 +35,7 @@ static char sccsid[] = "@(#)err.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ -#include "err.h" -#include <errno.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#ifdef __STDC__ -#include <stdarg.h> -#else -#include <varargs.h> -#endif +#include "precomp.h" extern char *__progname; /* Program name, from crt0. */ Modified: trunk/reactos/base/applications/network/finger/finger.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/finger/finger.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/finger/finger.c [iso-8859-1] Tue Jul 26 21:49:14 2011 @@ -54,17 +54,7 @@ * mail info, and .plan/.project files. */ -#include <winsock2.h> -#include "err.h" -#include <errno.h> -#include <fcntl.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <time.h> - -#include "various.h" -#include "getopt.h" +#include "precomp.h" char *__progname; Modified: trunk/reactos/base/applications/network/finger/getopt.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/finger/getopt.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/finger/getopt.c [iso-8859-1] Tue Jul 26 21:49:14 2011 @@ -38,11 +38,7 @@ static char sccsid[] = "@(#)getopt.c 4.13 (Berkeley) 2/23/91"; #endif /* LIBC_SCCS and not lint */ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include "getopt.h" +#include "precomp.h" /* * get option letter from argument vector Modified: trunk/reactos/base/applications/network/finger/net.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/finger/net.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/finger/net.c [iso-8859-1] Tue Jul 26 21:49:14 2011 @@ -34,12 +34,7 @@ * SUCH DAMAGE. */ -#include <winsock2.h> -#include <stdio.h> -#include <ctype.h> -#include <string.h> - -#include "various.h" +#include "precomp.h" void netfinger(char *name) Added: trunk/reactos/base/applications/network/finger/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/finger/precomp.h (added) +++ trunk/reactos/base/applications/network/finger/precomp.h [iso-8859-1] Tue Jul 26 21:49:14 2011 @@ -1,0 +1,19 @@ + +#include <winsock2.h> +#include "err.h" +#include <errno.h> +#include <fcntl.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> +#include <ctype.h> + +#ifdef __STDC__ +#include <stdarg.h> +#else +#include <varargs.h> +#endif + +#include "various.h" +#include "getopt.h" Propchange: trunk/reactos/base/applications/network/finger/precomp.h ------------------------------------------------------------------------------ svn:eol-style = native
13 years, 5 months
1
0
0
0
[akhaldi] 52901: [MSPAINT] * Introduce a PCH. * Fix Brush function declaration.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Jul 26 21:44:53 2011 New Revision: 52901 URL:
http://svn.reactos.org/svn/reactos?rev=52901&view=rev
Log: [MSPAINT] * Introduce a PCH. * Fix Brush function declaration. Added: trunk/reactos/base/applications/mspaint/precomp.h (with props) Modified: trunk/reactos/base/applications/mspaint/CMakeLists.txt trunk/reactos/base/applications/mspaint/dialogs.c trunk/reactos/base/applications/mspaint/dib.c trunk/reactos/base/applications/mspaint/drawing.c trunk/reactos/base/applications/mspaint/drawing.h trunk/reactos/base/applications/mspaint/history.c trunk/reactos/base/applications/mspaint/main.c trunk/reactos/base/applications/mspaint/mouse.c trunk/reactos/base/applications/mspaint/palette.c trunk/reactos/base/applications/mspaint/registry.c trunk/reactos/base/applications/mspaint/selection.c trunk/reactos/base/applications/mspaint/sizebox.c trunk/reactos/base/applications/mspaint/toolsettings.c trunk/reactos/base/applications/mspaint/winproc.c Modified: trunk/reactos/base/applications/mspaint/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/…
============================================================================== --- trunk/reactos/base/applications/mspaint/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/base/applications/mspaint/CMakeLists.txt [iso-8859-1] Tue Jul 26 21:44:53 2011 @@ -17,5 +17,6 @@ rsrc.rc) set_module_type(mspaint win32gui) +add_pch(mspaint precomp.h) add_importlibs(mspaint comdlg32 shell32 user32 gdi32 advapi32 comctl32 msvcrt kernel32) add_cd_file(TARGET mspaint DESTINATION reactos/system32 FOR all) Modified: trunk/reactos/base/applications/mspaint/dialogs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/…
============================================================================== --- trunk/reactos/base/applications/mspaint/dialogs.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mspaint/dialogs.c [iso-8859-1] Tue Jul 26 21:44:53 2011 @@ -8,10 +8,7 @@ /* INCLUDES *********************************************************/ -#include <windows.h> -#include <tchar.h> -#include "definitions.h" -#include "globalvar.h" +#include "precomp.h" /* FUNCTIONS ********************************************************/ Modified: trunk/reactos/base/applications/mspaint/dib.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/…
============================================================================== --- trunk/reactos/base/applications/mspaint/dib.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mspaint/dib.c [iso-8859-1] Tue Jul 26 21:44:53 2011 @@ -8,7 +8,7 @@ /* INCLUDES *********************************************************/ -#include <windows.h> +#include "precomp.h" /* FUNCTIONS ********************************************************/ Modified: trunk/reactos/base/applications/mspaint/drawing.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/…
============================================================================== --- trunk/reactos/base/applications/mspaint/drawing.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mspaint/drawing.c [iso-8859-1] Tue Jul 26 21:44:53 2011 @@ -8,7 +8,7 @@ /* INCLUDES *********************************************************/ -#include <windows.h> +#include "precomp.h" /* FUNCTIONS ********************************************************/ Modified: trunk/reactos/base/applications/mspaint/drawing.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/…
============================================================================== --- trunk/reactos/base/applications/mspaint/drawing.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/mspaint/drawing.h [iso-8859-1] Tue Jul 26 21:44:53 2011 @@ -26,7 +26,7 @@ void Airbrush(HDC hdc, LONG x, LONG y, COLORREF color, LONG r); -void Brush(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF color, int style); +void Brush(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF color, COLORREF style); void RectSel(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2); Modified: trunk/reactos/base/applications/mspaint/history.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/…
============================================================================== --- trunk/reactos/base/applications/mspaint/history.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mspaint/history.c [iso-8859-1] Tue Jul 26 21:44:53 2011 @@ -8,10 +8,7 @@ /* INCLUDES *********************************************************/ -#include <windows.h> -#include "globalvar.h" -#include "dib.h" -#include "definitions.h" +#include "precomp.h" /* FUNCTIONS ********************************************************/ Modified: trunk/reactos/base/applications/mspaint/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/…
============================================================================== --- trunk/reactos/base/applications/mspaint/main.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mspaint/main.c [iso-8859-1] Tue Jul 26 21:44:53 2011 @@ -8,25 +8,7 @@ /* INCLUDES *********************************************************/ -#include <windows.h> -#include <windowsx.h> -#include <commctrl.h> -#include <stdio.h> -#include <tchar.h> -#include "definitions.h" - -#include "drawing.h" -#include "dib.h" - -#include "globalvar.h" -#include "history.h" -#include "mouse.h" - -#include "winproc.h" -#include "palette.h" -#include "toolsettings.h" -#include "selection.h" -#include "sizebox.h" +#include "precomp.h" /* FUNCTIONS ********************************************************/ Modified: trunk/reactos/base/applications/mspaint/mouse.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/…
============================================================================== --- trunk/reactos/base/applications/mspaint/mouse.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mspaint/mouse.c [iso-8859-1] Tue Jul 26 21:44:53 2011 @@ -8,10 +8,7 @@ /* INCLUDES *********************************************************/ -#include "globalvar.h" -#include "dib.h" -#include "drawing.h" -#include "history.h" +#include "precomp.h" /* FUNCTIONS ********************************************************/ Modified: trunk/reactos/base/applications/mspaint/palette.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/…
============================================================================== --- trunk/reactos/base/applications/mspaint/palette.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mspaint/palette.c [iso-8859-1] Tue Jul 26 21:44:53 2011 @@ -8,8 +8,7 @@ /* INCLUDES *********************************************************/ -#include <windows.h> -#include "globalvar.h" +#include "precomp.h" /* FUNCTIONS ********************************************************/ Added: trunk/reactos/base/applications/mspaint/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/…
============================================================================== --- trunk/reactos/base/applications/mspaint/precomp.h (added) +++ trunk/reactos/base/applications/mspaint/precomp.h [iso-8859-1] Tue Jul 26 21:44:53 2011 @@ -1,0 +1,20 @@ + +#include <windows.h> +#include <commctrl.h> +#include <tchar.h> +#include <windowsx.h> +#include <stdio.h> + +#include "definitions.h" +#include "drawing.h" +#include "dib.h" +#include "globalvar.h" +#include "history.h" +#include "mouse.h" +#include "winproc.h" +#include "palette.h" +#include "toolsettings.h" +#include "selection.h" +#include "sizebox.h" +#include "dialogs.h" +#include "registry.h" Propchange: trunk/reactos/base/applications/mspaint/precomp.h ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/base/applications/mspaint/registry.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/…
============================================================================== --- trunk/reactos/base/applications/mspaint/registry.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mspaint/registry.c [iso-8859-1] Tue Jul 26 21:44:53 2011 @@ -8,8 +8,7 @@ /* INCLUDES *********************************************************/ -#include <windows.h> -#include <tchar.h> +#include "precomp.h" /* FUNCTIONS ********************************************************/ Modified: trunk/reactos/base/applications/mspaint/selection.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/…
============================================================================== --- trunk/reactos/base/applications/mspaint/selection.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mspaint/selection.c [iso-8859-1] Tue Jul 26 21:44:53 2011 @@ -8,14 +8,7 @@ /* INCLUDES *********************************************************/ -#include <windows.h> -#include <commctrl.h> -#include <tchar.h> -#include "globalvar.h" -#include "drawing.h" -#include "history.h" -#include "mouse.h" -#include "dib.h" +#include "precomp.h" /* FUNCTIONS ********************************************************/ Modified: trunk/reactos/base/applications/mspaint/sizebox.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/…
============================================================================== --- trunk/reactos/base/applications/mspaint/sizebox.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mspaint/sizebox.c [iso-8859-1] Tue Jul 26 21:44:53 2011 @@ -8,11 +8,7 @@ /* INCLUDES *********************************************************/ -#include <windows.h> -#include <commctrl.h> -#include <tchar.h> -#include "globalvar.h" -#include "history.h" +#include "precomp.h" /* FUNCTIONS ********************************************************/ Modified: trunk/reactos/base/applications/mspaint/toolsettings.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/…
============================================================================== --- trunk/reactos/base/applications/mspaint/toolsettings.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mspaint/toolsettings.c [iso-8859-1] Tue Jul 26 21:44:53 2011 @@ -8,11 +8,7 @@ /* INCLUDES *********************************************************/ -#include <windows.h> -#include <commctrl.h> -#include "globalvar.h" -#include "drawing.h" -#include "winproc.h" +#include "precomp.h" /* FUNCTIONS ********************************************************/ Modified: trunk/reactos/base/applications/mspaint/winproc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/…
============================================================================== --- trunk/reactos/base/applications/mspaint/winproc.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mspaint/winproc.c [iso-8859-1] Tue Jul 26 21:44:53 2011 @@ -9,19 +9,8 @@ /* INCLUDES *********************************************************/ -#include <windows.h> -#include <commctrl.h> //#include <htmlhelp.h> -#include <stdio.h> -#include <tchar.h> -#include "definitions.h" -#include "globalvar.h" -#include "dialogs.h" -#include "dib.h" -#include "drawing.h" -#include "history.h" -#include "mouse.h" -#include "registry.h" +#include "precomp.h" /* FUNCTIONS ********************************************************/
13 years, 5 months
1
0
0
0
[cmihail] 52900: [lwIP] - Revert the timer hack. It's no longer needed for speed boosts. Now lwIP is clean of any foreign code.
by cmihail@svn.reactos.org
Author: cmihail Date: Tue Jul 26 19:29:57 2011 New Revision: 52900 URL:
http://svn.reactos.org/svn/reactos?rev=52900&view=rev
Log: [lwIP] - Revert the timer hack. It's no longer needed for speed boosts. Now lwIP is clean of any foreign code. Modified: branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/core/timers.c Modified: branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/core/timers.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/TcpIpDriver/lib/drive…
============================================================================== --- branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/core/timers.c [iso-8859-1] (original) +++ branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/core/timers.c [iso-8859-1] Tue Jul 26 19:29:57 2011 @@ -427,7 +427,7 @@ time_needed = sys_arch_mbox_fetch(mbox, msg, 0); } else { if (next_timeout->time > 0) { - time_needed = sys_arch_mbox_fetch(mbox, msg, 5);//next_timeout->time); + time_needed = sys_arch_mbox_fetch(mbox, msg, next_timeout->time); } else { time_needed = SYS_ARCH_TIMEOUT; }
13 years, 5 months
1
0
0
0
[ion] 52899: [KERNEL32]: Cleanup of virtual memory functions. [KERNEL32]: VirtualAllocEx should build a SEH frame. [KERNEL32]: VirtualAllocEx should make sure the address given is not lower than th...
by ion@svn.reactos.org
Author: ion Date: Tue Jul 26 14:33:22 2011 New Revision: 52899 URL:
http://svn.reactos.org/svn/reactos?rev=52899&view=rev
Log: [KERNEL32]: Cleanup of virtual memory functions. [KERNEL32]: VirtualAllocEx should build a SEH frame. [KERNEL32]: VirtualAllocEx should make sure the address given is not lower than the system's allocation granularity. Modified: trunk/reactos/dll/win32/kernel32/client/virtmem.c Modified: trunk/reactos/dll/win32/kernel32/client/virtmem.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/virtmem.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/virtmem.c [iso-8859-1] Tue Jul 26 14:33:22 2011 @@ -1,19 +1,19 @@ /* * PROJECT: ReactOS Win32 Base API * LICENSE: GPL - See COPYING in the top level directory - * FILE: dll/win32/kernel32/mem/virtual.c + * FILE: dll/win32/kernel32/client/virtmem.c * PURPOSE: Handles virtual memory APIs * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org) */ -/* INCLUDES ******************************************************************/ +/* INCLUDES *******************************************************************/ #include <k32.h> #define NDEBUG #include <debug.h> -/* FUNCTIONS *****************************************************************/ +/* FUNCTIONS ******************************************************************/ /* * @implemented @@ -27,14 +27,34 @@ IN DWORD flProtect) { NTSTATUS Status; - - /* Allocate the memory */ - Status = NtAllocateVirtualMemory(hProcess, - (PVOID *)&lpAddress, - 0, - &dwSize, - flAllocationType, - flProtect); + + /* Make sure the address is within the granularity of the system (64K) */ + if ((lpAddress) && + (lpAddress < (PVOID)BaseStaticServerData->SysInfo.AllocationGranularity)) + { + /* Fail the call */ + SetLastError(ERROR_INVALID_PARAMETER); + return NULL; + } + + /* Handle any possible exceptions */ + _SEH2_TRY + { + /* Allocate the memory */ + Status = NtAllocateVirtualMemory(hProcess, + &lpAddress, + 0, + &dwSize, + flAllocationType, + flProtect); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + + /* Check for status */ if (!NT_SUCCESS(Status)) { /* We failed */ @@ -76,12 +96,13 @@ { NTSTATUS Status; - if (dwSize == 0 || !(dwFreeType & MEM_RELEASE)) + /* Validate size and flags */ + if (!(dwSize) || !(dwFreeType & MEM_RELEASE)) { /* Free the memory */ Status = NtFreeVirtualMemory(hProcess, - (PVOID *)&lpAddress, - (PULONG)&dwSize, + &lpAddress, + &dwSize, dwFreeType); if (!NT_SUCCESS(Status)) { @@ -94,6 +115,7 @@ return TRUE; } + /* Invalid combo */ BaseSetLastNTError(STATUS_INVALID_PARAMETER); return FALSE; } @@ -270,14 +292,12 @@ */ UINT WINAPI -GetWriteWatch( - DWORD dwFlags, - PVOID lpBaseAddress, - SIZE_T dwRegionSize, - PVOID *lpAddresses, - PULONG_PTR lpdwCount, - PULONG lpdwGranularity - ) +GetWriteWatch(IN DWORD dwFlags, + IN PVOID lpBaseAddress, + IN SIZE_T dwRegionSize, + IN PVOID *lpAddresses, + OUT PULONG_PTR lpdwCount, + OUT PULONG lpdwGranularity) { NTSTATUS Status; @@ -288,7 +308,6 @@ lpAddresses, lpdwCount, lpdwGranularity); - if (!NT_SUCCESS(Status)) { BaseSetLastNTError(Status); @@ -303,17 +322,14 @@ */ UINT WINAPI -ResetWriteWatch( - LPVOID lpBaseAddress, - SIZE_T dwRegionSize - ) +ResetWriteWatch(IN LPVOID lpBaseAddress, + IN SIZE_T dwRegionSize) { NTSTATUS Status; Status = NtResetWriteWatch(NtCurrentProcess(), lpBaseAddress, dwRegionSize); - if (!NT_SUCCESS(Status)) { BaseSetLastNTError(Status); @@ -328,96 +344,78 @@ */ BOOL WINAPI -AllocateUserPhysicalPages( - HANDLE hProcess, - PULONG_PTR NumberOfPages, - PULONG_PTR UserPfnArray - ) -{ - NTSTATUS Status; - - Status = NtAllocateUserPhysicalPages(hProcess, - NumberOfPages, - UserPfnArray); - - if (!NT_SUCCESS(Status)) - { - BaseSetLastNTError(Status); - return FALSE; - } - - return TRUE; -} - -/* - * @implemented - */ -BOOL -WINAPI -FreeUserPhysicalPages( - HANDLE hProcess, - PULONG_PTR NumberOfPages, - PULONG_PTR PageArray - ) -{ - NTSTATUS Status; - - Status = NtFreeUserPhysicalPages(hProcess, - NumberOfPages, - PageArray); - - if (!NT_SUCCESS(Status)) - { - BaseSetLastNTError(Status); - return FALSE; - } - - return TRUE; -} - -/* - * @implemented - */ -BOOL -WINAPI -MapUserPhysicalPages( - PVOID VirtualAddress, - ULONG_PTR NumberOfPages, - PULONG_PTR PageArray OPTIONAL - ) -{ - NTSTATUS Status; - - Status = NtMapUserPhysicalPages(VirtualAddress, - NumberOfPages, - PageArray); - - if (!NT_SUCCESS(Status)) - { - BaseSetLastNTError(Status); - return FALSE; - } - - return TRUE; -} - -/* - * @implemented - */ -BOOL -WINAPI -MapUserPhysicalPagesScatter( - PVOID *VirtualAddresses, - ULONG_PTR NumberOfPages, - PULONG_PTR PageArray OPTIONAL - ) +AllocateUserPhysicalPages(IN HANDLE hProcess, + IN PULONG_PTR NumberOfPages, + OUT PULONG_PTR UserPfnArray) +{ + NTSTATUS Status; + + Status = NtAllocateUserPhysicalPages(hProcess, NumberOfPages, UserPfnArray); + if (!NT_SUCCESS(Status)) + { + BaseSetLastNTError(Status); + return FALSE; + } + + return TRUE; +} + +/* + * @implemented + */ +BOOL +WINAPI +FreeUserPhysicalPages(IN HANDLE hProcess, + IN PULONG_PTR NumberOfPages, + IN PULONG_PTR PageArray) +{ + NTSTATUS Status; + + Status = NtFreeUserPhysicalPages(hProcess, NumberOfPages, PageArray); + if (!NT_SUCCESS(Status)) + { + BaseSetLastNTError(Status); + return FALSE; + } + + return TRUE; +} + +/* + * @implemented + */ +BOOL +WINAPI +MapUserPhysicalPages(IN PVOID VirtualAddress, + IN ULONG_PTR NumberOfPages, + OUT PULONG_PTR PageArray OPTIONAL) +{ + NTSTATUS Status; + + Status = NtMapUserPhysicalPages(VirtualAddress, NumberOfPages, PageArray); + if (!NT_SUCCESS(Status)) + { + BaseSetLastNTError(Status); + return FALSE; + } + + return TRUE; +} + +/* + * @implemented + */ +BOOL +WINAPI +MapUserPhysicalPagesScatter(IN PVOID *VirtualAddresses, + IN ULONG_PTR NumberOfPages, + OUT PULONG_PTR PageArray OPTIONAL) { NTSTATUS Status; Status = NtMapUserPhysicalPagesScatter(VirtualAddresses, NumberOfPages, PageArray); - if (!NT_SUCCESS(Status)) { BaseSetLastNTError(Status);
13 years, 5 months
1
0
0
0
[ion] 52898: [KERNEL32]: Rewrite almost all the time APIs to do their own conversions instead of calling other APIs (which sometimes have slightly different checks). [KERNEL32]: Add support for ter...
by ion@svn.reactos.org
Author: ion Date: Tue Jul 26 14:05:30 2011 New Revision: 52898 URL:
http://svn.reactos.org/svn/reactos?rev=52898&view=rev
Log: [KERNEL32]: Rewrite almost all the time APIs to do their own conversions instead of calling other APIs (which sometimes have slightly different checks). [KERNEL32]: Add support for terminal services timezone redirection (one more for GedMurphy's pipe dream) in all the time functions. [KERNEL32]: Make the time functions acquire SE_SYSTEMTIME_PRIVILEGE when needed (and release it). [KERNEL32]: Fix the DOS time conversion routines. [KERNEL32]: Add missing validations to some time functions. [KERNEL32]: Implement IsTimeZoneRedirectionEnabled. [KERNEL32]: Reimplement GetSystemTimes to support MP, and treat parameters as optional. Modified: trunk/reactos/dll/win32/kernel32/client/time.c Modified: trunk/reactos/dll/win32/kernel32/client/time.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/time.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/time.c [iso-8859-1] Tue Jul 26 14:05:30 2011 @@ -10,29 +10,13 @@ * Created 19/01/99 */ -/* INCLUDES ******************************************************************/ +/* INCLUDES *******************************************************************/ #include <k32.h> #define NDEBUG #include <debug.h> -/* TYPES *********************************************************************/ - -typedef struct __DOSTIME -{ - WORD Second:5; - WORD Minute:6; - WORD Hour:5; -} DOSTIME, *PDOSTIME; - -typedef struct __DOSDATE -{ - WORD Day:5; - WORD Month:4; - WORD Year:5; -} DOSDATE, *PDOSDATE; - /* FUNCTIONS ******************************************************************/ /* @@ -40,114 +24,130 @@ */ BOOL WINAPI -FileTimeToDosDateTime(CONST FILETIME *lpFileTime, - LPWORD lpFatDate, - LPWORD lpFatTime) -{ - PDOSTIME pdtime=(PDOSTIME) lpFatTime; - PDOSDATE pddate=(PDOSDATE) lpFatDate; - SYSTEMTIME SystemTime = { 0, 0, 0, 0, 0, 0, 0, 0 }; - - if (lpFileTime == NULL) - return FALSE; - - if (lpFatDate == NULL) - return FALSE; - - if (lpFatTime == NULL) - return FALSE; - - FileTimeToSystemTime(lpFileTime, &SystemTime); - - pdtime->Second = SystemTime.wSecond / 2; - pdtime->Minute = SystemTime.wMinute; - pdtime->Hour = SystemTime.wHour; - - pddate->Day = SystemTime.wDay; - pddate->Month = SystemTime.wMonth; - pddate->Year = SystemTime.wYear - 1980; - - return TRUE; -} - - -/* - * @implemented - */ -BOOL -WINAPI -DosDateTimeToFileTime(WORD wFatDate, - WORD wFatTime, - LPFILETIME lpFileTime) -{ - PDOSTIME pdtime = (PDOSTIME) &wFatTime; - PDOSDATE pddate = (PDOSDATE) &wFatDate; - SYSTEMTIME SystemTime; - - if (lpFileTime == NULL) - return FALSE; - - SystemTime.wMilliseconds = 0; - SystemTime.wSecond = pdtime->Second * 2; - SystemTime.wMinute = pdtime->Minute; - SystemTime.wHour = pdtime->Hour; - - SystemTime.wDay = pddate->Day; - SystemTime.wMonth = pddate->Month; - SystemTime.wYear = 1980 + pddate->Year; - - if (SystemTimeToFileTime(&SystemTime, lpFileTime) == FALSE) - { - return FALSE; - } - - return TRUE; -} - +IsTimeZoneRedirectionEnabled(VOID) +{ + /* Return if a TS Timezone ID is active */ + return (BaseStaticServerData->TermsrvClientTimeZoneId != TIME_ZONE_ID_INVALID); +} + +/* + * @implemented + */ +BOOL +WINAPI +FileTimeToDosDateTime(IN CONST FILETIME *lpFileTime, + OUT LPWORD lpFatDate, + OUT LPWORD lpFatTime) +{ + LARGE_INTEGER FileTime; + TIME_FIELDS TimeFields; + + FileTime.HighPart = lpFileTime->dwHighDateTime; + FileTime.LowPart = lpFileTime->dwLowDateTime; + + if (FileTime.QuadPart < 0) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + RtlTimeToTimeFields(&FileTime, &TimeFields); + if ((TimeFields.Year < 1980) || (TimeFields.Year > 2107)) + { + BaseSetLastNTError(STATUS_INVALID_PARAMETER); + return FALSE; + } + + *lpFatDate = (TimeFields.Day) | + (TimeFields.Month << 5) | + ((TimeFields.Year - 1980) << 9); + *lpFatTime = (TimeFields.Second >> 1) | + (TimeFields.Minute << 5) | + (TimeFields.Hour << 16); + + return TRUE; +} + +/* + * @implemented + */ +BOOL +WINAPI +DosDateTimeToFileTime(IN WORD wFatDate, + IN WORD wFatTime, + OUT LPFILETIME lpFileTime) +{ + TIME_FIELDS TimeFields; + LARGE_INTEGER SystemTime; + + TimeFields.Year = (wFatDate >> 9) + 1980; + TimeFields.Month = (wFatDate >> 5) & 0xF; + TimeFields.Day = (wFatDate & 0x1F); + TimeFields.Hour = (wFatTime >> 11); + TimeFields.Minute = (wFatTime >> 5) & 0x3F; + TimeFields.Second = (wFatTime & 0x1F) << 1; + TimeFields.Milliseconds = 0; + + if (RtlTimeFieldsToTime(&TimeFields, &SystemTime)) + { + lpFileTime->dwLowDateTime = SystemTime.LowPart; + lpFileTime->dwHighDateTime = SystemTime.HighPart; + return TRUE; + } + + BaseSetLastNTError(STATUS_INVALID_PARAMETER); + return FALSE; +} /* * @implemented */ LONG WINAPI -CompareFileTime(CONST FILETIME *lpFileTime1, CONST FILETIME *lpFileTime2) -{ - if (lpFileTime1 == NULL) - return 0; - if (lpFileTime2 == NULL) - return 0; - - if (*((PLONGLONG)lpFileTime1) > *((PLONGLONG)lpFileTime2)) - return 1; - else if (*((PLONGLONG)lpFileTime1) < *((PLONGLONG)lpFileTime2)) - return -1; - - return 0; -} - +CompareFileTime(IN CONST FILETIME *lpFileTime1, + IN CONST FILETIME *lpFileTime2) +{ + LARGE_INTEGER Time1, Time2, Diff; + + Time1.LowPart = lpFileTime1->dwLowDateTime; + Time2.LowPart = lpFileTime2->dwLowDateTime; + Time1.HighPart = lpFileTime1->dwHighDateTime; + Time2.HighPart = lpFileTime2->dwHighDateTime; + + Diff.QuadPart = Time1.QuadPart - Time2.QuadPart; + + if (Diff.HighPart < 0) return -1; + if (Diff.QuadPart == 0) return 0; + return 1; +} /* * @implemented */ VOID WINAPI -GetSystemTimeAsFileTime(PFILETIME lpFileTime) -{ +GetSystemTimeAsFileTime(OUT PFILETIME lpFileTime) +{ + LARGE_INTEGER SystemTime; + do { - lpFileTime->dwHighDateTime = SharedUserData->SystemTime.High1Time; - lpFileTime->dwLowDateTime = SharedUserData->SystemTime.LowPart; - } - while (lpFileTime->dwHighDateTime != (DWORD)SharedUserData->SystemTime.High2Time); -} - - -/* - * @implemented - */ -BOOL -WINAPI -SystemTimeToFileTime(CONST SYSTEMTIME *lpSystemTime, LPFILETIME lpFileTime) + SystemTime.HighPart = SharedUserData->SystemTime.High1Time; + SystemTime.LowPart = SharedUserData->SystemTime.LowPart; + } + while (SystemTime.HighPart != SharedUserData->SystemTime.High2Time); + + lpFileTime->dwLowDateTime = SystemTime.LowPart; + lpFileTime->dwHighDateTime = SystemTime.HighPart; +} + +/* + * @implemented + */ +BOOL +WINAPI +SystemTimeToFileTime(IN CONST SYSTEMTIME *lpSystemTime, + OUT LPFILETIME lpFileTime) { TIME_FIELDS TimeFields; LARGE_INTEGER liTime; @@ -160,33 +160,35 @@ TimeFields.Second = lpSystemTime->wSecond; TimeFields.Milliseconds = lpSystemTime->wMilliseconds; - if (RtlTimeFieldsToTime (&TimeFields, &liTime)) + if (RtlTimeFieldsToTime(&TimeFields, &liTime)) { lpFileTime->dwLowDateTime = liTime.u.LowPart; lpFileTime->dwHighDateTime = liTime.u.HighPart; return TRUE; } - SetLastError(ERROR_INVALID_PARAMETER); + BaseSetLastNTError(STATUS_INVALID_PARAMETER); return FALSE; } - -/* - * @implemented - */ -BOOL -WINAPI -FileTimeToSystemTime(CONST FILETIME *lpFileTime, LPSYSTEMTIME lpSystemTime) +/* + * @implemented + */ +BOOL +WINAPI +FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, + OUT LPSYSTEMTIME lpSystemTime) { TIME_FIELDS TimeFields; LARGE_INTEGER liTime; - - if (lpFileTime->dwHighDateTime & 0x80000000) - return FALSE; liTime.u.LowPart = lpFileTime->dwLowDateTime; liTime.u.HighPart = lpFileTime->dwHighDateTime; + if (liTime.QuadPart < 0) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } RtlTimeToTimeFields(&liTime, &TimeFields); @@ -202,115 +204,237 @@ return TRUE; } - -/* - * @implemented - */ -BOOL -WINAPI -FileTimeToLocalFileTime(CONST FILETIME *lpFileTime, LPFILETIME lpLocalFileTime) -{ - LARGE_INTEGER TimeZoneBias; - +/* + * @implemented + */ +BOOL +WINAPI +FileTimeToLocalFileTime(IN CONST FILETIME *lpFileTime, + OUT LPFILETIME lpLocalFileTime) +{ + LARGE_INTEGER TimeZoneBias, FileTime; + volatile KSYSTEM_TIME *TimePtr; + + TimePtr = IsTimeZoneRedirectionEnabled() ? + &BaseStaticServerData->ktTermsrvClientBias : + &SharedUserData->TimeZoneBias; do { - TimeZoneBias.HighPart = SharedUserData->TimeZoneBias.High1Time; - TimeZoneBias.LowPart = SharedUserData->TimeZoneBias.LowPart; - } - while (TimeZoneBias.HighPart != SharedUserData->TimeZoneBias.High2Time); - - *((PLONGLONG)lpLocalFileTime) = *((PLONGLONG)lpFileTime) - TimeZoneBias.QuadPart; - - return TRUE; -} - - -/* - * @implemented - */ -BOOL -WINAPI -LocalFileTimeToFileTime(CONST FILETIME *lpLocalFileTime, LPFILETIME lpFileTime) -{ - LARGE_INTEGER TimeZoneBias; + TimeZoneBias.HighPart = TimePtr->High1Time; + TimeZoneBias.LowPart = TimePtr->LowPart; + } + while (TimeZoneBias.HighPart != TimePtr->High2Time); + + FileTime.LowPart = lpFileTime->dwLowDateTime; + FileTime.HighPart = lpFileTime->dwHighDateTime; + + FileTime.QuadPart -= TimeZoneBias.QuadPart; + + lpLocalFileTime->dwLowDateTime = FileTime.LowPart; + lpLocalFileTime->dwHighDateTime = FileTime.HighPart; + + return TRUE; +} + +/* + * @implemented + */ +BOOL +WINAPI +LocalFileTimeToFileTime(IN CONST FILETIME *lpLocalFileTime, + OUT LPFILETIME lpFileTime) +{ + LARGE_INTEGER TimeZoneBias, FileTime; + volatile KSYSTEM_TIME *TimePtr; + + TimePtr = IsTimeZoneRedirectionEnabled() ? + &BaseStaticServerData->ktTermsrvClientBias : + &SharedUserData->TimeZoneBias; do { - TimeZoneBias.HighPart = SharedUserData->TimeZoneBias.High1Time; - TimeZoneBias.LowPart = SharedUserData->TimeZoneBias.LowPart; - } - while (TimeZoneBias.HighPart != SharedUserData->TimeZoneBias.High2Time); - - *((PLONGLONG)lpFileTime) = *((PLONGLONG)lpLocalFileTime) + TimeZoneBias.QuadPart; - - return TRUE; -} - + TimeZoneBias.HighPart = TimePtr->High1Time; + TimeZoneBias.LowPart = TimePtr->LowPart; + } + while (TimeZoneBias.HighPart != TimePtr->High2Time); + + FileTime.LowPart = lpLocalFileTime->dwLowDateTime; + FileTime.HighPart = lpLocalFileTime->dwHighDateTime; + + FileTime.QuadPart += TimeZoneBias.QuadPart; + + lpFileTime->dwLowDateTime = FileTime.LowPart; + lpFileTime->dwHighDateTime = FileTime.HighPart; + + return TRUE; +} /* * @implemented */ VOID WINAPI -GetLocalTime(LPSYSTEMTIME lpSystemTime) -{ - FILETIME FileTime; - FILETIME LocalFileTime; - - GetSystemTimeAsFileTime(&FileTime); - FileTimeToLocalFileTime(&FileTime, &LocalFileTime); - FileTimeToSystemTime(&LocalFileTime, lpSystemTime); -} - +GetLocalTime(OUT LPSYSTEMTIME lpSystemTime) +{ + LARGE_INTEGER SystemTime, TimeZoneBias; + TIME_FIELDS TimeFields; + volatile KSYSTEM_TIME *TimePtr; + + do + { + SystemTime.HighPart = SharedUserData->SystemTime.High1Time; + SystemTime.LowPart = SharedUserData->SystemTime.LowPart; + } + while (SystemTime.HighPart != SharedUserData->SystemTime.High2Time); + + TimePtr = IsTimeZoneRedirectionEnabled() ? + &BaseStaticServerData->ktTermsrvClientBias : + &SharedUserData->TimeZoneBias; + do + { + TimeZoneBias.HighPart = TimePtr->High1Time; + TimeZoneBias.LowPart = TimePtr->LowPart; + } + while (TimeZoneBias.HighPart != TimePtr->High2Time); + + SystemTime.QuadPart -= TimeZoneBias.QuadPart; + RtlTimeToTimeFields(&SystemTime, &TimeFields); + + lpSystemTime->wYear = TimeFields.Year; + lpSystemTime->wMonth = TimeFields.Month; + lpSystemTime->wDay = TimeFields.Day; + lpSystemTime->wHour = TimeFields.Hour; + lpSystemTime->wMinute = TimeFields.Minute; + lpSystemTime->wSecond = TimeFields.Second; + lpSystemTime->wMilliseconds = TimeFields.Milliseconds; + lpSystemTime->wDayOfWeek = TimeFields.Weekday; +} /* * @implemented */ VOID WINAPI -GetSystemTime(LPSYSTEMTIME lpSystemTime) -{ - FILETIME FileTime; - - GetSystemTimeAsFileTime(&FileTime); - FileTimeToSystemTime(&FileTime, lpSystemTime); -} - - -/* - * @implemented - */ -BOOL -WINAPI -SetLocalTime(CONST SYSTEMTIME *lpSystemTime) -{ - FILETIME LocalFileTime; - LARGE_INTEGER FileTime; +GetSystemTime(OUT LPSYSTEMTIME lpSystemTime) +{ + LARGE_INTEGER SystemTime; + TIME_FIELDS TimeFields; + + do + { + SystemTime.HighPart = SharedUserData->SystemTime.High1Time; + SystemTime.LowPart = SharedUserData->SystemTime.LowPart; + } + while (SystemTime.HighPart != SharedUserData->SystemTime.High2Time); + + RtlTimeToTimeFields(&SystemTime, &TimeFields); + + lpSystemTime->wYear = TimeFields.Year; + lpSystemTime->wMonth = TimeFields.Month; + lpSystemTime->wDay = TimeFields.Day; + lpSystemTime->wHour = TimeFields.Hour; + lpSystemTime->wMinute = TimeFields.Minute; + lpSystemTime->wSecond = TimeFields.Second; + lpSystemTime->wMilliseconds = TimeFields.Milliseconds; + lpSystemTime->wDayOfWeek = TimeFields.Weekday; +} + +/* + * @implemented + */ +BOOL +WINAPI +SetLocalTime(IN CONST SYSTEMTIME *lpSystemTime) +{ + LARGE_INTEGER NewSystemTime, TimeZoneBias; NTSTATUS Status; - - SystemTimeToFileTime(lpSystemTime, &LocalFileTime); - LocalFileTimeToFileTime(&LocalFileTime, (FILETIME *)&FileTime); - Status = NtSetSystemTime(&FileTime, &FileTime); + ULONG Privilege = SE_SYSTEMTIME_PRIVILEGE; + TIME_FIELDS TimeFields; + PVOID State; + volatile KSYSTEM_TIME *TimePtr; + + TimePtr = IsTimeZoneRedirectionEnabled() ? + &BaseStaticServerData->ktTermsrvClientBias : + &SharedUserData->TimeZoneBias; + do + { + TimeZoneBias.HighPart = TimePtr->High1Time; + TimeZoneBias.LowPart = TimePtr->LowPart; + } + while (TimeZoneBias.HighPart != TimePtr->High2Time); + + TimeFields.Year = lpSystemTime->wYear; + TimeFields.Month = lpSystemTime->wMonth; + TimeFields.Day = lpSystemTime->wDay; + TimeFields.Hour = lpSystemTime->wHour; + TimeFields.Minute = lpSystemTime->wMinute; + TimeFields.Second = lpSystemTime->wSecond; + TimeFields.Milliseconds = lpSystemTime->wMilliseconds; + + if (!RtlTimeFieldsToTime(&TimeFields, &NewSystemTime)) + { + BaseSetLastNTError(STATUS_INVALID_PARAMETER); + return FALSE; + } + + NewSystemTime.QuadPart += TimeZoneBias.QuadPart; + + Status = RtlAcquirePrivilege(&Privilege, 1, 0, &State); + if (NT_SUCCESS(Status)) + { + Status = NtSetSystemTime(&NewSystemTime, NULL); + RtlReleasePrivilege(State); + } + if (!NT_SUCCESS(Status)) - return FALSE; - return TRUE; -} - - -/* - * @implemented - */ -BOOL -WINAPI -SetSystemTime(CONST SYSTEMTIME *lpSystemTime) + { + BaseSetLastNTError(Status); + return FALSE; + } + + return TRUE; +} + +/* + * @implemented + */ +BOOL +WINAPI +SetSystemTime(IN CONST SYSTEMTIME *lpSystemTime) { LARGE_INTEGER NewSystemTime; NTSTATUS Status; - - SystemTimeToFileTime(lpSystemTime, (PFILETIME)&NewSystemTime); - Status = NtSetSystemTime(&NewSystemTime, &NewSystemTime); + ULONG Privilege = SE_SYSTEMTIME_PRIVILEGE; + TIME_FIELDS TimeFields; + PVOID State; + + TimeFields.Year = lpSystemTime->wYear; + TimeFields.Month = lpSystemTime->wMonth; + TimeFields.Day = lpSystemTime->wDay; + TimeFields.Hour = lpSystemTime->wHour; + TimeFields.Minute = lpSystemTime->wMinute; + TimeFields.Second = lpSystemTime->wSecond; + TimeFields.Milliseconds = lpSystemTime->wMilliseconds; + + if (!RtlTimeFieldsToTime(&TimeFields, &NewSystemTime)) + { + BaseSetLastNTError(STATUS_INVALID_PARAMETER); + return FALSE; + } + + Status = RtlAcquirePrivilege(&Privilege, 1, 0, &State); + if (NT_SUCCESS(Status)) + { + Status = NtSetSystemTime(&NewSystemTime, NULL); + RtlReleasePrivilege(State); + } + if (!NT_SUCCESS(Status)) - return FALSE; + { + BaseSetLastNTError(Status); + return FALSE; + } + return TRUE; } @@ -334,9 +458,147 @@ YieldProcessor(); } - return (ULONG)((UInt32x32To64(TickCount.LowPart, SharedUserData->TickCountMultiplier) >> 24) + - UInt32x32To64((TickCount.HighPart << 8) & 0xFFFFFFFF, SharedUserData->TickCountMultiplier)); - + return (ULONG)((UInt32x32To64(TickCount.LowPart, + SharedUserData->TickCountMultiplier) >> 24) + + UInt32x32To64((TickCount.HighPart << 8) & 0xFFFFFFFF, + SharedUserData->TickCountMultiplier)); + +} + +/* + * @implemented + */ +BOOL +WINAPI +GetSystemTimeAdjustment(OUT PDWORD lpTimeAdjustment, + OUT PDWORD lpTimeIncrement, + OUT PBOOL lpTimeAdjustmentDisabled) +{ + SYSTEM_QUERY_TIME_ADJUST_INFORMATION TimeInfo; + NTSTATUS Status; + + Status = NtQuerySystemInformation(SystemTimeAdjustmentInformation, + &TimeInfo, + sizeof(TimeInfo), + NULL); + if (!NT_SUCCESS(Status)) + { + BaseSetLastNTError(Status); + return FALSE; + } + + *lpTimeAdjustment = (DWORD)TimeInfo.TimeAdjustment; + *lpTimeIncrement = (DWORD)TimeInfo.TimeIncrement; + *lpTimeAdjustmentDisabled = (BOOL)TimeInfo.Enable; + + return TRUE; +} + +/* + * @implemented + */ +BOOL +WINAPI +SetSystemTimeAdjustment(IN DWORD dwTimeAdjustment, + IN BOOL bTimeAdjustmentDisabled) +{ + NTSTATUS Status; + SYSTEM_SET_TIME_ADJUST_INFORMATION TimeInfo; + + TimeInfo.TimeAdjustment = (ULONG)dwTimeAdjustment; + TimeInfo.Enable = (BOOLEAN)bTimeAdjustmentDisabled; + + Status = NtSetSystemInformation(SystemTimeAdjustmentInformation, + &TimeInfo, + sizeof(TimeInfo)); + if (!NT_SUCCESS(Status)) + { + BaseSetLastNTError(Status); + return FALSE; + } + + return TRUE; +} + +/* + * @implemented + */ +BOOL +WINAPI +GetSystemTimes(OUT LPFILETIME lpIdleTime OPTIONAL, + OUT LPFILETIME lpKernelTime OPTIONAL, + OUT LPFILETIME lpUserTime OPTIONAL) +{ + PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION ProcPerfInfo; + LARGE_INTEGER TotalUserTime, TotalKernTime, TotalIdleTime; + SIZE_T BufferSize, ReturnLength; + ULONG i; + NTSTATUS Status; + + TotalUserTime.QuadPart = TotalKernTime.QuadPart = TotalIdleTime.QuadPart = 0; + + BufferSize = sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) * + BaseStaticServerData->SysInfo.NumberOfProcessors; + + ProcPerfInfo = RtlAllocateHeap(RtlGetProcessHeap(), 0, BufferSize); + if (!ProcPerfInfo) + { + BaseSetLastNTError(STATUS_NO_MEMORY); + return FALSE; + } + + Status = ZwQuerySystemInformation(SystemProcessorPerformanceInformation, + ProcPerfInfo, + BufferSize, + &ReturnLength); + if ((NT_SUCCESS(Status)) && (ReturnLength == BufferSize)) + { + if (lpIdleTime) + { + for (i = 0; i < BaseStaticServerData->SysInfo.NumberOfProcessors; i++) + { + TotalIdleTime.QuadPart += ProcPerfInfo[i].IdleTime.QuadPart; + } + + lpIdleTime->dwLowDateTime = TotalIdleTime.LowPart; + lpIdleTime->dwHighDateTime = TotalIdleTime.HighPart; + } + + if (lpKernelTime) + { + for (i = 0; i < BaseStaticServerData->SysInfo.NumberOfProcessors; i++) + { + TotalKernTime.QuadPart += ProcPerfInfo[i].KernelTime.QuadPart; + } + + lpKernelTime->dwLowDateTime = TotalKernTime.LowPart; + lpKernelTime->dwHighDateTime = TotalKernTime.HighPart; + } + + if (lpUserTime) + { + for (i = 0; i < BaseStaticServerData->SysInfo.NumberOfProcessors; i++) + { + TotalUserTime.QuadPart += ProcPerfInfo[i].UserTime.QuadPart; + } + + lpUserTime->dwLowDateTime = TotalUserTime.LowPart; + lpUserTime->dwHighDateTime = TotalUserTime.HighPart; + } + } + else if (NT_SUCCESS(Status)) + { + Status = STATUS_INTERNAL_ERROR; + } + + RtlFreeHeap(RtlGetProcessHeap(), 0, ProcPerfInfo); + if (!NT_SUCCESS(Status)) + { + BaseSetLastNTError(Status); + return FALSE; + } + + return TRUE; } /* @@ -344,118 +606,10 @@ */ BOOL WINAPI -SetClientTimeZoneInformation( - CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation) +SetClientTimeZoneInformation(IN CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation) { STUB; return 0; } -/* - * @implemented - */ -BOOL -WINAPI -GetSystemTimeAdjustment(PDWORD lpTimeAdjustment, - PDWORD lpTimeIncrement, - PBOOL lpTimeAdjustmentDisabled) -{ - SYSTEM_QUERY_TIME_ADJUST_INFORMATION Buffer; - NTSTATUS Status; - - Status = NtQuerySystemInformation(SystemTimeAdjustmentInformation, - &Buffer, - sizeof(SYSTEM_QUERY_TIME_ADJUST_INFORMATION), - NULL); - if (!NT_SUCCESS(Status)) - { - BaseSetLastNTError(Status); - return FALSE; - } - - *lpTimeAdjustment = (DWORD)Buffer.TimeAdjustment; - *lpTimeIncrement = (DWORD)Buffer.TimeIncrement; - *lpTimeAdjustmentDisabled = (BOOL)Buffer.Enable; - - return TRUE; -} - - -/* - * @implemented - */ -BOOL -WINAPI -SetSystemTimeAdjustment(DWORD dwTimeAdjustment, - BOOL bTimeAdjustmentDisabled) -{ - NTSTATUS Status; - SYSTEM_SET_TIME_ADJUST_INFORMATION Buffer; - - Buffer.TimeAdjustment = (ULONG)dwTimeAdjustment; - Buffer.Enable = (BOOLEAN)bTimeAdjustmentDisabled; - - Status = NtSetSystemInformation(SystemTimeAdjustmentInformation, - &Buffer, - sizeof(SYSTEM_SET_TIME_ADJUST_INFORMATION)); - if (!NT_SUCCESS(Status)) - { - BaseSetLastNTError(Status); - return FALSE; - } - - return TRUE; -} - - -/* - * @implemented - */ -BOOL -WINAPI -GetSystemTimes(LPFILETIME lpIdleTime, - LPFILETIME lpKernelTime, - LPFILETIME lpUserTime) -{ - SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION SysProcPerfInfo; - NTSTATUS Status; - - Status = ZwQuerySystemInformation(SystemProcessorPerformanceInformation, - &SysProcPerfInfo, - sizeof(SysProcPerfInfo), - NULL); - - if (!NT_SUCCESS(Status)) - { - BaseSetLastNTError(Status); - return FALSE; - } -/* - Good only for one processor system. - */ - - lpIdleTime->dwLowDateTime = SysProcPerfInfo.IdleTime.LowPart; - lpIdleTime->dwHighDateTime = SysProcPerfInfo.IdleTime.HighPart; - - lpKernelTime->dwLowDateTime = SysProcPerfInfo.KernelTime.LowPart; - lpKernelTime->dwHighDateTime = SysProcPerfInfo.KernelTime.HighPart; - - lpUserTime->dwLowDateTime = SysProcPerfInfo.UserTime.LowPart; - lpUserTime->dwHighDateTime = SysProcPerfInfo.UserTime.HighPart; - - return TRUE; -} - -/* - * @implemented - */ -BOOL -WINAPI -IsTimeZoneRedirectionEnabled(VOID) -{ - /* To be implemented soon */ - //return (BaseStaticServerData->TermsrvClientTimeZoneId != TIME_ZONE_ID_INVALID); - return FALSE; -} - /* EOF */
13 years, 5 months
1
0
0
0
[tkreuzer] 52897: [NTOSKRNL] - Inline KeDisableInterrupts - Make ExInterlocked* functions portable
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Jul 26 14:00:08 2011 New Revision: 52897 URL:
http://svn.reactos.org/svn/reactos?rev=52897&view=rev
Log: [NTOSKRNL] - Inline KeDisableInterrupts - Make ExInterlocked* functions portable Added: trunk/reactos/ntoskrnl/ex/interlocked.c - copied, changed from r52875, trunk/reactos/ntoskrnl/ex/i386/interlocked.c Removed: trunk/reactos/ntoskrnl/ex/amd64/ trunk/reactos/ntoskrnl/ex/fastinterlck.c trunk/reactos/ntoskrnl/ex/i386/interlocked.c Modified: trunk/reactos/ntoskrnl/CMakeLists.txt trunk/reactos/ntoskrnl/include/internal/amd64/ke.h trunk/reactos/ntoskrnl/include/internal/arm/ke.h trunk/reactos/ntoskrnl/include/internal/i386/ke.h trunk/reactos/ntoskrnl/include/internal/ke.h trunk/reactos/ntoskrnl/ke/arm/cpu.c trunk/reactos/ntoskrnl/ke/i386/cpu.c trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild Modified: trunk/reactos/ntoskrnl/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/CMakeLists.txt?re…
============================================================================== --- trunk/reactos/ntoskrnl/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/CMakeLists.txt [iso-8859-1] Tue Jul 26 14:00:08 2011 @@ -83,12 +83,12 @@ ex/event.c ex/evtpair.c ex/exintrin.c - ex/fastinterlck.c ex/fmutex.c ex/handle.c ex/harderr.c ex/hdlsterm.c ex/init.c + ex/interlocked.c ex/keyedevt.c ex/locale.c ex/lookas.c @@ -277,7 +277,6 @@ list(APPEND SOURCE config/i386/cmhardwr.c ex/i386/fastinterlck_asm.S - ex/i386/interlocked.c ex/i386/ioport.S ke/i386/abios.c ke/i386/cpu.c @@ -305,7 +304,6 @@ elseif(ARCH MATCHES amd64) list(APPEND SOURCE config/i386/cmhardwr.c - ex/amd64/fastinterlck.c ke/amd64/boot.S ke/amd64/context.c ke/amd64/cpu.c Removed: trunk/reactos/ntoskrnl/ex/fastinterlck.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/fastinterlck.c…
============================================================================== --- trunk/reactos/ntoskrnl/ex/fastinterlck.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/fastinterlck.c (removed) @@ -1,460 +1,0 @@ -/* - * PROJECT: ReactOS Kernel - * LICENSE: BSD - See COPYING.ARM in the top level directory - * FILE: ntoskrnl/ex/fastinterlck.c - * PURPOSE: Portable Ex*Interlocked and REGISTER routines for non-x86 - * PROGRAMMERS: ReactOS Portable Systems Group - */ - -/* INCLUDES *******************************************************************/ - -#if defined(_ARM_) || defined(_PPC_) || defined(NTOS_USE_GENERICS) - -#include <ntoskrnl.h> -#define NDEBUG -#include <debug.h> - -#undef ExInterlockedPushEntrySList -#undef ExInterlockedPopEntrySList -#undef ExInterlockedAddULong -#undef ExInterlockedIncrementLong -#undef ExInterlockedDecrementLong -#undef ExInterlockedAddLargeStatistic - -/* FUNCTIONS ******************************************************************/ - -PSLIST_ENTRY -NTAPI -InterlockedPushEntrySList(IN PSLIST_HEADER ListHead, - IN PSLIST_ENTRY ListEntry) -{ - - PSINGLE_LIST_ENTRY FirstEntry, NextEntry; - PSINGLE_LIST_ENTRY Entry = (PVOID)ListEntry, Head = (PVOID)ListHead; - - FirstEntry = Head->Next; - do - { - Entry->Next = FirstEntry; - NextEntry = FirstEntry; - FirstEntry = (PVOID)_InterlockedCompareExchange((PLONG)Head, - (LONG)Entry, - (LONG)FirstEntry); - } while (FirstEntry != NextEntry); - - return FirstEntry; -} - -PSLIST_ENTRY -NTAPI -InterlockedPopEntrySList(IN PSLIST_HEADER ListHead) -{ - PSINGLE_LIST_ENTRY FirstEntry, NextEntry, Head = (PVOID)ListHead; - - FirstEntry = Head->Next; - do - { - if (!FirstEntry) return NULL; - - NextEntry = FirstEntry; - FirstEntry = (PVOID)_InterlockedCompareExchange((PLONG)Head, - (LONG)FirstEntry->Next, - (LONG)FirstEntry); - } while (FirstEntry != NextEntry); - - return FirstEntry; -} - -PSINGLE_LIST_ENTRY -FASTCALL -ExInterlockedFlushSList(IN PSLIST_HEADER ListHead) -{ - return (PVOID)_InterlockedExchange((PLONG)&ListHead->Next.Next, (LONG)NULL); -} - -PSLIST_ENTRY -FASTCALL -ExInterlockedPushEntrySList(IN PSLIST_HEADER ListHead, - IN PSLIST_ENTRY ListEntry, - IN PKSPIN_LOCK Lock) -{ - return InterlockedPushEntrySList(ListHead, ListEntry); -} - -PSINGLE_LIST_ENTRY -NTAPI -ExInterlockedPopEntrySList(IN PSLIST_HEADER ListHead, - IN PKSPIN_LOCK Lock) -{ - return InterlockedPopEntrySList(ListHead); -} - -ULONG -FASTCALL -ExfInterlockedAddUlong(IN PULONG Addend, - IN ULONG Increment, - PKSPIN_LOCK Lock) -{ - KIRQL OldIrql; - KeAcquireSpinLock(Lock, &OldIrql); - *Addend += Increment; - KeReleaseSpinLock(Lock, OldIrql); - return *Addend; -} - -LONGLONG -FASTCALL -ExfInterlockedCompareExchange64(IN OUT LONGLONG volatile *Destination, - IN PLONGLONG Exchange, - IN PLONGLONG Comparand) -{ - LONGLONG Result; - - Result = *Destination; - if (*Destination == *Comparand) *Destination = *Exchange; - return Result; -} - -PLIST_ENTRY -FASTCALL -ExfInterlockedInsertHeadList(IN PLIST_ENTRY ListHead, - IN PLIST_ENTRY ListEntry, - IN PKSPIN_LOCK Lock) -{ - KIRQL OldIrql; - PLIST_ENTRY OldHead = NULL; - KeAcquireSpinLock(Lock, &OldIrql); - if (!IsListEmpty(ListHead)) OldHead = ListEntry->Flink; - InsertHeadList(ListHead, ListEntry); - KeReleaseSpinLock(Lock, OldIrql); - return OldHead; -} - -PLIST_ENTRY -FASTCALL -ExfInterlockedInsertTailList(IN PLIST_ENTRY ListHead, - IN PLIST_ENTRY ListEntry, - IN PKSPIN_LOCK Lock) -{ - KIRQL OldIrql; - PLIST_ENTRY OldHead = NULL; - KeAcquireSpinLock(Lock, &OldIrql); - if (!IsListEmpty(ListHead)) OldHead = ListEntry->Blink; - InsertTailList(ListHead, ListEntry); - KeReleaseSpinLock(Lock, OldIrql); - return OldHead; -} - -PSINGLE_LIST_ENTRY -FASTCALL -ExfInterlockedPopEntryList(IN PSINGLE_LIST_ENTRY ListHead, - IN PKSPIN_LOCK Lock) -{ - UNIMPLEMENTED; - return NULL; -} - -PSINGLE_LIST_ENTRY -FASTCALL -ExfInterlockedPushEntryList(IN PSINGLE_LIST_ENTRY ListHead, - IN PSINGLE_LIST_ENTRY ListEntry, - IN PKSPIN_LOCK Lock) -{ - UNIMPLEMENTED; - return NULL; -} - -PLIST_ENTRY -FASTCALL -ExfInterlockedRemoveHeadList(IN PLIST_ENTRY ListHead, - IN PKSPIN_LOCK Lock) -{ - return ExInterlockedRemoveHeadList(ListHead, Lock); -} - -LARGE_INTEGER -NTAPI -ExInterlockedAddLargeInteger(IN PLARGE_INTEGER Addend, - IN LARGE_INTEGER Increment, - IN PKSPIN_LOCK Lock) -{ - LARGE_INTEGER Integer = {{0}}; - UNIMPLEMENTED; - return Integer; -} - -ULONG -NTAPI -ExInterlockedAddUlong(IN PULONG Addend, - IN ULONG Increment, - PKSPIN_LOCK Lock) -{ - return (ULONG)_InterlockedExchangeAdd((PLONG)Addend, Increment); -} - -INTERLOCKED_RESULT -NTAPI -ExInterlockedIncrementLong(IN PLONG Addend, - IN PKSPIN_LOCK Lock) -{ - return _InterlockedIncrement(Addend); -} - -INTERLOCKED_RESULT -NTAPI -ExInterlockedDecrementLong(IN PLONG Addend, - IN PKSPIN_LOCK Lock) -{ - return _InterlockedDecrement(Addend); -} - -ULONG -NTAPI -ExInterlockedExchangeUlong(IN PULONG Target, - IN ULONG Value, - IN PKSPIN_LOCK Lock) -{ - return (ULONG)_InterlockedExchange((PLONG)Target, Value); -} - -PLIST_ENTRY -NTAPI -ExInterlockedInsertHeadList(IN PLIST_ENTRY ListHead, - IN PLIST_ENTRY ListEntry, - IN PKSPIN_LOCK Lock) -{ - KIRQL OldIrql; - PLIST_ENTRY OldHead = NULL; - KeAcquireSpinLock(Lock, &OldIrql); - if (!IsListEmpty(ListHead)) OldHead = ListEntry->Flink; - InsertHeadList(ListHead, ListEntry); - KeReleaseSpinLock(Lock, OldIrql); - return OldHead; -} - -PLIST_ENTRY -NTAPI -ExInterlockedInsertTailList(IN PLIST_ENTRY ListHead, - IN PLIST_ENTRY ListEntry, - IN PKSPIN_LOCK Lock) -{ - KIRQL OldIrql; - PLIST_ENTRY OldHead = NULL; - KeAcquireSpinLock(Lock, &OldIrql); - if (!IsListEmpty(ListHead)) OldHead = ListEntry->Blink; - InsertTailList(ListHead, ListEntry); - KeReleaseSpinLock(Lock, OldIrql); - return OldHead; -} - -PSINGLE_LIST_ENTRY -NTAPI -ExInterlockedPopEntryList(IN PSINGLE_LIST_ENTRY ListHead, - IN PKSPIN_LOCK Lock) -{ - KIRQL OldIrql; - PSINGLE_LIST_ENTRY OldHead = NULL; - KeAcquireSpinLock(Lock, &OldIrql); - OldHead = PopEntryList(ListHead); - KeReleaseSpinLock(Lock, OldIrql); - return OldHead; -} - -PSINGLE_LIST_ENTRY -NTAPI -ExInterlockedPushEntryList(IN PSINGLE_LIST_ENTRY ListHead, - IN PSINGLE_LIST_ENTRY ListEntry, - IN PKSPIN_LOCK Lock) -{ - KIRQL OldIrql; - PSINGLE_LIST_ENTRY OldHead = NULL; - KeAcquireSpinLock(Lock, &OldIrql); - OldHead = ListHead->Next; - PushEntryList(ListHead, ListEntry); - KeReleaseSpinLock(Lock, OldIrql); - return OldHead; -} - -PLIST_ENTRY -NTAPI -ExInterlockedRemoveHeadList(IN PLIST_ENTRY ListHead, - IN PKSPIN_LOCK Lock) -{ - KIRQL OldIrql; - PLIST_ENTRY OldHead = NULL; - KeAcquireSpinLock(Lock, &OldIrql); - if (!IsListEmpty(ListHead)) OldHead = RemoveHeadList(ListHead); - KeReleaseSpinLock(Lock, OldIrql); - return OldHead; -} - -VOID -FASTCALL -ExInterlockedAddLargeStatistic(IN PLONGLONG Addend, - IN ULONG Increment) -{ - UNIMPLEMENTED; -} - -LONGLONG -FASTCALL -ExInterlockedCompareExchange64(IN OUT LONGLONG volatile *Destination, - IN PLONGLONG Exchange, - IN PLONGLONG Comparand, - IN PKSPIN_LOCK Lock) -{ - KIRQL OldIrql; - LONGLONG Result; - - KeAcquireSpinLock(Lock, &OldIrql); - Result = *Destination; - if (*Destination == *Comparand) *Destination = *Exchange; - KeReleaseSpinLock(Lock, OldIrql); - return Result; -} - -VOID -NTAPI -READ_REGISTER_BUFFER_UCHAR(IN PUCHAR Register, - IN PUCHAR Buffer, - IN ULONG Count) -{ - PUCHAR registerBuffer = Register; - PUCHAR readBuffer = Buffer; - ULONG readCount; - - for (readCount = Count; readCount--; readBuffer++, registerBuffer++) - { - *readBuffer = *(volatile UCHAR * const)registerBuffer; - } -} - -VOID -NTAPI -READ_REGISTER_BUFFER_ULONG(IN PULONG Register, - IN PULONG Buffer, - IN ULONG Count) -{ - PULONG registerBuffer = Register; - PULONG readBuffer = Buffer; - ULONG readCount; - - for (readCount = Count; readCount--; readBuffer++, registerBuffer++) - { - *readBuffer = *(volatile ULONG * const)registerBuffer; - } -} - -VOID -NTAPI -READ_REGISTER_BUFFER_USHORT(IN PUSHORT Register, - IN PUSHORT Buffer, - IN ULONG Count) -{ - PUSHORT registerBuffer = Register; - PUSHORT readBuffer = Buffer; - ULONG readCount; - - for (readCount = Count; readCount--; readBuffer++, registerBuffer++) - { - *readBuffer = *(volatile USHORT * const)registerBuffer; - } -} - -UCHAR -NTAPI -READ_REGISTER_UCHAR(IN PUCHAR Register) -{ - return *(volatile UCHAR * const)Register; -} - -ULONG -NTAPI -READ_REGISTER_ULONG(IN PULONG Register) -{ - return *(volatile ULONG * const)Register; -} - -USHORT -NTAPI -READ_REGISTER_USHORT(IN PUSHORT Register) -{ - return *(volatile USHORT * const)Register; -} - -VOID -NTAPI -WRITE_REGISTER_BUFFER_UCHAR(IN PUCHAR Register, - IN PUCHAR Buffer, - IN ULONG Count) -{ - PUCHAR registerBuffer = Register; - PUCHAR writeBuffer = Buffer; - ULONG writeCount; - for (writeCount = Count; writeCount--; writeBuffer++, registerBuffer++) - { - *(volatile UCHAR * const)registerBuffer = *writeBuffer; - } - KeFlushWriteBuffer(); -} - -VOID -NTAPI -WRITE_REGISTER_BUFFER_ULONG(IN PULONG Register, - IN PULONG Buffer, - IN ULONG Count) -{ - PULONG registerBuffer = Register; - PULONG writeBuffer = Buffer; - ULONG writeCount; - for (writeCount = Count; writeCount--; writeBuffer++, registerBuffer++) - { - *(volatile ULONG * const)registerBuffer = *writeBuffer; - } - KeFlushWriteBuffer(); -} - -VOID -NTAPI -WRITE_REGISTER_BUFFER_USHORT(IN PUSHORT Register, - IN PUSHORT Buffer, - IN ULONG Count) -{ - PUSHORT registerBuffer = Register; - PUSHORT writeBuffer = Buffer; - ULONG writeCount; - for (writeCount = Count; writeCount--; writeBuffer++, registerBuffer++) - { - *(volatile USHORT * const)registerBuffer = *writeBuffer; - } - KeFlushWriteBuffer(); -} - -VOID -NTAPI -WRITE_REGISTER_UCHAR(IN PUCHAR Register, - IN UCHAR Value) -{ - *(volatile UCHAR * const)Register = Value; - KeFlushWriteBuffer(); -} - -VOID -NTAPI -WRITE_REGISTER_ULONG(IN PULONG Register, - IN ULONG Value) -{ - *(volatile ULONG * const)Register = Value; - KeFlushWriteBuffer(); -} - -VOID -NTAPI -WRITE_REGISTER_USHORT(IN PUSHORT Register, - IN USHORT Value) -{ - *(volatile USHORT * const)Register = Value; - KeFlushWriteBuffer(); -} - -#endif Removed: trunk/reactos/ntoskrnl/ex/i386/interlocked.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/i386/interlock…
============================================================================== --- trunk/reactos/ntoskrnl/ex/i386/interlocked.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/i386/interlocked.c (removed) @@ -1,551 +1,0 @@ -/* -* PROJECT: ReactOS Kernel -* LICENSE: GPL - See COPYING in the top level directory -* FILE: ntoskrnl/ex/interlocked.c -* PURPOSE: Interlocked functions -* PROGRAMMERS: Timo Kreuzer (timo.kreuzer(a)reactos.org) -*/ - -/* INCLUDES *****************************************************************/ - -#include <ntoskrnl.h> - -#define NDEBUG -#include <debug.h> - -#undef ExInterlockedAddUlong -#undef ExInterlockedInsertHeadList -#undef ExInterlockedInsertTailList -#undef ExInterlockedRemoveHeadList -#undef ExInterlockedPopEntryList -#undef ExInterlockedPushEntryList -#undef ExInterlockedIncrementLong -#undef ExInterlockedDecrementLong -#undef ExInterlockedExchangeUlong -#undef ExInterlockedCompareExchange64 - - -/* FUNCTIONS ****************************************************************/ - -#if defined(_M_IX86 ) || defined(_M_AMD64) -FORCEINLINE -ULONG_PTR -_ExiDisableInteruptsAndAcquireSpinlock( - IN OUT PKSPIN_LOCK Lock) -{ - UINT_PTR EFlags; - - /* Save flags */ - EFlags = __readeflags(); - - /* Disable interrupts */ - _disable(); - - /* Acquire the spinlock (inline) */ - KxAcquireSpinLock(Lock); - - return EFlags; -} - -FORCEINLINE -VOID -_ExiReleaseSpinLockAndRestoreInterupts( - IN OUT PKSPIN_LOCK Lock, - ULONG_PTR EFlags) -{ - /* Release the spinlock */ - KxReleaseSpinLock(Lock); - - /* Restore flags */ - __writeeflags(EFlags); -} -#else -#error Unimplemented -#endif - -LARGE_INTEGER -NTAPI -ExInterlockedAddLargeInteger( - IN OUT PLARGE_INTEGER Addend, - IN LARGE_INTEGER Increment, - IN OUT PKSPIN_LOCK Lock) -{ - LARGE_INTEGER OldValue; - ULONG_PTR LockHandle; - - /* Disable interrupts and acquire the spinlock */ - LockHandle = _ExiDisableInteruptsAndAcquireSpinlock(Lock); - - /* Save the old value */ - OldValue.QuadPart = Addend->QuadPart; - - /* Do the operation */ - Addend->QuadPart += Increment.QuadPart; - - /* Release the spinlock and restore interrupts */ - _ExiReleaseSpinLockAndRestoreInterupts(Lock, LockHandle); - - /* Return the old value */ - return OldValue; -} - -ULONG -NTAPI -ExInterlockedAddUlong( - IN OUT PULONG Addend, - IN ULONG Increment, - IN OUT PKSPIN_LOCK Lock) -{ - ULONG_PTR LockHandle; - ULONG OldValue; - - /* Disable interrupts and acquire the spinlock */ - LockHandle = _ExiDisableInteruptsAndAcquireSpinlock(Lock); - - /* Save the old value */ - OldValue = *Addend; - - /* Do the operation */ - *Addend += Increment; - - /* Release the spinlock and restore interrupts */ - _ExiReleaseSpinLockAndRestoreInterupts(Lock, LockHandle); - - /* Return the old value */ - return OldValue; -} - -PLIST_ENTRY -NTAPI -ExInterlockedInsertHeadList( - IN OUT PLIST_ENTRY ListHead, - IN OUT PLIST_ENTRY ListEntry, - IN OUT PKSPIN_LOCK Lock) -{ - ULONG_PTR LockHandle; - PLIST_ENTRY FirstEntry; - - /* Disable interrupts and acquire the spinlock */ - LockHandle = _ExiDisableInteruptsAndAcquireSpinlock(Lock); - - /* Save the first entry */ - FirstEntry = ListHead->Flink; - - /* Insert the new entry */ - InsertHeadList(ListHead, ListEntry); - - /* Release the spinlock and restore interrupts */ - _ExiReleaseSpinLockAndRestoreInterupts(Lock, LockHandle); - - /* Return the old first entry or NULL for empty list */ - return (FirstEntry == ListHead) ? NULL : FirstEntry; -} - -PLIST_ENTRY -NTAPI -ExInterlockedInsertTailList( - IN OUT PLIST_ENTRY ListHead, - IN OUT PLIST_ENTRY ListEntry, - IN OUT PKSPIN_LOCK Lock) -{ - ULONG_PTR LockHandle; - PLIST_ENTRY LastEntry; - - /* Disable interrupts and acquire the spinlock */ - LockHandle = _ExiDisableInteruptsAndAcquireSpinlock(Lock); - - /* Save the last entry */ - LastEntry = ListHead->Blink; - - /* Insert the new entry */ - InsertTailList(ListHead, ListEntry); - - /* Release the spinlock and restore interrupts */ - _ExiReleaseSpinLockAndRestoreInterupts(Lock, LockHandle); - - /* Return the old last entry or NULL for empty list */ - return (LastEntry == ListHead) ? NULL : LastEntry; -} - -PLIST_ENTRY -NTAPI -ExInterlockedRemoveHeadList( - IN OUT PLIST_ENTRY ListHead, - IN OUT PKSPIN_LOCK Lock) -{ - ULONG_PTR LockHandle; - PLIST_ENTRY ListEntry; - - /* Disable interrupts and acquire the spinlock */ - LockHandle = _ExiDisableInteruptsAndAcquireSpinlock(Lock); - - /* Check if the list is empty */ - if (IsListEmpty(ListHead)) - { - /* Return NULL */ - ListEntry = NULL; - } - else - { - /* Remove the first entry from the list head */ - ListEntry = RemoveHeadList(ListHead); - } - - /* Release the spinlock and restore interrupts */ - _ExiReleaseSpinLockAndRestoreInterupts(Lock, LockHandle); - - /* Return the entry */ - return ListEntry; -} - -PSINGLE_LIST_ENTRY -NTAPI -ExInterlockedPopEntryList( - IN OUT PSINGLE_LIST_ENTRY ListHead, - IN OUT PKSPIN_LOCK Lock) -{ - ULONG_PTR LockHandle; - PSINGLE_LIST_ENTRY ListEntry; - - /* Disable interrupts and acquire the spinlock */ - LockHandle = _ExiDisableInteruptsAndAcquireSpinlock(Lock); - - /* Pop the first entry from the list */ - ListEntry = PopEntryList(ListHead); - - /* Release the spinlock and restore interrupts */ - _ExiReleaseSpinLockAndRestoreInterupts(Lock, LockHandle); - - /* Return the entry */ - return ListEntry; -} - -PSINGLE_LIST_ENTRY -NTAPI -ExInterlockedPushEntryList( - IN OUT PSINGLE_LIST_ENTRY ListHead, - IN OUT PSINGLE_LIST_ENTRY ListEntry, - IN OUT PKSPIN_LOCK Lock) -{ - ULONG_PTR LockHandle; - PSINGLE_LIST_ENTRY OldListEntry; - - /* Disable interrupts and acquire the spinlock */ - LockHandle = _ExiDisableInteruptsAndAcquireSpinlock(Lock); - - /* Save the old top entry */ - OldListEntry = ListHead->Next; - - /* Push a new entry on the list */ - PushEntryList(ListHead, ListEntry); - - /* Release the spinlock and restore interrupts */ - _ExiReleaseSpinLockAndRestoreInterupts(Lock, LockHandle); - - /* Return the entry */ - return OldListEntry; -} - -INTERLOCKED_RESULT -NTAPI -ExInterlockedIncrementLong( - IN PLONG Addend, - IN PKSPIN_LOCK Lock) -{ - LONG Result; - - Result = _InterlockedIncrement(Addend); - return (Result < 0) ? ResultNegative : - (Result > 0) ? ResultPositive : - ResultZero; -} - -INTERLOCKED_RESULT -NTAPI -ExInterlockedDecrementLong( - IN PLONG Addend, - IN PKSPIN_LOCK Lock) -{ - LONG Result; - - Result = _InterlockedDecrement(Addend); - return (Result < 0) ? ResultNegative : - (Result > 0) ? ResultPositive : - ResultZero; -} - -ULONG -NTAPI -ExInterlockedExchangeUlong( - IN PULONG Target, - IN ULONG Value, - IN PKSPIN_LOCK Lock) -{ - return (ULONG)_InterlockedExchange((PLONG)Target, (LONG)Value); -} - -#ifdef _M_IX86 - -ULONG -FASTCALL -ExfInterlockedAddUlong( - IN OUT PULONG Addend, - IN ULONG Increment, - IN OUT PKSPIN_LOCK Lock) -{ - ULONG_PTR LockHandle; - ULONG OldValue; - - /* Disable interrupts and acquire the spinlock */ - LockHandle = _ExiDisableInteruptsAndAcquireSpinlock(Lock); - - /* Save the old value */ - OldValue = *Addend; - - /* Do the operation */ - *Addend += Increment; - - /* Release the spinlock and restore interrupts */ - _ExiReleaseSpinLockAndRestoreInterupts(Lock, LockHandle); - - /* Return the old value */ - return OldValue; -} - -PLIST_ENTRY -FASTCALL -ExfInterlockedInsertHeadList( - IN OUT PLIST_ENTRY ListHead, - IN PLIST_ENTRY ListEntry, - IN OUT PKSPIN_LOCK Lock) -{ - ULONG_PTR LockHandle; - PLIST_ENTRY FirstEntry; - - /* Disable interrupts and acquire the spinlock */ - LockHandle = _ExiDisableInteruptsAndAcquireSpinlock(Lock); - - /* Save the first entry */ - FirstEntry = ListHead->Flink; - - /* Insert the new entry */ - InsertHeadList(ListHead, ListEntry); - - /* Release the spinlock and restore interrupts */ - _ExiReleaseSpinLockAndRestoreInterupts(Lock, LockHandle); - - /* Return the old first entry or NULL for empty list */ - return (FirstEntry == ListHead) ? NULL : FirstEntry; -} - -PLIST_ENTRY -FASTCALL -ExfInterlockedInsertTailList( - IN OUT PLIST_ENTRY ListHead, - IN PLIST_ENTRY ListEntry, - IN OUT PKSPIN_LOCK Lock) -{ - ULONG_PTR LockHandle; - PLIST_ENTRY LastEntry; - - /* Disable interrupts and acquire the spinlock */ - LockHandle = _ExiDisableInteruptsAndAcquireSpinlock(Lock); - - /* Save the last entry */ - LastEntry = ListHead->Blink; - - /* Insert the new entry */ - InsertTailList(ListHead, ListEntry); - - /* Release the spinlock and restore interrupts */ - _ExiReleaseSpinLockAndRestoreInterupts(Lock, LockHandle); - - /* Return the old last entry or NULL for empty list */ - return (LastEntry == ListHead) ? NULL : LastEntry; -} - - -PLIST_ENTRY -FASTCALL -ExfInterlockedRemoveHeadList( - IN OUT PLIST_ENTRY ListHead, - IN OUT PKSPIN_LOCK Lock) -{ - ULONG_PTR LockHandle; - PLIST_ENTRY ListEntry; - - /* Disable interrupts and acquire the spinlock */ - LockHandle = _ExiDisableInteruptsAndAcquireSpinlock(Lock); - - /* Check if the list is empty */ - if (IsListEmpty(ListHead)) - { - /* Return NULL */ - ListEntry = NULL; - } - else - { - /* Remove the first entry from the list head */ - ListEntry = RemoveHeadList(ListHead); - } - - /* Release the spinlock and restore interrupts */ - _ExiReleaseSpinLockAndRestoreInterupts(Lock, LockHandle); - - /* return the entry */ - return ListEntry; -} - -PSINGLE_LIST_ENTRY -FASTCALL -ExfInterlockedPopEntryList( - IN OUT PSINGLE_LIST_ENTRY ListHead, - IN OUT PKSPIN_LOCK Lock) -{ - ULONG_PTR LockHandle; - PSINGLE_LIST_ENTRY ListEntry; - - /* Disable interrupts and acquire the spinlock */ - LockHandle = _ExiDisableInteruptsAndAcquireSpinlock(Lock); - - /* Pop the first entry from the list */ - ListEntry = PopEntryList(ListHead); - - /* Release the spinlock and restore interrupts */ - _ExiReleaseSpinLockAndRestoreInterupts(Lock, LockHandle); - - /* return the entry */ - return ListEntry; -} - -PSINGLE_LIST_ENTRY -FASTCALL -ExfInterlockedPushEntryList( - IN OUT PSINGLE_LIST_ENTRY ListHead, - IN PSINGLE_LIST_ENTRY ListEntry, - IN OUT PKSPIN_LOCK Lock) -{ - ULONG_PTR LockHandle; - PSINGLE_LIST_ENTRY OldListEntry; - - /* Disable interrupts and acquire the spinlock */ - LockHandle = _ExiDisableInteruptsAndAcquireSpinlock(Lock); - - /* Save the old top entry */ - OldListEntry = ListHead->Next; - - /* Push a new entry on the list */ - PushEntryList(ListHead, ListEntry); - - /* Release the spinlock and restore interrupts */ - _ExiReleaseSpinLockAndRestoreInterupts(Lock, LockHandle); - - /* return the entry */ - return OldListEntry; -} - -INTERLOCKED_RESULT -NTAPI -Exi386InterlockedIncrementLong( - IN PLONG Addend) -{ - LONG Result; - - Result = _InterlockedIncrement(Addend); - return (Result < 0) ? ResultNegative : - (Result > 0) ? ResultPositive : - ResultZero; -} - -INTERLOCKED_RESULT -FASTCALL -Exfi386InterlockedIncrementLong( - IN OUT LONG volatile *Addend) -{ - LONG Result; - - Result = _InterlockedIncrement(Addend); - return (Result < 0) ? ResultNegative : - (Result > 0) ? ResultPositive : - ResultZero; -} - -INTERLOCKED_RESULT -NTAPI -Exi386InterlockedDecrementLong( - IN PLONG Addend) -{ - LONG Result; - - Result = _InterlockedDecrement(Addend); - return (Result < 0) ? ResultNegative : - (Result > 0) ? ResultPositive : - ResultZero; -} - -INTERLOCKED_RESULT -FASTCALL -Exfi386InterlockedDecrementLong( - IN OUT PLONG Addend) -{ - LONG Result; - - Result = _InterlockedDecrement(Addend); - return (Result < 0) ? ResultNegative : - (Result > 0) ? ResultPositive : - ResultZero; -} - -LONG -NTAPI -Exi386InterlockedExchangeUlong( - PLONG Target, - LONG Exchange) -{ - return _InterlockedExchange(Target, Exchange); -} - -ULONG -FASTCALL -Exfi386InterlockedExchangeUlong( - IN OUT PULONG Target, - IN ULONG Exchange) -{ - return _InterlockedExchange((PLONG)Target, Exchange); -} - -LONGLONG -FASTCALL -ExInterlockedCompareExchange64( - IN OUT LONGLONG volatile *Destination, - IN PLONGLONG Exchange, - IN PLONGLONG Comparand, - IN PKSPIN_LOCK Lock) -{ - return _InterlockedCompareExchange64(Destination, *Exchange, *Comparand); -} - -LONGLONG -FASTCALL -ExfInterlockedCompareExchange64( - IN OUT LONGLONG volatile *Destination, - IN PLONGLONG Exchange, - IN PLONGLONG Comparand) -{ - return _InterlockedCompareExchange64(Destination, *Exchange, *Comparand); -} -#endif - -#if 0 - -VOID -FASTCALL -ExInterlockedAddLargeStatistic( - IN OUT PLARGE_INTEGER Addend, - IN ULONG Increment) -{ -} - - -#endif - Copied: trunk/reactos/ntoskrnl/ex/interlocked.c (from r52875, trunk/reactos/ntoskrnl/ex/i386/interlocked.c) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/interlocked.c?…
============================================================================== --- trunk/reactos/ntoskrnl/ex/i386/interlocked.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/interlocked.c [iso-8859-1] Tue Jul 26 14:00:08 2011 @@ -27,41 +27,35 @@ /* FUNCTIONS ****************************************************************/ -#if defined(_M_IX86 ) || defined(_M_AMD64) FORCEINLINE -ULONG_PTR +BOOLEAN _ExiDisableInteruptsAndAcquireSpinlock( IN OUT PKSPIN_LOCK Lock) { - UINT_PTR EFlags; - - /* Save flags */ - EFlags = __readeflags(); + BOOLEAN Enabled; /* Disable interrupts */ - _disable(); + Enabled = KeDisableInterrupts(); /* Acquire the spinlock (inline) */ KxAcquireSpinLock(Lock); - return EFlags; + return Enabled; } FORCEINLINE VOID _ExiReleaseSpinLockAndRestoreInterupts( IN OUT PKSPIN_LOCK Lock, - ULONG_PTR EFlags) + BOOLEAN Enable) { /* Release the spinlock */ KxReleaseSpinLock(Lock); - /* Restore flags */ - __writeeflags(EFlags); -} -#else -#error Unimplemented -#endif + /* Restore interrupts */ + KeRestoreInterrupts(Enable); +} + LARGE_INTEGER NTAPI @@ -71,10 +65,10 @@ IN OUT PKSPIN_LOCK Lock) { LARGE_INTEGER OldValue; - ULONG_PTR LockHandle; - - /* Disable interrupts and acquire the spinlock */ - LockHandle = _ExiDisableInteruptsAndAcquireSpinlock(Lock); + BOOLEAN Enable; + + /* Disable interrupts and acquire the spinlock */ + Enable = _ExiDisableInteruptsAndAcquireSpinlock(Lock); /* Save the old value */ OldValue.QuadPart = Addend->QuadPart; @@ -83,7 +77,7 @@ Addend->QuadPart += Increment.QuadPart; /* Release the spinlock and restore interrupts */ - _ExiReleaseSpinLockAndRestoreInterupts(Lock, LockHandle); + _ExiReleaseSpinLockAndRestoreInterupts(Lock, Enable); /* Return the old value */ return OldValue; @@ -96,11 +90,11 @@ IN ULONG Increment, IN OUT PKSPIN_LOCK Lock) { - ULONG_PTR LockHandle; + BOOLEAN Enable; ULONG OldValue; /* Disable interrupts and acquire the spinlock */ - LockHandle = _ExiDisableInteruptsAndAcquireSpinlock(Lock); + Enable = _ExiDisableInteruptsAndAcquireSpinlock(Lock); /* Save the old value */ OldValue = *Addend; @@ -109,7 +103,7 @@ *Addend += Increment; /* Release the spinlock and restore interrupts */ - _ExiReleaseSpinLockAndRestoreInterupts(Lock, LockHandle); + _ExiReleaseSpinLockAndRestoreInterupts(Lock, Enable); /* Return the old value */ return OldValue; @@ -122,11 +116,11 @@ IN OUT PLIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock) { - ULONG_PTR LockHandle; + BOOLEAN Enable; PLIST_ENTRY FirstEntry; /* Disable interrupts and acquire the spinlock */ - LockHandle = _ExiDisableInteruptsAndAcquireSpinlock(Lock); + Enable = _ExiDisableInteruptsAndAcquireSpinlock(Lock); /* Save the first entry */ FirstEntry = ListHead->Flink; @@ -135,7 +129,7 @@ InsertHeadList(ListHead, ListEntry); /* Release the spinlock and restore interrupts */ - _ExiReleaseSpinLockAndRestoreInterupts(Lock, LockHandle); + _ExiReleaseSpinLockAndRestoreInterupts(Lock, Enable); /* Return the old first entry or NULL for empty list */ return (FirstEntry == ListHead) ? NULL : FirstEntry; @@ -148,11 +142,11 @@ IN OUT PLIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock) { - ULONG_PTR LockHandle; + BOOLEAN Enable; PLIST_ENTRY LastEntry; /* Disable interrupts and acquire the spinlock */ - LockHandle = _ExiDisableInteruptsAndAcquireSpinlock(Lock); + Enable = _ExiDisableInteruptsAndAcquireSpinlock(Lock); /* Save the last entry */ LastEntry = ListHead->Blink; @@ -161,7 +155,7 @@ InsertTailList(ListHead, ListEntry); /* Release the spinlock and restore interrupts */ - _ExiReleaseSpinLockAndRestoreInterupts(Lock, LockHandle); + _ExiReleaseSpinLockAndRestoreInterupts(Lock, Enable); /* Return the old last entry or NULL for empty list */ return (LastEntry == ListHead) ? NULL : LastEntry; @@ -173,11 +167,11 @@ IN OUT PLIST_ENTRY ListHead, IN OUT PKSPIN_LOCK Lock) { - ULONG_PTR LockHandle; + BOOLEAN Enable; PLIST_ENTRY ListEntry; /* Disable interrupts and acquire the spinlock */ - LockHandle = _ExiDisableInteruptsAndAcquireSpinlock(Lock); + Enable = _ExiDisableInteruptsAndAcquireSpinlock(Lock); /* Check if the list is empty */ if (IsListEmpty(ListHead)) @@ -192,7 +186,7 @@ } /* Release the spinlock and restore interrupts */ - _ExiReleaseSpinLockAndRestoreInterupts(Lock, LockHandle); + _ExiReleaseSpinLockAndRestoreInterupts(Lock, Enable); /* Return the entry */ return ListEntry; @@ -204,17 +198,17 @@ IN OUT PSINGLE_LIST_ENTRY ListHead, IN OUT PKSPIN_LOCK Lock) { - ULONG_PTR LockHandle; + BOOLEAN Enable; PSINGLE_LIST_ENTRY ListEntry; /* Disable interrupts and acquire the spinlock */ - LockHandle = _ExiDisableInteruptsAndAcquireSpinlock(Lock); + Enable = _ExiDisableInteruptsAndAcquireSpinlock(Lock); /* Pop the first entry from the list */ ListEntry = PopEntryList(ListHead); /* Release the spinlock and restore interrupts */ - _ExiReleaseSpinLockAndRestoreInterupts(Lock, LockHandle); + _ExiReleaseSpinLockAndRestoreInterupts(Lock, Enable); /* Return the entry */ return ListEntry; @@ -227,11 +221,11 @@ IN OUT PSINGLE_LIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock) { - ULONG_PTR LockHandle; + BOOLEAN Enable; PSINGLE_LIST_ENTRY OldListEntry; /* Disable interrupts and acquire the spinlock */ - LockHandle = _ExiDisableInteruptsAndAcquireSpinlock(Lock); + Enable = _ExiDisableInteruptsAndAcquireSpinlock(Lock); /* Save the old top entry */ OldListEntry = ListHead->Next; @@ -240,7 +234,7 @@ PushEntryList(ListHead, ListEntry); /* Release the spinlock and restore interrupts */ - _ExiReleaseSpinLockAndRestoreInterupts(Lock, LockHandle); + _ExiReleaseSpinLockAndRestoreInterupts(Lock, Enable); /* Return the entry */ return OldListEntry; @@ -293,11 +287,11 @@ IN ULONG Increment, IN OUT PKSPIN_LOCK Lock) { - ULONG_PTR LockHandle; + BOOLEAN Enable; ULONG OldValue; /* Disable interrupts and acquire the spinlock */ - LockHandle = _ExiDisableInteruptsAndAcquireSpinlock(Lock); + Enable = _ExiDisableInteruptsAndAcquireSpinlock(Lock); /* Save the old value */ OldValue = *Addend; @@ -306,7 +300,7 @@ *Addend += Increment; /* Release the spinlock and restore interrupts */ - _ExiReleaseSpinLockAndRestoreInterupts(Lock, LockHandle); + _ExiReleaseSpinLockAndRestoreInterupts(Lock, Enable); /* Return the old value */ return OldValue; @@ -319,11 +313,11 @@ IN PLIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock) { - ULONG_PTR LockHandle; + BOOLEAN Enable; PLIST_ENTRY FirstEntry; /* Disable interrupts and acquire the spinlock */ - LockHandle = _ExiDisableInteruptsAndAcquireSpinlock(Lock); + Enable = _ExiDisableInteruptsAndAcquireSpinlock(Lock); /* Save the first entry */ FirstEntry = ListHead->Flink; @@ -332,7 +326,7 @@ InsertHeadList(ListHead, ListEntry); /* Release the spinlock and restore interrupts */ - _ExiReleaseSpinLockAndRestoreInterupts(Lock, LockHandle); + _ExiReleaseSpinLockAndRestoreInterupts(Lock, Enable); /* Return the old first entry or NULL for empty list */ return (FirstEntry == ListHead) ? NULL : FirstEntry; @@ -345,11 +339,11 @@ IN PLIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock) { - ULONG_PTR LockHandle; + BOOLEAN Enable; PLIST_ENTRY LastEntry; /* Disable interrupts and acquire the spinlock */ - LockHandle = _ExiDisableInteruptsAndAcquireSpinlock(Lock); + Enable = _ExiDisableInteruptsAndAcquireSpinlock(Lock); /* Save the last entry */ LastEntry = ListHead->Blink; @@ -358,7 +352,7 @@ InsertTailList(ListHead, ListEntry); /* Release the spinlock and restore interrupts */ - _ExiReleaseSpinLockAndRestoreInterupts(Lock, LockHandle); + _ExiReleaseSpinLockAndRestoreInterupts(Lock, Enable); /* Return the old last entry or NULL for empty list */ return (LastEntry == ListHead) ? NULL : LastEntry; @@ -371,11 +365,11 @@ IN OUT PLIST_ENTRY ListHead, IN OUT PKSPIN_LOCK Lock) { - ULONG_PTR LockHandle; + BOOLEAN Enable; PLIST_ENTRY ListEntry; /* Disable interrupts and acquire the spinlock */ - LockHandle = _ExiDisableInteruptsAndAcquireSpinlock(Lock); + Enable = _ExiDisableInteruptsAndAcquireSpinlock(Lock); /* Check if the list is empty */ if (IsListEmpty(ListHead)) @@ -390,7 +384,7 @@ } /* Release the spinlock and restore interrupts */ - _ExiReleaseSpinLockAndRestoreInterupts(Lock, LockHandle); + _ExiReleaseSpinLockAndRestoreInterupts(Lock, Enable); /* return the entry */ return ListEntry; @@ -402,17 +396,17 @@ IN OUT PSINGLE_LIST_ENTRY ListHead, IN OUT PKSPIN_LOCK Lock) { - ULONG_PTR LockHandle; + BOOLEAN Enable; PSINGLE_LIST_ENTRY ListEntry; /* Disable interrupts and acquire the spinlock */ - LockHandle = _ExiDisableInteruptsAndAcquireSpinlock(Lock); + Enable = _ExiDisableInteruptsAndAcquireSpinlock(Lock); /* Pop the first entry from the list */ ListEntry = PopEntryList(ListHead); /* Release the spinlock and restore interrupts */ - _ExiReleaseSpinLockAndRestoreInterupts(Lock, LockHandle); + _ExiReleaseSpinLockAndRestoreInterupts(Lock, Enable); /* return the entry */ return ListEntry; @@ -425,11 +419,11 @@ IN PSINGLE_LIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock) { - ULONG_PTR LockHandle; + BOOLEAN Enable; PSINGLE_LIST_ENTRY OldListEntry; /* Disable interrupts and acquire the spinlock */ - LockHandle = _ExiDisableInteruptsAndAcquireSpinlock(Lock); + Enable = _ExiDisableInteruptsAndAcquireSpinlock(Lock); /* Save the old top entry */ OldListEntry = ListHead->Next; @@ -438,7 +432,7 @@ PushEntryList(ListHead, ListEntry); /* Release the spinlock and restore interrupts */ - _ExiReleaseSpinLockAndRestoreInterupts(Lock, LockHandle); + _ExiReleaseSpinLockAndRestoreInterupts(Lock, Enable); /* return the entry */ return OldListEntry; Modified: trunk/reactos/ntoskrnl/include/internal/amd64/ke.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/amd64/ke.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/amd64/ke.h [iso-8859-1] Tue Jul 26 14:00:08 2011 @@ -133,6 +133,31 @@ // #define KeGetTrapFrameInterruptState(TrapFrame) \ BooleanFlagOn((TrapFrame)->EFlags, EFLAGS_INTERRUPT_MASK) + +/* Diable interrupts and return whether they were enabled before */ +BOOLEAN +NTAPI +KeDisableInterrupts(VOID) +{ + ULONG Flags; + BOOLEAN Return; + + /* Get EFLAGS and check if the interrupt bit is set */ + Flags = __readeflags(); + Return = (Flags & EFLAGS_INTERRUPT_MASK) ? TRUE: FALSE; + + /* Disable interrupts */ + _disable(); + return Return; +} + +/* Restore previous interrupt state */ +FORCEINLINE +VOID +KeRestoreInterrupts(BOOLEAN WereEnabled) +{ + if (WereEnabled) _enable(); +} // // Invalidates the TLB entry for a specified address Modified: trunk/reactos/ntoskrnl/include/internal/arm/ke.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/arm/ke.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/arm/ke.h [iso-8859-1] Tue Jul 26 14:00:08 2011 @@ -65,6 +65,31 @@ // //#define KeGetTrapFrameInterruptState(TrapFrame) +FORCEINLINE +BOOLEAN +KeDisableInterrupts(VOID) +{ + ARM_STATUS_REGISTER Flags; + + // + // Get current interrupt state and disable interrupts + // + Flags = KeArmStatusRegisterGet(); + _disable(); + + // + // Return previous interrupt state + // + return Flags.IrqDisable; +} + +FORCEINLINE +VOID +KeRestoreInterrupts(BOOLEAN WereEnabled) +{ + if (WereEnabled) _enable(); +} + // // Invalidates the TLB entry for a specified address // Modified: trunk/reactos/ntoskrnl/include/internal/i386/ke.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/i386/ke.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/i386/ke.h [iso-8859-1] Tue Jul 26 14:00:08 2011 @@ -163,6 +163,31 @@ FX_SAVE_AREA NpxArea; KV86_FRAME V86Frame; } KV8086_STACK_FRAME, *PKV8086_STACK_FRAME; + +/* Diable interrupts and return whether they were enabled before */ +FORCEINLINE +BOOLEAN +KeDisableInterrupts(VOID) +{ + ULONG Flags; + BOOLEAN Return; + + /* Get EFLAGS and check if the interrupt bit is set */ + Flags = __readeflags(); + Return = (Flags & EFLAGS_INTERRUPT_MASK) ? TRUE: FALSE; + + /* Disable interrupts */ + _disable(); + return Return; +} + +/* Restore previous interrupt state */ +FORCEINLINE +VOID +KeRestoreInterrupts(BOOLEAN WereEnabled) +{ + if (WereEnabled) _enable(); +} // // Registers an interrupt handler with an IDT vector Modified: trunk/reactos/ntoskrnl/include/internal/ke.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ke.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/ke.h [iso-8859-1] Tue Jul 26 14:00:08 2011 @@ -1033,12 +1033,6 @@ NTAPI KeThawExecution(IN BOOLEAN Enable); -BOOLEAN -NTAPI -KeDisableInterrupts( - VOID -); - VOID FASTCALL KeAcquireQueuedSpinLockAtDpcLevel( Modified: trunk/reactos/ntoskrnl/ke/arm/cpu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/cpu.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/ke/arm/cpu.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/arm/cpu.c [iso-8859-1] Tue Jul 26 14:00:08 2011 @@ -90,23 +90,6 @@ return TRUE; } -BOOLEAN -NTAPI -KeDisableInterrupts(VOID) -{ - ARM_STATUS_REGISTER Flags; - - // - // Get current interrupt state and disable interrupts - // - Flags = KeArmStatusRegisterGet(); - _disable(); - - // - // Return previous interrupt state - // - return Flags.IrqDisable; -} /* PUBLIC FUNCTIONS ***********************************************************/ @@ -130,17 +113,17 @@ IN BOOLEAN AllProcessors) { KIRQL OldIrql; - + // // Raise the IRQL for the TB Flush // OldIrql = KeRaiseIrqlToSynchLevel(); - + // // Flush the TB for the Current CPU // KeFlushCurrentTb(); - + // // Return to Original IRQL // @@ -168,7 +151,7 @@ KeQueryActiveProcessors(VOID) { PAGED_CODE(); - + // // Simply return the number of active processors // @@ -186,7 +169,7 @@ // Capture the context // RtlCaptureContext(&State->ContextFrame); - + // // Capture the control state // Modified: trunk/reactos/ntoskrnl/ke/i386/cpu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/cpu.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/cpu.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/i386/cpu.c [iso-8859-1] Tue Jul 26 14:00:08 2011 @@ -1175,22 +1175,6 @@ BOOLEAN NTAPI -KeDisableInterrupts(VOID) -{ - ULONG Flags; - BOOLEAN Return; - - /* Get EFLAGS and check if the interrupt bit is set */ - Flags = __readeflags(); - Return = (Flags & EFLAGS_INTERRUPT_MASK) ? TRUE: FALSE; - - /* Disable interrupts */ - _disable(); - return Return; -} - -BOOLEAN -NTAPI KeInvalidateAllCaches(VOID) { /* Only supported on Pentium Pro and higher */ Modified: trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl-generic.…
============================================================================== --- trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild [iso-8859-1] Tue Jul 26 14:00:08 2011 @@ -218,14 +218,8 @@ <directory name="ex"> <if property="ARCH" value="i386"> <directory name="i386"> - <file>interlocked.c</file> <file>fastinterlck_asm.S</file> <file>ioport.S</file> - </directory> - </if> - <if property="ARCH" value="amd64"> - <directory name="amd64"> - <file>fastinterlck.c</file> </directory> </if> <file>atom.c</file> @@ -235,12 +229,12 @@ <file>event.c</file> <file>evtpair.c</file> <file>exintrin.c</file> - <file>fastinterlck.c</file> <file>fmutex.c</file> <file>handle.c</file> <file>harderr.c</file> <file>hdlsterm.c</file> <file>init.c</file> + <file>interlocked.c</file> <file>keyedevt.c</file> <file>locale.c</file> <file>lookas.c</file>
13 years, 5 months
1
0
0
0
[jgardou] 52896: [NTDLL] - fix the fix : export RtlAcquirePrivilege. - Also export RtlInterlockedCompareExchange64, it's needed by kernel32
by jgardou@svn.reactos.org
Author: jgardou Date: Tue Jul 26 13:53:18 2011 New Revision: 52896 URL:
http://svn.reactos.org/svn/reactos?rev=52896&view=rev
Log: [NTDLL] - fix the fix : export RtlAcquirePrivilege. - Also export RtlInterlockedCompareExchange64, it's needed by kernel32 Modified: trunk/reactos/dll/ntdll/def/ntdll.pspec trunk/reactos/dll/ntdll/def/ntdll.spec Modified: trunk/reactos/dll/ntdll/def/ntdll.pspec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/def/ntdll.pspec?…
============================================================================== --- trunk/reactos/dll/ntdll/def/ntdll.pspec [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/def/ntdll.pspec [iso-8859-1] Tue Jul 26 13:53:18 2011 @@ -726,6 +726,7 @@ @ stdcall RtlInt64ToUnicodeString(double long ptr) @ stdcall RtlIntegerToChar(long long long ptr) @ stdcall RtlIntegerToUnicodeString(long long ptr) +@ stdcall -arch=win32 -ret64 RtlInterlockedCompareExchange64(ptr double double) @ stdcall -arch=i386,x86_64 RtlInterlockedFlushSList(ptr) @ stdcall -arch=i386,x86_64 RtlInterlockedPopEntrySList(ptr) @ stdcall -arch=i386,x86_64 RtlInterlockedPushEntrySList(ptr ptr) Modified: trunk/reactos/dll/ntdll/def/ntdll.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/def/ntdll.spec?r…
============================================================================== --- trunk/reactos/dll/ntdll/def/ntdll.spec [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/def/ntdll.spec [iso-8859-1] Tue Jul 26 13:53:18 2011 @@ -411,6 +411,7 @@ ;@ stdcall RtlAbortRXact @ stdcall RtlAbsoluteToSelfRelativeSD(ptr ptr ptr) @ stdcall RtlAcquirePebLock() +@ stdcall RtlAcquirePrivilege(ptr long long ptr) @ stdcall RtlAcquireResourceExclusive(ptr long) @ stdcall RtlAcquireResourceShared(ptr long) @ stdcall RtlAcquireSRWLockExclusive(ptr) @@ -723,7 +724,7 @@ @ stdcall RtlInt64ToUnicodeString(double long ptr) @ stdcall RtlIntegerToChar(long long long ptr) @ stdcall RtlIntegerToUnicodeString(long long ptr) -;@ stdcall RtlInterlockedCompareExchange64 +@ stdcall -arch=win32 -ret64 RtlInterlockedCompareExchange64(ptr double double) @ stdcall -arch=i386,x86_64 RtlInterlockedFlushSList(ptr) @ stdcall -arch=i386,x86_64 RtlInterlockedPopEntrySList(ptr) @ stdcall -arch=i386,x86_64 RtlInterlockedPushEntrySList(ptr ptr)
13 years, 5 months
1
0
0
0
[jgardou] 52895: [CMAKE] -relink win32csr with msvcrt, it's a win32dll
by jgardou@svn.reactos.org
Author: jgardou Date: Tue Jul 26 11:40:20 2011 New Revision: 52895 URL:
http://svn.reactos.org/svn/reactos?rev=52895&view=rev
Log: [CMAKE] -relink win32csr with msvcrt, it's a win32dll Modified: trunk/reactos/subsystems/win32/csrss/win32csr/CMakeLists.txt Modified: trunk/reactos/subsystems/win32/csrss/win32csr/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/win32csr/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/win32csr/CMakeLists.txt [iso-8859-1] Tue Jul 26 11:40:20 2011 @@ -35,7 +35,7 @@ set_module_type(win32csr win32dll) -add_importlibs(win32csr user32 gdi32 advapi32 psapi kernel32 ntdll) +add_importlibs(win32csr user32 gdi32 advapi32 psapi kernel32 ntdll msvcrt) add_pch(win32csr w32csr.h)
13 years, 5 months
1
0
0
0
[cmihail] 52894: [lwIP/TCPIP] - Fix completing IRPs with 0 bytes received when getting the data from the connection's packet queue - Eliminate memory leaks caused by unreleased pbufs - Get rid of s...
by cmihail@svn.reactos.org
Author: cmihail Date: Tue Jul 26 11:25:24 2011 New Revision: 52894 URL:
http://svn.reactos.org/svn/reactos?rev=52894&view=rev
Log: [lwIP/TCPIP] - Fix completing IRPs with 0 bytes received when getting the data from the connection's packet queue - Eliminate memory leaks caused by unreleased pbufs - Get rid of some commented code In principle the speed issue with lwIP should be pretty much solved now. There's still some minor things to iron out that testing will reveal probably. Initial tests like running opera, downloading stuff etc seem to be very encouraging however. Modified: branches/GSoC_2011/TcpIpDriver/lib/drivers/ip/transport/tcp/event.c branches/GSoC_2011/TcpIpDriver/lib/drivers/ip/transport/tcp/tcp.c branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/rostcp.c Modified: branches/GSoC_2011/TcpIpDriver/lib/drivers/ip/transport/tcp/event.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/TcpIpDriver/lib/drive…
============================================================================== --- branches/GSoC_2011/TcpIpDriver/lib/drivers/ip/transport/tcp/event.c [iso-8859-1] (original) +++ branches/GSoC_2011/TcpIpDriver/lib/drivers/ip/transport/tcp/event.c [iso-8859-1] Tue Jul 26 11:25:24 2011 @@ -46,7 +46,6 @@ ExFreePoolWithTag(Bucket, TDI_BUCKET_TAG); } -static VOID CompleteBucket(PCONNECTION_ENDPOINT Connection, PTDI_BUCKET Bucket, BOOLEAN Synchronous) { @@ -149,22 +148,10 @@ DbgPrint("[IP, TCPFinEventHandler] Called for Connection( 0x%x )-> SocketContext = pcb (0x%x)\n", Connection, Connection->SocketContext); /* Only clear the pointer if the shutdown was caused by an error */ - if ((err != ERR_OK))// && (status != STATUS_REMOTE_DISCONNECT)) + if ((err != ERR_OK)) { /* We're already closed by the error so we don't want to call lwip_close */ DbgPrint("[IP, TCPFinEventHandler] MAKING Connection( 0x%x )-> SocketContext = pcb (0x%x) NULL\n", Connection, Connection->SocketContext); - - // close all possible callbacks - /*tcp_arg((PTCP_PCB)Connection->SocketContext, NULL); - - if (((PTCP_PCB)Connection->SocketContext)->state != LISTEN) - { - tcp_recv((PTCP_PCB)Connection->SocketContext, NULL); - tcp_sent((PTCP_PCB)Connection->SocketContext, NULL); - tcp_err((PTCP_PCB)Connection->SocketContext, NULL); - } - - tcp_accept((PTCP_PCB)Connection->SocketContext, NULL);*/ Connection->SocketContext = NULL; } Modified: branches/GSoC_2011/TcpIpDriver/lib/drivers/ip/transport/tcp/tcp.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/TcpIpDriver/lib/drive…
============================================================================== --- branches/GSoC_2011/TcpIpDriver/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1] (original) +++ branches/GSoC_2011/TcpIpDriver/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1] Tue Jul 26 11:25:24 2011 @@ -428,7 +428,7 @@ /* Freed in TCPSocketState */ Bucket = ExAllocatePoolWithTag( NonPagedPool, sizeof(*Bucket), TDI_BUCKET_TAG ); - if( !Bucket ) + if (!Bucket) { TI_DbgPrint(DEBUG_TCP,("[IP, TCPReceiveData] Failed to allocate bucket\n")); UnlockObject(Connection, OldIrql); @@ -438,20 +438,25 @@ Bucket->Request.RequestNotifyObject = Complete; Bucket->Request.RequestContext = Context; - *BytesReceived = 0; - + InsertTailList( &Connection->ReceiveRequest, &Bucket->Entry ); TI_DbgPrint(DEBUG_TCP,("[IP, TCPReceiveData] Queued read irp\n")); UnlockObject(Connection, OldIrql); TI_DbgPrint(DEBUG_TCP,("[IP, TCPReceiveData] Leaving. Status = STATUS_PENDING\n")); + + (*BytesReceived) = 0; + } + else + { + (*BytesReceived) = Received; } DbgPrint("[IP, TCPReceiveData] Leaving. Status = %s\n", Status == STATUS_PENDING? "STATUS_PENDING" : "STATUS_SUCCESS"); - return STATUS_PENDING; + return Status; } NTSTATUS TCPSendData Modified: branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/rostcp.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/TcpIpDriver/lib/drive…
============================================================================== --- branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/rostcp.c [iso-8859-1] (original) +++ branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/rostcp.c [iso-8859-1] Tue Jul 26 11:25:24 2011 @@ -47,7 +47,7 @@ qp = CONTAINING_RECORD(Entry, QUEUE_ENTRY, ListEntry); // reenable this later - //pbuf_free(qp->p); + pbuf_free(qp->p); ExFreePoolWithTag(qp, LWIP_TAG); } @@ -92,7 +92,7 @@ RecvLen = MIN(p->tot_len, RecvLen); - for ((*Received) = 0; (*Received) < RecvLen; *Received += p->len, p = p->next) + for ((*Received) = 0; (*Received) < RecvLen; (*Received) += p->len, p = p->next) { DbgPrint("[lwIP, LibTCPGetDataFromConnectionQueue] 0x%x: Copying %d bytes to 0x%x from 0x%x\n", p, p->len, ((PUCHAR)RecvBuffer) + (*Received), p->payload); @@ -101,7 +101,7 @@ } // reenable this later - //pbuf_free(qp->p); + pbuf_free(qp->p); ExFreePoolWithTag(qp, LWIP_TAG); Status = STATUS_SUCCESS;
13 years, 5 months
1
0
0
0
← Newer
1
...
9
10
11
12
13
14
15
...
52
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
Results per page:
10
25
50
100
200