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.

365 lines
13 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // File: iodll.h
  4. //
  5. // Contents: Declarations for the I/O API Layer DLL
  6. //
  7. // Classes: none
  8. //
  9. // History: 27-May-93 alessanm created
  10. //
  11. //----------------------------------------------------------------------------
  12. #ifndef _IODLL_H_
  13. #define _IODLL_H_
  14. //////////////////////////////////////////////////////////////////////////////
  15. // Type declaration, common to all the module in the Reader/Writer
  16. //////////////////////////////////////////////////////////////////////////////
  17. #define DllExport
  18. typedef unsigned char * LPUCHAR;
  19. typedef void * LPVOID;
  20. #define LAST_WRN 100 // last valid value for warning
  21. typedef enum Errors
  22. {
  23. ERROR_NO_ERROR = 0,
  24. // Warning have values smaller than LAST_WRN
  25. ERROR_RW_NO_RESOURCES = 1,
  26. ERROR_RW_VXD_MSGPAGE = 2,
  27. ERROR_IO_CHECKSUM_MISMATCH = 3,
  28. ERROR_FILE_CUSTOMRES = 4,
  29. ERROR_FILE_VERSTAMPONLY = 5,
  30. ERROR_RET_RESIZED = 6,
  31. ERROR_RET_ID_NOTFOUND = 7,
  32. ERROR_RET_CNTX_CHANGED = 8,
  33. ERROR_RET_INVALID_TOKEN = 9,
  34. ERROR_RET_TOKEN_REMOVED = 10,
  35. ERROR_RET_TOKEN_MISMATCH = 11,
  36. // Errors will have positive values
  37. ERROR_HANDLE_INVALID = LAST_WRN + 1,
  38. ERROR_READING_INI = LAST_WRN + 2,
  39. ERROR_NEW_FAILED = LAST_WRN + 3,
  40. ERROR_OUT_OF_DISKSPACE = LAST_WRN + 4,
  41. ERROR_FILE_OPEN = LAST_WRN + 5,
  42. ERROR_FILE_CREATE = LAST_WRN + 6,
  43. ERROR_FILE_INVALID_OFFSET = LAST_WRN + 7,
  44. ERROR_FILE_READ = LAST_WRN + 8,
  45. ERROR_FILE_WRITE = LAST_WRN + 9,
  46. ERROR_DLL_LOAD = LAST_WRN + 10,
  47. ERROR_DLL_PROC_ADDRESS = LAST_WRN + 11,
  48. ERROR_RW_LOADIMAGE = LAST_WRN + 12,
  49. ERROR_RW_PARSEIMAGE = LAST_WRN + 13,
  50. ERROR_RW_GETIMAGE = LAST_WRN + 14,
  51. ERROR_RW_NOTREADY = LAST_WRN + 15,
  52. ERROR_RW_BUFFER_TOO_SMALL = LAST_WRN + 16,
  53. ERROR_RW_INVALID_FILE = LAST_WRN + 17,
  54. ERROR_RW_IMAGE_TOO_BIG = LAST_WRN + 18,
  55. ERROR_RW_TOO_MANY_LEVELS = LAST_WRN + 19,
  56. ERROR_IO_INVALIDITEM = LAST_WRN + 20,
  57. ERROR_IO_INVALIDID = LAST_WRN + 21,
  58. ERROR_IO_INVALID_DLL = LAST_WRN + 22,
  59. ERROR_IO_TYPE_NOT_SUPPORTED = LAST_WRN + 23,
  60. ERROR_IO_INVALIDMODULE = LAST_WRN + 24,
  61. ERROR_IO_RESINFO_NULL = LAST_WRN + 25,
  62. ERROR_IO_UPDATEIMAGE = LAST_WRN + 26,
  63. ERROR_IO_FILE_NOT_SUPPORTED = LAST_WRN + 27,
  64. ERROR_FILE_SYMPATH_NOT_FOUND = LAST_WRN + 28,
  65. ERROR_FILE_MULTILANG = LAST_WRN + 29,
  66. ERROR_IO_SYMBOLFILE_NOT_FOUND = LAST_WRN + 30,
  67. ERROR_RES_NOT_FOUND = LAST_WRN + 31
  68. };
  69. #define LAST_ERROR 200 // last valid value for IODLL error. System error get passed as LAST_ERROR+syserr
  70. #define IODLL_LAST_ERROR LAST_ERROR // last valid value for IODLL error. System error get passed as LAST_ERROR+syserr
  71. typedef enum ResourceType
  72. {
  73. RS_ALL = 0,
  74. RS_CURSORS = 1,
  75. RS_BITMAPS = 2 ,
  76. RS_ICONS = 3,
  77. RS_MENUS = 4,
  78. RS_DIALOGS = 5,
  79. RS_STRINGS = 6,
  80. RS_FONTDIRS= 7,
  81. RS_FONTS = 8,
  82. RS_ACCELERATORS = 9,
  83. RS_RCDATA = 10,
  84. RS_ERRTABLES = 11,
  85. RS_GROUP_CURSORS = 12,
  86. RS_GROUP_ICONS = 14,
  87. RS_NAMETABLES = 15,
  88. RS_VERSIONS = 16,
  89. RS_CUSTOMS = 100
  90. } RESTYPES;
  91. typedef struct _ResItem
  92. {
  93. DWORD dwSize; // Size of the buffer to hold the structure
  94. WORD wX; // POSITION
  95. WORD wY;
  96. WORD wcX; // SIZE
  97. WORD wcY;
  98. DWORD dwCheckSum; // Checksum for bitmap
  99. DWORD dwStyle; // Styles
  100. DWORD dwExtStyle; // Extended style
  101. DWORD dwFlags; // Menu flags
  102. DWORD dwItemID; // Item Identifier
  103. DWORD dwResID; // Resource identifier (if ordinal)
  104. DWORD dwTypeID; // Type identifier (if Ordinal)
  105. DWORD dwLanguage; // Language identifier
  106. DWORD dwCodePage; // Code page
  107. WORD wClassName; // Class name (if ordinal)
  108. WORD wPointSize; // Point Size
  109. WORD wWeight; // Weight
  110. BYTE bItalic; // Italic
  111. BYTE bCharSet; // Charset
  112. LPSTR lpszClassName; // Class name (if string)
  113. LPSTR lpszFaceName; // Face Name
  114. LPSTR lpszCaption; // Caption
  115. LPSTR lpszResID; // Resource identifier (if string)
  116. LPSTR lpszTypeID; // Type identifier (if string)
  117. } RESITEM, * PRESITEM, FAR * LPRESITEM;
  118. typedef struct _Settings
  119. {
  120. UINT cp;
  121. BOOL bAppend; // Append resource to win32 files
  122. BOOL bUpdOtherResLang; //update language info of res. not specified.
  123. char szDefChar[2];
  124. } SETTINGS, * LPSETTINGS;
  125. //--------------------------------------------------------------------------------------------
  126. //********************************************************************************************
  127. // Module Opening/Closing API
  128. //--------------------------------------------------------------------------------------------
  129. extern "C"
  130. DllExport
  131. HANDLE
  132. APIENTRY
  133. RSOpenModule(
  134. LPCSTR lpszSrcfilename, // File name of the executable to use as source file
  135. LPCSTR lpszfiletype ); // Type of the executable file if known
  136. extern "C"
  137. DllExport
  138. HANDLE
  139. APIENTRY
  140. RSOpenModuleEx(
  141. LPCSTR lpszSrcfilename, // File name of the executable to use as source file
  142. LPCSTR lpszfiletype, // Type of the executable file if known
  143. LPCSTR lpszRDFfile, // Resource Description File (RDF)
  144. DWORD dwFlags ); // Flags to be passed to the RW to specify particular behaviour
  145. // LOWORD is for iodll while HIWORD if for RW
  146. extern "C"
  147. DllExport
  148. UINT
  149. APIENTRY
  150. RSCloseModule(
  151. HANDLE hResFileModule ); // Handle to the session opened before
  152. extern "C"
  153. DllExport
  154. HANDLE
  155. APIENTRY
  156. RSHandleFromName(
  157. LPCSTR lpszfilename ); // Handle to the session with the file name specified
  158. //--------------------------------------------------------------------------------------------
  159. //********************************************************************************************
  160. // Enumeration API
  161. //--------------------------------------------------------------------------------------------
  162. extern "C"
  163. DllExport
  164. LPCSTR
  165. APIENTRY
  166. RSEnumResType(
  167. HANDLE hResFileModule, // Handle to the file session
  168. LPCSTR lpszPrevResType); // Previously enumerated type
  169. extern "C"
  170. DllExport
  171. LPCSTR
  172. APIENTRY
  173. RSEnumResId(
  174. HANDLE hResFileModule, // Handle to the file session
  175. LPCSTR lpszResType, // Previously enumerated type
  176. LPCSTR lpszPrevResId); // Previously enumerated id
  177. extern "C"
  178. DllExport
  179. DWORD
  180. APIENTRY
  181. RSEnumResLang(
  182. HANDLE hResFileModule, // Handle to the file session
  183. LPCSTR lpszResType, // Previously enumerated type
  184. LPCSTR lpszResId, // Previously enumerated id
  185. DWORD dwPrevResLang); // Previously enumerated language
  186. extern "C"
  187. DllExport
  188. DWORD
  189. APIENTRY
  190. RSEnumResItemId(
  191. HANDLE hResFileModule, // Handle to the file session
  192. LPCSTR lpszResType, // Previously enumerated type
  193. LPCSTR lpszResId, // Previously enumerated id
  194. DWORD dwResLang, // Previously enumerated language
  195. DWORD dwPrevResItemId); // Previously enumerated item id
  196. //--------------------------------------------------------------------------------------------
  197. //********************************************************************************************
  198. // Data acquisition API
  199. //--------------------------------------------------------------------------------------------
  200. extern "C"
  201. DllExport
  202. UINT
  203. APIENTRY
  204. RSGetResItemData(
  205. HANDLE hResFileModule, // Handle to the file session
  206. LPCSTR lpszResType, // Previously enumerated type
  207. LPCSTR lpszResId, // Previously enumerated id
  208. DWORD dwResLang, // Previously enumerated language
  209. DWORD dwResItemId, // Previously enumerated item id
  210. LPVOID lpbuffer, // Pointer to the buffer that will get the resource info
  211. UINT uiBufSize); // Size of the buffer that will hold the resource info
  212. extern "C"
  213. DllExport
  214. DWORD
  215. APIENTRY
  216. RSGetResImage(
  217. HANDLE hResFileModule, // Handle to the file session
  218. LPCSTR lpszResType, // Previously enumerated type
  219. LPCSTR lpszResId, // Previously enumerated id
  220. DWORD dwResLang, // Previously enumerated language
  221. LPVOID lpbuffer, // Pointer to the buffer to get the resource Data
  222. DWORD dwBufSize); // Size of the allocated buffer
  223. //--------------------------------------------------------------------------------------------
  224. //********************************************************************************************
  225. // Update API
  226. //--------------------------------------------------------------------------------------------
  227. extern "C"
  228. DllExport
  229. UINT
  230. APIENTRY
  231. RSUpdateResItemData(
  232. HANDLE hResFileModule, // Handle to the file session
  233. LPCSTR lpszResType, // Previously enumerated type
  234. LPCSTR lpszResId, // Previously enumerated id
  235. DWORD dwResLang, // Previously enumerated language
  236. DWORD dwResItemId, // Previously enumerated items id
  237. LPVOID lpbuffer, // Pointer to the buffer to the resource item Data
  238. UINT uiBufSize); // Size of the buffer
  239. extern "C"
  240. DllExport
  241. DWORD
  242. APIENTRY
  243. RSUpdateResImage(
  244. HANDLE hResFileModule, // Handle to the file session
  245. LPCSTR lpszResType, // Previously enumerated type
  246. LPCSTR lpszResId, // Previously enumerated id
  247. DWORD dwResLang, // Previously enumerated language
  248. DWORD dwUpdLang, // Desired output language
  249. LPVOID lpbuffer, // Pointer to the buffer to the resource item Data
  250. DWORD dwBufSize); // Size of the buffer
  251. //--------------------------------------------------------------------------------------------
  252. //********************************************************************************************
  253. // Conversion API
  254. //--------------------------------------------------------------------------------------------
  255. extern "C"
  256. DllExport
  257. UINT
  258. APIENTRY
  259. RSUpdateFromResFile(
  260. HANDLE hResFileModule, // Handle to the file session
  261. LPSTR lpszResFilename); // The resource filename to be converted
  262. //--------------------------------------------------------------------------------------------
  263. //********************************************************************************************
  264. // Writing API
  265. //--------------------------------------------------------------------------------------------
  266. extern "C"
  267. DllExport
  268. UINT
  269. APIENTRY
  270. RSWriteResFile(
  271. HANDLE hResFileModule, // Handle to the file session
  272. LPCSTR lpszTgtfilename, // The new filename to be generated
  273. LPCSTR lpszTgtfileType, // Target Resource type 16/32
  274. LPCSTR lpszSymbolPath); // Symbol path for updating symbol checksum
  275. extern "C"
  276. DllExport
  277. HANDLE
  278. APIENTRY
  279. RSCopyModule(
  280. HANDLE hSrcfilemodule, // Handle to the source file
  281. LPCSTR lpszModuleName, // Name of the new module filename
  282. LPCSTR lpszfiletype ); // Type of the target module
  283. //--------------------------------------------------------------------------------------------
  284. //********************************************************************************************
  285. // Recognition API
  286. //--------------------------------------------------------------------------------------------
  287. extern "C"
  288. DllExport
  289. UINT
  290. APIENTRY
  291. RSFileType(
  292. LPCSTR lpszfilename, // File name of the executable to use as source file
  293. LPSTR lpszfiletype ); // Type of the executable file if known
  294. extern "C"
  295. DllExport
  296. UINT
  297. APIENTRY
  298. RSLanguages(
  299. HANDLE hfilemodule, // Handle to the file
  300. LPSTR lpszLanguages ); // will be filled with a string of all the languages in the file
  301. //--------------------------------------------------------------------------------------------
  302. //********************************************************************************************
  303. // Global Settings API
  304. //--------------------------------------------------------------------------------------------
  305. extern "C"
  306. DllExport
  307. UINT
  308. APIENTRY
  309. RSSetGlobals(
  310. SETTINGS settings); // Set the global variable, like CP to use.
  311. extern "C"
  312. DllExport
  313. UINT
  314. APIENTRY
  315. RSGetGlobals(
  316. LPSETTINGS lpSettings); // Retrieve the global variable
  317. #endif // _IODLL_H_