mirror of
https://github.com/reactos/reactos.git
synced 2025-01-01 20:13:23 +00:00
don't copy LARGE_INTEGER structs to FILETIME structs with memcpy, it works but it's confusing as they're different structures that happen to be identical.
svn path=/trunk/; revision=10792
This commit is contained in:
parent
b1d9a8f8ff
commit
a961785e1d
2 changed files with 57 additions and 42 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: file.c,v 1.56 2004/07/24 01:27:54 navaraf Exp $
|
/* $Id: file.c,v 1.57 2004/09/06 15:56:25 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS system libraries
|
* PROJECT: ReactOS system libraries
|
||||||
|
@ -623,9 +623,15 @@ GetFileInformationByHandle(HANDLE hFile,
|
||||||
}
|
}
|
||||||
|
|
||||||
lpFileInformation->dwFileAttributes = (DWORD)FileBasic.FileAttributes;
|
lpFileInformation->dwFileAttributes = (DWORD)FileBasic.FileAttributes;
|
||||||
memcpy(&lpFileInformation->ftCreationTime,&FileBasic.CreationTime,sizeof(LARGE_INTEGER));
|
|
||||||
memcpy(&lpFileInformation->ftLastAccessTime,&FileBasic.LastAccessTime,sizeof(LARGE_INTEGER));
|
lpFileInformation->ftCreationTime.dwHighDateTime = FileBasic.CreationTime.u.HighPart;
|
||||||
memcpy(&lpFileInformation->ftLastWriteTime, &FileBasic.LastWriteTime,sizeof(LARGE_INTEGER));
|
lpFileInformation->ftCreationTime.dwLowDateTime = FileBasic.CreationTime.u.LowPart;
|
||||||
|
|
||||||
|
lpFileInformation->ftLastAccessTime.dwHighDateTime = FileBasic.LastAccessTime.u.HighPart;
|
||||||
|
lpFileInformation->ftLastAccessTime.dwLowDateTime = FileBasic.LastAccessTime.u.LowPart;
|
||||||
|
|
||||||
|
lpFileInformation->ftLastWriteTime.dwHighDateTime = FileBasic.LastWriteTime.u.HighPart;
|
||||||
|
lpFileInformation->ftLastWriteTime.dwLowDateTime = FileBasic.LastWriteTime.u.LowPart;
|
||||||
|
|
||||||
errCode = NtQueryInformationFile(hFile,
|
errCode = NtQueryInformationFile(hFile,
|
||||||
&IoStatusBlock,
|
&IoStatusBlock,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: find.c,v 1.45 2004/08/28 22:07:51 navaraf Exp $
|
/* $Id: find.c,v 1.46 2004/09/06 15:56:25 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS system libraries
|
* PROJECT: ReactOS system libraries
|
||||||
|
@ -350,15 +350,16 @@ FindFirstFileA (
|
||||||
|
|
||||||
/* copy data into WIN32_FIND_DATA structure */
|
/* copy data into WIN32_FIND_DATA structure */
|
||||||
lpFindFileData->dwFileAttributes = IData->pFileInfo->FileAttributes;
|
lpFindFileData->dwFileAttributes = IData->pFileInfo->FileAttributes;
|
||||||
memcpy (&lpFindFileData->ftCreationTime,
|
|
||||||
&IData->pFileInfo->CreationTime,
|
lpFindFileData->ftCreationTime.dwHighDateTime = IData->pFileInfo->CreationTime.u.HighPart;
|
||||||
sizeof(FILETIME));
|
lpFindFileData->ftCreationTime.dwLowDateTime = IData->pFileInfo->CreationTime.u.LowPart;
|
||||||
memcpy (&lpFindFileData->ftLastAccessTime,
|
|
||||||
&IData->pFileInfo->LastAccessTime,
|
lpFindFileData->ftLastAccessTime.dwHighDateTime = IData->pFileInfo->LastAccessTime.u.HighPart;
|
||||||
sizeof(FILETIME));
|
lpFindFileData->ftLastAccessTime.dwLowDateTime = IData->pFileInfo->LastAccessTime.u.LowPart;
|
||||||
memcpy (&lpFindFileData->ftLastWriteTime,
|
|
||||||
&IData->pFileInfo->LastWriteTime,
|
lpFindFileData->ftLastWriteTime.dwHighDateTime = IData->pFileInfo->LastWriteTime.u.HighPart;
|
||||||
sizeof(FILETIME));
|
lpFindFileData->ftLastWriteTime.dwLowDateTime = IData->pFileInfo->LastWriteTime.u.LowPart;
|
||||||
|
|
||||||
lpFindFileData->nFileSizeHigh = IData->pFileInfo->EndOfFile.u.HighPart;
|
lpFindFileData->nFileSizeHigh = IData->pFileInfo->EndOfFile.u.HighPart;
|
||||||
lpFindFileData->nFileSizeLow = IData->pFileInfo->EndOfFile.u.LowPart;
|
lpFindFileData->nFileSizeLow = IData->pFileInfo->EndOfFile.u.LowPart;
|
||||||
|
|
||||||
|
@ -437,15 +438,16 @@ FindNextFileA (
|
||||||
|
|
||||||
/* copy data into WIN32_FIND_DATA structure */
|
/* copy data into WIN32_FIND_DATA structure */
|
||||||
lpFindFileData->dwFileAttributes = IData->pFileInfo->FileAttributes;
|
lpFindFileData->dwFileAttributes = IData->pFileInfo->FileAttributes;
|
||||||
memcpy (&lpFindFileData->ftCreationTime,
|
|
||||||
&IData->pFileInfo->CreationTime,
|
lpFindFileData->ftCreationTime.dwHighDateTime = IData->pFileInfo->CreationTime.u.HighPart;
|
||||||
sizeof(FILETIME));
|
lpFindFileData->ftCreationTime.dwLowDateTime = IData->pFileInfo->CreationTime.u.LowPart;
|
||||||
memcpy (&lpFindFileData->ftLastAccessTime,
|
|
||||||
&IData->pFileInfo->LastAccessTime,
|
lpFindFileData->ftLastAccessTime.dwHighDateTime = IData->pFileInfo->LastAccessTime.u.HighPart;
|
||||||
sizeof(FILETIME));
|
lpFindFileData->ftLastAccessTime.dwLowDateTime = IData->pFileInfo->LastAccessTime.u.LowPart;
|
||||||
memcpy (&lpFindFileData->ftLastWriteTime,
|
|
||||||
&IData->pFileInfo->LastWriteTime,
|
lpFindFileData->ftLastWriteTime.dwHighDateTime = IData->pFileInfo->LastWriteTime.u.HighPart;
|
||||||
sizeof(FILETIME));
|
lpFindFileData->ftLastWriteTime.dwLowDateTime = IData->pFileInfo->LastWriteTime.u.LowPart;
|
||||||
|
|
||||||
lpFindFileData->nFileSizeHigh = IData->pFileInfo->EndOfFile.u.HighPart;
|
lpFindFileData->nFileSizeHigh = IData->pFileInfo->EndOfFile.u.HighPart;
|
||||||
lpFindFileData->nFileSizeLow = IData->pFileInfo->EndOfFile.u.LowPart;
|
lpFindFileData->nFileSizeLow = IData->pFileInfo->EndOfFile.u.LowPart;
|
||||||
|
|
||||||
|
@ -541,17 +543,19 @@ FindFirstFileW (
|
||||||
|
|
||||||
/* copy data into WIN32_FIND_DATA structure */
|
/* copy data into WIN32_FIND_DATA structure */
|
||||||
lpFindFileData->dwFileAttributes = IData->pFileInfo->FileAttributes;
|
lpFindFileData->dwFileAttributes = IData->pFileInfo->FileAttributes;
|
||||||
memcpy (&lpFindFileData->ftCreationTime,
|
|
||||||
&IData->pFileInfo->CreationTime,
|
lpFindFileData->ftCreationTime.dwHighDateTime = IData->pFileInfo->CreationTime.u.HighPart;
|
||||||
sizeof(FILETIME));
|
lpFindFileData->ftCreationTime.dwLowDateTime = IData->pFileInfo->CreationTime.u.LowPart;
|
||||||
memcpy (&lpFindFileData->ftLastAccessTime,
|
|
||||||
&IData->pFileInfo->LastAccessTime,
|
lpFindFileData->ftLastAccessTime.dwHighDateTime = IData->pFileInfo->LastAccessTime.u.HighPart;
|
||||||
sizeof(FILETIME));
|
lpFindFileData->ftLastAccessTime.dwLowDateTime = IData->pFileInfo->LastAccessTime.u.LowPart;
|
||||||
memcpy (&lpFindFileData->ftLastWriteTime,
|
|
||||||
&IData->pFileInfo->LastWriteTime,
|
lpFindFileData->ftLastWriteTime.dwHighDateTime = IData->pFileInfo->LastWriteTime.u.HighPart;
|
||||||
sizeof(FILETIME));
|
lpFindFileData->ftLastWriteTime.dwLowDateTime = IData->pFileInfo->LastWriteTime.u.LowPart;
|
||||||
|
|
||||||
lpFindFileData->nFileSizeHigh = IData->pFileInfo->EndOfFile.u.HighPart;
|
lpFindFileData->nFileSizeHigh = IData->pFileInfo->EndOfFile.u.HighPart;
|
||||||
lpFindFileData->nFileSizeLow = IData->pFileInfo->EndOfFile.u.LowPart;
|
lpFindFileData->nFileSizeLow = IData->pFileInfo->EndOfFile.u.LowPart;
|
||||||
|
|
||||||
memcpy (lpFindFileData->cFileName,
|
memcpy (lpFindFileData->cFileName,
|
||||||
IData->pFileInfo->FileName,
|
IData->pFileInfo->FileName,
|
||||||
IData->pFileInfo->FileNameLength);
|
IData->pFileInfo->FileNameLength);
|
||||||
|
@ -592,18 +596,23 @@ FindNextFileW (
|
||||||
|
|
||||||
/* copy data into WIN32_FIND_DATA structure */
|
/* copy data into WIN32_FIND_DATA structure */
|
||||||
lpFindFileData->dwFileAttributes = IData->pFileInfo->FileAttributes;
|
lpFindFileData->dwFileAttributes = IData->pFileInfo->FileAttributes;
|
||||||
memcpy (&lpFindFileData->ftCreationTime,
|
|
||||||
&IData->pFileInfo->CreationTime,
|
lpFindFileData->ftCreationTime.dwHighDateTime = IData->pFileInfo->CreationTime.u.HighPart;
|
||||||
sizeof(FILETIME));
|
lpFindFileData->ftCreationTime.dwLowDateTime = IData->pFileInfo->CreationTime.u.LowPart;
|
||||||
memcpy (&lpFindFileData->ftLastAccessTime,
|
|
||||||
&IData->pFileInfo->LastAccessTime,
|
lpFindFileData->ftLastAccessTime.dwHighDateTime = IData->pFileInfo->LastAccessTime.u.HighPart;
|
||||||
sizeof(FILETIME));
|
lpFindFileData->ftLastAccessTime.dwLowDateTime = IData->pFileInfo->LastAccessTime.u.LowPart;
|
||||||
memcpy (&lpFindFileData->ftLastWriteTime,
|
|
||||||
&IData->pFileInfo->LastWriteTime,
|
lpFindFileData->ftLastWriteTime.dwHighDateTime = IData->pFileInfo->LastWriteTime.u.HighPart;
|
||||||
sizeof(FILETIME));
|
lpFindFileData->ftLastWriteTime.dwLowDateTime = IData->pFileInfo->LastWriteTime.u.LowPart;
|
||||||
|
|
||||||
lpFindFileData->nFileSizeHigh = IData->pFileInfo->EndOfFile.u.HighPart;
|
lpFindFileData->nFileSizeHigh = IData->pFileInfo->EndOfFile.u.HighPart;
|
||||||
lpFindFileData->nFileSizeLow = IData->pFileInfo->EndOfFile.u.LowPart;
|
lpFindFileData->nFileSizeLow = IData->pFileInfo->EndOfFile.u.LowPart;
|
||||||
memcpy (lpFindFileData->cFileName,
|
|
||||||
|
lpFindFileData->nFileSizeHigh = IData->pFileInfo->EndOfFile.u.HighPart;
|
||||||
|
lpFindFileData->nFileSizeLow = IData->pFileInfo->EndOfFile.u.LowPart;
|
||||||
|
|
||||||
|
memcpy (lpFindFileData->cFileName,
|
||||||
IData->pFileInfo->FileName,
|
IData->pFileInfo->FileName,
|
||||||
IData->pFileInfo->FileNameLength);
|
IData->pFileInfo->FileNameLength);
|
||||||
lpFindFileData->cFileName[IData->pFileInfo->FileNameLength / sizeof(WCHAR)] = 0;
|
lpFindFileData->cFileName[IData->pFileInfo->FileNameLength / sizeof(WCHAR)] = 0;
|
||||||
|
|
Loading…
Reference in a new issue