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.

123 lines
3.8 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. callback.hxx
  5. Abstract:
  6. This header file declares callback functions for known GDI types.
  7. Author:
  8. JasonHa
  9. --*/
  10. #ifndef _CALLBACK_HXX_
  11. #define _CALLBACK_HXX_
  12. #include "flags.hxx"
  13. // Set if you use callbacks
  14. // TRUE if you use DBG_DUMP_COMPACT_OUT
  15. // FALSE otherwise
  16. extern BOOL gbCallbacksPrintNewline;
  17. extern int gCallbacksPrintNameWidth;
  18. // Controls value returned by successful callbacks.
  19. // Use when callbacks should return something other
  20. // than STATUS_SUCCESS. For example used carefully
  21. // in conjunction with DBG_DUMP_FIELD_CALL_BEFORE_PRINT
  22. // can prevent default type printing.
  23. extern NTSTATUS gCallbackReturnValue;
  24. // PrepareCallbacks
  25. //
  26. // Call this at beginning of any extension which may
  27. // use one of the type callbacks below. It will make
  28. // sure they are set for default usage.
  29. //
  30. __inline
  31. VOID
  32. PrepareCallbacks(
  33. BOOL bPrintNewline=FALSE,
  34. int PrintNamesWidth=-1,
  35. NTSTATUS DefaultReturnStatus=STATUS_SUCCESS
  36. )
  37. {
  38. gbCallbacksPrintNewline = bPrintNewline;
  39. gCallbacksPrintNameWidth = PrintNamesWidth;
  40. gCallbackReturnValue = DefaultReturnStatus;
  41. }
  42. ULONG FieldCallback(PFIELD_INFO pField, PVOID UserContext);
  43. const char szDefaultNextItemHeader[] = "--------------------------------------------------\n";
  44. void NextItemCallbackInit(const char *pszPrintHeader = szDefaultNextItemHeader, ULONG64 LastItemAddr = 0);
  45. BOOL LastCallbackItemFound();
  46. ULONG NextItemCallback(PFIELD_INFO pField, PVOID UserContext);
  47. ULONG PointerToNextItemCallback(PFIELD_INFO pField, PVOID UserContext);
  48. ULONG ArrayCallback(PFIELD_INFO pField, PVOID UserContext);
  49. ULONG NewlineCallback(PFIELD_INFO pField, PVOID UserContext);
  50. ULONG NewlineCallback(PFIELD_INFO pField, PVOID UserContext);
  51. ULONG AddressPrintCallback(PFIELD_INFO pField, PVOID UserContext);
  52. ULONG BOOLCallback(PFIELD_INFO pField, PVOID UserContext);
  53. ULONG BYTECallback(PFIELD_INFO pField, PVOID UserContext);
  54. ULONG CHARCallback(PFIELD_INFO pField, PVOID UserContext);
  55. ULONG DecimalCHARCallback(PFIELD_INFO pField, PVOID UserContext);
  56. ULONG DecimalUCHARCallback(PFIELD_INFO pField, PVOID UserContext);
  57. ULONG DWORDCallback(PFIELD_INFO pField, PVOID UserContext);
  58. ULONG LONGCallback(PFIELD_INFO pField, PVOID UserContext);
  59. ULONG WORDCallback(PFIELD_INFO pField, PVOID UserContext);
  60. ULONG SHORTCallback(PFIELD_INFO pField, PVOID UserContext);
  61. ULONG ULONGCallback(PFIELD_INFO pField, PVOID UserContext);
  62. ULONG USHORTCallback(PFIELD_INFO pField, PVOID UserContext);
  63. ULONG EnumCallback(PFIELD_INFO pField, ENUMDEF *pEnumDef);
  64. ULONG FlagCallback(PFIELD_INFO pField, FLAGDEF *pFlagDef);
  65. ULONG POINTLCallback(PFIELD_INFO pField, PVOID UserContext);
  66. ULONG RECTLCallback(PFIELD_INFO pField, PVOID UserContext);
  67. ULONG SIZECallback(PFIELD_INFO pField, PVOID UserContext);
  68. ULONG SIZELCallback(PFIELD_INFO pField, PVOID UserContext);
  69. ULONG DEVMODECallback(PFIELD_INFO pField, PVOID UserContext);
  70. ULONG SizeDEVMODEListCallback(PFIELD_INFO pField, PVOID UserContext);
  71. ULONG DEVMODEListCallback(PFIELD_INFO pField, PVOID UserContext);
  72. ULONG64 PrintAString(ULONG64 StringAddr);
  73. ULONG64 PrintWString(ULONG64 StringAddr);
  74. // String printing callbacks to be used when
  75. // DBG_DUMP_FIELD_xxx_STRING flags can't be.
  76. ULONG ACharArrayCallback(PFIELD_INFO pField, PVOID UserContext);
  77. ULONG WCharArrayCallback(PFIELD_INFO pField, PVOID UserContext);
  78. ULONG AStringCallback(PFIELD_INFO pField, PVOID UserContext);
  79. ULONG WStringCallback(PFIELD_INFO pField, PVOID UserContext);
  80. ULONG AMultiStringCallback(PFIELD_INFO pField, PVOID UserContext);
  81. ULONG WMultiStringCallback(PFIELD_INFO pField, PVOID UserContext);
  82. #endif _CALLBACK_HXX_