ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

getcwd.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 doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.