PipCommitPendingOsExtensionResource
NTSTATUS __stdcall PipCommitPendingOsExtensionResource(
PWCHAR ResourceId,
PVOID hPendingOsExtensionDbRoot,
PVOID hPendingExtensionResource,
PVOID Context){
__int64 v7;
NTSTATUS CachedContextBaseKey;
INT64 v9;
char *v11;
VOID *TargetKeyHandle;
void *v13;
void *v14;
void *v15;
v11 = 0i64;
v13 = 0i64;
TargetKeyHandle = 0i64;
v14 = 0i64;
v15 = 0i64;
CachedContextBaseKey = PnpCtxGetCachedContextBaseKey(PiPnpRtlCtx, 4, (__int64 *)&v11);
if( CachedContextBaseKey >= 0 )
{
if( !hPendingOsExtensionDbRoot )
{
CachedContextBaseKey = PnpCtxRegOpenKey(
PiPnpRtlCtx,
v11,
L"Control\\PendingDriverOperations\\OsExtensionDatabase",
0,
0x2001Fu,
&v14);
if( CachedContextBaseKey < 0 )
goto LABEL_14;
hPendingOsExtensionDbRoot = v14;
}
if( !hPendingExtensionResource )
{
CachedContextBaseKey = PnpCtxRegOpenKey(
PiPnpRtlCtx,
(char *)hPendingOsExtensionDbRoot,
ResourceId,
0,
0x20019u,
&v15);
if( CachedContextBaseKey < 0 )
goto LABEL_14;
hPendingExtensionResource = v15;
}
CachedContextBaseKey = PnpCtxRegCreateKey(
PiPnpRtlCtx,
(__int64)v11,
L"Control\\OsExtensionDatabase",
0,
0x20006u,
0i64,
&v13,
0i64);
if( CachedContextBaseKey >= 0 )
{
CachedContextBaseKey = PnpCtxRegCreateKey(
PiPnpRtlCtx,
(__int64)v13,
ResourceId,
0,
0x20006u,
0i64,
&TargetKeyHandle,
0i64);
if( CachedContextBaseKey >= 0 )
{
CachedContextBaseKey = PiDevCfgCopyDeviceKeys(hPendingExtensionResource, TargetKeyHandle, v9, 0i64);
if( CachedContextBaseKey >= 0 )
{
CachedContextBaseKey = PnpCtxRegDeleteTree(PiPnpRtlCtx, (char *)hPendingOsExtensionDbRoot, ResourceId);
if( CachedContextBaseKey >= 0 )
{
LODWORD(v11) = 0;
if( (unsigned int)PnpCtxRegEnumKey(v7, hPendingOsExtensionDbRoot, 0, 0i64, (unsigned int *)&v11) == -2147483622 )
PnpCtxRegDeleteKey(PiPnpRtlCtx, (char *)hPendingOsExtensionDbRoot, 0i64);
}
}
}
}
}
LABEL_14:
if( TargetKeyHandle )
PnpCtxRegCloseKey(v7, TargetKeyHandle);
if( v13 )
PnpCtxRegCloseKey(v7, v13);
if( v14 )
PnpCtxRegCloseKey(v7, v14);
if( v15 )
PnpCtxRegCloseKey(v7, v15);
return CachedContextBaseKey;
}Referenced by:
No references.