ReactOS  0.4.15-dev-1150-g593bcce
getcwd.c
Go to the documentation of this file.
1 #include <precomp.h>
2 #include <direct.h>
3 #include <process.h>
4 #include <tchar.h>
5 
6 /*
7  * @implemented
8  */
10 {
13 
14  if (dir_len == 0)
15  {
17  return NULL; /* FIXME: Real return value untested */
18  }
19 
20  if (!buf)
21  {
22  return _tcsdup(dir);
23  }
24 
25  if (dir_len >= (DWORD)size)
26  {
28  return NULL; /* buf too small */
29  }
30 
31  _tcscpy(buf,dir);
32  return buf;
33 }
errno_t __cdecl _set_errno(_In_ int _Value)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
_TCHAR * _tcscpy(_TCHAR *to, const _TCHAR *from)
Definition: tcscpy.h:8
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
#define _tcsdup
Definition: tchar.h:625
#define GetCurrentDirectory
Definition: winbase.h:3645
smooth NULL
Definition: ftsmooth.c:416
unsigned int dir
Definition: maze.c:112
char _TCHAR
Definition: tchar.h:1392
GLsizeiptr size
Definition: glext.h:5919
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ERANGE
Definition: acclib.h:92
void _dosmaperr(unsigned long oserrcode)
Definition: errno.c:81
_TCHAR * _tgetcwd(_TCHAR *buf, int size)
Definition: getcwd.c:9