Line | |
---|
1 | /* $Id: dos.c,v 1.1 2000-07-16 22:18:14 bird Exp $
|
---|
2 | *
|
---|
3 | * Thunkers for OS/2 APIs.
|
---|
4 | *
|
---|
5 | * Some APIs requires Linear Stack, some have to overridden to
|
---|
6 | * emulate different things.
|
---|
7 | *
|
---|
8 | * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
|
---|
9 | *
|
---|
10 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
11 | *
|
---|
12 | */
|
---|
13 |
|
---|
14 | /*******************************************************************************
|
---|
15 | * Defined Constants And Macros *
|
---|
16 | *******************************************************************************/
|
---|
17 | #define INCL_BASE
|
---|
18 | #define INCL_NO_FAKE
|
---|
19 |
|
---|
20 | /*******************************************************************************
|
---|
21 | * Header Files *
|
---|
22 | *******************************************************************************/
|
---|
23 | #include <os2.h>
|
---|
24 |
|
---|
25 | #include "test.h"
|
---|
26 |
|
---|
27 |
|
---|
28 | /*******************************************************************************
|
---|
29 | * External Functions *
|
---|
30 | * (These are prototypes for functions in the IMPORTS section of the def-file.) *
|
---|
31 | *******************************************************************************/
|
---|
32 | APIRET APIENTRY _DosWrite(HFILE hFile, PVOID pBuffer, ULONG cbWrite, PULONG pcbActual);
|
---|
33 |
|
---|
34 |
|
---|
35 | /**
|
---|
36 | * DosWrite overload. Ensures that the stack is 32-bit!
|
---|
37 | */
|
---|
38 | APIRET APIENTRY DosWrite(HFILE hFile, PVOID pBuffer, ULONG cbWrite, PULONG pcbActual)
|
---|
39 | {
|
---|
40 | BOOL f32Stack = ((int)&hFile > 0x10000);
|
---|
41 | APIRET rc;
|
---|
42 | if (!f32Stack)
|
---|
43 | ThunkStack16To32();
|
---|
44 |
|
---|
45 | rc = _DosWrite(hFile, pBuffer, cbWrite, pcbActual);
|
---|
46 |
|
---|
47 | if (!f32Stack)
|
---|
48 | ThunkStack32To16();
|
---|
49 |
|
---|
50 | return rc;
|
---|
51 | }
|
---|
52 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.