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

chdir.c
Go to the documentation of this file.
00001 #include <precomp.h>
00002 #include <tchar.h>
00003 #include <process.h>
00004 
00005 /*
00006  * @implemented
00007  */
00008 int _tchdir(const _TCHAR* _path)
00009 {
00010     WCHAR newdir[MAX_PATH];
00011 
00012     if (!SetCurrentDirectory(_path))
00013     {
00014         _dosmaperr(_path ? GetLastError() : 0);
00015         return -1;
00016     }
00017 
00018     /* Update the drive-specific current directory variable */
00019     if (GetCurrentDirectoryW(MAX_PATH, newdir) >= 2)
00020     {
00021         if (newdir[1] == L':')
00022         {
00023             WCHAR envvar[4] = { L'=', towupper(newdir[0]), L':', L'\0' };
00024             SetEnvironmentVariableW(envvar, newdir);
00025         }
00026     }
00027 
00028     return 0;
00029 }

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.