ReactOS  0.4.14-dev-376-gaedba84
chdrive.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS system libraries
4  * FILE: lib/sdk/crt/direct/chdrive.c
5  * PURPOSE: Change the current drive.
6  * PROGRAMER: WINE
7  * UPDATE HISTORY:
8  * 25/11/05: Added license header
9  */
10 
11 #include <precomp.h>
12 
13 /*
14  * @implemented
15  *
16  * _chdrive (MSVCRT.@)
17  *
18  * Change the current drive.
19  *
20  * PARAMS
21  * newdrive [I] Drive number to change to (1 = 'A', 2 = 'B', ...)
22  *
23  * RETURNS
24  * Success: 0. The current drive is set to newdrive.
25  * Failure: -1. errno indicates the error.
26  *
27  * NOTES
28  * See SetCurrentDirectoryA.
29  */
30 int _chdrive(int newdrive)
31 {
32  WCHAR buffer[] = L"A:";
33 
34  buffer[0] += newdrive - 1;
36  {
38  if (newdrive <= 0)
39  {
41  }
42  return -1;
43  }
44  return 0;
45 }
errno_t __cdecl _set_errno(_In_ int _Value)
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
GLuint buffer
Definition: glext.h:5915
int _chdrive(int newdrive)
Definition: chdrive.c:30
__wchar_t WCHAR
Definition: xmlstorage.h:180
Definition: arc.h:34
static const WCHAR L[]
Definition: oid.c:1250
void _dosmaperr(unsigned long oserrcode)
Definition: errno.c:81
BOOL WINAPI SetCurrentDirectoryW(IN LPCWSTR lpPathName)
Definition: path.c:2248