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
January 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
23 participants
586 discussions
Start a n
N
ew thread
[martinf] 49: create new lean-explorer branch
by martinf@svn.reactos.org
create new lean-explorer branch Added: branches/lean-explorer/
18 years, 10 months
1
0
0
0
[martinf] 48: prepare for lean-explorer branch derived from trunk
by martinf@svn.reactos.org
prepare for lean-explorer branch derived from trunk Deleted: branches/lean-explorer/
18 years, 10 months
1
0
0
0
[gvg] 47: Add proxy makefile
by gvg@svn.reactos.org
Add proxy makefile Added: trunk/reactos/proxy.mak _____ Added: trunk/reactos/proxy.mak --- trunk/reactos/proxy.mak 2006-01-30 18:55:32 UTC (rev 46) +++ trunk/reactos/proxy.mak 2006-01-30 19:18:26 UTC (rev 47) @@ -0,0 +1,21 @@ +MAKEFLAGS += --no-print-directory + +$(DEFAULT): + @$(MAKE) -C $(TOP) $(DEFAULT) + +all: + @$(MAKE) -C $(TOP) all + +depends: + @$(MAKE) -C $(TOP) $(DEFAULT)_depends + +install: + @$(MAKE) -C $(TOP) $(DEFAULT)_install + +clean: + @$(MAKE) -C $(TOP) $(DEFAULT)_clean + +test: + @$(MAKE) -C $(TOP) $(DEFAULT)_test + +$(DEFAULT)_clean: clean Property changes on: trunk/reactos/proxy.mak ___________________________________________________________________ Name: svn:eol-style + native
18 years, 10 months
1
0
0
0
[gedmurphy] 46: Forgot the rbuild file.
by gedmurphy@svn.reactos.org
Forgot the rbuild file. Modified: trunk/reactos/base/system/servman/servman.rbuild _____ Modified: trunk/reactos/base/system/servman/servman.rbuild --- trunk/reactos/base/system/servman/servman.rbuild 2006-01-30 18:48:10 UTC (rev 45) +++ trunk/reactos/base/system/servman/servman.rbuild 2006-01-30 18:55:32 UTC (rev 46) @@ -15,12 +15,14 @@ <compilationunit name="unit.c"> <file>about.c</file> <file>control.c</file> + <file>create.c</file> + <file>export.c</file> <file>geterror.c</file> <file>progress.c</file> <file>propsheet.c</file> <file>query.c</file> <file>servman.c</file> - <file>start.c</file> + <file>start.c</file> </compilationunit> <file>servman.rc</file> <pch>servman.h</pch>
18 years, 10 months
1
0
0
0
[gedmurphy] 45: - Add basic support for creating services
by gedmurphy@svn.reactos.org
- Add basic support for creating services - Start to put in functionality for exporting all services to a file - Don't open the progress dialog if the action fails Modified: trunk/reactos/base/system/servman/En.rc Modified: trunk/reactos/base/system/servman/about.c Modified: trunk/reactos/base/system/servman/control.c Added: trunk/reactos/base/system/servman/create.c Added: trunk/reactos/base/system/servman/export.c Modified: trunk/reactos/base/system/servman/geterror.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/servman.h Modified: trunk/reactos/base/system/servman/start.c _____ Modified: trunk/reactos/base/system/servman/En.rc --- trunk/reactos/base/system/servman/En.rc 2006-01-30 18:44:22 UTC (rev 44) +++ trunk/reactos/base/system/servman/En.rc 2006-01-30 18:48:10 UTC (rev 45) @@ -80,13 +80,13 @@ PUSHBUTTON "Resume", IDC_RESUME, 192, 155, 54, 15 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 + LTEXT "Description:", IDC_STATIC, 4, 51, 53, 11 LTEXT "Path to executable:", IDC_STATIC, 6, 73, 82, 9 LTEXT "Startup type:", IDC_STATIC, 6, 108, 53, 11 LTEXT "Service status:", IDC_STATIC, 4, 138, 53, 11 CONTROL "",IDC_SERV_STATUS,"Static",0x50000000,70,138,176,11 LTEXT "You can specify the start parameters that apply when you start the service from here.",IDC_STATIC, 6,177,240,15 - LTEXT "Start parameters", IDC_STATIC, 6, 199, 53, 11 + LTEXT "Start parameters:", IDC_STATIC, 6, 200, 58, 11 EDITTEXT IDC_START_PARAM, 68, 199, 178, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP END @@ -97,9 +97,9 @@ BEGIN CONTROL "",IDC_DEPEND_TREE1,"SysTreeView32",0x50010007,8,70,236,68,0x00000200 CONTROL "",IDC_DEPEND_TREE2,"SysTreeView32",0x50010007,8,151,234,67,0x00000200 - CONTROL "Some services depend on other services, system drivers and load order groups. If a system component is stopped or it is not running properly, dependant services can be affected.",IDC_STATIC,"Static",0x50000000,8,7,238,26 - CONTROL "This service depends on the following components",IDC_STATIC,"Static",0x50000000,8,57,236,9 - CONTROL "",IDC_DEPEND_SERVICE,"Static",0x50000000,8,38,236,13 + LTEXT "Some services depend on other services, system drivers and load order groups. If a system component is stopped or it is not running properly, dependant services can be affected.", IDC_STATIC,8, 7, 238, 26 + LTEXT "This service depends on the following components", IDC_STATIC, 8, 57, 236, 9 + LTEXT "", IDC_DEPEND_SERVICE, 8, 38, 236, 13 END IDD_DLG_CREATE DIALOGEX 6,6,225,209 @@ -122,6 +122,15 @@ CONTROL "Help",ID_CREATE_HELP,"Button",0x50010000,6,192,44,13 END +IDD_DLG_HELP_OPTIONS DIALOGEX 6,6,200,150 +CAPTION "Options" +FONT 8,"MS Sans Serif",0,0 +STYLE 0x10CF0000 +BEGIN + LTEXT "", IDC_CREATE_HELP, 6, 5, 200, 150 + PUSHBUTTON "Ok", IDOK, 75, 130, 44, 13 +END + IDD_DLG_PROGRESS DIALOGEX 6,6,255,89 CAPTION "Service Control" FONT 8,"MS Sans Serif",0,0 @@ -131,7 +140,7 @@ 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 - CONTROL "&Close",IDOK,"Button",0x50010000,100,70,54,13 + PUSHBUTTON "&Close", IDOK, 100, 70, 54, 13 END @@ -159,7 +168,7 @@ STRINGTABLE DISCARDABLE BEGIN IDS_NUM_SERVICES "Num Services: %d" - IDS_LICENSE "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA" + IDS_LICENSE "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA." END STRINGTABLE DISCARDABLE @@ -178,5 +187,11 @@ STRINGTABLE DISCARDABLE BEGIN - IDS_PROGRESS_INFO "ReactOS is attempting to %s the following service" + IDS_PROGRESS_INFO_START "ReactOS is attempting to start the following service" + IDS_PROGRESS_INFO_STOP "ReactOS is attempting to stop the following service" END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_OPTIONS "CREATE OPTIONS:\r\nNOTE: The option name includes the equal sign.\r\n type= <own|share|interact|kernel|filesys|rec>\r\n (default = own)\r\n start= <boot|system|auto|demand|disabled>\r\n (default = demand) \r\n error= <normal|severe|critical|ignore>\r\n (default = normal)\r\n group= <LoadOrderGroup>\r\n tag= <yes|no>\r\n depend= <Dependencies(separated by / (forward slash))>\r\n obj= <AccountName|ObjectName>\r\n (default = LocalSystem)\r\n password= <password>\r\n" +END _____ Modified: trunk/reactos/base/system/servman/about.c --- trunk/reactos/base/system/servman/about.c 2006-01-30 18:44:22 UTC (rev 44) +++ trunk/reactos/base/system/servman/about.c 2006-01-30 18:48:10 UTC (rev 45) @@ -21,7 +21,7 @@ { HWND hLicenseEditWnd; HICON hIcon = NULL; - TCHAR strLicense[0x1000]; + TCHAR strLicense[700]; switch (message) { @@ -32,7 +32,7 @@ hLicenseEditWnd = GetDlgItem(hDlg, IDC_LICENSE_EDIT); - LoadString(hInstance, IDS_LICENSE, strLicense, 0x1000); + LoadString(hInstance, IDS_LICENSE, strLicense, 700); SetWindowText(hLicenseEditWnd, strLicense); _____ Modified: trunk/reactos/base/system/servman/control.c --- trunk/reactos/base/system/servman/control.c 2006-01-30 18:44:22 UTC (rev 44) +++ trunk/reactos/base/system/servman/control.c 2006-01-30 18:48:10 UTC (rev 45) @@ -106,7 +106,7 @@ GetError(0); return FALSE; } - + if (ServiceStatus.dwCheckPoint > dwOldCheckPoint) { /* The service is making progress. increment the progress bar */ _____ Added: trunk/reactos/base/system/servman/create.c --- trunk/reactos/base/system/servman/create.c 2006-01-30 18:44:22 UTC (rev 44) +++ trunk/reactos/base/system/servman/create.c 2006-01-30 18:48:10 UTC (rev 45) @@ -0,0 +1,219 @@ +/* + * PROJECT: ReactOS Services + * 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> + * + */ + +#include "servman.h" + +extern HINSTANCE hInstance; + + +BOOL Create(LPTSTR ServiceName, + LPTSTR DisplayName, + LPTSTR BinPath, + LPTSTR Description, + LPTSTR Options) +{ + SC_HANDLE hSCManager; + SC_HANDLE hSc; + + /* open handle to the SCM */ + hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); + if (hSCManager == NULL) + { + GetError(0); + return FALSE; + } + + hSc = CreateService(hSCManager, + ServiceName, + DisplayName, + SERVICE_ALL_ACCESS, + SERVICE_WIN32_OWN_PROCESS, + SERVICE_DEMAND_START, + SERVICE_ERROR_NORMAL, + BinPath, + NULL, + NULL, + NULL, + NULL, + NULL); + + if (hSc == NULL) + { + GetError(0); + return FALSE; + } + + DisplayString(_T("Service Succesfully Created")); + CloseServiceHandle(hSCManager); + CloseServiceHandle(hSc); + return TRUE; +} + + +#ifdef _MSC_VER +#pragma warning(disable : 4100) +#endif +BOOL CALLBACK +CreateHelpDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + HWND hHelp; + HICON hIcon = NULL; + TCHAR Buf[1000]; + + 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); + + hHelp = GetDlgItem(hDlg, IDC_CREATE_HELP); + + LoadString(hInstance, IDS_HELP_OPTIONS, Buf, 1000); + + SetWindowText(hHelp, Buf); + + return TRUE; + + case WM_COMMAND: + if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL)) + { + DestroyIcon(hIcon); + EndDialog(hDlg, LOWORD(wParam)); + return TRUE; + } + break; + } + + return FALSE; +} + + +BOOL CALLBACK +CreateDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + HICON hIcon = NULL; + + 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); + return TRUE; + + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDOK: + { + LPTSTR ServiceName = NULL; + LPTSTR DisplayName = NULL; + LPTSTR BinPath = NULL; + LPTSTR Description = NULL; + LPTSTR Options = NULL; + HWND hwnd; + INT iLen = 0; + + /* get service name */ + hwnd = GetDlgItem(hDlg, IDC_CREATE_SERVNAME); + iLen = GetWindowTextLength(hwnd); + if (iLen != 0) + { + ServiceName = HeapAlloc(GetProcessHeap(), 0, iLen+1); + if (ServiceName != NULL) + { + GetWindowText(hwnd, ServiceName, iLen+1); + DisplayString(ServiceName); + } + + } + + /* get display name */ + iLen = 0; + hwnd = GetDlgItem(hDlg, IDC_CREATE_DISPNAME); + iLen = GetWindowTextLength(hwnd); + if (iLen != 0) + { + DisplayName = HeapAlloc(GetProcessHeap(), 0, iLen+1); + if (DisplayName != NULL) + GetWindowText(hwnd, DisplayName, iLen+1); + + } + + /* get binary path */ + iLen = 0; + hwnd = GetDlgItem(hDlg, IDC_CREATE_PATH); + iLen = GetWindowTextLength(hwnd); + if (iLen != 0) + { + BinPath = HeapAlloc(GetProcessHeap(), 0, iLen+1); + if (BinPath != NULL) + GetWindowText(hwnd, BinPath, iLen+1); + + } + + /* get description */ + iLen = 0; + hwnd = GetDlgItem(hDlg, IDC_CREATE_PATH); + iLen = GetWindowTextLength(hwnd); + if (iLen != 0) + { + Description = HeapAlloc(GetProcessHeap(), 0, iLen+1); + if (Description != NULL) + GetWindowText(hwnd, Description, iLen+1); + + } + + /* get options */ + iLen = 0; + hwnd = GetDlgItem(hDlg, IDC_CREATE_PATH); + iLen = GetWindowTextLength(hwnd); + if (iLen != 0) + { + Options = HeapAlloc(GetProcessHeap(), 0, iLen+1); + if (Options != NULL) + GetWindowText(hwnd, Options, iLen+1); + + } + + Create(ServiceName, DisplayName, BinPath, Description, Options); + + if (ServiceName != NULL) + HeapFree(GetProcessHeap(), 0, ServiceName); + if (DisplayName != NULL) + HeapFree(GetProcessHeap(), 0, DisplayName); + if (BinPath != NULL) + HeapFree(GetProcessHeap(), 0, BinPath); + if (Description != NULL) + HeapFree(GetProcessHeap(), 0, Description); + if (Options != NULL) + HeapFree(GetProcessHeap(), 0, Options); + + + DestroyIcon(hIcon); + EndDialog(hDlg, LOWORD(wParam)); + return TRUE; + } + + case IDCANCEL: + DestroyIcon(hIcon); + EndDialog(hDlg, LOWORD(wParam)); + return TRUE; + + case ID_CREATE_HELP: + DialogBox(hInstance, + MAKEINTRESOURCE(IDD_DLG_HELP_OPTIONS), + hDlg, + (DLGPROC)CreateHelpDialogProc); + break; + } + + } + + return FALSE; +} _____ Added: trunk/reactos/base/system/servman/export.c --- trunk/reactos/base/system/servman/export.c 2006-01-30 18:44:22 UTC (rev 44) +++ trunk/reactos/base/system/servman/export.c 2006-01-30 18:48:10 UTC (rev 45) @@ -0,0 +1,51 @@ +/* + * PROJECT: ReactOS Services + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/servman/export.c + * PURPOSE: Save services to a file + * COPYRIGHT: Copyright 2005 Ged Murphy <gedmurphy(a)gmail.com> + * + */ + +#include "servman.h" + + +BOOL SaveServicesToFile(HWND hListView, LPCTSTR pszFileName) +{ + HANDLE hFile; + BOOL bSuccess = FALSE; + + hFile = CreateFile(pszFileName, GENERIC_WRITE, 0, NULL, + CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + if(hFile != INVALID_HANDLE_VALUE) + { + + CloseHandle(hFile); + } + return bSuccess; +} + + +VOID ExportFile(HWND hwnd) +{ + OPENFILENAME ofn; + TCHAR szFileName[MAX_PATH] = _T(""); + + ZeroMemory(&ofn, sizeof(ofn)); + + ofn.lStructSize = sizeof(OPENFILENAME); + ofn.hwndOwner = hwnd; + ofn.lpstrFilter = _T("Text Files (*.txt)\0*.txt\0All Files (*.*)\0*.*\0"); + ofn.lpstrFile = szFileName; + ofn.nMaxFile = MAX_PATH; + ofn.lpstrDefExt = _T("txt"); + ofn.Flags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT; + + if(GetSaveFileName(&ofn)) + { + SaveServicesToFile(hwnd, szFileName); + } +} + + + _____ Modified: trunk/reactos/base/system/servman/geterror.c --- trunk/reactos/base/system/servman/geterror.c 2006-01-30 18:44:22 UTC (rev 44) +++ trunk/reactos/base/system/servman/geterror.c 2006-01-30 18:48:10 UTC (rev 45) @@ -1,7 +1,15 @@ -//#include <stdarg> +/* + * PROJECT: ReactOS Services + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/servman/geterror.c + * PURPOSE: displays error messages + * COPYRIGHT: Copyright 2005 Ged Murphy <gedmurphy(a)gmail.com> + * + */ + #include "servman.h" -/* temp file for debugging */ + VOID GetError(DWORD err) { LPVOID lpMsgBuf; @@ -28,6 +36,6 @@ VOID DisplayString(PTCHAR Msg) { - MessageBox(NULL, Msg, _T("Error!"), MB_OK | MB_ICONERROR); + MessageBox(NULL, Msg, _T("..."), MB_OK); } _____ Modified: trunk/reactos/base/system/servman/propsheet.c --- trunk/reactos/base/system/servman/propsheet.c 2006-01-30 18:44:22 UTC (rev 44) +++ trunk/reactos/base/system/servman/propsheet.c 2006-01-30 18:48:10 UTC (rev 45) @@ -9,6 +9,7 @@ #include "servman.h" +HWND hwndGenDlg; extern ENUM_SERVICE_STATUS_PROCESS *pServiceStatus; extern HINSTANCE hInstance; extern HWND hListView; @@ -27,18 +28,19 @@ } PROP_DLG_INFO, *PPROP_DLG_INFO; + /* * Fills the 'startup type' combo box with possible * values and sets it to value of the selected item */ -VOID SetStartupType(HKEY hKey, HWND hwndDlg) +VOID SetStartupType(HKEY hKey) { HWND hList; TCHAR buf[25]; DWORD dwValueSize = 0; DWORD StartUp = 0; - hList = GetDlgItem(hwndDlg, IDC_START_TYPE); + hList = GetDlgItem(hwndGenDlg, IDC_START_TYPE); LoadString(hInstance, IDS_SERVICES_AUTO, buf, sizeof(buf) / sizeof(TCHAR)); SendMessage(hList, CB_ADDSTRING, 0, (LPARAM)buf); @@ -73,7 +75,7 @@ * Populates the General Properties dialog with * the relevant service information */ -VOID GetDlgInfo(HWND hwndDlg) +VOID GetDlgInfo() { HKEY hKey; ENUM_SERVICE_STATUS_PROCESS *Service = NULL; @@ -94,29 +96,29 @@ /* set the service name */ DlgInfo.lpServiceName = Service->lpServiceName; - SendDlgItemMessage(hwndDlg, IDC_SERV_NAME, WM_SETTEXT, 0, ( + SendDlgItemMessage(hwndGenDlg, IDC_SERV_NAME, WM_SETTEXT, 0, ( LPARAM)DlgInfo.lpServiceName); /* set the display name */ DlgInfo.lpDisplayName = Service->lpDisplayName; - SendDlgItemMessage(hwndDlg, IDC_DISP_NAME, WM_SETTEXT, 0, + SendDlgItemMessage(hwndGenDlg, IDC_DISP_NAME, WM_SETTEXT, 0, (LPARAM)DlgInfo.lpDisplayName); /* set the description */ if (GetDescription(hKey, &DlgInfo.lpDescription)) - SendDlgItemMessage(hwndDlg, IDC_DESCRIPTION, WM_SETTEXT, 0, + SendDlgItemMessage(hwndGenDlg, IDC_DESCRIPTION, WM_SETTEXT, 0, (LPARAM)DlgInfo.lpDescription); /* set the executable path */ if (GetExecutablePath(&DlgInfo.lpPathToExe)) - SendDlgItemMessage(hwndDlg, IDC_EXEPATH, WM_SETTEXT, 0, (LPARAM)DlgInfo.lpPathToExe); + SendDlgItemMessage(hwndGenDlg, IDC_EXEPATH, WM_SETTEXT, 0, (LPARAM)DlgInfo.lpPathToExe); /* set startup type */ - SetStartupType(hKey, hwndDlg); + SetStartupType(hKey); @@ -125,18 +127,19 @@ { LoadString(hInstance, IDS_SERVICES_STARTED, DlgInfo.szServiceStatus, sizeof(DlgInfo.szServiceStatus) / sizeof(TCHAR)); - SendDlgItemMessageW(hwndDlg, IDC_SERV_STATUS, WM_SETTEXT, 0, (LPARAM)DlgInfo.szServiceStatus); + SendDlgItemMessageW(hwndGenDlg, IDC_SERV_STATUS, WM_SETTEXT, 0, (LPARAM)DlgInfo.szServiceStatus); } else { LoadString(hInstance, IDS_SERVICES_STOPPED, DlgInfo.szServiceStatus, sizeof(DlgInfo.szServiceStatus) / sizeof(TCHAR)); - SendDlgItemMessageW(hwndDlg, IDC_SERV_STATUS, WM_SETTEXT, 0, (LPARAM)DlgInfo.szServiceStatus); + SendDlgItemMessageW(hwndGenDlg, IDC_SERV_STATUS, WM_SETTEXT, 0, (LPARAM)DlgInfo.szServiceStatus); } + } @@ -148,18 +151,19 @@ * General Property dialog callback. * Controls messages to the General dialog */ -/* FIXME: this may be better as a modeless dialog */ INT_PTR CALLBACK GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { + hwndGenDlg = hwndDlg; switch (uMsg) { case WM_INITDIALOG: - GetDlgInfo(hwndDlg); + GetDlgInfo(); + break; case WM_COMMAND: @@ -207,12 +211,11 @@ * Dependancies Property dialog callback. * Controls messages to the Dependancies dialog */ -/* FIXME: this may be better as a modeless dialog */ INT_PTR CALLBACK DependanciesPageProc(HWND hwndDlg, - UINT uMsg, - WPARAM wParam, - LPARAM lParam) + UINT uMsg, + WPARAM wParam, + LPARAM lParam) { switch (uMsg) _____ Modified: trunk/reactos/base/system/servman/query.c --- trunk/reactos/base/system/servman/query.c 2006-01-30 18:44:22 UTC (rev 44) +++ trunk/reactos/base/system/servman/query.c 2006-01-30 18:48:10 UTC (rev 45) @@ -25,7 +25,7 @@ -ENUM_SERVICE_STATUS_PROCESS* +ENUM_SERVICE_STATUS_PROCESS* GetSelectedService(VOID) { ENUM_SERVICE_STATUS_PROCESS *pSelectedService = NULL; _____ Modified: trunk/reactos/base/system/servman/resource.h --- trunk/reactos/base/system/servman/resource.h 2006-01-30 18:44:22 UTC (rev 44) +++ trunk/reactos/base/system/servman/resource.h 2006-01-30 18:48:10 UTC (rev 45) @@ -96,10 +96,16 @@ #define IDC_CREATE_DESC 8004 #define IDC_CREATE_OPTIONS 8005 #define ID_CREATE_HELP 8006 +#define IDD_DLG_HELP_OPTIONS 8020 +#define IDC_CREATE_HELP 8021 +#define IDS_HELP_OPTIONS 8022 /* progress bar */ #define IDD_DLG_PROGRESS 7000 #define IDC_SERVCON_PROGRESS 7001 #define IDC_SERVCON_INFO 7002 #define IDC_SERVCON_NAME 7003 -#define IDS_PROGRESS_INFO 7004 +#define IDS_PROGRESS_INFO_START 7004 +#define IDS_PROGRESS_INFO_STOP 7005 + + _____ Modified: trunk/reactos/base/system/servman/servman.c --- trunk/reactos/base/system/servman/servman.c 2006-01-30 18:44:22 UTC (rev 44) +++ trunk/reactos/base/system/servman/servman.c 2006-01-30 18:48:10 UTC (rev 45) @@ -20,7 +20,9 @@ HMENU hShortcutMenu; INT SelectedItem; +extern HWND hwndGenDlg; + INT GetSelectedItem(VOID) { return SelectedItem; @@ -122,7 +124,7 @@ MessageBox(hwnd, _T("Could not create List View."), _T("Error"), MB_OK | MB_ICONERROR); ListView_SetExtendedListViewStyle(hListView, LVS_EX_FULLROWSELECT | - LVS_EX_GRIDLINES | LVS_EX_HEADERDRAGDROP); + /*LVS_EX_GRIDLINES |*/ LVS_EX_HEADERDRAGDROP); lvc.mask = LVCF_TEXT | LVCF_SUBITEM | LVCF_WIDTH | LVCF_FMT; lvc.fmt = LVCFMT_LEFT; @@ -277,6 +279,10 @@ lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_EXPORT); break; + case ID_NEW: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_NEW); + break; + case ID_START: lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_START); break; @@ -293,10 +299,6 @@ lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_RESTART); break; - case ID_NEW: - lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_NEW); - break; - case ID_HELP: lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_HELP); break; @@ -341,40 +343,49 @@ break; case ID_EXPORT: + ExportFile(hListView); break; + case ID_NEW: + DialogBox(hInstance, + MAKEINTRESOURCE(IDD_DLG_CREATE), + hMainWnd, + (DLGPROC)CreateDialogProc); + + break; + case ID_START: { - ENUM_SERVICE_STATUS_PROCESS *Service = NULL; - TCHAR buf1[100]; - TCHAR buf2[100]; - /* open the progress dialog */ - hProgDlg = CreateDialog(GetModuleHandle(NULL), - MAKEINTRESOURCE(IDD_DLG_PROGRESS), - hMainWnd, - (DLGPROC)ProgressDialogProc); - if (hProgDlg != NULL) + if ( DoStartService(hProgDlg) ) { - ShowWindow(hProgDlg, SW_SHOW); + ENUM_SERVICE_STATUS_PROCESS *Service = NULL; + LVITEM item; + TCHAR szStatus[64]; + TCHAR buf[25]; + TCHAR ProgDlgBuf[100]; - /* write the info to the progress dialog */ - LoadString(hInstance, IDS_PROGRESS_INFO, buf1, - sizeof(buf1) / sizeof(TCHAR)); - _sntprintf(buf2, 100, buf1, _T("start")); - SendDlgItemMessage(hProgDlg, IDC_SERVCON_INFO, WM_SETTEXT, 0, (LPARAM)buf2); + /* open the progress dialog */ + hProgDlg = CreateDialog(GetModuleHandle(NULL), + MAKEINTRESOURCE(IDD_DLG_PROGRESS), + hMainWnd, + (DLGPROC)ProgressDialogProc); + if (hProgDlg != NULL) + { + ShowWindow(hProgDlg, SW_SHOW); - /* get pointer to selected service */ - Service = GetSelectedService(); + /* write the info to the progress dialog */ + LoadString(hInstance, IDS_PROGRESS_INFO_START, ProgDlgBuf, + sizeof(ProgDlgBuf) / sizeof(TCHAR)); + SendDlgItemMessage(hProgDlg, IDC_SERVCON_INFO, WM_SETTEXT, + 0, (LPARAM)ProgDlgBuf); - /* write the service name to the progress dialog */ - SendDlgItemMessage(hProgDlg, IDC_SERVCON_NAME, WM_SETTEXT, 0, - (LPARAM)Service->lpServiceName); - } + /* get pointer to selected service */ + Service = GetSelectedService(); - if ( DoStartService(hProgDlg) ) - { - LVITEM item; - TCHAR szStatus[64]; + /* write the service name to the progress dialog */ + SendDlgItemMessage(hProgDlg, IDC_SERVCON_NAME, WM_SETTEXT, 0, + (LPARAM)Service->lpServiceName); + } LoadString(hInstance, IDS_SERVICES_STARTED, szStatus, sizeof(szStatus) / sizeof(TCHAR)); @@ -382,51 +393,72 @@ item.iItem = GetSelectedItem(); item.iSubItem = 2; SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + + /* change dialog status */ + if (hwndGenDlg) + { + LoadString(hInstance, IDS_SERVICES_STARTED, buf, + sizeof(buf) / sizeof(TCHAR)); + SendDlgItemMessageW(hwndGenDlg, IDC_SERV_STATUS, WM_SETTEXT, + 0, (LPARAM)buf); + } } SendMessage(hProgDlg, WM_DESTROY, 0, 0); + } break; case ID_STOP: { - ENUM_SERVICE_STATUS_PROCESS *Service = NULL; - TCHAR buf1[100]; - TCHAR buf2[100]; - /* open the progress dialog */ - hProgDlg = CreateDialog(GetModuleHandle(NULL), - MAKEINTRESOURCE(IDD_DLG_PROGRESS), - hMainWnd, - (DLGPROC)ProgressDialogProc); - if (hProgDlg != NULL) + if( Control(hProgDlg, SERVICE_CONTROL_STOP) ) { - ShowWindow(hProgDlg, SW_SHOW); + ENUM_SERVICE_STATUS_PROCESS *Service = NULL; + LVITEM item; + TCHAR buf[25]; + TCHAR ProgDlgBuf[100]; - /* write the info to the progress dialog */ - LoadString(hInstance, IDS_PROGRESS_INFO, buf1, - sizeof(buf1) / sizeof(TCHAR)); - _sntprintf(buf2, 100, buf1, _T("stop")); - SendDlgItemMessage(hProgDlg, IDC_SERVCON_INFO, WM_SETTEXT, 0, (LPARAM)buf2); + /* open the progress dialog */ + hProgDlg = CreateDialog(GetModuleHandle(NULL), + MAKEINTRESOURCE(IDD_DLG_PROGRESS), + hMainWnd, + (DLGPROC)ProgressDialogProc); + if (hProgDlg != NULL) + { + ShowWindow(hProgDlg, SW_SHOW); - /* get pointer to selected service */ - Service = GetSelectedService(); + /* write the info to the progress dialog */ + LoadString(hInstance, IDS_PROGRESS_INFO_STOP, ProgDlgBuf, + sizeof(ProgDlgBuf) / sizeof(TCHAR)); + SendDlgItemMessage(hProgDlg, IDC_SERVCON_INFO, + WM_SETTEXT, 0, (LPARAM)ProgDlgBuf); - /* write the service name to the progress dialog */ - SendDlgItemMessage(hProgDlg, IDC_SERVCON_NAME, WM_SETTEXT, 0, - (LPARAM)Service->lpServiceName); - } + /* get pointer to selected service */ + Service = GetSelectedService(); - if( Control(hProgDlg, SERVICE_CONTROL_STOP) ) - { - LVITEM item; + /* write the service name to the progress dialog */ + SendDlgItemMessage(hProgDlg, IDC_SERVCON_NAME, WM_SETTEXT, 0, + (LPARAM)Service->lpServiceName); + } + item.pszText = '\0'; item.iItem = GetSelectedItem(); item.iSubItem = 2; SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + + /* change dialog status */ + if (hwndGenDlg) + { + LoadString(hInstance, IDS_SERVICES_STOPPED, buf, + sizeof(buf) / sizeof(TCHAR)); + SendDlgItemMessageW(hwndGenDlg, IDC_SERV_STATUS, WM_SETTEXT, + 0, (LPARAM)buf); + } } SendMessage(hProgDlg, WM_DESTROY, 0, 0); + } break; @@ -443,9 +475,6 @@ SendMessage(hMainWnd, WM_COMMAND, 0, ID_START); break; - case ID_NEW: - break; - case ID_HELP: MessageBox(NULL, _T("Help is not yet implemented\n"), _T("Note!"), MB_OK | MB_ICONINFORMATION); _____ Modified: trunk/reactos/base/system/servman/servman.h --- trunk/reactos/base/system/servman/servman.h 2006-01-30 18:44:22 UTC (rev 44) +++ trunk/reactos/base/system/servman/servman.h 2006-01-30 18:48:10 UTC (rev 45) @@ -1,7 +1,7 @@ #ifndef __SERVMAN_H #define __SERVMAN_H -#define WIN32_LEAN_AND_MEAN +//#define WIN32_LEAN_AND_MEAN #include <windows.h> #include <windowsx.h> /* GET_X/Y_LPARAM */ #include <stdio.h> @@ -16,6 +16,7 @@ BOOL RefreshServiceList(VOID); BOOL CALLBACK AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +BOOL CALLBACK CreateDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); BOOL CALLBACK ProgressDialogProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam); BOOL DoStartService(HWND hProgDlg); @@ -36,5 +37,7 @@ DWORD GetServiceList(VOID); +VOID ExportFile(HWND hwnd); + #endif /* __SERVMAN_H */ _____ Modified: trunk/reactos/base/system/servman/start.c --- trunk/reactos/base/system/servman/start.c 2006-01-30 18:44:22 UTC (rev 44) +++ trunk/reactos/base/system/servman/start.c 2006-01-30 18:48:10 UTC (rev 45) @@ -99,7 +99,7 @@ GetError(0); return FALSE; } - + if (ServiceStatus.dwCheckPoint > dwOldCheckPoint) { /* The service is making progress. increment the progress bar */
18 years, 10 months
1
0
0
0
[mflyer] 44: ReactOS Package Manager (marked in audit list as [OK])
by mflyer@svn.reactos.org
ReactOS Package Manager (marked in audit list as [OK]) Requested by crashfourit Added: trunk/rosapps/ Added: trunk/rosapps/packmgr/ Added: trunk/rosapps/packmgr/cmd-line/ Added: trunk/rosapps/packmgr/cmd-line/main.c Added: trunk/rosapps/packmgr/cmd-line/main.h Added: trunk/rosapps/packmgr/cmd-line/ros-get.rc Added: trunk/rosapps/packmgr/cmd-line/rosget.rbuild Added: trunk/rosapps/packmgr/directory.rbuild Added: trunk/rosapps/packmgr/gui/ Added: trunk/rosapps/packmgr/gui/cz.rc Added: trunk/rosapps/packmgr/gui/de.rc Added: trunk/rosapps/packmgr/gui/en.rc Added: trunk/rosapps/packmgr/gui/es.rc Added: trunk/rosapps/packmgr/gui/generic.rc Added: trunk/rosapps/packmgr/gui/help.txt Added: trunk/rosapps/packmgr/gui/main.c Added: trunk/rosapps/packmgr/gui/main.h Added: trunk/rosapps/packmgr/gui/packmgr.rbuild Added: trunk/rosapps/packmgr/gui/packmgr.rc Added: trunk/rosapps/packmgr/gui/res/ Added: trunk/rosapps/packmgr/gui/res/blank.ico Added: trunk/rosapps/packmgr/gui/res/development.ico Added: trunk/rosapps/packmgr/gui/res/games.ico Added: trunk/rosapps/packmgr/gui/res/graphics.ico Added: trunk/rosapps/packmgr/gui/res/inet.ico Added: trunk/rosapps/packmgr/gui/res/install.ico Added: trunk/rosapps/packmgr/gui/res/installed.ico Added: trunk/rosapps/packmgr/gui/res/installsource.ico Added: trunk/rosapps/packmgr/gui/res/multimedia.ico Added: trunk/rosapps/packmgr/gui/res/office.ico Added: trunk/rosapps/packmgr/gui/res/others.ico Added: trunk/rosapps/packmgr/gui/res/packetmanager.ico Added: trunk/rosapps/packmgr/gui/res/toolbar.bmp Added: trunk/rosapps/packmgr/gui/res/tools.ico Added: trunk/rosapps/packmgr/gui/res/uninstall.ico Added: trunk/rosapps/packmgr/gui/res/update.ico Added: trunk/rosapps/packmgr/gui/resource.h Added: trunk/rosapps/packmgr/lib/ Added: trunk/rosapps/packmgr/lib/cz.rc Added: trunk/rosapps/packmgr/lib/de.rc Added: trunk/rosapps/packmgr/lib/download.cpp Added: trunk/rosapps/packmgr/lib/en.rc Added: trunk/rosapps/packmgr/lib/error.h Added: trunk/rosapps/packmgr/lib/es.rc Added: trunk/rosapps/packmgr/lib/expat.h Added: trunk/rosapps/packmgr/lib/functions.cpp Added: trunk/rosapps/packmgr/lib/log.cpp Added: trunk/rosapps/packmgr/lib/log.h Added: trunk/rosapps/packmgr/lib/main.cpp Added: trunk/rosapps/packmgr/lib/options.cpp Added: trunk/rosapps/packmgr/lib/options.xml Added: trunk/rosapps/packmgr/lib/package.cpp Added: trunk/rosapps/packmgr/lib/package.def Added: trunk/rosapps/packmgr/lib/package.h Added: trunk/rosapps/packmgr/lib/package.hpp Added: trunk/rosapps/packmgr/lib/package.rbuild Added: trunk/rosapps/packmgr/lib/package.rc Added: trunk/rosapps/packmgr/lib/script.cpp Added: trunk/rosapps/packmgr/lib/script.h Added: trunk/rosapps/packmgr/lib/tree.cpp Added: trunk/rosapps/packmgr/tree/ Added: trunk/rosapps/packmgr/tree/7zip.inst.rps Added: trunk/rosapps/packmgr/tree/7zip.xml Added: trunk/rosapps/packmgr/tree/abiword.inst.rps Added: trunk/rosapps/packmgr/tree/abiword.xml Added: trunk/rosapps/packmgr/tree/firefox.inst.rps Added: trunk/rosapps/packmgr/tree/firefox.xml Added: trunk/rosapps/packmgr/tree/irfanview.inst.rps Added: trunk/rosapps/packmgr/tree/irfanview.xml Added: trunk/rosapps/packmgr/tree/mplayer.inst.rps Added: trunk/rosapps/packmgr/tree/mplayer.xml Added: trunk/rosapps/packmgr/tree/openoffice.inst.rps Added: trunk/rosapps/packmgr/tree/openoffice.xml Added: trunk/rosapps/packmgr/tree/putty.inst.rps Added: trunk/rosapps/packmgr/tree/putty.xml Added: trunk/rosapps/packmgr/tree/rosbe.inst.rps Added: trunk/rosapps/packmgr/tree/rosbe.xml Added: trunk/rosapps/packmgr/tree/tiny.inst.rps Added: trunk/rosapps/packmgr/tree/tiny.xml Added: trunk/rosapps/packmgr/tree/tree.xml Added: trunk/rosapps/packmgr/tree/tree_bare.xml Added: trunk/rosapps/packmgr/tree/tree_withsubs.xml Added: trunk/rosapps/packmgr/tree/tuxpaint.inst.rps Added: trunk/rosapps/packmgr/tree/tuxpaint.xml _____ Added: trunk/rosapps/packmgr/cmd-line/main.c --- trunk/rosapps/packmgr/cmd-line/main.c 2006-01-30 08:00:33 UTC (rev 43) +++ trunk/rosapps/packmgr/cmd-line/main.c 2006-01-30 18:44:22 UTC (rev 44) @@ -0,0 +1,211 @@ +//////////////////////////////////////////////////////// +// +// main.cpp +// +// Implementation of a Commandlne Interface +// for the ReactOs Package Manager +// +// Maarten Bosma, 09.01.2004 +// maarten.paul(a)bosma.de +// +//////////////////////////////////////////////////////////////////// + +#include "main.h" +#include <stdio.h> + + +int main (int argc, char **argv) +{ + wprintf(L"ReactOs PackageManager %d.%d.%d Commandline Interface \n\n", PACKMGR_VERSION_MAJOR, PACKMGR_VERSION_MINOR, PACKMGR_VERSION_PATCH_LEVEL); + Argv = argv; Argc = argc; + + if(argc<2) + return Help(); + + // install a package + if (!strcmp(argv[1], "install")) + Install(); + + // install a package from source + else if (!strcmp(argv[1], "src-inst")) + { + wprintf(L"Sorry but I can't do that yet. \n"); + } + + // update a package + else if (!strcmp(argv[1], "update")) + { + wprintf(L"Sorry but I can't do that yet. \n"); + } + + // update everything + else if (!strcmp(argv[1], "dist-upgrade")) + { + wprintf(L"Sorry but I can't do that yet. \n"); + } + + // remove a package + else if (!strcmp(argv[1], "remove")) + { + wprintf(L"Sorry but I can't do that yet. \n"); + } + + // search for a package + else if (!strcmp(argv[1], "show")) + { + Show(); + } + + // search for a package + else if (!strcmp(argv[1], "search")) + { + wprintf(L"Sorry but I can't do that yet. \n"); + } + + else + Help(); + + // + wprintf(L"\n"); + + + return 0; +} + +int Help (void) +{ + wprintf(L"Usage: ros-get [command] \n\n"); + + wprintf(L"Possible commands: \n"); + wprintf(L" install [package name] \t Installs a package \n\n"); + wprintf(L" show [package name] \t\t Shows you detailed information about a package \n"); + + wprintf(L"Currently unimplemented commands: \n"); + wprintf(L" src-install [package name] \t Installs a package from source code \n"); + wprintf(L" update [package name] \t Updates a package \n"); + wprintf(L" dist-update [package name] \t Updates a package \n"); + wprintf(L" remove [package name] \t Uninstalls a package \n\n"); + + wprintf(L" search [search agrument] \t Finds a package \n"); + wprintf(L" list \t\t\t\t Lists all installed programs \n"); + + return 0; +} + +int Ask (const WCHAR* question) +{ + // ask the user + wprintf(L"%s [y/n] ", question); + char answer = getchar(); + + // clear keybuffer + while(getchar()!='\n'); + wprintf(L"\n"); + + // prozess answer + if (answer == 'y') + return 1; + + else if (answer == 'n') + return 0; + + return Ask(question); +} + +int SetStatus (int status1, int status2, WCHAR* text) +{ + WCHAR errbuf[2000]; + if(text) + wprintf(L"%s\n", text); + + // If the Status is 1000 things are done + if(status1==1000) + { + wprintf(L"%s\n", PML_TransError(status2, errbuf, sizeof(errbuf)/sizeof(WCHAR))); + done = TRUE; + } + + return 0; +} + +int Install (void) +{ + pTree tree; + int i, error; + WCHAR errbuf[2000]; + + // load the tree + error = PML_LoadTree (&tree, "tree.xml", NULL); + if(error) + { + + wprintf(PML_TransError(error, errbuf, sizeof(errbuf)/sizeof(WCHAR))); + return 0; + } + + // look up the item + for (i=2; i<Argc; i++) + { + int id = PML_FindItem(tree, Argv[i]); + + if(id) + { + PML_LoadPackage(tree, id, NULL); + PML_SetAction(tree, id, 1, NULL, Ask); + } + + else + printf("Could not find the Package \"%s\"\n", Argv[i]); + } + + // do it + error = PML_DoIt (tree, SetStatus, Ask); + if(error) + { + + wprintf(PML_TransError(error, errbuf, sizeof(errbuf)/sizeof(WCHAR))); + PML_CloseTree (tree); + return 0; + } + + // wait + while (!done) + Sleep(1000); + + // clean up + PML_CloseTree (tree); + + return 0; +} + +int Show (void) +{ + pTree tree; + int i, error; + WCHAR errbuf[2000]; + + // load the tree + error = PML_LoadTree (&tree, "tree_bare.xml", NULL); + if(error) + { + wprintf(PML_TransError(error, errbuf, sizeof(errbuf)/sizeof(WCHAR))); + return 0; + } + + // look up the item + for (i=2; i<Argc; i++) + { + int id = PML_FindItem(tree, Argv[i]); + + if(id) + printf(PML_GetDescription(tree, id)); + + else + printf("Could not find the Package \"%s\"\n", Argv[i]); + } + + // clean up + PML_CloseTree (tree); + + return 0; +} _____ Added: trunk/rosapps/packmgr/cmd-line/main.h --- trunk/rosapps/packmgr/cmd-line/main.h 2006-01-30 08:00:33 UTC (rev 43) +++ trunk/rosapps/packmgr/cmd-line/main.h 2006-01-30 18:44:22 UTC (rev 44) @@ -0,0 +1,17 @@ +/////////////////////////////////////////////////// +// +// main.h +// main.cpp's lumber room :) +/////////////////////////////////////////////////// + +#include <package.h> + +int Argc; +char **Argv; +BOOL done = FALSE; + +int Help (void); +int Install (void); +int Show (void); + +int SetStatus (int status1, int status2, WCHAR* text); _____ Added: trunk/rosapps/packmgr/cmd-line/ros-get.rc --- trunk/rosapps/packmgr/cmd-line/ros-get.rc 2006-01-30 08:00:33 UTC (rev 43) +++ trunk/rosapps/packmgr/cmd-line/ros-get.rc 2006-01-30 18:44:22 UTC (rev 44) @@ -0,0 +1,8 @@ + +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Package Manager - Cmdline Interface\0" +#define REACTOS_STR_INTERNAL_NAME "ros-get\0" +#define REACTOS_STR_ORIGINAL_FILENAME "ros-get.exe\0" + +#include <reactos/version.rc> + +/* EOF */ _____ Added: trunk/rosapps/packmgr/cmd-line/rosget.rbuild --- trunk/rosapps/packmgr/cmd-line/rosget.rbuild 2006-01-30 08:00:33 UTC (rev 43) +++ trunk/rosapps/packmgr/cmd-line/rosget.rbuild 2006-01-30 18:44:22 UTC (rev 44) @@ -0,0 +1,12 @@ +<module name="rosget" type="win32cui" installbase="system32" installname="rosget.exe"> + <include base="package">.</include> + <define name="__USE_W32API" /> + <define name="UNICODE" /> + <define name="_WIN32_IE">0x0501</define> + <define name="_WIN32_WINNT">0x0501</define> + + <library>kernel32</library> + <library>package</library> + <file>main.c</file> + <file>ros-get.rc</file> +</module> _____ Added: trunk/rosapps/packmgr/directory.rbuild --- trunk/rosapps/packmgr/directory.rbuild 2006-01-30 08:00:33 UTC (rev 43) +++ trunk/rosapps/packmgr/directory.rbuild 2006-01-30 18:44:22 UTC (rev 44) @@ -0,0 +1,9 @@ +<directory name="cmd-line"> + <xi:include href="cmd-line/rosget.rbuild" /> +</directory> +<directory name="gui"> + <xi:include href="gui/packmgr.rbuild" /> +</directory> +<directory name="lib"> + <xi:include href="lib/package.rbuild" /> +</directory> \ No newline at end of file _____ Added: trunk/rosapps/packmgr/gui/cz.rc --- trunk/rosapps/packmgr/gui/cz.rc 2006-01-30 08:00:33 UTC (rev 43) +++ trunk/rosapps/packmgr/gui/cz.rc 2006-01-30 18:44:22 UTC (rev 44) @@ -0,0 +1,43 @@ + +LANGUAGE LANG_CZECH, SUBLANG_DEFAULT + +/* Dialogs */ +IDD_OPTIONS DIALOG DISCARDABLE 0, 0, 180, 200 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "NastavenÝ" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "ZatÝm zde nejsou ×ßdnÚ mo×nosti.", 0, 50, 95, 80, 8 +END + +IDD_DOIT DIALOG DISCARDABLE 0, 0, 180, 100 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "ProvßdÝm operace" +FONT 8, "MS Sans Serif" +BEGIN + + CTEXT "{Status}", IDC_TSTATUS, 0, 10, 180, 8 + + CONTROL "", IDC_STATUS1, "msctls_progress32", PBS_SMOOTH, 20, 25, 140, 15 + + CONTROL "", IDC_STATUS2, "msctls_progress32", PBS_SMOOTH, 20, 45, 140, 15 + + PUSHBUTTON "ZruÜit", IDC_CANCEL, 65, 70, 50, 14, WS_DISABLED +END + +IDR_POPUP MENU DISCARDABLE +BEGIN + POPUP "PopUp", MENUBARBREAK + BEGIN + MENUITEM "Äßdnß akce", 1, GRAYED + MENUITEM "Instalovat (doporuÞeno)", 2, GRAYED + MENUITEM "Instalovat ze zdrojov²ch k¾d¨", 3, GRAYED + MENUITEM "Aktualizovat", 4, GRAYED + MENUITEM "Odinstalovat", 5, GRAYED + MENUITEM SEPARATOR + MENUITEM "NastavenÝ", 8 + MENUITEM SEPARATOR + MENUITEM "ProvÚst", 6 + END +END + _____ Added: trunk/rosapps/packmgr/gui/de.rc --- trunk/rosapps/packmgr/gui/de.rc 2006-01-30 08:00:33 UTC (rev 43) +++ trunk/rosapps/packmgr/gui/de.rc 2006-01-30 18:44:22 UTC (rev 44) @@ -0,0 +1,43 @@ + +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN + +/* Dialogs */ +IDD_OPTIONS DIALOG DISCARDABLE 0, 0, 180, 200 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Optionen" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "Leider gibt es noch keine Optionen.", 0, 50, 95, 80, 8 +END + +IDD_DOIT DIALOG DISCARDABLE 0, 0, 180, 100 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Performing Operations" +FONT 8, "MS Sans Serif" +BEGIN + + CTEXT "{Status}", IDC_TSTATUS, 0, 10, 180, 8 + + CONTROL "", IDC_STATUS1, "msctls_progress32", PBS_SMOOTH, 20, 25, 140, 15 + + CONTROL "", IDC_STATUS2, "msctls_progress32", PBS_SMOOTH, 20, 45, 140, 15 + + PUSHBUTTON "Abort", IDC_CANCEL, 65, 70, 50, 14, WS_DISABLED +END + +IDR_POPUP MENU DISCARDABLE +BEGIN + POPUP "PopUp", MENUBARBREAK + BEGIN + MENUITEM "Keine Action", 1, GRAYED + MENUITEM "Intallieren (empfohlen)", 2, GRAYED + MENUITEM "Intallieren vom Quellcode", 3, GRAYED + MENUITEM "Aktualisieren", 4, GRAYED + MENUITEM "Deinstallieren", 5, GRAYED + MENUITEM SEPARATOR + MENUITEM "Optionen", 8 + MENUITEM SEPARATOR + MENUITEM "DoIt", 6 + END +END + _____ Added: trunk/rosapps/packmgr/gui/en.rc --- trunk/rosapps/packmgr/gui/en.rc 2006-01-30 08:00:33 UTC (rev 43) +++ trunk/rosapps/packmgr/gui/en.rc 2006-01-30 18:44:22 UTC (rev 44) @@ -0,0 +1,43 @@ + +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +/* Dialogs */ +IDD_OPTIONS DIALOG DISCARDABLE 0, 0, 180, 200 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Options" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "There are no options yet.", 0, 50, 95, 80, 8 +END + +IDD_DOIT DIALOG DISCARDABLE 0, 0, 180, 100 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Performing Operations" +FONT 8, "MS Sans Serif" +BEGIN + + CTEXT "{Status}", IDC_TSTATUS, 0, 10, 180, 8 + + CONTROL "", IDC_STATUS1, "msctls_progress32", PBS_SMOOTH, 20, 25, 140, 15 + + CONTROL "", IDC_STATUS2, "msctls_progress32", PBS_SMOOTH, 20, 45, 140, 15 + + PUSHBUTTON "Abort", IDC_CANCEL, 65, 70, 50, 14, WS_DISABLED +END + +IDR_POPUP MENU DISCARDABLE +BEGIN + POPUP "PopUp", MENUBARBREAK + BEGIN + MENUITEM "No Action", 1, GRAYED + MENUITEM "Install (recommended)", 2, GRAYED + MENUITEM "Install from Source", 3, GRAYED + MENUITEM "Update", 4, GRAYED + MENUITEM "Uninstall", 5, GRAYED + MENUITEM SEPARATOR + MENUITEM "Options", 8 + MENUITEM SEPARATOR + MENUITEM "DoIt", 6 + END +END + _____ Added: trunk/rosapps/packmgr/gui/es.rc --- trunk/rosapps/packmgr/gui/es.rc 2006-01-30 08:00:33 UTC (rev 43) +++ trunk/rosapps/packmgr/gui/es.rc 2006-01-30 18:44:22 UTC (rev 44) @@ -0,0 +1,43 @@ + +LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL + +/* Dialogs */ +IDD_OPTIONS DIALOG DISCARDABLE 0, 0, 180, 200 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Opciones" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "A·n no hay opciones disponibles.", 0, 50, 95, 80, 8 +END + +IDD_DOIT DIALOG DISCARDABLE 0, 0, 180, 100 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Realizando las operaciones" +FONT 8, "MS Sans Serif" +BEGIN + + CTEXT "{Status}", IDC_TSTATUS, 0, 10, 180, 8 + + CONTROL "", IDC_STATUS1, "msctls_progress32", PBS_SMOOTH, 20, 25, 140, 15 + + CONTROL "", IDC_STATUS2, "msctls_progress32", PBS_SMOOTH, 20, 45, 140, 15 + + PUSHBUTTON "Abort", IDC_CANCEL, 65, 70, 50, 14, WS_DISABLED +END + +IDR_POPUP MENU DISCARDABLE +BEGIN + POPUP "PopUp", MENUBARBREAK + BEGIN + MENUITEM "Ninguna acci¾n", 1, GRAYED + MENUITEM "Instalar (recomendado)", 2, GRAYED + MENUITEM "Instalar desde el c¾digo fuente", 3, GRAYED + MENUITEM "Actualizar", 4, GRAYED + MENUITEM "Desinstalar", 5, GRAYED + MENUITEM SEPARATOR + MENUITEM "Opciones", 8 + MENUITEM SEPARATOR + MENUITEM "íHazlo!", 6 + END +END + _____ Added: trunk/rosapps/packmgr/gui/generic.rc --- trunk/rosapps/packmgr/gui/generic.rc 2006-01-30 08:00:33 UTC (rev 43) +++ trunk/rosapps/packmgr/gui/generic.rc 2006-01-30 18:44:22 UTC (rev 44) @@ -0,0 +1,34 @@ + +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL + +IDI_MAIN ICON DISCARDABLE "res/packetmanager.ico" +IDB_TOOLBAR BITMAP DISCARDABLE "res/toolbar.bmp" + +/* TreeIcons - Categories */ +1 ICON DISCARDABLE "res/blank.ico" +2 ICON DISCARDABLE "res/inet.ico" +3 ICON DISCARDABLE "res/office.ico" +4 ICON DISCARDABLE "res/graphics.ico" +5 ICON DISCARDABLE "res/multimedia.ico" +6 ICON DISCARDABLE "res/development.ico" +7 ICON DISCARDABLE "res/games.ico" +8 ICON DISCARDABLE "res/tools.ico" +9 ICON DISCARDABLE "res/others.ico" +10 ICON DISCARDABLE "res/installed.ico" + +/* TreeIcons - Actions */ +11 ICON DISCARDABLE "res/install.ico" +12 ICON DISCARDABLE "res/installsource.ico" +13 ICON DISCARDABLE "res/update.ico" +14 ICON DISCARDABLE "res/uninstall.ico" + +/* HotKeys */ + +IDR_HOTKEYS ACCELERATORS DISCARDABLE +BEGIN + "1", 2, VIRTKEY, CONTROL + "2", 3, VIRTKEY, CONTROL + "3", 4, VIRTKEY, CONTROL + "4", 5, VIRTKEY, CONTROL + "0", 1, VIRTKEY, CONTROL +END _____ Added: trunk/rosapps/packmgr/gui/help.txt --- trunk/rosapps/packmgr/gui/help.txt 2006-01-30 08:00:33 UTC (rev 43) +++ trunk/rosapps/packmgr/gui/help.txt 2006-01-30 18:44:22 UTC (rev 44) @@ -0,0 +1,8 @@ +Welcome to ReactOS's Package Manager ! + +WARNING: This is still pre-alfa software you can't do much with it yet. + +This is the online help. You can show it at any time by clicking on the the Questionmark Icon above. + +You can use this package manager like this: click on the +You can also use the Buttons [ctrl] + [0] to [4] to set the action. \ No newline at end of file _____ Added: trunk/rosapps/packmgr/gui/main.c --- trunk/rosapps/packmgr/gui/main.c 2006-01-30 08:00:33 UTC (rev 43) +++ trunk/rosapps/packmgr/gui/main.c 2006-01-30 18:44:22 UTC (rev 44) @@ -0,0 +1,453 @@ +//////////////////////////////////////////////////////// +// +// main.cpp +// +// Implementation of the Package Manager GUI +// +// +// Maarten Bosma, 09.01.2004 +// maarten.paul(a)bosma.de +// +//////////////////////////////////////////////////////////////////// + +#include "main.h" + +// This is the struct where the toolbar is defined +const TBBUTTON Buttons [] = +{ + {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP}, + + {0, 1, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON}, // No Action + {1, 2, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON}, // Install + {2, 3, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON}, // Install from source + {3, 4, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON}, // Update + {4, 5, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON}, // Unistall + + {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP}, + {5, 6, TBSTATE_ENABLED, TBSTYLE_BUTTON}, // DoIt (tm) + {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP}, + + {6, 7, TBSTATE_ENABLED, TBSTYLE_BUTTON}, // Help + {7, 8, TBSTATE_ENABLED, TBSTYLE_BUTTON}, // Options + + {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP}, +}; + + +// Application's Entry Point +int WINAPI WinMain (HINSTANCE hinst, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) +{ + HWND hwnd; + MSG msg; + WNDCLASSEX wc = {0}; + WCHAR errbuf[2000]; + + // Window creation + wc.cbSize = sizeof(WNDCLASSEX); + wc.lpszClassName = L"pgkmgr"; + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.lpfnWndProc = (WNDPROC)WndProc; + wc.hInstance = hinst; + wc.hIcon = LoadIcon(hinst, MAKEINTRESOURCE(IDI_MAIN)); + wc.hbrBackground = (HBRUSH)(COLOR_SCROLLBAR); + + RegisterClassEx(&wc); + + hwnd = CreateWindow(L"pgkmgr", + L"ReactOS - Package Manager v0.3", + WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, + CW_USEDEFAULT, + 500, 600, + NULL, NULL, + hinst, + NULL); + + + // Toolbar creation + InitCommonControls(); + + hTBar = CreateToolbarEx(hwnd, WS_CHILD|WS_VISIBLE|TBSTYLE_FLAT, 0, 8, hinst, IDB_TOOLBAR, + Buttons, sizeof(Buttons)/sizeof(TBBUTTON), TBSIZE, TBSIZE, TBSIZE, TBSIZE, sizeof(TBBUTTON)); + + // Show the windows + ShowWindow(hwnd, SW_SHOW); + UpdateWindow(hwnd); + + // Load the tree + int error = PML_LoadTree(&tree, "tree_bare.xml", AddItem); + + if(error) + { + MessageBox(0,PML_TransError(error, errbuf, sizeof(errbuf)/sizeof(WCHAR)),0,0); + return 0; + } + + // Read the help + Help(); + + // Start getting messages + while(GetMessage(&msg,NULL,0,0)) + { + if(!TranslateAccelerator(hwnd, hHotKeys, &msg)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } + + // Close our handle + PML_CloseTree (tree); + + return 0; +} + +// Add a item to our tree +int AddItem (int id, const char* name, int parent, int icon) +{ + TV_INSERTSTRUCT tvins; + + tvins.item.lParam = (UINT)id; + tvins.item.mask = TVIF_TEXT|TVIF_PARAM; + tvins.item.pszText = (WCHAR*)name; //that is ok + tvins.item.cchTextMax = strlen(name); + tvins.hInsertAfter = TVI_LAST; + + if(icon) + { + tvins.item.iImage = icon; + tvins.item.iSelectedImage = icon; + tvins.item.mask |= TVIF_IMAGE | TVIF_SELECTEDIMAGE; + } + + if (parent==0) + tvins.hParent = TVI_ROOT; + else + tvins.hParent = nodes[parent]; + + nodes[id] = (HTREEITEM)SendMessage(hTree, TVM_INSERTITEMA, 0, (LPARAM)&tvins); + + return 0; +} + +// Load the Help from file and display it +void Help (void) +{ + int i; + char buffer [2000]; + FILE* file = fopen ("help.txt", "r"); + + if(!file) + return; + + for(i=0; i<2000; i++) + { + buffer[i] = getc(file); + if(buffer[i]==EOF) break; + } + buffer[i] = 0; + + SetText(buffer); +} + +// Create our Controls +void InitControls (HWND hwnd) +{ + + HINSTANCE hinst = GetModuleHandle(NULL); + WCHAR errbuf[2000]; + + // Create the controls + hTree = CreateWindowEx(0, WC_TREEVIEW, L"TreeView", WS_CHILD|WS_VISIBLE|WS_BORDER|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTON S, + 0, 0, 0, 0, hwnd, NULL, hinst, NULL); + + hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, L"edit", PML_TransError(IDS_LOAD, errbuf, sizeof(errbuf)/sizeof(WCHAR)), WS_CHILD|WS_VISIBLE|ES_MULTILINE, + 0, 0, 100, 100, hwnd, NULL, hinst, NULL); + + hPopup = LoadMenu(hinst, MAKEINTRESOURCE(IDR_POPUP)); + + // Create Tree Icons + HIMAGELIST hIcon = ImageList_Create(16, 16, ILC_MASK|ILC_COLOR32, 1, 1); + SendMessage(hTree, TVM_SETIMAGELIST, TVSIL_NORMAL, (LPARAM)(HIMAGELIST)hIcon); + + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(1))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(11))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(12))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(13))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(14))); + + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(2))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(3))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(4))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(5))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(6))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(7))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(8))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(9))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(10))); + + // Setup Hotkeys + hHotKeys = LoadAccelerators (hinst, MAKEINTRESOURCE(IDR_HOTKEYS)); +} + +// Set the Icons +int SetIcon (int id, int icon) +{ + TVITEMEX item; + + item.hItem = nodes[id]; + item.iImage = icon; + item.iSelectedImage = icon; + item.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE; + + TreeView_SetItem(hTree, &item); + + return 1; +} + +// Set the Icons +int Ask (const WCHAR* message) +{ + int ans = MessageBox (0,message,0,MB_YESNO); + + if(ans == IDYES) + return 1; + + return 0; +} + +// En- or Disable a Button inside of the toolbar and the Context Menu +int SetButton (DWORD id, BOOL state) +{ + // Change the Toorbar Button + TBBUTTONINFO ti; + + ti.cbSize = sizeof (ti); + ti.dwMask = TBIF_STATE; + + if(state) + ti.fsState = TBSTATE_ENABLED; + else + ti.fsState = TBSTATE_INDETERMINATE; + + SendMessage (hTBar, TB_SETBUTTONINFO, id, (LPARAM)&ti); + + // Change the Context Menu item + MENUITEMINFO mi; + + mi.cbSize = sizeof (mi); + mi.fMask = MIIM_STATE; + + if(state) + mi.fState = MFS_ENABLED; + + else + mi.fState = MFS_GRAYED; + + SetMenuItemInfo(hPopup, id, FALSE, &mi); + + return 0; +} + +// Set the text of the text box +int SetText (const char* text) +{ + int i, j; + char buffer [2000]; + + if(!text) + return 1; + + // the windows does not need "\n" + // for new lines but "\r\n" + for(i=0,j=0; text[i]; i++,j++) + { + buffer[j] = text[i]; + if(buffer[j] == '\n') + { + buffer[j] = '\r'; + buffer[++j] = '\n'; + } + } + buffer[j] = 0; + + SetWindowTextA(hEdit, buffer); + + return 0; +} + +// Windows Message Callback (this is where most things happen) +LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + // at the very beginning ... + case WM_CREATE: + { + InitControls(hwnd); + } + break; + + // calculate the size of the controls + case WM_SIZE: + { + RECT rcl; + SendMessage(hTBar, TB_AUTOSIZE, 0L, 0L); + GetWindowRect(hTBar, &rcl); + + int win_top = rcl.bottom - rcl.top; + int win_hight = HIWORD(lParam) - win_top; + + MoveWindow(hTree, 0, win_top, LOWORD(lParam), splitter_pos*win_hight/100, TRUE); + MoveWindow(hEdit, 0, (splitter_pos*win_hight/100)+win_top, LOWORD(lParam), win_hight, TRUE); + } + break; + + // for the treeview + case WM_NOTIFY: + { + if(((LPNMHDR)lParam)->code == TVN_SELCHANGED) + { + selected = ((LPNMTREEVIEW)lParam)->itemNew.lParam; + PML_LoadPackage (tree, selected, SetButton); + SetText(PML_GetDescription (tree, selected)); + } + + else if ((int)(((LPNMHDR)lParam)->code) == NM_RCLICK) // <= aarrggg LISP + { + // which item has been click on + HTREEITEM item = TreeView_GetDropHilight(hTree); + + if(item != NULL) + { + // mark the one as seleacted + SendMessage (hTree, TVM_SELECTITEM, TVGN_CARET, (LPARAM)item); + TreeView_EnsureVisible (hTree, item); + } + + // create the context menu + if(selected != 0) + { + POINT pt; + GetCursorPos (&pt); + TrackPopupMenu (GetSubMenu(hPopup, 0), 0, (UINT)pt.x, (UINT)pt.y, 0, hwnd, NULL); + } + } + } + break; + + // for the toolbar + case WM_COMMAND: + { + // All Actions + if(LOWORD(wParam) <= 5 && LOWORD(wParam) >= 1) + { + if(selected) + if(PML_SetAction(tree, selected, LOWORD(wParam)-1, SetIcon, Ask) == ERR_OK) + break; + + MessageBeep(MB_ICONHAND); + } + + // DoIt + else if(LOWORD(wParam)==6) + { + if(PML_DoIt(tree, SetStatus, Ask) == ERR_OK) + DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_DOIT), hwnd, StatusProc); + else + MessageBeep(MB_ICONHAND); + } + + // Help + else if(LOWORD(wParam)==7) + Help(); + + // Options + else if(LOWORD(wParam)==8) + DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_OPTIONS), hwnd, OptionsProc); + } + break; + + // prozess hotkeys + case WM_HOTKEY: + { + if(PML_SetAction(tree, selected, wParam, SetIcon, Ask) != ERR_OK) + MessageBeep(MB_ICONHAND); + } + break; + + // ... at the very end + case WM_DESTROY: + { + PostQuitMessage(0); + return 0; + } + } + + return DefWindowProc (hwnd, message, wParam, lParam); +} + +// Warning: This function is called from another thread +int SetStatus (int status1, int status2, WCHAR* text) +{ + WCHAR errbuf[2000]; + + // Set the Rage to 1000 + SendMessage(GetDlgItem(hStatus, IDC_STATUS1), PBM_SETRANGE32, 0, 1000); + SendMessage(GetDlgItem(hStatus, IDC_STATUS2), PBM_SETRANGE32, 0, 1000); + + // The prozessbars and the text filds + if(text) + SetDlgItemText(hStatus, IDC_TSTATUS, text); + + if(status1!=-1) + SendMessage(GetDlgItem(hStatus, IDC_STATUS1), PBM_SETPOS, status1, 0); + + if(status2!=-1) + SendMessage(GetDlgItem(hStatus, IDC_STATUS2), PBM_SETPOS, status2, 0); + + // If the Status is 1000 everything is done + if(status1==1000) + { + EndDialog(hStatus, TRUE); + MessageBox(0,PML_TransError(status2, errbuf, sizeof(errbuf)/sizeof(WCHAR)),0,0); + } + + return 0; +} + +// Callback for the Status Dialog +INT_PTR CALLBACK StatusProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) + { + case WM_INITDIALOG: + { + hStatus = hwnd; + + } break; + + case WM_COMMAND: // can only be the about button + case WM_CLOSE: // the close-window-[x] + { + PML_Abort(); + EndDialog(hwnd, TRUE); + return 0; + } + } + + return 0; +} + +// Callback for the Options Dialog +INT_PTR CALLBACK OptionsProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) + { + case WM_CLOSE: + EndDialog(hwnd, TRUE); + return 0; + } + + return 0; +} _____ Added: trunk/rosapps/packmgr/gui/main.h --- trunk/rosapps/packmgr/gui/main.h 2006-01-30 08:00:33 UTC (rev 43) +++ trunk/rosapps/packmgr/gui/main.h 2006-01-30 18:44:22 UTC (rev 44) @@ -0,0 +1,45 @@ +/////////////////////////////////////////////////// +// +// main.h +// main.cpp's lumber room :) +/////////////////////////////////////////////////// + +#include <windows.h> +#include <commctrl.h> +#include <stdio.h> [truncated at 1000 lines; 3555 more skipped]
18 years, 10 months
1
0
0
0
[martinf] 43: set svn:eol-style for Makefiles
by martinf@svn.reactos.org
set svn:eol-style for Makefiles Modified: branches/lean-explorer/Make-rosshell-MinGW Modified: branches/lean-explorer/Make-rosshell.mak _____ Modified: branches/lean-explorer/Make-rosshell-MinGW --- branches/lean-explorer/Make-rosshell-MinGW 2006-01-30 08:00:18 UTC (rev 42) +++ branches/lean-explorer/Make-rosshell-MinGW 2006-01-30 08:00:33 UTC (rev 43) @@ -1,82 +1,82 @@ -# -# ReactOS lean shell -# -# Make-rosshell.MinGW -# -# MinGW Makefile with precompiled header support -# - -CC = gcc -CXX = g++ -LINK = g++ - -CFLAGS = -DWIN32 -DROSSHELL -D_WIN32_IE=0x0501 -D_WIN32_WINNT=0x0501 -fexceptions -Wall -I. -RCFLAGS = -DWIN32 -DROSSHELL -D__WINDRES__ -LFLAGS = -Wl,--subsystem,windows - -ifdef DEBUG -CFLAGS += -D_DEBUG -g -RCFLAGS += -D_DEBUG -LFLAGS += -g -else -CFLAGS += -DNDEBUG -Os -D_NO_CONTEXT -RCFLAGS += -DNDEBUG -LFLAGS += -s -endif - -ifndef UNICODE -UNICODE = 1 -endif - -ifeq ($(UNICODE),1) -CFLAGS += -DUNICODE -# LFLAGS+= -Wl,--entry,_wWinMain@16 -endif - -CXXFLAGS = $(CFLAGS) - -EXEC_SUFFIX = .exe -RES_SUFFIX = .coff - -VPATH = shell utility taskbar desktop dialogs - -PROGRAM = rosshell - -TARGET = $(PROGRAM)$(EXEC_SUFFIX) - -OBJECTS = \ - startup.o \ - shellclasses.o \ - utility.o \ - window.o \ - dragdropimpl.o \ - shellbrowserimpl.o \ - explorer.o \ - entries.o \ - shellfs.o \ - desktop.o \ - desktopbar.o \ - taskbar.o \ - startmenu.o \ - traynotify.o \ - quicklaunch.o \ - settings.o - -LIBS = gdi32 comctl32 ole32 uuid - -all: precomp.h.gch $(TARGET) - -precomp.h.gch: *.h utility/*.h shell/*.h desktop/*.h - $(CXX) $(CFLAGS) precomp.h - -$(TARGET): $(OBJECTS) $(PROGRAM)$(RES_SUFFIX) - $(LINK) $(LFLAGS) -o $@ $^ $(addprefix -l,$(LIBS)) - -$(PROGRAM)$(RES_SUFFIX): explorer_intres.rc res/*.bmp res/*.ico - windres $(RCFLAGS) -o $@ explorer_intres.rc - -clean: - rm -f $(TARGET) $(OBJECTS) $(PROGRAM)$(RES_SUFFIX) precomp.h.gch \ - desktop/*.o dialogs/*.o shell/*.o taskbar/*.o utility/*.o - -ever: +# +# ReactOS lean shell +# +# Make-rosshell.MinGW +# +# MinGW Makefile with precompiled header support +# + +CC = gcc +CXX = g++ +LINK = g++ + +CFLAGS = -DWIN32 -DROSSHELL -D_WIN32_IE=0x0501 -D_WIN32_WINNT=0x0501 -fexceptions -Wall -I. +RCFLAGS = -DWIN32 -DROSSHELL -D__WINDRES__ +LFLAGS = -Wl,--subsystem,windows + +ifdef DEBUG +CFLAGS += -D_DEBUG -g +RCFLAGS += -D_DEBUG +LFLAGS += -g +else +CFLAGS += -DNDEBUG -Os -D_NO_CONTEXT +RCFLAGS += -DNDEBUG +LFLAGS += -s +endif + +ifndef UNICODE +UNICODE = 1 +endif + +ifeq ($(UNICODE),1) +CFLAGS += -DUNICODE +# LFLAGS+= -Wl,--entry,_wWinMain@16 +endif + +CXXFLAGS = $(CFLAGS) + +EXEC_SUFFIX = .exe +RES_SUFFIX = .coff + +VPATH = shell utility taskbar desktop dialogs + +PROGRAM = rosshell + +TARGET = $(PROGRAM)$(EXEC_SUFFIX) + +OBJECTS = \ + startup.o \ + shellclasses.o \ + utility.o \ + window.o \ + dragdropimpl.o \ + shellbrowserimpl.o \ + explorer.o \ + entries.o \ + shellfs.o \ + desktop.o \ + desktopbar.o \ + taskbar.o \ + startmenu.o \ + traynotify.o \ + quicklaunch.o \ + settings.o + +LIBS = gdi32 comctl32 ole32 uuid + +all: precomp.h.gch $(TARGET) + +precomp.h.gch: *.h utility/*.h shell/*.h desktop/*.h + $(CXX) $(CFLAGS) precomp.h + +$(TARGET): $(OBJECTS) $(PROGRAM)$(RES_SUFFIX) + $(LINK) $(LFLAGS) -o $@ $^ $(addprefix -l,$(LIBS)) + +$(PROGRAM)$(RES_SUFFIX): explorer_intres.rc res/*.bmp res/*.ico + windres $(RCFLAGS) -o $@ explorer_intres.rc + +clean: + rm -f $(TARGET) $(OBJECTS) $(PROGRAM)$(RES_SUFFIX) precomp.h.gch \ + desktop/*.o dialogs/*.o shell/*.o taskbar/*.o utility/*.o + +ever: Property changes on: branches/lean-explorer/Make-rosshell-MinGW ___________________________________________________________________ Name: svn:eol-style + native _____ Modified: branches/lean-explorer/Make-rosshell.mak --- branches/lean-explorer/Make-rosshell.mak 2006-01-30 08:00:18 UTC (rev 42) +++ branches/lean-explorer/Make-rosshell.mak 2006-01-30 08:00:33 UTC (rev 43) @@ -1,147 +1,147 @@ -# -# ReactOS lean shell -# -# Makefile -# - -# Windows is default host environment -ifeq ($(HOST),) -HOST = mingw32-windows -endif - -ifeq ($(HOST),mingw32-linux) -CC = mingw32-gcc -CXX = mingw32-g++ -LINK = mingw32-g++ -RC = mingw32-windres -CD_PREFIX := ./ -PREFIX = mingw32- -EXE_POSTFIX := -EXE_PREFIX := ./ -endif - -ifeq ($(HOST),mingw32-windows) -CC = gcc -CXX = g++ -LINK = g++ -RC = windres -CD_PREFIX := -PREFIX = -EXE_PREFIX := -EXE_POSTFIX := .exe -endif - -PATH_TO_TOP = ../../.. -TOOLS_PATH = $(PATH_TO_TOP)/tools - -ifndef UNICODE -UNICODE = 1 -endif - -CFLAGS = -I./ -DWIN32 -D_ROS_ -D_WIN32_IE=0x0501 -D_WIN32_WINNT=0x0501 -fexceptions -Wall -RCFLAGS = -DWIN32 -D_ROS_ -D__WINDRES__ -LFLAGS = -Wl,--subsystem,windows - -ifdef DEBUG -CFLAGS += -D_DEBUG -g -RCFLAGS += -D_DEBUG -LFLAGS += -g -else -CFLAGS += -DNDEBUG -Os -D_NO_CONTEXT -RCFLAGS += -DNDEBUG -LFLAGS += -s -endif - -ifeq ($(UNICODE),1) -CFLAGS += -DUNICODE -# LFLAGS+= -Wl,--entry,_wWinMain@16 -RCFLAGS += -DUNICODE -endif - -CXXFLAGS = $(CFLAGS) - -EXEC_SUFFIX = .exe -RES_SUFFIX = .coff - -VPATH = shell utility taskbar desktop dialogs - -PROGRAM = rosshell - -TARGET = $(PROGRAM)$(EXEC_SUFFIX) - -OBJECTS = \ - startup.o \ - shellclasses.o \ - utility.o \ - window.o \ - dragdropimpl.o \ - shellbrowserimpl.o \ - explorer.o \ - entries.o \ - shellfs.o \ - desktop.o \ - desktopbar.o \ - taskbar.o \ - startmenu.o \ - traynotify.o \ - quicklaunch.o \ - settings.o - -LIBS = gdi32 comctl32 ole32 uuid - -.PHONY: all depends implib clean install dist bootcd depends - -all: $(TARGET) - -ever: - -$(TARGET): $(OBJECTS) $(PROGRAM)$(RES_SUFFIX) - $(LINK) $(LFLAGS) -o $@ $^ $(addprefix -l,$(LIBS)) - -$(PROGRAM)$(RES_SUFFIX): explorer_intres.rc res/*.bmp res/*.ico - $(RC) $(RCFLAGS) -o $@ explorer_intres.rc - -clean: - $(TOOLS_PATH)/rdel $(TARGET) $(OBJECTS) $(PROGRAM)$(RES_SUFFIX) \ - desktop/*.o dialogs/*.o shell/*.o taskbar/*.o utility/*.o - -# Use environment var ROS_INSTALL to override default install dir -ifneq ($(ROS_INSTALL),) -INSTALL_DIR = $(ROS_INSTALL) -else -ifeq ($(HOST),mingw32-windows) -INSTALL_DIR = C:/reactos -else -INSTALL_DIR = $(PATH_TO_TOP)/reactos -endif -endif - -implib: - -install: - -$(TOOLS_PATH)/rcopy $(TARGET) $(INSTALL_DIR)/$(TARGET) - -bootcd: - - -# dependency scanning - -DEP_FILTERED := $(filter-out $(DEP_EXCLUDE_FILTER), $(OBJECTS:.o=.d)) -DEP_FILES := $(join $(dir $(DEP_FILTERED)), $(addprefix ., $(notdir $(DEP_FILTERED)))) - -ifneq ($(MAKECMDGOALS),clean) --include $(DEP_FILES) -endif - -ifeq ($(HOST),mingw32-windows) -DEPENDS_EXE := ..\..\..\tools\depends -else -DEPENDS_EXE := $(TOOLS_PATH)/depends -endif - -.%.d: %.c $(PATH_TO_TOP)/tools/depends$(EXE_POSTFIX) - $(CC) $(CFLAGS) -M $< | $(DEPENDS_EXE) $(@D) $@ - -.%.d: %.cpp $(PATH_TO_TOP)/tools/depends$(EXE_POSTFIX) - $(CC) $(CFLAGS) -M $< | $(DEPENDS_EXE) $(@D) $@ - +# +# ReactOS lean shell +# +# Makefile +# + +# Windows is default host environment +ifeq ($(HOST),) +HOST = mingw32-windows +endif + +ifeq ($(HOST),mingw32-linux) +CC = mingw32-gcc +CXX = mingw32-g++ +LINK = mingw32-g++ +RC = mingw32-windres +CD_PREFIX := ./ +PREFIX = mingw32- +EXE_POSTFIX := +EXE_PREFIX := ./ +endif + +ifeq ($(HOST),mingw32-windows) +CC = gcc +CXX = g++ +LINK = g++ +RC = windres +CD_PREFIX := +PREFIX = +EXE_PREFIX := +EXE_POSTFIX := .exe +endif + +PATH_TO_TOP = ../../.. +TOOLS_PATH = $(PATH_TO_TOP)/tools + +ifndef UNICODE +UNICODE = 1 +endif + +CFLAGS = -I./ -DWIN32 -D_ROS_ -D_WIN32_IE=0x0501 -D_WIN32_WINNT=0x0501 -fexceptions -Wall +RCFLAGS = -DWIN32 -D_ROS_ -D__WINDRES__ +LFLAGS = -Wl,--subsystem,windows + +ifdef DEBUG +CFLAGS += -D_DEBUG -g +RCFLAGS += -D_DEBUG +LFLAGS += -g +else +CFLAGS += -DNDEBUG -Os -D_NO_CONTEXT +RCFLAGS += -DNDEBUG +LFLAGS += -s +endif + +ifeq ($(UNICODE),1) +CFLAGS += -DUNICODE +# LFLAGS+= -Wl,--entry,_wWinMain@16 +RCFLAGS += -DUNICODE +endif + +CXXFLAGS = $(CFLAGS) + +EXEC_SUFFIX = .exe +RES_SUFFIX = .coff + +VPATH = shell utility taskbar desktop dialogs + +PROGRAM = rosshell + +TARGET = $(PROGRAM)$(EXEC_SUFFIX) + +OBJECTS = \ + startup.o \ + shellclasses.o \ + utility.o \ + window.o \ + dragdropimpl.o \ + shellbrowserimpl.o \ + explorer.o \ + entries.o \ + shellfs.o \ + desktop.o \ + desktopbar.o \ + taskbar.o \ + startmenu.o \ + traynotify.o \ + quicklaunch.o \ + settings.o + +LIBS = gdi32 comctl32 ole32 uuid + +.PHONY: all depends implib clean install dist bootcd depends + +all: $(TARGET) + +ever: + +$(TARGET): $(OBJECTS) $(PROGRAM)$(RES_SUFFIX) + $(LINK) $(LFLAGS) -o $@ $^ $(addprefix -l,$(LIBS)) + +$(PROGRAM)$(RES_SUFFIX): explorer_intres.rc res/*.bmp res/*.ico + $(RC) $(RCFLAGS) -o $@ explorer_intres.rc + +clean: + $(TOOLS_PATH)/rdel $(TARGET) $(OBJECTS) $(PROGRAM)$(RES_SUFFIX) \ + desktop/*.o dialogs/*.o shell/*.o taskbar/*.o utility/*.o + +# Use environment var ROS_INSTALL to override default install dir +ifneq ($(ROS_INSTALL),) +INSTALL_DIR = $(ROS_INSTALL) +else +ifeq ($(HOST),mingw32-windows) +INSTALL_DIR = C:/reactos +else +INSTALL_DIR = $(PATH_TO_TOP)/reactos +endif +endif + +implib: + +install: + -$(TOOLS_PATH)/rcopy $(TARGET) $(INSTALL_DIR)/$(TARGET) + +bootcd: + + +# dependency scanning + +DEP_FILTERED := $(filter-out $(DEP_EXCLUDE_FILTER), $(OBJECTS:.o=.d)) +DEP_FILES := $(join $(dir $(DEP_FILTERED)), $(addprefix ., $(notdir $(DEP_FILTERED)))) + +ifneq ($(MAKECMDGOALS),clean) +-include $(DEP_FILES) +endif + +ifeq ($(HOST),mingw32-windows) +DEPENDS_EXE := ..\..\..\tools\depends +else +DEPENDS_EXE := $(TOOLS_PATH)/depends +endif + +.%.d: %.c $(PATH_TO_TOP)/tools/depends$(EXE_POSTFIX) + $(CC) $(CFLAGS) -M $< | $(DEPENDS_EXE) $(@D) $@ + +.%.d: %.cpp $(PATH_TO_TOP)/tools/depends$(EXE_POSTFIX) + $(CC) $(CFLAGS) -M $< | $(DEPENDS_EXE) $(@D) $@ + Property changes on: branches/lean-explorer/Make-rosshell.mak ___________________________________________________________________ Name: svn:eol-style + native
18 years, 10 months
1
0
0
0
[martinf] 42: set svn:eol-style for Makefiles
by martinf@svn.reactos.org
set svn:eol-style for Makefiles Modified: trunk/reactos/base/shell/explorer/Make-rosshell-MinGW Modified: trunk/reactos/base/shell/explorer/Make-rosshell.mak _____ Modified: trunk/reactos/base/shell/explorer/Make-rosshell-MinGW --- trunk/reactos/base/shell/explorer/Make-rosshell-MinGW 2006-01-30 00:28:01 UTC (rev 41) +++ trunk/reactos/base/shell/explorer/Make-rosshell-MinGW 2006-01-30 08:00:18 UTC (rev 42) @@ -1,92 +1,92 @@ -# -# ReactOS shell -# -# Makefile-rosshell-MinGW -# -# MinGW Makefile with precompiled header support -# - -CC = gcc -CXX = g++ -LINK = g++ - -CFLAGS = -DWIN32 -DROSSHELL -D_WIN32_IE=0x0600 -D_WIN32_WINNT=0x0501 -DWINVER=0x0500 -fexceptions -Wall -I. -I$(EXPAT_INC) -RCFLAGS = -DWIN32 -DROSSHELL -D__WINDRES__ -LFLAGS = -Wl,--subsystem,windows - -ifdef DEBUG -CFLAGS += -D_DEBUG -g -RCFLAGS += -D_DEBUG -LFLAGS += -g -else -CFLAGS += -DNDEBUG -Os #-march=pentium4 -RCFLAGS += -DNDEBUG -LFLAGS += -s -endif - -ifndef UNICODE -UNICODE = 1 -endif - -ifeq ($(UNICODE),1) -CFLAGS += -DUNICODE -# LFLAGS+= -Wl,--entry,_wWinMain@16 -RCFLAGS += -DUNICODE -endif - -CXXFLAGS = $(CFLAGS) - -EXEC_SUFFIX = .exe -RES_SUFFIX = .coff - -VPATH = shell utility taskbar desktop dialogs services - -PROGRAM = rosshell - -TARGET = $(PROGRAM)$(EXEC_SUFFIX) - -OBJECTS = \ - startup.o \ - shellclasses.o \ - utility.o \ - window.o \ - dragdropimpl.o \ - shellbrowserimpl.o \ - explorer.o \ - entries.o \ - winfs.o \ - shellfs.o \ - pane.o \ - desktop.o \ - desktopbar.o \ - taskbar.o \ - startmenu.o \ - shellservices.o \ - traynotify.o \ - quicklaunch.o \ - favorites.o \ - searchprogram.o \ - settings.o \ - i386-stub-win32.o \ - xmlstorage.o - -LIBS = gdi32 comctl32 msimg32 ole32 uuid -DELAYIMPORTS = oleaut32 wsock32 - -all: precomp.h.gch $(TARGET) - -precomp.h.gch: *.h utility/*.h shell/*.h desktop/*.h - $(CXX) $(CFLAGS) precomp.h - -$(TARGET): $(OBJECTS) $(PROGRAM)$(RES_SUFFIX) notifyhook.dll libexpat.dll - $(LINK) $(LFLAGS) -o $@ $^ $(addprefix -l,$(LIBS)) $(addprefix -l,$(DELAYIMPORTS)) - -$(PROGRAM)$(RES_SUFFIX): explorer_intres.rc res/*.bmp res/*.ico - windres $(RCFLAGS) -o $@ explorer_intres.rc - -notifyhook.dll: notifyhook/notifyhook.c notifyhook/notifyhook.h - $(CC) -D_WIN32_IE=0x0600 -Wall -D_NOTIFYHOOK_IMPL -Os -s notifyhook/notifyhook.c -shared -o $@ - -clean: - rm -f $(TARGET) $(OBJECTS) $(PROGRAM)$(RES_SUFFIX) precomp.h.gch \ - desktop/*.o dialogs/*.o shell/*.o taskbar/*.o utility/*.o +# +# ReactOS shell +# +# Makefile-rosshell-MinGW +# +# MinGW Makefile with precompiled header support +# + +CC = gcc +CXX = g++ +LINK = g++ + +CFLAGS = -DWIN32 -DROSSHELL -D_WIN32_IE=0x0600 -D_WIN32_WINNT=0x0501 -DWINVER=0x0500 -fexceptions -Wall -I. -I$(EXPAT_INC) +RCFLAGS = -DWIN32 -DROSSHELL -D__WINDRES__ +LFLAGS = -Wl,--subsystem,windows + +ifdef DEBUG +CFLAGS += -D_DEBUG -g +RCFLAGS += -D_DEBUG +LFLAGS += -g +else +CFLAGS += -DNDEBUG -Os #-march=pentium4 +RCFLAGS += -DNDEBUG +LFLAGS += -s +endif + +ifndef UNICODE +UNICODE = 1 +endif + +ifeq ($(UNICODE),1) +CFLAGS += -DUNICODE +# LFLAGS+= -Wl,--entry,_wWinMain@16 +RCFLAGS += -DUNICODE +endif + +CXXFLAGS = $(CFLAGS) + +EXEC_SUFFIX = .exe +RES_SUFFIX = .coff + +VPATH = shell utility taskbar desktop dialogs services + +PROGRAM = rosshell + +TARGET = $(PROGRAM)$(EXEC_SUFFIX) + +OBJECTS = \ + startup.o \ + shellclasses.o \ + utility.o \ + window.o \ + dragdropimpl.o \ + shellbrowserimpl.o \ + explorer.o \ + entries.o \ + winfs.o \ + shellfs.o \ + pane.o \ + desktop.o \ + desktopbar.o \ + taskbar.o \ + startmenu.o \ + shellservices.o \ + traynotify.o \ + quicklaunch.o \ + favorites.o \ + searchprogram.o \ + settings.o \ + i386-stub-win32.o \ + xmlstorage.o + +LIBS = gdi32 comctl32 msimg32 ole32 uuid +DELAYIMPORTS = oleaut32 wsock32 + +all: precomp.h.gch $(TARGET) + +precomp.h.gch: *.h utility/*.h shell/*.h desktop/*.h + $(CXX) $(CFLAGS) precomp.h + +$(TARGET): $(OBJECTS) $(PROGRAM)$(RES_SUFFIX) notifyhook.dll libexpat.dll + $(LINK) $(LFLAGS) -o $@ $^ $(addprefix -l,$(LIBS)) $(addprefix -l,$(DELAYIMPORTS)) + +$(PROGRAM)$(RES_SUFFIX): explorer_intres.rc res/*.bmp res/*.ico + windres $(RCFLAGS) -o $@ explorer_intres.rc + +notifyhook.dll: notifyhook/notifyhook.c notifyhook/notifyhook.h + $(CC) -D_WIN32_IE=0x0600 -Wall -D_NOTIFYHOOK_IMPL -Os -s notifyhook/notifyhook.c -shared -o $@ + +clean: + rm -f $(TARGET) $(OBJECTS) $(PROGRAM)$(RES_SUFFIX) precomp.h.gch \ + desktop/*.o dialogs/*.o shell/*.o taskbar/*.o utility/*.o Property changes on: trunk/reactos/base/shell/explorer/Make-rosshell-MinGW ___________________________________________________________________ Name: svn:eol-style + native _____ Modified: trunk/reactos/base/shell/explorer/Make-rosshell.mak --- trunk/reactos/base/shell/explorer/Make-rosshell.mak 2006-01-30 00:28:01 UTC (rev 41) +++ trunk/reactos/base/shell/explorer/Make-rosshell.mak 2006-01-30 08:00:18 UTC (rev 42) @@ -1,68 +1,68 @@ -# -# ReactOS shell -# -# Makefile -# - -PATH_TO_TOP := ../../.. - -TARGET_TYPE := program - -TARGET_APPTYPE := windows - -TARGET_NAME := rosshell - -TARGET_INSTALLDIR := . - -TARGET_CFLAGS := \ - -D__USE_W32API -DWIN32 -D_ROS_ \ - -D_WIN32_IE=0x0600 -D_WIN32_WINNT=0x0501 -DWINVER=0x0500 \ - -DUNICODE -fexceptions -Wall -g \ - -I../../../include/expat - -TARGET_CPPFLAGS := $(TARGET_CFLAGS) - -TARGET_RCFLAGS := -D__USE_W32API -DWIN32 -D_ROS_ -D__WINDRES__ - -TARGET_SDKLIBS := \ - gdi32.a user32.a comctl32.a ole32.a oleaut32.a shell32.a expat.a \ - notifyhook.a ws2_32.a msimg32.a - -TARGET_GCCLIBS := stdc++ uuid - -TARGET_OBJECTS := \ - explorer.o \ - i386-stub-win32.o \ - desktop/desktop.o \ - dialogs/searchprogram.o \ - dialogs/settings.o \ - shell/entries.o \ - shell/shellfs.o \ - shell/pane.o \ - shell/winfs.o \ - services/startup.o \ - services/shellservices.o \ - taskbar/desktopbar.o \ - taskbar/taskbar.o \ - taskbar/startmenu.o \ - taskbar/traynotify.o \ - taskbar/quicklaunch.o \ - taskbar/favorites.o \ - utility/shellclasses.o \ - utility/utility.o \ - utility/window.o \ - utility/dragdropimpl.o \ - utility/shellbrowserimpl.o \ - utility/xmlstorage.o - -TARGET_CPPAPP := yes - -TARGET_PCH := precomp.h - -SUBDIRS := notifyhook - -DEP_OBJECTS := $(TARGET_OBJECTS) - -include $(PATH_TO_TOP)/rules.mak -include $(TOOLS_PATH)/helper.mk -include $(TOOLS_PATH)/depend.mk +# +# ReactOS shell +# +# Makefile +# + +PATH_TO_TOP := ../../.. + +TARGET_TYPE := program + +TARGET_APPTYPE := windows + +TARGET_NAME := rosshell + +TARGET_INSTALLDIR := . + +TARGET_CFLAGS := \ + -D__USE_W32API -DWIN32 -D_ROS_ \ + -D_WIN32_IE=0x0600 -D_WIN32_WINNT=0x0501 -DWINVER=0x0500 \ + -DUNICODE -fexceptions -Wall -g \ + -I../../../include/expat + +TARGET_CPPFLAGS := $(TARGET_CFLAGS) + +TARGET_RCFLAGS := -D__USE_W32API -DWIN32 -D_ROS_ -D__WINDRES__ + +TARGET_SDKLIBS := \ + gdi32.a user32.a comctl32.a ole32.a oleaut32.a shell32.a expat.a \ + notifyhook.a ws2_32.a msimg32.a + +TARGET_GCCLIBS := stdc++ uuid + +TARGET_OBJECTS := \ + explorer.o \ + i386-stub-win32.o \ + desktop/desktop.o \ + dialogs/searchprogram.o \ + dialogs/settings.o \ + shell/entries.o \ + shell/shellfs.o \ + shell/pane.o \ + shell/winfs.o \ + services/startup.o \ + services/shellservices.o \ + taskbar/desktopbar.o \ + taskbar/taskbar.o \ + taskbar/startmenu.o \ + taskbar/traynotify.o \ + taskbar/quicklaunch.o \ + taskbar/favorites.o \ + utility/shellclasses.o \ + utility/utility.o \ + utility/window.o \ + utility/dragdropimpl.o \ + utility/shellbrowserimpl.o \ + utility/xmlstorage.o + +TARGET_CPPAPP := yes + +TARGET_PCH := precomp.h + +SUBDIRS := notifyhook + +DEP_OBJECTS := $(TARGET_OBJECTS) + +include $(PATH_TO_TOP)/rules.mak +include $(TOOLS_PATH)/helper.mk +include $(TOOLS_PATH)/depend.mk Property changes on: trunk/reactos/base/shell/explorer/Make-rosshell.mak ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/reactos/lib/3rdparty/adns/Makefile.in ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/reactos/lib/3rdparty/adns/client/Makefile.in ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/reactos/lib/3rdparty/adns/dynamic/Makefile.in ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/reactos/lib/3rdparty/adns/src/Makefile.in ___________________________________________________________________ Name: svn:eol-style + native
18 years, 10 months
1
0
0
0
[arty] 41: moved documentation
by arty@svn.reactos.org
moved documentation Added: trunk/documentation/ Deleted: trunk/documentation/audit/ Added: trunk/documentation/audit/ Deleted: trunk/reactos/documentation/ _____ Copied: trunk/documentation (from rev 38, trunk/reactos/documentation) _____ Copied: trunk/documentation/audit (from rev 40, trunk/reactos/documentation/audit)
18 years, 10 months
1
0
0
0
[arty] 40: Added null driver (originally written by David Welch and KJK:Hyperion).
by arty@svn.reactos.org
Added null driver (originally written by David Welch and KJK:Hyperion). Added: trunk/reactos/drivers/base/null/ Added: trunk/reactos/drivers/base/null/null.c Added: trunk/reactos/drivers/base/null/null.h Added: trunk/reactos/drivers/base/null/null.rbuild Added: trunk/reactos/drivers/base/null/null.rc _____ Added: trunk/reactos/drivers/base/null/null.c --- trunk/reactos/drivers/base/null/null.c 2006-01-30 00:12:14 UTC (rev 39) +++ trunk/reactos/drivers/base/null/null.c 2006-01-30 00:15:24 UTC (rev 40) @@ -0,0 +1,205 @@ +/* $Id: null.c 18302 2005-10-06 21:39:18Z weiden $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: services/null/null.c + * PURPOSE: NULL device driver + * PROGRAMMER: David Welch (welch(a)mcmail.com) + * UPDATE HISTORY: + * 13/08/1998: Created + * 29/04/2002: Fixed bugs, added zero-stream device + * 28/06/2004: Compile against the DDK, use PSEH where necessary + */ + +/* INCLUDES */ +#include <ntddk.h> + +#include <pseh/pseh.h> + +#include "null.h" + +/* OBJECTS */ +static const NULL_EXTENSION nxNull = NullBitBucket; +static const NULL_EXTENSION nxZero = NullZeroStream; + +/* FUNCTIONS */ +static NTSTATUS STDCALL +NullDispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp) +{ + PIO_STACK_LOCATION piosStack = IoGetCurrentIrpStackLocation(Irp); + NTSTATUS nErrCode; + + nErrCode = STATUS_SUCCESS; + Irp->IoStatus.Information = 0; + + switch(piosStack->MajorFunction) + { + /* opening and closing handles to the device */ + case IRP_MJ_CREATE: + case IRP_MJ_CLOSE: + switch(NULL_DEVICE_TYPE(DeviceObject)) + { + case NullBitBucket: + case NullZeroStream: + break; + + default: + ASSERT(FALSE); + } + + break; + + /* write data */ + case IRP_MJ_WRITE: + { + switch(NULL_DEVICE_TYPE(DeviceObject)) + { + case NullBitBucket: + Irp->IoStatus.Information = piosStack->Parameters.Write.Length; + break; + + case NullZeroStream: + nErrCode = STATUS_INVALID_DEVICE_REQUEST; + break; + + default: + ASSERT(FALSE); + } + + break; + } + + /* read data */ + case IRP_MJ_READ: + { + switch(NULL_DEVICE_TYPE(DeviceObject)) + { + case NullBitBucket: + nErrCode = STATUS_END_OF_FILE; + break; + + case NullZeroStream: + _SEH_TRY + { + RtlZeroMemory(Irp->AssociatedIrp.SystemBuffer, piosStack->Parameters.Read.Length); + Irp->IoStatus.Information = piosStack->Parameters.Read.Length; + } + _SEH_HANDLE + { + nErrCode = _SEH_GetExceptionCode(); + } + _SEH_END; + + break; + + default: + ASSERT(FALSE); + + } + + break; + } + + case IRP_MJ_QUERY_VOLUME_INFORMATION: + switch(piosStack->Parameters.QueryVolume.FsInformationClass) + { + case FileFsDeviceInformation: + { + ULONG BufferLength = piosStack->Parameters.QueryVolume.Length; + PFILE_FS_DEVICE_INFORMATION FsDeviceInfo = (PFILE_FS_DEVICE_INFORMATION)Irp->AssociatedIrp.SystemBuffer; + + if (BufferLength >= sizeof(FILE_FS_DEVICE_INFORMATION)) + { + FsDeviceInfo->DeviceType = FILE_DEVICE_NULL; + FsDeviceInfo->Characteristics = 0; /* FIXME: fix this !! */ + Irp->IoStatus.Information = sizeof(FILE_FS_DEVICE_INFORMATION); + nErrCode = STATUS_SUCCESS; + } + else + { + Irp->IoStatus.Information = 0; + nErrCode = STATUS_BUFFER_OVERFLOW; + } + } + break; + + default: + Irp->IoStatus.Information = 0; + nErrCode = STATUS_NOT_IMPLEMENTED; + } + break; + + default: + Irp->IoStatus.Information = 0; + nErrCode = STATUS_NOT_IMPLEMENTED; + + } + + Irp->IoStatus.Status = nErrCode; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return (nErrCode); +} + +static VOID STDCALL +NullUnload(PDRIVER_OBJECT DriverObject) +{ +} + +/* TODO: \Device\Zero should be memory-mappable */ +NTSTATUS STDCALL +DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath) +{ + PDEVICE_OBJECT pdoNullDevice; + PDEVICE_OBJECT pdoZeroDevice; + UNICODE_STRING wstrNullDeviceName = RTL_CONSTANT_STRING(L"\\Device\\Null"); + UNICODE_STRING wstrZeroDeviceName = RTL_CONSTANT_STRING(L"\\Device\\Zero"); + NTSTATUS nErrCode; + + /* register driver routines */ + DriverObject->MajorFunction[IRP_MJ_CLOSE] = NullDispatch; + DriverObject->MajorFunction[IRP_MJ_CREATE] = NullDispatch; + DriverObject->MajorFunction[IRP_MJ_WRITE] = NullDispatch; + DriverObject->MajorFunction[IRP_MJ_READ] = NullDispatch; + DriverObject->DriverUnload = NullUnload; + + /* create null device */ + nErrCode = IoCreateDevice(DriverObject, + sizeof(NULL_EXTENSION), + &wstrNullDeviceName, + FILE_DEVICE_NULL, + 0, + FALSE, + &pdoNullDevice); + + /* failure */ + if(!NT_SUCCESS(nErrCode)) + { + return (nErrCode); + } + + pdoNullDevice->DeviceExtension = (PVOID)&nxNull; + + /* create zero device */ + nErrCode = IoCreateDevice(DriverObject, + sizeof(NULL_EXTENSION), + &wstrZeroDeviceName, + FILE_DEVICE_NULL, + FILE_READ_ONLY_DEVICE, /* zero device is read-only */ + FALSE, + &pdoZeroDevice); + + /* failure */ + if(!NT_SUCCESS(nErrCode)) + { + IoDeleteDevice(pdoNullDevice); + return (nErrCode); + } + + pdoZeroDevice->DeviceExtension = (PVOID)&nxZero; + pdoZeroDevice->Flags |= DO_BUFFERED_IO; + + return (nErrCode); +} + +/* EOF */ _____ Added: trunk/reactos/drivers/base/null/null.h --- trunk/reactos/drivers/base/null/null.h 2006-01-30 00:12:14 UTC (rev 39) +++ trunk/reactos/drivers/base/null/null.h 2006-01-30 00:15:24 UTC (rev 40) @@ -0,0 +1,22 @@ +/* $Id: null.h 18302 2005-10-06 21:39:18Z weiden $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: services/dd/null/null.h + * PURPOSE: NULL device driver internal definitions + * PROGRAMMER: KJK::Hyperion <noog(a)libero.it> + * UPDATE HISTORY: + * 29/04/2002: Created + */ + +typedef enum __tagNULL_EXTENSION{ + NullBitBucket, + NullZeroStream, +} NULL_EXTENSION, *PNULL_EXTENSION; + +#define NULL_DEVICE_TYPE(__DEVICE__) (*((PNULL_EXTENSION)((__DEVICE__)->DeviceExtension))) + +NTSTATUS STDCALL +DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath); + +/* EOF */ _____ Added: trunk/reactos/drivers/base/null/null.rbuild --- trunk/reactos/drivers/base/null/null.rbuild 2006-01-30 00:12:14 UTC (rev 39) +++ trunk/reactos/drivers/base/null/null.rbuild 2006-01-30 00:15:24 UTC (rev 40) @@ -0,0 +1,9 @@ +<module name="null" type="kernelmodedriver" installbase="system32/drivers" installname="null.sys"> + <include base="null">.</include> + <define name="__USE_W32API" /> + <library>pseh</library> + <library>ntoskrnl</library> + <library>hal</library> + <file>null.c</file> + <file>null.rc</file> +</module> _____ Added: trunk/reactos/drivers/base/null/null.rc --- trunk/reactos/drivers/base/null/null.rc 2006-01-30 00:12:14 UTC (rev 39) +++ trunk/reactos/drivers/base/null/null.rc 2006-01-30 00:15:24 UTC (rev 40) @@ -0,0 +1,7 @@ +/* $Id: null.rc 12852 2005-01-06 13:58:04Z mf $ */ + +#define REACTOS_VERSION_DLL +#define REACTOS_STR_FILE_DESCRIPTION "Null Device Driver\0" +#define REACTOS_STR_INTERNAL_NAME "null\0" +#define REACTOS_STR_ORIGINAL_FILENAME "null.sys\0" +#include <reactos/version.rc>
18 years, 10 months
1
0
0
0
← Newer
1
2
3
4
5
6
...
59
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Results per page:
10
25
50
100
200