1 | /* $Id: OS2KPTDA.c,v 1.2 2000-09-02 21:08:12 bird Exp $
|
---|
2 | *
|
---|
3 | * PTDA access functions.
|
---|
4 | *
|
---|
5 | * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
|
---|
6 | *
|
---|
7 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
8 | *
|
---|
9 | */
|
---|
10 |
|
---|
11 | /*******************************************************************************
|
---|
12 | * Defined Constants And Macros *
|
---|
13 | *******************************************************************************/
|
---|
14 | #define INCL_OS2KRNL_SEM
|
---|
15 | #define INCL_OS2KRNL_PTDA
|
---|
16 |
|
---|
17 | /*******************************************************************************
|
---|
18 | * Header Files *
|
---|
19 | *******************************************************************************/
|
---|
20 | #include <os2.h>
|
---|
21 | #include <OS2Krnl.h>
|
---|
22 |
|
---|
23 |
|
---|
24 | /*******************************************************************************
|
---|
25 | * External Data *
|
---|
26 | *******************************************************************************/
|
---|
27 | /*
|
---|
28 | * Requires the following imports:
|
---|
29 | * pPTDACur
|
---|
30 | * ptda_start
|
---|
31 | * ptda_environ
|
---|
32 | */
|
---|
33 | extern ULONG pptda_start;
|
---|
34 | extern ULONG pptda_environ;
|
---|
35 | extern ULONG pptda_ptdasem;
|
---|
36 | extern ULONG pptda_module;
|
---|
37 |
|
---|
38 |
|
---|
39 | /**
|
---|
40 | * Gets the ptda_environ PTDA member. This member holds the memory object handle
|
---|
41 | * for the environment block of the processes.
|
---|
42 | * @returns Content of the pPTDA->ptda_environ member.
|
---|
43 | * @param pPTDA PTDA Pointer. (NULL is not allowed!)
|
---|
44 | */
|
---|
45 | USHORT ptdaGet_ptda_environ(PPTDA pPTDA)
|
---|
46 | {
|
---|
47 | return *(PUSHORT)(void*)(((char*)(void*)pPTDA) + (pptda_environ - pptda_start));
|
---|
48 | }
|
---|
49 |
|
---|
50 |
|
---|
51 | /**
|
---|
52 | * Gets the ptda_module PTDA member. This member holds the MTE handle of the process's
|
---|
53 | * executable image.
|
---|
54 | * @returns Content of the pPTDA->ptda_module member.
|
---|
55 | * @param pPTDA PTDA Pointer. (NULL is not allowed!)
|
---|
56 | */
|
---|
57 | USHORT ptdaGet_ptda_module(PPTDA pPTDA)
|
---|
58 | {
|
---|
59 | return *(PUSHORT)(void*)(((char*)(void*)pPTDA) + (pptda_module - pptda_start));
|
---|
60 | }
|
---|
61 |
|
---|
62 |
|
---|
63 | /**
|
---|
64 | * Gets the ptda_ptdasem PTDA member. This member holds the intra-process semaphore which
|
---|
65 | * for example is used to serialize _LDRQAppType.
|
---|
66 | * @returns Content of the pPTDA->ptda_ptdasem member.
|
---|
67 | * @param pPTDA PTDA Pointer. (NULL is not allowed!)
|
---|
68 | */
|
---|
69 | HKSEMMTX ptda_ptda_ptdasem(PPTDA pPTDA)
|
---|
70 | {
|
---|
71 | return (HKSEMMTX)(void*)(((char*)(void*)pPTDA) + (pptda_ptdasem - pptda_start));
|
---|
72 | }
|
---|
73 |
|
---|
74 |
|
---|
75 |
|
---|