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
May 2009
----- 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
27 participants
504 discussions
Start a n
N
ew thread
[cgutman] 40792: - Handle IRP_MN_QUERY_REMOVE_DEVICE and IRP_MN_CANCEL_REMOVE_DEVICE - Implement NdisCompletePnPEvent - Handle pending cases
by cgutman@svn.reactos.org
Author: cgutman Date: Tue May 5 06:13:53 2009 New Revision: 40792 URL:
http://svn.reactos.org/svn/reactos?rev=40792&view=rev
Log: - Handle IRP_MN_QUERY_REMOVE_DEVICE and IRP_MN_CANCEL_REMOVE_DEVICE - Implement NdisCompletePnPEvent - Handle pending cases Modified: trunk/reactos/drivers/network/ndis/ndis/50stubs.c trunk/reactos/drivers/network/ndis/ndis/miniport.c trunk/reactos/drivers/network/ndis/ndis/protocol.c Modified: trunk/reactos/drivers/network/ndis/ndis/50stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
============================================================================== --- trunk/reactos/drivers/network/ndis/ndis/50stubs.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/ndis/ndis/50stubs.c [iso-8859-1] Tue May 5 06:13:53 2009 @@ -170,26 +170,6 @@ */ VOID EXPORT -NdisCompletePnPEvent( - IN NDIS_STATUS Status, - IN NDIS_HANDLE NdisBindingHandle, - IN PNET_PNP_EVENT NetPnPEvent) -/* - * FUNCTION: - * ARGUMENTS: - * NOTES: - * NDIS 5.0 - */ -{ - UNIMPLEMENTED -} - - -/* - * @unimplemented - */ -VOID -EXPORT NdisConvertStringToAtmAddress( OUT PNDIS_STATUS Status, IN PNDIS_STRING String, Modified: trunk/reactos/drivers/network/ndis/ndis/miniport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
============================================================================== --- trunk/reactos/drivers/network/ndis/ndis/miniport.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/ndis/ndis/miniport.c [iso-8859-1] Tue May 5 06:13:53 2009 @@ -2044,12 +2044,14 @@ IoCompleteRequest(Irp, IO_NO_INCREMENT); break; + case IRP_MN_QUERY_REMOVE_DEVICE: case IRP_MN_QUERY_STOP_DEVICE: Status = NdisIPnPQueryStopDevice(DeviceObject, Irp); Irp->IoStatus.Status = Status; IoCompleteRequest(Irp, IO_NO_INCREMENT); break; + case IRP_MN_CANCEL_REMOVE_DEVICE: case IRP_MN_CANCEL_STOP_DEVICE: Status = NdisIPnPCancelStopDevice(DeviceObject, Irp); Irp->IoStatus.Status = Status; @@ -2812,5 +2814,65 @@ Adapter); } +/* + * @implemented + */ +VOID +EXPORT +NdisCompletePnPEvent( + IN NDIS_STATUS Status, + IN NDIS_HANDLE NdisBindingHandle, + IN PNET_PNP_EVENT NetPnPEvent) +/* + * FUNCTION: + * ARGUMENTS: + * NOTES: + * NDIS 5.0 + */ +{ + PIRP Irp = (PIRP)NetPnPEvent->NdisReserved[0]; + PLIST_ENTRY CurrentEntry = (PLIST_ENTRY)NetPnPEvent->NdisReserved[1]; + PADAPTER_BINDING AdapterBinding = NdisBindingHandle; + PLOGICAL_ADAPTER Adapter = AdapterBinding->Adapter; + NDIS_STATUS NdisStatus; + + if (Status != NDIS_STATUS_SUCCESS) + { + ExFreePool(NetPnPEvent); + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return; + } + + while (CurrentEntry != &Adapter->ProtocolListHead) + { + AdapterBinding = CONTAINING_RECORD(CurrentEntry, ADAPTER_BINDING, AdapterListEntry); + + NdisStatus = (*AdapterBinding->ProtocolBinding->Chars.PnPEventHandler)( + AdapterBinding->NdisOpenBlock.ProtocolBindingContext, + NetPnPEvent); + + if (NdisStatus == NDIS_STATUS_PENDING) + { + NetPnPEvent->NdisReserved[1] = (ULONG_PTR)CurrentEntry->Flink; + return; + } + else if (NdisStatus != NDIS_STATUS_SUCCESS) + { + ExFreePool(NetPnPEvent); + Irp->IoStatus.Status = NdisStatus; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return; + } + + CurrentEntry = CurrentEntry->Flink; + } + + ExFreePool(NetPnPEvent); + + Irp->IoStatus.Status = NDIS_STATUS_SUCCESS; + IoCompleteRequest(Irp, IO_NO_INCREMENT); +} + /* EOF */ Modified: trunk/reactos/drivers/network/ndis/ndis/protocol.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
============================================================================== --- trunk/reactos/drivers/network/ndis/ndis/protocol.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/ndis/ndis/protocol.c [iso-8859-1] Tue May 5 06:13:53 2009 @@ -71,8 +71,11 @@ if (Status == NDIS_STATUS_PENDING) { - /* We don't handle this yet */ - ASSERT(FALSE); + IoMarkIrpPending(Irp); + /* Yes, I know this is stupid */ + PnPEvent->NdisReserved[0] = (ULONG_PTR)Irp; + PnPEvent->NdisReserved[1] = (ULONG_PTR)CurrentEntry->Flink; + return NDIS_STATUS_PENDING; } else if (Status != NDIS_STATUS_SUCCESS) { @@ -115,7 +118,13 @@ AdapterBinding->NdisOpenBlock.ProtocolBindingContext, PnPEvent); - /* A protocol should always succeed NetEventCancelRemoveDevice */ + if (Status == NDIS_STATUS_PENDING) + { + IoMarkIrpPending(Irp); + PnPEvent->NdisReserved[0] = (ULONG_PTR)Irp; + PnPEvent->NdisReserved[1] = (ULONG_PTR)CurrentEntry->Flink; + return NDIS_STATUS_PENDING; + } ASSERT(Status == NDIS_STATUS_SUCCESS);
15 years, 6 months
1
0
0
0
[cgutman] 40791: - Implement handling for IRP_MN_CANCEL_STOP_DEVICE
by cgutman@svn.reactos.org
Author: cgutman Date: Tue May 5 05:24:30 2009 New Revision: 40791 URL:
http://svn.reactos.org/svn/reactos?rev=40791&view=rev
Log: - Implement handling for IRP_MN_CANCEL_STOP_DEVICE Modified: trunk/reactos/drivers/network/ndis/include/protocol.h trunk/reactos/drivers/network/ndis/ndis/miniport.c trunk/reactos/drivers/network/ndis/ndis/protocol.c Modified: trunk/reactos/drivers/network/ndis/include/protocol.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/inclu…
============================================================================== --- trunk/reactos/drivers/network/ndis/include/protocol.h [iso-8859-1] (original) +++ trunk/reactos/drivers/network/ndis/include/protocol.h [iso-8859-1] Tue May 5 05:24:30 2009 @@ -61,6 +61,12 @@ IN PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS +NTAPI +NdisIPnPCancelStopDevice( + IN PDEVICE_OBJECT DeviceObject, + PIRP Irp); + #endif /* __PROTOCOL_H */ /* EOF */ Modified: trunk/reactos/drivers/network/ndis/ndis/miniport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
============================================================================== --- trunk/reactos/drivers/network/ndis/ndis/miniport.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/ndis/ndis/miniport.c [iso-8859-1] Tue May 5 05:24:30 2009 @@ -2050,6 +2050,12 @@ IoCompleteRequest(Irp, IO_NO_INCREMENT); break; + case IRP_MN_CANCEL_STOP_DEVICE: + Status = NdisIPnPCancelStopDevice(DeviceObject, Irp); + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + break; + default: IoSkipCurrentIrpStackLocation(Irp); Status = IoCallDriver(Adapter->NdisMiniportBlock.NextDeviceObject, Irp); Modified: trunk/reactos/drivers/network/ndis/ndis/protocol.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
============================================================================== --- trunk/reactos/drivers/network/ndis/ndis/protocol.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/ndis/ndis/protocol.c [iso-8859-1] Tue May 5 05:24:30 2009 @@ -77,11 +77,52 @@ else if (Status != NDIS_STATUS_SUCCESS) { /* One protocol failed so we can fail the query stop device IRP */ + ExFreePool(PnPEvent); return Status; } CurrentEntry = CurrentEntry->Flink; } + + ExFreePool(PnPEvent); + + return NDIS_STATUS_SUCCESS; +} + +NTSTATUS +NTAPI +NdisIPnPCancelStopDevice( + IN PDEVICE_OBJECT DeviceObject, + PIRP Irp) +{ + PLIST_ENTRY CurrentEntry; + PADAPTER_BINDING AdapterBinding; + PLOGICAL_ADAPTER Adapter = (PLOGICAL_ADAPTER)DeviceObject->DeviceExtension; + PNET_PNP_EVENT PnPEvent; + NDIS_STATUS Status; + + PnPEvent = ProSetupPnPEvent(NetEventCancelRemoveDevice, NULL, 0); + if (!PnPEvent) + return NDIS_STATUS_RESOURCES; + + CurrentEntry = Adapter->ProtocolListHead.Flink; + + while (CurrentEntry != &Adapter->ProtocolListHead) + { + AdapterBinding = CONTAINING_RECORD(CurrentEntry, ADAPTER_BINDING, AdapterListEntry); + + Status = (*AdapterBinding->ProtocolBinding->Chars.PnPEventHandler)( + AdapterBinding->NdisOpenBlock.ProtocolBindingContext, + PnPEvent); + + /* A protocol should always succeed NetEventCancelRemoveDevice */ + + ASSERT(Status == NDIS_STATUS_SUCCESS); + + CurrentEntry = CurrentEntry->Flink; + } + + ExFreePool(PnPEvent); return NDIS_STATUS_SUCCESS; }
15 years, 6 months
1
0
0
0
[cgutman] 40790: - Implement handling for IRP_MN_QUERY_STOP_DEVICE
by cgutman@svn.reactos.org
Author: cgutman Date: Tue May 5 05:08:06 2009 New Revision: 40790 URL:
http://svn.reactos.org/svn/reactos?rev=40790&view=rev
Log: - Implement handling for IRP_MN_QUERY_STOP_DEVICE Modified: trunk/reactos/drivers/network/ndis/include/protocol.h trunk/reactos/drivers/network/ndis/ndis/miniport.c trunk/reactos/drivers/network/ndis/ndis/protocol.c Modified: trunk/reactos/drivers/network/ndis/include/protocol.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/inclu…
============================================================================== --- trunk/reactos/drivers/network/ndis/include/protocol.h [iso-8859-1] (original) +++ trunk/reactos/drivers/network/ndis/include/protocol.h [iso-8859-1] Tue May 5 05:08:06 2009 @@ -55,6 +55,12 @@ IN PPNDIS_PACKET PacketArray, IN UINT NumberOfPackets); +NTSTATUS +NTAPI +NdisIPnPQueryStopDevice( + IN PDEVICE_OBJECT DeviceObject, + PIRP Irp); + #endif /* __PROTOCOL_H */ /* EOF */ Modified: trunk/reactos/drivers/network/ndis/ndis/miniport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
============================================================================== --- trunk/reactos/drivers/network/ndis/ndis/miniport.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/ndis/ndis/miniport.c [iso-8859-1] Tue May 5 05:08:06 2009 @@ -2044,6 +2044,12 @@ IoCompleteRequest(Irp, IO_NO_INCREMENT); break; + case IRP_MN_QUERY_STOP_DEVICE: + Status = NdisIPnPQueryStopDevice(DeviceObject, Irp); + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + break; + default: IoSkipCurrentIrpStackLocation(Irp); Status = IoCallDriver(Adapter->NdisMiniportBlock.NextDeviceObject, Irp); Modified: trunk/reactos/drivers/network/ndis/ndis/protocol.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
============================================================================== --- trunk/reactos/drivers/network/ndis/ndis/protocol.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/ndis/ndis/protocol.c [iso-8859-1] Tue May 5 05:08:06 2009 @@ -21,6 +21,70 @@ KSPIN_LOCK ProtocolListLock; #define WORKER_TEST 0 + +PNET_PNP_EVENT +ProSetupPnPEvent( + NET_PNP_EVENT_CODE EventCode, + PVOID EventBuffer, + ULONG EventBufferLength) +{ + PNET_PNP_EVENT PnPEvent; + + PnPEvent = ExAllocatePool(PagedPool, sizeof(NET_PNP_EVENT)); + if (!PnPEvent) + return NULL; + + RtlZeroMemory(PnPEvent, sizeof(NET_PNP_EVENT)); + + PnPEvent->NetEvent = EventCode; + PnPEvent->Buffer = EventBuffer; + PnPEvent->BufferLength = EventBufferLength; + + return PnPEvent; +} + +NTSTATUS +NTAPI +NdisIPnPQueryStopDevice( + IN PDEVICE_OBJECT DeviceObject, + PIRP Irp) +{ + PLIST_ENTRY CurrentEntry; + PADAPTER_BINDING AdapterBinding; + PLOGICAL_ADAPTER Adapter = (PLOGICAL_ADAPTER)DeviceObject->DeviceExtension; + PNET_PNP_EVENT PnPEvent; + NDIS_STATUS Status; + + PnPEvent = ProSetupPnPEvent(NetEventQueryRemoveDevice, NULL, 0); + if (!PnPEvent) + return NDIS_STATUS_RESOURCES; + + CurrentEntry = Adapter->ProtocolListHead.Flink; + + while (CurrentEntry != &Adapter->ProtocolListHead) + { + AdapterBinding = CONTAINING_RECORD(CurrentEntry, ADAPTER_BINDING, AdapterListEntry); + + Status = (*AdapterBinding->ProtocolBinding->Chars.PnPEventHandler)( + AdapterBinding->NdisOpenBlock.ProtocolBindingContext, + PnPEvent); + + if (Status == NDIS_STATUS_PENDING) + { + /* We don't handle this yet */ + ASSERT(FALSE); + } + else if (Status != NDIS_STATUS_SUCCESS) + { + /* One protocol failed so we can fail the query stop device IRP */ + return Status; + } + + CurrentEntry = CurrentEntry->Flink; + } + + return NDIS_STATUS_SUCCESS; +} /*
15 years, 6 months
1
0
0
0
[dgoette] 405: implement design suggestions from Mariusz Przybylski
by dgoette@svn.reactos.org
Author: dgoette Date: Tue May 5 02:33:07 2009 New Revision: 405 URL:
http://svn.reactos.org/svn/reactos?rev=405&view=rev
Log: implement design suggestions from Mariusz Przybylski Modified: branches/compat/convert1to2.sql branches/compat/css/style.css branches/compat/js/submit.js branches/compat/lib/om/Category.class.php branches/compat/lib/om/Entry.class.php branches/compat/lib/view/HTML_Submit.class.php Modified: branches/compat/convert1to2.sql URL:
http://svn.reactos.org/svn/reactos/branches/compat/convert1to2.sql?rev=405&…
============================================================================== --- branches/compat/convert1to2.sql [iso-8859-1] (original) +++ branches/compat/convert1to2.sql [iso-8859-1] Tue May 5 02:33:07 2009 @@ -21,6 +21,7 @@ CREATE TABLE cdb_categories ( id BIGINT UNSIGNED NOT NULL , parent BIGINT UNSIGNED NULL COMMENT '->categories(id)', + type ENUM('App','DLL','Drv', 'Oth') NOT NULL DEFAULT 'Oth', name VARCHAR( 100 ) NOT NULL , description VARCHAR( 255 ) NOT NULL , icon VARCHAR( 100 ) NULL , @@ -32,6 +33,7 @@ SELECT cat_id, cat_path, + 'App', cat_name, cat_description, cat_icon, @@ -182,6 +184,8 @@ user_id BIGINT UNSIGNED NOT NULL COMMENT '->roscms.users(id)', works ENUM( 'full', 'part', 'not' ) NULL, checked BOOL NOT NULL DEFAULT FALSE, + environment CHAR(4) NOT NULL DEFAULT 'unkn', + environment_version VARCHAR(10) NOT NULL DEFAULT '', created DATETIME NOT NULL, visible BOOL NOT NULL DEFAULT FALSE, disabled BOOL NOT NULL DEFAULT TRUE, @@ -201,6 +205,8 @@ comp_usrid, NULL, FALSE, + 'unkn', + '', comp_date, TRUE, FALSE, @@ -222,6 +228,7 @@ -- ----------------------------------------------------------------- CREATE TABLE cdb_entries ( id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + type ENUM('App','DLL','Drv', 'Oth') NOT NULL DEFAULT 'Oth', name VARCHAR( 100 ) NOT NULL, category_id BIGINT NOT NULL, description TEXT NOT NULL, @@ -237,6 +244,7 @@ INSERT INTO cdb_entries SELECT DISTINCT NULL, + 'App', grpentr_name, g.grpentr_category, (SELECT i.old_description FROM cdb_entries_reports i WHERE i.old_groupid=o.old_groupid ORDER BY i.created ASC LIMIT 1) AS old_description, @@ -268,6 +276,7 @@ id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , entry_id BIGINT UNSIGNED NOT NULL COMMENT '->entry', version VARCHAR( 20 ) NOT NULL, + created DATETIME NOT NULL, UNIQUE KEY(entry_id, version) ) ENGINE = MYISAM; @@ -275,7 +284,8 @@ SELECT NULL, id, - old_version + old_version, + created FROM cdb_entries; UPDATE cdb_entries_reports r @@ -381,6 +391,7 @@ INSERT INTO cdb_entries2 SELECT DISTINCT (SELECT id FROM cdb_entries WHERE name = g.name ORDER BY created DESC LIMIT 1), + g.type, name, (SELECT category_id FROM cdb_entries WHERE name = g.name ORDER BY created DESC LIMIT 1), (SELECT description FROM cdb_entries WHERE name = g.name ORDER BY created DESC LIMIT 1), @@ -398,6 +409,7 @@ DROP TABLE cdb_entries; RENAME TABLE cdb_entries2 TO cdb_entries; +ALTER TABLE cdb_entries ADD UNIQUE(type, name); Modified: branches/compat/css/style.css URL:
http://svn.reactos.org/svn/reactos/branches/compat/css/style.css?rev=405&r1…
============================================================================== --- branches/compat/css/style.css [iso-8859-1] (original) +++ branches/compat/css/style.css [iso-8859-1] Tue May 5 02:33:07 2009 @@ -12,6 +12,69 @@ .rtable THEAD { background-color:#5984C3;color:white;} + +#submit { + background-color: #EEE; +} +#submit H1 { + border-bottom: 2px solid #369; + line-height: 2em; + padding-left: 8px; + +} +#submit H1.left { + border-right: 1px solid white; + border-bottom: 2px solid #D75700; + background-color: #FF7800; + float: left; + padding-right: 8px; + clear: left; +} +#submit BUTTON { + border: none; + border-bottom: 2px solid #D75700; + background-color: #FF7800; + color: white; + font-weight: bold; + margin: 1em; +} +#submit LABEL, +#submit .label { + font-weight: bold; + color: #369; + line-height: 1.5em; +} +#submit LABEL.normal { + font-weight: normal; + color: black; +} +#submit INPUT, +#submit SELECT, +#submit TEXTAREA { + border: 1px solid #D75700; + margin-right: 10px; +} +#submit INPUT.normal { + margin-right: 0px; +} +#submit UL { + list-style-type: none; + margin-top: 0px; +} +#submit .suggestion { + position: absolute; + background-color: white; +} +#submit .suggestion UL { + padding-left:3px; + border: 1px solid #D75700; +} +#submit .suggestion LI A:hover { + cursor: pointer; +} + + + body { font-family: Verdana; Modified: branches/compat/js/submit.js URL:
http://svn.reactos.org/svn/reactos/branches/compat/js/submit.js?rev=405&r1=…
============================================================================== --- branches/compat/js/submit.js [iso-8859-1] (original) +++ branches/compat/js/submit.js [iso-8859-1] Tue May 5 02:33:07 2009 @@ -113,7 +113,6 @@ if (type == 'name') { id = 'title'; hideSuggestions('suggestedNames'); - disableDetails(); var entries = xmldoc.getElementsByTagName('entry'); var versions = entries[index].getElementsByTagName('version'); @@ -143,34 +142,3 @@ document.getElementById(id).value=from.innerHTML; } - - -function toggleDetails( ) -{ - if (!document.getElementById('iCheck').checked) { - enableDetails() - } - else { - disableDetails() - } -} - - - -function disableDetails( ) -{ - document.getElementById('iCheck').checked = true; - document.getElementById('cat').disabled = true; - document.getElementById('description').disabled = true; - document.getElementById('tags').disabled = true; -} - - - -function enableDetails( ) -{ - document.getElementById('iCheck').checked = false; - document.getElementById('cat').disabled = false; - document.getElementById('description').disabled = false; - document.getElementById('tags').disabled = false; -} Modified: branches/compat/lib/om/Category.class.php URL:
http://svn.reactos.org/svn/reactos/branches/compat/lib/om/Category.class.ph…
============================================================================== --- branches/compat/lib/om/Category.class.php [iso-8859-1] (original) +++ branches/compat/lib/om/Category.class.php [iso-8859-1] Tue May 5 02:33:07 2009 @@ -59,7 +59,7 @@ */ private static function getChilds($category_id) { - $stmt=CDBConnection::getInstance()->prepare("SELECT id, name FROM ".CDBT_CATEGORIES." WHERE parent = :cat_path AND visible IS TRUE ORDER BY name ASC"); + $stmt=CDBConnection::getInstance()->prepare("SELECT id, name FROM ".CDBT_CATEGORIES." WHERE parent = :cat_path AND visible IS TRUE ORDER BY type ASC, name ASC"); $stmt->bindParam('cat_path',$category_id,PDO::PARAM_INT); $stmt->execute(); return $stmt->fetchAll(PDO::FETCH_ASSOC); Modified: branches/compat/lib/om/Entry.class.php URL:
http://svn.reactos.org/svn/reactos/branches/compat/lib/om/Entry.class.php?r…
============================================================================== --- branches/compat/lib/om/Entry.class.php [iso-8859-1] (original) +++ branches/compat/lib/om/Entry.class.php [iso-8859-1] Tue May 5 02:33:07 2009 @@ -33,37 +33,44 @@ * * @access public */ - public static function add( $title, $version, $category, $description, $tags, $update = false ) - { - // search for existing entry - $entry_id = self::getId($title, $version); + public static function add( $type, $name, $version, $category, $description ) + { + // search for existing entry + $entry = self::get($type, $name); // insert new entry - if ($entry_id === false) { + if ($entry === false) { // check category type if (!ctype_digit((string)$category) || $category == 0) { - echo 'Error: Unknown Categorie'; + echo 'Error: Invalid category'; + return false; + } + + // check type + if ($type != 'app' && $type != 'dll' && $type != 'drv' && $type != 'oth') { + echo 'Error: Invalid type'; return false; } // insert - $stmt=CDBConnection::getInstance()->prepare("INSERT INTO ".CDBT_ENTRIES." (name, version, category_id, description, created, modified, visible) VALUES (:name, :version, :category, :description, NOW(), NOW(), TRUE)"); - $stmt->bindParam('name',$title,PDO::PARAM_STR); - $stmt->bindParam('version',$version,PDO::PARAM_STR); + $stmt=CDBConnection::getInstance()->prepare("INSERT INTO ".CDBT_ENTRIES." (type, name, category_id, description, created, modified, visible) VALUES (:type, :name, :category, :description, NOW(), NOW(), TRUE)"); + $stmt->bindParam('type',$type,PDO::PARAM_STR); + $stmt->bindParam('name',$name,PDO::PARAM_STR); $stmt->bindParam('category',$category,PDO::PARAM_INT); $stmt->bindParam('description',$description,PDO::PARAM_STR); if(!$stmt->execute()) { return false; } - $entry_id = self::getId($title, $version); + $entry = self::get($type, $name); } // update entry - elseif ($update) { - $stmt=CDBConnection::getInstance()->prepare("UPDATE ".CDBT_ENTRIES." SET category=:category, description=:description, modified=NOW() WHERE id=:entry_id"); - $stmt->bindParam('entry_id',$entry_id,PDO::PARAM_STR); + elseif ($category != $entry['category_id'] || $description != $entry['description']) { + + $stmt=CDBConnection::getInstance()->prepare("UPDATE ".CDBT_ENTRIES." SET category_id=:category, description=:description, modified=NOW() WHERE id=:entry_id"); + $stmt->bindParam('entry_id',$entry['id'],PDO::PARAM_INT); $stmt->bindParam('category',$category,PDO::PARAM_INT); $stmt->bindParam('description',$description,PDO::PARAM_STR); if(!$stmt->execute()) { @@ -71,31 +78,45 @@ } } - return $entry_id; - } // end of member function add - - - - /** - * @FILLME - * - * @access public - */ - public static function addReport( $entry_id, $revision, $status = false ) + // insert version + $ver = self::getVersionId($entry['id'], $version); + if ($ver === false) { + $stmt=CDBConnection::getInstance()->prepare("INSERT INTO ".CDBT_VERSIONS." (entry_id, version, created) VALUES (:entry_id, :version, NOW())"); + $stmt->bindParam('entry_id',$entry['id'],PDO::PARAM_INT); + $stmt->bindParam('version',$version,PDO::PARAM_STR); + if(!$stmt->execute()) { + return false; + } + } + + return array('entry'=>$entry['id'],'version'=>self::getVersionId($entry['id'],$version)); + } // end of member function add + + + + /** + * @FILLME + * + * @access public + */ + public static function addReport( $entry_id, $version_id, $revision, $env, $env_version, $status = 'not' ) { global $RSDB_intern_user_id; // check if entry exists - if ($entry_id === false) { + if ($entry_id === false || $version_id === false) { echo 'Error: Unknown entry'; return false; } // insert - $stmt=CDBConnection::getInstance()->prepare("INSERT INTO ".CDBT_REPORTS." (entry_id, user_id, revision, works, created, visible, disabled) VALUES (:entry_id, :user_id, :revision, :status, NOW(), TRUE, FALSE)"); + $stmt=CDBConnection::getInstance()->prepare("INSERT INTO ".CDBT_REPORTS." (entry_id, version_id, user_id, revision, environment, environment_version, works, created, visible, disabled) VALUES (:entry_id, :version_id, :user_id, :revision, :env, :env_ver, :status, NOW(), TRUE, FALSE)"); $stmt->bindParam('entry_id',$entry_id,PDO::PARAM_INT); + $stmt->bindParam('version_id',$version_id,PDO::PARAM_INT); $stmt->bindParam('user_id',$RSDB_intern_user_id,PDO::PARAM_INT); $stmt->bindParam('revision',$revision,PDO::PARAM_INT); + $stmt->bindParam('env',$env,PDO::PARAM_STR); + $stmt->bindParam('env_ver',$env_version,PDO::PARAM_STR); $stmt->bindParam('status',$status,PDO::PARAM_STR); return $stmt->execute(); } // end of member function addReport @@ -133,11 +154,46 @@ * * @access public */ - public static function getId( $title, $version ) - { - // search for existing entry - $stmt=CDBConnection::getInstance()->prepare("SELECT id FROM ".CDBT_ENTRIES." WHERE name LIKE :name AND version LIKE :version LIMIT 1"); - $stmt->bindParam('name',$title,PDO::PARAM_STR); + public static function get( $type, $name ) + { + // search for existing entry + $stmt=CDBConnection::getInstance()->prepare("SELECT id, type, name, description, category_id FROM ".CDBT_ENTRIES." WHERE name LIKE :name AND type = :type LIMIT 1"); + $stmt->bindParam('name',$name,PDO::PARAM_STR); + $stmt->bindParam('type',$type,PDO::PARAM_STR); + $stmt->execute(); + return $stmt->fetchOnce(PDO::FETCH_ASSOC); + } // end of member function add + + + + /** + * @FILLME + * + * @access public + */ + public static function getEntryId( $type, $name ) + { + // search for existing entry + $entry = self::get($type, $name); + if ($entry !== false) { + return $entry['id']; + } + return false; + } // end of member function add + + + + /** + * @FILLME + * + * @access public + */ + public static function getVersionId( $entry_id, $version) + { + // search for existing entry + // search for existing entry + $stmt=CDBConnection::getInstance()->prepare("SELECT id FROM ".CDBT_VERSIONS." WHERE entry_id = :entry_id AND version = :version ORDER BY created DESC LIMIT 1"); + $stmt->bindParam('entry_id',$entry_id,PDO::PARAM_INT); $stmt->bindParam('version',$version,PDO::PARAM_STR); $stmt->execute(); return $stmt->fetchColumn(); Modified: branches/compat/lib/view/HTML_Submit.class.php URL:
http://svn.reactos.org/svn/reactos/branches/compat/lib/view/HTML_Submit.cla…
============================================================================== --- branches/compat/lib/view/HTML_Submit.class.php [iso-8859-1] (original) +++ branches/compat/lib/view/HTML_Submit.class.php [iso-8859-1] Tue May 5 02:33:07 2009 @@ -32,13 +32,25 @@ protected function build( ) { - $this->header(); - $this->navigation(); - if (isset($_REQUEST['submit']) && $_REQUEST['submit'] == 'yes') { - $this->submit(); - } - $this->body(); - $this->footer(); + if (isset($_POST['next']) && $_POST['next'] == 'entry') { + $entry_id = Entry::getEntryId($_POST['type'], $_POST['title']); + $version_id = Entry::getVersionId($entry_id, $_POST['version']); + header('location: ?page=item&ver='.$version_id); + exit; + } + elseif (isset($_POST['next']) && $_POST['next'] == 'bug') { + echo 'Imagine a bugzilla here'; + exit; + } + else { + $this->header(); + $this->navigation(); + if (isset($_REQUEST['submit']) && $_REQUEST['submit'] == 'yes') { + $this->submit(); + } + $this->body(); + $this->footer(); + } } @@ -54,18 +66,36 @@ // try to insert a new entry if (isset($_POST['title']) && $_POST['title'] != '' && isset($_POST['tags']) && isset($_POST['cat']) && isset($_POST['description']) && isset($_POST['version']) && $_POST['version'] != '') { - $entry_id = Entry::add($_POST['title'], $_POST['version'], $_POST['cat'], $_POST['description'], $_POST['tags'], (isset($_POST['iCheck']) && $_POST['iCheck'] == 'yes')); - } - - // search entry - else { - $entry_id = Entry::getId($_POST['title'], $_POST['version']); + $ids = Entry::add($_POST['type'], $_POST['title'], $_POST['version'], $_POST['cat'], $_POST['description'], $_POST['tags']); + + // got no error + if ($ids !== false) { + $entry_id = $ids['entry']; + $version_id = $ids['version']; + } } + if (!isset($entry_id)) { + $entry_id = Entry::getEntryId($_POST['type'], $_POST['title']); + if ($entry_id !== false) { + $version_id = Entry::getVersionId($entry_id, $_POST['version']); + } + } + // insert new report/comment - if ($entry_id !== false) { - if (isset($_POST['status']) && ($_POST['status'] == 'works' || $_POST['status'] == 'part' ||$_POST['status'] == 'not')) - Entry::addReport($entry_id, $revision, $_POST['status']); + if ($entry_id !== false && $version_id !== false) { + if (isset($_POST['status']) && ($_POST['status'] == 'full' || $_POST['status'] == 'part' ||$_POST['status'] == 'not')) { + if ($_POST['env'] == 'RH') { + $env = 'RH'; + $env_ver = ''; + } + else { + $env = $_POST['vm']; + $env_ver = $_POST['vmver']; + } + + Entry::addReport($entry_id, $version_id, $revision, $env, $env_ver, $_POST['status']); + } // insert new comment if (isset($_POST['comment']) && $_POST['comment'] != '') { @@ -81,71 +111,73 @@ $used_again = (isset($_POST['next']) && $_POST['next']=='again'); echo ' - <form action="?page=submit&submit=yes" method="post"> - <fieldset> - <legend>App Details</legend> - <ul style="list-style-type: none;"> - <li style="float: left;"> - <label for="title">Application Name:</label><br /> - <input type="text" name="title" id="title" onkeyup="suggestName(this.value);" /> - <div id="suggestedNames" style="display:none;border: 1px solid red;"></div> - </li> - - <li style="float: right;"> + <form id="submit" action="?page=submit&submit=yes" method="post" style="width: 700px;"> + <div> + <h1 class="left">Step 1</h1><h1> Tested software</h1> + <ul> + <li style="float: left;"> + <label for="type">Type:</label><br /> + <select name="type" id="type"> + <option value="app" selected="selected">Application</option> + <option value="dll">DLL-Library</option> + <option value="drv">Driver</option> + <option value="oth">Other</option> + </select> + </li> + + <li style="float: left;"> + <label for="title">Name:</label><br /> + <input type="text" name="title" id="title" onkeyup="'."suggestName(this.value);".'" /> + <div class="suggestion" id="suggestedNames" style="display:none;"></div> + </li> + + <li style="float: left;"> <label for="version">Version:</label><br /> - <input type="text" name="version" id="version" /> - <div id="suggestedVersions" style="display:none;border: 1px solid red;"></div> + <input type="text" name="version" id="version" style="width: 50%;" /> + <div class="suggestion" id="suggestedVersions" style="display:none;"></div> + </li> + + <li style="clear: both;float: left;"> + <label for="cat">Category:</label><br /> + <select name="cat" id="cat" style="width: 200px;"> + <option value="0"> </option> + '.Category::showTreeAsOption().' + </select> + </li> + <li style="float:left;"> + <label for="description">Short Description:</label><br /> + <input type="text" name="description" id="description" /> </li> <li style="clear: both;"> - <fieldset> - <legend> - <input type="checkbox" name="iCheck" id="iCheck" value="yes" onclick="toggleDetails();" /> - <label for="iCheck">I don\'t want to modify the additional information</label> - </legend> - <ul style="list-style-type: none;"> - <li> - <label for="cat">Category:</label><br /> - <select name="cat" id="cat"> - <option value="0"> </option> - '.Category::showTreeAsOption().' - </select> - </li> - <li> - <label for="description">Short Description:</label><br /> - <input type="text" name="description" id="description" /> - </li> - - <li> - <label for="tags">Tags: (e.g. vendor)</label><br /> - <input type="text" name="tags" id="tags" /> (seperate them by <em>,</em>) - </li> - </ul> + <label for="tags">Tags: (e.g. vendor)</label><br /> + <input type="text" name="tags" id="tags" /> (seperate them by <em>,</em>) </li> </ul> - </fieldset> - - <fieldset> - <legend>Test</legend> - <ul style="list-style-type: none;"> + <br style="clear: both;"/> + </div> + + <div> + <h1 class="left">Step 2</h1><h1> Test summary</h1> + <ul style="float:left;margin-right: 20px;"> <li> - Status:<br /> - <input type="radio" name="status" id="noworks" value="not" /> - <label for="noworks" style="color: red;">Doesn\'t Work</label> + <span class="label">Outcome:</span><br /> + <input type="radio" class="normal" name="status" id="works" value="full" onchange="'."javascript:document.getElementById('bugreport').style.display=(this.checked ? 'none' : 'block' );".'" /> + <label for="works" style="color: #00CC00;">Running Stable</label> - <input type="radio" name="status" id="partworks" value="part" /> - <label for="partworks" style="color: orange;">Works partly</label> + <input type="radio" class="normal" name="status" id="partworks" value="part" onchange="'."javascript:document.getElementById('bugreport').style.display=(this.checked ? 'none' : 'block' );".'" /> + <label for="partworks" style="color: #FF7800;">Minor Problems</label> - <input type="radio" name="status" id="works" value="works" /> - <label for="works" style="color: green;">Works</label> - <br /> - <br /> - </li> - <li> + <input type="radio" class="normal" name="status" id="noworks" value="not" onchange="'."javascript:document.getElementById('bugreport').style.display=(this.checked ? 'block' : 'none' );".'" /> + <label for="noworks" style="color: #FF3300;">Crash</label> + <br /> + <br /> + </li> + <li style="float: left;"> <label for="ver">Tested Version</label><br /> <select name="ver" id="ver" onchange="'."javascript:document.getElementById('directRev').style.display=(this.value=='R' ? 'block' : 'none' );".'"> - <option value="R"'.(($used_again && $_POST['ver'] == 'R') ? ' selected="selected"' : '').'>Use Revision</option>'; + <option value="R"'.(($used_again && $_POST['ver'] == 'R') ? ' selected="selected"' : '').'>Trunk</option>'; $stmt=CDBConnection::getInstance()->prepare("SELECT revision, name FROM ".CDBT_VERTAGS." WHERE VISIBLE IS TRUE ORDER BY revision DESC"); $stmt->execute(); @@ -159,47 +191,92 @@ </select> </li> - <li id="directRev"> - <label for="rev">Tested Revision (only trunk revisions are allowed, please don\'t enter revisions of tags or branches)</label><br /> + <li id="directRev" style="float:left;"> + <label for="rev">Revision:</label><br /> <input type="text" name="rev" id="rev"'.(($used_again && $_POST['ver'] == 'R') ? ' value="'.htmlspecialchars($_POST['revision']).'"' : '').' /> </li> - </ul>'; - + </ul> + <div style="float: left;margin-right: 10px;"> + <span class="label">Environment:</span><br /> + <input type="radio" class="normal" name="env" id="envvm" value="VM" checked="checked" onchange="'."javascript:document.getElementById('vmlist').style.display=(this.checked ? 'block' : 'none' );".'" /> + <label class="normal" for="envvm">Virtual Machine</label><br /> + + <input type="radio" class="normal" name="env" id="envrh" value="RH" onchange="'."javascript:document.getElementById('vmlist').style.display=(this.checked ? 'none' : 'block' );".'" /> + <label class="normal" for="envrh">Real Hardware</label> + </div> + <div id="vmlist" style="list-style-type: none;float: left;"> + <label for="vm">Virtual Machine:</label><br /> + <select id="vm" name="vm"> + <option> </option> + <option value="Bo">Bochs</option> + <option value="qe">Qemu</option> + <option value="vb">VirtualBox</option> + <option value="vp">VirtualPC</option> + <option value="vw">VMWare</option> + <option value="ot">Other</option> + </select> + <br /> + <label for="vmver">VM Version:</label><br /> + <input type="text" name="vmver" id="vmver" /> + </div> + <br style="clear: both;"/> + </div> + + <div> + <h1 class="left">Step 3</h1><h1> Test details</h1> + <ul> + <li> + <label for="comment">Comment</label><br /> + <textarea rows="5" cols="70" name="comment" id="comment"></textarea> + </li> + <li> + <span class="label">next action:</span><br /> + <input type="radio" class="normal" name="next" id="again" value="again" '.($used_again ? 'checked="checked"' : '').' /> + <label for="again" class="normal">Insert another entry/report</label> + <br /> + <input type="radio" class="normal" name="next" id="more" value="more" /> + <label for="more" class="normal">Add more information to that entry.</label> + <br /> + <div id="bugreport"> + <input type="radio" class="normal" name="next" id="bug" value="bug" /> + <label for="bug" class="normal">Fill a bug report</label> + <br /> + </div> + <input type="radio" class="normal" name="next" id="entry" value="entry" '.(!$used_again ? 'checked="checked"' : '').' /> + <label for="entry" class="normal">Jump to inserted entry/report</label> + </li> + </ul> + </div> + <div> + <button type="submit">Submit report</button> + </div> + <hr style="color: #777;" /> + </form> + <script type="text/javascript"> + //<!--'." + document.getElementById('bugreport').style.display='none'; + //".'--> + </script>'; + + // hide revision field if (!$used_again || $_POST['ver'] != 'R') { echo ' <script type="text/javascript"> - //<!-- - document.getElementById("directRev").style.display="none"; - //--> + //<!--'." + document.getElementById('directRev').style.display='none'; + //".'--> </script>'; } - echo ' - </fieldset> - - <fieldset> - <legend>Additional</legend> - <ul style="list-style-type: none;"> - <li> - <label for="comment">Comment</label><br /> - <textarea rows="6" cols="80" name="comment" id="comment"></textarea> - </li> - <li> - next action:<br /> - <input type="radio" name="next" id="again" value="again" '.($used_again ? 'checked="checked"' : '').' /> - <label for="again">Insert another entry/report</label> - <br /> - <input type="radio" name="next" id="more" value="more" /> - <label for="more">Add more information to that entry.</label> - <br /> - <input type="radio" name="next" id="entry" value="entry" '.(!$used_again ? 'checked="checked"' : '').' /> - <label for="entry">Jump to inserted entry/report</label> - </li> - </ul> - </fieldset> - <div> - <button type="submit">Submit new Compatibility Report</button> - </div> - </form>'; + + // hide VM + if ($used_again && $_POST['env'] == 'RH') { + echo ' + <script type="text/javascript"> + //<!--'." + document.getElementById('vmlist').style.display='none'; + //".'--> + </script>'; + } } // end of member function body
15 years, 6 months
1
0
0
0
[dgoette] 404: now this is hopefully the last commit for the compare function :)
by dgoette@svn.reactos.org
Author: dgoette Date: Tue May 5 01:07:34 2009 New Revision: 404 URL:
http://svn.reactos.org/svn/reactos?rev=404&view=rev
Log: now this is hopefully the last commit for the compare function :) Modified:
branches/danny-web/www/www.reactos.org/roscms/js/cms_website.js
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_ViewEdito…
Modified:
branches/danny-web/www/www.reactos.org/roscms/js/cms_website.js
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/r…
============================================================================== ---
branches/danny-web/www/www.reactos.org/roscms/js/cms_website.js
[iso-8859-1] (original) +++
branches/danny-web/www/www.reactos.org/roscms/js/cms_website.js
[iso-8859-1] Tue May 5 01:07:34 2009 @@ -1573,7 +1573,9 @@ case 'diff2': document.getElementById('frmdiff').innerHTML = http_request.responseText; loadEditor('diffentry'); - document.getElementById('frmeditdiff').innerHTML = WDiffShortenOutput(WDiffString(document.getElementById('frmeditdiff1').innerHTML, document.getElementById('frmeditdiff2').innerHTML)); + if (document.getElementById('frmeditdiff1') && document.getElementById('frmeditdiff2')) { + document.getElementById('frmeditdiff').innerHTML = WDiffShortenOutput(WDiffString(document.getElementById('frmeditdiff1').innerHTML, document.getElementById('frmeditdiff2').innerHTML)); + } break; case 'changetags': Modified:
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_ViewEdito…
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/r…
============================================================================== ---
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_ViewEdito…
[iso-8859-1] (original) +++
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_ViewEdito…
[iso-8859-1] Tue May 5 01:07:34 2009 @@ -317,7 +317,7 @@ $revisions_count = $stmt->fetchColumn(); // No compare - if ($revisions_count == 0) { + if ($revisions_count < 2) { $stmt=&DBConnection::getInstance()->prepare("SELECT name FROM ".ROSCMST_LANGUAGES." WHERE id=:lang_id"); $stmt->bindParam('lang_id',Language::getStandardId(),PDO::PARAM_INT); $stmt->execute();
15 years, 6 months
1
0
0
0
[dgoette] 403: hopefully the last commit for the compare function
by dgoette@svn.reactos.org
Author: dgoette Date: Tue May 5 00:42:31 2009 New Revision: 403 URL:
http://svn.reactos.org/svn/reactos?rev=403&view=rev
Log: hopefully the last commit for the compare function Modified:
branches/danny-web/www/www.reactos.org/roscms/js/cms_website.js
Modified:
branches/danny-web/www/www.reactos.org/roscms/js/cms_website.js
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/r…
============================================================================== ---
branches/danny-web/www/www.reactos.org/roscms/js/cms_website.js
[iso-8859-1] (original) +++
branches/danny-web/www/www.reactos.org/roscms/js/cms_website.js
[iso-8859-1] Tue May 5 00:42:31 2009 @@ -644,17 +644,17 @@ document.getElementById('previewarea').style.display = 'none'; document.getElementById('newentryarea').style.display = 'none'; document.getElementById('frameedit').style.display = 'block'; + document.getElementById('editzone').style.display = 'block'; - } - if (event == 'diff') { document.getElementById('editzone').style.display = 'none'; document.getElementById('frmdiff').style.display = 'block'; } else { - document.getElementById('editzone').style.display = 'block'; document.getElementById('frmdiff').style.display = 'none'; } + } + // deactivate alert-timer window.clearTimeout(alertactiv);
15 years, 6 months
1
0
0
0
[dgoette] 402: * styling fixes * hide statistics tab * another fix for compare function spotted by Colin Finck
by dgoette@svn.reactos.org
Author: dgoette Date: Tue May 5 00:21:49 2009 New Revision: 402 URL:
http://svn.reactos.org/svn/reactos?rev=402&view=rev
Log: * styling fixes * hide statistics tab * another fix for compare function spotted by Colin Finck Modified:
branches/danny-web/www/www.reactos.org/roscms/css/cms_maintain.css
branches/danny-web/www/www.reactos.org/roscms/css/cms_website.css
branches/danny-web/www/www.reactos.org/roscms/js/cms.js
branches/danny-web/www/www.reactos.org/roscms/js/cms_website-init.js
branches/danny-web/www/www.reactos.org/roscms/js/cms_website.js
branches/danny-web/www/www.reactos.org/roscms/lib/HTML_CMS.class.php
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Admin_Groups.clas…
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_UserDetai…
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_ViewEdito…
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_ViewUserD…
branches/danny-web/www/www.reactos.org/roscms/lib/view/HTML_CMS_Maintain.cl…
branches/danny-web/www/www.reactos.org/roscms/lib/view/HTML_CMS_Website.cla…
Modified:
branches/danny-web/www/www.reactos.org/roscms/css/cms_maintain.css
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/r…
============================================================================== ---
branches/danny-web/www/www.reactos.org/roscms/css/cms_maintain.css
[iso-8859-1] (original) +++
branches/danny-web/www/www.reactos.org/roscms/css/cms_maintain.css
[iso-8859-1] Tue May 5 00:21:49 2009 @@ -26,4 +26,15 @@ #maintainarea { margin-top: 1.5em; border: 1px dashed lightgrey; min-height: 200px; background-color: white; } #usertable { min-height: 200px; background-color: white; } -#lmAccess { margin-top: 1.5em; } +#lmAccess { margin-top: 1.5em; } + +LABEL { + display: block; + font-weight:bold; + color: #369; +} +LABEL.normal { + display: inline; + font-weight: normal; + color: black; +} Modified:
branches/danny-web/www/www.reactos.org/roscms/css/cms_website.css
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/r…
============================================================================== ---
branches/danny-web/www/www.reactos.org/roscms/css/cms_website.css
[iso-8859-1] (original) +++
branches/danny-web/www/www.reactos.org/roscms/css/cms_website.css
[iso-8859-1] Tue May 5 00:21:49 2009 @@ -90,3 +90,4 @@ .deletebutton { cursor:pointer; color:#006090; font-weight: bold; } +#previewzone {background-color: white;min-height: 300px;padding-top: 10px;} Modified:
branches/danny-web/www/www.reactos.org/roscms/js/cms.js
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/r…
============================================================================== ---
branches/danny-web/www/www.reactos.org/roscms/js/cms.js
[iso-8859-1] (original) +++
branches/danny-web/www/www.reactos.org/roscms/js/cms.js
[iso-8859-1] Tue May 5 00:21:49 2009 @@ -51,9 +51,11 @@ { if (id.value == search_phrase) { id.value = ''; + id.style.color='black'; } else if (id.value === '') { id.value = search_phrase; + id.style.color='gray'; } } // end of function clearSearchBox Modified:
branches/danny-web/www/www.reactos.org/roscms/js/cms_website-init.js
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/r…
============================================================================== ---
branches/danny-web/www/www.reactos.org/roscms/js/cms_website-init.js
[iso-8859-1] (original) +++
branches/danny-web/www/www.reactos.org/roscms/js/cms_website-init.js
[iso-8859-1] Tue May 5 00:21:49 2009 @@ -68,7 +68,7 @@ theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", - theme_advanced_resizing : false, + theme_advanced_resizing : true, plugi2n_insertdate_dateFormat : "%Y-%m-%d", plugi2n_insertdate_timeFormat : "%H:%M:%S", Modified:
branches/danny-web/www/www.reactos.org/roscms/js/cms_website.js
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/r…
============================================================================== ---
branches/danny-web/www/www.reactos.org/roscms/js/cms_website.js
[iso-8859-1] (original) +++
branches/danny-web/www/www.reactos.org/roscms/js/cms_website.js
[iso-8859-1] Tue May 5 00:21:49 2009 @@ -644,14 +644,17 @@ document.getElementById('previewarea').style.display = 'none'; document.getElementById('newentryarea').style.display = 'none'; document.getElementById('frameedit').style.display = 'block'; + } - if (event == 'diff') { - document.getElementById('editzone').style.display = 'none'; - } - else { - document.getElementById('editzone').style.display = 'block'; - } + if (event == 'diff') { + document.getElementById('editzone').style.display = 'none'; + document.getElementById('frmdiff').style.display = 'block'; + } + else { + document.getElementById('editzone').style.display = 'block'; + document.getElementById('frmdiff').style.display = 'none'; + } // deactivate alert-timer window.clearTimeout(alertactiv); Modified:
branches/danny-web/www/www.reactos.org/roscms/lib/HTML_CMS.class.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/r…
============================================================================== ---
branches/danny-web/www/www.reactos.org/roscms/lib/HTML_CMS.class.php
[iso-8859-1] (original) +++
branches/danny-web/www/www.reactos.org/roscms/lib/HTML_CMS.class.php
[iso-8859-1] Tue May 5 00:21:49 2009 @@ -138,7 +138,7 @@ // Statistics branch tab if ($thisuser->hasAccess('stats')) { echo_strip(' - <th'.(($this->branch == 'stats') ? ' class="active"' : '').'> + <th'.(($this->branch == 'stats') ? ' class="active"' : '').' style="display:none"> <div class="corner_TL"> <div class="corner_TR"> <a class="text" href="'.RosCMS::getInstance()->pathInstance().'?page=data&branch=stats" onclick="'."loadBranch()".'">Statistics</a> Modified:
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Admin_Groups.clas…
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/r…
============================================================================== ---
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Admin_Groups.clas…
[iso-8859-1] (original) +++
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Admin_Groups.clas…
[iso-8859-1] Tue May 5 00:21:49 2009 @@ -75,16 +75,19 @@ // list rights in header foreach ($rights as $right) { - echo '<th style="vertical-align:bottom;" title="'.$right['name'].': '.$right['description'].'"><img src="'.RosCMS::getInstance()->pathInstance().'?page=presentation&type=vtext&text='.$right['name'].'" alt="'.$right['name'].'" /></th>'; + echo '<th style="vertical-align:bottom;" title="'.$right['name'].': '.$right['description'].'"><img src="'.RosCMS::getInstance()->pathInstance().'?page=presentation&type=vtext&text='.$right['name'].'&bgcolor=5984C3&textc=ffffff" alt="'.$right['name'].'" /></th>'; } echo '</tr></thead><tbody>'; // get list of Groups $stmt=&DBConnection::getInstance()->prepare("SELECT id, name, description FROM ".ROSCMST_ACCESS." ORDER BY name ASC"); $stmt->execute(); + $x=0; while ($access = $stmt->fetch(PDO::FETCH_ASSOC)) { + ++$x; + echo_strip(' - <tr title="'.htmlspecialchars($access['description']).'"> + <tr id="tr'.$x.'" class="'.($x%2 ? 'even' : 'odd').'" onmouseover="'."hlRow('tr".$x."',1)".'" onmouseout="'."hlRow('tr".$x."',2)".'" title="'.htmlspecialchars($access['description']).'"> <td>'.htmlspecialchars($access['name']).'</td>'); // list rights per group @@ -117,8 +120,8 @@ while ($area = $stmt->fetch(PDO::FETCH_ASSOC)) { ++$x; echo_strip(' - <tr id="trg'.$x.'" class="'.($x%2 ? 'even' : 'odd').'" onmouseover="'."hlRow('tr".$x."',1)".'" onmouseout="'."hlRow('tr".$x."',2)".'"> - <td title="'.$area['description'].'"><label for="area'.$area['id'].'">'.$area['name'].'</label></td> + <tr id="trg'.$x.'" class="'.($x%2 ? 'even' : 'odd').'" onmouseover="'."hlRow('trg".$x."',1)".'" onmouseout="'."hlRow('trg".$x."',2)".'"> + <td title="'.$area['description'].'"><label class="normal" for="area'.$area['id'].'">'.$area['name'].'</label></td> <td><input type="checkbox" value="1" name="area'.$area['id'].'" id="area'.$area['id'].'" /></td> </tr>'); } @@ -219,7 +222,7 @@ while ($group = $stmt->fetch(PDO::FETCH_ASSOC)) { ++$x; echo_strip (' - <tr id="tr'.($x).'" class="'.($x%2 ? 'odd' : 'even').'" onclick="'."editGroup(".$group['id'].")".'" onmouseover="'."hlRow(this.id,1)".'" onmouseout="'."hlRow(this.id,2)".'"> + <tr id="trg'.($x).'" class="'.($x%2 ? 'odd' : 'even').'" onclick="'."editGroup(".$group['id'].")".'" onmouseover="'."hlRow(this.id,1)".'" onmouseout="'."hlRow(this.id,2)".'"> <td>'.$group['security_level'].'</td> <td>'.$group['name'].'</td> <td>'.htmlentities($group['description']).'</td> @@ -303,13 +306,16 @@ <br /> <fieldset> <legend>configure group access rights</legend> - <table> - <tr> - <th>ACL Name</th>'); + <table class="roscmsTable"> + <thead> + <tr> + <th>ACL Name</th>'); foreach ($rights as $right) { - echo '<th style="vertical-align:bottom;" title="'.$right['name'].': '.$right['description'].'"><img src="'.RosCMS::getInstance()->pathInstance().'?page=presentation&type=vtext&text='.$right['name'].'" alt="'.$right['name'].'" /></th>'; - } - echo '</tr>'; + echo '<th style="vertical-align:bottom;" title="'.$right['name'].': '.$right['description'].'"><img src="'.RosCMS::getInstance()->pathInstance().'?page=presentation&type=vtext&text='.$right['name'].'&bgcolor=5984C3&textc=ffffff" alt="'.$right['name'].'" /></th>'; + } + echo ' + </tr> + </thead>'; // for usage in loop $stmt_is=&DBConnection::getInstance()->prepare("SELECT TRUE FROM ".ROSCMST_ACL." WHERE group_id=:group_id AND right_id=:right_id AND access_id=:access_id LIMIT 1"); @@ -318,10 +324,13 @@ // show current ACL settings $stmt=&DBConnection::getInstance()->prepare("SELECT id, name, description FROM ".ROSCMST_ACCESS." ORDER BY name ASC"); $stmt->execute(); + $x=0; while ($access = $stmt->fetch(PDO::FETCH_ASSOC)) { + ++$x; + $stmt_is->bindParam('access_id',$access['id'],PDO::PARAM_INT); echo_strip(' - <tr title="'.htmlspecialchars($access['description']).'"> + <tr id="tr'.$x.'" class="'.($x%2 ? 'even' : 'odd').'" onmouseover="'."hlRow('tr".$x."',1)".'" onmouseout="'."hlRow('tr".$x."',2)".'" title="'.htmlspecialchars($access['description']).'"> <td>'.htmlspecialchars($access['name']).'</td>'); // show right per group @@ -341,10 +350,13 @@ <br /> <fieldset> <legend>Area Protection List (APL)</legend> - <table> - <tr> - <th>APL Name</th> - <th>Status</th>'); + <table class="roscmsTable"> + <thead> + <tr> + <th>APL Name</th> + <th>Status</th> + </tr> + </thead>'); // for usage in loop $stmt_is=&DBConnection::getInstance()->prepare("SELECT TRUE FROM ".ROSCMST_AREA_ACCESS." WHERE group_id=:group_id AND area_id=:area_id LIMIT 1"); @@ -353,14 +365,17 @@ // show current APL settings $stmt=&DBConnection::getInstance()->prepare("SELECT id, name, description FROM ".ROSCMST_AREA." ORDER BY name ASC"); $stmt->execute(); + $x=0; while ($area = $stmt->fetch(PDO::FETCH_ASSOC)) { + ++$x; + $stmt_is->bindParam('area_id',$area['id'],PDO::PARAM_INT); $stmt_is->execute(); $is = $stmt_is->fetchColumn(); echo_strip(' - <tr> - <td title="'.$area['description'].'"><label for="area'.$area['id'].'">'.$area['name'].'</label></td> + <tr id="trg'.$x.'" class="'.($x%2 ? 'even' : 'odd').'" onmouseover="'."hlRow('trg".$x."',1)".'" onmouseout="'."hlRow('trg".$x."',2)".'"> + <td title="'.$area['description'].'"><label class="normal" for="area'.$area['id'].'">'.$area['name'].'</label></td> <td><input type="checkbox" value="1" name="area'.$area['id'].'" id="area'.$area['id'].'"'.($is ? ' checked="checked"' : '').' /></td> </tr>'); } Modified:
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_UserDetai…
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/r…
============================================================================== ---
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_UserDetai…
[iso-8859-1] (original) +++
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_UserDetai…
[iso-8859-1] Tue May 5 00:21:49 2009 @@ -37,7 +37,6 @@ { parent::__construct(); - echo $_GET['action']; // some userdata has to be updated ? if (isset($_GET['action'])) { switch ($_GET['action']) { Modified:
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_ViewEdito…
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/r…
============================================================================== ---
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_ViewEdito…
[iso-8859-1] (original) +++
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_ViewEdito…
[iso-8859-1] Tue May 5 00:21:49 2009 @@ -367,8 +367,7 @@ <span id="mefasi"> </span> </div> </div> - </div> - <div id="frmdiff" style="display:none;"></div>'); + </div>'); } // end of member function showEditor Modified:
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_ViewUserD…
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/r…
============================================================================== ---
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_ViewUserD…
[iso-8859-1] (original) +++
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_ViewUserD…
[iso-8859-1] Tue May 5 00:21:49 2009 @@ -74,8 +74,7 @@ <p><strong>Registered:</strong> '.$user['created'].'</p> <p>Account is '.($user['disabled']==false?'enabled':'disabled').' ( - <span class="frmeditbutton" onclick="'."setAccount(".$user['id'].", '".($user['disabled']==false?'disable':'enable')."')".'"> '.($user['disabled']==false?'disable':'enable').'</span> - it) + <span class="virtualLink" onclick="'."setAccount(".$user['id'].", '".($user['disabled']==false?'disable':'enable')."')".'">'.($user['disabled']==false?'disable':'enable').' account</span>) </p>'); } Modified:
branches/danny-web/www/www.reactos.org/roscms/lib/view/HTML_CMS_Maintain.cl…
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/r…
============================================================================== ---
branches/danny-web/www/www.reactos.org/roscms/lib/view/HTML_CMS_Maintain.cl…
[iso-8859-1] (original) +++
branches/danny-web/www/www.reactos.org/roscms/lib/view/HTML_CMS_Maintain.cl…
[iso-8859-1] Tue May 5 00:21:49 2009 @@ -292,7 +292,7 @@ <div id="pageAccess" style="display: none;"> <div class="toolbar"> <div class="button" onclick="addAccess()"> - <img src="'.RosCMS::getInstance()->pathRosCMS().'images/clear.gif" alt="" /> + <img src="'.RosCMS::getInstance()->pathRosCMS().'images/new.png" alt="" /> <span class="text">add new</span> </div> </div> @@ -317,7 +317,7 @@ <div id="pageGroups" style="display: none;"> <div class="toolbar"> <div class="button" onclick="addGroup()"> - <img src="'.RosCMS::getInstance()->pathRosCMS().'images/clear.gif" alt="" /> + <img src="'.RosCMS::getInstance()->pathRosCMS().'images/new.png" alt="" /> <span class="text">add new</span> </div> </div> @@ -339,7 +339,7 @@ <div id="pageLanguages" style="display: none;"> <div class="toolbar"> <div class="button" onclick="addLanguage()"> - <img src="'.RosCMS::getInstance()->pathRosCMS().'images/clear.gif" alt="" /> + <img src="'.RosCMS::getInstance()->pathRosCMS().'images/new.png" alt="" /> <span class="text">add new</span> </div> </div> Modified:
branches/danny-web/www/www.reactos.org/roscms/lib/view/HTML_CMS_Website.cla…
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/r…
============================================================================== ---
branches/danny-web/www/www.reactos.org/roscms/lib/view/HTML_CMS_Website.cla…
[iso-8859-1] (original) +++
branches/danny-web/www/www.reactos.org/roscms/lib/view/HTML_CMS_Website.cla…
[iso-8859-1] Tue May 5 00:21:49 2009 @@ -318,7 +318,7 @@ <div id="frmedithead" style="padding-bottom: 10px;"> </div> <div style="width:100%;"> <div id="editzone"> </div> - <div id="frmdiff"></div> + <div id="frmdiff" style="display:none;"></div> </div> </div> <div id="previewarea" style="display:none;">
15 years, 6 months
1
0
0
0
[gedmurphy] 40789: Add most of the code for the dependencies tab in the property sheet. It's not quite complete but I'm getting bored with it now. May finish it tomorrow.
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Mon May 4 22:44:54 2009 New Revision: 40789 URL:
http://svn.reactos.org/svn/reactos?rev=40789&view=rev
Log: Add most of the code for the dependencies tab in the property sheet. It's not quite complete but I'm getting bored with it now. May finish it tomorrow. Added: trunk/reactos/base/applications/mscutils/servman/dependencies.c (with props) trunk/reactos/base/applications/mscutils/servman/propsheet_depends.c (with props) trunk/reactos/base/applications/mscutils/servman/propsheet_general.c (with props) trunk/reactos/base/applications/mscutils/servman/res/driver.ico (with props) trunk/reactos/base/applications/mscutils/servman/res/nodepends.ico (with props) Modified: trunk/reactos/base/applications/mscutils/servman/lang/en-US.rc trunk/reactos/base/applications/mscutils/servman/mainwnd.c trunk/reactos/base/applications/mscutils/servman/misc.c trunk/reactos/base/applications/mscutils/servman/precomp.h trunk/reactos/base/applications/mscutils/servman/propsheet.c trunk/reactos/base/applications/mscutils/servman/resource.h trunk/reactos/base/applications/mscutils/servman/rsrc.rc trunk/reactos/base/applications/mscutils/servman/servman.rbuild trunk/reactos/base/applications/mscutils/servman/stop.c Added: trunk/reactos/base/applications/mscutils/servman/dependencies.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
============================================================================== --- trunk/reactos/base/applications/mscutils/servman/dependencies.c (added) +++ trunk/reactos/base/applications/mscutils/servman/dependencies.c [iso-8859-1] Mon May 4 22:44:54 2009 @@ -1,0 +1,228 @@ +/* + * PROJECT: ReactOS Services + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/applications/mscutils/servman/dependencies.c + * PURPOSE: Helper functions for service dependents + * COPYRIGHT: Copyright 2006-2009 Ged Murphy <gedmurphy(a)reactos.org> + * + */ + +#include "precomp.h" + +LPENUM_SERVICE_STATUS +GetDependentServices(SC_HANDLE hService, + LPDWORD lpdwCount) +{ + LPENUM_SERVICE_STATUS lpDependencies; + DWORD dwBytesNeeded; + DWORD dwCount; + + if (EnumDependentServices(hService, + SERVICE_ACTIVE, + NULL, + 0, + &dwBytesNeeded, + &dwCount)) + { + /* There are no dependent services */ + return NULL; + } + else + { + if (GetLastError() != ERROR_MORE_DATA) + return NULL; /* Unexpected error */ + + lpDependencies = (LPENUM_SERVICE_STATUS)HeapAlloc(GetProcessHeap(), + 0, + dwBytesNeeded); + if (lpDependencies) + { + if (EnumDependentServices(hService, + SERVICE_ACTIVE, + lpDependencies, + dwBytesNeeded, + &dwBytesNeeded, + &dwCount)) + { + *lpdwCount = dwCount; + } + else + { + HeapFree(ProcessHeap, + 0, + lpDependencies); + + lpDependencies = NULL; + } + } + } + + return lpDependencies; + +} + + +BOOL +HasDependentServices(SC_HANDLE hService) +{ + DWORD dwBytesNeeded, dwCount; + BOOL bRet = FALSE; + + if (hService) + { + if (!EnumDependentServices(hService, + SERVICE_ACTIVE, + NULL, + 0, + &dwBytesNeeded, + &dwCount)) + { + if (GetLastError() == ERROR_MORE_DATA) + bRet = TRUE; + } + } + + return bRet; +} + +static BOOL +DoInitDependsDialog(PSTOP_INFO pStopInfo, + HWND hDlg) +{ + LPENUM_SERVICE_STATUS lpDependencies; + DWORD dwCount; + LPTSTR lpPartialStr, lpStr; + DWORD fullLen; + HICON hIcon = NULL; + BOOL bRet = FALSE; + + if (pStopInfo) + { + SetWindowLongPtr(hDlg, + GWLP_USERDATA, + (LONG_PTR)pStopInfo); + + hIcon = (HICON)LoadImage(hInstance, + MAKEINTRESOURCE(IDI_SM_ICON), + IMAGE_ICON, + 16, + 16, + 0); + if (hIcon) + { + SendMessage(hDlg, + WM_SETICON, + ICON_SMALL, + (LPARAM)hIcon); + DestroyIcon(hIcon); + } + + /* Add the label */ + if (AllocAndLoadString(&lpPartialStr, + hInstance, + IDS_STOP_DEPENDS)) + { + fullLen = _tcslen(lpPartialStr) + _tcslen(pStopInfo->pInfo->pCurrentService->lpDisplayName) + 1; + + lpStr = HeapAlloc(ProcessHeap, + 0, + fullLen * sizeof(TCHAR)); + if (lpStr) + { + _sntprintf(lpStr, fullLen, lpPartialStr, pStopInfo->pInfo->pCurrentService->lpDisplayName); + + SendDlgItemMessage(hDlg, + IDC_STOP_DEPENDS, + WM_SETTEXT, + 0, + (LPARAM)lpStr); + + bRet = TRUE; + + HeapFree(ProcessHeap, + 0, + lpStr); + } + + HeapFree(ProcessHeap, + 0, + lpPartialStr); + } + + /* Get the list of dependencies */ + lpDependencies = GetDependentServices(pStopInfo->hMainService, &dwCount); + if (lpDependencies) + { + LPENUM_SERVICE_STATUS lpEnumServiceStatus; + DWORD i; + + for (i = 0; i < dwCount; i++) + { + lpEnumServiceStatus = &lpDependencies[i]; + + /* Add the service to the listbox */ + SendDlgItemMessage(hDlg, + IDC_STOP_DEPENDS_LB, + LB_ADDSTRING, + 0, + (LPARAM)lpEnumServiceStatus->lpDisplayName); + } + + HeapFree(ProcessHeap, + 0, + lpDependencies); + } + } + + return bRet; +} + + +INT_PTR CALLBACK +StopDependsDialogProc(HWND hDlg, + UINT message, + WPARAM wParam, + LPARAM lParam) +{ + PSTOP_INFO pStopInfo = NULL; + + /* Get the window context */ + pStopInfo = (PSTOP_INFO)GetWindowLongPtr(hDlg, + GWLP_USERDATA); + if (pStopInfo == NULL && message != WM_INITDIALOG) + { + return FALSE; + } + + switch (message) + { + case WM_INITDIALOG: + { + BOOL bRet = FALSE; + + pStopInfo = (PSTOP_INFO)lParam; + if (pStopInfo != NULL) + { + bRet = DoInitDependsDialog(pStopInfo, hDlg); + } + + return bRet; + } + + case WM_COMMAND: + { + switch (LOWORD(wParam)) + { + case IDOK: + case IDCANCEL: + { + EndDialog(hDlg, + LOWORD(wParam)); + return TRUE; + } + } + } + } + + return FALSE; +} Propchange: trunk/reactos/base/applications/mscutils/servman/dependencies.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/base/applications/mscutils/servman/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
============================================================================== --- trunk/reactos/base/applications/mscutils/servman/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/servman/lang/en-US.rc [iso-8859-1] Mon May 4 22:44:54 2009 @@ -205,6 +205,7 @@ BEGIN IDS_NUM_SERVICES "Num Services: %d" IDS_STOP_DEPENDS "When %s stops, these other services will also stop" + IDS_NO_DEPENDS "<No Dependencies>" IDS_LICENSE "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA." END Modified: trunk/reactos/base/applications/mscutils/servman/mainwnd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
============================================================================== --- trunk/reactos/base/applications/mscutils/servman/mainwnd.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/servman/mainwnd.c [iso-8859-1] Mon May 4 22:44:54 2009 @@ -288,8 +288,9 @@ hImageList = InitImageList(IDB_PROP, IDB_RESTART, - 16, - 16); + GetSystemMetrics(SM_CXSMICON), + GetSystemMetrics(SM_CXSMICON), + IMAGE_BITMAP); if (hImageList == NULL) return FALSE; @@ -890,7 +891,7 @@ WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, CW_USEDEFAULT, CW_USEDEFAULT, - 650, + 680, 450, NULL, NULL, Modified: trunk/reactos/base/applications/mscutils/servman/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
============================================================================== --- trunk/reactos/base/applications/mscutils/servman/misc.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/servman/misc.c [iso-8859-1] Mon May 4 22:44:54 2009 @@ -219,42 +219,59 @@ InitImageList(UINT StartResource, UINT EndResource, UINT Width, - UINT Height) -{ - HBITMAP hBitmap; - HIMAGELIST hImageList; + UINT Height, + ULONG type) +{ + HANDLE hImage; + HIMAGELIST himl; UINT i; - INT Ret; + INT ret; /* Create the toolbar icon image list */ - hImageList = ImageList_Create(Width, - Height, - ILC_MASK | ILC_COLOR24, - EndResource - StartResource, - 0); - if (hImageList == NULL) + himl = ImageList_Create(Width, + Height, + ILC_MASK | ILC_COLOR32, + EndResource - StartResource, + 0); + if (himl == NULL) return NULL; - /* Add all icons to the image list */ - for (i = StartResource; i <= EndResource; i++) - { - hBitmap = (HBITMAP) LoadImage(hInstance, - MAKEINTRESOURCE(i), - IMAGE_BITMAP, - Width, - Height, - LR_LOADTRANSPARENT); - if (hBitmap == NULL) - return NULL; - - Ret = ImageList_AddMasked(hImageList, - hBitmap, - RGB(255, 0, 128)); - if (Ret == -1) - return NULL; - - DeleteObject(hBitmap); - } - - return hImageList; -} + ret = 0; + for (i = StartResource; i <= EndResource && ret != -1; i++) + { + hImage = LoadImage(hInstance, + MAKEINTRESOURCE(i), + type, + Width, + Height, + LR_LOADTRANSPARENT); + if (hImage == NULL) + { + ImageList_Destroy(himl); + himl = NULL; + break; + } + + if (type == IMAGE_BITMAP) + { + ret = ImageList_AddMasked(himl, + hImage, + RGB(255, 0, 128)); + } + else if (type == IMAGE_ICON) + { + ret = ImageList_AddIcon(himl, + hImage); + } + + DeleteObject(hImage); + } + + if (ret == -1) + { + ImageList_Destroy(himl); + himl = NULL; + } + + return himl; +} Modified: trunk/reactos/base/applications/mscutils/servman/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
============================================================================== --- trunk/reactos/base/applications/mscutils/servman/precomp.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/servman/precomp.h [iso-8859-1] Mon May 4 22:44:54 2009 @@ -75,6 +75,14 @@ /* start */ BOOL DoStart(PMAIN_WND_INFO Info); +/* stop */ +typedef struct _STOP_INFO +{ + PMAIN_WND_INFO pInfo; + SC_HANDLE hSCManager; + SC_HANDLE hMainService; +} STOP_INFO, *PSTOP_INFO; + /* control */ BOOL Control(PMAIN_WND_INFO Info, HWND hProgDlg, DWORD Control); BOOL DoStop(PMAIN_WND_INFO Info); @@ -97,11 +105,30 @@ BOOL UpdateServiceStatus(ENUM_SERVICE_STATUS_PROCESS* pService); BOOL GetServiceList(PMAIN_WND_INFO Info, DWORD *NumServices); -/* reg */ -BOOL SetDescription(LPTSTR, LPTSTR); +/* dependencies */ +LPENUM_SERVICE_STATUS GetDependentServices(SC_HANDLE hService, LPDWORD lpdwCount); +BOOL HasDependentServices(SC_HANDLE hService); +INT_PTR CALLBACK StopDependsDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); /* propsheet.c */ +typedef struct _SERVICEPROPSHEET +{ + PMAIN_WND_INFO Info; + ENUM_SERVICE_STATUS_PROCESS *pService; + HIMAGELIST hDependsImageList; +} SERVICEPROPSHEET, *PSERVICEPROPSHEET; + LONG APIENTRY OpenPropSheet(PMAIN_WND_INFO Info); + +/* propsheet window procs */ +INT_PTR CALLBACK DependenciesPageProc(HWND hwndDlg, + UINT uMsg, + WPARAM wParam, + LPARAM lParam); +INT_PTR CALLBACK GeneralPageProc(HWND hwndDlg, + UINT uMsg, + WPARAM wParam, + LPARAM lParam); /* export.c */ VOID ExportFile(PMAIN_WND_INFO Info); @@ -128,9 +155,10 @@ IN UINT Res); VOID GetError(VOID); VOID DisplayString(PTCHAR); -HIMAGELIST InitImageList(UINT NumButtons, - UINT StartResource, +HIMAGELIST InitImageList(UINT StartResource, + UINT EndResource, UINT Width, - UINT Height); + UINT Height, + ULONG type); #endif /* __SERVMAN_PRECOMP_H */ Modified: trunk/reactos/base/applications/mscutils/servman/propsheet.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
============================================================================== --- trunk/reactos/base/applications/mscutils/servman/propsheet.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/servman/propsheet.c [iso-8859-1] Mon May 4 22:44:54 2009 @@ -9,429 +9,6 @@ #include "precomp.h" -typedef struct _SERVICEPROPSHEET -{ - PMAIN_WND_INFO Info; - ENUM_SERVICE_STATUS_PROCESS *pService; -} SERVICEPROPSHEET, *PSERVICEPROPSHEET; - - -static VOID -SetButtonStates(PSERVICEPROPSHEET dlgInfo, - HWND hwndDlg) -{ - HWND hButton; - LPQUERY_SERVICE_CONFIG lpServiceConfig; - DWORD Flags, State; - UINT i; - - Flags = dlgInfo->pService->ServiceStatusProcess.dwControlsAccepted; - State = dlgInfo->pService->ServiceStatusProcess.dwCurrentState; - - for (i = IDC_START; i <= IDC_RESUME; i++) - { - hButton = GetDlgItem(hwndDlg, i); - EnableWindow (hButton, FALSE); - } - - lpServiceConfig = GetServiceConfig(dlgInfo->pService->lpServiceName); - if (State == SERVICE_STOPPED && - lpServiceConfig && lpServiceConfig->dwStartType != SERVICE_DISABLED) - { - hButton = GetDlgItem(hwndDlg, IDC_START); - EnableWindow (hButton, TRUE); - HeapFree(GetProcessHeap(), 0, lpServiceConfig); - } - else if ( (Flags & SERVICE_ACCEPT_STOP) && (State == SERVICE_RUNNING) ) - { - hButton = GetDlgItem(hwndDlg, IDC_STOP); - EnableWindow (hButton, TRUE); - } - else if ( (Flags & SERVICE_ACCEPT_PAUSE_CONTINUE) && (State == SERVICE_RUNNING) ) - { - hButton = GetDlgItem(hwndDlg, IDC_PAUSE); - EnableWindow (hButton, TRUE); - } - - /* set the main toolbar */ - SetMenuAndButtonStates(dlgInfo->Info); -} - - -static VOID -SetServiceStatusText(PSERVICEPROPSHEET dlgInfo, - HWND hwndDlg) -{ - LPTSTR lpStatus; - UINT id; - - if (dlgInfo->pService->ServiceStatusProcess.dwCurrentState == SERVICE_RUNNING) - { - id = IDS_SERVICES_STARTED; - } - else - { - id = IDS_SERVICES_STOPPED; - } - - if (AllocAndLoadString(&lpStatus, - hInstance, - id)) - { - SendDlgItemMessage(hwndDlg, - IDC_SERV_STATUS, - WM_SETTEXT, - 0, - (LPARAM)lpStatus); - LocalFree(lpStatus); - } -} - -/* - * Fills the 'startup type' combo box with possible - * values and sets it to value of the selected item - */ -static VOID -SetStartupType(LPTSTR lpServiceName, - HWND hwndDlg) -{ - HWND hList; - LPQUERY_SERVICE_CONFIG pServiceConfig; - LPTSTR lpBuf; - DWORD StartUp = 0; - UINT i; - - hList = GetDlgItem(hwndDlg, IDC_START_TYPE); - - for (i = IDS_SERVICES_AUTO; i <= IDS_SERVICES_DIS; i++) - { - if (AllocAndLoadString(&lpBuf, - hInstance, - i)) - { - SendMessage(hList, - CB_ADDSTRING, - 0, - (LPARAM)lpBuf); - LocalFree(lpBuf); - } - } - - pServiceConfig = GetServiceConfig(lpServiceName); - - if (pServiceConfig) - { - switch (pServiceConfig->dwStartType) - { - case SERVICE_AUTO_START: StartUp = 0; break; - case SERVICE_DEMAND_START: StartUp = 1; break; - case SERVICE_DISABLED: StartUp = 2; break; - } - - SendMessage(hList, - CB_SETCURSEL, - StartUp, - 0); - - HeapFree(ProcessHeap, - 0, - pServiceConfig); - } -} - - -/* - * Populates the General Properties dialog with - * the relevant service information - */ -static VOID -InitGeneralPage(PSERVICEPROPSHEET dlgInfo, - HWND hwndDlg) -{ - LPQUERY_SERVICE_CONFIG pServiceConfig; - LPTSTR lpDescription; - - /* set the service name */ - SendDlgItemMessage(hwndDlg, - IDC_SERV_NAME, - WM_SETTEXT, - 0, - (LPARAM)dlgInfo->pService->lpServiceName); - - /* set the display name */ - SendDlgItemMessage(hwndDlg, - IDC_DISP_NAME, - WM_SETTEXT, - 0, - (LPARAM)dlgInfo->pService->lpDisplayName); - - /* set the description */ - if ((lpDescription = GetServiceDescription(dlgInfo->pService->lpServiceName))) - { - SendDlgItemMessage(hwndDlg, - IDC_DESCRIPTION, - WM_SETTEXT, - 0, - (LPARAM)lpDescription); - - HeapFree(ProcessHeap, - 0, - lpDescription); - } - - pServiceConfig = GetServiceConfig(dlgInfo->pService->lpServiceName); - if (pServiceConfig) - { - SendDlgItemMessage(hwndDlg, - IDC_EXEPATH, - WM_SETTEXT, - 0, - (LPARAM)pServiceConfig->lpBinaryPathName); - HeapFree(ProcessHeap, - 0, - pServiceConfig); - } - - - /* set startup type */ - SetStartupType(dlgInfo->pService->lpServiceName, hwndDlg); - - SetServiceStatusText(dlgInfo, - hwndDlg); - - if (dlgInfo->Info->bIsUserAnAdmin) - { - HWND hEdit = GetDlgItem(hwndDlg, - IDC_EDIT); - EnableWindow(hEdit, - TRUE); - } -} - - -VOID -SaveDlgInfo(PSERVICEPROPSHEET dlgInfo, - HWND hwndDlg) -{ - LPQUERY_SERVICE_CONFIG pServiceConfig = NULL; - HWND hList; - DWORD StartUp; - - pServiceConfig = HeapAlloc(ProcessHeap, - HEAP_ZERO_MEMORY, - sizeof(*pServiceConfig)); - if (pServiceConfig) - { - pServiceConfig->dwServiceType = SERVICE_NO_CHANGE; - pServiceConfig->dwErrorControl = SERVICE_NO_CHANGE; - - hList = GetDlgItem(hwndDlg, IDC_START_TYPE); - StartUp = SendMessage(hList, - CB_GETCURSEL, - 0, - 0); - switch (StartUp) - { - case 0: pServiceConfig->dwStartType = SERVICE_AUTO_START; break; - case 1: pServiceConfig->dwStartType = SERVICE_DEMAND_START; break; - case 2: pServiceConfig->dwStartType = SERVICE_DISABLED; break; - } - - if (SetServiceConfig(pServiceConfig, - dlgInfo->pService->lpServiceName, - NULL)) - { - ChangeListViewText(dlgInfo->Info, - dlgInfo->pService, - LVSTARTUP); - } - - HeapFree(ProcessHeap, - 0, - pServiceConfig); - } -} - - -/* - * General Property dialog callback. - * Controls messages to the General dialog - */ -static INT_PTR CALLBACK -GeneralPageProc(HWND hwndDlg, - UINT uMsg, - WPARAM wParam, - LPARAM lParam) -{ - PSERVICEPROPSHEET dlgInfo; - - /* Get the window context */ - dlgInfo = (PSERVICEPROPSHEET)GetWindowLongPtr(hwndDlg, - GWLP_USERDATA); - if (dlgInfo == NULL && uMsg != WM_INITDIALOG) - { - return FALSE; - } - - switch (uMsg) - { - case WM_INITDIALOG: - { - dlgInfo = (PSERVICEPROPSHEET)(((LPPROPSHEETPAGE)lParam)->lParam); - if (dlgInfo != NULL) - { - SetWindowLongPtr(hwndDlg, - GWLP_USERDATA, - (LONG_PTR)dlgInfo); - InitGeneralPage(dlgInfo, hwndDlg); - SetButtonStates(dlgInfo, hwndDlg); - } - } - break; - - case WM_COMMAND: - switch(LOWORD(wParam)) - { - case IDC_START_TYPE: - if (HIWORD(wParam) == CBN_SELCHANGE) - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - break; - - case IDC_START: - if (DoStart(dlgInfo->Info)) - { - UpdateServiceStatus(dlgInfo->pService); - ChangeListViewText(dlgInfo->Info, dlgInfo->pService, LVSTATUS); - SetButtonStates(dlgInfo, hwndDlg); - SetServiceStatusText(dlgInfo, hwndDlg); - } - break; - - case IDC_STOP: - if (DoStop(dlgInfo->Info)) - { - UpdateServiceStatus(dlgInfo->pService); - ChangeListViewText(dlgInfo->Info, dlgInfo->pService, LVSTATUS); - SetButtonStates(dlgInfo, hwndDlg); - SetServiceStatusText(dlgInfo, hwndDlg); - } - break; - - case IDC_PAUSE: - if (DoPause(dlgInfo->Info)) - { - UpdateServiceStatus(dlgInfo->pService); - ChangeListViewText(dlgInfo->Info, dlgInfo->pService, LVSTATUS); - SetButtonStates(dlgInfo, hwndDlg); - SetServiceStatusText(dlgInfo, hwndDlg); - } - break; - - case IDC_RESUME: - if (DoResume(dlgInfo->Info)) - { - UpdateServiceStatus(dlgInfo->pService); - ChangeListViewText(dlgInfo->Info, dlgInfo->pService, LVSTATUS); - SetButtonStates(dlgInfo, hwndDlg); - SetServiceStatusText(dlgInfo, hwndDlg); - } - break; - - case IDC_EDIT: - { - HWND hName, hDesc, hExePath; - - hName = GetDlgItem(hwndDlg, IDC_DISP_NAME); - hDesc = GetDlgItem(hwndDlg, IDC_DESCRIPTION); - hExePath = GetDlgItem(hwndDlg, IDC_EXEPATH); - - SendMessage(hName, EM_SETREADONLY, FALSE, 0); - SendMessage(hDesc, EM_SETREADONLY, FALSE, 0); - SendMessage(hExePath, EM_SETREADONLY, FALSE, 0); - } - break; - - case IDC_START_PARAM: - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - break; - } - break; - - case WM_NOTIFY: - { - LPNMHDR lpnm = (LPNMHDR)lParam; - - switch (lpnm->code) - { - case PSN_APPLY: - SaveDlgInfo(dlgInfo, hwndDlg); - SetButtonStates(dlgInfo, hwndDlg); - break; - } - } - break; - } - - return FALSE; -} -/* -static VOID -InitDependPage(PSERVICEPROPSHEET dlgInfo, - HWND hwndDlg) -{ - - -} - - - -* - * Dependancies Property dialog callback. - * Controls messages to the Dependancies dialog - * -static INT_PTR CALLBACK -DependanciesPageProc(HWND hwndDlg, - UINT uMsg, - WPARAM wParam, - LPARAM lParam) -{ - PSERVICEPROPSHEET dlgInfo; - - dlgInfo = (PSERVICEPROPSHEET)GetWindowLongPtr(hwndDlg, - GWLP_USERDATA); - - if (dlgInfo == NULL && uMsg != WM_INITDIALOG) - { - return FALSE; - } - - switch (uMsg) - { - case WM_INITDIALOG: - { - dlgInfo = (PSERVICEPROPSHEET)(((LPPROPSHEETPAGE)lParam)->lParam); - if (dlgInfo != NULL) - { - SetWindowLongPtr(hwndDlg, - GWLP_USERDATA, - (LONG_PTR)dlgInfo); - - InitDependPage(dlgInfo, hwndDlg); - } - } - break; - - case WM_COMMAND: - switch(LOWORD(wParam)) - { - - } - break; - } - - return FALSE; -} -*/ static VOID InitPropSheetPage(PROPSHEETPAGE *psp, @@ -453,7 +30,7 @@ OpenPropSheet(PMAIN_WND_INFO Info) { PROPSHEETHEADER psh; - PROPSHEETPAGE psp[1]; + PROPSHEETPAGE psp[2]; PSERVICEPROPSHEET pServicePropSheet; LONG Ret = 0; @@ -481,7 +58,7 @@ InitPropSheetPage(&psp[0], pServicePropSheet, IDD_DLG_GENERAL, GeneralPageProc); //InitPropSheetPage(&psp[1], Info, IDD_DLG_GENERAL, LogonPageProc); //InitPropSheetPage(&psp[2], Info, IDD_DLG_GENERAL, RecoveryPageProc); - //InitPropSheetPage(&psp[1], pServicePropSheet, IDD_DLG_DEPEND, DependanciesPageProc); + InitPropSheetPage(&psp[1], pServicePropSheet, IDD_DLG_DEPEND, DependenciesPageProc); Ret = (LONG)(PropertySheet(&psh) != -1); Added: trunk/reactos/base/applications/mscutils/servman/propsheet_depends.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
============================================================================== --- trunk/reactos/base/applications/mscutils/servman/propsheet_depends.c (added) +++ trunk/reactos/base/applications/mscutils/servman/propsheet_depends.c [iso-8859-1] Mon May 4 22:44:54 2009 @@ -1,0 +1,314 @@ +/* + * PROJECT: ReactOS Services + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/applications/mscutils/servman/propsheet_depends.c + * PURPOSE: Property dialog box message handler + * COPYRIGHT: Copyright 2006-2009 Ged Murphy <gedmurphy(a)reactos.org> + * + */ + +#include "precomp.h" + + +static HTREEITEM +AddItemToTreeView(HWND hTreeView, + HTREEITEM hRoot, + LPTSTR lpLabel, + ULONG serviceType) +{ + TV_ITEM tvi; + TV_INSERTSTRUCT tvins; + + ZeroMemory(&tvi, sizeof(tvi)); + ZeroMemory(&tvins, sizeof(tvins)); + + tvi.mask = TVIF_TEXT | TVIF_SELECTEDIMAGE | TVIF_IMAGE; + tvi.pszText = lpLabel; + tvi.cchTextMax = lstrlen(lpLabel); + + if (serviceType == SERVICE_WIN32_OWN_PROCESS || + serviceType == SERVICE_WIN32_SHARE_PROCESS) + { + tvi.iImage = 1; + tvi.iSelectedImage = 1; + } + else if (serviceType == SERVICE_KERNEL_DRIVER || + serviceType == SERVICE_FILE_SYSTEM_DRIVER) + { + tvi.iImage = 2; + tvi.iSelectedImage = 2; + } + else + { + tvi.iImage = 0; + tvi.iSelectedImage = 0; + } + + tvins.item = tvi; + tvins.hParent = hRoot; + + return TreeView_InsertItem(hTreeView, &tvins); +} + +static VOID +AddServiceDependency(PSERVICEPROPSHEET dlgInfo, + HWND hTreeView, + SC_HANDLE hSCManager, + LPTSTR lpServiceName, + HTREEITEM hParent, + HWND hwndDlg) +{ + LPQUERY_SERVICE_CONFIG lpServiceConfig; + SC_HANDLE hService; + HTREEITEM hChild; + DWORD bytesNeeded; + LPTSTR lpStr; + LPTSTR lpNoDepends; + + hService = OpenService(hSCManager, + lpServiceName, + SERVICE_QUERY_CONFIG); + if (hService) + { + + if (!QueryServiceConfig(hService, + NULL, + 0, + &bytesNeeded) && + GetLastError() == ERROR_INSUFFICIENT_BUFFER) + { + lpServiceConfig = HeapAlloc(ProcessHeap, + 0, + bytesNeeded); + if (lpServiceConfig) + { + if (QueryServiceConfig(hService, + lpServiceConfig, + bytesNeeded, + &bytesNeeded)) + { + if (lpServiceConfig) + { + lpStr = lpServiceConfig->lpDependencies; + + if (*lpStr) + { + while (*lpStr) + { + hChild = AddItemToTreeView(hTreeView, + hParent, + lpServiceConfig->lpDisplayName, + lpServiceConfig->dwServiceType); + + AddServiceDependency(dlgInfo, + hTreeView, + hSCManager, + lpStr, + hChild, + hwndDlg); + + while (*lpStr++) + ; + } + } + else + { + if (TreeView_GetCount(hTreeView) == 0) + { + if (AllocAndLoadString(&lpNoDepends, hInstance, IDS_NO_DEPENDS)) + { + lpStr = lpNoDepends; + } + + AddItemToTreeView(hTreeView, + hParent, + lpStr, + 0); + + HeapFree(ProcessHeap, + 0, + lpNoDepends); + + EnableWindow(hTreeView, FALSE); + } + } + } + } + + HeapFree(ProcessHeap, + 0, + lpServiceConfig); + } + } + + CloseServiceHandle(hService); + } + +} + +static VOID +AddServiceDependent(PSERVICEPROPSHEET dlgInfo, + HWND hTreeView, + SC_HANDLE hSCManager, + LPTSTR lpServiceName, + HTREEITEM hParent, + HWND hwndDlg) +{ + LPENUM_SERVICE_STATUS lpServiceStatus; + SC_HANDLE hService; + HTREEITEM hChild; + LPTSTR lpNoDepends; + DWORD count; + INT i; + + hService = OpenService(hSCManager, + lpServiceName, + SERVICE_QUERY_STATUS | SERVICE_ENUMERATE_DEPENDENTS); + if (hService) + { + lpServiceStatus = GetDependentServices(hService, &count); + if (lpServiceStatus) + { + for (i = 0; i < count; i++) + { + hChild = AddItemToTreeView(hTreeView, + hParent, + lpServiceStatus[i].lpDisplayName, + SERVICE_WIN32); + + AddServiceDependent(dlgInfo, + hTreeView, + hSCManager, + lpServiceStatus[i].lpServiceName, + hChild, + hwndDlg); + } + + HeapFree(ProcessHeap, + 0, + lpServiceStatus); + } + else + { + if (TreeView_GetCount(hTreeView) == 0) + { + AllocAndLoadString(&lpNoDepends, hInstance, IDS_NO_DEPENDS); + + AddItemToTreeView(hTreeView, + hParent, + lpNoDepends, + 0); + + HeapFree(ProcessHeap, + 0, + lpNoDepends); + + EnableWindow(hTreeView, FALSE); + } + } + } +} + + +static VOID +InitDependPage(PSERVICEPROPSHEET dlgInfo, + HWND hwndDlg) +{ + HWND hTreeView1, hTreeView2; + SC_HANDLE hSCManager; + + dlgInfo->hDependsImageList = InitImageList(IDI_NODEPENDS, + IDI_DRIVER, + GetSystemMetrics(SM_CXSMICON), + GetSystemMetrics(SM_CXSMICON), + IMAGE_ICON); + + + hTreeView1 = GetDlgItem(hwndDlg, IDC_DEPEND_TREE1); + if (!hTreeView1) + return; + + (void)TreeView_SetImageList(hTreeView1, + dlgInfo->hDependsImageList, + TVSIL_NORMAL); + + hTreeView2 = GetDlgItem(hwndDlg, IDC_DEPEND_TREE2); + if (!hTreeView2) + return; + + (void)TreeView_SetImageList(hTreeView2, + dlgInfo->hDependsImageList, + TVSIL_NORMAL); + + hSCManager = OpenSCManager(NULL, + NULL, + SC_MANAGER_ALL_ACCESS); + if (hSCManager) + { + AddServiceDependency(dlgInfo, + hTreeView1, + hSCManager, + dlgInfo->pService->lpServiceName, + NULL, + hwndDlg); + + AddServiceDependent(dlgInfo, + hTreeView2, + hSCManager, + dlgInfo->pService->lpServiceName, + NULL, + hwndDlg); + + CloseServiceHandle(hSCManager); + } + +} + + + +/* + * Dependancies Property dialog callback. + * Controls messages to the Dependancies dialog + */ +INT_PTR CALLBACK +DependenciesPageProc(HWND hwndDlg, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) +{ + PSERVICEPROPSHEET dlgInfo; + + /* Get the window context */ + dlgInfo = (PSERVICEPROPSHEET)GetWindowLongPtr(hwndDlg, + GWLP_USERDATA); + if (dlgInfo == NULL && uMsg != WM_INITDIALOG) + { + return FALSE; + } + + switch (uMsg) + { + case WM_INITDIALOG: + { + dlgInfo = (PSERVICEPROPSHEET)(((LPPROPSHEETPAGE)lParam)->lParam); + if (dlgInfo != NULL) + { + SetWindowLongPtr(hwndDlg, + GWLP_USERDATA, + (LONG_PTR)dlgInfo); + + InitDependPage(dlgInfo, hwndDlg); + } + } + break; + + case WM_COMMAND: + switch(LOWORD(wParam)) + { + + } + break; + } + + return FALSE; +} Propchange: trunk/reactos/base/applications/mscutils/servman/propsheet_depends.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/base/applications/mscutils/servman/propsheet_general.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
============================================================================== --- trunk/reactos/base/applications/mscutils/servman/propsheet_general.c (added) +++ trunk/reactos/base/applications/mscutils/servman/propsheet_general.c [iso-8859-1] Mon May 4 22:44:54 2009 @@ -1,0 +1,371 @@ +/* + * PROJECT: ReactOS Services + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/applications/mscutils/servman/propsheet_general.c + * PURPOSE: Property dialog box message handler + * COPYRIGHT: Copyright 2006-2009 Ged Murphy <gedmurphy(a)reactos.org> + * + */ + +#include "precomp.h" + + + +static VOID +SetButtonStates(PSERVICEPROPSHEET dlgInfo, + HWND hwndDlg) +{ + HWND hButton; + LPQUERY_SERVICE_CONFIG lpServiceConfig; + DWORD Flags, State; + UINT i; + + Flags = dlgInfo->pService->ServiceStatusProcess.dwControlsAccepted; + State = dlgInfo->pService->ServiceStatusProcess.dwCurrentState; + + for (i = IDC_START; i <= IDC_RESUME; i++) + { + hButton = GetDlgItem(hwndDlg, i); + EnableWindow (hButton, FALSE); + } + + lpServiceConfig = GetServiceConfig(dlgInfo->pService->lpServiceName); + if (State == SERVICE_STOPPED && + lpServiceConfig && lpServiceConfig->dwStartType != SERVICE_DISABLED) + { + hButton = GetDlgItem(hwndDlg, IDC_START); + EnableWindow (hButton, TRUE); + HeapFree(GetProcessHeap(), 0, lpServiceConfig); + } + else if ( (Flags & SERVICE_ACCEPT_STOP) && (State == SERVICE_RUNNING) ) + { + hButton = GetDlgItem(hwndDlg, IDC_STOP); + EnableWindow (hButton, TRUE); + } + else if ( (Flags & SERVICE_ACCEPT_PAUSE_CONTINUE) && (State == SERVICE_RUNNING) ) + { + hButton = GetDlgItem(hwndDlg, IDC_PAUSE); + EnableWindow (hButton, TRUE); + } + + /* set the main toolbar */ + SetMenuAndButtonStates(dlgInfo->Info); +} + + +static VOID +SetServiceStatusText(PSERVICEPROPSHEET dlgInfo, + HWND hwndDlg) +{ + LPTSTR lpStatus; + UINT id; + + if (dlgInfo->pService->ServiceStatusProcess.dwCurrentState == SERVICE_RUNNING) + { + id = IDS_SERVICES_STARTED; + } + else + { + id = IDS_SERVICES_STOPPED; + } + + if (AllocAndLoadString(&lpStatus, + hInstance, + id)) + { + SendDlgItemMessage(hwndDlg, + IDC_SERV_STATUS, + WM_SETTEXT, + 0, + (LPARAM)lpStatus); + LocalFree(lpStatus); + } +} + +/* + * Fills the 'startup type' combo box with possible + * values and sets it to value of the selected item + */ +static VOID +SetStartupType(LPTSTR lpServiceName, + HWND hwndDlg) +{ + HWND hList; + LPQUERY_SERVICE_CONFIG pServiceConfig; + LPTSTR lpBuf; + DWORD StartUp = 0; + UINT i; + + hList = GetDlgItem(hwndDlg, IDC_START_TYPE); + + for (i = IDS_SERVICES_AUTO; i <= IDS_SERVICES_DIS; i++) + { + if (AllocAndLoadString(&lpBuf, + hInstance, + i)) + { + SendMessage(hList, + CB_ADDSTRING, + 0, + (LPARAM)lpBuf); + LocalFree(lpBuf); + } + } + + pServiceConfig = GetServiceConfig(lpServiceName); + + if (pServiceConfig) + { + switch (pServiceConfig->dwStartType) + { + case SERVICE_AUTO_START: StartUp = 0; break; + case SERVICE_DEMAND_START: StartUp = 1; break; + case SERVICE_DISABLED: StartUp = 2; break; + } + + SendMessage(hList, + CB_SETCURSEL, + StartUp, + 0); + + HeapFree(ProcessHeap, + 0, + pServiceConfig); + } +} + + +/* + * Populates the General Properties dialog with + * the relevant service information + */ +static VOID +InitGeneralPage(PSERVICEPROPSHEET dlgInfo, + HWND hwndDlg) +{ + LPQUERY_SERVICE_CONFIG pServiceConfig; + LPTSTR lpDescription; + + /* set the service name */ + SendDlgItemMessage(hwndDlg, + IDC_SERV_NAME, + WM_SETTEXT, + 0, + (LPARAM)dlgInfo->pService->lpServiceName); + + /* set the display name */ + SendDlgItemMessage(hwndDlg, + IDC_DISP_NAME, + WM_SETTEXT, + 0, + (LPARAM)dlgInfo->pService->lpDisplayName); + + /* set the description */ + if ((lpDescription = GetServiceDescription(dlgInfo->pService->lpServiceName))) + { + SendDlgItemMessage(hwndDlg, + IDC_DESCRIPTION, + WM_SETTEXT, + 0, + (LPARAM)lpDescription); + + HeapFree(ProcessHeap, + 0, + lpDescription); + } + + pServiceConfig = GetServiceConfig(dlgInfo->pService->lpServiceName); + if (pServiceConfig) + { + SendDlgItemMessage(hwndDlg, + IDC_EXEPATH, + WM_SETTEXT, + 0, + (LPARAM)pServiceConfig->lpBinaryPathName); + HeapFree(ProcessHeap, + 0, + pServiceConfig); + } + + + /* set startup type */ + SetStartupType(dlgInfo->pService->lpServiceName, hwndDlg); + + SetServiceStatusText(dlgInfo, + hwndDlg); + + if (dlgInfo->Info->bIsUserAnAdmin) + { + HWND hEdit = GetDlgItem(hwndDlg, + IDC_EDIT); + EnableWindow(hEdit, + TRUE); + } +} + + +VOID +SaveDlgInfo(PSERVICEPROPSHEET dlgInfo, + HWND hwndDlg) +{ + LPQUERY_SERVICE_CONFIG pServiceConfig = NULL; + HWND hList; + DWORD StartUp; + + pServiceConfig = HeapAlloc(ProcessHeap, + HEAP_ZERO_MEMORY, + sizeof(*pServiceConfig)); + if (pServiceConfig) + { + pServiceConfig->dwServiceType = SERVICE_NO_CHANGE; + pServiceConfig->dwErrorControl = SERVICE_NO_CHANGE; + + hList = GetDlgItem(hwndDlg, IDC_START_TYPE); + StartUp = SendMessage(hList, + CB_GETCURSEL, + 0, + 0); + switch (StartUp) + { + case 0: pServiceConfig->dwStartType = SERVICE_AUTO_START; break; + case 1: pServiceConfig->dwStartType = SERVICE_DEMAND_START; break; + case 2: pServiceConfig->dwStartType = SERVICE_DISABLED; break; + } + + if (SetServiceConfig(pServiceConfig, + dlgInfo->pService->lpServiceName, + NULL)) + { + ChangeListViewText(dlgInfo->Info, + dlgInfo->pService, + LVSTARTUP); + } + + HeapFree(ProcessHeap, + 0, + pServiceConfig); + } +} + + +/* + * General Property dialog callback. + * Controls messages to the General dialog + */ +INT_PTR CALLBACK +GeneralPageProc(HWND hwndDlg, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) +{ + PSERVICEPROPSHEET dlgInfo; + + /* Get the window context */ + dlgInfo = (PSERVICEPROPSHEET)GetWindowLongPtr(hwndDlg, + GWLP_USERDATA); + if (dlgInfo == NULL && uMsg != WM_INITDIALOG) + { + return FALSE; + } + + switch (uMsg) + { + case WM_INITDIALOG: + { + dlgInfo = (PSERVICEPROPSHEET)(((LPPROPSHEETPAGE)lParam)->lParam); + if (dlgInfo != NULL) + { + SetWindowLongPtr(hwndDlg, + GWLP_USERDATA, + (LONG_PTR)dlgInfo); + InitGeneralPage(dlgInfo, hwndDlg); + SetButtonStates(dlgInfo, hwndDlg); + } + } + break; + + case WM_COMMAND: + switch(LOWORD(wParam)) + { + case IDC_START_TYPE: + if (HIWORD(wParam) == CBN_SELCHANGE) + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + break; + + case IDC_START: + if (DoStart(dlgInfo->Info)) + { + UpdateServiceStatus(dlgInfo->pService); + ChangeListViewText(dlgInfo->Info, dlgInfo->pService, LVSTATUS); + SetButtonStates(dlgInfo, hwndDlg); + SetServiceStatusText(dlgInfo, hwndDlg); + } + break; + + case IDC_STOP: + if (DoStop(dlgInfo->Info)) + { + UpdateServiceStatus(dlgInfo->pService); + ChangeListViewText(dlgInfo->Info, dlgInfo->pService, LVSTATUS); + SetButtonStates(dlgInfo, hwndDlg); + SetServiceStatusText(dlgInfo, hwndDlg); + } + break; + + case IDC_PAUSE: + if (DoPause(dlgInfo->Info)) + { + UpdateServiceStatus(dlgInfo->pService); + ChangeListViewText(dlgInfo->Info, dlgInfo->pService, LVSTATUS); + SetButtonStates(dlgInfo, hwndDlg); + SetServiceStatusText(dlgInfo, hwndDlg); + } + break; + + case IDC_RESUME: + if (DoResume(dlgInfo->Info)) + { + UpdateServiceStatus(dlgInfo->pService); + ChangeListViewText(dlgInfo->Info, dlgInfo->pService, LVSTATUS); + SetButtonStates(dlgInfo, hwndDlg); + SetServiceStatusText(dlgInfo, hwndDlg); + } + break; + + case IDC_EDIT: + { + HWND hName, hDesc, hExePath; + + hName = GetDlgItem(hwndDlg, IDC_DISP_NAME); + hDesc = GetDlgItem(hwndDlg, IDC_DESCRIPTION); + hExePath = GetDlgItem(hwndDlg, IDC_EXEPATH); + + SendMessage(hName, EM_SETREADONLY, FALSE, 0); + SendMessage(hDesc, EM_SETREADONLY, FALSE, 0); + SendMessage(hExePath, EM_SETREADONLY, FALSE, 0); + } + break; + + case IDC_START_PARAM: + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + break; + } + break; + + case WM_NOTIFY: + { + LPNMHDR lpnm = (LPNMHDR)lParam; + + switch (lpnm->code) + { + case PSN_APPLY: + SaveDlgInfo(dlgInfo, hwndDlg); + SetButtonStates(dlgInfo, hwndDlg); + break; + } + } + break; + } + + return FALSE; +} Propchange: trunk/reactos/base/applications/mscutils/servman/propsheet_general.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/base/applications/mscutils/servman/res/driver.ico URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/base/applications/mscutils/servman/res/driver.ico ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/base/applications/mscutils/servman/res/nodepends.ico URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/base/applications/mscutils/servman/res/nodepends.ico ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Modified: trunk/reactos/base/applications/mscutils/servman/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
============================================================================== --- trunk/reactos/base/applications/mscutils/servman/resource.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/servman/resource.h [iso-8859-1] Mon May 4 22:44:54 2009 @@ -61,6 +61,9 @@ #define IDI_SM_ICON 50 #define IDB_BUTTONS 51 +#define IDI_NODEPENDS 52 +#define IDI_SERVICE 53 +#define IDI_DRIVER 54 #define IDB_PROP 10000 #define IDB_REFRESH 10001 @@ -139,6 +142,7 @@ #define IDC_DEPEND_TREE1 20002 #define IDC_DEPEND_TREE2 20003 #define IDC_DEPEND_SERVICE 20004 +#define IDS_NO_DEPENDS 20005 /* create service dialog */ Modified: trunk/reactos/base/applications/mscutils/servman/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
============================================================================== --- trunk/reactos/base/applications/mscutils/servman/rsrc.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/servman/rsrc.rc [iso-8859-1] Mon May 4 22:44:54 2009 @@ -16,6 +16,10 @@ IDB_PAUSE BITMAP DISCARDABLE "res/pause.bmp" IDB_RESTART BITMAP DISCARDABLE "res/restart.bmp" +IDI_NODEPENDS ICON "res/nodepends.ico" +IDI_SERVICE ICON "res/system.ico" +IDI_DRIVER ICON "res/driver.ico" + #include "lang/bg-BG.rc" #include "lang/de-DE.rc" #include "lang/el-GR.rc" Modified: trunk/reactos/base/applications/mscutils/servman/servman.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
============================================================================== --- trunk/reactos/base/applications/mscutils/servman/servman.rbuild [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/servman/servman.rbuild [iso-8859-1] Mon May 4 22:44:54 2009 @@ -15,12 +15,15 @@ <file>control.c</file> <file>create.c</file> <file>delete.c</file> + <file>dependencies.c</file> <file>export.c</file> <file>listview.c</file> <file>mainwnd.c</file> <file>misc.c</file> <file>progress.c</file> <file>propsheet.c</file> + <file>propsheet_depends.c</file> + <file>propsheet_general.c</file> <file>query.c</file> <file>servman.c</file> <file>start.c</file> Modified: trunk/reactos/base/applications/mscutils/servman/stop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
============================================================================== --- trunk/reactos/base/applications/mscutils/servman/stop.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/servman/stop.c [iso-8859-1] Mon May 4 22:44:54 2009 @@ -8,13 +8,6 @@ */ #include "precomp.h" - -typedef struct _STOP_INFO -{ - PMAIN_WND_INFO pInfo; - SC_HANDLE hSCManager; - SC_HANDLE hMainService; -} STOP_INFO, *PSTOP_INFO; static BOOL @@ -74,58 +67,6 @@ return bRet; } -static LPENUM_SERVICE_STATUS -GetDependentServices(SC_HANDLE hService, - LPDWORD lpdwCount) -{ - LPENUM_SERVICE_STATUS lpDependencies; - DWORD dwBytesNeeded; - DWORD dwCount; - - if (EnumDependentServices(hService, - SERVICE_ACTIVE, - NULL, - 0, - &dwBytesNeeded, - &dwCount)) - { - /* There are no dependent services */ - return NULL; - } - else - { - if (GetLastError() != ERROR_MORE_DATA) - return NULL; /* Unexpected error */ - - lpDependencies = (LPENUM_SERVICE_STATUS)HeapAlloc(GetProcessHeap(), - 0, - dwBytesNeeded); - if (lpDependencies) - { - if (EnumDependentServices(hService, - SERVICE_ACTIVE, - lpDependencies, - dwBytesNeeded, - &dwBytesNeeded, - &dwCount)) - { - *lpdwCount = dwCount; - } - else - { - HeapFree(ProcessHeap, - 0, - lpDependencies); - - lpDependencies = NULL; - } - } - } - - return lpDependencies; - -} - static BOOL StopDependentServices(PSTOP_INFO pStopInfo, SC_HANDLE hService) @@ -168,171 +109,6 @@ } return bRet; -} - -static BOOL -HasDependentServices(SC_HANDLE hService) -{ - DWORD dwBytesNeeded, dwCount; - BOOL bRet = FALSE; - - if (hService) - { - if (!EnumDependentServices(hService, - SERVICE_ACTIVE, - NULL, - 0, - &dwBytesNeeded, - &dwCount)) - { - if (GetLastError() == ERROR_MORE_DATA) - bRet = TRUE; - } - } - - return bRet; -} - -static BOOL -DoInitDependsDialog(PSTOP_INFO pStopInfo, - HWND hDlg) -{ - LPENUM_SERVICE_STATUS lpDependencies; - DWORD dwCount; - LPTSTR lpPartialStr, lpStr; - DWORD fullLen; - HICON hIcon = NULL; - BOOL bRet = FALSE; - - if (pStopInfo) - { - SetWindowLongPtr(hDlg, - GWLP_USERDATA, - (LONG_PTR)pStopInfo); - - hIcon = (HICON)LoadImage(hInstance, - MAKEINTRESOURCE(IDI_SM_ICON), - IMAGE_ICON, - 16, - 16, - 0); - if (hIcon) - { - SendMessage(hDlg, - WM_SETICON, - ICON_SMALL, - (LPARAM)hIcon); - DestroyIcon(hIcon); - } - - /* Add the label */ - if (AllocAndLoadString(&lpPartialStr, - hInstance, - IDS_STOP_DEPENDS)) - { - fullLen = _tcslen(lpPartialStr) + _tcslen(pStopInfo->pInfo->pCurrentService->lpDisplayName) + 1; - - lpStr = HeapAlloc(ProcessHeap, - 0, - fullLen * sizeof(TCHAR)); - if (lpStr) - { - _sntprintf(lpStr, fullLen, lpPartialStr, pStopInfo->pInfo->pCurrentService->lpDisplayName); - - SendDlgItemMessage(hDlg, - IDC_STOP_DEPENDS, - WM_SETTEXT, - 0, - (LPARAM)lpStr); - - bRet = TRUE; - - HeapFree(ProcessHeap, - 0, - lpStr); - } - - HeapFree(ProcessHeap, - 0, - lpPartialStr); - } - - /* Get the list of dependencies */ - lpDependencies = GetDependentServices(pStopInfo->hMainService, &dwCount); - if (lpDependencies) - { - LPENUM_SERVICE_STATUS lpEnumServiceStatus; - DWORD i; - - for (i = 0; i < dwCount; i++) - { - lpEnumServiceStatus = &lpDependencies[i]; - - /* Add the service to the listbox */ - SendDlgItemMessage(hDlg, - IDC_STOP_DEPENDS_LB, - LB_ADDSTRING, - 0, - (LPARAM)lpEnumServiceStatus->lpDisplayName); - } - - HeapFree(ProcessHeap, - 0, - lpDependencies); - } - } - - return bRet; -} - - -INT_PTR CALLBACK -StopDependsDialogProc(HWND hDlg, - UINT message, - WPARAM wParam, - LPARAM lParam) -{ - PSTOP_INFO pStopInfo = NULL; - - /* Get the window context */ - pStopInfo = (PSTOP_INFO)GetWindowLongPtr(hDlg, - GWLP_USERDATA); - if (pStopInfo == NULL && message != WM_INITDIALOG) - { - return FALSE; - } - - switch (message) - { - case WM_INITDIALOG: - { - BOOL bRet = FALSE; - - pStopInfo = (PSTOP_INFO)lParam; - if (pStopInfo != NULL) - { - bRet = DoInitDependsDialog(pStopInfo, hDlg); - } - - return bRet; - } - - case WM_COMMAND: - { - switch (LOWORD(wParam)) - { - case IDOK: - case IDCANCEL: - { - EndDialog(hDlg, - LOWORD(wParam)); - return TRUE; - } - } - } - } - - return FALSE; }
15 years, 6 months
1
0
0
0
[weiden] 40788: Unbreak linking ntoskrnl
by weiden@svn.reactos.org
Author: weiden Date: Mon May 4 22:08:21 2009 New Revision: 40788 URL:
http://svn.reactos.org/svn/reactos?rev=40788&view=rev
Log: Unbreak linking ntoskrnl Modified: trunk/reactos/lib/rtl/vectoreh.c Modified: trunk/reactos/lib/rtl/vectoreh.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/vectoreh.c?rev=407…
============================================================================== --- trunk/reactos/lib/rtl/vectoreh.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/vectoreh.c [iso-8859-1] Mon May 4 22:08:21 2009 @@ -61,7 +61,7 @@ if (--veh->Refs == 0) { RemoveEntryList (&veh->ListEntry); - InterlockedDecrement (&RtlpVectoredExceptionsInstalled); + _InterlockedDecrement (&RtlpVectoredExceptionsInstalled); Remove = TRUE; } Ret = TRUE; @@ -74,7 +74,7 @@ { CurrentEntry = veh->ListEntry.Flink; RemoveEntryList (&veh->ListEntry); - InterlockedDecrement (&RtlpVectoredExceptionsInstalled); + _InterlockedDecrement (&RtlpVectoredExceptionsInstalled); RtlLeaveCriticalSection(&RtlpVectoredExceptionLock); RtlFreeHeap(RtlGetProcessHeap(), @@ -136,7 +136,7 @@ InsertTailList(&RtlpVectoredExceptionHead, &veh->ListEntry); } - InterlockedIncrement (&RtlpVectoredExceptionsInstalled); + _InterlockedIncrement (&RtlpVectoredExceptionsInstalled); RtlLeaveCriticalSection(&RtlpVectoredExceptionLock); }
15 years, 6 months
1
0
0
0
[weiden] 40787: Make vectored exceptions thread-safe
by weiden@svn.reactos.org
Author: weiden Date: Mon May 4 22:06:15 2009 New Revision: 40787 URL:
http://svn.reactos.org/svn/reactos?rev=40787&view=rev
Log: Make vectored exceptions thread-safe Modified: trunk/reactos/lib/rtl/vectoreh.c Modified: trunk/reactos/lib/rtl/vectoreh.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/vectoreh.c?rev=407…
============================================================================== --- trunk/reactos/lib/rtl/vectoreh.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/vectoreh.c [iso-8859-1] Mon May 4 22:06:15 2009 @@ -15,11 +15,14 @@ static RTL_CRITICAL_SECTION RtlpVectoredExceptionLock; static LIST_ENTRY RtlpVectoredExceptionHead; +static volatile LONG RtlpVectoredExceptionsInstalled; typedef struct _RTL_VECTORED_EXCEPTION_HANDLER { LIST_ENTRY ListEntry; PVECTORED_EXCEPTION_HANDLER VectoredHandler; + ULONG Refs; + BOOLEAN Deleted; } RTL_VECTORED_EXCEPTION_HANDLER, *PRTL_VECTORED_EXCEPTION_HANDLER; /* FUNCTIONS ***************************************************************/ @@ -30,37 +33,70 @@ IN PCONTEXT Context) { PLIST_ENTRY CurrentEntry; - PRTL_VECTORED_EXCEPTION_HANDLER veh; + PRTL_VECTORED_EXCEPTION_HANDLER veh = NULL; PVECTORED_EXCEPTION_HANDLER VectoredHandler; EXCEPTION_POINTERS ExceptionInfo; + BOOLEAN Remove = FALSE; + BOOLEAN Ret = FALSE; ExceptionInfo.ExceptionRecord = ExceptionRecord; ExceptionInfo.ContextRecord = Context; - if(RtlpVectoredExceptionHead.Flink != &RtlpVectoredExceptionHead) + if(RtlpVectoredExceptionsInstalled) { RtlEnterCriticalSection(&RtlpVectoredExceptionLock); - for(CurrentEntry = RtlpVectoredExceptionHead.Flink; - CurrentEntry != &RtlpVectoredExceptionHead; - CurrentEntry = CurrentEntry->Flink) + CurrentEntry = RtlpVectoredExceptionHead.Flink; + while (CurrentEntry != &RtlpVectoredExceptionHead) { veh = CONTAINING_RECORD(CurrentEntry, RTL_VECTORED_EXCEPTION_HANDLER, ListEntry); + veh->Refs++; + RtlLeaveCriticalSection(&RtlpVectoredExceptionLock); + VectoredHandler = RtlDecodePointer(veh->VectoredHandler); - RtlLeaveCriticalSection(&RtlpVectoredExceptionLock); - if(VectoredHandler(&ExceptionInfo) == EXCEPTION_CONTINUE_EXECUTION) { - return TRUE; + RtlEnterCriticalSection(&RtlpVectoredExceptionLock); + if (--veh->Refs == 0) + { + RemoveEntryList (&veh->ListEntry); + InterlockedDecrement (&RtlpVectoredExceptionsInstalled); + Remove = TRUE; + } + Ret = TRUE; + break; } RtlEnterCriticalSection(&RtlpVectoredExceptionLock); + + if (--veh->Refs == 0) + { + CurrentEntry = veh->ListEntry.Flink; + RemoveEntryList (&veh->ListEntry); + InterlockedDecrement (&RtlpVectoredExceptionsInstalled); + RtlLeaveCriticalSection(&RtlpVectoredExceptionLock); + + RtlFreeHeap(RtlGetProcessHeap(), + 0, + veh); + RtlEnterCriticalSection(&RtlpVectoredExceptionLock); + } + else + CurrentEntry = CurrentEntry->Flink; } + RtlLeaveCriticalSection(&RtlpVectoredExceptionLock); } + + if (Remove) + { + RtlFreeHeap(RtlGetProcessHeap(), + 0, + veh); + } - return FALSE; + return Ret; } VOID @@ -68,6 +104,7 @@ { InitializeListHead(&RtlpVectoredExceptionHead); RtlInitializeCriticalSection(&RtlpVectoredExceptionLock); + RtlpVectoredExceptionsInstalled = 0; } @@ -86,6 +123,8 @@ if(veh != NULL) { veh->VectoredHandler = RtlEncodePointer(VectoredHandler); + veh->Refs = 1; + veh->Deleted = FALSE; RtlEnterCriticalSection(&RtlpVectoredExceptionLock); if(FirstHandler != 0) { @@ -97,6 +136,7 @@ InsertTailList(&RtlpVectoredExceptionHead, &veh->ListEntry); } + InterlockedIncrement (&RtlpVectoredExceptionsInstalled); RtlLeaveCriticalSection(&RtlpVectoredExceptionLock); } @@ -112,7 +152,8 @@ { PLIST_ENTRY CurrentEntry; PRTL_VECTORED_EXCEPTION_HANDLER veh = NULL; - ULONG Removed = FALSE; + BOOLEAN Remove = FALSE; + ULONG Ret = FALSE; RtlEnterCriticalSection(&RtlpVectoredExceptionLock); for(CurrentEntry = RtlpVectoredExceptionHead.Flink; @@ -124,21 +165,29 @@ ListEntry); if(veh == VectoredHandlerHandle) { - RemoveEntryList(&veh->ListEntry); - Removed = TRUE; - break; + if (!veh->Deleted) + { + if (--veh->Refs == 0) + { + RemoveEntryList (&veh->ListEntry); + Remove = TRUE; + } + veh->Deleted = TRUE; + Ret = TRUE; + break; + } } } RtlLeaveCriticalSection(&RtlpVectoredExceptionLock); - if(Removed) + if(Remove) { RtlFreeHeap(RtlGetProcessHeap(), 0, veh); } - return Removed; + return Ret; } /* EOF */
15 years, 6 months
1
0
0
0
← Newer
1
...
44
45
46
47
48
49
50
51
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
Results per page:
10
25
50
100
200