Fixed a bug in FindFirstFileW() and FindNextFileW().

The lengs of the copied strings was wrong.

svn path=/trunk/; revision=2133
This commit is contained in:
Hartmut Birr 2001-08-01 19:26:41 +00:00
parent a798ec1a86
commit f1a3075ad7

View file

@ -1,4 +1,4 @@
/* $Id: find.c,v 1.27 2000/08/05 18:01:49 dwelch Exp $
/* $Id: find.c,v 1.28 2001/08/01 19:26:41 hbirr Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@ -398,11 +398,12 @@ FindFirstFileW (
lpFindFileData->nFileSizeLow = IData->FileInfo.EndOfFile.u.LowPart;
memcpy (lpFindFileData->cFileName,
IData->FileInfo.FileName,
IData->FileInfo.FileNameLength);
IData->FileInfo.FileNameLength * sizeof(WCHAR));
lpFindFileData->cFileName[IData->FileInfo.FileNameLength] = 0;
memcpy (lpFindFileData->cAlternateFileName,
IData->FileInfo.ShortName,
IData->FileInfo.ShortNameLength);
IData->FileInfo.ShortNameLength * sizeof(WCHAR));
lpFindFileData->cAlternateFileName[IData->FileInfo.ShortNameLength] = 0;
return IData;
}
@ -438,11 +439,12 @@ FindNextFileW (
lpFindFileData->nFileSizeLow = IData->FileInfo.EndOfFile.u.LowPart;
memcpy (lpFindFileData->cFileName,
IData->FileInfo.FileName,
IData->FileInfo.FileNameLength);
IData->FileInfo.FileNameLength * sizeof(WCHAR));
lpFindFileData->cFileName[IData->FileInfo.FileNameLength] = 0;
memcpy (lpFindFileData->cAlternateFileName,
IData->FileInfo.ShortName,
IData->FileInfo.ShortNameLength);
IData->FileInfo.ShortNameLength * sizeof(WCHAR));
lpFindFileData->cAlternateFileName[IData->FileInfo.ShortNameLength] = 0;
return TRUE;
}