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
[mf] 21003: revert the last change - it's not correct since the GDI handles were not allocated before.
by mf@svn.reactos.org
revert the last change - it's not correct since the GDI handles were not allocated before. Modified: trunk/reactos/subsys/system/explorer/shell/mainframe.cpp Modified: trunk/reactos/subsys/system/explorer/utility/window.cpp _____ Modified: trunk/reactos/subsys/system/explorer/shell/mainframe.cpp --- trunk/reactos/subsys/system/explorer/shell/mainframe.cpp 2006-01-23 18:15:00 UTC (rev 21002) +++ trunk/reactos/subsys/system/explorer/shell/mainframe.cpp 2006-01-23 18:46:45 UTC (rev 21003) @@ -1433,7 +1433,6 @@ HBRUSH lastBrush = SelectBrush(canvas, GetStockBrush(COLOR_SPLITBAR)); Rectangle(canvas, rt.left, rt.top-1, rt.right, rt.bottom+1); SelectObject(canvas, lastBrush); - DeleteObject(lastBrush); } break;} _____ Modified: trunk/reactos/subsys/system/explorer/utility/window.cpp --- trunk/reactos/subsys/system/explorer/utility/window.cpp 2006-01-23 18:15:00 UTC (rev 21002) +++ trunk/reactos/subsys/system/explorer/utility/window.cpp 2006-01-23 18:46:45 UTC (rev 21003) @@ -397,7 +397,6 @@ SetRect(&rc, rt.left, rt.top-1, rt.right, rt.bottom+1); DrawEdge(canvas, &rc, EDGE_RAISED, BF_RECT); SelectObject(canvas, lastBrush); - DeleteObject(lastBrush); break;} case WM_SETCURSOR:
18 years, 11 months
1
0
0
0
[cwittich] 21002: check NDIS ParameterType (fix by Crashfourit)
by cwittich@svn.reactos.org
check NDIS ParameterType (fix by Crashfourit) Modified: trunk/reactos/drivers/net/ndis/ndis/config.c _____ Modified: trunk/reactos/drivers/net/ndis/ndis/config.c --- trunk/reactos/drivers/net/ndis/ndis/config.c 2006-01-23 12:59:30 UTC (rev 21001) +++ trunk/reactos/drivers/net/ndis/ndis/config.c 2006-01-23 18:15:00 UTC (rev 21002) @@ -493,8 +493,17 @@ str.Buffer = (PWCHAR)KeyInformation->Data; (*ParameterValue)->ParameterType = ParameterType; - *Status = RtlUnicodeStringToInteger(&str, 16, &(*ParameterValue)->ParameterData.IntegerData); + + /* + If ParameterType is NdisParameterInteger then the base of str is decimal. + If ParameterType is NdisParameterHexInteger then the base of str is hexadecimal. + */ + if (ParameterType == NdisParameterInteger) + *Status = RtlUnicodeStringToInteger(&str, 10, &(*ParameterValue)->ParameterData.IntegerData); + else if (ParameterType == NdisParameterHexInteger) + *Status = RtlUnicodeStringToInteger(&str, 16, &(*ParameterValue)->ParameterData.IntegerData); + ExFreePool(KeyInformation); if(*Status != STATUS_SUCCESS)
18 years, 11 months
1
0
0
0
[cwittich] 21001: fixed some resource leaks
by cwittich@svn.reactos.org
fixed some resource leaks Modified: trunk/reactos/subsys/system/explorer/shell/mainframe.cpp Modified: trunk/reactos/subsys/system/explorer/utility/window.cpp _____ Modified: trunk/reactos/subsys/system/explorer/shell/mainframe.cpp --- trunk/reactos/subsys/system/explorer/shell/mainframe.cpp 2006-01-23 12:39:35 UTC (rev 21000) +++ trunk/reactos/subsys/system/explorer/shell/mainframe.cpp 2006-01-23 12:59:30 UTC (rev 21001) @@ -1433,6 +1433,7 @@ HBRUSH lastBrush = SelectBrush(canvas, GetStockBrush(COLOR_SPLITBAR)); Rectangle(canvas, rt.left, rt.top-1, rt.right, rt.bottom+1); SelectObject(canvas, lastBrush); + DeleteObject(lastBrush); } break;} _____ Modified: trunk/reactos/subsys/system/explorer/utility/window.cpp --- trunk/reactos/subsys/system/explorer/utility/window.cpp 2006-01-23 12:39:35 UTC (rev 21000) +++ trunk/reactos/subsys/system/explorer/utility/window.cpp 2006-01-23 12:59:30 UTC (rev 21001) @@ -397,6 +397,7 @@ SetRect(&rc, rt.left, rt.top-1, rt.right, rt.bottom+1); DrawEdge(canvas, &rc, EDGE_RAISED, BF_RECT); SelectObject(canvas, lastBrush); + DeleteObject(lastBrush); break;} case WM_SETCURSOR:
18 years, 11 months
1
0
0
0
[cwittich] 21000: forgot to commit the DrawEdge stuff
by cwittich@svn.reactos.org
forgot to commit the DrawEdge stuff Modified: trunk/reactos/subsys/system/explorer/utility/window.cpp _____ Modified: trunk/reactos/subsys/system/explorer/utility/window.cpp --- trunk/reactos/subsys/system/explorer/utility/window.cpp 2006-01-23 00:35:52 UTC (rev 20999) +++ trunk/reactos/subsys/system/explorer/utility/window.cpp 2006-01-23 12:39:35 UTC (rev 21000) @@ -387,12 +387,15 @@ { switch(nmsg) { case WM_PAINT: { + RECT rc; PaintCanvas canvas(_hwnd); ClientRect rt(_hwnd); rt.left = _split_pos-SPLIT_WIDTH/2; rt.right = _split_pos+SPLIT_WIDTH/2+1; - HBRUSH lastBrush = SelectBrush(canvas, GetStockBrush(COLOR_SPLITBAR)); + HBRUSH lastBrush = SelectBrush(canvas, GetStockBrush(LTGRAY_BRUSH)); Rectangle(canvas, rt.left, rt.top-1, rt.right, rt.bottom+1); + SetRect(&rc, rt.left, rt.top-1, rt.right, rt.bottom+1); + DrawEdge(canvas, &rc, EDGE_RAISED, BF_RECT); SelectObject(canvas, lastBrush); break;}
18 years, 11 months
1
0
0
0
[turner] 20999: Check to make sure GetComputerName failed, caught by Thomas.
by turner@svn.reactos.org
Check to make sure GetComputerName failed, caught by Thomas. Modified: trunk/reactos/lib/cpl/sysdm/computer.c _____ Modified: trunk/reactos/lib/cpl/sysdm/computer.c --- trunk/reactos/lib/cpl/sysdm/computer.c 2006-01-23 00:24:59 UTC (rev 20998) +++ trunk/reactos/lib/cpl/sysdm/computer.c 2006-01-23 00:35:52 UTC (rev 20999) @@ -46,8 +46,10 @@ /* Display computer name */ DWORD Size = MAX_COMPUTERNAME_LENGTH + 1; TCHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1]; - GetComputerName(ComputerName,&Size); - SendDlgItemMessage(hwndDlg,IDC_COMPUTERNAME,WM_SETTEXT,0,(LPARAM)Compute rName); + if (GetComputerName(ComputerName,&Size)) + { + SendDlgItemMessage(hwndDlg,IDC_COMPUTERNAME,WM_SETTEXT,0,(LPARAM)Compute rName); + } /* FIXME: get the workgroup */ break; }
18 years, 11 months
1
0
0
0
[turner] 20998: Show the computer name when loaded.
by turner@svn.reactos.org
Show the computer name when loaded. Modified: trunk/reactos/lib/cpl/sysdm/computer.c _____ Modified: trunk/reactos/lib/cpl/sysdm/computer.c --- trunk/reactos/lib/cpl/sysdm/computer.c 2006-01-23 00:13:14 UTC (rev 20997) +++ trunk/reactos/lib/cpl/sysdm/computer.c 2006-01-23 00:24:59 UTC (rev 20998) @@ -42,7 +42,15 @@ switch(uMsg) { case WM_INITDIALOG: + { + /* Display computer name */ + DWORD Size = MAX_COMPUTERNAME_LENGTH + 1; + TCHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1]; + GetComputerName(ComputerName,&Size); + SendDlgItemMessage(hwndDlg,IDC_COMPUTERNAME,WM_SETTEXT,0,(LPARAM)Compute rName); + /* FIXME: get the workgroup */ break; + } } return FALSE; }
18 years, 11 months
1
0
0
0
[cwittich] 20997: use DrawEdge to draw the splitter
by cwittich@svn.reactos.org
use DrawEdge to draw the splitter added WS_EX_CLIENTEDGE to MDI ChildWindow Modified: trunk/reactos/subsys/system/explorer/shell/mainframe.cpp Modified: trunk/reactos/subsys/system/explorer/shell/shellbrowser.cpp _____ Modified: trunk/reactos/subsys/system/explorer/shell/mainframe.cpp --- trunk/reactos/subsys/system/explorer/shell/mainframe.cpp 2006-01-22 23:42:45 UTC (rev 20996) +++ trunk/reactos/subsys/system/explorer/shell/mainframe.cpp 2006-01-23 00:13:14 UTC (rev 20997) @@ -535,7 +535,7 @@ if (_hwndrebar) { int height = SendMessage(_hwndrebar, RB_GETBARHEIGHT, 0, 0); rect.top += height; - rect.top += 4; + rect.top += 5; } else { if (IsWindowVisible(_htoolbar)) { SendMessage(_htoolbar, WM_SIZE, 0, 0); @@ -729,7 +729,7 @@ ccs.hWindowMenu = _hMenuWindow; ccs.idFirstChild = IDW_FIRST_CHILD; - _hmdiclient = CreateWindowEx(0, TEXT("MDICLIENT"), NULL, + _hmdiclient = CreateWindowEx(WS_EX_CLIENTEDGE, TEXT("MDICLIENT"), NULL, WS_CHILD|WS_CLIPCHILDREN|WS_VSCROLL|WS_HSCROLL|WS_VISIBLE|WS_BORDER, 0, 0, 0, 0, hwnd, 0, g_Globals._hInstance, &ccs); @@ -1215,7 +1215,7 @@ if (_hwndrebar) { int height = SendMessage(_hwndrebar, RB_GETBARHEIGHT, 0, 0); rect.top += height; - rect.top += 4; + rect.top += 5; } else { if (IsWindowVisible(_htoolbar)) { SendMessage(_htoolbar, WM_SIZE, 0, 0); @@ -1270,7 +1270,7 @@ SetWindowPos(_hsidebar, 0, -1, rect.top-1, rt.right-rt.left, rect.bottom-rect.top+1, SWP_NOACTIVATE|SWP_NOZORDER); } - MoveWindow(_hmdiclient, rect.left-1, rect.top-1, rect.right-rect.left+2, rect.bottom-rect.top+1, TRUE); + MoveWindow(_hmdiclient, rect.left-1, rect.top-1, rect.right-rect.left+1, rect.bottom-rect.top+1, TRUE); } bool MDIMainFrame::activate_drive_window(LPCTSTR path) @@ -1575,7 +1575,7 @@ if (_hwndrebar) { int height = ClientRect(_hwndrebar).bottom; rect.top += height; - rect.top += 4; + rect.top += 5; } else { if (IsWindowVisible(_htoolbar)) { SendMessage(_htoolbar, WM_SIZE, 0, 0); @@ -1658,7 +1658,7 @@ ClientRect rect(_hwnd); _left_hwnd = CreateWindowEx(WS_EX_CLIENTEDGE, WC_TREEVIEW, NULL, - WS_CHILD|WS_TABSTOP|WS_VISIBLE|WS_CHILD|TVS_HASLINES|TVS_LINESATROOT|TVS _HASBUTTONS|TVS_NOTOOLTIPS|TVS_SHOWSELALWAYS, + WS_CHILD|WS_TABSTOP|WS_VISIBLE|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTO NS|TVS_NOTOOLTIPS|TVS_SHOWSELALWAYS, 0, rect.top, split_pos-SPLIT_WIDTH/2, rect.bottom-rect.top, _hwnd, (HMENU)IDC_FILETREE, g_Globals._hInstance, 0); _____ Modified: trunk/reactos/subsys/system/explorer/shell/shellbrowser.cpp --- trunk/reactos/subsys/system/explorer/shell/shellbrowser.cpp 2006-01-22 23:42:45 UTC (rev 20996) +++ trunk/reactos/subsys/system/explorer/shell/shellbrowser.cpp 2006-01-23 00:13:14 UTC (rev 20997) @@ -683,7 +683,7 @@ ClientRect rect(_hwnd); _left_hwnd = CreateWindowEx(0, WC_TREEVIEW, NULL, - WS_CHILD|WS_TABSTOP|WS_VISIBLE|WS_CHILD|TVS_HASLINES|TVS_LINESATROOT|TVS _HASBUTTONS|TVS_SHOWSELALWAYS,//|TVS_NOTOOLTIPS + WS_CHILD|WS_TABSTOP|WS_VISIBLE|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTO NS|TVS_SHOWSELALWAYS,//|TVS_NOTOOLTIPS 0, rect.top, split_pos-SPLIT_WIDTH/2, rect.bottom-rect.top, _hwnd, (HMENU)IDC_FILETREE, g_Globals._hInstance, 0); }
18 years, 11 months
1
0
0
0
[gedmurphy] 20996: remove unneeded loop check
by gedmurphy@svn.reactos.org
remove unneeded loop check Modified: trunk/reactos/subsys/system/servman/control.c Modified: trunk/reactos/subsys/system/servman/servman.h Modified: trunk/reactos/subsys/system/servman/start.c _____ Modified: trunk/reactos/subsys/system/servman/control.c --- trunk/reactos/subsys/system/servman/control.c 2006-01-22 23:35:43 UTC (rev 20995) +++ trunk/reactos/subsys/system/servman/control.c 2006-01-22 23:42:45 UTC (rev 20996) @@ -22,7 +22,6 @@ SERVICE_STATUS Status; LVITEM item; DWORD BytesNeeded = 0; - DWORD Loop = 5; //FIXME: testing value. needs better control DWORD dwStartTickCount, dwOldCheckPoint; item.mask = LVIF_PARAM; @@ -34,7 +33,7 @@ /* set the progress bar range and step */ hProgBar = GetDlgItem(hProgDlg, IDC_SERVCON_PROGRESS); - SendMessage(hProgBar, PBM_SETRANGE, 0, MAKELPARAM(0, Loop)); + SendMessage(hProgBar, PBM_SETRANGE, 0, MAKELPARAM(0, PROGRESSRANGE)); SendMessage(hProgBar, PBM_SETSTEP, (WPARAM)1, 0); /* open handle to the SCM */ @@ -79,7 +78,7 @@ /* loop whilst service is not running */ /* FIXME: needs more control adding. 'Loop' is temparary */ - while (ServiceStatus.dwCurrentState != Control || !Loop) + while (ServiceStatus.dwCurrentState != Control) { DWORD dwWaitTime; @@ -129,7 +128,7 @@ if (ServiceStatus.dwCurrentState == Control) { - SendMessage(hProgBar, PBM_DELTAPOS, Loop, 0); + SendMessage(hProgBar, PBM_DELTAPOS, PROGRESSRANGE, 0); Sleep(1000); return TRUE; } _____ Modified: trunk/reactos/subsys/system/servman/servman.h --- trunk/reactos/subsys/system/servman/servman.h 2006-01-22 23:35:43 UTC (rev 20995) +++ trunk/reactos/subsys/system/servman/servman.h 2006-01-22 23:42:45 UTC (rev 20996) @@ -11,6 +11,7 @@ #define MAX_KEY_LENGTH 256 #define NUM_BUTTONS 13 +#define PROGRESSRANGE 8 BOOL RefreshServiceList(VOID); _____ Modified: trunk/reactos/subsys/system/servman/start.c --- trunk/reactos/subsys/system/servman/start.c 2006-01-22 23:35:43 UTC (rev 20995) +++ trunk/reactos/subsys/system/servman/start.c 2006-01-22 23:42:45 UTC (rev 20996) @@ -21,7 +21,6 @@ ENUM_SERVICE_STATUS_PROCESS *Service = NULL; DWORD BytesNeeded = 0; INT ArgCount = 0; - DWORD Loop = 5; //FIXME: testing value. needs better control DWORD dwStartTickCount, dwOldCheckPoint; /* copy pointer to selected service */ @@ -29,7 +28,7 @@ /* set the progress bar range and step */ hProgBar = GetDlgItem(hProgDlg, IDC_SERVCON_PROGRESS); - SendMessage(hProgBar, PBM_SETRANGE, 0, MAKELPARAM(0, Loop)); + SendMessage(hProgBar, PBM_SETRANGE, 0, MAKELPARAM(0, PROGRESSRANGE)); SendMessage(hProgBar, PBM_SETSTEP, (WPARAM)1, 0); /* open handle to the SCM */ @@ -72,7 +71,7 @@ /* loop whilst service is not running */ /* FIXME: needs more control adding. 'Loop' is temparary */ - while (ServiceStatus.dwCurrentState != SERVICE_RUNNING || !Loop) + while (ServiceStatus.dwCurrentState != SERVICE_RUNNING) { DWORD dwWaitTime; @@ -122,7 +121,7 @@ if (ServiceStatus.dwCurrentState == SERVICE_RUNNING) { - SendMessage(hProgBar, PBM_DELTAPOS, Loop, 0); + SendMessage(hProgBar, PBM_DELTAPOS, PROGRESSRANGE, 0); Sleep(1000); return TRUE; }
18 years, 11 months
1
0
0
0
[gedmurphy] 20995: - Improve start / stop control
by gedmurphy@svn.reactos.org
- Improve start / stop control - Use GetSelectedService exclusively Modified: trunk/reactos/subsys/system/servman/control.c Modified: trunk/reactos/subsys/system/servman/query.c Modified: trunk/reactos/subsys/system/servman/start.c _____ Modified: trunk/reactos/subsys/system/servman/control.c --- trunk/reactos/subsys/system/servman/control.c 2006-01-22 23:29:53 UTC (rev 20994) +++ trunk/reactos/subsys/system/servman/control.c 2006-01-22 23:35:43 UTC (rev 20995) @@ -23,6 +23,7 @@ LVITEM item; DWORD BytesNeeded = 0; DWORD Loop = 5; //FIXME: testing value. needs better control + DWORD dwStartTickCount, dwOldCheckPoint; item.mask = LVIF_PARAM; item.iItem = GetSelectedItem(); @@ -72,15 +73,28 @@ return FALSE; } + /* Save the tick count and initial checkpoint. */ + dwStartTickCount = GetTickCount(); + dwOldCheckPoint = ServiceStatus.dwCheckPoint; + /* loop whilst service is not running */ /* FIXME: needs more control adding. 'Loop' is temparary */ while (ServiceStatus.dwCurrentState != Control || !Loop) { + DWORD dwWaitTime; + + dwWaitTime = ServiceStatus.dwWaitHint / 10; + + if( dwWaitTime < 500 ) + dwWaitTime = 500; + else if ( dwWaitTime > 5000 ) + dwWaitTime = 5000; + /* increment the progress bar */ SendMessage(hProgBar, PBM_STEPIT, 0, 0); /* wait before checking status */ - Sleep(ServiceStatus.dwWaitHint / 8); + Sleep(dwWaitTime); /* check status again */ if (! QueryServiceStatusEx( @@ -93,7 +107,22 @@ GetError(0); return FALSE; } - Loop--; + + if (ServiceStatus.dwCheckPoint > dwOldCheckPoint) + { + /* The service is making progress. increment the progress bar */ + SendMessage(hProgBar, PBM_STEPIT, 0, 0); + dwStartTickCount = GetTickCount(); + dwOldCheckPoint = ServiceStatus.dwCheckPoint; + } + else + { + if(GetTickCount() - dwStartTickCount > ServiceStatus.dwWaitHint) + { + /* No progress made within the wait hint */ + break; + } + } } CloseServiceHandle(hSc); _____ Modified: trunk/reactos/subsys/system/servman/query.c --- trunk/reactos/subsys/system/servman/query.c 2006-01-22 23:29:53 UTC (rev 20994) +++ trunk/reactos/subsys/system/servman/query.c 2006-01-22 23:35:43 UTC (rev 20995) @@ -96,15 +96,10 @@ SC_HANDLE hSc = NULL; LPQUERY_SERVICE_CONFIG pServiceConfig = NULL; ENUM_SERVICE_STATUS_PROCESS *Service = NULL; - LVITEM item; DWORD BytesNeeded = 0; - item.mask = LVIF_PARAM; - item.iItem = GetSelectedItem(); - SendMessage(hListView, LVM_GETITEM, 0, (LPARAM)&item); - /* copy pointer to selected service */ - Service = (ENUM_SERVICE_STATUS_PROCESS *)item.lParam; + Service = GetSelectedService(); /* open handle to the SCM */ hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ENUMERATE_SERVICE); _____ Modified: trunk/reactos/subsys/system/servman/start.c --- trunk/reactos/subsys/system/servman/start.c 2006-01-22 23:29:53 UTC (rev 20994) +++ trunk/reactos/subsys/system/servman/start.c 2006-01-22 23:35:43 UTC (rev 20995) @@ -19,17 +19,13 @@ SC_HANDLE hSc; SERVICE_STATUS_PROCESS ServiceStatus; ENUM_SERVICE_STATUS_PROCESS *Service = NULL; - LVITEM item; DWORD BytesNeeded = 0; INT ArgCount = 0; DWORD Loop = 5; //FIXME: testing value. needs better control + DWORD dwStartTickCount, dwOldCheckPoint; - item.mask = LVIF_PARAM; - item.iItem = GetSelectedItem(); - SendMessage(hListView, LVM_GETITEM, 0, (LPARAM)&item); - /* copy pointer to selected service */ - Service = (ENUM_SERVICE_STATUS_PROCESS *)item.lParam; + Service = GetSelectedService(); /* set the progress bar range and step */ hProgBar = GetDlgItem(hProgDlg, IDC_SERVCON_PROGRESS); @@ -70,10 +66,23 @@ return FALSE; } + /* Save the tick count and initial checkpoint. */ + dwStartTickCount = GetTickCount(); + dwOldCheckPoint = ServiceStatus.dwCheckPoint; + /* loop whilst service is not running */ /* FIXME: needs more control adding. 'Loop' is temparary */ while (ServiceStatus.dwCurrentState != SERVICE_RUNNING || !Loop) { + DWORD dwWaitTime; + + dwWaitTime = ServiceStatus.dwWaitHint / 10; + + if( dwWaitTime < 500 ) + dwWaitTime = 500; + else if ( dwWaitTime > 5000 ) + dwWaitTime = 5000; + /* increment the progress bar */ SendMessage(hProgBar, PBM_STEPIT, 0, 0); @@ -91,7 +100,22 @@ GetError(0); return FALSE; } - Loop--; + + if (ServiceStatus.dwCheckPoint > dwOldCheckPoint) + { + /* The service is making progress. increment the progress bar */ + SendMessage(hProgBar, PBM_STEPIT, 0, 0); + dwStartTickCount = GetTickCount(); + dwOldCheckPoint = ServiceStatus.dwCheckPoint; + } + else + { + if(GetTickCount() - dwStartTickCount > ServiceStatus.dwWaitHint) + { + /* No progress made within the wait hint */ + break; + } + } } CloseServiceHandle(hSc);
18 years, 11 months
1
0
0
0
[turner] 20994: Added some error checking after allocations. Part of bug #1110.
by turner@svn.reactos.org
Added some error checking after allocations. Part of bug #1110. Modified: trunk/reactos/lib/kernel32/misc/errormsg.c Modified: trunk/reactos/lib/kernel32/misc/profile.c _____ Modified: trunk/reactos/lib/kernel32/misc/errormsg.c --- trunk/reactos/lib/kernel32/misc/errormsg.c 2006-01-22 23:28:05 UTC (rev 20993) +++ trunk/reactos/lib/kernel32/misc/errormsg.c 2006-01-22 23:29:53 UTC (rev 20994) @@ -197,6 +197,12 @@ } } target = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, 100); + if(target == NULL) + { + HeapFree(GetProcessHeap(),0,from); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return 0; + } t = target; talloced= 100; @@ -250,16 +256,37 @@ if (NULL!=(x=strchr(f,'!'))) { *x='\0'; fmtstr=HeapAlloc(GetProcessHeap(),0,strlen(f)+2); + if(fmtstr == NULL) + { + HeapFree(GetProcessHeap(),0,from); + HeapFree(GetProcessHeap(),0,target); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return 0; + } sprintf(fmtstr,"%%%s",f); f=x+1; } else { fmtstr=HeapAlloc(GetProcessHeap(),0,strlen(f)+2); + if(fmtstr == NULL) + { + HeapFree(GetProcessHeap(),0,from); + HeapFree(GetProcessHeap(),0,target); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return 0; + } sprintf(fmtstr,"%%%s",f); f+=strlen(f); /*at \0*/ } } else { if(!args) break; fmtstr = HeapAlloc(GetProcessHeap(),0,3); + if(fmtstr == NULL) + { + HeapFree(GetProcessHeap(),0,from); + HeapFree(GetProcessHeap(),0,target); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return 0; + } strcpy( fmtstr, "%s" ); } if (args) { @@ -401,6 +428,11 @@ if (dwFlags & FORMAT_MESSAGE_FROM_STRING) { from = HeapAlloc( GetProcessHeap(), 0, (strlenW((LPCWSTR)lpSource) + 1) * sizeof(WCHAR) ); + if(from == NULL) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return 0; + } strcpyW( from, (LPCWSTR)lpSource ); } else { @@ -418,6 +450,12 @@ } target = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, 100 * sizeof(WCHAR) ); + if(target == NULL) + { + HeapFree(GetProcessHeap(),0,from); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return 0; + } t = target; talloced= 100; @@ -472,16 +510,37 @@ if (NULL!=(x=strchrW(f,'!'))) { *x='\0'; fmtstr=HeapAlloc( GetProcessHeap(), 0,(strlenW(f)+2)*sizeof(WCHAR)); + if(fmtstr == NULL) + { + HeapFree(GetProcessHeap(),0,from); + HeapFree(GetProcessHeap(),0,target); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return 0; + } sprintfW(fmtstr,PCNTFMTWSTR,f); f=x+1; } else { fmtstr=HeapAlloc(GetProcessHeap(),0,(strlenW(f)+2)*sizeof(WCHAR)); + if(fmtstr == NULL) + { + HeapFree(GetProcessHeap(),0,from); + HeapFree(GetProcessHeap(),0,target); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return 0; + } sprintfW(fmtstr,PCNTFMTWSTR,f); f+=strlenW(f); /*at \0*/ } } else { if(!args) break; fmtstr = HeapAlloc( GetProcessHeap(),0,3*sizeof(WCHAR)); + if(fmtstr == NULL) + { + HeapFree(GetProcessHeap(),0,from); + HeapFree(GetProcessHeap(),0,target); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return 0; + } strcpyW( fmtstr, FMTWSTR ); } _____ Modified: trunk/reactos/lib/kernel32/misc/profile.c --- trunk/reactos/lib/kernel32/misc/profile.c 2006-01-22 23:28:05 UTC (rev 20993) +++ trunk/reactos/lib/kernel32/misc/profile.c 2006-01-22 23:29:53 UTC (rev 20994) @@ -830,6 +830,11 @@ /* OK, now that CurProfile is definitely free we assign it our new file */ CurProfile->filename = HeapAlloc( GetProcessHeap(), 0, (wcslen(buffer)+1) * sizeof(WCHAR) ); + if(CurProfile->filename == NULL) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } wcscpy( CurProfile->filename, buffer ); if (hFile != INVALID_HANDLE_VALUE) @@ -1061,6 +1066,11 @@ DPRINT(" creating key\n"); } key->value = HeapAlloc( GetProcessHeap(), 0, (wcslen(value) + 1) * sizeof(WCHAR) ); + if(key->value == NULL) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } wcscpy( key->value, value ); CurProfile->changed = TRUE; } @@ -1126,6 +1136,11 @@ LPWSTR p; p = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR)); + if(p == NULL) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } memcpy(p, def_val, len * sizeof(WCHAR)); p[len] = '\0'; pDefVal = p; @@ -1482,6 +1497,12 @@ ret = TRUE; while(*string) { LPWSTR buf = HeapAlloc( GetProcessHeap(), 0, (wcslen(string)+1) * sizeof(WCHAR) ); + if(buf == NULL) + { + RtlLeaveCriticalSection( &PROFILE_CritSect ); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } wcscpy( buf, string ); if((p = wcschr( buf, '='))) { *p = '\0'; @@ -1759,6 +1780,11 @@ /* allocate string buffer for hex chars + checksum hex char + '\0' */ outstring = HeapAlloc( GetProcessHeap(), 0, (bufsize*2 + 2 + 1) * sizeof(WCHAR) ); + if(outstring == NULL) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } p = outstring; for (binbuf = (LPBYTE)buf; binbuf < (LPBYTE)buf+bufsize; binbuf++) {
18 years, 11 months
1
0
0
0
← Newer
1
...
6
7
8
9
10
11
12
...
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