Commit Graph
102 Commits
Author SHA1 Message Date
Zoltan Varga 17edd267ab [bcl] Use List instead of ArrayList () in a few places. 2014-10-08 16:12:01 -04:00
Zoltan Varga c33600f57d [bcl] Free strings allocated using Marshal.SecureStringToBSTR () using Marshal.ZeroFreeBSTR (). 2014-10-08 15:12:35 -04:00
Rodrigo Kumpera 1531d4f34d [System] Throw IOE in more cases when dealing with an invalid Process object. Fixes #19864 2014-05-16 16:30:56 -04:00
Piotr Zierhoffer e7dce0eeba Fix typo in exception message 2014-03-21 16:00:45 +01:00
Marek Safar 6352c16dd5 Merge pull request #963 from kebby/master
Fix Process.CancelErrorRead
2014-03-18 13:45:38 +01:00
Tammo 'kb' Hinrichs dce6eeaece Fix Process.CancelErrorRead
Fixed CancelErrorRead throwing an InvalidOperationException because it checked the wrong output stream (probably a cut&paste mistake).
2014-03-18 12:45:11 +01:00
Rodrigo Kumpera 4db7fe7112 [System] Fix process creation when UseShellExecute is set to false.
This fixes the behavior of process spawning when UseShellExecute is
set to true.

The right behavior is to return no process only when we used the system
launcher. So, spawning /bin/cat should behave in the same way independent
of how UseShellExecute is set.
2014-02-06 15:52:43 -05:00
Rodrigo Kumpera 5066972814 [System] When starting a process with UseShellExecute=true, don't return a process. Fixes #16119 2013-12-16 17:13:06 -05:00
Rodrigo Kumpera 09e65ba543 [bcl] When finalizing a Process object, don't touch the streams as they are finalized on their own. Fixes #10883. 2013-12-11 17:15:12 -05:00
Marek Safar 510f20d376 Fix failing mobile tests 2013-02-26 10:37:01 +01:00
Marek Safar 5aeeb9cf7b Fix few warnings 2013-02-25 19:10:09 +01:00
Scott Blomquist ef6313d9c4 Return correctly-sized ProcessThreadCollection to enable Threads.Count. 2012-07-29 16:51:01 -07:00
Miguel de Icaza f48ceb9860 [System] Removal of the NET_2_0 in the source code
Modulo the GUID in the assembly and the GUID embedded in some
field initializers that use the assembly GUID for their name, the
assemblies are idential before and after the patch.
2012-06-02 13:16:40 -04:00
Zoltan Varga b0254ba0ef Throw a nicer error from Process.set_PriorityClass is the process has exited. Fixes #1692. 2011-11-04 18:54:10 +01:00
Ankit Jain 77fabf1209 Process.Start: Show native error message in Win32Exception.
mcs/class/System/System.Diagnostics/Process.cs (Start_noshell):
If the process execution fails, then add the error message for
the native error code in the Win32Exception thrown.
2011-01-27 04:03:46 +05:30
Gonzalo Paniagua Javier 827a231ffc Remove arbitrary 1024 limit in GetProcesses
Reallocate the array of PIDs if EnumProcesses used all of it and try
	again.
2010-10-22 00:01:38 -04:00
Gonzalo Paniagua Javier e497bb1b59 2010-07-06 Gonzalo Paniagua Javier <[email protected]>
* Process.cs: allow the exit callback to be used more than once. Fixes
	bug #614909.



svn path=/trunk/mcs/; revision=159980
2010-07-06 18:39:07 +00:00
Gonzalo Paniagua Javier 9b948ac91d 2010-07-04 Gonzalo Paniagua Javier <[email protected]>
* Process.cs: ignore processes that finish while we are looking for
	processes by name. Fixes bug #596779.


svn path=/trunk/mcs/; revision=159866
2010-07-04 21:31:42 +00:00
Zoltan Varga bcd2356726 2009-10-12 Zoltan Varga <[email protected]>
* Process.cs (Dispose): Close the async output/error readers. Fixes #545429.

