1 | /* $Id: oslibutil.cpp,v 1.7 2001-12-12 16:40:44 sandervl Exp $ */
|
---|
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 |
|
---|
17 | #define DBG_LOCALLOG DBG_oslibutil
|
---|
18 | #include "dbglocal.h"
|
---|
19 |
|
---|
20 | //******************************************************************************
|
---|
21 | //******************************************************************************
|
---|
22 | HAB GetThreadHAB()
|
---|
23 | {
|
---|
24 | TEB *teb;
|
---|
25 |
|
---|
26 | teb = GetThreadTEB();
|
---|
27 | if(teb)
|
---|
28 | {
|
---|
29 | return (HAB)teb->o.odin.hab;
|
---|
30 | }
|
---|
31 |
|
---|
32 | dprintf(("GetThreadHAB: teb == NULL!!"));
|
---|
33 | return 0;
|
---|
34 | }
|
---|
35 | //******************************************************************************
|
---|
36 | //******************************************************************************
|
---|
37 | void SetThreadHAB(HAB hab)
|
---|
38 | {
|
---|
39 | TEB *teb;
|
---|
40 |
|
---|
41 | teb = GetThreadTEB();
|
---|
42 | if(teb)
|
---|
43 | {
|
---|
44 | teb->o.odin.hab = (ULONG)hab;
|
---|
45 | }
|
---|
46 | else dprintf(("SetThreadHAB: teb == NULL!!"));
|
---|
47 | }
|
---|
48 | //******************************************************************************
|
---|
49 | //******************************************************************************
|
---|
50 | HMQ GetThreadMessageQueue()
|
---|
51 | {
|
---|
52 | TEB *teb;
|
---|
53 |
|
---|
54 | teb = GetThreadTEB();
|
---|
55 | if(teb)
|
---|
56 | {
|
---|
57 | return (HMQ)teb->o.odin.hmq;
|
---|
58 | }
|
---|
59 |
|
---|
60 | dprintf(("GetThreadMessageQueue: teb == NULL!!"));
|
---|
61 | return 0;
|
---|
62 | }
|
---|
63 | //******************************************************************************
|
---|
64 | //******************************************************************************
|
---|
65 | void SetThreadMessageQueue(HMQ hmq)
|
---|
66 | {
|
---|
67 | TEB *teb;
|
---|
68 |
|
---|
69 | teb = GetThreadTEB();
|
---|
70 | if(teb)
|
---|
71 | {
|
---|
72 | teb->o.odin.hmq = (ULONG)hmq;
|
---|
73 | }
|
---|
74 | else dprintf(("SetThreadMessageQueue: teb == NULL!!"));
|
---|
75 | }
|
---|
76 | //******************************************************************************
|
---|
77 | //******************************************************************************
|
---|