#include <corecrt_internal.h>
#include <ctype.h>
#include <direct.h>
#include <errno.h>
Go to the source code of this file.
◆ _chdrive()
Definition at line 58 of file drive.cpp.
59{
60 if (drive_number < 1 || drive_number > 26)
61 {
64 }
65
66#pragma warning(suppress:__WARNING_UNUSED_ASSIGNMENT)
67 wchar_t const drive_letter =
static_cast<wchar_t>(
L'A' +
drive_number - 1);
68 wchar_t const drive_string[] = { drive_letter,
L':',
L'\0' };
69
71 {
73 return -1;
74 }
75
76 return 0;
77}
void __cdecl __acrt_errno_map_os_error(unsigned long)
#define _VALIDATE_RETURN(expr, errorcode, retexpr)
BOOL WINAPI SetCurrentDirectoryW(IN LPCWSTR lpPathName)
DWORD WINAPI GetLastError(void)
#define ERROR_INVALID_DRIVE
◆ _getdrive()
Definition at line 25 of file drive.cpp.
26{
28
31 {
33 }
34
35
36
37 __crt_unique_heap_ptr<wchar_t> const heap_cwd(_calloc_crt_t(wchar_t, cwd_length + 1));
38 if (heap_cwd.get() == nullptr)
39 {
41 return 0;
42 }
43
45 if (heap_cwd_length == 0)
46 {
48 return 0;
49 }
50
52}
#define GetCurrentDirectoryW(x, y)
static int __cdecl get_drive_number_from_path(wchar_t const *const path)
Referenced by _tgetdcwd(), _tstat64(), cmd_setlocal(), get_drive_number_from_path(), test_utf8(), and throw().
◆ get_drive_number_from_path()
Definition at line 13 of file drive.cpp.
14{
16 return 0;
17
19}
__forceinline int __CRTDECL __ascii_towupper(int const _C)
Referenced by _getdrive().