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.

186 lines
6.7 KiB

  1. /****************************************************************************\
  2. *
  3. * LogError() and LogParamError() definitions
  4. *
  5. * Excerpted from WINDOWS.H, since that file isn't included by GDI & KERNEL.
  6. \****************************************************************************/
  7. /* If windows.h already included, don't redefine any of this. */
  8. /* Include the stuff if NOLOGERROR was defined, though. */
  9. #if (!defined(_INC_WINDOWS) || defined(NOLOGERROR))
  10. #ifdef WINAPI
  11. void WINAPI LogError(WORD err, void FAR* lpInfo);
  12. void WINAPI LogParamError(WORD err, FARPROC lpfn, void FAR* param);
  13. #endif
  14. /****** LogParamError/LogError values */
  15. /* Error modifier bits */
  16. #define ERR_WARNING 0x8000
  17. #define ERR_PARAM 0x4000
  18. /* Internal error value masks */ /* ;Internal */
  19. #define ERR_TYPE_MASK 0x0fff /* ;Internal */
  20. #define ERR_FLAGS_MASK 0xc000 /* ;Internal */
  21. /* ;Internal */
  22. #define ERR_SIZE_MASK 0x3000
  23. #define ERR_SIZE_SHIFT 12
  24. #define ERR_BYTE 0x1000
  25. #define ERR_WORD 0x2000
  26. #define ERR_DWORD 0x3000
  27. /****** LogParamError() values */
  28. /* Generic parameter values */
  29. #define ERR_BAD_VALUE 0x6001
  30. #define ERR_BAD_FLAGS 0x6002
  31. #define ERR_BAD_INDEX 0x6003
  32. #define ERR_BAD_DVALUE 0x7004
  33. #define ERR_BAD_DFLAGS 0x7005
  34. #define ERR_BAD_DINDEX 0x7006
  35. #define ERR_BAD_PTR 0x7007
  36. #define ERR_BAD_FUNC_PTR 0x7008
  37. #define ERR_BAD_SELECTOR 0x6009
  38. #define ERR_BAD_STRING_PTR 0x700a
  39. #define ERR_BAD_HANDLE 0x600b
  40. /* KERNEL parameter errors */
  41. #define ERR_BAD_HINSTANCE 0x6020
  42. #define ERR_BAD_HMODULE 0x6021
  43. #define ERR_BAD_GLOBAL_HANDLE 0x6022
  44. #define ERR_BAD_LOCAL_HANDLE 0x6023
  45. #define ERR_BAD_ATOM 0x6024
  46. #define ERR_BAD_HFILE 0x6025
  47. /* USER parameter errors */
  48. #define ERR_BAD_HWND 0x6040
  49. #define ERR_BAD_HMENU 0x6041
  50. #define ERR_BAD_HCURSOR 0x6042
  51. #define ERR_BAD_HICON 0x6043
  52. #define ERR_BAD_HDWP 0x6044
  53. #define ERR_BAD_CID 0x6045
  54. #define ERR_BAD_HDRVR 0x6046
  55. /* GDI parameter errors */
  56. #define ERR_BAD_COORDS 0x7060
  57. #define ERR_BAD_GDI_OBJECT 0x6061
  58. #define ERR_BAD_HDC 0x6062
  59. #define ERR_BAD_HPEN 0x6063
  60. #define ERR_BAD_HFONT 0x6064
  61. #define ERR_BAD_HBRUSH 0x6065
  62. #define ERR_BAD_HBITMAP 0x6066
  63. #define ERR_BAD_HRGN 0x6067
  64. #define ERR_BAD_HPALETTE 0x6068
  65. #define ERR_BAD_HMETAFILE 0x6069
  66. /* Debug fill constants */
  67. #define DBGFILL_ALLOC 0xfd
  68. #define DBGFILL_FREE 0xfb
  69. #define DBGFILL_BUFFER 0xf9
  70. #define DBGFILL_STACK 0xf7
  71. /**** LogError() values */
  72. /* KERNEL errors */
  73. #define ERR_GALLOC 0x0001 /* GlobalAlloc Failed */
  74. #define ERR_GREALLOC 0x0002 /* GlobalReAlloc Failed */
  75. #define ERR_GLOCK 0x0003 /* GlobalLock Failed */
  76. #define ERR_LALLOC 0x0004 /* LocalAlloc Failed */
  77. #define ERR_LREALLOC 0x0005 /* LocalReAlloc Failed */
  78. #define ERR_LLOCK 0x0006 /* LocalLock Failed */
  79. #define ERR_ALLOCRES 0x0007 /* AllocResource Failed */
  80. #define ERR_LOCKRES 0x0008 /* LockResource Failed */
  81. #define ERR_LOADMODULE 0x0009 /* LoadModule failed */
  82. /* USER errors */
  83. #define ERR_CREATEDLG 0x0040 /* Create Dlg failure due to LoadMenu failure */
  84. #define ERR_CREATEDLG2 0x0041 /* Create Dlg failure due to CreateWindow Failure */
  85. #define ERR_REGISTERCLASS 0x0042 /* RegisterClass failure due to Class already registered */
  86. #define ERR_DCBUSY 0x0043 /* DC Cache is full */
  87. #define ERR_CREATEWND 0x0044 /* Create Wnd failed due to class not found */
  88. #define ERR_STRUCEXTRA 0x0045 /* Unallocated Extra space is used */
  89. #define ERR_LOADSTR 0x0046 /* LoadString() failed */
  90. #define ERR_LOADMENU 0x0047 /* LoadMenu Failed */
  91. #define ERR_NESTEDBEGINPAINT 0x0048 /* Nested BeginPaint() calls */
  92. #define ERR_BADINDEX 0x0049 /* Bad index to Get/Set Class/Window Word/Long */
  93. #define ERR_CREATEMENU 0x004a /* Error creating menu */
  94. /* GDI errors */
  95. #define ERR_CREATEDC 0x0080 /* CreateDC/CreateIC etc., failure */
  96. #define ERR_CREATEMETA 0x0081 /* CreateMetafile failure */
  97. #define ERR_DELOBJSELECTED 0x0082 /* Bitmap being deleted is selected into DC */
  98. #define ERR_SELBITMAP 0x0083 /* Bitmap being selected is already selected elsewhere */
  99. /* Debugging information support (DEBUG SYSTEM ONLY) */
  100. #ifdef WINAPI
  101. typedef struct tagWINDEBUGINFO
  102. {
  103. UINT flags;
  104. DWORD dwOptions;
  105. DWORD dwFilter;
  106. char achAllocModule[8];
  107. DWORD dwAllocBreak;
  108. DWORD dwAllocCount;
  109. } WINDEBUGINFO;
  110. BOOL WINAPI GetWinDebugInfo(WINDEBUGINFO FAR* lpwdi, UINT flags);
  111. BOOL WINAPI SetWinDebugInfo(const WINDEBUGINFO FAR* lpwdi);
  112. void FAR _cdecl DebugOutput(UINT flags, LPCSTR lpsz, ...);
  113. void WINAPI DebugFillBuffer(void FAR* lpb, UINT cb);
  114. #endif
  115. /* WINDEBUGINFO flags values */
  116. #define WDI_OPTIONS 0x0001
  117. #define WDI_FILTER 0x0002
  118. #define WDI_ALLOCBREAK 0x0004
  119. #define WDI_VALID 0x0007 /* ;Internal */
  120. /* dwOptions values */
  121. #define DBO_CHECKHEAP 0x0001
  122. #define DBO_FREEFILL 0x0002
  123. #define DBO_BUFFERFILL 0x0004
  124. #define DBO_COMPAT 0x0008
  125. #define DBO_DISABLEGPTRAPPING 0x0010
  126. #define DBO_CHECKFREE 0x0020
  127. #define DBO_RIP_STACK 0x0040
  128. #define DBO_SILENT 0x8000
  129. #define DBO_PARAMBREAK 0x0000 /* ;Internal *//* Obsolete: was 0x4000 */
  130. #define DBO_TRACEBREAK 0x2000
  131. #define DBO_WARNINGBREAK 0x1000
  132. #define DBO_NOERRORBREAK 0x0800
  133. #define DBO_NOFATALBREAK 0x0400
  134. #define DBO_TRACEON 0x0000 /* ;Internal *//* Obsolete: was 0x0200 */
  135. #define DBO_INT3BREAK 0x0100
  136. /* dwFilter values */
  137. #define DBF_TRACE 0x0000
  138. #define DBF_WARNING 0x4000
  139. #define DBF_ERROR 0x8000
  140. #define DBF_FATAL 0xc000
  141. #define DBF_SEVMASK 0xc000 /* ;Internal */
  142. #define DBF_FILTERMASK 0x3fff /* ;Internal */
  143. #define DBF_INTERNAL 0x0000 /* ;Internal *//* Obsolete: was 0x2000 */
  144. #define DBF_KERNEL 0x1000
  145. #define DBF_KRN_MEMMAN 0x0001
  146. #define DBF_KRN_LOADMODULE 0x0002
  147. #define DBF_KRN_SEGMENTLOAD 0x0004
  148. #define DBF_USER 0x0800
  149. #define DBF_GDI 0x0400
  150. #define DBF_COMPAT 0x0000 /* ;Internal *//* Obsolete: was 0x0200 */
  151. #define DBF_LOGERROR 0x0000 /* ;Internal *//* Obsolete: was 0x0100 */
  152. #define DBF_PARAMERROR 0x0000 /* ;Internal *//* Obsolete: was 0x0080 */
  153. #define DBF_MMSYSTEM 0x0040
  154. #define DBF_PENWIN 0x0020
  155. #define DBF_APPLICATION 0x0010
  156. #define DBF_DRIVER 0x0008
  157. #endif /* _INC_WINDOWS */