[4165] | 1 | /* $Id: win32k.h,v 1.1 2000-09-02 21:11:22 bird Exp $
|
---|
| 2 | *
|
---|
| 3 | * Top level make file for the Win32k library.
|
---|
| 4 | * Contains library and 32-bit IOCtl definition.
|
---|
| 5 | *
|
---|
| 6 | * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
|
---|
| 7 | *
|
---|
| 8 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
| 9 | *
|
---|
| 10 | */
|
---|
| 11 | #ifndef _WIN32K_H_
|
---|
| 12 | #define _WIN32K_H_
|
---|
| 13 |
|
---|
| 14 | /*******************************************************************************
|
---|
| 15 | * Defined Constants And Macros *
|
---|
| 16 | *******************************************************************************/
|
---|
| 17 | /*
|
---|
| 18 | * IOCtls categories.
|
---|
| 19 | */
|
---|
| 20 | #define IOCTL_W32K_K32 0xC1
|
---|
| 21 | #define IOCTL_W32K_ELF 0xC2
|
---|
| 22 |
|
---|
| 23 | /*
|
---|
| 24 | * K32 category - these are the functions found in the k32 directory.
|
---|
| 25 | */
|
---|
| 26 | #define K32_ALLOCMEMEX 0x01
|
---|
| 27 | #define K32_QUERYOTES 0x02
|
---|
| 28 | #define K32_QUERYOPTIONSSTATUS 0x03
|
---|
| 29 | #define K32_SETOPTIONS 0x04
|
---|
| 30 |
|
---|
| 31 | /*
|
---|
| 32 | * Elf category
|
---|
| 33 | */
|
---|
| 34 | #define ELF_DUMMY 0x01
|
---|
| 35 |
|
---|
| 36 |
|
---|
| 37 | /*******************************************************************************
|
---|
| 38 | * Structures and Typedefs *
|
---|
| 39 | *******************************************************************************/
|
---|
| 40 | #pragma pack(1)
|
---|
| 41 |
|
---|
| 42 | /*
|
---|
| 43 | * Object Table Entry buffer.
|
---|
| 44 | */
|
---|
| 45 | typedef struct _QueryOTE
|
---|
| 46 | {
|
---|
| 47 | ULONG ote_size; /* Object virtual size */
|
---|
| 48 | ULONG ote_base; /* Object base virtual address */
|
---|
| 49 | ULONG ote_flags; /* Attribute flags */
|
---|
| 50 | ULONG ote_pagemap; /* Object page map index */
|
---|
| 51 | ULONG ote_mapsize; /* Num of entries in obj page map */
|
---|
| 52 | /*ULONG ote_reserved;*/
|
---|
| 53 | USHORT ote_sel; /* Object Selector */
|
---|
| 54 | USHORT ote_hob; /* Object Handle */
|
---|
| 55 | } QOTE, *PQOTE;
|
---|
| 56 |
|
---|
| 57 | typedef struct _QueryOTEBuffer
|
---|
| 58 | {
|
---|
| 59 | ULONG cOTEs; /* Number of entries in aOTE. */
|
---|
| 60 | QOTE aOTE[1]; /* Array of OTEs. */
|
---|
| 61 | } QOTEBUFFER, *PQOTEBUFFER;
|
---|
| 62 |
|
---|
| 63 |
|
---|
| 64 | /*
|
---|
| 65 | * Options struct.
|
---|
| 66 | *
|
---|
| 67 | * (The function of these members are described in options.h in
|
---|
| 68 | * the src\win32k\include directory.)
|
---|
| 69 | * All members of this struct (except cb ofcourse) is changable.
|
---|
| 70 | */
|
---|
| 71 | typedef struct _K32Options
|
---|
| 72 | {
|
---|
| 73 | ULONG cb;
|
---|
| 74 |
|
---|
| 75 | /** @cat logging options */
|
---|
| 76 | USHORT usCom; /* Output port no. */
|
---|
| 77 | ULONG fLogging; /* Logging. */
|
---|
| 78 |
|
---|
| 79 | /** @cat Options affecting the generated LX executables */
|
---|
| 80 | ULONG fPE; /* Flags set the type of conversion. */
|
---|
| 81 | ULONG ulInfoLevel; /* Pe2Lx InfoLevel. */
|
---|
| 82 |
|
---|
| 83 | /** @cat Options affecting the generated ELF executables */
|
---|
| 84 | ULONG fElf; /* Elf flags. */
|
---|
| 85 |
|
---|
| 86 | /** @cat Options affecting the UNIX script executables */
|
---|
| 87 | ULONG fUNIXScript; /* UNIX script flags. */
|
---|
| 88 |
|
---|
| 89 | /** @cat Options affecting the REXX script executables */
|
---|
| 90 | ULONG fREXXScript; /* REXX script flags. */
|
---|
| 91 |
|
---|
| 92 | /** @cat Options affecting the JAVA executables */
|
---|
| 93 | ULONG fJava; /* Java flags. */
|
---|
| 94 |
|
---|
| 95 | /** @cat Options affecting the executables */
|
---|
| 96 | ULONG fNoLoader; /* No loader stuff. !FIXME! We should import / functions even if this flag is set!!! */
|
---|
| 97 |
|
---|
| 98 | /** @cat Options affecting the heap. */
|
---|
| 99 | ULONG cbSwpHeapMax; /* Maximum heapsize. */
|
---|
| 100 | ULONG cbResHeapMax; /* Maxiumem residentheapsize. */
|
---|
| 101 | } K32OPTIONS, *PK32OPTIONS;
|
---|
| 102 |
|
---|
| 103 |
|
---|
| 104 | /*
|
---|
| 105 | * Status struct.
|
---|
| 106 | *
|
---|
| 107 | */
|
---|
| 108 | typedef struct _K32Status
|
---|
| 109 | {
|
---|
| 110 | ULONG cb;
|
---|
| 111 |
|
---|
| 112 | /** @cat Options status. */
|
---|
| 113 | ULONG fQuiet; /* Quiet initialization. */
|
---|
| 114 |
|
---|
| 115 | /** @cat Kernel status. */
|
---|
| 116 | ULONG fKernel; /* Smp or uni kernel. */
|
---|
| 117 | ULONG ulBuild; /* Kernel build. */
|
---|
| 118 | USHORT usVerMajor; /* OS/2 major ver - 20 */
|
---|
| 119 | USHORT usVerMinor; /* OS/2 minor ver - 30,40 */
|
---|
| 120 |
|
---|
| 121 | /** @cat Heap status. */
|
---|
| 122 | ULONG cbSwpHeapInit; /* Initial heapsize. */
|
---|
| 123 | ULONG cbSwpHeapFree; /* Amount of used space. */
|
---|
| 124 | ULONG cbSwpHeapUsed; /* Amount of free space reserved. */
|
---|
| 125 | ULONG cbSwpHeapSize; /* Amount of memory used by the heap free and used++. */
|
---|
| 126 | ULONG cSwpBlocksUsed; /* Count of used blocks. */
|
---|
| 127 | ULONG cSwpBlocksFree; /* Count of free blocks. */
|
---|
| 128 |
|
---|
| 129 | ULONG cbResHeapInit; /* Initial heapsize. */
|
---|
| 130 | ULONG cbResHeapFree; /* Amount of free space reserved. */
|
---|
| 131 | ULONG cbResHeapUsed; /* Amount of used space. */
|
---|
| 132 | ULONG cbResHeapSize; /* Amount of memory used by the heap free and used++. */
|
---|
| 133 | ULONG cResBlocksUsed; /* Count of used blocks. */
|
---|
| 134 | ULONG cResBlocksFree; /* Count of free blocks. */
|
---|
| 135 |
|
---|
| 136 | /** @cat Win32k build, version and init stuff */
|
---|
| 137 | CHAR szBuildDate[12]; /* Date of the win32k build. (Sep 02 2000) */
|
---|
| 138 | CHAR szBuildTime[9]; /* Time of the win32k build. (11:44:21) */
|
---|
| 139 | ULONG ulVersion; /* Win32k version */
|
---|
| 140 | CHAR szSymFile[CCHMAXPATH]; /* The name of the symbol file or sym database. */
|
---|
| 141 |
|
---|
| 142 | /** @cat Statistics */
|
---|
| 143 | ULONG cPe2LxModules; /* Number of Pe2Lx modules currently loaded. */
|
---|
| 144 | ULONG cElf2LxModules; /* Number of Elf2Lx modules currently loaded. */
|
---|
| 145 | /*...*/
|
---|
| 146 | } K32STATUS, *PK32STATUS;
|
---|
| 147 |
|
---|
| 148 |
|
---|
| 149 |
|
---|
| 150 | /*
|
---|
| 151 | * K32 category parameter structs
|
---|
| 152 | */
|
---|
| 153 | typedef struct _k32AllocMemEx
|
---|
| 154 | {
|
---|
| 155 | PVOID pv; /* Pointer to allocated memory block */
|
---|
| 156 | /* On input this holds the suggested */
|
---|
| 157 | /* location of the block. */
|
---|
| 158 | ULONG cb; /* Blocksize (bytes) */
|
---|
| 159 | ULONG flFlags; /* Flags (equal to DosAllocMem flags) */
|
---|
| 160 | ULONG ulCS; /* Call CS */
|
---|
| 161 | ULONG ulEIP; /* Call EIP */
|
---|
| 162 | ULONG rc; /* Return code. */
|
---|
| 163 | } K32ALLOCMEMEX, *PK32ALLOCMEMEX;
|
---|
| 164 |
|
---|
| 165 | typedef struct _k32QueryOTEs
|
---|
| 166 | {
|
---|
| 167 | HMODULE hMTE; /* Module handle. */
|
---|
| 168 | PQOTEBUFFER pQOte; /* Pointer to output buffer. */
|
---|
| 169 | ULONG cbQOte; /* Size of the buffer pointed to by pQOte */
|
---|
| 170 | ULONG rc; /* Return code. */
|
---|
| 171 | } K32QUERYOTES, *PK32QUERYOTES;
|
---|
| 172 |
|
---|
| 173 | typedef struct _k32QueryOptionsStatus
|
---|
| 174 | {
|
---|
| 175 | PK32OPTIONS pOptions; /* Pointer to option struct. (NULL allowed) */
|
---|
| 176 | PK32STATUS pStatus; /* Pointer to status struct. (NULL allowed) */
|
---|
| 177 | ULONG rc; /* Return code. */
|
---|
| 178 | } K32QUERYOPTIONSSTATUS, *PK32QUERYOPTIONSSTATUS;
|
---|
| 179 |
|
---|
| 180 | typedef struct _k32SetOptions
|
---|
| 181 | {
|
---|
| 182 | PK32OPTIONS pOptions; /* Pointer to option struct. (NULL allowed) */
|
---|
| 183 | ULONG rc; /* Return code. */
|
---|
| 184 | } K32SETOPTIONS, *PK32SETOPTIONS;
|
---|
| 185 |
|
---|
| 186 |
|
---|
| 187 | #pragma pack()
|
---|
| 188 |
|
---|
| 189 | #ifndef NO_WIN32K_LIB_FUNCTIONS
|
---|
| 190 | /*******************************************************************************
|
---|
| 191 | * External Functions *
|
---|
| 192 | *******************************************************************************/
|
---|
| 193 | /* Win32k APIs */
|
---|
| 194 | APIRET APIENTRY libWin32kInit(void);
|
---|
| 195 | APIRET APIENTRY libWin32kTerm(void);
|
---|
| 196 | BOOL APIENTRY libWin32kInstalled(void);
|
---|
| 197 | APIRET APIENTRY libWin32kQueryOptionsStatus(PK32OPTIONS pOptions, PK32STATUS pStatus);
|
---|
| 198 | APIRET APIENTRY libWin32kSetOptions(PK32OPTIONS pOptions);
|
---|
| 199 |
|
---|
| 200 | /* "Extra OS2 APIs" */
|
---|
| 201 | APIRET APIENTRY DosAllocMemEx(PPVOID ppv, ULONG cb, ULONG flag);
|
---|
| 202 | APIRET APIENTRY W32kQueryOTEs(HMODULE hMTE, PQOTEBUFFER pQOte, ULONG cbQOte);
|
---|
| 203 |
|
---|
| 204 | /* Helper function */
|
---|
| 205 | USHORT APIENTRY libHelperGetCS(void);
|
---|
| 206 |
|
---|
| 207 |
|
---|
| 208 | #endif
|
---|
| 209 |
|
---|
| 210 | #endif
|
---|