//
// get_drive_number_from_path from 0x180129640 to 0x1801296a3 (99 bytes)
//
// 3 xrefs:
// > common_stat<_stat64i32> @ 0x1801291cd
// > common_stat_handle_file_opened<_stat64i32> @ 0x180129277
// > ??> @ 0x180202aa4
//
// 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
//
char __fastcall get_drive_number_from_path(const wchar_t *const a1, int *a2)
{
int v3; // r8d
int v5; // ecx
int v6; // ecx
*a2 = 0;
v3 = *a1;
if ( ((unsigned int)(v3 - 65) <= 0x19 || (unsigned int)(v3 - 97) <= 0x19) && a1[1] == 58 )
{
if ( !a1[2] )
{
_acrt_errno_map_os_error(2);
return 0;
}
v5 = v3 + 32;
if ( (unsigned int)(v3 - 65) > 0x19 )
v5 = v3;
v6 = v5 - 96;
}
else
{
v6 = getdrive();
}
*a2 = v6;
return 1;
}