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.

278 lines
7.0 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. linkpif.h
  5. Abstract:
  6. Implements routines to manage .LNK and .PIF files. This
  7. is a complete redesign from the work that MikeCo did.
  8. Author:
  9. Calin Negreanu (calinn) 23-Sep-1998
  10. Revision History:
  11. <alias> <date> <comments>
  12. --*/
  13. #pragma once
  14. //
  15. // Types
  16. //
  17. typedef struct _LNK_EXTRA_DATAA {
  18. BOOL FullScreen;
  19. DWORD xSize;
  20. DWORD ySize;
  21. BOOL QuickEdit;
  22. CHAR FontName [LF_FACESIZE];
  23. DWORD xFontSize;
  24. DWORD yFontSize;
  25. DWORD FontWeight;
  26. DWORD FontFamily;
  27. WORD CurrentCodePage;
  28. } LNK_EXTRA_DATAA, *PLNK_EXTRA_DATAA;
  29. typedef struct _LNK_EXTRA_DATAW {
  30. BOOL FullScreen;
  31. DWORD xSize;
  32. DWORD ySize;
  33. BOOL QuickEdit;
  34. WCHAR FontName [LF_FACESIZE];
  35. DWORD xFontSize;
  36. DWORD yFontSize;
  37. DWORD FontWeight;
  38. DWORD FontFamily;
  39. WORD CurrentCodePage;
  40. } LNK_EXTRA_DATAW, *PLNK_EXTRA_DATAW;
  41. //
  42. // APIs
  43. //
  44. BOOL
  45. InitCOMLinkA (
  46. OUT IShellLinkA **ShellLink,
  47. OUT IPersistFile **PersistFile
  48. );
  49. BOOL
  50. InitCOMLinkW (
  51. OUT IShellLinkW **ShellLink,
  52. OUT IPersistFile **PersistFile
  53. );
  54. BOOL
  55. FreeCOMLinkA (
  56. IN OUT IShellLinkA **ShellLink,
  57. IN OUT IPersistFile **PersistFile
  58. );
  59. BOOL
  60. FreeCOMLinkW (
  61. IN OUT IShellLinkW **ShellLink,
  62. IN OUT IPersistFile **PersistFile
  63. );
  64. BOOL
  65. ExtractPifInfoA(
  66. IN PCSTR FileName,
  67. OUT PCSTR *Target,
  68. OUT PCSTR *Params,
  69. OUT PCSTR *WorkDir,
  70. OUT PCSTR *IconPath,
  71. OUT PINT IconNumber,
  72. OUT BOOL *MsDosMode,
  73. OUT PLNK_EXTRA_DATAA ExtraData OPTIONAL
  74. );
  75. BOOL
  76. ExtractPifInfoW(
  77. IN PCWSTR FileName,
  78. OUT PCWSTR *Target,
  79. OUT PCWSTR *Params,
  80. OUT PCWSTR *WorkDir,
  81. OUT PCWSTR *IconPath,
  82. OUT PINT IconNumber,
  83. OUT BOOL *MsDosMode,
  84. OUT PLNK_EXTRA_DATAW ExtraData OPTIONAL
  85. );
  86. BOOL
  87. ExtractShellLinkInfoA (
  88. IN PCSTR FileName,
  89. OUT PCSTR *Target,
  90. OUT PCSTR *Params,
  91. OUT PCSTR *WorkDir,
  92. OUT PCSTR *IconPath,
  93. OUT PINT IconNumber,
  94. OUT PWORD HotKey,
  95. IN IShellLinkA *ShellLink,
  96. IN IPersistFile *PersistFile
  97. );
  98. BOOL
  99. ExtractShellLinkInfoW (
  100. IN PCWSTR FileName,
  101. OUT PCWSTR *Target,
  102. OUT PCWSTR *Params,
  103. OUT PCWSTR *WorkDir,
  104. OUT PCWSTR *IconPath,
  105. OUT PINT IconNumber,
  106. OUT PWORD HotKey,
  107. IN IShellLinkW *ShellLink,
  108. IN IPersistFile *PersistFile
  109. );
  110. BOOL
  111. ExtractShortcutInfoA (
  112. IN PCSTR FileName,
  113. OUT PCSTR *Target,
  114. OUT PCSTR *Params,
  115. OUT PCSTR *WorkDir,
  116. OUT PCSTR *IconPath,
  117. OUT PINT IconNumber,
  118. OUT PWORD HotKey,
  119. OUT BOOL *DosApp,
  120. OUT BOOL *MsDosMode,
  121. OUT PLNK_EXTRA_DATAA ExtraData, OPTIONAL
  122. IN IShellLinkA *ShellLink,
  123. IN IPersistFile *PersistFile
  124. );
  125. BOOL
  126. ExtractShortcutInfoW (
  127. IN PCWSTR FileName,
  128. OUT PCWSTR *Target,
  129. OUT PCWSTR *Params,
  130. OUT PCWSTR *WorkDir,
  131. OUT PCWSTR *IconPath,
  132. OUT PINT IconNumber,
  133. OUT PWORD HotKey,
  134. OUT BOOL *DosApp,
  135. OUT BOOL *MsDosMode,
  136. OUT PLNK_EXTRA_DATAW ExtraData, OPTIONAL
  137. IN IShellLinkW *ShellLink,
  138. IN IPersistFile *PersistFile
  139. );
  140. BOOL
  141. ModifyShellLinkFileA (
  142. IN PCSTR FileName,
  143. IN PCSTR Target, OPTIONAL
  144. IN PCSTR Params, OPTIONAL
  145. IN PCSTR WorkDir, OPTIONAL
  146. IN PCSTR IconPath, OPTIONAL
  147. IN INT IconNumber,
  148. IN WORD HotKey,
  149. IN PLNK_EXTRA_DATAA ExtraData, OPTIONAL
  150. IN IShellLinkA *ShellLink,
  151. IN IPersistFile *PersistFile
  152. );
  153. BOOL
  154. ModifyShellLinkFileW (
  155. IN PCWSTR FileName,
  156. IN PCWSTR Target, OPTIONAL
  157. IN PCWSTR Params, OPTIONAL
  158. IN PCWSTR WorkDir, OPTIONAL
  159. IN PCWSTR IconPath, OPTIONAL
  160. IN INT IconNumber,
  161. IN WORD HotKey,
  162. IN PLNK_EXTRA_DATAW ExtraData, OPTIONAL
  163. IN IShellLinkW *ShellLink,
  164. IN IPersistFile *PersistFile
  165. );
  166. BOOL
  167. ModifyPifFileA (
  168. IN PCSTR FileName,
  169. IN PCSTR Target, OPTIONAL
  170. IN PCSTR Params, OPTIONAL
  171. IN PCSTR WorkDir, OPTIONAL
  172. IN PCSTR IconPath, OPTIONAL
  173. IN INT IconNumber
  174. );
  175. BOOL
  176. ModifyPifFileW (
  177. IN PCWSTR FileName,
  178. IN PCWSTR Target, OPTIONAL
  179. IN PCWSTR Params, OPTIONAL
  180. IN PCWSTR WorkDir, OPTIONAL
  181. IN PCWSTR IconPath, OPTIONAL
  182. IN INT IconNumber
  183. );
  184. BOOL
  185. ModifyShortcutFileExA (
  186. IN PCSTR FileName,
  187. IN PCSTR ForcedExtension, OPTIONAL
  188. IN PCSTR Target, OPTIONAL
  189. IN PCSTR Params, OPTIONAL
  190. IN PCSTR WorkDir, OPTIONAL
  191. IN PCSTR IconPath, OPTIONAL
  192. IN INT IconNumber,
  193. IN WORD HotKey,
  194. IN PLNK_EXTRA_DATAA ExtraData, OPTIONAL
  195. IN IShellLinkA *ShellLink,
  196. IN IPersistFile *PersistFile
  197. );
  198. #define ModifyShortcutFileA(n,t,p,w,i,in,hk,ed,sl,pf) ModifyShortcutFileExA(n,NULL,t,p,w,i,in,hk,ed,sl,pf)
  199. BOOL
  200. ModifyShortcutFileExW (
  201. IN PCWSTR FileName,
  202. IN PCWSTR ForcedExtension, OPTIONAL
  203. IN PCWSTR Target, OPTIONAL
  204. IN PCWSTR Params, OPTIONAL
  205. IN PCWSTR WorkDir, OPTIONAL
  206. IN PCWSTR IconPath, OPTIONAL
  207. IN INT IconNumber,
  208. IN WORD HotKey,
  209. IN PLNK_EXTRA_DATAW ExtraData, OPTIONAL
  210. IN IShellLinkW *ShellLink,
  211. IN IPersistFile *PersistFile
  212. );
  213. #define ModifyShortcutFileW(n,t,p,w,i,in,hk,ed,sl,pf) ModifyShortcutFileExW(n,NULL,t,p,w,i,in,hk,ed,sl,pf)
  214. //
  215. // Macros
  216. //
  217. #ifdef UNICODE
  218. #define InitCOMLink InitCOMLinkW
  219. #define FreeCOMLink FreeCOMLinkW
  220. #define ExtractPifInfo ExtractPifInfoW
  221. #define ExtractShellLinkInfo ExtractShellLinkInfoW
  222. #define ExtractShortcutInfo ExtractShortcutInfoW
  223. #define LNK_EXTRA_DATA LNK_EXTRA_DATAW
  224. #define PLNK_EXTRA_DATA PLNK_EXTRA_DATAW
  225. #define ModifyShellLinkFile ModifyShellLinkFileW
  226. #define ModifyPifFile ModifyPifFileW
  227. #define ModifyShortcutFileEx ModifyShortcutFileExW
  228. #define ModifyShortcutFile ModifyShortcutFileW
  229. #else
  230. #define InitCOMLink InitCOMLinkA
  231. #define FreeCOMLink FreeCOMLinkA
  232. #define ExtractPifInfo ExtractPifInfoA
  233. #define ExtractShellLinkInfo ExtractShellLinkInfoA
  234. #define ExtractShortcutInfo ExtractShortcutInfoA
  235. #define LNK_EXTRA_DATA LNK_EXTRA_DATAA
  236. #define PLNK_EXTRA_DATA PLNK_EXTRA_DATAA
  237. #define ModifyShellLinkFile ModifyShellLinkFileA
  238. #define ModifyPifFile ModifyPifFileA
  239. #define ModifyShortcutFileEx ModifyShortcutFileExA
  240. #define ModifyShortcutFile ModifyShortcutFileA
  241. #endif