diff --git a/reactos/lib/kernel32/file/dir.c b/reactos/lib/kernel32/file/dir.c index a3feebefb0e..8a323f5e89f 100644 --- a/reactos/lib/kernel32/file/dir.c +++ b/reactos/lib/kernel32/file/dir.c @@ -524,7 +524,7 @@ SearchPathA( for(i=0;idwFileAttributes = IData->FileInfo.FileAttributes; +// memcpy(&lpFindFileData->ftCreationTime,&IData->FileInfo.CreationTime,sizeof(FILETIME)); +// memcpy(&lpFindFileData->ftLastAccessTime,&IData->FileInfo.LastAccessTime,sizeof(FILETIME)); +// memcpy(&lpFindFileData->ftLastWriteTime,&IData->FileInfo.LastWriteTime,sizeof(FILETIME)); + lpFindFileData->nFileSizeHigh = IData->FileInfo.EndOfFile.HighPart; + lpFindFileData->nFileSizeLow = IData->FileInfo.EndOfFile.LowPart; +} WINBOOL STDCALL InternalFindNextFile(HANDLE hFindFile, LPWIN32_FIND_DATA lpFindFileData) @@ -89,18 +97,6 @@ WINBOOL STDCALL InternalFindNextFile(HANDLE hFindFile, return(TRUE); } -static FileDataToWin32Data(LPWIN32_FIND_DATA lpFindFileData, PKERNEL32_FIND_FILE_DATA IData) -{ - int i; - lpFindFileData->dwFileAttributes = IData->FileInfo.FileAttributes; -// memcpy(&lpFindFileData->ftCreationTime,&IData->FileInfo.CreationTime,sizeof(FILETIME)); -// memcpy(&lpFindFileData->ftLastAccessTime,&IData->FileInfo.LastAccessTime,sizeof(FILETIME)); -// memcpy(&lpFindFileData->ftLastWriteTime,&IData->FileInfo.LastWriteTime,sizeof(FILETIME)); - lpFindFileData->nFileSizeHigh = IData->FileInfo.EndOfFile.HighPart; - lpFindFileData->nFileSizeLow = IData->FileInfo.EndOfFile.LowPart; - -} - HANDLE STDCALL InternalFindFirstFile(LPCWSTR lpFileName, LPWIN32_FIND_DATA lpFindFileData) { @@ -289,17 +285,15 @@ HANDLE STDCALL FindFirstFileW(LPCWSTR lpFileName, { PWIN32_FIND_DATA_UNICODE Ret; PKERNEL32_FIND_FILE_DATA IData; - int i; IData = InternalFindFirstFile(lpFileName,lpFindFileData); Ret = (PWIN32_FIND_DATA_UNICODE)lpFindFileData; memcpy(Ret->cFileName, IData->FileInfo.FileName, IData->FileInfo.FileNameLength); - memset(Ret->cAlternateFileName, IData->FileInfo.ShortName, + memcpy(Ret->cAlternateFileName, IData->FileInfo.ShortName, IData->FileInfo.ShortNameLength); - return(IData); } @@ -308,7 +302,6 @@ WINBOOL STDCALL FindNextFileW(HANDLE hFindFile, { PWIN32_FIND_DATA_UNICODE Ret; PKERNEL32_FIND_FILE_DATA IData; - int i; IData = (PKERNEL32_FIND_FILE_DATA)hFindFile; if (!InternalFindNextFile(hFindFile, lpFindFileData)) diff --git a/reactos/lib/kernel32/file/volume.c b/reactos/lib/kernel32/file/volume.c index 8e16324f570..ca5227ae493 100644 --- a/reactos/lib/kernel32/file/volume.c +++ b/reactos/lib/kernel32/file/volume.c @@ -40,7 +40,7 @@ int DRIVE_IsValid( int drive ) Drives[0] = 'A' + drive -1; if ((drive < 0) || (drive >= MAX_DOS_DRIVES)) return 0; - if ( CreateFileA(Drives,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_FLAG_BACKUP_SEMANTICS|FILE_ATTRIBUTE_DIRECTORY,NULL) == -1 ) { + if ( CreateFileA(Drives,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_FLAG_BACKUP_SEMANTICS|FILE_ATTRIBUTE_DIRECTORY,NULL) == INVALID_HANDLE_VALUE ) { return 0; } return drive;