//
// 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 (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 10:54:56 +0000
//
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;
}