CmSetInstallerClassMappedProperty
NTSTATUS __stdcall CmSetInstallerClassMappedProperty(
HPNPCTX *hPnpCtx,
const WCHAR *ClassGuid,
VOID *ObjectBaseKey,
const WCHAR *PropertyLocaleName,
const _DEVPROPKEY *PropertyKey,
UINT8 *PropertyType,
UINT8 *PropertyBuffer,
UINT64 PropertySize){
NTSTATUS v11;
DEVPROPKEY **v12;
unsigned int v13;
DEVPROPKEY *v14;
const UINT8 *v15;
unsigned int v16;
_QWORD *v17;
__int64 v18;
NTSTATUS v19;
__int64 v21;
__int64 v22;
NTSTATUS v23;
DEVPROPKEY **v24;
unsigned int v25;
DEVPROPKEY *v26;
__int64 v27;
UINT64 v28;
UINT64 v29;
v11 = -1073741802;
if( !PropertyLocaleName )
{
v12 = &CmClassRegPropMap;
v13 = 0;
while( 1 )
{
v14 = *v12;
if( *v12 && PropertyKey->pid == v14->pid )
{
v21 = *(_QWORD *)&PropertyKey->fmtid.Data1 - *(_QWORD *)&v14->fmtid.Data1;
if( *(_QWORD *)&PropertyKey->fmtid.Data1 == *(_QWORD *)&v14->fmtid.Data1 )
v21 = *(_QWORD *)PropertyKey->fmtid.Data4 - *(_QWORD *)v14->fmtid.Data4;
if( !v21 )
break;
}
++v13;
v12 += 3;
if( v13 >= 9 )
goto LABEL_6;
}
LODWORD(v29) = PropertySize;
LODWORD(v28) = (_DWORD)PropertyType;
v11 = CmSetInstallerClassMappedPropertyFromRegProp(
hPnpCtx,
(WCHAR *)ClassGuid,
ObjectBaseKey,
(_DEVPROPKEY *)PropertyKey,
v28,
PropertyBuffer,
v29);
if( v11 != -1073741802 )
return v11;
LABEL_6:
v15 = &Create;
v16 = 0;
while( 1 )
{
v17 = *(_QWORD **)v15;
if( PropertyKey->pid == *(_DWORD *)(*(_QWORD *)v15 + 16i64) )
{
v18 = *(_QWORD *)&PropertyKey->fmtid.Data1 - *v17;
if( *(_QWORD *)&PropertyKey->fmtid.Data1 == *v17 )
v18 = *(_QWORD *)PropertyKey->fmtid.Data4 - v17[1];
if( !v18 )
break;
}
++v16;
v15 += 32;
if( v16 >= 0xD )
goto LABEL_25;
}
if( (unsigned int)PropertyType < 2 )
{
v19 = CmDeleteInstallerClassMappedPropertyFromRegValue(
hPnpCtx,
(WCHAR *)ClassGuid,
ObjectBaseKey,
(_DEVPROPKEY *)PropertyKey);
}
else
{
LODWORD(v29) = PropertySize;
LODWORD(v28) = (_DWORD)PropertyType;
v19 = CmSetInstallerClassMappedPropertyFromRegValue(
hPnpCtx,
ClassGuid,
ObjectBaseKey,
PropertyKey,
v28,
PropertyBuffer,
v29);
}
v11 = v19;
if( v19 >= 0 )
PnpObjectRaisePropertyChangeEvent(
(__int64)hPnpCtx,
(INT64)ClassGuid,
2i64,
(INT64)ObjectBaseKey,
0i64,
(__int64)PropertyKey);
if( v11 != -1073741802 )
return v11;
LABEL_25:
if( PropertyKey->pid != 2 )
goto LABEL_35;
v22 = *(_QWORD *)&PropertyKey->fmtid.Data1 - *(_QWORD *)&DEVPKEY_DeviceClass_ClassCoInstallers.fmtid.Data1;
if( *(_QWORD *)&PropertyKey->fmtid.Data1 == *(_QWORD *)&DEVPKEY_DeviceClass_ClassCoInstallers.fmtid.Data1 )
v22 = *(_QWORD *)PropertyKey->fmtid.Data4 - *(_QWORD *)DEVPKEY_DeviceClass_ClassCoInstallers.fmtid.Data4;
if( v22 )
goto LABEL_35;
if( (unsigned int)PropertyType < 2 )
v23 = CmDeleteInstallerClassMappedPropertyFromCoInstallers(hPnpCtx, (WCHAR *)ClassGuid);
else
v23 = CmSetInstallerClassMappedPropertyFromCoInstallers(
hPnpCtx,
(WCHAR *)ClassGuid,
(UINT64)v17,
(UINT8 *)(unsigned int)PropertyType,
(UINT64)PropertyBuffer);
v11 = v23;
if( v23 >= 0 )
PnpObjectRaisePropertyChangeEvent(
(__int64)hPnpCtx,
(INT64)ClassGuid,
2i64,
(INT64)ObjectBaseKey,
0i64,
(__int64)PropertyKey);
if( v11 == -1073741802 )
{
LABEL_35:
v24 = &off_140983F60;
v25 = 0;
while( 1 )
{
v26 = *v24;
if( PropertyKey->pid == (*v24)->pid )
{
v27 = *(_QWORD *)&PropertyKey->fmtid.Data1 - *(_QWORD *)&v26->fmtid.Data1;
if( *(_QWORD *)&PropertyKey->fmtid.Data1 == *(_QWORD *)&v26->fmtid.Data1 )
v27 = *(_QWORD *)PropertyKey->fmtid.Data4 - *(_QWORD *)v26->fmtid.Data4;
if( !v27 )
break;
}
++v25;
v24 += 2;
if( v25 >= 4 )
return v11;
}
return -1073741790;
}
}
return v11;
}Referenced by:
CmDeleteInstallerClassWorker
PnpDispatchInstallerClass