Ejemplo n.º 1
0
		ProcessModule[] GetModules_internal (SafeProcessHandle handle)
		{
			bool release = false;
			try {
				handle.DangerousAddRef (ref release);
				return GetModules_internal (handle.DangerousGetHandle ());
			} finally {
				if (release)
					handle.DangerousRelease ();
			}
		}
Ejemplo n.º 2
0
		static string ProcessName_internal(SafeProcessHandle handle)
		{
			bool release = false;
			try {
				handle.DangerousAddRef (ref release);
				return ProcessName_internal (handle.DangerousGetHandle ());
			} finally {
				if (release)
					handle.DangerousRelease ();
			}
		}
Ejemplo n.º 3
0
		public static bool TerminateProcess (SafeProcessHandle processHandle, int exitCode)
		{
			bool release = false;
			try {
				processHandle.DangerousAddRef (ref release);
				return TerminateProcess (processHandle.DangerousGetHandle (), exitCode);
			} finally {
				if (release)
					processHandle.DangerousRelease ();
			}
		}
Ejemplo n.º 4
0
		public static bool SetPriorityClass(SafeProcessHandle handle, int priorityClass)
		{
			bool release = false;
			try {
				handle.DangerousAddRef (ref release);
				return SetPriorityClass (handle.DangerousGetHandle (), priorityClass);
			} finally {
				if (release)
					handle.DangerousRelease ();
			}
		}
Ejemplo n.º 5
0
		public static bool GetProcessTimes (SafeProcessHandle handle, out long creation, out long exit, out long kernel, out long user)
		{
			bool release = false;
			try {
				handle.DangerousAddRef (ref release);
				return GetProcessTimes (handle.DangerousGetHandle (), out creation, out exit, out kernel, out user);
			} finally {
				if (release)
					handle.DangerousRelease ();
			}
		}
Ejemplo n.º 6
0
		public static bool SetProcessWorkingSetSize (SafeProcessHandle handle, IntPtr min, IntPtr max)
		{
			bool release = false;
			try {
				handle.DangerousAddRef (ref release);
				return SetProcessWorkingSetSize (handle.DangerousGetHandle (), min, max);
			} finally {
				if (release)
					handle.DangerousRelease ();
			}
		}
Ejemplo n.º 7
0
		public static int WaitForInputIdle (SafeProcessHandle handle, int milliseconds)
		{
			bool release = false;
			try {
				handle.DangerousAddRef (ref release);
				return WaitForInputIdle (handle.DangerousGetHandle (), milliseconds);
			} finally {
				if (release)
					handle.DangerousRelease ();
			}
		}