ReactOS 0.4.16-dev-106-g10b08aa
findgen.c File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

intptr_t _tfindfirst (const _TCHAR *_name, struct _tfinddata_t *result)
 
int _tfindnext (intptr_t handle, struct _tfinddata_t *result)
 

Function Documentation

◆ _tfindfirst()

intptr_t _tfindfirst ( const _TCHAR _name,
struct _tfinddata_t result 
)

Definition at line 5 of file findgen.c.

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}
#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 _tcsncpy
Definition: tchar.h:1410
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 FindFirstFile
Definition: winbase.h:3782

◆ _tfindnext()

int _tfindnext ( intptr_t  handle,
struct _tfinddata_t result 
)

Definition at line 29 of file findgen.c.

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 FindNextFile
Definition: winbase.h:3788