ObpDeleteSymbolicLinkName

VOID __stdcall ObpDeleteSymbolicLinkName(_OBJECT_SYMBOLIC_LINK *SymbolicLink){
  unsigned int DosDeviceDriveIndex; 
  _DEVICE_MAP *v3; 
  _ESERVERSILO_GLOBALS *CurrentServerSiloGlobals; 
  _ETHREAD *CurrentThread; 
  _ESERVERSILO_GLOBALS *v6; 
  __int64 v7; 
  int v8; 

  DosDeviceDriveIndex = SymbolicLink->DosDeviceDriveIndex;
  if( DosDeviceDriveIndex )
  {
    v3 = *(_DEVICE_MAP **)(*(_QWORD *)((char *)&SymbolicLink[-2].AccessMask
                                     - *((unsigned __int8 *)&dword_140C25D60
                                       + (BYTE2(SymbolicLink[-1].CallbackContext) & 3)))
                         + 304i64);
    if( v3 )
    {
      CurrentServerSiloGlobals = PsGetCurrentServerSiloGlobals(&dword_140C25D60);
      CurrentThread = (_ETHREAD *)KeGetCurrentThread();
      v6 = CurrentServerSiloGlobals;
      --CurrentThread->Tcb.SpecialApcDisable;
      ExAcquirePushLockExclusiveEx(&CurrentServerSiloGlobals->ObSiloState.DeviceMapLock, 0i64);
      v7 = DosDeviceDriveIndex - 1;
      v8 = ~(1 << (DosDeviceDriveIndex - 1));
      v3->DriveMap &= v8;
      v3->DriveType[v7] = 0;
      if( v3 == v6->ObSiloState.SystemDeviceMap )
        v6->ObSiloState.SystemDosDeviceState.GlobalDeviceMap &= v8;
      else
        --v6->ObSiloState.SystemDosDeviceState.LocalDeviceCount[v7];
      ExReleasePushLockEx((_DWORD)v6 + 120, 0);
      KiLeaveGuardedRegionUnsafe((__int64)KeGetCurrentThread());
    }
    SymbolicLink->DosDeviceDriveIndex = 0;
  }
}

Referenced by:

ObCloseHandleTableEntry
ObShutdownSystem
ObpDeleteNameCheck
ObpMarkDirectoryObjectsTemporary