//
// fclose from 0x18012fa80 to 0x18012fae2 (98 bytes)
//
// 3 xrefs:
// > sub_180043D20 @ 0x180043e3d
// > _fcloseall @ 0x180138711
// > ??> @ 0x180202dd4
//
// 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
//
int __cdecl fclose(FILE *Stream)
{
int v3; // edi
if ( !Stream )
{
*errno() = 22;
invalid_parameter_noinfo();
return -1;
}
if ( (HIDWORD(Stream->_base) & 0x1000) != 0 )
{
__acrt_stdio_free_stream(Stream);
return -1;
}
sub_18012F9E4((__int64)Stream);
v3 = fclose_nolock(Stream);
sub_18012F9F0((__int64)Stream);
return v3;
}