[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [win-pv-devel] [PATCH 1/2] Remove XenIfaceDebugPrint
From: Owen Smith <owen.smith@xxxxxxxxxx> Replace "XenIfaceDebugPrint(TRACE," with "Trace(" Replace "XenIfaceDebugPrint(INFO," with "Info(" Replace "XenIfaceDebugPrint(WARNING," with "Warning(" Replace "XenIfaceDebugPrint(ERROR," with "Error(" Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx> --- src/xeniface/fdo.c | 22 +++--- src/xeniface/ioctl_evtchn.c | 44 ++++++------ src/xeniface/ioctl_gnttab.c | 98 +++++++++++++-------------- src/xeniface/ioctl_sharedinfo.c | 4 +- src/xeniface/ioctl_store.c | 97 ++++++++++++++------------- src/xeniface/ioctl_suspend.c | 20 +++--- src/xeniface/ioctls.c | 14 ++-- src/xeniface/irp_queue.c | 3 +- src/xeniface/log.h | 38 ----------- src/xeniface/wmi.c | 144 ++++++++++++++++++++-------------------- 10 files changed, 221 insertions(+), 263 deletions(-) diff --git a/src/xeniface/fdo.c b/src/xeniface/fdo.c index c1c3901..7d8ee85 100644 --- a/src/xeniface/fdo.c +++ b/src/xeniface/fdo.c @@ -81,7 +81,7 @@ FdoInitialiseXSRegistryEntries( "/mh/boot-time/management-mac-address", &value); if (!NT_SUCCESS(status)){ - XenIfaceDebugPrint(ERROR, "no such xenstore key\n"); + Error("no such xenstore key\n"); goto failXS; } @@ -93,7 +93,7 @@ FdoInitialiseXSRegistryEntries( status = ZwOpenKey(&RegHandle, KEY_WRITE, &Attributes); if (!NT_SUCCESS(status)) { - XenIfaceDebugPrint(ERROR, "no such registry key %s\n", DriverParameters.RegistryPath); + Error("no such registry key %s\n", DriverParameters.RegistryPath); goto failReg; } @@ -101,17 +101,17 @@ FdoInitialiseXSRegistryEntries( RtlInitUnicodeString(&UnicodeValue, NULL); RtlInitAnsiString(&AnsiValue, value); - XenIfaceDebugPrint(ERROR, "About to convert unicode string\n"); + Error("About to convert unicode string\n"); status = RtlAnsiStringToUnicodeString(&UnicodeValue, &AnsiValue, TRUE); if (!NT_SUCCESS(status)) { - XenIfaceDebugPrint(ERROR, "Can't convert string\n"); + Error("Can't convert string\n"); goto failReg; } - XenIfaceDebugPrint(ERROR, "About to write unicode string\n"); + Error("About to write unicode string\n"); status = ZwSetValueKey(RegHandle, &UnicodeValueName, 0, REG_SZ, UnicodeValue.Buffer, UnicodeValue.Length+sizeof(WCHAR)); if (!NT_SUCCESS(status)) { - XenIfaceDebugPrint(ERROR, "Can't write key\n"); + Error("Can't write key\n"); goto failWrite; } @@ -124,17 +124,17 @@ FdoInitialiseXSRegistryEntries( failWrite: - XenIfaceDebugPrint(ERROR, "Fail : Write\n"); + Error("Fail : Write\n"); ZwClose(RegHandle); RtlFreeUnicodeString(&UnicodeValue); failReg: - XenIfaceDebugPrint(ERROR, "Fail : Reg\n"); + Error("Fail : Reg\n"); XENBUS_STORE(Free, &Fdo->StoreInterface, value); failXS: - XenIfaceDebugPrint(ERROR, "Failed to initialise registry (%08x)\n", status); + Error("Failed to initialise registry (%08x)\n", status); return; } @@ -161,7 +161,7 @@ static NTSTATUS FdoRegistryThreadHandler(IN PXENIFACE_THREAD Self, status = KeWaitForMultipleObjects(REGISTRY_EVENTS, (PVOID *)threadevents, WaitAny, Executive, KernelMode, TRUE, NULL, NULL); if ((status>=STATUS_WAIT_0) && (status < STATUS_WAIT_0+REGISTRY_EVENTS)) { if (status == STATUS_WAIT_0+REGISTRY_WRITE_EVENT) { - XenIfaceDebugPrint(ERROR,"WriteRegistry\n"); + Error("WriteRegistry\n"); FdoInitialiseXSRegistryEntries(Fdo); KeClearEvent(threadevents[REGISTRY_WRITE_EVENT]); } @@ -173,7 +173,7 @@ static NTSTATUS FdoRegistryThreadHandler(IN PXENIFACE_THREAD Self, } else if (!NT_SUCCESS(status)) { - XenIfaceDebugPrint(ERROR, "Registry handler thread failed %x\n", status); + Error("Registry handler thread failed %x\n", status); return status; } } diff --git a/src/xeniface/ioctl_evtchn.c b/src/xeniface/ioctl_evtchn.c index b9b0e27..0e51855 100644 --- a/src/xeniface/ioctl_evtchn.c +++ b/src/xeniface/ioctl_evtchn.c @@ -98,7 +98,7 @@ EvtchnFree( { ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL); - XenIfaceDebugPrint(TRACE, "Context %p, LocalPort %d, FO %p\n", + Trace("Context %p, LocalPort %d, FO %p\n", Context, Context->LocalPort, Context->FileObject); XENBUS_EVTCHN(Close, @@ -176,7 +176,7 @@ IoctlEvtchnBindUnbound( RtlZeroMemory(Context, sizeof(XENIFACE_EVTCHN_CONTEXT)); Context->FileObject = FileObject; - XenIfaceDebugPrint(TRACE, "> RemoteDomain %d, Mask %d, FO %p\n", + Trace("> RemoteDomain %d, Mask %d, FO %p\n", In->RemoteDomain, In->Mask, FileObject); status = ObReferenceObjectByHandle(In->Event, @@ -219,23 +219,23 @@ IoctlEvtchnBindUnbound( FALSE); } - XenIfaceDebugPrint(TRACE, "< LocalPort %lu, Context %p\n", Context->LocalPort, Context); + Trace("< LocalPort %lu, Context %p\n", Context->LocalPort, Context); return STATUS_SUCCESS; fail4: - XenIfaceDebugPrint(ERROR, "Fail4\n"); + Error("Fail4\n"); ObDereferenceObject(Context->Event); fail3: - XenIfaceDebugPrint(ERROR, "Fail3\n"); + Error("Fail3\n"); RtlZeroMemory(Context, sizeof(XENIFACE_EVTCHN_CONTEXT)); ExFreePoolWithTag(Context, XENIFACE_POOL_TAG); fail2: - XenIfaceDebugPrint(ERROR, "Fail2\n"); + Error("Fail2\n"); fail1: - XenIfaceDebugPrint(ERROR, "Fail1 (%08x)\n", status); + Error("Fail1 (%08x)\n", status); return status; } @@ -269,7 +269,7 @@ IoctlEvtchnBindInterdomain( RtlZeroMemory(Context, sizeof(XENIFACE_EVTCHN_CONTEXT)); Context->FileObject = FileObject; - XenIfaceDebugPrint(TRACE, "> RemoteDomain %d, RemotePort %lu, Mask %d, FO %p\n", + Trace("> RemoteDomain %d, RemotePort %lu, Mask %d, FO %p\n", In->RemoteDomain, In->RemotePort, In->Mask, FileObject); status = ObReferenceObjectByHandle(In->Event, @@ -313,24 +313,24 @@ IoctlEvtchnBindInterdomain( FALSE); } - XenIfaceDebugPrint(TRACE, "< LocalPort %lu, Context %p\n", Context->LocalPort, Context); + Trace("< LocalPort %lu, Context %p\n", Context->LocalPort, Context); return STATUS_SUCCESS; fail4: - XenIfaceDebugPrint(ERROR, "Fail4\n"); + Error("Fail4\n"); ObDereferenceObject(Context->Event); fail3: - XenIfaceDebugPrint(ERROR, "Fail3\n"); + Error("Fail3\n"); RtlZeroMemory(Context, sizeof(XENIFACE_EVTCHN_CONTEXT)); ExFreePoolWithTag(Context, XENIFACE_POOL_TAG); fail2: - XenIfaceDebugPrint(ERROR, "Fail2\n"); + Error("Fail2\n"); fail1: - XenIfaceDebugPrint(ERROR, "Fail1 (%08x)\n", status); + Error("Fail1 (%08x)\n", status); return status; } @@ -355,7 +355,7 @@ IoctlEvtchnClose( goto fail1; } - XenIfaceDebugPrint(TRACE, "> LocalPort %lu, FO %p\n", In->LocalPort, FileObject); + Trace("> LocalPort %lu, FO %p\n", In->LocalPort, FileObject); KeAcquireSpinLock(&Fdo->EvtchnLock, &Irql); status = STATUS_NOT_FOUND; @@ -370,11 +370,11 @@ IoctlEvtchnClose( return STATUS_SUCCESS; fail2: - XenIfaceDebugPrint(ERROR, "Fail2\n"); + Error("Fail2\n"); KeReleaseSpinLock(&Fdo->EvtchnLock, Irql); fail1: - XenIfaceDebugPrint(ERROR, "Fail1 (%08x)\n", status); + Error("Fail1 (%08x)\n", status); return status; } @@ -408,7 +408,7 @@ EvtchnNotify( return STATUS_SUCCESS; fail1: - XenIfaceDebugPrint(ERROR, "Fail1 (%08x)\n", status); + Error("Fail1 (%08x)\n", status); KeReleaseSpinLock(&Fdo->EvtchnLock, Irql); return status; } @@ -433,13 +433,13 @@ IoctlEvtchnNotify( } #if DBG - XenIfaceDebugPrint(INFO, "> LocalPort %d, FO %p\n", In->LocalPort, FileObject); + Info("> LocalPort %d, FO %p\n", In->LocalPort, FileObject); #endif return EvtchnNotify(Fdo, In->LocalPort, FileObject); fail1: - XenIfaceDebugPrint(ERROR, "Fail1 (%08x)\n", status); + Error("Fail1 (%08x)\n", status); return status; } @@ -464,7 +464,7 @@ IoctlEvtchnUnmask( goto fail1; } - XenIfaceDebugPrint(TRACE, "> LocalPort %d, FO %p\n", In->LocalPort, FileObject); + Trace("> LocalPort %d, FO %p\n", In->LocalPort, FileObject); KeAcquireSpinLock(&Fdo->EvtchnLock, &Irql); @@ -484,10 +484,10 @@ IoctlEvtchnUnmask( return STATUS_SUCCESS; fail2: - XenIfaceDebugPrint(ERROR, "Fail2\n"); + Error("Fail2\n"); KeReleaseSpinLock(&Fdo->EvtchnLock, Irql); fail1: - XenIfaceDebugPrint(ERROR, "Fail1 (%08x)\n", status); + Error("Fail1 (%08x)\n", status); return status; } diff --git a/src/xeniface/ioctl_gnttab.c b/src/xeniface/ioctl_gnttab.c index 02e9231..fbe33b7 100644 --- a/src/xeniface/ioctl_gnttab.c +++ b/src/xeniface/ioctl_gnttab.c @@ -60,11 +60,11 @@ CompleteGnttabIrp( // but we need to be there to unmap memory. ChangeProcess = PsGetCurrentProcess() != Id->Process; if (ChangeProcess) { - XenIfaceDebugPrint(TRACE, "Changing process from %p to %p\n", PsGetCurrentProcess(), Id->Process); + Trace("Changing process from %p to %p\n", PsGetCurrentProcess(), Id->Process); KeStackAttachProcess(Id->Process, &ApcState); } - XenIfaceDebugPrint(TRACE, "Irp %p, Process %p, Id %lu, Type %d, IRQL %d\n", + Trace("Irp %p, Process %p, Id %lu, Type %d, IRQL %d\n", Irp, Id->Process, Id->RequestId, Id->Type, KeGetCurrentIrql()); switch (Id->Type) { @@ -191,7 +191,7 @@ IoctlGnttabPermitForeignAccess( Context->NotifyOffset = In->NotifyOffset; Context->NotifyPort = In->NotifyPort; - XenIfaceDebugPrint(TRACE, "> RemoteDomain %d, NumberPages %lu, Flags 0x%x, Offset 0x%x, Port %d, Process %p, Id %lu\n", + Trace("> RemoteDomain %d, NumberPages %lu, Flags 0x%x, Offset 0x%x, Port %d, Process %p, Id %lu\n", Context->RemoteDomain, Context->NumberPages, Context->Flags, Context->NotifyOffset, Context->NotifyPort, Context->Id.Process, Context->Id.RequestId); @@ -237,7 +237,7 @@ IoctlGnttabPermitForeignAccess( // prefast somehow thinks that this call can modify Page... #pragma prefast(suppress:6385) - XenIfaceDebugPrint(INFO, "Grants[%lu] = %p\n", Page, Context->Grants[Page]); + Info("Grants[%lu] = %p\n", Page, Context->Grants[Page]); if (!NT_SUCCESS(status)) goto fail11; } @@ -261,7 +261,7 @@ IoctlGnttabPermitForeignAccess( if (Context->UserVa == NULL) goto fail13; - XenIfaceDebugPrint(TRACE, "< Context %p, Irp %p, KernelVa %p, UserVa %p\n", + Trace("< Context %p, Irp %p, KernelVa %p, UserVa %p\n", Context, Irp, Context->KernelVa, Context->UserVa); // Pass the result to user mode. @@ -277,7 +277,7 @@ IoctlGnttabPermitForeignAccess( } } except(EXCEPTION_EXECUTE_HANDLER) { status = GetExceptionCode(); - XenIfaceDebugPrint(ERROR, "Exception 0x%lx while probing/writing output buffer at %p, size 0x%lx\n", status, Out, OutLen); + Error("Exception 0x%lx while probing/writing output buffer at %p, size 0x%lx\n", status, Out, OutLen); goto fail14; } @@ -293,20 +293,20 @@ IoctlGnttabPermitForeignAccess( return STATUS_PENDING; fail15: - XenIfaceDebugPrint(ERROR, "Fail15\n"); + Error("Fail15\n"); fail14: - XenIfaceDebugPrint(ERROR, "Fail14\n"); + Error("Fail14\n"); MmUnmapLockedPages(Context->UserVa, Context->Mdl); fail13: - XenIfaceDebugPrint(ERROR, "Fail13\n"); + Error("Fail13\n"); fail12: - XenIfaceDebugPrint(ERROR, "Fail12\n"); + Error("Fail12\n"); fail11: - XenIfaceDebugPrint(ERROR, "Fail11: Page = %lu\n", Page); + Error("Fail11: Page = %lu\n", Page); while (Page > 0) { ASSERT(NT_SUCCESS(XENBUS_GNTTAB(RevokeForeignAccess, @@ -320,39 +320,39 @@ fail11: IoFreeMdl(Context->Mdl); fail10: - XenIfaceDebugPrint(ERROR, "Fail10\n"); + Error("Fail10\n"); ExFreePoolWithTag(Context->KernelVa, XENIFACE_POOL_TAG); fail9: - XenIfaceDebugPrint(ERROR, "Fail9\n"); + Error("Fail9\n"); ExFreePoolWithTag(Context->Grants, XENIFACE_POOL_TAG); fail8: - XenIfaceDebugPrint(ERROR, "Fail8\n"); + Error("Fail8\n"); fail7: - XenIfaceDebugPrint(ERROR, "Fail7\n"); + Error("Fail7\n"); RtlZeroMemory(Context, sizeof(XENIFACE_GRANT_CONTEXT)); ExFreePoolWithTag(Context, XENIFACE_POOL_TAG); fail6: - XenIfaceDebugPrint(ERROR, "Fail6\n"); + Error("Fail6\n"); fail5: - XenIfaceDebugPrint(ERROR, "Fail5\n"); + Error("Fail5\n"); fail4: - XenIfaceDebugPrint(ERROR, "Fail4\n"); + Error("Fail4\n"); fail3: - XenIfaceDebugPrint(ERROR, "Fail3\n"); + Error("Fail3\n"); __FreeCapturedBuffer(In); fail2: - XenIfaceDebugPrint(ERROR, "Fail2\n"); + Error("Fail2\n"); fail1: - XenIfaceDebugPrint(ERROR, "Fail1 (%08x)\n", status); + Error("Fail1 (%08x)\n", status); return status; } @@ -368,7 +368,7 @@ GnttabFreeGrant( ASSERT(KeGetCurrentIrql() <= APC_LEVEL); - XenIfaceDebugPrint(TRACE, "Context %p\n", Context); + Trace("Context %p\n", Context); if (Context->Flags & XENIFACE_GNTTAB_USE_NOTIFY_OFFSET) { ((PCHAR)Context->KernelVa)[Context->NotifyOffset] = 0; @@ -378,7 +378,7 @@ GnttabFreeGrant( status = EvtchnNotify(Fdo, Context->NotifyPort, NULL); if (!NT_SUCCESS(status)) // non-fatal, we must free memory - XenIfaceDebugPrint(ERROR, "failed to notify port %lu: 0x%x\n", Context->NotifyPort, status); + Error("failed to notify port %lu: 0x%x\n", Context->NotifyPort, status); } // unmap from user address space @@ -431,7 +431,7 @@ IoctlGnttabRevokeForeignAccess( Id.Process = PsGetCurrentProcess(); Id.RequestId = In->RequestId; - XenIfaceDebugPrint(TRACE, "> Process %p, Id %lu\n", Id.Process, Id.RequestId); + Trace("> Process %p, Id %lu\n", Id.Process, Id.RequestId); status = STATUS_NOT_FOUND; PendingIrp = IoCsqRemoveNextIrp(&Fdo->IrpQueue, &Id); @@ -449,10 +449,10 @@ IoctlGnttabRevokeForeignAccess( return STATUS_SUCCESS; fail2: - XenIfaceDebugPrint(ERROR, "Fail2\n"); + Error("Fail2\n"); fail1: - XenIfaceDebugPrint(ERROR, "Fail1 (%08x)\n", status); + Error("Fail1 (%08x)\n", status); return status; } @@ -519,12 +519,12 @@ IoctlGnttabMapForeignPages( Context->NotifyOffset = In->NotifyOffset; Context->NotifyPort = In->NotifyPort; - XenIfaceDebugPrint(TRACE, "> RemoteDomain %d, NumberPages %lu, Flags 0x%x, Offset 0x%x, Port %d, Process %p, Id %lu\n", + Trace("> RemoteDomain %d, NumberPages %lu, Flags 0x%x, Offset 0x%x, Port %d, Process %p, Id %lu\n", Context->RemoteDomain, Context->NumberPages, Context->Flags, Context->NotifyOffset, Context->NotifyPort, Context->Id.Process, Context->Id.RequestId); for (PageIndex = 0; PageIndex < In->NumberPages; PageIndex++) - XenIfaceDebugPrint(INFO, "> Ref %d\n", In->References[PageIndex]); + Info("> Ref %d\n", In->References[PageIndex]); status = STATUS_INVALID_PARAMETER; if (FindGnttabIrp(Fdo, &Context->Id) != NULL) @@ -572,7 +572,7 @@ IoctlGnttabMapForeignPages( if (Context->UserVa == NULL) goto fail12; - XenIfaceDebugPrint(TRACE, "< Context %p, Irp %p, Address %p, KernelVa %p, UserVa %p\n", + Trace("< Context %p, Irp %p, Address %p, KernelVa %p, UserVa %p\n", Context, Irp, Context->Address, Context->KernelVa, Context->UserVa); // Pass the result to user mode. @@ -582,7 +582,7 @@ IoctlGnttabMapForeignPages( Out->Address = Context->UserVa; } except(EXCEPTION_EXECUTE_HANDLER) { status = GetExceptionCode(); - XenIfaceDebugPrint(ERROR, "Exception 0x%lx while probing/writing output buffer at %p, size 0x%lx\n", status, Out, OutLen); + Error("Exception 0x%lx while probing/writing output buffer at %p, size 0x%lx\n", status, Out, OutLen); goto fail13; } @@ -598,56 +598,56 @@ IoctlGnttabMapForeignPages( return STATUS_PENDING; fail14: - XenIfaceDebugPrint(ERROR, "Fail14\n"); + Error("Fail14\n"); fail13: - XenIfaceDebugPrint(ERROR, "Fail13\n"); + Error("Fail13\n"); MmUnmapLockedPages(Context->UserVa, Context->Mdl); fail12: - XenIfaceDebugPrint(ERROR, "Fail12\n"); + Error("Fail12\n"); fail11: - XenIfaceDebugPrint(ERROR, "Fail11\n"); + Error("Fail11\n"); IoFreeMdl(Context->Mdl); fail10: - XenIfaceDebugPrint(ERROR, "Fail10\n"); + Error("Fail10\n"); MmUnmapIoSpace(Context->KernelVa, Context->NumberPages * PAGE_SIZE); fail9: - XenIfaceDebugPrint(ERROR, "Fail9\n"); + Error("Fail9\n"); ASSERT(NT_SUCCESS(XENBUS_GNTTAB(UnmapForeignPages, &Fdo->GnttabInterface, Context->Address ))); fail8: - XenIfaceDebugPrint(ERROR, "Fail8\n"); + Error("Fail8\n"); fail7: - XenIfaceDebugPrint(ERROR, "Fail7\n"); + Error("Fail7\n"); RtlZeroMemory(Context, sizeof(XENIFACE_MAP_CONTEXT)); ExFreePoolWithTag(Context, XENIFACE_POOL_TAG); fail6: - XenIfaceDebugPrint(ERROR, "Fail6\n"); + Error("Fail6\n"); fail5: - XenIfaceDebugPrint(ERROR, "Fail5\n"); + Error("Fail5\n"); fail4: - XenIfaceDebugPrint(ERROR, "Fail4\n"); + Error("Fail4\n"); fail3: - XenIfaceDebugPrint(ERROR, "Fail3\n"); + Error("Fail3\n"); __FreeCapturedBuffer(In); fail2: - XenIfaceDebugPrint(ERROR, "Fail2\n"); + Error("Fail2\n"); fail1: - XenIfaceDebugPrint(ERROR, "Fail1 (%08x)\n", status); + Error("Fail1 (%08x)\n", status); return status; } @@ -663,7 +663,7 @@ GnttabFreeMap( ASSERT(KeGetCurrentIrql() <= APC_LEVEL); - XenIfaceDebugPrint(TRACE, "Context %p\n", Context); + Trace("Context %p\n", Context); if (Context->Flags & XENIFACE_GNTTAB_USE_NOTIFY_OFFSET) { ((PCHAR)Context->KernelVa)[Context->NotifyOffset] = 0; @@ -673,7 +673,7 @@ GnttabFreeMap( status = EvtchnNotify(Fdo, Context->NotifyPort, NULL); if (!NT_SUCCESS(status)) // non-fatal, we must free memory - XenIfaceDebugPrint(ERROR, "failed to notify port %lu: 0x%x\n", Context->NotifyPort, status); + Error("failed to notify port %lu: 0x%x\n", Context->NotifyPort, status); } // unmap from user address space @@ -721,7 +721,7 @@ IoctlGnttabUnmapForeignPages( Id.Process = PsGetCurrentProcess(); Id.RequestId = In->RequestId; - XenIfaceDebugPrint(TRACE, "> Process %p, Id %lu\n", Id.Process, Id.RequestId); + Trace("> Process %p, Id %lu\n", Id.Process, Id.RequestId); status = STATUS_NOT_FOUND; PendingIrp = IoCsqRemoveNextIrp(&Fdo->IrpQueue, &Id); @@ -739,9 +739,9 @@ IoctlGnttabUnmapForeignPages( return STATUS_SUCCESS; fail2: - XenIfaceDebugPrint(ERROR, "Fail2\n"); + Error("Fail2\n"); fail1: - XenIfaceDebugPrint(ERROR, "Fail1 (%08x)\n", status); + Error("Fail1 (%08x)\n", status); return status; } diff --git a/src/xeniface/ioctl_sharedinfo.c b/src/xeniface/ioctl_sharedinfo.c index c9dfe65..91a9a88 100644 --- a/src/xeniface/ioctl_sharedinfo.c +++ b/src/xeniface/ioctl_sharedinfo.c @@ -61,8 +61,8 @@ IoctlSharedInfoGetTime( return STATUS_SUCCESS; fail2: - XenIfaceDebugPrint(ERROR, "Fail2\n"); + Error("Fail2\n"); fail1: - XenIfaceDebugPrint(ERROR, "Fail1 (%08x)\n", status); + Error("Fail1 (%08x)\n", status); return status; } diff --git a/src/xeniface/ioctl_store.c b/src/xeniface/ioctl_store.c index b8ee073..c0a1aef 100644 --- a/src/xeniface/ioctl_store.c +++ b/src/xeniface/ioctl_store.c @@ -74,7 +74,6 @@ __MultiSzLen( static FORCEINLINE VOID __DisplayMultiSz( - __in PCHAR Caller, __in PCHAR Str ) { @@ -84,7 +83,7 @@ __DisplayMultiSz( for (Ptr = Str, Idx = 0; *Ptr; ++Idx) { Len = (ULONG)strlen(Ptr); - XenIfaceDebugPrint(TRACE, "|%s: [%d]=(%d)->\"%s\"\n", Caller, Idx, Len, Ptr); + Trace("> [%d]=(%d)->\"%s\"\n", Idx, Len, Ptr); Ptr += (Len + 1); } } @@ -124,7 +123,7 @@ IoctlStoreRead( status = STATUS_BUFFER_OVERFLOW; if (OutLen == 0) { - XenIfaceDebugPrint(TRACE, "(\"%s\")=(%d)\n", Buffer, Length); + Trace("(\"%s\")=(%d)\n", Buffer, Length); goto done; } @@ -132,7 +131,7 @@ IoctlStoreRead( if (OutLen < Length) goto fail4; - XenIfaceDebugPrint(TRACE, "(\"%s\")=(%d)->\"%s\"\n", Buffer, Length, Value); + Trace("(\"%s\")=(%d)->\"%s\"\n", Buffer, Length, Value); RtlCopyMemory(Buffer, Value, Length); Buffer[Length - 1] = 0; @@ -144,17 +143,17 @@ done: return status; fail4: - XenIfaceDebugPrint(ERROR, "Fail4 (\"%s\")=(%d < %d)\n", Buffer, OutLen, Length); + Error("Fail4 (\"%s\")=(%d < %d)\n", Buffer, OutLen, Length); XENBUS_STORE(Free, &Fdo->StoreInterface, Value); fail3: if (!SquashError) - XenIfaceDebugPrint(ERROR, "Fail3 (\"%s\")\n", Buffer); + Error("Fail3 (\"%s\")\n", Buffer); fail2: if (!SquashError) - XenIfaceDebugPrint(ERROR, "Fail2\n"); + Error("Fail2\n"); fail1: if (!SquashError) - XenIfaceDebugPrint(ERROR, "Fail1 (%08x)\n", status); + Error("Fail1 (%08x)\n", status); return status; } @@ -190,17 +189,17 @@ IoctlStoreWrite( if (!NT_SUCCESS(status)) goto fail4; - XenIfaceDebugPrint(TRACE, "(\"%s\"=\"%s\")\n", Buffer, Value); + Trace("(\"%s\"=\"%s\")\n", Buffer, Value); return status; fail4: - XenIfaceDebugPrint(ERROR, "Fail4 (\"%s\")\n", Value); + Error("Fail4 (\"%s\")\n", Value); fail3: - XenIfaceDebugPrint(ERROR, "Fail3 (\"%s\")\n", Buffer); + Error("Fail3 (\"%s\")\n", Buffer); fail2: - XenIfaceDebugPrint(ERROR, "Fail2\n"); + Error("Fail2\n"); fail1: - XenIfaceDebugPrint(ERROR, "Fail1 (%08x)\n", status); + Error("Fail1 (%08x)\n", status); return status; } @@ -235,7 +234,7 @@ IoctlStoreDirectory( status = STATUS_BUFFER_OVERFLOW; if (OutLen == 0) { - XenIfaceDebugPrint(TRACE, "(\"%s\")=(%d)(%d)\n", Buffer, Length, Count); + Trace("(\"%s\")=(%d)(%d)\n", Buffer, Length, Count); goto done; } @@ -243,9 +242,9 @@ IoctlStoreDirectory( if (OutLen < Length) goto fail4; - XenIfaceDebugPrint(INFO, "(\"%s\")=(%d)(%d)\n", Buffer, Length, Count); + Info("(\"%s\")=(%d)(%d)\n", Buffer, Length, Count); #if DBG - __DisplayMultiSz(__FUNCTION__, Value); + __DisplayMultiSz(Value); #endif RtlCopyMemory(Buffer, Value, Length); @@ -259,14 +258,14 @@ done: return status; fail4: - XenIfaceDebugPrint(ERROR, "Fail4 (\"%s\")=(%d < %d)\n", Buffer, OutLen, Length); + Error("Fail4 (\"%s\")=(%d < %d)\n", Buffer, OutLen, Length); XENBUS_STORE(Free, &Fdo->StoreInterface, Value); fail3: - XenIfaceDebugPrint(ERROR, "Fail3 (\"%s\")\n", Buffer); + Error("Fail3 (\"%s\")\n", Buffer); fail2: - XenIfaceDebugPrint(ERROR, "Fail2\n"); + Error("Fail2\n"); fail1: - XenIfaceDebugPrint(ERROR, "Fail1 (%08x)\n", status); + Error("Fail1 (%08x)\n", status); return status; } @@ -293,15 +292,15 @@ IoctlStoreRemove( if (!NT_SUCCESS(status)) goto fail3; - XenIfaceDebugPrint(TRACE, "(\"%s\")\n", Buffer); + Trace("(\"%s\")\n", Buffer); return status; fail3: - XenIfaceDebugPrint(ERROR, "Fail3 (\"%s\")\n", Buffer); + Error("Fail3 (\"%s\")\n", Buffer); fail2: - XenIfaceDebugPrint(ERROR, "Fail2\n"); + Error("Fail2\n"); fail1: - XenIfaceDebugPrint(ERROR, "Fail1 (%08x)\n", status); + Error("Fail1 (%08x)\n", status); return status; } @@ -335,14 +334,14 @@ __ConvertPermissions( return XenbusPermissions; fail3: - XenIfaceDebugPrint(ERROR, "Fail3\n"); + Error("Fail3\n"); ExFreePoolWithTag(XenbusPermissions, XENIFACE_POOL_TAG); fail2: - XenIfaceDebugPrint(ERROR, "Fail2\n"); + Error("Fail2\n"); fail1: - XenIfaceDebugPrint(ERROR, "Fail1\n"); + Error("Fail1\n"); return NULL; } @@ -394,10 +393,10 @@ IoctlStoreSetPermissions( goto fail5; Path[In->PathLength - 1] = 0; - XenIfaceDebugPrint(TRACE, "> Path '%s', NumberPermissions %lu\n", Path, In->NumberPermissions); + Trace("> Path '%s', NumberPermissions %lu\n", Path, In->NumberPermissions); for (Index = 0; Index < In->NumberPermissions; Index++) { - XenIfaceDebugPrint(TRACE, "> %lu: Domain %d, Mask 0x%x\n", + Trace("> %lu: Domain %d, Mask 0x%x\n", Index, Permissions[Index].Domain, Permissions[Index].Mask); } @@ -416,24 +415,24 @@ IoctlStoreSetPermissions( return status; fail6: - XenIfaceDebugPrint(ERROR, "Fail6\n"); + Error("Fail6\n"); __FreeCapturedBuffer(Path); fail5: - XenIfaceDebugPrint(ERROR, "Fail5\n"); + Error("Fail5\n"); __FreePermissions(Permissions); fail4: - XenIfaceDebugPrint(ERROR, "Fail4\n"); + Error("Fail4\n"); fail3: - XenIfaceDebugPrint(ERROR, "Fail3\n"); + Error("Fail3\n"); fail2: - XenIfaceDebugPrint(ERROR, "Fail2\n"); + Error("Fail2\n"); fail1: - XenIfaceDebugPrint(ERROR, "Fail1 (%08x)\n", status); + Error("Fail1 (%08x)\n", status); return status; } @@ -459,7 +458,7 @@ StoreWatch( if (ThreadIsAlerted(Self)) break; - XenIfaceDebugPrint(INFO, "%s\n", Context->Path); + Info("%s\n", Context->Path); KeSetEvent(Context->Event, IO_NO_INCREMENT, FALSE); } @@ -520,7 +519,7 @@ IoctlStoreAddWatch( if (!NT_SUCCESS(status)) goto fail5; - XenIfaceDebugPrint(TRACE, "> Path '%s', Event %p, FO %p\n", Path, In->Event, FileObject); + Trace("> Path '%s', Event %p, FO %p\n", Path, In->Event, FileObject); Context->Path = Path; @@ -540,7 +539,7 @@ IoctlStoreAddWatch( ExInterlockedInsertTailList(&Fdo->StoreWatchList, &Context->Entry, &Fdo->StoreWatchLock); - XenIfaceDebugPrint(TRACE, "< Context %p, Watch %p\n", Context, Context->Watch); + Trace("< Context %p, Watch %p\n", Context, Context->Watch); Out->Context = Context; *Info = sizeof(XENIFACE_STORE_ADD_WATCH_OUT); @@ -550,31 +549,31 @@ IoctlStoreAddWatch( fail7: __FreeCapturedBuffer(Context->Path); - XenIfaceDebugPrint(ERROR, "Fail7\n"); + Error("Fail7\n"); ThreadAlert(Context->Thread); ThreadJoin(Context->Thread); fail6: - XenIfaceDebugPrint(ERROR, "Fail6\n"); + Error("Fail6\n"); ObDereferenceObject(Context->Event); fail5: - XenIfaceDebugPrint(ERROR, "Fail5\n"); + Error("Fail5\n"); RtlZeroMemory(Context, sizeof(XENIFACE_STORE_CONTEXT)); ExFreePoolWithTag(Context, XENIFACE_POOL_TAG); fail4: - XenIfaceDebugPrint(ERROR, "Fail4\n"); + Error("Fail4\n"); __FreeCapturedBuffer(Path); fail3: - XenIfaceDebugPrint(ERROR, "Fail3\n"); + Error("Fail3\n"); fail2: - XenIfaceDebugPrint(ERROR, "Fail2\n"); + Error("Fail2\n"); fail1: - XenIfaceDebugPrint(ERROR, "Fail1 (%08x)\n", status); + Error("Fail1 (%08x)\n", status); return status; } @@ -589,7 +588,7 @@ StoreFreeWatch( ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL); - XenIfaceDebugPrint(TRACE, "Context %p, Watch %p, FO %p\n", + Trace("Context %p, Watch %p, FO %p\n", Context, Context->Watch, Context->FileObject); status = XENBUS_STORE(WatchRemove, @@ -630,7 +629,7 @@ IoctlStoreRemoveWatch( goto fail1; } - XenIfaceDebugPrint(TRACE, "> Context %p, FO %p\n", In->Context, FileObject); + Trace("> Context %p, FO %p\n", In->Context, FileObject); KeAcquireSpinLock(&Fdo->StoreWatchLock, &Irql); Node = Fdo->StoreWatchList.Flink; @@ -657,9 +656,9 @@ IoctlStoreRemoveWatch( return STATUS_SUCCESS; fail2: - XenIfaceDebugPrint(ERROR, "Fail2\n"); + Error("Fail2\n"); fail1: - XenIfaceDebugPrint(ERROR, "Fail1 (%08x)\n", status); + Error("Fail1 (%08x)\n", status); return status; } diff --git a/src/xeniface/ioctl_suspend.c b/src/xeniface/ioctl_suspend.c index e848864..94cfd24 100644 --- a/src/xeniface/ioctl_suspend.c +++ b/src/xeniface/ioctl_suspend.c @@ -62,9 +62,9 @@ IoctlSuspendGetCount( return status; fail2: - XenIfaceDebugPrint(ERROR, "Fail2\n"); + Error("Fail2\n"); fail1: - XenIfaceDebugPrint(ERROR, "Fail1 (%08x)\n", status); + Error("Fail1 (%08x)\n", status); return status; } @@ -108,7 +108,7 @@ IoctlSuspendRegister( if (!NT_SUCCESS(status)) goto fail3; - XenIfaceDebugPrint(TRACE, "> Suspend Event %p, FO %p\n", In->Event, FileObject); + Trace("> Suspend Event %p, FO %p\n", In->Event, FileObject); ExInterlockedInsertTailList(&Fdo->SuspendList, &Context->Entry, &Fdo->SuspendLock); Out->Context = Context; @@ -117,15 +117,15 @@ IoctlSuspendRegister( return status; fail3: - XenIfaceDebugPrint(ERROR, "Fail3\n"); + Error("Fail3\n"); RtlZeroMemory(Context, sizeof(XENIFACE_SUSPEND_CONTEXT)); ExFreePoolWithTag(Context, XENIFACE_POOL_TAG); fail2: - XenIfaceDebugPrint(ERROR, "Fail2\n"); + Error("Fail2\n"); fail1: - XenIfaceDebugPrint(ERROR, "Fail1 (%08x)\n", status); + Error("Fail1 (%08x)\n", status); return status; } @@ -136,7 +136,7 @@ SuspendFreeEvent( __inout PXENIFACE_SUSPEND_CONTEXT Context ) { - XenIfaceDebugPrint(TRACE, "Context %p, FO %p\n", + Trace("Context %p, FO %p\n", Context, Context->FileObject); ObDereferenceObject(Context->Event); @@ -166,7 +166,7 @@ IoctlSuspendDeregister( goto fail1; } - XenIfaceDebugPrint(TRACE, "> Context %p, FO %p\n", In->Context, FileObject); + Trace("> Context %p, FO %p\n", In->Context, FileObject); KeAcquireSpinLock(&Fdo->SuspendLock, &Irql); Node = Fdo->SuspendList.Flink; @@ -193,10 +193,10 @@ IoctlSuspendDeregister( return STATUS_SUCCESS; fail2: - XenIfaceDebugPrint(ERROR, "Fail2\n"); + Error("Fail2\n"); fail1: - XenIfaceDebugPrint(ERROR, "Fail1 (%08x)\n", status); + Error("Fail1 (%08x)\n", status); return status; } diff --git a/src/xeniface/ioctls.c b/src/xeniface/ioctls.c index 8e5648b..bf280cb 100644 --- a/src/xeniface/ioctls.c +++ b/src/xeniface/ioctls.c @@ -64,7 +64,7 @@ __CaptureUserBuffer( ProbeForRead(Buffer, Length, 1); RtlCopyMemory(TempBuffer, Buffer, Length); } except(EXCEPTION_EXECUTE_HANDLER) { - XenIfaceDebugPrint(ERROR, "Exception while probing/reading buffer at %p, size 0x%lx\n", Buffer, Length); + Error("Exception while probing/reading buffer at %p, size 0x%lx\n", Buffer, Length); ExFreePoolWithTag(TempBuffer, XENIFACE_POOL_TAG); TempBuffer = NULL; Status = GetExceptionCode(); @@ -131,13 +131,13 @@ IoctlLog( *ptr = '\0'; } - XenIfaceDebugPrint(INFO, "USER: %s\n", Buffer); + Info("USER: %s\n", Buffer); return STATUS_SUCCESS; fail2: - XenIfaceDebugPrint(ERROR, "Fail2\n"); + Error("Fail2\n"); fail1: - XenIfaceDebugPrint(ERROR, "Fail1 (%08x)\n", status); + Error("Fail1 (%08x)\n", status); return status; } @@ -168,7 +168,7 @@ XenIfaceCleanup( StoreContext->FileObject != FileObject) continue; - XenIfaceDebugPrint(TRACE, "Store context %p\n", StoreContext); + Trace("Store context %p\n", StoreContext); RemoveEntryList(&StoreContext->Entry); // StoreFreeWatch requires PASSIVE_LEVEL and we're inside a lock InsertTailList(&ToFree, &StoreContext->Entry); @@ -196,7 +196,7 @@ XenIfaceCleanup( EvtchnContext->FileObject != FileObject) continue; - XenIfaceDebugPrint(TRACE, "Evtchn context %p\n", EvtchnContext); + Trace("Evtchn context %p\n", EvtchnContext); RemoveEntryList(&EvtchnContext->Entry); // EvtchnFree requires PASSIVE_LEVEL and we're inside a lock InsertTailList(&ToFree, &EvtchnContext->Entry); @@ -223,7 +223,7 @@ XenIfaceCleanup( SuspendContext->FileObject != FileObject) continue; - XenIfaceDebugPrint(TRACE, "Suspend context %p\n", SuspendContext); + Trace("Suspend context %p\n", SuspendContext); RemoveEntryList(&SuspendContext->Entry); SuspendFreeEvent(Fdo, SuspendContext); } diff --git a/src/xeniface/irp_queue.c b/src/xeniface/irp_queue.c index 807f930..37191bc 100644 --- a/src/xeniface/irp_queue.c +++ b/src/xeniface/irp_queue.c @@ -150,8 +150,7 @@ CsqCompleteCanceledIrp( PXENIFACE_FDO Fdo = CONTAINING_RECORD(Csq, XENIFACE_FDO, IrpQueue); PIO_WORKITEM WorkItem; - XenIfaceDebugPrint(TRACE, "Irp %p, IRQL %d\n", - Irp, KeGetCurrentIrql()); + Trace("Irp %p, IRQL %d\n", Irp, KeGetCurrentIrql()); // This is not guaranteed to run at PASSIVE_LEVEL, so queue a work item // to perform actual cleanup/IRP completion. diff --git a/src/xeniface/log.h b/src/xeniface/log.h index 5524f05..bf78f67 100644 --- a/src/xeniface/log.h +++ b/src/xeniface/log.h @@ -35,11 +35,6 @@ #include <ntddk.h> #include <stdarg.h> -#define ERROR DPFLTR_ERROR_LEVEL -#define WARNING DPFLTR_WARNING_LEVEL -#define TRACE DPFLTR_TRACE_LEVEL -#define INFO DPFLTR_INFO_LEVEL - #pragma warning(disable:4127) // conditional expression is constant #define __MODULE__ "XENIFACE" @@ -140,37 +135,4 @@ __Info( #define Info(...) \ __Info(__MODULE__ "|" __FUNCTION__ ": ", __VA_ARGS__) - -#define XenIfaceDebugPrint(LEVEL, ...) \ - __XenIfaceDebugPrint(__MODULE__ "|" __FUNCTION__ ": ",LEVEL, __VA_ARGS__) - -static __inline VOID -__XenIfaceDebugPrint ( - __in const CHAR *Prefix, - __in ULONG DebugPrintLevel, - __in PCCHAR DebugMessage, - ... - ) - -{ - va_list list; - -#if !DBG - if (DebugPrintLevel == TRACE) - return; -#endif - - va_start(list, DebugMessage); - - if (DebugMessage) - { - vDbgPrintExWithPrefix(Prefix, DPFLTR_IHVDRIVER_ID, DebugPrintLevel, DebugMessage, list); - - } - va_end(list); - - return; -} - - #endif // _XENIFACE_LOG_H diff --git a/src/xeniface/wmi.c b/src/xeniface/wmi.c index 479f400..0f8ab8a 100644 --- a/src/xeniface/wmi.c +++ b/src/xeniface/wmi.c @@ -728,9 +728,9 @@ SessionFindWatchLocked(XenStoreSession *session, UNICODE_STRING *path) { XenStoreWatch * watch; - XenIfaceDebugPrint(TRACE,"Wait for session watch lock\n"); + Trace("Wait for session watch lock\n"); AcquireMutex(&session->WatchMapLock); - XenIfaceDebugPrint(TRACE,"got session watch lock\n"); + Trace("got session watch lock\n"); watch = (XenStoreWatch *)session->watches.Flink; while (watch != (XenStoreWatch *)&session->watches){ @@ -740,7 +740,7 @@ SessionFindWatchLocked(XenStoreSession *session, watch = (XenStoreWatch *)watch->listentry.Flink; } - XenIfaceDebugPrint(WARNING,"couldn't find watch\n"); + Warning("couldn't find watch\n"); return NULL; } @@ -750,13 +750,13 @@ WmiFireSuspendEvent( IN PXENIFACE_FDO Fdo ) { - XenIfaceDebugPrint(ERROR, "Ready to unsuspend Event\n"); + Error("Ready to unsuspend Event\n"); KeSetEvent(&Fdo->registryWriteEvent, IO_NO_INCREMENT, FALSE); if (!Fdo->WmiReady) return; - XenIfaceDebugPrint(TRACE, "Fire Suspend Event\n"); + Trace("Fire Suspend Event\n"); WmiFireEvent(Fdo->Dx->DeviceObject, (LPGUID)&OBJECT_GUID(XenStoreUnsuspendedEvent), 0, @@ -785,7 +785,7 @@ void FireWatch(XenStoreWatch* watch) { } if (eventdata !=NULL) { - XenIfaceDebugPrint(TRACE,"Fire Watch Event\n"); + Trace("Fire Watch Event\n"); WmiFireEvent(watch->fdoData->Dx->DeviceObject, (LPGUID)&OBJECT_GUID(XenStoreWatchEvent), 0, @@ -821,7 +821,7 @@ StartWatch(XENIFACE_FDO *fdoData, XenStoreWatch *watch) return status; } - XenIfaceDebugPrint(WARNING,"Start Watch %p\n", watch->watchhandle); + Warning("Start Watch %p\n", watch->watchhandle); ExFreePool(tmppath); RtlFreeAnsiString(&ansipath); @@ -840,7 +840,7 @@ VOID WatchCallbackThread(__in PVOID StartContext) { if (session->mapchanged) { // Construct a new mapping XenStoreWatch *watch; - XenIfaceDebugPrint(TRACE,"Construct a new mapping\n"); + Trace("Construct a new mapping\n"); watch = (XenStoreWatch *)session->watches.Flink; for (i=0; watch != (XenStoreWatch *)&session->watches; i++) { session->watchevents[i] = &watch->watchevent; @@ -850,12 +850,12 @@ VOID WatchCallbackThread(__in PVOID StartContext) { session->watchevents[i] = &session->SessionChangedEvent; } ReleaseMutex(&session->WatchMapLock); - XenIfaceDebugPrint(TRACE,"Wait for new event\n"); + Trace("Wait for new event\n"); status = KeWaitForMultipleObjects(i+1, session->watchevents, WaitAny, Executive, KernelMode, TRUE, NULL, session->watchwaitblockarray); - XenIfaceDebugPrint(TRACE,"got new event\n"); + Trace("got new event\n"); if ((status >= STATUS_WAIT_0) && (status < STATUS_WAIT_0 +i )) { XenStoreWatch *watch; - XenIfaceDebugPrint(TRACE,"watch or suspend\n"); + Trace("watch or suspend\n"); watch = CONTAINING_RECORD(session->watchevents[status-STATUS_WAIT_0], XenStoreWatch, watchevent ); AcquireMutex(&session->WatchMapLock); KeClearEvent(&watch->watchevent); @@ -870,7 +870,7 @@ VOID WatchCallbackThread(__in PVOID StartContext) { } else if (!session->suspended && watch->suspendcount != XENBUS_SUSPEND(GetCount, &watch->fdoData->SuspendInterface)) { watch->suspendcount = XENBUS_SUSPEND(GetCount, &watch->fdoData->SuspendInterface); - XenIfaceDebugPrint(WARNING,"SessionSuspendResumeUnwatch %p\n", watch->watchhandle); + Warning("SessionSuspendResumeUnwatch %p\n", watch->watchhandle); XENBUS_STORE(WatchRemove, &watch->fdoData->StoreInterface, watch->watchhandle); watch->watchhandle = NULL; @@ -884,7 +884,7 @@ VOID WatchCallbackThread(__in PVOID StartContext) { AcquireMutex(&session->WatchMapLock); KeClearEvent(&session->SessionChangedEvent); if (session->closing==TRUE) { - XenIfaceDebugPrint(TRACE,"Trying to end session thread\n"); + Trace("Trying to end session thread\n"); if (session->watchcount != 0) { XenStoreWatch *watch; for (watch = (XenStoreWatch *)session->watches.Flink; @@ -898,7 +898,7 @@ VOID WatchCallbackThread(__in PVOID StartContext) { } } ReleaseMutex(&session->WatchMapLock); - XenIfaceDebugPrint(TRACE,"Ending session thread\n"); + Trace("Ending session thread\n"); PsTerminateSystemThread(STATUS_SUCCESS); //ReleaseMutex(&session->WatchMapLock); } @@ -954,14 +954,14 @@ SessionAddWatchLocked(XenStoreSession *session, session->watchcount++; InsertHeadList(&session->watches,(PLIST_ENTRY)(*watch)); - XenIfaceDebugPrint(TRACE, "WATCHLIST for session %p-----------\n",session); + Trace("WATCHLIST for session %p-----------\n", session); pwatch = (XenStoreWatch *)session->watches.Flink; while (pwatch != (XenStoreWatch *)&session->watches){ - XenIfaceDebugPrint(TRACE, "WATCHLIST %p\n",pwatch->watchhandle); + Trace("WATCHLIST %p\n", pwatch->watchhandle); pwatch = (XenStoreWatch *)pwatch->listentry.Flink; } - XenIfaceDebugPrint(TRACE, "WATCHLIST-------------------\n"); + Trace("WATCHLIST-------------------\n"); ReleaseMutex(&session->WatchMapLock); return STATUS_SUCCESS; @@ -971,22 +971,22 @@ SessionAddWatchLocked(XenStoreSession *session, void SessionRemoveWatchLocked(XenStoreSession *session, XenStoreWatch *watch) { XenStoreWatch *pwatch; - XenIfaceDebugPrint(TRACE, "Remove watch locked\n"); - XenIfaceDebugPrint(TRACE, "watch %p\n", watch); - XenIfaceDebugPrint(TRACE, "handle %p\n", watch->watchhandle); + Trace("Remove watch locked\n"); + Trace("watch %p\n", watch); + Trace("handle %p\n", watch->watchhandle); if (watch->watchhandle) { XENBUS_STORE(WatchRemove, &watch->fdoData->StoreInterface, watch->watchhandle); watch->watchhandle=NULL; watch->finished = TRUE; - XenIfaceDebugPrint(TRACE, "WATCHLIST for session %p-----------\n",session); + Trace("WATCHLIST for session %p-----------\n", session); pwatch = (XenStoreWatch *)session->watches.Flink; while (pwatch != (XenStoreWatch *)&session->watches){ - XenIfaceDebugPrint(TRACE, "WATCHLIST %p\n",pwatch->watchhandle); + Trace("WATCHLIST %p\n", pwatch->watchhandle); pwatch = (XenStoreWatch *)pwatch->listentry.Flink; } - XenIfaceDebugPrint(TRACE, "WATCHLIST-------------------\n"); + Trace("WATCHLIST-------------------\n"); KeSetEvent(&watch->watchevent, IO_NO_INCREMENT,FALSE); } @@ -995,16 +995,16 @@ void SessionRemoveWatchLocked(XenStoreSession *session, XenStoreWatch *watch) { void SessionRemoveWatchesLocked(XenStoreSession *session) { XenStoreWatch *watch; - XenIfaceDebugPrint(TRACE, "wait remove mutex\n"); + Trace("wait remove mutex\n"); AcquireMutex(&session->WatchMapLock); for (watch = (XenStoreWatch *)session->watches.Flink; watch!=(XenStoreWatch *)&session->watches; watch=(XenStoreWatch *)watch->listentry.Flink) { - XenIfaceDebugPrint(TRACE, "try remove %p\n",session->watches.Flink ); + Trace("try remove %p\n", session->watches.Flink); SessionRemoveWatchLocked(session, watch); } - XenIfaceDebugPrint(TRACE, "release remove mutex\n"); + Trace("release remove mutex\n"); ReleaseMutex(&session->WatchMapLock); } @@ -1142,11 +1142,11 @@ CreateNewSession(XENIFACE_FDO *fdoData, KeInitializeEvent(&session->SessionChangedEvent, NotificationEvent, FALSE); session->closing = FALSE; if (fdoData->InterfacesAcquired){ - XenIfaceDebugPrint(TRACE,"Add session unsuspended\n"); + Trace("Add session unsuspended\n"); session->suspended=FALSE; } else { - XenIfaceDebugPrint(TRACE,"Add session suspended\n"); + Trace("Add session suspended\n"); session->suspended=TRUE; } fdoData->Sessions++; @@ -1168,7 +1168,7 @@ void RemoveSessionLocked(XENIFACE_FDO *fdoData, XenStoreSession *session) { - XenIfaceDebugPrint(TRACE,"RemoveSessionLocked\n"); + Trace("RemoveSessionLocked\n"); RemoveEntryList((LIST_ENTRY*)session); fdoData->Sessions--; SessionRemoveWatchesLocked(session); @@ -1188,22 +1188,22 @@ RemoveSessionLocked(XENIFACE_FDO *fdoData, void RemoveSession(XENIFACE_FDO *fdoData, XenStoreSession *session) { - XenIfaceDebugPrint(TRACE,"RemoveSession\n"); + Trace("RemoveSession\n"); LockSessions(fdoData); RemoveSessionLocked(fdoData, session); UnlockSessions(fdoData); } void SessionsRemoveAll(XENIFACE_FDO *fdoData) { - XenIfaceDebugPrint(TRACE,"lock"); + Trace("lock"); LockSessions(fdoData); - XenIfaceDebugPrint(TRACE,"in lock"); + Trace("in lock"); while (fdoData->SessionHead.Flink != &fdoData->SessionHead) { RemoveSessionLocked(fdoData, (XenStoreSession *)fdoData->SessionHead.Flink); } - XenIfaceDebugPrint(TRACE,"unlock"); + Trace("unlock"); UnlockSessions(fdoData); - XenIfaceDebugPrint(TRACE,"unlocked"); + Trace("unlocked"); } @@ -1215,20 +1215,20 @@ void SessionUnwatchWatchesLocked(XenStoreSession *session) AcquireMutex(&session->WatchMapLock); watch = (XenStoreWatch *)session->watches.Flink; for (i=0; watch != (XenStoreWatch *)&session->watches; i++) { - XenIfaceDebugPrint(TRACE,"Suspend unwatch %p\n", watch->watchhandle); + Trace("Suspend unwatch %p\n", watch->watchhandle); XENBUS_STORE(WatchRemove, &watch->fdoData->StoreInterface, watch->watchhandle); watch->watchhandle = NULL; watch = (XenStoreWatch *)watch->listentry.Flink; } - XenIfaceDebugPrint(TRACE, "WATCHLIST for session %p-----------\n",session); + Trace("WATCHLIST for session %p-----------\n",session); watch = (XenStoreWatch *)session->watches.Flink; while (watch != (XenStoreWatch *)&session->watches){ - XenIfaceDebugPrint(TRACE, "WATCHLIST %p\n",watch->watchhandle); + Trace("WATCHLIST %p\n",watch->watchhandle); watch = (XenStoreWatch *)watch->listentry.Flink; } - XenIfaceDebugPrint(TRACE, "WATCHLIST-------------------\n"); + Trace("WATCHLIST-------------------\n"); session->suspended=1; ReleaseMutex(&session->WatchMapLock); } @@ -1237,7 +1237,7 @@ void SuspendSessionLocked(XENIFACE_FDO *fdoData, XenStoreSession *session) { SessionUnwatchWatchesLocked(session); if (session->transaction != NULL) { - XenIfaceDebugPrint(TRACE, "End transaction %p\n",session->transaction); + Trace("End transaction %p\n",session->transaction); XENBUS_STORE(TransactionEnd, &fdoData->StoreInterface, session->transaction, FALSE); session->transaction = NULL; @@ -1252,7 +1252,7 @@ WmiSessionsSuspendAll( XenStoreSession *session; LockSessions(Fdo); - XenIfaceDebugPrint(TRACE,"Suspend all sessions\n"); + Trace("Suspend all sessions\n"); session = (XenStoreSession *)Fdo->SessionHead.Flink; while (session != (XenStoreSession *)&Fdo->SessionHead) { SuspendSessionLocked(Fdo, session); @@ -1273,14 +1273,14 @@ void SessionRenewWatchesLocked(XenStoreSession *session) { } watch = (XenStoreWatch *)watch->listentry.Flink; } - XenIfaceDebugPrint(TRACE, "WATCHLIST for session %p-----------\n",session); + Trace("WATCHLIST for session %p-----------\n",session); watch = (XenStoreWatch *)session->watches.Flink; while (watch != (XenStoreWatch *)&session->watches){ - XenIfaceDebugPrint(TRACE, "WATCHLIST %p\n",watch->watchhandle); + Trace("WATCHLIST %p\n",watch->watchhandle); watch = (XenStoreWatch *)watch->listentry.Flink; } - XenIfaceDebugPrint(TRACE, "WATCHLIST-------------------\n"); + Trace("WATCHLIST-------------------\n"); session->suspended=0; session->mapchanged = TRUE; KeSetEvent(&session->SessionChangedEvent, IO_NO_INCREMENT,FALSE); @@ -1300,7 +1300,7 @@ WmiSessionsResumeAll( XenStoreSession *session; LockSessions(Fdo); - XenIfaceDebugPrint(TRACE,"Resume all sessions\n"); + Trace("Resume all sessions\n"); session = (XenStoreSession *)Fdo->SessionHead.Flink; while (session != (XenStoreSession *)&Fdo->SessionHead) { ResumeSessionLocked(Fdo, session); @@ -1319,8 +1319,8 @@ WmiRegister( if (Fdo->WmiReady) return STATUS_SUCCESS; - XenIfaceDebugPrint(TRACE,"%s\n",__FUNCTION__); - XenIfaceDebugPrint(INFO,"DRV: XenIface WMI Initialisation\n"); + Trace("%s\n",__FUNCTION__); + Info("DRV: XenIface WMI Initialisation\n"); status = IoWMIRegistrationControl(Fdo->Dx->DeviceObject, WMIREG_ACTION_REGISTER); @@ -1343,8 +1343,8 @@ WmiDeregister( if (!Fdo->WmiReady) return; - XenIfaceDebugPrint(INFO,"DRV: XenIface WMI Finalisation\n"); - XenIfaceDebugPrint(TRACE,"%s\n",__FUNCTION__); + Info("DRV: XenIface WMI Finalisation\n"); + Trace("%s\n",__FUNCTION__); SessionsRemoveAll(Fdo); (VOID) IoWMIRegistrationControl(Fdo->Dx->DeviceObject, @@ -1360,7 +1360,7 @@ WmiChangeSingleInstance( { UNREFERENCED_PARAMETER(Fdo); UNREFERENCED_PARAMETER(stack); - XenIfaceDebugPrint(TRACE,"%s\n",__FUNCTION__); + Trace("%s\n",__FUNCTION__); return STATUS_NOT_SUPPORTED; } @@ -1372,7 +1372,7 @@ WmiChangeSingleItem( { UNREFERENCED_PARAMETER(Fdo); UNREFERENCED_PARAMETER(stack); - XenIfaceDebugPrint(TRACE,"%s\n",__FUNCTION__); + Trace("%s\n",__FUNCTION__); return STATUS_NOT_SUPPORTED; } @@ -1384,7 +1384,7 @@ WmiDisableCollection( { UNREFERENCED_PARAMETER(Fdo); UNREFERENCED_PARAMETER(stack); - XenIfaceDebugPrint(TRACE,"%s\n",__FUNCTION__); + Trace("%s\n",__FUNCTION__); return STATUS_NOT_SUPPORTED; } @@ -1396,7 +1396,7 @@ WmiDisableEvents( { UNREFERENCED_PARAMETER(Fdo); UNREFERENCED_PARAMETER(stack); - XenIfaceDebugPrint(TRACE,"%s\n",__FUNCTION__); + Trace("%s\n",__FUNCTION__); return STATUS_NOT_SUPPORTED; } @@ -1408,7 +1408,7 @@ WmiEnableCollection( { UNREFERENCED_PARAMETER(Fdo); UNREFERENCED_PARAMETER(stack); - XenIfaceDebugPrint(TRACE,"%s\n",__FUNCTION__); + Trace("%s\n",__FUNCTION__); return STATUS_NOT_SUPPORTED; } @@ -1420,7 +1420,7 @@ WmiEnableEvents( { UNREFERENCED_PARAMETER(Fdo); UNREFERENCED_PARAMETER(stack); - XenIfaceDebugPrint(TRACE,"%s\n",__FUNCTION__); + Trace("%s\n",__FUNCTION__); return STATUS_NOT_SUPPORTED; } @@ -1526,7 +1526,7 @@ SessionExecuteRemoveWatch(UCHAR *InBuffer, } - XenIfaceDebugPrint(TRACE, "Find Watch\n"); + Trace("Find Watch\n"); watch = SessionFindWatchLocked(session, &unicpath_notbacked); @@ -1535,7 +1535,7 @@ SessionExecuteRemoveWatch(UCHAR *InBuffer, SessionRemoveWatchLocked(session, watch); } else { - XenIfaceDebugPrint(WARNING, "No Watch\n"); + Warning("No Watch\n"); } #pragma prefast (suppress:26110) ReleaseMutex(&session->WatchMapLock); @@ -1606,7 +1606,7 @@ SessionExecuteEndSession(UCHAR *InBuffer, UNICODE_STRING *instance, OUT ULONG_PTR *byteswritten) { XenStoreSession *session; - XenIfaceDebugPrint(TRACE, "ExecuteEndSession\n"); + Trace("ExecuteEndSession\n"); *byteswritten = 0; if ((session = FindSessionByInstanceAndLock(fdoData, instance)) == NULL){ @@ -1635,7 +1635,7 @@ SessionExecuteSetValue(UCHAR *InBuffer, char *tmppath; char* tmpvalue; - XenIfaceDebugPrint(TRACE, " Try to write\n"); + Trace(" Try to write\n"); if (!AccessWmiBuffer(InBuffer, TRUE, &RequiredSize, InBufferSize, WMI_STRING, &upathname, WMI_STRING, &uvalue, @@ -1673,7 +1673,7 @@ SessionExecuteSetValue(UCHAR *InBuffer, goto fail4; } status = XENBUS_STORE(Printf, &fdoData->StoreInterface, session->transaction, NULL, tmppath, tmpvalue); - XenIfaceDebugPrint(TRACE, " Write %s to %s (%p)\n", tmpvalue, tmppath, status); + Trace(" Write %s to %s (%p)\n", tmpvalue, tmppath, status); UnlockSessions(fdoData); fail4: @@ -2124,7 +2124,7 @@ SessionExecuteLog(UCHAR *InBuffer, if (!NT_SUCCESS(status)) return status; - XenIfaceDebugPrint(INFO,"USER: %s\n", message.Buffer); + Info("USER: %s\n", message.Buffer); RtlFreeAnsiString(&message); *byteswritten = 0; @@ -2381,7 +2381,7 @@ SessionExecuteMethod(UCHAR *Buffer, NTSTATUS status; UNICODE_STRING instance; UCHAR *InstStr; - XenIfaceDebugPrint(TRACE,"%s\n",__FUNCTION__); + Trace("%s\n",__FUNCTION__); if (!AccessWmiBuffer(Buffer, TRUE, &RequiredSize, BufferSize, WMI_BUFFER, sizeof(WNODE_METHOD_ITEM), &Method, @@ -2404,7 +2404,7 @@ SessionExecuteMethod(UCHAR *Buffer, GetCountedUnicodeString(&instance, InstStr); - XenIfaceDebugPrint(TRACE,"Method Id %d\n", Method->MethodId); + Trace("Method Id %d\n", Method->MethodId); switch (Method->MethodId) { case GetValue: status = SessionExecuteGetValue(InBuffer, Method->SizeDataBlock, @@ -2513,7 +2513,7 @@ SessionExecuteMethod(UCHAR *Buffer, default: - XenIfaceDebugPrint(INFO,"DRV: Unknown WMI method %d\n", Method->MethodId); + Info("DRV: Unknown WMI method %d\n", Method->MethodId); return STATUS_WMI_ITEMID_NOT_FOUND; } Method->SizeDataBlock = (ULONG)*byteswritten; @@ -2920,7 +2920,7 @@ WmiRegInfo( WMIREGGUID * guid; - XenIfaceDebugPrint(TRACE,"%s\n",__FUNCTION__); + Trace("%s\n",__FUNCTION__); if (stack->Parameters.WMI.DataPath == WMIREGISTER) { mofnamesz = mofname.Length + sizeof(USHORT); @@ -2993,7 +2993,7 @@ WmiRegInfoEx( ) { - XenIfaceDebugPrint(TRACE,"%s\n",__FUNCTION__); + Trace("%s\n",__FUNCTION__); return WmiRegInfo(fdoData, stack, byteswritten); } @@ -3008,16 +3008,14 @@ WmiProcessMinorFunction( Stack = IoGetCurrentIrpStackLocation(Irp); if (Stack->Parameters.WMI.ProviderId != (ULONG_PTR)Fdo->Dx->DeviceObject) { - XenIfaceDebugPrint(TRACE, - "ProviderID %p %p", - Stack->Parameters.WMI.ProviderId, - Fdo->PhysicalDeviceObject); + Trace("ProviderID %p %p", + Stack->Parameters.WMI.ProviderId, + Fdo->PhysicalDeviceObject); return STATUS_NOT_SUPPORTED; } else { - XenIfaceDebugPrint(TRACE, - "ProviderID Match %p %p", - Stack->Parameters.WMI.ProviderId, - Fdo->PhysicalDeviceObject); + Trace("ProviderID Match %p %p", + Stack->Parameters.WMI.ProviderId, + Fdo->PhysicalDeviceObject); } switch (Stack->MinorFunction) { -- 2.8.3 _______________________________________________ win-pv-devel mailing list win-pv-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |