com.sun.jna.platform.win32.WinNT.HANDLE Java Examples

The following examples show how to use com.sun.jna.platform.win32.WinNT.HANDLE. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WinUtil.java    From SikuliX1 with MIT License 6 votes vote down vote up
private static String getProcessImageName(int pid) {
  HANDLE hProcess = Kernel32.INSTANCE.OpenProcess(
      0x1000,
      false,
      pid);

  if (hProcess != null) {
    try {
      char[] imageNameChars = new char[1024];
      IntByReference imageNameLen
          = new IntByReference(imageNameChars.length);
      if (Kernel32.INSTANCE.QueryFullProcessImageName(hProcess, 0, imageNameChars, imageNameLen)) {
        String name = FilenameUtils.getName(new String(imageNameChars, 0, imageNameLen.getValue()));
        return name;
      }
      return null;
    } finally {
      Kernel32.INSTANCE.CloseHandle(hProcess);
    }
  }
  return null;
}
 
Example #2
Source File: JNAScreenshot.java    From sc2gears with Apache License 2.0 6 votes vote down vote up
@Override
public BufferedImage getScreenshot() {
	final HANDLE oldBitmap = GDI.SelectObject( blitDC, outputBitmap );
	try {
		GDI.BitBlt( blitDC, 0, 0, screenArea.width, screenArea.height, windowDC, screenArea.x, screenArea.y, GDI32.SRCCOPY );
	} finally {
		GDI.SelectObject( blitDC, oldBitmap );
	}
	
	final boolean ok = GDI.GetDIBits( blitDC, outputBitmap, 0, screenArea.height, (byte[]) null, bi, WinGDI.DIB_RGB_COLORS );
	
	if ( ok ) {
		final BITMAPINFOHEADER bih = bi.bmiHeader;
		bih.biHeight      = -Math.abs( bih.biHeight );
		bih.biCompression = 0;
		
		return bufferedImageFromBitmap( blitDC, outputBitmap );
	}
	else
		return null;
}
 
Example #3
Source File: WinUtil.java    From SikuliX1 with MIT License 6 votes vote down vote up
public static List<ProcessInfo> allProcesses() {
  List<ProcessInfo> processList = new ArrayList<ProcessInfo>();

  HANDLE snapshot = Kernel32.INSTANCE.CreateToolhelp32Snapshot(
      Tlhelp32.TH32CS_SNAPPROCESS, new DWORD(0));

  try {
    Tlhelp32.PROCESSENTRY32.ByReference pe
        = new Tlhelp32.PROCESSENTRY32.ByReference();
    for (boolean more = Kernel32.INSTANCE.Process32First(snapshot, pe);
         more;
         more = Kernel32.INSTANCE.Process32Next(snapshot, pe)) {
      int pid = pe.th32ProcessID.intValue();
      String name = getProcessImageName(pe.th32ProcessID.intValue());
      if (null == name) {
        continue;
      }
      processList.add(new ProcessInfo(pid, name));
    }
    return processList;
  } finally {
    Kernel32.INSTANCE.CloseHandle(snapshot);
  }
}
 
Example #4
Source File: SharedMemorySocket.java    From mariadb-connector-j with GNU Lesser General Public License v2.1 6 votes vote down vote up
@Override
public int read(byte[] bytes, int off, int count) throws IOException {
  HANDLE[] handles = {serverWrote, connectionClosed};
  if (bytesLeft == 0) {
    int index = Kernel32.INSTANCE.WaitForMultipleObjects(2, handles, false, timeout);
    if (index == -1) {
      throw new IOException("wait failed, timeout");
    } else if (index == 1) {
      // Connection closed
      throw new IOException("Server closed connection");
    } else if (index != 0) {
      throw new IOException("Unexpected return result from WaitForMultipleObjects : " + index);
    }
    bytesLeft = view.getInt(0);
    position = 4;
  }
  int len = Math.min(count, bytesLeft);
  view.read(position, bytes, off, len);
  position += len;
  bytesLeft -= len;
  if (bytesLeft == 0) {
    Kernel32.INSTANCE.SetEvent(clientRead);
  }
  return len;
}
 
