/* $Id: win32k.h,v 1.13 2001-07-10 05:31:36 bird Exp $ * * Top level make file for the Win32k library. * Contains library and 32-bit IOCtl definition. * * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no) * * Project Odin Software License can be found in LICENSE.TXT * */ /* NOINC */ #ifndef _WIN32K_H_ #define _WIN32K_H_ /* INC */ /******************************************************************************* * Defined Constants And Macros * *******************************************************************************/ /* * IOCtls categories. */ #define IOCTL_W32K_K32 0xC1 #define IOCTL_W32K_ELF 0xC2 /* * K32 category - these are the functions found in the k32 directory. */ #define K32_ALLOCMEMEX 0x01 #define K32_QUERYOTES 0x02 #define K32_QUERYOPTIONSSTATUS 0x03 #define K32_SETOPTIONS 0x04 #define K32_PROCESSREADWRITE 0x05 #define K32_HANDLESYSTEMEVENT 0x06 #define K32_QUERYSYSTEMMEMINFO 0x07 #define K32_QUERYCALLGATE 0x08 #define K32_SETENVIRONMENT 0x09 #define K32_KILLPROCESSEX 0x0a #define K32_LASTIOCTLFUNCTION K32_KILLPROCESSEX /* * Elf category */ #define ELF_DUMMY 0x01 /* * DosAllocMemEx - Extra (bsememf.h) flag definitions. */ #define OBJ_ALIGNDEFAULT 0x00000000UL #define OBJ_ALIGN64K 0x10000000UL #define OBJ_ALIGNPAGE 0x20000000UL #define OBJ_ALIGNMASK 0x30000000UL #define OBJ_LOCATION 0x80000000UL #ifndef OBJ_SELMAPALL #define OBJ_SELMAPALL 0x00000800UL /* This isn't ours. It just a dropout from bsememf.h */ #endif #ifndef OBJ_ANY #define OBJ_ANY 0x00000400UL /* This isn't ours. It just no present in all toolkits. */ #endif /* * System event Identifiers. */ #define K32_SYSEVENT_SM_MOUSE 0x00 /* dh SendEvent - Session Manager (mouse) */ #define K32_SYSEVENT_CTRL_BREAK 0x01 /* dh SendEvent - Ctrl-Break */ #define K32_SYSEVENT_CTRL_C 0x02 /* dh SendEvent - Ctrl-C */ #define K32_SYSEVENT_CTRL_SCREEN_LOCK 0x03 /* dh SendEvent - Ctrl-ScrollLock */ #define K32_SYSEVENT_CTRL_PRINT_SCREEN 0x04 /* dh SendEvent - Ctrl-PrtSc */ #define K32_SYSEVENT_SHIFT_PRINT_SCREEN 0x05 /* dh SendEvent - Shift-PrtSc */ #define K32_SYSEVENT_SM_KEYBOARD 0x06 /* dh SendEvent - Session Manager (keyboard) */ #define K32_SYSEVENT_SM_CTRL_ALT_DELETE 0x07 /* dh SendEvent - Ctrl-Alt-Del */ #define K32_SYSEVENT_HOT_PLUG 0x08 /* dh SendEvent - Keyboard Hot Plug/Reset */ #define K32_SYSEVENT_POWER 0x09 /* dh SendEvent - Power suspend event */ #define K32_SYSEVENT_POWEROFF 0x0a /* dh SendEvent - Power off event */ #define K32_SYSEVENT_CTRL_ALT_2xNUMLOCK 0x0b /* VectorSDF - System Dump */ #define K32_SYSEVENT_LAST K32_SYSEVENT_CTRL_ALT_2xNUMLOCK /* * System Memory Info flags. */ #define K32_SYSMEMINFO_ALL 0 /* Everything is queried. */ #define K32_SYSMEMINFO_SWAPFILE 0x01 /* Swapfile stuff is queried. */ #define K32_SYSMEMINFO_PAGING 0x02 /* Paging and Physical memory stuff is queried. */ #define K32_SYSMEMINFO_VM 0x04 /* Virtual memory stuff is all queried. */ /* * DosKillProcessEx extra flags. * (DKP_PROCESS and DKP_PROCESSTREE is defined in the OS/2 toolkit headers.) */ #define DKP_ALLDECENDANTS 0x00000002UL/* Kill process all its decendants. */ #define DKP_SCREENGROUP 0x00000003UL/* Kill all processes in that screen group. */ #define DKP_ACTION_MASK 0x00000003UL/* Mask for actions (validation) */ #define DKP_FLAG_MASK (DKP_FLAG_KILL9) /* Mask for flags (validation) */ #define DKP_FLAG_KILL9 0x80000000UL/* Very forceful kill */ /* - not necessarily properly cleaned up. */ /* NOINC */ #ifndef INCL_16 /* We don't need this in 16-bit code. */ /* INC */ /******************************************************************************* * Assembly Fixes * *******************************************************************************/ /*ASM BOOL struc dd ? BOOL ends PID struc dd ? PID ends HMODULE struc dd ? HMODULE ends HEV struc dd ? HEV ends PVOID struc dd ? PVOID ends PPVOID struc dd ? PPVOID ends PUSHORT struc dd ? PUSHORT ends PSZ struc dd ? PSZ ends CCHMAXPATH EQU 260 */ /* end of assembly */ /******************************************************************************* * Structures and Typedefs * *******************************************************************************/ #pragma pack(1) /* * Object Table Entry buffer. */ struct _QueryOTE { ULONG ote_size; /* Object virtual size */ ULONG ote_base; /* Object base virtual address */ ULONG ote_flags; /* Attribute flags */ ULONG ote_pagemap; /* Object page map index */ ULONG ote_mapsize; /* Num of entries in obj page map */ /*ULONG ote_reserved;*/ USHORT ote_sel; /* Object Selector */ USHORT ote_hob; /* Object Handle */ }; typedef struct _QueryOTE QOTE; typedef QOTE * PQOTE; typedef struct _QueryOTEBuffer { ULONG cOTEs; /* Number of entries in aOTE. */ QOTE aOTE[1]; /* Array of OTEs. */ } QOTEBUFFER; typedef QOTEBUFFER *PQOTEBUFFER; /* * Options struct. * * (The function of these members are described in options.h in * the src\win32k\include directory.) * All members of this struct (except cb ofcourse) is changable. */ typedef struct _K32Options { ULONG cb; /** @cat logging options */ USHORT usCom; /* Output port no. */ ULONG fLogging; /* Logging. */ /** @cat Options affecting the generated LX executables */ ULONG fPE; /* Flags set the type of conversion. */ ULONG fPEOneObject; /* All in one object. */ ULONG ulInfoLevel; /* Pe2Lx InfoLevel. */ /** @cat Options affecting the generated ELF executables */ ULONG fElf; /* Elf flags. */ /** @cat Options affecting the UNIX script executables */ ULONG fUNIXScript; /* UNIX script flags. */ /** @cat Options affecting the REXX script executables */ ULONG fREXXScript; /* REXX script flags. */ /** @cat Options affecting the JAVA executables */ ULONG fJava; /* Java flags. */ /** @cat Options affecting the executables */ ULONG fNoLoader; /* No loader stuff. !FIXME! We should import / functions even if this flag is set!!! */ /** @cat Options affecting the behaviour changes in the OS/2 loader */ ULONG fDllFixes; /* Enables the long DLL name and non .DLL extention fixes. */ ULONG fExeFixes; /* Enables EXE files to export entry points. */ ULONG fForcePreload; /* Forces the loader to preload executable images. Handy for ICAT Ring-3 debugging. */ ULONG fApiEnh; /* Enables the API enhancements */ /** @cat Options affecting the heap. */ ULONG cbSwpHeapMax; /* Maximum heapsize. */ ULONG cbResHeapMax; /* Maxiumem residentheapsize. */ } K32OPTIONS; typedef K32OPTIONS *PK32OPTIONS; /* * Status struct. * */ typedef struct _K32Status { ULONG cb; /** @cat Options status. */ ULONG fQuiet; /* Quiet initialization. */ /** @cat Kernel status. */ ULONG fKernel; /* Smp or uni kernel. */ ULONG ulBuild; /* Kernel build. */ USHORT usVerMajor; /* OS/2 major ver - 20 */ USHORT usVerMinor; /* OS/2 minor ver - 30,40 */ /** @cat Heap status. */ ULONG cbSwpHeapInit; /* Initial heapsize. */ ULONG cbSwpHeapFree; /* Amount of used space. */ ULONG cbSwpHeapUsed; /* Amount of free space reserved. */ ULONG cbSwpHeapSize; /* Amount of memory used by the heap free and used++. */ ULONG cSwpBlocksUsed; /* Count of used blocks. */ ULONG cSwpBlocksFree; /* Count of free blocks. */ ULONG cbResHeapInit; /* Initial heapsize. */ ULONG cbResHeapFree; /* Amount of free space reserved. */ ULONG cbResHeapUsed; /* Amount of used space. */ ULONG cbResHeapSize; /* Amount of memory used by the heap free and used++. */ ULONG cResBlocksUsed; /* Count of used blocks. */ ULONG cResBlocksFree; /* Count of free blocks. */ /** @cat Win32k build, version and init stuff */ CHAR szBuildDate[12]; /* Date of the win32k build. (Sep 02 2000) */ CHAR szBuildTime[9]; /* Time of the win32k build. (11:44:21) */ ULONG ulVersion; /* Win32k version */ CHAR szSymFile[CCHMAXPATH]; /* The name of the symbol file or sym database. */ /** @cat Statistics */ ULONG cPe2LxModules; /* Number of Pe2Lx modules currently loaded. */ ULONG cElf2LxModules; /* Number of Elf2Lx modules currently loaded. */ /*...*/ } K32STATUS; typedef K32STATUS * PK32STATUS; /* * Memory information struct. */ typedef struct _k32SystemMemInfo { ULONG cb; /* Size of this structure - must be set. */ /* This will be used to distinguish futher versions. */ ULONG flFlags; /* This is used to limit amount of information collected - must be set. (K32_SYSMEMINFO_*) */ /* Some conciderations. * - VM uses worker functions which traverses internal lists. * - Page and physical memory traverses one internal structure (PGPhysAvail()) * - Swap File only accesses variables. */ /* SwapFile Info */ BOOL fSwapFile; /* Swap File: Swapping enabled or disabled. (SMswapping) */ /* (The SwapFile data below is valid when swapping is enbled!) */ ULONG cbSwapFileSize; /* Swap File: Current size. (smFileSize<