ReactOS 0.4.16-dev-2104-gb84fa49
corecrt_wio.h File Reference
#include <corecrt.h>
#include <pshpack8.h>
#include <poppack.h>
Include dependency graph for corecrt_wio.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _wfinddata32_t
 
struct  _wfinddata32i64_t
 
struct  _wfinddata64i32_t
 
struct  _wfinddata64_t
 

Macros

#define _wfinddata_t   _wfinddata64i32_t
 
#define _wfinddatai64_t   _wfinddata64_t
 
#define _wfindfirst64i32   _wfindfirst
 
#define _wfindfirst64   _wfindfirsti64
 
#define _wfindnext64i32   _wfindnext
 
#define _wfindnext64   _wfindnexti64
 

Typedefs

typedef __msvcrt_ulong _fsize_t
 

Functions

_ACRTIMP int __cdecl _waccess (const wchar_t *, int)
 
_ACRTIMP int __cdecl _wchmod (const wchar_t *, int)
 
_ACRTIMP int __cdecl _wcreat (const wchar_t *, int)
 
_ACRTIMP intptr_t __cdecl _wfindfirst32 (const wchar_t *, struct _wfinddata32_t *)
 
_ACRTIMP intptr_t __cdecl _wfindfirst32i64 (const wchar_t *, struct _wfinddata32i64_t *)
 
_ACRTIMP intptr_t __cdecl _wfindfirst64 (const wchar_t *, struct _wfinddata64_t *)
 
_ACRTIMP intptr_t __cdecl _wfindfirst64i32 (const wchar_t *, struct _wfinddata64i32_t *)
 
_ACRTIMP int __cdecl _wfindnext32 (intptr_t, struct _wfinddata32_t *)
 
_ACRTIMP int __cdecl _wfindnext32i64 (intptr_t, struct _wfinddata32i64_t *)
 
_ACRTIMP int __cdecl _wfindnext64 (intptr_t, struct _wfinddata64_t *)
 
_ACRTIMP int __cdecl _wfindnext64i32 (intptr_t, struct _wfinddata64i32_t *)
 
_ACRTIMP wchar_t *__cdecl _wmktemp (wchar_t *)
 
_ACRTIMP int __cdecl _wopen (const wchar_t *, int,...)
 
_ACRTIMP int __cdecl _wrename (const wchar_t *, const wchar_t *)
 
_ACRTIMP int __cdecl _wsopen (const wchar_t *, int, int,...)
 
_ACRTIMP int __cdecl _wunlink (const wchar_t *)
 

Macro Definition Documentation

◆ _wfinddata_t

Definition at line 19 of file corecrt_wio.h.

◆ _wfinddatai64_t

#define _wfinddatai64_t   _wfinddata64_t

Definition at line 20 of file corecrt_wio.h.

◆ _wfindfirst64

#define _wfindfirst64   _wfindfirsti64

Definition at line 79 of file corecrt_wio.h.

◆ _wfindfirst64i32

#define _wfindfirst64i32   _wfindfirst

Definition at line 78 of file corecrt_wio.h.

◆ _wfindnext64

#define _wfindnext64   _wfindnexti64

Definition at line 81 of file corecrt_wio.h.

◆ _wfindnext64i32

#define _wfindnext64i32   _wfindnext

Definition at line 80 of file corecrt_wio.h.

Typedef Documentation

◆ _fsize_t

This file has no copyright assigned and is placed in the Public Domain. This file is part of the Wine project.

Definition at line 13 of file corecrt_wio.h.

Function Documentation

◆ _waccess()

_ACRTIMP int __cdecl _waccess ( const wchar_t filename,
int  mode 
)

Definition at line 1017 of file file.c.

1018{
1020
1021 TRACE("(%s,%d) %ld\n", debugstr_w(filename), mode, attr);
1022
1024 {
1026 return -1;
1027 }
1029 {
1031 return -1;
1032 }
1033 return 0;
1034}
#define ERROR_ACCESS_DENIED
Definition: compat.h:97
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
#define MSVCRT_W_OK
Definition: file.c:76
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum mode
Definition: glext.h:6217
const char * filename
Definition: ioapi.h:137
#define debugstr_w
Definition: kernel32.h:32
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
#define msvcrt_set_errno
Definition: heap.c:50
#define TRACE(s)
Definition: solgame.cpp:4
Definition: cookie.c:202
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

Referenced by _access(), and _waccess_s().

◆ _wchmod()

_ACRTIMP int __cdecl _wchmod ( const wchar_t path,
int  flags 
)

Definition at line 1066 of file file.c.