Example #5
Source File: SharedMemorySocket.java    From mariadb-connector-j with GNU Lesser General Public License v2.1 6 votes vote down vote up
private HANDLE lockMutex() throws IOException {
  PointerByReference securityDescriptor = new PointerByReference();
  Advapi32.INSTANCE.ConvertStringSecurityDescriptorToSecurityDescriptor(
      EVERYONE_SYNCHRONIZE_SDDL, 1, securityDescriptor, null);
  Advapi32.SECURITY_ATTRIBUTES sa = new Advapi32.SECURITY_ATTRIBUTES();
  sa.nLength = sa.size();
  sa.lpSecurityDescriptor = securityDescriptor.getValue();
  sa.bInheritHandle = false;
  HANDLE mutex = Kernel32.INSTANCE.CreateMutex(sa, false, memoryName + "_CONNECT_MUTEX");
  Kernel32.INSTANCE.LocalFree(securityDescriptor.getValue());
  if (Kernel32.INSTANCE.WaitForSingleObject(mutex, timeout) == -1) {
    Kernel32.INSTANCE.CloseHandle(mutex);
    throw new IOException(
        "wait failed (timeout, last error =  " + Kernel32.INSTANCE.GetLastError());
  }
  return mutex;
}
 
Example #6
Source File: SharedMemorySocket.java    From mariadb-connector-j with GNU Lesser General Public License v2.1 6 votes vote down vote up
@Override
public void close() {

  if (connectionClosed != null
      && Kernel32.INSTANCE.WaitForSingleObject(connectionClosed, 0) != 0) {
    /* Set close event if not yet set */
    Kernel32.INSTANCE.SetEvent(connectionClosed);
  }
  HANDLE[] handles = {serverRead, serverWrote, clientRead, clientWrote, connectionClosed};
  for (HANDLE h : handles) {
    if (h != null) {
      Kernel32.INSTANCE.CloseHandle(h);
    }
  }
  if (view != null) {
    Kernel32.INSTANCE.UnmapViewOfFile(view);
  }
  serverRead = null;
  serverWrote = null;
  clientRead = null;
  clientWrote = null;
  connectionClosed = null;
  view = null;
}
 
Example #7
Source File: WindowsNamedPipe.java    From buck with Apache License 2.0 6 votes vote down vote up
/** Creates a Windows named pipe bound to a path */
public static WindowsNamedPipe createPipeWithPath(String path) throws IOException {
  HANDLE pipeHandle =
      api.CreateFile(
          path,
          WinNT.GENERIC_READ | WinNT.GENERIC_WRITE,
          0,
          null,
          WinNT.OPEN_EXISTING,
          WinNT.FILE_FLAG_OVERLAPPED,
          null);
  if (WinNT.INVALID_HANDLE_VALUE.equals(pipeHandle)) {
    throw new IOException(
        "Failed to open a named pipe " + path + " error: " + api.GetLastError());
  }
  return new WindowsNamedPipe(pipeHandle, createEvent(), createEvent());
}
 
Example #8
Source File: Win32ProcessTools.java    From jpexs-decompiler with GNU General Public License v3.0 5 votes vote down vote up
private static boolean unsetGuard(HANDLE hOtherProcess, MEMORY_BASIC_INFORMATION mbi) {
    if (!hasGuard(mbi)) {
        return true;
    }
    int oldProt = mbi.protect.intValue();
    int newProt = oldProt - WinNT.PAGE_GUARD;
    IntByReference oldProtRef = new IntByReference();
    boolean ok = Kernel32.INSTANCE.VirtualProtectEx(hOtherProcess, new WinDef.LPVOID(pointerToAddress(mbi.baseAddress)), mbi.regionSize, newProt, oldProtRef);
    if (ok) {
        mbi.protect = new NativeLong(newProt);
        return true;
    }
    return false;
}
 
Example #9
Source File: SharedMemorySocket.java    From mariadb-connector-j with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public void write(byte[] bytes, int off, int count) throws IOException {
  int bytesToWrite = count;
  int buffPos = off;
  HANDLE[] handles = {serverRead, connectionClosed};
  while (bytesToWrite > 0) {
    int index = Kernel32.INSTANCE.WaitForMultipleObjects(2, handles, false, timeout);
    if (index == -1) {
      // wait failed,  probably timeout
      throw new IOException("WaitForMultipleObjects() failed, timeout");
    } else if (index == 1) {
      // Connection closed
      throw new IOException("Server closed connection");
    } else if (index != 0) {
      throw new IOException("Unexpected return result from WaitForMultipleObjects : " + index);
    }

    int chunk = Math.min(bytesToWrite, BUFFERLEN);
    view.setInt(0, chunk);
    view.write(4, bytes, buffPos, chunk);
    buffPos += chunk;
    bytesToWrite -= chunk;
    if (!Kernel32.INSTANCE.SetEvent(clientWrote)) {
      throw new IOException("SetEvent failed");
    }
  }
}
 
