source: trunk/src/win32k/misc/OS2KPTDA.c@ 4787

Last change on this file since 4787 was 4787, checked in by bird, 25 years ago

Changed email address... (may some dll fixes changes too.)

File size: 2.7 KB
Line 
1/* $Id: OS2KPTDA.c,v 1.4 2000-12-11 06:53:54 bird Exp $
2 *
3 * PTDA access functions.
4 *
5 * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@mynd.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 */
33extern ULONG pptda_start;
34extern ULONG pptda_environ;
35extern ULONG pptda_ptdasem;
36extern ULONG pptda_handle;
37extern ULONG pptda_module;
38
39
40/**
41 * Gets the ptda_environ PTDA member. This member holds the memory object handle
42 * for the environment block of the processes.
43 * @returns Content of the pPTDA->ptda_environ member.
44 * @param pPTDA PTDA Pointer. (NULL is not allowed!)
45 */
46USHORT ptdaGet_ptda_environ(PPTDA pPTDA)
47{
48 return *(PUSHORT)(void*)(((char*)(void*)pPTDA) + (pptda_environ - pptda_start));
49}
50
51
52/**
53 * Gets the ptda_handle PTDA member. This member holds the PTDA handle for the
54 * given PTDA.
55 * @returns Content of the pPTDA->ptda_handle member.
56 * @param pPTDA PTDA Pointer. (NULL is not allowed!)
57 */
58HPTDA ptdaGet_ptda_handle(PPTDA pPTDA)
59{
60 return *(PHPTDA)(void*)(((char*)(void*)pPTDA) + (pptda_handle - pptda_start));
61}
62
63
64/**
65 * Gets the ptda_module PTDA member. This member holds the MTE handle of the process's
66 * executable image.
67 * @returns Content of the pPTDA->ptda_module member.
68 * @param pPTDA PTDA Pointer. (NULL is not allowed!)
69 */
70USHORT ptdaGet_ptda_module(PPTDA pPTDA)
71{
72 return *(PUSHORT)(void*)(((char*)(void*)pPTDA) + (pptda_module - pptda_start));
73}
74
75
76/**
77 * Gets the ptda_ptdasem PTDA member. This member holds the intra-process semaphore which
78 * for example is used to serialize _LDRQAppType.
79 * @returns Content of the pPTDA->ptda_ptdasem member.
80 * @param pPTDA PTDA Pointer. (NULL is not allowed!)
81 */
82HKSEMMTX ptda_ptda_ptdasem(PPTDA pPTDA)
83{
84 return (HKSEMMTX)(void*)(((char*)(void*)pPTDA) + (pptda_ptdasem - pptda_start));
85}
86
87
88
Note: See TracBrowser for help on using the repository browser.