ReactOS
0.4.16-dev-979-g79f281e
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
Variables
_
c
d
e
f
g
h
i
l
m
n
o
p
s
t
u
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
_
a
b
c
d
f
i
l
m
o
p
s
t
w
x
Enumerator
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
x
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Examples
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;
35
if
(!
SetCurrentDirectoryW
(
buffer
))
36
{
37
_dosmaperr
(
GetLastError
());
38
if
(newdrive <= 0)
39
{
40
_set_errno
(
EACCES
);
41
}
42
return
-1;
43
}
44
return
0;
45
}
EACCES
#define EACCES
Definition:
acclib.h:85
_chdrive
int _chdrive(int newdrive)
Definition:
chdrive.c:30
SetCurrentDirectoryW
BOOL WINAPI SetCurrentDirectoryW(IN LPCWSTR lpPathName)
Definition:
path.c:2249
buffer
GLuint buffer
Definition:
glext.h:5915
L
#define L(x)
Definition:
ntvdm.h:50
_dosmaperr
void _dosmaperr(unsigned long oserrcode)
Definition:
errno.c:79
_set_errno
errno_t __cdecl _set_errno(_In_ int _Value)
GetLastError
DWORD WINAPI GetLastError(void)
Definition:
except.c:1042
WCHAR
__wchar_t WCHAR
Definition:
xmlstorage.h:180
sdk
lib
crt
direct
chdrive.c
Generated on Sun Apr 13 2025 06:14:07 for ReactOS by
1.9.6