Example #10
Source File: OrigJNAScreenShot.java    From sc2gears with Apache License 2.0 5 votes vote down vote up
public static BufferedImage getScreenshot( final Rectangle bounds ) {
	HDC windowDC = GDI.GetDC( USER.GetDesktopWindow() );
	HBITMAP outputBitmap = GDI.CreateCompatibleBitmap( windowDC, bounds.width, bounds.height );
	try {
		HDC blitDC = GDI.CreateCompatibleDC( windowDC );
		try {
			HANDLE oldBitmap = GDI.SelectObject( blitDC, outputBitmap );
			try {
				GDI.BitBlt( blitDC, 0, 0, bounds.width, bounds.height, windowDC, bounds.x, bounds.y, GDI32.SRCCOPY );
			} finally {
				GDI.SelectObject( blitDC, oldBitmap );
			}
			BITMAPINFO bi = new BITMAPINFO( 40 );
			bi.bmiHeader.biSize = 40;
			boolean ok = GDI.GetDIBits( blitDC, outputBitmap, 0, bounds.height, (byte[]) null, bi, WinGDI.DIB_RGB_COLORS );
			if ( ok ) {
				BITMAPINFOHEADER bih = bi.bmiHeader;
				bih.biHeight = -Math.abs( bih.biHeight );
				bi.bmiHeader.biCompression = 0;
				return bufferedImageFromBitmap( blitDC, outputBitmap, bi );
			} else
				return null;
		} finally {
			GDI.DeleteObject( blitDC );
		}
	} finally {
		GDI.DeleteObject( outputBitmap );
	}
}
 
Example #11
Source File: Win32ProcessTools.java    From jpexs-decompiler with GNU General Public License v3.0 5 votes vote down vote up
private static boolean setGuard(HANDLE hOtherProcess, MEMORY_BASIC_INFORMATION mbi) {
    if (hasGuard(mbi)) {
        return true;
    }
    int oldProt = mbi.protect.intValue();
    int newProt = oldProt | WinNT.PAGE_GUARD;
    IntByReference oldProtRef = new IntByReference();
    boolean ok = Kernel32.INSTANCE.VirtualProtectEx(hOtherProcess, new WinDef.LPVOID(pointerToAddress(mbi.baseAddress)), mbi.regionSize, newProt, oldProtRef);
    if (ok) {
        mbi.protect = new NativeLong(newProt);
        return true;
    }
    return false;
}
 
Example #12
Source File: Win32ProcessTools.java    From jpexs-decompiler with GNU General Public License v3.0 5 votes vote down vote up
public static boolean adjustPrivileges() {

        WinNT.TOKEN_PRIVILEGES tp = new WinNT.TOKEN_PRIVILEGES(1);
        WinNT.TOKEN_PRIVILEGES oldtp = new WinNT.TOKEN_PRIVILEGES(1);
        WinNT.LUID luid = new WinNT.LUID();
        WinNT.HANDLEByReference hTokenRef = new WinNT.HANDLEByReference();
        if (!Advapi32.INSTANCE.OpenProcessToken(Kernel32.INSTANCE.GetCurrentProcess(), WinNT.TOKEN_ADJUST_PRIVILEGES | WinNT.TOKEN_QUERY, hTokenRef)) {
            return false;
        }
        WinNT.HANDLE hToken = hTokenRef.getValue();
        if (!Advapi32.INSTANCE.LookupPrivilegeValue(null, WinNT.SE_DEBUG_NAME, luid)) {
            Kernel32.INSTANCE.CloseHandle(hToken);
            return false;
        }

        tp.PrivilegeCount = new WinDef.DWORD(1);
        tp.Privileges = new WinNT.LUID_AND_ATTRIBUTES[1];
        tp.Privileges[0] = new WinNT.LUID_AND_ATTRIBUTES(luid, new WinDef.DWORD(WinNT.SE_PRIVILEGE_ENABLED));

        IntByReference retSize = new IntByReference(0);
        if (!Advapi32.INSTANCE.AdjustTokenPrivileges(hToken, false, tp, tp.size(), oldtp, retSize)) {
            Kernel32.INSTANCE.CloseHandle(hToken);
            return false;
        }
        Kernel32.INSTANCE.CloseHandle(hToken);
        privAdjusted = true;
        return true;
    }
 
