//
// _fclose_nolock from 0x18012f9fc to 0x18012fa7f (131 bytes)
//
// 2 xrefs:
// > fclose @ 0x18012facf
// > ??> @ 0x180202dc8
//
// 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:58 +0000
//
int __cdecl fclose_nolock(FILE *Stream)
{
int v3; // edi
unsigned int v4; // eax
char *tmpfname; // rcx
if ( Stream )
{
v3 = -1;
if ( (HIDWORD(Stream->_base) & 0x2000) != 0 )
{
v3 = _acrt_stdio_flush_nolock(Stream);
_acrt_stdio_free_buffer_nolock(Stream);
v4 = fileno(Stream);
if ( (int)sub_180138B78(v4) >= 0 )
{
tmpfname = Stream->_tmpfname;
if ( tmpfname )
{
free_base(tmpfname);
Stream->_tmpfname = nullptr;
}
}
else
{
v3 = -1;
}
}
__acrt_stdio_free_stream(Stream);
return v3;
}
else
{
*errno() = 22;
invalid_parameter_noinfo();
return -1;
}
}