Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
3.0 KiB

  1. divert(-1)dnl
  2. #
  3. # File: d3dxerr.w
  4. # Purpose: Generates d3dxerr.h and d3dxerrswitch.h
  5. # Includes: d3dxerrdef.w
  6. #
  7. # Description: d3dxerr.h is an external D3DX header containing D3DXERR_*
  8. # definitions. d3dxerrswitch.h contains the guts of a C switch
  9. # statement that assigns strings to an LPSTR based on a given
  10. # D3DXERR_. The switch statement which #includes d3dxerrswitch.h
  11. # is in the implementation of D3DXGetErrorString in d3dx.cpp.
  12. #
  13. # Usage: m4 d3dxerr.w > d3dxerr.h
  14. # m4 -Dswitch d3dxerr.w > d3dxerrswitch.h
  15. #
  16. #
  17. define(`begindoc',`divert(-1)dnl')
  18. define(`enddoc',`divert(0)dnl')
  19. # Severity codes
  20. define(`Success',`0x0')
  21. define(`Informational',`0x4')
  22. define(`Warning',`0x8')
  23. define(`Error',`0xC')
  24. # Customer code flag
  25. define(`CustomerCodeFlag',`0x0')
  26. # Reserved bit
  27. define(`ReservedBit',`0x0')
  28. # Facility Names
  29. # Do not use just D3DX, because anywhere the text D3DX appears,
  30. # 0x877 will be replaced, which is undesirable.
  31. define(`FACILITY_D3DX',`0x877')
  32. define(`MessageId',`0')
  33. divert(0)dnl
  34. ifdef( `switch',dnl
  35. `begindoc'
  36. # ErrorBlock(MessageId,Severity,Facility,Language,SymbolicName,ErrorString)
  37. `enddoc'
  38. define(`ErrorBlock',
  39. ` CASE_ERROR( $5 );')dnl
  40. include(d3dxerrdef.w),
  41. //----------------------------------------------------------------------
  42. //
  43. // d3dxerr.h -- Error code definitions for the D3DX API
  44. //
  45. // Copyright (c) Microsoft Corp. All rights reserved.
  46. //
  47. //----------------------------------------------------------------------
  48. #ifndef __D3DXERR_H__
  49. #define __D3DXERR_H__
  50. //
  51. //
  52. // Values are 32 bit values layed out as follows:
  53. //
  54. // 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  55. // 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  56. // +---+-+-+-----------------------+-------------------------------+
  57. // |Sev|C|R| Facility | Code |
  58. // +---+-+-+-----------------------+-------------------------------+
  59. //
  60. // where
  61. //
  62. // Sev - is the severity code
  63. //
  64. // 00 - ``Success''
  65. // 01 - ``Informational''
  66. // 10 - ``Warning''
  67. // 11 - ``Error''
  68. //
  69. // C - is the Customer code flag
  70. //
  71. // R - is a reserved bit
  72. //
  73. // Facility - is the facility code
  74. //
  75. // Code - is the facility's status code
  76. //
  77. //
  78. // Define the facility codes
  79. //
  80. `#'define `FACILITY_D3DX' FACILITY_D3DX
  81. `begindoc'
  82. # ErrorBlock(MessageId,Severity,Facility,Language,SymbolicName,ErrorString)
  83. `enddoc'
  84. define(`ErrorBlock',`
  85. //
  86. // ``MessageId'': $5
  87. //
  88. // MessageText:
  89. //
  90. // $6
  91. //
  92. ifelse(`$1',`',`define(`MessageId',incr(MessageId))',`define(`MessageId',$1)')dnl
  93. `#'define $5 `((HRESULT)0x'eval(CustomerCodeFlag+ReservedBit+`$2',16,1)`'eval($3,16,3)eval(MessageId,16,4)`L)'
  94. ')
  95. include(d3dxerrdef.w)
  96. #endif //__D3DXERR_H__
  97. )