Hans Leidekker : quartz: Add stub implementation for AMGetErrorText{A,
W}.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon May 22 05:20:33 CDT 2006
Module: wine
Branch: refs/heads/master
Commit: 1f35ff591ce9d9242b2dfa12429ddce80fe59d8b
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=1f35ff591ce9d9242b2dfa12429ddce80fe59d8b
Author: Hans Leidekker <hans at it.vu.nl>
Date: Sat May 20 20:57:51 2006 +0200
quartz: Add stub implementation for AMGetErrorText{A,W}.
---
dlls/quartz/main.c | 30 ++++++++++++++++++++++++++++++
dlls/quartz/quartz.spec | 4 ++--
include/Makefile.in | 1 +
include/dshow.h | 2 +-
include/errors.h | 40 ++++++++++++++++++++++++++++++++++++++++
5 files changed, 74 insertions(+), 3 deletions(-)
create mode 100644 include/errors.h
diff --git a/dlls/quartz/main.c b/dlls/quartz/main.c
index 765d59b..6ba27e3 100644
--- a/dlls/quartz/main.c
+++ b/dlls/quartz/main.c
@@ -268,3 +268,33 @@ LONG WINAPI DBToAmpFactor(LONG db)
return 0;
return 100;
}
+
+DWORD WINAPI AMGetErrorTextA(HRESULT hr, char *buffer, DWORD maxlen)
+{
+ int len;
+ static const char format[] = "Error: 0x%lx";
+ char error[MAX_ERROR_TEXT_LEN];
+
+ FIXME("(%lx,%p,%ld) stub\n", hr, buffer, maxlen);
+
+ if (!buffer) return 0;
+ wsprintfA(error, format, hr);
+ if ((len = lstrlenA(error)) >= maxlen) return 0;
+ lstrcpyA(buffer, error);
+ return len;
+}
+
+DWORD WINAPI AMGetErrorTextW(HRESULT hr, WCHAR *buffer, DWORD maxlen)
+{
+ int len;
+ static const WCHAR format[] = {'E','r','r','o','r',':',' ','0','x','%','l','x',0};
+ WCHAR error[MAX_ERROR_TEXT_LEN];
+
+ FIXME("(%lx,%p,%ld) stub\n", hr, buffer, maxlen);
+
+ if (!buffer) return 0;
+ wsprintfW(error, format, hr);
+ if ((len = lstrlenW(error)) >= maxlen) return 0;
+ lstrcpyW(buffer, error);
+ return len;
+}
diff --git a/dlls/quartz/quartz.spec b/dlls/quartz/quartz.spec
index 9491e60..7c0e2ac 100644
--- a/dlls/quartz/quartz.spec
+++ b/dlls/quartz/quartz.spec
@@ -1,5 +1,5 @@
-@ stub AMGetErrorTextA
-@ stub AMGetErrorTextW
+@ stdcall AMGetErrorTextA(long ptr long)
+@ stdcall AMGetErrorTextW(long ptr long)
@ stdcall AmpFactorToDB(long)
@ stdcall DBToAmpFactor(long)
@ stdcall -private DllCanUnloadNow()
diff --git a/include/Makefile.in b/include/Makefile.in
index 8fd224f..d726016 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -131,6 +131,7 @@ WINDOWS_INCLUDES = \
dxerr8.h \
dxerr9.h \
dxfile.h \
+ errors.h \
evcode.h \
evntrace.h \
excpt.h \
diff --git a/include/dshow.h b/include/dshow.h
index 9c6238b..f9c8120 100644
--- a/include/dshow.h
+++ b/include/dshow.h
@@ -37,7 +37,7 @@ #include <strmif.h>
#include <control.h>
/*#include <evcode.h>*/
#include <uuids.h>
-/*#include <errors.h>*/
+#include <errors.h>
#include <audevcod.h>
#ifndef OATRUE
diff --git a/include/errors.h b/include/errors.h
new file mode 100644
index 0000000..1c6bbab
--- /dev/null
+++ b/include/errors.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2006 Hans Leidekker
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __ERRORS__
+#define __ERRORS__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define VFW_FIRST_CODE 0x200
+#define MAX_ERROR_TEXT_LEN 160
+
+#include <vfwmsgs.h>
+
+DWORD WINAPI AMGetErrorTextA(HRESULT hr, char *buffer, DWORD maxlen);
+DWORD WINAPI AMGetErrorTextW(HRESULT hr, WCHAR *buffer, DWORD maxlen);
+
+#define AMGetErrorText WINELIB_NAME_AW(AMGetErrorText)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ERRORS__ */
More information about the wine-cvs
mailing list