How to pass a Environment Pointer to Windows CreateProcess in Java (using jna)
问题 I am calling Kernel32.Instance.CreateProcess to start a detached process. One issue I am facing is attempting to pass a environment block to CreateProcess each time I do the process does not start. I first used Advapi32Util.getEnvironmentBlock(environment) to create the block, then to make a Pointer (needed by CreateProcess ( I used: public static Pointer asPointer(String string) { byte[] data; try { data = Native.toByteArray(string, "UTF-8"); } catch (UnsupportedEncodingException e) { throw