1067{
1068 DWORD oldFlags = GetFileAttributesW(path);
1069
1070 if (oldFlags != INVALID_FILE_ATTRIBUTES)
1071 {
1072 DWORD newFlags = (flags & _S_IWRITE)? oldFlags & ~FILE_ATTRIBUTE_READONLY:
1073 oldFlags | FILE_ATTRIBUTE_READONLY;
1074
1075 if (newFlags == oldFlags || SetFileAttributesW(path, newFlags))
1076 return 0;
1077 }
1079 return -1;
1080}
#define _S_IWRITE
Definition: stat.h:85
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
Definition: fileinfo.c:794
GLbitfield flags
Definition: glext.h:7161

Referenced by _chmod().

◆ _wcreat()

_ACRTIMP int __cdecl _wcreat ( const wchar_t path,
int  pmode 
)

Definition at line 2702 of file file.c.

2703{
2704 int flags = _O_CREAT | _O_TRUNC | _O_RDWR;
2705 return _wopen(path, flags, pmode);
2706}
#define _O_RDWR
Definition: cabinet.h:39
#define _O_TRUNC
Definition: cabinet.h:47
#define _O_CREAT
Definition: cabinet.h:46
int WINAPIV _wopen(const wchar_t *path, int flags,...)
Definition: file.c:2674

◆ _wfindfirst32()

_ACRTIMP intptr_t __cdecl _wfindfirst32 ( const wchar_t fspec,
struct _wfinddata32_t ft 
)

Definition at line 368 of file dir.c.

369{
371 HANDLE hfind;
372
373 hfind = FindFirstFileW(fspec, &find_data);
374 if (hfind == INVALID_HANDLE_VALUE)
375 {
377 return -1;
378 }
380 TRACE(":got handle %p\n", hfind);
381 return (intptr_t)hfind;
382}
static int find_data(const struct Vector *v, const BYTE *pData, int size)
Definition: filtermapper.c:162
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
static void msvcrt_wfttofd32(const WIN32_FIND_DATAW *fd, struct _wfinddata32_t *ft)
Definition: dir.c:101
int intptr_t
Definition: corecrt.h:176

Referenced by _findfirst32().

◆ _wfindfirst32i64()

_ACRTIMP intptr_t __cdecl _wfindfirst32i64 ( const wchar_t pattern,
struct _wfinddata32i64_t result 
)

Definition at line 228 of file findfile.cpp.

229{
230 return common_find_first_wide(pattern, result);
231}
GLubyte * pattern
Definition: glext.h:7787
GLuint64EXT * result
Definition: glext.h:11304

◆ _wfindfirst64()

_ACRTIMP intptr_t __cdecl _wfindfirst64 ( const wchar_t fspec,
struct _wfinddata64_t ft 
)

Definition at line 440 of file dir.c.

441{
443 HANDLE hfind;
444
445 hfind = FindFirstFileW(fspec, &find_data);
446 if (hfind == INVALID_HANDLE_VALUE)
447 {
449 return -1;
450 }
452 TRACE(":got handle %p\n",hfind);
453 return (intptr_t)hfind;
454}
static void msvcrt_wfttofd64(const WIN32_FIND_DATAW *fd, struct _wfinddata64_t *ft)
Definition: dir.c:141

◆ _wfindfirst64i32()

_ACRTIMP intptr_t __cdecl _wfindfirst64i32 ( const wchar_t fspec,
struct _wfinddata64i32_t ft 
)

Definition at line 493 of file dir.c.

494{
496 HANDLE hfind;
497
498 hfind = FindFirstFileW(fspec, &find_data);
499 if (hfind == INVALID_HANDLE_VALUE)
500 {
502 return -1;
503 }
505 TRACE(":got handle %p\n",hfind);
506 return (intptr_t)hfind;
507}
static void msvcrt_wfttofd64i32(const WIN32_FIND_DATAW *fd, struct _wfinddata64i32_t *ft)
Definition: dir.c:181

◆ _wfindnext32()

_ACRTIMP int __cdecl _wfindnext32 ( intptr_t  hand,
struct _wfinddata32_t ft 
)

Definition at line 595 of file dir.c.

596{
598
599 if (!FindNextFileW((HANDLE)hand, &find_data))
600 {
601 *_errno() = ENOENT;
602 return -1;
603 }
604
606 return 0;
607}
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382
int *CDECL _errno(void)
Definition: errno.c:215
#define ENOENT
Definition: errno.h:25

Referenced by _findnext32().

◆ _wfindnext32i64()

_ACRTIMP int __cdecl _wfindnext32i64 ( intptr_t  handle,
struct _wfinddata32i64_t result 
)

Definition at line 360 of file findfile.cpp.

361{
363}
static int __cdecl common_find_next_wide(intptr_t const handle, WideFileData *const result)
Definition: findfile.cpp:266

◆ _wfindnext64()

_ACRTIMP int __cdecl _wfindnext64 ( intptr_t  hand,
struct _wfinddata64_t ft 
)

Definition at line 665 of file dir.c.

