mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 10:43:05 +00:00
Create a branch for network fixes.
svn path=/branches/aicom-network-fixes/; revision=34994
This commit is contained in:
parent
0e213bbc00
commit
c501d8112c
18148 changed files with 0 additions and 860488 deletions
35
lib/sdk/crt/direct/getdrive.c
Normal file
35
lib/sdk/crt/direct/getdrive.c
Normal file
|
@ -0,0 +1,35 @@
|
|||
#include <precomp.h>
|
||||
#include <ctype.h>
|
||||
#include <direct.h>
|
||||
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*
|
||||
* _getdrive (MSVCRT.@)
|
||||
*
|
||||
* Get the current drive number.
|
||||
*
|
||||
* PARAMS
|
||||
* None.
|
||||
*
|
||||
* RETURNS
|
||||
* Success: The drive letter number from 1 to 26 ("A:" to "Z:").
|
||||
* Failure: 0.
|
||||
*/
|
||||
int _getdrive(void)
|
||||
{
|
||||
WCHAR buffer[MAX_PATH];
|
||||
if (GetCurrentDirectoryW( MAX_PATH, buffer ) &&
|
||||
buffer[0] >= 'A' && buffer[0] <= 'z' && buffer[1] == ':')
|
||||
return towupper(buffer[0]) - 'A' + 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
unsigned long _getdrives(void)
|
||||
{
|
||||
return GetLogicalDrives();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue