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

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

Implemented tool for generating calltab for kernel imports. (mkcalltab)
Implemented API for accessing memory in another process. (*ProcessReadWrite)
Added kernel imports needed to implemented ProcessReadWrite.
Removed unused kernel imports.

File size: 2.7 KB
Line 
1/* $Id: OS2KPTDA.c,v 1.3 2000-10-01 02:58:20 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 */
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.