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.

256 lines
4.9 KiB

  1. /*
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. desktop.h
  5. Abstract:
  6. This module contains the desktop database structures.
  7. Author:
  8. Jameel Hyder (microsoft!jameelh)
  9. Revision History:
  10. 25 Apr 1992 Initial Version
  11. Notes: Tab stop: 4
  12. --*/
  13. #ifndef _DESKTOP_
  14. #define _DESKTOP_
  15. #define AFP_DESKTOP_VERSION1 0x00010000
  16. #define AFP_DESKTOP_VERSION2 0x00020000
  17. #define AFP_DESKTOP_VERSION AFP_DESKTOP_VERSION2
  18. typedef struct _ApplInfo
  19. {
  20. struct _ApplInfo * appl_Next; // link to next entry for this hash
  21. DWORD appl_Creator; // Creator
  22. DWORD appl_FileNum; // File Number of the application file
  23. DWORD appl_Tag; // APPL Tag
  24. } APPLINFO, *PAPPLINFO;
  25. // NOTE: the first 4 fields of _ApplInfo2 must be exactly the same as
  26. // _ApplInfo so that version 1 desktop APPLs can be read into the version 2
  27. // structure.
  28. typedef struct _ApplInfo2
  29. {
  30. struct _ApplInfo2 * appl_Next; // link to next entry for this hash
  31. DWORD appl_Creator; // Creator
  32. DWORD appl_FileNum; // File Number of the application file
  33. DWORD appl_Tag; // APPL Tag
  34. DWORD appl_ParentID; // DirId of parent of the app file
  35. } APPLINFO2, *PAPPLINFO2;
  36. typedef struct _IconInfo
  37. {
  38. struct _IconInfo * icon_Next; // Link to Next entry for this hash
  39. DWORD icon_Creator; // Creator
  40. DWORD icon_Type; // Finder Type
  41. DWORD icon_Tag; // ICON Tag
  42. USHORT icon_IconType; // Icon type
  43. SHORT icon_Size; // Size of Icon
  44. // Icon bitmap follows the structure
  45. } ICONINFO, *PICONINFO;
  46. typedef struct _Desktop
  47. {
  48. DWORD dtp_Signature; // Signature
  49. DWORD dtp_Version; // Version number
  50. LONG dtp_cApplEnts; // Number of APPL entries
  51. PAPPLINFO dtp_pApplInfo; // Pointer to 1st APPL entry
  52. // Used only on disk
  53. LONG dtp_cIconEnts; // Number of ICON entries
  54. PICONINFO dtp_pIconInfo; // Pointer to 1st ICON entry
  55. // Used only on disk
  56. } DESKTOP, *PDESKTOP;
  57. #define DESKTOPIO_BUFSIZE 8180 // 8192 - 12
  58. #define HASH_ICON(Creator) ((Creator) % ICON_BUCKETS)
  59. #define HASH_APPL(Creator) ((Creator) % APPL_BUCKETS)
  60. GLOBAL SWMR AfpIconListLock EQU { 0 };
  61. GLOBAL PICONINFO AfpGlobalIconList EQU NULL;
  62. extern
  63. NTSTATUS
  64. AfpDesktopInit(
  65. VOID
  66. );
  67. extern
  68. AFPSTATUS
  69. AfpAddIcon(
  70. IN struct _VolDesc * pVolDesc,
  71. IN DWORD Creator,
  72. IN DWORD Type,
  73. IN DWORD Tag,
  74. IN LONG IconSize,
  75. IN DWORD IconType,
  76. IN PBYTE pIconBitmap
  77. );
  78. extern
  79. AFPSTATUS
  80. AfpLookupIcon(
  81. IN struct _VolDesc * pVolDesc,
  82. IN DWORD Creator,
  83. IN DWORD Type,
  84. IN LONG Length,
  85. IN DWORD IconType,
  86. OUT PLONG pActualLength,
  87. OUT PBYTE pIconBitMap
  88. );
  89. extern
  90. AFPSTATUS
  91. AfpLookupIconInfo(
  92. IN struct _VolDesc * pVolDesc,
  93. IN DWORD Creator,
  94. IN LONG Index,
  95. OUT PDWORD pType,
  96. OUT PDWORD pIconType,
  97. OUT PDWORD pTag,
  98. OUT PLONG pSize
  99. );
  100. extern
  101. AFPSTATUS
  102. AfpAddAppl(
  103. IN struct _VolDesc * pVolDesc,
  104. IN DWORD Creator,
  105. IN DWORD ApplTag,
  106. IN DWORD FileNum,
  107. IN BOOLEAN Internal,
  108. IN DWORD ParentID
  109. );
  110. extern
  111. AFPSTATUS
  112. AfpLookupAppl(
  113. IN struct _VolDesc * pVolDesc,
  114. IN DWORD Creator,
  115. IN LONG Index,
  116. OUT PDWORD pApplTag,
  117. OUT PDWORD pFileNum,
  118. OUT PDWORD pParentID
  119. );
  120. extern
  121. AFPSTATUS
  122. AfpRemoveAppl(
  123. IN struct _VolDesc * pVolDesc,
  124. IN DWORD Creator,
  125. IN DWORD FileNum
  126. );
  127. extern
  128. AFPSTATUS
  129. AfpAddComment(
  130. IN PSDA pSda,
  131. IN struct _VolDesc * pVolDesc,
  132. IN PANSI_STRING Comment,
  133. IN struct _PathMapEntity * PME,
  134. IN BOOLEAN Directory,
  135. IN DWORD AfpId
  136. );
  137. extern
  138. AFPSTATUS
  139. AfpGetComment(
  140. IN PSDA pSda,
  141. IN struct _VolDesc * pVolDesc,
  142. IN struct _PathMapEntity * PME,
  143. IN BOOLEAN Directory
  144. );
  145. extern
  146. AFPSTATUS
  147. AfpRemoveComment(
  148. IN PSDA pSda,
  149. IN struct _VolDesc * pVolDesc,
  150. IN struct _PathMapEntity * PME,
  151. IN BOOLEAN Directory,
  152. IN DWORD AfpId
  153. );
  154. extern
  155. AFPSTATUS
  156. AfpAddIconToGlobalList(
  157. IN DWORD Type,
  158. IN DWORD Creator,
  159. IN DWORD IconType,
  160. IN LONG IconSize,
  161. IN PBYTE pIconBitMap
  162. );
  163. extern
  164. VOID
  165. AfpFreeGlobalIconList(
  166. VOID
  167. );
  168. extern
  169. AFPSTATUS
  170. AfpInitDesktop(
  171. IN struct _VolDesc * pVolDesc,
  172. OUT BOOLEAN * pfNewVolume
  173. );
  174. extern
  175. VOID
  176. AfpUpdateDesktop(
  177. IN struct _VolDesc * pVolDesc
  178. );
  179. extern
  180. VOID
  181. AfpFreeDesktopTables(
  182. IN struct _VolDesc * pVolDesc
  183. );
  184. #ifdef DESKTOP_LOCALS
  185. #define ALLOC_ICONINFO(IconLen) (PICONINFO)AfpAllocPagedMemory((IconLen) + sizeof(ICONINFO))
  186. #define ALLOC_APPLINFO() (PAPPLINFO2)AfpAllocPagedMemory(sizeof(APPLINFO2))
  187. LOCAL AFPSTATUS
  188. afpGetGlobalIconInfo(
  189. IN DWORD Creator,
  190. OUT PDWORD pType,
  191. OUT PDWORD pIconType,
  192. OUT PDWORD pTag,
  193. OUT PLONG pSize
  194. );
  195. LOCAL AFPSTATUS
  196. afpLookupIconInGlobalList(
  197. IN DWORD Creator,
  198. IN DWORD Type,
  199. IN DWORD IconType,
  200. IN PLONG pSize,
  201. OUT PBYTE pBitMap
  202. );
  203. LOCAL NTSTATUS
  204. afpReadDesktopFromDisk(
  205. IN struct _VolDesc * pVolDesc,
  206. IN struct _FileSysHandle * pfshDesktop
  207. );
  208. #endif // DESKTOP_LOCALS
  209. #endif // _DESKTOP_
  210.