//
// _validdrive from 0x18013c034 to 0x18013c0b4 (128 bytes)
//
// 2 xrefs:
// > common_getdcwd @ 0x18013bf25
// > ??> @ 0x180203998
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall validdrive(unsigned int a1)
{
unsigned int v2; // ebx
WCHAR RootPathName; // [rsp+20h] [rbp-18h] BYREF
int v4; // [rsp+22h] [rbp-16h]
__int16 v5; // [rsp+26h] [rbp-12h]
if ( a1 <= 0x1A )
{
v2 = 0;
if ( a1 )
{
v4 = 6029370;
RootPathName = a1 + 64;
v5 = 0;
LOBYTE(v2) = GetDriveTypeW(&RootPathName) >= 2;
return v2;
}
else
{
return 1;
}
}
else
{
*_doserrno() = 15;
*errno() = 13;
invalid_parameter_noinfo();
return 0;
}
}