-/* $Id: errlog.c,v 1.19 2004/08/21 20:51:26 tamlin Exp $
+/* $Id: errlog.c,v 1.20 2004/09/28 12:51:14 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
KeInitializeTimer (&WorkerDpc->Timer);
/* Restart after 30 seconds */
-#if defined(__GNUC__)
- Timeout.QuadPart = -300000000LL;
-#else
- Timeout.QuadPart = -300000000;
-#endif
+ Timeout.QuadPart = (LONGLONG)-300000000;
KeSetTimer (&WorkerDpc->Timer,
Timeout,
&WorkerDpc->Dpc);
/* Release the work item */
ExFreePool (Parameter);
-
/* Connect to the error log port */
if (IopLogPortConnected == FALSE)
{
KeAcquireSpinLock (&IopAllocationLock,
&Irql);
- IopTotalLogSize -= LogEntry->PacketSize;
+ IopTotalLogSize -= (LogEntry->PacketSize - sizeof(ERROR_LOG_ENTRY));
ExFreePool (LogEntry);
KeReleaseSpinLock (&IopAllocationLock,
ULONG LogEntrySize;
KIRQL Irql;
- DPRINT1 ("IoAllocateErrorLogEntry() called\n");
+ DPRINT("IoAllocateErrorLogEntry() called\n");
if (IoObject == NULL)
return NULL;
return (PVOID)((ULONG_PTR)LogEntry + sizeof(ERROR_LOG_ENTRY));
}
+
/*
- * @unimplemented
+ * @implemented
*/
-VOID
-STDCALL
-IoFreeErrorLogEntry(
- PVOID ElEntry
- )
+VOID STDCALL
+IoFreeErrorLogEntry(IN PVOID ElEntry)
{
- UNIMPLEMENTED;
+ PERROR_LOG_ENTRY LogEntry;
+ KIRQL Irql;
+
+ DPRINT("IoFreeErrorLogEntry() called\n");
+
+ if (ElEntry == NULL)
+ return;
+
+ LogEntry = (PERROR_LOG_ENTRY)((ULONG_PTR)ElEntry - sizeof(ERROR_LOG_ENTRY));
+
+ KeAcquireSpinLock(&IopAllocationLock,
+ &Irql);
+
+ IopTotalLogSize -= (LogEntry->PacketSize - sizeof(ERROR_LOG_ENTRY));
+ ExFreePool(LogEntry);
+
+ KeReleaseSpinLock(&IopAllocationLock,
+ Irql);
}
+
/*
* @implemented
*/
PERROR_LOG_ENTRY LogEntry;
KIRQL Irql;
- DPRINT ("IoWriteErrorLogEntry() called\n");
+ DPRINT("IoWriteErrorLogEntry() called\n");
LogEntry = (PERROR_LOG_ENTRY)((ULONG_PTR)ElEntry - sizeof(ERROR_LOG_ENTRY));
KeReleaseSpinLock (&IopLogListLock,
Irql);
- DPRINT ("IoWriteErrorLogEntry() done\n");
+ DPRINT("IoWriteErrorLogEntry() done\n");
}
/* EOF */