mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 18:23:07 +00:00
Create a branch for cmake bringup.
svn path=/branches/cmake-bringup/; revision=48236
This commit is contained in:
parent
a28e798006
commit
c424146e2c
20602 changed files with 0 additions and 1140137 deletions
45
lib/sdk/crt/direct/chdrive.c
Normal file
45
lib/sdk/crt/direct/chdrive.c
Normal file
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
* FILE: lib/crt/chdrive.c
|
||||
* PURPOSE: Change the current drive.
|
||||
* PROGRAMER: WINE
|
||||
* UPDATE HISTORY:
|
||||
* 25/11/05: Added license header
|
||||
*/
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*
|
||||
* _chdrive (MSVCRT.@)
|
||||
*
|
||||
* Change the current drive.
|
||||
*
|
||||
* PARAMS
|
||||
* newdrive [I] Drive number to change to (1 = 'A', 2 = 'B', ...)
|
||||
*
|
||||
* RETURNS
|
||||
* Success: 0. The current drive is set to newdrive.
|
||||
* Failure: -1. errno indicates the error.
|
||||
*
|
||||
* NOTES
|
||||
* See SetCurrentDirectoryA.
|
||||
*/
|
||||
int _chdrive(int newdrive)
|
||||
{
|
||||
WCHAR buffer[] = L"A:";
|
||||
|
||||
buffer[0] += newdrive - 1;
|
||||
if (!SetCurrentDirectoryW( buffer ))
|
||||
{
|
||||
_dosmaperr(GetLastError());
|
||||
if (newdrive <= 0)
|
||||
{
|
||||
__set_errno(EACCES);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue