Move MAX_PATH to OS class.
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java
index cb92398..1d7fff2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java
@@ -599,6 +599,7 @@
public static final int LVS_SHAREIMAGELISTS = 0x40;
public static final int LVS_SHOWSELALWAYS = 0x8;
public static final int LVS_SINGLESEL = 0x4;
+ public static final int MAX_PATH = 260;
public static final int MA_NOACTIVATE = 0x3;
public static final int MB_ABORTRETRYIGNORE = 0x2;
public static final int MB_APPLMODAL = 0x0;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FileDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FileDialog.java
index 462c4a6..dbb90f5 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FileDialog.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FileDialog.java
@@ -34,7 +34,6 @@
String [] fileNames = new String [0];
String filterPath = "", fileName = "";
static final String FILTER = "*.*";
- static int MAX_PATH = 260; // maximum file name size 256 + 3 chars for drive + 1 for null
static int BUFFER_SIZE = 1024 * 32;
/**
@@ -190,7 +189,7 @@
* Copy the name into lpstrFile and ensure that the
* last byte is NULL and the buffer does not overrun.
*/
- int nMaxFile = MAX_PATH;
+ int nMaxFile = OS.MAX_PATH;
if ((style & SWT.MULTI) != 0) nMaxFile = Math.max (nMaxFile, BUFFER_SIZE);
int byteCount = nMaxFile * TCHAR.sizeof;
int lpstrFile = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount);
@@ -204,7 +203,7 @@
if (filterPath == null) filterPath = "";
/* Use the character encoding for the default locale */
TCHAR path = new TCHAR (0, filterPath.replace ('/', '\\'), true);
- int byteCount5 = MAX_PATH * TCHAR.sizeof;
+ int byteCount5 = OS.MAX_PATH * TCHAR.sizeof;
int lpstrInitialDir = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount5);
int byteCountDir = Math.min (path.length () * TCHAR.sizeof, byteCount5 - TCHAR.sizeof);
OS.MoveMemory (lpstrInitialDir, path, byteCountDir);