Fixes 25272 and most likely 25274. r=dougt.

This commit is contained in:
putterman%netscape.com 2000-01-27 20:06:23 +00:00
Родитель 97ca106067
Коммит 14753a4220
1 изменённых файлов: 40 добавлений и 36 удалений

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

@ -136,47 +136,51 @@ MyGetFileAttributesEx(const char* file, WIN32_FILE_ATTRIBUTE_DATA* data)
memset(data, 0, sizeof(WIN32_FILE_ATTRIBUTE_DATA)); memset(data, 0, sizeof(WIN32_FILE_ATTRIBUTE_DATA));
data->dwFileAttributes = GetFileAttributes(file); data->dwFileAttributes = GetFileAttributes(file);
if(! (data->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
{
HANDLE hFile = CreateFile(file,
GENERIC_READ,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
if (hFile != INVALID_HANDLE_VALUE) if(data->dwFileAttributes != 0xFFFFFFFF)
{
if(! (data->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
{ {
okay = GetFileTime(hFile, HANDLE hFile = CreateFile(file,
&data->ftCreationTime, GENERIC_READ,
&data->ftLastAccessTime, FILE_SHARE_READ,
&data->ftLastWriteTime); NULL,
if (okay) OPEN_EXISTING,
{ FILE_ATTRIBUTE_NORMAL,
// Try to obtain hFile's huge size. NULL);
data->nFileSizeLow = GetFileSize (hFile,
&data->nFileSizeHigh);
if (data->nFileSizeLow == 0xFFFFFFFF && if (hFile != INVALID_HANDLE_VALUE)
GetLastError() != NO_ERROR ) {
{ okay = GetFileTime(hFile,
//error in getting filesize &data->ftCreationTime,
okay = PR_FALSE; &data->ftLastAccessTime,
} &data->ftLastWriteTime);
else if (okay)
{ {
okay = PR_TRUE; // Try to obtain hFile's huge size.
} data->nFileSizeLow = GetFileSize (hFile,
&data->nFileSizeHigh);
if (data->nFileSizeLow == 0xFFFFFFFF &&
GetLastError() != NO_ERROR )
{
//error in getting filesize
okay = PR_FALSE;
}
else
{
okay = PR_TRUE;
}
}
CloseHandle(hFile);
} }
CloseHandle(hFile);
} }
} else
else {
{ // it is a directory,
// it is a directory, okay = PR_TRUE;
okay = PR_TRUE; }
} }
} }