mirror of
https://github.com/reactos/reactos.git
synced 2025-07-24 17:13:51 +00:00
Hopefully create a branch and not destroy the svn repository.
svn path=/branches/reactos-yarotows/; revision=45219
This commit is contained in:
parent
c88ec84439
commit
6afbc8f483
19442 changed files with 0 additions and 1060695 deletions
46
lib/sdk/crt/stdio/findgen.c
Normal file
46
lib/sdk/crt/stdio/findgen.c
Normal file
|
@ -0,0 +1,46 @@
|
|||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
intptr_t _tfindfirst(const _TCHAR* _name, struct _tfinddata_t* result)
|
||||
{
|
||||
WIN32_FIND_DATA FindFileData;
|
||||
HANDLE hFindFile;
|
||||
|
||||
hFindFile = FindFirstFile(_name, &FindFileData);
|
||||
if (hFindFile == INVALID_HANDLE_VALUE) {
|
||||
_dosmaperr(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
result->attrib = FindFileData.dwFileAttributes;
|
||||
result->time_create = FileTimeToUnixTime(&FindFileData.ftCreationTime,NULL);
|
||||
result->time_access = FileTimeToUnixTime(&FindFileData.ftLastAccessTime,NULL);
|
||||
result->time_write = FileTimeToUnixTime(&FindFileData.ftLastWriteTime,NULL);
|
||||
result->size = (((__int64)FindFileData.nFileSizeHigh)<<32) + FindFileData.nFileSizeLow;
|
||||
_tcsncpy(result->name,FindFileData.cFileName,MAX_PATH);
|
||||
|
||||
return (intptr_t)hFindFile;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
int _tfindnext(intptr_t handle, struct _tfinddata_t* result)
|
||||
{
|
||||
WIN32_FIND_DATA FindFileData;
|
||||
|
||||
if (!FindNextFile((HANDLE)handle, &FindFileData)) {
|
||||
_dosmaperr(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
result->attrib = FindFileData.dwFileAttributes;
|
||||
result->time_create = FileTimeToUnixTime(&FindFileData.ftCreationTime,NULL);
|
||||
result->time_access = FileTimeToUnixTime(&FindFileData.ftLastAccessTime,NULL);
|
||||
result->time_write = FileTimeToUnixTime(&FindFileData.ftLastWriteTime,NULL);
|
||||
result->size = (((__int64)FindFileData.nFileSizeHigh)<<32) + FindFileData.nFileSizeLow;
|
||||
_tcsncpy(result->name,FindFileData.cFileName, MAX_PATH);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue