Skip to content
Browse files

Updating library revisions.

  • Loading branch information...
1 parent d631a79 commit f424960936f5246e892102fedcc68f321861cb0a @Raptor399 Raptor399 committed
Showing with 43 additions and 35 deletions.
  1. +11 −26 pom.xml
  2. +32 −9 src/main/java/net/pms/io/WindowsNamedPipe.java
View
37 pom.xml
@@ -76,14 +76,7 @@
<!-- NSIS needs a version without "-SNAPSHOT" or "-b1" -->
<project.version.short>1.80.0</project.version.short>
- <!--
- JNA 3.4.0 solves issue #1152, but causes a bug in Windows.
- The version is therefore overruled in the Windows profile.
- This property should be removed when Windows can use the
- same version.
- -->
- <jna-version>3.4.0</jna-version>
-
+ <jna-version>3.5.1</jna-version>
<cuelib-version>1.2.1-2008-06-13</cuelib-version>
<jgoodies-common-version>1.2.1</jgoodies-common-version>
<jgoodies-forms-version>1.4.2</jgoodies-forms-version>
@@ -592,7 +585,7 @@
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.5.1</version>
+ <version>3.0</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
@@ -758,12 +751,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
- <version>3.1</version>
+ <version>3.2</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-module-docbook-simple</artifactId>
- <version>1.2</version>
+ <version>1.3</version>
</dependency>
</dependencies>
@@ -773,7 +766,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
- <version>2.4</version>
+ <version>2.6</version>
<reports>
<report>index</report>
<report>dependencies</report>
@@ -787,7 +780,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
- <version>2.5</version>
+ <version>2.14</version>
<configuration>
<showSuccess>false</showSuccess>
</configuration>
@@ -841,14 +834,14 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
- <version>2.3.2</version>
+ <version>2.5.2</version>
</plugin>
<!-- Checkstyle report will go out of memory because of the huge amount of issues it finds(!)
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
- <version>2.8</version>
+ <version>2.10</version>
</plugin>
-->
@@ -856,14 +849,14 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
- <version>2.5.1</version>
+ <version>2.5.2</version>
</plugin>
<!-- PMD and CPD code analysis report -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
- <version>2.6</version>
+ <version>3.0.1</version>
<configuration>
<linkXref>false</linkXref>
<sourceEncoding>utf-8</sourceEncoding>
@@ -915,7 +908,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
- <version>2.2</version>
+ <version>2.2.1</version>
</plugin>
<plugin>
@@ -941,14 +934,6 @@
</os>
</activation>
- <properties>
- <!--
- Last known JNA version known not to cause a Java crash
- when browsing folders with files in them on Windows.
- -->
- <jna-version>3.2.5</jna-version>
- </properties>
-
<pluginRepositories>
<pluginRepository>
<id>Codehaus Snapshots</id>
View
41 src/main/java/net/pms/io/WindowsNamedPipe.java
@@ -18,18 +18,26 @@
*/
package net.pms.io;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.PipedInputStream;
+import java.io.PipedOutputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import net.pms.PMS;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import com.sun.jna.Memory;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import com.sun.jna.ptr.IntByReference;
import com.sun.jna.win32.StdCallLibrary;
-import net.pms.PMS;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.*;
-import java.util.ArrayList;
public class WindowsNamedPipe extends Thread implements ProcessWrapper {
private static final Logger LOGGER = LoggerFactory.getLogger(WindowsNamedPipe.class);
@@ -67,17 +75,32 @@
Kernel32 SYNC_INSTANCE = (Kernel32) Native.synchronizedLibrary(INSTANCE);
- class SECURITY_ATTRIBUTES extends Structure {
+ // @see http://msdn.microsoft.com/en-us/library/windows/desktop/aa379560%28v=vs.85%29.aspx
+ class LPSECURITY_ATTRIBUTES extends Structure {
public int nLength = size();
public Pointer lpSecurityDescriptor;
public boolean bInheritHandle;
+
+ @Override
+ protected ArrayList<String> getFieldOrder() {
+ return (ArrayList<String>) Arrays.asList(new String[] { "nLength",
+ "lpSecurityDescriptor", "bInheritHandle" });
+ }
}
- public static class LPOVERLAPPED extends Structure { }
+ // @see http://msdn.microsoft.com/en-us/library/windows/desktop/ms684342%28v=vs.85%29.aspx
+ public static class LPOVERLAPPED extends Structure {
+ @Override
+ protected ArrayList<String> getFieldOrder() {
+ return (ArrayList<String>) Arrays.asList(new String[] {
+ "Internal", "InternalHigh", "Offset", "OffsetHigh",
+ "Pointer", "hEvent" });
+ }
+ }
Pointer CreateNamedPipeA(String lpName, int dwOpenMode, int dwPipeMode,
int nMaxInstances, int nOutBufferSize, int nInBufferSize,
- int nDefaultTimeOut, SECURITY_ATTRIBUTES lpSecurityAttributes
+ int nDefaultTimeOut, LPSECURITY_ATTRIBUTES lpSecurityAttributes
);
boolean ConnectNamedPipe(Pointer handle, LPOVERLAPPED overlapped);

0 comments on commit f424960

Please sign in to comment.
Something went wrong with that request. Please try again.