source: trunk/dll/wrappers.h@ 1857

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

Restore comments lost by JBS commit

  • Property svn:eolstyle set to native
  • Property svn:keywords set to Id
File size: 3.4 KB
RevLine 
[1190]1
2/***********************************************************************
3
[1202]4 $Id: wrappers.h 1853 2015-08-17 00:08:03Z 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.
[1190]21
22***********************************************************************/
23
24#if !defined(WRAPPERS_H)
25#define WRAPPERS_H
26
[1327]27#if !defined(OS2_INCLUDED)
28#include <os2.h>
29#endif
30
[1845]31// Functions wrapped because they are not safe with high memory addresses
[1439]32
[1845]33APIRET xDosDupHandle(HFILE hFile,
34 PHFILE phFile);
[1438]35
[1845]36APIRET xDosForceDelete(PSZ pszFileName);
37
38APIRET xDosQueryHType(HFILE hFile,
39 PULONG pulType,
40 PULONG pulAttr);
41
42APIRET xDosQueryAppType(PCSZ pszName,
43 PULONG pFlags);
44
45#ifdef INCL_DOSSESMGR
46APIRET xDosStartSession(PSTARTDATA psd,
47 PULONG pulSessionID,
48 PPID ppid);
49#endif
50
51// Functions wrapped for other reasons
52
[1438]53APIRET xDosAllocMem(PPVOID ppb,
[1839]54 ULONG cb,
55 PCSZ pszSrcFile,
56 UINT uiLineNumber);
[1438]57
[1627]58APIRET xDosAllocMemLow(PPVOID ppb,
[1839]59 ULONG cb,
60 PCSZ pszSrcFile,
61 UINT uiLineNumber);
[1627]62
[1845]63APIRET xDosAllocSharedMem(PPVOID ppb,
64 PSZ pszName,
65 ULONG cb,
66 PCSZ pszSrcFile,
67 UINT uiLineNumber);
68
[1190]69APIRET xDosFindFirst(PSZ pszFileSpec,
70 PHDIR phdir,
[1845]71 ULONG flAttribute,
72 PVOID pfindbuf,
73 ULONG cbBuf,
[1190]74 PULONG pcFileNames,
[1845]75 ULONG ulInfoLevel);
76
77APIRET xDosFindNext(HDIR hDir,
78 PVOID pfindbuf,
79 ULONG cbfindbuf,
[1190]80 PULONG pcFilenames,
[1845]81 ULONG ulInfoLevel); // 06 Oct 07 SHL Added
[1839]82
[1845]83#ifdef INCL_DOSPROCESS // // PPIB PTIB
[1839]84APIRET xDosGetInfoBlocks(PTIB *pptib,
[1845]85 PPIB *pppib); // 2015-08-09 SHL added
[1839]86#endif
87
[1845]88APIRET xDosSetPathInfo(PSZ pszPathName,
[1190]89 ULONG ulInfoLevel,
90 PVOID pInfoBuf,
91 ULONG cbInfoBuf,
92 ULONG flOptions);
[1845]93
[1190]94PSZ xfgets(PSZ pszBuf, size_t cMaxBytes, FILE * fp, PCSZ pszSrcFile,
95 UINT uiLineNumber);
96PSZ xfgets_bstripcr(PSZ pszBuf, size_t cMaxBytes, FILE * fp, PCSZ pszSrcFile,
97 UINT uiLineNumber);
98FILE *xfopen(PCSZ pszFileName, PCSZ pszMode, PCSZ pszSrcFile,
[1544]99 UINT uiLineNumber, BOOL fSilent);
[1190]100VOID xfree(PVOID pv, PCSZ pszSrcFile, UINT uiLineNumber);
101FILE *xfsopen(PCSZ pszFileName, PCSZ pszMode, INT fSharemode, PCSZ pszSrcFile,
[1544]102 UINT uiLineNumber, BOOL fSilent);
[1190]103PVOID xmalloc(size_t cBytes, PCSZ pszSrcFile, UINT uiLineNumber);
104PVOID xmallocz(size_t cBytes, PCSZ pszSrcFile, UINT uiLineNumber);
105PVOID xrealloc(PVOID pvIn, size_t cBytes, PCSZ pszSrcFile, UINT uiLineNumber);
106PVOID xstrdup(PCSZ pszIn, PCSZ pszSrcFile, UINT uiLineNumber);
107
[1845]108#define HIGH_MEMORY_ADDRESS(p) (((ULONG)p) >= (512*1024*1024))
109
[1215]110// Data declarations
111extern BOOL fNoLargeFileSupport;
[1190]112
[1845]113
[1190]114#endif // WRAPPERS_H
Note: See TracBrowser for help on using the repository browser.