ReactOS
0.4.16-dev-122-g325d74c
getdrive.c
Go to the documentation of this file.
1
#include <precomp.h>
2
#include <ctype.h>
3
#include <
direct.h
>
4
5
6
/*
7
* @implemented
8
*
9
* _getdrive (MSVCRT.@)
10
*
11
* Get the current drive number.
12
*
13
* PARAMS
14
* None.
15
*
16
* RETURNS
17
* Success: The drive letter number from 1 to 26 ("A:" to "Z:").
18
* Failure: 0.
19
*/
20
int
_getdrive
(
void
)
21
{
22
WCHAR
buffer
[
MAX_PATH
];
23
if
(
GetCurrentDirectoryW
(
MAX_PATH
,
buffer
)>=2)
24
{
25
buffer
[0]=
towupper
(
buffer
[0]);
26
if
(
buffer
[0] >=
L
'A'
&&
buffer
[0] <=
L
'Z'
&&
buffer
[1] ==
L
':'
)
27
return
buffer
[0] -
L
'A'
+ 1;
28
}
29
return
0;
30
}
31
32
/*
33
* @implemented
34
*/
35
unsigned
long
_getdrives
(
void
)
36
{
37
return
GetLogicalDrives
();
38
}
direct.h
GetCurrentDirectoryW
#define GetCurrentDirectoryW(x, y)
Definition:
compat.h:756
MAX_PATH
#define MAX_PATH
Definition:
compat.h:34
_getdrive
int _getdrive(void)
Definition:
getdrive.c:20
_getdrives
unsigned long _getdrives(void)
Definition:
getdrive.c:35
buffer
GLuint buffer
Definition:
glext.h:5915
L
#define L(x)
Definition:
ntvdm.h:50
towupper
#define towupper(c)
Definition:
wctype.h:99
GetLogicalDrives
DWORD WINAPI GetLogicalDrives(void)
Definition:
disk.c:110
WCHAR
__wchar_t WCHAR
Definition:
xmlstorage.h:180
sdk
lib
crt
direct
getdrive.c
Generated on Sun Oct 13 2024 06:13:11 for ReactOS by
1.9.6