projects
/
reactos.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Added binary and unicode file i/o support to msvcrt.
[reactos.git]
/
reactos
/
lib
/
msvcrt
/
direct
/
getdcwd.c
1
#include <windows.h>
2
#include <msvcrt/direct.h>
3
4
char
*
_getdcwd
(
int
nDrive
,
char
*
caBuffer
,
int
nBufLen
)
5
{
6
int
i
=
0
;
7
int
dr
=
_getdrive
();
8
9
if
(
nDrive
<
1
||
nDrive
>
26
)
10
return
NULL
;
11
if
(
dr
!=
nDrive
)
12
_chdrive
(
nDrive
);
13
i
=
GetCurrentDirectoryA
(
nBufLen
,
caBuffer
);
14
if
(
i
==
nBufLen
)
15
return
NULL
;
16
if
(
dr
!=
nDrive
)
17
_chdrive
(
dr
);
18
return
caBuffer
;
19
}