Re: [fltk.bugs] [LOW] STR #2733: MAX_PATH for filter of Fl_Native_File_Chooser too small on Win32

2011-11-12 Thread Greg Ercolano

[STR Closed w/Resolution]

Link: http://www.fltk.org/str.php?L2733
Version: 1.3-current
Fix Version: 1.3-current (r9174)


Fixed in Subversion repository.


Link: http://www.fltk.org/str.php?L2733
Version: 1.3-current
Fix Version: 1.3-current (r9174)

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [LOW] STR #2733: MAX_PATH for filter of Fl_Native_File_Chooser too small on Win32

2011-10-13 Thread Greg Ercolano

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2733
Version: 1.3.0


Which limit is this, the limit on how many filters (currently 80)
or how large the filter strings can be (1024)?

Agreed there should be no limits on any of it, but want to make sure the
bug you're reporting is solved. (I didn't see any 260 limits on any of our
buffers, so not sure where that's coming from)


Link: http://www.fltk.org/str.php?L2733
Version: 1.3.0

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [LOW] STR #2733: MAX_PATH for filter of Fl_Native_File_Chooser too small on Win32

2011-10-13 Thread Steve Maas

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2733
Version: 1.3.0


In the file Fl_Native_File_Chooser.cxx, line 333.

static WCHAR wpattern[MAX_PATH];

MAX_PATH is defined in WinDef.h as 260. It is this buffer I need
increased. 

Thanks,

Steve.


Link: http://www.fltk.org/str.php?L2733
Version: 1.3.0

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [LOW] STR #2733: MAX_PATH for filter of Fl_Native_File_Chooser too small on Win32

2011-10-13 Thread Steve Maas

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2733
Version: 1.3.0


Sorry, that's in file Fl_Native_File_Chooser_WIN32.cxx.


Link: http://www.fltk.org/str.php?L2733
Version: 1.3.0

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [LOW] STR #2733: MAX_PATH for filter of Fl_Native_File_Chooser too small on Win32

2011-10-13 Thread Greg Ercolano

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2733
Version: 1.3.0


I see.. subject line has the details about MAX_PATH which I missed.
I was only looking at the STR's body.

Wow, the OS's own setting for MAX_PATH is 260? Good grief.
OK, seems this page covers the details:

http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx#maxpath

..which seems to reduce to:

   260   -- for 'local' drive letter paths (eg. c:\bla..)
   32767 -- for 'extended' paths (eg. \\?\D:\bla\bla..)

I imagine UNC paths qualify for the latter as well
(eg. \\server\volname\bla..)

Will probably have to make our own macro and set it to 32767
to get past this, but I'll check if it's possible to use dynamic
arrays.

FWIW, quoting the relevant info from the above link in case it goes stale:

In the Windows API (with some exceptions discussed in the
following paragraphs), the maximum length for a path is
MAX_PATH, which is defined as 260 characters. A local path
is structured in the following order: drive letter, colon,
backslash, name components separated by backslashes,
and a terminating null character. For example, the maximum
path on drive D is D:\some 256-character path stringNUL [..]

The Windows API has many functions that also have Unicode
versions to permit an extended-length path for a maximum
total path length of 32,767 characters. This type of path
is composed of components separated by backslashes, each
up to the value returned in the lpMaximumComponentLength
parameter of the GetVolumeInformation function (this value
is commonly 255 characters). To specify an extended-length
path, use the \\?\ prefix. For example, \\?\D:\very long path.

Sounds like we'll have to hard code the 32767.


Link: http://www.fltk.org/str.php?L2733
Version: 1.3.0

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [LOW] STR #2733: MAX_PATH for filter of Fl_Native_File_Chooser too small on Win32

2011-10-13 Thread Steve Maas

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2733
Version: 1.3.0


Hi Greg,

Thanks for your repsonse. A buffer of size 32767 will be more than enough
for my application.

Thanks,

Steve.


Link: http://www.fltk.org/str.php?L2733
Version: 1.3.0

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [LOW] STR #2733: MAX_PATH for filter of Fl_Native_File_Chooser too small on Win32

2011-10-13 Thread Greg Ercolano

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2733
Version: 1.3.0


For your short term needs, I'd suggest modifying
Fl_Native_File_Chooser_WIN32.cxx and change all instances of MAX_PATH with
FNFC_MAX_PATH, and define that with:

#define FNFC_MAX_PATH 32767

Meanwhile, I'll see if I can get rid of hard coded char arrays to avoid
having 32k strings all over the place. For instance I know fixed strings
like this:

  char oldcwd[MAX_PATH];
  GetCurrentDirectory(MAX_PATH, oldcwd);

..can be avoided, and replaced with:

  char *oldcwd = 0;
  DWORD oldcwdsz = GetCurrentDirectory(0,0);
  if ( oldcwdsz  0 ) {
if (GetCurrentDirectory(oldcwdsz, oldcwd) == 0 ) {
  ..error..
} 
  }

  [..]

  if ( oldcwd ) {
SetCurrentDirectory(oldcwd);
delete [] oldcwd; oldcwd = 0;
  }

..but doing such changes to the rest of the code will take some time I
don't have at the moment. Will follow up when I have some time to look at
this more.


Link: http://www.fltk.org/str.php?L2733
Version: 1.3.0

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs