PnpGetGenericStorePropertyKeys
signed int __fastcall PnpGetGenericStorePropertyKeys(
__int64 a1,
VOID *a2,
const wchar_t *a3,
char a4,
__int64 arg20,
int arg28,
__int64 arg30){
char v7;
const wchar_t *v8;
VOID *v9;
signed int result;
unsigned int i;
NTSTATUS v13;
__int64 v14;
unsigned int v15;
NTSTATUS v16;
__int64 v17;
__int64 v18;
ULONG v19;
NTSTATUS v20;
bool v21;
int v22;
__int64 v23;
__int64 v24;
INT64 a5;
int a6;
INT64 a6a;
INT64 a7;
INT64 v29;
UINT64 KeyNameLength;
char Value[12];
INT64 v33;
VOID *hKey;
_SIZE_T pcchLength;
const wchar_t *v36;
_UNICODE_STRING DestinationString;
__int64 v38;
_GUID Guid;
WCHAR SourceString[16];
WCHAR KeyName[40];
char v42[176];
v7 = 0;
v36 = a3;
v8 = a3;
*(_DWORD *)arg30 = 0;
v9 = a2;
v38 = arg20;
hKey = 0i64;
v33 = 0i64;
HIDWORD(KeyNameLength) = 0;
memset(Value, 0, sizeof(Value));
Guid = 0i64;
DestinationString = 0i64;
if( !a3 || (result = RtlUnalignedStringCchLengthW(a3, 85, &pcchLength), result >= 0) )
{
result = PnpOpenPropertiesKey(a1, v9, 0i64, 9u, 0, a6, (INT64)&hKey);
if( result == -1073741772 )
return 0;
if( result >= 0 )
{
for( i = 0; ; i = pcchLength )
{
while( 1 )
{
do
{
LODWORD(KeyNameLength) = 39;
v13 = RegRtlEnumKey(hKey, i++, KeyName, &KeyNameLength, a5, a6a, a7, v29);
pcchLength = i;
}
while( v13 == -1073741789 );
if( v13 )
{
ZwClose((_HANDLE)hKey);
return(unsigned int)arg28 < *(_DWORD *)arg30 ? 0xC0000023 : 0;
}
if( RtlInitUnicodeStringEx(&DestinationString, KeyName) >= 0
&& RtlGUIDFromString(&DestinationString, &Guid) >= 0 )
{
v14 = 0i64;
if( a1 )
v14 = *(_QWORD *)(a1 + 224);
if( SysCtxRegOpenKey(v14, hKey, KeyName, 0, 9u, (VOID **)&v33) >= 0 )
break;
}
}
v15 = 0;
while( 1 )
{
do
{
LODWORD(KeyNameLength) = 9;
v16 = RegRtlEnumKey((VOID *)v33, v15++, SourceString, &KeyNameLength, a5, a6a, a7, v29);
}
while( v16 == -1073741789 );
if( v16 )
break;
if( RtlInitUnicodeStringEx(&DestinationString, SourceString) >= 0
&& RtlUnicodeStringToInteger(&DestinationString, 0x10ui64, (UINT64 *)Value) >= 0 )
{
v17 = 0i64;
if( a1 )
v17 = *(_QWORD *)(a1 + 224);
if( SysCtxRegOpenKey(v17, (VOID *)v33, SourceString, 0, 1u, (VOID **)&Value[4]) >= 0 )
{
if( a4 )
{
v19 = 0;
do
{
v29 = 0i64;
LODWORD(KeyNameLength) = 85;
v20 = PnpCtxRegEnumValue(
v18,
*(_HANDLE *)&Value[4],
v19++,
v42,
(INT64)&KeyNameLength,
(char *)&KeyNameLength + 4,
0i64);
}
while( v20 == -1073741789 );
v8 = v36;
v21 = v20 == 0;
}
else
{
LODWORD(KeyNameLength) = 0;
v22 = RegRtlQueryValue(
*(VOID **)&Value[4],
v8,
(_DWORD *)&KeyNameLength + 1,
0i64,
(__int64)&KeyNameLength);
if( !v22 )
goto LABEL_31;
v21 = v22 == -1073741789;
}
if( v21 )
LABEL_31:
v7 = 1;
ZwClose(*(_HANDLE *)&Value[4]);
v21 = v7 == 0;
v7 = 0;
if( !v21 )
{
v23 = *(unsigned int *)arg30;
if( (unsigned int)v23 < arg28 )
{
v24 = v38;
*(_GUID *)(v38 + 20 * v23) = Guid;
*(_DWORD *)(v24 + 20i64 * *(unsigned int *)arg30 + 16) = *(_DWORD *)Value;
LODWORD(v23) = *(_DWORD *)arg30;
}
*(_DWORD *)arg30 = v23 + 1;
v7 = 0;
}
}
}
}
ZwClose(v33);
}
}
}
return result;
}Referenced by:
DrvDbDeleteObjectSubKey
PiCreateDriverSwDeviceCallback
PiDevCfgCopyObjectProperties
PiDqPnPGetObjectPropertyKeys
PnpGetObjectPropertyKeysWorker