Skip to content
Browse files

Reverting the JNA update as it still crashes PMS on Windows.

  • Loading branch information...
1 parent a4fe3e1 commit a2f3e866b69a676b02ff57e1bae2e53414e9cb49 @Raptor399 Raptor399 committed Apr 2, 2013
Showing with 35 additions and 43 deletions.
  1. +26 −11 pom.xml
  2. +9 −32 src/main/java/net/pms/io/WindowsNamedPipe.java
View
37 pom.xml
@@ -76,7 +76,14 @@
<!-- NSIS needs a version without "-SNAPSHOT" or "-b1" -->
<project.version.short>1.80.0</project.version.short>
- <jna-version>3.5.1</jna-version>
+ <!--
+ 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>
+
<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>
@@ -585,7 +592,7 @@
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.0</version>
+ <version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
@@ -751,12 +758,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
- <version>3.2</version>
+ <version>3.1</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-module-docbook-simple</artifactId>
- <version>1.3</version>
+ <version>1.2</version>
</dependency>
</dependencies>
@@ -766,7 +773,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
- <version>2.6</version>
+ <version>2.4</version>
<reports>
<report>index</report>
<report>dependencies</report>
@@ -780,7 +787,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
- <version>2.14</version>
+ <version>2.5</version>
<configuration>
<showSuccess>false</showSuccess>
</configuration>
@@ -834,29 +841,29 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
- <version>2.5.2</version>
+ <version>2.3.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.10</version>
+ <version>2.8</version>
</plugin>
-->
<!-- Cobertura Test Coverage report -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
- <version>2.5.2</version>
+ <version>2.5.1</version>
</plugin>
<!-- PMD and CPD code analysis report -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
- <version>3.0.1</version>
+ <version>2.6</version>
<configuration>
<linkXref>false</linkXref>
<sourceEncoding>utf-8</sourceEncoding>
@@ -908,7 +915,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
- <version>2.2.1</version>
+ <version>2.2</version>
</plugin>
<plugin>
@@ -934,6 +941,14 @@
</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,26 +18,18 @@
*/
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);
@@ -75,32 +67,17 @@
Kernel32 SYNC_INSTANCE = (Kernel32) Native.synchronizedLibrary(INSTANCE);
- // @see http://msdn.microsoft.com/en-us/library/windows/desktop/aa379560%28v=vs.85%29.aspx
- class LPSECURITY_ATTRIBUTES extends Structure {
+ class SECURITY_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" });
- }
}
- // @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" });
- }
- }
+ public static class LPOVERLAPPED extends Structure { }
Pointer CreateNamedPipeA(String lpName, int dwOpenMode, int dwPipeMode,
int nMaxInstances, int nOutBufferSize, int nInBufferSize,
- int nDefaultTimeOut, LPSECURITY_ATTRIBUTES lpSecurityAttributes
+ int nDefaultTimeOut, SECURITY_ATTRIBUTES lpSecurityAttributes
);
boolean ConnectNamedPipe(Pointer handle, LPOVERLAPPED overlapped);

0 comments on commit a2f3e86

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