28#define IOP_MAXIMUM_LOG_SIZE (100 * PAGE_SIZE)
120 SecurityQos.
Length =
sizeof(SecurityQos);
150#define IO_ERROR_OBJECT_NAMES_LENGTH 100
159 ULONG RemainingLength;
162 ULONG DriverNameLength, DeviceNameLength;
167 ULONG ExtraStringLength;
195 if (!ListEntry)
break;
218 if (
Packet->NumberOfStrings)
243 DriverNameLength = 0; DeviceNameLength = 0;
244 PoolObjectNameInfo =
NULL;
260 DriverNameLength = 0;
264 if (!DriverNameLength)
274 DriverNameLength = 0;
278 NameString = ObjectNameInfo->Name.Buffer;
279 DriverNameLength = ObjectNameInfo->Name.Length;
286 NameString =
L"Application Popup";
291 if (DriverNameLength)
294 p = &NameString[DriverNameLength /
sizeof(
WCHAR)];
297 DriverNameLength =
sizeof(
WCHAR);
299 while ((*
p !=
L'\\') && (
p != NameString))
303 DriverNameLength +=
sizeof(
WCHAR);
310 DriverNameLength -=
sizeof(
WCHAR);
318 DriverNameLength =
min(DriverNameLength,
325 DriverNameLength +=
sizeof(
WCHAR);
329 RemainingLength -= DriverNameLength;
341 sizeof(
Buffer) - DriverNameLength,
346 RtlInitEmptyUnicodeString(&ObjectNameInfo->Name,
L"", 0);
355 if (PoolObjectNameInfo)
358 ObjectNameInfo = PoolObjectNameInfo;
366 ObjectNameInfo->Name.Length =
373 NameString = ObjectNameInfo->Name.Buffer;
374 DeviceNameLength = ObjectNameInfo->Name.Length;
380 DeviceNameLength = 0;
388 DeviceNameLength =
min(DeviceNameLength,
394 DeviceNameLength +=
sizeof(
WCHAR);
397 if (PoolObjectNameInfo)
400 PoolObjectNameInfo =
NULL;
406 RemainingLength -= DeviceNameLength;
409 if (
Packet->NumberOfStrings)
412 ExtraStringLength = LogEntry->
Size -
417 ExtraStringLength =
ROUND_UP(ExtraStringLength,
sizeof(
WCHAR));
420 if (ExtraStringLength > (RemainingLength -
sizeof(
UNICODE_NULL)))
423 MessageLength -= ExtraStringLength - RemainingLength;
424 ExtraStringLength = RemainingLength -
sizeof(
UNICODE_NULL);
440 MessageLength += DriverNameLength + DeviceNameLength;
448 Message->Header.u1.s1.TotalLength =
517 Irp->IoStatus.Information = 0;
579 if (!LogEntry)
return NULL;
591 LogEntry->
Size = LogEntrySize;
609 if (!ElEntry)
return;
634 if (!ElEntry)
return;
675 Irp->IoStatus.Information = 0;
714 DPRINT1(
"IoRaiseInformationalHardError: %lx, '%wZ'\n", ErrorStatus,
String);
static UNICODE_STRING PortName
VOID ErrorMessage(IN DWORD dwErrorCode, IN PCWSTR szFormat OPTIONAL,...)
_In_ ULONG _In_ BATTERY_QUERY_INFORMATION_LEVEL _In_ LONG _In_ ULONG _Out_ PULONG ReturnedLength
#define NT_SUCCESS(StatCode)
static const WCHAR Message[]
VOID NTAPI KeInitializeDpc(IN PKDPC Dpc, IN PKDEFERRED_ROUTINE DeferredRoutine, IN PVOID DeferredContext)
#define InsertHeadList(ListHead, Entry)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define IsListEmpty(ListHead)
#define PsGetCurrentThread()
struct _DEVICE_OBJECT * PDEVICE_OBJECT
#define KeReleaseSpinLock(sl, irql)
#define KeAcquireSpinLock(sl, irql)
#define KeQuerySystemTime(t)
#define RemoveHeadList(ListHead)
#define ROUND_UP(n, align)
IN OUT PVCB IN PDEVICE_OBJECT IN PVPB Vpb
#define ExAllocatePool(type, size)
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
PLIST_ENTRY NTAPI ExInterlockedInsertHeadList(IN OUT PLIST_ENTRY ListHead, IN OUT PLIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock)
#define InterlockedExchangeAdd
NTSYSAPI NTSTATUS NTAPI ZwRequestPort(_In_ HANDLE PortHandle, _In_ PPORT_MESSAGE LpcMessage)
NTSYSAPI NTSTATUS NTAPI ZwConnectPort(_Out_ PHANDLE PortHandle, _In_ PUNICODE_STRING PortName, _In_ PSECURITY_QUALITY_OF_SERVICE SecurityQos, _In_opt_ PPORT_VIEW ClientView, _In_opt_ PREMOTE_PORT_VIEW ServerView, _In_opt_ PULONG MaxMessageLength, _In_opt_ PVOID ConnectionInformation, _In_opt_ PULONG ConnectionInformationLength)
#define ExFreePoolWithTag(_P, _T)
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
VOID(NTAPI * PKNORMAL_ROUTINE)(IN PVOID NormalContext OPTIONAL, IN PVOID SystemArgument1 OPTIONAL, IN PVOID SystemArgument2 OPTIONAL)
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
struct _OBJECT_NAME_INFORMATION OBJECT_NAME_INFORMATION
struct _OBJECT_NAME_INFORMATION * POBJECT_NAME_INFORMATION
#define UNREFERENCED_PARAMETER(P)
struct _ERROR_LOG_ENTRY * PERROR_LOG_ENTRY
struct _ERROR_LOG_ENTRY ERROR_LOG_ENTRY
LIST_ENTRY IopErrorLogListHead
VOID NTAPI IoWriteErrorLogEntry(IN PVOID ElEntry)
VOID NTAPI IopRestartLogWorker(VOID)
VOID NTAPI IopLogWorker(IN PVOID Parameter)
BOOLEAN NTAPI IoSetThreadHardErrorMode(IN BOOLEAN HardErrorEnabled)
static VOID NTAPI IopFreeApc(IN PKAPC Apc, IN OUT PKNORMAL_ROUTINE *NormalRoutine, IN OUT PVOID *NormalContext, IN OUT PVOID *SystemArgument1, IN OUT PVOID *SystemArgument2)
VOID NTAPI IoRaiseHardError(IN PIRP Irp, IN PVPB Vpb, IN PDEVICE_OBJECT RealDeviceObject)
WORK_QUEUE_ITEM IopErrorLogWorkItem
PVOID NTAPI IoAllocateErrorLogEntry(IN PVOID IoObject, IN UCHAR EntrySize)
BOOLEAN IopLogPortConnected
KSPIN_LOCK IopLogListLock
struct _IOP_ERROR_LOG_WORKER_DPC * PIOP_ERROR_LOG_WORKER_DPC
struct _IOP_ERROR_LOG_WORKER_DPC IOP_ERROR_LOG_WORKER_DPC
PDEVICE_OBJECT IopErrorLogObject
BOOLEAN NTAPI IoRaiseInformationalHardError(IN NTSTATUS ErrorStatus, IN PUNICODE_STRING String, IN PKTHREAD Thread)
BOOLEAN NTAPI IopConnectLogPort(VOID)
static VOID NTAPI IopRaiseHardError(IN PVOID NormalContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
BOOLEAN IopLogWorkerRunning
PLIST_ENTRY NTAPI IopGetErrorLogEntry(VOID)
#define IO_ERROR_OBJECT_NAMES_LENGTH
VOID NTAPI IopLogDpcRoutine(IN PKDPC Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
#define IOP_MAXIMUM_LOG_SIZE
VOID NTAPI IoFreeErrorLogEntry(IN PVOID ElEntry)
#define IoCompleteRequest
BOOLEAN NTAPI KeInsertQueueApc(IN PKAPC Apc, IN PVOID SystemArgument1, IN PVOID SystemArgument2, IN KPRIORITY PriorityBoost)
VOID NTAPI KeInitializeApc(IN PKAPC Apc, IN PKTHREAD Thread, IN KAPC_ENVIRONMENT TargetEnvironment, IN PKKERNEL_ROUTINE KernelRoutine, IN PKRUNDOWN_ROUTINE RundownRoutine OPTIONAL, IN PKNORMAL_ROUTINE NormalRoutine, IN KPROCESSOR_MODE Mode, IN PVOID Context)
#define STATUS_NOT_IMPLEMENTED
NTSTATUS NTAPI ObQueryNameString(IN PVOID Object, OUT POBJECT_NAME_INFORMATION ObjectNameInfo, IN ULONG Length, OUT PULONG ReturnLength)
UNICODE_STRING DriverName
PDEVICE_OBJECT DeviceObject
PDRIVER_OBJECT DriverObject
ULONG HardErrorsAreDisabled
SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode
SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
BOOLEAN NTAPI KeSetTimer(IN OUT PKTIMER Timer, IN LARGE_INTEGER DueTime, IN PKDPC Dpc OPTIONAL)
VOID NTAPI KeInitializeTimer(OUT PKTIMER Timer)
#define RTL_CONSTANT_STRING(s)
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_INFO_LENGTH_MISMATCH
#define STATUS_FILE_CORRUPT_ERROR
#define ALIGN_UP_POINTER(ptr, type)
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
_Must_inspect_result_ _In_ PWDF_DPC_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFDPC * Dpc
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
VOID NTAPI ExQueueWorkItem(IN PWORK_QUEUE_ITEM WorkItem, IN WORK_QUEUE_TYPE QueueType)
#define ExInitializeWorkItem(Item, Routine, Context)
_In_opt_ PVPB _In_ PDEVICE_OBJECT RealDeviceObject
struct _DRIVER_OBJECT * PDRIVER_OBJECT
#define ERROR_LOG_MAXIMUM_SIZE
#define IO_TYPE_ERROR_LOG
#define IO_TYPE_ERROR_MESSAGE
#define IO_ERROR_LOG_MESSAGE_LENGTH
struct _IO_ERROR_LOG_MESSAGE IO_ERROR_LOG_MESSAGE
struct _IO_ERROR_LOG_PACKET * PIO_ERROR_LOG_PACKET
#define IO_DISK_INCREMENT
struct _IO_ERROR_LOG_PACKET IO_ERROR_LOG_PACKET
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
_In_opt_ PVOID _In_opt_ PVOID SystemArgument1
_In_opt_ PVOID DeferredContext
_In_opt_ PVOID _In_opt_ PVOID _In_opt_ PVOID SystemArgument2
#define ObDereferenceObject
#define ObReferenceObject
_Inout_opt_ PVOID Parameter
#define SECURITY_DYNAMIC_TRACKING