Andrew Nguyen : dxdiag: Introduce the information collection infrastructure .

Alexandre Julliard julliard at winehq.org
Tue Jun 14 11:57:48 CDT 2011


Module: wine
Branch: master
Commit: c349a34e1694265da0f3b25c532278ab69362b54
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c349a34e1694265da0f3b25c532278ab69362b54

Author: Andrew Nguyen <anguyen at codeweavers.com>
Date:   Tue Jun 14 08:01:51 2011 -0500

dxdiag: Introduce the information collection infrastructure.

---

 programs/dxdiag/Makefile.in      |    1 +
 programs/dxdiag/dxdiag_private.h |    8 +++++++-
 programs/dxdiag/information.c    |   36 ++++++++++++++++++++++++++++++++++++
 programs/dxdiag/main.c           |   12 +++++++++++-
 programs/dxdiag/output.c         |    2 +-
 5 files changed, 56 insertions(+), 3 deletions(-)

diff --git a/programs/dxdiag/Makefile.in b/programs/dxdiag/Makefile.in
index 6a43982..3a691b0 100644
--- a/programs/dxdiag/Makefile.in
+++ b/programs/dxdiag/Makefile.in
@@ -4,6 +4,7 @@ APPMODE   = -mwindows -municode
 IMPORTS   = user32
 
 C_SRCS = \
+	information.c \
 	main.c \
 	output.c
 
diff --git a/programs/dxdiag/dxdiag_private.h b/programs/dxdiag/dxdiag_private.h
index 6026a9d..cbd9f5d 100644
--- a/programs/dxdiag/dxdiag_private.h
+++ b/programs/dxdiag/dxdiag_private.h
@@ -26,6 +26,12 @@
 #define STRING_DXDIAG_TOOL      101
 #define STRING_USAGE            102
 
+/* Information collection definitions. */
+struct dxdiag_information;
+
+struct dxdiag_information *collect_dxdiag_information(BOOL whql_check);
+void free_dxdiag_information(struct dxdiag_information *dxdiag_info);
+
 /* Output backend definitions. */
 enum output_type
 {
@@ -50,4 +56,4 @@ static inline const char *debugstr_output_type(enum output_type type)
 }
 
 const WCHAR *get_output_extension(enum output_type type);
-BOOL output_dxdiag_information(const WCHAR *filename, enum output_type type);
+BOOL output_dxdiag_information(struct dxdiag_information *dxdiag_info, const WCHAR *filename, enum output_type type);
diff --git a/programs/dxdiag/information.c b/programs/dxdiag/information.c
new file mode 100644
index 0000000..ecdaa92
--- /dev/null
+++ b/programs/dxdiag/information.c
@@ -0,0 +1,36 @@
+/*
+ * DxDiag information collection
+ *
+ * Copyright 2011 Andrew Nguyen
+ *
+ * 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 "wine/debug.h"
+
+#include "dxdiag_private.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(dxdiag);
+
+void free_dxdiag_information(struct dxdiag_information *system_info)
+{
+    /* Do nothing for now. */
+}
+
+struct dxdiag_information *collect_dxdiag_information(BOOL whql_check)
+{
+    WINE_FIXME("DxDiag information collection is not implemented\n");
+    return NULL;
+}
diff --git a/programs/dxdiag/main.c b/programs/dxdiag/main.c
index 5380548..f286db6 100644
--- a/programs/dxdiag/main.c
+++ b/programs/dxdiag/main.c
@@ -174,6 +174,7 @@ static BOOL process_command_line(const WCHAR *cmdline, struct command_line_info
 int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cmdshow)
 {
     struct command_line_info info;
+    struct dxdiag_information *dxdiag_info;
 
     hInstance = hInst;
 
@@ -185,10 +186,19 @@ int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cm
     if (info.output_type != OUTPUT_NONE)
         WINE_TRACE("Output filename: %s\n", debugstr_output_type(info.output_type));
 
+    dxdiag_info = collect_dxdiag_information(info.whql_check);
+    if (!dxdiag_info)
+    {
+        WINE_ERR("DxDiag information collection failed\n");
+        return 1;
+    }
+
     if (info.output_type != OUTPUT_NONE)
-        output_dxdiag_information(info.outfile, info.output_type);
+        output_dxdiag_information(dxdiag_info, info.outfile, info.output_type);
     else
         WINE_FIXME("Information dialog is not implemented\n");
 
+    free_dxdiag_information(dxdiag_info);
+
     return 0;
 }
diff --git a/programs/dxdiag/output.c b/programs/dxdiag/output.c
index c7b3060..effe2a2 100644
--- a/programs/dxdiag/output.c
+++ b/programs/dxdiag/output.c
@@ -48,7 +48,7 @@ const WCHAR *get_output_extension(enum output_type type)
     return output_backends[type - 1].filename_ext;
 }
 
-BOOL output_dxdiag_information(const WCHAR *filename, enum output_type type)
+BOOL output_dxdiag_information(struct dxdiag_information *dxdiag_info, const WCHAR *filename, enum output_type type)
 {
     WINE_FIXME("File information output is not implemented\n");
     return FALSE;




More information about the wine-cvs mailing list