Example #13
Source File: SharedMemorySocket.java    From mariadb-connector-j with GNU Lesser General Public License v2.1 5 votes vote down vote up
Pointer MapViewOfFile(
HANDLE hFileMappingObject,
int dwDesiredAccess,
int dwFileOffsetHigh,
int dwFileOffsetLow,
SIZE_T dwNumberOfBytesToMap)
throws LastErrorException;
 
Example #14
Source File: SharedMemorySocket.java    From mariadb-connector-j with GNU Lesser General Public License v2.1 5 votes vote down vote up
private int getConnectNumber() throws IOException {
  HANDLE connectRequest;
  try {
    connectRequest = openEvent(memoryName + "_CONNECT_REQUEST");
  } catch (LastErrorException lee) {
    try {
      connectRequest = openEvent("Global\\" + memoryName + "_CONNECT_REQUEST");
      memoryName = "Global\\" + memoryName;
    } catch (LastErrorException lee2) {
      throw new IOException("getConnectNumber() fails : " + lee2.getMessage() + " " + memoryName);
    }
  }

  HANDLE connectAnswer = openEvent(memoryName + "_CONNECT_ANSWER");

  HANDLE mutex = lockMutex();
  Pointer connectData = null;
  try {
    Kernel32.INSTANCE.SetEvent(connectRequest);
    connectData = mapMemory(memoryName + "_CONNECT_DATA", Kernel32.FILE_MAP_READ, 4);
    int ret = Kernel32.INSTANCE.WaitForSingleObject(connectAnswer, timeout);
    if (ret != 0) {
      throw new IOException(
          "WaitForSingleObject returned "
              + ret
              + ", last error "
              + Kernel32.INSTANCE.GetLastError());
    }
    return connectData.getInt(0);
  } finally {
    Kernel32.INSTANCE.ReleaseMutex(mutex);
    Kernel32.INSTANCE.CloseHandle(mutex);
    if (connectData != null) {
      Kernel32.INSTANCE.UnmapViewOfFile(connectData);
    }
    Kernel32.INSTANCE.CloseHandle(connectRequest);
    Kernel32.INSTANCE.CloseHandle(connectAnswer);
  }
}
 
Example #15
Source File: WindowsNamedPipe.java    From buck with Apache License 2.0 5 votes vote down vote up
private WindowsNamedPipe(HANDLE pipeHandle, HANDLE readerWaitable, HANDLE writerWaitable) {
  this.pipeHandle = pipeHandle;
  this.readerWaitable = readerWaitable;
  this.writerWaitable = writerWaitable;
  this.in = new NamedPipeInputStream();
  this.out = new NamedPipeOutputStream();
}
 
Example #16
Source File: WindowsNamedPipe.java    From buck with Apache License 2.0 5 votes vote down vote up
private static HANDLE createEvent() throws IOException {
  HANDLE event = api.CreateEvent(null, true, false, null);
  if (event == null) {
    throw new IOException("CreateEvent() failed. Error: " + api.GetLastError());
  }
  return event;
}
 
Example #17
Source File: OSUtils.java    From SWET with MIT License 5 votes vote down vote up
public static String getDesktopPath() {
	HWND hwndOwner = null;
	int nFolder = Shell32.CSIDL_DESKTOPDIRECTORY;
	HANDLE hToken = null;
	int dwFlags = Shell32.SHGFP_TYPE_CURRENT;
	char[] pszPath = new char[Shell32.MAX_PATH];
	int hResult = Shell32.INSTANCE.SHGetFolderPath(hwndOwner, nFolder, hToken,
			dwFlags, pszPath);
	if (Shell32.S_OK == hResult) {
		String path = new String(pszPath);
		return (path.substring(0, path.indexOf('\0')));
	} else {
		return String.format("%s\\Desktop", System.getProperty("user.home"));
	}
}
 
Example #18
Source File: WindowsConsoleOutputStream.java    From lanterna with GNU Lesser General Public License v3.0 4 votes vote down vote up
public HANDLE getHandle() {
	return hConsoleOutput;
}
 
