IoctlLog will strip any trailing newline and insert a single
newline to enforce log file consistancy
Signed-off-by: Owen Smith <owen.smith@citrix.com>
va_end(args);
OutputDebugString(message);
+
+ // if possible, send to xeniface to forward to logs
+ CCritSec crit(&s_service.m_crit);
+ if (s_service.m_device) {
+ s_service.m_device->Log(message);
+ }
}
/*static*/ int CXenAgent::ServiceInstall()
)
{
NTSTATUS status;
+ PCHAR ptr;
status = STATUS_INVALID_BUFFER_SIZE;
if (InLen == 0 || InLen > XENIFACE_LOG_MAX_LENGTH || OutLen != 0)
if (!__IsValidStr(Buffer, InLen))
goto fail2;
+ // remove newlines from end of buffer
+ for (ptr = Buffer + InLen - 1;
+ ptr != Buffer && *ptr != 0 && *ptr != '\n';
+ --ptr)
+ *ptr = 0;
XenIfaceDebugPrint(INFO, "USER: %s\n", Buffer);
return STATUS_SUCCESS;