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.

385 lines
7.3 KiB

  1. ;; Copyright Microsoft Corporation
  2. ;;
  3. ;; Module Name:
  4. ;;
  5. ;; winthrow_err.tpl
  6. ;;
  7. ;; Abstract:
  8. ;;
  9. ;; Author:
  10. ;;
  11. ;; July 2001 JayKrell
  12. ;;
  13. ;; Revision History:
  14. ;;
  15. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  16. [EFunc]
  17. ;;
  18. ;;
  19. ;;
  20. TemplateName=RegistryFunction ;; an arbitrary label instead of a function name, just for documentation
  21. Also=RegCreateKeyExW
  22. Also=RegOpenKeyExW
  23. Also=RegQueryValueExW
  24. Also=RegSetValueExW
  25. ;; But does RegCloseKey ever fail?
  26. Also=RegCloseKey
  27. Also=RegDeleteKeyW
  28. Also=RegDeleteValueW
  29. Also=RegQueryInfoKeyW
  30. Also=SetupGetFileCompressionInfoW ;; happens to have the signature of a registry function
  31. ;;
  32. ;;
  33. ;; add registry functions above here
  34. ;;
  35. Failed=
  36. @RegistryjFailed
  37. End=
  38. IsErrorAcceptable=
  39. @RegistryjIsErrorAcceptable
  40. End=
  41. ThrowError=
  42. @RegistryjThrowError
  43. End=
  44. [EFunc]
  45. TemplateName=InvalidHandleValueLastError ;; an arbitrary label instead of a function name, just for documentation
  46. Also=CreateFileW
  47. Also=FindFirstFileW
  48. Also=GetStdHandle
  49. ;;
  50. ;;
  51. ;; add "InvalidHandleValueLastError" functions above here
  52. ;;
  53. Failed=
  54. RetVal == INVALID_HANDLE_VALUE
  55. End=
  56. DeclareErrorOut=
  57. @LastErrorjDeclareErrorOut
  58. End=
  59. DeclareLocalErrorOut=
  60. @LastErrorjDeclareLocalErrorOut
  61. End=
  62. PassErrorOut=
  63. @LastErrorjPassErrorOut
  64. End=
  65. ClearErrorOut=
  66. @LastErrorjClearErrorOut
  67. End=
  68. SetErrorOut=
  69. @LastErrorjSetErrorOut
  70. End=
  71. IsErrorAcceptable=
  72. @LastErrorjIsErrorAcceptable
  73. End=
  74. ThrowError=
  75. @LastErrorjThrowError
  76. End=
  77. [EFunc]
  78. ;;
  79. ;; UNDONE lots of these functions have query/overflow stuff we should pay attention to.
  80. ;;
  81. TemplateName=ZeroLastErrorFunctions ;; an arbitrary label instead of a function name, just for documentation
  82. Also=ImageList_GetImageCount
  83. Also=CertGetPublicKeyLength
  84. Also=FormatMessageW
  85. Also=GetDateFormatW
  86. Also=GetTimeFormatW
  87. Also=GetDlgItemTextW
  88. Also=GetFileVersionInfoSizeA
  89. Also=GetFileVersionInfoSizeW
  90. Also=GetFullPathNameW
  91. Also=GetLocaleInfoA
  92. Also=GetLocaleInfoW
  93. Also=GetLogicalDriveStringsW
  94. Also=GetModuleFileNameA
  95. Also=GetModuleFileNameW
  96. Also=GetShortPathNameW
  97. Also=GetSystemDefaultUILanguage
  98. Also=LCMapStringW
  99. Also=LoadStringW
  100. Also=MessageBoxW
  101. Also=MultiByteToWideChar
  102. Also=WideCharToMultiByte
  103. Also=RegisterWindowMessageW
  104. Also=SizeofResource
  105. Also=GetImageUnusedHeaderBytes
  106. Also=UnDecorateSymbolName
  107. Also=GetTimestampForLoadedLibrary
  108. Also=SymGetModuleBase
  109. Also=SymGetModuleBase64
  110. Also=SymLoadModule
  111. Also=SymLoadModule64
  112. ;;
  113. ;;
  114. ;; add "ZeroLastError" functions above here
  115. ;;
  116. ;;
  117. Also=NullLastErrorFunctions ;; SLEAZY (and the rest)
  118. Also=CreateEventW
  119. Also=OpenEventW
  120. Also=CreateFileMappingW
  121. Also=CreateThread
  122. ;;Also=GetModuleHandleA ;; HMODULE
  123. ;;Also=GetModuleHandleW ;; HMODULE
  124. ;;Also=LoadLibraryA ;; HMODULE
  125. ;;Also=LoadLibraryW ;; HMODULE
  126. ;;Also=GetProcAddress ;; FARPROC
  127. Also=CertOpenStore
  128. Also=GetProcessHeap
  129. Also=HeapCreate
  130. Also=FindDebugInfoFile
  131. Also=FindDebugInfoFileEx
  132. Also=FindExecutableImage
  133. Also=FindExecutableImageEx
  134. ;;
  135. ;;
  136. ;; add "NullLastError" functions above here
  137. ;;
  138. ;;
  139. Failed=
  140. RetVal == 0
  141. End=
  142. DeclareErrorOut=
  143. @LastErrorjDeclareErrorOut
  144. End=
  145. DeclareLocalErrorOut=
  146. @LastErrorjDeclareLocalErrorOut
  147. End=
  148. PassErrorOut=
  149. @LastErrorjPassErrorOut
  150. End=
  151. ClearErrorOut=
  152. @LastErrorjClearErrorOut
  153. End=
  154. SetErrorOut=
  155. @LastErrorjSetErrorOut
  156. End=
  157. IsErrorAcceptable=
  158. @LastErrorjIsErrorAcceptable
  159. End=
  160. ThrowError=
  161. @LastErrorjThrowError
  162. End=
  163. [EFunc]
  164. TemplateName=NegativeOneLastError ;; an arbitrary label instead of a function name, just for documentation
  165. Also=DialogBoxParamW
  166. Also=DialogBoxIndirectParamW
  167. Also=DialogBoxIndirectW
  168. ;;
  169. ;;
  170. ;; add "NegativeOneLastError" functions above here
  171. ;;
  172. ;;
  173. Failed=
  174. RetVal == -1
  175. End=
  176. DeclareErrorOut=
  177. @LastErrorjDeclareErrorOut
  178. End=
  179. DeclareLocalErrorOut=
  180. @LastErrorjDeclareLocalErrorOut
  181. End=
  182. PassErrorOut=
  183. @LastErrorjPassErrorOut
  184. End=
  185. ClearErrorOut=
  186. @LastErrorjClearErrorOut
  187. End=
  188. SetErrorOut=
  189. @LastErrorjSetErrorOut
  190. End=
  191. IsErrorAcceptable=
  192. @LastErrorjIsErrorAcceptable
  193. End=
  194. ThrowError=
  195. @LastErrorjThrowError
  196. End=
  197. [EFunc]
  198. TemplateName=WaitFunctionLastError ;; an arbitrary label instead of a function name, just for documentation
  199. Also=WaitForSingleObject
  200. Also=WaitForSingleObjectEx
  201. Also=WaitForMultipleObjects
  202. Also=WaitForMultipleObjectsEx
  203. ;;
  204. ;;
  205. ;; add "Wait" functions above here
  206. ;;
  207. ;;
  208. Failed=
  209. RetVal == WAIT_FAILED
  210. End=
  211. DeclareErrorOut=
  212. @LastErrorjDeclareErrorOut
  213. End=
  214. DeclareLocalErrorOut=
  215. @LastErrorjDeclareLocalErrorOut
  216. End=
  217. PassErrorOut=
  218. @LastErrorjPassErrorOut
  219. End=
  220. ClearErrorOut=
  221. @LastErrorjClearErrorOut
  222. End=
  223. SetErrorOut=
  224. @LastErrorjSetErrorOut
  225. End=
  226. IsErrorAcceptable=
  227. @LastErrorjIsErrorAcceptable
  228. End=
  229. ThrowError=
  230. @LastErrorjThrowError
  231. End=
  232. [EFunc]
  233. TemplateName=TlsAlloc
  234. Failed=
  235. RetVal == TLS_OUT_OF_INDEXES
  236. End=
  237. DeclareErrorOut=
  238. @LastErrorjDeclareErrorOut
  239. End=
  240. DeclareLocalErrorOut=
  241. @LastErrorjDeclareLocalErrorOut
  242. End=
  243. PassErrorOut=
  244. @LastErrorjPassErrorOut
  245. End=
  246. ClearErrorOut=
  247. @LastErrorjClearErrorOut
  248. End=
  249. SetErrorOut=
  250. @LastErrorjSetErrorOut
  251. End=
  252. IsErrorAcceptable=
  253. @LastErrorjIsErrorAcceptable
  254. End=
  255. ThrowError=
  256. @LastErrorjThrowError
  257. End=
  258. [EFunc]
  259. TemplateName=F8LastError
  260. ;;
  261. ;;
  262. ;;
  263. Also=GetFileAttributesW
  264. ;;
  265. ;;
  266. ;; add "F8LastError" functions above here
  267. ;; (F8 means 0xFFFFFFFF)
  268. ;;
  269. ;;
  270. Failed=
  271. RetVal == 0xFFFFFFFF
  272. End=
  273. DeclareErrorOut=
  274. @LastErrorjDeclareErrorOut
  275. End=
  276. DeclareLocalErrorOut=
  277. @LastErrorjDeclareLocalErrorOut
  278. End=
  279. PassErrorOut=
  280. @LastErrorjPassErrorOut
  281. End=
  282. ClearErrorOut=
  283. @LastErrorjClearErrorOut
  284. End=
  285. SetErrorOut=
  286. @LastErrorjSetErrorOut
  287. End=
  288. IsErrorAcceptable=
  289. @LastErrorjIsErrorAcceptable
  290. End=
  291. ThrowError=
  292. @LastErrorjThrowError
  293. End=
  294. [Types]
  295. TemplateName=ZeroLastErrorTypes
  296. Also=PVOID
  297. Also=LPVOID
  298. Also=HWND
  299. Also=HIMAGELIST
  300. Also=PCCTL_CONTEXT ;; UNDONE investigate this
  301. Also=PCCERT_CONTEXT ;; UNDONE investigate this
  302. Also=PCTL_ENTRY ;; UNDONE investigate this
  303. Also=HMODULE ;; GetModuleHandle, LoadLibrary
  304. Also=FARPROC ;; GetProcAddress
  305. Also=HRSRC ;; Find/Load/LockResource
  306. Also=HGLOBAL ;; Find/Load/LockResource
  307. Also=HLOCAL
  308. Also=LANGID ;; UNDONE just lazily getting a lot to compile
  309. Also=HDESK ;; UNDONE investigate this
  310. Also=PIMAGE_NT_HEADERS
  311. Also=PIMAGE_SECTION_HEADER
  312. Also=PIMAGE_DEBUG_INFORMATION
  313. Also=PLOADED_IMAGE
  314. ;;
  315. ;;
  316. ;; Add return types here for which NULL or 0 is generally the failure return value.
  317. ;; Do not add HANDLE or any integral (int, long, ULONG, UINT, etc.) types here.
  318. ;;
  319. ;;
  320. ;; ..SLEAZY overloading of NULL == 0 == FALSE below..
  321. Failed=
  322. RetVal == 0
  323. End=
  324. DeclareErrorOut=
  325. @LastErrorjDeclareErrorOut
  326. End=
  327. DeclareLocalErrorOut=
  328. @LastErrorjDeclareLocalErrorOut
  329. End=
  330. PassErrorOut=
  331. @LastErrorjPassErrorOut
  332. End=
  333. ClearErrorOut=
  334. @LastErrorjClearErrorOut
  335. End=
  336. SetErrorOut=
  337. @LastErrorjSetErrorOut
  338. End=
  339. IsErrorAcceptable=
  340. @LastErrorjIsErrorAcceptable
  341. End=
  342. ThrowError=
  343. @LastErrorjThrowError
  344. End=
  345. [Types]
  346. TemplateName=BOOL
  347. Failed=
  348. !RetVal
  349. End=
  350. DeclareErrorOut=
  351. @LastErrorjDeclareErrorOut
  352. End=
  353. DeclareLocalErrorOut=
  354. @LastErrorjDeclareLocalErrorOut
  355. End=
  356. PassErrorOut=
  357. @LastErrorjPassErrorOut
  358. End=
  359. ClearErrorOut=
  360. @LastErrorjClearErrorOut
  361. End=
  362. SetErrorOut=
  363. @LastErrorjSetErrorOut
  364. End=
  365. IsErrorAcceptable=
  366. @LastErrorjIsErrorAcceptable
  367. End=
  368. ThrowError=
  369. @LastErrorjThrowError
  370. End=
  371. IFNewReturnTypeNotVoid=
  372. End=
  373. NewReturnType=
  374. void
  375. End=