Module: wine
Branch: master
Commit: 5a91cffc20cf85664596706326152c88ce2914ef
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5a91cffc20cf8566459670632…
Author: Alexander Scott-Johns <alexander.scott.johns(a)googlemail.com>
Date: Fri Jun 26 23:53:49 2009 +0100
rtutils: Add stub TraceRegisterExW and TraceRegisterExA.
The -W function is imported by Windows Journal Viewer.
---
dlls/rtutils/Makefile.in | 3 +-
dlls/rtutils/rtutils.spec | 4 +-
dlls/rtutils/tracing.c | 64 +++++++++++++++++++++++++++++++++++++++++++++
include/Makefile.in | 1 +
include/rtutils.h | 49 ++++++++++++++++++++++++++++++++++
5 files changed, 118 insertions(+), 3 deletions(-)
diff --git a/dlls/rtutils/Makefile.in b/dlls/rtutils/Makefile.in
index dfe9bbb..d695502 100644
--- a/dlls/rtutils/Makefile.in
+++ b/dlls/rtutils/Makefile.in
@@ -7,7 +7,8 @@ IMPORTLIB = rtutils
IMPORTS = kernel32
C_SRCS = \
- main.c
+ main.c \
+ tracing.c
@MAKE_DLL_RULES@
diff --git a/dlls/rtutils/rtutils.spec b/dlls/rtutils/rtutils.spec
index 008009c..1c8c9c3 100644
--- a/dlls/rtutils/rtutils.spec
+++ b/dlls/rtutils/rtutils.spec
@@ -47,8 +47,8 @@
@ stub TracePrintfW
@ stub TracePutsExA
@ stub TracePutsExW
-@ stub TraceRegisterExA
-@ stub TraceRegisterExW
+@ stdcall TraceRegisterExA(str long)
+@ stdcall TraceRegisterExW(wstr long)
@ stub TraceVprintfExA
@ stub TraceVprintfExW
@ stub UpdateWaitTimer
diff --git a/dlls/rtutils/tracing.c b/dlls/rtutils/tracing.c
new file mode 100644
index 0000000..96d1dfb
--- /dev/null
+++ b/dlls/rtutils/tracing.c
@@ -0,0 +1,64 @@
+/*
+ * Tracing API functions
+ *
+ * Copyright 2009 Alexander Scott-Johns
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdarg.h>
+#include <stdio.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "winnt.h"
+#include "winuser.h"
+#include "winnls.h"
+
+#include "wine/debug.h"
+
+#include "rtutils.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(rtutils);
+
+/******************************************************************************
+ * TraceRegisterExW (RTUTILS.@)
+ */
+DWORD WINAPI TraceRegisterExW(LPCWSTR name, DWORD flags)
+{
+ FIXME("(%s, %x): stub\n", debugstr_w(name), flags);
+ return INVALID_TRACEID;
+}
+
+/******************************************************************************
+ * TraceRegisterExA (RTUTILS.@)
+ *
+ * See TraceRegisterExW.
+ */
+DWORD WINAPI TraceRegisterExA(LPCSTR name, DWORD flags)
+{
+ DWORD id;
+ int lenW = MultiByteToWideChar(CP_ACP, 0, name, -1, NULL, 0);
+ WCHAR* nameW = HeapAlloc(GetProcessHeap(), 0, lenW * sizeof(WCHAR));
+ if (!nameW)
+ {
+ SetLastError(ERROR_OUTOFMEMORY);
+ return INVALID_TRACEID;
+ }
+ MultiByteToWideChar(CP_ACP, 0, name, -1, nameW, lenW);
+ id = TraceRegisterExW(nameW, flags);
+ HeapFree(GetProcessHeap(), 0, nameW);
+ return id;
+}
diff --git a/include/Makefile.in b/include/Makefile.in
index c62b85f..4210bbb 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -390,6 +390,7 @@ SRCDIR_INCLUDES = \
rpcndr.h \
rpcnterr.h \
rpcproxy.h \
+ rtutils.h \
scarderr.h \
schannel.h \
schemadef.h \
diff --git a/include/rtutils.h b/include/rtutils.h
new file mode 100644
index 0000000..1e2921a
--- /dev/null
+++ b/include/rtutils.h
@@ -0,0 +1,49 @@
+/*
+ * Rtutils.h - Routing utilities / RRAS tracing
+ *
+ * Copyright (C) 2009 Alexander Scott-Johns
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef _RTUTILS_H_
+#define _RTUTILS_H_
+
+#include <stdarg.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+DWORD WINAPI TraceRegisterExW(LPCWSTR name, DWORD flags);
+DWORD WINAPI TraceRegisterExA(LPCSTR name, DWORD flags);
+#define TraceRegisterEx WINELIB_NAME_AW(TraceRegisterEx)
+
+#define TraceRegisterW(name) TraceRegisterExW((name), 0)
+#define TraceRegisterA(name) TraceRegisterExA((name), 0)
+#define TraceRegister WINELIB_NAME_AW(TraceRegister)
+
+/* Flags for TraceRegisterEx(W|A) */
+#define TRACE_USE_FILE 1
+#define TRACE_USE_CONSOLE 2
+
+/* Return value of TraceRegisterEx(W|A) */
+#define INVALID_TRACEID 0xFFFFFFFF
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RTUTILS_H_ */