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
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
June 2006
----- 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
19 participants
595 discussions
Start a n
N
ew thread
[janderwald] 22192: fix bug in CmiCreateHiveFreeCellList when a cell has size 0 which leads to inifite loop fix bug in CmiCreateTempHive where only a pointer was allocated for the first cell but not object itself
by janderwald@svn.reactos.org
Author: janderwald Date: Sat Jun 3 16:48:09 2006 New Revision: 22192 URL:
http://svn.reactos.ru/svn/reactos?rev=22192&view=rev
Log: fix bug in CmiCreateHiveFreeCellList when a cell has size 0 which leads to inifite loop fix bug in CmiCreateTempHive where only a pointer was allocated for the first cell but not object itself Modified: trunk/reactos/ntoskrnl/cm/regfile.c (contents, props changed) Modified: trunk/reactos/ntoskrnl/cm/regfile.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/cm/regfile.c?rev=2…
============================================================================== --- trunk/reactos/ntoskrnl/cm/regfile.c (original) +++ trunk/reactos/ntoskrnl/cm/regfile.c Sat Jun 3 16:48:09 2006 @@ -783,10 +783,24 @@ FreeOffset += FreeBlock->CellSize; } - else + else if (FreeBlock->CellSize < 0) { FreeOffset -= FreeBlock->CellSize; } + else + { +#ifdef HIVE_CHECK + /* Check and eventually fix a hive */ + Status = CmiCheckAndFixHive(Hive); + if (!NT_SUCCESS(Status)) + { + DPRINT1("CmiCheckAndFixHive() failed (Status %lx)\n", Status); + return(Status); + } +#else + break; +#endif + } } BlockIndex += Bin->BinSize / REG_BLOCK_SIZE; @@ -1164,7 +1178,7 @@ /* Allocate hive block list */ Hive->BlockList = ExAllocatePool (NonPagedPool, - sizeof(PBLOCK_LIST_ENTRY)); + sizeof(BLOCK_LIST_ENTRY)); if (Hive->BlockList == NULL) { DPRINT1 ("Failed to allocate hive block list\n"); Propchange: trunk/reactos/ntoskrnl/cm/regfile.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -*
18 years, 5 months
1
0
0
0
[hpoussin] 22191: Fix some little bugs
by hpoussin@svn.reactos.org
Author: hpoussin Date: Sat Jun 3 15:47:04 2006 New Revision: 22191 URL:
http://svn.reactos.ru/svn/reactos?rev=22191&view=rev
Log: Fix some little bugs Modified: trunk/reactos/base/system/services/database.c trunk/reactos/base/system/services/groupdb.c trunk/reactos/base/system/services/rpcserver.c trunk/reactos/base/system/services/services.h Modified: trunk/reactos/base/system/services/database.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/system/services/databa…
============================================================================== --- trunk/reactos/base/system/services/database.c (original) +++ trunk/reactos/base/system/services/database.c Sat Jun 3 15:47:04 2006 @@ -741,10 +741,10 @@ } -static NTSTATUS -ScmStartService(PSERVICE Service, - PSERVICE_GROUP Group) -{ +NTSTATUS +ScmStartService(PSERVICE Service) +{ + PSERVICE_GROUP Group = Service->lpGroup; NTSTATUS Status; DPRINT("ScmStartService() called\n"); @@ -849,8 +849,7 @@ (CurrentService->dwTag == CurrentGroup->TagArray[i])) { CurrentService->ServiceVisited = TRUE; - ScmStartService(CurrentService, - CurrentGroup); + ScmStartService(CurrentService); } ServiceEntry = ServiceEntry->Flink; @@ -868,8 +867,7 @@ (CurrentService->ServiceVisited == FALSE)) { CurrentService->ServiceVisited = TRUE; - ScmStartService(CurrentService, - CurrentGroup); + ScmStartService(CurrentService); } ServiceEntry = ServiceEntry->Flink; @@ -889,8 +887,7 @@ (CurrentService->ServiceVisited == FALSE)) { CurrentService->ServiceVisited = TRUE; - ScmStartService(CurrentService, - NULL); + ScmStartService(CurrentService); } ServiceEntry = ServiceEntry->Flink; @@ -907,8 +904,7 @@ (CurrentService->ServiceVisited == FALSE)) { CurrentService->ServiceVisited = TRUE; - ScmStartService(CurrentService, - NULL); + ScmStartService(CurrentService); } ServiceEntry = ServiceEntry->Flink; Modified: trunk/reactos/base/system/services/groupdb.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/system/services/groupd…
============================================================================== --- trunk/reactos/base/system/services/groupdb.c (original) +++ trunk/reactos/base/system/services/groupdb.c Sat Jun 3 15:47:04 2006 @@ -63,6 +63,7 @@ wcscpy(lpGroup->szGroupName, lpGroupName); lpGroup->lpGroupName = lpGroup->szGroupName; lpGroup->dwRefCount = 1; + lpService->lpGroup = lpGroup; InsertTailList(&UnknownGroupListHead, &lpGroup->GroupListEntry); Modified: trunk/reactos/base/system/services/rpcserver.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/system/services/rpcser…
============================================================================== --- trunk/reactos/base/system/services/rpcserver.c (original) +++ trunk/reactos/base/system/services/rpcserver.c Sat Jun 3 15:47:04 2006 @@ -1605,7 +1605,7 @@ LPQUERY_SERVICE_CONFIGW lpConfig; LPWSTR lpStr; - DPRINT1("ScmrQueryServiceConfigW() called\n"); + DPRINT("ScmrQueryServiceConfigW() called\n"); if (ScmShutdown) return ERROR_SHUTDOWN_IN_PROGRESS; @@ -1725,7 +1725,7 @@ /* FIXME: Unlock the service database */ - DPRINT1("ScmrQueryServiceConfigW() done\n"); + DPRINT("ScmrQueryServiceConfigW() done\n"); return dwError; } @@ -1755,6 +1755,7 @@ DWORD dwError = ERROR_SUCCESS; PSERVICE_HANDLE hSvc; PSERVICE lpService = NULL; + NTSTATUS Status; DPRINT1("ScmrStartServiceW() called\n"); @@ -1788,7 +1789,10 @@ if (lpService->bDeleted) return ERROR_SERVICE_MARKED_FOR_DELETE; - /* FIXME: Start the service */ + /* Start the service */ + Status = STATUS_SUCCESS; /* FIXME: ScmStartService(lpService); */ + if (!NT_SUCCESS(Status)) + return RtlNtStatusToDosError(Status); return dwError; } Modified: trunk/reactos/base/system/services/services.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/system/services/servic…
============================================================================== --- trunk/reactos/base/system/services/services.h (original) +++ trunk/reactos/base/system/services/services.h Sat Jun 3 15:47:04 2006 @@ -121,7 +121,7 @@ /* services.c */ VOID PrintString(LPCSTR fmt, ...); - +NTSTATUS ScmStartService(PSERVICE Service); /* EOF */
18 years, 5 months
1
0
0
0
[gedmurphy] 22189: [AUDIT] services.exe Eric Kohl and Filip Navara have both confirmed their contributions are clean. Public documentation, like "Inside Microsoft Windows 2000", and tests were used to implement it
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Sat Jun 3 15:25:47 2006 New Revision: 22189 URL:
http://svn.reactos.ru/svn/reactos?rev=22189&view=rev
Log: [AUDIT] services.exe Eric Kohl and Filip Navara have both confirmed their contributions are clean. Public documentation, like "Inside Microsoft Windows 2000", and tests were used to implement it Modified: trunk/reactos/base/system/services/config.c (props changed) trunk/reactos/base/system/services/database.c (props changed) trunk/reactos/base/system/services/driver.c (props changed) trunk/reactos/base/system/services/groupdb.c (props changed) trunk/reactos/base/system/services/rpcserver.c (props changed) trunk/reactos/base/system/services/services.c (props changed) trunk/reactos/base/system/services/services.h (props changed) trunk/reactos/base/system/services/services.rc (props changed) Propchange: trunk/reactos/base/system/services/config.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/system/services/database.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/system/services/driver.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/system/services/groupdb.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/system/services/rpcserver.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/system/services/services.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/system/services/services.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/system/services/services.rc ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -*
18 years, 5 months
1
0
0
0
[jimtabor] 22188: Fix compiling. Well for me anyway.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Sat Jun 3 11:00:09 2006 New Revision: 22188 URL:
http://svn.reactos.ru/svn/reactos?rev=22188&view=rev
Log: Fix compiling. Well for me anyway. Modified: trunk/reactos/hal/hal/hal.c Modified: trunk/reactos/hal/hal/hal.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/hal/hal/hal.c?rev=22188&r1=…
============================================================================== --- trunk/reactos/hal/hal/hal.c (original) +++ trunk/reactos/hal/hal/hal.c Sat Jun 3 11:00:09 2006 @@ -1051,4 +1051,28 @@ UNIMPLEMENTED; } +/* + * @unimplemented + */ +KIRQL +FASTCALL +KeAcquireQueuedSpinLock(IN PKLOCK_QUEUE_HANDLE LockHandle) +{ + UNIMPLEMENTED; + return 0; +} + +/* + * @unimplemented + */ +VOID +FASTCALL +KeReleaseQueuedSpinLock(IN PKLOCK_QUEUE_HANDLE LockHandle, + IN KIRQL OldIrql) +{ + UNIMPLEMENTED; +} + + + /* EOF */
18 years, 5 months
1
0
0
0
[fireball] 22187: Add forgotten KeAcquire/ReleaseQueuedSpinLock exported funcs to hal.def
by fireball@svn.reactos.org
Author: fireball Date: Sat Jun 3 00:15:54 2006 New Revision: 22187 URL:
http://svn.reactos.ru/svn/reactos?rev=22187&view=rev
Log: Add forgotten KeAcquire/ReleaseQueuedSpinLock exported funcs to hal.def Modified: trunk/reactos/hal/hal/hal.def trunk/reactos/hal/halx86/mp/spinlock.c Modified: trunk/reactos/hal/hal/hal.def URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/hal/hal/hal.def?rev=22187&r…
============================================================================== --- trunk/reactos/hal/hal/hal.def (original) +++ trunk/reactos/hal/hal/hal.def Sat Jun 3 00:15:54 2006 @@ -72,6 +72,7 @@ KeAcquireSpinLock@8 @KeAcquireInStackQueuedSpinLock@8 @KeAcquireSpinLockRaiseToSynch@4 +@KeAcquireQueuedSpinLock@4 KeGetCurrentIrql@0 KeFlushWriteBuffer@0 KeLowerIrql@4 @@ -81,6 +82,7 @@ KeRaiseIrqlToSynchLevel@0 @KeReleaseInStackQueuedSpinLock@4 KeReleaseSpinLock@8 +@KeReleaseQueuedSpinLock@8 KeStallExecutionProcessor@4 @KfAcquireSpinLock@4 @KfLowerIrql@4 Modified: trunk/reactos/hal/halx86/mp/spinlock.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/hal/halx86/mp/spinlock.c?re…
============================================================================== --- trunk/reactos/hal/halx86/mp/spinlock.c (original) +++ trunk/reactos/hal/halx86/mp/spinlock.c Sat Jun 3 00:15:54 2006 @@ -130,4 +130,26 @@ UNIMPLEMENTED; } +/* + * @unimplemented + */ +KIRQL +FASTCALL +KeAcquireQueuedSpinLock(IN PKLOCK_QUEUE_HANDLE LockHandle) +{ + UNIMPLEMENTED; + return 0; +} + +/* + * @unimplemented + */ +VOID +FASTCALL +KeReleaseQueuedSpinLock(IN PKLOCK_QUEUE_HANDLE LockHandle, + IN KIRQL OldIrql) +{ + UNIMPLEMENTED; +} + /* EOF */
18 years, 5 months
1
0
0
0
[fireball] 22186: [AUDIT] halmp.dll - Most functions are 2 lines - And other funcs are simply UNIMPLEMENTED
by fireball@svn.reactos.org
Author: fireball Date: Sat Jun 3 00:14:40 2006 New Revision: 22186 URL:
http://svn.reactos.ru/svn/reactos?rev=22186&view=rev
Log: [AUDIT] halmp.dll - Most functions are 2 lines - And other funcs are simply UNIMPLEMENTED Modified: trunk/reactos/hal/halx86/mp/spinlock.c (props changed) Propchange: trunk/reactos/hal/halx86/mp/spinlock.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -*
18 years, 5 months
1
0
0
0
[janderwald] 22185: return ERROR_INVALID_HANDLE when hKey is invalid ReactOS passes now 88 of 89 advapi32_winetest registry tests
by janderwald@svn.reactos.org
Author: janderwald Date: Fri Jun 2 23:02:21 2006 New Revision: 22185 URL:
http://svn.reactos.ru/svn/reactos?rev=22185&view=rev
Log: return ERROR_INVALID_HANDLE when hKey is invalid ReactOS passes now 88 of 89 advapi32_winetest registry tests Modified: trunk/reactos/dll/win32/advapi32/reg/reg.c Modified: trunk/reactos/dll/win32/advapi32/reg/reg.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/advapi32/reg/reg.…
============================================================================== --- trunk/reactos/dll/win32/advapi32/reg/reg.c (original) +++ trunk/reactos/dll/win32/advapi32/reg/reg.c Fri Jun 2 23:02:21 2006 @@ -2772,6 +2772,11 @@ PHKEY phkResult) { TRACE("RegOpenKeyA hKey 0x%x lpSubKey %s phkResult %p\n", hKey, lpSubKey, phkResult); + + if (!hKey && lpSubKey && phkResult) + { + return ERROR_INVALID_HANDLE; + } if (!lpSubKey || !*lpSubKey) { @@ -2798,6 +2803,11 @@ PHKEY phkResult) { TRACE("RegOpenKeyW hKey 0x%x lpSubKey %S phkResult %p\n", hKey, lpSubKey, phkResult); + + if (!hKey && lpSubKey && phkResult) + { + return ERROR_INVALID_HANDLE; + } if (!lpSubKey || !*lpSubKey) {
18 years, 5 months
1
0
0
0
[gedmurphy] 22184: - remove all reliance on 'extern' data, using abstraction. - store pointer to currently selected service in info struct so we don't have to keep calling it - rewrite create.c making it more modular. Still has some missing features. - lots of bugfixes and small improvements
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Fri Jun 2 20:47:39 2006 New Revision: 22184 URL:
http://svn.reactos.ru/svn/reactos?rev=22184&view=rev
Log: - remove all reliance on 'extern' data, using abstraction. - store pointer to currently selected service in info struct so we don't have to keep calling it - rewrite create.c making it more modular. Still has some missing features. - lots of bugfixes and small improvements Modified: trunk/reactos/base/applications/servman/En.rc trunk/reactos/base/applications/servman/control.c trunk/reactos/base/applications/servman/create.c trunk/reactos/base/applications/servman/delete.c trunk/reactos/base/applications/servman/mainwnd.c trunk/reactos/base/applications/servman/misc.c trunk/reactos/base/applications/servman/precomp.h trunk/reactos/base/applications/servman/propsheet.c trunk/reactos/base/applications/servman/query.c trunk/reactos/base/applications/servman/servman.c trunk/reactos/base/applications/servman/start.c trunk/reactos/base/applications/servman/stop.c Modified: trunk/reactos/base/applications/servman/En.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/servman/E…
============================================================================== --- trunk/reactos/base/applications/servman/En.rc (original) +++ trunk/reactos/base/applications/servman/En.rc Fri Jun 2 20:47:39 2006 @@ -64,7 +64,7 @@ FONT 8,"Tahoma",0,0 STYLE WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME BEGIN - LTEXT "Service Manager v0.5\nCopyright (C) 2005-2006\nby Ged Murphy (gedmurphy(a)gmail.com)", IDC_STATIC, 48, 7, 130, 26 + LTEXT "Service Manager v0.5.1\nCopyright (C) 2005-2006\nby Ged Murphy (gedmurphy(a)gmail.com)", IDC_STATIC, 48, 7, 130, 26 PUSHBUTTON "Close", IDOK, 75, 162, 44, 15 ICON IDI_SM_ICON, IDC_STATIC, 10, 10, 7, 30 EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP | ES_READONLY | ES_MULTILINE @@ -209,7 +209,7 @@ IDS_PROGRESS_INFO_START "ReactOS is attempting to start the following service" IDS_PROGRESS_INFO_STOP "ReactOS is attempting to stop the following service" IDS_CREATE_SUCCESS "Service Created Succesfully" - IDS_CREATE_REQ "* = required fields" + IDS_CREATE_REQ "Fields marked with an\nasterix are mandatory" IDS_DELETE_STOP "You must manually stop the service before deleting!" END Modified: trunk/reactos/base/applications/servman/control.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/servman/c…
============================================================================== --- trunk/reactos/base/applications/servman/control.c (original) +++ trunk/reactos/base/applications/servman/control.c Fri Jun 2 20:47:39 2006 @@ -16,7 +16,6 @@ HWND hProgBar; SC_HANDLE hSCManager; SC_HANDLE hSc; - ENUM_SERVICE_STATUS_PROCESS *Service = NULL; SERVICE_STATUS_PROCESS ServiceStatus; SERVICE_STATUS Status; LVITEM item; @@ -30,9 +29,6 @@ 0, (LPARAM)&item); - /* copy pointer to selected service */ - Service = (ENUM_SERVICE_STATUS_PROCESS *)item.lParam; - /* set the progress bar range and step */ hProgBar = GetDlgItem(Info->hProgDlg, IDC_SERVCON_PROGRESS); @@ -40,6 +36,7 @@ PBM_SETRANGE, 0, MAKELPARAM(0, PROGRESSRANGE)); + SendMessage(hProgBar, PBM_SETSTEP, (WPARAM)1, @@ -57,7 +54,7 @@ /* open handle to the service */ hSc = OpenService(hSCManager, - Service->lpServiceName, + Info->CurrentService->lpServiceName, SC_MANAGER_ALL_ACCESS); if (hSc == NULL) { Modified: trunk/reactos/base/applications/servman/create.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/servman/c…
============================================================================== --- trunk/reactos/base/applications/servman/create.c (original) +++ trunk/reactos/base/applications/servman/create.c Fri Jun 2 20:47:39 2006 @@ -9,22 +9,30 @@ #include "precomp.h" -extern HINSTANCE hInstance; -BOOL bHelpOpen = FALSE; - - -BOOL Create(LPTSTR ServiceName, - LPTSTR DisplayName, - LPTSTR BinPath, - LPTSTR Description, - LPTSTR Options) +typedef struct _CREATE_DATA +{ + HWND hSelf; + LPTSTR ServiceName; + LPTSTR DisplayName; + LPTSTR BinPath; + LPTSTR Description; + LPTSTR Options; + +} CREATE_DATA, *PCREATE_DATA; + +static BOOL bHelpOpen = FALSE; + +static BOOL +DoCreate(PCREATE_DATA Data) { SC_HANDLE hSCManager; SC_HANDLE hSc; TCHAR Buf[32]; /* open handle to the SCM */ - hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); + hSCManager = OpenSCManager(NULL, + NULL, + SC_MANAGER_ALL_ACCESS); if (hSCManager == NULL) { GetError(); @@ -32,13 +40,13 @@ } hSc = CreateService(hSCManager, - ServiceName, - DisplayName, + Data->ServiceName, + Data->DisplayName, SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, SERVICE_DEMAND_START, SERVICE_ERROR_NORMAL, - BinPath, + Data->BinPath, NULL, NULL, NULL, @@ -48,25 +56,204 @@ if (hSc == NULL) { GetError(); + CloseServiceHandle(hSCManager); return FALSE; } - SetDescription(ServiceName, Description); - - LoadString(hInstance, IDS_CREATE_SUCCESS, Buf, - sizeof(Buf) / sizeof(TCHAR)); + /* Set the service description in the registry + * CreateService does not do this for us */ + SetDescription(Data->ServiceName, + Data->Description); + + /* report success to user */ + LoadString(hInstance, + IDS_CREATE_SUCCESS, + Buf, + sizeof(Buf) / sizeof(TCHAR)); DisplayString(Buf); + CloseServiceHandle(hSCManager); CloseServiceHandle(hSc); + return TRUE; } -#ifdef _MSC_VER -#pragma warning(disable : 4100) -#endif +static BOOL +GetDataFromDialog(PCREATE_DATA Data) +{ + HWND hwnd; + TCHAR Buf[64]; + INT iLen = 0; + + /* get service name */ + hwnd = GetDlgItem(Data->hSelf, + IDC_CREATE_SERVNAME); + iLen = GetWindowTextLength(hwnd); + if (iLen != 0) + { + Data->ServiceName = HeapAlloc(ProcessHeap, + 0, + (iLen+1) * sizeof(TCHAR)); + if (Data->ServiceName != NULL) + { + GetWindowText(hwnd, + Data->ServiceName, + iLen+1); + } + else + return FALSE; + } + else + { + LoadString(hInstance, + IDS_CREATE_REQ, + Buf, + sizeof(Buf)); + DisplayString(Buf); + SetFocus(hwnd); + return FALSE; + } + + /* get display name */ + iLen = 0; + hwnd = GetDlgItem(Data->hSelf, + IDC_CREATE_DISPNAME); + iLen = GetWindowTextLength(hwnd); + if (iLen != 0) + { + Data->DisplayName = HeapAlloc(ProcessHeap, + 0, + (iLen+1) * sizeof(TCHAR)); + if (Data->DisplayName != NULL) + { + GetWindowText(hwnd, + Data->DisplayName, + iLen+1); + } + else + return FALSE; + } + else + { + LoadString(hInstance, + IDS_CREATE_REQ, + Buf, + sizeof(Buf)); + DisplayString(Buf); + SetFocus(hwnd); + return FALSE; + } + + /* get binary path */ + iLen = 0; + hwnd = GetDlgItem(Data->hSelf, + IDC_CREATE_PATH); + iLen = GetWindowTextLength(hwnd); + if (iLen != 0) + { + Data->BinPath = HeapAlloc(ProcessHeap, + 0, + (iLen+1) * sizeof(TCHAR)); + if (Data->BinPath != NULL) + { + GetWindowText(hwnd, + Data->BinPath, + iLen+1); + } + else + return FALSE; + } + else + { + LoadString(hInstance, + IDS_CREATE_REQ, + Buf, + sizeof(Buf)); + DisplayString(Buf); + SetFocus(hwnd); + return FALSE; + } + + /* get description */ + iLen = 0; + hwnd = GetDlgItem(Data->hSelf, + IDC_CREATE_DESC); + iLen = GetWindowTextLength(hwnd); + if (iLen != 0) + { + Data->Description = HeapAlloc(ProcessHeap, + 0, + (iLen+1) * sizeof(TCHAR)); + if (Data->Description != NULL) + { + GetWindowText(hwnd, + Data->Description, + iLen+1); + } + else + return FALSE; + } + + + /* get options */ + iLen = 0; + hwnd = GetDlgItem(Data->hSelf, + IDC_CREATE_PATH); + iLen = GetWindowTextLength(hwnd); + if (iLen != 0) + { + Data->Options = HeapAlloc(ProcessHeap, + 0, + (iLen+1) * sizeof(TCHAR)); + if (Data->Options != NULL) + { + GetWindowText(hwnd, + Data->Options, + iLen+1); + } + else + return FALSE; + } + + return TRUE; +} + +static VOID +FreeMemory(PCREATE_DATA Data) +{ + if (Data->ServiceName != NULL) + HeapFree(ProcessHeap, + 0, + Data->ServiceName); + if (Data->DisplayName != NULL) + HeapFree(ProcessHeap, + 0, + Data->DisplayName); + if (Data->BinPath != NULL) + HeapFree(ProcessHeap, + 0, + Data->BinPath); + if (Data->Description != NULL) + HeapFree(ProcessHeap, + 0, + Data->Description); + if (Data->Options != NULL) + HeapFree(ProcessHeap, + 0, + Data->Options); + + HeapFree(ProcessHeap, + 0, + Data); +} + + BOOL CALLBACK -CreateHelpDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +CreateHelpDialogProc(HWND hDlg, + UINT message, + WPARAM wParam, + LPARAM lParam) { HWND hHelp; HICON hIcon = NULL; @@ -74,31 +261,45 @@ 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, - sizeof(Buf) / sizeof(TCHAR)); - - SetWindowText(hHelp, Buf); - - return TRUE; - - case WM_COMMAND: - if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL)) - { - DestroyIcon(hIcon); - DestroyWindow(hDlg); + 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, + sizeof(Buf) / sizeof(TCHAR)); + + SetWindowText(hHelp, + Buf); + return TRUE; } - break; - - case WM_DESTROY: - bHelpOpen = FALSE; - break; + + case WM_COMMAND: + { + if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL)) + { + bHelpOpen = FALSE; + DestroyIcon(hIcon); + DestroyWindow(hDlg); + return TRUE; + } + break; + } } return FALSE; @@ -106,160 +307,94 @@ BOOL CALLBACK -CreateDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +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: + 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)) { - LPTSTR ServiceName = NULL; - LPTSTR DisplayName = NULL; - LPTSTR BinPath = NULL; - LPTSTR Description = NULL; - LPTSTR Options = NULL; - HWND hwnd; - TCHAR Buf[32]; - INT iLen = 0; - - /* get service name */ - hwnd = GetDlgItem(hDlg, IDC_CREATE_SERVNAME); - iLen = GetWindowTextLength(hwnd); - if (iLen != 0) + case IDOK: { - ServiceName = HeapAlloc(GetProcessHeap(), 0, iLen+1); - if (ServiceName != NULL) + PCREATE_DATA Data; + + Data = HeapAlloc(ProcessHeap, + HEAP_ZERO_MEMORY, + sizeof(CREATE_DATA)); + if (Data != NULL) { - GetWindowText(hwnd, ServiceName, iLen+1); + Data->hSelf = hDlg; + + if (GetDataFromDialog(Data)) + { + DoCreate(Data); + } + else + { + /* Something went wrong, leave the dialog + * open so they can try again */ + FreeMemory(Data); + break; + } + + FreeMemory(Data); } + DestroyIcon(hIcon); + EndDialog(hDlg, + LOWORD(wParam)); + return TRUE; } - else + + case IDCANCEL: { - LoadString(hInstance, IDS_CREATE_REQ, Buf, - sizeof(Buf) / sizeof(TCHAR)); - DisplayString(Buf); - SetFocus(hwnd); - break; + DestroyIcon(hIcon); + EndDialog(hDlg, + LOWORD(wParam)); + return TRUE; } - /* get display name */ - iLen = 0; - hwnd = GetDlgItem(hDlg, IDC_CREATE_DISPNAME); - iLen = GetWindowTextLength(hwnd); - if (iLen != 0) + case ID_CREATE_HELP: { - DisplayName = HeapAlloc(GetProcessHeap(), 0, iLen+1); - if (DisplayName != NULL) - GetWindowText(hwnd, DisplayName, iLen+1); - - } - else - { - LoadString(hInstance, IDS_CREATE_REQ, Buf, - sizeof(Buf) / sizeof(TCHAR)); - DisplayString(Buf); - SetFocus(hwnd); - break; - } - - /* 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); - - } - else - { - LoadString(hInstance, IDS_CREATE_REQ, Buf, - sizeof(Buf) / sizeof(TCHAR)); - DisplayString(Buf); - SetFocus(hwnd); - break; - } - - /* get description */ - iLen = 0; - hwnd = GetDlgItem(hDlg, IDC_CREATE_DESC); - 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: - { - HWND hHelp; - - if (! bHelpOpen) - { - hHelp = CreateDialog(hInstance, - MAKEINTRESOURCE(IDD_DLG_HELP_OPTIONS), - hDlg, - (DLGPROC)CreateHelpDialogProc); - if(hHelp != NULL) + HWND hHelp; + + if (! bHelpOpen) { - ShowWindow(hHelp, SW_SHOW); - bHelpOpen = TRUE; + hHelp = CreateDialog(hInstance, + MAKEINTRESOURCE(IDD_DLG_HELP_OPTIONS), + hDlg, + (DLGPROC)CreateHelpDialogProc); + if(hHelp != NULL) + { + bHelpOpen = TRUE; + } } } + break; } - break; - } - + } } return FALSE; Modified: trunk/reactos/base/applications/servman/delete.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/servman/d…
============================================================================== --- trunk/reactos/base/applications/servman/delete.c (original) +++ trunk/reactos/base/applications/servman/delete.c Fri Jun 2 20:47:39 2006 @@ -15,7 +15,6 @@ { SC_HANDLE hSCManager; SC_HANDLE hSc; - ENUM_SERVICE_STATUS_PROCESS *Service = NULL; /* open handle to the SCM */ hSCManager = OpenSCManager(NULL, @@ -27,23 +26,23 @@ return FALSE; } - /* copy pointer to selected service */ - Service = GetSelectedService(Info); - - /* get a handle to the service requested for starting */ + /* get a handle to the service requested for deleting */ hSc = OpenService(hSCManager, - Service->lpServiceName, + Info->CurrentService->lpServiceName, DELETE); if (hSc == NULL) { GetError(); + CloseServiceHandle(hSCManager); return FALSE; } - /* start the service opened */ + /* delete the service opened */ if (! DeleteService(hSc)) { GetError(); + CloseServiceHandle(hSCManager); + CloseServiceHandle(hSc); return FALSE; } @@ -55,9 +54,6 @@ } -#ifdef _MSC_VER -#pragma warning(disable : 4100) -#endif BOOL CALLBACK DeleteDialogProc(HWND hDlg, UINT message, @@ -65,76 +61,80 @@ LPARAM lParam) { PMAIN_WND_INFO Info = NULL; - ENUM_SERVICE_STATUS_PROCESS *Service = NULL; HICON hIcon = NULL; TCHAR Buf[1000]; LVITEM item; switch (message) { - case WM_INITDIALOG: - { - Info = (PMAIN_WND_INFO)lParam; + case WM_INITDIALOG: + { + Info = (PMAIN_WND_INFO)lParam; - hIcon = LoadImage(hInstance, - MAKEINTRESOURCE(IDI_SM_ICON), - IMAGE_ICON, - 16, - 16, - 0); + hIcon = LoadImage(hInstance, + MAKEINTRESOURCE(IDI_SM_ICON), + IMAGE_ICON, + 16, + 16, + 0); - SendMessage(hDlg, - WM_SETICON, - ICON_SMALL, - (LPARAM)hIcon); + SendMessage(hDlg, + WM_SETICON, + ICON_SMALL, + (LPARAM)hIcon); - /* get pointer to selected service */ - Service = GetSelectedService(Info); - - SendDlgItemMessage(hDlg, - IDC_DEL_NAME, - WM_SETTEXT, - 0, - (LPARAM)Service->lpDisplayName); + SendDlgItemMessage(hDlg, + IDC_DEL_NAME, + WM_SETTEXT, + 0, + (LPARAM)Info->CurrentService->lpDisplayName); - item.mask = LVIF_TEXT; - item.iItem = Info->SelectedItem; - item.iSubItem = 1; - item.pszText = Buf; - item.cchTextMax = sizeof(Buf); - SendMessage(Info->hListView, - LVM_GETITEM, - 0, - (LPARAM)&item); + item.mask = LVIF_TEXT; + item.iItem = Info->SelectedItem; + item.iSubItem = 1; + item.pszText = Buf; + item.cchTextMax = sizeof(Buf); + SendMessage(Info->hListView, + LVM_GETITEM, + 0, + (LPARAM)&item); - SendDlgItemMessage(hDlg, - IDC_DEL_DESC, - WM_SETTEXT, - 0, - (LPARAM)Buf); + SendDlgItemMessage(hDlg, + IDC_DEL_DESC, + WM_SETTEXT, + 0, + (LPARAM)Buf); - return TRUE; - } + SetFocus(GetDlgItem(hDlg, IDCANCEL)); - case WM_COMMAND: - switch (LOWORD(wParam)) + return TRUE; + } + + case WM_COMMAND: { - case IDOK: - if (DoDeleteService(Info, hDlg)) - (void)ListView_DeleteItem(Info->hListView, - Info->SelectedItem); + switch (LOWORD(wParam)) + { + case IDOK: + { + if (DoDeleteService(Info, hDlg)) + (void)ListView_DeleteItem(Info->hListView, + Info->SelectedItem); - DestroyIcon(hIcon); - EndDialog(hDlg, - LOWORD(wParam)); - return TRUE; + DestroyIcon(hIcon); + EndDialog(hDlg, + LOWORD(wParam)); + return TRUE; + } - case IDCANCEL: - DestroyIcon(hIcon); - EndDialog(hDlg, - LOWORD(wParam)); - return TRUE; + case IDCANCEL: + { + DestroyIcon(hIcon); + EndDialog(hDlg, + LOWORD(wParam)); + return TRUE; + } + } } } Modified: trunk/reactos/base/applications/servman/mainwnd.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/servman/m…
============================================================================== --- trunk/reactos/base/applications/servman/mainwnd.c (original) +++ trunk/reactos/base/applications/servman/mainwnd.c Fri Jun 2 20:47:39 2006 @@ -13,7 +13,6 @@ BOOL bSortAscending = TRUE; -extern HWND hwndGenDlg; /* Toolbar buttons */ TBBUTTON tbb [NUM_BUTTONS] = @@ -43,19 +42,24 @@ }; -VOID SetView(HWND hListView, DWORD View) +static VOID +SetListViewStyle(HWND hListView, + DWORD View) { DWORD Style = GetWindowLong(hListView, GWL_STYLE); if ((Style & LVS_TYPEMASK) != View) - SetWindowLong(hListView, GWL_STYLE, (Style & ~LVS_TYPEMASK) | View); + { + SetWindowLong(hListView, + GWL_STYLE, + (Style & ~LVS_TYPEMASK) | View); + } } VOID SetMenuAndButtonStates(PMAIN_WND_INFO Info) { HMENU hMainMenu; - ENUM_SERVICE_STATUS_PROCESS *Service = NULL; DWORD Flags, State; /* get handle to menu */ @@ -85,11 +89,8 @@ if (Info->SelectedItem != NO_ITEM_SELECTED) { - /* get pointer to selected service */ - Service = GetSelectedService(Info); - - Flags = Service->ServiceStatusProcess.dwControlsAccepted; - State = Service->ServiceStatusProcess.dwCurrentState; + Flags = Info->CurrentService->ServiceStatusProcess.dwControlsAccepted; + State = Info->CurrentService->ServiceStatusProcess.dwCurrentState; if (State == SERVICE_STOPPED) { @@ -135,7 +136,8 @@ } -INT CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort) +static INT CALLBACK +CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort) { ENUM_SERVICE_STATUS_PROCESS *Param1; ENUM_SERVICE_STATUS_PROCESS *Param2; @@ -464,11 +466,7 @@ case ID_DELETE: { - ENUM_SERVICE_STATUS_PROCESS *Service = NULL; - - Service = GetSelectedService(Info); - - if (Service->ServiceStatusProcess.dwCurrentState != SERVICE_RUNNING) + if (Info->CurrentService->ServiceStatusProcess.dwCurrentState != SERVICE_RUNNING) { DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_DLG_DELETE), @@ -547,23 +545,23 @@ break; case ID_VIEW_LARGE: - SetView(Info->hListView, - LVS_ICON); + SetListViewStyle(Info->hListView, + LVS_ICON); break; case ID_VIEW_SMALL: - SetView(Info->hListView, - LVS_SMALLICON); + SetListViewStyle(Info->hListView, + LVS_SMALLICON); break; case ID_VIEW_LIST: - SetView(Info->hListView, - LVS_LIST); + SetListViewStyle(Info->hListView, + LVS_LIST); break; case ID_VIEW_DETAILS: - SetView(Info->hListView, - LVS_REPORT); + SetListViewStyle(Info->hListView, + LVS_REPORT); break; case ID_VIEW_CUSTOMIZE: @@ -606,6 +604,7 @@ /* Initialize the main window context */ Info->hMainWnd = hwnd; + Info->SelectedItem = NO_ITEM_SELECTED; SetWindowLongPtr(hwnd, GWLP_USERDATA, @@ -670,7 +669,6 @@ case LVN_ITEMCHANGED: { LPNMLISTVIEW pnmv = (LPNMLISTVIEW) lParam; - ENUM_SERVICE_STATUS_PROCESS *Service = NULL; HMENU hMainMenu; /* get handle to menu */ @@ -680,9 +678,11 @@ if (GetMenuState(hMainMenu, ID_PROP, MF_BYCOMMAND) != MF_ENABLED) + { EnableMenuItem(hMainMenu, ID_PROP, MF_ENABLED); + } /* activate delete menu item, if not already */ if (GetMenuState(hMainMenu, @@ -698,20 +698,20 @@ } - /* globally set selected service */ + /* set selected service */ Info->SelectedItem = pnmv->iItem; + + /* get pointer to selected service */ + Info->CurrentService = GetSelectedService(Info); /* alter options for the service */ SetMenuAndButtonStates(Info); - - /* get pointer to selected service */ - Service = GetSelectedService(Info); /* set current selected service in the status bar */ SendMessage(Info->hStatus, SB_SETTEXT, 1, - (LPARAM)Service->lpDisplayName); + (LPARAM)Info->CurrentService->lpDisplayName); /* show the properties button */ SendMessage(Info->hTool, Modified: trunk/reactos/base/applications/servman/misc.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/servman/m…
============================================================================== --- trunk/reactos/base/applications/servman/misc.c (original) +++ trunk/reactos/base/applications/servman/misc.c Fri Jun 2 20:47:39 2006 @@ -1,3 +1,12 @@ +/* + * PROJECT: ReactOS Services + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/servman/misc.c + * PURPOSE: miscallanous functions + * COPYRIGHT: Copyright 2006 Ged Murphy <gedmurphy(a)gmail.com> + * + */ + #include "precomp.h" static INT @@ -201,7 +210,7 @@ VOID DisplayString(PTCHAR Msg) { - MessageBox(NULL, Msg, _T("Note!"), MB_OK); + MessageBox(NULL, Msg, _T("Note!"), MB_ICONEXCLAMATION|MB_OK); } Modified: trunk/reactos/base/applications/servman/precomp.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/servman/p…
============================================================================== --- trunk/reactos/base/applications/servman/precomp.h (original) +++ trunk/reactos/base/applications/servman/precomp.h Fri Jun 2 20:47:39 2006 @@ -49,6 +49,7 @@ /* Stores the current selected service */ ENUM_SERVICE_STATUS_PROCESS *CurrentService; + /* selection number in the list view */ INT SelectedItem; struct _PROP_DLG_INFO *PropSheet; Modified: trunk/reactos/base/applications/servman/propsheet.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/servman/p…
============================================================================== --- trunk/reactos/base/applications/servman/propsheet.c (original) +++ trunk/reactos/base/applications/servman/propsheet.c Fri Jun 2 20:47:39 2006 @@ -9,42 +9,36 @@ #include "precomp.h" -HWND hwndGenDlg; - static VOID SetButtonStates(PMAIN_WND_INFO Info) { HWND hButton; - ENUM_SERVICE_STATUS_PROCESS *Service = NULL; DWORD Flags, State; - /* get pointer to selected service */ - Service = GetSelectedService(Info); - - Flags = Service->ServiceStatusProcess.dwControlsAccepted; - State = Service->ServiceStatusProcess.dwCurrentState; + Flags = Info->CurrentService->ServiceStatusProcess.dwControlsAccepted; + State = Info->CurrentService->ServiceStatusProcess.dwCurrentState; if (State == SERVICE_STOPPED) { - hButton = GetDlgItem(hwndGenDlg, IDC_START); + hButton = GetDlgItem(Info->PropSheet->hwndGenDlg, IDC_START); EnableWindow (hButton, TRUE); } if ( (Flags & SERVICE_ACCEPT_STOP) && (State == SERVICE_RUNNING) ) { - hButton = GetDlgItem(hwndGenDlg, IDC_STOP); + hButton = GetDlgItem(Info->PropSheet->hwndGenDlg, IDC_STOP); EnableWindow (hButton, TRUE); } if ( (Flags & SERVICE_ACCEPT_PAUSE_CONTINUE) && (State == SERVICE_RUNNING) ) { - hButton = GetDlgItem(hwndGenDlg, IDC_PAUSE); + hButton = GetDlgItem(Info->PropSheet->hwndGenDlg, IDC_PAUSE); EnableWindow (hButton, TRUE); } if ( (Flags & SERVICE_ACCEPT_STOP) && (State == SERVICE_RUNNING) ) { - hButton = GetDlgItem(hwndGenDlg, IDC_PAUSE); + hButton = GetDlgItem(Info->PropSheet->hwndGenDlg, IDC_PAUSE); EnableWindow (hButton, TRUE); } } @@ -54,7 +48,7 @@ * values and sets it to value of the selected item */ static VOID -SetStartupType(LPTSTR lpServiceName) +SetStartupType(PMAIN_WND_INFO Info) { HWND hList; HKEY hKey; @@ -65,14 +59,18 @@ TCHAR KeyBuf[300]; /* open the registry key for the service */ - _sntprintf(KeyBuf, sizeof(KeyBuf) / sizeof(TCHAR), Path, lpServiceName); + _sntprintf(KeyBuf, + sizeof(KeyBuf) / sizeof(TCHAR), + Path, + Info->CurrentService->lpServiceName); + RegOpenKeyEx(HKEY_LOCAL_MACHINE, KeyBuf, 0, KEY_READ, &hKey); - hList = GetDlgItem(hwndGenDlg, IDC_START_TYPE); + hList = GetDlgItem(Info->PropSheet->hwndGenDlg, IDC_START_TYPE); LoadString(hInstance, IDS_SERVICES_AUTO, buf, sizeof(buf) / sizeof(TCHAR)); SendMessage(hList, CB_ADDSTRING, 0, (LPARAM)buf); @@ -110,30 +108,25 @@ static VOID GetDlgInfo(PMAIN_WND_INFO Info) { - ENUM_SERVICE_STATUS_PROCESS *Service = NULL; - - /* get pointer to selected service */ - Service = GetSelectedService(Info); - /* set the service name */ - Info->PropSheet->lpServiceName = Service->lpServiceName; - SendDlgItemMessage(hwndGenDlg, + Info->PropSheet->lpServiceName = Info->CurrentService->lpServiceName; + SendDlgItemMessage(Info->PropSheet->hwndGenDlg, IDC_SERV_NAME, WM_SETTEXT, 0, (LPARAM)Info->PropSheet->lpServiceName); /* set the display name */ - Info->PropSheet->lpDisplayName = Service->lpDisplayName; - SendDlgItemMessage(hwndGenDlg, + Info->PropSheet->lpDisplayName = Info->CurrentService->lpDisplayName; + SendDlgItemMessage(Info->PropSheet->hwndGenDlg, IDC_DISP_NAME, WM_SETTEXT, 0, (LPARAM)Info->PropSheet->lpDisplayName); /* set the description */ - if (GetDescription(Service->lpServiceName, &Info->PropSheet->lpDescription)) - SendDlgItemMessage(hwndGenDlg, + if (GetDescription(Info->CurrentService->lpServiceName, &Info->PropSheet->lpDescription)) + SendDlgItemMessage(Info->PropSheet->hwndGenDlg, IDC_DESCRIPTION, WM_SETTEXT, 0, @@ -141,24 +134,24 @@ /* set the executable path */ if (GetExecutablePath(Info, &Info->PropSheet->lpPathToExe)) - SendDlgItemMessage(hwndGenDlg, + SendDlgItemMessage(Info->PropSheet->hwndGenDlg, IDC_EXEPATH, WM_SETTEXT, 0, (LPARAM)Info->PropSheet->lpPathToExe); /* set startup type */ - SetStartupType(Service->lpServiceName); + SetStartupType(Info); /* set service status */ - if (Service->ServiceStatusProcess.dwCurrentState == SERVICE_RUNNING) + if (Info->CurrentService->ServiceStatusProcess.dwCurrentState == SERVICE_RUNNING) { LoadString(hInstance, IDS_SERVICES_STARTED, Info->PropSheet->szServiceStatus, sizeof(Info->PropSheet->szServiceStatus) / sizeof(TCHAR)); - SendDlgItemMessage(hwndGenDlg, + SendDlgItemMessage(Info->PropSheet->hwndGenDlg, IDC_SERV_STATUS, WM_SETTEXT, 0, @@ -171,7 +164,7 @@ Info->PropSheet->szServiceStatus, sizeof(Info->PropSheet->szServiceStatus) / sizeof(TCHAR)); - SendDlgItemMessage(hwndGenDlg, + SendDlgItemMessage(Info->PropSheet->hwndGenDlg, IDC_SERV_STATUS, WM_SETTEXT, 0, @@ -194,11 +187,7 @@ { PMAIN_WND_INFO Info; - /* FIXME get rid of this */ - hwndGenDlg = hwndDlg; - /* Get the window context */ - /* FIXME: does this get called in time for WM_INITDIALOG */ Info = (PMAIN_WND_INFO)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); @@ -214,6 +203,8 @@ Info = (PMAIN_WND_INFO)(((LPPROPSHEETPAGE)lParam)->lParam); if (Info != NULL) { + Info->PropSheet->hwndGenDlg = hwndDlg; + SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)Info); @@ -293,9 +284,6 @@ { PMAIN_WND_INFO Info; - /* FIXME get rid of this */ - hwndGenDlg = hwndDlg; - /* Get the window context */ Info = (PMAIN_WND_INFO)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); @@ -312,6 +300,8 @@ Info = (PMAIN_WND_INFO)(((LPPROPSHEETPAGE)lParam)->lParam); if (Info != NULL) { + Info->PropSheet->hwndDepDlg = hwndDlg; + SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)Info); @@ -403,9 +393,6 @@ { PROPSHEETHEADER psh; PROPSHEETPAGE psp[2]; - ENUM_SERVICE_STATUS_PROCESS *Service = NULL; - - Service = GetSelectedService(Info); ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); psh.dwSize = sizeof(PROPSHEETHEADER); @@ -413,7 +400,7 @@ psh.hwndParent = Info->hMainWnd; psh.hInstance = hInstance; psh.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SM_ICON)); - psh.pszCaption = Service->lpDisplayName; + psh.pszCaption = Info->CurrentService->lpDisplayName; psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE); psh.nStartPage = 0; psh.pfnCallback = AddEditButton; Modified: trunk/reactos/base/applications/servman/query.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/servman/q…
============================================================================== --- trunk/reactos/base/applications/servman/query.c (original) +++ trunk/reactos/base/applications/servman/query.c Fri Jun 2 20:47:39 2006 @@ -10,11 +10,9 @@ #include "precomp.h" - ENUM_SERVICE_STATUS_PROCESS* GetSelectedService(PMAIN_WND_INFO Info) { - ENUM_SERVICE_STATUS_PROCESS *pSelectedService = NULL; LVITEM lvItem; lvItem.mask = LVIF_PARAM; @@ -24,10 +22,8 @@ 0, (LPARAM)&lvItem); - /* copy pointer to selected service */ - pSelectedService = (ENUM_SERVICE_STATUS_PROCESS *)lvItem.lParam; - - return pSelectedService; + /* return pointer to selected service */ + return (ENUM_SERVICE_STATUS_PROCESS *)lvItem.lParam; } @@ -100,7 +96,9 @@ if (ret != ERROR_FILE_NOT_FOUND) { - Description = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwValueSize); + Description = HeapAlloc(ProcessHeap, + HEAP_ZERO_MEMORY, + dwValueSize); if (Description == NULL) { RegCloseKey(hKey); @@ -114,7 +112,9 @@ (LPBYTE)Description, &dwValueSize)) { - HeapFree(GetProcessHeap(), 0, Description); + HeapFree(ProcessHeap, + 0, + Description); RegCloseKey(hKey); return FALSE; } @@ -135,11 +135,7 @@ SC_HANDLE hSCManager = NULL; SC_HANDLE hSc = NULL; LPQUERY_SERVICE_CONFIG pServiceConfig = NULL; - ENUM_SERVICE_STATUS_PROCESS *Service = NULL; DWORD BytesNeeded = 0; - - /* copy pointer to selected service */ - Service = GetSelectedService(Info); /* open handle to the SCM */ hSCManager = OpenSCManager(NULL, @@ -153,7 +149,7 @@ /* get a handle to the service requested for starting */ hSc = OpenService(hSCManager, - Service->lpServiceName, + Info->CurrentService->lpServiceName, SERVICE_QUERY_CONFIG); if (hSc == NULL) { @@ -170,7 +166,7 @@ if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) { pServiceConfig = (LPQUERY_SERVICE_CONFIG) - HeapAlloc(GetProcessHeap(), + HeapAlloc(ProcessHeap, 0, BytesNeeded); if (pServiceConfig == NULL) Modified: trunk/reactos/base/applications/servman/servman.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/servman/s…
============================================================================== --- trunk/reactos/base/applications/servman/servman.c (original) +++ trunk/reactos/base/applications/servman/servman.c Fri Jun 2 20:47:39 2006 @@ -2,7 +2,7 @@ * PROJECT: ReactOS Services * LICENSE: GPL - See COPYING in the top level directory * FILE: base/system/servman/servman.c - * PURPOSE: HQ + * PURPOSE: Program HQ * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy <gedmurphy(a)gmail.com> * */ @@ -31,7 +31,9 @@ icex.dwICC = ICC_BAR_CLASSES | ICC_COOL_CLASSES; InitCommonControlsEx(&icex); - if (!AllocAndLoadString(&lpAppName, hInstance, IDS_APPNAME)) + if (!AllocAndLoadString(&lpAppName, + hInstance, + IDS_APPNAME)) { return 1; } Modified: trunk/reactos/base/applications/servman/start.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/servman/s…
============================================================================== --- trunk/reactos/base/applications/servman/start.c (original) +++ trunk/reactos/base/applications/servman/start.c Fri Jun 2 20:47:39 2006 @@ -9,8 +9,6 @@ #include "precomp.h" -extern HWND hwndGenDlg; - static BOOL DoStartService(PMAIN_WND_INFO Info) { @@ -18,13 +16,10 @@ SC_HANDLE hSCManager; SC_HANDLE hSc; SERVICE_STATUS_PROCESS ServiceStatus; - ENUM_SERVICE_STATUS_PROCESS *Service = NULL; /* FIXME: get rid of this */ DWORD BytesNeeded = 0; INT ArgCount = 0; DWORD dwStartTickCount, dwOldCheckPoint; - /* copy pointer to selected service */ - Service = GetSelectedService(Info); /* set the progress bar range and step */ hProgBar = GetDlgItem(Info->hProgDlg, @@ -51,7 +46,9 @@ } /* get a handle to the service requested for starting */ - hSc = OpenService(hSCManager, Service->lpServiceName, SERVICE_ALL_ACCESS); + hSc = OpenService(hSCManager, + Info->CurrentService->lpServiceName, + SERVICE_ALL_ACCESS); if (hSc == NULL) { GetError(); @@ -59,7 +56,9 @@ } /* start the service opened */ - if (! StartService(hSc, ArgCount, NULL)) + if (! StartService(hSc, + ArgCount, + NULL)) { GetError(); return FALSE; @@ -100,12 +99,11 @@ Sleep(ServiceStatus.dwWaitHint / 8); /* check status again */ - if (! QueryServiceStatusEx( - hSc, - SC_STATUS_PROCESS_INFO, - (LPBYTE)&ServiceStatus, - sizeof(SERVICE_STATUS_PROCESS), - &BytesNeeded)) + if (! QueryServiceStatusEx(hSc, + SC_STATUS_PROCESS_INFO, + (LPBYTE)&ServiceStatus, + sizeof(SERVICE_STATUS_PROCESS), + &BytesNeeded)) { GetError(); return FALSE; @@ -132,7 +130,10 @@ if (ServiceStatus.dwCurrentState == SERVICE_RUNNING) { - SendMessage(hProgBar, PBM_DELTAPOS, PROGRESSRANGE, 0); + SendMessage(hProgBar, + PBM_DELTAPOS, + PROGRESSRANGE, + 0); Sleep(1000); return TRUE; } @@ -148,7 +149,6 @@ DoStart(PMAIN_WND_INFO Info) { HWND hProgDlg; - ENUM_SERVICE_STATUS_PROCESS *Service = NULL; TCHAR ProgDlgBuf[100]; /* open the progress dialog */ @@ -173,15 +173,12 @@ 0, (LPARAM)ProgDlgBuf); - /* get pointer to selected service */ - Service = GetSelectedService(Info); - /* write the service name to the progress dialog */ SendDlgItemMessage(hProgDlg, IDC_SERVCON_NAME, WM_SETTEXT, 0, - (LPARAM)Service->lpServiceName); + (LPARAM)Info->CurrentService->lpServiceName); } /* start the service */ @@ -204,13 +201,14 @@ (LPARAM) &item); /* change dialog status */ - if (hwndGenDlg) + if (Info->PropSheet->hwndGenDlg) { LoadString(hInstance, IDS_SERVICES_STARTED, buf, sizeof(buf) / sizeof(TCHAR)); - SendDlgItemMessageW(hwndGenDlg, + + SendDlgItemMessageW(Info->PropSheet->hwndGenDlg, IDC_SERV_STATUS, WM_SETTEXT, 0, Modified: trunk/reactos/base/applications/servman/stop.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/servman/s…
============================================================================== --- trunk/reactos/base/applications/servman/stop.c (original) +++ trunk/reactos/base/applications/servman/stop.c Fri Jun 2 20:47:39 2006 @@ -1,7 +1,7 @@ /* * PROJECT: ReactOS Services * LICENSE: GPL - See COPYING in the top level directory - * FILE: base/system/servman/start.c + * FILE: base/system/servman/stop.c * PURPOSE: Stops a service * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy <gedmurphy(a)gmail.com> * @@ -9,12 +9,9 @@ #include "precomp.h" -extern HWND hwndGenDlg; - BOOL DoStop(PMAIN_WND_INFO Info) { HWND hProgDlg; - ENUM_SERVICE_STATUS_PROCESS *Service = NULL; TCHAR ProgDlgBuf[100]; /* open the progress dialog */ @@ -32,24 +29,22 @@ IDS_PROGRESS_INFO_STOP, ProgDlgBuf, sizeof(ProgDlgBuf) / sizeof(TCHAR)); + SendDlgItemMessage(hProgDlg, IDC_SERVCON_INFO, WM_SETTEXT, 0, (LPARAM)ProgDlgBuf); - /* get pointer to selected service */ - Service = GetSelectedService(Info); - /* write the service name to the progress dialog */ SendDlgItemMessage(hProgDlg, IDC_SERVCON_NAME, WM_SETTEXT, 0, - (LPARAM)Service->lpServiceName); + (LPARAM)Info->CurrentService->lpServiceName); } - if( Control(Info, SERVICE_CONTROL_STOP) ) + if ( Control(Info, SERVICE_CONTROL_STOP) ) { LVITEM item; TCHAR buf[25]; @@ -63,13 +58,14 @@ (LPARAM) &item); /* change dialog status */ - if (hwndGenDlg) + if (Info->PropSheet->hwndGenDlg) { LoadString(hInstance, IDS_SERVICES_STOPPED, buf, sizeof(buf) / sizeof(TCHAR)); - SendDlgItemMessageW(hwndGenDlg, + + SendDlgItemMessageW(Info->PropSheet->hwndGenDlg, IDC_SERV_STATUS, WM_SETTEXT, 0, (LPARAM)buf);
18 years, 5 months
1
0
0
0
[amunger] 22183: Bump 0.3.0 to RC1.
by amunger@svn.reactos.org
Author: amunger Date: Fri Jun 2 19:05:18 2006 New Revision: 22183 URL:
http://svn.reactos.ru/svn/reactos?rev=22183&view=rev
Log: Bump 0.3.0 to RC1. Modified: branches/ros-branch-0_3_0/reactos/include/reactos/version.h Modified: branches/ros-branch-0_3_0/reactos/include/reactos/version.h URL:
http://svn.reactos.ru/svn/reactos/branches/ros-branch-0_3_0/reactos/include…
============================================================================== --- branches/ros-branch-0_3_0/reactos/include/reactos/version.h (original) +++ branches/ros-branch-0_3_0/reactos/include/reactos/version.h Fri Jun 2 19:05:18 2006 @@ -22,7 +22,7 @@ #define KERNEL_VERSION_PATCH_LEVEL 0 /* KERNEL_VERSION_BUILD_TYPE is L"SVN", L"RC1", L"RC2" or L"RELEASE" */ -#define KERNEL_VERSION_BUILD_TYPE L"PRE-RELEASE" +#define KERNEL_VERSION_BUILD_TYPE L"RC1" #endif
18 years, 5 months
1
0
0
0
[amunger] 22182: Merge w3seek fixes from trunk. Revisions: 22177-22179
by amunger@svn.reactos.org
Author: amunger Date: Fri Jun 2 18:53:34 2006 New Revision: 22182 URL:
http://svn.reactos.ru/svn/reactos?rev=22182&view=rev
Log: Merge w3seek fixes from trunk. Revisions: 22177-22179 Modified: branches/ros-branch-0_3_0/reactos/base/services/umpnpmgr/umpnpmgr.c branches/ros-branch-0_3_0/reactos/dll/cpl/desk/classinst.c branches/ros-branch-0_3_0/reactos/dll/win32/netcfgx/netcfgx.c branches/ros-branch-0_3_0/reactos/include/reactos/probe.h branches/ros-branch-0_3_0/reactos/ntoskrnl/cm/ntfunc.c branches/ros-branch-0_3_0/reactos/ntoskrnl/io/pnpmgr.c Modified: branches/ros-branch-0_3_0/reactos/base/services/umpnpmgr/umpnpmgr.c URL:
http://svn.reactos.ru/svn/reactos/branches/ros-branch-0_3_0/reactos/base/se…
============================================================================== --- branches/ros-branch-0_3_0/reactos/base/services/umpnpmgr/umpnpmgr.c (original) +++ branches/ros-branch-0_3_0/reactos/base/services/umpnpmgr/umpnpmgr.c Fri Jun 2 18:53:34 2006 @@ -1170,7 +1170,7 @@ static BOOL SetupIsActive(VOID) { - HKEY hKey = INVALID_HANDLE_VALUE; + HKEY hKey = NULL; DWORD regType, active, size; LONG rc; BOOL ret = FALSE; @@ -1189,7 +1189,7 @@ ret = (active != 0); cleanup: - if (hKey != INVALID_HANDLE_VALUE) + if (hKey != NULL) RegCloseKey(hKey); DPRINT("System setup in progress? %S\n", ret ? L"YES" : L"NO"); Modified: branches/ros-branch-0_3_0/reactos/dll/cpl/desk/classinst.c URL:
http://svn.reactos.ru/svn/reactos/branches/ros-branch-0_3_0/reactos/dll/cpl…
============================================================================== --- branches/ros-branch-0_3_0/reactos/dll/cpl/desk/classinst.c (original) +++ branches/ros-branch-0_3_0/reactos/dll/cpl/desk/classinst.c Fri Jun 2 18:53:34 2006 @@ -24,11 +24,11 @@ TCHAR SectionName[MAX_PATH]; TCHAR ServiceName[MAX_SERVICE_NAME_LEN]; SP_DRVINFO_DETAIL_DATA DriverInfoDetailData; - HKEY hDriverKey = INVALID_HANDLE_VALUE; - HKEY hSettingsKey = INVALID_HANDLE_VALUE; - HKEY hServicesKey = INVALID_HANDLE_VALUE; - HKEY hServiceKey = INVALID_HANDLE_VALUE; - HKEY hDeviceSubKey = INVALID_HANDLE_VALUE; + HKEY hDriverKey = INVALID_HANDLE_VALUE; /* SetupDiOpenDevRegKey returns INVALID_HANDLE_VALUE in case of error! */ + HKEY hSettingsKey = NULL; + HKEY hServicesKey = NULL; + HKEY hServiceKey = NULL; + HKEY hDeviceSubKey = NULL; DWORD disposition; BOOL result; LONG rc; @@ -214,14 +214,17 @@ if (hInf != INVALID_HANDLE_VALUE) SetupCloseInfFile(hInf); if (hDriverKey != INVALID_HANDLE_VALUE) + { + /* SetupDiOpenDevRegKey returns INVALID_HANDLE_VALUE in case of error! */ RegCloseKey(hDriverKey); - if (hSettingsKey != INVALID_HANDLE_VALUE) + } + if (hSettingsKey != NULL) RegCloseKey(hSettingsKey); - if (hServicesKey != INVALID_HANDLE_VALUE) + if (hServicesKey != NULL) RegCloseKey(hServicesKey); - if (hServiceKey != INVALID_HANDLE_VALUE) + if (hServiceKey != NULL) RegCloseKey(hServiceKey); - if (hDeviceSubKey != INVALID_HANDLE_VALUE) + if (hDeviceSubKey != NULL) RegCloseKey(hDeviceSubKey); return rc; Modified: branches/ros-branch-0_3_0/reactos/dll/win32/netcfgx/netcfgx.c URL:
http://svn.reactos.ru/svn/reactos/branches/ros-branch-0_3_0/reactos/dll/win…
============================================================================== --- branches/ros-branch-0_3_0/reactos/dll/win32/netcfgx/netcfgx.c (original) +++ branches/ros-branch-0_3_0/reactos/dll/win32/netcfgx/netcfgx.c Fri Jun 2 18:53:34 2006 @@ -184,10 +184,10 @@ LPWSTR ExportName = NULL; LONG rc; DWORD dwShowIcon, dwLength; - HKEY hKey = INVALID_HANDLE_VALUE; - HKEY hLinkageKey = INVALID_HANDLE_VALUE; - HKEY hNetworkKey = INVALID_HANDLE_VALUE; - HKEY hConnectionKey = INVALID_HANDLE_VALUE; + HKEY hKey = NULL; + HKEY hLinkageKey = NULL; + HKEY hNetworkKey = NULL; + HKEY hConnectionKey = NULL; if (InstallFunction != DIF_INSTALLDEVICE) return ERROR_DI_DO_DEFAULT; @@ -279,7 +279,7 @@ goto cleanup; } RegCloseKey(hKey); - hKey = INVALID_HANDLE_VALUE; + hKey = NULL; rc = RegCreateKeyExW(hNetworkKey, L"Parameters\\Tcpip", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, NULL, &hKey, NULL); if (rc != ERROR_SUCCESS) { @@ -287,7 +287,7 @@ goto cleanup; } RegCloseKey(hNetworkKey); - hNetworkKey = INVALID_HANDLE_VALUE; + hNetworkKey = NULL; rc = RegSetValueExW(hKey, L"DefaultGateway", 0, REG_SZ, (const BYTE*)L"0.0.0.0", (wcslen(L"0.0.0.0") + 1) * sizeof(WCHAR)); if (rc != ERROR_SUCCESS) { @@ -307,7 +307,7 @@ goto cleanup; } RegCloseKey(hKey); - hKey = INVALID_HANDLE_VALUE; + hKey = NULL; /* Write 'Linkage' key in hardware key */ #if _WIN32_WINNT >= 0x502 @@ -319,6 +319,7 @@ hKey = SetupDiCreateDevRegKeyW(DeviceInfoSet, DeviceInfoData, DICS_FLAG_GLOBAL, 0, DIREG_DRV, NULL, NULL); if (hKey == INVALID_HANDLE_VALUE) { + hKey = NULL; rc = GetLastError(); DPRINT("SetupDiCreateDevRegKeyW() failed with error 0x%lx\n", rc); goto cleanup; @@ -354,7 +355,7 @@ goto cleanup; } RegCloseKey(hKey); - hKey = INVALID_HANDLE_VALUE; + hKey = NULL; /* Write connection information in network subkey */ rc = RegCreateKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}", 0, NULL, REG_OPTION_NON_VOLATILE, 0, NULL, &hNetworkKey, NULL); @@ -371,7 +372,7 @@ } rc = RegCreateKeyExW(hKey, L"Connection", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, NULL, &hConnectionKey, NULL); RegCloseKey(hKey); - hKey = INVALID_HANDLE_VALUE; + hKey = NULL; if (rc != ERROR_SUCCESS) { DPRINT("RegCreateKeyExW() failed with error 0x%lx\n", rc); @@ -446,13 +447,13 @@ HeapFree(GetProcessHeap(), 0, UuidString); HeapFree(GetProcessHeap(), 0, DeviceName); HeapFree(GetProcessHeap(), 0, ExportName); - if (hKey != INVALID_HANDLE_VALUE) + if (hKey != NULL) RegCloseKey(hKey); - if (hLinkageKey != INVALID_HANDLE_VALUE) + if (hLinkageKey != NULL) RegCloseKey(hLinkageKey); - if (hNetworkKey != INVALID_HANDLE_VALUE) + if (hNetworkKey != NULL) RegCloseKey(hNetworkKey); - if (hConnectionKey != INVALID_HANDLE_VALUE) + if (hConnectionKey != NULL) RegCloseKey(hConnectionKey); if (rc == ERROR_SUCCESS) Modified: branches/ros-branch-0_3_0/reactos/include/reactos/probe.h URL:
http://svn.reactos.ru/svn/reactos/branches/ros-branch-0_3_0/reactos/include…
============================================================================== --- branches/ros-branch-0_3_0/reactos/include/reactos/probe.h (original) +++ branches/ros-branch-0_3_0/reactos/include/reactos/probe.h Fri Jun 2 18:53:34 2006 @@ -73,6 +73,15 @@ #define ProbeForReadLargeInteger(Ptr) ProbeForReadGenericType(Ptr, LARGE_INTEGER, __emptyLargeInteger) #define ProbeForReadUlargeInteger(Ptr) ProbeForReadGenericType(Ptr, ULARGE_INTEGER, __emptyULargeInteger) #define ProbeForReadUnicodeString(Ptr) ProbeForReadGenericType(Ptr, UNICODE_STRING, __emptyUnicodeString) + +#define ProbeAndZeroHandle(Ptr) \ + do { \ + if ((ULONG_PTR)(Ptr) + sizeof(HANDLE) - 1 < (ULONG_PTR)(Ptr) || \ + (ULONG_PTR)(Ptr) + sizeof(HANDLE) - 1 >= (ULONG_PTR)MmUserProbeAddress) { \ + RtlRaiseStatus (STATUS_ACCESS_VIOLATION); \ + } \ + *(volatile HANDLE *)(Ptr) = NULL; \ + } while (0) /* * Inlined Probing Macros Modified: branches/ros-branch-0_3_0/reactos/ntoskrnl/cm/ntfunc.c URL:
http://svn.reactos.ru/svn/reactos/branches/ros-branch-0_3_0/reactos/ntoskrn…
============================================================================== --- branches/ros-branch-0_3_0/reactos/ntoskrnl/cm/ntfunc.c (original) +++ branches/ros-branch-0_3_0/reactos/ntoskrnl/cm/ntfunc.c Fri Jun 2 18:53:34 2006 @@ -208,7 +208,7 @@ { _SEH_TRY { - ProbeForWriteHandle(KeyHandle); + ProbeAndZeroHandle(KeyHandle); if (Disposition != NULL) { ProbeForWriteUlong(Disposition); @@ -1281,7 +1281,7 @@ { _SEH_TRY { - ProbeForWriteHandle(KeyHandle); + ProbeAndZeroHandle(KeyHandle); } _SEH_HANDLE { Modified: branches/ros-branch-0_3_0/reactos/ntoskrnl/io/pnpmgr.c URL:
http://svn.reactos.ru/svn/reactos/branches/ros-branch-0_3_0/reactos/ntoskrn…
============================================================================== --- branches/ros-branch-0_3_0/reactos/ntoskrnl/io/pnpmgr.c (original) +++ branches/ros-branch-0_3_0/reactos/ntoskrnl/io/pnpmgr.c Fri Jun 2 18:53:34 2006 @@ -1317,7 +1317,7 @@ UNICODE_STRING KeyValue; UNICODE_STRING ValueName; OBJECT_ATTRIBUTES ObjectAttributes; - HANDLE hKey = INVALID_HANDLE_VALUE; + HANDLE hKey = NULL; ULONG crc32; NTSTATUS Status; @@ -1395,7 +1395,7 @@ } ExFreePool(ParentIdPrefixInformation); ExFreePool(KeyNameBuffer); - if (hKey != INVALID_HANDLE_VALUE) + if (hKey != NULL) ZwClose(hKey); return Status; }
18 years, 5 months
1
0
0
0
← Newer
1
...
52
53
54
55
56
57
58
59
60
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Results per page:
10
25
50
100
200