ReactOS 0.4.16-dev-125-g798ea90
findgen.c
Go to the documentation of this file.
1
2/*
3 * @implemented
4 */
6{
7 WIN32_FIND_DATA FindFileData;
8 HANDLE hFindFile;
9
10 hFindFile = FindFirstFile(_name, &FindFileData);
11 if (hFindFile == INVALID_HANDLE_VALUE) {
13 return -1;
14 }
15
16 result->attrib = FindFileData.dwFileAttributes;
17 result->time_create = (time_t)FileTimeToUnixTime(&FindFileData.ftCreationTime,NULL);
18 result->time_access = (time_t)FileTimeToUnixTime(&FindFileData.ftLastAccessTime,NULL);
19 result->time_write = (time_t)FileTimeToUnixTime(&FindFileData.ftLastWriteTime,NULL);
20 result->size = (((__int64)FindFileData.nFileSizeHigh)<<32) + FindFileData.nFileSizeLow;
21 _tcsncpy(result->name,FindFileData.cFileName,MAX_PATH);
22
23 return (intptr_t)hFindFile;
24}
25
26/*
27 * @implemented
28 */
30{
31 WIN32_FIND_DATA FindFileData;
32
33 if (!FindNextFile((HANDLE)handle, &FindFileData)) {
35 return -1;
36 }
37
38 result->attrib = FindFileData.dwFileAttributes;
39 result->time_create = (time_t)FileTimeToUnixTime(&FindFileData.ftCreationTime,NULL);
40 result->time_access = (time_t)FileTimeToUnixTime(&FindFileData.ftLastAccessTime,NULL);
41 result->time_write = (time_t)FileTimeToUnixTime(&FindFileData.ftLastWriteTime,NULL);
42 result->size = (((__int64)FindFileData.nFileSizeHigh)<<32) + FindFileData.nFileSizeLow;
43 _tcsncpy(result->name,FindFileData.cFileName, MAX_PATH);
44
45 return 0;
46}
#define __int64
Definition: basetyps.h:16
int intptr_t
Definition: crtdefs.h:304
#define NULL
Definition: types.h:112
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define MAX_PATH
Definition: compat.h:34
__kernel_time_t time_t
Definition: linux.h:252
GLuint64EXT * result
Definition: glext.h:11304
#define _tfindnext
Definition: tchar.h:710
#define _tcsncpy
Definition: tchar.h:1410
#define _tfinddata_t
Definition: tchar.h:731
char _TCHAR
Definition: tchar.h:1392
#define _tfindfirst
Definition: tchar.h:704
void _dosmaperr(unsigned long oserrcode)
Definition: errno.c:79
static __inline __time64_t FileTimeToUnixTime(const FILETIME *FileTime, USHORT *millitm)
Definition: time.h:14
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define FindNextFile
Definition: winbase.h:3788
#define FindFirstFile
Definition: winbase.h:3782