24#include <corecrt_io.h>
44#undef _wfindfirst64i32
76 ft->
size =
fd->nFileSizeLow;
96 ft->
size =
fd->nFileSizeLow;
116 ft->
size =
fd->nFileSizeLow;
128 ft->attrib =
fd->dwFileAttributes;
131 ft->time_create =
dw;
133 ft->time_access =
dw;
136 ft->size = ((
__int64)
fd->nFileSizeHigh) << 32 |
fd->nFileSizeLow;
168 ft->attrib =
fd->dwFileAttributes;
171 ft->time_create =
dw;
173 ft->time_access =
dw;
176 ft->size = ((
__int64)
fd->nFileSizeHigh) << 32 |
fd->nFileSizeLow;
196 ft->
size =
fd->nFileSizeLow;
217 wchar_t *newdirW =
NULL;
243 if (fulldir[1] ==
L':')
272 buffer[0] += newdrive - 1;
300 TRACE(
":handle %Iu\n",hand);
338 TRACE(
":got handle %p\n",hfind);
359 TRACE(
":got handle %p\n",hfind);
380 TRACE(
":got handle %p\n", hfind);
400 wchar_t *fspecW =
NULL;
431 TRACE(
":got handle %p\n",hfind);
452 TRACE(
":got handle %p\n",hfind);
474 wchar_t *fspecW =
NULL;
505 TRACE(
":got handle %p\n",hfind);
527 wchar_t *fspecW =
NULL;
558 TRACE(
":got handle %p\n",hfind);
795 if (
size <= dir_len)
size = dir_len + 1;
798 else if (dir_len >=
size)
869 static wchar_t*
dummy;
878 wchar_t drivespec[4] =
L"A:\\";
881 drivespec[0] +=
drive - 1;
889 if (dir_len >=
size || dir_len < 1)
921 WCHAR drivespec[] =
L"@:\\";
928 drivespec[0] += disk;
932 d->sectors_per_cluster =
ret[0];
933 d->bytes_per_sector =
ret[1];
934 d->avail_clusters =
ret[2];
935 d->total_clusters =
ret[3];
960 wchar_t *newdirW =
NULL;
999 wchar_t *dirW =
NULL;
1025 char*
drive,
size_t sz_drive,
1026 char*
dir,
size_t sz_dir,
1027 char* fname,
size_t sz_fname,
1028 char*
ext,
size_t sz_ext)
1030 const char *
p, *
end;
1032 if (!inpath || (!
drive && sz_drive) ||
1033 (
drive && !sz_drive) ||
1036 (!fname && sz_fname) ||
1037 (fname && !sz_fname) ||
1045 if (inpath[0] && inpath[1] ==
':')
1049 if (sz_drive <= 2)
goto do_error;
1050 drive[0] = inpath[0];
1051 drive[1] = inpath[1];
1060 for (
p = inpath; *
p;
p++)
1067 if (*
p ==
'/' || *
p ==
'\\')
end =
p + 1;
1074 if (sz_dir <=
end - inpath)
goto do_error;
1080 else if (
dir)
dir[0] = 0;
1084 for (
p = inpath; *
p;
p++)
if (*
p ==
'.')
end =
p;
1090 if (sz_fname <=
end - inpath)
goto do_error;
1091 memcpy( fname, inpath, (
end - inpath) );
1092 fname[
end - inpath] = 0;
1096 if (sz_ext <=
strlen(
end))
goto do_error;
1103 if (fname) fname[0]=
'\0';
1113 char *fname,
char *
ext)
1125 wchar_t*
drive,
size_t sz_drive,
1126 wchar_t*
dir,
size_t sz_dir,
1127 wchar_t* fname,
size_t sz_fname,
1128 wchar_t*
ext,
size_t sz_ext)
1130 const wchar_t *
p, *
end;
1132 if (!inpath || (!
drive && sz_drive) ||
1133 (
drive && !sz_drive) ||
1136 (!fname && sz_fname) ||
1137 (fname && !sz_fname) ||
1145 if (inpath[0] && inpath[1] ==
':')
1149 if (sz_drive <= 2)
goto do_error;
1150 drive[0] = inpath[0];
1151 drive[1] = inpath[1];
1160 for (
p = inpath; *
p;
p++)
if (*
p ==
'/' || *
p ==
'\\')
end =
p + 1;
1166 if (sz_dir <=
end - inpath)
goto do_error;
1167 memcpy(
dir, inpath, (
end - inpath) *
sizeof(
wchar_t) );
1172 else if (
dir)
dir[0] = 0;
1176 for (
p = inpath; *
p;
p++)
if (*
p ==
'.')
end =
p;
1182 if (sz_fname <=
end - inpath)
goto do_error;
1183 memcpy( fname, inpath, (
end - inpath) *
sizeof(
wchar_t) );
1184 fname[
end - inpath] = 0;
1188 if (sz_ext <=
wcslen(
end))
goto do_error;
1195 if (fname) fname[0]=
'\0';
1207 wchar_t *fname,
wchar_t *
ext)
1225 if (!relPath || !*relPath)
1228 if (absPath ==
NULL)
1247 if (rc > 0 && rc <=
size )
1280 if (!retW)
return NULL;
1312 const char * extension)
1332 if (
p[-1] !=
'/' &&
p[-1] !=
'\\')
1341 if (extension && extension[0])
1343 if (extension[0] !=
'.')
1358 const wchar_t *
filename,
const wchar_t *extension)
1378 if (
p[-1] !=
'/' &&
p[-1] !=
'\\')
1387 if (extension && extension[0])
1389 if (extension[0] !=
'.')
1406 const char *extension)
1443 if (needs_separator)
1470 if (extension && extension[0])
1473 unsigned int needs_period = extension[0] !=
'.';
1474 unsigned int copylen;
1486 memcpy(
p, extension, copylen);
1510 const wchar_t *extension)
1547 if (needs_separator)
1574 if (extension && extension[0])
1577 unsigned int needs_period = extension[0] !=
'.';
1578 unsigned int copylen;
1590 memcpy(
p, extension, copylen *
sizeof(
wchar_t));
1612 char *envVal, *penv, *
end;
1622 FIXME(
"count > MAX_PATH not supported\n");
1647 TRACE(
":searching for %s in paths %s\n",
file, envVal);
1649 for(; *penv; penv = (*
end ?
end + 1 :
end))
1713 wchar_t *envVal, *penv, *
end;
1722 FIXME(
"count > MAX_PATH not supported\n");
1746 for(; *penv; penv = (*
end ?
end + 1 :
end))
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static LPCWSTR LPCWSTR LPCWSTR env
static int find_data(const struct Vector *v, const BYTE *pData, int size)
#define ERROR_INVALID_PARAMETER
#define GetCurrentDirectoryW(x, y)
#define INVALID_HANDLE_VALUE
#define FILE_ATTRIBUTE_NORMAL
static const WCHAR *const ext[]
BOOL WINAPI DECLSPEC_HOTPATCH SetEnvironmentVariableW(IN LPCWSTR lpName, IN LPCWSTR lpValue)
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
BOOL WINAPI GetDiskFreeSpaceW(IN LPCWSTR lpRootPathName, OUT LPDWORD lpSectorsPerCluster, OUT LPDWORD lpBytesPerSector, OUT LPDWORD lpNumberOfFreeClusters, OUT LPDWORD lpTotalNumberOfClusters)
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
HANDLE WINAPI FindFirstFileA(IN LPCSTR lpFileName, OUT LPWIN32_FIND_DATAA lpFindFileData)
BOOL WINAPI FindClose(HANDLE hFindFile)
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
BOOL WINAPI FindNextFileA(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAA lpFindFileData)
BOOL WINAPI SetCurrentDirectoryW(IN LPCWSTR lpPathName)
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
char *CDECL _getdcwd(int drive, char *buf, int size)
static void msvcrt_wfttofd(const WIN32_FIND_DATAW *fd, struct _wfinddata_t *ft)
static void msvcrt_fttofd(const WIN32_FIND_DATAA *fd, struct _finddata_t *ft)
wchar_t *CDECL _wgetdcwd(int drive, wchar_t *buf, int size)
char *CDECL _getcwd(char *buf, int size)
static int finddata64_wtoa(const struct _wfinddata64_t *wfd, struct _finddata64_t *fd)
static void msvcrt_wfttofd32(const WIN32_FIND_DATAW *fd, struct _wfinddata32_t *ft)
int CDECL _wsearchenv_s(const wchar_t *file, const wchar_t *env, wchar_t *buf, size_t count)
void CDECL _wsearchenv(const wchar_t *file, const wchar_t *env, wchar_t *buf)
static void msvcrt_wfttofdi64(const WIN32_FIND_DATAW *fd, struct _wfinddatai64_t *ft)
int CDECL _searchenv_s(const char *file, const char *env, char *buf, size_t count)
void CDECL _searchenv(const char *file, const char *env, char *buf)
static void msvcrt_fttofdi64(const WIN32_FIND_DATAA *fd, struct _finddatai64_t *ft)
static void msvcrt_wfttofd64i32(const WIN32_FIND_DATAW *fd, struct _wfinddata64i32_t *ft)
int CDECL _wrmdir(const wchar_t *dir)
int CDECL _wfindnext32(intptr_t hand, struct _wfinddata32_t *ft)
int CDECL _rmdir(const char *dir)
char *CDECL _fullpath(char *abs_path, const char *rel_path, size_t size)
int CDECL _wchdir(const wchar_t *newdir)
int CDECL _getdrive(void)
int CDECL _chdir(const char *newdir)
void CDECL _wsplitpath(const wchar_t *inpath, wchar_t *drv, wchar_t *dir, wchar_t *fname, wchar_t *ext)
int CDECL _mkdir(const char *newdir)
int CDECL _chdrive(int newdrive)
int CDECL _makepath_s(char *path, size_t size, const char *drive, const char *directory, const char *filename, const char *extension)
unsigned int CDECL _getdiskfree(unsigned int disk, struct _diskfree_t *d)
wchar_t *CDECL _wgetcwd(wchar_t *buf, int size)
intptr_t CDECL _findfirst32(const char *fspec, struct _finddata32_t *ft)
int CDECL _wmakepath_s(wchar_t *path, size_t size, const wchar_t *drive, const wchar_t *directory, const wchar_t *filename, const wchar_t *extension)
wchar_t *CDECL _wfullpath(wchar_t *absPath, const wchar_t *relPath, size_t size)
static int finddata32_wtoa(const struct _wfinddata32_t *wfd, struct _finddata32_t *fd)
static int finddata64i32_wtoa(const struct _wfinddata64i32_t *wfd, struct _finddata64i32_t *fd)
static void msvcrt_wfttofd64(const WIN32_FIND_DATAW *fd, struct _wfinddata64_t *ft)
int CDECL _wmkdir(const wchar_t *newdir)
int CDECL _findnext32(intptr_t hand, struct _finddata32_t *ft)
void CDECL _splitpath(const char *inpath, char *drv, char *dir, char *fname, char *ext)
intptr_t CDECL _wfindfirst32(const wchar_t *fspec, struct _wfinddata32_t *ft)
int CDECL _findclose(intptr_t hand)
VOID CDECL _wmakepath(wchar_t *path, const wchar_t *drive, const wchar_t *directory, const wchar_t *filename, const wchar_t *extension)
wchar_t *CDECL _wgetenv(const wchar_t *name)
char *CDECL getenv(const char *name)
int CDECL _access(const char *filename, int mode)
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
_ACRTIMP wchar_t *__cdecl _wcsdup(const wchar_t *) __WINE_DEALLOC(free) __WINE_MALLOC
_ACRTIMP int __cdecl _ismbblead(unsigned int)
_ACRTIMP size_t __cdecl strlen(const char *)
static wchar_t * wstrdupa_utf8(const char *str)
static char * astrdupw_utf8(const wchar_t *wstr)
static int convert_wcs_to_acp_utf8(const wchar_t *wstr, char *str, int len)
#define MSVCRT_INVALID_PMT(x, err)
#define MSVCRT_CHECK_PMT(x)
GLuint GLuint GLsizei count
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLint GLboolean GLint GLenum access
BOOLEAN NTAPI RtlTimeToSecondsSince1970(PLARGE_INTEGER Time, PULONG ElapsedSeconds)
REFIID LPVOID DWORD_PTR dw
#define memcpy(s1, s2, n)
#define memmove(s1, s2, n)
#define _wsplitpath_s(f, d, dl, p, pl, n, nl, e, el)
#define _splitpath_s(f, d, dl, p, pl, n, nl, e, el)
#define INVALID_FILE_ATTRIBUTES
DWORD WINAPI GetLastError(void)