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
Line 
1
2/***********************************************************************
3
4 $Id: wrappers.h 1853 2015-08-17 00:08:03Z stevenhl $
5
6 Wrappers with error checking
7
8 Copyright (c) 1993-98 M. Kimes
9 Copyright (c) 2008, 2015 Steven H. Levine
10
11 08 Dec 08 SHL Add missing OS2_INCLUDED check
12 12 Jul 09 GKY Add xDosQueryAppType and xDoxAlloc... to allow FM/2 to load in high memory
13 26 Aug 11 GKY Add a low mem version of xDosAlloc* wrappers; move error checking into all the
14 xDosAlloc* wrappers.
15 09 Aug 15 SHL Add xDosGetInfoBlocks
16 12 Aug 15 JBS Ticket #522: Ensure no "highmem-unsafe" functions are called directly
17 1) New functions have been added
18 2) Code for unsafe-but-not-yet-used-by-FM/2 functinos have been added in an
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.
21
22***********************************************************************/
23
24#if !defined(WRAPPERS_H)
25#define WRAPPERS_H
26
27#if !defined(OS2_INCLUDED)
28#include <os2.h>
29#endif
30
31// Functions wrapped because they are not safe with high memory addresses
32
33APIRET xDosDupHandle(HFILE hFile,
34 PHFILE phFile);
35
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
53APIRET xDosAllocMem(PPVOID ppb,
54 ULONG cb,
55 PCSZ pszSrcFile,
56 UINT uiLineNumber);
57
58APIRET xDosAllocMemLow(PPVOID ppb,
59 ULONG cb,
60 PCSZ pszSrcFile,
61 UINT uiLineNumber);
62
63APIRET xDosAllocSharedMem(PPVOID ppb,
64 PSZ pszName,
65 ULONG cb,
66 PCSZ pszSrcFile,
67 UINT uiLineNumber);
68
69APIRET xDosFindFirst(PSZ pszFileSpec,
70 PHDIR phdir,
71 ULONG flAttribute,
72 PVOID pfindbuf,
73 ULONG cbBuf,
74 PULONG pcFileNames,
75 ULONG ulInfoLevel);
76
77APIRET xDosFindNext(HDIR hDir,
78 PVOID pfindbuf,
79 ULONG cbfindbuf,
80 PULONG pcFilenames,
81 ULONG ulInfoLevel); // 06 Oct 07 SHL Added
82
83#ifdef INCL_DOSPROCESS // // PPIB PTIB
84APIRET xDosGetInfoBlocks(PTIB *pptib,
85 PPIB *pppib); // 2015-08-09 SHL added
86#endif
87
88APIRET xDosSetPathInfo(PSZ pszPathName,
89 ULONG ulInfoLevel,
90 PVOID pInfoBuf,
91 ULONG cbInfoBuf,
92 ULONG flOptions);
93
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,
99 UINT uiLineNumber, BOOL fSilent);
100VOID xfree(PVOID pv, PCSZ pszSrcFile, UINT uiLineNumber);
101FILE *xfsopen(PCSZ pszFileName, PCSZ pszMode, INT fSharemode, PCSZ pszSrcFile,
102 UINT uiLineNumber, BOOL fSilent);
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
108#define HIGH_MEMORY_ADDRESS(p) (((ULONG)p) >= (512*1024*1024))
109
110// Data declarations
111extern BOOL fNoLargeFileSupport;
112
113
114#endif // WRAPPERS_H
Note: See TracBrowser for help on using the repository browser.