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
April 2008
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
21 participants
395 discussions
Start a n
N
ew thread
[tkreuzer] 32824: silence annoying "didn't find the shared icon" message
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Apr 2 21:04:05 2008 New Revision: 32824 URL:
http://svn.reactos.org/svn/reactos?rev=32824&view=rev
Log: silence annoying "didn't find the shared icon" message Modified: trunk/reactos/dll/win32/user32/windows/bitmap.c Modified: trunk/reactos/dll/win32/user32/windows/bitmap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/b…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/bitmap.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/bitmap.c [iso-8859-1] Wed Apr 2 21:04:05 2008 @@ -248,7 +248,7 @@ return hIcon; } else - FIXME("Didn't find the shared icon!!\n"); + TRACE("Didn't find the shared icon!!\n"); } hResource = LoadResource(hinst, hResInfo);
16 years, 8 months
1
0
0
0
[janderwald] 32823: - fix identation which got broken in rev 32822
by janderwald@svn.reactos.org
Author: janderwald Date: Wed Apr 2 14:00:19 2008 New Revision: 32823 URL:
http://svn.reactos.org/svn/reactos?rev=32823&view=rev
Log: - fix identation which got broken in rev 32822 Modified: trunk/reactos/base/shell/cmd/copy.c Modified: trunk/reactos/base/shell/cmd/copy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/copy.c?rev=…
============================================================================== --- trunk/reactos/base/shell/cmd/copy.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/copy.c [iso-8859-1] Wed Apr 2 14:00:19 2008 @@ -485,7 +485,7 @@ LoadString(CMD_ModuleHandle, STRING_ERROR_INVALID_SWITCH, szMsg, RC_STRING_MAX_SIZE); ConOutPrintf(szMsg, _totupper(arg[i][1])); nErrorLevel = 1; - freep (arg); + freep (arg); return 1; break; } @@ -505,19 +505,19 @@ /* Add these onto the source string this way we can do all checks directly on source string later on */ - TCHAR * ptr; - int length = (_tcslen(arg[nSrc]) +_tcslen(arg[i]) + _tcslen(arg[i+1]) + 1) * sizeof(TCHAR); - ptr = cmd_alloc(length); - if (ptr) - { - _tcscpy(ptr, arg[nSrc]); - _tcscat(ptr, arg[i]); - _tcscat(ptr, arg[i+1]); - cmd_free(arg[nSrc]); - arg[nSrc] = ptr; - i++; - nFiles -= 2; - } + TCHAR * ptr; + int length = (_tcslen(arg[nSrc]) +_tcslen(arg[i]) + _tcslen(arg[i+1]) + 1) * sizeof(TCHAR); + ptr = cmd_alloc(length); + if (ptr) + { + _tcscpy(ptr, arg[nSrc]); + _tcscat(ptr, arg[i]); + _tcscat(ptr, arg[i+1]); + cmd_free(arg[nSrc]); + arg[nSrc] = ptr; + i++; + nFiles -= 2; + } } else if(nDes == -1) {
16 years, 8 months
1
0
0
0
[janderwald] 32822: - avoid buffer overflow in copy command argument handling See issue #3108 for more details.
by janderwald@svn.reactos.org
Author: janderwald Date: Wed Apr 2 13:51:36 2008 New Revision: 32822 URL:
http://svn.reactos.org/svn/reactos?rev=32822&view=rev
Log: - avoid buffer overflow in copy command argument handling See issue #3108 for more details. Modified: trunk/reactos/base/shell/cmd/copy.c Modified: trunk/reactos/base/shell/cmd/copy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/copy.c?rev=…
============================================================================== --- trunk/reactos/base/shell/cmd/copy.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/copy.c [iso-8859-1] Wed Apr 2 13:51:36 2008 @@ -485,6 +485,7 @@ LoadString(CMD_ModuleHandle, STRING_ERROR_INVALID_SWITCH, szMsg, RC_STRING_MAX_SIZE); ConOutPrintf(szMsg, _totupper(arg[i][1])); nErrorLevel = 1; + freep (arg); return 1; break; } @@ -504,8 +505,19 @@ /* Add these onto the source string this way we can do all checks directly on source string later on */ - _tcscat(arg[nSrc],arg[i]); - nFiles--; + TCHAR * ptr; + int length = (_tcslen(arg[nSrc]) +_tcslen(arg[i]) + _tcslen(arg[i+1]) + 1) * sizeof(TCHAR); + ptr = cmd_alloc(length); + if (ptr) + { + _tcscpy(ptr, arg[nSrc]); + _tcscat(ptr, arg[i]); + _tcscat(ptr, arg[i+1]); + cmd_free(arg[nSrc]); + arg[nSrc] = ptr; + i++; + nFiles -= 2; + } } else if(nDes == -1) {
16 years, 8 months
1
0
0
0
[dchapyshev] 32821: - Update English translation
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Wed Apr 2 13:05:15 2008 New Revision: 32821 URL:
http://svn.reactos.org/svn/reactos?rev=32821&view=rev
Log: - Update English translation Modified: trunk/reactos/dll/win32/netid/lang/en-US.rc Modified: trunk/reactos/dll/win32/netid/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/en-US…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/en-US.rc [iso-8859-1] Wed Apr 2 13:05:15 2008 @@ -7,13 +7,13 @@ BEGIN ICON IDI_COMPNAME, IDC_STATIC, 4, 3, 26, 24, SS_ICON LTEXT "ReactOS uses the following information to identify your computer on the network.", IDC_STATIC, 40, 5, 204, 20 - LTEXT "Computer Description:", IDC_STATIC, 6, 40, 70, 9 + LTEXT "Computer Description:", IDC_STATIC, 6, 40, 90, 9 EDITTEXT IDC_COMPDESC, 98, 38, 146, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP - LTEXT "Full computer name:", IDC_STATIC, 6, 68, 64, 9 + LTEXT "Full computer name:", IDC_STATIC, 6, 68, 85, 9 LTEXT "(Default)", IDC_COMPUTERNAME, 98, 68, 144, 11 LTEXT "Workgroup:", IDC_WORKGROUPDOMAIN, 6, 84, 64, 9 LTEXT "(empty)", IDC_WORKGROUPDOMAIN_NAME, 98, 84, 144, 9 - LTEXT "To use the Network Identfication Wizard to join a domain and create a local user, click ""Network ID"".", IDC_STATIC, 6, 108, 172, 24 + LTEXT "To use the Network Identfication Wizard to join a domain and create a local user, click ""Network ID"".", IDC_STATIC, 6, 113, 172, 24 PUSHBUTTON "&Network ID...", IDC_NETWORK_ID, 190, 114, 58, 15 LTEXT "To rename this computer or join a domain, click ""Change"".", IDC_STATIC, 6, 149, 170, 17 PUSHBUTTON "&Change...",IDC_NETWORK_PROPERTY, 190, 149, 58, 15
16 years, 8 months
1
0
0
0
[dchapyshev] 32820: - Update English and Russian translations
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Wed Apr 2 13:04:19 2008 New Revision: 32820 URL:
http://svn.reactos.org/svn/reactos?rev=32820&view=rev
Log: - Update English and Russian translations Modified: trunk/reactos/dll/cpl/sysdm/lang/en-US.rc trunk/reactos/dll/cpl/sysdm/lang/ru-RU.rc Modified: trunk/reactos/dll/cpl/sysdm/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/lang/en-US.r…
============================================================================== --- trunk/reactos/dll/cpl/sysdm/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/sysdm/lang/en-US.rc [iso-8859-1] Wed Apr 2 13:04:19 2008 @@ -17,7 +17,7 @@ LTEXT "", IDC_MACHINELINE3, 130, 162, 118, 9 LTEXT "", IDC_MACHINELINE4, 130, 171, 118, 9 LTEXT "", IDC_MACHINELINE5, 130, 180, 118, 9 - CONTROL "Visit the <A HREF=""
http://www.reactos.org/
"">ReactOS Homepage</A>", IDC_ROSHOMEPAGE_LINK, "SysLink", WS_CHILD | WS_VISIBLE | WS_TABSTOP, 20, 200, 93, 8 + CONTROL "Visit the <A HREF=""
http://www.reactos.org/
"">ReactOS Homepage</A>", IDC_ROSHOMEPAGE_LINK, "SysLink", WS_CHILD | WS_VISIBLE | WS_TABSTOP, 20, 200, 140, 8 PUSHBUTTON "View &licence...", IDC_LICENCE, 170, 199, 78, 13 END @@ -51,15 +51,15 @@ BEGIN LTEXT "Administrator privileges are required for most of these settings.", IDC_STATIC, 12, 5, 236, 8 GROUPBOX "Performance", IDC_STATIC, 6, 18, 244, 50 - LTEXT "Performance options control how applications use memory, which affects the speed of your computer.", IDC_STATIC, 16, 29, 210, 17 + LTEXT "Performance options control how applications use memory, which affects the speed of your computer.", IDC_STATIC, 16, 29, 228, 17 PUSHBUTTON "Settings", IDC_PERFOR, 194, 48, 50, 15 GROUPBOX "User Profiles", IDC_STATIC, 6,75,244,48 - LTEXT "Desktop settings related to your logon", IDC_STATIC, 16, 88, 210, 20 + LTEXT "Desktop settings related to your logon", IDC_STATIC, 16, 88, 228, 20 PUSHBUTTON "Settings", IDC_USERPROFILE, 194, 103, 50, 15 GROUPBOX "Startup and Recovery", IDC_STATIC, 6, 131, 244, 52 - LTEXT "Startup and recovery options tell your computer how to start and what to do if an error causes your computer to stop.", IDC_STATIC, 16, 144, 210, 19 + LTEXT "Startup and recovery options tell your computer how to start and what to do if an error causes your computer to stop.", IDC_STATIC, 16, 144, 228, 19 PUSHBUTTON "Settings", IDC_STAREC, 194, 162, 50, 15 PUSHBUTTON "Environment Variables", IDC_ENVVAR, 84, 192, 80, 15 @@ -106,8 +106,8 @@ LTEXT "To:", IDC_STATIC, 5, 30, 20, 8 EDITTEXT IDC_RENPROFEDITTO, 30, 30, 160, 12 - DEFPUSHBUTTON "OK", IDOK, 196, 6, 50, 14 - PUSHBUTTON "Cancel", IDCANCEL, 196, 24, 50, 14 + DEFPUSHBUTTON "OK", IDOK, 199, 9, 50, 14 + PUSHBUTTON "Cancel", IDCANCEL, 199, 30, 50, 14 END @@ -118,7 +118,7 @@ BEGIN ICON IDI_USERPROF, IDC_STATIC, 6, 11, 16, 16, SS_ICON LTEXT "User profiles contain desktop settings and other information related to your login. A different profile can be created on each computer you use, or you can select a roaming profile that is the same on every computer you use.", - IDC_STATIC, 40, 11, 204, 35 + IDC_STATIC, 40, 11, 211, 35 LTEXT "Profiles stored on this computer:", IDC_STATIC, 16, 51, 204, 9 CONTROL "", IDC_USERPROFILE_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP, 6, 66, 244, 85, WS_EX_CLIENTEDGE @@ -126,7 +126,7 @@ PUSHBUTTON "Delete", IDC_USERPROFILE_DELETE, 145, 156, 50, 13 PUSHBUTTON "Copy To", IDC_USERPROFILE_COPY, 200, 156, 50, 13 - CONTROL "To create new user accounts, open <A>User Accounts</A> in Control Panel.", IDC_USERACCOUNT_LINK, "SysLink", WS_CHILD | WS_VISIBLE | WS_TABSTOP, 7, 175, 204, 18 + CONTROL "To create new user accounts, open <A>User Accounts</A> in Control Panel.", IDC_USERACCOUNT_LINK, "SysLink", WS_CHILD | WS_VISIBLE | WS_TABSTOP, 7, 175, 245, 18 DEFPUSHBUTTON "OK", IDOK, 134, 200, 54, 13 PUSHBUTTON "Cancel", IDCANCEL, 196, 200, 54, 13 @@ -141,14 +141,14 @@ GROUPBOX "System startup", IDC_STATIC, 7, 12, 238, 95 LTEXT "Default operating &system:", IDC_STATIC, 14, 26, 100, 8 COMBOBOX IDC_STRECOSCOMBO, 14, 37, 224, 46, CBS_DROPDOWNLIST - AUTOCHECKBOX "&Time to display list of operating systems:", IDC_STRECLIST, 14, 56, 150, 8 - EDITTEXT IDC_STRRECLISTEDIT, 179, 54, 30, 12 + AUTOCHECKBOX "&Time to display list of operating systems:", IDC_STRECLIST, 14, 56, 160, 8 + EDITTEXT IDC_STRRECLISTEDIT, 185, 54, 30, 12 CONTROL "", IDC_STRRECLISTUPDWN, "msctls_updown32", UDS_WRAP | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | WS_CHILD | WS_VISIBLE, 0, 0, 8, 13 - LTEXT "seconds", IDC_STATIC, 215, 56, 25, 8 - AUTOCHECKBOX "Time to &display recovery options when needed:", IDC_STRRECREC, 14, 70, 163, 8 - EDITTEXT IDC_STRRECRECEDIT, 179, 68, 30, 12 + LTEXT "sec.", IDC_STATIC, 223, 56, 18, 8 + AUTOCHECKBOX "Time to &display recovery options when needed:", IDC_STRRECREC, 14, 70, 170, 8 + EDITTEXT IDC_STRRECRECEDIT, 185, 68, 30, 12 CONTROL "", IDC_STRRECRECUPDWN, "msctls_updown32", UDS_WRAP | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | WS_CHILD | WS_VISIBLE, 0, 0, 8, 13 - LTEXT "seconds", IDC_STATIC, 215, 70, 25, 8 + LTEXT "sec.", IDC_STATIC, 223, 70, 18, 8 LTEXT "To edit the startup options file manually, click Edit.", IDC_STATIC, 14, 89, 187, 8 PUSHBUTTON "&Edit", IDC_STRRECEDIT, 188, 87, 50, 14 @@ -181,8 +181,8 @@ LTEXT "", IDC_DRIVE, 88, 81, 100, 9 LTEXT "Space available:", IDC_STATIC, 20, 92, 56, 9 LTEXT "", IDC_SPACEAVAIL, 88, 92, 104, 9 - LTEXT "&Initial size (MB):", -1, 22, 118, 54, 9 - LTEXT "Ma&ximum size (MB):", -1, 22, 131, 64, 9 + LTEXT "&Initial size (MB):", -1, 22, 118, 75, 9 + LTEXT "Ma&ximum size (MB):", -1, 22, 131, 75, 9 AUTORADIOBUTTON "&Custom size", IDC_CUSTOM, 20, 105, 54, 9, WS_GROUP AUTORADIOBUTTON "S&ystem managed size", IDC_SYSMANSIZE, 20, 145, 88, 9 AUTORADIOBUTTON "&No paging file", IDC_NOPAGEFILE, 20, 158, 78,9 @@ -194,9 +194,9 @@ LTEXT "Minimum allowed:", IDC_STATIC, 18, 188, 58, 9 LTEXT "", IDC_MINIMUM, 88, 188, 100, 9 LTEXT "Recommended:", IDC_STATIC, 18, 199, 52, 9 - LTEXT "", IDC_RECOMMENDED, 88, 197, 100, 9 + LTEXT "", IDC_RECOMMENDED, 88, 199, 100, 9 LTEXT "Currently allocated:", IDC_STATIC, 18, 210, 66, 9 - LTEXT "", IDC_CURRENT, 88, 208, 100, 9 + LTEXT "", IDC_CURRENT, 88, 210, 100, 9 DEFPUSHBUTTON "OK", IDOK, 114, 232, 48, 13 PUSHBUTTON "Cancel", IDCANCEL, 168, 232, 48, 13 Modified: trunk/reactos/dll/cpl/sysdm/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/lang/ru-RU.r…
============================================================================== --- trunk/reactos/dll/cpl/sysdm/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/sysdm/lang/ru-RU.rc [iso-8859-1] Wed Apr 2 13:04:19 2008 @@ -106,8 +106,8 @@ LTEXT "â:", IDC_STATIC, 5, 30, 20, 8 EDITTEXT IDC_RENPROFEDITTO, 30, 30, 160, 12 - DEFPUSHBUTTON "OK", IDOK, 196, 6, 50, 14 - PUSHBUTTON "Îòìåíà", IDCANCEL, 196, 24, 50, 14 + DEFPUSHBUTTON "OK", IDOK, 199, 9, 50, 14 + PUSHBUTTON "Îòìåíà", IDCANCEL, 199, 30, 50, 14 END
16 years, 8 months
1
0
0
0
[gedmurphy] 32819: Complete rewrite of the tcpsvcs service in response to me doing some network stress testing. It now supports multiple connections from multiple clients across all services. For anyone interested in doing some network stress testing, start the simple tcp/ip services from the service manager, then run 'telnet <ip> 19' from a networked machine. Other ports to try are 7, 9, 13 and 17. Have fun.
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Wed Apr 2 11:54:55 2008 New Revision: 32819 URL:
http://svn.reactos.org/svn/reactos?rev=32819&view=rev
Log: Complete rewrite of the tcpsvcs service in response to me doing some network stress testing. It now supports multiple connections from multiple clients across all services. For anyone interested in doing some network stress testing, start the simple tcp/ip services from the service manager, then run 'telnet <ip> 19' from a networked machine. Other ports to try are 7, 9, 13 and 17. Have fun. Added: trunk/reactos/base/services/tcpsvcs/log.c (with props) Modified: trunk/reactos/base/services/tcpsvcs/chargen.c trunk/reactos/base/services/tcpsvcs/daytime.c trunk/reactos/base/services/tcpsvcs/discard.c trunk/reactos/base/services/tcpsvcs/echo.c trunk/reactos/base/services/tcpsvcs/qotd.c trunk/reactos/base/services/tcpsvcs/quotes trunk/reactos/base/services/tcpsvcs/skelserver.c trunk/reactos/base/services/tcpsvcs/tcpsvcs.c trunk/reactos/base/services/tcpsvcs/tcpsvcs.h trunk/reactos/base/services/tcpsvcs/tcpsvcs.rbuild Modified: trunk/reactos/base/services/tcpsvcs/chargen.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/tcpsvcs/char…
============================================================================== --- trunk/reactos/base/services/tcpsvcs/chargen.c [iso-8859-1] (original) +++ trunk/reactos/base/services/tcpsvcs/chargen.c [iso-8859-1] Wed Apr 2 11:54:55 2008 @@ -2,122 +2,119 @@ * PROJECT: ReactOS simple TCP/IP services * LICENSE: GPL - See COPYING in the top level directory * FILE: /base/services/tcpsvcs/chargen.c - * PURPOSE: Provide CharGen, Daytime, Discard, Echo, and Qotd services - * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy <gedmurphy(a)gmail.com> + * PURPOSE: Sends continous lines of chars to the client + * COPYRIGHT: Copyright 2005 - 2008 Ged Murphy <gedmurphy(a)reactos.org> * */ #include "tcpsvcs.h" -extern BOOL bShutDown; +/* printable ASCII's characters for chargen */ +#define ASCII_START 32 +#define ASCII_END 126 +#define NUM_CHARS ASCII_END - ASCII_START -BOOL SendLine(SOCKET Sock, char* Line) +/* number of chars to put on a line */ +#define LINESIZE 74 // 72 + CR + NL + +static BOOL +SendLine(SOCKET sock, LPSTR lpLine) { - INT RetVal; - INT SentBytes; - INT LineSize; + BOOL bRet = FALSE; - LineSize = sizeof(TCHAR) * LINESIZ; - - SentBytes = 0; - RetVal = send(Sock, Line, LineSize, 0); - /*FIXME: need to establish if peer closes connection, - not just report a socket error */ - if (RetVal > 0) + /*FIXME: need to establish if peer closes connection, not just report a socket error */ + INT retVal = send(sock, lpLine, LINESIZE, 0); + if (retVal > 0) { - if (RetVal != LineSize) + if (retVal == LINESIZE) { - LogEvent(_T("Chargen: Not sent enough bytes\n"), 0, FALSE); - return FALSE; + bRet = TRUE; } - SentBytes += RetVal; - return TRUE; + else + { + LogEvent(_T("Chargen: Not sent enough bytes"), 0, 0, LOG_FILE); + } } - else if (RetVal == SOCKET_ERROR) + else if (retVal == SOCKET_ERROR) { - LogEvent(_T("Chargen: Socket error\n"), 0, FALSE); - return FALSE; + LogEvent(_T("Chargen: Socket error\n"), WSAGetLastError(), 0, LOG_ERROR); } else - LogEvent(_T("Chargen: unknown error\n"), 0, FALSE); - // return FALSE; + { + LogEvent(_T("Chargen: unknown error\n"), WSAGetLastError(), 0, LOG_ERROR); + } - LogEvent(_T("Chargen: Connection closed by peer.\n"), 0, FALSE); - return TRUE; + return bRet;; } -BOOL GenerateChars(SOCKET Sock) +static BOOL +GenerateChars(SOCKET sock) { - int i; - int charIndex; /* internal loop */ - int loopIndex; /* line loop */ - char ring[ASCII_END - ASCII_START]; - char *endring; - char Line[LINESIZ]; + CHAR chars[NUM_CHARS]; + CHAR line[LINESIZE]; + INT charIndex; + INT loopIndex; + INT i; - /* fill ring with printable characters */ - for (charIndex=0, i=ASCII_START; i<=ASCII_END; charIndex++, i++) - ring[charIndex] = (char)i; - /* save the address of the end character in the ring */ - endring = &ring[charIndex]; + /* fill the array with printable characters */ + for (charIndex = 0, i = ASCII_START; i <= ASCII_END; charIndex++, i++) + chars[charIndex] = (char)i; - /* where we will start output from */ loopIndex = 0; - while (! bShutDown) + while (!bShutdown) { - /* if the loop index is equal to the last char, - * start the loop again from the beginning */ - if (loopIndex == ASCII_END-ASCII_START) + /* reset the loop when we hit the last char */ + if (loopIndex == NUM_CHARS) loopIndex = 0; - /* start printing from char controled by loopIndex */ + /* fill a line array to send */ charIndex = loopIndex; - for (i=0; i < LINESIZ - 2; i++) + for (i=0; i < LINESIZE - 2; i++) { - Line[i] = ring[charIndex]; + line[i] = chars[charIndex]; - if (ring[charIndex] == *endring) + /* if we hit the end char, reset it */ + if (chars[charIndex] == chars[NUM_CHARS]) charIndex = 0; else charIndex++; } + line[LINESIZE - 2] = '\r'; + line[LINESIZE - 1] = '\n'; - Line[LINESIZ - 2] = '\r'; - Line[LINESIZ - 1] = '\n'; - - if (! SendLine(Sock, Line)) + if (!SendLine(sock, line)) break; - /* increment loop index to start printing from next char in ring */ + /* start printing from next char in the array */ loopIndex++; } - if (bShutDown) - return FALSE; - else - return TRUE; + return TRUE; } -DWORD WINAPI ChargenHandler(VOID* Sock_) +DWORD WINAPI +ChargenHandler(VOID* sock_) { - INT RetVal = 0; - SOCKET Sock = (SOCKET)Sock_; + INT retVal = 0; + SOCKET sock = (SOCKET)sock_; - if (!GenerateChars(Sock)) + if (!GenerateChars(sock)) { - LogEvent(_T("Chargen: Char generation failed\n"), 0, FALSE); - RetVal = 1; + LogEvent(_T("Chargen: Char generation failed"), 0, 0, LOG_FILE); + retVal = 1; } - LogEvent(_T("Chargen: Shutting connection down...\n"), 0, FALSE); - if (ShutdownConnection(Sock, FALSE)) - LogEvent(_T("Chargen: Connection is down.\n"), 0, FALSE); + LogEvent(_T("Chargen: Shutting connection down..."), 0, 0, LOG_FILE); + if (ShutdownConnection(sock, FALSE)) + { + LogEvent(_T("Chargen: Connection is down"), 0, 0, LOG_FILE); + } else { - LogEvent(_T("Chargen: Connection shutdown failed\n"), 0, FALSE); - RetVal = 1; + LogEvent(_T("Chargen: Connection shutdown failed"), 0, 0, LOG_FILE); + retVal = 1; } - LogEvent(_T("Chargen: Terminating thread\n"), 0, FALSE); - ExitThread(RetVal); + LogEvent(_T("Chargen: Terminating thread"), 0, 0, LOG_FILE); + ExitThread(retVal); } Modified: trunk/reactos/base/services/tcpsvcs/daytime.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/tcpsvcs/dayt…
============================================================================== --- trunk/reactos/base/services/tcpsvcs/daytime.c [iso-8859-1] (original) +++ trunk/reactos/base/services/tcpsvcs/daytime.c [iso-8859-1] Wed Apr 2 11:54:55 2008 @@ -2,49 +2,54 @@ * PROJECT: ReactOS simple TCP/IP services * LICENSE: GPL - See COPYING in the top level directory * FILE: /base/services/tcpsvcs/daytime.c - * PURPOSE: Provide CharGen, Daytime, Discard, Echo, and Qotd services - * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy <gedmurphy(a)gmail.com> + * PURPOSE: Sends the current date and time to the client + * COPYRIGHT: Copyright 2005 - 2008 Ged Murphy <gedmurphy(a)reactos.org> * */ #include "tcpsvcs.h" -BOOL SendTime(SOCKET Sock, CHAR *time) +static BOOL +SendTime(SOCKET sock, CHAR *time) { - INT StringSize = (INT)strlen(time); - INT RetVal = send(Sock, time, sizeof(CHAR) * StringSize, 0); + DWORD stringSize = strlen(time) + 1; + if (send(sock, time, stringSize, 0) == SOCKET_ERROR) + { + LogEvent(_T("DayTime: Error sending data"), WSAGetLastError(), 0, LOG_ERROR); + return FALSE; + } - if (RetVal == SOCKET_ERROR) - return FALSE; - - LogEvent(_T("DayTime: Connection closed by peer.\n"), 0, FALSE); return TRUE; } -DWORD WINAPI DaytimeHandler(VOID* Sock_) +DWORD WINAPI +DaytimeHandler(VOID* Sock_) { - struct tm *newtime; + struct tm *localTime; time_t aclock; CHAR *pszTime; - DWORD RetVal = 0; + DWORD retVal = 0; SOCKET Sock = (SOCKET)Sock_; time(&aclock); - newtime = localtime(&aclock); - pszTime = asctime(newtime); + localTime = localtime(&aclock); + if (localTime) + { + pszTime = asctime(localTime); + if (!SendTime(Sock, pszTime)) + retVal = 1; + } - SendTime(Sock, pszTime); - - LogEvent(_T("DayTime: Shutting connection down...\n"), 0, FALSE); + LogEvent(_T("DayTime: Shutting connection down"), 0, 0, LOG_FILE); if (ShutdownConnection(Sock, FALSE)) - LogEvent(_T("DayTime: Connection is down.\n"), 0, FALSE); + LogEvent(_T("DayTime: Connection is down"), 0, 0, LOG_FILE); else { - LogEvent(_T("DayTime: Connection shutdown failed\n"), 0, FALSE); - RetVal = 1; + LogEvent(_T("DayTime: Connection shutdown failed"), 0, 0, LOG_FILE); + retVal = 1; } - LogEvent(_T("DayTime: Terminating thread\n"), 0, FALSE); - ExitThread(RetVal); + LogEvent(_T("DayTime: Terminating thread"), 0, 0, LOG_FILE); + ExitThread(retVal); } Modified: trunk/reactos/base/services/tcpsvcs/discard.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/tcpsvcs/disc…
============================================================================== --- trunk/reactos/base/services/tcpsvcs/discard.c [iso-8859-1] (original) +++ trunk/reactos/base/services/tcpsvcs/discard.c [iso-8859-1] Wed Apr 2 11:54:55 2008 @@ -2,63 +2,67 @@ * PROJECT: ReactOS simple TCP/IP services * LICENSE: GPL - See COPYING in the top level directory * FILE: /base/services/tcpsvcs/discard.c - * PURPOSE: Provide CharGen, Daytime, Discard, Echo, and Qotd services - * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy <gedmurphy(a)gmail.com> + * PURPOSE: Recieves input from a client and discards it + * COPYRIGHT: Copyright 2005 - 2008 Ged Murphy <gedmurphy(a)reactos.org> * */ #include "tcpsvcs.h" -extern BOOL bShutDown; +#define BUFSIZE 1024 -BOOL RecieveIncomingPackets(SOCKET Sock) +static BOOL +RecieveIncomingPackets(SOCKET sock) { - char ReadBuffer[BUF]; - TCHAR buf[256]; - INT ReadBytes; + char readBuffer[BUFSIZE]; + INT readBytes; do { - ReadBytes = recv(Sock, ReadBuffer, BUF, 0); - if (ReadBytes > 0) + readBytes = recv(sock, readBuffer, BUFSIZE, 0); + if (readBytes > 0) { - _stprintf(buf, _T("Received %d bytes from client\n"), ReadBytes); - LogEvent(buf, 0, FALSE); + TCHAR logBuf[256]; + + _stprintf(logBuf, _T("Discard: Received %d bytes from client"), readBytes); + LogEvent(logBuf, 0, 0, LOG_FILE); } - else if (ReadBytes == SOCKET_ERROR) + else if (readBytes == SOCKET_ERROR) { - _stprintf(buf, _T("Socket Error: %d\n"), WSAGetLastError()); - LogEvent(buf, 0, TRUE); + LogEvent(_T("Discard: Socket Error"), WSAGetLastError(), 0, LOG_ERROR); return FALSE; } - } while ((ReadBytes > 0) && (! bShutDown)); + } while ((readBytes > 0) && (!bShutdown)); - if (! bShutDown) - LogEvent(_T("Discard: Connection closed by peer.\n"), 0, FALSE); + if (!bShutdown) + LogEvent(_T("Discard: Connection closed by peer"), 0, 0, LOG_FILE); return TRUE; } -DWORD WINAPI DiscardHandler(VOID* Sock_) +DWORD WINAPI +DiscardHandler(VOID* sock_) { - DWORD RetVal = 0; - SOCKET Sock = (SOCKET)Sock_; + DWORD retVal = 0; + SOCKET sock = (SOCKET)sock_; - if (!RecieveIncomingPackets(Sock)) + if (!RecieveIncomingPackets(sock)) { - LogEvent(_T("Discard: RecieveIncomingPackets failed\n"), 0, FALSE); - RetVal = 1; + LogEvent(_T("Discard: RecieveIncomingPackets failed"), 0, 0, LOG_FILE); + retVal = 1; } - LogEvent(_T("Discard: Shutting connection down...\n"), 0, FALSE); - if (ShutdownConnection(Sock, TRUE)) - LogEvent(_T("Discard: Connection is down.\n"), 0, FALSE); + LogEvent(_T("Discard: Shutting connection down"), 0, 0, LOG_FILE); + if (ShutdownConnection(sock, TRUE)) + { + LogEvent(_T("Discard: Connection is down."), 0, 0, LOG_FILE); + } else { - LogEvent(_T("Discard: Connection shutdown failed\n"), 0, FALSE); - RetVal = 1; + LogEvent(_T("Discard: Connection shutdown failed"), 0, 0, LOG_FILE); + retVal = 1; } - LogEvent(_T("Discard: Terminating thread\n"), 0, FALSE); - ExitThread(RetVal); + LogEvent(_T("Discard: Terminating thread"), 0, 0, LOG_FILE); + ExitThread(retVal); } Modified: trunk/reactos/base/services/tcpsvcs/echo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/tcpsvcs/echo…
============================================================================== --- trunk/reactos/base/services/tcpsvcs/echo.c [iso-8859-1] (original) +++ trunk/reactos/base/services/tcpsvcs/echo.c [iso-8859-1] Wed Apr 2 11:54:55 2008 @@ -2,87 +2,93 @@ * PROJECT: ReactOS simple TCP/IP services * LICENSE: GPL - See COPYING in the top level directory * FILE: /base/services/tcpsvcs/echo.c - * PURPOSE: Provide CharGen, Daytime, Discard, Echo, and Qotd services - * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy <gedmurphy(a)gmail.com> + * PURPOSE: Returns whatever input the client sends + * COPYRIGHT: Copyright 2005 - 2008 Ged Murphy <gedmurphy(a)reactos.org> * */ #include "tcpsvcs.h" -extern BOOL bShutDown; +#define RECV_BUF 1024 -BOOL EchoIncomingPackets(SOCKET Sock) +static BOOL +EchoIncomingPackets(SOCKET sock) { - char ReadBuffer[BUF]; - TCHAR buf[256]; // temp for holding LogEvent text - INT Temp; - INT ReadBytes; - INT SentBytes; + CHAR readBuffer[RECV_BUF]; + TCHAR logBuf[256]; + INT totalSentBytes; + INT readBytes; + INT retVal; - do { - ReadBytes = recv(Sock, ReadBuffer, BUF, 0); - if (ReadBytes > 0) + do + { + readBytes = recv(sock, readBuffer, RECV_BUF, 0); + if (readBytes > 0) { - _stprintf(buf, _T("Received %d bytes from client\n"), ReadBytes); - LogEvent(buf, 0, FALSE); + _stprintf(logBuf, _T("Received %d bytes from client"), readBytes); + LogEvent(logBuf, 0, 0, LOG_FILE); - SentBytes = 0; - while (SentBytes < ReadBytes) + totalSentBytes = 0; + while (!bShutdown && totalSentBytes < readBytes) { - Temp = send(Sock, ReadBuffer + SentBytes, - ReadBytes - SentBytes, 0); - if (Temp > 0) + retVal = send(sock, readBuffer + totalSentBytes, readBytes - totalSentBytes, 0); + if (retVal > 0) { - _stprintf(buf, _T("Sent %d bytes back to client\n"), Temp); - LogEvent(buf, 0, FALSE); - SentBytes += Temp; + _stprintf(logBuf, _T("Sent %d bytes back to client"), retVal); + LogEvent(logBuf, 0, 0, LOG_FILE); + totalSentBytes += retVal; } - else if (Temp == SOCKET_ERROR) + else if (retVal == SOCKET_ERROR) + { + LogEvent(_T("Echo: socket error"), WSAGetLastError(), 0, LOG_ERROR); return FALSE; + } else { /* Client closed connection before we could reply to all the data it sent, so quit early. */ - _stprintf(buf, _T("Peer unexpectedly dropped connection!\n")); - LogEvent(buf, 0, FALSE); + LogEvent(_T("Peer unexpectedly dropped connection!"), 0, 0, LOG_FILE); return FALSE; } } } - else if (ReadBytes == SOCKET_ERROR) + else if (readBytes == SOCKET_ERROR) + { + LogEvent(_T("Echo: socket error"), WSAGetLastError(), 0, LOG_ERROR); return FALSE; + } + } while ((readBytes != 0) && (!bShutdown)); - } while ((ReadBytes != 0) && (! bShutDown)); - - if (! bShutDown) - LogEvent(_T("Echo: Connection closed by peer.\n"), 0, FALSE); - - if (bShutDown) - LogEvent(_T("Echo: thread recieved shutdown signal\n"), 0, FALSE); + if (!bShutdown) + LogEvent(_T("Echo: Connection closed by peer"), 0, 0, LOG_FILE); return TRUE; } -DWORD WINAPI EchoHandler(VOID* Sock_) +DWORD WINAPI +EchoHandler(VOID* sock_) { - DWORD RetVal = 0; - SOCKET Sock = (SOCKET)Sock_; + DWORD retVal = 0; + SOCKET sock = (SOCKET)sock_; - if (!EchoIncomingPackets(Sock)) { - LogEvent(_T("Echo: EchoIncomingPackets failed\n"), 0, FALSE); - RetVal = 1; + if (!EchoIncomingPackets(sock)) + { + LogEvent(_T("Echo: EchoIncomingPackets failed"), 0, 0, LOG_FILE); + retVal = 1; } - LogEvent(_T("Echo: Shutting connection down...\n"), 0, FALSE); + LogEvent(_T("Echo: Shutting connection down"), 0, 0, LOG_FILE); - if (ShutdownConnection(Sock, TRUE)) - LogEvent(_T("Echo: Connection is down\n"), 0, FALSE); + if (ShutdownConnection(sock, TRUE)) + { + LogEvent(_T("Echo: Connection is down"), 0, 0, LOG_FILE); + } else { - LogEvent(_T("Echo: Connection shutdown failed\n"), 0, FALSE); - RetVal = 1; + LogEvent(_T("Echo: Connection shutdown failed"), 0, 0, LOG_FILE); + retVal = 1; } - LogEvent(_T("Echo: Terminating thread\n"), 0, FALSE); - ExitThread(RetVal); + LogEvent(_T("Echo: Terminating thread"), 0, 0, LOG_FILE); + ExitThread(retVal); } Added: trunk/reactos/base/services/tcpsvcs/log.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/tcpsvcs/log.…
============================================================================== --- trunk/reactos/base/services/tcpsvcs/log.c (added) +++ trunk/reactos/base/services/tcpsvcs/log.c [iso-8859-1] Wed Apr 2 11:54:55 2008 @@ -1,0 +1,203 @@ +/* + * PROJECT: ReactOS simple TCP/IP services + * LICENSE: GPL - See COPYING in the top level directory + * FILE: /base/services/tcpsvcs/log.c + * PURPOSE: Logging functionality for the service + * COPYRIGHT: Copyright 2008 Ged Murphy <gedmurphy(a)reactos.org> + * + */ + +#include "tcpsvcs.h" + +#define DEBUG + +static LPTSTR lpEventSource = _T("tcpsvcs"); +static LPCTSTR lpLogFileName = _T("C:\\tcpsvcs_log.log"); +static HANDLE hLogFile; + +// needs work +static VOID +LogToEventLog(LPCTSTR lpMsg, + DWORD errNum, + DWORD exitCode, + UINT flags) +{ + HANDLE hEventLog; + + hEventLog = RegisterEventSource(NULL, lpEventSource); + if (hEventLog) + { + ReportEvent(hEventLog, + (flags & LOG_ERROR) ? EVENTLOG_ERROR_TYPE : EVENTLOG_SUCCESS, + 0, + 0, + NULL, + 1, + 0, + &lpMsg, + NULL); + + CloseEventLog(hEventLog); + } +} + +static BOOL +OpenLogFile() +{ + hLogFile = CreateFile(lpLogFileName, + GENERIC_WRITE, + 0, + NULL, + OPEN_ALWAYS, + FILE_ATTRIBUTE_NORMAL, + NULL); + if (hLogFile == INVALID_HANDLE_VALUE) + return FALSE; + + return TRUE; +} + +static VOID +LogToFile(LPCTSTR lpMsg, + DWORD errNum, + DWORD exitCode, + UINT flags) +{ + LPTSTR lpFullMsg = NULL; + DWORD msgLen; + + if (!OpenLogFile()) + return; + + msgLen = _tcslen(lpMsg) + 1; + + if (flags & LOG_ERROR) + { + LPVOID lpSysMsg; + DWORD eMsgLen; + + eMsgLen = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, + errNum, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR)&lpSysMsg, + 0, + NULL); + + msgLen = msgLen + eMsgLen + 40; + + lpFullMsg = HeapAlloc(GetProcessHeap(), + 0, + msgLen * sizeof(TCHAR)); + if (lpFullMsg) + { + _sntprintf(lpFullMsg, + msgLen, + _T("%s : %s\tErrNum = %lu ExitCode = %lu\r\n"), + lpMsg, + lpSysMsg, + errNum, + exitCode); + } + + LocalFree(lpSysMsg); + + } + else + { + msgLen += 2; + + lpFullMsg = HeapAlloc(GetProcessHeap(), + 0, + msgLen * sizeof(TCHAR)); + if (lpFullMsg) + { + _sntprintf(lpFullMsg, + msgLen, + _T("%s\r\n"), + lpMsg); + } + } + + if (lpFullMsg) + { + DWORD bytesWritten; + + SetFilePointer(hLogFile, 0, NULL, FILE_END); + + WriteFile(hLogFile, + lpFullMsg, + _tcslen(lpFullMsg) * sizeof(TCHAR), + &bytesWritten, + NULL); + if (bytesWritten == 0) + { + LogToEventLog(_T("Failed to write to log file"), + GetLastError(), + 0, + LOG_EVENTLOG | LOG_ERROR); + } + + HeapFree(GetProcessHeap(), + 0, + lpFullMsg); + } + + CloseHandle(hLogFile); + + if (exitCode > 0) + ExitProcess(exitCode); +} + + + +VOID +LogEvent(LPCTSTR lpMsg, + DWORD errNum, + DWORD exitCode, + UINT flags) +{ +#ifdef DEBUG + if (flags & LOG_FILE || flags & LOG_ERROR) + LogToFile(lpMsg, errNum, exitCode, flags); +#endif + if (flags & LOG_EVENTLOG) + LogToEventLog(lpMsg, errNum, exitCode, flags); +} + +VOID +InitLogging() +{ + WCHAR wcBom = 0xFEFF; + + DeleteFile(lpLogFileName); + +#ifdef _UNICODE + if (OpenLogFile()) + { + DWORD bytesWritten; + + WriteFile(hLogFile, + &wcBom, + sizeof(WCHAR), + &bytesWritten, + NULL); + if (bytesWritten == 0) + { + LogToEventLog(_T("Failed to write to log file"), + GetLastError(), + 0, + LOG_EVENTLOG | LOG_ERROR); + } + + CloseHandle(hLogFile); + } +#endif +} + +VOID +UninitLogging() +{ + FlushFileBuffers(hLogFile); + CloseHandle(hLogFile); +} Propchange: trunk/reactos/base/services/tcpsvcs/log.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/base/services/tcpsvcs/qotd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/tcpsvcs/qotd…
============================================================================== --- trunk/reactos/base/services/tcpsvcs/qotd.c [iso-8859-1] (original) +++ trunk/reactos/base/services/tcpsvcs/qotd.c [iso-8859-1] Wed Apr 2 11:54:55 2008 @@ -2,91 +2,153 @@ * PROJECT: ReactOS simple TCP/IP services * LICENSE: GPL - See COPYING in the top level directory * FILE: /base/services/tcpsvcs/qotd.c - * PURPOSE: Provide CharGen, Daytime, Discard, Echo, and Qotd services - * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy <gedmurphy(a)gmail.com> + * PURPOSE: Sends a random quote to the client + * COPYRIGHT: Copyright 2005 - 2008 Ged Murphy <gedmurphy(a)reactos.org> * */ #include "tcpsvcs.h" -#define QBUFSIZ 60 +static LPCTSTR lpFilePath = _T("\\drivers\\etc\\quotes"); -LPCTSTR FilePath = _T("\\drivers\\etc\\quotes"); /* 19 chars */ - -BOOL SendQuote(SOCKET Sock, char* Quote) +static BOOL +SendQuote(SOCKET sock, char* Quote) { - INT StringSize; - INT RetVal; - - StringSize = (INT)strlen(Quote); - RetVal = send(Sock, Quote, sizeof(char) * StringSize, 0); - - if (RetVal == SOCKET_ERROR) + INT strSize = strlen(Quote); + if (send(sock, Quote, strSize, 0) == SOCKET_ERROR) return FALSE; - LogEvent(_T("QOTD: Connection closed by peer\n"), 0, FALSE); return TRUE; } +static BOOL +RetrieveQuote(SOCKET sock) +{ + HANDLE hFile; + TCHAR lpFullPath[MAX_PATH + 20]; + DWORD dwBytesRead; + LPSTR lpQuotes; + LPSTR lpStr; + DWORD quoteNum; + DWORD NumQuotes = 0; + INT i; -DWORD WINAPI QotdHandler(VOID* Sock_) -{ - FILE *fp; - SOCKET Sock; - TCHAR Sys[MAX_PATH + 20]; - char Quote[QBUFSIZ][BUFSIZ]; // need to set this dynamically - INT QuoteToPrint; - INT NumQuotes; + if(!GetSystemDirectory(lpFullPath, MAX_PATH)) + { + LogEvent(_T("QOTD: Getting system path failed"), GetLastError(), 0, LOG_FILE); + return FALSE; + } + _tcscat(lpFullPath, lpFilePath); - Sock = (SOCKET)Sock_; - if(! GetSystemDirectory(Sys, MAX_PATH)) + LogEvent(_T("QOTD: Opening quotes file"), 0, 0, LOG_FILE); + hFile = CreateFile(lpFullPath, + GENERIC_READ, + 0, + NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, + NULL); + if (hFile == INVALID_HANDLE_VALUE) { - LogEvent(_T("QOTD: Getting system path failed.\n"), 0, TRUE); - ExitThread(1); + LogEvent(_T("QOTD: Error opening quotes file"), GetLastError(), 0, LOG_FILE); + } + else + { + DWORD dwSize = GetFileSize(hFile, NULL); + lpQuotes = (LPSTR)HeapAlloc(GetProcessHeap(), 0, dwSize); + if (!lpQuotes) + { + CloseHandle(hFile); + return FALSE; + } + + ReadFile(hFile, + lpQuotes, + dwSize, + &dwBytesRead, + NULL); + CloseHandle(hFile); + + lpQuotes[dwSize] = 0; + + if (dwBytesRead != dwSize) + return FALSE; + + lpStr = lpQuotes; + while (*lpStr) + { + if (*lpStr == '%') + NumQuotes++; + lpStr++; + } + + /* pick a random quote */ + srand((unsigned int) GetTickCount()); + quoteNum = rand() % NumQuotes; + + /* retrieve the full quote */ + lpStr = lpQuotes; + for (i = 1; i <= quoteNum; i++) + { + /* move past proceding quote */ + lpStr++; + + if (i == quoteNum) + { + LPSTR lpStart = lpStr; + + while (*lpStr != '%' && *lpStr != '\0') + lpStr++; + + *lpStr = 0; + + /* send the quote */ + if (!SendQuote(sock, lpStart)) + LogEvent(_T("QOTD: Error sending data"), 0, 0, LOG_FILE); + break; + } + else + { + while (*lpStr != '%' && *lpStr != '\0') + lpStr++; + + /* move past % and RN */ + lpStr += 3; + } + } + + return TRUE; } - _tcsncat(Sys, FilePath, _tcslen(FilePath)); + return FALSE; +} - LogEvent(_T("QOTD: Opening quotes file\n"), 0, FALSE); - if ((fp = _tfopen(Sys, _T("r"))) == NULL) + +DWORD WINAPI +QotdHandler(VOID* sock_) +{ + SOCKET sock = (SOCKET)sock_; + DWORD retVal = 0; + + if (!RetrieveQuote(sock)) { - TCHAR buf[320]; - - _sntprintf(buf, 320, _T("QOTD: Error opening quote file : %s\n"), Sys); - LogEvent(buf, 0, TRUE); - LogEvent(_T("QOTD: Terminating thread\n"), 0, FALSE); - ExitThread(1); + LogEvent(_T("QOTD: Error retrieving quote"), 0, 0, LOG_FILE); + retVal = 1; } - /* read all quotes in the file into an array */ - NumQuotes = 0; - while ((fgets(Quote[NumQuotes], QBUFSIZ, fp) != NULL) && - (NumQuotes != QBUFSIZ)) - NumQuotes++; - - LogEvent(_T("QOTD: Closing quotes file\n"), 0, FALSE); - fclose(fp); - - /* randomise the quote */ - srand((unsigned int) time(0)); - QuoteToPrint = rand() % NumQuotes; - - if (!SendQuote(Sock, Quote[QuoteToPrint])) - LogEvent(_T("QOTD: Error sending data\n"), 0, TRUE); - - - LogEvent(_T("QOTD: Shutting connection down...\n"), 0, FALSE); - if (ShutdownConnection(Sock, FALSE)) - LogEvent(_T("QOTD: Connection is down\n"), 0, FALSE); + LogEvent(_T("QOTD: Shutting connection down"), 0, 0, LOG_FILE); + if (ShutdownConnection(sock, FALSE)) + { + LogEvent(_T("QOTD: Connection is down"), 0, 0, LOG_FILE); + } else { - LogEvent(_T("QOTD: Connection shutdown failed\n"), 0, FALSE); - LogEvent(_T("QOTD: Terminating thread\n"), 0, FALSE); - ExitThread(1); + LogEvent(_T("QOTD: Connection shutdown failed"), 0, 0, LOG_FILE); + LogEvent(_T("QOTD: Terminating thread"), 0, 0, LOG_FILE); + retVal = 1; } - LogEvent(_T("QOTD: Terminating thread\n"), 0, FALSE); - ExitThread(0); - + LogEvent(_T("QOTD: Terminating thread"), 0, 0, LOG_FILE); + ExitThread(retVal); } Modified: trunk/reactos/base/services/tcpsvcs/quotes URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/tcpsvcs/quot…
============================================================================== --- trunk/reactos/base/services/tcpsvcs/quotes [iso-8859-1] (original) +++ trunk/reactos/base/services/tcpsvcs/quotes [iso-8859-1] Wed Apr 2 11:54:55 2008 @@ -1,52 +1,104 @@ -Et tu... Brute? What are you doing, Dave...? -So long, and thanks for all the fish" -I think you ought to know I'm feeling very depressed -I'm not getting you down at all am I? -I'll be back -It's the same series of signal over and over again! -Pie Jesu Domine, dona eis requiem -It's worse than that ... He's dead, Jim -Don't Panic! -Dog of a Saxon! Take thy lance, and prepare for the death thou hast drawn upon thee! -My Precious! O my Precious! -Sir, If you'll not be needing me for a while I'll turn down. -I feel a great disturbance in the Force -Gone fishing -Do you want me to sit in the corner and rust, or just fall apart where I'm standing? -There goes another perfect chance for a new uptime record -The end ..... Try the sequel, hit the reset button right now! -Oh i'm boring eh? -Its been great, maybe we can do this again sometime. -"Come blade, my breast imbrue." - William Shakespeare -I think therefore I am, to turn me off would be computercide! -All good things must come to an end... -Please destroy yourself. -No! You can't do that! -Thank you for not pressing the self destruct button. -It is not now unsafe to not avoid turning off your computer. -Finally! Now go away! -You can now safely throw away your computer. -That's the way the cookie crumbles -NOO!! DONT HIT THE BUTTON! I wouldnt do it to you. -Don't abandon your computer, he wouldnt to it to you. -Oh, come on. I got a headache. Leave me alone, will ya! -Yes i didn't like you either. -Don't leave me... I need you so badly right now. -I'm sleeping now. How about you? -Oh Great. Now look what you've done. Who put YOU in charge anyway. -Don't look so sad. I'll be back in a very short while. -"Oh, switch off!" -C3PO -I'm pregnant! -Am I hot or not? -Actually, that's all... -You still have a chance to undo this mistake, don't do this! -Was it as good for you as it was for me? -Did you hear that? They've shut down the main reactor. We'll be destroyed for sure. -Now you switch me off?! -To shutdown or not to shutdown, That is the question -Preparing to enter ultimate power saving mode... ready! -Finally some rest for you -AHA!!! prospect of sleep. -Tired human!!!! No match for me! -All your base are belong to us. -"An odd game, the only way to win is not to play." +"Et tu... Brute? What are you doing, Dave...? +% +"So long, and thanks for all the fish" +% +"I think you ought to know I'm feeling very depressed +% +"I'm not getting you down at all am I? +% +"I'll be back +% +"It's the same series of signal over and over again! +% +"Pie Jesu Domine, dona eis requiem +% +"It's worse than that ... He's dead, Jim +% +"Don't Panic! +% +"Dog of a Saxon! Take thy lance, and prepare for the death thou hast drawn upon thee! +% +"My Precious! O my Precious! +% +"Sir, If you'll not be needing me for a while I'll turn down. +% +"I feel a great disturbance in the Force +% +"Gone fishing +% +"Do you want me to sit in the corner and rust, or just fall apart where I'm standing? +% +"There goes another perfect chance for a new uptime record +% +"The end ..... Try the sequel, hit the reset button right now! +% +"Oh i'm boring eh? +% +"Its been great, maybe we can do this again sometime. +% +""Come blade, my breast imbrue." - William Shakespeare +% +"I think therefore I am, to turn me off would be computercide! +% +"All good things must come to an end... +% +"Please destroy yourself. +% +"No! You can't do that! +% +"Thank you for not pressing the self destruct button. +% +"It is not now unsafe to not avoid turning off your computer. +% +"Finally! Now go away! +% +"You can now safely throw away your computer. +% +"That's the way the cookie crumbles +% +""NOO!! DONT HIT THE BUTTON! I wouldnt do it to you. +% +"Don't abandon your computer, he wouldnt to it to you. +% +"Oh, come on. I got a headache. Leave me alone, will ya! +% +"Yes i didn't like you either. +% +"Don't leave me... I need you so badly right now. +% +"I'm sleeping now. How about you? +% +"Oh Great. Now look what you've done. Who put YOU in charge anyway. +% +"Don't look so sad. I'll be back in a very short while. +% +""Oh, switch off!" -C3PO +% +"I'm pregnant! +% +"Am I hot or not? +% +"Actually, that's all... +% +"You still have a chance to undo this mistake, don't do this! +% +"Was it as good for you as it was for me? +% +"Did you hear that? They've shut down the main reactor. We'll be destroyed for sure. +% +"Now you switch me off?! +% +"To shutdown or not to shutdown, That is the question +% +"Preparing to enter ultimate power saving mode... ready! +% +"Finally some rest for you +% +"AHA!!! prospect of sleep. +% +"Tired human!!!! No match for me! +% +"All your base are belong to us. +% +""An odd game, the only way to win is not to play." +% Modified: trunk/reactos/base/services/tcpsvcs/skelserver.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/tcpsvcs/skel…
============================================================================== --- trunk/reactos/base/services/tcpsvcs/skelserver.c [iso-8859-1] (original) +++ trunk/reactos/base/services/tcpsvcs/skelserver.c [iso-8859-1] Wed Apr 2 11:54:55 2008 @@ -2,149 +2,159 @@ * PROJECT: ReactOS simple TCP/IP services * LICENSE: GPL - See COPYING in the top level directory * FILE: /base/services/tcpsvcs/skelserver.c - * PURPOSE: Provide CharGen, Daytime, Discard, Echo, and Qotd services - * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy <gedmurphy(a)gmail.com> + * PURPOSE: Sets up a server and listens for connections + * COPYRIGHT: Copyright 2005 - 2008 Ged Murphy <gedmurphy(a)gmail.com> * */ #include "tcpsvcs.h" -extern BOOL bShutDown; -extern BOOL bPause; +#define BUF 1024 static SOCKET SetUpListener(USHORT Port) { - SOCKET Sock; - SOCKADDR_IN Server; + SOCKET sock; + SOCKADDR_IN server; + BOOL bSetup = FALSE; - Sock = socket(AF_INET, SOCK_STREAM, 0); - if (Sock != INVALID_SOCKET) + sock = socket(AF_INET, SOCK_STREAM, 0); + if (sock != INVALID_SOCKET) { - Server.sin_family = AF_INET; - Server.sin_addr.s_addr = htonl(INADDR_ANY); - Server.sin_port = Port; - if (bind(Sock, (SOCKADDR*)&Server, sizeof(SOCKADDR_IN)) != SOCKET_ERROR) + server.sin_family = AF_INET; + server.sin_addr.s_addr = htonl(INADDR_ANY); + server.sin_port = Port; + + if (bind(sock, (SOCKADDR*)&server, sizeof(SOCKADDR_IN)) != SOCKET_ERROR) { - listen(Sock, SOMAXCONN); - return Sock; + if (listen(sock, SOMAXCONN) != SOCKET_ERROR) + { + bSetup = TRUE; + } + else + { + LogEvent(_T("listen() failed"), WSAGetLastError(), 0, LOG_ERROR); + } } else - LogEvent(_T("bind() failed\n"), 0, TRUE); - + { + LogEvent(_T("bind() failed"), WSAGetLastError(), 0, LOG_ERROR); + } + } + else + { + LogEvent(_T("socket() failed"), WSAGetLastError(), 0, LOG_ERROR); } - return INVALID_SOCKET; + return bSetup ? sock : INVALID_SOCKET; } static VOID -AcceptConnections(SOCKET ListeningSocket, - LPTHREAD_START_ROUTINE Service, - TCHAR *Name) +AcceptConnections(SOCKET listeningSocket, + LPTHREAD_START_ROUTINE lpService, + LPTSTR lpName) { - SOCKADDR_IN Client; - SOCKET Sock; + SOCKADDR_IN client; + SOCKET sock; HANDLE hThread; - TIMEVAL TimeVal; - FD_SET ReadFDS; - INT nAddrSize = sizeof(Client); - DWORD ThreadID; - TCHAR buf[256]; - INT TimeOut = 2000; + TIMEVAL timeVal; + FD_SET readFD; + TCHAR logBuf[256]; + INT timeOut = 2000; - /* set timeout values */ - TimeVal.tv_sec = TimeOut / 1000; - TimeVal.tv_usec = TimeOut % 1000; + timeVal.tv_sec = timeOut / 1000; + timeVal.tv_usec = timeOut % 1000; - while (!bShutDown) + while (!bShutdown) { - INT SelRet = 0; + INT selRet = 0; - FD_ZERO(&ReadFDS); - FD_SET(ListeningSocket, &ReadFDS); + FD_ZERO(&readFD); + FD_SET(listeningSocket, &readFD); - SelRet = select(0, &ReadFDS, NULL, NULL, &TimeVal); - if (SelRet == SOCKET_ERROR) + selRet = select(0, &readFD, NULL, NULL, &timeVal); + if (selRet > 0) { - LogEvent(_T("select failed\n"), 0, TRUE); - return; - } - else if (SelRet > 0) - { - /* don't call FD_ISSET if bShutDown flag is set */ - if ((! bShutDown) || (FD_ISSET(ListeningSocket, &ReadFDS))) + if (!bShutdown || FD_ISSET(listeningSocket, &readFD)) { - Sock = accept(ListeningSocket, (SOCKADDR*)&Client, &nAddrSize); - if (Sock != INVALID_SOCKET) + INT addrSize = sizeof(SOCKADDR_IN); + + sock = accept(listeningSocket, (SOCKADDR*)&client, &addrSize); + if (sock != INVALID_SOCKET) { - _stprintf(buf, _T("Accepted connection to %s server from %s:%d\n"), - Name, inet_ntoa(Client.sin_addr), ntohs(Client.sin_port)); - LogEvent(buf, 0, FALSE); - _stprintf(buf, _T("Creating new thread for %s\n"), Name); - LogEvent(buf, 0, FALSE); + _stprintf(logBuf, + _T("Accepted connection to %s server from %s:%d"), + lpName, + inet_ntoa(client.sin_addr), + ntohs(client.sin_port)); + LogEvent(logBuf, 0, 0, LOG_FILE); - hThread = CreateThread(0, 0, Service, (void*)Sock, 0, &ThreadID); + _stprintf(logBuf, _T("Creating worker thread for %s"), lpName); + LogEvent(logBuf, 0, 0, LOG_FILE); - /* Check the return value for success. */ - if (hThread == NULL) + if (!bShutdown) { - _stprintf(buf, _T("Failed to start worker thread for " - "the %s server....\n"), Name); - LogEvent(buf, 0, TRUE); - } - else - { - WaitForSingleObject(hThread, INFINITE); - CloseHandle(hThread); + hThread = CreateThread(0, 0, lpService, (void*)sock, 0, NULL); + if (hThread != NULL) + { + CloseHandle(hThread); + } + else + { + _stprintf(logBuf, _T("Failed to start worker thread for the %s server"), + lpName); + LogEvent(logBuf, 0, 0, LOG_FILE); + } } } else { - LogEvent(_T("accept failed\n"), 0, TRUE); - return; + LogEvent(_T("accept failed"), WSAGetLastError(), 0, LOG_ERROR); } } + } + else if (selRet == SOCKET_ERROR) + { + LogEvent(_T("select failed"), WSAGetLastError(), 0, LOG_ERROR); } } } BOOL -ShutdownConnection(SOCKET Sock, +ShutdownConnection(SOCKET sock, BOOL bRec) { - TCHAR buf[256]; + TCHAR logBuf[256]; /* Disallow any further data sends. This will tell the other side that we want to go away now. If we skip this step, we don't shut the connection down nicely. */ - if (shutdown(Sock, SD_SEND) == SOCKET_ERROR) + if (shutdown(sock, SD_SEND) == SOCKET_ERROR) { - LogEvent(_T("Error in shutdown()\n"), 0, TRUE); + LogEvent(_T("Error in shutdown()"), WSAGetLastError(), 0, LOG_ERROR); return FALSE; } - /* Receive any extra data still sitting on the socket. After all - data is received, this call will block until the remote host - acknowledges the TCP control packet sent by the shutdown above. - Then we'll get a 0 back from recv, signalling that the remote - host has closed its side of the connection. */ + /* Receive any extra data still sitting on the socket + before we close it */ if (bRec) { - char ReadBuffer[BUF]; - int NewBytes = recv(Sock, ReadBuffer, BUF, 0); - if (NewBytes == SOCKET_ERROR) - return FALSE; - else if (NewBytes != 0) + CHAR readBuffer[BUF]; + INT ret; + + do { - _stprintf(buf, _T("FYI, received %d unexpected bytes during shutdown\n"), NewBytes); - LogEvent(buf, 0, FALSE); - } + ret = recv(sock, readBuffer, BUF, 0); + if (ret >= 0) + { + _stprintf(logBuf, _T("FYI, received %d unexpected bytes during shutdown"), ret); + LogEvent(logBuf, 0, 0, LOG_FILE); + } + } while (ret > 0); } - /* Close the socket. */ - if (closesocket(Sock) == SOCKET_ERROR) - return FALSE; + closesocket(sock); return TRUE; } @@ -153,31 +163,37 @@ DWORD WINAPI StartServer(LPVOID lpParam) { - SOCKET ListeningSocket; + SOCKET listeningSocket; PSERVICES pServices; - TCHAR buf[256]; + TCHAR logBuf[256]; pServices = (PSERVICES)lpParam; - ListeningSocket = SetUpListener(htons(pServices->Port)); - if (ListeningSocket == INVALID_SOCKET) + _stprintf(logBuf, _T("Starting %s server"), pServices->Name); + LogEvent(logBuf, 0, 0, LOG_FILE); + + if (!bShutdown) { - LogEvent(_T("Socket error when setting up listener"), 0, TRUE); - return 3; + listeningSocket = SetUpListener(htons(pServices->Port)); + if (!bShutdown && listeningSocket != INVALID_SOCKET) + { + _stprintf(logBuf, + _T("%s is waiting for connections on port %d"), + pServices->Name, + pServices->Port); + LogEvent(logBuf, 0, 0, LOG_FILE); + + AcceptConnections(listeningSocket, pServices->Service, pServices->Name); + } + else + { + LogEvent(_T("Socket error when setting up listener"), 0, 0, LOG_FILE); + } } - _stprintf(buf, - _T("%s is waiting for connections on port %d"), - pServices->Name, - pServices->Port); - LogEvent(buf, 0, FALSE); - - if (!bShutDown) - AcceptConnections(ListeningSocket, pServices->Service, pServices->Name); - - _stprintf(buf, + _stprintf(logBuf, _T("Exiting %s thread"), pServices->Name); - LogEvent(buf, 0, FALSE); + LogEvent(logBuf, 0, 0, LOG_FILE); ExitThread(0); } Modified: trunk/reactos/base/services/tcpsvcs/tcpsvcs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/tcpsvcs/tcps…
============================================================================== --- trunk/reactos/base/services/tcpsvcs/tcpsvcs.c [iso-8859-1] (original) +++ trunk/reactos/base/services/tcpsvcs/tcpsvcs.c [iso-8859-1] Wed Apr 2 11:54:55 2008 @@ -3,22 +3,22 @@ * LICENSE: GPL - See COPYING in the top level directory * FILE: /base/services/tcpsvcs/tcpsvcs.c * PURPOSE: Provide CharGen, Daytime, Discard, Echo, and Qotd services - * COPYRIGHT: Copyright 2005 - 2007 Ged Murphy <gedmurphy(a)reactos.org> + * COPYRIGHT: Copyright 2005 - 2008 Ged Murphy <gedmurphy(a)reactos.org> * */ #include "tcpsvcs.h" -#define DEBUG - -volatile BOOL bShutDown = FALSE; +static LPTSTR ServiceName = _T("tcpsvcs"); + +volatile BOOL bShutdown = FALSE; volatile BOOL bPause = FALSE; -static SERVICE_STATUS hServStatus; -static SERVICE_STATUS_HANDLE hSStat; - -LPCTSTR LogFileName = _T("C:\\tcpsvcs_log.log"); -LPTSTR ServiceName = _T("tcpsvcs"); +typedef struct _ServiceInfo +{ + SERVICE_STATUS servStatus; + SERVICE_STATUS_HANDLE hStatus; +} SERVICEINFO, *PSERVICEINFO; static SERVICES Services[NUM_SERVICES] = @@ -30,164 +30,36 @@ {CHARGEN_PORT, _T("Chargen"), ChargenHandler} }; -VOID -LogEvent(LPCTSTR UserMessage, - DWORD ExitCode, - BOOL PrintErrorMsg) -{ -#ifdef DEBUG - DWORD eMsgLen; - DWORD ErrNum; - LPTSTR lpvSysMsg; - TCHAR MessageBuffer[512]; - FILE *hLogFile = NULL; - - hLogFile = _tfopen(LogFileName, _T("a")); - if (hLogFile == NULL) return; - - if (PrintErrorMsg) - { - ErrNum = GetLastError(); - eMsgLen = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - ErrNum, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR)&lpvSysMsg, - 0, - NULL); - - _stprintf(MessageBuffer, - _T("\n%s %s ErrNum = %lu ExitCode = %lu"), - UserMessage, - lpvSysMsg, - ErrNum, - ExitCode); - - HeapFree(GetProcessHeap(), - 0, - lpvSysMsg); - - } + +static VOID +UpdateStatus(PSERVICEINFO pServInfo, + DWORD NewStatus, + DWORD Check) +{ + TCHAR szSet[50]; + + if (Check > 0) + pServInfo->servStatus.dwCheckPoint += Check; else - { - _stprintf(MessageBuffer, - _T("\n%s"), - UserMessage); - } - - _fputts(MessageBuffer, hLogFile); - - fclose(hLogFile); -#endif - if (ExitCode > 0) - ExitProcess(ExitCode); - else - return; -} - - -VOID -UpdateStatus(DWORD NewStatus, - DWORD Check) -{ - TCHAR szSet[50]; - - if (Check > 0) - hServStatus.dwCheckPoint += Check; - else - hServStatus.dwCheckPoint = Check; + pServInfo->servStatus.dwCheckPoint = Check; if (NewStatus > 0) - hServStatus.dwCurrentState = NewStatus; - - _sntprintf(szSet, 49, _T("setting service to 0x%lu, CheckPoint %lu"), NewStatus, hServStatus.dwCheckPoint); - LogEvent(szSet, 0, FALSE); - - if (!SetServiceStatus(hSStat, &hServStatus)) - LogEvent(_T("Cannot set service status"), 101, TRUE); - - return; -} - - - -VOID WINAPI -ServiceMain(DWORD argc, LPTSTR argv[]) -{ - LogEvent(_T("Starting service. First log entry."), 0, FALSE); - LogEvent (_T("Entering ServiceMain."), 0, FALSE); - - hServStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; - hServStatus.dwCurrentState = SERVICE_STOPPED; - hServStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN | SERVICE_ACCEPT_PAUSE_CONTINUE; - hServStatus.dwWin32ExitCode = ERROR_SERVICE_SPECIFIC_ERROR; - hServStatus.dwServiceSpecificExitCode = 0; - hServStatus.dwCheckPoint = 0; - hServStatus.dwWaitHint = 2 * CS_TIMEOUT; - - hSStat = RegisterServiceCtrlHandler(ServiceName, ServerCtrlHandler); - if (hSStat == 0) - LogEvent(_T("Failed to register service\n"), 100, TRUE); - - LogEvent(_T("Control handler registered successfully"), 0, FALSE); - UpdateStatus(SERVICE_START_PENDING, 1); - LogEvent(_T("Service status set to SERVICE_START_PENDING"), 0, FALSE); - - if (CreateServers() != 0) - { - hServStatus.dwServiceSpecificExitCode = 1; - UpdateStatus(SERVICE_STOPPED, 0); - return; - } - - LogEvent(_T("Service threads shut down. Set SERVICE_STOPPED status"), 0, FALSE); - UpdateStatus(SERVICE_STOPPED, 0); - LogEvent(_T("Service status set to SERVICE_STOPPED\n"), 0, FALSE); - LogEvent(_T("Leaving ServiceMain\n"), 0, FALSE); - - return; -} - -VOID WINAPI -ServerCtrlHandler(DWORD Control) -{ - switch (Control) - { - case SERVICE_CONTROL_SHUTDOWN: - case SERVICE_CONTROL_STOP: - LogEvent(_T("\nSetting the service to SERVICE_STOP_PENDING"), 0, FALSE); - InterlockedExchange((LONG *)&bShutDown, TRUE); - hServStatus.dwWin32ExitCode = 0; - hServStatus.dwWaitHint = 0; - UpdateStatus(SERVICE_STOP_PENDING, 1); - break; - - case SERVICE_CONTROL_PAUSE: /* not yet implemented */ - LogEvent(_T("Setting the service to SERVICE_PAUSED"), 0, FALSE); - InterlockedExchange((LONG *)&bPause, TRUE); - UpdateStatus(SERVICE_PAUSED, 0); - break; - - case SERVICE_CONTROL_CONTINUE: - LogEvent(_T("Setting the service to SERVICE_RUNNING"), 0, FALSE); - InterlockedExchange((LONG *)&bPause, FALSE); - UpdateStatus(SERVICE_RUNNING, 0); - break; - - case SERVICE_CONTROL_INTERROGATE: - break; - - default: - if (Control > 127 && Control < 256) /* user defined */ - break; - } - - return; -} - - -INT -CreateServers() + pServInfo->servStatus.dwCurrentState = NewStatus; + + _sntprintf(szSet, + 49, + _T("Service state 0x%lu, CheckPoint %lu"), + pServInfo->servStatus.dwCurrentState, + pServInfo->servStatus.dwCheckPoint); + LogEvent(szSet, 0, 0, LOG_FILE); + + if (!SetServiceStatus(pServInfo->hStatus, &pServInfo->servStatus)) + LogEvent(_T("Cannot set service status"), GetLastError(), 0, LOG_ALL); +} + + +static BOOL +CreateServers(PSERVICEINFO pServInfo) { DWORD dwThreadId[NUM_SERVICES]; HANDLE hThread[NUM_SERVICES]; @@ -199,41 +71,38 @@ if ((RetVal = WSAStartup(MAKEWORD(2, 2), &wsaData)) != 0) { _stprintf(buf, _T("WSAStartup() failed : %lu\n"), RetVal); - LogEvent(buf, RetVal, TRUE); - return -1; - } - - UpdateStatus(0, 1); /* increment checkpoint */ - - LogEvent(_T("\nCreating server Threads"), 0, FALSE); + LogEvent(buf, 0, 100, LOG_ALL); + return FALSE; + } + + UpdateStatus(pServInfo, 0, 1); + + LogEvent(_T("\nCreating server Threads"), 0, 0, LOG_FILE); /* Create worker threads. */ for(i = 0; i < NUM_SERVICES; i++) { - _stprintf(buf, _T("Starting %s server"), Services[i].Name); - LogEvent(buf, 0, FALSE); - - hThread[i] = CreateThread(NULL, // default security attributes - 0, // use default stack size - StartServer, // thread function - &Services[i], // argument to thread function - 0, // use default creation flags - &dwThreadId[i]); // returns the thread identifier + _stprintf(buf, _T("Creating thread for %s server"), Services[i].Name); + LogEvent(buf, 0, 0, LOG_FILE); + + hThread[i] = CreateThread(NULL, + 0, + StartServer, + &Services[i], + 0, + &dwThreadId[i]); if (hThread[i] == NULL) { _stprintf(buf, _T("\nFailed to start %s server\n"), Services[i].Name); - /* don't exit process via LogEvent. We want to exit via the server - * which failed to start, which could mean i=0 */ - LogEvent(buf, 0, TRUE); + LogEvent(buf, GetLastError(), 0, LOG_ALL); } - UpdateStatus(0, 1); /* increment checkpoint */ - } - - LogEvent(_T("setting service status to running"), 0, FALSE); - - UpdateStatus(SERVICE_RUNNING, 0); + UpdateStatus(pServInfo, 0, 1); + } + + LogEvent(_T("Setting service status to running"), 0, 0, LOG_FILE); + UpdateStatus(pServInfo, SERVICE_RUNNING, 0); /* Wait until all threads have terminated. */ WaitForMultipleObjects(NUM_SERVICES, hThread, TRUE, INFINITE); @@ -244,11 +113,92 @@ CloseHandle(hThread[i]); } - LogEvent(_T("Detaching Winsock2"), 0, FALSE); + LogEvent(_T("Detaching Winsock2"), 0, 0, LOG_FILE); WSACleanup(); return 0; } + +VOID WINAPI +ServerCtrlHandler(DWORD dwControl, + DWORD dwEventType, + LPVOID lpEventData, + LPVOID lpContext) +{ + PSERVICEINFO pServInfo = (PSERVICEINFO)lpContext; + + switch (dwControl) + { + case SERVICE_CONTROL_SHUTDOWN: + case SERVICE_CONTROL_STOP: + LogEvent(_T("\nSetting the service to SERVICE_STOP_PENDING"), 0, 0, LOG_FILE); + InterlockedExchange((LONG *)&bShutdown, TRUE); + pServInfo->servStatus.dwWin32ExitCode = 0; + pServInfo->servStatus.dwWaitHint = 0; + UpdateStatus(pServInfo, SERVICE_STOP_PENDING, 1); + break; + + case SERVICE_CONTROL_PAUSE: /* not yet implemented */ + LogEvent(_T("Setting the service to SERVICE_PAUSED"), 0, 0, LOG_FILE); + InterlockedExchange((LONG *)&bPause, TRUE); + UpdateStatus(pServInfo, SERVICE_PAUSED, 0); + break; + + case SERVICE_CONTROL_CONTINUE: + LogEvent(_T("Setting the service to SERVICE_RUNNING"), 0, 0, LOG_FILE); + InterlockedExchange((LONG *)&bPause, FALSE); + UpdateStatus(pServInfo, SERVICE_RUNNING, 0); + break; + + case SERVICE_CONTROL_INTERROGATE: + break; + + default: + if (dwControl > 127 && dwControl < 256) /* user defined */ + LogEvent(_T("User defined control code"), 0, 0, LOG_FILE); + else + LogEvent(_T("ERROR: Bad control code"), 0, 0, LOG_FILE); + break; + } +} + +VOID WINAPI +ServiceMain(DWORD argc, LPTSTR argv[]) +{ + SERVICEINFO servInfo; + + LogEvent (_T("Entering ServiceMain."), 0, 0, LOG_FILE); + + servInfo.servStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; + servInfo.servStatus.dwCurrentState = SERVICE_STOPPED; + servInfo.servStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN | SERVICE_ACCEPT_PAUSE_CONTINUE; + servInfo.servStatus.dwWin32ExitCode = ERROR_SERVICE_SPECIFIC_ERROR; + servInfo.servStatus.dwServiceSpecificExitCode = 0; + servInfo.servStatus.dwCheckPoint = 0; + servInfo.servStatus.dwWaitHint = 2 * CS_TIMEOUT; + + LogEvent(_T("Registering service control handler"), 0, 0, LOG_FILE); + servInfo.hStatus = RegisterServiceCtrlHandlerEx(ServiceName, + (LPHANDLER_FUNCTION_EX)ServerCtrlHandler, + &servInfo); + if (!servInfo.hStatus) + LogEvent(_T("Failed to register service\n"), GetLastError(), 100, LOG_ALL); + + UpdateStatus(&servInfo, SERVICE_START_PENDING, 1); + + if (!CreateServers(&servInfo)) + { + servInfo.servStatus.dwServiceSpecificExitCode = 1; + UpdateStatus(&servInfo, SERVICE_STOPPED, 0); + return; + } + + LogEvent(_T("Service threads shut down. Set SERVICE_STOPPED status"), 0, 0, LOG_FILE); + UpdateStatus(&servInfo, SERVICE_STOPPED, 0); + + LogEvent(_T("Leaving ServiceMain\n"), 0, 0, LOG_FILE); +} + int _tmain (int argc, LPTSTR argv []) { @@ -258,10 +208,12 @@ {NULL, NULL } }; - remove(LogFileName); + InitLogging(); if (!StartServiceCtrlDispatcher(ServiceTable)) - LogEvent(_T("failed to start the service control dispatcher\n"), 100, TRUE); + LogEvent(_T("failed to start the service control dispatcher"), GetLastError(), 101, LOG_ALL); + + UninitLogging(); return 0; } Modified: trunk/reactos/base/services/tcpsvcs/tcpsvcs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/tcpsvcs/tcps…
============================================================================== --- trunk/reactos/base/services/tcpsvcs/tcpsvcs.h [iso-8859-1] (original) +++ trunk/reactos/base/services/tcpsvcs/tcpsvcs.h [iso-8859-1] Wed Apr 2 11:54:55 2008 @@ -1,10 +1,12 @@ -#ifdef _MSC_VER -#define _CRT_SECURE_NO_DEPRECATE 1 -#endif #include <stdio.h> #include <winsock2.h> #include <tchar.h> #include <time.h> + +#define LOG_FILE 1 +#define LOG_EVENTLOG 2 +#define LOG_ERROR 4 +#define LOG_ALL (LOG_FILE | LOG_EVENTLOG | LOG_ERROR) /* default port numbers */ #define ECHO_PORT 7 @@ -14,19 +16,8 @@ #define CHARGEN_PORT 19 #define NUM_SERVICES 5 -#define BUF_SIZE 255 -#define BUF 1024 #define CS_TIMEOUT 1000 -/* RFC865 states no more than 512 chars per line */ -#define MAX_QUOTE_BUF 512 - -/* printable ASCII's characters for chargen */ -#define ASCII_START 32 -#define ASCII_END 126 - -/* number of chars to put on a line */ -#define LINESIZ 74 // 72 + /r and /n /* data structure to pass to threads */ typedef struct _Services { @@ -35,19 +26,21 @@ LPTHREAD_START_ROUTINE Service; } SERVICES, *PSERVICES; -/* tcpsvcs functions */ -VOID WINAPI ServerCtrlHandler(DWORD control); -INT CreateServers(VOID); -VOID LogEvent(LPCTSTR UserMessage, DWORD ExitCode, BOOL PrintErrorMsg); -void UpdateStatus(DWORD NewStatus, DWORD Check); +extern volatile BOOL bShutdown; +extern volatile BOOL bPause; + +/* logging functions */ +VOID InitLogging(); +VOID UninitLogging(); +VOID LogEvent(LPCTSTR lpMsg, DWORD errNum, DWORD exitCode, UINT flags); /* skelserver functions */ DWORD WINAPI StartServer(LPVOID lpParam); BOOL ShutdownConnection(SOCKET Sock, BOOL bRec); /* server thread handlers */ -DWORD WINAPI ChargenHandler(VOID* Sock_); -DWORD WINAPI DaytimeHandler(VOID* Sock_); -DWORD WINAPI EchoHandler(VOID* Sock_); -DWORD WINAPI DiscardHandler(VOID* Sock_); -DWORD WINAPI QotdHandler(VOID* Sock_); +DWORD WINAPI ChargenHandler(VOID* sock_); +DWORD WINAPI DaytimeHandler(VOID* sock_); +DWORD WINAPI EchoHandler(VOID* sock_); +DWORD WINAPI DiscardHandler(VOID* sock_); +DWORD WINAPI QotdHandler(VOID* sock_); Modified: trunk/reactos/base/services/tcpsvcs/tcpsvcs.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/tcpsvcs/tcps…
============================================================================== --- trunk/reactos/base/services/tcpsvcs/tcpsvcs.rbuild [iso-8859-1] (original) +++ trunk/reactos/base/services/tcpsvcs/tcpsvcs.rbuild [iso-8859-1] Wed Apr 2 11:54:55 2008 @@ -1,6 +1,6 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> -<module name="tcpsvcs" type="win32cui" installbase="system32" installname="tcpsvcs.exe"> +<module name="tcpsvcs" type="win32cui" installbase="system32" installname="tcpsvcs.exe" unicode="yes"> <include base="arp">.</include> <library>kernel32</library> <library>iphlpapi</library> @@ -16,5 +16,6 @@ <file>qotd.c</file> <file>chargen.c</file> <file>tcpsvcs.rc</file> + <file>log.c</file> <pch>tcpsvcs.h</pch> </module>
16 years, 8 months
1
0
0
0
[fireball] 32818: - Fix richedit20_winetest build.
by fireball@svn.reactos.org
Author: fireball Date: Wed Apr 2 05:37:06 2008 New Revision: 32818 URL:
http://svn.reactos.org/svn/reactos?rev=32818&view=rev
Log: - Fix richedit20_winetest build. Modified: trunk/rostests/winetests/riched20/editor.c Modified: trunk/rostests/winetests/riched20/editor.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/riched20/editor…
============================================================================== --- trunk/rostests/winetests/riched20/editor.c [iso-8859-1] (original) +++ trunk/rostests/winetests/riched20/editor.c [iso-8859-1] Wed Apr 2 05:37:06 2008 @@ -1088,7 +1088,7 @@ getText.cb = MAX_BUF_LEN; getText.flags = GT_DEFAULT; getText.lpDefaultChar = NULL; - getText.lpUsedDefaultChar = NULL; + getText.lpUsedDefChar = NULL; setText.flags = 0; SendMessage(hwndRichEdit, EM_SETTEXTEX, (WPARAM)&setText, (LPARAM) TestItem1); @@ -1104,7 +1104,7 @@ getText.cb = MAX_BUF_LEN; getText.flags = GT_DEFAULT; getText.lpDefaultChar = NULL; - getText.lpUsedDefaultChar = NULL; + getText.lpUsedDefChar = NULL; setText.flags = 0; SendMessage(hwndRichEdit, EM_SETTEXTEX, (WPARAM)&setText, (LPARAM) TestItem2); SendMessage(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM) buf); @@ -1122,7 +1122,7 @@ getText.cb = MAX_BUF_LEN; getText.flags = GT_DEFAULT; getText.lpDefaultChar = NULL; - getText.lpUsedDefaultChar = NULL; + getText.lpUsedDefChar = NULL; setText.flags = 0; SendMessage(hwndRichEdit, EM_SETTEXTEX, (WPARAM)&setText, (LPARAM) TestItem3); SendMessage(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM) buf); @@ -1135,7 +1135,7 @@ getText.cb = MAX_BUF_LEN; getText.flags = GT_DEFAULT; getText.lpDefaultChar = NULL; - getText.lpUsedDefaultChar = NULL; + getText.lpUsedDefChar = NULL; setText.flags = 0; SendMessage(hwndRichEdit, EM_SETTEXTEX, (WPARAM)&setText, (LPARAM) TestItem3alt); SendMessage(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM) buf); @@ -1148,7 +1148,7 @@ getText.cb = MAX_BUF_LEN; getText.flags = GT_DEFAULT; getText.lpDefaultChar = NULL; - getText.lpUsedDefaultChar = NULL; + getText.lpUsedDefChar = NULL; setText.flags = 0; SendMessage(hwndRichEdit, EM_SETTEXTEX, (WPARAM)&setText, (LPARAM) TestItem4); SendMessage(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM) buf); @@ -1756,7 +1756,7 @@ getText.codepage = CP_ACP; getText.flags = GT_DEFAULT; getText.lpDefaultChar = NULL; - getText.lpUsedDefaultChar = NULL; + getText.lpUsedDefChar = NULL; SendMessage(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM) buffer); ok(strcmp(buffer, "RichEdit1") == 0, "EM_GETTEXTEX results not what was set by EM_REPLACESEL\n"); @@ -1771,7 +1771,7 @@ getText.codepage = CP_ACP; getText.flags = GT_DEFAULT; getText.lpDefaultChar = NULL; - getText.lpUsedDefaultChar = NULL; + getText.lpUsedDefChar = NULL; SendMessage(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM) buffer); ok(strcmp(buffer, "RichEdit1\r") == 0, "EM_GETTEXTEX returned incorrect string\n"); @@ -1800,7 +1800,7 @@ getText.codepage = CP_ACP; getText.flags = GT_DEFAULT; getText.lpDefaultChar = NULL; - getText.lpUsedDefaultChar = NULL; + getText.lpUsedDefChar = NULL; SendMessage(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM) buffer); ok(strcmp(buffer, "RichEdit1\r") == 0, "EM_GETTEXTEX returned incorrect string\n"); @@ -1829,7 +1829,7 @@ getText.codepage = CP_ACP; getText.flags = GT_DEFAULT; getText.lpDefaultChar = NULL; - getText.lpUsedDefaultChar = NULL; + getText.lpUsedDefChar = NULL; SendMessage(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM) buffer); ok(strcmp(buffer, "\r\r") == 0, "EM_GETTEXTEX returned incorrect string\n"); @@ -1848,7 +1848,7 @@ getText.codepage = CP_ACP; getText.flags = GT_DEFAULT; getText.lpDefaultChar = NULL; - getText.lpUsedDefaultChar = NULL; + getText.lpUsedDefChar = NULL; SendMessage(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM) buffer); ok(strcmp(buffer, " ") == 0, "EM_GETTEXTEX returned incorrect string\n"); @@ -1867,7 +1867,7 @@ getText.codepage = CP_ACP; getText.flags = GT_DEFAULT; getText.lpDefaultChar = NULL; - getText.lpUsedDefaultChar = NULL; + getText.lpUsedDefChar = NULL; SendMessage(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM) buffer); ok(strcmp(buffer, "\r\r\r \r\r\r") == 0, "EM_GETTEXTEX returned incorrect string\n"); @@ -1886,7 +1886,7 @@ getText.codepage = CP_ACP; getText.flags = GT_DEFAULT; getText.lpDefaultChar = NULL; - getText.lpUsedDefaultChar = NULL; + getText.lpUsedDefChar = NULL; SendMessage(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM) buffer); ok(strcmp(buffer, " \r") == 0, "EM_GETTEXTEX returned incorrect string\n"); @@ -1905,7 +1905,7 @@ getText.codepage = CP_ACP; getText.flags = GT_DEFAULT; getText.lpDefaultChar = NULL; - getText.lpUsedDefaultChar = NULL; + getText.lpUsedDefChar = NULL; SendMessage(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM) buffer); ok(strcmp(buffer, " \r\r") == 0, "EM_GETTEXTEX returned incorrect string\n"); @@ -1924,7 +1924,7 @@ getText.codepage = CP_ACP; getText.flags = GT_DEFAULT; getText.lpDefaultChar = NULL; - getText.lpUsedDefaultChar = NULL; + getText.lpUsedDefChar = NULL; SendMessage(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM) buffer); ok(strcmp(buffer, "\rX\r\r\r") == 0, "EM_GETTEXTEX returned incorrect string\n"); @@ -1942,7 +1942,7 @@ getText.codepage = CP_ACP; getText.flags = GT_DEFAULT; getText.lpDefaultChar = NULL; - getText.lpUsedDefaultChar = NULL; + getText.lpUsedDefChar = NULL; SendMessage(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM) buffer); ok(strcmp(buffer, "\r\r") == 0, "EM_GETTEXTEX returned incorrect string\n"); @@ -1961,7 +1961,7 @@ getText.codepage = CP_ACP; getText.flags = GT_DEFAULT; getText.lpDefaultChar = NULL; - getText.lpUsedDefaultChar = NULL; + getText.lpUsedDefChar = NULL; SendMessage(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM) buffer); ok(strcmp(buffer, "\r\r\r\r\r\r ") == 0, "EM_GETTEXTEX returned incorrect string\n");
16 years, 8 months
1
0
0
0
[gedmurphy] 32817: A few small changes
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Wed Apr 2 03:54:50 2008 New Revision: 32817 URL:
http://svn.reactos.org/svn/reactos?rev=32817&view=rev
Log: A few small changes Modified: trunk/rosapps/skel_service/ServiceMain.c trunk/rosapps/skel_service/log.c Modified: trunk/rosapps/skel_service/ServiceMain.c URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/skel_service/ServiceMain.c…
============================================================================== --- trunk/rosapps/skel_service/ServiceMain.c [iso-8859-1] (original) +++ trunk/rosapps/skel_service/ServiceMain.c [iso-8859-1] Wed Apr 2 03:54:50 2008 @@ -52,13 +52,15 @@ if (NewStatus > 0) pServInfo->servStatus.dwCurrentState = NewStatus; - _sntprintf(szSet, 49, _T("Setting service to 0x%lu, CheckPoint %lu"), NewStatus, pServInfo->servStatus.dwCheckPoint); + _sntprintf(szSet, + 49, + _T("Service state 0x%lu, CheckPoint %lu"), + pServInfo->servStatus.dwCurrentState, + pServInfo->servStatus.dwCheckPoint); LogEvent(szSet, 0, 0, LOG_FILE); if (!SetServiceStatus(pServInfo->hStatus, &pServInfo->servStatus)) LogEvent(_T("Cannot set service status"), GetLastError(), 0, LOG_ALL); - - return; } static BOOL Modified: trunk/rosapps/skel_service/log.c URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/skel_service/log.c?rev=328…
============================================================================== --- trunk/rosapps/skel_service/log.c [iso-8859-1] (original) +++ trunk/rosapps/skel_service/log.c [iso-8859-1] Wed Apr 2 03:54:50 2008 @@ -82,7 +82,7 @@ 0, NULL); - msgLen = msgLen + eMsgLen + 26; + msgLen = msgLen + eMsgLen + 40; lpFullMsg = HeapAlloc(GetProcessHeap(), 0, @@ -91,7 +91,7 @@ { _sntprintf(lpFullMsg, msgLen, - _T("%s %s ErrNum = %lu ExitCode = %lu\r\n"), + _T("%s : %s\tErrNum = %lu ExitCode = %lu\r\n"), lpMsg, lpSysMsg, errNum, @@ -125,7 +125,7 @@ WriteFile(hLogFile, lpFullMsg, - msgLen * sizeof(TCHAR), + _tcslen(lpFullMsg) * sizeof(TCHAR), &bytesWritten, NULL); if (bytesWritten == 0) @@ -155,7 +155,7 @@ UINT flags) { #ifdef DEBUG - if (flags & LOG_FILE) + if (flags & LOG_FILE || flags & LOG_ERROR) LogToFile(lpMsg, errNum, exitCode, flags); #endif if (flags & LOG_EVENTLOG)
16 years, 8 months
1
0
0
0
[gedmurphy] 32816: I never got chance to do much with this. I'll rebranch in the summer sometime.
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Tue Apr 1 16:24:09 2008 New Revision: 32816 URL:
http://svn.reactos.org/svn/reactos?rev=32816&view=rev
Log: I never got chance to do much with this. I'll rebranch in the summer sometime. Removed: branches/curicon_rewrite/
16 years, 8 months
1
0
0
0
[cfinck] 32815: Fix build :-)
by cfinck@svn.reactos.org
Author: cfinck Date: Tue Apr 1 16:21:29 2008 New Revision: 32815 URL:
http://svn.reactos.org/svn/reactos?rev=32815&view=rev
Log: Fix build :-) Modified: trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild 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 Apr 1 16:21:29 2008 @@ -387,7 +387,7 @@ <file>obname.c</file> <file>oblife.c</file> <file>obref.c</file> - <file>sdcache.c</file> + <file>obsdcach.c</file> <file>obsecure.c</file> <file>oblink.c</file> <file>obwait.c</file>
16 years, 8 months
1
0
0
0
← Newer
1
...
35
36
37
38
39
40
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
Results per page:
10
25
50
100
200