ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
October 2008
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
25 participants
517 discussions
Start a n
N
ew thread
[cgutman] 36740: - Implement ProtocolResetComplete - Store the status that gets passed to the completion routine
by cgutman@svn.reactos.org
Author: cgutman Date: Sun Oct 12 19:55:33 2008 New Revision: 36740 URL:
http://svn.reactos.org/svn/reactos?rev=36740&view=rev
Log: - Implement ProtocolResetComplete - Store the status that gets passed to the completion routine Modified: branches/aicom-network-fixes/drivers/network/tcpip/datalink/lan.c Modified: branches/aicom-network-fixes/drivers/network/tcpip/datalink/lan.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/tcpip/datalink/lan.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/tcpip/datalink/lan.c [iso-8859-1] Sun Oct 12 19:55:33 2008 @@ -201,6 +201,8 @@ TI_DbgPrint(DEBUG_DATALINK, ("Called.\n")); + Adapter->NdisStatus = Status; + KeSetEvent(&Adapter->Event, 0, FALSE); } @@ -235,7 +237,13 @@ * Status = Status of the operation */ { - TI_DbgPrint(MID_TRACE, ("Called.\n")); + PLAN_ADAPTER Adapter = (PLAN_ADAPTER)BindingContext; + + TI_DbgPrint(DEBUG_DATALINK, ("Called.\n")); + + Adapter->NdisStatus = Status; + + KeSetEvent(&Adapter->Event, 0, FALSE); }
16 years, 2 months
1
0
0
0
[cgutman] 36739: - Make sure NBAddNeighbor completed successfully - Return the actual status instead of STATUS_SUCCESS always
by cgutman@svn.reactos.org
Author: cgutman Date: Sun Oct 12 19:52:25 2008 New Revision: 36739 URL:
http://svn.reactos.org/svn/reactos?rev=36739&view=rev
Log: - Make sure NBAddNeighbor completed successfully - Return the actual status instead of STATUS_SUCCESS always Modified: branches/aicom-network-fixes/lib/drivers/ip/network/neighbor.c branches/aicom-network-fixes/lib/drivers/ip/network/transmit.c Modified: branches/aicom-network-fixes/lib/drivers/ip/network/neighbor.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/lib/drivers…
============================================================================== --- branches/aicom-network-fixes/lib/drivers/ip/network/neighbor.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/lib/drivers/ip/network/neighbor.c [iso-8859-1] Sun Oct 12 19:52:25 2008 @@ -412,11 +412,13 @@ TI_DbgPrint(MID_TRACE,("Packet targeted at broadcast addr\n")); NCE = NBAddNeighbor(Interface, Address, NULL, Interface->AddressLength, NUD_CONNECTED); + if (!NCE) return NULL; NCE->EventTimer = 0; NCE->EventCount = 0; } else { NCE = NBAddNeighbor(Interface, Address, NULL, Interface->AddressLength, NUD_INCOMPLETE); + if (!NCE) return NULL; NCE->EventTimer = 1; NCE->EventCount = 0; } Modified: branches/aicom-network-fixes/lib/drivers/ip/network/transmit.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/lib/drivers…
============================================================================== --- branches/aicom-network-fixes/lib/drivers/ip/network/transmit.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/lib/drivers/ip/network/transmit.c [iso-8859-1] Sun Oct 12 19:52:25 2008 @@ -204,9 +204,7 @@ /* Prepare next fragment for transmission and send it */ PrepareNextFragment(IFC); - IPSendFragment(IFC->NdisPacket, NCE, IFC); - - return STATUS_SUCCESS; + return IPSendFragment(IFC->NdisPacket, NCE, IFC); } NTSTATUS IPSendDatagram(PIP_PACKET IPPacket, PNEIGHBOR_CACHE_ENTRY NCE,
16 years, 2 months
1
0
0
0
[cgutman] 36738: - Queue the work item directly from MiniQueueWorkItem - Handle an invalid SelectedMediumIndex separately - Cancel the hang timer before calling MiniportHalt - Handle a BindAdapter failure
by cgutman@svn.reactos.org
Author: cgutman Date: Sun Oct 12 19:41:48 2008 New Revision: 36738 URL:
http://svn.reactos.org/svn/reactos?rev=36738&view=rev
Log: - Queue the work item directly from MiniQueueWorkItem - Handle an invalid SelectedMediumIndex separately - Cancel the hang timer before calling MiniportHalt - Handle a BindAdapter failure Modified: branches/aicom-network-fixes/drivers/network/ndis/ndis/miniport.c branches/aicom-network-fixes/drivers/network/ndis/ndis/protocol.c Modified: branches/aicom-network-fixes/drivers/network/ndis/ndis/miniport.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/ndis/ndis/miniport.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/ndis/ndis/miniport.c [iso-8859-1] Sun Oct 12 19:41:48 2008 @@ -662,37 +662,52 @@ * Status of operation */ { - PNDIS_MINIPORT_WORK_ITEM Item; + PNDIS_MINIPORT_WORK_ITEM MiniportWorkItem; + PNDIS_WORK_ITEM NdisWorkItem; + PWORK_QUEUE_ITEM WorkQueueItem; NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); ASSERT(Adapter); ASSERT(KeGetCurrentIrql() >= DISPATCH_LEVEL); - Item = ExAllocatePool(NonPagedPool, sizeof(NDIS_MINIPORT_WORK_ITEM)); - if (Item == NULL) + MiniportWorkItem = ExAllocatePool(NonPagedPool, sizeof(NDIS_MINIPORT_WORK_ITEM)); + if (!MiniportWorkItem) { NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); return NDIS_STATUS_RESOURCES; } - Item->WorkItemType = WorkItemType; - Item->WorkItemContext = WorkItemContext; + NdisWorkItem = ExAllocatePool(NonPagedPool, sizeof(NDIS_WORK_ITEM)); + if (!NdisWorkItem) + { + ExFreePool(MiniportWorkItem); + return NDIS_STATUS_RESOURCES; + } + + MiniportWorkItem->WorkItemType = WorkItemType; + MiniportWorkItem->WorkItemContext = WorkItemContext; /* safe due to adapter lock held */ - Item->Link.Next = NULL; + MiniportWorkItem->Link.Next = NULL; if (!Adapter->WorkQueueHead) { - Adapter->WorkQueueHead = Item; - Adapter->WorkQueueTail = Item; + Adapter->WorkQueueHead = MiniportWorkItem; + Adapter->WorkQueueTail = MiniportWorkItem; } else { - Adapter->WorkQueueTail->Link.Next = (PSINGLE_LIST_ENTRY)Item; - Adapter->WorkQueueTail = Item; - } - - KeInsertQueueDpc(&Adapter->NdisMiniportBlock.DeferredDpc, NULL, NULL); + Adapter->WorkQueueTail->Link.Next = (PSINGLE_LIST_ENTRY)MiniportWorkItem; + Adapter->WorkQueueTail = MiniportWorkItem; + } + + WorkQueueItem = (PWORK_QUEUE_ITEM)NdisWorkItem->WrapperReserved; + + NdisWorkItem->Context = Adapter; + + ExInitializeWorkItem(WorkQueueItem, MiniportWorker, NdisWorkItem); + + ExQueueWorkItem(WorkQueueItem, CriticalWorkQueue); return NDIS_STATUS_SUCCESS; } @@ -717,30 +732,38 @@ * Status of operation */ { - PNDIS_MINIPORT_WORK_ITEM Item; + PNDIS_MINIPORT_WORK_ITEM MiniportWorkItem; + PNDIS_WORK_ITEM NdisWorkItem; + PWORK_QUEUE_ITEM WorkQueueItem; + NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); if (Adapter->MiniportBusy) { NDIS_DbgPrint(MID_TRACE, ("Waiting for miniport to become free.\n")); - KeInsertQueueDpc(&Adapter->NdisMiniportBlock.DeferredDpc, NULL, NULL); + NdisWorkItem = ExAllocatePool(NonPagedPool, sizeof(NDIS_WORK_ITEM)); + if (!NdisWorkItem) return NDIS_STATUS_RESOURCES; + WorkQueueItem = (PWORK_QUEUE_ITEM)NdisWorkItem->WrapperReserved; + NdisWorkItem->Context = Adapter; + ExInitializeWorkItem(WorkQueueItem, MiniportWorker, NdisWorkItem); + ExQueueWorkItem(WorkQueueItem, CriticalWorkQueue); return NDIS_STATUS_FAILURE; } - Item = Adapter->WorkQueueHead; - - if (Item) + MiniportWorkItem = Adapter->WorkQueueHead; + + if (MiniportWorkItem) { /* safe due to adapter lock held */ - Adapter->WorkQueueHead = (PNDIS_MINIPORT_WORK_ITEM)Item->Link.Next; - - if (Item == Adapter->WorkQueueTail) + Adapter->WorkQueueHead = (PNDIS_MINIPORT_WORK_ITEM)MiniportWorkItem->Link.Next; + + if (MiniportWorkItem == Adapter->WorkQueueTail) Adapter->WorkQueueTail = NULL; - *WorkItemType = Item->WorkItemType; - *WorkItemContext = Item->WorkItemContext; - - ExFreePool(Item); + *WorkItemType = MiniportWorkItem->WorkItemType; + *WorkItemContext = MiniportWorkItem->WorkItemContext; + + ExFreePool(MiniportWorkItem); Adapter->MiniportBusy = TRUE; @@ -999,38 +1022,6 @@ -VOID NTAPI MiniportDpc( - IN PKDPC Dpc, - IN PVOID DeferredContext, - IN PVOID SystemArgument1, - IN PVOID SystemArgument2) -/* - * FUNCTION: Deferred routine to handle serialization - * ARGUMENTS: - * Dpc = Pointer to DPC object - * DeferredContext = Pointer to context information (LOGICAL_ADAPTER) - * SystemArgument1 = Unused - * SystemArgument2 = Unused - */ -{ - PNDIS_WORK_ITEM NdisWorkItem; - PWORK_QUEUE_ITEM WorkItem; - - NDIS_DbgPrint(DEBUG_MINIPORT, ("Called.\n")); - - NdisWorkItem = ExAllocatePool(NonPagedPool, sizeof(NDIS_WORK_ITEM)); - if (!NdisWorkItem) return; - - WorkItem = (PWORK_QUEUE_ITEM)NdisWorkItem->WrapperReserved; - - NdisWorkItem->Context = DeferredContext; - - ExInitializeWorkItem(WorkItem, MiniportWorker, NdisWorkItem); - - ExQueueWorkItem(WorkItem, CriticalWorkQueue); -} - - VOID NTAPI MiniStatus( @@ -1665,13 +1656,18 @@ ZwClose(WrapperContext.RegistryHandle); - if (NdisStatus != NDIS_STATUS_SUCCESS || - SelectedMediumIndex >= MEDIA_ARRAY_SIZE) + if (NdisStatus != NDIS_STATUS_SUCCESS) { NDIS_DbgPrint(MIN_TRACE, ("MiniportInitialize() failed for an adapter.\n")); ExInterlockedRemoveEntryList( &Adapter->ListEntry, &AdapterListLock ); - if (NdisStatus == NDIS_STATUS_SUCCESS) NdisStatus = NDIS_STATUS_FAILURE; return NdisStatus; + } + + if (SelectedMediumIndex >= MEDIA_ARRAY_SIZE) + { + NDIS_DbgPrint(MIN_TRACE, ("MiniportInitialize() failed for an adapter\n")); + ExInterlockedRemoveEntryList( &Adapter->ListEntry, &AdapterListLock ); + return NDIS_STATUS_UNSUPPORTED_MEDIA; } Adapter->NdisMiniportBlock.MediaType = MediaArray[SelectedMediumIndex]; @@ -1762,6 +1758,8 @@ RemoveEntryList(&Adapter->ListEntry); KeReleaseSpinLock(&AdapterListLock, OldIrql); + KeCancelTimer(&Adapter->NdisMiniportBlock.WakeUpDpcTimer.Timer); + (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.HaltHandler)(Adapter); if (Adapter->LookaheadBuffer) @@ -1782,8 +1780,6 @@ Adapter->NdisMiniportBlock.OldPnPDeviceState = Adapter->NdisMiniportBlock.PnPDeviceState; Adapter->NdisMiniportBlock.PnPDeviceState = NdisPnPDeviceStopped; - - KeCancelTimer(&Adapter->NdisMiniportBlock.WakeUpDpcTimer.Timer); return STATUS_SUCCESS; } @@ -1995,7 +1991,6 @@ KeInitializeTimer(&Adapter->NdisMiniportBlock.WakeUpDpcTimer.Timer); KeInitializeDpc(&Adapter->NdisMiniportBlock.WakeUpDpcTimer.Dpc, MiniportHangDpc, Adapter); - KeInitializeDpc(&Adapter->NdisMiniportBlock.DeferredDpc, MiniportDpc, Adapter); DeviceObject->Flags &= ~DO_DEVICE_INITIALIZING; Modified: branches/aicom-network-fixes/drivers/network/ndis/ndis/protocol.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/ndis/ndis/protocol.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/ndis/ndis/protocol.c [iso-8859-1] Sun Oct 12 19:41:48 2008 @@ -798,13 +798,13 @@ /* Put protocol binding struct on global list */ ExInterlockedInsertTailList(&ProtocolListHead, &Protocol->ListEntry, &ProtocolListLock); } - - /* else if(*Status != NDIS_STATUS_PENDING) { - // what to do here? + ExFreePool(Protocol); + ExFreePool(KeyInformation); + *NdisProtocolHandle = NULL; + return; } - */ } ExFreePool(KeyInformation);
16 years, 2 months
1
0
0
0
[gschneider] 36737: RosDbg Part 3/3: - Named pipe implementation based on .net namespace IO.Pipes with support of threads - Previous win32 test version would strip random characters from debug messages and crash on entering kdbg (related to .net ReadFile approach) - Works with QEMU (Client mode), VirtualBox (Client and Server), VMware Server (Client and Server) - Usually faster than pure serial connection mode Known bugs: - Input to kdbg using /KDSERIAL is not displayed until enter pressed (but
by gschneider@svn.reactos.org
Author: gschneider Date: Sun Oct 12 16:55:50 2008 New Revision: 36737 URL:
http://svn.reactos.org/svn/reactos?rev=36737&view=rev
Log: RosDbg Part 3/3: - Named pipe implementation based on .net namespace IO.Pipes with support of threads - Previous win32 test version would strip random characters from debug messages and crash on entering kdbg (related to .net ReadFile approach) - Works with QEMU (Client mode), VirtualBox (Client and Server), VMware Server (Client and Server) - Usually faster than pure serial connection mode Known bugs: - Input to kdbg using /KDSERIAL is not displayed until enter pressed (but input works) - Reconnect issues, depending on virtual machine behaviour Modified: trunk/tools/reactosdbg/Pipe/namedpipe.cs trunk/tools/reactosdbg/Pipe/serialpipe.cs Modified: trunk/tools/reactosdbg/Pipe/namedpipe.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/Pipe/namedpipe.cs…
============================================================================== --- trunk/tools/reactosdbg/Pipe/namedpipe.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/Pipe/namedpipe.cs [iso-8859-1] Sun Oct 12 16:55:50 2008 @@ -1,227 +1,205 @@ using System; +using System.Collections.Generic; +using System.ComponentModel; using System.IO; -using System.ComponentModel; +using System.IO.Pipes; using System.Runtime.InteropServices; - +using System.Text; +using System.Threading; namespace AbstractPipe { - class Kernel32 + public enum ConnectionMode { - [DllImport("kernel32.dll", SetLastError = true)] - public static extern IntPtr CreateNamedPipe( - String lpName, - OpenMode dwOpenMode, - uint dwPipeMode, - uint nMaxInstances, - uint nOutBufferSize, - uint nInBufferSize, - DefaultTimeout nDefaultTimeOut, - IntPtr pipeSecurityDescriptor - ); - - [DllImport("kernel32.dll", SetLastError = true)] - public static extern bool ConnectNamedPipe( - IntPtr hHandle, - IntPtr lpOverlapped - ); - - [DllImport("kernel32.dll", SetLastError = true)] - public static extern bool ReadFile( - IntPtr hHandle, - byte[] lpBuffer, - uint nNumberOfBytesToRead, - ref uint lpNumberOfBytesRead, - IntPtr lpOverlapped - ); - - [DllImport("kernel32.dll", SetLastError = true)] - public static extern bool WriteFile( - IntPtr hHandle, - byte[] lpBuffer, - uint nNumberOfBytesToWrite, - ref uint lpNumberOfBytesWritten, - IntPtr lpOverlapped - ); - - [DllImport("kernel32.dll", SetLastError = true)] - public static extern bool CloseHandle( - IntPtr hHandle); - - [DllImport("kernel32.dll", SetLastError = true)] - public static extern uint GetLastError(); - - [DllImport("kernel32.dll", SetLastError = true)] - public static extern bool DisconnectNamedPipe( - IntPtr hHandle); - - [DllImport("kernel32.dll", SetLastError = true)] - public static extern bool FlushFileBuffers(IntPtr handle); + MODE_CLIENT = 0x00000000, + MODE_SERVER = 0x00000001, + MODE_AUTO = 0x00000002 } - [StructLayout(LayoutKind.Sequential)] - public class Overlapped + public class NamedPipe : Pipe { - } - - public enum OpenMode : uint - { - PIPE_ACCESS_INBOUND = 0x00000001, - PIPE_ACCESS_OUTBOUND = 0x00000002, - PIPE_ACCESS_DUPLEX = 0x00000003, - FILE_FLAG_FIRST_PIPE_INSTANCE = 0x00080000, - FILE_FLAG_OVERLAPPED = 0x40000000, - FILE_FLAG_WRITE_THROUGH = 0x80000000 - } - - public enum DefaultTimeout : uint - { - NMPWAIT_USE_DEFAULT_WAIT = 0x00000000, - NMPWAIT_NOWAIT = 0x00000001, - NMPWAIT_WAIT_FOREVER = 0xffffffff - } - - [StructLayout(LayoutKind.Sequential)] - public struct SECURITY_ATTRIBUTES - { - public int nLength; - public IntPtr lpSecurityDescriptor; - public int bInheritHandle; - } - - public class NamedPipe// : Pipe - { - private const Int32 INVALID_HANDLE_VALUE = -1; - private const ulong ERROR_PIPE_CONNECTED = 535; - - private IntPtr handle; - //FileAccess mode; + public const int PIPE_SIZE = 1024; + + private PipeStream ioStream; /* stream for io operations */ + private String wCommand; /* buffer of a single command line */ + private List<String> cmdList; /*list of commands pending to be written */ + + public event PipeReceiveEventHandler PipeReceiveEvent; + public event PipeErrorEventHandler PipeErrorEvent; + + private static ManualResetEvent newWriteData = new ManualResetEvent(false); public NamedPipe() { - handle = IntPtr.Zero; - } - - public IntPtr Create(string name) - { - handle = Kernel32.CreateNamedPipe(name, - OpenMode.PIPE_ACCESS_DUPLEX | OpenMode.FILE_FLAG_OVERLAPPED, - 0, - 1, - 100, - 100, - DefaultTimeout.NMPWAIT_WAIT_FOREVER, - IntPtr.Zero); - if (handle.ToInt32() == INVALID_HANDLE_VALUE) - { - throw new Win32Exception("Error creating named pipe " + name + " . Internal error: " + Marshal.GetLastWin32Error().ToString()); - } - - return handle; - } - - public void Disconnect() - { - Kernel32.DisconnectNamedPipe(handle); + cmdList = new List<string>(); + } + + public bool CreateServerPipe(string name) + { + /* create a pipe and wait for a client */ + NamedPipeServerStream sStream = new NamedPipeServerStream(name, PipeDirection.InOut, 1, + PipeTransmissionMode.Byte, PipeOptions.Asynchronous, PIPE_SIZE, PIPE_SIZE); + sStream.WaitForConnection(); + + if (sStream.IsConnected) + { + ioStream = sStream; + return true; + } + else + { + return false; + } + } + + public bool CreateClientPipe(string name) + { + /* try to connect as a client */ + /* (QEMU -serial pipe or VMware in pipe server mode) */ + try + { + NamedPipeClientStream cStream = new NamedPipeClientStream(".", name, PipeDirection.InOut, PipeOptions.Asynchronous); + cStream.Connect(100); + + if (cStream.IsConnected) + { + ioStream = cStream; + return true; + } + else + { + return false; + } + } + catch (Exception) + { + return false; + } + } + + public bool CreatePipe(string name, ConnectionMode mode) + { + if (name == "" || name == null) + { + return false; + } + switch (mode) + { + case ConnectionMode.MODE_AUTO: + //check if pipe exists, if not create server pipe, wait certain time, check if pipe... + //TODO: server-client lookup should time out + while (true) + { + if (CreateClientPipe(name)) + { + break; + } + if (CreateServerPipe(name)) + { + break; + } + } + return true; + + case ConnectionMode.MODE_CLIENT: + while (!CreateClientPipe(name)) ; + + /* pipe open, everything fine */ + return true; + + case ConnectionMode.MODE_SERVER: + if (CreateServerPipe(name)) + { + /* wait for a client*/ + + return true; + } + break; + } + return false; } public void Close() { - Kernel32.CloseHandle(handle); - handle = IntPtr.Zero; - } - - public void Flush() - { - if (handle == IntPtr.Zero) - throw new ObjectDisposedException("NamedPipeStream", "The stream has already been closed"); - Kernel32.FlushFileBuffers(handle); - } - - public bool Listen() - { - Disconnect(); - if (Kernel32.ConnectNamedPipe(handle, IntPtr.Zero) != true) - { - uint lastErr = (uint)Marshal.GetLastWin32Error(); - if (lastErr == ERROR_PIPE_CONNECTED) - return true; - return false; + if (ioStream != null) + ioStream.Close(); + } + + public void WriteLoop() + { + try + { + while (true) + { + if (cmdList.Count > 0) + { + byte[] wBuf = new byte[cmdList[0].Length]; + UTF8Encoding.UTF8.GetBytes(cmdList[0], 0, cmdList[0].Length, wBuf, 0); + + ioStream.Write(wBuf, 0, cmdList[0].Length); + + /* remove written data from commandlist */ + cmdList.RemoveAt(0); + } + else if (cmdList.Count == 0) + { + /* wait until new data is signaled */ + newWriteData.Reset(); + newWriteData.WaitOne(); + } + } + } + catch (Exception e) + { + if (PipeErrorEvent != null) + PipeErrorEvent.Invoke(this, new PipeErrorEventArgs(e.Message)); + } + + } + + public void ReadLoop() + { + byte[] buf = new byte[PIPE_SIZE]; + int read = 0; + + try + { + while(true) + { + read = ioStream.Read(buf, 0, PIPE_SIZE); + if (read > 0) + { + if (PipeReceiveEvent != null) + PipeReceiveEvent.Invoke(this, new PipeReceiveEventArgs(UTF8Encoding.UTF8.GetString(buf, 0, read))); + } + else + { + /* connecion closed */ + break; + } + } + } + catch (Exception e) + { + if (PipeErrorEvent != null) + PipeErrorEvent.Invoke(this, new PipeErrorEventArgs(e.Message)); + } + } + + public bool Write(string str) + { + /* only forward a complete line */ + wCommand += str; + + if (str[str.Length-1] == '\r') + { + cmdList.Add(wCommand); + wCommand = null; + + /* wake up the write thread */ + newWriteData.Set(); } return true; - } - - public int Read(byte[] buffer, int offset, int count) - { - if (buffer == null) - throw new ArgumentNullException("buffer", "The buffer to read into cannot be null"); - if (buffer.Length < (offset + count)) - throw new ArgumentException("Buffer is not large enough to hold requested data", "buffer"); - if (offset < 0) - throw new ArgumentOutOfRangeException("offset", offset, "Offset cannot be negative"); - if (count < 0) - throw new ArgumentOutOfRangeException("count", count, "Count cannot be negative"); - if (handle == IntPtr.Zero) - throw new ObjectDisposedException("NamedPipeStream", "The stream has already been closed"); - - // first read the data into an internal buffer since ReadFile cannot read into a buf at - // a specified offset - uint read = 0; - - byte[] buf = buffer; - if (offset != 0) - { - buf = new byte[count]; - } - bool f = Kernel32.ReadFile(handle, buf, (uint)count, ref read, IntPtr.Zero); - if (!f) - { - throw new Win32Exception(Marshal.GetLastWin32Error(), "ReadFile failed"); - } - if (offset != 0) - { - for (int x = 0; x < read; x++) - { - buffer[offset + x] = buf[x]; - } - - } - return (int)read; - } - - public void Write(byte[] buffer, int offset, int count) - { - if (buffer == null) - throw new ArgumentNullException("buffer", "The buffer to write into cannot be null"); - if (buffer.Length < (offset + count)) - throw new ArgumentException("Buffer does not contain amount of requested data", "buffer"); - if (offset < 0) - throw new ArgumentOutOfRangeException("offset", offset, "Offset cannot be negative"); - if (count < 0) - throw new ArgumentOutOfRangeException("count", count, "Count cannot be negative"); - if (handle == IntPtr.Zero) - throw new ObjectDisposedException("NamedPipeStream", "The stream has already been closed"); - - // copy data to internal buffer to allow writing from a specified offset - if (offset != 0) - { - byte[] buf = new Byte[count]; - for (int x = 0; x < count; x++) - { - buf[x] = buffer[offset + x]; - } - buffer = buf; - } - uint written = 0; - bool result = Kernel32.WriteFile(handle, buffer, (uint)count, ref written, IntPtr.Zero); - - if (!result) - { - int err = (int)Marshal.GetLastWin32Error(); - throw new Win32Exception(err, "Writing to the stream failed"); - } - if (written < count) - throw new IOException("Unable to write entire buffer to stream"); } } } Modified: trunk/tools/reactosdbg/Pipe/serialpipe.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/Pipe/serialpipe.c…
============================================================================== --- trunk/tools/reactosdbg/Pipe/serialpipe.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/Pipe/serialpipe.cs [iso-8859-1] Sun Oct 12 16:55:50 2008 @@ -80,7 +80,7 @@ public void SerialPortErrorReceived(object sender, SerialErrorReceivedEventArgs args) { - mSerialPort.Close(); + /* port will be closed by debug connection */ if (PipeErrorEvent != null) PipeErrorEvent.Invoke(this, new PipeErrorEventArgs(args.EventType.ToString())); }
16 years, 2 months
1
0
0
0
[gschneider] 36736: RosDbg Part 2/3: - Visual improvements for rawtraffic/modules - Shortcuts for menu, menu separators and item reordering - Visual and functional additions to PipeTargetSelect dialog - Misc cleanup
by gschneider@svn.reactos.org
Author: gschneider Date: Sun Oct 12 16:43:31 2008 New Revision: 36736 URL:
http://svn.reactos.org/svn/reactos?rev=36736&view=rev
Log: RosDbg Part 2/3: - Visual improvements for rawtraffic/modules - Shortcuts for menu, menu separators and item reordering - Visual and functional additions to PipeTargetSelect dialog - Misc cleanup Modified: trunk/tools/reactosdbg/RosDBG/BackTrace.cs trunk/tools/reactosdbg/RosDBG/MainWindow.Designer.cs trunk/tools/reactosdbg/RosDBG/MainWindow.cs trunk/tools/reactosdbg/RosDBG/Modules.Designer.cs trunk/tools/reactosdbg/RosDBG/PipeTargetSelect.Designer.cs trunk/tools/reactosdbg/RosDBG/PipeTargetSelect.cs trunk/tools/reactosdbg/RosDBG/RawTraffic.cs trunk/tools/reactosdbg/RosDBG/Settings.cs Modified: trunk/tools/reactosdbg/RosDBG/BackTrace.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/BackTrace.…
============================================================================== --- trunk/tools/reactosdbg/RosDBG/BackTrace.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/RosDBG/BackTrace.cs [iso-8859-1] Sun Oct 12 16:43:31 2008 @@ -136,7 +136,7 @@ private void StackFrames_SelectedIndexChanged(object sender, EventArgs e) { - if (StackFrames.SelectedItem != null) //crashed with argumentnullexception + if (StackFrames.SelectedItem != null) { string[] parsedEntry = ((string)StackFrames.SelectedItem).Split(new char[] { ' ' }); mSelectedAddr = ulong.Parse(parsedEntry[0], NumberStyles.HexNumber); Modified: trunk/tools/reactosdbg/RosDBG/MainWindow.Designer.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/MainWindow…
============================================================================== --- trunk/tools/reactosdbg/RosDBG/MainWindow.Designer.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/RosDBG/MainWindow.Designer.cs [iso-8859-1] Sun Oct 12 16:43:31 2008 @@ -37,7 +37,7 @@ this.connectSerialToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.connectPipeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.connectTCPIPToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); + this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); this.symbolDirectoryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -46,10 +46,12 @@ this.pasteToInteractionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.memoryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.debugToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.bugcheckToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.continueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.bugcheckToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.stepToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.nextToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); this.breakToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.stepToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.breakHereToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.breakpointClipboardToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.followListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -119,69 +121,75 @@ this.connectSerialToolStripMenuItem, this.connectPipeToolStripMenuItem, this.connectTCPIPToolStripMenuItem, - this.toolStripMenuItem1, + this.toolStripSeparator3, this.symbolDirectoryToolStripMenuItem, this.toolStripSeparator1, this.exitToolStripMenuItem}); this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); - this.fileToolStripMenuItem.Text = "File"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(35, 20); + this.fileToolStripMenuItem.Text = "&File"; // // openSourceFileToolStripMenuItem // this.openSourceFileToolStripMenuItem.Name = "openSourceFileToolStripMenuItem"; - this.openSourceFileToolStripMenuItem.Size = new System.Drawing.Size(175, 22); - this.openSourceFileToolStripMenuItem.Text = "Open Source File ..."; + this.openSourceFileToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); + this.openSourceFileToolStripMenuItem.Size = new System.Drawing.Size(213, 22); + this.openSourceFileToolStripMenuItem.Text = "&Open Source File ..."; this.openSourceFileToolStripMenuItem.Click += new System.EventHandler(this.openSourceFileToolStripMenuItem_Click); // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(172, 6); + this.toolStripSeparator2.Size = new System.Drawing.Size(210, 6); // // connectSerialToolStripMenuItem // this.connectSerialToolStripMenuItem.Name = "connectSerialToolStripMenuItem"; - this.connectSerialToolStripMenuItem.Size = new System.Drawing.Size(175, 22); - this.connectSerialToolStripMenuItem.Text = "Connect Serial ..."; + this.connectSerialToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.L))); + this.connectSerialToolStripMenuItem.Size = new System.Drawing.Size(213, 22); + this.connectSerialToolStripMenuItem.Text = "Connect Seria&l ..."; this.connectSerialToolStripMenuItem.Click += new System.EventHandler(this.connectSerialToolStripMenuItem_Click); // // connectPipeToolStripMenuItem // this.connectPipeToolStripMenuItem.Name = "connectPipeToolStripMenuItem"; - this.connectPipeToolStripMenuItem.Size = new System.Drawing.Size(175, 22); - this.connectPipeToolStripMenuItem.Text = "Connect Pipe ..."; + this.connectPipeToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P))); + this.connectPipeToolStripMenuItem.Size = new System.Drawing.Size(213, 22); + this.connectPipeToolStripMenuItem.Text = "Connect &Pipe ..."; this.connectPipeToolStripMenuItem.Click += new System.EventHandler(this.connectPipeToolStripMenuItem_Click); // // connectTCPIPToolStripMenuItem // this.connectTCPIPToolStripMenuItem.Name = "connectTCPIPToolStripMenuItem"; - this.connectTCPIPToolStripMenuItem.Size = new System.Drawing.Size(175, 22); - this.connectTCPIPToolStripMenuItem.Text = "Connect TCP/IP ..."; + this.connectTCPIPToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.T))); + this.connectTCPIPToolStripMenuItem.Size = new System.Drawing.Size(213, 22); + this.connectTCPIPToolStripMenuItem.Text = "Connect &TCP/IP ..."; this.connectTCPIPToolStripMenuItem.Click += new System.EventHandler(this.connectTCPIPToolStripMenuItem_Click); // - // toolStripMenuItem1 - // - this.toolStripMenuItem1.Name = "toolStripMenuItem1"; - this.toolStripMenuItem1.Size = new System.Drawing.Size(172, 6); + // toolStripSeparator3 + // + this.toolStripSeparator3.Name = "toolStripSeparator3"; + this.toolStripSeparator3.Size = new System.Drawing.Size(210, 6); // // symbolDirectoryToolStripMenuItem // this.symbolDirectoryToolStripMenuItem.Name = "symbolDirectoryToolStripMenuItem"; - this.symbolDirectoryToolStripMenuItem.Size = new System.Drawing.Size(175, 22); - this.symbolDirectoryToolStripMenuItem.Text = "Settings ..."; + this.symbolDirectoryToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); + this.symbolDirectoryToolStripMenuItem.Size = new System.Drawing.Size(213, 22); + this.symbolDirectoryToolStripMenuItem.Text = "&Settings ..."; this.symbolDirectoryToolStripMenuItem.Click += new System.EventHandler(this.symbolDirectoryToolStripMenuItem_Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(172, 6); + this.toolStripSeparator1.Size = new System.Drawing.Size(210, 6); // // exitToolStripMenuItem // this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.Size = new System.Drawing.Size(175, 22); - this.exitToolStripMenuItem.Text = "Exit"; + this.exitToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.X))); + this.exitToolStripMenuItem.Size = new System.Drawing.Size(213, 22); + this.exitToolStripMenuItem.Text = "E&xit"; this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); // // editToolStripMenuItem @@ -191,93 +199,111 @@ this.pasteToInteractionToolStripMenuItem, this.memoryToolStripMenuItem}); this.editToolStripMenuItem.Name = "editToolStripMenuItem"; - this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20); - this.editToolStripMenuItem.Text = "Edit"; + this.editToolStripMenuItem.Size = new System.Drawing.Size(37, 20); + this.editToolStripMenuItem.Text = "&Edit"; // // copyToolStripMenuItem // - this.copyToolStripMenuItem.Enabled = false; this.copyToolStripMenuItem.Name = "copyToolStripMenuItem"; - this.copyToolStripMenuItem.Size = new System.Drawing.Size(187, 22); - this.copyToolStripMenuItem.Text = "Copy"; + this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C))); + this.copyToolStripMenuItem.Size = new System.Drawing.Size(173, 22); + this.copyToolStripMenuItem.Text = "&Copy"; this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click); // // pasteToInteractionToolStripMenuItem // this.pasteToInteractionToolStripMenuItem.Enabled = false; this.pasteToInteractionToolStripMenuItem.Name = "pasteToInteractionToolStripMenuItem"; - this.pasteToInteractionToolStripMenuItem.Size = new System.Drawing.Size(187, 22); - this.pasteToInteractionToolStripMenuItem.Text = "Paste to Interaction"; + this.pasteToInteractionToolStripMenuItem.Size = new System.Drawing.Size(173, 22); + this.pasteToInteractionToolStripMenuItem.Text = "&Paste to Interaction"; // // memoryToolStripMenuItem // this.memoryToolStripMenuItem.Enabled = false; this.memoryToolStripMenuItem.Name = "memoryToolStripMenuItem"; - this.memoryToolStripMenuItem.Size = new System.Drawing.Size(187, 22); - this.memoryToolStripMenuItem.Text = "Memory at Clipboard"; + this.memoryToolStripMenuItem.Size = new System.Drawing.Size(173, 22); + this.memoryToolStripMenuItem.Text = "&Memory at Clipboard"; // // debugToolStripMenuItem // this.debugToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.bugcheckToolStripMenuItem, this.continueToolStripMenuItem, - this.bugcheckToolStripMenuItem, + this.stepToolStripMenuItem, + this.nextToolStripMenuItem, + this.toolStripSeparator4, this.breakToolStripMenuItem, - this.stepToolStripMenuItem, this.breakHereToolStripMenuItem, this.breakpointClipboardToolStripMenuItem, this.followListToolStripMenuItem}); this.debugToolStripMenuItem.Name = "debugToolStripMenuItem"; - this.debugToolStripMenuItem.Size = new System.Drawing.Size(54, 20); - this.debugToolStripMenuItem.Text = "Debug"; - // - // continueToolStripMenuItem - // - this.continueToolStripMenuItem.Name = "continueToolStripMenuItem"; - this.continueToolStripMenuItem.Size = new System.Drawing.Size(186, 22); - this.continueToolStripMenuItem.Text = "Continue"; - this.continueToolStripMenuItem.Click += new System.EventHandler(this.continueToolStripMenuItem_Click); + this.debugToolStripMenuItem.Size = new System.Drawing.Size(50, 20); + this.debugToolStripMenuItem.Text = "&Debug"; // // bugcheckToolStripMenuItem // this.bugcheckToolStripMenuItem.Enabled = false; this.bugcheckToolStripMenuItem.Name = "bugcheckToolStripMenuItem"; - this.bugcheckToolStripMenuItem.Size = new System.Drawing.Size(186, 22); - this.bugcheckToolStripMenuItem.Text = "Bugcheck"; + this.bugcheckToolStripMenuItem.Size = new System.Drawing.Size(173, 22); + this.bugcheckToolStripMenuItem.Text = "&Bugcheck"; + // + // continueToolStripMenuItem + // + this.continueToolStripMenuItem.Name = "continueToolStripMenuItem"; + this.continueToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F5; + this.continueToolStripMenuItem.Size = new System.Drawing.Size(173, 22); + this.continueToolStripMenuItem.Text = "&Continue"; + this.continueToolStripMenuItem.Click += new System.EventHandler(this.continueToolStripMenuItem_Click); + // + // stepToolStripMenuItem + // + this.stepToolStripMenuItem.Name = "stepToolStripMenuItem"; + this.stepToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F11; + this.stepToolStripMenuItem.Size = new System.Drawing.Size(173, 22); + this.stepToolStripMenuItem.Text = "&Step"; + this.stepToolStripMenuItem.Click += new System.EventHandler(this.stepToolStripMenuItem_Click); + // + // nextToolStripMenuItem + // + this.nextToolStripMenuItem.Name = "nextToolStripMenuItem"; + this.nextToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F10; + this.nextToolStripMenuItem.Size = new System.Drawing.Size(173, 22); + this.nextToolStripMenuItem.Text = "&Next"; + this.nextToolStripMenuItem.Click += new System.EventHandler(this.nextToolStripMenuItem_Click); + // + // toolStripSeparator4 + // + this.toolStripSeparator4.Name = "toolStripSeparator4"; + this.toolStripSeparator4.Size = new System.Drawing.Size(170, 6); // // breakToolStripMenuItem // this.breakToolStripMenuItem.Name = "breakToolStripMenuItem"; - this.breakToolStripMenuItem.Size = new System.Drawing.Size(186, 22); - this.breakToolStripMenuItem.Text = "Break"; + this.breakToolStripMenuItem.Size = new System.Drawing.Size(173, 22); + this.breakToolStripMenuItem.Text = "B&reak"; this.breakToolStripMenuItem.Click += new System.EventHandler(this.breakToolStripMenuItem_Click); - // - // stepToolStripMenuItem - // - this.stepToolStripMenuItem.Name = "stepToolStripMenuItem"; - this.stepToolStripMenuItem.Size = new System.Drawing.Size(186, 22); - this.stepToolStripMenuItem.Text = "Step"; - this.stepToolStripMenuItem.Click += new System.EventHandler(this.stepToolStripMenuItem_Click); // // breakHereToolStripMenuItem // this.breakHereToolStripMenuItem.Enabled = false; this.breakHereToolStripMenuItem.Name = "breakHereToolStripMenuItem"; - this.breakHereToolStripMenuItem.Size = new System.Drawing.Size(186, 22); - this.breakHereToolStripMenuItem.Text = "Breakpoint Here"; + this.breakHereToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F9; + this.breakHereToolStripMenuItem.Size = new System.Drawing.Size(173, 22); + this.breakHereToolStripMenuItem.Text = "Breakpoint &Here"; // // breakpointClipboardToolStripMenuItem // this.breakpointClipboardToolStripMenuItem.Enabled = false; this.breakpointClipboardToolStripMenuItem.Name = "breakpointClipboardToolStripMenuItem"; - this.breakpointClipboardToolStripMenuItem.Size = new System.Drawing.Size(186, 22); - this.breakpointClipboardToolStripMenuItem.Text = "Breakpoint Clipboard"; + this.breakpointClipboardToolStripMenuItem.Size = new System.Drawing.Size(173, 22); + this.breakpointClipboardToolStripMenuItem.Text = "Breakpoint Cli&pboard"; // // followListToolStripMenuItem // this.followListToolStripMenuItem.Enabled = false; this.followListToolStripMenuItem.Name = "followListToolStripMenuItem"; - this.followListToolStripMenuItem.Size = new System.Drawing.Size(186, 22); - this.followListToolStripMenuItem.Text = "Follow List"; + this.followListToolStripMenuItem.Size = new System.Drawing.Size(173, 22); + this.followListToolStripMenuItem.Text = "&Follow List"; // // windowToolStripMenuItem // @@ -286,27 +312,27 @@ this.detachCurrentTabToolStripMenuItem, this.closeCurrentTabToolStripMenuItem}); this.windowToolStripMenuItem.Name = "windowToolStripMenuItem"; - this.windowToolStripMenuItem.Size = new System.Drawing.Size(63, 20); - this.windowToolStripMenuItem.Text = "Window"; + this.windowToolStripMenuItem.Size = new System.Drawing.Size(57, 20); + this.windowToolStripMenuItem.Text = "&Window"; // // NewWindowItem // this.NewWindowItem.Name = "NewWindowItem"; - this.NewWindowItem.Size = new System.Drawing.Size(177, 22); - this.NewWindowItem.Text = "New"; + this.NewWindowItem.Size = new System.Drawing.Size(169, 22); + this.NewWindowItem.Text = "&New"; // // detachCurrentTabToolStripMenuItem // this.detachCurrentTabToolStripMenuItem.Name = "detachCurrentTabToolStripMenuItem"; - this.detachCurrentTabToolStripMenuItem.Size = new System.Drawing.Size(177, 22); - this.detachCurrentTabToolStripMenuItem.Text = "Detach Current Tab"; + this.detachCurrentTabToolStripMenuItem.Size = new System.Drawing.Size(169, 22); + this.detachCurrentTabToolStripMenuItem.Text = "&Detach Current Tab"; this.detachCurrentTabToolStripMenuItem.Click += new System.EventHandler(this.detachCurrentTabToolStripMenuItem_Click); // // closeCurrentTabToolStripMenuItem // this.closeCurrentTabToolStripMenuItem.Name = "closeCurrentTabToolStripMenuItem"; - this.closeCurrentTabToolStripMenuItem.Size = new System.Drawing.Size(177, 22); - this.closeCurrentTabToolStripMenuItem.Text = "Close Current Tab"; + this.closeCurrentTabToolStripMenuItem.Size = new System.Drawing.Size(169, 22); + this.closeCurrentTabToolStripMenuItem.Text = "&Close Current Tab"; this.closeCurrentTabToolStripMenuItem.Click += new System.EventHandler(this.closeCurrentTabToolStripMenuItem_Click); // // toolStripMenuItem2 @@ -321,14 +347,15 @@ // helpToolStripMenuItem // this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - this.helpToolStripMenuItem.Size = new System.Drawing.Size(107, 22); + this.helpToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F1; + this.helpToolStripMenuItem.Size = new System.Drawing.Size(114, 22); this.helpToolStripMenuItem.Text = "&Help"; this.helpToolStripMenuItem.Click += new System.EventHandler(this.helpToolStripMenuItem_Click); // // infoToolStripMenuItem // this.infoToolStripMenuItem.Name = "infoToolStripMenuItem"; - this.infoToolStripMenuItem.Size = new System.Drawing.Size(107, 22); + this.infoToolStripMenuItem.Size = new System.Drawing.Size(114, 22); this.infoToolStripMenuItem.Text = "&About"; // // splitContainer2 @@ -381,12 +408,12 @@ this.contextMenuTabStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.closeToolStripMenuItem}); this.contextMenuTabStrip.Name = "contextMenuTabStrip"; - this.contextMenuTabStrip.Size = new System.Drawing.Size(104, 26); + this.contextMenuTabStrip.Size = new System.Drawing.Size(101, 26); // // closeToolStripMenuItem // this.closeToolStripMenuItem.Name = "closeToolStripMenuItem"; - this.closeToolStripMenuItem.Size = new System.Drawing.Size(103, 22); + this.closeToolStripMenuItem.Size = new System.Drawing.Size(100, 22); this.closeToolStripMenuItem.Text = "&Close"; this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click); // @@ -436,7 +463,6 @@ private System.Windows.Forms.ToolStripMenuItem connectPipeToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem connectTCPIPToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem stepToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem breakHereToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem breakpointClipboardToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem followListToolStripMenuItem; @@ -449,12 +475,15 @@ private System.Windows.Forms.ToolStripStatusLabel RunStatus; private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; - private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; private System.Windows.Forms.ContextMenuStrip contextMenuTabStrip; private System.Windows.Forms.ToolStripMenuItem closeToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2; private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem infoToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem stepToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem nextToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; } } Modified: trunk/tools/reactosdbg/RosDBG/MainWindow.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/MainWindow…
============================================================================== --- trunk/tools/reactosdbg/RosDBG/MainWindow.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/RosDBG/MainWindow.cs [iso-8859-1] Sun Oct 12 16:43:31 2008 @@ -8,6 +8,7 @@ using System.Text; using System.Windows.Forms; using System.Reflection; +using AbstractPipe; using DebugProtocol; using KDBGProtocol; using DbgHelpAPI; @@ -244,7 +245,7 @@ if (targetSelect.ShowDialog() == DialogResult.OK) { mConnection.Close(); - mConnection.Start(targetSelect.Host, targetSelect.Port); + mConnection.StartTCP(targetSelect.Host, targetSelect.Port); } } @@ -256,6 +257,11 @@ private void stepToolStripMenuItem_Click(object sender, EventArgs e) { mConnection.Step(); + } + + private void nextToolStripMenuItem_Click(object sender, EventArgs e) + { + mConnection.Next(); } private void continueToolStripMenuItem_Click(object sender, EventArgs e) @@ -276,7 +282,7 @@ if (targetSelect.ShowDialog() == DialogResult.OK) { mConnection.Close(); - mConnection.Start(targetSelect.Baudrate, targetSelect.Port); + mConnection.StartSerial(targetSelect.Port, targetSelect.Baudrate); } } @@ -340,7 +346,7 @@ if (targetSelect.ShowDialog() == DialogResult.OK) { mConnection.Close(); - mConnection.Start(targetSelect.PipeName); + mConnection.StartPipe(targetSelect.PipeName, targetSelect.PipeMode); } } Modified: trunk/tools/reactosdbg/RosDBG/Modules.Designer.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/Modules.De…
============================================================================== --- trunk/tools/reactosdbg/RosDBG/Modules.Designer.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/RosDBG/Modules.Designer.cs [iso-8859-1] Sun Oct 12 16:43:31 2008 @@ -39,6 +39,9 @@ this.MListAddress, this.MListShortName}); this.ModulesList.Dock = System.Windows.Forms.DockStyle.Fill; + this.ModulesList.FullRowSelect = true; + this.ModulesList.GridLines = true; + this.ModulesList.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; this.ModulesList.Location = new System.Drawing.Point(0, 0); this.ModulesList.Name = "ModulesList"; this.ModulesList.Size = new System.Drawing.Size(244, 218); @@ -51,6 +54,7 @@ // MListAddress // this.MListAddress.Text = "Address"; + this.MListAddress.Width = 80; // // MListShortName // Modified: trunk/tools/reactosdbg/RosDBG/PipeTargetSelect.Designer.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/PipeTarget…
============================================================================== --- trunk/tools/reactosdbg/RosDBG/PipeTargetSelect.Designer.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/RosDBG/PipeTargetSelect.Designer.cs [iso-8859-1] Sun Oct 12 16:43:31 2008 @@ -33,17 +33,18 @@ this.PipeNameTextBox = new System.Windows.Forms.TextBox(); this.DefaultRadioBtn = new System.Windows.Forms.RadioButton(); this.CustomRadioBtn = new System.Windows.Forms.RadioButton(); - this.DefaultNameLabel = new System.Windows.Forms.Label(); + this.cType = new System.Windows.Forms.ComboBox(); + this.label1 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // bOK // this.bOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.bOK.DialogResult = System.Windows.Forms.DialogResult.OK; - this.bOK.Location = new System.Drawing.Point(69, 86); + this.bOK.Location = new System.Drawing.Point(69, 121); this.bOK.Name = "bOK"; this.bOK.Size = new System.Drawing.Size(75, 23); - this.bOK.TabIndex = 5; + this.bOK.TabIndex = 6; this.bOK.Text = "OK"; this.bOK.UseVisualStyleBackColor = true; this.bOK.Click += new System.EventHandler(this.bOK_Click); @@ -52,10 +53,10 @@ // this.bCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.bCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.bCancel.Location = new System.Drawing.Point(150, 86); + this.bCancel.Location = new System.Drawing.Point(150, 121); this.bCancel.Name = "bCancel"; this.bCancel.Size = new System.Drawing.Size(75, 23); - this.bCancel.TabIndex = 6; + this.bCancel.TabIndex = 7; this.bCancel.Text = "Cancel"; this.bCancel.UseVisualStyleBackColor = true; this.bCancel.Click += new System.EventHandler(this.bCancel_Click); @@ -63,19 +64,19 @@ // PipeNameTextBox // this.PipeNameTextBox.Enabled = false; - this.PipeNameTextBox.Location = new System.Drawing.Point(15, 60); + this.PipeNameTextBox.Location = new System.Drawing.Point(12, 86); this.PipeNameTextBox.Name = "PipeNameTextBox"; this.PipeNameTextBox.Size = new System.Drawing.Size(213, 20); - this.PipeNameTextBox.TabIndex = 8; + this.PipeNameTextBox.TabIndex = 5; // // DefaultRadioBtn // this.DefaultRadioBtn.AutoSize = true; this.DefaultRadioBtn.Checked = true; - this.DefaultRadioBtn.Location = new System.Drawing.Point(15, 12); + this.DefaultRadioBtn.Location = new System.Drawing.Point(12, 38); this.DefaultRadioBtn.Name = "DefaultRadioBtn"; this.DefaultRadioBtn.Size = new System.Drawing.Size(81, 17); - this.DefaultRadioBtn.TabIndex = 9; + this.DefaultRadioBtn.TabIndex = 3; this.DefaultRadioBtn.TabStop = true; this.DefaultRadioBtn.Text = "Use Default"; this.DefaultRadioBtn.UseVisualStyleBackColor = true; @@ -83,21 +84,33 @@ // CustomRadioBtn // this.CustomRadioBtn.AutoSize = true; - this.CustomRadioBtn.Location = new System.Drawing.Point(15, 37); + this.CustomRadioBtn.Location = new System.Drawing.Point(12, 61); this.CustomRadioBtn.Name = "CustomRadioBtn"; this.CustomRadioBtn.Size = new System.Drawing.Size(91, 17); - this.CustomRadioBtn.TabIndex = 10; + this.CustomRadioBtn.TabIndex = 4; this.CustomRadioBtn.Text = "Custom Name"; this.CustomRadioBtn.UseVisualStyleBackColor = true; this.CustomRadioBtn.CheckedChanged += new System.EventHandler(this.radioButton2_CheckedChanged); // - // DefaultNameLabel + // cType // - this.DefaultNameLabel.AutoSize = true; - this.DefaultNameLabel.Location = new System.Drawing.Point(118, 14); - this.DefaultNameLabel.Name = "DefaultNameLabel"; - this.DefaultNameLabel.Size = new System.Drawing.Size(0, 13); - this.DefaultNameLabel.TabIndex = 11; + this.cType.FormattingEnabled = true; + this.cType.Items.AddRange(new object[] { + "Client", + "Server"}); + this.cType.Location = new System.Drawing.Point(69, 6); + this.cType.Name = "cType"; + this.cType.Size = new System.Drawing.Size(156, 21); + this.cType.TabIndex = 2; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(31, 13); + this.label1.TabIndex = 1; + this.label1.Text = "Type"; // // PipeTargetSelect // @@ -105,8 +118,9 @@ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.bCancel; - this.ClientSize = new System.Drawing.Size(237, 121); - this.Controls.Add(this.DefaultNameLabel); + this.ClientSize = new System.Drawing.Size(237, 156); + this.Controls.Add(this.label1); + this.Controls.Add(this.cType); this.Controls.Add(this.CustomRadioBtn); this.Controls.Add(this.DefaultRadioBtn); this.Controls.Add(this.PipeNameTextBox); @@ -129,6 +143,7 @@ private System.Windows.Forms.TextBox PipeNameTextBox; private System.Windows.Forms.RadioButton DefaultRadioBtn; private System.Windows.Forms.RadioButton CustomRadioBtn; - private System.Windows.Forms.Label DefaultNameLabel; + private System.Windows.Forms.ComboBox cType; + private System.Windows.Forms.Label label1; } } Modified: trunk/tools/reactosdbg/RosDBG/PipeTargetSelect.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/PipeTarget…
============================================================================== --- trunk/tools/reactosdbg/RosDBG/PipeTargetSelect.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/RosDBG/PipeTargetSelect.cs [iso-8859-1] Sun Oct 12 16:43:31 2008 @@ -1,4 +1,5 @@ -using System; +using AbstractPipe; +using System; using System.Windows.Forms; namespace RosDBG @@ -7,10 +8,16 @@ { private string defaultPipeName = Settings.Pipe; private string pipeName; + public ConnectionMode pipeMode; public string PipeName { get { return pipeName; } + } + + public ConnectionMode PipeMode + { + get { return (ConnectionMode)pipeMode; } } public bool UseDefault @@ -34,6 +41,19 @@ pipeName = PipeNameTextBox.Text; } + if (cType.SelectedItem.ToString().CompareTo("Client") == 0) + { + pipeMode = ConnectionMode.MODE_CLIENT; + } + else if (cType.SelectedItem.ToString().CompareTo("Server") == 0) + { + pipeMode = ConnectionMode.MODE_SERVER; + } + else if (cType.SelectedItem.ToString().CompareTo("Automatic") == 0) + { + pipeMode = ConnectionMode.MODE_AUTO; + } + DialogResult = DialogResult.OK; Close(); } @@ -53,7 +73,8 @@ private void PipeTargetSelect_Load(object sender, EventArgs e) { - DefaultNameLabel.Text = "[" + defaultPipeName + "]"; + DefaultRadioBtn.Text += " [" + defaultPipeName + "]"; + cType.SelectedIndex = 0; } } } Modified: trunk/tools/reactosdbg/RosDBG/RawTraffic.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/RawTraffic…
============================================================================== --- trunk/tools/reactosdbg/RosDBG/RawTraffic.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/RosDBG/RawTraffic.cs [iso-8859-1] Sun Oct 12 16:43:31 2008 @@ -37,6 +37,7 @@ foreach (string s in textToAdd) toAdd.Append(s); textToAdd.Clear(); + //TODO: skip backspace signs } RawTrafficText.AppendText(toAdd.ToString()); } @@ -52,7 +53,7 @@ void CopyEvent(object sender, CopyEventArgs args) { - if (args.Obj == this) + if (args.Obj == this && RawTrafficText.SelectedText != null) Clipboard.SetText(RawTrafficText.SelectedText); } Modified: trunk/tools/reactosdbg/RosDBG/Settings.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/Settings.c…
============================================================================== --- trunk/tools/reactosdbg/RosDBG/Settings.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/RosDBG/Settings.cs [iso-8859-1] Sun Oct 12 16:43:31 2008 @@ -56,7 +56,7 @@ } [CategoryAttribute("Connection"), DescriptionAttribute("Connection settings")] - [UserScopedSetting, DefaultSettingValue(@"\\.\Pipe\RosDbg")] + [UserScopedSetting, DefaultSettingValue(@"RosDbg")] public string Pipe { get { return this["Pipe"].ToString(); }
16 years, 2 months
1
0
0
0
[gschneider] 36735: RosDbg Part 1/3: - Add process name and process state to process view - Separate start communication functions - Make kdbg command "next" usable - Misc preparations for named pipe communication
by gschneider@svn.reactos.org
Author: gschneider Date: Sun Oct 12 16:34:05 2008 New Revision: 36735 URL:
http://svn.reactos.org/svn/reactos?rev=36735&view=rev
Log: RosDbg Part 1/3: - Add process name and process state to process view - Separate start communication functions - Make kdbg command "next" usable - Misc preparations for named pipe communication Modified: trunk/tools/reactosdbg/DebugProtocol/DebugConnection.cs trunk/tools/reactosdbg/DebugProtocol/IDebugProtocol.cs trunk/tools/reactosdbg/DebugProtocol/KDBG.cs Modified: trunk/tools/reactosdbg/DebugProtocol/DebugConnection.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/DebugProtocol/Deb…
============================================================================== --- trunk/tools/reactosdbg/DebugProtocol/DebugConnection.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/DebugProtocol/DebugConnection.cs [iso-8859-1] Sun Oct 12 16:34:05 2008 @@ -5,6 +5,7 @@ using
System.Net
; using System.Net.Sockets; using System.IO.Ports; +using System.Threading; using AbstractPipe; using DebugProtocol; using KDBGProtocol; @@ -85,8 +86,12 @@ public bool Current { get { return mCurrent; } set { mCurrent = value; } } ulong mPid; public ulong ProcessId { get { return mPid; } set { mPid = value; } } + string mState; + public string State { get { return mState; } set { mState = value; } } + string mName; + public string Name { get { return mName; } set { mName = value; } } public Dictionary<ulong, ThreadElement> Threads = new Dictionary<ulong,ThreadElement>(); - public ProcessElement(ulong pid, bool current) { mPid = pid; mCurrent = current; } + public ProcessElement(ulong pid, bool current, string state, string name) { mPid = pid; mCurrent = current; mState = state; mName = name; } } public class DebugProcessThreadChangeEventArgs : EventArgs @@ -165,6 +170,8 @@ #region Named Pipe Members NamedPipe mNamedPipe; + Thread ReadThread; + Thread WriteThread; #endregion public event DebugRegisterChangeEventHandler DebugRegisterChangeEvent; @@ -213,7 +220,7 @@ mKdb.ThreadListEvent += ThreadListEvent; } - public void Start(string host, int port) + public void StartTCP(string host, int port) { Close(); mRemotePort = port; @@ -226,16 +233,31 @@ mDnsAsyncResult = Dns.BeginGetHostEntry(host, mDnsLookup, this); } - public void Start(string pipeName) + public void StartPipe(string pipeName, ConnectionMode mode) { Close(); ConnectionMode = Mode.PipeMode; mNamedPipe = new NamedPipe(); - mNamedPipe.Create(pipeName); - mNamedPipe.Listen(); - } - - public void Start(int baudrate, string port) + if (mNamedPipe.CreatePipe(pipeName, mode)) + { + mKdb = new KDBG(mNamedPipe); + mNamedPipe.PipeReceiveEvent += PipeReceiveEvent; + mNamedPipe.PipeErrorEvent += MediumError; + Running = true; + ConnectEventHandlers(); + /* retrieve input seperate thread */ + ReadThread = new Thread(mNamedPipe.ReadLoop); + ReadThread.Start(); + WriteThread = new Thread(mNamedPipe.WriteLoop); + WriteThread.Start(); + } + else + { + ConnectionMode = Mode.ClosedMode; + } + } + + public void StartSerial(string port, int baudrate) { Close(); ConnectionMode = Mode.SerialMode; @@ -248,6 +270,7 @@ //create pipe and kdb instances, connect internal receive pipe mMedium = new SerialPipe(mSerialPort); mMedium.PipeReceiveEvent += PipeReceiveEvent; + mMedium.PipeErrorEvent += MediumError; mKdb = new KDBG(mMedium); ConnectEventHandlers(); Running = true; @@ -270,7 +293,7 @@ mKdb.GetThreads(mNewCurrentProcess); } else - mAccumulateProcesses[args.Pid] = new ProcessElement(args.Pid, args.Current); + mAccumulateProcesses[args.Pid] = new ProcessElement(args.Pid, args.Current, args.State, args.Name); if (args.Current) mNewCurrentProcess = args.Pid; @@ -313,9 +336,14 @@ Running = false; break; case Mode.PipeMode: - mNamedPipe.Close(); - mNamedPipe = null; + if (mNamedPipe != null) + { + mNamedPipe.Close(); + mNamedPipe = null; + } Running = false; + ReadThread.Abort(); + WriteThread.Abort(); break; } @@ -405,6 +433,13 @@ Running = false; } + public void Next() + { + Running = true; + if (mKdb != null) mKdb.Next(); + Running = false; + } + public void Go() { if (mKdb != null) Modified: trunk/tools/reactosdbg/DebugProtocol/IDebugProtocol.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/DebugProtocol/IDe…
============================================================================== --- trunk/tools/reactosdbg/DebugProtocol/IDebugProtocol.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/DebugProtocol/IDebugProtocol.cs [iso-8859-1] Sun Oct 12 16:34:05 2008 @@ -74,9 +74,10 @@ { public readonly bool Reset, Current, End; public readonly ulong Pid; + public readonly string Name, State; public ProcessListEventArgs() { Reset = true; } public ProcessListEventArgs(bool end) { End = true; } - public ProcessListEventArgs(ulong pid, bool current) { Current = current; Pid = pid; } + public ProcessListEventArgs(ulong pid, bool current, string state, string name) { Current = current; Pid = pid; State = state; Name = name; } } public delegate void ProcessListEventHandler(object sender, ProcessListEventArgs args); Modified: trunk/tools/reactosdbg/DebugProtocol/KDBG.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/DebugProtocol/KDB…
============================================================================== --- trunk/tools/reactosdbg/DebugProtocol/KDBG.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/DebugProtocol/KDBG.cs [iso-8859-1] Sun Oct 12 16:34:05 2008 @@ -40,7 +40,7 @@ static Regex mSregLine = new Regex("[CDEFGS]S 0x(?<seg>[0-9a-fA-F]+).*"); static Regex mProcListHeading = new Regex("PID[ \\t]+State[ \\t]+Filename.*"); static Regex mThreadListHeading = new Regex("TID[ \\t]+State[ \\t]+Prio.*"); - static Regex mProcListEntry = new Regex("^(?<cur>([*]|))0x(?<pid>[0-9a-fA-F]+)[ \\t]+(?<state>.*)"); + static Regex mProcListEntry = new Regex("^(?<cur>([*]|))0x(?<pid>[0-9a-fA-F]+)[ \\t](?<state>[a-zA-Z ]+)[ \\t](?<name>[a-zA-Z. ]+).*"); static Regex mThreadListEntry = new Regex("^(?<cur>([*]|))0x(?<tid>[0-9a-fA-F]+)[ \\t]+(?<state>.*)0x(?<eip>[0-9a-fA-F]*)"); bool mFirstModuleUpdate = false; @@ -254,10 +254,12 @@ if (pidEntryMatch.Success && mReceivingProcs) { if (ProcessListEvent != null) - ProcessListEvent(this, new ProcessListEventArgs(ulong.Parse(pidEntryMatch.Groups["pid"].ToString(), NumberStyles.HexNumber), pidEntryMatch.Groups["cur"].Length > 0)); + ProcessListEvent(this, new ProcessListEventArgs(ulong.Parse(pidEntryMatch.Groups["pid"].ToString(), NumberStyles.HexNumber), pidEntryMatch.Groups["cur"].Length > 0, + pidEntryMatch.Groups["state"].ToString(), pidEntryMatch.Groups["name"].ToString())); } else { + /* TODO: this is called by far too often, results in several "thread list xx" commands */ if ((mReceivingProcs || cleanedLine.Contains("No processes")) && ProcessListEvent != null) ProcessListEvent(this, new ProcessListEventArgs(true)); } @@ -350,7 +352,8 @@ if (mCommandBuffer.Count == 1) { mConnection.Write(command + "\r"); - mCommandBuffer.RemoveAt(0); //useful??? + /* remove the command after sending */ + mCommandBuffer.RemoveAt(0); } } }
16 years, 2 months
1
0
0
0
[sserapion] 36734: Set svn:eol-style property
by sserapion@svn.reactos.org
Author: sserapion Date: Sun Oct 12 14:15:57 2008 New Revision: 36734 URL:
http://svn.reactos.org/svn/reactos?rev=36734&view=rev
Log: Set svn:eol-style property Modified: branches/ros-amd64-bringup/reactos/dll/win32/gdi32/objects/arc.c (contents, props changed) Modified: branches/ros-amd64-bringup/reactos/dll/win32/gdi32/objects/arc.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/w…
============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/gdi32/objects/arc.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/gdi32/objects/arc.c [iso-8859-1] Sun Oct 12 14:15:57 2008 @@ -1,57 +1,57 @@ -#include "precomp.h" - -BOOL -WINAPI -Arc( - HDC hDC, - int nLeftRect, - int nTopRect, - int nRightRect, - int nBottomRect, - int nXStartArc, - int nYStartArc, - int nXEndArc, - int nYEndArc -) -{ -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) -// Call Wine (rewrite of) MFDRV_MetaParam8 - return MFDRV_MetaParam8( hDC, META_ARC, a1, a2, a3, a4, a5, a6, a7, a8) - else - { - PLDC pLDC = GdiGetLDC(hDC); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { -// Call Wine (rewrite of) EMFDRV_ArcChordPie - BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_ARC); - return Ret; - } - return FALSE; - } - } -#endif - return NtGdiArcInternal(GdiTypeArc, - hDC, - nLeftRect, - nTopRect, - nRightRect, - nBottomRect, - nXStartArc, - nYStartArc, - nXEndArc, - nYEndArc); -} - - +#include "precomp.h" + +BOOL +WINAPI +Arc( + HDC hDC, + int nLeftRect, + int nTopRect, + int nRightRect, + int nBottomRect, + int nXStartArc, + int nYStartArc, + int nXEndArc, + int nYEndArc +) +{ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) +// Call Wine (rewrite of) MFDRV_MetaParam8 + return MFDRV_MetaParam8( hDC, META_ARC, a1, a2, a3, a4, a5, a6, a7, a8) + else + { + PLDC pLDC = GdiGetLDC(hDC); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { +// Call Wine (rewrite of) EMFDRV_ArcChordPie + BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_ARC); + return Ret; + } + return FALSE; + } + } +#endif + return NtGdiArcInternal(GdiTypeArc, + hDC, + nLeftRect, + nTopRect, + nRightRect, + nBottomRect, + nXStartArc, + nYStartArc, + nXEndArc, + nYEndArc); +} + + /* * @implemented */ @@ -64,175 +64,175 @@ FLOAT StartAngle, FLOAT SweepAngle) { - gxf_long worker, worker1; - - worker.f = StartAngle; - worker1.f = SweepAngle; - -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return FALSE; //No meta support for AngleArc - else - { - PLDC pLDC = GdiGetLDC(hDC); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - BOOL Ret = EMFDRV_AngleArc( hDC, X, Y, Radius, StartAngle, SweepAngle); - return Ret; - } - return FALSE; - } - } -#endif - return NtGdiAngleArc(hDC, X, Y, Radius, (DWORD)worker.l, (DWORD)worker1.l); -} - -BOOL -WINAPI -ArcTo( - HDC hDC, - int nLeftRect, - int nTopRect, - int nRightRect, - int nBottomRect, - int nXRadial1, - int nYRadial1, - int nXRadial2, - int nYRadial2) -{ -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return FALSE; //No meta support for ArcTo - else - { - PLDC pLDC = GdiGetLDC(hDC); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_ARCTO); - return Ret; - } - return FALSE; - } - } -#endif - return NtGdiArcInternal(GdiTypeArcTo, - hDC, - nLeftRect, - nTopRect, - nRightRect, - nBottomRect, - nXRadial1, - nYRadial1, - nXRadial2, - nYRadial2); -} - -BOOL -WINAPI -Chord( - HDC hDC, - int nLeftRect, - int nTopRect, - int nRightRect, - int nBottomRect, - int nXRadial1, - int nYRadial1, - int nXRadial2, - int nYRadial2) -{ -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return MFDRV_MetaParam8( hDC, META_CHORD, a1, a2, a3, a4, a5, a6, a7, a8) - else - { - PLDC pLDC = GdiGetLDC(hDC); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_CHORD); - return Ret; - } - return FALSE; - } - } -#endif - return NtGdiArcInternal(GdiTypeChord, - hDC, - nLeftRect, - nTopRect, - nRightRect, - nBottomRect, - nXRadial1, - nYRadial1, - nXRadial2, - nYRadial2); -} - - -/* - * @unimplemented - */ -BOOL -STDCALL -Pie( - HDC hDC, - int a1, - int a2, - int a3, - int a4, - int a5, - int a6, - int a7, - int a8 - ) -{ -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return MFDRV_MetaParam8( hDC, META_PIE, a1, a2, a3, a4, a5, a6, a7, a8) - else - { - PLDC pLDC = GdiGetLDC(hDC); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_PIE); - return Ret; - } - return FALSE; - } - } -#endif - return NtGdiArcInternal(GdiTypePie, hDC, a1, a2, a3, a4, a5, a6, a7, a8); -} - - + gxf_long worker, worker1; + + worker.f = StartAngle; + worker1.f = SweepAngle; + +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) + return FALSE; //No meta support for AngleArc + else + { + PLDC pLDC = GdiGetLDC(hDC); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + BOOL Ret = EMFDRV_AngleArc( hDC, X, Y, Radius, StartAngle, SweepAngle); + return Ret; + } + return FALSE; + } + } +#endif + return NtGdiAngleArc(hDC, X, Y, Radius, (DWORD)worker.l, (DWORD)worker1.l); +} + +BOOL +WINAPI +ArcTo( + HDC hDC, + int nLeftRect, + int nTopRect, + int nRightRect, + int nBottomRect, + int nXRadial1, + int nYRadial1, + int nXRadial2, + int nYRadial2) +{ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) + return FALSE; //No meta support for ArcTo + else + { + PLDC pLDC = GdiGetLDC(hDC); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_ARCTO); + return Ret; + } + return FALSE; + } + } +#endif + return NtGdiArcInternal(GdiTypeArcTo, + hDC, + nLeftRect, + nTopRect, + nRightRect, + nBottomRect, + nXRadial1, + nYRadial1, + nXRadial2, + nYRadial2); +} + +BOOL +WINAPI +Chord( + HDC hDC, + int nLeftRect, + int nTopRect, + int nRightRect, + int nBottomRect, + int nXRadial1, + int nYRadial1, + int nXRadial2, + int nYRadial2) +{ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) + return MFDRV_MetaParam8( hDC, META_CHORD, a1, a2, a3, a4, a5, a6, a7, a8) + else + { + PLDC pLDC = GdiGetLDC(hDC); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_CHORD); + return Ret; + } + return FALSE; + } + } +#endif + return NtGdiArcInternal(GdiTypeChord, + hDC, + nLeftRect, + nTopRect, + nRightRect, + nBottomRect, + nXRadial1, + nYRadial1, + nXRadial2, + nYRadial2); +} + + +/* + * @unimplemented + */ +BOOL +STDCALL +Pie( + HDC hDC, + int a1, + int a2, + int a3, + int a4, + int a5, + int a6, + int a7, + int a8 + ) +{ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) + return MFDRV_MetaParam8( hDC, META_PIE, a1, a2, a3, a4, a5, a6, a7, a8) + else + { + PLDC pLDC = GdiGetLDC(hDC); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_PIE); + return Ret; + } + return FALSE; + } + } +#endif + return NtGdiArcInternal(GdiTypePie, hDC, a1, a2, a3, a4, a5, a6, a7, a8); +} + + Propchange: branches/ros-amd64-bringup/reactos/dll/win32/gdi32/objects/arc.c ------------------------------------------------------------------------------ svn:eol-style = native
16 years, 2 months
1
0
0
0
[pschweitzer] 36733: Implemented FsRtlInitializeTunnelCache
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Oct 12 12:44:10 2008 New Revision: 36733 URL:
http://svn.reactos.org/svn/reactos?rev=36733&view=rev
Log: Implemented FsRtlInitializeTunnelCache Modified: branches/pierre-fsd/ntoskrnl/fsrtl/tunnel.c Modified: branches/pierre-fsd/ntoskrnl/fsrtl/tunnel.c URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/ntoskrnl/fsrtl/tunne…
============================================================================== --- branches/pierre-fsd/ntoskrnl/fsrtl/tunnel.c [iso-8859-1] (original) +++ branches/pierre-fsd/ntoskrnl/fsrtl/tunnel.c [iso-8859-1] Sun Oct 12 12:44:10 2008 @@ -157,12 +157,12 @@ /*++ * @name FsRtlDeleteTunnelCache - * @unimplemented + * @implemented * - * FILLME + * Initialize a tunnel cache * * @param Cache - * FILLME + * Pointer to an allocated TUNNEL structure * * @return None * @@ -173,8 +173,10 @@ NTAPI FsRtlInitializeTunnelCache(IN PTUNNEL Cache) { - /* Unimplemented */ - KEBUGCHECK(0); + ExInitializeFastMutex(&(Cache->Mutex)); + Cache->Cache = 0; + InitializeListHead(&(Cache->TimerQueue)); + Cache->NumEntries = 0; } /* EOF */
16 years, 2 months
1
0
0
0
[mjmartin] 36732: - Implement REnumServicesStatusExA - REnumServicesStatusA/W: Fixed returned param values to match Windows - REnumServicesStatusExW: Dont try to access lpResumeIndex if it is NULL. Fixed returned param values to match windows.
by mjmartin@svn.reactos.org
Author: mjmartin Date: Sun Oct 12 08:10:05 2008 New Revision: 36732 URL:
http://svn.reactos.org/svn/reactos?rev=36732&view=rev
Log: - Implement REnumServicesStatusExA - REnumServicesStatusA/W: Fixed returned param values to match Windows - REnumServicesStatusExW: Dont try to access lpResumeIndex if it is NULL. Fixed returned param values to match windows. Modified: trunk/reactos/base/system/services/rpcserver.c Modified: trunk/reactos/base/system/services/rpcserver.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/rpcse…
============================================================================== --- trunk/reactos/base/system/services/rpcserver.c [iso-8859-1] (original) +++ trunk/reactos/base/system/services/rpcserver.c [iso-8859-1] Sun Oct 12 08:10:05 2008 @@ -2371,6 +2371,12 @@ dwRequiredSize += dwSize; } + if (dwError != ERROR_MORE_DATA) + { + *pcbBytesNeeded = 0; + if (lpResumeHandle) *lpResumeHandle = 0; + } + Done:; /* FIXME: Unlock the service list */ @@ -3451,8 +3457,8 @@ continue; dwSize = sizeof(ENUM_SERVICE_STATUSA) + - ((wcslen(CurrentService->lpServiceName) + 1)) + - ((wcslen(CurrentService->lpDisplayName) + 1)); + wcslen(CurrentService->lpServiceName) + 1 + + wcslen(CurrentService->lpDisplayName) + 1; if (dwRequiredSize + dwSize > dwBufSize) { @@ -3487,9 +3493,9 @@ if ((dwState & dwServiceState) == 0) continue; - dwRequiredSize += (sizeof(ENUM_SERVICE_STATUSA) + - ((wcslen(CurrentService->lpServiceName) + 1)) + - ((wcslen(CurrentService->lpDisplayName) + 1))); + dwRequiredSize += sizeof(ENUM_SERVICE_STATUSA) + + wcslen(CurrentService->lpServiceName) + 1 + + wcslen(CurrentService->lpDisplayName) + 1; dwError = ERROR_MORE_DATA; } @@ -3524,8 +3530,8 @@ continue; dwSize = sizeof(ENUM_SERVICE_STATUSA) + - ((wcslen(CurrentService->lpServiceName) + 1)) + - ((wcslen(CurrentService->lpDisplayName) + 1)); + wcslen(CurrentService->lpServiceName) + 1 + + wcslen(CurrentService->lpDisplayName) + 1; if (dwRequiredSize + dwSize > dwBufSize) break; @@ -3561,6 +3567,12 @@ lpStatusPtr++; dwRequiredSize += dwSize; + } + + if (dwError != ERROR_MORE_DATA) + { + *pcbBytesNeeded = 0; + if (lpResumeHandle) *lpResumeHandle = 0; } Done:; @@ -4509,10 +4521,295 @@ LPBOUNDED_DWORD_256K lpResumeIndex, LPCSTR pszGroupName) { - UNIMPLEMENTED; + PMANAGER_HANDLE hManager; + PSERVICE lpService; + DWORD dwError = ERROR_SUCCESS; + PLIST_ENTRY ServiceEntry; + PSERVICE CurrentService; + DWORD dwState; + DWORD dwRequiredSize; + DWORD dwServiceCount; + DWORD dwSize; + DWORD dwLastResumeCount = 0; + LPENUM_SERVICE_STATUS_PROCESSA lpStatusPtr; + LPSTR lpStringPtr; + LPWSTR pszGroupNameW = NULL; + + DPRINT("REnumServicesStatusExA() called\n"); + + if (ScmShutdown) + return ERROR_SHUTDOWN_IN_PROGRESS; + + if (InfoLevel != SC_ENUM_PROCESS_INFO) + return ERROR_INVALID_LEVEL; + + hManager = (PMANAGER_HANDLE)hSCManager; + if (!hManager || hManager->Handle.Tag != MANAGER_TAG) + { + DPRINT1("Invalid manager handle!\n"); + return ERROR_INVALID_HANDLE; + } + *pcbBytesNeeded = 0; *lpServicesReturned = 0; - return ERROR_CALL_NOT_IMPLEMENTED; + + if ((dwServiceType!=SERVICE_DRIVER) && (dwServiceType!=SERVICE_WIN32)) + { + DPRINT1("Not a valid Service Type!\n"); + return ERROR_INVALID_PARAMETER; + } + + if ((dwServiceState<SERVICE_ACTIVE) || (dwServiceState>SERVICE_STATE_ALL)) + { + DPRINT1("Not a valid Service State!\n"); + return ERROR_INVALID_PARAMETER; + } + + /* Check access rights */ + if (!RtlAreAllAccessesGranted(hManager->Handle.DesiredAccess, + SC_MANAGER_ENUMERATE_SERVICE)) + { + DPRINT1("Insufficient access rights! 0x%lx\n", + hManager->Handle.DesiredAccess); + return ERROR_ACCESS_DENIED; + } + + if (lpResumeIndex) dwLastResumeCount = *lpResumeIndex; + + /* FIXME: Lock the service list shared */ + + lpService = ScmGetServiceEntryByResumeCount(dwLastResumeCount); + if (lpService == NULL) + { + dwError = ERROR_SUCCESS; + goto Done; + } + + dwRequiredSize = 0; + dwServiceCount = 0; + + if (pszGroupName) + { + pszGroupNameW = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (strlen(pszGroupName) + 1) * sizeof(WCHAR)); + if (!pszGroupNameW) + { + DPRINT1("Failed to allocate buffer!\n"); + return ERROR_NOT_ENOUGH_MEMORY; + } + MultiByteToWideChar(CP_ACP, + 0, + pszGroupName, + -1, + pszGroupNameW, + strlen(pszGroupName) + 1); + } + + for (ServiceEntry = &lpService->ServiceListEntry; + ServiceEntry != &ServiceListHead; + ServiceEntry = ServiceEntry->Flink) + { + CurrentService = CONTAINING_RECORD(ServiceEntry, + SERVICE, + ServiceListEntry); + + if ((CurrentService->Status.dwServiceType & dwServiceType) == 0) + continue; + + dwState = SERVICE_ACTIVE; + if (CurrentService->Status.dwCurrentState == SERVICE_STOPPED) + dwState = SERVICE_INACTIVE; + + if ((dwState & dwServiceState) == 0) + continue; + + if (pszGroupNameW) + { + if (*pszGroupNameW == 0) + { + if (CurrentService->lpGroup != NULL) + continue; + } + else + { + if ((CurrentService->lpGroup == NULL) || + _wcsicmp(pszGroupNameW, CurrentService->lpGroup->lpGroupName)) + continue; + } + } + + dwSize = sizeof(ENUM_SERVICE_STATUS_PROCESSW) + + (wcslen(CurrentService->lpServiceName) + 1) + + (wcslen(CurrentService->lpDisplayName) + 1); + + if (dwRequiredSize + dwSize <= cbBufSize) + { + DPRINT("Service name: %S fit\n", CurrentService->lpServiceName); + dwRequiredSize += dwSize; + dwServiceCount++; + dwLastResumeCount = CurrentService->dwResumeCount; + } + else + { + DPRINT("Service name: %S no fit\n", CurrentService->lpServiceName); + break; + } + + } + + DPRINT("dwRequiredSize: %lu\n", dwRequiredSize); + DPRINT("dwServiceCount: %lu\n", dwServiceCount); + + for (; + ServiceEntry != &ServiceListHead; + ServiceEntry = ServiceEntry->Flink) + { + CurrentService = CONTAINING_RECORD(ServiceEntry, + SERVICE, + ServiceListEntry); + + if ((CurrentService->Status.dwServiceType & dwServiceType) == 0) + continue; + + dwState = SERVICE_ACTIVE; + if (CurrentService->Status.dwCurrentState == SERVICE_STOPPED) + dwState = SERVICE_INACTIVE; + + if ((dwState & dwServiceState) == 0) + continue; + + if (pszGroupNameW) + { + if (*pszGroupNameW == 0) + { + if (CurrentService->lpGroup != NULL) + continue; + } + else + { + if ((CurrentService->lpGroup == NULL) || + _wcsicmp(pszGroupNameW, CurrentService->lpGroup->lpGroupName)) + continue; + } + } + + dwRequiredSize += (sizeof(ENUM_SERVICE_STATUS_PROCESSW) + + (wcslen(CurrentService->lpServiceName) + 1) + + (wcslen(CurrentService->lpDisplayName) + 1)); + + dwError = ERROR_MORE_DATA; + } + + DPRINT("*pcbBytesNeeded: %lu\n", dwRequiredSize); + + if (lpResumeIndex) *lpResumeIndex = dwLastResumeCount; + *lpServicesReturned = dwServiceCount; + *pcbBytesNeeded = dwRequiredSize; + + /* If there was no services that matched */ + if (!dwServiceCount) + { + dwError = ERROR_SERVICE_DOES_NOT_EXIST; + goto Done; + } + + lpStatusPtr = (LPENUM_SERVICE_STATUS_PROCESSA)lpBuffer; + lpStringPtr = (LPSTR)((ULONG_PTR)lpBuffer + + dwServiceCount * sizeof(ENUM_SERVICE_STATUS_PROCESSA)); + + dwRequiredSize = 0; + for (ServiceEntry = &lpService->ServiceListEntry; + ServiceEntry != &ServiceListHead; + ServiceEntry = ServiceEntry->Flink) + { + CurrentService = CONTAINING_RECORD(ServiceEntry, + SERVICE, + ServiceListEntry); + + if ((CurrentService->Status.dwServiceType & dwServiceType) == 0) + continue; + + dwState = SERVICE_ACTIVE; + if (CurrentService->Status.dwCurrentState == SERVICE_STOPPED) + dwState = SERVICE_INACTIVE; + + if ((dwState & dwServiceState) == 0) + continue; + + if (pszGroupNameW) + { + if (*pszGroupNameW == 0) + { + if (CurrentService->lpGroup != NULL) + continue; + } + else + { + if ((CurrentService->lpGroup == NULL) || + _wcsicmp(pszGroupNameW, CurrentService->lpGroup->lpGroupName)) + continue; + } + } + + dwSize = sizeof(ENUM_SERVICE_STATUS_PROCESSW) + + ((wcslen(CurrentService->lpServiceName) + 1) * sizeof(WCHAR)) + + ((wcslen(CurrentService->lpDisplayName) + 1) * sizeof(WCHAR)); + + if (dwRequiredSize + dwSize <= cbBufSize) + { + /* Copy the service name */ + WideCharToMultiByte(CP_ACP, + 0, + CurrentService->lpServiceName, + -1, + lpStringPtr, + wcslen(CurrentService->lpServiceName), + 0, + 0); + lpStatusPtr->lpServiceName = (LPSTR)((ULONG_PTR)lpStringPtr - (ULONG_PTR)lpBuffer); + lpStringPtr += (wcslen(CurrentService->lpServiceName) + 1); + + /* Copy the display name */ + WideCharToMultiByte(CP_ACP, + 0, + CurrentService->lpDisplayName, + -1, + lpStringPtr, + wcslen(CurrentService->lpDisplayName), + 0, + 0); + lpStatusPtr->lpDisplayName = (LPSTR)((ULONG_PTR)lpStringPtr - (ULONG_PTR)lpBuffer); + lpStringPtr += (wcslen(CurrentService->lpDisplayName) + 1); + + /* Copy the status information */ + memcpy(&lpStatusPtr->ServiceStatusProcess, + &CurrentService->Status, + sizeof(SERVICE_STATUS)); + lpStatusPtr->ServiceStatusProcess.dwProcessId = CurrentService->ProcessId; /* FIXME */ + lpStatusPtr->ServiceStatusProcess.dwServiceFlags = 0; /* FIXME */ + + lpStatusPtr++; + dwRequiredSize += dwSize; + } + else + { + break; + } + } + + if (dwError != ERROR_MORE_DATA) + { + *pcbBytesNeeded = 0; + if (lpResumeIndex) *lpResumeIndex = 0; + } + +Done:; + /* Unlock the service list */ + + if (pszGroupNameW) HeapFree(GetProcessHeap(),0,pszGroupNameW); + + DPRINT("REnumServicesStatusExA() done (Error %lu)\n", dwError); + + return dwError; } @@ -4539,7 +4836,7 @@ DWORD dwRequiredSize; DWORD dwServiceCount; DWORD dwSize; - DWORD dwLastResumeCount; + DWORD dwLastResumeCount = 0; LPENUM_SERVICE_STATUS_PROCESSW lpStatusPtr; LPWSTR lpStringPtr; @@ -4556,6 +4853,21 @@ { DPRINT1("Invalid manager handle!\n"); return ERROR_INVALID_HANDLE; + } + + *pcbBytesNeeded = 0; + *lpServicesReturned = 0; + + if ((dwServiceType!=SERVICE_DRIVER) && (dwServiceType!=SERVICE_WIN32)) + { + DPRINT1("Not a valid Service Type!\n"); + return ERROR_INVALID_PARAMETER; + } + + if ((dwServiceState<SERVICE_ACTIVE) || (dwServiceState>SERVICE_STATE_ALL)) + { + DPRINT1("Not a valid Service State!\n"); + return ERROR_INVALID_PARAMETER; } /* Check access rights */ @@ -4567,10 +4879,7 @@ return ERROR_ACCESS_DENIED; } - *pcbBytesNeeded = 0; - *lpServicesReturned = 0; - - dwLastResumeCount = *lpResumeIndex; + if (lpResumeIndex) dwLastResumeCount = *lpResumeIndex; /* Lock the service list shared */ @@ -4681,9 +4990,16 @@ DPRINT("*pcbBytesNeeded: %lu\n", dwRequiredSize); - *lpResumeIndex = dwLastResumeCount; + if (lpResumeIndex) *lpResumeIndex = dwLastResumeCount; *lpServicesReturned = dwServiceCount; *pcbBytesNeeded = dwRequiredSize; + + /* If there was no services that matched */ + if (!dwServiceCount) + { + dwError = ERROR_SERVICE_DOES_NOT_EXIST; + goto Done; + } lpStatusPtr = (LPENUM_SERVICE_STATUS_PROCESSW)lpBuffer; lpStringPtr = (LPWSTR)((ULONG_PTR)lpBuffer + @@ -4755,7 +5071,12 @@ { break; } - + } + + if (dwError != ERROR_MORE_DATA) + { + *pcbBytesNeeded = 0; + if (lpResumeIndex) *lpResumeIndex = 0; } Done:;
16 years, 2 months
1
0
0
0
[fireball] 36731: - Implement locking for Cc flush (the one used in NT5.2 results in a hang, might be because of a misused PagingIoResource). - If an acquire/release operation is not implemented, FSD must return STATUS_INVALID_DEVICE_REQUEST, not some other error code. - Fix a typo in the debug message.
by fireball@svn.reactos.org
Author: fireball Date: Sun Oct 12 04:34:29 2008 New Revision: 36731 URL:
http://svn.reactos.org/svn/reactos?rev=36731&view=rev
Log: - Implement locking for Cc flush (the one used in NT5.2 results in a hang, might be because of a misused PagingIoResource). - If an acquire/release operation is not implemented, FSD must return STATUS_INVALID_DEVICE_REQUEST, not some other error code. - Fix a typo in the debug message. Modified: trunk/reactos/drivers/filesystems/fastfat/create.c trunk/reactos/drivers/filesystems/fastfat/fastio.c Modified: trunk/reactos/drivers/filesystems/fastfat/create.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/create.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/create.c [iso-8859-1] Sun Oct 12 04:34:29 2008 @@ -198,7 +198,7 @@ DPRINT ("FindFile(Parent %p, FileToFind '%wZ', DirIndex: %d)\n", Parent, FileToFindU, DirContext->DirIndex); - DPRINT ("FindFile: Path %wZ)\n",&Parent->PathNameU); + DPRINT ("FindFile: Path %wZ\n",&Parent->PathNameU); PathNameBufferLength = LONGNAME_MAX_LENGTH * sizeof(WCHAR); PathNameBuffer = ExAllocatePoolWithTag(NonPagedPool, PathNameBufferLength + sizeof(WCHAR), TAG_VFAT); Modified: trunk/reactos/drivers/filesystems/fastfat/fastio.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/fastio.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/fastio.c [iso-8859-1] Sun Oct 12 04:34:29 2008 @@ -175,7 +175,7 @@ IN PDEVICE_OBJECT DeviceObject) { DPRINT("VfatAcquireForModWrite\n"); - return STATUS_UNSUCCESSFUL; + return STATUS_INVALID_DEVICE_REQUEST; } static BOOLEAN NTAPI @@ -296,16 +296,34 @@ VfatAcquireForCcFlush(IN PFILE_OBJECT FileObject, IN PDEVICE_OBJECT DeviceObject) { + PVFATFCB Fcb = (PVFATFCB)FileObject->FsContext; + DPRINT("VfatAcquireForCcFlush\n"); - return STATUS_INVALID_DEVICE_REQUEST; + + /* Make sure it is not a volume lock */ + ASSERT(!(Fcb->Flags & FCB_IS_VOLUME)); + + /* Acquire the resource */ + ExAcquireResourceExclusiveLite(&(Fcb->MainResource), TRUE); + + return STATUS_SUCCESS; } static NTSTATUS NTAPI VfatReleaseForCcFlush(IN PFILE_OBJECT FileObject, IN PDEVICE_OBJECT DeviceObject) { + PVFATFCB Fcb = (PVFATFCB)FileObject->FsContext; + DPRINT("VfatReleaseForCcFlush\n"); - return STATUS_INVALID_DEVICE_REQUEST; + + /* Make sure it is not a volume lock */ + ASSERT(!(Fcb->Flags & FCB_IS_VOLUME)); + + /* Release the resource */ + ExReleaseResourceLite(&(Fcb->MainResource)); + + return STATUS_SUCCESS; } BOOLEAN NTAPI @@ -378,7 +396,6 @@ FastIoDispatch->ReleaseFileForNtCreateSection = VfatReleaseFileForNtCreateSection; FastIoDispatch->FastIoDetachDevice = VfatFastIoDetachDevice; FastIoDispatch->FastIoQueryNetworkOpenInfo = VfatFastIoQueryNetworkOpenInfo; - FastIoDispatch->AcquireForModWrite = VfatAcquireForModWrite; FastIoDispatch->MdlRead = VfatMdlRead; FastIoDispatch->MdlReadComplete = VfatMdlReadComplete; FastIoDispatch->PrepareMdlWrite = VfatPrepareMdlWrite; @@ -388,6 +405,7 @@ FastIoDispatch->MdlReadCompleteCompressed = VfatMdlReadCompleteCompressed; FastIoDispatch->MdlWriteCompleteCompressed = VfatMdlWriteCompleteCompressed; FastIoDispatch->FastIoQueryOpen = VfatFastIoQueryOpen; + FastIoDispatch->AcquireForModWrite = VfatAcquireForModWrite; FastIoDispatch->ReleaseForModWrite = VfatReleaseForModWrite; FastIoDispatch->AcquireForCcFlush = VfatAcquireForCcFlush; FastIoDispatch->ReleaseForCcFlush = VfatReleaseForCcFlush;
16 years, 2 months
1
0
0
0
← Newer
1
...
36
37
38
39
40
41
42
...
52
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Results per page:
10
25
50
100
200