666{
668
669 if (!FindNextFileW((HANDLE)hand, &find_data))
670 {
671 *_errno() = ENOENT;
672 return -1;
673 }
674
676 return 0;
677}

◆ _wfindnext64i32()

_ACRTIMP int __cdecl _wfindnext64i32 ( intptr_t  hand,
struct _wfinddata64i32_t ft 
)

Definition at line 718 of file dir.c.

719{
721
722 if (!FindNextFileW((HANDLE)hand, &find_data))
723 {
724 *_errno() = ENOENT;
725 return -1;
726 }
727
729 return 0;
730}

◆ _wmktemp()

_ACRTIMP wchar_t *__cdecl _wmktemp ( wchar_t pattern)

Definition at line 2260 of file file.c.

2261{
2262 int numX = 0;
2263 wchar_t *retVal = pattern;
2264 int id;
2265 wchar_t letter = 'a';
2266
2267 if(!pattern)
2268 return NULL;
2269
2270 while(*pattern)
2271 numX = (*pattern++ == 'X')? numX + 1 : 0;
2272 if (numX < 6)
2273 return NULL;
2274 pattern--;
2275 id = GetCurrentProcessId();
2276 numX = 6;
2277 while(numX--)
2278 {
2279 int tempNum = id / 10;
2280 *pattern-- = id - (tempNum * 10) + '0';
2281 id = tempNum;
2282 }
2283 pattern++;
2284 do
2285 {
2287 return retVal;
2288 *pattern = letter++;
2289 } while(letter != '|');
2290 return NULL;
2291}
#define NULL
Definition: types.h:112
GLuint id
Definition: glext.h:5910
DWORD WINAPI GetCurrentProcessId(void)
Definition: proc.c:1158

◆ _wopen()

_ACRTIMP int __cdecl _wopen ( const wchar_t path,
int  flags,
  ... 
)

Definition at line 2674 of file file.c.

2675{
2676 va_list ap;
2677
2678 if (flags & _O_CREAT)
2679 {
2680 int pmode;
2681 va_start(ap, flags);
2682 pmode = va_arg(ap, int);
2683 va_end(ap);
2684 return _wsopen( path, flags, _SH_DENYNO, pmode );
2685 }
2686 else
2687 return _wsopen( path, flags, _SH_DENYNO);
2688}
int WINAPIV _wsopen(const wchar_t *path, int oflags, int shflags,...)
Definition: file.c:2583
#define _SH_DENYNO
Definition: share.h:40
#define va_end(v)
Definition: stdarg.h:28
#define va_arg(v, l)
Definition: stdarg.h:27
#define va_start(v, l)
Definition: stdarg.h:26
char * va_list
Definition: vadefs.h:50
void int int ULONGLONG int va_list * ap
Definition: winesup.h:36

◆ _wrename()

_ACRTIMP int __cdecl _wrename ( const wchar_t oldpath,
const wchar_t newpath 
)

Definition at line 4993 of file file.c.

4994{
4995 TRACE(":from %s to %s\n", debugstr_w(oldpath), debugstr_w(newpath));
4996 if (MoveFileExW(oldpath, newpath, MOVEFILE_COPY_ALLOWED))
4997 return 0;
4998 TRACE(":failed (%ld)\n", GetLastError());
5000 return -1;
5001}
BOOL WINAPI MoveFileExW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName OPTIONAL, IN DWORD dwFlags)
Definition: move.c:1120
#define MOVEFILE_COPY_ALLOWED
Definition: filesup.h:29

Referenced by rename().

◆ _wsopen()

_ACRTIMP int __cdecl _wsopen ( const wchar_t path,
int  oflags,
int  shflags,
  ... 
)

Definition at line 2583 of file file.c.

2584{
2585 int pmode;
2586 int fd;
2587
2588 if (oflags & _O_CREAT)
2589 {
2590 va_list ap;
2591
2592 va_start(ap, shflags);
2593 pmode = va_arg(ap, int);
2594 va_end(ap);
2595 }
2596 else
2597 pmode = 0;
2598
2599 return _wsopen_dispatch(path, oflags, shflags, pmode, &fd, 0) ? -1 : fd;
2600}
int CDECL _wsopen_dispatch(const wchar_t *path, int oflags, int shflags, int pmode, int *fd, int secure)
Definition: file.c:2397
static int fd
Definition: io.c:51

◆ _wunlink()

_ACRTIMP int __cdecl _wunlink ( const wchar_t path)

Definition at line 1099 of file file.c.

1100{
1101 TRACE("(%s)\n", debugstr_w(path));
1102 if(DeleteFileW(path))
1103 return 0;
1104 TRACE("failed (%ld)\n", GetLastError());
1106 return -1;
1107}
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39

Referenced by _unlink(), _wremove(), and test_utf8().