PfTLoggingWorker
VOID __fastcall PfTLoggingWorker(PVOID StartContext){
NTSTATUS v2;
int v3;
int v4;
unsigned int v5;
UINT8 v6;
int v7;
int v8;
NTSTATUS v9;
unsigned int v10;
UINT8 v11;
int v12;
int v13;
_LARGE_INTEGER Interval;
_LARGE_INTEGER Timeout;
VOID *Object[4];
_KWAIT_BLOCK WaitBlockArray;
Interval.QuadPart = -300000i64;
Timeout.QuadPart = -3000000000i64;
KeSetBasePriorityThread(KeGetCurrentThread(), 0xFFFFFFFFi64);
Object[0] = (char *)StartContext + 96;
Object[1] = (char *)StartContext + 32;
Object[2] = (char *)StartContext + 8;
Object[3] = PfKernelGlobals.gap10;
*(&stru_140C4DB30 + 978) = KiQueryUnbiasedInterruptTime(1u);
while( 1 )
{
do
{
v2 = KeWaitForMultipleObjects(4ui64, Object, WaitAny, Executive, 0, 0, &Timeout, &WaitBlockArray);
if( v2 == 258 )
v2 = 3;
}
while( v2 >= 4 );
KeResetEvent((_KEVENT *)Object[v2]);
if( !v2 )
break;
if( *(&stru_140C4DB30 + 2042) >= *(&stru_140C4DB30 + 2043) )
{
if( v2 == 1 )
goto LABEL_31;
}
else
{
v3 = v2 - 1;
if( v3 )
{
v4 = v3 - 1;
if( v4 )
{
if( v4 == 1 )
{
v5 = 0;
while( 1 )
{
v6 = PfpFlushBuffers();
v7 = v6;
if( !v6 && PfTGenerateTrace() == -1073741670 )
break;
++v5;
if( v7 || v5 >= 0x3E8 )
goto LABEL_13;
}
KeDelayExecutionThread(0, 0, &Interval);
LABEL_13:
if( KiQueryUnbiasedInterruptTime(1u) - *(&stru_140C4DB30 + 978) > 0xB2D05E00 )
PfTGenerateTrace();
}
}
else
{
v8 = PfpFlushBuffers();
v9 = PfTGenerateTrace();
if( !v8 )
{
if( v9 == -1073741670 )
KeDelayExecutionThread(0, 0, &Interval);
PfpFlushBuffers();
}
}
}
else
{
v10 = 0;
do
{
v11 = PfpFlushBuffers();
v12 = v11;
if( (!v11 || *((_DWORD *)StartContext + 20)) && PfTGenerateTrace() == -1073741670 )
{
KeDelayExecutionThread(0, 0, &Interval);
v13 = 1000;
}
else
{
v13 = 1;
}
v10 += v13;
}
while( !v12 && v10 < 0x2710 );
LABEL_31:
KeSetEvent((PRKEVENT)((char *)StartContext + 56), 0, 0);
}
}
}
}Referenced by:
No references.