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
October 2007
----- 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
20 participants
708 discussions
Start a n
N
ew thread
[cwittich] 29459: -fix compilation with msvc -fix some memory leaks
by cwittich@svn.reactos.org
Author: cwittich Date: Mon Oct 8 23:18:42 2007 New Revision: 29459 URL:
http://svn.reactos.org/svn/reactos?rev=29459&view=rev
Log: -fix compilation with msvc -fix some memory leaks Modified: trunk/reactos/tools/rgenstat/rgenstat.c trunk/reactos/tools/sysreg/conf_parser.cpp trunk/reactos/tools/sysreg/rosboot_test.cpp trunk/reactos/tools/sysreg/sysreg.cpp trunk/reactos/tools/sysreg/user_types.h Modified: trunk/reactos/tools/rgenstat/rgenstat.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rgenstat/rgenstat.c?…
============================================================================== --- trunk/reactos/tools/rgenstat/rgenstat.c (original) +++ trunk/reactos/tools/rgenstat/rgenstat.c Mon Oct 8 23:18:42 2007 @@ -13,6 +13,9 @@ #ifdef WIN32 #include <io.h> #include <dos.h> +#include <windows.h> +int __cdecl strcasecmp (const char * __sz1, const char * __sz2) + {return _stricmp (__sz1, __sz2);} #else #include <sys/io.h> #include <errno.h> Modified: trunk/reactos/tools/sysreg/conf_parser.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/conf_parser.c…
============================================================================== --- trunk/reactos/tools/sysreg/conf_parser.cpp (original) +++ trunk/reactos/tools/sysreg/conf_parser.cpp Mon Oct 8 23:18:42 2007 @@ -69,8 +69,8 @@ } } } + fclose(file); return ret; - } //--------------------------------------------------------------------------------------- Modified: trunk/reactos/tools/sysreg/rosboot_test.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/rosboot_test.…
============================================================================== --- trunk/reactos/tools/sysreg/rosboot_test.cpp (original) +++ trunk/reactos/tools/sysreg/rosboot_test.cpp Mon Oct 8 23:18:42 2007 @@ -27,7 +27,7 @@ #include <assert.h> #include <math.h> #include <signal.h> -//#include <io.h> +#include <io.h> namespace Sysreg_ { Modified: trunk/reactos/tools/sysreg/sysreg.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/sysreg.cpp?re…
============================================================================== --- trunk/reactos/tools/sysreg/sysreg.cpp (original) +++ trunk/reactos/tools/sysreg/sysreg.cpp Mon Oct 8 23:18:42 2007 @@ -77,9 +77,11 @@ if (!ret) { cout << "The regression test has failed at stage: " << i << endl; + delete regtest; return -2; } } cout << "The regression test completed successfully" << endl; + delete regtest; return 0; } Modified: trunk/reactos/tools/sysreg/user_types.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/user_types.h?…
============================================================================== --- trunk/reactos/tools/sysreg/user_types.h (original) +++ trunk/reactos/tools/sysreg/user_types.h Mon Oct 8 23:18:42 2007 @@ -18,26 +18,12 @@ #define pclose _pclose #endif - typedef std::basic_string<char> string; - typedef std::basic_istringstream<char> istringstream; +typedef std::basic_string<char> string; +typedef std::basic_istringstream<char> istringstream; - -#ifdef UNICODE - - using std::wcout; - using std::wcerr; - using std::endl; - -#define cout wcout -#define cerr wcerr - -#else - - using std::cout; - using std::cerr; - using std::endl; - -#endif +using std::cout; +using std::cerr; +using std::endl; #endif // end of USER_TYPES_H__
17 years, 2 months
1
0
0
0
[fireball] 29458: Dmitry Chapyshev <lentind@yandex.ru> - Modify/Remove action: Wait for the process completion and only then become active again (like Windows' AppWiz does) - Move Updates to another tab - Move all include directives to appwiz.h - Add context menu for applications list - Slightly change this applet's design - Add an icon for ReactOS setup and Update tabs - Add a working Download! button. This button is active only if Download!.exe exists in system32 directory when appwiz.cpl star
by fireball@svn.reactos.org
Author: fireball Date: Mon Oct 8 19:56:31 2007 New Revision: 29458 URL:
http://svn.reactos.org/svn/reactos?rev=29458&view=rev
Log: Dmitry Chapyshev <lentind(a)yandex.ru> - Modify/Remove action: Wait for the process completion and only then become active again (like Windows' AppWiz does) - Move Updates to another tab - Move all include directives to appwiz.h - Add context menu for applications list - Slightly change this applet's design - Add an icon for ReactOS setup and Update tabs - Add a working Download! button. This button is active only if Download!.exe exists in system32 directory when appwiz.cpl starts - Other small changes Added: trunk/reactos/dll/cpl/appwiz/resources/reactos.ico (with props) trunk/reactos/dll/cpl/appwiz/resources/updates.ico (with props) trunk/reactos/dll/cpl/appwiz/updates.c (with props) Modified: trunk/reactos/dll/cpl/appwiz/add.c trunk/reactos/dll/cpl/appwiz/appwiz.c trunk/reactos/dll/cpl/appwiz/appwiz.h trunk/reactos/dll/cpl/appwiz/appwiz.rbuild trunk/reactos/dll/cpl/appwiz/appwiz.rc trunk/reactos/dll/cpl/appwiz/createlink.c trunk/reactos/dll/cpl/appwiz/lang/en-US.rc trunk/reactos/dll/cpl/appwiz/remove.c trunk/reactos/dll/cpl/appwiz/resource.h trunk/reactos/dll/cpl/appwiz/rossetup.c Modified: trunk/reactos/dll/cpl/appwiz/add.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/add.c?rev=2…
============================================================================== --- trunk/reactos/dll/cpl/appwiz/add.c (original) +++ trunk/reactos/dll/cpl/appwiz/add.c Mon Oct 8 19:56:31 2007 @@ -19,7 +19,7 @@ /* * * PROJECT: ReactOS Software Control Panel - * FILE: dll/cpl/appwiz/appwiz.c + * FILE: dll/cpl/appwiz/add.c * PURPOSE: ReactOS Software Control Panel * PROGRAMMERS: Gero Kuehn (reactos.filter(a)gkware.com) * Dmitry Chapyshev (lentind(a)yandex.ru) @@ -28,19 +28,40 @@ * 09-25-2007 Modify */ -#include <windows.h> -#include <commctrl.h> -#include <cpl.h> - -#include <stdlib.h> -#include <stdio.h> -#include <stdarg.h> -#include <tchar.h> -#include <process.h> - -#include "resource.h" #include "appwiz.h" +BOOL +CheckDownload(VOID) +{ + TCHAR Buf[MAX_PATH]; + if(!GetSystemDirectory(Buf,MAX_PATH)) return FALSE; + lstrcat((LPTSTR)Buf, L"\\downloader.exe"); + if (GetFileAttributes(Buf) != 0xFFFFFFFF) return TRUE; + return FALSE; +} + +BOOL +LaunchDownload(HWND hwndDlg) +{ + STARTUPINFO si; + PROCESS_INFORMATION pi; + TCHAR Buf[MAX_PATH]; + + ZeroMemory(&si, sizeof(si)); + si.cb = sizeof(si); + ZeroMemory(&pi, sizeof(pi)); + + if(!GetSystemDirectory(Buf,MAX_PATH)) return FALSE; + lstrcat((LPTSTR)Buf, L"\\downloader.exe"); + + if(CreateProcess(NULL,Buf,NULL,NULL,FALSE,0,NULL,NULL,&si,&pi)) + { + CloseHandle(pi.hProcess); + CloseHandle(pi.hThread); + return TRUE; + } + return FALSE; +} /* Property page dialog callback */ INT_PTR CALLBACK @@ -54,7 +75,16 @@ { case WM_INITDIALOG: EnableWindow(GetDlgItem(hwndDlg, IDC_INSTALL), FALSE); - break; + if (CheckDownload()) EnableWindow(GetDlgItem(hwndDlg, IDC_ADD_DOWNLOAD_BUTTON), TRUE); + break; + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDC_ADD_DOWNLOAD_BUTTON: + LaunchDownload(hwndDlg); + break; + } + break; } return FALSE; Modified: trunk/reactos/dll/cpl/appwiz/appwiz.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/appwiz.c?re…
============================================================================== --- trunk/reactos/dll/cpl/appwiz/appwiz.c (original) +++ trunk/reactos/dll/cpl/appwiz/appwiz.c Mon Oct 8 19:56:31 2007 @@ -28,17 +28,6 @@ * 09-25-2007 Modify */ -#include <windows.h> -#include <commctrl.h> -#include <cpl.h> - -#include <stdlib.h> -#include <stdio.h> -#include <stdarg.h> -#include <tchar.h> -#include <process.h> - -#include "resource.h" #include "appwiz.h" #define NUM_APPLETS (1) @@ -71,7 +60,7 @@ LONG CALLBACK SystemApplet(VOID) { - PROPSHEETPAGE psp[3]; + PROPSHEETPAGE psp[4]; PROPSHEETHEADER psh; TCHAR Caption[1024]; @@ -90,8 +79,9 @@ psh.pfnCallback = NULL; InitPropSheetPage(&psp[0], IDD_PROPPAGEINSTALL, (DLGPROC) RemovePageProc); - InitPropSheetPage(&psp[1], IDD_PROPPAGEADD, (DLGPROC) AddPageProc); - InitPropSheetPage(&psp[2], IDD_PROPPAGEROSSETUP, (DLGPROC) RosPageProc); + InitPropSheetPage(&psp[1], IDD_PROPPAGEUPDATES, (DLGPROC) UpdatesPageProc); + InitPropSheetPage(&psp[2], IDD_PROPPAGEADD, (DLGPROC) AddPageProc); + InitPropSheetPage(&psp[3], IDD_PROPPAGEROSSETUP, (DLGPROC) RosPageProc); return (LONG)(PropertySheet(&psh) != -1); } Modified: trunk/reactos/dll/cpl/appwiz/appwiz.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/appwiz.h?re…
============================================================================== --- trunk/reactos/dll/cpl/appwiz/appwiz.h (original) +++ trunk/reactos/dll/cpl/appwiz/appwiz.h Mon Oct 8 19:56:31 2007 @@ -1,5 +1,23 @@ #ifndef __CPL_APPWIZ_H #define __CPL_APPWIZ_H + +#include <windows.h> +#include <windowsx.h> /* GET_X/Y_LPARAM */ +#include <commctrl.h> +#include <cpl.h> +#include <prsht.h> +#include <stdlib.h> +#include <stdio.h> +#include <stdarg.h> +#include <tchar.h> +#include <process.h> +#include <prsht.h> +#include <shlobj.h> +#include <objbase.h> +#include <shobjidl.h> +#include <shlguid.h> + +#include "resource.h" typedef LONG (CALLBACK *CPLAPPLET_PROC)(VOID); @@ -26,6 +44,33 @@ INT_PTR CALLBACK RemovePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK +InfoPropDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); + +VOID +AddListColumn(HWND hList, LPTSTR Caption); + +VOID +FillSoftwareList(HWND hwndDlg, BOOL bShowUpdates); + +VOID +AddItemsToViewControl(HWND hwndDlg); + +VOID +FindItems(HWND hwndDlg); + +VOID +CallUninstall(HWND hwndDlg, UINT Control, BOOL isUpdate); + +VOID +GetCurrentView(HWND hwndDlg); + +VOID +CallInformation(HWND hwndDlg); + +VOID +ShowPopupMenu(HWND hwndDlg, UINT ResMenu, INT xPos, INT yPos); + /* add.c */ INT_PTR CALLBACK AddPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); @@ -44,6 +89,10 @@ LONG CALLBACK NewLinkHere(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2); +/* updates.c */ +INT_PTR CALLBACK +UpdatesPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); + void ShowLastWin32Error(HWND hWndOwner); #endif /* __CPL_APPWIZ_H */ Modified: trunk/reactos/dll/cpl/appwiz/appwiz.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/appwiz.rbui…
============================================================================== --- trunk/reactos/dll/cpl/appwiz/appwiz.rbuild (original) +++ trunk/reactos/dll/cpl/appwiz/appwiz.rbuild Mon Oct 8 19:56:31 2007 @@ -19,5 +19,6 @@ <file>add.c</file> <file>rossetup.c</file> <file>createlink.c</file> + <file>updates.c</file> <file>appwiz.rc</file> </module> Modified: trunk/reactos/dll/cpl/appwiz/appwiz.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/appwiz.rc?r…
============================================================================== --- trunk/reactos/dll/cpl/appwiz/appwiz.rc (original) +++ trunk/reactos/dll/cpl/appwiz/appwiz.rc Mon Oct 8 19:56:31 2007 @@ -21,6 +21,8 @@ IDI_RECBINICO ICON "resources/1503.ico" IDI_DOWNLOADICO ICON "resources/1504.ico" IDI_APPINETICO ICON "resources/1505.ico" +IDI_UPDATES ICON "resources/updates.ico" +IDI_REACTOS ICON "resources/reactos.ico" IDB_WATERMARK BITMAP "resources/watermark.bmp" Modified: trunk/reactos/dll/cpl/appwiz/createlink.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/createlink.…
============================================================================== --- trunk/reactos/dll/cpl/appwiz/createlink.c (original) +++ trunk/reactos/dll/cpl/appwiz/createlink.c Mon Oct 8 19:56:31 2007 @@ -1,27 +1,15 @@ - /* $Id: appwiz.c 29364 2007-10-02 23:34:00Z janderwald $ * * PROJECT: ReactOS Software Control Panel * FILE: dll/cpl/appwiz/createlink.c * PURPOSE: ReactOS Software Control Panel - * PROGRAMMER: Johannes Anderwald + * PROGRAMMER: Gero Kuehn (reactos.filter(a)gkware.com) + * Dmitry Chapyshev (lentind(a)yandex.ru) + * Johannes Anderwald + * UPDATE HISTORY: + * 06-17-2004 Created */ -#include <windows.h> -#include <commctrl.h> -#include <cpl.h> -#include <prsht.h> -#include <stdlib.h> -#include <stdio.h> -#include <stdarg.h> -#include <tchar.h> -#include <process.h> -#include <shlobj.h> -#include <objbase.h> -#include <shobjidl.h> -#include <shlguid.h> -#include <stdio.h> -#include "resource.h" #include "appwiz.h" Modified: trunk/reactos/dll/cpl/appwiz/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/lang/en-US.…
============================================================================== --- trunk/reactos/dll/cpl/appwiz/lang/en-US.rc (original) +++ trunk/reactos/dll/cpl/appwiz/lang/en-US.rc Mon Oct 8 19:56:31 2007 @@ -1,4 +1,22 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +IDR_POPUP_APP MENU +BEGIN + POPUP "popup" + BEGIN + MENUITEM "Modify/&Remove",ID_APP_MODIFYREMOVE + MENUITEM "&Information", ID_APP_INFORMATION + END +END + +IDR_POPUP_UPD MENU +BEGIN + POPUP "popup" + BEGIN + MENUITEM "&Remove", ID_UPD_REMOVE + MENUITEM "&Information", ID_UPD_INFORMATION + END +END IDD_PROPPAGEINSTALL DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION @@ -7,14 +25,29 @@ BEGIN ICON IDI_CPLSYSTEM,-1,PROPSHEETPADDING,6,16,16 LTEXT "The following Software can be automatically removed. To remove a program or to modify its installed components, select it from the list and click Modify/Remove.",-1,36,7,PROPSHEETWIDTH-48,32 - CONTROL "&Show updates",IDC_SHOWUPDATES,"button",BS_AUTOCHECKBOX | WS_TABSTOP,PROPSHEETPADDING, 30, 100, 14 - LTEXT "Find:",-1,172,33,50,14 - EDITTEXT IDC_FIND_EDIT, 193, 30, 180, 14, WS_VISIBLE | WS_TABSTOP + LTEXT "Find:",-1,PROPSHEETPADDING,33,50,14 + EDITTEXT IDC_FIND_EDIT, PROPSHEETPADDING+30, 30, 180, 14, WS_VISIBLE | WS_TABSTOP + LTEXT "View:",-1,250,33,40,8 + COMBOBOX IDC_VIEW_COMBO, 280, 30, 94, 80, CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL CONTROL "", IDC_SOFTWARELIST, "SysListView32", LVS_REPORT | LVS_SORTASCENDING | LVS_AUTOARRANGE | LVS_SINGLESEL, PROPSHEETPADDING, 50, PROPSHEETWIDTH-12, 155, WS_EX_CLIENTEDGE PUSHBUTTON "Modify/&Remove", IDC_ADDREMOVE, PROPSHEETPADDING, 210, 80, 14, WS_DISABLED PUSHBUTTON "&Information", IDC_INFO_BUTTON, PROPSHEETPADDING+85, 210, 80, 14, WS_DISABLED - LTEXT "View:",-1,253,212,40,8 - COMBOBOX IDC_VIEW_COMBO, 280, 210, 94, 80, CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL +END + +IDD_PROPPAGEUPDATES DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Remove Updates" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + ICON IDI_UPDATES,-1,PROPSHEETPADDING,6,16,16 + LTEXT "The following Updates can be automatically removed. To remove a update, select it from the list and click Remove.",-1,36,7,PROPSHEETWIDTH-48,32 + LTEXT "Find:",-1,PROPSHEETPADDING,33,50,14 + EDITTEXT IDC_FIND_EDIT, PROPSHEETPADDING+30, 30, 180, 14, WS_VISIBLE | WS_TABSTOP + LTEXT "View:",-1,250,33,40,8 + COMBOBOX IDC_VIEW_COMBO, 280, 30, 94, 80, CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL + CONTROL "", IDC_SOFTWARELIST, "SysListView32", LVS_REPORT | LVS_SORTASCENDING | LVS_AUTOARRANGE | LVS_SINGLESEL, PROPSHEETPADDING, 50, PROPSHEETWIDTH-12, 155, WS_EX_CLIENTEDGE + PUSHBUTTON "&Remove", IDC_ADDREMOVE, PROPSHEETPADDING, 210, 80, 14, WS_DISABLED + PUSHBUTTON "&Information", IDC_INFO_BUTTON, PROPSHEETPADDING+85, 210, 80, 14, WS_DISABLED END IDD_PROPPAGEADD DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT @@ -28,12 +61,12 @@ LTEXT "", -1, PROPSHEETPADDING, 70, PROPSHEETWIDTH-12, 1, NOT WS_GROUP | SS_SUNKEN ICON IDI_DOWNLOADICO,-1,PROPSHEETPADDING,80,32,32 LTEXT "To download and install new applications, press ""Download !"".",-1,36,83,PROPSHEETWIDTH-48,17 - PUSHBUTTON "&Download !", IDC_INSTALL, PROPSHEETWIDTH-(90), 125, 80, 14 + PUSHBUTTON "&Download !", IDC_ADD_DOWNLOAD_BUTTON, PROPSHEETWIDTH-(90), 125, 80, 14, WS_DISABLED LTEXT "", -1, PROPSHEETPADDING, 150, PROPSHEETWIDTH-12, 1, NOT WS_GROUP | SS_SUNKEN ICON IDI_APPINETICO,-1,PROPSHEETPADDING,160,32,32 LTEXT "Press ""Find in the Internet"" button in order to search for new applications available via Internet connection.",-1,36,161,PROPSHEETWIDTH-48,17 - PUSHBUTTON "&Properties...", IDC_INSTALL, PROPSHEETWIDTH-(175), 205, 80, 14 - PUSHBUTTON "&Find in the Internet", IDC_INSTALL, PROPSHEETWIDTH-(90), 205, 80, 14 + PUSHBUTTON "&Properties...", IDC_ADD_PROP_BUTTON, PROPSHEETWIDTH-(175), 205, 80, 14, WS_DISABLED + PUSHBUTTON "&Find in the Internet", IDC_ADD_FIND_BUTTON, PROPSHEETWIDTH-(90), 205, 80, 14, WS_DISABLED END IDD_PROPPAGEROSSETUP DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT @@ -41,7 +74,8 @@ CAPTION "ReactOS Setup" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - + ICON IDI_REACTOS,-1,PROPSHEETPADDING,6,16,16 + LTEXT "",-1,36,7,PROPSHEETWIDTH-48,32 END IDD_FIRSTPAGE DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT @@ -85,6 +119,35 @@ LTEXT "Click Finish to create the shortcut.", -1, 120, 50, 150, 10 END +IDD_INFORMATION DIALOG 5, 100, 269, 200 +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION +CAPTION "Information" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "DisplayName", IDS_INFO_DISPNAME, PROPSHEETPADDING, 8, 160, 24 + LTEXT "Registered Owner:", -1, PROPSHEETPADDING, 25, 160, 17 + LTEXT "", IDS_INFO_REGOWNER, PROPSHEETPADDING+75, 25, 160, 17 + LTEXT "Product ID:", -1, PROPSHEETPADDING, 40, 160, 17 + LTEXT "", IDS_INFO_PRODUCTID, PROPSHEETPADDING+75, 40, 160, 17 + LTEXT "Publisher:", -1, PROPSHEETPADDING, 55, 160, 17 + LTEXT "", IDS_INFO_PUBLISHER, PROPSHEETPADDING+75, 55, 160, 17 + LTEXT "Version:", -1, PROPSHEETPADDING, 70, 160, 17 + LTEXT "", IDS_INFO_VERSION, PROPSHEETPADDING+75, 70, 160, 17 + LTEXT "Contact:", -1, PROPSHEETPADDING, 85, 160, 17 + LTEXT "", IDS_INFO_CONTACT, PROPSHEETPADDING+75, 85, 160, 17 + LTEXT "Support Information:", -1, PROPSHEETPADDING, 100, 160, 17 + LTEXT "", IDS_INFO_SUPPORTINFO, PROPSHEETPADDING+75, 100, 160, 17 + LTEXT "Support Telephone:", -1, PROPSHEETPADDING, 115, 160, 17 + LTEXT "", IDS_INFO_SUPPORTPHONE, PROPSHEETPADDING+75, 115, 160, 17 + LTEXT "Product Updates:", -1, PROPSHEETPADDING, 130, 160, 17 + LTEXT "", IDS_INFO_PRODUCT_UPDATES, PROPSHEETPADDING+75, 130, 160, 17 + LTEXT "Readme:", -1, PROPSHEETPADDING, 145, 160, 17 + LTEXT "", IDS_INFO_README, PROPSHEETPADDING+75, 145, 160, 17 + LTEXT "Comments:", -1, PROPSHEETPADDING, 160, 160, 17 + LTEXT "", IDS_INFO_COMMENTS, PROPSHEETPADDING+75, 160, 160, 17 + PUSHBUTTON "&Close", IDCANCEL, 212, 180, 50, 14 +END + STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "Add/Remove Programs" @@ -94,6 +157,7 @@ IDS_UNABLEREAD_UNINSTSTR "Unable to read UninstallString. This entry is invalid or has been created by an MSI installer." IDS_UNABLEOPEN_UNINSTKEY "Unable to open Uninstall Key" IDS_APPLIST "Currently installed programs" + IDS_UPDATESLIST "Currently installed updates" IDS_LARGEICONS "Large Icons" IDS_LIST "List" IDS_DETAILS "Details" Modified: trunk/reactos/dll/cpl/appwiz/remove.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/remove.c?re…
============================================================================== --- trunk/reactos/dll/cpl/appwiz/remove.c (original) +++ trunk/reactos/dll/cpl/appwiz/remove.c Mon Oct 8 19:56:31 2007 @@ -19,7 +19,7 @@ /* * * PROJECT: ReactOS Software Control Panel - * FILE: dll/cpl/appwiz/appwiz.c + * FILE: dll/cpl/appwiz/remove.c * PURPOSE: ReactOS Software Control Panel * PROGRAMMERS: Gero Kuehn (reactos.filter(a)gkware.com) * Dmitry Chapyshev (lentind(a)yandex.ru) @@ -28,21 +28,16 @@ * 09-25-2007 Modify */ -#include <windows.h> -#include <commctrl.h> -#include <cpl.h> - -#include <stdlib.h> -#include <stdio.h> -#include <stdarg.h> -#include <tchar.h> -#include <process.h> - -#include "resource.h" #include "appwiz.h" -static VOID -CallUninstall(HWND hwndDlg) +VOID +CallInformation(HWND hwndDlg) +{ + +} + +VOID +CallUninstall(HWND hwndDlg, UINT Control, BOOL isUpdate) { STARTUPINFO si; PROCESS_INFORMATION pi; @@ -53,7 +48,7 @@ DWORD dwSize; TCHAR Buf[256],Title[256]; - nIndex = (INT)SendMessage(GetDlgItem(hwndDlg, IDC_SOFTWARELIST),LVM_GETNEXTITEM,-1,LVNI_FOCUSED); + nIndex = (INT)SendMessage(GetDlgItem(hwndDlg, Control),LVM_GETNEXTITEM,-1,LVNI_FOCUSED); if (nIndex == -1) { LoadString(hApplet, IDS_NOITEM_SELECTED, Buf, sizeof(Buf) / sizeof(TCHAR)); @@ -87,8 +82,12 @@ si.wShowWindow = SW_SHOW; if (CreateProcess(NULL,pszUninstallString,NULL,NULL,FALSE,0,NULL,NULL,&si,&pi)) { + WaitForSingleObject(pi.hProcess, INFINITE); CloseHandle(pi.hProcess); CloseHandle(pi.hThread); + // Update software list + (void)ListView_DeleteAllItems(GetDlgItem(hwndDlg, IDC_SOFTWARELIST)); + FillSoftwareList(hwndDlg, isUpdate); } } else @@ -103,7 +102,7 @@ } } -static VOID +VOID AddListColumn(HWND hList, LPTSTR Caption) { LV_COLUMN dummy; @@ -166,11 +165,10 @@ (void)ListView_SetImageList(GetDlgItem(hwndDlg, IDC_SOFTWARELIST),hImgListSmall,LVSIL_SMALL); (void)ListView_SetImageList(GetDlgItem(hwndDlg, IDC_SOFTWARELIST),hImgListLarge,LVSIL_NORMAL); - -} - -static VOID -FillSoftwareList(HWND hwndDlg) +} + +VOID +FillSoftwareList(HWND hwndDlg, BOOL bShowUpdates) { TCHAR pszName[MAX_PATH]; TCHAR pszDisplayName[MAX_PATH]; @@ -183,11 +181,8 @@ DWORD dwValue = 0; BOOL bIsUpdate = FALSE; BOOL bIsSystemComponent = FALSE; - BOOL bShowUpdates = FALSE; INT ItemIndex = 0; TCHAR Buf[256],Title[256]; - - bShowUpdates = (SendMessage(GetDlgItem(hwndDlg, IDC_SHOWUPDATES), BM_GETCHECK, 0, 0) == BST_CHECKED); if (RegOpenKey(HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall"), @@ -240,7 +235,7 @@ (LPBYTE)pszDisplayName, &dwSize) == ERROR_SUCCESS) { - if ((!bIsUpdate) && (!bIsSystemComponent)) + if ((!bIsUpdate) && (!bIsSystemComponent) && (!bShowUpdates)) { AddItemToList(hwndDlg, (LPARAM)hSubKey, (LPTSTR)pszDisplayName, ItemIndex); } @@ -258,7 +253,7 @@ RegCloseKey(hKey); } -static VOID +VOID AddItemsToViewControl(HWND hwndDlg) { TCHAR Buf[256]; @@ -304,7 +299,7 @@ (LPARAM)Buf); } -static VOID +VOID FindItems(HWND hwndDlg) { HWND hList; @@ -344,6 +339,91 @@ } } +VOID +GetCurrentView(HWND hwndDlg) +{ + int nCurrSel; + nCurrSel = (int)SendMessage(GetDlgItem(hwndDlg, IDC_VIEW_COMBO), + CB_GETCURSEL, + (WPARAM)0, + (LPARAM)0); + switch (nCurrSel) + { + case 0: + SetWindowLong(GetDlgItem(hwndDlg, IDC_SOFTWARELIST), + GWL_STYLE, LVS_ICON | LVS_SORTASCENDING | LVS_AUTOARRANGE | LVS_SINGLESEL | WS_VISIBLE | WS_CHILD | WS_BORDER | WS_TABSTOP); + break; + case 1: + SetWindowLong(GetDlgItem(hwndDlg, IDC_SOFTWARELIST), + GWL_STYLE,LVS_LIST | LVS_SORTASCENDING | LVS_AUTOARRANGE | LVS_SINGLESEL | WS_VISIBLE | WS_CHILD | WS_BORDER | WS_TABSTOP); + break; + case 2: + SetWindowLong(GetDlgItem(hwndDlg, IDC_SOFTWARELIST), + GWL_STYLE,LVS_REPORT | LVS_SORTASCENDING | LVS_AUTOARRANGE | LVS_SINGLESEL | WS_VISIBLE | WS_CHILD | WS_BORDER | WS_TABSTOP); + break; + } +} + +VOID +ShowPopupMenu(HWND hwndDlg, UINT ResMenu, INT xPos, INT yPos) +{ + INT nIndex; + nIndex = (INT)SendMessage(GetDlgItem(hwndDlg, IDC_SOFTWARELIST),LVM_GETNEXTITEM,-1,LVNI_FOCUSED); + if ( nIndex != -1) + { + POINT pt; + RECT lvRect; + HMENU hMenu; + + GetCursorPos(&pt); + + GetWindowRect(GetDlgItem(hwndDlg, IDC_SOFTWARELIST), &lvRect); + if (PtInRect(&lvRect, pt)) + { + hMenu = GetSubMenu(LoadMenu(hApplet, MAKEINTRESOURCE(ResMenu)),0); + TrackPopupMenuEx(hMenu, + TPM_RIGHTBUTTON, + xPos, + yPos, + hwndDlg, + NULL); + DestroyMenu(hMenu); + } + } +} + +INT_PTR CALLBACK +InfoPropDlgProc(HWND hDlg, + UINT message, + WPARAM wParam, + LPARAM lParam) +{ + UNREFERENCED_PARAMETER(lParam); + + switch (message) + { + case WM_INITDIALOG: + { + + } + case WM_COMMAND: + { + switch (LOWORD(wParam)) + { + case IDOK: + + break; + case IDCANCEL: + EndDialog(hDlg,LOWORD(wParam)); + break; + } + } + break; + } + + return FALSE; +} + /* Property page dialog callback */ INT_PTR CALLBACK RemovePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) @@ -357,7 +437,7 @@ AddItemsToViewControl(hwndDlg); LoadString(hApplet, IDS_APPLIST, Buf, sizeof(Buf) / sizeof(TCHAR)); AddListColumn(GetDlgItem(hwndDlg, IDC_SOFTWARELIST),Buf); - FillSoftwareList(hwndDlg); + FillSoftwareList(hwndDlg, FALSE); break; case WM_COMMAND: @@ -369,51 +449,34 @@ FindItems(hwndDlg); } break; - case IDC_SHOWUPDATES: - if (HIWORD(wParam) == BN_CLICKED) - { - SendMessage(GetDlgItem(hwndDlg, IDC_SOFTWARELIST),LVM_DELETEALLITEMS,0,0); - FillSoftwareList(hwndDlg); - } + case ID_APP_MODIFYREMOVE: + case IDC_ADDREMOVE: + CallUninstall(hwndDlg, IDC_SOFTWARELIST, FALSE); break; - case IDC_ADDREMOVE: - CallUninstall(hwndDlg); - break; + case ID_APP_INFORMATION: + case IDC_INFO_BUTTON: + DialogBox(hApplet, + MAKEINTRESOURCE(IDD_INFORMATION), + hwndDlg, + InfoPropDlgProc); + break; case IDC_VIEW_COMBO: if (HIWORD(wParam) == CBN_SELCHANGE) { - int nCurrSel; - nCurrSel = (int)SendMessage(GetDlgItem(hwndDlg, IDC_VIEW_COMBO), - CB_GETCURSEL, - (WPARAM)0, - (LPARAM)0); - switch (nCurrSel) - { - case 0: - SetWindowLong(GetDlgItem(hwndDlg, IDC_SOFTWARELIST), - GWL_STYLE, LVS_ICON | LVS_SORTASCENDING | LVS_AUTOARRANGE | LVS_SINGLESEL | WS_VISIBLE | WS_CHILD | WS_BORDER | WS_TABSTOP); - break; - case 1: - SetWindowLong(GetDlgItem(hwndDlg, IDC_SOFTWARELIST), - GWL_STYLE,LVS_LIST | LVS_SORTASCENDING | LVS_AUTOARRANGE | LVS_SINGLESEL | WS_VISIBLE | WS_CHILD | WS_BORDER | WS_TABSTOP); - break; - case 2: - SetWindowLong(GetDlgItem(hwndDlg, IDC_SOFTWARELIST), - GWL_STYLE,LVS_REPORT | LVS_SORTASCENDING | LVS_AUTOARRANGE | LVS_SINGLESEL | WS_VISIBLE | WS_CHILD | WS_BORDER | WS_TABSTOP); - break; - } + GetCurrentView(hwndDlg); } break; } break; case WM_NOTIFY: + { switch (LOWORD(wParam)) { case IDC_SOFTWARELIST: switch (((LPNMHDR)lParam)->code) { case NM_DBLCLK: - CallUninstall(hwndDlg); + CallUninstall(hwndDlg, IDC_SOFTWARELIST, FALSE); break; case NM_CLICK: { @@ -422,16 +485,34 @@ if (nIndex == -1) { EnableWindow(GetDlgItem(hwndDlg, IDC_ADDREMOVE),FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_INFO_BUTTON),FALSE); } else { EnableWindow(GetDlgItem(hwndDlg, IDC_ADDREMOVE),TRUE); + EnableWindow(GetDlgItem(hwndDlg, IDC_INFO_BUTTON),TRUE); } } break; } break; } + } + break; + case WM_MENUSELECT: + { + switch((UINT)LOWORD(wParam)) + { + } + } + break; + case WM_CONTEXTMENU: + { + ShowPopupMenu(hwndDlg, + IDR_POPUP_APP, + GET_X_LPARAM(lParam), + GET_Y_LPARAM(lParam)); + } break; } Modified: trunk/reactos/dll/cpl/appwiz/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/resource.h?…
============================================================================== --- trunk/reactos/dll/cpl/appwiz/resource.h (original) +++ trunk/reactos/dll/cpl/appwiz/resource.h Mon Oct 8 19:56:31 2007 @@ -18,6 +18,17 @@ #define IDI_RECBINICO 1503 #define IDI_DOWNLOADICO 1504 #define IDI_APPINETICO 1505 +#define IDI_UPDATES 1506 +#define IDI_REACTOS 1507 + +/* menus */ +#define IDR_POPUP_APP 3000 +#define IDR_POPUP_UPD 3001 + +#define ID_APP_MODIFYREMOVE 3500 +#define ID_APP_INFORMATION 3501 +#define ID_UPD_REMOVE 3502 +#define ID_UPD_INFORMATION 3503 /* dialogs */ #define IDD_PROPPAGEINSTALL 200 @@ -25,6 +36,8 @@ #define IDD_PROPPAGEADD 202 #define IDD_SHORTCUT_LOCATION 203 #define IDD_SHORTCUT_FINISH 204 +#define IDD_PROPPAGEUPDATES 205 +#define IDD_INFORMATION 206 /* bitmaps */ #define IDB_WATERMARK 5001 @@ -40,20 +53,34 @@ #define IDS_LARGEICONS 2007 #define IDS_LIST 2008 #define IDS_DETAILS 2009 -#define IDS_CREATE_SHORTCUT 2010 -#define IDS_ERROR_NOT_FOUND 2011 +#define IDS_UPDATESLIST 2010 +#define IDS_INFO_DISPNAME 2011 +#define IDS_INFO_PUBLISHER 2012 +#define IDS_INFO_VERSION 2013 +#define IDS_INFO_CONTACT 2014 +#define IDS_INFO_SUPPORTINFO 2015 +#define IDS_INFO_SUPPORTPHONE 2016 +#define IDS_INFO_PRODUCT_UPDATES 2017 +#define IDS_INFO_COMMENTS 2018 +#define IDS_INFO_REGOWNER 2019 +#define IDS_INFO_PRODUCTID 2020 +#define IDS_INFO_README 2021 +#define IDS_CREATE_SHORTCUT 2022 +#define IDS_ERROR_NOT_FOUND 2023 /* controls */ #define IDC_INSTALL 101 #define IDC_SOFTWARELIST 102 #define IDC_ADDREMOVE 103 -#define IDC_SHOWUPDATES 104 -#define IDC_FIND_EDIT 105 -#define IDC_INFO_BUTTON 106 -#define IDC_VIEW_COMBO 107 -#define IDC_SHORTCUT_LOCATION 108 -#define IDC_SHORTCUT_BROWSE 109 -#define IDC_SHORTCUT_NAME 110 +#define IDC_FIND_EDIT 104 +#define IDC_INFO_BUTTON 105 +#define IDC_VIEW_COMBO 106 +#define IDC_SHORTCUT_LOCATION 107 +#define IDC_SHORTCUT_BROWSE 108 +#define IDC_SHORTCUT_NAME 109 +#define IDC_ADD_DOWNLOAD_BUTTON 110 +#define IDC_ADD_FIND_BUTTON 111 +#define IDC_ADD_PROP_BUTTON 112 #endif /* __CPL_RESOURCE_H */ Added: trunk/reactos/dll/cpl/appwiz/resources/reactos.ico URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/resources/r…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/dll/cpl/appwiz/resources/reactos.ico ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/dll/cpl/appwiz/resources/updates.ico URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/resources/u…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/dll/cpl/appwiz/resources/updates.ico ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Modified: trunk/reactos/dll/cpl/appwiz/rossetup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/rossetup.c?…
============================================================================== --- trunk/reactos/dll/cpl/appwiz/rossetup.c (original) +++ trunk/reactos/dll/cpl/appwiz/rossetup.c Mon Oct 8 19:56:31 2007 @@ -19,7 +19,7 @@ /* * * PROJECT: ReactOS Software Control Panel - * FILE: dll/cpl/appwiz/appwiz.c + * FILE: dll/cpl/appwiz/rossetup.c * PURPOSE: ReactOS Software Control Panel * PROGRAMMERS: Gero Kuehn (reactos.filter(a)gkware.com) * Dmitry Chapyshev (lentind(a)yandex.ru) @@ -28,17 +28,6 @@ * 09-25-2007 Modify */ -#include <windows.h> -#include <commctrl.h> -#include <cpl.h> - -#include <stdlib.h> -#include <stdio.h> -#include <stdarg.h> -#include <tchar.h> -#include <process.h> - -#include "resource.h" #include "appwiz.h" Added: trunk/reactos/dll/cpl/appwiz/updates.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/updates.c?r…
============================================================================== --- trunk/reactos/dll/cpl/appwiz/updates.c (added) +++ trunk/reactos/dll/cpl/appwiz/updates.c Mon Oct 8 19:56:31 2007 @@ -1,0 +1,118 @@ +/* + * ReactOS + * Copyright (C) 2004 ReactOS Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* + * + * PROJECT: ReactOS Software Control Panel + * FILE: dll/cpl/appwiz/updates.c + * PURPOSE: ReactOS Software Control Panel + * PROGRAMMERS: Gero Kuehn (reactos.filter(a)gkware.com) + * Dmitry Chapyshev (lentind(a)yandex.ru) + * UPDATE HISTORY: + * 06-17-2004 Created + * 09-25-2007 Modify + */ + +#include "appwiz.h" + +/* Property page dialog callback */ +INT_PTR CALLBACK +UpdatesPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + UNREFERENCED_PARAMETER(lParam); + UNREFERENCED_PARAMETER(wParam); + UNREFERENCED_PARAMETER(hwndDlg); + TCHAR Buf[256]; + + switch (uMsg) + { + case WM_INITDIALOG: + AddItemsToViewControl(hwndDlg); + LoadString(hApplet, IDS_UPDATESLIST, Buf, sizeof(Buf) / sizeof(TCHAR)); + AddListColumn(GetDlgItem(hwndDlg, IDC_SOFTWARELIST),Buf); + FillSoftwareList(hwndDlg, TRUE); + break; + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDC_FIND_EDIT: + if (HIWORD(wParam) == EN_CHANGE) + { + FindItems(hwndDlg); + } + break; + case ID_UPD_INFORMATION: + case IDC_INFO_BUTTON: + DialogBox(hApplet, + MAKEINTRESOURCE(IDD_INFORMATION), + hwndDlg, + InfoPropDlgProc); + break; + case ID_UPD_REMOVE: + case IDC_ADDREMOVE: + CallUninstall(hwndDlg, IDC_SOFTWARELIST, TRUE); + break; + case IDC_VIEW_COMBO: + if (HIWORD(wParam) == CBN_SELCHANGE) + { + GetCurrentView(hwndDlg); + } + break; + } + break; + case WM_NOTIFY: + switch (LOWORD(wParam)) + { + case IDC_SOFTWARELIST: + switch (((LPNMHDR)lParam)->code) + { + case NM_DBLCLK: + CallUninstall(hwndDlg, IDC_SOFTWARELIST, TRUE); + break; + case NM_CLICK: + { + INT nIndex; + nIndex = (INT)SendMessage(GetDlgItem(hwndDlg, IDC_SOFTWARELIST),LVM_GETNEXTITEM,-1,LVNI_FOCUSED); + if (nIndex == -1) + { + EnableWindow(GetDlgItem(hwndDlg, IDC_ADDREMOVE),FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_INFO_BUTTON),FALSE); + } + else + { + EnableWindow(GetDlgItem(hwndDlg, IDC_ADDREMOVE),TRUE); + EnableWindow(GetDlgItem(hwndDlg, IDC_INFO_BUTTON),TRUE); + } + } + break; + } + break; + } + break; + case WM_CONTEXTMENU: + { + ShowPopupMenu(hwndDlg, + IDR_POPUP_UPD, + GET_X_LPARAM(lParam), + GET_Y_LPARAM(lParam)); + } + break; + } + + return FALSE; +} Propchange: trunk/reactos/dll/cpl/appwiz/updates.c ------------------------------------------------------------------------------ svn:eol-style = native
17 years, 2 months
1
0
0
0
[fireball] 29457: - Merge 29405 (memory-overwrite in region.c bugfix) from trunk.
by fireball@svn.reactos.org
Author: fireball Date: Mon Oct 8 16:54:07 2007 New Revision: 29457 URL:
http://svn.reactos.org/svn/reactos?rev=29457&view=rev
Log: - Merge 29405 (memory-overwrite in region.c bugfix) from trunk. Modified: branches/win32k-stable/reactos/subsystems/win32/win32k/objects/region.c Modified: branches/win32k-stable/reactos/subsystems/win32/win32k/objects/region.c URL:
http://svn.reactos.org/svn/reactos/branches/win32k-stable/reactos/subsystem…
============================================================================== --- branches/win32k-stable/reactos/subsystems/win32/win32k/objects/region.c (original) +++ branches/win32k-stable/reactos/subsystems/win32/win32k/objects/region.c Mon Oct 8 16:54:07 2007 @@ -669,7 +669,7 @@ else break; - for(i = j; i >= 0; i--) // fixup bottom band + for(i = j; i > 0; i--) // fixup bottom band if(((PRECT)rgnDst->Buffer + i)->bottom > right) ((PRECT)rgnDst->Buffer + i)->bottom = right; else
17 years, 2 months
1
0
0
0
[fireball] 29456: - Don't try to free a pointer if it was not allocated.
by fireball@svn.reactos.org
Author: fireball Date: Mon Oct 8 16:37:44 2007 New Revision: 29456 URL:
http://svn.reactos.org/svn/reactos?rev=29456&view=rev
Log: - Don't try to free a pointer if it was not allocated. Modified: trunk/reactos/drivers/network/afd/afd/main.c Modified: trunk/reactos/drivers/network/afd/afd/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/ma…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/main.c (original) +++ trunk/reactos/drivers/network/afd/afd/main.c Mon Oct 8 16:37:44 2007 @@ -290,7 +290,7 @@ FCB->AddressFrom, ConnInfo); - ExFreePool( ConnInfo ); + if (ConnInfo) ExFreePool( ConnInfo ); return UnlockAndMaybeComplete( FCB, Status, Irp, 0, NULL, TRUE ); }
17 years, 2 months
1
0
0
0
[hpoussin] 29455: Fix rgenstat compilation
by hpoussin@svn.reactos.org
Author: hpoussin Date: Mon Oct 8 15:19:46 2007 New Revision: 29455 URL:
http://svn.reactos.org/svn/reactos?rev=29455&view=rev
Log: Fix rgenstat compilation Modified: trunk/reactos/tools/rgenstat/rgenstat.mak Modified: trunk/reactos/tools/rgenstat/rgenstat.mak URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rgenstat/rgenstat.ma…
============================================================================== --- trunk/reactos/tools/rgenstat/rgenstat.mak (original) +++ trunk/reactos/tools/rgenstat/rgenstat.mak Mon Oct 8 15:19:46 2007 @@ -26,9 +26,9 @@ RGENSTAT_OBJECTS = \ $(addprefix $(INTERMEDIATE_), $(RGENSTAT_SOURCES:.c=.o)) -RGENSTAT_HOST_CFLAGS = -g -Werror -Wall +RGENSTAT_HOST_CFLAGS = -g -Werror -Wall $(TOOLS_CFLAGS) -RGENSTAT_HOST_LFLAGS = -g +RGENSTAT_HOST_LFLAGS = $(TOOLS_LFLAGS) -g $(RGENSTAT_TARGET): $(RGENSTAT_OBJECTS) | $(RGENSTAT_OUT) $(ECHO_LD)
17 years, 2 months
1
0
0
0
[janderwald] 29454: - fix linux compilation
by janderwald@svn.reactos.org
Author: janderwald Date: Mon Oct 8 13:28:04 2007 New Revision: 29454 URL:
http://svn.reactos.org/svn/reactos?rev=29454&view=rev
Log: - fix linux compilation Modified: trunk/reactos/tools/sysreg/rosboot_test.cpp Modified: trunk/reactos/tools/sysreg/rosboot_test.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/rosboot_test.…
============================================================================== --- trunk/reactos/tools/sysreg/rosboot_test.cpp (original) +++ trunk/reactos/tools/sysreg/rosboot_test.cpp Mon Oct 8 13:28:04 2007 @@ -27,7 +27,7 @@ #include <assert.h> #include <math.h> #include <signal.h> -#include <io.h> +//#include <io.h> namespace Sysreg_ { @@ -283,7 +283,7 @@ #ifdef __LINUX__ - if (_mktemp(pipename)) + if (mktemp(pipename)) { string temp = pipename; m_Src = "/tmp/" + temp;
17 years, 2 months
1
0
0
0
[janderwald] 29453: - randomize named pipe name - remove hardcoded path in named pipe reader class
by janderwald@svn.reactos.org
Author: janderwald Date: Mon Oct 8 13:01:33 2007 New Revision: 29453 URL:
http://svn.reactos.org/svn/reactos?rev=29453&view=rev
Log: - randomize named pipe name - remove hardcoded path in named pipe reader class Modified: trunk/reactos/tools/sysreg/namedpipe_reader.cpp trunk/reactos/tools/sysreg/rosboot_test.cpp Modified: trunk/reactos/tools/sysreg/namedpipe_reader.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/namedpipe_rea…
============================================================================== --- trunk/reactos/tools/sysreg/namedpipe_reader.cpp (original) +++ trunk/reactos/tools/sysreg/namedpipe_reader.cpp Mon Oct 8 13:01:33 2007 @@ -50,7 +50,7 @@ return false; } #ifndef __LINUX__ - h_Pipe = CreateFile("\\\\.\\pipe\\qemu", //PipeCmd.c_str(), + h_Pipe = CreateFile(PipeCmd.c_str(), GENERIC_WRITE | GENERIC_READ, 0, NULL, @@ -139,7 +139,7 @@ long offset = 0; size_t start_size = vect.size (); char * start = buffer; - buffer[cbRead] = _T('\0'); + buffer[cbRead] = '\0'; char * end = strstr(buffer, s_LineBreak); //cout << "extractLines entered with append_line: " << append_line << " cbRead: " << cbRead << "buffer: " << buffer << endl; @@ -148,7 +148,7 @@ { if (end) { - end[0] = _T('\0'); + end[0] = '\0'; string line = start; end += (sizeof(s_LineBreak) / sizeof(char)); start = end; Modified: trunk/reactos/tools/sysreg/rosboot_test.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/rosboot_test.…
============================================================================== --- trunk/reactos/tools/sysreg/rosboot_test.cpp (original) +++ trunk/reactos/tools/sysreg/rosboot_test.cpp Mon Oct 8 13:01:33 2007 @@ -27,7 +27,8 @@ #include <assert.h> #include <math.h> #include <signal.h> - +#include <io.h> + namespace Sysreg_ { using std::vector; @@ -273,7 +274,7 @@ { string pipe; string qemudir; - + char pipename[] = "qemuXXXXXX"; if (m_MaxMem.length() == 0) { /* set default memory size to 64M */ @@ -281,14 +282,35 @@ } #ifdef __LINUX__ - pipe = "pipe:/tmp/qemu"; - m_Src = "/tmp/qemu"; + + if (_mktemp(pipename)) + { + string temp = pipename; + m_Src = "/tmp/" + temp; + pipe = "pipe:" + m_Src; + } + else + { + pipe = "pipe:/tmp/qemu"; + m_Src = "/tmp/qemu"; + } + qemudir = "/usr/share/qemu"; m_DebugPort = "pipe"; #else - pipe = "pipe:qemu"; - m_Src = "\\\\.\\pipe\\qemu"; + if (_mktemp(pipename)) + { + string temp = pipename; + pipe = "pipe:" + temp; + m_Src = "\\\\.\\pipe\\" + temp; + } + else + { + pipe = "pipe:qemu"; + m_Src = "\\\\.\\pipe\\qemu"; + } m_DebugPort = "pipe"; + if (!getQemuDir(qemudir)) { return false;
17 years, 2 months
1
0
0
0
[janderwald] 29452: - forgot one thing
by janderwald@svn.reactos.org
Author: janderwald Date: Mon Oct 8 12:17:43 2007 New Revision: 29452 URL:
http://svn.reactos.org/svn/reactos?rev=29452&view=rev
Log: - forgot one thing Modified: trunk/reactos/tools/sysreg/conf_parser.cpp trunk/reactos/tools/sysreg/rosboot_test.cpp Modified: trunk/reactos/tools/sysreg/conf_parser.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/conf_parser.c…
============================================================================== --- trunk/reactos/tools/sysreg/conf_parser.cpp (original) +++ trunk/reactos/tools/sysreg/conf_parser.cpp Mon Oct 8 12:17:43 2007 @@ -59,7 +59,7 @@ if (value[value.length () -1] == 0xA) { // remove newline char - value[value.length ()-1] = _T('\0'); + value[value.length ()-1] = '\0'; } */ // cerr << "name: "<< name << "value: "<< value << "|" << endl; Modified: trunk/reactos/tools/sysreg/rosboot_test.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/rosboot_test.…
============================================================================== --- trunk/reactos/tools/sysreg/rosboot_test.cpp (original) +++ trunk/reactos/tools/sysreg/rosboot_test.cpp Mon Oct 8 12:17:43 2007 @@ -191,7 +191,7 @@ "create", "-f", #ifdef __LINUX__ - _T("raw"), + "raw", #else "vmdk", #endif
17 years, 2 months
1
0
0
0
[janderwald] 29451: - remove non required specialization
by janderwald@svn.reactos.org
Author: janderwald Date: Mon Oct 8 04:22:39 2007 New Revision: 29451 URL:
http://svn.reactos.org/svn/reactos?rev=29451&view=rev
Log: - remove non required specialization Modified: trunk/reactos/tools/sysreg/rosboot_test.cpp Modified: trunk/reactos/tools/sysreg/rosboot_test.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/rosboot_test.…
============================================================================== --- trunk/reactos/tools/sysreg/rosboot_test.cpp (original) +++ trunk/reactos/tools/sysreg/rosboot_test.cpp Mon Oct 8 04:22:39 2007 @@ -128,16 +128,6 @@ //--------------------------------------------------------------------------------------- void RosBootTest::getDefaultHDDImage(string & img) { -#ifndef __LINUX__ - char buffer[MAX_PATH]; - if (GetCurrentDirectory(MAX_PATH, buffer)) - { - img = buffer; - img += "\\output-i386"; - - } - else -#endif img = "output-i386"; EnvironmentVariable::getValue("ROS_OUTPUT", img);
17 years, 2 months
1
0
0
0
[janderwald] 29450: - remove unicode support (it was mess, a few places only accepting char and then another using wchar compatibel) - rewrite line extraction (currently if'0) - add Wine gettimeofday implementation (currently if'0) - apply sources changes to SymbolFile class - remove unicode support class - fix a bug in the createProcess version for windows hosts which randomly led to invalid boot hdd error messages
by janderwald@svn.reactos.org
Author: janderwald Date: Mon Oct 8 04:18:01 2007 New Revision: 29450 URL:
http://svn.reactos.org/svn/reactos?rev=29450&view=rev
Log: - remove unicode support (it was mess, a few places only accepting char and then another using wchar compatibel) - rewrite line extraction (currently if'0) - add Wine gettimeofday implementation (currently if'0) - apply sources changes to SymbolFile class - remove unicode support class - fix a bug in the createProcess version for windows hosts which randomly led to invalid boot hdd error messages Removed: trunk/reactos/tools/sysreg/unicode.cpp trunk/reactos/tools/sysreg/unicode.h Modified: trunk/reactos/tools/sysreg/conf_parser.cpp trunk/reactos/tools/sysreg/conf_parser.h trunk/reactos/tools/sysreg/env_var.cpp trunk/reactos/tools/sysreg/file_reader.cpp trunk/reactos/tools/sysreg/namedpipe_reader.cpp trunk/reactos/tools/sysreg/namedpipe_reader.h trunk/reactos/tools/sysreg/os_support.cpp trunk/reactos/tools/sysreg/os_support.h trunk/reactos/tools/sysreg/pipe_reader.cpp trunk/reactos/tools/sysreg/rosboot_test.cpp trunk/reactos/tools/sysreg/sym_file.cpp trunk/reactos/tools/sysreg/sysreg.cpp trunk/reactos/tools/sysreg/sysreg.mak trunk/reactos/tools/sysreg/user_types.h Modified: trunk/reactos/tools/sysreg/conf_parser.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/conf_parser.c…
============================================================================== --- trunk/reactos/tools/sysreg/conf_parser.cpp (original) +++ trunk/reactos/tools/sysreg/conf_parser.cpp Mon Oct 8 04:18:01 2007 @@ -29,14 +29,9 @@ } //--------------------------------------------------------------------------------------- - bool ConfigParser::parseFile(TCHAR * FileName) + bool ConfigParser::parseFile(char * FileName) { - FILE * file; -#ifdef UNICODE - file = _tfopen(FileName, _T("rt,ccs=UNICODE")); -#else - file = fopen(FileName, "rt"); -#endif + FILE * file = fopen(FileName, "rt"); if (!file) { cerr << "Error: ConfigParser::parseFile failed to open configuration file " << FileName << endl; @@ -45,16 +40,16 @@ bool ret = false; while (!feof(file)) { - TCHAR buffer[500]; - TCHAR * buf; + char buffer[500]; + char * buf; - buf = _fgetts(buffer, sizeof(buffer) / sizeof(TCHAR), file); + buf = fgets(buffer, sizeof(buffer) / sizeof(char), file); if (buf) { - if (buffer[0] != _T(';')) + if (buffer[0] != ';') { string s_buffer = string(buffer); - string::size_type ws_pos = s_buffer.find_first_of (_T("=")); + string::size_type ws_pos = s_buffer.find_first_of ("="); if (ws_pos != string::npos && ws_pos > 0 && ws_pos < s_buffer.size()) { @@ -101,7 +96,7 @@ return false; } - ConfValue = _tcstod(it->second.c_str(), NULL); + ConfValue = strtod(it->second.c_str(), NULL); return true; } //----------------------------------------------------------------------------------------- @@ -114,7 +109,7 @@ return false; } - ConfValue = _tcstol(it->second.c_str(), NULL, 10); + ConfValue = strtol(it->second.c_str(), NULL, 10); return true; } Modified: trunk/reactos/tools/sysreg/conf_parser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/conf_parser.h…
============================================================================== --- trunk/reactos/tools/sysreg/conf_parser.h (original) +++ trunk/reactos/tools/sysreg/conf_parser.h Mon Oct 8 04:18:01 2007 @@ -62,7 +62,7 @@ /// @param FileName path to configuration file /// @return bool - bool parseFile(TCHAR * FileName); + bool parseFile(char * FileName); //-------------------------------------------------------------------------------------- /// Modified: trunk/reactos/tools/sysreg/env_var.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/env_var.cpp?r…
============================================================================== --- trunk/reactos/tools/sysreg/env_var.cpp (original) +++ trunk/reactos/tools/sysreg/env_var.cpp Mon Oct 8 04:18:01 2007 @@ -39,7 +39,7 @@ return true; } - TCHAR * value = _tgetenv(EnvName.c_str ()); + char * value = getenv(EnvName.c_str ()); if (!value) { @@ -47,7 +47,7 @@ return false; } - if (!_tcslen(value)) + if (!strlen(value)) { cerr << "EnvironmentVariable::getValue found no value for " << EnvName << endl; return false; Modified: trunk/reactos/tools/sysreg/file_reader.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/file_reader.c…
============================================================================== --- trunk/reactos/tools/sysreg/file_reader.cpp (original) +++ trunk/reactos/tools/sysreg/file_reader.cpp Mon Oct 8 04:18:01 2007 @@ -23,11 +23,7 @@ //--------------------------------------------------------------------------------------- bool FileReader::openSource(const string & filename) { -#ifdef UNICODE - m_File = (FILE*)_tfopen(filename.c_str(), _T("rb,ccs=UNICODE")); -#else m_File = fopen((char*)filename.c_str(), (char*)"rb"); -#endif if (m_File) { @@ -69,34 +65,18 @@ char szBuffer[256]; int readoffset = 0; -#ifdef UNICODE - wchar_t wbuf[512]; - int wbuf_offset = 0; - - if (m_BufferedLines.length ()) - { - wcscpy(wbuf, m_BufferedLines.c_str ()); - wbuf_offset = m_BufferedLines.length (); - } -#else if (m_BufferedLines.length()) { strcpy(szBuffer, m_BufferedLines.c_str()); readoffset = m_BufferedLines.length(); } -#endif do { if (total_length < num) { -#ifdef UNICODE - memmove(wbuf, &wbuf[total_length], (num - total_length) * sizeof(wchar_t)); - wbuf_offset = num - total_length; -#else memmove(szBuffer, &szBuffer[total_length], num - total_length); readoffset = num - total_length; -#endif } num = fread(&szBuffer[readoffset], @@ -113,32 +93,16 @@ } break; } - TCHAR * ptr; -#ifdef UNICODE - int i = 0; - int conv; - while((conv = mbtowc(&wbuf[wbuf_offset+i], &szBuffer[i], num))) - { - i += conv; - if (i == num) - break; + char * ptr; + char * offset = szBuffer; - assert(wbuf_offset + i < 512); - } - wbuf[wbuf_offset + num] = L'\0'; - - TCHAR * offset = wbuf; -#else - - TCHAR * offset = szBuffer; -#endif total_length = 0; - while((ptr = _tcsstr(offset, _T("\x0D\x0A"))) != NULL) + while((ptr = strstr(offset, "\x0D\x0A")) != NULL) { long length = ((long )ptr - (long)offset); - length /= sizeof(TCHAR); + length /= sizeof(char); - offset[length] = _T('\0'); + offset[length] = '\0'; string line = offset; lines.push_back (line); @@ -155,11 +119,7 @@ if (total_length < num) { -#ifdef UNICODE - m_BufferedLines = &wbuf[total_length]; -#else - m_BufferedLines = &szBuffer[total_length]; -#endif + m_BufferedLines = &szBuffer[total_length]; } return ret; Modified: trunk/reactos/tools/sysreg/namedpipe_reader.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/namedpipe_rea…
============================================================================== --- trunk/reactos/tools/sysreg/namedpipe_reader.cpp (original) +++ trunk/reactos/tools/sysreg/namedpipe_reader.cpp Mon Oct 8 04:18:01 2007 @@ -9,7 +9,6 @@ */ #include "namedpipe_reader.h" -#include "unicode.h" #include <iostream> #include <assert.h> @@ -18,13 +17,15 @@ { #define MIN(a, b) (((a) < (b)) ? (a) : (b)) +#ifdef __LINUX__ + const char * NamedPipeReader::s_LineBreak = "\x0A\0"; +#else + const char * NamedPipeReader::s_LineBreak = "\x0D\x0A\0"; +#endif using std::vector; //--------------------------------------------------------------------------------------- NamedPipeReader::NamedPipeReader() : DataSource(), h_Pipe(NULLVAL), m_Buffer(0) { -#ifdef UNICODE - m_WBuffer = 0; -#endif } //--------------------------------------------------------------------------------------- @@ -32,10 +33,6 @@ { if (m_Buffer) free(m_Buffer); -#ifdef UNICODE - if (m_WBuffer) - free(m_WBuffer); -#endif } bool NamedPipeReader::isSourceOpen() @@ -76,14 +73,7 @@ m_BufferLength = 100; m_Buffer = (char*)malloc(sizeof(char) * m_BufferLength); } - -#ifdef UNICODE - if (!m_WBuffer) - { - m_WBuffer = (WCHAR*)malloc(sizeof(WCHAR) * m_BufferLength); - } -#endif - ConnectNamedPipe(h_Pipe, + ConnectNamedPipe(h_Pipe, 0); return true; } @@ -112,6 +102,7 @@ bool NamedPipeReader::closeSource() { + cerr << "NamedPipeReader::closePipe> entered" << endl; if (h_Pipe == NULLVAL) { cerr << "NamedPipeReader::closePipe> pipe is not open" << endl; @@ -127,19 +118,87 @@ return true; } //--------------------------------------------------------------------------------------- - void NamedPipeReader::extractLines(TCHAR * buffer, std::vector<string> & vect, bool & append_line, unsigned long cbRead) - { - TCHAR * offset = _tcschr(buffer, _T('\x0D')); - DWORD buf_offset = 0; + void NamedPipeReader::insertLine(std::vector<string> & vect, string line, bool append_line) + { + if (append_line && vect.size ()) + { + string prev = vect[vect.size () - 1]; + prev += line; + vect[vect.size () - 1] = prev; + } + else + { + vect.push_back (line); + } + + } +//--------------------------------------------------------------------------------------- + void NamedPipeReader::extractLines(char * buffer, std::vector<string> & vect, bool & append_line, unsigned long cbRead) + { +#if 0 + long offset = 0; + size_t start_size = vect.size (); + char * start = buffer; + buffer[cbRead] = _T('\0'); + char * end = strstr(buffer, s_LineBreak); + + //cout << "extractLines entered with append_line: " << append_line << " cbRead: " << cbRead << "buffer: " << buffer << endl; + + do + { + if (end) + { + end[0] = _T('\0'); + string line = start; + end += (sizeof(s_LineBreak) / sizeof(char)); + start = end; + offset += line.length() + (sizeof(s_LineBreak) / sizeof(char)); + + // cout << "Offset: "<< offset << "cbRead: " << cbRead << "line: " << line << endl; + insertLine(vect, line, append_line); + if (append_line) + { + append_line = false; + } + } + else + { + string line = start; +// cout << "inserting line start_size: " << start_size << "current: " << vect.size () << "line length: "<< line.length () << endl; + if (!line.length ()) + { + if (start_size == vect.size ()) + append_line = true; + break; + } + if (start_size == vect.size ()) + { + insertLine(vect, line, true); + } + else + { + insertLine(vect, line, false); + } + append_line = true; + break; + } + + end = strstr(end, s_LineBreak); + + }while(append_line); + +#else + DWORD buf_offset = 0; + char * offset = strchr(buffer, '\x0D'); while(offset) { /// /// HACKHACK - /// due to some mysterious reason, _tcschr / _tcsstr sometimes returns + /// due to some mysterious reason, strchr / strstr sometimes returns /// not always the offset to the CR character but to the next LF /// in MSVC 2005 (Debug Modus) - if (offset[0] == _T('\x0A')) + if (offset[0] == '\x0A') { if (buf_offset) { @@ -152,10 +211,10 @@ } } - if (offset[0] == _T('\x0D')) + if (offset[0] == '\x0D') { buf_offset += 2; - offset[0] = _T('\0'); + offset[0] = '\0'; offset +=2; } else @@ -188,11 +247,11 @@ } buffer = offset; - offset = _tcsstr(buffer, _T("\n")); + offset = strstr(buffer, "\n"); } if (buf_offset < cbRead) { - buffer[cbRead - buf_offset] = _T('\0'); + buffer[cbRead - buf_offset] = '\0'; string line = buffer; if (append_line) { @@ -212,6 +271,7 @@ { append_line = false; } +#endif } //--------------------------------------------------------------------------------------- bool NamedPipeReader::readPipe(char * buffer, int bufferlength, long & bytesread) @@ -254,32 +314,16 @@ return false; } -#ifdef UNICODE - if (!m_WBuffer) - { - cerr << "Error: no memory" << endl; - return false; - } -#endif - bool append_line = false; do { memset(m_Buffer, 0x0, m_BufferLength * sizeof(char)); long cbRead = 0; - + if (!readPipe(m_Buffer, m_BufferLength-1, cbRead)) break; -#ifdef UNICODE - memset(m_WBuffer, 0x0, m_BufferLength * sizeof(WCHAR)); - if (!UnicodeConverter::ansi2Unicode(m_Buffer, m_WBuffer, cbRead)) - break; - extractLines(m_WBuffer, vect, append_line, cbRead); -#else extractLines(m_Buffer, vect, append_line, cbRead); -#endif - }while (append_line); return (vect.size () - lines); Modified: trunk/reactos/tools/sysreg/namedpipe_reader.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/namedpipe_rea…
============================================================================== --- trunk/reactos/tools/sysreg/namedpipe_reader.h (original) +++ trunk/reactos/tools/sysreg/namedpipe_reader.h Mon Oct 8 04:18:01 2007 @@ -118,7 +118,8 @@ /// @param vect vector storing the extracted lines /// @param append_line if the line isnt fully read, the line is appended - void extractLines(TCHAR * buffer, std::vector<string> & vect, bool & append_line, unsigned long cbRead); + void extractLines(char * buffer, std::vector<string> & vect, bool & append_line, unsigned long cbRead); + void insertLine(std::vector<string> & vect, string line, bool append_line); bool readPipe(char * buffer, int bufferlength, long & read); @@ -130,6 +131,7 @@ WCHAR * m_WBuffer; #endif + static const char * s_LineBreak; }; // end of class NamedPipeReader } // end of namespace System_ Modified: trunk/reactos/tools/sysreg/os_support.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/os_support.cp…
============================================================================== --- trunk/reactos/tools/sysreg/os_support.cpp (original) +++ trunk/reactos/tools/sysreg/os_support.cpp Mon Oct 8 04:18:01 2007 @@ -14,11 +14,15 @@ OsSupport::TimeEntryVector OsSupport::s_Entries; + //int gettimeofday(struct timeval *tv, void * tz); + void OsSupport::checkAlarms() { struct timeval tm; size_t i; - gettimeofday(&tm, 0); +#if 0 +// gettimeofday(&tm, 0); +#endif for (i = 0; i < s_Entries.size(); i++) { long diffsec = s_Entries[i]->tm.tv_sec - tm.tv_sec; @@ -67,6 +71,40 @@ HANDLE OsSupport::s_hThread = 0; static HANDLE hTimer; +#if 0 +__inline int gettimeofday(struct timeval *tv, struct timezone *tz) +{ + FILETIME ft; + LARGE_INTEGER li; + __int64 t; + static int tzflag; + + if (tv) + { + GetSystemTimeAsFileTime(&ft); + li.LowPart = ft.dwLowDateTime; + li.HighPart = ft.dwHighDateTime; + t = li.QuadPart; /* In 100-nanosecond intervals */ + t -= EPOCHFILETIME; /* Offset to the Epoch time */ + t /= 10; /* In microseconds */ + tv->tv_sec = (long)(t / 1000000); + tv->tv_usec = (long)(t % 1000000); + } + + if (tz) + { + if (!tzflag) + { + _tzset(); + tzflag++; + } + tz->tz_minuteswest = _timezone / 60; + tz->tz_dsttime = _daylight; + } + + return 0; +} +#endif bool OsSupport::terminateProcess(OsSupport::ProcessID pid, int exitcode) { HANDLE hProcess = OpenProcess(PROCESS_TERMINATE, FALSE, pid); @@ -80,14 +118,14 @@ return ret; } - OsSupport::ProcessID OsSupport::createProcess(TCHAR *procname, int procargsnum, TCHAR **procargs, bool wait) + OsSupport::ProcessID OsSupport::createProcess(char *procname, int procargsnum, char **procargs, bool wait) { STARTUPINFO siStartInfo; PROCESS_INFORMATION piProcInfo; OsSupport::ProcessID pid; DWORD length = 0; - TCHAR * szBuffer; - TCHAR * cmd; + char * szBuffer; + char * cmd; ZeroMemory(&siStartInfo, sizeof(STARTUPINFO)); ZeroMemory(&piProcInfo, sizeof(PROCESS_INFORMATION)); @@ -99,29 +137,36 @@ { for (int i = 1; i < procargsnum; i++) { - length += _tcslen(procargs[i]); + length += strlen(procargs[i]); } length += procargsnum; - szBuffer = (TCHAR*)malloc(length * sizeof(TCHAR)); + szBuffer = (char*)malloc(length * sizeof(char)); length = 0; for (int i = 1; i < procargsnum; i++) { - _tcscpy(&szBuffer[length], procargs[i]); - length += _tcslen(procargs[i]); - szBuffer[length] = _T(' '); + strcpy(&szBuffer[length], procargs[i]); + length += strlen(procargs[i]); + if (i + 1 < procargsnum) + { + szBuffer[length] = ' '; + } + else + { + szBuffer[length] = '\0'; + } length++; } - length = _tcslen(procname) + _tcslen(szBuffer) + 2; - cmd = (TCHAR*)malloc(length * sizeof(TCHAR)); - _tcscpy(cmd, procname); - _tcscat(cmd, _T(" ")); - _tcscat(cmd, szBuffer); + length = strlen(procname) + strlen(szBuffer) + 2; + cmd = (char*)malloc(length * sizeof(char)); + strcpy(cmd, procname); + strcat(cmd, " "); + strcat(cmd, szBuffer); free(szBuffer); } else { - cmd = _tcsdup(procname); + cmd = _strdup(procname); } if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &siStartInfo, &piProcInfo)) @@ -151,7 +196,7 @@ { LARGE_INTEGER liDueTime; - hTimer = CreateWaitableTimer(NULL, TRUE, _T("SysRegTimer")); + hTimer = CreateWaitableTimer(NULL, TRUE, "SysRegTimer"); if (!hTimer) { return 0; @@ -168,13 +213,16 @@ void OsSupport::setAlarm(long secs, OsSupport::ProcessID pid) { - + return; PTIME_ENTRY entry = (PTIME_ENTRY) malloc(sizeof(TIME_ENTRY)); if (entry) { cout << "secs: " << secs << endl; struct timeval tm; +#if 0 gettimeofday(&tm, 0); +#else +#endif tm.tv_sec += secs; entry->tm = tm; @@ -194,7 +242,7 @@ struct sigaction OsSupport::s_sact; - OsSupport::ProcessID OsSupport::createProcess(TCHAR *procname, int procargsnum, TCHAR **procargs, bool bWait) + OsSupport::ProcessID OsSupport::createProcess(char *procname, int procargsnum, char **procargs, bool bWait) { ProcessID pid; Modified: trunk/reactos/tools/sysreg/os_support.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/os_support.h?…
============================================================================== --- trunk/reactos/tools/sysreg/os_support.h (original) +++ trunk/reactos/tools/sysreg/os_support.h Mon Oct 8 04:18:01 2007 @@ -22,7 +22,10 @@ #include "user_types.h" #include <ctime> #include <vector> + +#ifndef _MSC_VER #include <sys/time.h> +#endif #define MAX(a, b) (((a) > (b)) ? (a) : (b)) @@ -66,7 +69,7 @@ /// /// - static ProcessID createProcess(TCHAR * procname, int procargsnum, TCHAR ** procargs, bool wait); + static ProcessID createProcess(char * procname, int procargsnum, char ** procargs, bool wait); //--------------------------------------------------------------------------------------- /// Modified: trunk/reactos/tools/sysreg/pipe_reader.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/pipe_reader.c…
============================================================================== --- trunk/reactos/tools/sysreg/pipe_reader.cpp (original) +++ trunk/reactos/tools/sysreg/pipe_reader.cpp Mon Oct 8 04:18:01 2007 @@ -83,12 +83,12 @@ bool PipeReader::readSource(vector<string> & lines) { - TCHAR * buf = (TCHAR*)malloc(100 * sizeof(TCHAR)); + char * buf = (char*)malloc(100 * sizeof(char)); //#ifdef NDEBUG - memset(buf, 0x0, sizeof(TCHAR) * 100); + memset(buf, 0x0, sizeof(char) * 100); //#endif - TCHAR * res = _fgetts(buf, 100, m_File); + char * res = fgets(buf, 100, m_File); if (!res) { //cerr << "Error: PipeReader::readPipe failed" << endl; Modified: trunk/reactos/tools/sysreg/rosboot_test.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/rosboot_test.…
============================================================================== --- trunk/reactos/tools/sysreg/rosboot_test.cpp (original) +++ trunk/reactos/tools/sysreg/rosboot_test.cpp Mon Oct 8 04:18:01 2007 @@ -45,25 +45,25 @@ using std::ofstream; #endif - string RosBootTest::ROS_EMU_TYPE= _T("ROS_EMU_TYPE"); - string RosBootTest::EMU_TYPE_QEMU = _T("qemu"); - string RosBootTest::EMU_TYPE_VMWARE = _T("vmware"); - string RosBootTest::ROS_HDD_IMAGE= _T("ROS_HDD_IMAGE"); - string RosBootTest::ROS_CD_IMAGE = _T("ROS_CD_IMAGE"); - string RosBootTest::ROS_MAX_TIME = _T("ROS_MAX_TIME"); - string RosBootTest::ROS_LOG_FILE = _T("ROS_LOG_FILE"); - string RosBootTest::ROS_SYM_DIR = _T("ROS_SYM_DIR"); - string RosBootTest::ROS_DELAY_READ = _T("ROS_DELAY_READ"); - string RosBootTest::ROS_SYSREG_CHECKPOINT = _T("SYSREG_CHECKPOINT:"); - string RosBootTest::ROS_CRITICAL_IMAGE = _T("ROS_CRITICAL_IMAGE"); - string RosBootTest::ROS_EMU_KILL = _T("ROS_EMU_KILL"); - string RosBootTest::ROS_EMU_MEM = _T("ROS_EMU_MEM"); - string RosBootTest::ROS_BOOT_CMD = _T("ROS_BOOT_CMD"); - -#ifdef __LINUX__ - string RosBootTest::ROS_EMU_PATH = _T("ROS_EMU_PATH_LIN"); + string RosBootTest::ROS_EMU_TYPE= "ROS_EMU_TYPE"; + string RosBootTest::EMU_TYPE_QEMU = "qemu"; + string RosBootTest::EMU_TYPE_VMWARE = "vmware"; + string RosBootTest::ROS_HDD_IMAGE= "ROS_HDD_IMAGE"; + string RosBootTest::ROS_CD_IMAGE = "ROS_CD_IMAGE"; + string RosBootTest::ROS_MAX_TIME = "ROS_MAX_TIME"; + string RosBootTest::ROS_LOG_FILE = "ROS_LOG_FILE"; + string RosBootTest::ROS_SYM_DIR = "ROS_SYM_DIR"; + string RosBootTest::ROS_DELAY_READ = "ROS_DELAY_READ"; + string RosBootTest::ROS_SYSREG_CHECKPOINT = "SYSREG_CHECKPOINT:"; + string RosBootTest::ROS_CRITICAL_IMAGE = "ROS_CRITICAL_IMAGE"; + string RosBootTest::ROS_EMU_KILL = "ROS_EMU_KILL"; + string RosBootTest::ROS_EMU_MEM = "ROS_EMU_MEM"; + string RosBootTest::ROS_BOOT_CMD = "ROS_BOOT_CMD"; + +#ifdef __LINUX__ + string RosBootTest::ROS_EMU_PATH = "ROS_EMU_PATH_LIN"; #else - string RosBootTest::ROS_EMU_PATH = _T("ROS_EMU_PATH_WIN"); + string RosBootTest::ROS_EMU_PATH = "ROS_EMU_PATH_WIN"; #endif //--------------------------------------------------------------------------------------- @@ -88,7 +88,7 @@ pBuf = (char*)m_BootCmd.c_str (); if (pBuf) { - pBuf = strtok(pBuf, _T(" ")); + pBuf = strtok(pBuf, " "); while(pBuf != NULL) { if (!numargs) @@ -96,7 +96,7 @@ args[numargs] = pBuf; numargs++; - pBuf = _tcstok(NULL, _T(" ")); + pBuf = strtok(NULL, " "); } args[numargs++] = 0; } @@ -128,20 +128,30 @@ //--------------------------------------------------------------------------------------- void RosBootTest::getDefaultHDDImage(string & img) { +#ifndef __LINUX__ + char buffer[MAX_PATH]; + if (GetCurrentDirectory(MAX_PATH, buffer)) + { + img = buffer; + img += "\\output-i386"; + + } + else +#endif img = "output-i386"; - EnvironmentVariable::getValue(_T("ROS_OUTPUT"), img); -#ifdef __LINUX__ - img += _T("/ros.hd"); + EnvironmentVariable::getValue("ROS_OUTPUT", img); +#ifdef __LINUX__ + img += "/ros.hd"; #else - img += _T("\\ros.hd"); + img += "\\ros.hd"; #endif } //--------------------------------------------------------------------------------------- bool RosBootTest::isFileExisting(string output) { FILE * file; - file = _tfopen(output.c_str(), _T("r")); + file = fopen(output.c_str(), "r"); if (file) { @@ -174,38 +184,38 @@ #ifdef __LINUX__ - qemuimgdir += _T("/qemu-img"); + qemuimgdir += "/qemu-img"; #else - qemuimgdir += _T("\\qemu-img.exe"); + qemuimgdir += "\\qemu-img.exe"; #endif if (!isFileExisting(qemuimgdir)) { - cerr << "Error: ROS_EMU_PATH must contain the path to qemu and qemu-img " << qemuimgdir << endl; - return false; - } - _tremove(image.c_str ()); - - TCHAR * options[] = {NULL, - _T("create"), - _T("-f"), + cerr << "Error: ROS_EMU_PATH must contain the path to qemu and qemu-img " << qemuimgdir << endl; + return false; + } + remove(image.c_str ()); + + char * options[] = {NULL, + "create", + "-f", #ifdef __LINUX__ _T("raw"), #else - _T("vmdk"), + "vmdk", #endif NULL, - _T("100M"), + "100M", NULL }; - options[0] = (TCHAR*)qemuimgdir.c_str(); - options[4] = (TCHAR*)image.c_str(); + options[0] = (char*)qemuimgdir.c_str(); + options[4] = (char*)image.c_str(); cerr << "Creating HDD Image ..." << image << endl; - OsSupport::createProcess ((TCHAR*)qemuimgdir.c_str(), 6, options, true); + OsSupport::createProcess ((char*)qemuimgdir.c_str(), 6, options, true); if (isFileExisting(image)) { m_HDDImage = image; @@ -223,7 +233,7 @@ /* the boot cmd is already provided * check if path to qemu is valid */ - string::size_type pos = m_BootCmd.find_first_of(_T(" ")); + string::size_type pos = m_BootCmd.find_first_of(" "); if (pos == string::npos) { /* the bootcmd is certainly not valid */ @@ -256,9 +266,9 @@ string::size_type pos; #ifdef __LINUX__ - pos = m_EmuPath.find_last_of(_T("/")); + pos = m_EmuPath.find_last_of("/"); #else - pos = m_EmuPath.find_last_of(_T("\\")); + pos = m_EmuPath.find_last_of("\\"); #endif if (pos == string::npos) { @@ -281,14 +291,14 @@ } #ifdef __LINUX__ - pipe = _T("pipe:/tmp/qemu"); - m_Src = _T("/tmp/qemu"); - qemudir = _T("/usr/share/qemu"); - m_DebugPort = _T("pipe"); + pipe = "pipe:/tmp/qemu"; + m_Src = "/tmp/qemu"; + qemudir = "/usr/share/qemu"; + m_DebugPort = "pipe"; #else - pipe = _T("pipe:qemu"); - m_Src = _T("\\\\.\\pipe\\qemu"); - m_DebugPort = _T("pipe"); + pipe = "pipe:qemu"; + m_Src = "\\\\.\\pipe\\qemu"; + m_DebugPort = "pipe"; if (!getQemuDir(qemudir)) { return false; @@ -296,24 +306,24 @@ #endif - m_BootCmd = m_EmuPath + _T(" -L ") + qemudir + _T(" -m ") + m_MaxMem + _T(" -serial ") + pipe; + m_BootCmd = m_EmuPath + " -L " + qemudir + " -m " + m_MaxMem + " -serial " + pipe; if (m_CDImage.length()) { /* boot from cdrom */ - m_BootCmd += _T(" -boot d -cdrom ") + m_CDImage; + m_BootCmd += " -boot d -cdrom " + m_CDImage; if (m_HDDImage.length ()) { /* add disk when specified */ - m_BootCmd += _T(" -hda ") + m_HDDImage; + m_BootCmd += " -hda " + m_HDDImage; } } else if (m_HDDImage.length ()) { /* boot from hdd */ - m_BootCmd += _T(" -boot c -hda ") + m_HDDImage; + m_BootCmd += " -boot c -hda " + m_HDDImage; } else { @@ -329,17 +339,17 @@ * to terminate the emulator in case of errors * on windows we can get pid as return of CreateProcess */ - m_PidFile = _T("output-i386"); - EnvironmentVariable::getValue(_T("ROS_OUTPUT"), m_PidFile); - m_PidFile += _T("/pid.txt"); - m_BootCmd += _T(" -pidfile "); + m_PidFile = "output-i386"; + EnvironmentVariable::getValue("ROS_OUTPUT", m_PidFile); + m_PidFile += "/pid.txt"; + m_BootCmd += " -pidfile "; m_BootCmd += m_PidFile; - m_BootCmd += _T(" -vnc :0"); + m_BootCmd += " -vnc :0"; #else if (hasQemuNoRebootOption()) { - m_BootCmd += _T(" -no-reboot "); + m_BootCmd += " -no-reboot "; } #endif return true; @@ -347,7 +357,7 @@ //---------------------------------------------------------------------------------------- bool RosBootTest::extractPipeFromBootCmd() { - string::size_type pos = m_BootCmd.find(_T("-serial")); + string::size_type pos = m_BootCmd.find("-serial"); if (pos == string::npos) { /* no debug options provided */ @@ -355,11 +365,11 @@ } string pipe = m_BootCmd.substr(pos + 7, m_BootCmd.size() - pos -7); - pos = pipe.find(_T("pipe:")); + pos = pipe.find("pipe:"); if (pos == 0) { pipe = pipe.substr(pos + 5, pipe.size() - pos - 5); - pos = pipe.find(_T(" ")); + pos = pipe.find(" "); if (pos != string::npos) { pipe = pipe.substr(0, pos); @@ -367,17 +377,17 @@ #ifdef __LINUX__ m_Src = pipe; #else - m_Src = _T("\\\\.\\pipe\\") + pipe.substr(0, pos); -#endif - m_DebugPort = _T("pipe"); + m_Src = "\\\\.\\pipe\\" + pipe.substr(0, pos); +#endif + m_DebugPort = "pipe"; return true; } - pos = pipe.find(_T("stdio")); + pos = pipe.find("stdio"); if (pos == 0) { #ifdef __LINUX__ m_Src = m_BootCmd; - m_DebugPort = _T("stdio"); + m_DebugPort = "stdio"; return true; #else cerr << "Error: reading from stdio is not supported for windows hosts - use pipes" << endl; @@ -433,13 +443,13 @@ */ bool hdaboot = false; - string::size_type pos = m_BootCmd.find (_T("-boot c")); + string::size_type pos = m_BootCmd.find ("-boot c"); if (pos != string::npos) { hdaboot = true; } - pos = m_BootCmd.find(_T("-hda ")); + pos = m_BootCmd.find("-hda "); if (pos != string::npos) { string hdd = m_BootCmd.substr(pos + 5, m_BootCmd.length() - pos - 5); @@ -486,18 +496,18 @@ return true; } } - if (isFileExisting(_T("ReactOS-RegTest.iso"))) - { - m_CDImage = _T("ReactOS-RegTest.iso"); + if (isFileExisting("ReactOS-RegTest.iso")) + { + m_CDImage = "ReactOS-RegTest.iso"; cerr << "Falling back to default CDROM image " << m_CDImage << endl; return true; } cerr << "No CDROM image found, boot device is HDD" << endl; - m_CDImage = _T(""); + m_CDImage = ""; return true; } - string::size_type pos = m_BootCmd.find(_T("-boot ")); + string::size_type pos = m_BootCmd.find("-boot "); if (pos == string::npos) { /* ROS_BOOT_CMD must provide a boot parameter*/ @@ -512,19 +522,19 @@ cerr << "Error: ROS_BOOT_CMD misses boot parameter" << endl; return false; } - if (rest[0] != _T('c') && rest[0] != _T('d')) + if (rest[0] != 'c' && rest[0] != 'd') { cerr << "Error: ROS_BOOT_CMD has invalid boot parameter" << endl; return false; } - if (rest[0] == _T('c')) + if (rest[0] == 'c') { /* ROS_BOOT_CMD boots from hdd */ return true; } - pos = m_BootCmd.find(_T("-cdrom ")); + pos = m_BootCmd.find("-cdrom "); if (pos == string::npos) { cerr << "Error: ROS_BOOT_CMD misses cdrom parameter" << endl; @@ -536,7 +546,7 @@ cerr << "Error: ROS_BOOT_CMD misses cdrom parameter" << endl; return false; } - pos = rest.find(_T(" ")); + pos = rest.find(" "); if (pos != string::npos) { rest = rest.substr(0, pos); @@ -591,7 +601,7 @@ if (m_PidFile.length () && isFileExisting(m_PidFile)) { cerr << "Deleting pid file " << m_PidFile << endl; - _tremove(m_PidFile.c_str ()); + remove(m_PidFile.c_str ()); } cerr << "Opening Data Source:" << m_BootCmd << endl; @@ -638,7 +648,7 @@ conf_parser.getStringValue (RosBootTest::ROS_CD_IMAGE, m_CDImage); } /* reset boot cmd */ - m_BootCmd = _T(""); + m_BootCmd = ""; conf_parser.getIntValue (RosBootTest::ROS_MAX_TIME, m_MaxTime); @@ -668,7 +678,7 @@ if (m_PidFile.length ()) { - _tremove(m_PidFile.c_str ()); + remove(m_PidFile.c_str ()); } } @@ -797,7 +807,7 @@ { line.erase (0, line.find (RosBootTest::ROS_SYSREG_CHECKPOINT) + RosBootTest::ROS_SYSREG_CHECKPOINT.length ()); - if (!_tcsncmp(line.c_str (), m_Checkpoint.c_str (), m_Checkpoint.length ())) + if (!strncmp(line.c_str (), m_Checkpoint.c_str (), m_Checkpoint.length ())) { state = DebugStateCPReached; break; @@ -806,7 +816,7 @@ } - if (line.find (_T("*** Fatal System Error")) != string::npos) + if (line.find ("*** Fatal System Error") != string::npos) { cerr << "Blue Screen of Death detected" <<endl; if (m_Checkpoints.size ()) @@ -818,7 +828,7 @@ m_Checkpoints.erase (m_Checkpoints.begin ()); cerr << cp << endl; }while(m_Checkpoints.size ()); - cerr << _T("----------------------------------") << endl; + cerr << "----------------------------------" << endl; } if (i + 1 < debug_data.size () ) { @@ -829,14 +839,14 @@ cerr << data << endl; i++; } - cerr << _T("----------------------------------") << endl; + cerr << "----------------------------------" << endl; } state = DebugStateBSODDetected; break; } - else if (line.find (_T("Unhandled exception")) != string::npos) + else if (line.find ("Unhandled exception") != string::npos) { - if (m_CriticalImage == _T("IGNORE")) + if (m_CriticalImage == "IGNORE") { /// /// ignoring all user-mode exceptions @@ -859,7 +869,7 @@ /// string address = debug_data[i+2]; - string::size_type pos = address.find_last_of (_T(" ")); + string::size_type pos = address.find_last_of (" "); if (pos == string::npos) { cerr << "Error: trace is not available (corrupted debug info" << endl; @@ -874,7 +884,7 @@ /// string modulename = debug_data[i+3]; - pos = modulename.find_last_of (_T("\\")); + pos = modulename.find_last_of ("\\"); if (pos == string::npos) { cerr << "Error: trace is not available (corrupted debug info" << endl; @@ -891,7 +901,7 @@ continue; } - pos = appname.find_last_of (_T(".")); + pos = appname.find_last_of ("."); if (pos == string::npos) { cerr << "Error: trace is not available (corrupted debug info" << endl; @@ -940,7 +950,7 @@ if (m_DebugFile.length ()) { - _tremove(m_DebugFile.c_str ()); + remove(m_DebugFile.c_str ()); file.open (m_DebugFile.c_str ()); } @@ -973,7 +983,6 @@ } lines += (vect.size() -prev_count); //WTF? } - m_DataSource->closeSource(); if (write_log) { file.close(); Modified: trunk/reactos/tools/sysreg/sym_file.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/sym_file.cpp?…
============================================================================== --- trunk/reactos/tools/sysreg/sym_file.cpp (original) +++ trunk/reactos/tools/sysreg/sym_file.cpp Mon Oct 8 04:18:01 2007 @@ -27,10 +27,10 @@ { using std::vector; - string SymbolFile::VAR_ROS_OUTPUT = _T("ROS_OUTPUT"); - string SymbolFile::ROS_ADDR2LINE = _T("ROS_ADDR2LINE"); - string SymbolFile::m_SymbolPath= _T(""); - string SymbolFile::m_SymResolver= _T(""); + string SymbolFile::VAR_ROS_OUTPUT = "ROS_OUTPUT"; + string SymbolFile::ROS_ADDR2LINE = "ROS_ADDR2LINE"; + string SymbolFile::m_SymbolPath= ""; + string SymbolFile::m_SymResolver= ""; SymbolFile::SymbolMap SymbolFile::m_Map; //--------------------------------------------------------------------------------------- @@ -51,9 +51,9 @@ vector<string> vect; string current_dir; - if (Path == _T("")) + if (Path == "") { - current_dir = _T("output-i386"); + current_dir = "output-i386"; EnvironmentVariable::getValue(SymbolFile::VAR_ROS_OUTPUT, current_dir); } else @@ -70,10 +70,10 @@ } string val = current_dir; - val.insert (val.length()-1, _T("\\*")); + val.insert (val.length()-1, "\\*"); - struct _tfinddatai64_t c_file; - intptr_t hFile = _tfindfirsti64(val.c_str(), &c_file); + struct _finddatai64_t c_file; + intptr_t hFile = _findfirsti64(val.c_str(), &c_file); if (hFile == -1L) { @@ -86,16 +86,16 @@ do { - TCHAR * pos; - if ((pos = _tcsstr(c_file.name, _T(".nostrip.")))) + char * pos; + if ((pos = strstr(c_file.name, ".nostrip."))) { - size_t len = _tcslen(pos); + size_t len = strlen(pos); string modulename = c_file.name; string filename = modulename; modulename.erase(modulename.length() - len, len); string path = current_dir; - path.insert (path.length () -1, _T("\\")); + path.insert (path.length () -1, "\\"); path.insert (path.length () -1, filename); #ifdef NDEBUG cerr << "Module Name " << modulename << endl << "File Name " << path << endl; @@ -109,7 +109,7 @@ if (c_file.name[0] != _T('.')) { string path = current_dir; - path.insert (path.length ()-1, _T("\\")); + path.insert (path.length ()-1, "\\"); path.insert (path.length ()-1, c_file.name); vect.push_back (path); } @@ -125,7 +125,7 @@ current_dir = vect.front (); vect.erase (vect.begin()); val = current_dir; - val.insert (val.length() -1, _T("\\*")); + val.insert (val.length() -1, "\\*"); hFile = _tfindfirsti64(val.c_str(), &c_file); if (hFile != -1L) { @@ -149,32 +149,27 @@ { SymbolMap::const_iterator it = m_Map.find (module_name); - if (it == m_Map.end () || m_SymResolver == _T("")) + if (it == m_Map.end () || m_SymResolver == "") { cerr << "SymbolFile::resolveAddress> no symbol file or ROS_ADDR2LINE not set" << endl; return false; } - TCHAR szCmd[300]; + char szCmd[300]; - _stprintf(szCmd, _T("%s %s %s"), m_SymResolver.c_str (), it->second.c_str (), module_address.c_str()); + sprintf(szCmd, "%s %s %s", m_SymResolver.c_str (), it->second.c_str (), module_address.c_str()); string pipe_cmd(szCmd); - + vector<string> vect; PipeReader pipe_reader; - if (!pipe_reader.openPipe (pipe_cmd)) + if (!pipe_reader.openSource(pipe_cmd)) { cerr << "SymbolFile::resolveAddress> failed to open pipe" <<pipe_cmd <<endl; return false; } - if (Buffer.capacity () < 100) - { - Buffer.reserve (500); - } - - bool ret = pipe_reader.readPipe (Buffer); - pipe_reader.closePipe (); + bool ret = pipe_reader.readSource (vect); + pipe_reader.closeSource (); return ret; } Modified: trunk/reactos/tools/sysreg/sysreg.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/sysreg.cpp?re…
============================================================================== --- trunk/reactos/tools/sysreg/sysreg.cpp (original) +++ trunk/reactos/tools/sysreg/sysreg.cpp Mon Oct 8 04:18:01 2007 @@ -22,17 +22,17 @@ using System_::SymbolFile; #endif -static const TCHAR USAGE[] = -_T("sysreg.exe [conf_file]\nconfiguration file (default: sysreg.cfg)"); +static const char USAGE[] = +"sysreg.exe [conf_file]\nconfiguration file (default: sysreg.cfg)"; -int _tmain(int argc, TCHAR * argv[]) +int main(int argc, char * argv[]) { ConfigParser config; - TCHAR DefaultConfig[] = _T("sysreg.cfg"); - TCHAR *ConfigFile; + char DefaultConfig[] = "sysreg.cfg"; + char *ConfigFile; if ((argc > 2)) { @@ -65,7 +65,7 @@ } string envvar; - string ros = _T("ROS_OUTPUT"); + string ros = "ROS_OUTPUT"; config.getStringValue (ros, envvar); #if 0 SymbolFile::initialize (config, envvar); Modified: trunk/reactos/tools/sysreg/sysreg.mak URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/sysreg.mak?re…
============================================================================== --- trunk/reactos/tools/sysreg/sysreg.mak (original) +++ trunk/reactos/tools/sysreg/sysreg.mak Mon Oct 8 04:18:01 2007 @@ -26,7 +26,6 @@ sysreg.cpp \ file_reader.cpp \ os_support.cpp \ - unicode.cpp \ ) SYSREGBUILD_OBJECTS = \ @@ -85,10 +84,6 @@ $(ECHO_CC) ${host_gpp} $(SYSREGBUILD_HOST_CFLAGS) -c $< -o $@ -$(SYSREGBUILD_INT_)unicode.o: $(SYSREGBUILD_BASE_)unicode.cpp | $(SYSREGBUILD_INT) - $(ECHO_CC) - ${host_gpp} $(SYSREGBUILD_HOST_CFLAGS) -c $< -o $@ - .PHONY: sysregbuild_clean sysreg_clean: -@$(rm) $(SYSREGBUILD_TARGET) $(SYSREGBUILD_OBJECTS) 2>$(NUL) Removed: trunk/reactos/tools/sysreg/unicode.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/unicode.cpp?r…
============================================================================== --- trunk/reactos/tools/sysreg/unicode.cpp (original) +++ trunk/reactos/tools/sysreg/unicode.cpp (removed) @@ -1,31 +1,0 @@ -#include "unicode.h" - -#include <stdlib.h> -#include <stdio.h> - -namespace System_ -{ -//--------------------------------------------------------------------------------------- - bool UnicodeConverter::ansi2Unicode(char * abuf, wchar_t *outbuf, size_t length) - { - size_t i = 0; - int conv; - - while((conv = mbtowc(&outbuf[i], &abuf[i], length - i))) - { - i += conv; - if (i == length) - break; - } - outbuf[i] = L'\0'; - - if (i) - { - return true; - } - else - { - return false; - } - } -} // end of namespace System_ Removed: trunk/reactos/tools/sysreg/unicode.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/unicode.h?rev…
============================================================================== --- trunk/reactos/tools/sysreg/unicode.h (original) +++ trunk/reactos/tools/sysreg/unicode.h (removed) @@ -1,55 +1,0 @@ -#ifndef UNICODE_H__ -#define UNICODE_H__ // unicode.h - -#include "user_types.h" - -namespace System_ -{ - - class UnicodeConverter - { - public: -//--------------------------------------------------------------------------------------- -/// -/// UnicodeConverter -/// -/// Description: destructor of class UnicodeConverter - - virtual ~UnicodeConverter() - {} - -//--------------------------------------------------------------------------------------- -/// -/// UnicodeConverter -/// -/// Description: converts an ANSI buffer to wide character buffer -/// using standard c routines -/// -/// Note: make sure before calling that outbuf is big enough to receive the result -/// -/// @param abuf ansi buffer used a source -/// @param outbuf wide character buffer receives result -/// @param length length of abuf -/// -/// @return bool - - static bool ansi2Unicode(char * abuf, wchar_t * outbuf, size_t length); - - - protected: -//--------------------------------------------------------------------------------------- -/// -/// UnicodeConverter -/// -/// Description: constructor of class UnicodeConverter - - UnicodeConverter() - {} - - }; // end of class UnicodeConverter - - - -} // end of namespace System_ - -#endif /* end of UNICODE_H__ */ Modified: trunk/reactos/tools/sysreg/user_types.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/user_types.h?…
============================================================================== --- trunk/reactos/tools/sysreg/user_types.h (original) +++ trunk/reactos/tools/sysreg/user_types.h Mon Oct 8 04:18:01 2007 @@ -14,32 +14,12 @@ #include <iostream> #ifndef __LINUX__ - #include <tchar.h> -#else - #define TCHAR char - #define tstrcpy strcpy - #define _tcstok strtok - #define _tcschr strchr - #define _tcscat strcat - #define _tcscpy(str1, str2) strcpy(str1, str2) - #define _tcslen(str1) strlen(str1) - #define _tcstod strtod - #define _tcscmp strcmp - #define _tcstoul strtoul - #define _tcsncmp strncmp - #define _tremove remove - #define _ttoi atoi - #define _T(x) x - #define _tfopen fopen - #define _tcsstr strstr - #define _fgetts fgets - #define _tgetenv getenv - #define _tmain main - #define _tcstol strtol +#define popen _popen +#define pclose _pclose #endif - typedef std::basic_string<TCHAR> string; - typedef std::basic_istringstream<TCHAR> istringstream; + typedef std::basic_string<char> string; + typedef std::basic_istringstream<char> istringstream; #ifdef UNICODE
17 years, 2 months
1
0
0
0
← Newer
1
...
55
56
57
58
59
60
61
...
71
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Results per page:
10
25
50
100
200