Example #19
Source File: SharedMemorySocket.java    From mariadb-connector-j with GNU Lesser General Public License v2.1 4 votes vote down vote up
private static HANDLE openEvent(String name) {
  return Kernel32.INSTANCE.OpenEvent(
      Kernel32.EVENT_MODIFY_STATE | Kernel32.SYNCHRONIZE, false, name);
}
 
Example #20
Source File: SharedMemorySocket.java    From mariadb-connector-j with GNU Lesser General Public License v2.1 4 votes vote down vote up
HANDLE OpenFileMapping(int dwDesiredAccess, boolean bInheritHandle, String name)
throws LastErrorException;
 
Example #21
Source File: WindowsConsoleInputStream.java    From lanterna with GNU Lesser General Public License v3.0 4 votes vote down vote up
public WindowsConsoleInputStream(HANDLE hConsoleInput, Charset encoderCharset) {
	this.hConsoleInput = hConsoleInput;
	this.encoderCharset = encoderCharset;
}
 
Example #22
Source File: SharedMemorySocket.java    From mariadb-connector-j with GNU Lesser General Public License v2.1 4 votes vote down vote up
int WaitForMultipleObjects(int count, HANDLE[] handles, boolean waitAll, int millis)
throws LastErrorException;
 
Example #23
Source File: SharedMemorySocket.java    From mariadb-connector-j with GNU Lesser General Public License v2.1 4 votes vote down vote up
HANDLE OpenEvent(int dwDesiredAccess, boolean bInheritHandle, String name)
throws LastErrorException;
 
Example #24
Source File: WindowsConsoleInputStream.java    From lanterna with GNU Lesser General Public License v3.0 4 votes vote down vote up
public HANDLE getHandle() {
	return hConsoleInput;
}
 
Example #25
Source File: WindowsConsoleOutputStream.java    From lanterna with GNU Lesser General Public License v3.0 4 votes vote down vote up
public WindowsConsoleOutputStream(HANDLE hConsoleOutput, Charset decoderCharset) {
	this.hConsoleOutput = hConsoleOutput;
	this.decoderCharset = decoderCharset;
}
 
Example #26
Source File: Win32ProcessTools.java    From jpexs-decompiler with GNU General Public License v3.0 4 votes vote down vote up
public ProcessMemoryInputStream(List<MEMORY_BASIC_INFORMATION> pages, HANDLE hOtherProcess, int currentPage, long pagePos) {
    this.pages = pages;
    this.hOtherProcess = hOtherProcess;
    this.currentPage = currentPage;
    this.pagePos = pagePos;
}
 
Example #27
Source File: Win32ProcessTools.java    From jpexs-decompiler with GNU General Public License v3.0 4 votes vote down vote up
public static boolean drawIcon(BufferedImage ret, WinDef.HICON hIcon, int diFlags) {

        WinDef.HDC hdcScreen = User32.INSTANCE.GetDC(null);
        WinDef.HDC hdcMem = Gdi32.INSTANCE.CreateCompatibleDC(hdcScreen);

        WinDef.HBITMAP bitmap = Gdi32.INSTANCE.CreateCompatibleBitmap(hdcScreen, ret.getWidth(), ret.getHeight());

        WinNT.HANDLE hbmOld = Gdi32.INSTANCE.SelectObject(hdcMem, bitmap);

        WinNT.HANDLE hBrush = Gdi32.INSTANCE.CreateSolidBrush(new WinDef.DWORD(0xffffff));
        WinDef.RECT rect = new WinDef.RECT();
        rect.left = 0;
        rect.top = 0;
        rect.right = ret.getWidth();
        rect.bottom = ret.getHeight();
        User32.INSTANCE.FillRect(hdcMem, rect, hBrush);
        Gdi32.INSTANCE.DeleteObject(hBrush);

        boolean ok = User32.INSTANCE.DrawIconEx(hdcMem, 0, 0, hIcon, ret.getWidth(), ret.getHeight(), new WinDef.UINT(0), new WinDef.HBRUSH(Pointer.NULL), diFlags);

        if (!ok) {
            return false;
        }

        for (int x = 0; x < ret.getWidth(); x++) {
            for (int y = 0; y < ret.getHeight(); y++) {
                int rgb = Gdi32.INSTANCE.GetPixel(hdcMem, x, y).intValue();
                int r = (rgb >> 16) & 0xff;
                int g = (rgb >> 8) & 0xff;
                int b = (rgb) & 0xff;
                rgb = (b << 16) + (g << 8) + r;
                ret.setRGB(x, y, rgb);
            }
        }

        Gdi32.INSTANCE.SelectObject(hdcMem, hbmOld);
        Gdi32.INSTANCE.DeleteObject(bitmap);
        Gdi32.INSTANCE.DeleteDC(hdcMem);
        User32.INSTANCE.ReleaseDC(null, hdcScreen);
        return true;
    }
 
