Leaked source code of windows server 2003
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.

162 lines
3.3 KiB

  1. ;; Copyright Microsoft Corporation
  2. ;;
  3. ;; Module Name:
  4. ;;
  5. ;; winthrow_specialcases.tpl
  6. ;;
  7. ;; Abstract:
  8. ;;
  9. ;; Author:
  10. ;;
  11. ;; July 2001 JayKrell
  12. ;;
  13. ;; Revision History:
  14. ;;
  15. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  16. [Types]
  17. TemplateName=NTSTATUS
  18. MicrosoftInternal=
  19. 1
  20. End=
  21. Failed=
  22. !NT_SUCCESS(RetVal)
  23. End=
  24. IsErrorAcceptable=
  25. ::@PrivateNamespace_IsNtStatusAcceptable(RetVal, NumberOfAcceptableErrors, VaListOfAcceptableErrors)
  26. End=
  27. ThrowError=
  28. EXCEPTION_TYPE Exception;
  29. __if_exists(EXCEPTION_TYPE::Init@ApiName)@NL
  30. {@Indent(@NL
  31. Exception.Init@ApiName(RetVal@IfArgs(@NL, @ArgsOut));@NL
  32. )}@NL
  33. __if_not_exists(EXCEPTION_TYPE::Init@ApiName)@NL
  34. {@Indent(@NL
  35. Exception.InitNtStatus(RetVal);@NL
  36. )}@NL
  37. Exception.Throw();@NL
  38. End=
  39. [Types]
  40. TemplateName=HRESULT
  41. Failed=
  42. FAILED(RetVal)
  43. End=
  44. IsErrorAcceptable=
  45. ::@PrivateNamespace_IsHResultAcceptable(RetVal, NumberOfAcceptableErrors, VaListOfAcceptableErrors)
  46. End=
  47. ThrowError=
  48. EXCEPTION_TYPE Exception;
  49. __if_exists(EXCEPTION_TYPE::Init@ApiName)@NL
  50. {@Indent(@NL
  51. Exception.Init@ApiName(RetVal@IfArgs(@NL, @ArgsOut));@NL
  52. )}@NL
  53. __if_not_exists(EXCEPTION_TYPE::Init@ApiName)
  54. {@Indent(@NL
  55. Exception.InitHResult(RetVal);@NL
  56. )}@NL
  57. Exception.Throw();@NL
  58. End=
  59. [EFunc]
  60. TemplateName=RegistryEnumeration
  61. Also=RegEnumKeyExW
  62. Also=RegEnumValueW
  63. Failed=
  64. RetVal != ERROR_SUCCESS && RetVal != ERROR_NO_MORE_ITEMS
  65. End=
  66. IsErrorAcceptable=
  67. @RegistryjIsErrorAcceptable
  68. End=
  69. ThrowError=
  70. @RegistryjThrowError
  71. End=
  72. ;;
  73. ;; Since FindNextFileW returns BOOL, we can rely on the BOOL rules
  74. ;; to handle the other lasterror stuff.
  75. ;;
  76. [EFunc]
  77. TemplateName=FindNextFileW
  78. Failed=
  79. RetVal == FALSE && (::GetLastError() != ERROR_NO_MORE_FILES)
  80. End=
  81. ;;
  82. ;; Since TlsGetValue returns PVOID, we can rely on the PVOID rules
  83. ;; to handle the other lasterror stuff.
  84. ;;
  85. [EFunc]
  86. TemplateName=TlsGetValue
  87. Failed=
  88. RetVal == NULL && (::GetLastError() != NO_ERROR)
  89. End=
  90. [EFunc]
  91. ;;
  92. ;; GetFileSize and SetFilePointer are very similar.
  93. ;;
  94. TemplateName=SetFilePointer
  95. Failed=
  96. RetVal == INVALID_SET_FILE_POINTER && (lpDistanceToMoveHigh == NULL || ::GetLastError() != NO_ERROR)
  97. End=
  98. ;;
  99. ;; The rest of this [EFunc] section ideally would not be present, given
  100. ;; better understanding or behavior of genthnk.exe.
  101. ;;
  102. DeclareErrorOut=
  103. @LastErrorjDeclareErrorOut
  104. End=
  105. DeclareLocalErrorOut=
  106. @LastErrorjDeclareLocalErrorOut
  107. End=
  108. PassErrorOut=
  109. @LastErrorjPassErrorOut
  110. End=
  111. ClearErrorOut=
  112. @LastErrorjClearErrorOut
  113. End=
  114. SetErrorOut=
  115. @LastErrorjSetErrorOut
  116. End=
  117. IsErrorAcceptable=
  118. @LastErrorjIsErrorAcceptable
  119. End=
  120. ThrowError=
  121. @LastErrorjThrowError
  122. End=
  123. [EFunc]
  124. ;;
  125. ;; GetFileSize and SetFilePointer are very similar.
  126. ;;
  127. TemplateName=GetFileSize
  128. Failed=
  129. RetVal == INVALID_FILE_SIZE && (lpFileSizeHigh == NULL || ::GetLastError() != NO_ERROR)
  130. End=
  131. ;;
  132. ;; The rest of this [EFunc] section ideally would not be present, given
  133. ;; better understanding or behavior of genthnk.exe.
  134. ;;
  135. DeclareErrorOut=
  136. @LastErrorjDeclareErrorOut
  137. End=
  138. DeclareLocalErrorOut=
  139. @LastErrorjDeclareLocalErrorOut
  140. End=
  141. PassErrorOut=
  142. @LastErrorjPassErrorOut
  143. End=
  144. ClearErrorOut=
  145. @LastErrorjClearErrorOut
  146. End=
  147. SetErrorOut=
  148. @LastErrorjSetErrorOut
  149. End=
  150. IsErrorAcceptable=
  151. @LastErrorjIsErrorAcceptable
  152. End=
  153. ThrowError=
  154. @LastErrorjThrowError
  155. End=