47 IN NTSTATUS ErrorCode,
56 USHORT numberOfStrings;
62 DBG_IRQL( <= DISPATCH_LEVEL);
71 stringSize1 = String1 ? (++numberOfStrings,
sizeof(WCHAR) * (wcslen(String1) + 1)) : 0;
76 stringSize2 = String2 ? (++numberOfStrings,
sizeof(WCHAR) * (wcslen(String2) + 1)) : 0;
81 stringSize = stringSize1 + stringSize2;
85 stringOffset =
sizeof(IO_ERROR_LOG_PACKET);
89 size = stringOffset + stringSize;
102 if (size <= ERROR_LOG_MAXIMUM_SIZE)
104 PIO_ERROR_LOG_PACKET pentry;
108 DBG_IRQL( <= DISPATCH_LEVEL);
109 pentry = IoAllocateErrorLogEntry(Fdo, (UCHAR) size);
116 RtlZeroMemory(pentry,
sizeof(*pentry));
120 pentry->NumberOfStrings = numberOfStrings;
121 pentry->StringOffset = stringOffset;
122 pentry->ErrorCode = ErrorCode;
128 wcscpy((
wchar_t*)&((UCHAR*)pentry)[stringOffset], String1);
135 wcscpy((
wchar_t*)&((UCHAR*)pentry)[stringOffset + stringSize1], String2);
140 DBG_IRQL( <= DISPATCH_LEVEL);
141 IoWriteErrorLogEntry(pentry);
Definitions for the opencbm driver.
VOID LogError(IN PDEVICE_OBJECT Fdo, IN NTSTATUS ErrorCode, const WCHAR *String1, const WCHAR *String2)
Log an error entry in the system log.