CmAddPanelDeviceWorker
__int64 __fastcall CmAddPanelDeviceWorker(__int64 a1, const wchar_t *a2, const WCHAR *a3, _BYTE *a4){
int v8;
HANDLE v9;
int v10;
int Value;
__int64 v12;
__int64 v13;
ULONG v15;
HANDLE v16;
HANDLE Handle;
char v18;
v16 = 0i64;
Handle = 0i64;
v15 = 0;
*a4 = 0;
v18 = 0;
v8 = CmCreateDevicePanel(a1, a2, (__int64)a3, &v16, &v18);
v9 = v16;
v10 = v8;
if( v8 >= 0 )
{
v10 = PnpCtxRegCreateKey(a1, (__int64)v16, L"Devices", 0, 7u, 0i64, &Handle, &v15);
if( v10 >= 0 )
{
if( v15 == 2 )
{
LODWORD(v16) = 0;
Value = RegRtlQueryValue(Handle, a3, 0i64, 0i64, (__int64)&v16);
v10 = Value;
if( Value == -1073741772 || Value == -1073741444 )
{
v10 = 0;
}
else if( !Value )
{
*a4 = 1;
goto LABEL_24;
}
}
if( v10 >= 0 && !*a4 )
{
v10 = RegRtlSetValue(Handle, a3, 0, 0i64, 0);
if( v10 >= 0 )
PnpObjectRaisePropertyChangeEvent(a1, (__int64)a3, 1i64, 0i64, 0i64, (__int64)&DEVPKEY_Device_PanelId);
}
}
}
if( v10 == -1073741444 )
v10 = -1073741772;
if( v10 < 0 )
{
if( v15 == 1 )
{
if( a1 && (v12 = *(_QWORD *)(a1 + 224)) != 0 )
v13 = *(_QWORD *)(v12 + 8);
else
v13 = 0i64;
RegRtlDeleteKeyTransacted((char *)Handle, 0i64, v13);
}
if( v18 == 1 )
CmDeleteDevicePanel(a1, a2);
}
LABEL_24:
if( Handle )
ZwClose(Handle);
if( v9 )
ZwClose(v9);
return(unsigned int)v10;
}Referenced by:
CmAddPanelDevice