[7620] | 1 | /* $Id: oslibutil.cpp,v 1.7 2001-12-12 16:40:44 sandervl Exp $ */
|
---|
[2469] | 2 | /*
|
---|
| 3 | * Window API utility functions for OS/2
|
---|
| 4 | *
|
---|
| 5 | *
|
---|
| 6 | * Copyright 1999 Sander van Leeuwen (sandervl@xs4all.nl)
|
---|
| 7 | *
|
---|
| 8 | *
|
---|
| 9 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
| 10 | *
|
---|
| 11 | */
|
---|
| 12 | #include <os2win.h>
|
---|
| 13 | #include <misc.h>
|
---|
| 14 | #include <wprocess.h>
|
---|
| 15 | #include "oslibutil.h"
|
---|
| 16 |
|
---|
[2804] | 17 | #define DBG_LOCALLOG DBG_oslibutil
|
---|
| 18 | #include "dbglocal.h"
|
---|
| 19 |
|
---|
[2469] | 20 | //******************************************************************************
|
---|
| 21 | //******************************************************************************
|
---|
| 22 | HAB GetThreadHAB()
|
---|
| 23 | {
|
---|
[4658] | 24 | TEB *teb;
|
---|
[2469] | 25 |
|
---|
[4658] | 26 | teb = GetThreadTEB();
|
---|
| 27 | if(teb)
|
---|
[2469] | 28 | {
|
---|
[4658] | 29 | return (HAB)teb->o.odin.hab;
|
---|
[2469] | 30 | }
|
---|
| 31 |
|
---|
[4658] | 32 | dprintf(("GetThreadHAB: teb == NULL!!"));
|
---|
[2469] | 33 | return 0;
|
---|
| 34 | }
|
---|
| 35 | //******************************************************************************
|
---|
| 36 | //******************************************************************************
|
---|
| 37 | void SetThreadHAB(HAB hab)
|
---|
| 38 | {
|
---|
[4658] | 39 | TEB *teb;
|
---|
[2469] | 40 |
|
---|
[4658] | 41 | teb = GetThreadTEB();
|
---|
| 42 | if(teb)
|
---|
[2469] | 43 | {
|
---|
[4658] | 44 | teb->o.odin.hab = (ULONG)hab;
|
---|
[2469] | 45 | }
|
---|
[4658] | 46 | else dprintf(("SetThreadHAB: teb == NULL!!"));
|
---|
[2469] | 47 | }
|
---|
| 48 | //******************************************************************************
|
---|
| 49 | //******************************************************************************
|
---|
| 50 | HMQ GetThreadMessageQueue()
|
---|
| 51 | {
|
---|
[4658] | 52 | TEB *teb;
|
---|
[2469] | 53 |
|
---|
[4658] | 54 | teb = GetThreadTEB();
|
---|
| 55 | if(teb)
|
---|
[2469] | 56 | {
|
---|
[4658] | 57 | return (HMQ)teb->o.odin.hmq;
|
---|
[2469] | 58 | }
|
---|
| 59 |
|
---|
[4658] | 60 | dprintf(("GetThreadMessageQueue: teb == NULL!!"));
|
---|
[2469] | 61 | return 0;
|
---|
| 62 | }
|
---|
| 63 | //******************************************************************************
|
---|
| 64 | //******************************************************************************
|
---|
| 65 | void SetThreadMessageQueue(HMQ hmq)
|
---|
| 66 | {
|
---|
[4658] | 67 | TEB *teb;
|
---|
[2469] | 68 |
|
---|
[4658] | 69 | teb = GetThreadTEB();
|
---|
| 70 | if(teb)
|
---|
[2469] | 71 | {
|
---|
[4658] | 72 | teb->o.odin.hmq = (ULONG)hmq;
|
---|
[2469] | 73 | }
|
---|
[4658] | 74 | else dprintf(("SetThreadMessageQueue: teb == NULL!!"));
|
---|
[2469] | 75 | }
|
---|
| 76 | //******************************************************************************
|
---|
| 77 | //******************************************************************************
|
---|