IopExecuteHardwareProfileChange
NTSTATUS __stdcall IopExecuteHardwareProfileChange(
WCHAR **ProfileSerialNumbers,
UINT64 SerialNumbersCount,
VOID **NewProfile,
UINT8 *ProfileChanged){
__int64 v5;
VOID **PoolWithTag;
VOID **v7;
NTSTATUS v8;
__int16 v9;
_UNICODE_STRING *v10;
__int64 v11;
__int64 v12;
_UNICODE_STRING *v13;
__int64 v14;
_UNICODE_STRING *v15;
_UNICODE_STRING v16;
int v17;
VOID **v18;
__int64 v19;
int v20;
unsigned int v21;
VOID **v22;
__int64 v23;
unsigned __int16 *v24;
_WORD *v25;
_WORD *v26;
const VOID **v27;
__int64 v28;
__int64 v29;
VOID **v31;
_BYTE *v33;
v5 = (unsigned int)NewProfile;
PoolWithTag = ExAllocatePoolWithTag(0x200ui64, (unsigned int)(16 * (_DWORD)NewProfile), 863006288i64);
v31 = PoolWithTag;
v7 = PoolWithTag;
if( !PoolWithTag )
return -1073741670;
v9 = 1;
if( (_DWORD)v5 )
{
v10 = (_UNICODE_STRING *)PoolWithTag;
v11 = v5;
v12 = v5;
do
{
RtlInitUnicodeString(v10++, *(PCWSTR *)SerialNumbersCount);
SerialNumbersCount += 8i64;
--v12;
}
while( v12 );
do
{
if( (_DWORD)v5 != 1 )
{
v13 = (_UNICODE_STRING *)v7;
v14 = (unsigned int)(v5 - 1);
v15 = (_UNICODE_STRING *)(v7 + 2);
do
{
if( RtlCompareUnicodeString(v15 - 1, v15, 0) > 0 )
{
v16 = *v15;
*v15 = *v13;
*v13 = v16;
}
++v15;
++v13;
--v14;
}
while( v14 );
}
--v11;
}
while( v11 );
}
v17 = 0;
if( (_DWORD)v5 )
{
v18 = v7;
v19 = v5;
do
{
v20 = *(unsigned __int16 *)v18;
v18 += 2;
v17 += v20;
--v19;
}
while( v19 );
}
v21 = v17 + 2;
v22 = ExAllocatePoolWithTag(0x200ui64, v21 + 6i64, 863006288i64);
v24 = (unsigned __int16 *)v22;
if( v22 )
{
v25 = (_WORD *)v22 + 2;
v26 = (_WORD *)v22 + 2;
if( (_DWORD)v5 )
{
v27 = (const VOID **)v7;
v28 = v5;
do
{
v29 = *(unsigned __int16 *)v27;
memmove(v26, v27[1], *(unsigned __int16 *)v27);
v26 = (_WORD *)((char *)v26 + v29);
v27 += 2;
--v28;
}
while( v28 );
v7 = v31;
v25 = v24 + 2;
}
*v26 = 0;
v24[1] = v21;
if( (unsigned int)v5 > 1 || *v25 )
v9 = 2;
*v24 = v9;
v8 = CmSetAcpiHwProfile(
v24,
(__int64(__fastcall *)(INT64, char *, _QWORD))IopExecuteHwpDefaultSelect,
v23,
(__int64)ProfileChanged,
v33);
}
else
{
v8 = -1073741670;
}
ExFreePoolWithTag(v7, 0x33706E50u);
if( v24 )
ExFreePoolWithTag(v24, 0x33706E50u);
return v8;
}Referenced by:
PnpProfileUpdateHardwareProfile