ReactOS  0.4.15-dev-3299-gbe8e5fc
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 }
GLuint64EXT * result
Definition: glext.h:11304
_TCHAR * _tcsncpy(_TCHAR *dst, const _TCHAR *src, size_t n)
Definition: tcsncpy.h:9
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
static __inline __time64_t FileTimeToUnixTime(const FILETIME *FileTime, USHORT *millitm)
Definition: time.h:14
#define FindFirstFile
Definition: winbase.h:3638
int intptr_t
Definition: crtdefs.h:304
#define MAX_PATH
Definition: compat.h:34
void _dosmaperr(unsigned long oserrcode)
Definition: errno.c:81
__kernel_time_t time_t
Definition: linux.h:252
#define NULL
Definition: types.h:112
#define __int64
Definition: basetyps.h:16

◆ _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 }
GLuint64EXT * result
Definition: glext.h:11304
_TCHAR * _tcsncpy(_TCHAR *dst, const _TCHAR *src, size_t n)
Definition: tcsncpy.h:9
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
static __inline __time64_t FileTimeToUnixTime(const FILETIME *FileTime, USHORT *millitm)
Definition: time.h:14
#define FindNextFile
Definition: winbase.h:3644
#define MAX_PATH
Definition: compat.h:34
void _dosmaperr(unsigned long oserrcode)
Definition: errno.c:81
__kernel_time_t time_t
Definition: linux.h:252
#define NULL
Definition: types.h:112
#define __int64
Definition: basetyps.h:16