svn path=/trunk/mcs/; revision=143985
2009-10-12 21:28:49 +00:00
Miguel de Icaza 401337e297 2009-04-19 Miguel de Icaza <[email protected]>
* Process.cs: Do not crash if GetProcesses_internal returns null
	This happens on operating systems where we have not implemented

svn path=/trunk/mcs/; revision=132110
2009-04-20 03:57:44 +00:00
Andrés G. Aragoneses 5bb70a1030 * Test/System.Diagnostics/ProcessTest.cs: New tests for bug 477943.
* System.Diagnostics/Process.cs: Throw IOEs instead of normal
exceptions. Fixes bug 477943.

svn path=/trunk/mcs/; revision=127932
2009-02-25 02:28:14 +00:00
Zoltan Varga 10cabfadcc 2009-01-18 Zoltan Varga <[email protected]>
* Process.cs: Avoid closing the duplicated process handle in
	ProcessWaitHandle, it is done automatically by the WaitHandle.Dispose ().
	Fixes #464628.

svn path=/trunk/mcs/; revision=123738
2009-01-18 16:00:11 +00:00
Miguel de Icaza 1755003275 A bug fix for 459450
2008-12-25  Miguel de Icaza  <[email protected]>

	* ProcessTest.cs: Created a test case from bug 459450.

2008-12-25   Leszek Ciesielski <[email protected]>

	* System.Diagnostics/Process.cs: Raise the
	Process.OutputDataReceived and Process.ErrorDataReceived with null
	arguments at the end.   This is the documented behavior:

	http://msdn.microsoft.com/en-us/library/system.diagnostics.datareceivedeventargs.data.aspx

	And CruiseControl.NET depended on this.   Bug #459450.
	
	* Microsoft.CSharp/CSharpCodeCompiler.cs: Fix the code, as it
	depened on the previous broken behavior.



svn path=/trunk/mcs/; revision=122125
2008-12-25 17:44:52 +00:00
Bill Holmes 18e193acd5 2008-11-13 Bill Holmes <[email protected]>
* process.h : Adding method declaration for
	  ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.

	* process.c : Adding implementation for
	  ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.

	* icall-def.h : Registering ICALL Processs.WaitForInputIdle_internal
	  to ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.

	* wait.h : Adding method declaration for WaitForInputIdle.

	* wait.c : Adding implementation for WaitForInputIdle.

	* Process.cs : Adding an implementation for WaitForInputIdle
	  to call the an internal call.  The internal call is only
	  implemented properly on Windows.

	Code is contributed under MIT/X11 license.


svn path=/trunk/mcs/; revision=118724
2008-11-13 16:03:48 +00:00
Jonathan Chambers 84ec87d71b 2008-11-06 Jonathan Chambers <[email protected]>
* MonoIO.cs : Add DuplicateHandle.

2008-11-06  Jonathan Chambers  <[email protected]>

        * Process.cs : Use DuplicateHandle when redirecting
        StdInput and StdOutput. Fixes bug #436291.



