using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;

namespace WinAPI
{
    /// <summary>
    /// 
    /// </summary>
   public static class Kernel32
    {
        /// <summary>
        /// 结束进程
        /// </summary>
        /// <param name="handle"></param>
        /// <param name="exitCode"></param>
        /// <returns></returns>
        [DllImport("kernel32")]
        public static extern long TerminateProcess(int handle, int exitCode);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="processAccess"></param>
        /// <param name="bInheritHandle"></param>
        /// <param name="processId"></param>
        /// <returns></returns>
        [DllImport("kernel32.dll")]
        public static extern IntPtr OpenProcess(uint processAccess, bool bInheritHandle, int processId);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="hObject"></param>
        /// <returns></returns>
        [DllImport("kernel32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern bool CloseHandle(IntPtr hObject);
    }
}
