private static Long windowsProcessId(Process process) {
		if (process.getClass().getName().equals("java.lang.Win32Process")
				|| process.getClass().getName().equals("java.lang.ProcessImpl")) {
			/* determine the pid on windows plattforms */
			try {
				Field f = process.getClass().getDeclaredField("handle");
				f.setAccessible(true);
				long handl = f.getLong(process);

				Kernel32 kernel = Kernel32.INSTANCE;
				WinNT.HANDLE handle = new WinNT.HANDLE();
				handle.setPointer(Pointer.createConstant(handl));
				int ret = kernel.GetProcessId(handle);
				logger.debug("Detected pid: {}", ret);
				return (long) ret;
			} catch (Throwable e) {
				e.printStackTrace();
			}
		}
		return null;
	}
private static Long windowsProcessId ( Process process ) { if ( process . getClass ( ) . getName ( ) . equals ( "java.lang.Win32Process" ) || process . getClass ( ) . getName ( ) . equals ( "java.lang.ProcessImpl" ) ) { try { Field f = process . getClass ( ) . getDeclaredField ( "handle" ) ; f . setAccessible ( true ) ; long handl = f . getLong ( process ) ; Kernel32 kernel = Kernel32 . INSTANCE ; WinNT . HANDLE handle = new WinNT . HANDLE ( ) ; handle . setPointer ( Pointer . createConstant ( handl ) ) ; int ret = kernel . GetProcessId ( handle ) ; logger . debug ( "Detected pid: {}" , ret ) ; return ( long ) ret ; } catch ( Throwable e ) { e . printStackTrace ( ) ; } } return null ; }
@see http://www.golesny.de/p/code/javagetpid

@return