From 66d6c7333ca67faca05588960a5fb4be44a17d7f Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Mon, 20 Oct 2008 15:28:08 +0200 Subject: [PATCH] d3d10: Add a debug function for D3D10_DRIVER_TYPE. --- dlls/d3d10/Makefile.in | 3 +- dlls/d3d10/d3d10_main.c | 7 ++--- dlls/d3d10/{d3d10_main.c => d3d10_private.h} | 34 +++++++-------------- dlls/d3d10/{d3d10_main.c => utils.c} | 34 ++++++++++----------- include/Makefile.in | 1 + include/d3d10.idl | 2 +- dlls/d3d10/d3d10_main.c => include/d3d10misc.h | 42 +++++++++++--------------- 7 files changed, 51 insertions(+), 72 deletions(-) copy dlls/d3d10/{d3d10_main.c => d3d10_private.h} (61%) copy dlls/d3d10/{d3d10_main.c => utils.c} (57%) copy dlls/d3d10/d3d10_main.c => include/d3d10misc.h (56%) diff --git a/dlls/d3d10/Makefile.in b/dlls/d3d10/Makefile.in index d9bb511d786..0acf4c0ea16 100644 --- a/dlls/d3d10/Makefile.in +++ b/dlls/d3d10/Makefile.in @@ -7,7 +7,8 @@ IMPORTLIB = d3d10 IMPORTS = dxguid uuid wined3d kernel32 C_SRCS = \ - d3d10_main.c + d3d10_main.c \ + utils.c RC_SRCS = version.rc diff --git a/dlls/d3d10/d3d10_main.c b/dlls/d3d10/d3d10_main.c index 8d80c41f619..c0a65f435cf 100644 --- a/dlls/d3d10/d3d10_main.c +++ b/dlls/d3d10/d3d10_main.c @@ -20,12 +20,9 @@ */ #include "config.h" -#include +#include "wine/port.h" -#include "windef.h" -#include "winbase.h" -#include "winuser.h" -#include "wine/debug.h" +#include "d3d10_private.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d10); diff --git a/dlls/d3d10/d3d10_main.c b/dlls/d3d10/d3d10_private.h similarity index 61% copy from dlls/d3d10/d3d10_main.c copy to dlls/d3d10/d3d10_private.h index 8d80c41f619..6c6bf12ee5c 100644 --- a/dlls/d3d10/d3d10_main.c +++ b/dlls/d3d10/d3d10_private.h @@ -1,7 +1,5 @@ /* - * Direct3D 10 - * - * Copyright 2007 Andras Kovacs + * Copyright 2008 Henri Verbeet for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -16,30 +14,20 @@ * 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 "config.h" -#include +#ifndef __WINE_D3D10_PRIVATE_H +#define __WINE_D3D10_PRIVATE_H + +#include "wine/debug.h" -#include "windef.h" #include "winbase.h" #include "winuser.h" -#include "wine/debug.h" +#include "objbase.h" + +#include "d3d10.h" -WINE_DEFAULT_DEBUG_CHANNEL(d3d10); +/* TRACE helper functions */ +const char *debug_d3d10_driver_type(D3D10_DRIVER_TYPE driver_type); -/* At process attach */ -BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) -{ - TRACE("fdwReason=%d\n", fdwReason); - switch(fdwReason) - { - case DLL_WINE_PREATTACH: - return FALSE; /* prefer native version */ - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls( hInstDLL ); - break; - } - return TRUE; -} +#endif /* __WINE_D3D10_PRIVATE_H */ diff --git a/dlls/d3d10/d3d10_main.c b/dlls/d3d10/utils.c similarity index 57% copy from dlls/d3d10/d3d10_main.c copy to dlls/d3d10/utils.c index 8d80c41f619..461056b9fe6 100644 --- a/dlls/d3d10/d3d10_main.c +++ b/dlls/d3d10/utils.c @@ -1,7 +1,5 @@ /* - * Direct3D 10 - * - * Copyright 2007 Andras Kovacs + * Copyright 2008 Henri Verbeet for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,26 +18,26 @@ */ #include "config.h" -#include +#include "wine/port.h" -#include "windef.h" -#include "winbase.h" -#include "winuser.h" -#include "wine/debug.h" +#include "d3d10_private.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d10); -/* At process attach */ -BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) +#define WINE_D3D10_TO_STR(x) case x: return #x + +const char *debug_d3d10_driver_type(D3D10_DRIVER_TYPE driver_type) { - TRACE("fdwReason=%d\n", fdwReason); - switch(fdwReason) + switch(driver_type) { - case DLL_WINE_PREATTACH: - return FALSE; /* prefer native version */ - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls( hInstDLL ); - break; + WINE_D3D10_TO_STR(D3D10_DRIVER_TYPE_HARDWARE); + WINE_D3D10_TO_STR(D3D10_DRIVER_TYPE_REFERENCE); + WINE_D3D10_TO_STR(D3D10_DRIVER_TYPE_NULL); + WINE_D3D10_TO_STR(D3D10_DRIVER_TYPE_SOFTWARE); + default: + FIXME("Unrecognized D3D10_DRIVER_TYPE %#x\n", driver_type); + return "unrecognized"; } - return TRUE; } + +#undef WINE_D3D10_TO_STR diff --git a/include/Makefile.in b/include/Makefile.in index d7e85f4b593..c70e6db0444 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -112,6 +112,7 @@ SRCDIR_INCLUDES = \ custcntl.h \ cvconst.h \ d3d.h \ + d3d10misc.h \ d3d8.h \ d3d8caps.h \ d3d8types.h \ diff --git a/include/d3d10.idl b/include/d3d10.idl index 032063ffe8d..ad90edeb727 100644 --- a/include/d3d10.idl +++ b/include/d3d10.idl @@ -1533,7 +1533,7 @@ interface ID3D10Multithread : IUnknown BOOL GetMultithreadProtected(); } -/* TODO: Include "d310misc.h" as soon as it exists */ +cpp_quote("#include ") /* TODO: Include "d310effect.h" as soon as it exists */ /* TODO: Include "d310shader.h" as soon as it exists */ /* TODO: Include "d310sdklayers.h" as soon as it exists */ diff --git a/dlls/d3d10/d3d10_main.c b/include/d3d10misc.h similarity index 56% copy from dlls/d3d10/d3d10_main.c copy to include/d3d10misc.h index 8d80c41f619..69b80697e4b 100644 --- a/dlls/d3d10/d3d10_main.c +++ b/include/d3d10misc.h @@ -1,7 +1,5 @@ /* - * Direct3D 10 - * - * Copyright 2007 Andras Kovacs + * Copyright 2008 Henri Verbeet for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -16,30 +14,26 @@ * 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 "config.h" -#include +#ifndef __D3D10MISC_H__ +#define __D3D10MISC_H__ -#include "windef.h" -#include "winbase.h" -#include "winuser.h" -#include "wine/debug.h" +#include "d3d10.h" -WINE_DEFAULT_DEBUG_CHANNEL(d3d10); +#ifdef __cplusplus +extern "C" { +#endif -/* At process attach */ -BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) -{ - TRACE("fdwReason=%d\n", fdwReason); - switch(fdwReason) - { - case DLL_WINE_PREATTACH: - return FALSE; /* prefer native version */ - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls( hInstDLL ); - break; - } - return TRUE; +typedef enum D3D10_DRIVER_TYPE { + D3D10_DRIVER_TYPE_HARDWARE = 0, + D3D10_DRIVER_TYPE_REFERENCE = 1, + D3D10_DRIVER_TYPE_NULL = 2, + D3D10_DRIVER_TYPE_SOFTWARE = 3, +} D3D10_DRIVER_TYPE; + +#ifdef __cplusplus } +#endif + +#endif /* __D3D10MISC_H__ */ -- 2.11.4.GIT