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.

314 lines
8.1 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. ExtractUrlInfoA(
  88. IN PCSTR FileName,
  89. OUT PCSTR *Target,
  90. OUT PCSTR *IconPath,
  91. OUT PINT IconNumber
  92. );
  93. BOOL
  94. ExtractUrlInfoW(
  95. IN PCWSTR FileName,
  96. OUT PCWSTR *Target,
  97. OUT PCWSTR *IconPath,
  98. OUT PINT IconNumber
  99. );
  100. BOOL
  101. ExtractShellLinkInfoA (
  102. IN PCSTR FileName,
  103. OUT PCSTR *Target,
  104. OUT PCSTR *Params,
  105. OUT PCSTR *WorkDir,
  106. OUT PCSTR *IconPath,
  107. OUT PINT IconNumber,
  108. OUT PWORD HotKey,
  109. IN IShellLinkA *ShellLink,
  110. IN IPersistFile *PersistFile
  111. );
  112. BOOL
  113. ExtractShellLinkInfoW (
  114. IN PCWSTR FileName,
  115. OUT PCWSTR *Target,
  116. OUT PCWSTR *Params,
  117. OUT PCWSTR *WorkDir,
  118. OUT PCWSTR *IconPath,
  119. OUT PINT IconNumber,
  120. OUT PWORD HotKey,
  121. IN IShellLinkW *ShellLink,
  122. IN IPersistFile *PersistFile
  123. );
  124. BOOL
  125. ExtractShortcutInfoA (
  126. IN PCSTR FileName,
  127. OUT PCSTR *Target,
  128. OUT PCSTR *Params,
  129. OUT PCSTR *WorkDir,
  130. OUT PCSTR *IconPath,
  131. OUT PINT IconNumber,
  132. OUT PWORD HotKey,
  133. OUT BOOL *DosApp,
  134. OUT BOOL *MsDosMode,
  135. OUT PLNK_EXTRA_DATAA ExtraData, OPTIONAL
  136. IN IShellLinkA *ShellLink,
  137. IN IPersistFile *PersistFile
  138. );
  139. BOOL
  140. ExtractShortcutInfoW (
  141. IN PCWSTR FileName,
  142. OUT PCWSTR *Target,
  143. OUT PCWSTR *Params,
  144. OUT PCWSTR *WorkDir,
  145. OUT PCWSTR *IconPath,
  146. OUT PINT IconNumber,
  147. OUT PWORD HotKey,
  148. OUT BOOL *DosApp,
  149. OUT BOOL *MsDosMode,
  150. OUT PLNK_EXTRA_DATAW ExtraData, OPTIONAL
  151. IN IShellLinkW *ShellLink,
  152. IN IPersistFile *PersistFile
  153. );
  154. BOOL
  155. ModifyShellLinkFileA (
  156. IN PCSTR FileName,
  157. IN PCSTR Target, OPTIONAL
  158. IN PCSTR Params, OPTIONAL
  159. IN PCSTR WorkDir, OPTIONAL
  160. IN PCSTR IconPath, OPTIONAL
  161. IN INT IconNumber,
  162. IN WORD HotKey,
  163. IN PLNK_EXTRA_DATAA ExtraData, OPTIONAL
  164. IN IShellLinkA *ShellLink,
  165. IN IPersistFile *PersistFile
  166. );
  167. BOOL
  168. ModifyShellLinkFileW (
  169. IN PCWSTR FileName,
  170. IN PCWSTR Target, OPTIONAL
  171. IN PCWSTR Params, OPTIONAL
  172. IN PCWSTR WorkDir, OPTIONAL
  173. IN PCWSTR IconPath, OPTIONAL
  174. IN INT IconNumber,
  175. IN WORD HotKey,
  176. IN PLNK_EXTRA_DATAW ExtraData, OPTIONAL
  177. IN IShellLinkW *ShellLink,
  178. IN IPersistFile *PersistFile
  179. );
  180. BOOL
  181. ModifyPifFileA (
  182. IN PCSTR FileName,
  183. IN PCSTR Target, OPTIONAL
  184. IN PCSTR Params, OPTIONAL
  185. IN PCSTR WorkDir, OPTIONAL
  186. IN PCSTR IconPath, OPTIONAL
  187. IN INT IconNumber
  188. );
  189. BOOL
  190. ModifyPifFileW (
  191. IN PCWSTR FileName,
  192. IN PCWSTR Target, OPTIONAL
  193. IN PCWSTR Params, OPTIONAL
  194. IN PCWSTR WorkDir, OPTIONAL
  195. IN PCWSTR IconPath, OPTIONAL
  196. IN INT IconNumber
  197. );
  198. BOOL
  199. ModifyUrlFileA (
  200. IN PCSTR FileName,
  201. IN PCSTR Target, OPTIONAL
  202. IN PCSTR IconPath, OPTIONAL
  203. IN INT IconNumber
  204. );
  205. BOOL
  206. ModifyUrlFileW (
  207. IN PCWSTR FileName,
  208. IN PCWSTR Target, OPTIONAL
  209. IN PCWSTR IconPath, OPTIONAL
  210. IN INT IconNumber
  211. );
  212. BOOL
  213. ModifyShortcutFileExA (
  214. IN PCSTR FileName,
  215. IN PCSTR ForcedExtension, OPTIONAL
  216. IN PCSTR Target, OPTIONAL
  217. IN PCSTR Params, OPTIONAL
  218. IN PCSTR WorkDir, OPTIONAL
  219. IN PCSTR IconPath, OPTIONAL
  220. IN INT IconNumber,
  221. IN WORD HotKey,
  222. IN PLNK_EXTRA_DATAA ExtraData, OPTIONAL
  223. IN IShellLinkA *ShellLink,
  224. IN IPersistFile *PersistFile
  225. );
  226. #define ModifyShortcutFileA(n,t,p,w,i,in,hk,ed,sl,pf) ModifyShortcutFileExA(n,NULL,t,p,w,i,in,hk,ed,sl,pf)
  227. BOOL
  228. ModifyShortcutFileExW (
  229. IN PCWSTR FileName,
  230. IN PCWSTR ForcedExtension, OPTIONAL
  231. IN PCWSTR Target, OPTIONAL
  232. IN PCWSTR Params, OPTIONAL
  233. IN PCWSTR WorkDir, OPTIONAL
  234. IN PCWSTR IconPath, OPTIONAL
  235. IN INT IconNumber,
  236. IN WORD HotKey,
  237. IN PLNK_EXTRA_DATAW ExtraData, OPTIONAL
  238. IN IShellLinkW *ShellLink,
  239. IN IPersistFile *PersistFile
  240. );
  241. #define ModifyShortcutFileW(n,t,p,w,i,in,hk,ed,sl,pf) ModifyShortcutFileExW(n,NULL,t,p,w,i,in,hk,ed,sl,pf)
  242. //
  243. // Macros
  244. //
  245. #ifdef UNICODE
  246. #define InitCOMLink InitCOMLinkW
  247. #define FreeCOMLink FreeCOMLinkW
  248. #define ExtractPifInfo ExtractPifInfoW
  249. #define ExtractUrlInfo ExtractUrlInfoW
  250. #define ExtractShellLinkInfo ExtractShellLinkInfoW
  251. #define ExtractShortcutInfo ExtractShortcutInfoW
  252. #define LNK_EXTRA_DATA LNK_EXTRA_DATAW
  253. #define PLNK_EXTRA_DATA PLNK_EXTRA_DATAW
  254. #define ModifyShellLinkFile ModifyShellLinkFileW
  255. #define ModifyPifFile ModifyPifFileW
  256. #define ModifyUrlFile ModifyUrlFileW
  257. #define ModifyShortcutFileEx ModifyShortcutFileExW
  258. #define ModifyShortcutFile ModifyShortcutFileW
  259. #else
  260. #define InitCOMLink InitCOMLinkA
  261. #define FreeCOMLink FreeCOMLinkA
  262. #define ExtractPifInfo ExtractPifInfoA
  263. #define ExtractUrlInfo ExtractUrlInfoA
  264. #define ExtractShellLinkInfo ExtractShellLinkInfoA
  265. #define ExtractShortcutInfo ExtractShortcutInfoA
  266. #define LNK_EXTRA_DATA LNK_EXTRA_DATAA
  267. #define PLNK_EXTRA_DATA PLNK_EXTRA_DATAA
  268. #define ModifyShellLinkFile ModifyShellLinkFileA
  269. #define ModifyPifFile ModifyPifFileA
  270. #define ModifyUrlFile ModifyUrlFileA
  271. #define ModifyShortcutFileEx ModifyShortcutFileExA
  272. #define ModifyShortcutFile ModifyShortcutFileA
  273. #endif