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.

124 lines
4.2 KiB

  1. /////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1998 Active Voice Corporation. All Rights Reserved.
  4. //
  5. // Active Agent(r) and Unified Communications(tm) are trademarks of Active Voice Corporation.
  6. //
  7. // Other brand and product names used herein are trademarks of their respective owners.
  8. //
  9. // The entire program and user interface including the structure, sequence, selection,
  10. // and arrangement of the dialog, the exclusively "yes" and "no" choices represented
  11. // by "1" and "2," and each dialog message are protected by copyrights registered in
  12. // the United States and by international treaties.
  13. //
  14. // Protected by one or more of the following United States patents: 5,070,526, 5,488,650,
  15. // 5,434,906, 5,581,604, 5,533,102, 5,568,540, 5,625,676, 5,651,054.
  16. //
  17. // Active Voice Corporation
  18. // Seattle, Washington
  19. // USA
  20. //
  21. /////////////////////////////////////////////////////////////////////////////////////////
  22. ////
  23. // garb.h - interface for garbage bag functions in garb.c
  24. ////
  25. #ifndef __GARB_H__
  26. #define __GARB_H__
  27. #include "winlocal.h"
  28. #define GARB_VERSION 0x00000100
  29. // garbage bag handle
  30. //
  31. DECLARE_HANDLE32(HGARB);
  32. // flags which identify characteristics of a garbage bag element
  33. //
  34. #define GARBELEM_TEMPFILENAME 0x00000001
  35. #define GARBELEM_STRDUP 0x00000002
  36. #define GARBELEM_GLOBALPTR 0x00000004
  37. #define GARBELEM_LOCALPTR 0x00000008
  38. #define GARBELEM_CURSOR 0x00000010
  39. #define GARBELEM_ICON 0x00000020
  40. #define GARBELEM_MENU 0x00000040
  41. #define GARBELEM_WINDOW 0x00000080
  42. #define GARBELEM_ATOM 0x00000100
  43. #define GARBELEM_DC 0x00000200
  44. #define GARBELEM_METAFILE 0x00000400
  45. #define GARBELEM_PEN 0x00001000
  46. #define GARBELEM_BRUSH 0x00002000
  47. #define GARBELEM_FONT 0x00004000
  48. #define GARBELEM_BITMAP 0x00008000
  49. #define GARBELEM_RGN 0x00010000
  50. #define GARBELEM_PALETTE 0x00020000
  51. #define GARBELEM_HFIL 0x00040000
  52. #define GARBELEM_HFILE 0x00080000
  53. #ifdef _WIN32
  54. #define GARBELEM_HEAPPTR 0x00100000
  55. #endif
  56. #ifdef __cplusplus
  57. extern "C" {
  58. #endif
  59. // GarbInit - initialize garbage bag
  60. // <dwVersion> (i) must be GARB_VERSION
  61. // <hInst> (i) instance handle of calling module
  62. // return handle (NULL if error)
  63. //
  64. HGARB DLLEXPORT WINAPI GarbInit(DWORD dwVersion, HINSTANCE hInst);
  65. // GarbTerm - dispose of each element in garbage bag, then destroy it
  66. // <hGarb> (i) handle returned from GarbInit
  67. // return 0 if success
  68. //
  69. // NOTE: elements are disposed of in the order they were placed
  70. // in the garbage bag; therefore, for instance, if a temporary
  71. // file is to be first closed and then deleted, call GarbAddElement()
  72. // first with the file handle (GARBELEM_HFILE) and then with the
  73. // file name (GARBELEM_TEMPFILENAME).
  74. //
  75. int DLLEXPORT WINAPI GarbTerm(HGARB hGarb);
  76. // GarbAddElement - add an element to the garbage bag
  77. // <hGarb> (i) handle returned from GarbInit
  78. // <elem> (i) garbage elem
  79. // <dwFlags> (i) element flags (determines disposal method)
  80. // GARBELEM_TEMPFILENAME FileRemove(elem)
  81. // GARBELEM_STRDUP StrDupFree(elem)
  82. // GARBELEM_GLOBALPTR GlobalFreePtr(elem)
  83. // GARBELEM_LOCALPTR LocalFreePtr(elem)
  84. #ifdef _WIN32
  85. // GARBELEM_HEAPPTR HeapFreePtr(GetProcessHeap(), 0, elem)
  86. #endif
  87. // GARBELEM_CURSOR DestroyCursor(elem)
  88. // GARBELEM_ICON DestroyIcon(elem)
  89. // GARBELEM_MENU DestroyMenu(elem)
  90. // GARBELEM_WINDOW DestroyWindow(elem)
  91. // GARBELEM_DC DeleteDC(elem)
  92. // GARBELEM_METAFILE DeleteMetafile(elem)
  93. // GARBELEM_PEN DeleteObject(elem)
  94. // GARBELEM_BRUSH DeleteObject(elem)
  95. // GARBELEM_FONT DeleteObject(elem)
  96. // GARBELEM_BITMAP DeleteObject(elem)
  97. // GARBELEM_RGN DeleteObject(elem)
  98. // GARBELEM_PALETTE DeleteObject(elem)
  99. // GARBELEM_HFIL FileClose(elem)
  100. // GARBELEM_HFILE _lclose(elem)
  101. // return 0 if success
  102. //
  103. // NOTE: it is possible to combine flags, such as
  104. // (GARBELEM_TEMPFILENAME | GARBELEM_STRDUP)
  105. // In this case the FileRemove() will be called before StrDupFree()
  106. // Most flag combinations, however, make no sense.
  107. //
  108. int DLLEXPORT WINAPI GarbAddElement(HGARB hGarb, LPVOID elem, DWORD dwFlags);
  109. #ifdef __cplusplus
  110. }
  111. #endif
  112. #endif // __GARB_H__