PiCMCaptureInterfaceAliasInputData
__int64 __fastcall PiCMCaptureInterfaceAliasInputData(unsigned __int64 a1, unsigned int a2, int a3, __int64 a4){
int v5;
char CallerMode;
NTSTATUS UserModeCallersCopy;
unsigned __int64 v8;
_QWORD *v9;
VOID *v10;
UINT64 v11;
unsigned __int64 v13;
UINT64 AllocateDestination;
v5 = 0;
CallerMode = KeGetCurrentThread()->PreviousMode;
UserModeCallersCopy = 0;
if( !a1 || !a2 )
{
UserModeCallersCopy = -1073741811;
goto LABEL_19;
}
if( a3 )
{
if( (a1 & 3) != 0 )
ExRaiseDatatypeMisalignment();
v13 = a1 + a2;
if( v13 > 0x7FFFFFFF0000i64 || v13 < a1 )
MEMORY[0x7FFFFFFF0000] = 0;
if( a2 >= 0x24 && *(_DWORD *)a1 == 36 )
{
*(_DWORD *)a4 = 40;
*(_DWORD *)(a4 + 4) = *(_DWORD *)(a1 + 4);
*(_OWORD *)(a4 + 8) = *(_OWORD *)(a1 + 8);
*(_QWORD *)(a4 + 24) = *(unsigned int *)(a1 + 24);
*(_DWORD *)(a4 + 32) = *(_DWORD *)(a1 + 28);
*(_DWORD *)(a4 + 36) = *(_DWORD *)(a1 + 32);
}
else
{
UserModeCallersCopy = -1073741811;
}
}
else
{
if( (a1 & 7) != 0 )
ExRaiseDatatypeMisalignment();
v8 = a1 + a2;
if( v8 > 0x7FFFFFFF0000i64 || v8 < a1 )
MEMORY[0x7FFFFFFF0000] = 0;
if( a2 < 0x28 )
{
UserModeCallersCopy = -1073741811;
}
else
{
*(_OWORD *)a4 = *(_OWORD *)a1;
*(_OWORD *)(a4 + 16) = *(_OWORD *)(a1 + 16);
*(_QWORD *)(a4 + 32) = *(_QWORD *)(a1 + 32);
if( *(_DWORD *)a4 != 40 )
UserModeCallersCopy = -1073741811;
}
}
if( UserModeCallersCopy >= 0 )
{
v9 = (_QWORD *)(a4 + 24);
v10 = *(VOID **)(a4 + 24);
*(_QWORD *)(a4 + 24) = 0i64;
if( v10 )
{
v11 = *(unsigned int *)(a4 + 32);
if( (unsigned int)v11 >= 2 )
{
LODWORD(AllocateDestination) = 1;
UserModeCallersCopy = PiControlMakeUserModeCallersCopy(
(VOID **)(a4 + 24),
v10,
v11,
2ui64,
CallerMode,
AllocateDestination);
if( UserModeCallersCopy < 0 )
{
*v9 = 0i64;
*(_DWORD *)(a4 + 32) = 0;
}
else
{
v5 = 1;
*(_WORD *)(*v9 + 2 * ((unsigned __int64)*(unsigned int *)(a4 + 32) >> 1) - 2) = 0;
}
LABEL_19:
if( UserModeCallersCopy >= 0 )
return(unsigned int)UserModeCallersCopy;
goto LABEL_36;
}
if( *(_DWORD *)(a4 + 32) >= 2u )
goto LABEL_19;
}
else if( !*(_DWORD *)(a4 + 32) )
{
goto LABEL_19;
}
UserModeCallersCopy = -1073741811;
}
LABEL_36:
if( v5 )
PiControlFreeUserModeCallersBuffer(CallerMode, *(PVOID *)(a4 + 24));
*(_OWORD *)a4 = 0i64;
*(_OWORD *)(a4 + 16) = 0i64;
*(_QWORD *)(a4 + 32) = 0i64;
return(unsigned int)UserModeCallersCopy;
}Referenced by:
PiCMGetDeviceInterfaceAlias