1 | /* $Id: oslibutil.cpp,v 1.5 2000-02-16 14:34:28 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 | THDB *thdb;
|
---|
25 |
|
---|
26 | thdb = GetThreadTHDB();
|
---|
27 | if(thdb)
|
---|
28 | {
|
---|
29 | return (HAB)thdb->hab;
|
---|
30 | }
|
---|
31 |
|
---|
32 | dprintf(("GetThreadHAB: thdb == NULL!!"));
|
---|
33 | return 0;
|
---|
34 | }
|
---|
35 | //******************************************************************************
|
---|
36 | //******************************************************************************
|
---|
37 | void SetThreadHAB(HAB hab)
|
---|
38 | {
|
---|
39 | THDB *thdb;
|
---|
40 |
|
---|
41 | thdb = GetThreadTHDB();
|
---|
42 | if(thdb)
|
---|
43 | {
|
---|
44 | thdb->hab = (ULONG)hab;
|
---|
45 | }
|
---|
46 | else dprintf(("SetThreadHAB: thdb == NULL!!"));
|
---|
47 | }
|
---|
48 | //******************************************************************************
|
---|
49 | //******************************************************************************
|
---|
50 | HMQ GetThreadMessageQueue()
|
---|
51 | {
|
---|
52 | THDB *thdb;
|
---|
53 |
|
---|
54 | thdb = GetThreadTHDB();
|
---|
55 | if(thdb)
|
---|
56 | {
|
---|
57 | return (HMQ)thdb->hmq;
|
---|
58 | }
|
---|
59 |
|
---|
60 | dprintf(("GetThreadMessageQueue: thdb == NULL!!"));
|
---|
61 | return 0;
|
---|
62 | }
|
---|
63 | //******************************************************************************
|
---|
64 | //******************************************************************************
|
---|
65 | void SetThreadMessageQueue(HMQ hmq)
|
---|
66 | {
|
---|
67 | THDB *thdb;
|
---|
68 |
|
---|
69 | thdb = GetThreadTHDB();
|
---|
70 | if(thdb)
|
---|
71 | {
|
---|
72 | thdb->hmq = (ULONG)hmq;
|
---|
73 | }
|
---|
74 | else dprintf(("SetThreadMessageQueue: thdb == NULL!!"));
|
---|
75 | }
|
---|
76 | //******************************************************************************
|
---|
77 | //******************************************************************************
|
---|
78 | DWORD GetThreadMessageExtraInfo()
|
---|
79 | {
|
---|
80 | THDB *thdb;
|
---|
81 |
|
---|
82 | thdb = GetThreadTHDB();
|
---|
83 | if(thdb)
|
---|
84 | {
|
---|
85 | return thdb->lParam;
|
---|
86 | }
|
---|
87 |
|
---|
88 | dprintf(("GetThreadMessageExtraInfo: thdb == NULL!!"));
|
---|
89 | return 0;
|
---|
90 | }
|
---|
91 | //******************************************************************************
|
---|
92 | //******************************************************************************
|
---|
93 | DWORD SetThreadMessageExtraInfo(DWORD lParam)
|
---|
94 | {
|
---|
95 | THDB *thdb;
|
---|
96 |
|
---|
97 | thdb = GetThreadTHDB();
|
---|
98 | if(thdb)
|
---|
99 | {
|
---|
100 | thdb->lParam = lParam;
|
---|
101 | }
|
---|
102 | else dprintf(("SetThreadMessageExtraInfo: thdb == NULL!!"));
|
---|
103 | return 0;
|
---|
104 | }
|
---|