Last change
on this file since 2013 was 1287, checked in by bird, 21 years ago |
#967: Initial per thread data rewrite.
|
-
Property cvs2svn:cvs-rev
set to
1.2
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
896 bytes
|
Line | |
---|
1 | #define INCL_BASE
|
---|
2 | #include <os2.h>
|
---|
3 | #include <stdio.h>
|
---|
4 |
|
---|
5 | APIRET grc;
|
---|
6 |
|
---|
7 | void APIENTRY thread2(ULONG ulArg)
|
---|
8 | {
|
---|
9 | HMODULE hmod = NULLHANDLE;
|
---|
10 | char szObj[32];
|
---|
11 | APIRET rc;
|
---|
12 | szObj[0] = '\0';
|
---|
13 | rc = DosLoadModule(szObj, sizeof(szObj), "LIBC06.DLL", &hmod);
|
---|
14 | if (rc)
|
---|
15 | printf("DosLoadModule failed loading LIBC06.DLL. rc=%d szObj=%s\n", rc, szObj);
|
---|
16 | else
|
---|
17 | printf("Successfully loaded LIBC06.DLL\n");
|
---|
18 | grc = rc;
|
---|
19 | }
|
---|
20 |
|
---|
21 | int main()
|
---|
22 | {
|
---|
23 | APIRET rc;
|
---|
24 | TID tid;
|
---|
25 |
|
---|
26 | rc = DosCreateThread(&tid, thread2, 0, CREATE_READY | STACK_COMMITTED, 128*1024);
|
---|
27 | if (!rc)
|
---|
28 | {
|
---|
29 | rc = DosWaitThread(&tid, DCWW_WAIT);
|
---|
30 | if (!rc)
|
---|
31 | {
|
---|
32 | if (!grc)
|
---|
33 | {
|
---|
34 | printf("loadthread2: success\n");
|
---|
35 | return 0;
|
---|
36 | }
|
---|
37 | rc = grc;
|
---|
38 | }
|
---|
39 | }
|
---|
40 | printf("loadthread2: Failure. (rc=%d)\n", rc);
|
---|
41 | return 1;
|
---|
42 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.