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.

580 lines
21 KiB

  1. /*****************************************************************************
  2. * *
  3. * WRAPSTOR.H *
  4. * *
  5. * Copyright (C) Microsoft Corporation 1990 - 1994. *
  6. * All Rights reserved. *
  7. * *
  8. ******************************************************************************
  9. * *
  10. * Module intent *
  11. * *
  12. * *
  13. * *
  14. ******************************************************************************
  15. * *
  16. * Current Owner: BINHN *
  17. * *
  18. *****************************************************************************/
  19. #ifndef __WRAPSTOR_H__
  20. #define __WRAPSTOR_H__
  21. #ifdef __cplusplus
  22. #include <itsort.h>
  23. #endif
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. #pragma pack(1) // avoid problems when Zp!=1
  28. // requires windows.h, mvopsys.h, misc.h, orkin.h
  29. #include <fileoff.h>
  30. //typedef USHORT RC; // for those not coming via HELP.H
  31. typedef VOID FAR * QV; // this is also in misc.h
  32. // Lone function from iofts.c that wasn't prototyped anywhere
  33. LPCSTR NEAR PASCAL GetSubFilename(LPCSTR lszFilename, BYTE* lszTemp);
  34. /*****************************************************************************
  35. *
  36. * File Moniker
  37. *
  38. *****************************************************************************/
  39. #define fmNil ((FM)0)
  40. #define qafmNil ((QAFM)0)
  41. /*
  42. When creating an FM (in other WORDs, specifying the location of a new
  43. or extant file), the caller must specify the directory in which that file
  44. is located. There are a finite number of directories available to Help.
  45. These are:
  46. */
  47. #define dirNil 0x0000 // No directory specified
  48. #define dirCurrent 0x0001 // Whatever the OS thinks the current dir. is
  49. #define dirTemp 0x0002 // The directory temporary files are created in
  50. #define dirHelp 0x0004 // Wherever the Help Application lives
  51. #define dirSystem 0x0008 // The Windows and Windows System directories
  52. #define dirPath 0x0010 // Searches the $PATH
  53. // (includes Current dir and System dirs)
  54. #define dirAll 0xFFFF // Search all directories, in the above order
  55. #define dirFirst dirCurrent // The lowest bit that can be set
  56. #define dirLast dirPath // The highest bit that can be set
  57. /*
  58. To specify which parts of a full filename you want to extract, add
  59. (logical or) the following part codes:
  60. */
  61. #define partNone 0x0000 // return nothing
  62. #define partDrive 0x0001 // D: Vol
  63. #define partDir 0x0002 // dir\dir\ :dir:dir:
  64. #define partBase 0x0004 // basename filename
  65. #define partExt 0x0008 // ext <usu. nothing>
  66. #define partAll 0xFFFF
  67. // Get from stdlib.h
  68. #if !defined(_M_MPPC) && !defined(_M_M68K)
  69. #define _MAX_PATH 260 /* max. length of full pathname */
  70. #else /* ndef defined(_M_M68K) || defined(_M_MPPC) */
  71. #define _MAX_PATH 256 /* max. length of full pathname */
  72. #endif /* defined(_M_M68K) || defined(_M_MPPC) */
  73. /*
  74. max. string lengths of file names
  75. */
  76. #define cchMaxPath _MAX_PATH // = _MAX_PATH in <stdlib.h>
  77. #ifdef __cplusplus
  78. typedef IStorage* HFS;
  79. typedef IStream* HF;
  80. #else // __cplusplus
  81. typedef PVOID HFS;
  82. typedef PVOID HF;
  83. #endif // __cplusplus
  84. /*
  85. An FM is a magic cookie which refers to some structure describing the
  86. location of a file, including the volume/drive, path, and filename.
  87. */
  88. typedef struct {
  89. char rgch[cchMaxPath]; // Fully canonicalized pathname
  90. } AFM; // RAllocation of FMS
  91. typedef AFM FAR *QAFM;
  92. typedef LPSTR FM; // An FM is now just a string, allocated through
  93. // the NewMemory()/DisposeMemory() API
  94. typedef USHORT DIR; // Help directory flag
  95. #define FValidFm(fm) ((fm)!=fmNil)
  96. /*** MATTSMI 2/5/92 -- ADDED FROM DOS VERSION OF THIS HEADER TO SUPPORT WMVC ***/
  97. #define VerifyFm(fm) // assert(fm == fmNil || FCheckGh((HANDLE) fm))
  98. // VerifyFm(fm) not needed for FM being LPSTR
  99. FM EXPORT_API FAR PASCAL FmNewSzDir (LPSTR, DIR, LPVOID);
  100. FM EXPORT_API PASCAL FAR FmNew(LPSTR, LPVOID);
  101. FM EXPORT_API FAR PASCAL FmNewExistSzDir (LPSTR, DIR, LPVOID);
  102. FM EXPORT_API FAR PASCAL FmNewExistSzIni (LPSTR, LPSTR, LPSTR, LPVOID);
  103. FM EXPORT_API FAR PASCAL FmNewTemp (LPSTR, LPVOID);
  104. FM EXPORT_API FAR PASCAL FmNewSameDirFmSz (FM, LPSTR, LPVOID);
  105. VOID EXPORT_API FAR PASCAL DisposeFm (FM);
  106. FM EXPORT_API FAR PASCAL FmCopyFm(FM, LPVOID);
  107. BOOL EXPORT_API FAR PASCAL FExistFm(FM);
  108. int EXPORT_API FAR PASCAL CbPartsFm(FM, int);
  109. LPSTR EXPORT_API FAR PASCAL SzPartsFm(FM, LPSTR, int, int);
  110. BOOL EXPORT_API FAR PASCAL FSameFmFm (FM, FM);
  111. /*****************************************************************************
  112. *
  113. * FIDs - file access (fid.c)
  114. *
  115. *****************************************************************************/
  116. #define wRead 0x0001
  117. #define wWrite 0x0002
  118. #define wReadOnly wRead
  119. #define wReadWrite (wRead | wWrite)
  120. #define wRWMask (wRead | wWrite)
  121. #define wShareRead 0x0004
  122. #define wShareWrite 0x0008
  123. #define wShareAll (wShareRead | wShareWrite)
  124. #define wShareNone 0x000
  125. #define wShareMask (wShareRead | wShareWrite)
  126. #define wShareShift 2
  127. #define wSeekSet 0 /* SEEK_SET from stdio.h */
  128. #define wSeekCur 1 /* SEEK_CUR from stdio.h */
  129. #define wSeekEnd 2 /* SEEK_END from stdio.h */
  130. #ifdef _WIN32
  131. typedef HANDLE FID;
  132. #define fidNil INVALID_HANDLE_VALUE
  133. #else
  134. typedef HFILE FID;
  135. #define fidNil HFILE_ERROR
  136. #endif
  137. FID EXPORT_API FAR PASCAL FidCreateFm(FM fm, WORD wOpenMode, WORD wPerm,
  138. LPVOID);
  139. FID EXPORT_API FAR PASCAL FidOpenFm(FM fm, WORD wOpenMode,
  140. LPVOID);
  141. BOOL EXPORT_API FAR PASCAL FidFlush(FID fid);
  142. #define FUnlinkFm(fm) ((BOOL)(RcUnlinkFm(fm)==ERR_SUCCESS))
  143. RC EXPORT_API FAR PASCAL RcUnlinkFm(FM);
  144. LONG EXPORT_API FAR PASCAL LcbReadFid(FID, LPVOID, LONG, LPVOID);
  145. #define FCloseFid(fid) ((BOOL)(RcCloseFid((int)fid) == ERR_SUCCESS))
  146. RC EXPORT_API FAR PASCAL RcCloseFid(FID);
  147. LONG EXPORT_API FAR PASCAL LcbWriteFid(FID, LPVOID, LONG, LPVOID);
  148. LONG EXPORT_API FAR PASCAL LTellFid(FID, LPVOID);
  149. LONG EXPORT_API FAR PASCAL LSeekFid(FID, LONG, WORD, LPVOID);
  150. FILEOFFSET EXPORT_API FAR PASCAL FoSeekFid(FID, FILEOFFSET, WORD, LPERRB);
  151. int EXPORT_API PASCAL FAR FEofFid(FID);
  152. #define FChSizeFid(fid, lcb) (RcChSizeFid ((fid), (lcb)) == 0)
  153. RC EXPORT_API PASCAL FAR RcChSizeFid(FID, LONG);
  154. BOOL EXPORT_API PASCAL FAR FDriveOk(LPSTR);
  155. /*****************************************************************************
  156. *
  157. * BTREE api
  158. *
  159. *****************************************************************************/
  160. #define bBtreeVersionBonehead 0 /* fixed size key, array */
  161. #define wBtreeMagic 0x293B /* magic number for btrees; a winky: ;) */
  162. #define bBtreeVersion 4 /* ver 2: back to strcmp for 'z' keys */
  163. /* ver 3: skipped
  164. /* ver 4: BTHESI header info, KT_EXTSORT */
  165. #define bkNil ((BK)-1)/* nil value for BK */
  166. #define wMaxFormat 15 /* length of format string */
  167. #define cbBtreeBlockDefault 8192 /* default btree block size */
  168. #define fFSDirty (BYTE)0x08 // file (FS) is dirty and needs writing
  169. /* key types */
  170. #define KT_SZI 'i'
  171. #define KT_SZDELMIN 'k' /* not supported */
  172. #define KT_SZMIN 'm' /* not supported */
  173. #define KT_SZDEL 'r' /* not supported */
  174. #define KT_ST 't' /* not supported */
  175. #define KT_SZ 'z'
  176. #define KT_VSTI 'V' // variable-byte prefixed Pascal string
  177. #define KT_STI 'I'
  178. #define KT_STDELMIN 'K' /* not supported */
  179. #define KT_LONG 'L'
  180. #define KT_STMIN 'M' /* not supported */
  181. #define KT_STDEL 'R' /* not supported */
  182. #define KT_SZISCAND 'S'
  183. #define KT_SZMAP 'P'
  184. #define KT_EXTSORT 'X' // keys are understood by an external sort object
  185. #define FBtreeKeyTypeIsSz(c) ((c) == KT_SZ || (c) == KT_SZMAP || (c) == KT_SZI || \
  186. (c) == KT_SZISCAND)
  187. /*
  188. Btree record formats
  189. In addition to these #defines, '1'..'9', 'a'..'f' for fixed length
  190. keys & records of 1..15 bytes are accepted.
  191. */
  192. #define FMT_VNUM_FO 'O' // Variable byte offset or length
  193. #define FMT_BYTE_PREFIX 't'
  194. #define FMT_WORD_PREFIX 'T'
  195. #define FMT_SZ 'z'
  196. #define FBtreeRecordTypeIsSz(c) ((c) == FMT_SZ)
  197. /* elevator constants */
  198. #define btelevMax ((BT_ELEV)32767)
  199. #define btelevNil ((BT_ELEV)-1)
  200. typedef LONG_PTR KEY; /* btree key */
  201. typedef BYTE KT; /* key type */
  202. typedef HANDLE HBT; /* handle to a btree */
  203. typedef HANDLE HMAPBT; /* handle to a btree map */
  204. // @DOC INTERNAL
  205. // @struct BTREE_PARAMS | Btree parameters passed in for creation
  206. typedef struct _btree_params
  207. {
  208. HFS hfs; // @field File system that btree lives in
  209. int cbBlock; // @field Number of bytes in a btree block.
  210. // Key or Data cannot exceed 1/2 this amount.
  211. // Members used in conjunction with KT_EXTSORT - btree file version 4.0.
  212. DWORD dwCodePageID; // @field ANSI code page no.
  213. LCID lcid; // @field WIN32 locale ID.
  214. DWORD dwExtSortInstID; // @field External sort instance ID
  215. DWORD dwExtSortKeyType; // @field External sort key type
  216. BYTE bFlags; // @field HFOPEN_ flags (same as used in opening an hFile).
  217. char rgchFormat[wMaxFormat+1]; // @field Key and record format string.
  218. } BTREE_PARAMS;
  219. typedef DWORD BK; // btree block index - extended to DWORD, davej 12/95
  220. // @DOC INTERNAL
  221. // @struct BTPOS | Btree position structure.
  222. typedef struct
  223. {
  224. BK bk; // @field Block number.
  225. int cKey; // @field Which key in block (0 means first).
  226. int iKey; // @field Key's index db.rgbBlock (in bytes).
  227. } BTPOS, FAR *QBTPOS;
  228. typedef int BTELEV, FAR *QBTELEV; /* elevator location: 0 .. 32767 legal */
  229. HBT EXPORT_API FAR PASCAL HbtCreateBtreeSz(LPSTR, BTREE_PARAMS FAR *,
  230. PHRESULT);
  231. RC EXPORT_API FAR PASCAL RcDestroyBtreeSz(LPSTR, HFS);
  232. HBT EXPORT_API FAR PASCAL HbtOpenBtreeSz (LPWSTR, HFS, BYTE, PHRESULT);
  233. VOID EXPORT_API FAR PASCAL GetBtreeParams(HBT, BTREE_PARAMS FAR *);
  234. RC EXPORT_API FAR PASCAL RcCloseBtreeHbt (HBT);
  235. RC EXPORT_API FAR PASCAL RcAbandonHbt (HBT);
  236. #if defined(_DEBUG)
  237. VOID EXPORT_API FAR PASCAL VerifyHbt (HBT);
  238. #else
  239. #define VerifyHbt(hbt)
  240. #endif //!def _DEBUG
  241. RC EXPORT_API FAR PASCAL RcLookupByPos (HBT, QBTPOS, KEY, int, LPVOID);
  242. RC EXPORT_API FAR PASCAL RcLookupByKeyAux(HBT, KEY, QBTPOS, LPVOID, BOOL);
  243. WORD EXPORT_API FAR PASCAL wGetNextNEntries(HBT, WORD wFlags, WORD wEntries, QBTPOS, LPVOID, LONG, LPERRB);
  244. // Flags for wGetNextNEntries
  245. #define GETNEXT_KEYS 1
  246. #define GETNEXT_RECS 2
  247. #define GETNEXT_RESET 4
  248. #define RcLookupByKey( hbt, key, qbtpos, qv) \
  249. RcLookupByKeyAux((hbt), (key), (qbtpos), (qv), FALSE)
  250. RC EXPORT_API FAR PASCAL RcFirstHbt (HBT, KEY, LPVOID, QBTPOS);
  251. RC EXPORT_API FAR PASCAL RcLastHbt (HBT, KEY, LPVOID, QBTPOS);
  252. RC EXPORT_API FAR PASCAL RcNextPos (HBT, QBTPOS, QBTPOS);
  253. RC EXPORT_API FAR PASCAL RcOffsetPos (HBT, QBTPOS, LONG, LPLONG, QBTPOS);
  254. #if defined(__DEBUG)
  255. #define FValidPos(qbtpos) \
  256. ((qbtpos) == NULL ? FALSE : (qbtpos)->bk != bkNil)
  257. #else /* !_DEBUG */
  258. #define FValidPos(qbtpos) ((qbtpos)->bk != bkNil)
  259. #endif /* !_DEBUG */
  260. // Callback passed to RcTraverseHbt
  261. typedef DWORD (FAR PASCAL *TRAVERSE_FUNC) (KEY key, BYTE FAR *rec, DWORD dwUser);
  262. #define TRAVERSE_DONE 0
  263. #define TRAVERSE_DELETE 1
  264. #define TRAVERSE_INTERRUPT 2
  265. RC EXPORT_API FAR PASCAL RcInsertHbt (HBT, KEY, LPVOID);
  266. RC EXPORT_API FAR PASCAL RcInsertMacBrsHbt(HBT, KEY, QV);
  267. RC EXPORT_API FAR PASCAL RcDeleteHbt (HBT, KEY);
  268. RC EXPORT_API FAR PASCAL RcUpdateHbt (HBT, KEY, LPVOID);
  269. RC EXPORT_API FAR PASCAL RcTraverseHbt (HBT, TRAVERSE_FUNC, DWORD);
  270. RC EXPORT_API FAR PASCAL RcPackHbt (HBT); /* >>>> unimplemented */
  271. RC EXPORT_API FAR PASCAL RcCheckHbt (HBT); /* >>>> unimplemented */
  272. RC EXPORT_API FAR PASCAL RcLeafBlockHbt (HBT, KEY, LPVOID); /* >>>> unimplemented */
  273. HBT EXPORT_API FAR PASCAL HbtInitFill (LPSTR, BTREE_PARAMS FAR *,
  274. LPVOID);
  275. RC EXPORT_API FAR PASCAL RcFillHbt (HBT, KEY, LPVOID);
  276. RC EXPORT_API FAR PASCAL RcFiniFillHbt (HBT);
  277. RC EXPORT_API FAR PASCAL RcFreeCacheHbt (HBT);
  278. RC EXPORT_API FAR PASCAL RcFlushHbt (HBT);
  279. RC EXPORT_API FAR PASCAL RcCloseOrFlushHbt(HBT, BOOL);
  280. RC EXPORT_API FAR PASCAL RcPos2Elev(HBT, QBTPOS, QBTELEV); /* >>>> unimplemented */
  281. RC FAR PASCAL RcElev2Pos(HBT, QBTELEV, QBTPOS); /* >>>> unimplemented */
  282. RC EXPORT_API FAR PASCAL RcGetBtreeInfo(HBT, LPBYTE, LPLONG, LPWORD);
  283. HF EXPORT_API PASCAL FAR HfOpenDiskBt(HFS, HBT, LPSTR, BYTE, LPVOID);
  284. /* Map utility functions */
  285. RC EXPORT_API FAR PASCAL RcCreateBTMapHfs(HFS, HBT, LPSTR);
  286. HMAPBT EXPORT_API FAR PASCAL HmapbtOpenHfs(HFS, LPWSTR, LPVOID);
  287. RC EXPORT_API FAR PASCAL RcCloseHmapbt(HMAPBT);
  288. RC EXPORT_API FAR PASCAL RcIndexFromKeyHbt(HBT, HMAPBT, LPLONG, KEY);
  289. RC EXPORT_API FAR PASCAL RcKeyFromIndexHbt(HBT, HMAPBT, KEY, int, LONG);
  290. BOOL EXPORT_API FAR PASCAL FIsPrefix(HBT, KEY, KEY);
  291. VOID EXPORT_API FAR PASCAL BtreeSetCMap(HBT, LPVOID);
  292. LPVOID EXPORT_API PASCAL FAR BtreeGetCMap(HANDLE);
  293. #ifdef __cplusplus
  294. VOID EXPORT_API FAR PASCAL BtreeSetExtSort(HBT, IITSortKey*);
  295. VOID EXPORT_API PASCAL FAR BtreeGetExtSort(HBT, IITSortKey**);
  296. #else
  297. // Hack to get .c files to compile.
  298. VOID EXPORT_API FAR PASCAL BtreeSetExtSort(HBT, LPVOID);
  299. VOID EXPORT_API PASCAL FAR BtreeGetExtSort(HBT, LPVOID*);
  300. #endif
  301. /*****************************************************************************
  302. *
  303. * FS - file system (subfile.c, filesys.c)
  304. *
  305. *****************************************************************************/
  306. /* FS magic number */
  307. #define wFileSysMagic 0x5F3F // ?_ - the help icon (with shadow)
  308. //#define bFileSysVersion 2 // sorted free list
  309. /* Current FS version */
  310. #define bFileSysVersionOld (BYTE)3 // different sorting functions
  311. #define bFileSysVersion (BYTE)0x04 // M20 format quite different from M14
  312. /* flags for FlushHfs */
  313. #define fFSCloseFile (BYTE)0x01 // close fid associated with the FS
  314. #define fFSFreeBtreeCache (BYTE)0x02 // free the btree's cache
  315. /* seek origins */
  316. #define wFSSeekSet 0 // seek relative to start of file
  317. #define wFSSeekCur 1 // seek relative to current position
  318. #define wFSSeekEnd 2 // seek relative to end of file
  319. #define FSH_READWRITE (BYTE)0x01
  320. #define FSH_READONLY (BYTE)0x02
  321. #define FSH_CREATE (BYTE)0x04
  322. #define FSH_M14 (BYTE)0x08 // Not used really, since we return
  323. // an error if reading M14 to force
  324. // caller to use M14 APIs instead (we
  325. // could make this transparent to
  326. // user?)
  327. #define FSH_FASTUPDATE (BYTE)0x10 // System Btree is not copied to temp file
  328. // unless absolutely necessary
  329. #define FSH_DISKBTREE (BYTE)0x20 // System Btree is always copied to disk if
  330. // possible for speed. Btree may be very very
  331. // large, and this is NOT recommended for on-line
  332. #define HFOPEN_READWRITE (BYTE)0x01
  333. #define HFOPEN_READ (BYTE)0x02
  334. #define HFOPEN_CREATE (BYTE)0x04
  335. #define HFOPEN_SYSTEM (BYTE)0x08
  336. #define HFOPEN_NOTEMP (BYTE)0x10 // No temp file in r/w mode
  337. #define HFOPEN_FORCETEMP (BYTE)0x20 // Temp file created in r mode
  338. #define HFOPEN_ENABLELOGGING (BYTE)0x40
  339. #define FACCESS_READWRITE (BYTE)0x01
  340. #define FACCESS_READ (BYTE)0x02
  341. #define FACCESS_EXISTS (BYTE)0x04
  342. #define FACCESS_LIVESINFS (BYTE)0x08
  343. #define FACCESS_LIVESINTEMP (BYTE)0x10
  344. #define SFH_LOCKED (BYTE)0x01 // File may not be written to or deleted
  345. #define SFH_EXTRABYTES (BYTE)0x02 // (not used yet) Should use if extra bytes appear in header of file
  346. // file header should contain the number of header bytes as the first byte.
  347. #define SFH_COMPRESSED (BYTE)0x04 // (not used yet). Perhaps use to indicate an overall file compression
  348. #define SFH_LOGGING (BYTE)0x08
  349. #define SFH_INVALID (BYTE)0x80 // This is the value if file does not
  350. // really exist in fs yet.
  351. // These are the flags that users can manipulate
  352. #define SFH_FILEFLAGS (SFH_LOGGING|SFH_LOCKED)
  353. // Compatibility
  354. //#define fFSReadOnly (BYTE)0x01 // file (FS) is readonly
  355. //#define fFSOpenReadOnly (BYTE)0x02 // file (FS) is opened in readonly mode
  356. //#define fFSReadWrite (BYTE)0x00 // file (FS) is readwrite
  357. //#define fFSOpenReadWrite (BYTE)0x00 // file (FS) is opened in read/write mode
  358. //#define fFSOptCdRom (BYTE)0x20 // align file optimally for CDROM
  359. //#define fFSNoFlushDir (BYTE)0x40 // don't flush directory when closing
  360. #define fFSReadOnly HFOPEN_READ // file (FS) is readonly
  361. #define fFSOpenReadOnly HFOPEN_READ // file (FS) is opened in readonly mode
  362. #define fFSReadWrite HFOPEN_READWRITE // file (FS) is readwrite
  363. #define fFSOpenReadWrite HFOPEN_READWRITE // file (FS) is opened in read/write mode
  364. #define fFSOptCdRom 0x00 // align file optimally for CDROM
  365. #define fFSNoFlushDir 0x00 // don't flush directory when closing
  366. typedef HANDLE HSFB; // Handle to a SFB
  367. typedef BOOL (FAR PASCAL * PROGFUNC)(WORD);
  368. #define hfNil NULL
  369. // @DOC INTERNAL API
  370. // @struct FS_PARAMS | File system parameters to be passed in to
  371. // <f HfsCreateFileSysFm>. Only the <p cbBlock> parameter is used right now.
  372. typedef struct _fs_params
  373. {
  374. USHORT wFreeListSize; // @field Free List Entries (0=default, else max entries in free list)
  375. USHORT cbBlock; // @field Size of directory btree block. Usually 1024 to 8192.
  376. } FS_PARAMS;
  377. typedef struct fsfilefind_tag
  378. {
  379. FILEOFFSET foSize;
  380. FILEOFFSET foStart;
  381. BYTE bFlags;
  382. char szFilename[256];
  383. int magic;
  384. BTPOS btpos;
  385. HFS hfs;
  386. } FSFILEFIND, FAR * LPFSFILEFIND;
  387. VOID EXPORT_API FAR PASCAL CleanErrorList (BOOL);
  388. VOID EXPORT_API FAR PASCAL MVFSShutDown (void);
  389. /* File System Operations */
  390. HFS PASCAL FAR EXPORT_API HfsCreateFileSysFm( FM, FS_PARAMS FAR *, LPERRB );
  391. RC PASCAL FAR EXPORT_API RcDestroyFileSysFm( FM );
  392. HFS PASCAL FAR EXPORT_API HfsOpenFm( FM, BYTE, LPERRB );
  393. RC PASCAL FAR EXPORT_API RcCloseHfs( HFS );
  394. RC PASCAL FAR EXPORT_API RcFlushHfs( HFS );
  395. BOOL PASCAL FAR EXPORT_API FHfsAccess(HFS hfs, BYTE bFlags);
  396. RC PASCAL FAR EXPORT_API RcFindFirstFile(HFS hfs, LPCSTR szFilename, FSFILEFIND * pfind);
  397. RC PASCAL FAR EXPORT_API RcFindNextFile(FSFILEFIND * pfind);
  398. #define VerifyHfs(hfs)
  399. /* File Operations */
  400. HF PASCAL FAR EXPORT_API HfCreateFileHfs( HFS, LPCSTR, BYTE, LPERRB );
  401. RC PASCAL FAR EXPORT_API RcUnlinkFileHfs( HFS, LPCSTR );
  402. HF PASCAL FAR EXPORT_API HfOpenHfs( HFS, LPCWSTR, BYTE, LPERRB );
  403. HF PASCAL FAR EXPORT_API HfOpenHfsReserve( HFS, LPCSTR, BYTE, FILEOFFSET, LPERRB );
  404. RC PASCAL FAR EXPORT_API RcFlushHf( HF );
  405. RC PASCAL FAR EXPORT_API RcCloseHf( HF );
  406. LONG PASCAL FAR EXPORT_API LcbReadHf( HF, LPVOID, LONG, LPERRB );
  407. LONG PASCAL FAR EXPORT_API LcbWriteHf( HF, LPVOID, LONG, LPERRB );
  408. BOOL PASCAL FAR EXPORT_API FEofHf( HF, LPERRB );
  409. BOOL PASCAL FAR EXPORT_API FChSizeHf( HF, FILEOFFSET, LPERRB );
  410. BOOL PASCAL FAR EXPORT_API FAccessHfs( HFS, LPCSTR, BYTE, LPERRB );
  411. RC PASCAL FAR EXPORT_API RcAbandonHf( HF );
  412. RC PASCAL FAR EXPORT_API RcRenameFileHfs( HFS, LPCSTR, LPCSTR );
  413. BYTE PASCAL FAR EXPORT_API GetFileFlags(HFS, LPCSTR, LPERRB );
  414. RC PASCAL FAR EXPORT_API SetFileFlags(HFS, LPCSTR, BYTE );
  415. //BOOL PASCAL FAR EXPORT_API FHfValid( HF );
  416. HFS PASCAL FAR EXPORT_API HfsGetFromHf( HF );
  417. RC PASCAL FAR EXPORT_API RcCopyDosFileHfs(HFS, LPCSTR, LPCSTR, BYTE, PROGFUNC );
  418. FILEOFFSET PASCAL FAR EXPORT_API FoTellHf( HF, LPERRB );
  419. FILEOFFSET PASCAL FAR EXPORT_API FoSeekHf(HF, FILEOFFSET, WORD, LPERRB);
  420. FILEOFFSET PASCAL FAR EXPORT_API FoSizeHf( HF, LPERRB );
  421. FILEOFFSET PASCAL FAR EXPORT_API FoOffsetHf(HF hf, LPERRB lperrb);
  422. #define FHfValid(hf) ((hf) != NULL)
  423. #define VerifyHf(hf)
  424. // These functions require the FID type. They only make sense
  425. // if the caller already needs H_LLFILE.
  426. //#ifdef H_LLFILE
  427. //RC EXPORT_API FAR PASCAL RcLLInfoFromHf (HF, WORD, FID FAR *, LPLONG, LPLONG);
  428. //RC EXPORT_API FAR PASCAL RcLLInfoFromHfsSz (HFS, LPSTR, WORD, FID FAR *, LPLONG, LPLONG);
  429. //#endif // H_LLFILE
  430. /*****************************************************************************
  431. *
  432. * MediaView File Handling
  433. *
  434. *****************************************************************************/
  435. BOOL EXPORT_API FAR PASCAL LooseFileCompare(LPSTR, LPSTR);
  436. FM EXPORT_API FAR PASCAL LocateFile(LPSTR, LPVOID);
  437. HANDLE EXPORT_API FAR PASCAL LocateDLL(LPSTR, LPVOID);
  438. RC EXPORT_API FAR PASCAL CopyOrReplaceFileToSubfile(HFS, LPSTR, LPSTR, LONG, BYTE, PROGFUNC, BOOL);
  439. // New functionality
  440. FM EXPORT_API FAR PASCAL FmFromHfs(HFS hfs);
  441. #pragma pack() // avoid problems when Zp!=1
  442. #ifdef __cplusplus
  443. }
  444. #endif
  445. #endif // __WRAPSTOR_H__