source: trunk/src/emx/testcase/loadthread2.c@ 1285

Last change on this file since 1285 was 1285, checked in by bird, 21 years ago

Initial coding.

  • Property cvs2svn:cvs-rev set to 1.1
  • 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
5APIRET grc;
6
7void 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), "LIBC05.DLL", &hmod);
14 if (rc)
15 printf("DosLoadModule failed loading LIBC05.DLL. rc=%d szObj=%s\n", rc, szObj);
16 else
17 printf("Successfully loaded LIBC05.DLL\n");
18 grc = rc;
19}
20
21int 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.