From ea79919d0046555a2ecfba699c3b80439562120e Mon Sep 17 00:00:00 2001
From: =?utf8?q?Jos=C3=A9=20Fonseca?= <jose.r.fonseca@gmail.com>
Date: Tue, 13 Nov 2012 21:37:24 +0000
Subject: [PATCH] d3dretrace: Handle Software devices.

---
 retrace/d3dcommonretrace.py | 7 +++++++
 specs/winapi.py             | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/retrace/d3dcommonretrace.py b/retrace/d3dcommonretrace.py
index e939ddf..add1a50 100644
--- a/retrace/d3dcommonretrace.py
+++ b/retrace/d3dcommonretrace.py
@@ -52,8 +52,15 @@ class D3DRetracer(Retracer):
         if function.name in ('D3D10CreateDeviceAndSwapChain', 'D3D10CreateDeviceAndSwapChain1', 'D3D11CreateDeviceAndSwapChain'):
             print r'    pSwapChainDesc->OutputWindow = d3dretrace::createWindow(512, 512);'
 
+        if 'Software' in function.argNames():
+            print r'    if (Software) {'
+            print r'        retrace::warning(call) << "software device\n";'
+            print r'        Software = LoadLibraryA("d3d10warp");'
+            print r'    }'
+
         Retracer.invokeFunction(self, function)
 
+
     def invokeInterfaceMethod(self, interface, method):
         # keep track of the last used device for state dumping
         #if interface.name in ('IDirect3DDevice9', 'IDirect3DDevice9Ex'):
diff --git a/specs/winapi.py b/specs/winapi.py
index 23d6419..031c834 100644
--- a/specs/winapi.py
+++ b/specs/winapi.py
@@ -152,7 +152,7 @@ RGNDATA = Struct("RGNDATA", [
 ])
 LPRGNDATA = Pointer(RGNDATA)
 
-HMODULE = DECLARE_HANDLE("HMODULE")
+HMODULE = IntPointer("HMODULE")
 
 FILETIME = Struct("FILETIME", [
     (DWORD, "dwLowDateTime"),
-- 
2.45.2