//
// common_lseek_nolock<__int64> from 0x180141fcc to 0x180142065 (153 bytes)
//
// 3 xrefs:
// > common_lseek<__int64> @ 0x180141f83
// > common_lseek_nolock<__int64> @ 0x180142070
// > ??> @ 0x180203cf8
//
// 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:55:05 +0000
//
LARGE_INTEGER __fastcall common_lseek_nolock<__int64>(int a1, LARGE_INTEGER a2, DWORD a3)
{
__int64 v3; // rbx
void *osfhandle; // rax
LARGE_INTEGER result; // rax
DWORD LastError; // eax
LARGE_INTEGER NewFilePointer; // [rsp+48h] [rbp+20h] BYREF
v3 = a1;
osfhandle = (void *)get_osfhandle(a1);
if ( osfhandle == (void *)-1LL )
{
*errno() = 9;
return (LARGE_INTEGER)-1LL;
}
if ( !SetFilePointerEx(osfhandle, a2, &NewFilePointer, a3) )
{
LastError = GetLastError();
_acrt_errno_map_os_error(LastError);
return (LARGE_INTEGER)-1LL;
}
result = NewFilePointer;
if ( NewFilePointer.QuadPart == -1 )
return (LARGE_INTEGER)-1LL;
*(_BYTE *)(qword_1801F5160[v3 >> 6] + 72 * (v3 & 0x3F) + 56) &= ~2u;
return result;
}