Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygengetcwd.c
Go to the documentation of this file.
00001 #include <precomp.h> 00002 #include <direct.h> 00003 #include <process.h> 00004 #include <tchar.h> 00005 00006 /* 00007 * @implemented 00008 */ 00009 _TCHAR* _tgetcwd(_TCHAR* buf, int size) 00010 { 00011 _TCHAR dir[MAX_PATH]; 00012 DWORD dir_len = GetCurrentDirectory(MAX_PATH,dir); 00013 00014 if (dir_len == 0) 00015 { 00016 _dosmaperr(GetLastError()); 00017 return NULL; /* FIXME: Real return value untested */ 00018 } 00019 00020 if (!buf) 00021 { 00022 return _tcsdup(dir); 00023 } 00024 00025 if (dir_len >= (DWORD)size) 00026 { 00027 _set_errno(ERANGE); 00028 return NULL; /* buf too small */ 00029 } 00030 00031 _tcscpy(buf,dir); 00032 return buf; 00033 } Generated on Sun May 27 2012 04:36:27 for ReactOS by
1.7.6.1
|