Example #28
Source File: WindowsNamedPipe.java    From buck with Apache License 2.0 4 votes vote down vote up
private static WinBase.OVERLAPPED createOverlapped(WinNT.HANDLE event) {
  WinBase.OVERLAPPED olap = new WinBase.OVERLAPPED();
  olap.hEvent = event;
  olap.write();
  return olap;
}
 
Example #29
Source File: User32RW.java    From Flashtool with GNU General Public License v3.0 4 votes vote down vote up
int MsgWaitForMultipleObjects(int nCount, HANDLE[] pHandles,
boolean bWaitAll, int dwMilliseconds, int dwWakeMask);
 
Example #30
Source File: Advapi32.java    From jpexs-decompiler with GNU General Public License v3.0 3 votes vote down vote up
/**
 * Creates a new process and its primary thread. The new process runs in the
 * security context of the user represented by the specified token.
 *
 * Typically, the process that calls the CreateProcessAsUser function must
 * have the SE_INCREASE_QUOTA_NAME privilege and may require the
 * SE_ASSIGNPRIMARYTOKEN_NAME privilege if the token is not assignable. If
 * this function fails with ERROR_PRIVILEGE_NOT_HELD (1314), use the
 * CreateProcessWithLogonW function instead. CreateProcessWithLogonW
 * requires no special privileges, but the specified user account must be
 * allowed to log on interactively. Generally, it is best to use
 * CreateProcessWithLogonW to create a process with alternate credentials.
 *
 * @param hToken A handle to the primary token that represents a user.
 * @param lpApplicationName The name of the module to be executed.
 * @param lpCommandLine The command line to be executed.
 * @param lpProcessAttributes A pointer to a SECURITY_ATTRIBUTES structure
 * that specifies a security descriptor for the new process object and
 * determines whether child processes can inherit the returned handle to the
 * process.
 * @param lpThreadAttributes A pointer to a SECURITY_ATTRIBUTES structure
 * that specifies a security descriptor for the new thread object and
 * determines whether child processes can inherit the returned handle to the
 * thread.
 * @param bInheritHandles If this parameter is TRUE, each inheritable handle
 * in the calling process is inherited by the new process. If the parameter
 * is FALSE, the handles are not inherited. Note that inherited handles have
 * the same value and access rights as the original handles.
 * @param dwCreationFlags The flags that control the priority class and the
 * creation of the process. For a list of values, see Process Creation
 * Flags.
 * @param lpEnvironment A pointer to an environment block for the new
 * process. If this parameter is NULL, the new process uses the environment
 * of the calling process.
 *
 * An environment block consists of a null-terminated block of
 * null-terminated strings. Each string is in the following form:
 * name=value\0
 * @param lpCurrentDirectory The full path to the current directory for the
 * process. The string can also specify a UNC path.
 * @param lpStartupInfo A pointer to a STARTUPINFO or STARTUPINFOEX
 * structure.
 * @param lpProcessInformation A pointer to a PROCESS_INFORMATION structure
 * that receives identification information about the new process.
 * @return If the function succeeds, the return value is nonzero. If the
 * function fails, the return value is zero. To get extended error
 * information, call GetLastError.
 */
public boolean CreateProcessAsUser(
        HANDLE hToken,
        String lpApplicationName,
        String lpCommandLine,
        SECURITY_ATTRIBUTES lpProcessAttributes,
        SECURITY_ATTRIBUTES lpThreadAttributes,
        boolean bInheritHandles,
        int dwCreationFlags,
        String lpEnvironment,
        String lpCurrentDirectory,
        WinBase.STARTUPINFO lpStartupInfo,
        WinBase.PROCESS_INFORMATION lpProcessInformation);