source: trunk/dll/wrappers.h@ 1878

Last change on this file since 1878 was 1860, checked in by Steven Levine, 10 years ago

Rework FlesWaitForWorkListEmpty to support wait for parents of path
Add more wrappers for mutex and event semaphores
Clean up some obsolete code

  • Property svn:eolstyle set to native
  • Property svn:keywords set to Id
File size: 3.8 KB
RevLine 
[1190]1
2/***********************************************************************
3
[1202]4 $Id: wrappers.h 1860 2015-08-22 02:30:34Z stevenhl $
[1190]5
[1327]6 Wrappers with error checking
[1190]7
[1202]8 Copyright (c) 1993-98 M. Kimes
[1853]9 Copyright (c) 2008, 2015 Steven H. Levine
[1190]10
[1327]11 08 Dec 08 SHL Add missing OS2_INCLUDED check
[1439]12 12 Jul 09 GKY Add xDosQueryAppType and xDoxAlloc... to allow FM/2 to load in high memory
[1627]13 26 Aug 11 GKY Add a low mem version of xDosAlloc* wrappers; move error checking into all the
[1839]14 xDosAlloc* wrappers.
[1853]15 09 Aug 15 SHL Add xDosGetInfoBlocks
[1847]16 12 Aug 15 JBS Ticket #522: Ensure no "highmem-unsafe" functions are called directly
[1845]17 1) New functions have been added
[1848]18 2) Code for unsafe-but-not-yet-used-by-FM/2 functinos have been added in an
[1845]19 "#if 0" block in wrappers.c for quick implementation should FM/2 start to use them.
20 Among these. xDosOpenL and xWinUpper still need work. The rest are ready for use.
[1860]21 20 Aug 15 SHL Add xDos...MutexSem and xDos..EventSem wrappers
[1190]22
23***********************************************************************/
24
25#if !defined(WRAPPERS_H)
26#define WRAPPERS_H
27
[1327]28#if !defined(OS2_INCLUDED)
29#include <os2.h>
30#endif
31
[1845]32// Functions wrapped because they are not safe with high memory addresses
[1439]33
[1845]34APIRET xDosDupHandle(HFILE hFile,
35 PHFILE phFile);
[1438]36
[1845]37APIRET xDosForceDelete(PSZ pszFileName);
38
39APIRET xDosQueryHType(HFILE hFile,
40 PULONG pulType,
41 PULONG pulAttr);
42
43APIRET xDosQueryAppType(PCSZ pszName,
44 PULONG pFlags);
45
46#ifdef INCL_DOSSESMGR
47APIRET xDosStartSession(PSTARTDATA psd,
48 PULONG pulSessionID,
49 PPID ppid);
50#endif
51
52// Functions wrapped for other reasons
53
[1438]54APIRET xDosAllocMem(PPVOID ppb,
[1839]55 ULONG cb,
56 PCSZ pszSrcFile,
57 UINT uiLineNumber);
[1438]58
[1627]59APIRET xDosAllocMemLow(PPVOID ppb,
[1839]60 ULONG cb,
61 PCSZ pszSrcFile,
62 UINT uiLineNumber);
[1627]63
[1845]64APIRET xDosAllocSharedMem(PPVOID ppb,
65 PSZ pszName,
66 ULONG cb,
67 PCSZ pszSrcFile,
68 UINT uiLineNumber);
69
[1190]70APIRET xDosFindFirst(PSZ pszFileSpec,
71 PHDIR phdir,
[1845]72 ULONG flAttribute,
73 PVOID pfindbuf,
74 ULONG cbBuf,
[1190]75 PULONG pcFileNames,
[1845]76 ULONG ulInfoLevel);
77
78APIRET xDosFindNext(HDIR hDir,
79 PVOID pfindbuf,
80 ULONG cbfindbuf,
[1190]81 PULONG pcFilenames,
[1845]82 ULONG ulInfoLevel); // 06 Oct 07 SHL Added
[1839]83
[1860]84#ifdef INCL_DOSPROCESS // PPIB PTIB
[1839]85APIRET xDosGetInfoBlocks(PTIB *pptib,
[1845]86 PPIB *pppib); // 2015-08-09 SHL added
[1839]87#endif
88
[1860]89#ifdef INCL_DOSSEMAPHORES // HMTX HEV
90APIRET xDosRequestMutexSem(HMTX hmtx, ULONG ulTimeout);
91APIRET xDosReleaseMutexSem(HMTX hmtx);
92APIRET xDosCreateEventSem (PSZ pszName,PHEV phev, ULONG flAttr, BOOL32 fState);
93APIRET xDosWaitEventSem(HEV hev, ULONG ulTimeout);
94APIRET xDosPostEventSem(HEV hev);
95APIRET xDosResetEventSem(HEV hev, PULONG pulPostCt);
96#endif
97
[1845]98APIRET xDosSetPathInfo(PSZ pszPathName,
[1190]99 ULONG ulInfoLevel,
100 PVOID pInfoBuf,
101 ULONG cbInfoBuf,
102 ULONG flOptions);
[1845]103
[1190]104PSZ xfgets(PSZ pszBuf, size_t cMaxBytes, FILE * fp, PCSZ pszSrcFile,
105 UINT uiLineNumber);
106PSZ xfgets_bstripcr(PSZ pszBuf, size_t cMaxBytes, FILE * fp, PCSZ pszSrcFile,
107 UINT uiLineNumber);
108FILE *xfopen(PCSZ pszFileName, PCSZ pszMode, PCSZ pszSrcFile,
[1544]109 UINT uiLineNumber, BOOL fSilent);
[1190]110VOID xfree(PVOID pv, PCSZ pszSrcFile, UINT uiLineNumber);
111FILE *xfsopen(PCSZ pszFileName, PCSZ pszMode, INT fSharemode, PCSZ pszSrcFile,
[1544]112 UINT uiLineNumber, BOOL fSilent);
[1190]113PVOID xmalloc(size_t cBytes, PCSZ pszSrcFile, UINT uiLineNumber);
114PVOID xmallocz(size_t cBytes, PCSZ pszSrcFile, UINT uiLineNumber);
115PVOID xrealloc(PVOID pvIn, size_t cBytes, PCSZ pszSrcFile, UINT uiLineNumber);
116PVOID xstrdup(PCSZ pszIn, PCSZ pszSrcFile, UINT uiLineNumber);
117
[1845]118#define HIGH_MEMORY_ADDRESS(p) (((ULONG)p) >= (512*1024*1024))
119
[1215]120// Data declarations
121extern BOOL fNoLargeFileSupport;
[1190]122
[1845]123
[1190]124#endif // WRAPPERS_H
Note: See TracBrowser for help on using the repository browser.