PpReleaseBootDDB

INT64 __fastcall PpReleaseBootDDB(){
  _ETHREAD *CurrentThread; 
  unsigned int v1; 
  CurrentThread = (_ETHREAD *)KeGetCurrentThread();
  --*((_WORD *)CurrentThread + 242);
  ExAcquireResourceExclusiveLite(&PiDDBLock, 1u);
  if( PpDDBHandle )
  {
    SdbReleaseDatabase(PpDDBHandle);
    PpDDBHandle = 0i64;
    ExFreePoolWithTag(PpBootDDB, 0);
    PpBootDDB = 0i64;
    v1 = 0;
  }
  else
  {
    v1 = -1073741823;
  }
  if( PpDDBPatchHandle )
  {
    SdbReleaseDatabase(PpDDBPatchHandle);
    PpDDBPatchHandle = 0i64;
    ExFreePoolWithTag(PpBootDDBPatch, 0);
    PpBootDDBPatch = 0i64;
  }
  ExReleaseResourceLite(&PiDDBLock);
  KeLeaveCriticalRegionThread((__int64)KeGetCurrentThread());
  return v1;
}

Referenced by:

PnpCompleteSystemStartProcess