mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 15:53:03 +00:00
This really needs to go in a branch. It needs heavy testing and can't coincide with the current shell32 due to PSDK interface changes
svn path=/branches/shell32_new-bringup/; revision=51893
This commit is contained in:
parent
4596e5e59b
commit
4019caae75
23116 changed files with 0 additions and 1109022 deletions
38
lib/sdk/crt/direct/getdrive.c
Normal file
38
lib/sdk/crt/direct/getdrive.c
Normal file
|
@ -0,0 +1,38 @@
|
|||
#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 )>=2)
|
||||
{
|
||||
buffer[0]=towupper(buffer[0]);
|
||||
if (buffer[0] >= L'A' && buffer[0] <= L'Z' && buffer[1] == L':')
|
||||
return buffer[0] - L'A' + 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
unsigned long _getdrives(void)
|
||||
{
|
||||
return GetLogicalDrives();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue