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
February 2006
----- 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
5 participants
47 discussions
Start a n
N
ew thread
[gedmurphy] 76: group registry gathering data together
by gedmurphy@svn.reactos.org
group registry gathering data together Modified: trunk/reactos/base/system/servman/propsheet.c Modified: trunk/reactos/base/system/servman/query.c Modified: trunk/reactos/base/system/servman/servman.h _____ Modified: trunk/reactos/base/system/servman/propsheet.c --- trunk/reactos/base/system/servman/propsheet.c 2006-02-03 19:18:17 UTC (rev 75) +++ trunk/reactos/base/system/servman/propsheet.c 2006-02-03 20:03:48 UTC (rev 76) @@ -70,13 +70,24 @@ * Fills the 'startup type' combo box with possible * values and sets it to value of the selected item */ -VOID SetStartupType(HKEY hKey) +VOID SetStartupType(LPTSTR lpServiceName) { HWND hList; + HKEY hKey; TCHAR buf[25]; DWORD dwValueSize = 0; DWORD StartUp = 0; + LPCTSTR Path = _T("System\\CurrentControlSet\\Services\\%s"); + TCHAR KeyBuf[300]; + /* open the registry key for the service */ + _sntprintf(KeyBuf, sizeof(KeyBuf) / sizeof(TCHAR), Path, lpServiceName); + RegOpenKeyEx(HKEY_LOCAL_MACHINE, + KeyBuf, + 0, + KEY_READ, + &hKey); + hList = GetDlgItem(hwndGenDlg, IDC_START_TYPE); LoadString(hInstance, IDS_SERVICES_AUTO, buf, sizeof(buf) / sizeof(TCHAR)); @@ -114,23 +125,13 @@ */ VOID GetDlgInfo() { - HKEY hKey; ENUM_SERVICE_STATUS_PROCESS *Service = NULL; PROP_DLG_INFO DlgInfo; - LPCTSTR Path = _T("System\\CurrentControlSet\\Services\\%s"); - TCHAR buf[300]; + /* get pointer to selected service */ Service = GetSelectedService(); - /* open the registry key for the service */ - /* TODO: move all this into query (getdescription)*/ - _sntprintf(buf, sizeof(buf) / sizeof(TCHAR), Path, Service->lpServiceName); - RegOpenKeyEx(HKEY_LOCAL_MACHINE, - buf, - 0, - KEY_READ, - &hKey); /* set the service name */ DlgInfo.lpServiceName = Service->lpServiceName; @@ -145,7 +146,7 @@ /* set the description */ - if (GetDescription(hKey, &DlgInfo.lpDescription)) + if (GetDescription(Service->lpServiceName, &DlgInfo.lpDescription)) SendDlgItemMessage(hwndGenDlg, IDC_DESCRIPTION, WM_SETTEXT, 0, (LPARAM)DlgInfo.lpDescription); @@ -156,10 +157,9 @@ /* set startup type */ - SetStartupType(hKey); + SetStartupType(Service->lpServiceName); - /* set service status */ if (Service->ServiceStatusProcess.dwCurrentState == SERVICE_RUNNING) { @@ -174,13 +174,10 @@ SendDlgItemMessageW(hwndGenDlg, IDC_SERV_STATUS, WM_SETTEXT, 0, (LPARAM)DlgInfo.szServiceStatus); } - - - - } + #ifdef _MSC_VER #pragma warning(disable : 4100) #endif _____ Modified: trunk/reactos/base/system/servman/query.c --- trunk/reactos/base/system/servman/query.c 2006-02-03 19:18:17 UTC (rev 75) +++ trunk/reactos/base/system/servman/query.c 2006-02-03 20:03:48 UTC (rev 76) @@ -61,17 +61,29 @@ } /* Retrives the service description from the registry */ -BOOL GetDescription(HKEY hKey, LPTSTR *retDescription) +BOOL GetDescription(LPTSTR lpServiceName, LPTSTR *retDescription) { - + HKEY hKey; LPTSTR Description = NULL; DWORD dwValueSize = 0; - LONG ret = RegQueryValueEx(hKey, - _T("Description"), - NULL, - NULL, - NULL, - &dwValueSize); + LONG ret; + LPCTSTR Path = _T("System\\CurrentControlSet\\Services\\%s"); + TCHAR buf[300]; + + /* open the registry key for the service */ + _sntprintf(buf, sizeof(buf) / sizeof(TCHAR), Path, lpServiceName); + RegOpenKeyEx(HKEY_LOCAL_MACHINE, + buf, + 0, + KEY_READ, + &hKey); + + ret = RegQueryValueEx(hKey, + _T("Description"), + NULL, + NULL, + NULL, + &dwValueSize); if (ret != ERROR_SUCCESS && ret != ERROR_FILE_NOT_FOUND && ret != ERROR_INVALID_HANDLE) { RegCloseKey(hKey); @@ -254,10 +266,9 @@ - /* set the description */ - if (GetDescription(hKey, &Description)) + if (GetDescription(pServiceStatus[Index].lpServiceName, &Description)) { item.pszText = Description; item.iSubItem = 1; _____ Modified: trunk/reactos/base/system/servman/servman.h --- trunk/reactos/base/system/servman/servman.h 2006-02-03 19:18:17 UTC (rev 75) +++ trunk/reactos/base/system/servman/servman.h 2006-02-03 20:03:48 UTC (rev 76) @@ -32,7 +32,7 @@ VOID DisplayString(PTCHAR); BOOL SetDescription(HKEY, LPTSTR *); -BOOL GetDescription(HKEY, LPTSTR *); +BOOL GetDescription(LPTSTR, LPTSTR *); BOOL GetExecutablePath(LPTSTR *); LONG APIENTRY OpenPropSheet(HWND);
18 years, 10 months
1
0
0
0
[gedmurphy] 75: fix displaying of large icons. Thanks to Christoph for pointing this out.
by gedmurphy@svn.reactos.org
fix displaying of large icons. Thanks to Christoph for pointing this out. Modified: trunk/reactos/base/system/servman/query.c _____ Modified: trunk/reactos/base/system/servman/query.c --- trunk/reactos/base/system/servman/query.c 2006-02-03 18:19:53 UTC (rev 74) +++ trunk/reactos/base/system/servman/query.c 2006-02-03 19:18:17 UTC (rev 75) @@ -194,7 +194,7 @@ if (NumServices) { - HICON hiconItem, hiconItem2; /* icon for list-view items */ + HICON hSmIconItem, hLgIconItem; /* icon for list-view items */ HIMAGELIST hSmall, hLarge; /* image list for other views */ TCHAR buf[300]; /* buffer to hold key path */ INT NumListedServ = 0; /* how many services were listed */ @@ -203,17 +203,17 @@ hSmall = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_MASK | ILC_COLOR32, 1, 1); - hLarge = ImageList_Create(GetSystemMetrics(SM_CXSMICON), - GetSystemMetrics(SM_CYSMICON), ILC_MASK | ILC_COLOR32, 1, 1); + hLarge = ImageList_Create(GetSystemMetrics(SM_CXICON), + GetSystemMetrics(SM_CYICON), ILC_MASK | ILC_COLOR32, 1, 1); /* Add an icon to each image list */ - hiconItem = LoadImage(hInstance, MAKEINTRESOURCE(IDI_SM_ICON), + hSmIconItem = LoadImage(hInstance, MAKEINTRESOURCE(IDI_SM_ICON), IMAGE_ICON, 16, 16, 0); - ImageList_AddIcon(hSmall, hiconItem); + ImageList_AddIcon(hSmall, hSmIconItem); - hiconItem2 = LoadImage(hInstance, MAKEINTRESOURCE(IDI_SM_ICON), - IMAGE_ICON, 48, 48, 0); - ImageList_AddIcon(hLarge, hiconItem2); + hLgIconItem = LoadImage(hInstance, MAKEINTRESOURCE(IDI_SM_ICON), + IMAGE_ICON, 32, 32, 0); + ImageList_AddIcon(hLarge, hLgIconItem); /* assign the image to the list view */ ListView_SetImageList(hListView, hSmall, LVSIL_SMALL);
18 years, 10 months
1
0
0
0
[gedmurphy] 74: - add functionality to delete current services
by gedmurphy@svn.reactos.org
- add functionality to delete current services - allow setting of a description when creating services - turn off toolbar buttons and menu items when not usable - fix the toolbar icons so they don't look weird when greyed out - a few other random bugfixes and alterations. Modified: trunk/reactos/base/system/servman/En.rc Modified: trunk/reactos/base/system/servman/create.c Added: trunk/reactos/base/system/servman/delete.c Modified: trunk/reactos/base/system/servman/propsheet.c Modified: trunk/reactos/base/system/servman/query.c Modified: trunk/reactos/base/system/servman/res/toolbar.bmp Modified: trunk/reactos/base/system/servman/resource.h Modified: trunk/reactos/base/system/servman/servman.c Modified: trunk/reactos/base/system/servman/servman.h Modified: trunk/reactos/base/system/servman/servman.rbuild _____ Modified: trunk/reactos/base/system/servman/En.rc --- trunk/reactos/base/system/servman/En.rc 2006-02-03 17:36:44 UTC (rev 73) +++ trunk/reactos/base/system/servman/En.rc 2006-02-03 18:19:53 UTC (rev 74) @@ -2,10 +2,14 @@ BEGIN POPUP "&File" BEGIN + MENUITEM "Export...", ID_EXPORT + MENUITEM SEPARATOR MENUITEM "E&xit", ID_EXIT END POPUP "Action" BEGIN + MENUITEM "Connect to...", ID_NET_CON, GRAYED + MENUITEM SEPARATOR MENUITEM "Start", ID_START, GRAYED MENUITEM "Stop", ID_STOP, GRAYED MENUITEM "Pause", ID_PAUSE, GRAYED @@ -14,7 +18,11 @@ MENUITEM SEPARATOR MENUITEM "Refresh", ID_REFRESH MENUITEM SEPARATOR - MENUITEM "Properties", ID_PROP, GRAYED + MENUITEM "Edit...", ID_EDIT, GRAYED + MENUITEM "Create...", ID_CREATE + MENUITEM "Delete...", ID_DELETE, GRAYED + MENUITEM SEPARATOR + MENUITEM "Properties...", ID_PROP, GRAYED END POPUP "View" BEGIN @@ -23,11 +31,11 @@ MENUITEM "List", ID_VIEW_LIST MENUITEM "Details", ID_VIEW_DETAILS MENUITEM SEPARATOR - MENUITEM "Customize", ID_VIEW_CUSTOMIZE, GRAYED + MENUITEM "Customize...",ID_VIEW_CUSTOMIZE, GRAYED END POPUP "Help" BEGIN - MENUITEM "About", ID_ABOUT + MENUITEM "About...", ID_ABOUT END END IDR_POPUP MENU @@ -40,21 +48,14 @@ MENUITEM "Resume", ID_RESUME, GRAYED MENUITEM "Restart", ID_RESTART, GRAYED MENUITEM SEPARATOR - POPUP "All tasks" - BEGIN - MENUITEM "Start", ID_START, GRAYED - MENUITEM "Stop", ID_STOP, GRAYED - MENUITEM "Pause", ID_PAUSE, GRAYED - MENUITEM "Resume", ID_RESUME, GRAYED - MENUITEM "Restart", ID_RESTART, GRAYED - MENUITEM "Refresh", ID_REFRESH, GRAYED - END - MENUITEM SEPARATOR MENUITEM "Refresh", ID_REFRESH MENUITEM SEPARATOR - MENUITEM "Properties", ID_PROP + MENUITEM "Edit...", ID_EDIT, GRAYED + MENUITEM "Delete...", ID_DELETE, GRAYED MENUITEM SEPARATOR - MENUITEM "Help", ID_HELP + MENUITEM "Properties...", ID_PROP, GRAYED + MENUITEM SEPARATOR + MENUITEM "Help...", ID_HELP END END @@ -127,6 +128,20 @@ CONTROL "Help",ID_CREATE_HELP,"Button",0x50010000,6,192,44,13 END +IDD_DLG_DELETE DIALOGEX 6,6,185,148 +CAPTION "Delete a service" +FONT 8,"Tahoma",0,0 +STYLE WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME +BEGIN + ICON IDI_WARNING, IDC_STATIC, 4, 5, 24, 22 + LTEXT "Are you sure you want to delete the following service? This cannot be undone once removed!", IDC_STATIC, 32, 9, 152, 17 + LTEXT "Service Name:",IDC_STATIC, 6, 40, 80, 9 + LTEXT "", IDC_DEL_NAME, 15, 53, 160, 15 + EDITTEXT IDC_DEL_DESC, 6, 73, 174, 48, WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_EX_STATICEDGE | ES_MULTILINE | ES_READONLY + PUSHBUTTON "Yes", IDOK, 26, 129, 54, 13 + PUSHBUTTON "No", IDCANCEL, 102, 129, 54, 13 +END + IDD_DLG_HELP_OPTIONS DIALOGEX 6,6,200,150 CAPTION "Options" FONT 8,"MS Sans Serif",0,0 @@ -143,8 +158,8 @@ EXSTYLE WS_EX_TOOLWINDOW BEGIN CONTROL "",IDC_SERVCON_PROGRESS,"msctls_progress32",0x50000000,8,46,238,13 - CONTROL "",IDC_SERVCON_INFO,"Static",0x50000000,8,5,236,11 - CONTROL "",IDC_SERVCON_NAME,"Static",0x50000000,8,25,66,11 + LTEXT "", IDC_SERVCON_INFO, 8, 5, 236, 11 + LTEXT "", IDC_SERVCON_NAME, 8, 25, 66, 11 PUSHBUTTON "&Close", IDOK, 100, 70, 54, 13 END _____ Modified: trunk/reactos/base/system/servman/create.c --- trunk/reactos/base/system/servman/create.c 2006-02-03 17:36:44 UTC (rev 73) +++ trunk/reactos/base/system/servman/create.c 2006-02-03 18:19:53 UTC (rev 74) @@ -3,7 +3,7 @@ * LICENSE: GPL - See COPYING in the top level directory * FILE: base/system/servman/create.c * PURPOSE: Create a new service - * COPYRIGHT: Copyright 2005 Ged Murphy <gedmurphy(a)gmail.com> + * COPYRIGHT: Copyright 2006 Ged Murphy <gedmurphy(a)gmail.com> * */ @@ -20,6 +20,9 @@ { SC_HANDLE hSCManager; SC_HANDLE hSc; + HKEY hKey; + LPCTSTR Path = _T("System\\CurrentControlSet\\Services\\%s"); + TCHAR buf[300]; /* open handle to the SCM */ hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); @@ -49,6 +52,19 @@ return FALSE; } + + + /* open the registry key for the service */ + /* TODO: move all this into query */ + _sntprintf(buf, sizeof(buf) / sizeof(TCHAR), Path, ServiceName); + RegOpenKeyEx(HKEY_LOCAL_MACHINE, + buf, + 0, + KEY_READ, + &hKey); + + SetDescription(hKey, &Description); + DisplayString(_T("Service Succesfully Created")); CloseServiceHandle(hSCManager); CloseServiceHandle(hSc); _____ Added: trunk/reactos/base/system/servman/delete.c --- trunk/reactos/base/system/servman/delete.c 2006-02-03 17:36:44 UTC (rev 73) +++ trunk/reactos/base/system/servman/delete.c 2006-02-03 18:19:53 UTC (rev 74) @@ -0,0 +1,108 @@ +/* + * PROJECT: ReactOS Services + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/servman/delete.c + * PURPOSE: Delete an existing service + * COPYRIGHT: Copyright 2006 Ged Murphy <gedmurphy(a)gmail.com> + * + */ + +#include "servman.h" + +extern HINSTANCE hInstance; +extern HWND hListView; + +BOOL DoDeleteService(HWND hDlg) +{ + SC_HANDLE hSCManager; + SC_HANDLE hSc; + ENUM_SERVICE_STATUS_PROCESS *Service = NULL; + + /* open handle to the SCM */ + hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); + if (hSCManager == NULL) + { + GetError(0); + return FALSE; + } + + /* copy pointer to selected service */ + Service = GetSelectedService(); + + /* get a handle to the service requested for starting */ + hSc = OpenService(hSCManager, Service->lpServiceName, DELETE); + if (hSc == NULL) + { + GetError(0); + return FALSE; + } + + /* start the service opened */ + if (! DeleteService(hSc)) + { + GetError(0); + return FALSE; + } + + + CloseServiceHandle(hSCManager); + CloseServiceHandle(hSc); + + return TRUE; +} + + +#ifdef _MSC_VER +#pragma warning(disable : 4100) +#endif +BOOL CALLBACK +DeleteDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + ENUM_SERVICE_STATUS_PROCESS *Service = NULL; + HICON hIcon = NULL; + TCHAR Buf[1000]; + LVITEM item; + + switch (message) + { + case WM_INITDIALOG: + + hIcon = LoadImage(hInstance, MAKEINTRESOURCE(IDI_SM_ICON), IMAGE_ICON, 16, 16, 0); + SendMessage(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)hIcon); + + /* get pointer to selected service */ + Service = GetSelectedService(); + + SendDlgItemMessage(hDlg, IDC_DEL_NAME, WM_SETTEXT, 0, (LPARAM)Service->lpDisplayName); + + + item.mask = LVIF_TEXT; + item.iItem = GetSelectedItem(); + item.iSubItem = 1; + item.pszText = Buf; + item.cchTextMax = sizeof(Buf); + SendMessage(hListView, LVM_GETITEM, 0, (LPARAM)&item); + + SendDlgItemMessage(hDlg, IDC_DEL_DESC, WM_SETTEXT, 0, + (LPARAM)Buf); + + return TRUE; + + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDOK: + DoDeleteService(hDlg); + DestroyIcon(hIcon); + EndDialog(hDlg, LOWORD(wParam)); + return TRUE; + + case IDCANCEL: + DestroyIcon(hIcon); + EndDialog(hDlg, LOWORD(wParam)); + return TRUE; + } + } + + return FALSE; +} _____ Modified: trunk/reactos/base/system/servman/propsheet.c --- trunk/reactos/base/system/servman/propsheet.c 2006-02-03 17:36:44 UTC (rev 73) +++ trunk/reactos/base/system/servman/propsheet.c 2006-02-03 18:19:53 UTC (rev 74) @@ -124,6 +124,7 @@ Service = GetSelectedService(); /* open the registry key for the service */ + /* TODO: move all this into query (getdescription)*/ _sntprintf(buf, sizeof(buf) / sizeof(TCHAR), Path, Service->lpServiceName); RegOpenKeyEx(HKEY_LOCAL_MACHINE, buf, @@ -309,6 +310,37 @@ } +INT CALLBACK AddEditButton(HWND hwnd, UINT message, LPARAM lParam) +{ + HWND hEditButton; + + switch (message) + { + case PSCB_PRECREATE: + /*hEditButton = CreateWindowEx(0, + WC_BUTTON, + NULL, + WS_CHILD | WS_VISIBLE, + 20, 300, 30, 15, + hwnd, + NULL, + hInstance, + NULL); + if (hEditButton == NULL) + GetError(0);*/ + + hEditButton = GetDlgItem(hwnd, PSBTN_OK); + DestroyWindow(hEditButton); + //SetWindowText(hEditButton, _T("test")); + + return TRUE; + } + return TRUE; +} + + + + static VOID InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc) { @@ -324,29 +356,30 @@ LONG APIENTRY OpenPropSheet(HWND hwnd) { - PROPSHEETHEADER psh; - PROPSHEETPAGE psp[2]; - TCHAR Caption[256]; + PROPSHEETHEADER psh; + PROPSHEETPAGE psp[2]; + ENUM_SERVICE_STATUS_PROCESS *Service = NULL; - LoadString(hInstance, IDS_PROP_SHEET, Caption, sizeof(Caption) / sizeof(TCHAR)); + Service = GetSelectedService(); - ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); - psh.dwSize = sizeof(PROPSHEETHEADER); - psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE; - psh.hwndParent = NULL; - psh.hInstance = hInstance; - psh.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SM_ICON)); - psh.pszCaption = Caption; - psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE); - psh.nStartPage = 0; - psh.ppsp = psp; + ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); + psh.dwSize = sizeof(PROPSHEETHEADER); + psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE | PSH_USECALLBACK; + psh.hwndParent = hwnd; + psh.hInstance = hInstance; + psh.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SM_ICON)); + psh.pszCaption = Service->lpDisplayName; + psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE); + psh.nStartPage = 0; + psh.pfnCallback = AddEditButton; + psh.ppsp = psp; - InitPropSheetPage(&psp[0], IDD_DLG_GENERAL, GeneralPageProc); - //InitPropSheetPage(&psp[1], IDD_DLG_GENERAL, LogonPageProc); - //InitPropSheetPage(&psp[2], IDD_DLG_GENERAL, RecoveryPageProc); - InitPropSheetPage(&psp[1], IDD_DLG_DEPEND, DependanciesPageProc); + InitPropSheetPage(&psp[0], IDD_DLG_GENERAL, GeneralPageProc); + //InitPropSheetPage(&psp[1], IDD_DLG_GENERAL, LogonPageProc); + //InitPropSheetPage(&psp[2], IDD_DLG_GENERAL, RecoveryPageProc); + InitPropSheetPage(&psp[1], IDD_DLG_DEPEND, DependanciesPageProc); - return (LONG)(PropertySheet(&psh) != -1); + return (LONG)(PropertySheet(&psh) != -1); } _____ Modified: trunk/reactos/base/system/servman/query.c --- trunk/reactos/base/system/servman/query.c 2006-02-03 17:36:44 UTC (rev 73) +++ trunk/reactos/base/system/servman/query.c 2006-02-03 18:19:53 UTC (rev 74) @@ -42,6 +42,24 @@ } +/* Sets the service description in the registry */ +BOOL SetDescription(HKEY hKey, LPTSTR *Description) +{ + TCHAR szBuf[MAX_PATH]; + + if (RegSetValueEx(hKey, + L"Description", + 0, + REG_SZ, + (LPBYTE)Description, + (DWORD)lstrlen(szBuf)+1)) + GetError(0); + + + RegCloseKey(hKey); + return TRUE; +} + /* Retrives the service description from the registry */ BOOL GetDescription(HKEY hKey, LPTSTR *retDescription) { @@ -176,22 +194,30 @@ if (NumServices) { - HICON hiconItem; /* icon for list-view items */ - HIMAGELIST hSmall; /* image list for other views */ + HICON hiconItem, hiconItem2; /* icon for list-view items */ + HIMAGELIST hSmall, hLarge; /* image list for other views */ TCHAR buf[300]; /* buffer to hold key path */ INT NumListedServ = 0; /* how many services were listed */ /* Create the icon image lists */ hSmall = ImageList_Create(GetSystemMetrics(SM_CXSMICON), - GetSystemMetrics(SM_CYSMICON), ILC_MASK | ILC_COLOR16, 1, 1); + GetSystemMetrics(SM_CYSMICON), ILC_MASK | ILC_COLOR32, 1, 1); + hLarge = ImageList_Create(GetSystemMetrics(SM_CXSMICON), + GetSystemMetrics(SM_CYSMICON), ILC_MASK | ILC_COLOR32, 1, 1); + /* Add an icon to each image list */ hiconItem = LoadImage(hInstance, MAKEINTRESOURCE(IDI_SM_ICON), IMAGE_ICON, 16, 16, 0); ImageList_AddIcon(hSmall, hiconItem); + hiconItem2 = LoadImage(hInstance, MAKEINTRESOURCE(IDI_SM_ICON), + IMAGE_ICON, 48, 48, 0); + ImageList_AddIcon(hLarge, hiconItem2); + /* assign the image to the list view */ ListView_SetImageList(hListView, hSmall, LVSIL_SMALL); + ListView_SetImageList(hListView, hLarge, LVSIL_NORMAL); for (Index = 0; Index < NumServices; Index++) { _____ Modified: trunk/reactos/base/system/servman/res/toolbar.bmp (Binary files differ) _____ Modified: trunk/reactos/base/system/servman/resource.h --- trunk/reactos/base/system/servman/resource.h 2006-02-03 17:36:44 UTC (rev 73) +++ trunk/reactos/base/system/servman/resource.h 2006-02-03 18:19:53 UTC (rev 74) @@ -8,6 +8,7 @@ #define IDC_SERVLIST 1000 #define IDC_TOOLBAR 1001 #define IDC_STATUSBAR 1002 +#define IDC_EDIT_BUTTON 1003 #define ID_PROP 2000 #define ID_REFRESH 2001 @@ -17,9 +18,12 @@ #define ID_PAUSE 2005 #define ID_RESUME 2006 #define ID_RESTART 2007 -#define ID_NEW 2008 -#define ID_HELP 2009 -#define ID_EXIT 2010 +#define ID_EDIT 2008 +#define ID_CREATE 2009 +#define ID_DELETE 2010 +#define ID_HELP 2011 +#define ID_EXIT 2012 +#define ID_NET_CON 2013 #define IDR_MAINMENU 102 #define IDR_POPUP 103 @@ -63,7 +67,7 @@ #define TBICON_PROP 0 #define TBICON_REFRESH 1 #define TBICON_EXPORT 2 -#define TBICON_NEW 3 +#define TBICON_CREATE 3 #define TBICON_START 4 #define TBICON_STOP 5 #define TBICON_PAUSE 6 @@ -72,7 +76,6 @@ #define TBICON_EXIT 9 /* properties dialog */ -#define IDS_PROP_SHEET 10000 #define IDD_DLG_GENERAL 10001 #define IDC_SERV_NAME 10041 #define IDC_DISP_NAME 10051 @@ -86,6 +89,7 @@ #define IDC_RESUME 10161 #define IDC_START_PARAM 10191 +/* dependancies dialog */ #define IDD_DLG_DEPEND 20001 #define IDC_DEPEND_TREE1 20002 #define IDC_DEPEND_TREE2 20003 @@ -104,6 +108,14 @@ #define IDC_CREATE_HELP 8021 #define IDS_HELP_OPTIONS 8022 + +/* delete service dialog */ +#define IDD_DLG_DELETE 9000 +#define IDC_DEL_GROUP 9001 +#define IDC_DEL_NAME 9002 +#define IDC_DEL_DESC 9003 + + /* progress bar */ #define IDD_DLG_PROGRESS 7000 #define IDC_SERVCON_PROGRESS 7001 _____ Modified: trunk/reactos/base/system/servman/servman.c --- trunk/reactos/base/system/servman/servman.c 2006-02-03 17:36:44 UTC (rev 73) +++ trunk/reactos/base/system/servman/servman.c 2006-02-03 18:19:53 UTC (rev 74) @@ -20,6 +20,8 @@ HMENU hShortcutMenu; INT SelectedItem = -1; +TBBUTTON *ptbb; + extern HWND hwndGenDlg; @@ -59,7 +61,14 @@ EnableMenuItem(hShortcutMenu, ID_RESUME, MF_GRAYED); EnableMenuItem(hShortcutMenu, ID_RESTART, MF_GRAYED); - //EnableWindow(hTool, FALSE); + SendMessage(hTool, TB_SETSTATE, ID_START, + (LPARAM)MAKELONG(TBSTATE_INDETERMINATE, 0)); + SendMessage(hTool, TB_SETSTATE, ID_STOP, + (LPARAM)MAKELONG(TBSTATE_INDETERMINATE, 0)); + SendMessage(hTool, TB_SETSTATE, ID_PAUSE, + (LPARAM)MAKELONG(TBSTATE_INDETERMINATE, 0)); + SendMessage(hTool, TB_SETSTATE, ID_RESTART, + (LPARAM)MAKELONG(TBSTATE_INDETERMINATE, 0)); if (GetSelectedItem() != -1) { @@ -73,28 +82,42 @@ { EnableMenuItem(hMainMenu, ID_START, MF_ENABLED); EnableMenuItem(hShortcutMenu, ID_START, MF_ENABLED); + SendMessage(hTool, TB_SETSTATE, ID_START, + (LPARAM)MAKELONG(TBSTATE_ENABLED, 0)); } if ( (Flags & SERVICE_ACCEPT_STOP) && (State == SERVICE_RUNNING) ) { EnableMenuItem(hMainMenu, ID_STOP, MF_ENABLED); EnableMenuItem(hShortcutMenu, ID_STOP, MF_ENABLED); + SendMessage(hTool, TB_SETSTATE, ID_STOP, + (LPARAM)MAKELONG(TBSTATE_ENABLED, 0)); } if ( (Flags & SERVICE_ACCEPT_PAUSE_CONTINUE) && (State == SERVICE_RUNNING) ) { EnableMenuItem(hMainMenu, ID_PAUSE, MF_ENABLED); EnableMenuItem(hShortcutMenu, ID_PAUSE, MF_ENABLED); + SendMessage(hTool, TB_SETSTATE, ID_PAUSE, + (LPARAM)MAKELONG(TBSTATE_ENABLED, 0)); } if ( (Flags & SERVICE_ACCEPT_STOP) && (State == SERVICE_RUNNING) ) { EnableMenuItem(hMainMenu, ID_RESTART, MF_ENABLED); EnableMenuItem(hShortcutMenu, ID_RESTART, MF_ENABLED); + SendMessage(hTool, TB_SETSTATE, ID_RESTART, + (LPARAM)MAKELONG(TBSTATE_ENABLED, 0)); } } else + { EnableMenuItem(hMainMenu, ID_PROP, MF_GRAYED); + EnableMenuItem(hMainMenu, ID_DELETE, MF_GRAYED); + EnableMenuItem(hShortcutMenu, ID_DELETE, MF_GRAYED); + SendMessage(hTool, TB_SETSTATE, ID_PROP, + (LPARAM)MAKELONG(TBSTATE_INDETERMINATE, 0)); + } } @@ -114,29 +137,31 @@ /* Toolbar buttons */ TBBUTTON tbb [NUM_BUTTONS] = { /* iBitmap, idCommand, fsState, fsStyle, bReserved[2], dwData, iString */ - {TBICON_PROP, ID_PROP, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, /* properties */ - {TBICON_REFRESH, ID_REFRESH, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, /* refresh */ - {TBICON_EXPORT, ID_EXPORT, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, /* export */ + {TBICON_PROP, ID_PROP, TBSTATE_INDETERMINATE, BTNS_BUTTON, {0}, 0, 0}, /* properties */ + {TBICON_REFRESH, ID_REFRESH, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, /* refresh */ + {TBICON_EXPORT, ID_EXPORT, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, /* export */ /* Note: First item for a seperator is its width in pixels */ - {15, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0}, /* separator */ + {15, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0}, /* separator */ - {TBICON_NEW, ID_NEW, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* create */ + {TBICON_CREATE, ID_CREATE, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* create */ - {15, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0}, /* separator */ + {15, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0}, /* separator */ - {TBICON_START, ID_START, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* start */ - {TBICON_STOP, ID_STOP, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* stop */ - {TBICON_PAUSE, ID_PAUSE, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* pause */ - {TBICON_RESTART, ID_RESTART, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* restart */ + {TBICON_START, ID_START, TBSTATE_INDETERMINATE, BTNS_BUTTON, {0}, 0, 0 }, /* start */ + {TBICON_STOP, ID_STOP, TBSTATE_INDETERMINATE, BTNS_BUTTON, {0}, 0, 0 }, /* stop */ + {TBICON_PAUSE, ID_PAUSE, TBSTATE_INDETERMINATE, BTNS_BUTTON, {0}, 0, 0 }, /* pause */ + {TBICON_RESTART, ID_RESTART, TBSTATE_INDETERMINATE, BTNS_BUTTON, {0}, 0, 0 }, /* restart */ - {15, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0}, /* separator */ + {15, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0}, /* separator */ - {TBICON_HELP, ID_HELP, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* help */ - {TBICON_EXIT, ID_EXIT, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* exit */ + {TBICON_HELP, ID_HELP, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* help */ + {TBICON_EXIT, ID_EXIT, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* exit */ }; + ptbb = tbb; + /* ======================== Create Toolbar ============================== */ /* Create Toolbar */ @@ -153,7 +178,6 @@ MessageBox(hwnd, _T("Could not create tool bar."), _T("Error"), MB_OK | MB_ICONERROR); /* Send the TB_BUTTONSTRUCTSIZE message, which is required for backward compatibility */ - SendMessage(hTool, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0); /* Add custom images */ @@ -163,7 +187,7 @@ tbb[0].iBitmap += iImageOffset; /* properties */ tbb[1].iBitmap += iImageOffset; /* refresh */ tbb[2].iBitmap += iImageOffset; /* export */ - tbb[4].iBitmap += iImageOffset; /* new */ + tbb[4].iBitmap += iImageOffset; /* create */ tbb[6].iBitmap += iImageOffset; /* start */ tbb[7].iBitmap += iImageOffset; /* stop */ tbb[8].iBitmap += iImageOffset; /* pause */ @@ -330,6 +354,14 @@ if (GetMenuState(hMainMenu, ID_PROP, MF_BYCOMMAND) != MF_ENABLED) EnableMenuItem(hMainMenu, ID_PROP, MF_ENABLED); + /* activate delete menu item, if not already */ + if (GetMenuState(hMainMenu, ID_DELETE, MF_BYCOMMAND) != MF_ENABLED) + { + EnableMenuItem(hMainMenu, ID_DELETE, MF_ENABLED); + EnableMenuItem(hShortcutMenu, ID_DELETE, MF_ENABLED); + } + + /* globally set selected service */ SelectedItem = pnmv->iItem; @@ -342,6 +374,10 @@ /* set current selected service in the status bar */ SendMessage(hStatus, SB_SETTEXT, 1, (LPARAM)Service->lpDisplayName); + /* show the properties button */ + SendMessage(hTool, TB_SETSTATE, ID_PROP, + (LPARAM)MAKELONG(TBSTATE_ENABLED, 0)); + } break; @@ -369,7 +405,7 @@ lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_EXPORT); break; - case ID_NEW: + case ID_CREATE: lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_NEW); break; @@ -443,14 +479,40 @@ case ID_EXPORT: ExportFile(hListView); + SetFocus(hListView); break; - case ID_NEW: + case ID_CREATE: DialogBox(hInstance, MAKEINTRESOURCE(IDD_DLG_CREATE), hMainWnd, (DLGPROC)CreateDialogProc); + SetFocus(hListView); + break; + case ID_DELETE: + { + ENUM_SERVICE_STATUS_PROCESS *Service = NULL; + + Service = GetSelectedService(); + + if (Service->ServiceStatusProcess.dwCurrentState != + SERVICE_RUNNING) + { + DialogBox(hInstance, + MAKEINTRESOURCE(IDD_DLG_DELETE), + hMainWnd, + (DLGPROC)DeleteDialogProc); + } + else + { + MessageBox(NULL, _T("You must manually stop the service before deleting!\n"), + _T("Note!"), MB_OK | MB_ICONINFORMATION); + } + + SetFocus(hListView); + + } break; case ID_START: @@ -578,6 +640,7 @@ case ID_HELP: MessageBox(NULL, _T("Help is not yet implemented\n"), _T("Note!"), MB_OK | MB_ICONINFORMATION); + SetFocus(hListView); break; case ID_EXIT: @@ -608,6 +671,7 @@ MAKEINTRESOURCE(IDD_ABOUTBOX), hMainWnd, (DLGPROC)AboutDialogProc); + SetFocus(hListView); break; } _____ Modified: trunk/reactos/base/system/servman/servman.h --- trunk/reactos/base/system/servman/servman.h 2006-02-03 17:36:44 UTC (rev 73) +++ trunk/reactos/base/system/servman/servman.h 2006-02-03 18:19:53 UTC (rev 74) @@ -17,6 +17,7 @@ BOOL CALLBACK AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); BOOL CALLBACK CreateDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +BOOL CALLBACK DeleteDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); BOOL CALLBACK ProgressDialogProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam); BOOL DoStartService(HWND hProgDlg); @@ -30,6 +31,7 @@ VOID FreeMemory(VOID); VOID DisplayString(PTCHAR); +BOOL SetDescription(HKEY, LPTSTR *); BOOL GetDescription(HKEY, LPTSTR *); BOOL GetExecutablePath(LPTSTR *); _____ Modified: trunk/reactos/base/system/servman/servman.rbuild --- trunk/reactos/base/system/servman/servman.rbuild 2006-02-03 17:36:44 UTC (rev 73) +++ trunk/reactos/base/system/servman/servman.rbuild 2006-02-03 18:19:53 UTC (rev 74) @@ -19,6 +19,7 @@ <file>about.c</file> <file>control.c</file> <file>create.c</file> + <file>delete.c</file> <file>export.c</file> <file>geterror.c</file> <file>progress.c</file>
18 years, 10 months
1
0
0
0
[gedmurphy] 73: fixed security issues - fixes bug 1307
by gedmurphy@svn.reactos.org
fixed security issues - fixes bug 1307 fixed unicode over network issues Modified: trunk/reactos/base/services/tcpsvcs/chargen.c Modified: trunk/reactos/base/services/tcpsvcs/daytime.c Modified: trunk/reactos/base/services/tcpsvcs/discard.c Modified: trunk/reactos/base/services/tcpsvcs/echo.c Modified: trunk/reactos/base/services/tcpsvcs/qotd.c Modified: trunk/reactos/base/services/tcpsvcs/skelserver.c Modified: trunk/reactos/base/services/tcpsvcs/tcpsvcs.c Modified: trunk/reactos/base/services/tcpsvcs/tcpsvcs.h _____ Modified: trunk/reactos/base/services/tcpsvcs/chargen.c --- trunk/reactos/base/services/tcpsvcs/chargen.c 2006-02-02 20:20:51 UTC (rev 72) +++ trunk/reactos/base/services/tcpsvcs/chargen.c 2006-02-03 17:36:44 UTC (rev 73) @@ -4,7 +4,7 @@ * 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> - * + * */ #include "tcpsvcs.h" @@ -30,7 +30,7 @@ LogEvent(_T("Chargen: Connection shutdown failed\n"), 0, FALSE); RetVal = 1; } - + LogEvent(_T("Chargen: Terminating thread\n"), 0, FALSE); ExitThread(RetVal); @@ -73,8 +73,8 @@ charIndex++; } - Line[LINESIZ - 2] = L'\r'; - Line[LINESIZ - 1] = L'\n'; + Line[LINESIZ - 2] = '\r'; + Line[LINESIZ - 1] = '\n'; if (! SendLine(Sock, Line)) break; @@ -82,14 +82,14 @@ /* increment loop index to start printing from next char in ring */ loopIndex++; } - + if (bShutDown) return FALSE; else return TRUE; } -BOOL SendLine(SOCKET Sock, TCHAR* Line) +BOOL SendLine(SOCKET Sock, char* Line) { INT RetVal; INT SentBytes; _____ Modified: trunk/reactos/base/services/tcpsvcs/daytime.c --- trunk/reactos/base/services/tcpsvcs/daytime.c 2006-02-02 20:20:51 UTC (rev 72) +++ trunk/reactos/base/services/tcpsvcs/daytime.c 2006-02-03 17:36:44 UTC (rev 73) @@ -4,7 +4,7 @@ * 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> - * + * */ #include "tcpsvcs.h" @@ -13,14 +13,14 @@ { struct tm *newtime; time_t aclock; - TCHAR *pszTime; + CHAR *pszTime; DWORD RetVal = 0; SOCKET Sock = (SOCKET)Sock_; - + time(&aclock); newtime = localtime(&aclock); - pszTime = _tasctime(newtime); - + pszTime = asctime(newtime); + SendTime(Sock, pszTime); LogEvent(_T("DayTime: Shutting connection down...\n"), 0, FALSE); @@ -31,17 +31,17 @@ LogEvent(_T("DayTime: Connection shutdown failed\n"), 0, FALSE); RetVal = 1; } - + LogEvent(_T("DayTime: Terminating thread\n"), 0, FALSE); ExitThread(RetVal); } -BOOL SendTime(SOCKET Sock, TCHAR *time) +BOOL SendTime(SOCKET Sock, CHAR *time) { - INT StringSize = (INT)_tcsclen(time); - INT RetVal = send(Sock, time, sizeof(TCHAR) * StringSize, 0); - + INT StringSize = (INT)strlen(time); + INT RetVal = send(Sock, time, sizeof(CHAR) * StringSize, 0); + if (RetVal == SOCKET_ERROR) return FALSE; _____ Modified: trunk/reactos/base/services/tcpsvcs/discard.c --- trunk/reactos/base/services/tcpsvcs/discard.c 2006-02-02 20:20:51 UTC (rev 72) +++ trunk/reactos/base/services/tcpsvcs/discard.c 2006-02-03 17:36:44 UTC (rev 73) @@ -4,7 +4,7 @@ * 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> - * + * */ #include "tcpsvcs.h" @@ -30,7 +30,7 @@ LogEvent(_T("Discard: Connection shutdown failed\n"), 0, FALSE); RetVal = 1; } - + LogEvent(_T("Discard: Terminating thread\n"), 0, FALSE); ExitThread(RetVal); } @@ -39,7 +39,7 @@ BOOL RecieveIncomingPackets(SOCKET Sock) { - TCHAR ReadBuffer[BUF]; + char ReadBuffer[BUF]; TCHAR buf[256]; INT ReadBytes; @@ -53,7 +53,7 @@ } else if (ReadBytes == SOCKET_ERROR) { - _stprintf(buf, ("Socket Error: %d\n"), WSAGetLastError()); + _stprintf(buf, _T("Socket Error: %d\n"), WSAGetLastError()); LogEvent(buf, 0, TRUE); return FALSE; } _____ Modified: trunk/reactos/base/services/tcpsvcs/echo.c --- trunk/reactos/base/services/tcpsvcs/echo.c 2006-02-02 20:20:51 UTC (rev 72) +++ trunk/reactos/base/services/tcpsvcs/echo.c 2006-02-03 17:36:44 UTC (rev 73) @@ -4,7 +4,7 @@ * 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> - * + * */ #include "tcpsvcs.h" @@ -22,7 +22,7 @@ } LogEvent(_T("Echo: Shutting connection down...\n"), 0, FALSE); - + if (ShutdownConnection(Sock, TRUE)) LogEvent(_T("Echo: Connection is down\n"), 0, FALSE); else @@ -30,7 +30,7 @@ LogEvent(_T("Echo: Connection shutdown failed\n"), 0, FALSE); RetVal = 1; } - + LogEvent(_T("Echo: Terminating thread\n"), 0, FALSE); ExitThread(RetVal); } @@ -39,7 +39,7 @@ BOOL EchoIncomingPackets(SOCKET Sock) { - TCHAR ReadBuffer[BUF]; + char ReadBuffer[BUF]; TCHAR buf[256]; // temp for holding LogEvent text INT Temp; INT ReadBytes; _____ Modified: trunk/reactos/base/services/tcpsvcs/qotd.c --- trunk/reactos/base/services/tcpsvcs/qotd.c 2006-02-02 20:20:51 UTC (rev 72) +++ trunk/reactos/base/services/tcpsvcs/qotd.c 2006-02-03 17:36:44 UTC (rev 73) @@ -4,21 +4,21 @@ * 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> - * + * */ #include "tcpsvcs.h" -#define QBUFSIZ 160 +#define QBUFSIZ 60 -LPCTSTR FilePath = _T("\\drivers\\etc\\quotes"); +LPCTSTR FilePath = _T("\\drivers\\etc\\quotes"); /* 19 chars */ DWORD WINAPI QotdHandler(VOID* Sock_) { FILE *fp; SOCKET Sock; - TCHAR Sys[MAX_PATH]; - TCHAR Quote[60][BUFSIZ]; // need to set this dynamically + TCHAR Sys[MAX_PATH + 20]; + char Quote[QBUFSIZ][BUFSIZ]; // need to set this dynamically INT QuoteToPrint; INT NumQuotes; @@ -29,15 +29,15 @@ LogEvent(_T("QOTD: Getting system path failed.\n"), 0, TRUE); ExitThread(1); } - - _tcscat(Sys, FilePath); + _tcsncat(Sys, FilePath, _tcslen(FilePath)); + LogEvent(_T("QOTD: Opening quotes file\n"), 0, FALSE); - if ((fp = _tfopen(Sys, "r")) == NULL) + if ((fp = _tfopen(Sys, _T("r"))) == NULL) { - TCHAR buf[256]; + TCHAR buf[320]; - _stprintf(buf, _T("QOTD: Error opening quote file : %s\n"), Sys); + _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); @@ -45,7 +45,8 @@ /* read all quotes in the file into an array */ NumQuotes = 0; - while (_fgetts(Quote[NumQuotes], QBUFSIZ, fp) != NULL) + while ((fgets(Quote[NumQuotes], QBUFSIZ, fp) != NULL) && + (NumQuotes != QBUFSIZ)) NumQuotes++; LogEvent(_T("QOTD: Closing quotes file\n"), 0, FALSE); @@ -68,21 +69,20 @@ LogEvent(_T("QOTD: Terminating thread\n"), 0, FALSE); ExitThread(1); } - + LogEvent(_T("QOTD: Terminating thread\n"), 0, FALSE); ExitThread(0); - //return Retval; } -BOOL SendQuote(SOCKET Sock, TCHAR* Quote) +BOOL SendQuote(SOCKET Sock, char* Quote) { INT StringSize; INT RetVal; - StringSize = (INT)_tcsclen(Quote); - RetVal = send(Sock, Quote, sizeof(TCHAR) * StringSize, 0); + StringSize = (INT)strlen(Quote); + RetVal = send(Sock, Quote, sizeof(char) * StringSize, 0); if (RetVal == SOCKET_ERROR) return FALSE; _____ Modified: trunk/reactos/base/services/tcpsvcs/skelserver.c --- trunk/reactos/base/services/tcpsvcs/skelserver.c 2006-02-02 20:20:51 UTC (rev 72) +++ trunk/reactos/base/services/tcpsvcs/skelserver.c 2006-02-03 17:36:44 UTC (rev 73) @@ -4,7 +4,7 @@ * 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> - * + * */ #include "tcpsvcs.h" @@ -24,7 +24,7 @@ ListeningSocket = SetUpListener(htons(pServices->Port)); if (ListeningSocket == INVALID_SOCKET) { - LogEvent("Socket error when setting up listener\n", 0, TRUE); + LogEvent(_T("Socket error when setting up listener\n"), 0, TRUE); return 3; } @@ -131,7 +131,7 @@ } WaitForSingleObject(hThread, INFINITE); - + CloseHandle(hThread); } else _____ Modified: trunk/reactos/base/services/tcpsvcs/tcpsvcs.c --- trunk/reactos/base/services/tcpsvcs/tcpsvcs.c 2006-02-02 20:20:51 UTC (rev 72) +++ trunk/reactos/base/services/tcpsvcs/tcpsvcs.c 2006-02-03 17:36:44 UTC (rev 73) @@ -4,7 +4,7 @@ * FILE: /base/services/tcpsvcs/tcpsvcs.c * PURPOSE: Provide CharGen, Daytime, Discard, Echo, and Qotd services * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy <gedmurphy(a)gmail.com> - * + * */ /* * TODO: @@ -31,7 +31,7 @@ BOOL bShutDown = FALSE; BOOL bPause = FALSE; -LPCTSTR LogFileName = "\\tcpsvcs_log.log"; +LPCTSTR LogFileName = _T("\\tcpsvcs_log.log"); LPTSTR ServiceName = _T("Simp Tcp"); //LPTSTR DisplayName = _T("Simple TCP/IP Services"); @@ -69,19 +69,19 @@ VOID WINAPI ServiceMain(DWORD argc, LPTSTR argv[]) { - TCHAR LogFilePath[MAX_PATH]; + TCHAR LogFilePath[MAX_PATH + 17]; if(! GetSystemDirectory(LogFilePath, MAX_PATH)) return; - _tcscat(LogFilePath, LogFileName); + _tcsncat(LogFilePath, LogFileName, 17); - hLogFile = fopen(LogFilePath, _T("a+")); + hLogFile = _tfopen(LogFilePath, _T("a+")); if (hLogFile == NULL) { - TCHAR buf[50]; + TCHAR buf[300]; - _stprintf(buf, _T("Could not open log file: %s\n"), LogFilePath); + _sntprintf(buf, 300, _T("Could not open log file: %s\n"), LogFilePath); MessageBox(NULL, buf, NULL, MB_OK); return; } @@ -120,7 +120,7 @@ UpdateStatus (SERVICE_STOPPED, 0); LogEvent(_T("Service status set to SERVICE_STOPPED\n"), 0, FALSE); LogEvent(_T("Leaving ServiceMain\n"), 0, FALSE); - + fclose(hLogFile); return; @@ -232,10 +232,10 @@ { CloseHandle(hThread[i]); } - + LogEvent(_T("Detaching Winsock2...\n"), 0, FALSE); WSACleanup(); - + return 0; } @@ -247,7 +247,7 @@ { DWORD eMsgLen, ErrNum = GetLastError (); LPTSTR lpvSysMsg; - TCHAR MessageBuffer[512]; + TCHAR MessageBuffer[1024]; @@ -258,16 +258,16 @@ ErrNum, MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpvSysMsg, 0, NULL); - _stprintf(MessageBuffer, _T("%s %s ErrNum = %lu. ExitCode = %d."), + _sntprintf(MessageBuffer, 1024, _T("%s %s ErrNum = %lu. ExitCode = %d."), UserMessage, lpvSysMsg, ErrNum, ExitCode); HeapFree(GetProcessHeap (), 0, lpvSysMsg); } else { - _stprintf(MessageBuffer, _T("%s"), UserMessage); + _sntprintf(MessageBuffer, 1024, _T("%s"), UserMessage); } - fputs (MessageBuffer, hLogFile); + _fputts(MessageBuffer, hLogFile); if (ExitCode != 0) ExitProcess(ExitCode); _____ Modified: trunk/reactos/base/services/tcpsvcs/tcpsvcs.h --- trunk/reactos/base/services/tcpsvcs/tcpsvcs.h 2006-02-02 20:20:51 UTC (rev 72) +++ trunk/reactos/base/services/tcpsvcs/tcpsvcs.h 2006-02-03 17:36:44 UTC (rev 73) @@ -4,7 +4,7 @@ * FILE: /base/services/tcpsvcs/tcpsvcs.h * PURPOSE: Provide CharGen, Daytime, Discard, Echo, and Qotd services * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy <gedmurphy(a)gmail.com> - * + * */ #include <stdio.h> @@ -12,9 +12,6 @@ #include <tchar.h> #include <time.h> -#define UNICODE -#define _UNICODE - /* default port numbers */ #define ECHO_PORT 7 #define DISCARD_PORT 9 @@ -63,11 +60,11 @@ /* chargen functions */ DWORD WINAPI ChargenHandler(VOID* Sock_); BOOL GenerateChars(SOCKET Sock); -BOOL SendLine(SOCKET Sock, TCHAR* Line); +BOOL SendLine(SOCKET Sock, char* Line); /* daytime functions */ DWORD WINAPI DaytimeHandler(VOID* Sock_); -BOOL SendTime(SOCKET Sock, TCHAR *time); +BOOL SendTime(SOCKET Sock, char *time); /* echo functions */ DWORD WINAPI EchoHandler(VOID* Sock_); @@ -79,4 +76,4 @@ /* qotd functions */ DWORD WINAPI QotdHandler(VOID* Sock_); -BOOL SendQuote(SOCKET Sock, TCHAR* Quote); +BOOL SendQuote(SOCKET Sock, char* Quote);
18 years, 10 months
1
0
0
0
[martinf] 72: convert *.rbuild files into valid XML files by inserting XML headers and a <rbuild> root nodes
by martinf@svn.reactos.org
convert *.rbuild files into valid XML files by inserting XML headers and a <rbuild> root nodes Modified: trunk/reactos/ReactOS-ppc.rbuild Modified: trunk/reactos/ReactOS.rbuild Modified: trunk/reactos/base/applications/applications.rbuild Modified: trunk/reactos/base/applications/ibrowser/ibrowser.rbuild Modified: trunk/reactos/base/applications/network/arp/arp.rbuild Modified: trunk/reactos/base/applications/network/ipconfig/ipconfig.rbuild Modified: trunk/reactos/base/applications/network/netstat/netstat.rbuild Modified: trunk/reactos/base/applications/network/tracert/tracert.rbuild Modified: trunk/reactos/base/applications/winefile/winefile.rbuild Modified: trunk/reactos/base/base.rbuild Modified: trunk/reactos/base/services/tcpsvcs/tcpsvcs.rbuild Modified: trunk/reactos/base/shell/explorer/explorer.rbuild Modified: trunk/reactos/base/shell/explorer/notifyhook/notifyhook.rbuild Modified: trunk/reactos/base/shell/shell.rbuild Modified: trunk/reactos/base/system/msconfig/msconfig.rbuild Modified: trunk/reactos/base/system/sc/sc.rbuild Modified: trunk/reactos/base/system/servman/servman.rbuild Modified: trunk/reactos/base/system/system.rbuild Modified: trunk/reactos/baseaddress.rbuild Modified: trunk/reactos/boot/boot.rbuild Modified: trunk/reactos/boot/bootcd/bootcd.rbuild Modified: trunk/reactos/boot/freeldr/bootsect/bootsect.rbuild Modified: trunk/reactos/boot/freeldr/freeldr.rbuild Modified: trunk/reactos/config.template.rbuild Modified: trunk/reactos/drivers/base/null/null.rbuild Modified: trunk/reactos/lib/directory.rbuild Modified: trunk/reactos/lib/inflib/inflib.rbuild Modified: trunk/reactos/lib/rossym/rossym.rbuild Modified: trunk/reactos/subsystems/subsystems.rbuild _____ Modified: trunk/reactos/ReactOS-ppc.rbuild --- trunk/reactos/ReactOS-ppc.rbuild 2006-02-01 22:07:06 UTC (rev 71) +++ trunk/reactos/ReactOS-ppc.rbuild 2006-02-02 20:20:51 UTC (rev 72) @@ -1,88 +1,88 @@ <?xml version="1.0"?> <!DOCTYPE project SYSTEM "tools/rbuild/project.dtd"> <project name="ReactOS" makefile="makefile.ppc" xmlns:xi="
http://www.w3.org/2001/XInclude
"> - <xi:include href="config-ppc.rbuild"> - <xi:fallback> - <xi:include href="config.template.rbuild" /> - </xi:fallback> - </xi:include> + <xi:include href="config-ppc.rbuild"> + <xi:fallback> + <xi:include href="config.template.rbuild" /> + </xi:fallback> + </xi:include> - <xi:include href="baseaddress.rbuild" /> + <xi:include href="baseaddress.rbuild" /> - <property name="BOOTPROG_PREPARE" value="ppc-le2be" /> - <property name="BOOTPROG_FLATFORMAT" value="-O elf32-powerpc -B powerpc:common" /> - <property name="BOOTPROG_LINKFORMAT" value="-melf32ppc --no-omagic -Ttext 0xe00000 -Tdata 0xe10000" /> - <property name="BOOTPROG_COPYFORMAT" value="--only-section=.text --only-section=.data --only-section=.bss -O aixcoff-rs6000" /> + <property name="BOOTPROG_PREPARE" value="ppc-le2be" /> + <property name="BOOTPROG_FLATFORMAT" value="-O elf32-powerpc -B powerpc:common" /> + <property name="BOOTPROG_LINKFORMAT" value="-melf32ppc --no-omagic -Ttext 0xe00000 -Tdata 0xe10000" /> + <property name="BOOTPROG_COPYFORMAT" value="--only-section=.text --only-section=.data --only-section=.bss -O aixcoff-rs6000" /> - <define name="_M_PPC" /> - <define name="_PPC_" /> - <define name="__PowerPC__" /> - <define name="_REACTOS_" /> - <define name="__MINGW_IMPORT" empty="true" /> - <define name="__restrict__" empty="true" /> - <compilerflag>-v</compilerflag> - <if property="MP" value="1"> - <define name="CONFIG_SMP" value="1" /> - </if> - <if property="DBG" value="1"> - <define name="DBG" value="1" /> - <property name="DBG_OR_KDBG" value="true" /> - </if> - <if property="DBG" value="0"> - <compilerflag>-Os</compilerflag> - <compilerflag>-Wno-strict-aliasing</compilerflag> - </if> - <if property="KDBG" value="1"> - <define name="KDBG" value="1" /> - <property name="DBG_OR_KDBG" value="true" /> - </if> - <compilerflag>-Wpointer-arith</compilerflag> + <define name="_M_PPC" /> + <define name="_PPC_" /> + <define name="__PowerPC__" /> + <define name="_REACTOS_" /> + <define name="__MINGW_IMPORT" empty="true" /> + <define name="__restrict__" empty="true" /> + <compilerflag>-v</compilerflag> + <if property="MP" value="1"> + <define name="CONFIG_SMP" value="1" /> + </if> + <if property="DBG" value="1"> + <define name="DBG" value="1" /> + <property name="DBG_OR_KDBG" value="true" /> + </if> + <if property="DBG" value="0"> + <compilerflag>-Os</compilerflag> + <compilerflag>-Wno-strict-aliasing</compilerflag> + </if> + <if property="KDBG" value="1"> + <define name="KDBG" value="1" /> + <property name="DBG_OR_KDBG" value="true" /> + </if> + <compilerflag>-Wpointer-arith</compilerflag> - <include>.</include> - <include>include</include> - <include>include/reactos</include> - <include>include/libs</include> - <include>include/drivers</include> - <include>include/subsys</include> - <include>include/ndk</include> - <include>w32api/include</include> - <include>w32api/include/crt</include> - <include>w32api/include/ddk</include> + <include>.</include> + <include>include</include> + <include>include/reactos</include> + <include>include/libs</include> + <include>include/drivers</include> + <include>include/subsys</include> + <include>include/ndk</include> + <include>w32api/include</include> + <include>w32api/include/crt</include> + <include>w32api/include/ddk</include> - <directory name="apps"> - <xi:include href="apps/directory.rbuild" /> - </directory> - <directory name="boot"> - <xi:include href="boot/boot.rbuild" /> - </directory> - <directory name="drivers"> - <xi:include href="drivers/directory.rbuild" /> - </directory> - <directory name="hal"> - <xi:include href="hal/directory.rbuild" /> - </directory> - <directory name="include"> - <xi:include href="include/directory.rbuild" /> - </directory> - <directory name="lib"> - <xi:include href="lib/directory.rbuild" /> - </directory> - <directory name="media"> - <xi:include href="media/directory.rbuild" /> - </directory> - <directory name="modules"> - <xi:include href="modules/directory.rbuild" /> - </directory> - <directory name="ntoskrnl"> - <xi:include href="ntoskrnl/ntoskrnl.rbuild" /> - </directory> - <directory name="regtests"> - <xi:include href="regtests/directory.rbuild" /> - </directory> - <directory name="services"> - <xi:include href="services/directory.rbuild" /> - </directory> - <directory name="subsys"> - <xi:include href="subsys/directory.rbuild" /> - </directory> + <directory name="apps"> + <xi:include href="apps/directory.rbuild" /> + </directory> + <directory name="boot"> + <xi:include href="boot/boot.rbuild" /> + </directory> + <directory name="drivers"> + <xi:include href="drivers/directory.rbuild" /> + </directory> + <directory name="hal"> + <xi:include href="hal/directory.rbuild" /> + </directory> + <directory name="include"> + <xi:include href="include/directory.rbuild" /> + </directory> + <directory name="lib"> + <xi:include href="lib/directory.rbuild" /> + </directory> + <directory name="media"> + <xi:include href="media/directory.rbuild" /> + </directory> + <directory name="modules"> + <xi:include href="modules/directory.rbuild" /> + </directory> + <directory name="ntoskrnl"> + <xi:include href="ntoskrnl/ntoskrnl.rbuild" /> + </directory> + <directory name="regtests"> + <xi:include href="regtests/directory.rbuild" /> + </directory> + <directory name="services"> + <xi:include href="services/directory.rbuild" /> + </directory> + <directory name="subsys"> + <xi:include href="subsys/directory.rbuild" /> + </directory> </project> _____ Modified: trunk/reactos/ReactOS.rbuild --- trunk/reactos/ReactOS.rbuild 2006-02-01 22:07:06 UTC (rev 71) +++ trunk/reactos/ReactOS.rbuild 2006-02-02 20:20:51 UTC (rev 72) @@ -1,94 +1,94 @@ <?xml version="1.0"?> <!DOCTYPE project SYSTEM "tools/rbuild/project.dtd"> <project name="ReactOS" makefile="makefile.auto" xmlns:xi="
http://www.w3.org/2001/XInclude
"> - <xi:include href="config.rbuild"> - <xi:fallback> - <xi:include href="config.template.rbuild" /> - </xi:fallback> - </xi:include> + <xi:include href="config.rbuild"> + <xi:fallback> + <xi:include href="config.template.rbuild" /> + </xi:fallback> + </xi:include> - <xi:include href="baseaddress.rbuild" /> + <xi:include href="baseaddress.rbuild" /> - <define name="_M_IX86" /> - <define name="_X86_" /> - <define name="__i386__" /> - <define name="_REACTOS_" /> - <if property="MP" value="1"> - <define name="CONFIG_SMP" value="1" /> - </if> - <if property="DBG" value="1"> - <define name="DBG" value="1" /> - <property name="DBG_OR_KDBG" value="true" /> - </if> - <if property="KDBG" value="1"> - <define name="KDBG" value="1" /> - <property name="DBG_OR_KDBG" value="true" /> - </if> - <compilerflag>-Os</compilerflag> - <compilerflag>-Wno-strict-aliasing</compilerflag> - <compilerflag>-ftracer</compilerflag> - <compilerflag>-momit-leaf-frame-pointer</compilerflag> - <compilerflag>-mpreferred-stack-boundary=2</compilerflag> - <compilerflag>-Wpointer-arith</compilerflag> + <define name="_M_IX86" /> + <define name="_X86_" /> + <define name="__i386__" /> + <define name="_REACTOS_" /> + <if property="MP" value="1"> + <define name="CONFIG_SMP" value="1" /> + </if> + <if property="DBG" value="1"> + <define name="DBG" value="1" /> + <property name="DBG_OR_KDBG" value="true" /> + </if> + <if property="KDBG" value="1"> + <define name="KDBG" value="1" /> + <property name="DBG_OR_KDBG" value="true" /> + </if> + <compilerflag>-Os</compilerflag> + <compilerflag>-Wno-strict-aliasing</compilerflag> + <compilerflag>-ftracer</compilerflag> + <compilerflag>-momit-leaf-frame-pointer</compilerflag> + <compilerflag>-mpreferred-stack-boundary=2</compilerflag> + <compilerflag>-Wpointer-arith</compilerflag> - <include>.</include> - <include>include</include> - <include>include/reactos</include> - <include>include/libs</include> - <include>include/drivers</include> - <include>include/subsys</include> - <include>include/ndk</include> - <include>w32api/include</include> - <include>w32api/include/crt</include> - <include>w32api/include/ddk</include> + <include>.</include> + <include>include</include> + <include>include/reactos</include> + <include>include/libs</include> + <include>include/drivers</include> + <include>include/subsys</include> + <include>include/ndk</include> + <include>w32api/include</include> + <include>w32api/include/crt</include> + <include>w32api/include/ddk</include> <!-- TODO - <directory name="apps"> - <xi:include href="apps/directory.rbuild" /> - </directory> - <directory name="boot"> - <xi:include href="boot/boot.rbuild" /> - </directory> + <directory name="apps"> + <xi:include href="apps/directory.rbuild" /> + </directory> + <directory name="boot"> + <xi:include href="boot/boot.rbuild" /> + </directory> --> - <directory name="boot"> - <xi:include href="boot/boot.rbuild" /> - </directory> - <directory name="base"> - <xi:include href="base/base.rbuild" /> - </directory> + <directory name="boot"> + <xi:include href="boot/boot.rbuild" /> + </directory> + <directory name="base"> + <xi:include href="base/base.rbuild" /> + </directory> <!-- TODO - <directory name="dll"> - <xi:include href="dll/dll.rbuild" /> - </directory> - <directory name="drivers"> - <xi:include href="drivers/directory.rbuild" /> - </directory> - <directory name="hal"> - <xi:include href="hal/directory.rbuild" /> - </directory> - <directory name="include"> - <xi:include href="include/directory.rbuild" /> - </directory> + <directory name="dll"> + <xi:include href="dll/dll.rbuild" /> + </directory> + <directory name="drivers"> + <xi:include href="drivers/directory.rbuild" /> + </directory> + <directory name="hal"> + <xi:include href="hal/directory.rbuild" /> + </directory> + <directory name="include"> + <xi:include href="include/directory.rbuild" /> + </directory> --> - <directory name="lib"> - <xi:include href="lib/directory.rbuild" /> - </directory> + <directory name="lib"> + <xi:include href="lib/directory.rbuild" /> + </directory> <!-- TODO - <directory name="media"> - <xi:include href="media/directory.rbuild" /> - </directory> - <directory name="modules"> - <xi:include href="modules/directory.rbuild" /> - </directory> - <directory name="ntoskrnl"> - <xi:include href="ntoskrnl/ntoskrnl.rbuild" /> - </directory> - <directory name="regtests"> - <xi:include href="regtests/directory.rbuild" /> - </directory> + <directory name="media"> + <xi:include href="media/directory.rbuild" /> + </directory> + <directory name="modules"> + <xi:include href="modules/directory.rbuild" /> + </directory> + <directory name="ntoskrnl"> + <xi:include href="ntoskrnl/ntoskrnl.rbuild" /> + </directory> + <directory name="regtests"> + <xi:include href="regtests/directory.rbuild" /> + </directory> --> - <directory name="subsystems"> - <xi:include href="subsystems/subsystems.rbuild" /> - </directory> + <directory name="subsystems"> + <xi:include href="subsystems/subsystems.rbuild" /> + </directory> </project> _____ Modified: trunk/reactos/base/applications/applications.rbuild --- trunk/reactos/base/applications/applications.rbuild 2006-02-01 22:07:06 UTC (rev 71) +++ trunk/reactos/base/applications/applications.rbuild 2006-02-02 20:20:51 UTC (rev 72) @@ -1,16 +1,19 @@ -<group> +<?xml version="1.0"?> +<rbuild xmlns:xi="
http://www.w3.org/2001/XInclude
"> + <group> <!-- -<directory name="games"> - <xi:include href="games/games.rbuild" /> -</directory> -<directory name="network"> - <xi:include href="network/network.rbuild" /> -</directory> -<directory name="ibrowser"> - <xi:include href="ibrowser/ibrowser.rbuild" /> -</directory> -<directory name="winefile"> - <xi:include href="winefile/winefile.rbuild" /> -</directory> + <directory name="games"> + <xi:include href="games/games.rbuild" /> + </directory> + <directory name="network"> + <xi:include href="network/network.rbuild" /> + </directory> + <directory name="ibrowser"> + <xi:include href="ibrowser/ibrowser.rbuild" /> + </directory> + <directory name="winefile"> + <xi:include href="winefile/winefile.rbuild" /> + </directory> --> -</group> + </group> +</rbuild> _____ Modified: trunk/reactos/base/applications/ibrowser/ibrowser.rbuild --- trunk/reactos/base/applications/ibrowser/ibrowser.rbuild 2006-02-01 22:07:06 UTC (rev 71) +++ trunk/reactos/base/applications/ibrowser/ibrowser.rbuild 2006-02-02 20:20:51 UTC (rev 72) @@ -1,31 +1,34 @@ -<module name="ibrowser" type="win32gui" installbase="system32" installname="ibrowser.exe" allowwarnings ="true"> - <linkerflag>-fexceptions</linkerflag> - <include base="ibrowser">.</include> - <include base="ReactOS">include/expat</include> - <define name="__USE_W32API" /> - <define name="UNICODE" /> - <define name="WIN32" /> - <define name="_ROS_" /> - <define name="_WIN32_IE">0x0600</define> - <define name="_WIN32_WINNT">0x0501</define> - <define name="WINVER">0x0500</define> - <library>uuid</library> - <library>kernel32</library> - <library>gdi32</library> - <library>comctl32</library> - <library>ole32</library> - <library>oleaut32</library> - <library>shell32</library> - <library>expat</library> - <pch>precomp.h</pch> - <directory name="utility"> - <file>utility.cpp</file> - <file>window.cpp</file> - <file>xmlstorage.cpp</file> - </directory> - <file>ibrowser.cpp</file> - <file>favorites.cpp</file> - <file>mainframe.cpp</file> - <file>webchild.cpp</file> - <file>ibrowser.rc</file> -</module> +<?xml version="1.0"?> +<rbuild xmlns:xi="
http://www.w3.org/2001/XInclude
"> + <module name="ibrowser" type="win32gui" installbase="system32" installname="ibrowser.exe" allowwarnings ="true"> + <linkerflag>-fexceptions</linkerflag> + <include base="ibrowser">.</include> + <include base="ReactOS">include/expat</include> + <define name="__USE_W32API" /> + <define name="UNICODE" /> + <define name="WIN32" /> + <define name="_ROS_" /> + <define name="_WIN32_IE">0x0600</define> + <define name="_WIN32_WINNT">0x0501</define> + <define name="WINVER">0x0500</define> + <library>uuid</library> + <library>kernel32</library> + <library>gdi32</library> + <library>comctl32</library> + <library>ole32</library> + <library>oleaut32</library> + <library>shell32</library> + <library>expat</library> + <pch>precomp.h</pch> + <directory name="utility"> + <file>utility.cpp</file> + <file>window.cpp</file> + <file>xmlstorage.cpp</file> + </directory> + <file>ibrowser.cpp</file> + <file>favorites.cpp</file> + <file>mainframe.cpp</file> + <file>webchild.cpp</file> + <file>ibrowser.rc</file> + </module> +</rbuild> _____ Modified: trunk/reactos/base/applications/network/arp/arp.rbuild --- trunk/reactos/base/applications/network/arp/arp.rbuild 2006-02-01 22:07:06 UTC (rev 71) +++ trunk/reactos/base/applications/network/arp/arp.rbuild 2006-02-02 20:20:51 UTC (rev 72) @@ -1,11 +1,13 @@ -<module name="arp" type="win32cui" installbase="system32" installname="arp.exe"> - <include base="arp">.</include> - <define name="__USE_W32API" /> - <library>kernel32</library> - <library>iphlpapi</library> - <library>ws2_32</library> - <library>shlwapi</library> - <file>arp.c</file> - <file>arp.rc</file> -</module> - +<?xml version="1.0"?> +<rbuild xmlns:xi="
http://www.w3.org/2001/XInclude
"> + <module name="arp" type="win32cui" installbase="system32" installname="arp.exe"> + <include base="arp">.</include> + <define name="__USE_W32API" /> + <library>kernel32</library> + <library>iphlpapi</library> + <library>ws2_32</library> + <library>shlwapi</library> + <file>arp.c</file> + <file>arp.rc</file> + </module> +</rbuild> _____ Modified: trunk/reactos/base/applications/network/ipconfig/ipconfig.rbuild --- trunk/reactos/base/applications/network/ipconfig/ipconfig.rbuild 2006-02-01 22:07:06 UTC (rev 71) +++ trunk/reactos/base/applications/network/ipconfig/ipconfig.rbuild 2006-02-02 20:20:51 UTC (rev 72) @@ -1,4 +1,6 @@ -<module name="ipconfig" type="win32cui" installbase="system32" installname="ipconfig.exe" allowwarnings="true"> +<?xml version="1.0"?> +<rbuild xmlns:xi="
http://www.w3.org/2001/XInclude
"> + <module name="ipconfig" type="win32cui" installbase="system32" installname="ipconfig.exe" allowwarnings="true"> <include base="ipconfig">.</include> <define name="__USE_W32API" /> <library>kernel32</library> @@ -6,4 +8,5 @@ <library>iphlpapi</library> <file>ipconfig.c</file> <file>ipconfig.rc</file> -</module> + </module> +</rbuild> _____ Modified: trunk/reactos/base/applications/network/netstat/netstat.rbuild --- trunk/reactos/base/applications/network/netstat/netstat.rbuild 2006-02-01 22:07:06 UTC (rev 71) +++ trunk/reactos/base/applications/network/netstat/netstat.rbuild 2006-02-02 20:20:51 UTC (rev 72) @@ -1,4 +1,6 @@ -<module name="netstat" type="win32cui" installbase="system32" installname="netstat.exe" allowwarnings="true"> +<?xml version="1.0"?> +<rbuild xmlns:xi="
http://www.w3.org/2001/XInclude
"> + <module name="netstat" type="win32cui" installbase="system32" installname="netstat.exe" allowwarnings="true"> <include base="netstat">.</include> <define name="__USE_W32API" /> <define name="_WIN32_IE">0x600</define> @@ -10,4 +12,5 @@ <library>iphlpapi</library> <file>netstat.c</file> <file>netstat.rc</file> -</module> + </module> +</rbuild> _____ Modified: trunk/reactos/base/applications/network/tracert/tracert.rbuild --- trunk/reactos/base/applications/network/tracert/tracert.rbuild 2006-02-01 22:07:06 UTC (rev 71) +++ trunk/reactos/base/applications/network/tracert/tracert.rbuild 2006-02-02 20:20:51 UTC (rev 72) @@ -1,11 +1,14 @@ -<module name="tracert" type="win32cui" installbase="system32" installname="tracert.exe"> - <include base="tracert">.</include> - <define name="__USE_W32API" /> - <define name="__USE_W32_SOCKETS" /> - <define name="_WIN32_IE">0x600</define> - <define name="_WIN32_WINNT">0x501</define> - <library>kernel32</library> - <library>ws2_32</library> - <file>tracert.c</file> - <file>tracert.rc</file> -</module> +<?xml version="1.0"?> +<rbuild xmlns:xi="
http://www.w3.org/2001/XInclude
"> + <module name="tracert" type="win32cui" installbase="system32" installname="tracert.exe"> + <include base="tracert">.</include> + <define name="__USE_W32API" /> + <define name="__USE_W32_SOCKETS" /> + <define name="_WIN32_IE">0x600</define> + <define name="_WIN32_WINNT">0x501</define> + <library>kernel32</library> + <library>ws2_32</library> + <file>tracert.c</file> + <file>tracert.rc</file> + </module> +</rbuild> _____ Modified: trunk/reactos/base/applications/winefile/winefile.rbuild --- trunk/reactos/base/applications/winefile/winefile.rbuild 2006-02-01 22:07:06 UTC (rev 71) +++ trunk/reactos/base/applications/winefile/winefile.rbuild 2006-02-02 20:20:51 UTC (rev 72) @@ -1,19 +1,22 @@ -<module name="winefile" type="win32gui" installbase="system32" installname="winefile.exe" allowwarnings="true"> - <include base="winefile">.</include> - <define name="UNICODE" /> - <define name="__USE_W32API" /> - <define name="_WIN32_IE">0x0501</define> - <define name="_WIN32_WINNT">0x0501</define> - <library>uuid</library> - <library>kernel32</library> - <library>gdi32</library> - <library>user32</library> - <library>comctl32</library> - <library>comdlg32</library> - <library>shell32</library> - <library>ole32</library> - <library>version</library> - <library>mpr</library> - <file>winefile.c</file> - <file>winefile.rc</file> -</module> +<?xml version="1.0"?> +<rbuild xmlns:xi="
http://www.w3.org/2001/XInclude
"> + <module name="winefile" type="win32gui" installbase="system32" installname="winefile.exe" allowwarnings="true"> + <include base="winefile">.</include> + <define name="UNICODE" /> + <define name="__USE_W32API" /> + <define name="_WIN32_IE">0x0501</define> + <define name="_WIN32_WINNT">0x0501</define> + <library>uuid</library> + <library>kernel32</library> + <library>gdi32</library> + <library>user32</library> + <library>comctl32</library> + <library>comdlg32</library> + <library>shell32</library> + <library>ole32</library> + <library>version</library> + <library>mpr</library> + <file>winefile.c</file> + <file>winefile.rc</file> + </module> +</rbuild> _____ Modified: trunk/reactos/base/base.rbuild --- trunk/reactos/base/base.rbuild 2006-02-01 22:07:06 UTC (rev 71) +++ trunk/reactos/base/base.rbuild 2006-02-02 20:20:51 UTC (rev 72) @@ -1,19 +1,22 @@ -<group> -<directory name="applications"> - <xi:include href="applications/applications.rbuild" /> -</directory> +<?xml version="1.0"?> +<rbuild xmlns:xi="
http://www.w3.org/2001/XInclude
"> + <group> + <directory name="applications"> + <xi:include href="applications/applications.rbuild" /> + </directory> <!-- -<directory name="services"> - <xi:include href="services/services.rbuild" /> -</directory> -<directory name="setup"> - <xi:include href="setup/setup.rbuild" /> -</directory> + <directory name="services"> + <xi:include href="services/services.rbuild" /> + </directory> + <directory name="setup"> + <xi:include href="setup/setup.rbuild" /> + </directory> --> -<directory name="shell"> - <xi:include href="shell/shell.rbuild" /> -</directory> -<directory name="system"> - <xi:include href="system/system.rbuild" /> -</directory> -</group> + <directory name="shell"> + <xi:include href="shell/shell.rbuild" /> + </directory> + <directory name="system"> + <xi:include href="system/system.rbuild" /> + </directory> + </group> +</rbuild> _____ Modified: trunk/reactos/base/services/tcpsvcs/tcpsvcs.rbuild --- trunk/reactos/base/services/tcpsvcs/tcpsvcs.rbuild 2006-02-01 22:07:06 UTC (rev 71) +++ trunk/reactos/base/services/tcpsvcs/tcpsvcs.rbuild 2006-02-02 20:20:51 UTC (rev 72) @@ -1,4 +1,6 @@ -<module name="tcpsvcs" type="win32cui" installbase="system32" installname="tcpsvcs.exe"> +<?xml version="1.0"?> +<rbuild xmlns:xi="
http://www.w3.org/2001/XInclude
"> + <module name="tcpsvcs" type="win32cui" installbase="system32" installname="tcpsvcs.exe"> <include base="arp">.</include> <define name="__USE_W32API" /> <library>kernel32</library> @@ -14,4 +16,5 @@ <file>chargen.c</file> <file>tcpsvcs.rc</file> <pch>tcpsvcs.h</pch> -</module> + </module> +</rbuild> _____ Modified: trunk/reactos/base/shell/explorer/explorer.rbuild --- trunk/reactos/base/shell/explorer/explorer.rbuild 2006-02-01 22:07:06 UTC (rev 71) +++ trunk/reactos/base/shell/explorer/explorer.rbuild 2006-02-02 20:20:51 UTC (rev 72) @@ -1,74 +1,77 @@ -<module name="explorer" type="win32gui" installname="explorer.exe" allowwarnings="true"> - <linkerflag>-luuid</linkerflag> - <linkerflag>-lstdc++</linkerflag> - <linkerflag>-fexceptions</linkerflag> - <include base="explorer">.</include> - <define name="__USE_W32API" /> - <define name="UNICODE" /> - <define name="WIN32" /> - <define name="_ROS_" /> - <define name="_WIN32_IE">0x0600</define> - <define name="_WIN32_WINNT">0x0501</define> - <define name="WINVER">0x0500</define> - <define name="__WINDRES__" /> - <library>kernel32</library> - <library>gdi32</library> - <library>user32</library> - <library>ws2_32</library> - <library>msimg32</library> - <library>comctl32</library> - <library>ole32</library> - <library>oleaut32</library> - <library>shell32</library> - <library>expat</library> - <library>notifyhook</library> - <pch>precomp.h</pch> - <directory name="desktop"> - <file>desktop.cpp</file> - </directory> - <directory name="dialogs"> - <file>searchprogram.cpp</file> - <file>settings.cpp</file> - </directory> - <directory name="shell"> - <file>entries.cpp</file> - <file>fatfs.cpp</file> - <file>filechild.cpp</file> - <file>shellfs.cpp</file> - <file>mainframe.cpp</file> - <file>ntobjfs.cpp</file> - <file>pane.cpp</file> - <file>regfs.cpp</file> - <file>shellbrowser.cpp</file> - <file>unixfs.cpp</file> - <file>webchild.cpp</file> - <file>winfs.cpp</file> - </directory> - <directory name="services"> - <file>shellservices.cpp</file> - <file>startup.c</file> - </directory> - <directory name="taskbar"> - <file>desktopbar.cpp</file> - <file>favorites.cpp</file> - <file>taskbar.cpp</file> - <file>startmenu.cpp</file> - <file>traynotify.cpp</file> - <file>quicklaunch.cpp</file> - </directory> - <directory name="utility"> - <file>shellclasses.cpp</file> - <file>utility.cpp</file> - <file>window.cpp</file> - <file>dragdropimpl.cpp</file> - <file>shellbrowserimpl.cpp</file> - <file>xmlstorage.cpp</file> - </directory> - <file>explorer.cpp</file> - <file>i386-stub-win32.c</file> - <file>explorer.rc</file> -</module> -<installfile base=".">explorer-cfg-template.xml</installfile> -<directory name="notifyhook"> - <xi:include href="notifyhook/notifyhook.rbuild" /> -</directory> +<?xml version="1.0"?> +<rbuild xmlns:xi="
http://www.w3.org/2001/XInclude
"> + <module name="explorer" type="win32gui" installname="explorer.exe" allowwarnings="true"> + <linkerflag>-luuid</linkerflag> + <linkerflag>-lstdc++</linkerflag> + <linkerflag>-fexceptions</linkerflag> + <include base="explorer">.</include> + <define name="__USE_W32API" /> + <define name="UNICODE" /> + <define name="WIN32" /> + <define name="_ROS_" /> + <define name="_WIN32_IE">0x0600</define> + <define name="_WIN32_WINNT">0x0501</define> + <define name="WINVER">0x0500</define> + <define name="__WINDRES__" /> + <library>kernel32</library> + <library>gdi32</library> + <library>user32</library> + <library>ws2_32</library> + <library>msimg32</library> + <library>comctl32</library> + <library>ole32</library> + <library>oleaut32</library> + <library>shell32</library> + <library>expat</library> + <library>notifyhook</library> + <pch>precomp.h</pch> + <directory name="desktop"> + <file>desktop.cpp</file> + </directory> + <directory name="dialogs"> + <file>searchprogram.cpp</file> + <file>settings.cpp</file> + </directory> + <directory name="shell"> + <file>entries.cpp</file> + <file>fatfs.cpp</file> + <file>filechild.cpp</file> + <file>shellfs.cpp</file> + <file>mainframe.cpp</file> + <file>ntobjfs.cpp</file> + <file>pane.cpp</file> + <file>regfs.cpp</file> + <file>shellbrowser.cpp</file> + <file>unixfs.cpp</file> + <file>webchild.cpp</file> + <file>winfs.cpp</file> + </directory> + <directory name="services"> + <file>shellservices.cpp</file> + <file>startup.c</file> + </directory> + <directory name="taskbar"> + <file>desktopbar.cpp</file> + <file>favorites.cpp</file> + <file>taskbar.cpp</file> + <file>startmenu.cpp</file> + <file>traynotify.cpp</file> + <file>quicklaunch.cpp</file> + </directory> + <directory name="utility"> + <file>shellclasses.cpp</file> + <file>utility.cpp</file> + <file>window.cpp</file> + <file>dragdropimpl.cpp</file> + <file>shellbrowserimpl.cpp</file> + <file>xmlstorage.cpp</file> + </directory> + <file>explorer.cpp</file> + <file>i386-stub-win32.c</file> + <file>explorer.rc</file> + </module> + <installfile base=".">explorer-cfg-template.xml</installfile> + <directory name="notifyhook"> + <xi:include href="notifyhook/notifyhook.rbuild" /> + </directory> +</rbuild> _____ Modified: trunk/reactos/base/shell/explorer/notifyhook/notifyhook.rbuild --- trunk/reactos/base/shell/explorer/notifyhook/notifyhook.rbuild 2006-02-01 22:07:06 UTC (rev 71) +++ trunk/reactos/base/shell/explorer/notifyhook/notifyhook.rbuild 2006-02-02 20:20:51 UTC (rev 72) @@ -1,10 +1,13 @@ -<module name="notifyhook" type="win32dll" baseaddress="${BASEADDRESS_NOTIFYHOOK}" installbase="system32" installname="notifyhook.dll"> - <importlibrary definition="notifyhook.def" /> - <include base="notifyhook">.</include> - <define name="__USE_W32API" /> - <define name="_WIN32_IE">0x0600</define> - <define name="_NOTIFYHOOK_IMPL" /> - <library>kernel32</library> - <file>notifyhook.c</file> - <file>notifyhook.rc</file> -</module> +<?xml version="1.0"?> +<rbuild xmlns:xi="
http://www.w3.org/2001/XInclude
"> + <module name="notifyhook" type="win32dll" baseaddress="${BASEADDRESS_NOTIFYHOOK}" installbase="system32" installname="notifyhook.dll"> + <importlibrary definition="notifyhook.def" /> + <include base="notifyhook">.</include> + <define name="__USE_W32API" /> + <define name="_WIN32_IE">0x0600</define> + <define name="_NOTIFYHOOK_IMPL" /> + <library>kernel32</library> + <file>notifyhook.c</file> + <file>notifyhook.rc</file> + </module> +</rbuild> _____ Modified: trunk/reactos/base/shell/shell.rbuild --- trunk/reactos/base/shell/shell.rbuild 2006-02-01 22:07:06 UTC (rev 71) +++ trunk/reactos/base/shell/shell.rbuild 2006-02-02 20:20:51 UTC (rev 72) @@ -1,10 +1,13 @@ -<group> +<?xml version="1.0"?> +<rbuild xmlns:xi="
http://www.w3.org/2001/XInclude
"> + <group> <!-- -<directory name="cmd"> - <xi:include href="cmd/cmd.rbuild" /> -</directory> -<directory name="explorer"> - <xi:include href="explorer/explorer.rbuild" /> -</directory> + <directory name="cmd"> + <xi:include href="cmd/cmd.rbuild" /> + </directory> + <directory name="explorer"> + <xi:include href="explorer/explorer.rbuild" /> + </directory> --> -</group> + </group> +</rbuild> _____ Modified: trunk/reactos/base/system/msconfig/msconfig.rbuild --- trunk/reactos/base/system/msconfig/msconfig.rbuild 2006-02-01 22:07:06 UTC (rev 71) +++ trunk/reactos/base/system/msconfig/msconfig.rbuild 2006-02-02 20:20:51 UTC (rev 72) @@ -1,26 +1,29 @@ -<module name="msconfig" type="win32gui" installbase="system32" installname="msconfig.exe"> - <include base="msconfig">.</include> - <define name="UNICODE" /> - <define name="_UNICODE" /> - <define name="__REACTOS__" /> - <define name="__USE_W32API" /> - <define name="_WIN32_IE">0x600</define> - <define name="_WIN32_WINNT">0x501</define> - <library>kernel32</library> - <library>user32</library> - <library>advapi32</library> - <library>version</library> - <library>comctl32</library> - <library>shell32</library> - <compilationunit name="unit.c"> - <file>toolspage.c</file> - <file>srvpage.c</file> - <file>systempage.c</file> - <file>startuppage.c</file> - <file>freeldrpage.c</file> - <file>generalpage.c</file> - <file>msconfig.c</file> - </compilationunit> - <file>msconfig.rc</file> - <pch>precomp.h</pch> -</module> +<?xml version="1.0"?> +<rbuild xmlns:xi="
http://www.w3.org/2001/XInclude
"> + <module name="msconfig" type="win32gui" installbase="system32" installname="msconfig.exe"> + <include base="msconfig">.</include> + <define name="UNICODE" /> + <define name="_UNICODE" /> + <define name="__REACTOS__" /> + <define name="__USE_W32API" /> + <define name="_WIN32_IE">0x600</define> + <define name="_WIN32_WINNT">0x501</define> + <library>kernel32</library> + <library>user32</library> + <library>advapi32</library> + <library>version</library> + <library>comctl32</library> + <library>shell32</library> + <compilationunit name="unit.c"> + <file>toolspage.c</file> + <file>srvpage.c</file> + <file>systempage.c</file> + <file>startuppage.c</file> + <file>freeldrpage.c</file> + <file>generalpage.c</file> + <file>msconfig.c</file> + </compilationunit> + <file>msconfig.rc</file> + <pch>precomp.h</pch> + </module> +</rbuild> _____ Modified: trunk/reactos/base/system/sc/sc.rbuild --- trunk/reactos/base/system/sc/sc.rbuild 2006-02-01 22:07:06 UTC (rev 71) +++ trunk/reactos/base/system/sc/sc.rbuild 2006-02-02 20:20:51 UTC (rev 72) @@ -1,17 +1,20 @@ -<module name="sc" type="win32cui" installbase="system32" installname="sc.exe"> - <define name="__USE_W32API" /> - <define name="DEFINE_GUID" /> - <define name="UNICODE" /> - <define name="_UNICODE" /> - <library>kernel32</library> - <library>advapi32</library> - <file>sc.c</file> - <file>start.c</file> - <file>query.c</file> - <file>control.c</file> - <file>create.c</file> - <file>delete.c</file> - <file>usage.c</file> - <file>sc.rc</file> - <pch>sc.h</pch> -</module> +<?xml version="1.0"?> +<rbuild xmlns:xi="
http://www.w3.org/2001/XInclude
"> + <module name="sc" type="win32cui" installbase="system32" installname="sc.exe"> + <define name="__USE_W32API" /> + <define name="DEFINE_GUID" /> + <define name="UNICODE" /> + <define name="_UNICODE" /> + <library>kernel32</library> + <library>advapi32</library> + <file>sc.c</file> + <file>start.c</file> + <file>query.c</file> + <file>control.c</file> + <file>create.c</file> + <file>delete.c</file> + <file>usage.c</file> + <file>sc.rc</file> + <pch>sc.h</pch> + </module> +</rbuild> _____ Modified: trunk/reactos/base/system/servman/servman.rbuild --- trunk/reactos/base/system/servman/servman.rbuild 2006-02-01 22:07:06 UTC (rev 71) +++ trunk/reactos/base/system/servman/servman.rbuild 2006-02-02 20:20:51 UTC (rev 72) @@ -1,30 +1,33 @@ -<module name="servman" type="win32gui" installbase="system32" installname="servman.exe"> - <include base="servman">.</include> - <define name="UNICODE" /> - <define name="_UNICODE" /> - <define name="__REACTOS__" /> - <define name="__USE_W32API" /> - <define name="_WIN32_IE">0x600</define> - <define name="_WIN32_WINNT">0x501</define> - <library>kernel32</library> - <library>user32</library> - <library>advapi32</library> - <library>version</library> - <library>comctl32</library> - <library>shell32</library> - <library>comdlg32</library> - <compilationunit name="unit.c"> - <file>about.c</file> - <file>control.c</file> - <file>create.c</file> [truncated at 1000 lines; 638 more skipped]
18 years, 10 months
1
0
0
0
[gedmurphy] 71: fix writing to file
by gedmurphy@svn.reactos.org
fix writing to file Modified: trunk/reactos/base/system/servman/export.c _____ Modified: trunk/reactos/base/system/servman/export.c --- trunk/reactos/base/system/servman/export.c 2006-02-01 19:41:17 UTC (rev 70) +++ trunk/reactos/base/system/servman/export.c 2006-02-01 22:07:06 UTC (rev 71) @@ -53,11 +53,11 @@ dwTextLength = GetTextFromListView(LVText, i, k); if (LVText != NULL) { - WriteFile(hFile, LVText, dwTextLength, &dwWritten, NULL); - WriteFile(hFile, &tab, 1, &dwWritten, NULL); + WriteFile(hFile, LVText, sizeof(TCHAR) * dwTextLength, &dwWritten, NULL); + WriteFile(hFile, &tab, sizeof(TCHAR), &dwWritten, NULL); } } - WriteFile(hFile, &newl, 1, &dwWritten, NULL); + WriteFile(hFile, &newl, sizeof(TCHAR), &dwWritten, NULL); } CloseHandle(hFile); bSuccess = TRUE;
18 years, 10 months
1
0
0
0
[gedmurphy] 70: - set the button states according to the service
by gedmurphy@svn.reactos.org
- set the button states according to the service - Set the main and popup menus according to the current environment or service - allow viewing in list or icon mode too Modified: trunk/reactos/base/system/servman/En.rc Modified: trunk/reactos/base/system/servman/export.c Modified: trunk/reactos/base/system/servman/propsheet.c Modified: trunk/reactos/base/system/servman/query.c Modified: trunk/reactos/base/system/servman/resource.h Modified: trunk/reactos/base/system/servman/servman.c _____ Modified: trunk/reactos/base/system/servman/En.rc --- trunk/reactos/base/system/servman/En.rc 2006-01-31 22:41:45 UTC (rev 69) +++ trunk/reactos/base/system/servman/En.rc 2006-02-01 19:41:17 UTC (rev 70) @@ -2,54 +2,59 @@ BEGIN POPUP "&File" BEGIN - MENUITEM "E&xit",ID_EXIT + MENUITEM "E&xit", ID_EXIT END POPUP "Action" BEGIN - MENUITEM "Start",ID_START - MENUITEM "Stop",ID_STOP - MENUITEM "Pause",ID_PAUSE - MENUITEM "Resume",ID_RESUME - MENUITEM "Restart",ID_RESTART + MENUITEM "Start", ID_START, GRAYED + MENUITEM "Stop", ID_STOP, GRAYED + MENUITEM "Pause", ID_PAUSE, GRAYED + MENUITEM "Resume", ID_RESUME, GRAYED + MENUITEM "Restart", ID_RESTART, GRAYED MENUITEM SEPARATOR - MENUITEM "Refresh",ID_REFRESH + MENUITEM "Refresh", ID_REFRESH MENUITEM SEPARATOR - MENUITEM "Properties",ID_PROP + MENUITEM "Properties", ID_PROP, GRAYED END POPUP "View" BEGIN - MENUITEM "Customize",ID_VIEW_CUSTOMIZE + MENUITEM "Large Icons", ID_VIEW_LARGE + MENUITEM "Small Icons", ID_VIEW_SMALL + MENUITEM "List", ID_VIEW_LIST + MENUITEM "Details", ID_VIEW_DETAILS + MENUITEM SEPARATOR + MENUITEM "Customize", ID_VIEW_CUSTOMIZE, GRAYED END POPUP "Help" BEGIN - MENUITEM "About",ID_ABOUT + MENUITEM "About", ID_ABOUT END END IDR_POPUP MENU BEGIN POPUP "popup" BEGIN - MENUITEM "Start",ID_START - MENUITEM "Stop",ID_STOP - MENUITEM "Pause",ID_PAUSE - MENUITEM "Resume",ID_RESUME - MENUITEM "Restart",ID_RESTART + MENUITEM "Start", ID_START, GRAYED + MENUITEM "Stop", ID_STOP, GRAYED + MENUITEM "Pause", ID_PAUSE, GRAYED + MENUITEM "Resume", ID_RESUME, GRAYED + MENUITEM "Restart", ID_RESTART, GRAYED MENUITEM SEPARATOR POPUP "All tasks" BEGIN - MENUITEM "Start",ID_START - MENUITEM "Stop",ID_STOP - MENUITEM "Pause",ID_PAUSE - MENUITEM "Resume",ID_RESUME - MENUITEM "Restart",ID_RESTART - MENUITEM "Refresh",ID_REFRESH + MENUITEM "Start", ID_START, GRAYED + MENUITEM "Stop", ID_STOP, GRAYED + MENUITEM "Pause", ID_PAUSE, GRAYED + MENUITEM "Resume", ID_RESUME, GRAYED + MENUITEM "Restart", ID_RESTART, GRAYED + MENUITEM "Refresh", ID_REFRESH, GRAYED END MENUITEM SEPARATOR - MENUITEM "Refresh",ID_REFRESH + MENUITEM "Refresh", ID_REFRESH MENUITEM SEPARATOR - MENUITEM "Properties",ID_PROP + MENUITEM "Properties", ID_PROP MENUITEM SEPARATOR - MENUITEM "Help",ID_HELP + MENUITEM "Help", ID_HELP END END @@ -58,7 +63,7 @@ FONT 8,"Tahoma",0,0 STYLE WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME BEGIN - LTEXT "Service Manager v0.1\nCopyright (C) 2006\nby Ged Murphy (gedmurphy(a)gmail.com)", IDC_STATIC, 48, 7, 130, 26 + LTEXT "Service Manager v0.3\nCopyright (C) 2005-2006\nby Ged Murphy (gedmurphy(a)gmail.com)", IDC_STATIC, 48, 7, 130, 26 PUSHBUTTON "Close", IDOK, 75, 162, 44, 15 ICON IDI_SM_ICON, IDC_STATIC, 10, 10, 7, 30 EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP | ES_READONLY | ES_MULTILINE @@ -74,10 +79,10 @@ EDITTEXT IDC_DESCRIPTION, 70, 46, 176, 24, WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP | ES_MULTILINE | ES_READONLY EDITTEXT IDC_EXEPATH, 6, 86, 240, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_READONLY CONTROL "",IDC_START_TYPE,"ComboBox",0x50010003,70,107,176,11 - PUSHBUTTON "Start", IDC_START, 6, 155, 54, 15 - PUSHBUTTON "Stop", IDC_STOP, 68, 155, 54, 15 - PUSHBUTTON "Pause", IDC_PAUSE , 130, 155, 54, 15 - PUSHBUTTON "Resume", IDC_RESUME, 192, 155, 54, 15 + PUSHBUTTON "Start", IDC_START, 6, 155, 54, 15, WS_DISABLED + PUSHBUTTON "Stop", IDC_STOP, 68, 155, 54, 15, WS_DISABLED + PUSHBUTTON "Pause", IDC_PAUSE , 130, 155, 54, 15, WS_DISABLED + PUSHBUTTON "Resume", IDC_RESUME, 192, 155, 54, 15, WS_DISABLED LTEXT "Service name:", IDC_STATIC, 4, 11, 53, 11 LTEXT "Display name:", IDC_STATIC, 4, 29, 53, 11 LTEXT "Description:", IDC_STATIC, 4, 51, 53, 11 _____ Modified: trunk/reactos/base/system/servman/export.c --- trunk/reactos/base/system/servman/export.c 2006-01-31 22:41:45 UTC (rev 69) +++ trunk/reactos/base/system/servman/export.c 2006-02-01 19:41:17 UTC (rev 70) @@ -87,7 +87,8 @@ return; } - MessageBox(NULL, _T("Export to file failed"), NULL, 0); + if (CommDlgExtendedError() != CDERR_GENERALCODES) + MessageBox(NULL, _T("Export to file failed"), NULL, 0); } _____ Modified: trunk/reactos/base/system/servman/propsheet.c --- trunk/reactos/base/system/servman/propsheet.c 2006-01-31 22:41:45 UTC (rev 69) +++ trunk/reactos/base/system/servman/propsheet.c 2006-02-01 19:41:17 UTC (rev 70) @@ -29,6 +29,43 @@ +VOID SetButtonStates() +{ + HWND hButton; + ENUM_SERVICE_STATUS_PROCESS *Service = NULL; + DWORD Flags, State; + + /* get pointer to selected service */ + Service = GetSelectedService(); + + Flags = Service->ServiceStatusProcess.dwControlsAccepted; + State = Service->ServiceStatusProcess.dwCurrentState; + + if (State == SERVICE_STOPPED) + { + hButton = GetDlgItem(hwndGenDlg, IDC_START); + EnableWindow (hButton, TRUE); + } + + if ( (Flags & SERVICE_ACCEPT_STOP) && (State == SERVICE_RUNNING) ) + { + hButton = GetDlgItem(hwndGenDlg, IDC_STOP); + EnableWindow (hButton, TRUE); + } + + if ( (Flags & SERVICE_ACCEPT_PAUSE_CONTINUE) && (State == SERVICE_RUNNING) ) + { + hButton = GetDlgItem(hwndGenDlg, IDC_PAUSE); + EnableWindow (hButton, TRUE); + } + + if ( (Flags & SERVICE_ACCEPT_STOP) && (State == SERVICE_RUNNING) ) + { + hButton = GetDlgItem(hwndGenDlg, IDC_PAUSE); + EnableWindow (hButton, TRUE); + } +} + /* * Fills the 'startup type' combo box with possible * values and sets it to value of the selected item @@ -163,43 +200,60 @@ { case WM_INITDIALOG: GetDlgInfo(); + SetButtonStates(); + break; - break; - case WM_COMMAND: switch(LOWORD(wParam)) { + case IDC_START_TYPE: + /* Enable the 'Apply' button */ + //PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + break; + case IDC_START: SendMessage(hMainWnd, WM_COMMAND, ID_START, 0); - break; + break; case IDC_STOP: SendMessage(hMainWnd, WM_COMMAND, ID_STOP, 0); - break; + break; case IDC_PAUSE: SendMessage(hMainWnd, WM_COMMAND, ID_PAUSE, 0); - break; + break; case IDC_RESUME: SendMessage(hMainWnd, WM_COMMAND, ID_RESUME, 0); - break; + break; + + case IDC_START_PARAM: + /* Enable the 'Apply' button */ + //PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + break; + } break; case WM_DESTROY: - break; + break; case WM_NOTIFY: { LPNMHDR lpnm = (LPNMHDR)lParam; switch (lpnm->code) + { + case MCN_SELECT: + /* Enable the 'Apply' button */ + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + break; - default: + default: break; + } } - break; + break; } return FALSE; _____ Modified: trunk/reactos/base/system/servman/query.c --- trunk/reactos/base/system/servman/query.c 2006-01-31 22:41:45 UTC (rev 69) +++ trunk/reactos/base/system/servman/query.c 2006-02-01 19:41:17 UTC (rev 70) @@ -414,206 +414,3 @@ return NumServices; } - - - - - - - - - - - -/* - //WORD wCodePage; - //WORD wLangID; - //SC_HANDLE hService; - //DWORD dwHandle, dwLen; - //UINT BufLen; - //TCHAR* lpData; - //TCHAR* lpBuffer; - //TCHAR szStrFileInfo[80]; - //TCHAR FileName[MAX_PATH]; - //LPVOID pvData; - - //LPSERVICE_FAILURE_ACTIONS pServiceFailureActions = NULL; - //LPQUERY_SERVICE_CONFIG pServiceConfig = NULL; - - BytesNeeded = 0; - hService = OpenService(ScHandle, - pServiceStatus[Index].lpServiceName, - SC_MANAGER_CONNECT); - if (hService != INVALID_HANDLE_VALUE) - { - / * check if service is required by the system* / - if (!QueryServiceConfig2(hService, - SERVICE_CONFIG_FAILURE_ACTIONS, - (LPBYTE)pServiceFailureActions, - 0, - &BytesNeeded)) - { - if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) - { - pServiceFailureActions = (LPSERVICE_FAILURE_ACTIONS) - HeapAlloc(GetProcessHeap(), 0, BytesNeeded); - if (pServiceFailureActions == NULL) - return FALSE; - - if (!QueryServiceConfig2(hService, - SERVICE_CONFIG_FAILURE_ACTIONS, - (LPBYTE)pServiceFailureActions, - BytesNeeded, - &BytesNeeded)) - { - HeapFree(GetProcessHeap(), 0, pServiceFailureActions); - return FALSE; - } - } - else / * exit on failure * / - { - return FALSE; - } - } - if (pServiceFailureActions->cActions) - { - if (pServiceFailureActions->lpsaActions[0].Type == SC_ACTION_REBOOT) - { - LoadString(hInstance, IDS_SERVICES_YES, szStatus, 128); - item.pszText = szStatus; - item.iSubItem = 1; - SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); - } - } - - if (pServiceFailureActions != NULL) - { - HeapFree(GetProcessHeap(), 0, pServiceFailureActions); - pServiceFailureActions = NULL; - } - - / * get vendor of service binary * / - BytesNeeded = 0; - if (!QueryServiceConfig(hService, pServiceConfig, 0, &BytesNeeded)) - { - if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) - { - pServiceConfig = (LPQUERY_SERVICE_CONFIG) - HeapAlloc(GetProcessHeap(), 0, BytesNeeded); - if (pServiceConfig == NULL) - return FALSE; - - if (!QueryServiceConfig(hService, - pServiceConfig, - BytesNeeded, - &BytesNeeded)) - { - HeapFree(GetProcessHeap(), 0, pServiceConfig); - return FALSE; - } - } - else / * exit on failure * / - { - return FALSE; - } - } - - memset(&FileName, 0, MAX_PATH); - if (_tcscspn(pServiceConfig->lpBinaryPathName, _T("\""))) - { - _tcsncpy(FileName, pServiceConfig->lpBinaryPathName, - _tcscspn(pServiceConfig->lpBinaryPathName, _T(" ")) ); - } - else - { - _tcscpy(FileName, pServiceConfig->lpBinaryPathName); - } - - HeapFree(GetProcessHeap(), 0, pServiceConfig); - pServiceConfig = NULL; - - dwLen = GetFileVersionInfoSize(FileName, &dwHandle); - if (dwLen) - { - lpData = (TCHAR*) HeapAlloc(GetProcessHeap(), 0, dwLen); - if (lpData == NULL) - return FALSE; - - if (!GetFileVersionInfo (FileName, dwHandle, dwLen, lpData)) { - HeapFree(GetProcessHeap(), 0, lpData); - return FALSE; - } - - if (VerQueryValue(lpData, _T("\\VarFileInfo\\Translation"), &pvData, (PUINT) &BufLen)) - { - wCodePage = LOWORD(*(DWORD*) pvData); - wLangID = HIWORD(*(DWORD*) pvData); - wsprintf(szStrFileInfo, _T("StringFileInfo\\%04X%04X\\CompanyName"), wCodePage, wLangID); - } - - if (VerQueryValue (lpData, szStrFileInfo, (LPVOID) &lpBuffer, (PUINT) &BufLen)) { - item.pszText = lpBuffer; - item.iSubItem = 2; - SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); - } - HeapFree(GetProcessHeap(), 0, lpData); - } - else - { - LoadString(hInstance, IDS_SERVICES_UNKNOWN, szStatus, 128); - item.pszText = szStatus; - item.iSubItem = 2; - SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); - } - CloseServiceHandle(hService); - } - - - - - - - - HeapFree(GetProcessHeap(), 0, pServiceConfig); - pServiceConfig = NULL; - - dwLen = GetFileVersionInfoSize(FileName, &dwHandle); - if (dwLen) - { - lpData = (TCHAR*) HeapAlloc(GetProcessHeap(), 0, dwLen); - if (lpData == NULL) - return FALSE; - - if (!GetFileVersionInfo (FileName, dwHandle, dwLen, lpData)) { - HeapFree(GetProcessHeap(), 0, lpData); - return FALSE; - } - - if (VerQueryValue(lpData, _T("\\VarFileInfo\\Translation"), - &pvData, (PUINT) &BufLen)) - { - wCodePage = LOWORD(*(DWORD*) pvData); - wLangID = HIWORD(*(DWORD*) pvData); - wsprintf(szStrFileInfo, _T("StringFileInfo\\%04X%04X\\CompanyName"), - wCodePage, wLangID); - } - - if (VerQueryValue (lpData, szStrFileInfo, (LPVOID) &lpBuffer, (PUINT) &BufLen)) - { - item.pszText = lpBuffer; - item.iSubItem = 2; - SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); - } - HeapFree(GetProcessHeap(), 0, lpData); - } - else - { - LoadString(hInstance, IDS_SERVICES_UNKNOWN, szStatus, 128); - item.pszText = szStatus; - item.iSubItem = 2; - SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); - } - - -*/ - _____ Modified: trunk/reactos/base/system/servman/resource.h --- trunk/reactos/base/system/servman/resource.h 2006-01-31 22:41:45 UTC (rev 69) +++ trunk/reactos/base/system/servman/resource.h 2006-02-01 19:41:17 UTC (rev 70) @@ -24,6 +24,10 @@ #define IDR_MAINMENU 102 #define IDR_POPUP 103 #define ID_VIEW_CUSTOMIZE 4021 +#define ID_VIEW_LARGE 4022 +#define ID_VIEW_SMALL 4023 +#define ID_VIEW_LIST 4024 +#define ID_VIEW_DETAILS 4025 #define ID_ABOUT 4031 /* List view columns */ _____ Modified: trunk/reactos/base/system/servman/servman.c --- trunk/reactos/base/system/servman/servman.c 2006-01-31 22:41:45 UTC (rev 69) +++ trunk/reactos/base/system/servman/servman.c 2006-02-01 19:41:17 UTC (rev 70) @@ -18,7 +18,7 @@ HWND hTool; HWND hProgDlg; HMENU hShortcutMenu; -INT SelectedItem; +INT SelectedItem = -1; extern HWND hwndGenDlg; @@ -28,7 +28,77 @@ return SelectedItem; } +VOID SetView(DWORD View) +{ + DWORD Style = GetWindowLong(hListView, GWL_STYLE); + if ((Style & LVS_TYPEMASK) != View) + SetWindowLong(hListView, GWL_STYLE, (Style & ~LVS_TYPEMASK) | View); +} + + +VOID SetMenuAndButtonStates() +{ + HMENU hMainMenu; + ENUM_SERVICE_STATUS_PROCESS *Service = NULL; + DWORD Flags, State; + + /* get handle to menu */ + hMainMenu = GetMenu(hMainWnd); + + /* set all to greyed */ + EnableMenuItem(hMainMenu, ID_START, MF_GRAYED); + EnableMenuItem(hMainMenu, ID_STOP, MF_GRAYED); + EnableMenuItem(hMainMenu, ID_PAUSE, MF_GRAYED); + EnableMenuItem(hMainMenu, ID_RESUME, MF_GRAYED); + EnableMenuItem(hMainMenu, ID_RESTART, MF_GRAYED); + + EnableMenuItem(hShortcutMenu, ID_START, MF_GRAYED); + EnableMenuItem(hShortcutMenu, ID_STOP, MF_GRAYED); + EnableMenuItem(hShortcutMenu, ID_PAUSE, MF_GRAYED); + EnableMenuItem(hShortcutMenu, ID_RESUME, MF_GRAYED); + EnableMenuItem(hShortcutMenu, ID_RESTART, MF_GRAYED); + + //EnableWindow(hTool, FALSE); + + if (GetSelectedItem() != -1) + { + /* get pointer to selected service */ + Service = GetSelectedService(); + + Flags = Service->ServiceStatusProcess.dwControlsAccepted; + State = Service->ServiceStatusProcess.dwCurrentState; + + if (State == SERVICE_STOPPED) + { + EnableMenuItem(hMainMenu, ID_START, MF_ENABLED); + EnableMenuItem(hShortcutMenu, ID_START, MF_ENABLED); + } + + if ( (Flags & SERVICE_ACCEPT_STOP) && (State == SERVICE_RUNNING) ) + { + EnableMenuItem(hMainMenu, ID_STOP, MF_ENABLED); + EnableMenuItem(hShortcutMenu, ID_STOP, MF_ENABLED); + } + + if ( (Flags & SERVICE_ACCEPT_PAUSE_CONTINUE) && (State == SERVICE_RUNNING) ) + { + EnableMenuItem(hMainMenu, ID_PAUSE, MF_ENABLED); + EnableMenuItem(hShortcutMenu, ID_PAUSE, MF_ENABLED); + } + + if ( (Flags & SERVICE_ACCEPT_STOP) && (State == SERVICE_RUNNING) ) + { + EnableMenuItem(hMainMenu, ID_RESTART, MF_ENABLED); + EnableMenuItem(hShortcutMenu, ID_RESTART, MF_ENABLED); + } + } + else + EnableMenuItem(hMainMenu, ID_PROP, MF_GRAYED); + +} + + LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) @@ -83,6 +153,7 @@ MessageBox(hwnd, _T("Could not create tool bar."), _T("Error"), MB_OK | MB_ICONERROR); /* Send the TB_BUTTONSTRUCTSIZE message, which is required for backward compatibility */ + SendMessage(hTool, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0); /* Add custom images */ @@ -249,9 +320,28 @@ case LVN_ITEMCHANGED: { LPNMLISTVIEW pnmv = (LPNMLISTVIEW) lParam; + ENUM_SERVICE_STATUS_PROCESS *Service = NULL; + HMENU hMainMenu; + /* get handle to menu */ + hMainMenu = GetMenu(hMainWnd); + + /* activate properties menu item, if not already */ + if (GetMenuState(hMainMenu, ID_PROP, MF_BYCOMMAND) != MF_ENABLED) + EnableMenuItem(hMainMenu, ID_PROP, MF_ENABLED); + + /* globally set selected service */ SelectedItem = pnmv->iItem; + /* alter options for the service */ + SetMenuAndButtonStates(); + + /* get pointer to selected service */ + Service = GetSelectedService(); + + /* set current selected service in the status bar */ + SendMessage(hStatus, SB_SETTEXT, 1, (LPARAM)Service->lpDisplayName); + } break; @@ -334,12 +424,21 @@ switch(LOWORD(wParam)) { case ID_PROP: - OpenPropSheet(hwnd); + if (GetSelectedItem() != -1) + OpenPropSheet(hwnd); break; case ID_REFRESH: RefreshServiceList(); + SelectedItem = -1; + + /* disable menus and buttons */ + SetMenuAndButtonStates(); + + /* clear the service in the status bar */ + SendMessage(hStatus, SB_SETTEXT, 1, _T('\0')); + break; case ID_EXPORT: @@ -356,7 +455,9 @@ case ID_START: { - + ENUM_SERVICE_STATUS_PROCESS *Service = NULL; + TCHAR ProgDlgBuf[100]; + /* open the progress dialog */ hProgDlg = CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_DLG_PROGRESS), @@ -364,9 +465,6 @@ (DLGPROC)ProgressDialogProc); if (hProgDlg != NULL) { - ENUM_SERVICE_STATUS_PROCESS *Service = NULL; - TCHAR ProgDlgBuf[100]; - ShowWindow(hProgDlg, SW_SHOW); /* write the info to the progress dialog */ @@ -385,11 +483,10 @@ if ( DoStartService(hProgDlg) ) { - LVITEM item; TCHAR szStatus[64]; TCHAR buf[25]; - + LoadString(hInstance, IDS_SERVICES_STARTED, szStatus, sizeof(szStatus) / sizeof(TCHAR)); item.pszText = szStatus; @@ -414,6 +511,9 @@ case ID_STOP: { + ENUM_SERVICE_STATUS_PROCESS *Service = NULL; + TCHAR ProgDlgBuf[100]; + /* open the progress dialog */ hProgDlg = CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_DLG_PROGRESS), @@ -421,9 +521,6 @@ (DLGPROC)ProgressDialogProc); if (hProgDlg != NULL) { - ENUM_SERVICE_STATUS_PROCESS *Service = NULL; - TCHAR ProgDlgBuf[100]; - ShowWindow(hProgDlg, SW_SHOW); /* write the info to the progress dialog */ @@ -442,11 +539,10 @@ if( Control(hProgDlg, SERVICE_CONTROL_STOP) ) { - LVITEM item; TCHAR buf[25]; - item.pszText = '\0'; + item.pszText = _T('\0'); item.iItem = GetSelectedItem(); item.iSubItem = 2; SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); @@ -488,6 +584,22 @@ PostMessage(hwnd, WM_CLOSE, 0, 0); break; + case ID_VIEW_LARGE: + SetView(LVS_ICON); + break; + + case ID_VIEW_SMALL: + SetView(LVS_SMALLICON); + break; + + case ID_VIEW_LIST: + SetView(LVS_LIST); + break; + + case ID_VIEW_DETAILS: + SetView(LVS_REPORT); + break; + case ID_VIEW_CUSTOMIZE: break; @@ -496,7 +608,7 @@ MAKEINTRESOURCE(IDD_ABOUTBOX), hMainWnd, (DLGPROC)AboutDialogProc); - break; + break; } break;
18 years, 10 months
1
0
0
0
← Newer
1
2
3
4
5
Older →
Jump to page:
1
2
3
4
5
Results per page:
10
25
50
100
200