]> git.cworth.org Git - apitrace/commitdiff
Fix common HRESULT values.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Mon, 16 Apr 2012 19:47:56 +0000 (20:47 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Mon, 16 Apr 2012 19:47:56 +0000 (20:47 +0100)
specs/d3d.py
specs/d3d10.py
specs/d3d11.py
specs/d3d8.py
specs/d3d9.py
specs/ddraw.py
specs/dxgitype.py
specs/winapi.py

index 2a02afd61e559e44e8bc0afd4295dc8d7643e729..ca1155167418a62b51b37b464f98130b9511bcd1 100644 (file)
@@ -48,8 +48,7 @@ d3ddpFlags = Flags(DWORD, [
     "D3DDP_DONOTLIGHT",
 ])
 
-HRESULT = FakeEnum(HRESULT, [
-    "D3D_OK",
+HRESULT = MAKE_HRESULT(ok = "D3D_OK", errors = [
     "D3DERR_BADMAJORVERSION",
     "D3DERR_BADMINORVERSION",
     "D3DERR_INVALID_DEVICE",
index 3ee6179bf5719f5e0af5631a1a95b0e2c92b8b38..defad5aac3f201078f99d593c358c9dd8d7a59e5 100644 (file)
@@ -28,7 +28,7 @@ from dxgi import *
 from d3dcommon import *
 
 
-HRESULT = FakeEnum(HRESULT, [
+HRESULT = MAKE_HRESULT([
     "D3D10_ERROR_FILE_NOT_FOUND",
     "D3D10_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS",
     "D3DERR_INVALIDCALL",
index bbbf7fa024075089ce1c49264dfa9aac7c13212c..5d0c62659f3c5d9d403d4fce650351ffa8ddc5aa 100644 (file)
@@ -29,7 +29,7 @@ from d3dcommon import *
 from d3d11sdklayers import *
 
 
-HRESULT = FakeEnum(HRESULT, [
+HRESULT = MAKE_HRESULT([
     "D3D11_ERROR_FILE_NOT_FOUND",
     "D3D11_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS",
     "D3D11_ERROR_TOO_MANY_UNIQUE_VIEW_OBJECTS",
index 79177cf56b0dbbd726987c19d3b56d0dff301e09..41e640255f576bd6daa757fdfa58f97ffa211078 100644 (file)
@@ -29,8 +29,7 @@ from winapi import *
 from d3d8types import *
 from d3d8caps import *
 
-HRESULT = FakeEnum(HRESULT, [
-    "D3D_OK",
+HRESULT = MAKE_HRESULT(ok = "D3D_OK", errors = [
     "D3DERR_WRONGTEXTUREFORMAT",
     "D3DERR_UNSUPPORTEDCOLOROPERATION",
     "D3DERR_UNSUPPORTEDCOLORARG",
index 475508c574708a4c65adc75effad2292354af218..050517b2db9bf80de584a3ac196a90c75834f2a8 100644 (file)
@@ -78,8 +78,7 @@ D3DPRESENT = Flags(DWORD, [
     "D3DPRESENT_VIDEO_RESTRICT_TO_MONITOR",
 ])
 
-HRESULT = FakeEnum(HRESULT, [
-    "D3D_OK",
+HRESULT = MAKE_HRESULT(ok = "D3D_OK", errors = [
     "D3DERR_WRONGTEXTUREFORMAT",
     "D3DERR_UNSUPPORTEDCOLOROPERATION",
     "D3DERR_UNSUPPORTEDCOLORARG",
index fe93a8f697034d21c8eaf089ad0cd19d5faf61be..aed2b0d958198cb7c0f0e7c436a418dc0a17a5b4 100644 (file)
@@ -1147,9 +1147,7 @@ DirectDrawEvaluateModeFlags = Flags(DWORD, [
     "DDEM_MODEFAILED",
 ])
 
-DDRESULT = FakeEnum(HRESULT, [
-    "DD_OK",
-    "DD_FALSE",
+DDRESULT = MAKE_HRESULT(ok = "DD_OK", false = "DD_FALSE", errors = [
     "DDERR_ALREADYINITIALIZED",
     "DDERR_CANNOTATTACHSURFACE",
     "DDERR_CANNOTDETACHSURFACE",
index c7c610cc859a7a6ca2f703f6b491201b93e0e5b9..e330d14ff6cdbb092e900cc8972eac9f36e75c83 100644 (file)
@@ -27,7 +27,7 @@
 from dxgiformat import *
 
 
-HRESULT = FakeEnum(HRESULT, [
+HRESULT = MAKE_HRESULT([
     "DXGI_STATUS_OCCLUDED",
     "DXGI_STATUS_CLIPPED",
     "DXGI_STATUS_NO_REDIRECTION",
index 6fbdfaefb2b90c753c51ebdd978bf7a998ba60a4..0941118f08310ddbad3e3e7ea1e889290c47a602 100644 (file)
@@ -179,21 +179,25 @@ LOGFONTW = Struct("LOGFONTW", [
 
 # http://msdn.microsoft.com/en-us/library/ff485842.aspx
 # http://msdn.microsoft.com/en-us/library/windows/desktop/ms681381.aspx
-HRESULT = Enum("HRESULT", [
-    "S_OK", # 0x0
-    "S_FALSE", # 0x1
-    "E_PENDING", # 0x8000000A
-    "E_NOTIMPL", # 0x80004001
-    "E_NOINTERFACE", # 0x80004002
-    "E_POINTER", # 0x80004003
-    "E_ABORT", # 0x80004004
-    "E_FAIL", # 0x80004005
-    "E_UNEXPECTED", # 0x8000FFFF
-    "E_ACCESSDENIED", # 0x80070005
-    "E_HANDLE", # 0x80070006
-    "E_OUTOFMEMORY", # 0x8007000E
-    "E_INVALIDARG", # 0x80070057
-])
+def MAKE_HRESULT(errors, ok = "S_OK", false = "S_FALSE"):
+    values = [ok, false]
+    values.extend(errors)
+    values.extend([
+        "E_PENDING", # 0x8000000A
+        "E_NOTIMPL", # 0x80004001
+        "E_NOINTERFACE", # 0x80004002
+        "E_POINTER", # 0x80004003
+        "E_ABORT", # 0x80004004
+        "E_FAIL", # 0x80004005
+        "E_UNEXPECTED", # 0x8000FFFF
+        "E_ACCESSDENIED", # 0x80070005
+        "E_HANDLE", # 0x80070006
+        "E_OUTOFMEMORY", # 0x8007000E
+        "E_INVALIDARG", # 0x80070057
+    ])
+    return Enum("HRESULT", values)
+
+HRESULT = MAKE_HRESULT([])
 
 
 IUnknown = Interface("IUnknown")