//
// is_usable_drive_or_unc_root from 0x180129748 to 0x180129851 (265 bytes)
//
// 2 xrefs:
// > common_stat<_stat64i32> @ 0x180129190
// > ??> @ 0x180202ab0
//
// 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
//
bool __fastcall is_usable_drive_or_unc_root(const wchar_t *Path)
{
wchar_t *v2; // rax
wchar_t *v3; // rbx
int v4; // ebp
wchar_t *v5; // rdi
__int64 v6; // rax
char v7; // di
wchar_t Buffer[264]; // [rsp+20h] [rbp-238h] BYREF
v2 = wcspbrk(Path, L"./\\");
if ( v2 )
{
v3 = nullptr;
v4 = *errno();
*errno() = 0;
v5 = wfullpath(Buffer, Path, 0x104u);
if ( v5 )
{
*errno() = v4;
}
else
{
if ( *errno() != 34 )
{
LABEL_12:
v7 = 0;
LABEL_13:
free(v3);
LOBYTE(v2) = v7;
return (char)v2;
}
*errno() = v4;
v3 = wfullpath(nullptr, Path, 0);
v5 = v3;
}
if ( v5 )
{
v6 = -1;
do
++v6;
while ( v5[v6] );
if ( v6 == 3 || is_root_unc_name(v5) )
{
v7 = 1;
if ( GetDriveTypeW(Path) > 1 )
goto LABEL_13;
}
}
goto LABEL_12;
}
return (char)v2;
}