multiple file open can fail for multiple files.

it will still fail, but now it will take a lot more,
since we're using a bigger buffer.

an example: multiple file attach to the compose window.

r/sr/a=sspitzer
This commit is contained in:
scott%scott-macgregor.org 2003-09-04 00:33:48 +00:00
Родитель 891e05f8b0
Коммит 2a81605580
3 изменённых файлов: 11 добавлений и 11 удалений

Просмотреть файл

@ -82,14 +82,6 @@ nsFilePicker::~nsFilePicker()
NS_IF_RELEASE(mUnicodeDecoder);
}
// we used to use MAX_PATH
// which works great for one file
// but for multiple files, the format is
// dirpath\0\file1\0file2\0...filen\0\0
// and that can quickly be more than MAX_PATH (260)
// see bug #172001 for more details
#define FILE_BUFFER_SIZE 4096
//-------------------------------------------------------------------------
//
// Show - Display the file dialog

Просмотреть файл

@ -220,7 +220,7 @@ BOOL CallOpenSaveFileNameA(LPOPENFILENAMEW aFileNameW, BOOL aOpen)
OPENFILENAMEA ofnA;
char filterA[MAX_FILTER_NAME+2];
char customFilterA[MAX_FILTER_NAME+1];
char fileA[MAX_PATH+1];
char fileA[FILE_BUFFER_SIZE+1];
char fileTitleA[MAX_PATH+1];
char initDirA[MAX_PATH+1];
char titleA[MAX_PATH+1];
@ -256,9 +256,9 @@ BOOL CallOpenSaveFileNameA(LPOPENFILENAMEW aFileNameW, BOOL aOpen)
}
ofnA.nFilterIndex = aFileNameW->nFilterIndex; // Index of pair of filter strings. Should be ok.
if (aFileNameW->lpstrFile) {
ConvertWtoA(aFileNameW->lpstrFile, MAX_PATH, fileA);
ConvertWtoA(aFileNameW->lpstrFile, FILE_BUFFER_SIZE, fileA);
ofnA.lpstrFile = fileA;
ofnA.nMaxFile = MAX_PATH;
ofnA.nMaxFile = FILE_BUFFER_SIZE;
if (strlen(fileA)) {
// find last file offset
ofnA.nFileOffset = strrchr(fileA, '\\') - fileA + 1;

Просмотреть файл

@ -48,6 +48,14 @@ struct IActiveIMMApp;
struct MethodInfo;
class nsIEventQueue;
// we used to use MAX_PATH
// which works great for one file
// but for multiple files, the format is
// dirpath\0\file1\0file2\0...filen\0\0
// and that can quickly be more than MAX_PATH (260)
// see bug #172001 for more details
#define FILE_BUFFER_SIZE 4096
/**
* Wrapper around the thread running the message pump.