* fhandler.h (fhandler_base::fstat_helper): Declare with additional

dwVolumeSerialNumber argument.  Drop default values for last three
	arguments.
	* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Pass
	dwVolumeSerialNumber from GetFileInformationByHandle to fstat_helper.
	(fhandler_base::fstat_by_name): Pass pc.volser () to fstat_helper.
	Accomodate dropping default values for last three arguments of
	fstat_helper.
	(fhandler_base::fstat_helper): Add dwVolumeSerialNumber argument.
	Use for st_dev member unless 0 in which case pc.volser () is used.
This commit is contained in:
Corinna Vinschen 2005-02-20 16:14:53 +00:00
parent f46ddb818a
commit 4e5a3fa5e2
3 changed files with 27 additions and 7 deletions

View File

@ -1,3 +1,16 @@
2005-02-20 Corinna Vinschen <corinna@vinschen.de>
* fhandler.h (fhandler_base::fstat_helper): Declare with additional
dwVolumeSerialNumber argument. Drop default values for last three
arguments.
* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Pass
dwVolumeSerialNumber from GetFileInformationByHandle to fstat_helper.
(fhandler_base::fstat_by_name): Pass pc.volser () to fstat_helper.
Accomodate dropping default values for last three arguments of
fstat_helper.
(fhandler_base::fstat_helper): Add dwVolumeSerialNumber argument.
Use for st_dev member unless 0 in which case pc.volser () is used.
2005-02-20 Corinna Vinschen <corinna@vinschen.de>
* autoload.cc (FindFirstVolumeA): Add.

View File

@ -250,14 +250,15 @@ class fhandler_base
virtual int __stdcall fstat (struct __stat64 *buf) __attribute__ ((regparm (2)));
int __stdcall fstat_fs (struct __stat64 *buf) __attribute__ ((regparm (2)));
int __stdcall fstat_helper (struct __stat64 *buf,
FILETIME ftCreateionTime,
FILETIME ftCreationTime,
FILETIME ftLastAccessTime,
FILETIME ftLastWriteTime,
DWORD dwVolumeSerialNumber,
DWORD nFileSizeHigh,
DWORD nFileSizeLow,
DWORD nFileIndexHigh = 0,
DWORD nFileIndexLow = 0,
DWORD nNumberOfLinks = 1)
DWORD nFileIndexHigh,
DWORD nFileIndexLow,
DWORD nNumberOfLinks)
__attribute__ ((regparm (3)));
int __stdcall fstat_by_handle (struct __stat64 *buf) __attribute__ ((regparm (2)));
int __stdcall fstat_by_name (struct __stat64 *buf) __attribute__ ((regparm (2)));

View File

@ -114,6 +114,7 @@ fhandler_base::fstat_by_handle (struct __stat64 *buf)
local.ftCreationTime,
local.ftLastAccessTime,
local.ftLastWriteTime,
local.dwVolumeSerialNumber,
local.nFileSizeHigh,
local.nFileSizeLow,
local.nFileIndexHigh,
@ -141,13 +142,17 @@ fhandler_base::fstat_by_name (struct __stat64 *buf)
local.ftCreationTime,
local.ftLastAccessTime,
local.ftLastWriteTime,
pc.volser (),
local.nFileSizeHigh,
local.nFileSizeLow);
local.nFileSizeLow,
0,
0,
1);
}
else if (pc.isdir ())
{
FILETIME ft = {};
res = fstat_helper (buf, ft, ft, ft, 0, 0);
res = fstat_helper (buf, ft, ft, ft, pc.volser (), 0, 0, 0, 0, 1);
}
else
{
@ -213,6 +218,7 @@ fhandler_base::fstat_helper (struct __stat64 *buf,
FILETIME ftCreationTime,
FILETIME ftLastAccessTime,
FILETIME ftLastWriteTime,
DWORD dwVolumeSerialNumber,
DWORD nFileSizeHigh,
DWORD nFileSizeLow,
DWORD nFileIndexHigh,
@ -233,7 +239,7 @@ fhandler_base::fstat_helper (struct __stat64 *buf,
to_timestruc_t (&ftLastAccessTime, &buf->st_atim);
to_timestruc_t (&ftLastWriteTime, &buf->st_mtim);
to_timestruc_t (&ftCreationTime, &buf->st_ctim);
buf->st_dev = pc.volser ();
buf->st_dev = dwVolumeSerialNumber ?: pc.volser ();
buf->st_size = ((_off64_t) nFileSizeHigh << 32) + nFileSizeLow;
/* The number of links to a directory includes the
number of subdirectories in the directory, since all