svn path=/trunk/mcs/; revision=118134
2008-11-06 18:48:08 +00:00
Paolo Molaro 43c05dda29 Mon Oct 13 14:39:52 CEST 2008 Paolo Molaro <[email protected]>
* Process.cs: added icall and implementation of many memory-related
	query methods (bug #434473).


svn path=/trunk/mcs/; revision=115653
2008-10-13 12:42:08 +00:00
Bill Holmes 017eaee375 2008-09-10 Bill Holmes <[email protected]>
* Socket.cs : Adding a comment to provide locations where
	  changes to MonoSocketAsyncResult need to be synced.

	* Process.cs : Update the fields of ProcessAsyncReader to
	  match MonoSocketAsyncResult metadata/socket-io.h

	Code is contributed under MIT/X11 license.


svn path=/trunk/mcs/; revision=112681
2008-09-10 15:20:35 +00:00
Dick Porter 941ac90384 2008-07-28 Dick Porter <[email protected]>
* Process.cs: When passing handle references around, it needs to
	be duplicated and freed so the OS doesn't close it.  Makes the
	testcase in 410743 work again now the underlying bug has been
	fixed.



svn path=/trunk/mcs/; revision=109048
2008-07-28 16:30:37 +00:00
Zoltan Varga eff019542d 2008-07-27 Zoltan Varga <[email protected]>
* Process.cs (SetExitCallbackIfNeeded): Avoid a race condition by not
	checking for HashExited.

svn path=/trunk/mcs/; revision=108887
2008-07-27 00:08:08 +00:00
Robert Jordan 2b194c193d In System.Diagnostics:
2008-06-21  Robert Jordan  <[email protected]>

	* Process.cs (Start_common): UserName may be null or empty.
	Fixes bug  #350543.

In Test/System.Diagnostics:
2008-06-21  Robert Jordan  <[email protected]>

	* ProcessTest.cs (Start_UseShellExecuteWithEmptyUserName):
	add test for bug #350543.


svn path=/trunk/mcs/; revision=106452
2008-06-23 19:09:22 +00:00
Dick Porter a4a491eac8 2008-06-19 Dick Porter <[email protected]>
* Process.cs: Match the buffer sizes of StreamWriter and
	MonoSyncFileStream for redirected stdout and stderr.  Fixes bug
	401225.



svn path=/trunk/mcs/; revision=106217
2008-06-19 14:56:31 +00:00
Gert Driesen baab1f11d4 * Process.cs: In PriorityClass setter, first check whether value is
valid and remove LAMESPEC since the documentation has been corrected 
for .NET 3.5. Code formatting.
* ProcessTest.cs: Added tests for PriorityClass.

svn path=/trunk/mcs/; revision=91804
2007-12-22 09:48:37 +00:00
Dick Porter 6ffa6c9dbc 2007-12-19 Dick Porter <[email protected]>
* Process.cs: Check that the process has been started before
	getting or setting the priority class.  Fixes bug 348415.

2007-12-19  Dick Porter  <[email protected]>

	* Win32Exception.cs: Add text for error 5, Access denied.



svn path=/trunk/mcs/; revision=91629
2007-12-19 14:25:14 +00:00
Gert Driesen 3b0d04fd6c * Process.cs: Modified StartInfo to throw ArgumentNullException when
value is set to null, instead of ArgumentException. Remove check if   
file name is rooted and exists when UseShellExecute is false, and let
runtime handle this. Fixes bug #345565. When a process cannot be started, do
not access ProcessStartInfo.EnvironmentVariables since that would not allow us
to re-use the instance when changing UseShellExecute. Added argument check in
Start (ProcessStartInfo). Code formatting.
* ProcessTest.cs: Added tests for Start overloads.

svn path=/trunk/mcs/; revision=90693
2007-12-04 16:37:36 +00:00
Dick Porter e2577f0f0d 2007-11-15 Dick Porter <[email protected]>
* Process.cs: Pass the process handle to GetModules_internal();



svn path=/trunk/mcs/; revision=89687
2007-11-15 17:13:46 +00:00
Atsushi Eno c961accff5 2007-11-13 Atsushi Enomoto <[email protected]>
* Process.cs : ... and it exposed some missing attributes.


svn path=/trunk/mcs/; revision=89548
2007-11-13 11:51:37 +00:00
Atsushi Eno 42bd154fb0 2007-11-13 Atsushi Enomoto <[email protected]>
* Process.cs : oops, SessionId was int.


svn path=/trunk/mcs/; revision=89532
2007-11-13 09:45:56 +00:00
Atsushi Eno 09a8cb64ff oops.
svn path=/trunk/mcs/; revision=89531
2007-11-13 09:37:43 +00:00
Atsushi Eno 3df8967748 2007-11-13 Atsushi Enomoto <[email protected]>
* Process.cs : added missing SessionId (NIE).


svn path=/trunk/mcs/; revision=89530
2007-11-13 09:29:03 +00:00
Robert Jordan 535abaefa2 In Test/System.Diagnostics:
2007-10-30  Robert Jordan  <[email protected]>

	* ProcessTest.cs: Add tests for bug #319829.

In System.Diagnostics:
2007-10-30  Robert Jordan  <[email protected]>

	* Process.cs: Wrap the redirected streams with a stream
	that provides real async Begin/Read|Write operations.
	Fixes bug #319829.

In System.IO:
2007-10-30  Robert Jordan  <[email protected]>

	* MonoSyncFileStream.cs: Add.


svn path=/trunk/mcs/; revision=88491
2007-10-30 18:35:42 +00:00
Miguel de Icaza 9cf1277ccf 2007-09-25 Miguel de Icaza <[email protected]>
* Process.cs: Return an empty collection to prevent crashes;
        Fixes #319946


svn path=/trunk/mcs/; revision=86360
2007-09-25 21:43:56 +00:00
Paolo Molaro bc3b51b83f Tue Sep 25 18:03:37 CEST 2007 Paolo Molaro <[email protected]>
* Process.cs: eliminate the console encoding logic which was
	duplicated from System.Console and just use Console.Out.Encoding
	(bug #328162).


svn path=/trunk/mcs/; revision=86341
2007-09-25 15:57:26 +00:00
Atsushi Eno 5ccf103008 2007-09-05 Atsushi Enomoto <[email protected]>
* EventLog.cs, EventLogImpl.cs, LocalFileEventLog.cs, NullEventLog.cs,
	  Win32EventLog.cs : added missing members, will be left unsupported
	  in non-Win32 impl and left unimplemented in Win32.
	* CounterCreationDataCollection.cs : in 2.0 OnValidate() is overriden
	  instad of OnInsert().
	* Process.cs : removed StandardErrorEncoding and
	  StandardOutputEncoding. They do not exist anymore.


svn path=/trunk/mcs/; revision=85336
2007-09-05 08:57:02 +00:00
Atsushi Eno 14448f8d30 2007-09-03 Atsushi Enomoto <[email protected]>
* Process.cs, ProcessStartInfo.cs : user info support (on windows).
	 Removed encoding_stderr, encoding_stdout which are not needed and
	 do not match icall.


svn path=/trunk/mcs/; revision=85209
2007-09-03 08:51:17 +00:00
Robert Jordan ff0f205a05 2007-08-23 Robert Jordan <[email protected]>
* Process.cs: implement PriorityClass. Fixes #81756.


svn path=/trunk/mcs/; revision=84679
2007-08-23 06:17:06 +00:00
Paolo Molaro 822ca991f0 Mon Aug 20 12:41:09 CEST 2007 Paolo Molaro <[email protected]>
* Process.cs: implemented icall for system/user times.


svn path=/trunk/mcs/; revision=84440
2007-08-20 10:18:46 +00:00
Gonzalo Paniagua Javier b28ba972c6 2007-08-08 Gonzalo Paniagua Javier <[email protected]>
* Process.cs: added StandardOutputEncoding and StandardErrorEncoding
	properties. Bug #82262 fixed.


svn path=/trunk/mcs/; revision=83703
2007-08-09 03:48:02 +00:00
Atsushi Eno 520f81d70b 2007-08-06 Atsushi Enomoto <[email protected]>
* Process.cs, ProcessStartInfo.cs : added StandardOutputEncoding
	  and StandardErrorEncoding.

	* ProcessStartInfoTest.cs: tests for Standard[Output|Error]Encoding.


svn path=/trunk/mcs/; revision=83566
2007-08-06 23:46:28 +00:00
Atsushi Eno bc1aba7e94 2007-08-06 Atsushi Enomoto <[email protected]>
* PerformanceCounterInstanceLifetime.cs
	  PerformanceCounterCategoryType.cs : new.
	* ICollectData.cs ProcessStartInfo.cs
	  InstanceDataCollectionCollection.cs PerformanceCounter.cs
	  InstanceDataCollection.cs Process.cs :
	  cosmetic attributes cleanup.

	* System.dll.sources : added PerformanceCounterInstanceLifetime.cs
	  and PerformanceCounterCategoryType.cs.


svn path=/trunk/mcs/; revision=83517
2007-08-06 05:40:47 +00:00
Jb Evain ccd11c2531 2007-08-03 Jb Evain <[email protected]>
* Process.cs: disable StartExistCallbackIfNeeded in 2.1.

svn path=/trunk/mcs/; revision=83453
2007-08-03 21:13:42 +00:00