1 /****************************************************************************
3 * SciTech OS Portability Manager Library
5 * ========================================================================
7 * The contents of this file are subject to the SciTech MGL Public
8 * License Version 1.0 (the "License"); you may not use this file
9 * except in compliance with the License. You may obtain a copy of
10 * the License at http://www.scitechsoft.com/mgl-license.txt
12 * Software distributed under the License is distributed on an
13 * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
14 * implied. See the License for the specific language governing
15 * rights and limitations under the License.
17 * The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
19 * The Initial Developer of the Original Code is SciTech Software, Inc.
20 * All Rights Reserved.
22 * ========================================================================
25 * Environment: Win32, OS/2
27 * Description: Include file for the SciTech Portability Manager 32-bit
28 * helper VxD for Windows 9x for and the 16-bit ring 0
29 * helper device driver for OS/2.
31 * This file documents all the public services used by the
32 * SciTech Portability Manager library and SciTech Nucleus
35 ****************************************************************************/
40 /* Include version information */
42 #include "sdd/sddver.h"
43 #define PMHELP_Major SDD_RELEASE_MAJOR
44 #define PMHELP_Minor SDD_RELEASE_MINOR
45 #define PMHELP_VERSION ((PMHELP_Major << 8) | PMHELP_Minor)
49 /****************************************************************************
50 * Public OS/2 Support functions
51 ****************************************************************************/
54 #include "nucleus/graphics.h"
56 /* Name of device driver */
58 #define PMHELP_NAME (PSZ)"sddhelp$"
60 /* Main IOCTL function to talk to device driver */
62 #define PMHELP_IOCTL 0x0080
64 /* Macro definition for defining IOCTL function control codes for the SDDHELP
65 * device driver for OS/2. Similar to that used for the DOS/Win32 version.
68 #define PMHELP_CTL_CODE(name,value) \
72 /* Version function used by all drivers */
73 PMHELP_CTL_CODE(GETVER ,0x0001),
74 PMHELP_CTL_CODE(MAPPHYS ,0x0002),
75 PMHELP_CTL_CODE(ALLOCLOCKED ,0x0003),
76 PMHELP_CTL_CODE(FREELOCKED ,0x0004),
77 PMHELP_CTL_CODE(GETGDT32 ,0x0005),
78 PMHELP_CTL_CODE(MALLOCSHARED ,0x0007),
79 PMHELP_CTL_CODE(FREESHARED ,0x0008),
80 PMHELP_CTL_CODE(MAPTOPROCESS ,0x0009),
81 PMHELP_CTL_CODE(FREEPHYS ,0x000A),
82 PMHELP_CTL_CODE(FLUSHTLB ,0x000B),
83 PMHELP_CTL_CODE(SAVECR4 ,0x000C),
84 PMHELP_CTL_CODE(RESTORECR4 ,0x000D),
85 PMHELP_CTL_CODE(READMSR ,0x000E),
86 PMHELP_CTL_CODE(WRITEMSR ,0x000F),
87 PMHELP_CTL_CODE(GETPHYSICALADDR ,0x0010),
88 PMHELP_CTL_CODE(GETPHYSICALADDRRANGE ,0x0011),
89 PMHELP_CTL_CODE(LOCKPAGES ,0x0012),
90 PMHELP_CTL_CODE(UNLOCKPAGES ,0x0013),
91 PMHELP_CTL_CODE(GETSHAREDEXP ,0x0042),
92 PMHELP_CTL_CODE(SETSHAREDEXP ,0x0043),
93 PMHELP_CTL_CODE(GETSTACKSWITCHRTN ,0x0044),
94 PMHELP_CTL_CODE(GETBUILDNO ,0x0050),
99 /****************************************************************************
100 * Public DOS/Windows Support functions
101 ****************************************************************************/
105 #define PMHELP_Init_Order (VDD_INIT_ORDER-1)
106 #define RETURN_LONGS(n) *p->dioc_bytesret = (n) * sizeof(ulong)
107 #endif /* DEVICE_MAIN */
109 #include "nucleus/graphics.h"
111 /* We connect to the SDDHELP.VXD module if it is staticly loaded (as part
112 * of SciTech Display Doctor), otherwise we dynamically load the PMHELP.VXD
116 #define PMHELP_DeviceID 0x0000
117 #define SDDHELP_DeviceID 0x3DF8
118 #define VXDLDR_DeviceID 0x0027
119 #define SDDHELP_MODULE "SDDHELP"
120 #define SDDHELP_NAME "SDDHELP.VXD"
121 #define PMHELP_MODULE "PMHELP"
122 #define PMHELP_NAME "PMHELP.VXD"
123 #define PMHELP_DDBNAME "pmhelp "
124 #define SDDHELP_MODULE_PATH "\\\\.\\" SDDHELP_MODULE
125 #define PMHELP_MODULE_PATH "\\\\.\\" PMHELP_MODULE
126 #define PMHELP_VXD_PATH "\\\\.\\" PMHELP_NAME
128 /* Macro definition for defining IOCTL function control codes for the PMHELP
129 * device drivers for Windows 9x and NT. This macro is basically derived from
130 * the CTL_CODE macro in the Windows 2000 DDK, but we hard code it here to
131 * avoid having to #include any of the Windows 2000 DDK header files. We also
132 * define both a 16-bit and 32-bit version of the control code within the same
133 * macro to simplify future additions.
135 * Essentially the Win32 macro would normally expand to the following:
137 * CTL_CODE(FILE_DEVICE_VIDEO,0x800+value,METHOD_BUFFERED,FILE_ANY_ACCESS)
140 #define PMHELP_CTL_CODE(name,value) \
141 PMHELP_##name = value, \
142 PMHELP_##name##32 = ((0x23 << 16) | (0 << 14) | ((0x800+value) << 2) | (0))
145 /* Include all the control codes. We keep them in a separate header
146 * file so we can include them in multiple places to make this
152 /* For real mode VxD calls, we put the function number into the high
153 * order word of EAX, and a value of 0x4FFF in AX. This allows our
154 * VxD handler which is set up to handle Int 10's to recognise a native
155 * PMHELP API call from a real mode DOS program.
159 #define API_NUM(num) (((ulong)(num) << 16) | 0x4FFF)
161 #define API_NUM(num) (num)
164 #endif /* !__OS2__ */
166 #endif /* __PMHELP_H */