Changeset 123 for trunk/src/kernel32/os2util.cpp
- Timestamp:
- Jun 19, 1999, 3:57:51 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/os2util.cpp
r120 r123 1 /* $Id: os2util.cpp,v 1. 3 1999-06-19 10:54:42sandervl Exp $ */1 /* $Id: os2util.cpp,v 1.4 1999-06-19 13:57:51 sandervl Exp $ */ 2 2 3 3 /* … … 14 14 #define INCL_BASE 15 15 #define INCL_DOSPROCESS 16 #define INCL_DOSSEL 16 17 #include <os2wrap.h> //Odin32 OS/2 api wrappers 17 18 #include <string.h> … … 207 208 } 208 209 209 210 211 212 210 void OS2Wait(ULONG msec) 213 211 { 214 212 DosSleep(msec); 215 213 } 214 215 //****************************************************************************** 216 //Wrapper for Dos16AllocSeg 217 //****************************************************************************** 218 BOOL OS2AllocSel(ULONG size, USHORT *selector) 219 { 220 return (Dos16AllocSeg(size, selector, SEG_NONSHARED) == 0); 221 } 222 //****************************************************************************** 223 //Wrapper for Dos16FreeSeg 224 //****************************************************************************** 225 BOOL OS2FreeSel(USHORT selector) 226 { 227 return (Dos16FreeSeg(selector) == 0); 228 } 229 //****************************************************************************** 230 //Wrapper for Dos32SelToFlat 231 //****************************************************************************** 232 PVOID OS2SelToFlat(USHORT selector) 233 { 234 return (PVOID)DosSelToFlat(selector << 16); 235 } 236 //****************************************************************************** 237 //Get TIB data 238 //****************************************************************************** 239 ULONG OS2GetTIB(int tiboff) 240 { 241 PTIB ptib; 242 PPIB ppib; 243 APIRET rc; 244 245 rc = DosGetInfoBlocks(&ptib, &ppib); 246 if(rc) { 247 return 0; 248 } 249 switch(tiboff) 250 { 251 case TIB_STACKTOP: 252 return (ULONG)ptib->tib_pstack; 253 case TIB_STACKLOW: 254 return (ULONG)ptib->tib_pstacklimit; 255 default: 256 return 0; 257 } 258 } 259 //****************************************************************************** 260 //Get PIB data 261 //****************************************************************************** 262 ULONG OS2GetPIB(int piboff) 263 { 264 PTIB ptib; 265 PPIB ppib; 266 APIRET rc; 267 268 rc = DosGetInfoBlocks(&ptib, &ppib); 269 if(rc) { 270 return 0; 271 } 272 switch(piboff) 273 { 274 case PIB_TASKHNDL: 275 return ppib->pib_hmte; 276 case PIB_TASKTYPE: 277 if(ppib->pib_ultype == 3) { 278 return TASKTYPE_PM; 279 } 280 else return TASKTYPE_VIO; 281 default: 282 return 0; 283 } 284 } 285 //****************************************************************************** 286 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.