From cb4308061a829c28222d74a8a5f6e392d162663f Mon Sep 17 00:00:00 2001 From: Ged Murphy Date: Fri, 17 Feb 2006 23:20:14 +0000 Subject: [PATCH] move crt, ddk and GL includes svn path=/trunk/; revision=21129 --- reactos/include/GL/gl.h | 1472 +++++ reactos/include/GL/glext.h | 4623 ++++++++++++++ reactos/include/GL/glu.h | 278 + reactos/include/crt/excpt.h | 94 + reactos/include/ddk/afilter.h | 189 + reactos/include/ddk/atm.h | 507 ++ reactos/include/ddk/batclass.h | 296 + reactos/include/ddk/cfg.h | 147 + reactos/include/ddk/cfgmgr32.h | 2037 ++++++ reactos/include/ddk/csq.h | 289 + reactos/include/ddk/d3dhal.h | 525 ++ reactos/include/ddk/d3dnthal.h | 209 + reactos/include/ddk/d4drvif.h | 103 + reactos/include/ddk/d4iface.h | 82 + reactos/include/ddk/dciddi.h | 59 + reactos/include/ddk/ddkernel.h | 97 + reactos/include/ddk/ddkmapi.h | 332 + reactos/include/ddk/ddrawi.h | 2187 +++++++ reactos/include/ddk/ddrawint.h | 1461 +++++ reactos/include/ddk/dmemmgr.h | 150 + reactos/include/ddk/dvp.h | 268 + reactos/include/ddk/hidclass.h | 152 + reactos/include/ddk/hidpi.h | 634 ++ reactos/include/ddk/hidusage.h | 210 + reactos/include/ddk/ide.h | 305 + reactos/include/ddk/kbdmou.h | 91 + reactos/include/ddk/mcd.h | 142 + reactos/include/ddk/miniport.h | 75 + reactos/include/ddk/minitape.h | 221 + reactos/include/ddk/mountdev.h | 78 + reactos/include/ddk/mountmgr.h | 137 + reactos/include/ddk/ndis.h | 5437 ++++++++++++++++ reactos/include/ddk/ndisguid.h | 439 ++ reactos/include/ddk/ndistapi.h | 1308 ++++ reactos/include/ddk/ndiswan.h | 251 + reactos/include/ddk/netevent.h | 42 + reactos/include/ddk/netpnp.h | 69 + reactos/include/ddk/newdev.h | 66 + reactos/include/ddk/ntagp.h | 109 + reactos/include/ddk/ntdd8042.h | 212 + reactos/include/ddk/ntddbeep.h | 52 + reactos/include/ddk/ntddcdrm.h | 346 ++ reactos/include/ddk/ntddcdvd.h | 212 + reactos/include/ddk/ntddchgr.h | 352 ++ reactos/include/ddk/ntdddisk.h | 572 ++ reactos/include/ddk/ntddk.h | 83 + reactos/include/ddk/ntddkbd.h | 133 + reactos/include/ddk/ntddmou.h | 113 + reactos/include/ddk/ntddndis.h | 186 + reactos/include/ddk/ntddpar.h | 117 + reactos/include/ddk/ntddpcm.h | 163 + reactos/include/ddk/ntddscsi.h | 175 + reactos/include/ddk/ntddser.h | 447 ++ reactos/include/ddk/ntddstor.h | 331 + reactos/include/ddk/ntddtape.h | 78 + reactos/include/ddk/ntddtdi.h | 59 + reactos/include/ddk/ntddvdeo.h | 437 ++ reactos/include/ddk/ntddvol.h | 139 + reactos/include/ddk/ntifs.h | 4989 +++++++++++++++ reactos/include/ddk/ntnls.h | 52 + reactos/include/ddk/ntpoapi.h | 227 + reactos/include/ddk/ntstatus.h | 1105 ++++ reactos/include/ddk/parallel.h | 276 + reactos/include/ddk/pfhook.h | 74 + reactos/include/ddk/poclass.h | 117 + reactos/include/ddk/prntfont.h | 286 + reactos/include/ddk/scsi.h | 1695 +++++ reactos/include/ddk/scsiscan.h | 128 + reactos/include/ddk/scsiwmi.h | 208 + reactos/include/ddk/smbus.h | 190 + reactos/include/ddk/srb.h | 751 +++ reactos/include/ddk/storport.h | 421 ++ reactos/include/ddk/tdi.h | 592 ++ reactos/include/ddk/tdiinfo.h | 108 + reactos/include/ddk/tdikrnl.h | 1161 ++++ reactos/include/ddk/tdistat.h | 83 + reactos/include/ddk/tvout.h | 114 + reactos/include/ddk/upssvc.h | 92 + reactos/include/ddk/usb.h | 470 ++ reactos/include/ddk/usb100.h | 235 + reactos/include/ddk/usbcamdi.h | 402 ++ reactos/include/ddk/usbdi.h | 406 ++ reactos/include/ddk/usbioctl.h | 352 ++ reactos/include/ddk/usbiodef.h | 104 + reactos/include/ddk/usbscan.h | 156 + reactos/include/ddk/usbuser.h | 327 + reactos/include/ddk/video.h | 1562 +++++ reactos/include/ddk/videoagp.h | 127 + reactos/include/ddk/wdmguid.h | 118 + reactos/include/ddk/win2k.h | 104 + reactos/include/ddk/winddi.h | 4111 ++++++++++++ reactos/include/ddk/winddk.h | 10302 +++++++++++++++++++++++++++++++ reactos/include/ddk/winnt4.h | 619 ++ reactos/include/ddk/winxp.h | 38 + reactos/include/ddk/ws2san.h | 246 + reactos/include/ddk/xfilter.h | 236 + 96 files changed, 61962 insertions(+) create mode 100644 reactos/include/GL/gl.h create mode 100644 reactos/include/GL/glext.h create mode 100644 reactos/include/GL/glu.h create mode 100644 reactos/include/crt/excpt.h create mode 100644 reactos/include/ddk/afilter.h create mode 100644 reactos/include/ddk/atm.h create mode 100644 reactos/include/ddk/batclass.h create mode 100644 reactos/include/ddk/cfg.h create mode 100644 reactos/include/ddk/cfgmgr32.h create mode 100644 reactos/include/ddk/csq.h create mode 100644 reactos/include/ddk/d3dhal.h create mode 100644 reactos/include/ddk/d3dnthal.h create mode 100644 reactos/include/ddk/d4drvif.h create mode 100644 reactos/include/ddk/d4iface.h create mode 100644 reactos/include/ddk/dciddi.h create mode 100644 reactos/include/ddk/ddkernel.h create mode 100644 reactos/include/ddk/ddkmapi.h create mode 100644 reactos/include/ddk/ddrawi.h create mode 100644 reactos/include/ddk/ddrawint.h create mode 100644 reactos/include/ddk/dmemmgr.h create mode 100644 reactos/include/ddk/dvp.h create mode 100644 reactos/include/ddk/hidclass.h create mode 100644 reactos/include/ddk/hidpi.h create mode 100644 reactos/include/ddk/hidusage.h create mode 100644 reactos/include/ddk/ide.h create mode 100644 reactos/include/ddk/kbdmou.h create mode 100644 reactos/include/ddk/mcd.h create mode 100644 reactos/include/ddk/miniport.h create mode 100644 reactos/include/ddk/minitape.h create mode 100644 reactos/include/ddk/mountdev.h create mode 100644 reactos/include/ddk/mountmgr.h create mode 100644 reactos/include/ddk/ndis.h create mode 100644 reactos/include/ddk/ndisguid.h create mode 100644 reactos/include/ddk/ndistapi.h create mode 100644 reactos/include/ddk/ndiswan.h create mode 100644 reactos/include/ddk/netevent.h create mode 100644 reactos/include/ddk/netpnp.h create mode 100644 reactos/include/ddk/newdev.h create mode 100644 reactos/include/ddk/ntagp.h create mode 100644 reactos/include/ddk/ntdd8042.h create mode 100644 reactos/include/ddk/ntddbeep.h create mode 100644 reactos/include/ddk/ntddcdrm.h create mode 100644 reactos/include/ddk/ntddcdvd.h create mode 100644 reactos/include/ddk/ntddchgr.h create mode 100644 reactos/include/ddk/ntdddisk.h create mode 100644 reactos/include/ddk/ntddk.h create mode 100644 reactos/include/ddk/ntddkbd.h create mode 100644 reactos/include/ddk/ntddmou.h create mode 100644 reactos/include/ddk/ntddndis.h create mode 100644 reactos/include/ddk/ntddpar.h create mode 100644 reactos/include/ddk/ntddpcm.h create mode 100644 reactos/include/ddk/ntddscsi.h create mode 100644 reactos/include/ddk/ntddser.h create mode 100644 reactos/include/ddk/ntddstor.h create mode 100644 reactos/include/ddk/ntddtape.h create mode 100644 reactos/include/ddk/ntddtdi.h create mode 100644 reactos/include/ddk/ntddvdeo.h create mode 100644 reactos/include/ddk/ntddvol.h create mode 100644 reactos/include/ddk/ntifs.h create mode 100644 reactos/include/ddk/ntnls.h create mode 100644 reactos/include/ddk/ntpoapi.h create mode 100644 reactos/include/ddk/ntstatus.h create mode 100644 reactos/include/ddk/parallel.h create mode 100644 reactos/include/ddk/pfhook.h create mode 100644 reactos/include/ddk/poclass.h create mode 100644 reactos/include/ddk/prntfont.h create mode 100644 reactos/include/ddk/scsi.h create mode 100644 reactos/include/ddk/scsiscan.h create mode 100644 reactos/include/ddk/scsiwmi.h create mode 100644 reactos/include/ddk/smbus.h create mode 100644 reactos/include/ddk/srb.h create mode 100644 reactos/include/ddk/storport.h create mode 100644 reactos/include/ddk/tdi.h create mode 100644 reactos/include/ddk/tdiinfo.h create mode 100644 reactos/include/ddk/tdikrnl.h create mode 100644 reactos/include/ddk/tdistat.h create mode 100644 reactos/include/ddk/tvout.h create mode 100644 reactos/include/ddk/upssvc.h create mode 100644 reactos/include/ddk/usb.h create mode 100644 reactos/include/ddk/usb100.h create mode 100644 reactos/include/ddk/usbcamdi.h create mode 100644 reactos/include/ddk/usbdi.h create mode 100644 reactos/include/ddk/usbioctl.h create mode 100644 reactos/include/ddk/usbiodef.h create mode 100644 reactos/include/ddk/usbscan.h create mode 100644 reactos/include/ddk/usbuser.h create mode 100644 reactos/include/ddk/video.h create mode 100644 reactos/include/ddk/videoagp.h create mode 100644 reactos/include/ddk/wdmguid.h create mode 100644 reactos/include/ddk/win2k.h create mode 100644 reactos/include/ddk/winddi.h create mode 100644 reactos/include/ddk/winddk.h create mode 100644 reactos/include/ddk/winnt4.h create mode 100644 reactos/include/ddk/winxp.h create mode 100644 reactos/include/ddk/ws2san.h create mode 100644 reactos/include/ddk/xfilter.h diff --git a/reactos/include/GL/gl.h b/reactos/include/GL/gl.h new file mode 100644 index 00000000000..8a1129a0fcf --- /dev/null +++ b/reactos/include/GL/gl.h @@ -0,0 +1,1472 @@ +/* $Id: gl.h 12852 2005-01-06 13:58:04Z mf $ */ + +/* + * Mesa 3-D graphics library + * Version: 4.0 + * + * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +/************************************************************************ + * 2002-Apr-22, José Fonseca: + * Removed non Win32 system-specific stuff + * + * 2002-Apr-17, Marcus Geelnard: + * For win32, OpenGL 1.2 & 1.3 definitions are not made in this file + * anymore, since under Windows those are regarded as extensions, and + * are better defined in glext.h (especially the function prototypes may + * conflict with extension function pointers). A few "cosmetical" + * changes were also made to this file. + * + * 2002-Apr-15, Marcus Geelnard: + * Modified this file to better fit a wider range of compilers, removed + * Mesa specific stuff, and removed extension definitions (this file now + * relies on GL/glext.h). Hopefully this file should now function as a + * generic OpenGL gl.h include file for most compilers and environments. + * Changed GLAPIENTRY to APIENTRY (to be consistent with GL/glext.h). + ************************************************************************/ + + +#ifndef __gl_h_ +#define __gl_h_ + + + +/************************************************************************ + * Begin system-specific stuff. + */ +/* __WIN32__ */ +#if !defined(__WIN32__) && (defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__)) +# define __WIN32__ +#endif + +/* GLAPI, part 1 (use WINGDIAPI, if defined) */ +#if defined(__WIN32__) && defined(WINGDIAPI) +# define GLAPI WINGDIAPI +#endif + +/* GLAPI, part 2 */ +#if !defined(GLAPI) +# if defined(_MSC_VER) /* Microsoft Visual C++ */ +# define GLAPI __declspec(dllimport) +# elif defined(__LCC__) && defined(__WIN32__) /* LCC-Win32 */ +# define GLAPI __stdcall +# else /* Others (e.g. MinGW, Cygwin, non-win32) */ +# define GLAPI extern +# endif +#endif + +/* APIENTRY */ +#if !defined(APIENTRY) +# if defined(__WIN32__) +# define APIENTRY __stdcall +# else +# define APIENTRY +# endif +#endif +/* + * End system-specific stuff. + ************************************************************************/ + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +#define GL_VERSION_1_1 1 + +#if !defined(__WIN32__) +#define GL_VERSION_1_2 1 +#define GL_VERSION_1_3 1 +#define GL_ARB_imaging 1 +#endif + + +/* + * + * Datatypes + * + */ +#ifdef CENTERLINE_CLPP +#define signed +#endif +typedef unsigned int GLenum; +typedef unsigned char GLboolean; +typedef unsigned int GLbitfield; +typedef void GLvoid; +typedef signed char GLbyte; /* 1-byte signed */ +typedef short GLshort; /* 2-byte signed */ +typedef int GLint; /* 4-byte signed */ +typedef unsigned char GLubyte; /* 1-byte unsigned */ +typedef unsigned short GLushort; /* 2-byte unsigned */ +typedef unsigned int GLuint; /* 4-byte unsigned */ +typedef int GLsizei; /* 4-byte signed */ +typedef float GLfloat; /* single precision float */ +typedef float GLclampf; /* single precision float in [0,1] */ +typedef double GLdouble; /* double precision float */ +typedef double GLclampd; /* double precision float in [0,1] */ + + + +/************************************************************************ + * + * Constants + * + ************************************************************************/ + +/* Boolean values */ +#define GL_FALSE 0x0 +#define GL_TRUE 0x1 + +/* Data types */ +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_DOUBLE 0x140A +#define GL_2_BYTES 0x1407 +#define GL_3_BYTES 0x1408 +#define GL_4_BYTES 0x1409 + +/* Primitives */ +#define GL_POINTS 0x0000 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_LINE_STRIP 0x0003 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 +#define GL_QUADS 0x0007 +#define GL_QUAD_STRIP 0x0008 +#define GL_POLYGON 0x0009 + +/* Vertex Arrays */ +#define GL_VERTEX_ARRAY 0x8074 +#define GL_NORMAL_ARRAY 0x8075 +#define GL_COLOR_ARRAY 0x8076 +#define GL_INDEX_ARRAY 0x8077 +#define GL_TEXTURE_COORD_ARRAY 0x8078 +#define GL_EDGE_FLAG_ARRAY 0x8079 +#define GL_VERTEX_ARRAY_SIZE 0x807A +#define GL_VERTEX_ARRAY_TYPE 0x807B +#define GL_VERTEX_ARRAY_STRIDE 0x807C +#define GL_NORMAL_ARRAY_TYPE 0x807E +#define GL_NORMAL_ARRAY_STRIDE 0x807F +#define GL_COLOR_ARRAY_SIZE 0x8081 +#define GL_COLOR_ARRAY_TYPE 0x8082 +#define GL_COLOR_ARRAY_STRIDE 0x8083 +#define GL_INDEX_ARRAY_TYPE 0x8085 +#define GL_INDEX_ARRAY_STRIDE 0x8086 +#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A +#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C +#define GL_VERTEX_ARRAY_POINTER 0x808E +#define GL_NORMAL_ARRAY_POINTER 0x808F +#define GL_COLOR_ARRAY_POINTER 0x8090 +#define GL_INDEX_ARRAY_POINTER 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 +#define GL_V2F 0x2A20 +#define GL_V3F 0x2A21 +#define GL_C4UB_V2F 0x2A22 +#define GL_C4UB_V3F 0x2A23 +#define GL_C3F_V3F 0x2A24 +#define GL_N3F_V3F 0x2A25 +#define GL_C4F_N3F_V3F 0x2A26 +#define GL_T2F_V3F 0x2A27 +#define GL_T4F_V4F 0x2A28 +#define GL_T2F_C4UB_V3F 0x2A29 +#define GL_T2F_C3F_V3F 0x2A2A +#define GL_T2F_N3F_V3F 0x2A2B +#define GL_T2F_C4F_N3F_V3F 0x2A2C +#define GL_T4F_C4F_N3F_V4F 0x2A2D + +/* Matrix Mode */ +#define GL_MATRIX_MODE 0x0BA0 +#define GL_MODELVIEW 0x1700 +#define GL_PROJECTION 0x1701 +#define GL_TEXTURE 0x1702 + +/* Points */ +#define GL_POINT_SMOOTH 0x0B10 +#define GL_POINT_SIZE 0x0B11 +#define GL_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_POINT_SIZE_RANGE 0x0B12 + +/* Lines */ +#define GL_LINE_SMOOTH 0x0B20 +#define GL_LINE_STIPPLE 0x0B24 +#define GL_LINE_STIPPLE_PATTERN 0x0B25 +#define GL_LINE_STIPPLE_REPEAT 0x0B26 +#define GL_LINE_WIDTH 0x0B21 +#define GL_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_LINE_WIDTH_RANGE 0x0B22 + +/* Polygons */ +#define GL_POINT 0x1B00 +#define GL_LINE 0x1B01 +#define GL_FILL 0x1B02 +#define GL_CW 0x0900 +#define GL_CCW 0x0901 +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_POLYGON_MODE 0x0B40 +#define GL_POLYGON_SMOOTH 0x0B41 +#define GL_POLYGON_STIPPLE 0x0B42 +#define GL_EDGE_FLAG 0x0B43 +#define GL_CULL_FACE 0x0B44 +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_POINT 0x2A01 +#define GL_POLYGON_OFFSET_LINE 0x2A02 +#define GL_POLYGON_OFFSET_FILL 0x8037 + +/* Display Lists */ +#define GL_COMPILE 0x1300 +#define GL_COMPILE_AND_EXECUTE 0x1301 +#define GL_LIST_BASE 0x0B32 +#define GL_LIST_INDEX 0x0B33 +#define GL_LIST_MODE 0x0B30 + +/* Depth buffer */ +#define GL_NEVER 0x0200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 +#define GL_DEPTH_TEST 0x0B71 +#define GL_DEPTH_BITS 0x0D56 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_COMPONENT 0x1902 + +/* Lighting */ +#define GL_LIGHTING 0x0B50 +#define GL_LIGHT0 0x4000 +#define GL_LIGHT1 0x4001 +#define GL_LIGHT2 0x4002 +#define GL_LIGHT3 0x4003 +#define GL_LIGHT4 0x4004 +#define GL_LIGHT5 0x4005 +#define GL_LIGHT6 0x4006 +#define GL_LIGHT7 0x4007 +#define GL_SPOT_EXPONENT 0x1205 +#define GL_SPOT_CUTOFF 0x1206 +#define GL_CONSTANT_ATTENUATION 0x1207 +#define GL_LINEAR_ATTENUATION 0x1208 +#define GL_QUADRATIC_ATTENUATION 0x1209 +#define GL_AMBIENT 0x1200 +#define GL_DIFFUSE 0x1201 +#define GL_SPECULAR 0x1202 +#define GL_SHININESS 0x1601 +#define GL_EMISSION 0x1600 +#define GL_POSITION 0x1203 +#define GL_SPOT_DIRECTION 0x1204 +#define GL_AMBIENT_AND_DIFFUSE 0x1602 +#define GL_COLOR_INDEXES 0x1603 +#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 +#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 +#define GL_LIGHT_MODEL_AMBIENT 0x0B53 +#define GL_FRONT_AND_BACK 0x0408 +#define GL_SHADE_MODEL 0x0B54 +#define GL_FLAT 0x1D00 +#define GL_SMOOTH 0x1D01 +#define GL_COLOR_MATERIAL 0x0B57 +#define GL_COLOR_MATERIAL_FACE 0x0B55 +#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 +#define GL_NORMALIZE 0x0BA1 + +/* User clipping planes */ +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 + +/* Accumulation buffer */ +#define GL_ACCUM_RED_BITS 0x0D58 +#define GL_ACCUM_GREEN_BITS 0x0D59 +#define GL_ACCUM_BLUE_BITS 0x0D5A +#define GL_ACCUM_ALPHA_BITS 0x0D5B +#define GL_ACCUM_CLEAR_VALUE 0x0B80 +#define GL_ACCUM 0x0100 +#define GL_ADD 0x0104 +#define GL_LOAD 0x0101 +#define GL_MULT 0x0103 +#define GL_RETURN 0x0102 + +/* Alpha testing */ +#define GL_ALPHA_TEST 0x0BC0 +#define GL_ALPHA_TEST_REF 0x0BC2 +#define GL_ALPHA_TEST_FUNC 0x0BC1 + +/* Blending */ +#define GL_BLEND 0x0BE2 +#define GL_BLEND_SRC 0x0BE1 +#define GL_BLEND_DST 0x0BE0 +#define GL_ZERO 0x0 +#define GL_ONE 0x1 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 + +/* Render Mode */ +#define GL_FEEDBACK 0x1C01 +#define GL_RENDER 0x1C00 +#define GL_SELECT 0x1C02 + +/* Feedback */ +#define GL_2D 0x0600 +#define GL_3D 0x0601 +#define GL_3D_COLOR 0x0602 +#define GL_3D_COLOR_TEXTURE 0x0603 +#define GL_4D_COLOR_TEXTURE 0x0604 +#define GL_POINT_TOKEN 0x0701 +#define GL_LINE_TOKEN 0x0702 +#define GL_LINE_RESET_TOKEN 0x0707 +#define GL_POLYGON_TOKEN 0x0703 +#define GL_BITMAP_TOKEN 0x0704 +#define GL_DRAW_PIXEL_TOKEN 0x0705 +#define GL_COPY_PIXEL_TOKEN 0x0706 +#define GL_PASS_THROUGH_TOKEN 0x0700 +#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 +#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 +#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 + +/* Selection */ +#define GL_SELECTION_BUFFER_POINTER 0x0DF3 +#define GL_SELECTION_BUFFER_SIZE 0x0DF4 + +/* Fog */ +#define GL_FOG 0x0B60 +#define GL_FOG_MODE 0x0B65 +#define GL_FOG_DENSITY 0x0B62 +#define GL_FOG_COLOR 0x0B66 +#define GL_FOG_INDEX 0x0B61 +#define GL_FOG_START 0x0B63 +#define GL_FOG_END 0x0B64 +#define GL_LINEAR 0x2601 +#define GL_EXP 0x0800 +#define GL_EXP2 0x0801 + +/* Logic Ops */ +#define GL_LOGIC_OP 0x0BF1 +#define GL_INDEX_LOGIC_OP 0x0BF1 +#define GL_COLOR_LOGIC_OP 0x0BF2 +#define GL_LOGIC_OP_MODE 0x0BF0 +#define GL_CLEAR 0x1500 +#define GL_SET 0x150F +#define GL_COPY 0x1503 +#define GL_COPY_INVERTED 0x150C +#define GL_NOOP 0x1505 +#define GL_INVERT 0x150A +#define GL_AND 0x1501 +#define GL_NAND 0x150E +#define GL_OR 0x1507 +#define GL_NOR 0x1508 +#define GL_XOR 0x1506 +#define GL_EQUIV 0x1509 +#define GL_AND_REVERSE 0x1502 +#define GL_AND_INVERTED 0x1504 +#define GL_OR_REVERSE 0x150B +#define GL_OR_INVERTED 0x150D + +/* Stencil */ +#define GL_STENCIL_TEST 0x0B90 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_STENCIL_BITS 0x0D57 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_INDEX 0x1901 +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 + +/* Buffers, Pixel Drawing/Reading */ +#define GL_NONE 0x0 +#define GL_LEFT 0x0406 +#define GL_RIGHT 0x0407 +/*GL_FRONT 0x0404 */ +/*GL_BACK 0x0405 */ +/*GL_FRONT_AND_BACK 0x0408 */ +#define GL_FRONT_LEFT 0x0400 +#define GL_FRONT_RIGHT 0x0401 +#define GL_BACK_LEFT 0x0402 +#define GL_BACK_RIGHT 0x0403 +#define GL_AUX0 0x0409 +#define GL_AUX1 0x040A +#define GL_AUX2 0x040B +#define GL_AUX3 0x040C +#define GL_COLOR_INDEX 0x1900 +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A +#define GL_ALPHA_BITS 0x0D55 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_INDEX_BITS 0x0D51 +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_AUX_BUFFERS 0x0C00 +#define GL_READ_BUFFER 0x0C02 +#define GL_DRAW_BUFFER 0x0C01 +#define GL_DOUBLEBUFFER 0x0C32 +#define GL_STEREO 0x0C33 +#define GL_BITMAP 0x1A00 +#define GL_COLOR 0x1800 +#define GL_DEPTH 0x1801 +#define GL_STENCIL 0x1802 +#define GL_DITHER 0x0BD0 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 + +/* Implementation limits */ +#define GL_MAX_LIST_NESTING 0x0B31 +#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 +#define GL_MAX_NAME_STACK_DEPTH 0x0D37 +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 +#define GL_MAX_EVAL_ORDER 0x0D30 +#define GL_MAX_LIGHTS 0x0D31 +#define GL_MAX_CLIP_PLANES 0x0D32 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B + +/* Gets */ +#define GL_ATTRIB_STACK_DEPTH 0x0BB0 +#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_CURRENT_INDEX 0x0B01 +#define GL_CURRENT_COLOR 0x0B00 +#define GL_CURRENT_NORMAL 0x0B02 +#define GL_CURRENT_RASTER_COLOR 0x0B04 +#define GL_CURRENT_RASTER_DISTANCE 0x0B09 +#define GL_CURRENT_RASTER_INDEX 0x0B05 +#define GL_CURRENT_RASTER_POSITION 0x0B07 +#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 +#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 +#define GL_CURRENT_TEXTURE_COORDS 0x0B03 +#define GL_INDEX_CLEAR_VALUE 0x0C20 +#define GL_INDEX_MODE 0x0C30 +#define GL_INDEX_WRITEMASK 0x0C21 +#define GL_MODELVIEW_MATRIX 0x0BA6 +#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 +#define GL_NAME_STACK_DEPTH 0x0D70 +#define GL_PROJECTION_MATRIX 0x0BA7 +#define GL_PROJECTION_STACK_DEPTH 0x0BA4 +#define GL_RENDER_MODE 0x0C40 +#define GL_RGBA_MODE 0x0C31 +#define GL_TEXTURE_MATRIX 0x0BA8 +#define GL_TEXTURE_STACK_DEPTH 0x0BA5 +#define GL_VIEWPORT 0x0BA2 + +/* Evaluators */ +#define GL_AUTO_NORMAL 0x0D80 +#define GL_MAP1_COLOR_4 0x0D90 +#define GL_MAP1_GRID_DOMAIN 0x0DD0 +#define GL_MAP1_GRID_SEGMENTS 0x0DD1 +#define GL_MAP1_INDEX 0x0D91 +#define GL_MAP1_NORMAL 0x0D92 +#define GL_MAP1_TEXTURE_COORD_1 0x0D93 +#define GL_MAP1_TEXTURE_COORD_2 0x0D94 +#define GL_MAP1_TEXTURE_COORD_3 0x0D95 +#define GL_MAP1_TEXTURE_COORD_4 0x0D96 +#define GL_MAP1_VERTEX_3 0x0D97 +#define GL_MAP1_VERTEX_4 0x0D98 +#define GL_MAP2_COLOR_4 0x0DB0 +#define GL_MAP2_GRID_DOMAIN 0x0DD2 +#define GL_MAP2_GRID_SEGMENTS 0x0DD3 +#define GL_MAP2_INDEX 0x0DB1 +#define GL_MAP2_NORMAL 0x0DB2 +#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 +#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 +#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 +#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 +#define GL_MAP2_VERTEX_3 0x0DB7 +#define GL_MAP2_VERTEX_4 0x0DB8 +#define GL_COEFF 0x0A00 +#define GL_DOMAIN 0x0A02 +#define GL_ORDER 0x0A01 + +/* Hints */ +#define GL_FOG_HINT 0x0C54 +#define GL_LINE_SMOOTH_HINT 0x0C52 +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 +#define GL_POINT_SMOOTH_HINT 0x0C51 +#define GL_POLYGON_SMOOTH_HINT 0x0C53 +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 + +/* Scissor box */ +#define GL_SCISSOR_TEST 0x0C11 +#define GL_SCISSOR_BOX 0x0C10 + +/* Pixel Mode / Transfer */ +#define GL_MAP_COLOR 0x0D10 +#define GL_MAP_STENCIL 0x0D11 +#define GL_INDEX_SHIFT 0x0D12 +#define GL_INDEX_OFFSET 0x0D13 +#define GL_RED_SCALE 0x0D14 +#define GL_RED_BIAS 0x0D15 +#define GL_GREEN_SCALE 0x0D18 +#define GL_GREEN_BIAS 0x0D19 +#define GL_BLUE_SCALE 0x0D1A +#define GL_BLUE_BIAS 0x0D1B +#define GL_ALPHA_SCALE 0x0D1C +#define GL_ALPHA_BIAS 0x0D1D +#define GL_DEPTH_SCALE 0x0D1E +#define GL_DEPTH_BIAS 0x0D1F +#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 +#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 +#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 +#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 +#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 +#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 +#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 +#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 +#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 +#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 +#define GL_PIXEL_MAP_S_TO_S 0x0C71 +#define GL_PIXEL_MAP_I_TO_I 0x0C70 +#define GL_PIXEL_MAP_I_TO_R 0x0C72 +#define GL_PIXEL_MAP_I_TO_G 0x0C73 +#define GL_PIXEL_MAP_I_TO_B 0x0C74 +#define GL_PIXEL_MAP_I_TO_A 0x0C75 +#define GL_PIXEL_MAP_R_TO_R 0x0C76 +#define GL_PIXEL_MAP_G_TO_G 0x0C77 +#define GL_PIXEL_MAP_B_TO_B 0x0C78 +#define GL_PIXEL_MAP_A_TO_A 0x0C79 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_PACK_LSB_FIRST 0x0D01 +#define GL_PACK_ROW_LENGTH 0x0D02 +#define GL_PACK_SKIP_PIXELS 0x0D04 +#define GL_PACK_SKIP_ROWS 0x0D03 +#define GL_PACK_SWAP_BYTES 0x0D00 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_UNPACK_LSB_FIRST 0x0CF1 +#define GL_UNPACK_ROW_LENGTH 0x0CF2 +#define GL_UNPACK_SKIP_PIXELS 0x0CF4 +#define GL_UNPACK_SKIP_ROWS 0x0CF3 +#define GL_UNPACK_SWAP_BYTES 0x0CF0 +#define GL_ZOOM_X 0x0D16 +#define GL_ZOOM_Y 0x0D17 + +/* Texture mapping */ +#define GL_TEXTURE_ENV 0x2300 +#define GL_TEXTURE_ENV_MODE 0x2200 +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_ENV_COLOR 0x2201 +#define GL_TEXTURE_GEN_S 0x0C60 +#define GL_TEXTURE_GEN_T 0x0C61 +#define GL_TEXTURE_GEN_MODE 0x2500 +#define GL_TEXTURE_BORDER_COLOR 0x1004 +#define GL_TEXTURE_WIDTH 0x1000 +#define GL_TEXTURE_HEIGHT 0x1001 +#define GL_TEXTURE_BORDER 0x1005 +#define GL_TEXTURE_COMPONENTS 0x1003 +#define GL_TEXTURE_RED_SIZE 0x805C +#define GL_TEXTURE_GREEN_SIZE 0x805D +#define GL_TEXTURE_BLUE_SIZE 0x805E +#define GL_TEXTURE_ALPHA_SIZE 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE 0x8061 +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 +#define GL_OBJECT_LINEAR 0x2401 +#define GL_OBJECT_PLANE 0x2501 +#define GL_EYE_LINEAR 0x2400 +#define GL_EYE_PLANE 0x2502 +#define GL_SPHERE_MAP 0x2402 +#define GL_DECAL 0x2101 +#define GL_MODULATE 0x2100 +#define GL_NEAREST 0x2600 +#define GL_REPEAT 0x2901 +#define GL_CLAMP 0x2900 +#define GL_S 0x2000 +#define GL_T 0x2001 +#define GL_R 0x2002 +#define GL_Q 0x2003 +#define GL_TEXTURE_GEN_R 0x0C62 +#define GL_TEXTURE_GEN_Q 0x0C63 + +/* Utility */ +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 + +/* Errors */ +#define GL_NO_ERROR 0x0 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_OPERATION 0x0502 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_OUT_OF_MEMORY 0x0505 + +/* glPush/PopAttrib bits */ +#define GL_CURRENT_BIT 0x00000001 +#define GL_POINT_BIT 0x00000002 +#define GL_LINE_BIT 0x00000004 +#define GL_POLYGON_BIT 0x00000008 +#define GL_POLYGON_STIPPLE_BIT 0x00000010 +#define GL_PIXEL_MODE_BIT 0x00000020 +#define GL_LIGHTING_BIT 0x00000040 +#define GL_FOG_BIT 0x00000080 +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_ACCUM_BUFFER_BIT 0x00000200 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_VIEWPORT_BIT 0x00000800 +#define GL_TRANSFORM_BIT 0x00001000 +#define GL_ENABLE_BIT 0x00002000 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_HINT_BIT 0x00008000 +#define GL_EVAL_BIT 0x00010000 +#define GL_LIST_BIT 0x00020000 +#define GL_TEXTURE_BIT 0x00040000 +#define GL_SCISSOR_BIT 0x00080000 +#define GL_ALL_ATTRIB_BITS 0x000FFFFF + + +/* OpenGL 1.1 */ +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_TEXTURE_PRIORITY 0x8066 +#define GL_TEXTURE_RESIDENT 0x8067 +#define GL_TEXTURE_BINDING_1D 0x8068 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 +#define GL_ALPHA4 0x803B +#define GL_ALPHA8 0x803C +#define GL_ALPHA12 0x803D +#define GL_ALPHA16 0x803E +#define GL_LUMINANCE4 0x803F +#define GL_LUMINANCE8 0x8040 +#define GL_LUMINANCE12 0x8041 +#define GL_LUMINANCE16 0x8042 +#define GL_LUMINANCE4_ALPHA4 0x8043 +#define GL_LUMINANCE6_ALPHA2 0x8044 +#define GL_LUMINANCE8_ALPHA8 0x8045 +#define GL_LUMINANCE12_ALPHA4 0x8046 +#define GL_LUMINANCE12_ALPHA12 0x8047 +#define GL_LUMINANCE16_ALPHA16 0x8048 +#define GL_INTENSITY 0x8049 +#define GL_INTENSITY4 0x804A +#define GL_INTENSITY8 0x804B +#define GL_INTENSITY12 0x804C +#define GL_INTENSITY16 0x804D +#define GL_R3_G3_B2 0x2A10 +#define GL_RGB4 0x804F +#define GL_RGB5 0x8050 +#define GL_RGB8 0x8051 +#define GL_RGB10 0x8052 +#define GL_RGB12 0x8053 +#define GL_RGB16 0x8054 +#define GL_RGBA2 0x8055 +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGBA8 0x8058 +#define GL_RGB10_A2 0x8059 +#define GL_RGBA12 0x805A +#define GL_RGBA16 0x805B +#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 +#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 +#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF +#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF + + +/* Under Windows, we do not define OpenGL 1.2 & 1.3 functionality, since + it is treated as extensions (defined in glext.h) */ +#if !defined(__WIN32__) + +/* OpenGL 1.2 */ +#define GL_RESCALE_NORMAL 0x803A +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_TEXTURE_BINDING_3D 0x806A + +/* OpenGL 1.2 imaging subset */ +/* GL_EXT_color_table */ +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +/* GL_EXT_convolution and GL_HP_convolution_border_modes */ +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_CONSTANT_BORDER 0x8151 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 +/* GL_SGI_color_matrix */ +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +/* GL_EXT_histogram */ +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +/* GL_EXT_blend_color, GL_EXT_blend_minmax */ +#define GL_BLEND_EQUATION 0x8009 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_FUNC_ADD 0x8006 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_BLEND_COLOR 0x8005 + + +/* OpenGL 1.3 */ +/* multitexture */ +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +/* texture_cube_map */ +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +/* texture_compression */ +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +/* multisample */ +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_MULTISAMPLE_BIT 0x20000000 +/* transpose_matrix */ +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +/* texture_env_combine */ +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_SUBTRACT 0x84E7 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +/* texture_env_dot3 */ +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +/* texture_border_clamp */ +#define GL_CLAMP_TO_BORDER 0x812D + +#endif /* __WIN32__ */ + + + +/************************************************************************ + * + * Function prototypes + * + ************************************************************************/ + +/* Miscellaneous */ +GLAPI void APIENTRY glClearIndex( GLfloat c ); +GLAPI void APIENTRY glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ); +GLAPI void APIENTRY glClear( GLbitfield mask ); +GLAPI void APIENTRY glIndexMask( GLuint mask ); +GLAPI void APIENTRY glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ); +GLAPI void APIENTRY glAlphaFunc( GLenum func, GLclampf ref ); +GLAPI void APIENTRY glBlendFunc( GLenum sfactor, GLenum dfactor ); +GLAPI void APIENTRY glLogicOp( GLenum opcode ); +GLAPI void APIENTRY glCullFace( GLenum mode ); +GLAPI void APIENTRY glFrontFace( GLenum mode ); +GLAPI void APIENTRY glPointSize( GLfloat size ); +GLAPI void APIENTRY glLineWidth( GLfloat width ); +GLAPI void APIENTRY glLineStipple( GLint factor, GLushort pattern ); +GLAPI void APIENTRY glPolygonMode( GLenum face, GLenum mode ); +GLAPI void APIENTRY glPolygonOffset( GLfloat factor, GLfloat units ); +GLAPI void APIENTRY glPolygonStipple( const GLubyte *mask ); +GLAPI void APIENTRY glGetPolygonStipple( GLubyte *mask ); +GLAPI void APIENTRY glEdgeFlag( GLboolean flag ); +GLAPI void APIENTRY glEdgeFlagv( const GLboolean *flag ); +GLAPI void APIENTRY glScissor( GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glClipPlane( GLenum plane, const GLdouble *equation ); +GLAPI void APIENTRY glGetClipPlane( GLenum plane, GLdouble *equation ); +GLAPI void APIENTRY glDrawBuffer( GLenum mode ); +GLAPI void APIENTRY glReadBuffer( GLenum mode ); +GLAPI void APIENTRY glEnable( GLenum cap ); +GLAPI void APIENTRY glDisable( GLenum cap ); +GLAPI GLboolean APIENTRY glIsEnabled( GLenum cap ); +GLAPI void APIENTRY glEnableClientState( GLenum cap ); /* 1.1 */ +GLAPI void APIENTRY glDisableClientState( GLenum cap ); /* 1.1 */ +GLAPI void APIENTRY glGetBooleanv( GLenum pname, GLboolean *params ); +GLAPI void APIENTRY glGetDoublev( GLenum pname, GLdouble *params ); +GLAPI void APIENTRY glGetFloatv( GLenum pname, GLfloat *params ); +GLAPI void APIENTRY glGetIntegerv( GLenum pname, GLint *params ); +GLAPI void APIENTRY glPushAttrib( GLbitfield mask ); +GLAPI void APIENTRY glPopAttrib( void ); +GLAPI void APIENTRY glPushClientAttrib( GLbitfield mask ); /* 1.1 */ +GLAPI void APIENTRY glPopClientAttrib( void ); /* 1.1 */ +GLAPI GLint APIENTRY glRenderMode( GLenum mode ); +GLAPI GLenum APIENTRY glGetError( void ); +GLAPI const GLubyte* APIENTRY glGetString( GLenum name ); +GLAPI void APIENTRY glFinish( void ); +GLAPI void APIENTRY glFlush( void ); +GLAPI void APIENTRY glHint( GLenum target, GLenum mode ); + +/* Depth Buffer */ +GLAPI void APIENTRY glClearDepth( GLclampd depth ); +GLAPI void APIENTRY glDepthFunc( GLenum func ); +GLAPI void APIENTRY glDepthMask( GLboolean flag ); +GLAPI void APIENTRY glDepthRange( GLclampd near_val, GLclampd far_val ); + +/* Accumulation Buffer */ +GLAPI void APIENTRY glClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ); +GLAPI void APIENTRY glAccum( GLenum op, GLfloat value ); + +/* Transformation */ +GLAPI void APIENTRY glMatrixMode( GLenum mode ); +GLAPI void APIENTRY glOrtho( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val ); +GLAPI void APIENTRY glFrustum( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val ); +GLAPI void APIENTRY glViewport( GLint x, GLint y, GLsizei width, GLsizei height ); +GLAPI void APIENTRY glPushMatrix( void ); +GLAPI void APIENTRY glPopMatrix( void ); +GLAPI void APIENTRY glLoadIdentity( void ); +GLAPI void APIENTRY glLoadMatrixd( const GLdouble *m ); +GLAPI void APIENTRY glLoadMatrixf( const GLfloat *m ); +GLAPI void APIENTRY glMultMatrixd( const GLdouble *m ); +GLAPI void APIENTRY glMultMatrixf( const GLfloat *m ); +GLAPI void APIENTRY glRotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z ); +GLAPI void APIENTRY glRotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ); +GLAPI void APIENTRY glScaled( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void APIENTRY glScalef( GLfloat x, GLfloat y, GLfloat z ); +GLAPI void APIENTRY glTranslated( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void APIENTRY glTranslatef( GLfloat x, GLfloat y, GLfloat z ); + +/* Display Lists */ +GLAPI GLboolean APIENTRY glIsList( GLuint list ); +GLAPI void APIENTRY glDeleteLists( GLuint list, GLsizei range ); +GLAPI GLuint APIENTRY glGenLists( GLsizei range ); +GLAPI void APIENTRY glNewList( GLuint list, GLenum mode ); +GLAPI void APIENTRY glEndList( void ); +GLAPI void APIENTRY glCallList( GLuint list ); +GLAPI void APIENTRY glCallLists( GLsizei n, GLenum type, const GLvoid *lists ); +GLAPI void APIENTRY glListBase( GLuint base ); + +/* Drawing Functions */ +GLAPI void APIENTRY glBegin( GLenum mode ); +GLAPI void APIENTRY glEnd( void ); +GLAPI void APIENTRY glVertex2d( GLdouble x, GLdouble y ); +GLAPI void APIENTRY glVertex2f( GLfloat x, GLfloat y ); +GLAPI void APIENTRY glVertex2i( GLint x, GLint y ); +GLAPI void APIENTRY glVertex2s( GLshort x, GLshort y ); +GLAPI void APIENTRY glVertex3d( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void APIENTRY glVertex3f( GLfloat x, GLfloat y, GLfloat z ); +GLAPI void APIENTRY glVertex3i( GLint x, GLint y, GLint z ); +GLAPI void APIENTRY glVertex3s( GLshort x, GLshort y, GLshort z ); +GLAPI void APIENTRY glVertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ); +GLAPI void APIENTRY glVertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); +GLAPI void APIENTRY glVertex4i( GLint x, GLint y, GLint z, GLint w ); +GLAPI void APIENTRY glVertex4s( GLshort x, GLshort y, GLshort z, GLshort w ); +GLAPI void APIENTRY glVertex2dv( const GLdouble *v ); +GLAPI void APIENTRY glVertex2fv( const GLfloat *v ); +GLAPI void APIENTRY glVertex2iv( const GLint *v ); +GLAPI void APIENTRY glVertex2sv( const GLshort *v ); +GLAPI void APIENTRY glVertex3dv( const GLdouble *v ); +GLAPI void APIENTRY glVertex3fv( const GLfloat *v ); +GLAPI void APIENTRY glVertex3iv( const GLint *v ); +GLAPI void APIENTRY glVertex3sv( const GLshort *v ); +GLAPI void APIENTRY glVertex4dv( const GLdouble *v ); +GLAPI void APIENTRY glVertex4fv( const GLfloat *v ); +GLAPI void APIENTRY glVertex4iv( const GLint *v ); +GLAPI void APIENTRY glVertex4sv( const GLshort *v ); +GLAPI void APIENTRY glNormal3b( GLbyte nx, GLbyte ny, GLbyte nz ); +GLAPI void APIENTRY glNormal3d( GLdouble nx, GLdouble ny, GLdouble nz ); +GLAPI void APIENTRY glNormal3f( GLfloat nx, GLfloat ny, GLfloat nz ); +GLAPI void APIENTRY glNormal3i( GLint nx, GLint ny, GLint nz ); +GLAPI void APIENTRY glNormal3s( GLshort nx, GLshort ny, GLshort nz ); +GLAPI void APIENTRY glNormal3bv( const GLbyte *v ); +GLAPI void APIENTRY glNormal3dv( const GLdouble *v ); +GLAPI void APIENTRY glNormal3fv( const GLfloat *v ); +GLAPI void APIENTRY glNormal3iv( const GLint *v ); +GLAPI void APIENTRY glNormal3sv( const GLshort *v ); +GLAPI void APIENTRY glIndexd( GLdouble c ); +GLAPI void APIENTRY glIndexf( GLfloat c ); +GLAPI void APIENTRY glIndexi( GLint c ); +GLAPI void APIENTRY glIndexs( GLshort c ); +GLAPI void APIENTRY glIndexub( GLubyte c ); /* 1.1 */ +GLAPI void APIENTRY glIndexdv( const GLdouble *c ); +GLAPI void APIENTRY glIndexfv( const GLfloat *c ); +GLAPI void APIENTRY glIndexiv( const GLint *c ); +GLAPI void APIENTRY glIndexsv( const GLshort *c ); +GLAPI void APIENTRY glIndexubv( const GLubyte *c ); /* 1.1 */ +GLAPI void APIENTRY glColor3b( GLbyte red, GLbyte green, GLbyte blue ); +GLAPI void APIENTRY glColor3d( GLdouble red, GLdouble green, GLdouble blue ); +GLAPI void APIENTRY glColor3f( GLfloat red, GLfloat green, GLfloat blue ); +GLAPI void APIENTRY glColor3i( GLint red, GLint green, GLint blue ); +GLAPI void APIENTRY glColor3s( GLshort red, GLshort green, GLshort blue ); +GLAPI void APIENTRY glColor3ub( GLubyte red, GLubyte green, GLubyte blue ); +GLAPI void APIENTRY glColor3ui( GLuint red, GLuint green, GLuint blue ); +GLAPI void APIENTRY glColor3us( GLushort red, GLushort green, GLushort blue ); +GLAPI void APIENTRY glColor4b( GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha ); +GLAPI void APIENTRY glColor4d( GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha ); +GLAPI void APIENTRY glColor4f( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ); +GLAPI void APIENTRY glColor4i( GLint red, GLint green, GLint blue, GLint alpha ); +GLAPI void APIENTRY glColor4s( GLshort red, GLshort green, GLshort blue, GLshort alpha ); +GLAPI void APIENTRY glColor4ub( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ); +GLAPI void APIENTRY glColor4ui( GLuint red, GLuint green, GLuint blue, GLuint alpha ); +GLAPI void APIENTRY glColor4us( GLushort red, GLushort green, GLushort blue, GLushort alpha ); +GLAPI void APIENTRY glColor3bv( const GLbyte *v ); +GLAPI void APIENTRY glColor3dv( const GLdouble *v ); +GLAPI void APIENTRY glColor3fv( const GLfloat *v ); +GLAPI void APIENTRY glColor3iv( const GLint *v ); +GLAPI void APIENTRY glColor3sv( const GLshort *v ); +GLAPI void APIENTRY glColor3ubv( const GLubyte *v ); +GLAPI void APIENTRY glColor3uiv( const GLuint *v ); +GLAPI void APIENTRY glColor3usv( const GLushort *v ); +GLAPI void APIENTRY glColor4bv( const GLbyte *v ); +GLAPI void APIENTRY glColor4dv( const GLdouble *v ); +GLAPI void APIENTRY glColor4fv( const GLfloat *v ); +GLAPI void APIENTRY glColor4iv( const GLint *v ); +GLAPI void APIENTRY glColor4sv( const GLshort *v ); +GLAPI void APIENTRY glColor4ubv( const GLubyte *v ); +GLAPI void APIENTRY glColor4uiv( const GLuint *v ); +GLAPI void APIENTRY glColor4usv( const GLushort *v ); +GLAPI void APIENTRY glTexCoord1d( GLdouble s ); +GLAPI void APIENTRY glTexCoord1f( GLfloat s ); +GLAPI void APIENTRY glTexCoord1i( GLint s ); +GLAPI void APIENTRY glTexCoord1s( GLshort s ); +GLAPI void APIENTRY glTexCoord2d( GLdouble s, GLdouble t ); +GLAPI void APIENTRY glTexCoord2f( GLfloat s, GLfloat t ); +GLAPI void APIENTRY glTexCoord2i( GLint s, GLint t ); +GLAPI void APIENTRY glTexCoord2s( GLshort s, GLshort t ); +GLAPI void APIENTRY glTexCoord3d( GLdouble s, GLdouble t, GLdouble r ); +GLAPI void APIENTRY glTexCoord3f( GLfloat s, GLfloat t, GLfloat r ); +GLAPI void APIENTRY glTexCoord3i( GLint s, GLint t, GLint r ); +GLAPI void APIENTRY glTexCoord3s( GLshort s, GLshort t, GLshort r ); +GLAPI void APIENTRY glTexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q ); +GLAPI void APIENTRY glTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q ); +GLAPI void APIENTRY glTexCoord4i( GLint s, GLint t, GLint r, GLint q ); +GLAPI void APIENTRY glTexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q ); +GLAPI void APIENTRY glTexCoord1dv( const GLdouble *v ); +GLAPI void APIENTRY glTexCoord1fv( const GLfloat *v ); +GLAPI void APIENTRY glTexCoord1iv( const GLint *v ); +GLAPI void APIENTRY glTexCoord1sv( const GLshort *v ); +GLAPI void APIENTRY glTexCoord2dv( const GLdouble *v ); +GLAPI void APIENTRY glTexCoord2fv( const GLfloat *v ); +GLAPI void APIENTRY glTexCoord2iv( const GLint *v ); +GLAPI void APIENTRY glTexCoord2sv( const GLshort *v ); +GLAPI void APIENTRY glTexCoord3dv( const GLdouble *v ); +GLAPI void APIENTRY glTexCoord3fv( const GLfloat *v ); +GLAPI void APIENTRY glTexCoord3iv( const GLint *v ); +GLAPI void APIENTRY glTexCoord3sv( const GLshort *v ); +GLAPI void APIENTRY glTexCoord4dv( const GLdouble *v ); +GLAPI void APIENTRY glTexCoord4fv( const GLfloat *v ); +GLAPI void APIENTRY glTexCoord4iv( const GLint *v ); +GLAPI void APIENTRY glTexCoord4sv( const GLshort *v ); +GLAPI void APIENTRY glRasterPos2d( GLdouble x, GLdouble y ); +GLAPI void APIENTRY glRasterPos2f( GLfloat x, GLfloat y ); +GLAPI void APIENTRY glRasterPos2i( GLint x, GLint y ); +GLAPI void APIENTRY glRasterPos2s( GLshort x, GLshort y ); +GLAPI void APIENTRY glRasterPos3d( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void APIENTRY glRasterPos3f( GLfloat x, GLfloat y, GLfloat z ); +GLAPI void APIENTRY glRasterPos3i( GLint x, GLint y, GLint z ); +GLAPI void APIENTRY glRasterPos3s( GLshort x, GLshort y, GLshort z ); +GLAPI void APIENTRY glRasterPos4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ); +GLAPI void APIENTRY glRasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); +GLAPI void APIENTRY glRasterPos4i( GLint x, GLint y, GLint z, GLint w ); +GLAPI void APIENTRY glRasterPos4s( GLshort x, GLshort y, GLshort z, GLshort w ); +GLAPI void APIENTRY glRasterPos2dv( const GLdouble *v ); +GLAPI void APIENTRY glRasterPos2fv( const GLfloat *v ); +GLAPI void APIENTRY glRasterPos2iv( const GLint *v ); +GLAPI void APIENTRY glRasterPos2sv( const GLshort *v ); +GLAPI void APIENTRY glRasterPos3dv( const GLdouble *v ); +GLAPI void APIENTRY glRasterPos3fv( const GLfloat *v ); +GLAPI void APIENTRY glRasterPos3iv( const GLint *v ); +GLAPI void APIENTRY glRasterPos3sv( const GLshort *v ); +GLAPI void APIENTRY glRasterPos4dv( const GLdouble *v ); +GLAPI void APIENTRY glRasterPos4fv( const GLfloat *v ); +GLAPI void APIENTRY glRasterPos4iv( const GLint *v ); +GLAPI void APIENTRY glRasterPos4sv( const GLshort *v ); +GLAPI void APIENTRY glRectd( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 ); +GLAPI void APIENTRY glRectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ); +GLAPI void APIENTRY glRecti( GLint x1, GLint y1, GLint x2, GLint y2 ); +GLAPI void APIENTRY glRects( GLshort x1, GLshort y1, GLshort x2, GLshort y2 ); +GLAPI void APIENTRY glRectdv( const GLdouble *v1, const GLdouble *v2 ); +GLAPI void APIENTRY glRectfv( const GLfloat *v1, const GLfloat *v2 ); +GLAPI void APIENTRY glRectiv( const GLint *v1, const GLint *v2 ); +GLAPI void APIENTRY glRectsv( const GLshort *v1, const GLshort *v2 ); + +/* Lighting */ +GLAPI void APIENTRY glShadeModel( GLenum mode ); +GLAPI void APIENTRY glLightf( GLenum light, GLenum pname, GLfloat param ); +GLAPI void APIENTRY glLighti( GLenum light, GLenum pname, GLint param ); +GLAPI void APIENTRY glLightfv( GLenum light, GLenum pname, const GLfloat *params ); +GLAPI void APIENTRY glLightiv( GLenum light, GLenum pname, const GLint *params ); +GLAPI void APIENTRY glGetLightfv( GLenum light, GLenum pname, GLfloat *params ); +GLAPI void APIENTRY glGetLightiv( GLenum light, GLenum pname, GLint *params ); +GLAPI void APIENTRY glLightModelf( GLenum pname, GLfloat param ); +GLAPI void APIENTRY glLightModeli( GLenum pname, GLint param ); +GLAPI void APIENTRY glLightModelfv( GLenum pname, const GLfloat *params ); +GLAPI void APIENTRY glLightModeliv( GLenum pname, const GLint *params ); +GLAPI void APIENTRY glMaterialf( GLenum face, GLenum pname, GLfloat param ); +GLAPI void APIENTRY glMateriali( GLenum face, GLenum pname, GLint param ); +GLAPI void APIENTRY glMaterialfv( GLenum face, GLenum pname, const GLfloat *params ); +GLAPI void APIENTRY glMaterialiv( GLenum face, GLenum pname, const GLint *params ); +GLAPI void APIENTRY glGetMaterialfv( GLenum face, GLenum pname, GLfloat *params ); +GLAPI void APIENTRY glGetMaterialiv( GLenum face, GLenum pname, GLint *params ); +GLAPI void APIENTRY glColorMaterial( GLenum face, GLenum mode ); + +/* Raster functions */ +GLAPI void APIENTRY glPixelZoom( GLfloat xfactor, GLfloat yfactor ); +GLAPI void APIENTRY glPixelStoref( GLenum pname, GLfloat param ); +GLAPI void APIENTRY glPixelStorei( GLenum pname, GLint param ); +GLAPI void APIENTRY glPixelTransferf( GLenum pname, GLfloat param ); +GLAPI void APIENTRY glPixelTransferi( GLenum pname, GLint param ); +GLAPI void APIENTRY glPixelMapfv( GLenum map, GLint mapsize, const GLfloat *values ); +GLAPI void APIENTRY glPixelMapuiv( GLenum map, GLint mapsize, const GLuint *values ); +GLAPI void APIENTRY glPixelMapusv( GLenum map, GLint mapsize, const GLushort *values ); +GLAPI void APIENTRY glGetPixelMapfv( GLenum map, GLfloat *values ); +GLAPI void APIENTRY glGetPixelMapuiv( GLenum map, GLuint *values ); +GLAPI void APIENTRY glGetPixelMapusv( GLenum map, GLushort *values ); +GLAPI void APIENTRY glBitmap( GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap ); +GLAPI void APIENTRY glReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ); +GLAPI void APIENTRY glDrawPixels( GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ); +GLAPI void APIENTRY glCopyPixels( GLint x, GLint y, GLsizei width, GLsizei height, GLenum type ); + +/* Stenciling */ +GLAPI void APIENTRY glStencilFunc( GLenum func, GLint ref, GLuint mask ); +GLAPI void APIENTRY glStencilMask( GLuint mask ); +GLAPI void APIENTRY glStencilOp( GLenum fail, GLenum zfail, GLenum zpass ); +GLAPI void APIENTRY glClearStencil( GLint s ); + +/* Texture mapping */ +GLAPI void APIENTRY glTexGend( GLenum coord, GLenum pname, GLdouble param ); +GLAPI void APIENTRY glTexGenf( GLenum coord, GLenum pname, GLfloat param ); +GLAPI void APIENTRY glTexGeni( GLenum coord, GLenum pname, GLint param ); +GLAPI void APIENTRY glTexGendv( GLenum coord, GLenum pname, const GLdouble *params ); +GLAPI void APIENTRY glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); +GLAPI void APIENTRY glTexGeniv( GLenum coord, GLenum pname, const GLint *params ); +GLAPI void APIENTRY glGetTexGendv( GLenum coord, GLenum pname, GLdouble *params ); +GLAPI void APIENTRY glGetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ); +GLAPI void APIENTRY glGetTexGeniv( GLenum coord, GLenum pname, GLint *params ); +GLAPI void APIENTRY glTexEnvf( GLenum target, GLenum pname, GLfloat param ); +GLAPI void APIENTRY glTexEnvi( GLenum target, GLenum pname, GLint param ); +GLAPI void APIENTRY glTexEnvfv( GLenum target, GLenum pname, const GLfloat *params ); +GLAPI void APIENTRY glTexEnviv( GLenum target, GLenum pname, const GLint *params ); +GLAPI void APIENTRY glGetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ); +GLAPI void APIENTRY glGetTexEnviv( GLenum target, GLenum pname, GLint *params ); +GLAPI void APIENTRY glTexParameterf( GLenum target, GLenum pname, GLfloat param ); +GLAPI void APIENTRY glTexParameteri( GLenum target, GLenum pname, GLint param ); +GLAPI void APIENTRY glTexParameterfv( GLenum target, GLenum pname, const GLfloat *params ); +GLAPI void APIENTRY glTexParameteriv( GLenum target, GLenum pname, const GLint *params ); +GLAPI void APIENTRY glGetTexParameterfv( GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetTexParameteriv( GLenum target, GLenum pname, GLint *params ); +GLAPI void APIENTRY glGetTexLevelParameterfv( GLenum target, GLint level, GLenum pname, GLfloat *params ); +GLAPI void APIENTRY glGetTexLevelParameteriv( GLenum target, GLint level, GLenum pname, GLint *params ); +GLAPI void APIENTRY glTexImage1D( GLenum target, GLint level, GLint internalFormat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels ); +GLAPI void APIENTRY glTexImage2D( GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ); +GLAPI void APIENTRY glGetTexImage( GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels ); + +/* Evaluators */ +GLAPI void APIENTRY glMap1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points ); +GLAPI void APIENTRY glMap1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points ); +GLAPI void APIENTRY glMap2d( GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points ); +GLAPI void APIENTRY glMap2f( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points ); +GLAPI void APIENTRY glGetMapdv( GLenum target, GLenum query, GLdouble *v ); +GLAPI void APIENTRY glGetMapfv( GLenum target, GLenum query, GLfloat *v ); +GLAPI void APIENTRY glGetMapiv( GLenum target, GLenum query, GLint *v ); +GLAPI void APIENTRY glEvalCoord1d( GLdouble u ); +GLAPI void APIENTRY glEvalCoord1f( GLfloat u ); +GLAPI void APIENTRY glEvalCoord1dv( const GLdouble *u ); +GLAPI void APIENTRY glEvalCoord1fv( const GLfloat *u ); +GLAPI void APIENTRY glEvalCoord2d( GLdouble u, GLdouble v ); +GLAPI void APIENTRY glEvalCoord2f( GLfloat u, GLfloat v ); +GLAPI void APIENTRY glEvalCoord2dv( const GLdouble *u ); +GLAPI void APIENTRY glEvalCoord2fv( const GLfloat *u ); +GLAPI void APIENTRY glMapGrid1d( GLint un, GLdouble u1, GLdouble u2 ); +GLAPI void APIENTRY glMapGrid1f( GLint un, GLfloat u1, GLfloat u2 ); +GLAPI void APIENTRY glMapGrid2d( GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2 ); +GLAPI void APIENTRY glMapGrid2f( GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2 ); +GLAPI void APIENTRY glEvalPoint1( GLint i ); +GLAPI void APIENTRY glEvalPoint2( GLint i, GLint j ); +GLAPI void APIENTRY glEvalMesh1( GLenum mode, GLint i1, GLint i2 ); +GLAPI void APIENTRY glEvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ); + +/* Fog */ +GLAPI void APIENTRY glFogf( GLenum pname, GLfloat param ); +GLAPI void APIENTRY glFogi( GLenum pname, GLint param ); +GLAPI void APIENTRY glFogfv( GLenum pname, const GLfloat *params ); +GLAPI void APIENTRY glFogiv( GLenum pname, const GLint *params ); + +/* Selection and Feedback */ +GLAPI void APIENTRY glFeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ); +GLAPI void APIENTRY glPassThrough( GLfloat token ); +GLAPI void APIENTRY glSelectBuffer( GLsizei size, GLuint *buffer ); +GLAPI void APIENTRY glInitNames( void ); +GLAPI void APIENTRY glLoadName( GLuint name ); +GLAPI void APIENTRY glPushName( GLuint name ); +GLAPI void APIENTRY glPopName( void ); + + +/* 1.1 functions */ +/* texture objects */ +GLAPI void APIENTRY glGenTextures( GLsizei n, GLuint *textures ); +GLAPI void APIENTRY glDeleteTextures( GLsizei n, const GLuint *textures); +GLAPI void APIENTRY glBindTexture( GLenum target, GLuint texture ); +GLAPI void APIENTRY glPrioritizeTextures( GLsizei n, const GLuint *textures, const GLclampf *priorities ); +GLAPI GLboolean APIENTRY glAreTexturesResident( GLsizei n, const GLuint *textures, GLboolean *residences ); +GLAPI GLboolean APIENTRY glIsTexture( GLuint texture ); +/* texture mapping */ +GLAPI void APIENTRY glTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels ); +GLAPI void APIENTRY glTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ); +GLAPI void APIENTRY glCopyTexImage1D( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border ); +GLAPI void APIENTRY glCopyTexImage2D( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ); +GLAPI void APIENTRY glCopyTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width ); +GLAPI void APIENTRY glCopyTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ); +/* vertex arrays */ +GLAPI void APIENTRY glVertexPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *ptr ); +GLAPI void APIENTRY glNormalPointer( GLenum type, GLsizei stride, const GLvoid *ptr ); +GLAPI void APIENTRY glColorPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *ptr ); +GLAPI void APIENTRY glIndexPointer( GLenum type, GLsizei stride, const GLvoid *ptr ); +GLAPI void APIENTRY glTexCoordPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *ptr ); +GLAPI void APIENTRY glEdgeFlagPointer( GLsizei stride, const GLvoid *ptr ); +GLAPI void APIENTRY glGetPointerv( GLenum pname, GLvoid **params ); +GLAPI void APIENTRY glArrayElement( GLint i ); +GLAPI void APIENTRY glDrawArrays( GLenum mode, GLint first, GLsizei count ); +GLAPI void APIENTRY glDrawElements( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ); +GLAPI void APIENTRY glInterleavedArrays( GLenum format, GLsizei stride, const GLvoid *pointer ); + + + +/* Under Windows, we do not define OpenGL 1.2 & 1.3 functionality, since + it is treated as extensions (defined in glext.h) */ +#if !defined(__WIN32__) + +/* 1.2 functions */ +GLAPI void APIENTRY glDrawRangeElements( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices ); +GLAPI void APIENTRY glTexImage3D( GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels ); +GLAPI void APIENTRY glTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glCopyTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ); + +/* 1.2 imaging extension functions */ +GLAPI void APIENTRY glColorTable( GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table ); +GLAPI void APIENTRY glColorSubTable( GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data ); +GLAPI void APIENTRY glColorTableParameteriv(GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glCopyColorSubTable( GLenum target, GLsizei start, GLint x, GLint y, GLsizei width ); +GLAPI void APIENTRY glCopyColorTable( GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width ); +GLAPI void APIENTRY glGetColorTable( GLenum target, GLenum format, GLenum type, GLvoid *table ); +GLAPI void APIENTRY glGetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ); +GLAPI void APIENTRY glGetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ); +GLAPI void APIENTRY glBlendEquation( GLenum mode ); +GLAPI void APIENTRY glBlendColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ); +GLAPI void APIENTRY glHistogram( GLenum target, GLsizei width, GLenum internalformat, GLboolean sink ); +GLAPI void APIENTRY glResetHistogram( GLenum target ); +GLAPI void APIENTRY glGetHistogram( GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values ); +GLAPI void APIENTRY glGetHistogramParameterfv( GLenum target, GLenum pname, GLfloat *params ); +GLAPI void APIENTRY glGetHistogramParameteriv( GLenum target, GLenum pname, GLint *params ); +GLAPI void APIENTRY glMinmax( GLenum target, GLenum internalformat, GLboolean sink ); +GLAPI void APIENTRY glResetMinmax( GLenum target ); +GLAPI void APIENTRY glGetMinmax( GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values ); +GLAPI void APIENTRY glGetMinmaxParameterfv( GLenum target, GLenum pname, GLfloat *params ); +GLAPI void APIENTRY glGetMinmaxParameteriv( GLenum target, GLenum pname, GLint *params ); +GLAPI void APIENTRY glConvolutionFilter1D( GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image ); +GLAPI void APIENTRY glConvolutionFilter2D( GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image ); +GLAPI void APIENTRY glConvolutionParameterf( GLenum target, GLenum pname, GLfloat params ); +GLAPI void APIENTRY glConvolutionParameterfv( GLenum target, GLenum pname, const GLfloat *params ); +GLAPI void APIENTRY glConvolutionParameteri( GLenum target, GLenum pname, GLint params ); +GLAPI void APIENTRY glConvolutionParameteriv( GLenum target, GLenum pname, const GLint *params ); +GLAPI void APIENTRY glCopyConvolutionFilter1D( GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width ); +GLAPI void APIENTRY glCopyConvolutionFilter2D( GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetConvolutionFilter( GLenum target, GLenum format, GLenum type, GLvoid *image ); +GLAPI void APIENTRY glGetConvolutionParameterfv( GLenum target, GLenum pname, GLfloat *params ); +GLAPI void APIENTRY glGetConvolutionParameteriv( GLenum target, GLenum pname, GLint *params ); +GLAPI void APIENTRY glSeparableFilter2D( GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column ); +GLAPI void APIENTRY glGetSeparableFilter( GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span ); + +/* 1.3 functions */ +GLAPI void APIENTRY glActiveTexture( GLenum texture ); +GLAPI void APIENTRY glClientActiveTexture( GLenum texture ); +GLAPI void APIENTRY glCompressedTexImage1D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data ); +GLAPI void APIENTRY glCompressedTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ); +GLAPI void APIENTRY glCompressedTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data ); +GLAPI void APIENTRY glCompressedTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data ); +GLAPI void APIENTRY glCompressedTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ); +GLAPI void APIENTRY glCompressedTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data ); +GLAPI void APIENTRY glGetCompressedTexImage( GLenum target, GLint lod, GLvoid *img ); +GLAPI void APIENTRY glMultiTexCoord1d( GLenum target, GLdouble s ); +GLAPI void APIENTRY glMultiTexCoord1dv( GLenum target, const GLdouble *v ); +GLAPI void APIENTRY glMultiTexCoord1f( GLenum target, GLfloat s ); +GLAPI void APIENTRY glMultiTexCoord1fv( GLenum target, const GLfloat *v ); +GLAPI void APIENTRY glMultiTexCoord1i( GLenum target, GLint s ); +GLAPI void APIENTRY glMultiTexCoord1iv( GLenum target, const GLint *v ); +GLAPI void APIENTRY glMultiTexCoord1s( GLenum target, GLshort s ); +GLAPI void APIENTRY glMultiTexCoord1sv( GLenum target, const GLshort *v ); +GLAPI void APIENTRY glMultiTexCoord2d( GLenum target, GLdouble s, GLdouble t ); +GLAPI void APIENTRY glMultiTexCoord2dv( GLenum target, const GLdouble *v ); +GLAPI void APIENTRY glMultiTexCoord2f( GLenum target, GLfloat s, GLfloat t ); +GLAPI void APIENTRY glMultiTexCoord2fv( GLenum target, const GLfloat *v ); +GLAPI void APIENTRY glMultiTexCoord2i( GLenum target, GLint s, GLint t ); +GLAPI void APIENTRY glMultiTexCoord2iv( GLenum target, const GLint *v ); +GLAPI void APIENTRY glMultiTexCoord2s( GLenum target, GLshort s, GLshort t ); +GLAPI void APIENTRY glMultiTexCoord2sv( GLenum target, const GLshort *v ); +GLAPI void APIENTRY glMultiTexCoord3d( GLenum target, GLdouble s, GLdouble t, GLdouble r ); +GLAPI void APIENTRY glMultiTexCoord3dv( GLenum target, const GLdouble *v ); +GLAPI void APIENTRY glMultiTexCoord3f( GLenum target, GLfloat s, GLfloat t, GLfloat r ); +GLAPI void APIENTRY glMultiTexCoord3fv( GLenum target, const GLfloat *v ); +GLAPI void APIENTRY glMultiTexCoord3i( GLenum target, GLint s, GLint t, GLint r ); +GLAPI void APIENTRY glMultiTexCoord3iv( GLenum target, const GLint *v ); +GLAPI void APIENTRY glMultiTexCoord3s( GLenum target, GLshort s, GLshort t, GLshort r ); +GLAPI void APIENTRY glMultiTexCoord3sv( GLenum target, const GLshort *v ); +GLAPI void APIENTRY glMultiTexCoord4d( GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q ); +GLAPI void APIENTRY glMultiTexCoord4dv( GLenum target, const GLdouble *v ); +GLAPI void APIENTRY glMultiTexCoord4f( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ); +GLAPI void APIENTRY glMultiTexCoord4fv( GLenum target, const GLfloat *v ); +GLAPI void APIENTRY glMultiTexCoord4i( GLenum target, GLint s, GLint t, GLint r, GLint q ); +GLAPI void APIENTRY glMultiTexCoord4iv( GLenum target, const GLint *v ); +GLAPI void APIENTRY glMultiTexCoord4s( GLenum target, GLshort s, GLshort t, GLshort r, GLshort q ); +GLAPI void APIENTRY glMultiTexCoord4sv( GLenum target, const GLshort *v ); +GLAPI void APIENTRY glLoadTransposeMatrixd( const GLdouble m[16] ); +GLAPI void APIENTRY glLoadTransposeMatrixf( const GLfloat m[16] ); +GLAPI void APIENTRY glMultTransposeMatrixd( const GLdouble m[16] ); +GLAPI void APIENTRY glMultTransposeMatrixf( const GLfloat m[16] ); +GLAPI void APIENTRY glSampleCoverage( GLclampf value, GLboolean invert ); +GLAPI void APIENTRY glSamplePass( GLenum pass ); + +#endif /* __WIN32__ */ + + +/* Include external definitions of OpenGL extensions */ +/* Removed, see this bug report for reference: + * http://sourceforge.net/tracker/index.php?func=detail&aid=610178&group_id=2435&atid=102435 + * + * #include + */ + + +/************************************************************************ + * Begin system-specific stuff + */ +/* + * End system-specific stuff + ************************************************************************/ + + +#ifdef __cplusplus +} +#endif + +#endif /* __gl_h_ */ diff --git a/reactos/include/GL/glext.h b/reactos/include/GL/glext.h new file mode 100644 index 00000000000..d6a834b0f34 --- /dev/null +++ b/reactos/include/GL/glext.h @@ -0,0 +1,4623 @@ +#ifndef __glext_h_ +#define __glext_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** License Applicability. Except to the extent portions of this file are +** made subject to an alternative license as permitted in the SGI Free +** Software License B, Version 1.1 (the "License"), the contents of this +** file are subject only to the provisions of the License. You may not use +** this file except in compliance with the License. You may obtain a copy +** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 +** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: +** +** http://oss.sgi.com/projects/FreeB +** +** Note that, as provided in the License, the Software is distributed on an +** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS +** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND +** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A +** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +** +** Original Code. The Original Code is: OpenGL Sample Implementation, +** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, +** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. +** Copyright in any portions created by third parties is as indicated +** elsewhere herein. All Rights Reserved. +** +** Additional Notice Provisions: This software was created using the +** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has +** not been independently verified as being compliant with the OpenGL(R) +** version 1.2.1 Specification. +*/ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) +#define WIN32_LEAN_AND_MEAN 1 +#include +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif +#ifndef GLAPI +#define GLAPI extern +#endif + +/*************************************************************/ + +/* Header file version number, required by OpenGL ABI for Linux */ +/* glext.h last updated 2002/03/22 */ +/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */ +#define GL_GLEXT_VERSION 11 + +#ifndef GL_VERSION_1_2 +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 +#define GL_FUNC_ADD 0x8006 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_BLEND_EQUATION 0x8009 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_RESCALE_NORMAL 0x803A +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_IGNORE_BORDER 0x8150 +#define GL_CONSTANT_BORDER 0x8151 +#define GL_WRAP_BORDER 0x8152 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#endif + +#ifndef GL_VERSION_1_3 +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_MULTISAMPLE_BIT 0x20000000 +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_CLAMP_TO_BORDER 0x812D +#define GL_CLAMP_TO_BORDER_SGIS 0x812D +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_SUBTRACT 0x84E7 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +#endif + +#ifndef GL_ARB_multitexture +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 +#endif + +#ifndef GL_ARB_transpose_matrix +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 +#endif + +#ifndef GL_ARB_multisample +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 +#endif + +#ifndef GL_ARB_texture_env_add +#endif + +#ifndef GL_ARB_texture_cube_map +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C +#endif + +#ifndef GL_ARB_texture_compression +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 +#endif + +#ifndef GL_ARB_texture_border_clamp +#define GL_CLAMP_TO_BORDER_ARB 0x812D +#endif + +#ifndef GL_ARB_point_parameters +#define GL_POINT_SIZE_MIN_ARB 0x8126 +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MIN_SGIS 0x8126 +#define GL_POINT_SIZE_MAX_ARB 0x8127 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_SIZE_MAX_SGIS 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 +#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 +#endif + +#ifndef GL_ARB_vertex_blend +#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 +#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 +#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 +#define GL_VERTEX_BLEND_ARB 0x86A7 +#define GL_CURRENT_WEIGHT_ARB 0x86A8 +#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA +#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB +#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC +#define GL_WEIGHT_ARRAY_ARB 0x86AD +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#define GL_MODELVIEW2_ARB 0x8722 +#define GL_MODELVIEW3_ARB 0x8723 +#define GL_MODELVIEW4_ARB 0x8724 +#define GL_MODELVIEW5_ARB 0x8725 +#define GL_MODELVIEW6_ARB 0x8726 +#define GL_MODELVIEW7_ARB 0x8727 +#define GL_MODELVIEW8_ARB 0x8728 +#define GL_MODELVIEW9_ARB 0x8729 +#define GL_MODELVIEW10_ARB 0x872A +#define GL_MODELVIEW11_ARB 0x872B +#define GL_MODELVIEW12_ARB 0x872C +#define GL_MODELVIEW13_ARB 0x872D +#define GL_MODELVIEW14_ARB 0x872E +#define GL_MODELVIEW15_ARB 0x872F +#define GL_MODELVIEW16_ARB 0x8730 +#define GL_MODELVIEW17_ARB 0x8731 +#define GL_MODELVIEW18_ARB 0x8732 +#define GL_MODELVIEW19_ARB 0x8733 +#define GL_MODELVIEW20_ARB 0x8734 +#define GL_MODELVIEW21_ARB 0x8735 +#define GL_MODELVIEW22_ARB 0x8736 +#define GL_MODELVIEW23_ARB 0x8737 +#define GL_MODELVIEW24_ARB 0x8738 +#define GL_MODELVIEW25_ARB 0x8739 +#define GL_MODELVIEW26_ARB 0x873A +#define GL_MODELVIEW27_ARB 0x873B +#define GL_MODELVIEW28_ARB 0x873C +#define GL_MODELVIEW29_ARB 0x873D +#define GL_MODELVIEW30_ARB 0x873E +#define GL_MODELVIEW31_ARB 0x873F +#endif + +#ifndef GL_ARB_matrix_palette +#define GL_MATRIX_PALETTE_ARB 0x8840 +#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 +#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 +#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 +#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 +#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 +#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 +#endif + +#ifndef GL_ARB_texture_env_combine +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#endif + +#ifndef GL_ARB_texture_env_crossbar +#endif + +#ifndef GL_ARB_texture_env_dot3 +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGB_EXT 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF +#define GL_DOT3_RGBA_EXT 0x86AF +#endif + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_MIRRORED_REPEAT_ARB 0x8370 +#endif + +#ifndef GL_ARB_depth_texture +#define GL_DEPTH_COMPONENT16_ARB 0x81A5 +#define GL_DEPTH_COMPONENT24_ARB 0x81A6 +#define GL_DEPTH_COMPONENT32_ARB 0x81A7 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A +#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B +#endif + +#ifndef GL_ARB_shadow +#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E +#endif + +#ifndef GL_ARB_shadow_ambient +#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF +#endif + +#ifndef GL_ARB_window_pos +#endif + +#ifndef GL_EXT_abgr +#define GL_ABGR_EXT 0x8000 +#endif + +#ifndef GL_EXT_blend_color +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 +#endif + +#ifndef GL_EXT_polygon_offset +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 +#endif + +#ifndef GL_EXT_texture +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 +#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 +#endif + +#ifndef GL_EXT_texture3D +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 +#endif + +#ifndef GL_SGIS_texture_filter4 +#define GL_FILTER4_SGIS 0x8146 +#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 +#endif + +#ifndef GL_EXT_subtexture +#endif + +#ifndef GL_EXT_copy_texture +#endif + +#ifndef GL_EXT_histogram +#define GL_HISTOGRAM_EXT 0x8024 +#define GL_PROXY_HISTOGRAM_EXT 0x8025 +#define GL_HISTOGRAM_WIDTH_EXT 0x8026 +#define GL_HISTOGRAM_FORMAT_EXT 0x8027 +#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C +#define GL_HISTOGRAM_SINK_EXT 0x802D +#define GL_MINMAX_EXT 0x802E +#define GL_MINMAX_FORMAT_EXT 0x802F +#define GL_MINMAX_SINK_EXT 0x8030 +#define GL_TABLE_TOO_LARGE_EXT 0x8031 +#endif + +#ifndef GL_EXT_convolution +#define GL_CONVOLUTION_1D_EXT 0x8010 +#define GL_CONVOLUTION_2D_EXT 0x8011 +#define GL_SEPARABLE_2D_EXT 0x8012 +#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 +#define GL_REDUCE_EXT 0x8016 +#define GL_CONVOLUTION_FORMAT_EXT 0x8017 +#define GL_CONVOLUTION_WIDTH_EXT 0x8018 +#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 +#endif + +#ifndef GL_SGI_color_matrix +#define GL_COLOR_MATRIX_SGI 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB +#endif + +#ifndef GL_SGI_color_table +#define GL_COLOR_TABLE_SGI 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 +#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 +#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 +#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF +#endif + +#ifndef GL_SGIS_pixel_texture +#define GL_PIXEL_TEXTURE_SGIS 0x8353 +#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 +#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 +#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 +#endif + +#ifndef GL_SGIX_pixel_texture +#define GL_PIXEL_TEX_GEN_SGIX 0x8139 +#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B +#endif + +#ifndef GL_SGIS_texture4D +#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 +#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 +#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 +#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 +#define GL_TEXTURE_4D_SGIS 0x8134 +#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 +#define GL_TEXTURE_4DSIZE_SGIS 0x8136 +#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 +#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 +#define GL_TEXTURE_4D_BINDING_SGIS 0x814F +#endif + +#ifndef GL_SGI_texture_color_table +#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD +#endif + +#ifndef GL_EXT_cmyka +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F +#endif + +#ifndef GL_EXT_texture_object +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A +#endif + +#ifndef GL_SGIS_detail_texture +#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 +#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 +#define GL_LINEAR_DETAIL_SGIS 0x8097 +#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 +#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 +#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A +#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B +#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C +#endif + +#ifndef GL_SGIS_sharpen_texture +#define GL_LINEAR_SHARPEN_SGIS 0x80AD +#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE +#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF +#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 +#endif + +#ifndef GL_EXT_packed_pixels +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 +#endif + +#ifndef GL_SGIS_texture_lod +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D +#endif + +#ifndef GL_SGIS_multisample +#define GL_MULTISAMPLE_SGIS 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F +#define GL_SAMPLE_MASK_SGIS 0x80A0 +#define GL_1PASS_SGIS 0x80A1 +#define GL_2PASS_0_SGIS 0x80A2 +#define GL_2PASS_1_SGIS 0x80A3 +#define GL_4PASS_0_SGIS 0x80A4 +#define GL_4PASS_1_SGIS 0x80A5 +#define GL_4PASS_2_SGIS 0x80A6 +#define GL_4PASS_3_SGIS 0x80A7 +#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 +#define GL_SAMPLES_SGIS 0x80A9 +#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA +#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB +#define GL_SAMPLE_PATTERN_SGIS 0x80AC +#endif + +#ifndef GL_EXT_rescale_normal +#define GL_RESCALE_NORMAL_EXT 0x803A +#endif + +#ifndef GL_EXT_vertex_array +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 +#endif + +#ifndef GL_EXT_misc_attribute +#endif + +#ifndef GL_SGIS_generate_mipmap +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 +#endif + +#ifndef GL_SGIX_clipmap +#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 +#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 +#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 +#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 +#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 +#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 +#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 +#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 +#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 +#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D +#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E +#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F +#endif + +#ifndef GL_SGIX_shadow +#define GL_TEXTURE_COMPARE_SGIX 0x819A +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D +#endif + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_CLAMP_TO_EDGE_SGIS 0x812F +#endif + +#ifndef GL_EXT_blend_minmax +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_BLEND_EQUATION_EXT 0x8009 +#endif + +#ifndef GL_EXT_blend_subtract +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B +#endif + +#ifndef GL_EXT_blend_logic_op +#endif + +#ifndef GL_SGIX_interlace +#define GL_INTERLACE_SGIX 0x8094 +#endif + +#ifndef GL_SGIX_pixel_tiles +#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E +#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F +#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 +#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 +#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 +#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 +#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 +#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 +#endif + +#ifndef GL_SGIS_texture_select +#define GL_DUAL_ALPHA4_SGIS 0x8110 +#define GL_DUAL_ALPHA8_SGIS 0x8111 +#define GL_DUAL_ALPHA12_SGIS 0x8112 +#define GL_DUAL_ALPHA16_SGIS 0x8113 +#define GL_DUAL_LUMINANCE4_SGIS 0x8114 +#define GL_DUAL_LUMINANCE8_SGIS 0x8115 +#define GL_DUAL_LUMINANCE12_SGIS 0x8116 +#define GL_DUAL_LUMINANCE16_SGIS 0x8117 +#define GL_DUAL_INTENSITY4_SGIS 0x8118 +#define GL_DUAL_INTENSITY8_SGIS 0x8119 +#define GL_DUAL_INTENSITY12_SGIS 0x811A +#define GL_DUAL_INTENSITY16_SGIS 0x811B +#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C +#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D +#define GL_QUAD_ALPHA4_SGIS 0x811E +#define GL_QUAD_ALPHA8_SGIS 0x811F +#define GL_QUAD_LUMINANCE4_SGIS 0x8120 +#define GL_QUAD_LUMINANCE8_SGIS 0x8121 +#define GL_QUAD_INTENSITY4_SGIS 0x8122 +#define GL_QUAD_INTENSITY8_SGIS 0x8123 +#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 +#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 +#endif + +#ifndef GL_SGIX_sprite +#define GL_SPRITE_SGIX 0x8148 +#define GL_SPRITE_MODE_SGIX 0x8149 +#define GL_SPRITE_AXIS_SGIX 0x814A +#define GL_SPRITE_TRANSLATION_SGIX 0x814B +#define GL_SPRITE_AXIAL_SGIX 0x814C +#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D +#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E +#endif + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E +#endif + +#ifndef GL_SGIX_instruments +#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 +#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 +#endif + +#ifndef GL_SGIX_texture_scale_bias +#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 +#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A +#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B +#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C +#endif + +#ifndef GL_SGIX_framezoom +#define GL_FRAMEZOOM_SGIX 0x818B +#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C +#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D +#endif + +#ifndef GL_SGIX_tag_sample_buffer +#endif + +#ifndef GL_FfdMaskSGIX +#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 +#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 +#endif + +#ifndef GL_SGIX_polynomial_ffd +#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 +#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 +#define GL_DEFORMATIONS_MASK_SGIX 0x8196 +#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 +#endif + +#ifndef GL_SGIX_reference_plane +#define GL_REFERENCE_PLANE_SGIX 0x817D +#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E +#endif + +#ifndef GL_SGIX_flush_raster +#endif + +#ifndef GL_SGIX_depth_texture +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 +#endif + +#ifndef GL_SGIS_fog_function +#define GL_FOG_FUNC_SGIS 0x812A +#define GL_FOG_FUNC_POINTS_SGIS 0x812B +#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C +#endif + +#ifndef GL_SGIX_fog_offset +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 +#endif + +#ifndef GL_HP_image_transform +#define GL_IMAGE_SCALE_X_HP 0x8155 +#define GL_IMAGE_SCALE_Y_HP 0x8156 +#define GL_IMAGE_TRANSLATE_X_HP 0x8157 +#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 +#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 +#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A +#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B +#define GL_IMAGE_MAG_FILTER_HP 0x815C +#define GL_IMAGE_MIN_FILTER_HP 0x815D +#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E +#define GL_CUBIC_HP 0x815F +#define GL_AVERAGE_HP 0x8160 +#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 +#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 +#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 +#endif + +#ifndef GL_HP_convolution_border_modes +#define GL_IGNORE_BORDER_HP 0x8150 +#define GL_CONSTANT_BORDER_HP 0x8151 +#define GL_REPLICATE_BORDER_HP 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 +#endif + +#ifndef GL_INGR_palette_buffer +#endif + +#ifndef GL_SGIX_texture_add_env +#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE +#endif + +#ifndef GL_EXT_color_subtable +#endif + +#ifndef GL_PGI_vertex_hints +#define GL_VERTEX_DATA_HINT_PGI 0x1A22A +#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B +#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C +#define GL_MAX_VERTEX_HINT_PGI 0x1A22D +#define GL_COLOR3_BIT_PGI 0x00010000 +#define GL_COLOR4_BIT_PGI 0x00020000 +#define GL_EDGEFLAG_BIT_PGI 0x00040000 +#define GL_INDEX_BIT_PGI 0x00080000 +#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 +#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 +#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 +#define GL_MAT_EMISSION_BIT_PGI 0x00800000 +#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 +#define GL_MAT_SHININESS_BIT_PGI 0x02000000 +#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 +#define GL_NORMAL_BIT_PGI 0x08000000 +#define GL_TEXCOORD1_BIT_PGI 0x10000000 +#define GL_TEXCOORD2_BIT_PGI 0x20000000 +#define GL_TEXCOORD3_BIT_PGI 0x40000000 +#define GL_TEXCOORD4_BIT_PGI 0x80000000 +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#endif + +#ifndef GL_PGI_misc_hints +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 +#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD +#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 +#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C +#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E +#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F +#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 +#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 +#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 +#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 +#define GL_CLIP_NEAR_HINT_PGI 0x1A220 +#define GL_CLIP_FAR_HINT_PGI 0x1A221 +#define GL_WIDE_LINE_HINT_PGI 0x1A222 +#define GL_BACK_NORMALS_HINT_PGI 0x1A223 +#endif + +#ifndef GL_EXT_paletted_texture +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#endif + +#ifndef GL_EXT_clip_volume_hint +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 +#endif + +#ifndef GL_SGIX_list_priority +#define GL_LIST_PRIORITY_SGIX 0x8182 +#endif + +#ifndef GL_SGIX_ir_instrument1 +#define GL_IR_INSTRUMENT1_SGIX 0x817F +#endif + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 +#endif + +#ifndef GL_SGIX_texture_lod_bias +#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E +#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F +#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 +#endif + +#ifndef GL_SGIX_shadow_ambient +#define GL_SHADOW_AMBIENT_SGIX 0x80BF +#endif + +#ifndef GL_EXT_index_texture +#endif + +#ifndef GL_EXT_index_material +#define GL_INDEX_MATERIAL_EXT 0x81B8 +#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 +#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA +#endif + +#ifndef GL_EXT_index_func +#define GL_INDEX_TEST_EXT 0x81B5 +#define GL_INDEX_TEST_FUNC_EXT 0x81B6 +#define GL_INDEX_TEST_REF_EXT 0x81B7 +#endif + +#ifndef GL_EXT_index_array_formats +#define GL_IUI_V2F_EXT 0x81AD +#define GL_IUI_V3F_EXT 0x81AE +#define GL_IUI_N3F_V2F_EXT 0x81AF +#define GL_IUI_N3F_V3F_EXT 0x81B0 +#define GL_T2F_IUI_V2F_EXT 0x81B1 +#define GL_T2F_IUI_V3F_EXT 0x81B2 +#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 +#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 +#endif + +#ifndef GL_EXT_compiled_vertex_array +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 +#endif + +#ifndef GL_EXT_cull_vertex +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC +#endif + +#ifndef GL_SGIX_ycrcb +#define GL_YCRCB_422_SGIX 0x81BB +#define GL_YCRCB_444_SGIX 0x81BC +#endif + +#ifndef GL_SGIX_fragment_lighting +#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 +#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 +#define GL_LIGHT_ENV_MODE_SGIX 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B +#define GL_FRAGMENT_LIGHT0_SGIX 0x840C +#define GL_FRAGMENT_LIGHT1_SGIX 0x840D +#define GL_FRAGMENT_LIGHT2_SGIX 0x840E +#define GL_FRAGMENT_LIGHT3_SGIX 0x840F +#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 +#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 +#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 +#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 +#endif + +#ifndef GL_IBM_rasterpos_clip +#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 +#endif + +#ifndef GL_HP_texture_lighting +#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 +#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 +#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 +#endif + +#ifndef GL_EXT_draw_range_elements +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 +#endif + +#ifndef GL_WIN_phong_shading +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB +#endif + +#ifndef GL_WIN_specular_fog +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC +#endif + +#ifndef GL_EXT_light_texture +#define GL_FRAGMENT_MATERIAL_EXT 0x8349 +#define GL_FRAGMENT_NORMAL_EXT 0x834A +#define GL_FRAGMENT_COLOR_EXT 0x834C +#define GL_ATTENUATION_EXT 0x834D +#define GL_SHADOW_ATTENUATION_EXT 0x834E +#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F +#define GL_TEXTURE_LIGHT_EXT 0x8350 +#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 +#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 +/* reuse GL_FRAGMENT_DEPTH_EXT */ +#endif + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_ALPHA_MIN_SGIX 0x8320 +#define GL_ALPHA_MAX_SGIX 0x8321 +#endif + +#ifndef GL_SGIX_impact_pixel_texture +#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184 +#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185 +#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186 +#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187 +#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188 +#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189 +#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A +#endif + +#ifndef GL_EXT_bgra +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 +#endif + +#ifndef GL_SGIX_async +#define GL_ASYNC_MARKER_SGIX 0x8329 +#endif + +#ifndef GL_SGIX_async_pixel +#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C +#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D +#define GL_ASYNC_READ_PIXELS_SGIX 0x835E +#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F +#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 +#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 +#endif + +#ifndef GL_SGIX_async_histogram +#define GL_ASYNC_HISTOGRAM_SGIX 0x832C +#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D +#endif + +#ifndef GL_INTEL_texture_scissor +#endif + +#ifndef GL_INTEL_parallel_arrays +#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 +#endif + +#ifndef GL_HP_occlusion_test +#define GL_OCCLUSION_TEST_HP 0x8165 +#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 +#endif + +#ifndef GL_EXT_pixel_transform +#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 +#define GL_PIXEL_MAG_FILTER_EXT 0x8331 +#define GL_PIXEL_MIN_FILTER_EXT 0x8332 +#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 +#define GL_CUBIC_EXT 0x8334 +#define GL_AVERAGE_EXT 0x8335 +#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 +#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 +#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 +#endif + +#ifndef GL_EXT_pixel_transform_color_table +#endif + +#ifndef GL_EXT_shared_texture_palette +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB +#endif + +#ifndef GL_EXT_separate_specular_color +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA +#endif + +#ifndef GL_EXT_secondary_color +#define GL_COLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E +#endif + +#ifndef GL_EXT_texture_perturb_normal +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF +#endif + +#ifndef GL_EXT_multi_draw_arrays +#endif + +#ifndef GL_EXT_fog_coord +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 +#endif + +#ifndef GL_REND_screen_coordinates +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 +#endif + +#ifndef GL_EXT_coordinate_frame +#define GL_TANGENT_ARRAY_EXT 0x8439 +#define GL_BINORMAL_ARRAY_EXT 0x843A +#define GL_CURRENT_TANGENT_EXT 0x843B +#define GL_CURRENT_BINORMAL_EXT 0x843C +#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E +#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F +#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 +#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 +#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 +#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 +#define GL_MAP1_TANGENT_EXT 0x8444 +#define GL_MAP2_TANGENT_EXT 0x8445 +#define GL_MAP1_BINORMAL_EXT 0x8446 +#define GL_MAP2_BINORMAL_EXT 0x8447 +#endif + +#ifndef GL_EXT_texture_env_combine +#define GL_COMBINE_EXT 0x8570 +#define GL_COMBINE_RGB_EXT 0x8571 +#define GL_COMBINE_ALPHA_EXT 0x8572 +#define GL_RGB_SCALE_EXT 0x8573 +#define GL_ADD_SIGNED_EXT 0x8574 +#define GL_INTERPOLATE_EXT 0x8575 +#define GL_CONSTANT_EXT 0x8576 +#define GL_PRIMARY_COLOR_EXT 0x8577 +#define GL_PREVIOUS_EXT 0x8578 +#define GL_SOURCE0_RGB_EXT 0x8580 +#define GL_SOURCE1_RGB_EXT 0x8581 +#define GL_SOURCE2_RGB_EXT 0x8582 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A +#endif + +#ifndef GL_APPLE_specular_vector +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 +#endif + +#ifndef GL_APPLE_transform_hint +#define GL_TRANSFORM_HINT_APPLE 0x85B1 +#endif + +#ifndef GL_SGIX_fog_scale +#define GL_FOG_SCALE_SGIX 0x81FC +#define GL_FOG_SCALE_VALUE_SGIX 0x81FD +#endif + +#ifndef GL_SUNX_constant_data +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 +#endif + +#ifndef GL_SUN_global_alpha +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA +#endif + +#ifndef GL_SUN_triangle_list +#define GL_RESTART_SUN 0x0001 +#define GL_REPLACE_MIDDLE_SUN 0x0002 +#define GL_REPLACE_OLDEST_SUN 0x0003 +#define GL_TRIANGLE_LIST_SUN 0x81D7 +#define GL_REPLACEMENT_CODE_SUN 0x81D8 +#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 +#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 +#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 +#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 +#define GL_R1UI_V3F_SUN 0x85C4 +#define GL_R1UI_C4UB_V3F_SUN 0x85C5 +#define GL_R1UI_C3F_V3F_SUN 0x85C6 +#define GL_R1UI_N3F_V3F_SUN 0x85C7 +#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 +#define GL_R1UI_T2F_V3F_SUN 0x85C9 +#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA +#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB +#endif + +#ifndef GL_SUN_vertex +#endif + +#ifndef GL_EXT_blend_func_separate +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB +#endif + +#ifndef GL_INGR_color_clamp +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 +#endif + +#ifndef GL_INGR_interlace_read +#define GL_INTERLACE_READ_INGR 0x8568 +#endif + +#ifndef GL_EXT_stencil_wrap +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 +#endif + +#ifndef GL_EXT_422_pixels +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF +#endif + +#ifndef GL_NV_texgen_reflection +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 +#endif + +#ifndef GL_EXT_texture_cube_map +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C +#endif + +#ifndef GL_SUN_convolution_border_modes +#define GL_WRAP_BORDER_SUN 0x81D4 +#endif + +#ifndef GL_EXT_texture_env_add +#endif + +#ifndef GL_EXT_texture_lod_bias +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 +#endif + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#endif + +#ifndef GL_EXT_vertex_weighting +#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX +#define GL_MODELVIEW1_MATRIX_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW0_EXT GL_MODELVIEW +#define GL_MODELVIEW1_EXT 0x850A +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F +#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 +#endif + +#ifndef GL_NV_light_max_exponent +#define GL_MAX_SHININESS_NV 0x8504 +#define GL_MAX_SPOT_EXPONENT_NV 0x8505 +#endif + +#ifndef GL_NV_vertex_array_range +#define GL_VERTEX_ARRAY_RANGE_NV 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E +#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 +#endif + +#ifndef GL_NV_register_combiners +#define GL_REGISTER_COMBINERS_NV 0x8522 +#define GL_VARIABLE_A_NV 0x8523 +#define GL_VARIABLE_B_NV 0x8524 +#define GL_VARIABLE_C_NV 0x8525 +#define GL_VARIABLE_D_NV 0x8526 +#define GL_VARIABLE_E_NV 0x8527 +#define GL_VARIABLE_F_NV 0x8528 +#define GL_VARIABLE_G_NV 0x8529 +#define GL_CONSTANT_COLOR0_NV 0x852A +#define GL_CONSTANT_COLOR1_NV 0x852B +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_SPARE0_NV 0x852E +#define GL_SPARE1_NV 0x852F +#define GL_DISCARD_NV 0x8530 +#define GL_E_TIMES_F_NV 0x8531 +#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 +#define GL_UNSIGNED_IDENTITY_NV 0x8536 +#define GL_UNSIGNED_INVERT_NV 0x8537 +#define GL_EXPAND_NORMAL_NV 0x8538 +#define GL_EXPAND_NEGATE_NV 0x8539 +#define GL_HALF_BIAS_NORMAL_NV 0x853A +#define GL_HALF_BIAS_NEGATE_NV 0x853B +#define GL_SIGNED_IDENTITY_NV 0x853C +#define GL_SIGNED_NEGATE_NV 0x853D +#define GL_SCALE_BY_TWO_NV 0x853E +#define GL_SCALE_BY_FOUR_NV 0x853F +#define GL_SCALE_BY_ONE_HALF_NV 0x8540 +#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 +#define GL_COMBINER_INPUT_NV 0x8542 +#define GL_COMBINER_MAPPING_NV 0x8543 +#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 +#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 +#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 +#define GL_COMBINER_MUX_SUM_NV 0x8547 +#define GL_COMBINER_SCALE_NV 0x8548 +#define GL_COMBINER_BIAS_NV 0x8549 +#define GL_COMBINER_AB_OUTPUT_NV 0x854A +#define GL_COMBINER_CD_OUTPUT_NV 0x854B +#define GL_COMBINER_SUM_OUTPUT_NV 0x854C +#define GL_MAX_GENERAL_COMBINERS_NV 0x854D +#define GL_NUM_GENERAL_COMBINERS_NV 0x854E +#define GL_COLOR_SUM_CLAMP_NV 0x854F +#define GL_COMBINER0_NV 0x8550 +#define GL_COMBINER1_NV 0x8551 +#define GL_COMBINER2_NV 0x8552 +#define GL_COMBINER3_NV 0x8553 +#define GL_COMBINER4_NV 0x8554 +#define GL_COMBINER5_NV 0x8555 +#define GL_COMBINER6_NV 0x8556 +#define GL_COMBINER7_NV 0x8557 +/* reuse GL_TEXTURE0_ARB */ +/* reuse GL_TEXTURE1_ARB */ +/* reuse GL_ZERO */ +/* reuse GL_NONE */ +/* reuse GL_FOG */ +#endif + +#ifndef GL_NV_fog_distance +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C +/* reuse GL_EYE_PLANE */ +#endif + +#ifndef GL_NV_texgen_emboss +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E +#define GL_EMBOSS_MAP_NV 0x855F +#endif + +#ifndef GL_NV_blend_square +#endif + +#ifndef GL_NV_texture_env_combine4 +#define GL_COMBINE4_NV 0x8503 +#define GL_SOURCE3_RGB_NV 0x8583 +#define GL_SOURCE3_ALPHA_NV 0x858B +#define GL_OPERAND3_RGB_NV 0x8593 +#define GL_OPERAND3_ALPHA_NV 0x859B +#endif + +#ifndef GL_MESA_resize_buffers +#endif + +#ifndef GL_MESA_window_pos +#endif + +#ifndef GL_EXT_texture_compression_s3tc +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 +#endif + +#ifndef GL_IBM_cull_vertex +#define GL_CULL_VERTEX_IBM 103050 +#endif + +#ifndef GL_IBM_multimode_draw_arrays +#endif + +#ifndef GL_IBM_vertex_array_lists +#define GL_VERTEX_ARRAY_LIST_IBM 103070 +#define GL_NORMAL_ARRAY_LIST_IBM 103071 +#define GL_COLOR_ARRAY_LIST_IBM 103072 +#define GL_INDEX_ARRAY_LIST_IBM 103073 +#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 +#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 +#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 +#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 +#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 +#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 +#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 +#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 +#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 +#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 +#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 +#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 +#endif + +#ifndef GL_SGIX_subsample +#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 +#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 +#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 +#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 +#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 +#endif + +#ifndef GL_SGIX_ycrcb_subsample +#endif + +#ifndef GL_SGIX_ycrcba +#define GL_YCRCB_SGIX 0x8318 +#define GL_YCRCBA_SGIX 0x8319 +#endif + +#ifndef GL_SGI_depth_pass_instrument +#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 +#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 +#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 +#endif + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 +#endif + +#ifndef GL_3DFX_multisample +#define GL_MULTISAMPLE_3DFX 0x86B2 +#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 +#define GL_SAMPLES_3DFX 0x86B4 +#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 +#endif + +#ifndef GL_3DFX_tbuffer +#endif + +#ifndef GL_EXT_multisample +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#define GL_SAMPLE_MASK_EXT 0x80A0 +#define GL_1PASS_EXT 0x80A1 +#define GL_2PASS_0_EXT 0x80A2 +#define GL_2PASS_1_EXT 0x80A3 +#define GL_4PASS_0_EXT 0x80A4 +#define GL_4PASS_1_EXT 0x80A5 +#define GL_4PASS_2_EXT 0x80A6 +#define GL_4PASS_3_EXT 0x80A7 +#define GL_SAMPLE_BUFFERS_EXT 0x80A8 +#define GL_SAMPLES_EXT 0x80A9 +#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA +#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB +#define GL_SAMPLE_PATTERN_EXT 0x80AC +#define GL_MULTISAMPLE_BIT_EXT 0x20000000 +#endif + +#ifndef GL_SGIX_vertex_preclip +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF +#endif + +#ifndef GL_SGIX_convolution_accuracy +#define GL_CONVOLUTION_HINT_SGIX 0x8316 +#endif + +#ifndef GL_SGIX_resample +#define GL_PACK_RESAMPLE_SGIX 0x842C +#define GL_UNPACK_RESAMPLE_SGIX 0x842D +#define GL_RESAMPLE_REPLICATE_SGIX 0x842E +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#endif + +#ifndef GL_SGIS_point_line_texgen +#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 +#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 +#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 +#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 +#define GL_EYE_POINT_SGIS 0x81F4 +#define GL_OBJECT_POINT_SGIS 0x81F5 +#define GL_EYE_LINE_SGIS 0x81F6 +#define GL_OBJECT_LINE_SGIS 0x81F7 +#endif + +#ifndef GL_SGIS_texture_color_mask +#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF +#endif + +#ifndef GL_NV_fence +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 +#endif + +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_MIRRORED_REPEAT_IBM 0x8370 +#endif + +#ifndef GL_NV_evaluators +#define GL_EVAL_2D_NV 0x86C0 +#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 +#define GL_MAP_TESSELLATION_NV 0x86C2 +#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 +#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 +#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 +#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 +#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 +#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 +#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 +#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA +#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB +#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC +#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD +#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE +#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF +#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 +#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 +#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 +#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 +#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 +#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 +#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 +#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 +#endif + +#ifndef GL_NV_packed_depth_stencil +#define GL_DEPTH_STENCIL_NV 0x84F9 +#define GL_UNSIGNED_INT_24_8_NV 0x84FA +#endif + +#ifndef GL_NV_register_combiners2 +#define GL_PER_STAGE_CONSTANTS_NV 0x8535 +#endif + +#ifndef GL_NV_texture_compression_vtc +#endif + +#ifndef GL_NV_texture_rectangle +#define GL_TEXTURE_RECTANGLE_NV 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 +#define GL_MAX_TEXTURE_RECTANGLE_SIZE_NV 0x84F8 +#endif + +#ifndef GL_NV_texture_shader +#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C +#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D +#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E +#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_SHADER_CONSISTENT_NV 0x86DD +#define GL_TEXTURE_SHADER_NV 0x86DE +#define GL_SHADER_OPERATION_NV 0x86DF +#define GL_CULL_MODES_NV 0x86E0 +#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV +#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV +#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV +#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 +#define GL_CONST_EYE_NV 0x86E5 +#define GL_PASS_THROUGH_NV 0x86E6 +#define GL_CULL_FRAGMENT_NV 0x86E7 +#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 +#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 +#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA +#define GL_DOT_PRODUCT_NV 0x86EC +#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED +#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE +#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 +#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 +#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 +#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D +#define GL_HI_SCALE_NV 0x870E +#define GL_LO_SCALE_NV 0x870F +#define GL_DS_SCALE_NV 0x8710 +#define GL_DT_SCALE_NV 0x8711 +#define GL_MAGNITUDE_SCALE_NV 0x8712 +#define GL_VIBRANCE_SCALE_NV 0x8713 +#define GL_HI_BIAS_NV 0x8714 +#define GL_LO_BIAS_NV 0x8715 +#define GL_DS_BIAS_NV 0x8716 +#define GL_DT_BIAS_NV 0x8717 +#define GL_MAGNITUDE_BIAS_NV 0x8718 +#define GL_VIBRANCE_BIAS_NV 0x8719 +#define GL_TEXTURE_BORDER_VALUES_NV 0x871A +#define GL_TEXTURE_HI_SIZE_NV 0x871B +#define GL_TEXTURE_LO_SIZE_NV 0x871C +#define GL_TEXTURE_DS_SIZE_NV 0x871D +#define GL_TEXTURE_DT_SIZE_NV 0x871E +#define GL_TEXTURE_MAG_SIZE_NV 0x871F +#endif + +#ifndef GL_NV_texture_shader2 +#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF +#endif + +#ifndef GL_NV_vertex_array_range2 +#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 +#endif + +#ifndef GL_NV_vertex_program +#define GL_VERTEX_PROGRAM_NV 0x8620 +#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 +#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 +#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 +#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 +#define GL_CURRENT_ATTRIB_NV 0x8626 +#define GL_PROGRAM_LENGTH_NV 0x8627 +#define GL_PROGRAM_STRING_NV 0x8628 +#define GL_MODELVIEW_PROJECTION_NV 0x8629 +#define GL_IDENTITY_NV 0x862A +#define GL_INVERSE_NV 0x862B +#define GL_TRANSPOSE_NV 0x862C +#define GL_INVERSE_TRANSPOSE_NV 0x862D +#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E +#define GL_MAX_TRACK_MATRICES_NV 0x862F +#define GL_MATRIX0_NV 0x8630 +#define GL_MATRIX1_NV 0x8631 +#define GL_MATRIX2_NV 0x8632 +#define GL_MATRIX3_NV 0x8633 +#define GL_MATRIX4_NV 0x8634 +#define GL_MATRIX5_NV 0x8635 +#define GL_MATRIX6_NV 0x8636 +#define GL_MATRIX7_NV 0x8637 +#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 +#define GL_CURRENT_MATRIX_NV 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 +#define GL_PROGRAM_PARAMETER_NV 0x8644 +#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 +#define GL_PROGRAM_TARGET_NV 0x8646 +#define GL_PROGRAM_RESIDENT_NV 0x8647 +#define GL_TRACK_MATRIX_NV 0x8648 +#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 +#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A +#define GL_PROGRAM_ERROR_POSITION_NV 0x864B +#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 +#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 +#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 +#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 +#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 +#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 +#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 +#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 +#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 +#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 +#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A +#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B +#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C +#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D +#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E +#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F +#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 +#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 +#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 +#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 +#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 +#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 +#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 +#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 +#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 +#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 +#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A +#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B +#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C +#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D +#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E +#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F +#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 +#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 +#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 +#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 +#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 +#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 +#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 +#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 +#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 +#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 +#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A +#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B +#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C +#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D +#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E +#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F +#endif + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 +#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A +#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B +#endif + +#ifndef GL_SGIX_scalebias_hint +#define GL_SCALEBIAS_HINT_SGIX 0x8322 +#endif + +#ifndef GL_OML_interlace +#define GL_INTERLACE_OML 0x8980 +#define GL_INTERLACE_READ_OML 0x8981 +#endif + +#ifndef GL_OML_subsample +#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 +#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 +#endif + +#ifndef GL_OML_resample +#define GL_PACK_RESAMPLE_OML 0x8984 +#define GL_UNPACK_RESAMPLE_OML 0x8985 +#define GL_RESAMPLE_REPLICATE_OML 0x8986 +#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 +#define GL_RESAMPLE_AVERAGE_OML 0x8988 +#define GL_RESAMPLE_DECIMATE_OML 0x8989 +#endif + +#ifndef GL_NV_copy_depth_to_color +#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E +#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F +#endif + +#ifndef GL_ATI_envmap_bumpmap +#define GL_BUMP_ROT_MATRIX_ATI 0x8775 +#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 +#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 +#define GL_BUMP_TEX_UNITS_ATI 0x8778 +#define GL_DUDV_ATI 0x8779 +#define GL_DU8DV8_ATI 0x877A +#define GL_BUMP_ENVMAP_ATI 0x877B +#define GL_BUMP_TARGET_ATI 0x877C +#endif + +#ifndef GL_ATI_fragment_shader +#define GL_FRAGMENT_SHADER_ATI 0x8920 +#define GL_REG_0_ATI 0x8921 +#define GL_REG_1_ATI 0x8922 +#define GL_REG_2_ATI 0x8923 +#define GL_REG_3_ATI 0x8924 +#define GL_REG_4_ATI 0x8925 +#define GL_REG_5_ATI 0x8926 +#define GL_REG_6_ATI 0x8927 +#define GL_REG_7_ATI 0x8928 +#define GL_REG_8_ATI 0x8929 +#define GL_REG_9_ATI 0x892A +#define GL_REG_10_ATI 0x892B +#define GL_REG_11_ATI 0x892C +#define GL_REG_12_ATI 0x892D +#define GL_REG_13_ATI 0x892E +#define GL_REG_14_ATI 0x892F +#define GL_REG_15_ATI 0x8930 +#define GL_REG_16_ATI 0x8931 +#define GL_REG_17_ATI 0x8932 +#define GL_REG_18_ATI 0x8933 +#define GL_REG_19_ATI 0x8934 +#define GL_REG_20_ATI 0x8935 +#define GL_REG_21_ATI 0x8936 +#define GL_REG_22_ATI 0x8937 +#define GL_REG_23_ATI 0x8938 +#define GL_REG_24_ATI 0x8939 +#define GL_REG_25_ATI 0x893A +#define GL_REG_26_ATI 0x893B +#define GL_REG_27_ATI 0x893C +#define GL_REG_28_ATI 0x893D +#define GL_REG_29_ATI 0x893E +#define GL_REG_30_ATI 0x893F +#define GL_REG_31_ATI 0x8940 +#define GL_CON_0_ATI 0x8941 +#define GL_CON_1_ATI 0x8942 +#define GL_CON_2_ATI 0x8943 +#define GL_CON_3_ATI 0x8944 +#define GL_CON_4_ATI 0x8945 +#define GL_CON_5_ATI 0x8946 +#define GL_CON_6_ATI 0x8947 +#define GL_CON_7_ATI 0x8948 +#define GL_CON_8_ATI 0x8949 +#define GL_CON_9_ATI 0x894A +#define GL_CON_10_ATI 0x894B +#define GL_CON_11_ATI 0x894C +#define GL_CON_12_ATI 0x894D +#define GL_CON_13_ATI 0x894E +#define GL_CON_14_ATI 0x894F +#define GL_CON_15_ATI 0x8950 +#define GL_CON_16_ATI 0x8951 +#define GL_CON_17_ATI 0x8952 +#define GL_CON_18_ATI 0x8953 +#define GL_CON_19_ATI 0x8954 +#define GL_CON_20_ATI 0x8955 +#define GL_CON_21_ATI 0x8956 +#define GL_CON_22_ATI 0x8957 +#define GL_CON_23_ATI 0x8958 +#define GL_CON_24_ATI 0x8959 +#define GL_CON_25_ATI 0x895A +#define GL_CON_26_ATI 0x895B +#define GL_CON_27_ATI 0x895C +#define GL_CON_28_ATI 0x895D +#define GL_CON_29_ATI 0x895E +#define GL_CON_30_ATI 0x895F +#define GL_CON_31_ATI 0x8960 +#define GL_MOV_ATI 0x8961 +#define GL_ADD_ATI 0x8963 +#define GL_MUL_ATI 0x8964 +#define GL_SUB_ATI 0x8965 +#define GL_DOT3_ATI 0x8966 +#define GL_DOT4_ATI 0x8967 +#define GL_MAD_ATI 0x8968 +#define GL_LERP_ATI 0x8969 +#define GL_CND_ATI 0x896A +#define GL_CND0_ATI 0x896B +#define GL_DOT2_ADD_ATI 0x896C +#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D +#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E +#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F +#define GL_NUM_PASSES_ATI 0x8970 +#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 +#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 +#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 +#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 +#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 +#define GL_SWIZZLE_STR_ATI 0x8976 +#define GL_SWIZZLE_STQ_ATI 0x8977 +#define GL_SWIZZLE_STR_DR_ATI 0x8978 +#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 +#define GL_SWIZZLE_STRQ_ATI 0x897A +#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B +#define GL_RED_BIT_ATI 0x00000001 +#define GL_GREEN_BIT_ATI 0x00000002 +#define GL_BLUE_BIT_ATI 0x00000004 +#define GL_2X_BIT_ATI 0x00000001 +#define GL_4X_BIT_ATI 0x00000002 +#define GL_8X_BIT_ATI 0x00000004 +#define GL_HALF_BIT_ATI 0x00000008 +#define GL_QUARTER_BIT_ATI 0x00000010 +#define GL_EIGHTH_BIT_ATI 0x00000020 +#define GL_SATURATE_BIT_ATI 0x00000040 +#define GL_COMP_BIT_ATI 0x00000002 +#define GL_NEGATE_BIT_ATI 0x00000004 +#define GL_BIAS_BIT_ATI 0x00000008 +#endif + +#ifndef GL_ATI_pn_triangles +#define GL_PN_TRIANGLES_ATI 0x87F0 +#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 +#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 +#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 +#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 +#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 +#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 +#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 +#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 +#endif + +#ifndef GL_ATI_vertex_array_object +#define GL_STATIC_ATI 0x8760 +#define GL_DYNAMIC_ATI 0x8761 +#define GL_PRESERVE_ATI 0x8762 +#define GL_DISCARD_ATI 0x8763 +#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 +#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 +#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 +#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 +#endif + +#ifndef GL_EXT_vertex_shader +#define GL_VERTEX_SHADER_EXT 0x8780 +#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 +#define GL_OP_INDEX_EXT 0x8782 +#define GL_OP_NEGATE_EXT 0x8783 +#define GL_OP_DOT3_EXT 0x8784 +#define GL_OP_DOT4_EXT 0x8785 +#define GL_OP_MUL_EXT 0x8786 +#define GL_OP_ADD_EXT 0x8787 +#define GL_OP_MADD_EXT 0x8788 +#define GL_OP_FRAC_EXT 0x8789 +#define GL_OP_MAX_EXT 0x878A +#define GL_OP_MIN_EXT 0x878B +#define GL_OP_SET_GE_EXT 0x878C +#define GL_OP_SET_LT_EXT 0x878D +#define GL_OP_CLAMP_EXT 0x878E +#define GL_OP_FLOOR_EXT 0x878F +#define GL_OP_ROUND_EXT 0x8790 +#define GL_OP_EXP_BASE_2_EXT 0x8791 +#define GL_OP_LOG_BASE_2_EXT 0x8792 +#define GL_OP_POWER_EXT 0x8793 +#define GL_OP_RECIP_EXT 0x8794 +#define GL_OP_RECIP_SQRT_EXT 0x8795 +#define GL_OP_SUB_EXT 0x8796 +#define GL_OP_CROSS_PRODUCT_EXT 0x8797 +#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 +#define GL_OP_MOV_EXT 0x8799 +#define GL_OUTPUT_VERTEX_EXT 0x879A +#define GL_OUTPUT_COLOR0_EXT 0x879B +#define GL_OUTPUT_COLOR1_EXT 0x879C +#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D +#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E +#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F +#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 +#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 +#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 +#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 +#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 +#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 +#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 +#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 +#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 +#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 +#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA +#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB +#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC +#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD +#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE +#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF +#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 +#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 +#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 +#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 +#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 +#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 +#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 +#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 +#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 +#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 +#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA +#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB +#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC +#define GL_OUTPUT_FOG_EXT 0x87BD +#define GL_SCALAR_EXT 0x87BE +#define GL_VECTOR_EXT 0x87BF +#define GL_MATRIX_EXT 0x87C0 +#define GL_VARIANT_EXT 0x87C1 +#define GL_INVARIANT_EXT 0x87C2 +#define GL_LOCAL_CONSTANT_EXT 0x87C3 +#define GL_LOCAL_EXT 0x87C4 +#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 +#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 +#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 +#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 +#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INARIANTS_EXT 0x87CD +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE +#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF +#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 +#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 +#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 +#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 +#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 +#define GL_X_EXT 0x87D5 +#define GL_Y_EXT 0x87D6 +#define GL_Z_EXT 0x87D7 +#define GL_W_EXT 0x87D8 +#define GL_NEGATIVE_X_EXT 0x87D9 +#define GL_NEGATIVE_Y_EXT 0x87DA +#define GL_NEGATIVE_Z_EXT 0x87DB +#define GL_NEGATIVE_W_EXT 0x87DC +#define GL_ZERO_EXT 0x87DD +#define GL_ONE_EXT 0x87DE +#define GL_NEGATIVE_ONE_EXT 0x87DF +#define GL_NORMALIZED_RANGE_EXT 0x87E0 +#define GL_FULL_RANGE_EXT 0x87E1 +#define GL_CURRENT_VERTEX_EXT 0x87E2 +#define GL_MVP_MATRIX_EXT 0x87E3 +#define GL_VARIANT_VALUE_EXT 0x87E4 +#define GL_VARIANT_DATATYPE_EXT 0x87E5 +#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 +#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 +#define GL_VARIANT_ARRAY_EXT 0x87E8 +#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 +#define GL_INVARIANT_VALUE_EXT 0x87EA +#define GL_INVARIANT_DATATYPE_EXT 0x87EB +#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC +#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED +#endif + +#ifndef GL_ATI_vertex_streams +#define GL_MAX_VERTEX_STREAMS_ATI 0x876B +#define GL_VERTEX_STREAM0_ATI 0x876C +#define GL_VERTEX_STREAM1_ATI 0x876D +#define GL_VERTEX_STREAM2_ATI 0x876E +#define GL_VERTEX_STREAM3_ATI 0x876F +#define GL_VERTEX_STREAM4_ATI 0x8770 +#define GL_VERTEX_STREAM5_ATI 0x8771 +#define GL_VERTEX_STREAM6_ATI 0x8772 +#define GL_VERTEX_STREAM7_ATI 0x8773 +#define GL_VERTEX_SOURCE_ATI 0x8774 +#endif + +#ifndef GL_ATI_element_array +#define GL_ELEMENT_ARRAY_ATI 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A +#endif + +#ifndef GL_SUN_mesh_array +#define GL_QUAD_MESH_SUN 0x8614 +#define GL_TRIANGLE_MESH_SUN 0x8615 +#endif + +#ifndef GL_SUN_slice_accum +#define GL_SLICE_ACCUM_SUN 0x85CC +#endif + +#ifndef GL_NV_multisample_filter_hint +#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 +#endif + +#ifndef GL_NV_depth_clamp +#define GL_DEPTH_CLAMP_NV 0x864F +#endif + +#ifndef GL_NV_occlusion_query +#define GL_PIXEL_COUNTER_BITS_NV 0x8864 +#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 +#define GL_PIXEL_COUNT_NV 0x8866 +#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 +#endif + +#ifndef GL_NV_point_sprite +#define GL_POINT_SPRITE_NV 0x8861 +#define GL_COORD_REPLACE_NV 0x8862 +#define GL_POINT_SPRITE_R_MODE_NV 0x8863 +#endif + +#ifndef GL_NV_texture_shader3 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 +#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 +#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 +#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 +#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 +#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A +#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B +#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C +#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D +#define GL_HILO8_NV 0x885E +#define GL_SIGNED_HILO8_NV 0x885F +#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 +#endif + +#ifndef GL_NV_vertex_program1_1 +#endif + + +/*************************************************************/ + +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf); +GLAPI void APIENTRY glBlendEquation (GLenum); +GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); +GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei); +GLAPI void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint); +GLAPI void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); +GLAPI void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); +GLAPI void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean); +GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean); +GLAPI void APIENTRY glResetHistogram (GLenum); +GLAPI void APIENTRY glResetMinmax (GLenum); +GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (APIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (APIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +typedef void (APIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (APIENTRY * PFNGLRESETMINMAXPROC) (GLenum target); +typedef void (APIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif + +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveTexture (GLenum); +GLAPI void APIENTRY glClientActiveTexture (GLenum); +GLAPI void APIENTRY glMultiTexCoord1d (GLenum, GLdouble); +GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord1f (GLenum, GLfloat); +GLAPI void APIENTRY glMultiTexCoord1fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord1i (GLenum, GLint); +GLAPI void APIENTRY glMultiTexCoord1iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord1s (GLenum, GLshort); +GLAPI void APIENTRY glMultiTexCoord1sv (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord2d (GLenum, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord2dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord2f (GLenum, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord2fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord2i (GLenum, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord2iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord2s (GLenum, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord2sv (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord3d (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord3dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord3f (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord3fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord3i (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord3iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord3s (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord3sv (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord4dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord4fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord4i (GLenum, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord4iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord4s (GLenum, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord4sv (GLenum, const GLshort *); +GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *); +GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *); +GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *); +GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *); +GLAPI void APIENTRY glSampleCoverage (GLclampf, GLboolean); +GLAPI void APIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, void *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRY * PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, void *img); +#endif + +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveTextureARB (GLenum); +GLAPI void APIENTRY glClientActiveTextureARB (GLenum); +GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble); +GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat); +GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum, GLint); +GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort); +GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); +#endif + +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *); +GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *); +GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *); +GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +#endif + +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); +#endif + +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 +#endif + +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 +#endif + +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, void *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, void *img); +#endif + +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 +#endif + +#ifndef GL_ARB_point_parameters +#define GL_ARB_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_ARB_vertex_blend +#define GL_ARB_vertex_blend 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWeightbvARB (GLint, const GLbyte *); +GLAPI void APIENTRY glWeightsvARB (GLint, const GLshort *); +GLAPI void APIENTRY glWeightivARB (GLint, const GLint *); +GLAPI void APIENTRY glWeightfvARB (GLint, const GLfloat *); +GLAPI void APIENTRY glWeightdvARB (GLint, const GLdouble *); +GLAPI void APIENTRY glWeightubvARB (GLint, const GLubyte *); +GLAPI void APIENTRY glWeightusvARB (GLint, const GLushort *); +GLAPI void APIENTRY glWeightuivARB (GLint, const GLuint *); +GLAPI void APIENTRY glWeightPointerARB (GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexBlendARB (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights); +typedef void (APIENTRY * PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights); +typedef void (APIENTRY * PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights); +typedef void (APIENTRY * PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights); +typedef void (APIENTRY * PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights); +typedef void (APIENTRY * PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights); +typedef void (APIENTRY * PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights); +typedef void (APIENTRY * PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights); +typedef void (APIENTRY * PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLVERTEXBLENDARBPROC) (GLint count); +#endif + +#ifndef GL_ARB_matrix_palette +#define GL_ARB_matrix_palette 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint); +GLAPI void APIENTRY glMatrixIndexubvARB (GLint, const GLubyte *); +GLAPI void APIENTRY glMatrixIndexusvARB (GLint, const GLushort *); +GLAPI void APIENTRY glMatrixIndexuivARB (GLint, const GLuint *); +GLAPI void APIENTRY glMatrixIndexPointerARB (GLint, GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); +typedef void (APIENTRY * PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices); +typedef void (APIENTRY * PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices); +typedef void (APIENTRY * PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices); +typedef void (APIENTRY * PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 +#endif + +#ifndef GL_ARB_texture_env_crossbar +#define GL_ARB_texture_env_crossbar 1 +#endif + +#ifndef GL_ARB_texture_env_dot3 +#define GL_ARB_texture_env_dot3 1 +#endif + +#ifndef GL_ARB_texture_mirror_repeat +#define GL_ARB_texture_mirror_repeat 1 +#endif + +#ifndef GL_ARB_depth_texture +#define GL_ARB_depth_texture 1 +#endif + +#ifndef GL_ARB_shadow +#define GL_ARB_shadow 1 +#endif + +#ifndef GL_ARB_shadow_ambient +#define GL_ARB_shadow_ambient 1 +#endif + +#ifndef GL_ARB_window_pos +#define GL_ARB_window_pos 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowPos2dARB (GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *); +GLAPI void APIENTRY glWindowPos2fARB (GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *); +GLAPI void APIENTRY glWindowPos2iARB (GLint, GLint); +GLAPI void APIENTRY glWindowPos2ivARB (const GLint *); +GLAPI void APIENTRY glWindowPos2sARB (GLshort, GLshort); +GLAPI void APIENTRY glWindowPos2svARB (const GLshort *); +GLAPI void APIENTRY glWindowPos3dARB (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *); +GLAPI void APIENTRY glWindowPos3fARB (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *); +GLAPI void APIENTRY glWindowPos3iARB (GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos3ivARB (const GLint *); +GLAPI void APIENTRY glWindowPos3sARB (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos3svARB (const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRY * PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRY * PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); +typedef void (APIENTRY * PFNGLWINDOWPOS2IVARBPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); +typedef void (APIENTRY * PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRY * PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRY * PFNGLWINDOWPOS3IVARBPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRY * PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v); +#endif + +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 +#endif + +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +#endif + +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); +#endif + +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 +#endif + +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); +typedef void (APIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); +#endif + +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); +GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); +GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRY * PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif + +#ifndef GL_EXT_histogram +#define GL_EXT_histogram 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean); +GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean); +GLAPI void APIENTRY glResetHistogramEXT (GLenum); +GLAPI void APIENTRY glResetMinmaxEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRY * PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRY * PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (APIENTRY * PFNGLRESETMINMAXEXTPROC) (GLenum target); +#endif + +#ifndef GL_EXT_convolution +#define GL_EXT_convolution 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint); +GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); +GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +#endif + +#ifndef GL_EXT_color_matrix +#define GL_EXT_color_matrix 1 +#endif + +#ifndef GL_SGI_color_table +#define GL_SGI_color_table 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); +#endif + +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTexGenSGIX (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); +#endif + +#ifndef GL_SGIS_pixel_texture +#define GL_SGIS_pixel_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint); +GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *); +GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat); +GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *); +GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *); +GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); +#endif + +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_SGI_texture_color_table +#define GL_SGI_texture_color_table 1 +#endif + +#ifndef GL_EXT_cmyka +#define GL_EXT_cmyka 1 +#endif + +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *); +GLAPI void APIENTRY glBindTextureEXT (GLenum, GLuint); +GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint); +GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRY * PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); +typedef void (APIENTRY * PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (APIENTRY * PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); +typedef void (APIENTRY * PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); +typedef GLboolean (APIENTRY * PFNGLISTEXTUREEXTPROC) (GLuint texture); +typedef void (APIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); +#endif + +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#endif + +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#endif + +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 +#endif + +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 +#endif + +#ifndef GL_SGIS_multisample +#define GL_SGIS_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean); +GLAPI void APIENTRY glSamplePatternSGIS (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); +#endif + +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 +#endif + +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glArrayElementEXT (GLint); +GLAPI void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei); +GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *); +GLAPI void APIENTRY glGetPointervEXT (GLenum, GLvoid* *); +GLAPI void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i); +typedef void (APIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRY * PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); +typedef void (APIENTRY * PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params); +typedef void (APIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_misc_attribute +#define GL_EXT_misc_attribute 1 +#endif + +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 +#endif + +#ifndef GL_SGIX_clipmap +#define GL_SGIX_clipmap 1 +#endif + +#ifndef GL_SGIX_shadow +#define GL_SGIX_shadow 1 +#endif + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 +#endif + +#ifndef GL_SGIS_texture_border_clamp +#define GL_SGIS_texture_border_clamp 1 +#endif + +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 +#endif + +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 +#endif + +#ifndef GL_SGIX_interlace +#define GL_SGIX_interlace 1 +#endif + +#ifndef GL_SGIX_pixel_tiles +#define GL_SGIX_pixel_tiles 1 +#endif + +#ifndef GL_SGIX_texture_select +#define GL_SGIX_texture_select 1 +#endif + +#ifndef GL_SGIX_sprite +#define GL_SGIX_sprite 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat); +GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *); +GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint); +GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); +#endif + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_SGIX_texture_multi_buffer 1 +#endif + +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_SGIS_point_parameters +#define GL_SGIS_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_SGIX_instruments +#define GL_SGIX_instruments 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLint APIENTRY glGetInstrumentsSGIX (void); +GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *); +GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *); +GLAPI void APIENTRY glReadInstrumentsSGIX (GLint); +GLAPI void APIENTRY glStartInstrumentsSGIX (void); +GLAPI void APIENTRY glStopInstrumentsSGIX (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLint (APIENTRY * PFNGLGETINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRY * PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); +typedef GLint (APIENTRY * PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); +typedef void (APIENTRY * PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); +typedef void (APIENTRY * PFNGLSTARTINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRY * PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); +#endif + +#ifndef GL_SGIX_texture_scale_bias +#define GL_SGIX_texture_scale_bias 1 +#endif + +#ifndef GL_SGIX_framezoom +#define GL_SGIX_framezoom 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFrameZoomSGIX (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor); +#endif + +#ifndef GL_SGIX_tag_sample_buffer +#define GL_SGIX_tag_sample_buffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTagSampleBufferSGIX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); +#endif + +#ifndef GL_SGIX_polynomial_ffd +#define GL_SGIX_polynomial_ffd 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *); +GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *); +GLAPI void APIENTRY glDeformSGIX (GLbitfield); +GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); +typedef void (APIENTRY * PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); +typedef void (APIENTRY * PFNGLDEFORMSGIXPROC) (GLbitfield mask); +typedef void (APIENTRY * PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); +#endif + +#ifndef GL_SGIX_reference_plane +#define GL_SGIX_reference_plane 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); +#endif + +#ifndef GL_SGIX_flush_raster +#define GL_SGIX_flush_raster 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushRasterSGIX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); +#endif + +#ifndef GL_SGIX_depth_texture +#define GL_SGIX_depth_texture 1 +#endif + +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); +typedef void (APIENTRY * PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); +#endif + +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 +#endif + +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint); +GLAPI void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_HP_convolution_border_modes +#define GL_HP_convolution_border_modes 1 +#endif + +#ifndef GL_SGIX_texture_add_env +#define GL_SGIX_texture_add_env 1 +#endif + +#ifndef GL_EXT_color_subtable +#define GL_EXT_color_subtable 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +#endif + +#ifndef GL_PGI_vertex_hints +#define GL_PGI_vertex_hints 1 +#endif + +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glHintPGI (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLHINTPGIPROC) (GLenum target, GLint mode); +#endif + +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 +#endif + +#ifndef GL_SGIX_list_priority +#define GL_SGIX_list_priority 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat); +GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *); +GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint); +GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); +#endif + +#ifndef GL_SGIX_ir_instrument1 +#define GL_SGIX_ir_instrument1 1 +#endif + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_SGIX_calligraphic_fragment 1 +#endif + +#ifndef GL_SGIX_texture_lod_bias +#define GL_SGIX_texture_lod_bias 1 +#endif + +#ifndef GL_SGIX_shadow_ambient +#define GL_SGIX_shadow_ambient 1 +#endif + +#ifndef GL_EXT_index_texture +#define GL_EXT_index_texture 1 +#endif + +#ifndef GL_EXT_index_material +#define GL_EXT_index_material 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); +#endif + +#ifndef GL_EXT_index_func +#define GL_EXT_index_func 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); +#endif + +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 +#endif + +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei); +GLAPI void APIENTRY glUnlockArraysEXT (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (APIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void); +#endif + +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *); +GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); +typedef void (APIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); +#endif + +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 +#endif + +#ifndef GL_SGIX_fragment_lighting +#define GL_SGIX_fragment_lighting 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum); +GLAPI void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint); +GLAPI void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat); +GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *); +GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint); +GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *); +GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint); +GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); +#endif + +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 +#endif + +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 +#endif + +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +#endif + +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 +#endif + +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 +#endif + +#ifndef GL_EXT_light_texture +#define GL_EXT_light_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glApplyTextureEXT (GLenum); +GLAPI void APIENTRY glTextureLightEXT (GLenum); +GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (APIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (APIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); +#endif + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_SGIX_blend_alpha_minmax 1 +#endif + +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 +#endif + +#ifndef GL_SGIX_async +#define GL_SGIX_async 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint); +GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *); +GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *); +GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei); +GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei); +GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLASYNCMARKERSGIXPROC) (GLuint marker); +typedef GLint (APIENTRY * PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); +typedef GLint (APIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); +typedef GLuint (APIENTRY * PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); +typedef void (APIENTRY * PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); +typedef GLboolean (APIENTRY * PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); +#endif + +#ifndef GL_SGIX_async_pixel +#define GL_SGIX_async_pixel 1 +#endif + +#ifndef GL_SGIX_async_histogram +#define GL_SGIX_async_histogram 1 +#endif + +#ifndef GL_INTEL_parallel_arrays +#define GL_INTEL_parallel_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *); +GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *); +GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *); +GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +typedef void (APIENTRY * PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer); +typedef void (APIENTRY * PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +typedef void (APIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +#endif + +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 +#endif + +#ifndef GL_EXT_pixel_transform +#define GL_EXT_pixel_transform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint); +GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 +#endif + +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 +#endif + +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 +#endif + +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *); +GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *); +GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *); +GLAPI void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint); +GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *); +GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *); +GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *); +GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *); +GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort); +GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *); +GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_texture_perturb_normal +#define GL_EXT_texture_perturb_normal 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureNormalEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei); +GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (APIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +#endif + +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogCoordfEXT (GLfloat); +GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *); +GLAPI void APIENTRY glFogCoorddEXT (GLdouble); +GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *); +GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (APIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); +typedef void (APIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (APIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); +typedef void (APIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 +#endif + +#ifndef GL_EXT_coordinate_frame +#define GL_EXT_coordinate_frame 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *); +GLAPI void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *); +GLAPI void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *); +GLAPI void APIENTRY glTangent3iEXT (GLint, GLint, GLint); +GLAPI void APIENTRY glTangent3ivEXT (const GLint *); +GLAPI void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glTangent3svEXT (const GLshort *); +GLAPI void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *); +GLAPI void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *); +GLAPI void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *); +GLAPI void APIENTRY glBinormal3iEXT (GLint, GLint, GLint); +GLAPI void APIENTRY glBinormal3ivEXT (const GLint *); +GLAPI void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glBinormal3svEXT (const GLshort *); +GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); +typedef void (APIENTRY * PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRY * PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); +typedef void (APIENTRY * PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); +typedef void (APIENTRY * PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); +typedef void (APIENTRY * PFNGLTANGENT3IVEXTPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); +typedef void (APIENTRY * PFNGLTANGENT3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRY * PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); +typedef void (APIENTRY * PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRY * PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); +typedef void (APIENTRY * PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); +typedef void (APIENTRY * PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); +typedef void (APIENTRY * PFNGLBINORMAL3IVEXTPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); +typedef void (APIENTRY * PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 +#endif + +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 +#endif + +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 +#endif + +#ifndef GL_SGIX_fog_scale +#define GL_SGIX_fog_scale 1 +#endif + +#ifndef GL_SUNX_constant_data +#define GL_SUNX_constant_data 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFinishTextureSUNX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLFINISHTEXTURESUNXPROC) (void); +#endif + +#ifndef GL_SUN_global_alpha +#define GL_SUN_global_alpha 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte); +GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort); +GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint); +GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat); +GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble); +GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte); +GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort); +GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); +#endif + +#ifndef GL_SUN_triangle_list +#define GL_SUN_triangle_list 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint); +GLAPI void APIENTRY glReplacementCodeusSUN (GLushort); +GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte); +GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *); +GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *); +GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *); +GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer); +#endif + +#ifndef GL_SUN_vertex +#define GL_SUN_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat); +GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLenum *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLenum, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLenum *, const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLenum rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLenum rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLenum *rc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLenum rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLenum rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +#endif + +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif + +#ifndef GL_INGR_color_clamp +#define GL_INGR_color_clamp 1 +#endif + +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 +#endif + +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 +#endif + +#ifndef GL_EXT_422_pixels +#define GL_EXT_422_pixels 1 +#endif + +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 +#endif + +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 +#endif + +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 +#endif + +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 +#endif + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +#endif + +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexWeightfEXT (GLfloat); +GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *); +GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (APIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); +typedef void (APIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 +#endif + +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); +GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (APIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer); +#endif + +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *); +GLAPI void APIENTRY glCombinerParameterfNV (GLenum, GLfloat); +GLAPI void APIENTRY glCombinerParameterivNV (GLenum, const GLint *); +GLAPI void APIENTRY glCombinerParameteriNV (GLenum, GLint); +GLAPI void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean); +GLAPI void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (APIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); +#endif + +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 +#endif + +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 +#endif + +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 +#endif + +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 +#endif + +#ifndef GL_MESA_resize_buffers +#define GL_MESA_resize_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glResizeBuffersMESA (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void); +#endif + +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *); +GLAPI void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *); +GLAPI void APIENTRY glWindowPos2iMESA (GLint, GLint); +GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *); +GLAPI void APIENTRY glWindowPos2sMESA (GLshort, GLshort); +GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *); +GLAPI void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *); +GLAPI void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *); +GLAPI void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *); +GLAPI void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *); +GLAPI void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *); +GLAPI void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *); +GLAPI void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *); +GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRY * PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRY * PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (APIENTRY * PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (APIENTRY * PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRY * PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRY * PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRY * PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); +typedef void (APIENTRY * PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRY * PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); +#endif + +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 +#endif + +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiModeDrawArraysIBM (GLenum, const GLint *, const GLsizei *, GLsizei, GLint); +GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* *, GLsizei, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (APIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount, GLint modestride); +#endif + +#ifndef GL_IBM_vertex_array_lists +#define GL_IBM_vertex_array_lists 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint); +GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +#endif + +#ifndef GL_SGIX_subsample +#define GL_SGIX_subsample 1 +#endif + +#ifndef GL_SGIX_ycrcba +#define GL_SGIX_ycrcba 1 +#endif + +#ifndef GL_SGIX_ycrcb_subsample +#define GL_SGIX_ycrcb_subsample 1 +#endif + +#ifndef GL_SGIX_depth_pass_instrument +#define GL_SGIX_depth_pass_instrument 1 +#endif + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_3DFX_texture_compression_FXT1 1 +#endif + +#ifndef GL_3DFX_multisample +#define GL_3DFX_multisample 1 +#endif + +#ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTbufferMask3DFX (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); +#endif + +#ifndef GL_EXT_multisample +#define GL_EXT_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean); +GLAPI void APIENTRY glSamplePatternEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); +#endif + +#ifndef GL_SGIX_vertex_preclip +#define GL_SGIX_vertex_preclip 1 +#endif + +#ifndef GL_SGIX_convolution_accuracy +#define GL_SGIX_convolution_accuracy 1 +#endif + +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 +#endif + +#ifndef GL_SGIS_point_line_texgen +#define GL_SGIS_point_line_texgen 1 +#endif + +#ifndef GL_SGIS_texture_color_mask +#define GL_SGIS_texture_color_mask 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +#endif + +#ifndef GL_SGIX_igloo_interface +#define GL_SGIX_igloo_interface 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params); +#endif + +#ifndef GL_NV_fence +#define GL_NV_fence 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeleteFencesNV (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsFenceNV (GLuint); +GLAPI GLboolean APIENTRY glTestFenceNV (GLuint); +GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glFinishFenceNV (GLuint); +GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRY * PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); +typedef GLboolean (APIENTRY * PFNGLISFENCENVPROC) (GLuint fence); +typedef GLboolean (APIENTRY * PFNGLTESTFENCENVPROC) (GLuint fence); +typedef void (APIENTRY * PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (APIENTRY * PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +#endif + +#ifndef GL_NV_evaluators +#define GL_NV_evaluators 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLint, GLint, GLboolean, const GLvoid *); +GLAPI void APIENTRY glMapParameterivNV (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glMapParameterfvNV (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glGetMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLboolean, GLvoid *); +GLAPI void APIENTRY glGetMapParameterivNV (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMapParameterfvNV (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum, GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glEvalMapsNV (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); +typedef void (APIENTRY * PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); +typedef void (APIENTRY * PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); +#endif + +#ifndef GL_NV_packed_depth_stencil +#define GL_NV_packed_depth_stencil 1 +#endif + +#ifndef GL_NV_register_combiners2 +#define GL_NV_register_combiners2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_NV_texture_compression_vtc +#define GL_NV_texture_compression_vtc 1 +#endif + +#ifndef GL_NV_texture_rectangle +#define GL_NV_texture_rectangle 1 +#endif + +#ifndef GL_NV_texture_shader +#define GL_NV_texture_shader 1 +#endif + +#ifndef GL_NV_texture_shader2 +#define GL_NV_texture_shader2 1 +#endif + +#ifndef GL_NV_vertex_array_range2 +#define GL_NV_vertex_array_range2 1 +#endif + +#ifndef GL_NV_vertex_program +#define GL_NV_vertex_program 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *); +GLAPI void APIENTRY glBindProgramNV (GLenum, GLuint); +GLAPI void APIENTRY glDeleteProgramsNV (GLsizei, const GLuint *); +GLAPI void APIENTRY glExecuteProgramNV (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glGenProgramsNV (GLsizei, GLuint *); +GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum, GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetProgramivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetProgramStringNV (GLuint, GLenum, GLubyte *); +GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum, GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint, GLenum, GLvoid* *); +GLAPI GLboolean APIENTRY glIsProgramNV (GLuint); +GLAPI void APIENTRY glLoadProgramNV (GLenum, GLuint, GLsizei, const GLubyte *); +GLAPI void APIENTRY glProgramParameter4dNV (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramParameter4dvNV (GLenum, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramParameter4fvNV (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glProgramParameters4dvNV (GLenum, GLuint, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramParameters4fvNV (GLenum, GLuint, GLuint, const GLfloat *); +GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *); +GLAPI void APIENTRY glTrackMatrixNV (GLenum, GLuint, GLenum, GLenum); +GLAPI void APIENTRY glVertexAttribPointerNV (GLuint, GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexAttrib1dNV (GLuint, GLdouble); +GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat); +GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort); +GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRY * PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); +typedef void (APIENTRY * PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); +typedef void (APIENTRY * PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRY * PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); +typedef void (APIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRY * PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRY * PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); +typedef void (APIENTRY * PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRY * PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRY * PFNGLISPROGRAMNVPROC) (GLuint id); +typedef void (APIENTRY * PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); +typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v); +typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v); +typedef void (APIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v); +typedef void (APIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v); +typedef void (APIENTRY * PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRY * PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); +typedef void (APIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); +typedef void (APIENTRY * PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (APIENTRY * PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); +typedef void (APIENTRY * PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRY * PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRY * PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRY * PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRY * PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRY * PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v); +#endif + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_SGIX_texture_coordinate_clamp 1 +#endif + +#ifndef GL_SGIX_scalebias_hint +#define GL_SGIX_scalebias_hint 1 +#endif + +#ifndef GL_OML_interlace +#define GL_OML_interlace 1 +#endif + +#ifndef GL_OML_subsample +#define GL_OML_subsample 1 +#endif + +#ifndef GL_OML_resample +#define GL_OML_resample 1 +#endif + +#ifndef GL_NV_copy_depth_to_color +#define GL_NV_copy_depth_to_color 1 +#endif + +#ifndef GL_ATI_envmap_bumpmap +#define GL_ATI_envmap_bumpmap 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBumpParameterivATI (GLenum, const GLint *); +GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum, GLint *); +GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param); +typedef void (APIENTRY * PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param); +typedef void (APIENTRY * PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); +typedef void (APIENTRY * PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +#endif + +#ifndef GL_ATI_fragment_shader +#define GL_ATI_fragment_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint); +GLAPI void APIENTRY glBindFragmentShaderATI (GLuint); +GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint); +GLAPI void APIENTRY glBeginFragmentShaderATI (void); +GLAPI void APIENTRY glEndFragmentShaderATI (void); +GLAPI void APIENTRY glPassTexCoordATI (GLuint, GLuint, GLenum); +GLAPI void APIENTRY glSampleMapATI (GLuint, GLuint, GLenum); +GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLuint (APIENTRY * PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); +typedef void (APIENTRY * PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRY * PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRY * PFNGLBEGINFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRY * PFNGLENDFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRY * PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); +typedef void (APIENTRY * PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); +typedef void (APIENTRY * PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRY * PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRY * PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRY * PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRY * PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRY * PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRY * PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value); +#endif + +#ifndef GL_ATI_pn_triangles +#define GL_ATI_pn_triangles 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPNTrianglesiATI (GLenum, GLint); +GLAPI void APIENTRY glPNTrianglesfATI (GLenum, GLfloat); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); +#endif + +#ifndef GL_ATI_vertex_array_object +#define GL_ATI_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei, const GLvoid *, GLenum); +GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint); +GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint, GLuint, GLsizei, const GLvoid *, GLenum); +GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetObjectBufferivATI (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glDeleteObjectBufferATI (GLuint); +GLAPI void APIENTRY glArrayObjectATI (GLenum, GLint, GLenum, GLsizei, GLuint, GLuint); +GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetArrayObjectivATI (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glVariantArrayObjectATI (GLuint, GLenum, GLsizei, GLuint, GLuint); +GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLuint (APIENTRY * PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage); +typedef GLboolean (APIENTRY * PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRY * PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); +typedef void (APIENTRY * PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLDELETEOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRY * PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRY * PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRY * PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params); +#endif + +#ifndef GL_EXT_vertex_shader +#define GL_EXT_vertex_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginVertexShaderEXT (void); +GLAPI void APIENTRY glEndVertexShaderEXT (void); +GLAPI void APIENTRY glBindVertexShaderEXT (GLuint); +GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint); +GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint); +GLAPI void APIENTRY glShaderOp1EXT (GLenum, GLuint, GLuint); +GLAPI void APIENTRY glShaderOp2EXT (GLenum, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glShaderOp3EXT (GLenum, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSwizzleEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glWriteMaskEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glInsertComponentEXT (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glExtractComponentEXT (GLuint, GLuint, GLuint); +GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum, GLenum, GLenum, GLuint); +GLAPI void APIENTRY glSetInvariantEXT (GLuint, GLenum, const void *); +GLAPI void APIENTRY glSetLocalConstantEXT (GLuint, GLenum, const void *); +GLAPI void APIENTRY glVariantbvEXT (GLuint, const GLbyte *); +GLAPI void APIENTRY glVariantsvEXT (GLuint, const GLshort *); +GLAPI void APIENTRY glVariantivEXT (GLuint, const GLint *); +GLAPI void APIENTRY glVariantfvEXT (GLuint, const GLfloat *); +GLAPI void APIENTRY glVariantdvEXT (GLuint, const GLdouble *); +GLAPI void APIENTRY glVariantubvEXT (GLuint, const GLubyte *); +GLAPI void APIENTRY glVariantusvEXT (GLuint, const GLushort *); +GLAPI void APIENTRY glVariantuivEXT (GLuint, const GLuint *); +GLAPI void APIENTRY glVariantPointerEXT (GLuint, GLenum, GLuint, const void *); +GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint); +GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint); +GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum, GLenum); +GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum, GLenum); +GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum, GLenum, GLenum); +GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum, GLenum); +GLAPI GLuint APIENTRY glBindParameterEXT (GLenum); +GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint, GLenum); +GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint, GLenum, GLboolean *); +GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVariantPointervEXT (GLuint, GLenum, GLvoid* *); +GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint, GLenum, GLboolean *); +GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint, GLenum, GLboolean *); +GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLBEGINVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRY * PFNGLENDVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRY * PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); +typedef GLuint (APIENTRY * PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); +typedef void (APIENTRY * PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); +typedef void (APIENTRY * PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); +typedef void (APIENTRY * PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +typedef void (APIENTRY * PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +typedef void (APIENTRY * PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRY * PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRY * PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef void (APIENTRY * PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLuint (APIENTRY * PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); +typedef void (APIENTRY * PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const void *addr); +typedef void (APIENTRY * PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const void *addr); +typedef void (APIENTRY * PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr); +typedef void (APIENTRY * PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr); +typedef void (APIENTRY * PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr); +typedef void (APIENTRY * PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr); +typedef void (APIENTRY * PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr); +typedef void (APIENTRY * PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr); +typedef void (APIENTRY * PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr); +typedef void (APIENTRY * PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr); +typedef void (APIENTRY * PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const void *addr); +typedef void (APIENTRY * PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (APIENTRY * PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef GLuint (APIENTRY * PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); +typedef GLuint (APIENTRY * PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); +typedef GLuint (APIENTRY * PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); +typedef GLuint (APIENTRY * PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); +typedef GLuint (APIENTRY * PFNGLBINDPARAMETEREXTPROC) (GLenum value); +typedef GLboolean (APIENTRY * PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); +typedef void (APIENTRY * PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRY * PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRY * PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRY * PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data); +typedef void (APIENTRY * PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRY * PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRY * PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRY * PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRY * PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRY * PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +#endif + +#ifndef GL_ATI_vertex_streams +#define GL_ATI_vertex_streams 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexStream1sATI (GLenum, GLshort); +GLAPI void APIENTRY glVertexStream1svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream1iATI (GLenum, GLint); +GLAPI void APIENTRY glVertexStream1ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream1fATI (GLenum, GLfloat); +GLAPI void APIENTRY glVertexStream1fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream1dATI (GLenum, GLdouble); +GLAPI void APIENTRY glVertexStream1dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glVertexStream2sATI (GLenum, GLshort, GLshort); +GLAPI void APIENTRY glVertexStream2svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream2iATI (GLenum, GLint, GLint); +GLAPI void APIENTRY glVertexStream2ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream2fATI (GLenum, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexStream2fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream2dATI (GLenum, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexStream2dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glVertexStream3sATI (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexStream3svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream3iATI (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexStream3ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexStream3fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexStream3dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glVertexStream4sATI (GLenum, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexStream4svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream4iATI (GLenum, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexStream4ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream4fATI (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexStream4fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream4dATI (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexStream4dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glNormalStream3bATI (GLenum, GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glNormalStream3bvATI (GLenum, const GLbyte *); +GLAPI void APIENTRY glNormalStream3sATI (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glNormalStream3svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glNormalStream3iATI (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glNormalStream3ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glNormalStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glNormalStream3fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glNormalStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glNormalStream3dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum); +GLAPI void APIENTRY glVertexBlendEnviATI (GLenum, GLint); +GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum, GLfloat); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); +typedef void (APIENTRY * PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); +typedef void (APIENTRY * PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); +typedef void (APIENTRY * PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); +typedef void (APIENTRY * PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); +typedef void (APIENTRY * PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); +typedef void (APIENTRY * PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); +typedef void (APIENTRY * PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); +typedef void (APIENTRY * PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRY * PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (APIENTRY * PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRY * PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRY * PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRY * PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRY * PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); +typedef void (APIENTRY * PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); +typedef void (APIENTRY * PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); +typedef void (APIENTRY * PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRY * PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); +typedef void (APIENTRY * PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRY * PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); +typedef void (APIENTRY * PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRY * PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); +typedef void (APIENTRY * PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRY * PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); +typedef void (APIENTRY * PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); +#endif + +#ifndef GL_ATI_element_array +#define GL_ATI_element_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glElementPointerATI (GLenum, const GLvoid *); +GLAPI void APIENTRY glDrawElementArrayATI (GLenum, GLsizei); +GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum, GLuint, GLuint, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); +typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); +#endif + +#ifndef GL_SUN_mesh_array +#define GL_SUN_mesh_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); +#endif + +#ifndef GL_SUN_slice_accum +#define GL_SUN_slice_accum 1 +#endif + +#ifndef GL_NV_multisample_filter_hint +#define GL_NV_multisample_filter_hint 1 +#endif + +#ifndef GL_NV_depth_clamp +#define GL_NV_depth_clamp 1 +#endif + +#ifndef GL_NV_occlusion_query +#define GL_NV_occlusion_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei, const GLuint *); +GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint); +GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint); +GLAPI void APIENTRY glEndOcclusionQueryNV (void); +GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRY * PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRY * PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRY * PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRY * PFNGLENDOCCLUSIONQUERYNVPROC) (void); +typedef void (APIENTRY * PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params); +#endif + +#ifndef GL_NV_point_sprite +#define GL_NV_point_sprite 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameteriNV (GLenum, GLint); +GLAPI void APIENTRY glPointParameterivNV (GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +#endif + +#ifndef GL_NV_texture_shader3 +#define GL_NV_texture_shader3 1 +#endif + +#ifndef GL_NV_vertex_program1_1 +#define GL_NV_vertex_program1_1 1 +#endif + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/reactos/include/GL/glu.h b/reactos/include/GL/glu.h new file mode 100644 index 00000000000..e324501e01d --- /dev/null +++ b/reactos/include/GL/glu.h @@ -0,0 +1,278 @@ +/* +** License Applicability. Except to the extent portions of this file are +** made subject to an alternative license as permitted in the SGI Free +** Software License B, Version 1.1 (the "License"), the contents of this +** file are subject only to the provisions of the License. You may not use +** this file except in compliance with the License. You may obtain a copy +** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 +** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: +** +** http://oss.sgi.com/projects/FreeB +** +** Note that, as provided in the License, the Software is distributed on an +** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS +** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND +** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A +** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +** +** Original Code. The Original Code is: OpenGL Sample Implementation, +** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, +** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. +** Copyright in any portions created by third parties is as indicated +** elsewhere herein. All Rights Reserved. +** +** Additional Notice Provisions: This software was created using the +** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has +** not been independently verified as being compliant with the OpenGL(R) +** version 1.2.1 Specification. +*/ + +#ifndef __glu_h__ +#define __glu_h__ +#define _GLU_H +#if __GNUC__ >= 3 +#pragma GCC system_header +#endif + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/*************************************************************/ + +/* Boolean */ +#define GLU_FALSE 0 +#define GLU_TRUE 1 + +/* Version */ +#define GLU_VERSION_1_1 1 +#define GLU_VERSION_1_2 1 + +/* StringName */ +#define GLU_VERSION 100800 +#define GLU_EXTENSIONS 100801 + +/* ErrorCode */ +#define GLU_INVALID_ENUM 100900 +#define GLU_INVALID_VALUE 100901 +#define GLU_OUT_OF_MEMORY 100902 +#define GLU_INVALID_OPERATION 100904 + +/* NurbsDisplay */ +/* GLU_FILL */ +#define GLU_OUTLINE_POLYGON 100240 +#define GLU_OUTLINE_PATCH 100241 + +/* NurbsError */ +#define GLU_NURBS_ERROR1 100251 +#define GLU_NURBS_ERROR2 100252 +#define GLU_NURBS_ERROR3 100253 +#define GLU_NURBS_ERROR4 100254 +#define GLU_NURBS_ERROR5 100255 +#define GLU_NURBS_ERROR6 100256 +#define GLU_NURBS_ERROR7 100257 +#define GLU_NURBS_ERROR8 100258 +#define GLU_NURBS_ERROR9 100259 +#define GLU_NURBS_ERROR10 100260 +#define GLU_NURBS_ERROR11 100261 +#define GLU_NURBS_ERROR12 100262 +#define GLU_NURBS_ERROR13 100263 +#define GLU_NURBS_ERROR14 100264 +#define GLU_NURBS_ERROR15 100265 +#define GLU_NURBS_ERROR16 100266 +#define GLU_NURBS_ERROR17 100267 +#define GLU_NURBS_ERROR18 100268 +#define GLU_NURBS_ERROR19 100269 +#define GLU_NURBS_ERROR20 100270 +#define GLU_NURBS_ERROR21 100271 +#define GLU_NURBS_ERROR22 100272 +#define GLU_NURBS_ERROR23 100273 +#define GLU_NURBS_ERROR24 100274 +#define GLU_NURBS_ERROR25 100275 +#define GLU_NURBS_ERROR26 100276 +#define GLU_NURBS_ERROR27 100277 +#define GLU_NURBS_ERROR28 100278 +#define GLU_NURBS_ERROR29 100279 +#define GLU_NURBS_ERROR30 100280 +#define GLU_NURBS_ERROR31 100281 +#define GLU_NURBS_ERROR32 100282 +#define GLU_NURBS_ERROR33 100283 +#define GLU_NURBS_ERROR34 100284 +#define GLU_NURBS_ERROR35 100285 +#define GLU_NURBS_ERROR36 100286 +#define GLU_NURBS_ERROR37 100287 + +/* NurbsSampling */ +#define GLU_PATH_LENGTH 100215 +#define GLU_PARAMETRIC_ERROR 100216 +#define GLU_DOMAIN_DISTANCE 100217 + +/* NurbsTrim */ +#define GLU_MAP1_TRIM_2 100210 +#define GLU_MAP1_TRIM_3 100211 + +/* QuadricDrawStyle */ +#define GLU_POINT 100010 +#define GLU_LINE 100011 +#define GLU_FILL 100012 +#define GLU_SILHOUETTE 100013 + +/* QuadricCallback */ +/* GLU_ERROR */ + +/* QuadricNormal */ +#define GLU_SMOOTH 100000 +#define GLU_FLAT 100001 +#define GLU_NONE 100002 + +/* QuadricOrientation */ +#define GLU_OUTSIDE 100020 +#define GLU_INSIDE 100021 + +/* TessCallback */ +#define GLU_TESS_BEGIN 100100 +#define GLU_BEGIN 100100 +#define GLU_TESS_VERTEX 100101 +#define GLU_VERTEX 100101 +#define GLU_TESS_END 100102 +#define GLU_END 100102 +#define GLU_TESS_ERROR 100103 +#define GLU_TESS_EDGE_FLAG 100104 +#define GLU_EDGE_FLAG 100104 +#define GLU_TESS_COMBINE 100105 +#define GLU_TESS_BEGIN_DATA 100106 +#define GLU_TESS_VERTEX_DATA 100107 +#define GLU_TESS_END_DATA 100108 +#define GLU_TESS_ERROR_DATA 100109 +#define GLU_TESS_EDGE_FLAG_DATA 100110 +#define GLU_TESS_COMBINE_DATA 100111 + +/* TessContour */ +#define GLU_CW 100120 +#define GLU_CCW 100121 +#define GLU_INTERIOR 100122 +#define GLU_EXTERIOR 100123 +#define GLU_UNKNOWN 100124 + +/* TessProperty */ +#define GLU_TESS_WINDING_RULE 100140 +#define GLU_TESS_BOUNDARY_ONLY 100141 +#define GLU_TESS_TOLERANCE 100142 + +/* TessError */ +#define GLU_TESS_ERROR1 100151 +#define GLU_TESS_ERROR2 100152 +#define GLU_TESS_ERROR3 100153 +#define GLU_TESS_ERROR4 100154 +#define GLU_TESS_ERROR5 100155 +#define GLU_TESS_ERROR6 100156 +#define GLU_TESS_ERROR7 100157 +#define GLU_TESS_ERROR8 100158 +#define GLU_TESS_MISSING_BEGIN_POLYGON 100151 +#define GLU_TESS_MISSING_BEGIN_CONTOUR 100152 +#define GLU_TESS_MISSING_END_POLYGON 100153 +#define GLU_TESS_MISSING_END_CONTOUR 100154 +#define GLU_TESS_COORD_TOO_LARGE 100155 +#define GLU_TESS_NEED_COMBINE_CALLBACK 100156 + +/* TessWinding */ +#define GLU_TESS_WINDING_ODD 100130 +#define GLU_TESS_WINDING_NONZERO 100131 +#define GLU_TESS_WINDING_POSITIVE 100132 +#define GLU_TESS_WINDING_NEGATIVE 100133 +#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134 + +/* Obsolete. For compatibility with previous Sun OpenGL versions */ +#define GLU_INCOMPATIBLE_GL_VERSION 100903 + + +/*************************************************************/ + + +#ifdef __cplusplus +class GLUnurbs; +class GLUquadric; +class GLUtesselator; +#else +typedef struct GLUnurbs GLUnurbs; +typedef struct GLUquadric GLUquadric; +typedef struct GLUtesselator GLUtesselator; +#endif + +typedef GLUnurbs GLUnurbsObj; +typedef GLUquadric GLUquadricObj; +typedef GLUtesselator GLUtesselatorObj; +typedef GLUtesselator GLUtriangulatorObj; + +#define GLU_TESS_MAX_COORD 1.0e150 + +/* Internal convenience typedefs */ +typedef void (APIENTRY *_GLUfuncptr)(); + +GLAPI void APIENTRY gluBeginCurve (GLUnurbs* nurb); +GLAPI void APIENTRY gluBeginPolygon (GLUtesselator* tess); +GLAPI void APIENTRY gluBeginSurface (GLUnurbs* nurb); +GLAPI void APIENTRY gluBeginTrim (GLUnurbs* nurb); +GLAPI GLint APIENTRY gluBuild1DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data); +GLAPI GLint APIENTRY gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY gluCylinder (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks); +GLAPI void APIENTRY gluDeleteNurbsRenderer (GLUnurbs* nurb); +GLAPI void APIENTRY gluDeleteQuadric (GLUquadric* quad); +GLAPI void APIENTRY gluDeleteTess (GLUtesselator* tess); +GLAPI void APIENTRY gluDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops); +GLAPI void APIENTRY gluEndCurve (GLUnurbs* nurb); +GLAPI void APIENTRY gluEndPolygon (GLUtesselator* tess); +GLAPI void APIENTRY gluEndSurface (GLUnurbs* nurb); +GLAPI void APIENTRY gluEndTrim (GLUnurbs* nurb); +GLAPI const GLubyte * APIENTRY gluErrorString (GLenum error); +GLAPI const wchar_t * APIENTRY gluErrorUnicodeStringEXT (GLenum error); +GLAPI void APIENTRY gluGetNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat* data); +GLAPI const GLubyte * APIENTRY gluGetString (GLenum name); +GLAPI void APIENTRY gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data); +GLAPI void APIENTRY gluLoadSamplingMatrices (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view); +GLAPI void APIENTRY gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ); +GLAPI GLUnurbs* APIENTRY gluNewNurbsRenderer (void); +GLAPI GLUquadric* APIENTRY gluNewQuadric (void); +GLAPI GLUtesselator* APIENTRY gluNewTess (void); +GLAPI void APIENTRY gluNextContour (GLUtesselator* tess, GLenum type); +GLAPI void APIENTRY gluNurbsCallback (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc); +GLAPI void APIENTRY gluNurbsCurve (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type); +GLAPI void APIENTRY gluNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat value); +GLAPI void APIENTRY gluNurbsSurface (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloat* control, GLint sOrder, GLint tOrder, GLenum type); +GLAPI void APIENTRY gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top); +GLAPI void APIENTRY gluPartialDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep); +GLAPI void APIENTRY gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar); +GLAPI void APIENTRY gluPickMatrix (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport); +GLAPI GLint APIENTRY gluProject (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ); +GLAPI void APIENTRY gluPwlCurve (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type); +GLAPI void APIENTRY gluQuadricCallback (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc); +GLAPI void APIENTRY gluQuadricDrawStyle (GLUquadric* quad, GLenum draw); +GLAPI void APIENTRY gluQuadricNormals (GLUquadric* quad, GLenum normal); +GLAPI void APIENTRY gluQuadricOrientation (GLUquadric* quad, GLenum orientation); +GLAPI void APIENTRY gluQuadricTexture (GLUquadric* quad, GLboolean texture); +GLAPI GLint APIENTRY gluScaleImage (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut); +GLAPI void APIENTRY gluSphere (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks); +GLAPI void APIENTRY gluTessBeginContour (GLUtesselator* tess); +GLAPI void APIENTRY gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data); +GLAPI void APIENTRY gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc); +GLAPI void APIENTRY gluTessEndContour (GLUtesselator* tess); +GLAPI void APIENTRY gluTessEndPolygon (GLUtesselator* tess); +GLAPI void APIENTRY gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ); +GLAPI void APIENTRY gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data); +GLAPI void APIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data); +GLAPI GLint APIENTRY gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ); +GLAPI GLint APIENTRY gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW); + +#ifdef UNICODE +#define gluErrorStringWIN gluErrorUnicodeStringEXT +#else +#define gluErrorStringWIN gluErrorString +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __glu_h__ */ diff --git a/reactos/include/crt/excpt.h b/reactos/include/crt/excpt.h new file mode 100644 index 00000000000..967b067a6d0 --- /dev/null +++ b/reactos/include/crt/excpt.h @@ -0,0 +1,94 @@ +/* + * excpt.h + * This file has no copyright assigned and is placed in the Public Domain. + * This file is a part of the mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within the package. + * + * Support for operating system level structured exception handling. + * + * NOTE: This is very preliminary stuff. I am also pretty sure it is + * completely Intel specific. + * + */ + +#ifndef _EXCPT_H_ +#define _EXCPT_H_ + +/* All the headers include this file. */ +#if defined(__MINGW32__) +#include <_mingw.h> +#endif + +/* + * NOTE: The constants structs and typedefs below should be defined in the + * Win32 API headers. + */ +#define EXCEPTION_EXECUTE_HANDLER 1 +#define EXCEPTION_CONTINUE_SEARCH 0 +#define EXCEPTION_CONTINUE_EXECUTION -1 + +#define EH_NONCONTINUABLE 0x01 +#define EH_UNWINDING 0x02 +#define EH_EXIT_UNWIND 0x04 +#define EH_STACK_INVALID 0x08 +#define EH_NESTED_CALL 0x10 + +#ifndef RC_INVOKED + +typedef enum { + ExceptionContinueExecution, + ExceptionContinueSearch, + ExceptionNestedException, + ExceptionCollidedUnwind +} EXCEPTION_DISPOSITION; + + +/* + * End of stuff that should be in the Win32 API files. + */ + + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The type of function that is expected as an exception handler to be + * installed with _try1. + */ +typedef EXCEPTION_DISPOSITION (*PEXCEPTION_HANDLER) + (struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*); + + +/* + * A macro which installs the supplied exception handler. + * Push the pointer to the new handler onto the stack, + * then push the pointer to the old registration structure (at fs:0) + * onto the stack, then put a pointer to the new registration + * structure (i.e. the current stack pointer) at fs:0. + */ +#define __try1(pHandler) \ + __asm__ ("pushl %0;pushl %%fs:0;movl %%esp,%%fs:0;" : : "g" (pHandler)); + +/* + * A macro which (despite its name) *removes* an installed + * exception handler. Should be used only in conjunction with the above + * install routine __try1. + * Move the pointer to the old reg. struct (at the current stack + * position) to fs:0, replacing the pointer we installed above, + * then add 8 to the stack pointer to get rid of the space we + * used when we pushed on our new reg. struct above. Notice that + * the stack must be in the exact state at this point that it was + * after we did _try1 or this will smash things. + */ +#define __except1 \ + __asm__ ("movl (%%esp),%%eax;movl %%eax,%%fs:0;addl $8,%%esp;" \ + : : : "%eax"); + +#ifdef __cplusplus +} +#endif + +#endif /* Not RC_INVOKED */ + +#endif /* _EXCPT_H_ not defined */ diff --git a/reactos/include/ddk/afilter.h b/reactos/include/ddk/afilter.h new file mode 100644 index 00000000000..d8e457289ae --- /dev/null +++ b/reactos/include/ddk/afilter.h @@ -0,0 +1,189 @@ +/* + * afilter.h + * + * Address filtering for NDIS MACs + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Filip Navara + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef _ARC_FILTER_DEFS_ +#define _ARC_FILTER_DEFS_ + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define ARC_RECEIVE_BUFFERS 64 +#define ARCNET_ADDRESS_LEN 1 +#define ARC_PROTOCOL_HEADER_SIZE (sizeof(ARC_PROTOCOL_HEADER)) +#define ARC_MAX_FRAME_SIZE 504 +#define ARC_MAX_ADDRESS_IDS 256 +#define ARC_MAX_FRAME_HEADER_SIZE 6 +#define ARC_MAX_PACKET_SIZE 576 +#define ARC_FILTER_MAX_OPENS (sizeof(ULONG) * 8) + +#define ARC_IS_BROADCAST(Address) (BOOLEAN)(!(Address)) + +#define ARC_QUERY_FILTER_CLASSES(Filter) ((Filter)->CombinedPacketFilter) +#define ARC_QUERY_PACKET_FILTER(Filter, NdisFilterHandle) \ + (((PARC_BINDING_INFO)(NdisFilterHandle))->PacketFilters) + +typedef ULONG MASK, *PMASK; + +typedef struct _ARC_BUFFER_LIST +{ + PVOID Buffer; + UINT Size; + UINT BytesLeft; + struct _ARC_BUFFER_LIST *Next; +} ARC_BUFFER_LIST, *PARC_BUFFER_LIST; + +typedef struct _ARC_PROTOCOL_HEADER +{ + UCHAR SourceId[ARCNET_ADDRESS_LEN]; + UCHAR DestId[ARCNET_ADDRESS_LEN]; + UCHAR ProtId; +} ARC_PROTOCOL_HEADER, *PARC_PROTOCOL_HEADER; + +typedef struct _ARC_PACKET_HEADER +{ + ARC_PROTOCOL_HEADER ProtHeader; + USHORT FrameSequence; + UCHAR SplitFlag; + UCHAR LastSplitFlag; + UCHAR FramesReceived; +} ARC_PACKET_HEADER, *PARC_PACKET_HEADER; + +typedef struct _ARC_PACKET +{ + ARC_PACKET_HEADER Header; + struct _ARC_PACKET *Next; + ULONG TotalLength; + BOOLEAN LastFrame; + PARC_BUFFER_LIST FirstBuffer; + PARC_BUFFER_LIST LastBuffer; + NDIS_PACKET TmpNdisPacket; +} ARC_PACKET, *PARC_PACKET; + +typedef struct _ARC_BINDING_INFO +{ + PNDIS_OPEN_BLOCK NdisBindingHandle; + PVOID Reserved; + UINT PacketFilters; + ULONG References; + struct _ARC_BINDING_INFO *NextOpen; + BOOLEAN ReceivedAPacket; + UINT OldPacketFilters; +} ARC_BINDING_INFO,*PARC_BINDING_INFO; + +typedef struct _ARC_FILTER +{ + struct _NDIS_MINIPORT_BLOCK *Miniport; + UINT CombinedPacketFilter; + PARC_BINDING_INFO OpenList; + NDIS_HANDLE ReceiveBufferPool; + PARC_BUFFER_LIST FreeBufferList; + PARC_PACKET FreePackets; + PARC_PACKET OutstandingPackets; + UCHAR AdapterAddress; + UINT OldCombinedPacketFilter; +} ARC_FILTER,*PARC_FILTER; + +BOOLEAN +DDKAPI +ArcCreateFilter( + IN struct _NDIS_MINIPORT_BLOCK *Miniport, + IN UCHAR AdapterAddress, + OUT PARC_FILTER *Filter); + +VOID +DDKAPI +ArcDeleteFilter( + IN PARC_FILTER Filter); + +BOOLEAN +DDKAPI +ArcNoteFilterOpenAdapter( + IN PARC_FILTER Filter, + IN NDIS_HANDLE NdisBindingHandle, + OUT PNDIS_HANDLE NdisFilterHandle); + +NDIS_STATUS +DDKAPI +ArcDeleteFilterOpenAdapter( + IN PARC_FILTER Filter, + IN NDIS_HANDLE NdisFilterHandle, + IN PNDIS_REQUEST NdisRequest); + +NDIS_STATUS +DDKAPI +ArcFilterAdjust( + IN PARC_FILTER Filter, + IN NDIS_HANDLE NdisFilterHandle, + IN PNDIS_REQUEST NdisRequest, + IN UINT FilterClasses, + IN BOOLEAN Set); + +VOID +DDKAPI +ArcFilterDprIndicateReceiveComplete( + IN PARC_FILTER Filter); + +VOID +DDKAPI +ArcFilterDprIndicateReceive( + IN PARC_FILTER Filter, + IN PUCHAR pRawHeader, + IN PUCHAR pData, + IN UINT Length); + +NDIS_STATUS +DDKAPI +ArcFilterTransferData( + IN PARC_FILTER Filter, + IN NDIS_HANDLE MacReceiveContext, + IN UINT ByteOffset, + IN UINT BytesToTransfer, + OUT PNDIS_PACKET Packet, + OUT PUINT BytesTransfered); + +VOID +DDKAPI +ArcFreeNdisPacket( + IN PARC_PACKET Packet); + +VOID +DDKAPI +ArcFilterDoIndication( + IN PARC_FILTER Filter, + IN PARC_PACKET Packet); + +VOID +DDKAPI +ArcDestroyPacket( + IN PARC_FILTER Filter, + IN PARC_PACKET Packet); + +#ifdef __cplusplus +} +#endif + +#endif /* _ARC_FILTER_DEFS_ */ diff --git a/reactos/include/ddk/atm.h b/reactos/include/ddk/atm.h new file mode 100644 index 00000000000..a5423e5c04c --- /dev/null +++ b/reactos/include/ddk/atm.h @@ -0,0 +1,507 @@ +/* + * atm.h + * + * ATM support + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef _ATM_H +#define _ATM_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef ULONG ATM_ADDRESSTYPE; + +#define SAP_TYPE_NSAP 1 +#define SAP_TYPE_E164 2 + +#define ATM_MEDIA_SPECIFIC 1 + +#define CALLMGR_SPECIFIC_Q2931 1 + +#define ATM_NSAP 0 +#define ATM_E164 1 + +#define ATM_MAC_ADDRESS_LENGTH 6 +#define ATM_ADDRESS_LENGTH 20 + +typedef ULONG ATM_AAL_TYPE, *PATM_AAL_TYPE; + +#define AAL_TYPE_AAL0 1 +#define AAL_TYPE_AAL1 2 +#define AAL_TYPE_AAL34 4 +#define AAL_TYPE_AAL5 8 + +#define ATM_ADDR_BLANK_CHAR L' ' +#define ATM_ADDR_E164_START_CHAR L'+' +#define ATM_ADDR_PUNCTUATION_CHAR L'.' + +typedef enum { + IE_AALParameters, + IE_TrafficDescriptor, + IE_BroadbandBearerCapability, + IE_BHLI, + IE_BLLI, + IE_CalledPartyNumber, + IE_CalledPartySubaddress, + IE_CallingPartyNumber, + IE_CallingPartySubaddress, + IE_Cause, + IE_QOSClass, + IE_TransitNetworkSelection, + IE_BroadbandSendingComplete, + IE_LIJCallId, + IE_Raw +} Q2931_IE_TYPE; + +typedef struct _Q2931_IE { + Q2931_IE_TYPE IEType; + ULONG IELength; + UCHAR IE[1]; +} Q2931_IE, *PQ2931_IE; + +typedef struct _AAL1_PARAMETERS { + UCHAR Subtype; + UCHAR CBRRate; + USHORT Multiplier; + UCHAR SourceClockRecoveryMethod; + UCHAR ErrorCorrectionMethod; + USHORT StructuredDataTransferBlocksize; + UCHAR PartiallyFilledCellsMethod; +} AAL1_PARAMETERS, *PAAL1_PARAMETERS; + +typedef struct _AAL34_PARAMETERS { + USHORT ForwardMaxCPCSSDUSize; + USHORT BackwardMaxCPCSSDUSize; + USHORT LowestMID; + USHORT HighestMID; + UCHAR SSCSType; +} AAL34_PARAMETERS, *PAAL34_PARAMETERS; + +/* AAL5_PARAMETERS.Mode constants */ +#define AAL5_MODE_MESSAGE 0x01 +#define AAL5_MODE_STREAMING 0x02 + +/* AAL5_PARAMETERS.SSCSType constants */ +#define AAL5_SSCS_NULL 0x00 +#define AAL5_SSCS_SSCOP_ASSURED 0x01 +#define AAL5_SSCS_SSCOP_NON_ASSURED 0x02 +#define AAL5_SSCS_FRAME_RELAY 0x04 + +typedef struct _AAL5_PARAMETERS { + ULONG ForwardMaxCPCSSDUSize; + ULONG BackwardMaxCPCSSDUSize; + UCHAR Mode; + UCHAR SSCSType; +} AAL5_PARAMETERS, *PAAL5_PARAMETERS; + +typedef struct _AALUSER_PARAMETERS { + ULONG UserDefined; +} AALUSER_PARAMETERS, *PAALUSER_PARAMETERS; + +typedef struct _AAL_PARAMETERS_IE { + ATM_AAL_TYPE AALType; + union { + AAL1_PARAMETERS AAL1Parameters; + AAL34_PARAMETERS AAL34Parameters; + AAL5_PARAMETERS AAL5Parameters; + AALUSER_PARAMETERS AALUserParameters; + } AALSpecificParameters; +} AAL_PARAMETERS_IE, *PAAL_PARAMETERS_IE; + + +/* FIXME: Should the union be anonymous in C++ too? If so, + can't define named types _ATM_AAL5_INFO and _ATM_AAL0_INFO + within anonymous union for C++. */ +typedef struct _ATM_AAL_OOB_INFO +{ + ATM_AAL_TYPE AalType; +#ifndef __cplusplus + _ANONYMOUS_UNION +#endif + union { + struct _ATM_AAL5_INFO { + BOOLEAN CellLossPriority; + UCHAR UserToUserIndication; + UCHAR CommonPartIndicator; + } ATM_AAL5_INFO; + + struct _ATM_AAL0_INFO { + BOOLEAN CellLossPriority; + UCHAR PayLoadTypeIdentifier; + } ATM_AAL0_INFO; +#ifndef __cplusplus + } DUMMYUNIONNAME; +#else + } u; +#endif +} ATM_AAL_OOB_INFO, *PATM_AAL_OOB_INFO; + +typedef struct _ATM_ADDRESS { + ATM_ADDRESSTYPE AddressType; + ULONG NumberOfDigits; + UCHAR Address[ATM_ADDRESS_LENGTH]; +} ATM_ADDRESS, *PATM_ADDRESS; + +/* ATM_BHLI_IE.HighLayerInfoType constants */ +#define BHLI_ISO 0x00 +#define BHLI_UserSpecific 0x01 +#define BHLI_HighLayerProfile 0x02 +#define BHLI_VendorSpecificAppId 0x03 + +typedef struct _ATM_BHLI_IE { + ULONG HighLayerInfoType; + ULONG HighLayerInfoLength; + UCHAR HighLayerInfo[8]; +} ATM_BHLI_IE, *PATM_BHLI_IE; + +/* ATM_BLLI_IE.Layer2Protocol constants */ +#define BLLI_L2_ISO_1745 0x01 +#define BLLI_L2_Q921 0x02 +#define BLLI_L2_X25L 0x06 +#define BLLI_L2_X25M 0x07 +#define BLLI_L2_ELAPB 0x08 +#define BLLI_L2_HDLC_ARM 0x09 +#define BLLI_L2_HDLC_NRM 0x0A +#define BLLI_L2_HDLC_ABM 0x0B +#define BLLI_L2_LLC 0x0C +#define BLLI_L2_X75 0x0D +#define BLLI_L2_Q922 0x0E +#define BLLI_L2_USER_SPECIFIED 0x10 +#define BLLI_L2_ISO_7776 0x11 + +/* ATM_BLLI_IE.Layer3Protocol constants */ +#define BLLI_L3_X25 0x06 +#define BLLI_L3_ISO_8208 0x07 +#define BLLI_L3_X223 0x08 +#define BLLI_L3_SIO_8473 0x09 +#define BLLI_L3_T70 0x0A +#define BLLI_L3_ISO_TR9577 0x0B +#define BLLI_L3_USER_SPECIFIED 0x10 + +/* ATM_BLLI_IE.Layer3IPI constants */ +#define BLLI_L3_IPI_SNAP 0x80 +#define BLLI_L3_IPI_IP 0xCC + +typedef struct _ATM_BLLI_IE { + ULONG Layer2Protocol; + UCHAR Layer2Mode; + UCHAR Layer2WindowSize; + ULONG Layer2UserSpecifiedProtocol; + ULONG Layer3Protocol; + UCHAR Layer3Mode; + UCHAR Layer3DefaultPacketSize; + UCHAR Layer3PacketWindowSize; + ULONG Layer3UserSpecifiedProtocol; + ULONG Layer3IPI; + UCHAR SnapId[5]; +} ATM_BLLI_IE, *PATM_BLLI_IE; + +/* ATM_BROADBAND_BEARER_CAPABILITY_IE.BearerClass constants */ +#define BCOB_A 0x00 +#define BCOB_C 0x01 +#define BCOB_X 0x02 + +/* ATM_BROADBAND_BEARER_CAPABILITY_IE.TrafficType constants */ +#define TT_NOIND 0x00 +#define TT_CBR 0x04 +#define TT_VBR 0x08 + +/* ATM_BROADBAND_BEARER_CAPABILITY_IE.TimingRequirements constants */ +#define TR_NOIND 0x00 +#define TR_END_TO_END 0x01 +#define TR_NO_END_TO_END 0x02 + +/* ATM_BROADBAND_BEARER_CAPABILITY_IE.ClippingSusceptability constants */ +#define CLIP_NOT 0x00 +#define CLIP_SUS 0x20 + +/* ATM_BROADBAND_BEARER_CAPABILITY_IE.UserPlaneConnectionConfig constants */ +#define UP_P2P 0x00 +#define UP_P2MP 0x01 + +typedef struct _ATM_BROADBAND_BEARER_CAPABILITY_IE { + UCHAR BearerClass; + UCHAR TrafficType; + UCHAR TimingRequirements; + UCHAR ClippingSusceptability; + UCHAR UserPlaneConnectionConfig; +} ATM_BROADBAND_BEARER_CAPABILITY_IE, *PATM_BROADBAND_BEARER_CAPABILITY_IE; + +typedef struct _ATM_BROADBAND_SENDING_COMPLETE_IE { + UCHAR SendingComplete; +} ATM_BROADBAND_SENDING_COMPLETE_IE, *PATM_BROADBAND_SENDING_COMPLETE_IE; + +typedef struct _ATM_CALLING_PARTY_NUMBER_IE { + ATM_ADDRESS Number; + UCHAR PresentationIndication; + UCHAR ScreeningIndicator; +} ATM_CALLING_PARTY_NUMBER_IE, *PATM_CALLING_PARTY_NUMBER_IE; + +/* ATM_CAUSE_IE.Location constants */ +#define ATM_CAUSE_LOC_USER 0x00 +#define ATM_CAUSE_LOC_PRIVATE_LOCAL 0x01 +#define ATM_CAUSE_LOC_PUBLIC_LOCAL 0x02 +#define ATM_CAUSE_LOC_TRANSIT_NETWORK 0x03 +#define ATM_CAUSE_LOC_PUBLIC_REMOTE 0x04 +#define ATM_CAUSE_LOC_PRIVATE_REMOTE 0x05 +#define ATM_CAUSE_LOC_INTERNATIONAL_NETWORK 0x07 +#define ATM_CAUSE_LOC_BEYOND_INTERWORKING 0x0A + +/* ATM_CAUSE_IE.Cause constants */ +#define ATM_CAUSE_UNALLOCATED_NUMBER 0x01 +#define ATM_CAUSE_NO_ROUTE_TO_TRANSIT_NETWORK 0x02 +#define ATM_CAUSE_NO_ROUTE_TO_DESTINATION 0x03 +#define ATM_CAUSE_VPI_VCI_UNACCEPTABLE 0x0A +#define ATM_CAUSE_NORMAL_CALL_CLEARING 0x10 +#define ATM_CAUSE_USER_BUSY 0x11 +#define ATM_CAUSE_NO_USER_RESPONDING 0x12 +#define ATM_CAUSE_CALL_REJECTED 0x15 +#define ATM_CAUSE_NUMBER_CHANGED 0x16 +#define ATM_CAUSE_USER_REJECTS_CLIR 0x17 +#define ATM_CAUSE_DESTINATION_OUT_OF_ORDER 0x1B +#define ATM_CAUSE_INVALID_NUMBER_FORMAT 0x1C +#define ATM_CAUSE_STATUS_ENQUIRY_RESPONSE 0x1E +#define ATM_CAUSE_NORMAL_UNSPECIFIED 0x1F +#define ATM_CAUSE_VPI_VCI_UNAVAILABLE 0x23 +#define ATM_CAUSE_NETWORK_OUT_OF_ORDER 0x26 +#define ATM_CAUSE_TEMPORARY_FAILURE 0x29 +#define ATM_CAUSE_ACCESS_INFORMAION_DISCARDED 0x2B +#define ATM_CAUSE_NO_VPI_VCI_AVAILABLE 0x2D +#define ATM_CAUSE_RESOURCE_UNAVAILABLE 0x2F +#define ATM_CAUSE_QOS_UNAVAILABLE 0x31 +#define ATM_CAUSE_USER_CELL_RATE_UNAVAILABLE 0x33 +#define ATM_CAUSE_BEARER_CAPABILITY_UNAUTHORIZED 0x39 +#define ATM_CAUSE_BEARER_CAPABILITY_UNAVAILABLE 0x3A +#define ATM_CAUSE_OPTION_UNAVAILABLE 0x3F +#define ATM_CAUSE_BEARER_CAPABILITY_UNIMPLEMENTED 0x41 +#define ATM_CAUSE_UNSUPPORTED_TRAFFIC_PARAMETERS 0x49 +#define ATM_CAUSE_INVALID_CALL_REFERENCE 0x51 +#define ATM_CAUSE_CHANNEL_NONEXISTENT 0x52 +#define ATM_CAUSE_INCOMPATIBLE_DESTINATION 0x58 +#define ATM_CAUSE_INVALID_ENDPOINT_REFERENCE 0x59 +#define ATM_CAUSE_INVALID_TRANSIT_NETWORK_SELECTION 0x5B +#define ATM_CAUSE_TOO_MANY_PENDING_ADD_PARTY 0x5C +#define ATM_CAUSE_AAL_PARAMETERS_UNSUPPORTED 0x5D +#define ATM_CAUSE_MANDATORY_IE_MISSING 0x60 +#define ATM_CAUSE_UNIMPLEMENTED_MESSAGE_TYPE 0x61 +#define ATM_CAUSE_UNIMPLEMENTED_IE 0x63 +#define ATM_CAUSE_INVALID_IE_CONTENTS 0x64 +#define ATM_CAUSE_INVALID_STATE_FOR_MESSAGE 0x65 +#define ATM_CAUSE_RECOVERY_ON_TIMEOUT 0x66 +#define ATM_CAUSE_INCORRECT_MESSAGE_LENGTH 0x68 +#define ATM_CAUSE_PROTOCOL_ERROR 0x6F + +/* ATM_CAUSE_IE.Diagnostics constants */ +#define ATM_CAUSE_COND_UNKNOWN 0x00 +#define ATM_CAUSE_COND_PERMANENT 0x01 +#define ATM_CAUSE_COND_TRANSIENT 0x02 +#define ATM_CAUSE_REASON_USER 0x00 +#define ATM_CAUSE_REASON_IE_MISSING 0x04 +#define ATM_CAUSE_REASON_IE_INSUFFICIENT 0x08 +#define ATM_CAUSE_PU_PROVIDER 0x00 +#define ATM_CAUSE_PU_USER 0x08 +#define ATM_CAUSE_NA_NORMAL 0x00 +#define ATM_CAUSE_NA_ABNORMAL 0x04 + +typedef struct _ATM_CAUSE_IE { + UCHAR Location; + UCHAR Cause; + UCHAR DiagnosticsLength; + UCHAR Diagnostics[4]; +} ATM_CAUSE_IE, *PATM_CAUSE_IE; + + +typedef ULONG ATM_SERVICE_CATEGORY, *PATM_SERVICE_CATEGORY; + +/* ATM_FLOW_PARAMETERS.ServiceCategory constants */ +#define ATM_SERVICE_CATEGORY_CBR 1 +#define ATM_SERVICE_CATEGORY_VBR 2 +#define ATM_SERVICE_CATEGORY_UBR 4 +#define ATM_SERVICE_CATEGORY_ABR 8 + +/* ATM_FLOW_PARAMETERS.Reserved1 constants */ +#define ATM_FLOW_PARAMS_RSVD1_MPP 0x01 + +typedef struct _ATM_FLOW_PARAMETERS { + ATM_SERVICE_CATEGORY ServiceCategory; + ULONG AverageCellRate; + ULONG PeakCellRate; + ULONG MinimumCellRate; + ULONG InitialCellRate; + ULONG BurstLengthCells; + ULONG MaxSduSize; + ULONG TransientBufferExposure; + ULONG CumulativeRMFixedRTT; + UCHAR RateIncreaseFactor; + UCHAR RateDecreaseFactor; + USHORT ACRDecreaseTimeFactor; + UCHAR MaximumCellsPerForwardRMCell; + UCHAR MaximumForwardRMCellInterval; + UCHAR CutoffDecreaseFactor; + UCHAR Reserved1; + ULONG MissingRMCellCount; + ULONG Reserved2; + ULONG Reserved3; +} ATM_FLOW_PARAMETERS, *PATM_FLOW_PARAMETERS; + +typedef struct _ATM_VPIVCI { + ULONG Vpi; + ULONG Vci; +} ATM_VPIVCI, *PATM_VPIVCI; + +typedef struct _ATM_MEDIA_PARAMETERS { + ATM_VPIVCI ConnectionId; + ATM_AAL_TYPE AALType; + ULONG CellDelayVariationCLP0; + ULONG CellDelayVariationCLP1; + ULONG CellLossRatioCLP0; + ULONG CellLossRatioCLP1; + ULONG CellTransferDelayCLP0; + ULONG CellTransferDelayCLP1; + ULONG DefaultCLP; + ATM_FLOW_PARAMETERS Transmit; + ATM_FLOW_PARAMETERS Receive; +} ATM_MEDIA_PARAMETERS, *PATM_MEDIA_PARAMETERS; + +typedef struct _ATM_PVC_SAP { + ATM_BLLI_IE Blli; + ATM_BHLI_IE Bhli; +} ATM_PVC_SAP, *PATM_PVC_SAP; + +/* ATM_QOS_CLASS_IE constants */ +#define QOS_CLASS0 0x00 +#define QOS_CLASS1 0x01 +#define QOS_CLASS2 0x02 +#define QOS_CLASS3 0x03 +#define QOS_CLASS4 0x04 + +typedef struct _ATM_QOS_CLASS_IE { + UCHAR QOSClassForward; + UCHAR QOSClassBackward; +} ATM_QOS_CLASS_IE, *PATM_QOS_CLASS_IE; + +typedef struct _ATM_RAW_IE { + ULONG RawIELength; + ULONG RawIEType; + UCHAR RawIEValue[1]; +} ATM_RAW_IE, *PATM_RAW_IE; + +typedef struct _ATM_SAP { + ATM_BLLI_IE Blli; + ATM_BHLI_IE Bhli; + ULONG NumberOfAddresses; + UCHAR Addresses[1]; +} ATM_SAP, *PATM_SAP; + +typedef struct _ATM_TRAFFIC_DESCRIPTOR { + ULONG PeakCellRateCLP0; + ULONG PeakCellRateCLP01; + ULONG SustainableCellRateCLP0; + ULONG SustainableCellRateCLP01; + ULONG MaximumBurstSizeCLP0; + ULONG MaximumBurstSizeCLP01; + BOOLEAN BestEffort; + BOOLEAN Tagging; +} ATM_TRAFFIC_DESCRIPTOR, *PATM_TRAFFIC_DESCRIPTOR; + +typedef struct _ATM_TRAFFIC_DESCRIPTOR_IE { + ATM_TRAFFIC_DESCRIPTOR ForwardTD; + ATM_TRAFFIC_DESCRIPTOR BackwardTD; + BOOLEAN BestEffort; +} ATM_TRAFFIC_DESCRIPTOR_IE, *PATM_TRAFFIC_DESCRIPTOR_IE; + +/* ATM_TRANSIT_NETWORK_SELECTION_IE.TypeOfNetworkId constants */ +#define TNS_TYPE_NATIONAL 0x40 + +/* ATM_TRANSIT_NETWORK_SELECTION_IE.NetworkIdPlan constants */ +#define TNS_PLAN_CARRIER_ID_CODE 0x01 + +typedef struct _ATM_TRANSIT_NETWORK_SELECTION_IE { + UCHAR TypeOfNetworkId; + UCHAR NetworkIdPlan; + UCHAR NetworkIdLength; + UCHAR NetworkId[1]; +} ATM_TRANSIT_NETWORK_SELECTION_IE, *PATM_TRANSIT_NETWORK_SELECTION_IE; + +typedef struct _ATM_LIJ_CALLID_IE { + ULONG Identifier; +} ATM_LIJ_CALLID_IE, *PATM_LIJ_CALLID_IE; + +/* Q2931_ADD_PVC.Flags constants */ +#define CO_FLAG_SIGNALING_VC 0x00000001 +#define CO_FLAG_NO_DEST_SAP 0x00000002 + +typedef struct _Q2931_ADD_PVC { + ATM_ADDRESS CalledParty; + ATM_ADDRESS CallingParty; + ATM_VPIVCI ConnectionId; + ATM_AAL_TYPE AALType; + ATM_FLOW_PARAMETERS ForwardFP; + ATM_FLOW_PARAMETERS BackwardFP; + ULONG Flags; + ATM_PVC_SAP LocalSap; + ATM_PVC_SAP DestinationSap; + BOOLEAN LIJIdPresent; + ATM_LIJ_CALLID_IE LIJId; +} Q2931_ADD_PVC, *PQ2931_ADD_PVC; + +typedef struct _Q2931_DELETE_PVC { + ATM_VPIVCI ConnectionId; +} Q2931_DELETE_PVC, *PQ2931_DELETE_PVC; + +typedef ATM_ADDRESS ATM_CALLED_PARTY_NUMBER_IE; +typedef ATM_ADDRESS ATM_CALLED_PARTY_SUBADDRESS_IE; +typedef ATM_ADDRESS ATM_CALLING_PARTY_SUBADDRESS_IE; + +typedef struct _Q2931_CALLMGR_PARAMETERS { + ATM_ADDRESS CalledParty; + ATM_ADDRESS CallingParty; + ULONG InfoElementCount; + UCHAR InfoElements[1]; +} Q2931_CALLMGR_PARAMETERS, *PQ2931_CALLMGR_PARAMETERS; + +typedef struct _ATM_VC_RATES_SUPPORTED { + ULONG MinCellRate; + ULONG MaxCellRate; +} ATM_VC_RATES_SUPPORTED, *PATM_VC_RATES_SUPPORTED; + +typedef ULONG ATM_SERVICE_REGISTRY_TYPE; + +/* ATM_SERVICE_ADDRESS_LIST.ServiceRegistryType constants */ +#define ATM_SERVICE_REGISTRY_LECS 1 +#define ATM_SERVICE_REGISTRY_ANS 2 + +typedef struct _ATM_SERVICE_ADDRESS_LIST { + ATM_SERVICE_REGISTRY_TYPE ServiceRegistryType; + ULONG NumberOfAddressesAvailable; + ULONG NumberOfAddressesReturned; + ATM_ADDRESS Address[1]; +} ATM_SERVICE_ADDRESS_LIST, *PATM_SERVICE_ADDRESS_LIST; + +#ifdef __cplusplus +} +#endif + +#endif /* _ATM_H */ diff --git a/reactos/include/ddk/batclass.h b/reactos/include/ddk/batclass.h new file mode 100644 index 00000000000..769bfe92fbd --- /dev/null +++ b/reactos/include/ddk/batclass.h @@ -0,0 +1,296 @@ +/* + * batclass.h + * + * Battery class driver interface + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __BATCLASS_H +#define __BATCLASS_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(_BATTERYCLASS_) + #define BCLASSAPI DECLSPEC_EXPORT +#else + #define BCLASSAPI DECLSPEC_IMPORT +#endif + + +/* Battery device GUIDs */ + +DEFINE_GUID(GUID_DEVICE_BATTERY, + 0x72631e54L, 0x78A4, 0x11d0, 0xbc, 0xf7, 0x00, 0xaa, 0x00, 0xb7, 0xb3, 0x2a); + +DEFINE_GUID(BATTERY_STATUS_WMI_GUID, + 0xfc4670d1, 0xebbf, 0x416e, 0x87, 0xce, 0x37, 0x4a, 0x4e, 0xbc, 0x11, 0x1a); + +DEFINE_GUID(BATTERY_RUNTIME_WMI_GUID, + 0x535a3767, 0x1ac2, 0x49bc, 0xa0, 0x77, 0x3f, 0x7a, 0x02, 0xe4, 0x0a, 0xec); + +DEFINE_GUID(BATTERY_TEMPERATURE_WMI_GUID, + 0x1a52a14d, 0xadce, 0x4a44, 0x9a, 0x3e, 0xc8, 0xd8, 0xf1, 0x5f, 0xf2, 0xc2); + +DEFINE_GUID(BATTERY_FULL_CHARGED_CAPACITY_WMI_GUID, + 0x40b40565, 0x96f7, 0x4435, 0x86, 0x94, 0x97, 0xe0, 0xe4, 0x39, 0x59, 0x05); + +DEFINE_GUID(BATTERY_CYCLE_COUNT_WMI_GUID, + 0xef98db24, 0x0014, 0x4c25, 0xa5, 0x0b, 0xc7, 0x24, 0xae, 0x5c, 0xd3, 0x71); + +DEFINE_GUID(BATTERY_STATIC_DATA_WMI_GUID, + 0x05e1e463, 0xe4e2, 0x4ea9, 0x80, 0xcb, 0x9b, 0xd4, 0xb3, 0xca, 0x06, 0x55); + +DEFINE_GUID(BATTERY_STATUS_CHANGE_WMI_GUID, + 0xcddfa0c3, 0x7c5b, 0x4e43, 0xa0, 0x34, 0x05, 0x9f, 0xa5, 0xb8, 0x43, 0x64); + +DEFINE_GUID(BATTERY_TAG_CHANGE_WMI_GUID, + 0x5e1f6e19, 0x8786, 0x4d23, 0x94, 0xfc, 0x9e, 0x74, 0x6b, 0xd5, 0xd8, 0x88); + + +/* BATTERY_INFORMATION.Capabilities constants */ +#define BATTERY_SET_CHARGE_SUPPORTED 0x00000001 +#define BATTERY_SET_DISCHARGE_SUPPORTED 0x00000002 +#define BATTERY_SET_RESUME_SUPPORTED 0x00000004 +#define BATTERY_IS_SHORT_TERM 0x20000000 +#define BATTERY_CAPACITY_RELATIVE 0x40000000 +#define BATTERY_SYSTEM_BATTERY 0x80000000 + +typedef struct _BATTERY_INFORMATION { + ULONG Capabilities; + UCHAR Technology; + UCHAR Reserved[3]; + UCHAR Chemistry[4]; + ULONG DesignedCapacity; + ULONG FullChargedCapacity; + ULONG DefaultAlert1; + ULONG DefaultAlert2; + ULONG CriticalBias; + ULONG CycleCount; +} BATTERY_INFORMATION, *PBATTERY_INFORMATION; + +typedef struct _BATTERY_MANUFACTURE_DATE { + UCHAR Day; + UCHAR Month; + USHORT Year; +} BATTERY_MANUFACTURE_DATE, *PBATTERY_MANUFACTURE_DATE; + +typedef struct _BATTERY_NOTIFY { + ULONG PowerState; + ULONG LowCapacity; + ULONG HighCapacity; +} BATTERY_NOTIFY, *PBATTERY_NOTIFY; + +/* BATTERY_STATUS.PowerState flags */ +#define BATTERY_POWER_ON_LINE 0x00000001 +#define BATTERY_DISCHARGING 0x00000002 +#define BATTERY_CHARGING 0x00000004 +#define BATTERY_CRITICAL 0x00000008 + +/* BATTERY_STATUS.Voltage constant */ +#define BATTERY_UNKNOWN_VOLTAGE 0xFFFFFFFF + +/* BATTERY_STATUS.Rate constant */ +#define BATTERY_UNKNOWN_RATE 0x80000000 + +typedef struct _BATTERY_STATUS { + ULONG PowerState; + ULONG Capacity; + ULONG Voltage; + LONG Rate; +} BATTERY_STATUS, *PBATTERY_STATUS; + +/* BATTERY_INFORMATION.Capacity constants */ +#define BATTERY_UNKNOWN_CAPACITY 0xFFFFFFFF + +typedef enum _BATTERY_QUERY_INFORMATION_LEVEL { + BatteryInformation = 0, + BatteryGranularityInformation, + BatteryTemperature, + BatteryEstimatedTime, + BatteryDeviceName, + BatteryManufactureDate, + BatteryManufactureName, + BatteryUniqueID, + BatterySerialNumber +} BATTERY_QUERY_INFORMATION_LEVEL; + +/* BatteryEstimatedTime constant */ +#define BATTERY_UNKNOWN_TIME 0x80000000 + +/* NTSTATUS possibly returned by BCLASS_QUERY_STATUS */ +#define BATTERY_TAG_INVALID 0 + +typedef struct _BATTERY_QUERY_INFORMATION { + ULONG BatteryTag; + BATTERY_QUERY_INFORMATION_LEVEL InformationLevel; + LONG AtRate; +} BATTERY_QUERY_INFORMATION, *PBATTERY_QUERY_INFORMATION; + +typedef enum _BATTERY_SET_INFORMATION_LEVEL { + BatteryCriticalBias = 0, + BatteryCharge, + BatteryDischarge +} BATTERY_SET_INFORMATION_LEVEL; + +#define MAX_BATTERY_STRING_SIZE 128 + +typedef struct _BATTERY_SET_INFORMATION { + ULONG BatteryTag; + BATTERY_SET_INFORMATION_LEVEL InformationLevel; + UCHAR Buffer[1]; +} BATTERY_SET_INFORMATION, *PBATTERY_SET_INFORMATION; + +typedef struct _BATTERY_WAIT_STATUS { + ULONG BatteryTag; + ULONG Timeout; + ULONG PowerState; + ULONG LowCapacity; + ULONG HighCapacity; +} BATTERY_WAIT_STATUS, *PBATTERY_WAIT_STATUS; + + +#define IOCTL_BATTERY_QUERY_TAG \ + CTL_CODE(FILE_DEVICE_BATTERY, 0x10, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_BATTERY_QUERY_INFORMATION \ + CTL_CODE(FILE_DEVICE_BATTERY, 0x11, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_BATTERY_SET_INFORMATION \ + CTL_CODE(FILE_DEVICE_BATTERY, 0x12, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_BATTERY_QUERY_STATUS \ + CTL_CODE(FILE_DEVICE_BATTERY, 0x13, METHOD_BUFFERED, FILE_READ_ACCESS) + + +typedef NTSTATUS +(DDKAPI*BCLASS_DISABLE_STATUS_NOTIFY)( + IN PVOID Context); + +typedef NTSTATUS +(DDKAPI*BCLASS_QUERY_INFORMATION)( + IN PVOID Context, + IN ULONG BatteryTag, + IN BATTERY_QUERY_INFORMATION_LEVEL Level, + IN LONG AtRate OPTIONAL, + OUT PVOID Buffer, + IN ULONG BufferLength, + OUT PULONG ReturnedLength); + +typedef NTSTATUS +(DDKAPI*BCLASS_QUERY_STATUS)( + IN PVOID Context, + IN ULONG BatteryTag, + OUT PBATTERY_STATUS BatteryStatus); + +typedef NTSTATUS +(DDKAPI*BCLASS_QUERY_TAG)( + IN PVOID Context, + OUT PULONG BatteryTag); + +typedef NTSTATUS +(DDKAPI*BCLASS_SET_INFORMATION)( + IN PVOID Context, + IN ULONG BatteryTag, + IN BATTERY_SET_INFORMATION_LEVEL Level, + IN PVOID Buffer OPTIONAL); + +typedef NTSTATUS +(DDKAPI*BCLASS_SET_STATUS_NOTIFY)( + IN PVOID Context, + IN ULONG BatteryTag, + IN PBATTERY_NOTIFY BatteryNotify); + + +typedef struct _BATTERY_MINIPORT_INFO { + USHORT MajorVersion; + USHORT MinorVersion; + PVOID Context; + BCLASS_QUERY_TAG QueryTag; + BCLASS_QUERY_INFORMATION QueryInformation; + BCLASS_SET_INFORMATION SetInformation; + BCLASS_QUERY_STATUS QueryStatus; + BCLASS_SET_STATUS_NOTIFY SetStatusNotify; + BCLASS_DISABLE_STATUS_NOTIFY DisableStatusNotify; + PDEVICE_OBJECT Pdo; + PUNICODE_STRING DeviceName; +} BATTERY_MINIPORT_INFO, *PBATTERY_MINIPORT_INFO; + +/* BATTERY_MINIPORT_INFO.XxxVersion */ +#define BATTERY_CLASS_MAJOR_VERSION 0x0001 +#define BATTERY_CLASS_MINOR_VERSION 0x0000 + + +BCLASSAPI +NTSTATUS +DDKAPI +BatteryClassInitializeDevice( + IN PBATTERY_MINIPORT_INFO MiniportInfo, + IN PVOID *ClassData); + +BCLASSAPI +NTSTATUS +DDKAPI +BatteryClassIoctl( + IN PVOID ClassData, + IN PIRP Irp); + +BCLASSAPI +NTSTATUS +DDKAPI +BatteryClassQueryWmiDataBlock( + IN PVOID ClassData, + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp, + IN ULONG GuidIndex, + IN OUT PULONG InstanceLengthArray, + IN ULONG OutBufferSize, + OUT PUCHAR Buffer); + +BCLASSAPI +NTSTATUS +DDKAPI +BatteryClassStatusNotify( + IN PVOID ClassData); + +BCLASSAPI +NTSTATUS +DDKAPI +BatteryClassSystemControl( + IN PVOID ClassData, + IN PWMILIB_CONTEXT WmiLibContext, + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp, + OUT PSYSCTL_IRP_DISPOSITION Disposition); + +BCLASSAPI +NTSTATUS +DDKAPI +BatteryClassUnload( + IN PVOID ClassData); + +#ifdef __cplusplus +} +#endif + +#endif /* __BATCLASS_H */ diff --git a/reactos/include/ddk/cfg.h b/reactos/include/ddk/cfg.h new file mode 100644 index 00000000000..a15dfb3c82b --- /dev/null +++ b/reactos/include/ddk/cfg.h @@ -0,0 +1,147 @@ +/* + * cfg.h + * + * PnP Configuration Manager shared definitions between user mode and kernel mode code + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef _CFG_INCLUDED_ +#define _CFG_INCLUDED_ + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define CM_PROB_NOT_CONFIGURED 0x00000001 +#define CM_PROB_DEVLOADER_FAILED 0x00000002 +#define CM_PROB_OUT_OF_MEMORY 0x00000003 +#define CM_PROB_ENTRY_IS_WRONG_TYPE 0x00000004 +#define CM_PROB_LACKED_ARBITRATOR 0x00000005 +#define CM_PROB_BOOT_CONFIG_CONFLICT 0x00000006 +#define CM_PROB_FAILED_FILTER 0x00000007 +#define CM_PROB_DEVLOADER_NOT_FOUND 0x00000008 +#define CM_PROB_INVALID_DATA 0x00000009 +#define CM_PROB_FAILED_START 0x0000000A +#define CM_PROB_LIAR 0x0000000B +#define CM_PROB_NORMAL_CONFLICT 0x0000000C +#define CM_PROB_NOT_VERIFIED 0x0000000D +#define CM_PROB_NEED_RESTART 0x0000000E +#define CM_PROB_REENUMERATION 0x0000000F +#define CM_PROB_PARTIAL_LOG_CONF 0x00000010 +#define CM_PROB_UNKNOWN_RESOURCE 0x00000011 +#define CM_PROB_REINSTALL 0x00000012 +#define CM_PROB_REGISTRY 0x00000013 +#define CM_PROB_VXDLDR 0x00000014 +#define CM_PROB_WILL_BE_REMOVED 0x00000015 +#define CM_PROB_DISABLED 0x00000016 +#define CM_PROB_DEVLOADER_NOT_READY 0x00000017 +#define CM_PROB_DEVICE_NOT_THERE 0x00000018 +#define CM_PROB_MOVED 0x00000019 +#define CM_PROB_TOO_EARLY 0x0000001A +#define CM_PROB_NO_VALID_LOG_CONF 0x0000001B +#define CM_PROB_FAILED_INSTALL 0x0000001C +#define CM_PROB_HARDWARE_DISABLED 0x0000001D +#define CM_PROB_CANT_SHARE_IRQ 0x0000001E +#define CM_PROB_FAILED_ADD 0x0000001F +#define CM_PROB_DISABLED_SERVICE 0x00000020 +#define CM_PROB_TRANSLATION_FAILED 0x00000021 +#define CM_PROB_NO_SOFTCONFIG 0x00000022 +#define CM_PROB_BIOS_TABLE 0x00000023 +#define CM_PROB_IRQ_TRANSLATION_FAILED 0x00000024 +#define CM_PROB_FAILED_DRIVER_ENTRY 0x00000025 +#define CM_PROB_DRIVER_FAILED_PRIOR_UNLOAD 0x00000026 +#define CM_PROB_DRIVER_FAILED_LOAD 0x00000027 +#define CM_PROB_DRIVER_SERVICE_KEY_INVALID 0x00000028 +#define CM_PROB_LEGACY_SERVICE_NO_DEVICES 0x00000029 +#define CM_PROB_DUPLICATE_DEVICE 0x0000002A +#define CM_PROB_FAILED_POST_START 0x0000002B +#define CM_PROB_HALTED 0x0000002C +#define CM_PROB_PHANTOM 0x0000002D +#define CM_PROB_SYSTEM_SHUTDOWN 0x0000002E +#define CM_PROB_HELD_FOR_EJECT 0x0000002F +#define CM_PROB_DRIVER_BLOCKED 0x00000030 +#define CM_PROB_REGISTRY_TOO_LARGE 0x00000031 +#define CM_PROB_SETPROPERTIES_FAILED 0x00000032 +#define NUM_CM_PROB 0x00000033 + +#define LCPRI_FORCECONFIG 0x00000000 +#define LCPRI_BOOTCONFIG 0x00000001 +#define LCPRI_DESIRED 0x00002000 +#define LCPRI_NORMAL 0x00003000 +#define LCPRI_LASTBESTCONFIG 0x00003FFF +#define LCPRI_SUBOPTIMAL 0x00005000 +#define LCPRI_LASTSOFTCONFIG 0x00007FFF +#define LCPRI_RESTART 0x00008000 +#define LCPRI_REBOOT 0x00009000 +#define LCPRI_POWEROFF 0x0000A000 +#define LCPRI_HARDRECONFIG 0x0000C000 +#define LCPRI_HARDWIRED 0x0000E000 +#define LCPRI_IMPOSSIBLE 0x0000F000 +#define LCPRI_DISABLED 0x0000FFFF +#define MAX_LCPRI 0x0000FFFF + +#define DN_ROOT_ENUMERATED 0x00000001 /* Was enumerated by ROOT */ +#define DN_DRIVER_LOADED 0x00000002 /* Has Register_Device_Driver */ +#define DN_ENUM_LOADED 0x00000004 /* Has Register_Enumerator */ +#define DN_STARTED 0x00000008 /* Is currently configured */ +#define DN_MANUAL 0x00000010 /* Manually installed */ +#define DN_NEED_TO_ENUM 0x00000020 /* May need reenumeration */ +#define DN_NOT_FIRST_TIME 0x00000040 /* Has received a config */ +#define DN_HARDWARE_ENUM 0x00000080 /* Enum generates hardware ID */ +#define DN_LIAR 0x00000100 /* Lied about can reconfig once */ +#define DN_HAS_MARK 0x00000200 /* Not CM_Create_DevNode lately */ +#define DN_HAS_PROBLEM 0x00000400 /* Need device installer */ +#define DN_FILTERED 0x00000800 /* Is filtered */ +#define DN_MOVED 0x00001000 /* Has been moved */ +#define DN_DISABLEABLE 0x00002000 /* Can be rebalanced */ +#define DN_REMOVABLE 0x00004000 /* Can be removed */ +#define DN_PRIVATE_PROBLEM 0x00008000 /* Has a private problem */ +#define DN_MF_PARENT 0x00010000 /* Multi function parent */ +#define DN_MF_CHILD 0x00020000 /* Multi function child */ +#define DN_WILL_BE_REMOVED 0x00040000 /* Devnode is being removed */ + +typedef enum _PNP_VETO_TYPE { + PNP_VetoTypeUnknown, + PNP_VetoLegacyDevice, + PNP_VetoPendingClose, + PNP_VetoWindowsApp, + PNP_VetoWindowsService, + PNP_VetoOutstandingOpen, + PNP_VetoDevice, + PNP_VetoDriver, + PNP_VetoIllegalDeviceRequest, + PNP_VetoInsufficientPower, + PNP_VetoNonDisableable, + PNP_VetoLegacyDriver +} PNP_VETO_TYPE, *PPNP_VETO_TYPE; + +#define CM_GLOBAL_STATE_CAN_DO_UI 0x00000001 +#define CM_GLOBAL_STATE_ON_BIG_STACK 0x00000002 +#define CM_GLOBAL_STATE_SERVICES_AVAILABLE 0x00000004 +#define CM_GLOBAL_STATE_SHUTTING_DOWN 0x00000008 +#define CM_GLOBAL_STATE_DETECTION_PENDING 0x00000010 + +#ifdef __cplusplus +} +#endif + +#endif /* _CFG_INCLUDED_ */ diff --git a/reactos/include/ddk/cfgmgr32.h b/reactos/include/ddk/cfgmgr32.h new file mode 100644 index 00000000000..d01722306ec --- /dev/null +++ b/reactos/include/ddk/cfgmgr32.h @@ -0,0 +1,2037 @@ +/* + * cfgmgr32.h + * + * PnP configuration manager + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef _CFGMGR32_H_ +#define _CFGMGR32_H_ + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include "cfg.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(_CFGMGR32_) +#define CMAPI DECLSPEC_EXPORT +#else +#define CMAPI DECLSPEC_IMPORT +#endif + +#include + +#define CR_SUCCESS 0x00000000 +#define CR_DEFAULT 0x00000001 +#define CR_OUT_OF_MEMORY 0x00000002 +#define CR_INVALID_POINTER 0x00000003 +#define CR_INVALID_FLAG 0x00000004 +#define CR_INVALID_DEVNODE 0x00000005 +#define CR_INVALID_DEVINST CR_INVALID_DEVNODE +#define CR_INVALID_RES_DES 0x00000006 +#define CR_INVALID_LOG_CONF 0x00000007 +#define CR_INVALID_ARBITRATOR 0x00000008 +#define CR_INVALID_NODELIST 0x00000009 +#define CR_DEVNODE_HAS_REQS 0x0000000A +#define CR_DEVINST_HAS_REQS CR_DEVNODE_HAS_REQS +#define CR_INVALID_RESOURCEID 0x0000000B +#define CR_DLVXD_NOT_FOUND 0x0000000C +#define CR_NO_SUCH_DEVNODE 0x0000000D +#define CR_NO_SUCH_DEVINST CR_NO_SUCH_DEVNODE +#define CR_NO_MORE_LOG_CONF 0x0000000E +#define CR_NO_MORE_RES_DES 0x0000000F +#define CR_ALREADY_SUCH_DEVNODE 0x00000010 +#define CR_ALREADY_SUCH_DEVINST CR_ALREADY_SUCH_DEVNODE +#define CR_INVALID_RANGE_LIST 0x00000011 +#define CR_INVALID_RANGE 0x00000012 +#define CR_FAILURE 0x00000013 +#define CR_NO_SUCH_LOGICAL_DEV 0x00000014 +#define CR_CREATE_BLOCKED 0x00000015 +#define CR_NOT_SYSTEM_VM 0x00000016 +#define CR_REMOVE_VETOED 0x00000017 +#define CR_APM_VETOED 0x00000018 +#define CR_INVALID_LOAD_TYPE 0x00000019 +#define CR_BUFFER_SMALL 0x0000001A +#define CR_NO_ARBITRATOR 0x0000001B +#define CR_NO_REGISTRY_HANDLE 0x0000001C +#define CR_REGISTRY_ERROR 0x0000001D +#define CR_INVALID_DEVICE_ID 0x0000001E +#define CR_INVALID_DATA 0x0000001F +#define CR_INVALID_API 0x00000020 +#define CR_DEVLOADER_NOT_READY 0x00000021 +#define CR_NEED_RESTART 0x00000022 +#define CR_NO_MORE_HW_PROFILES 0x00000023 +#define CR_DEVICE_NOT_THERE 0x00000024 +#define CR_NO_SUCH_VALUE 0x00000025 +#define CR_WRONG_TYPE 0x00000026 +#define CR_INVALID_PRIORITY 0x00000027 +#define CR_NOT_DISABLEABLE 0x00000028 +#define CR_FREE_RESOURCES 0x00000029 +#define CR_QUERY_VETOED 0x0000002A +#define CR_CANT_SHARE_IRQ 0x0000002B +#define CR_NO_DEPENDENT 0x0000002C +#define CR_SAME_RESOURCES 0x0000002D +#define CR_NO_SUCH_REGISTRY_KEY 0x0000002E +#define CR_INVALID_MACHINENAME 0x0000002F +#define CR_REMOTE_COMM_FAILURE 0x00000030 +#define CR_MACHINE_UNAVAILABLE 0x00000031 +#define CR_NO_CM_SERVICES 0x00000032 +#define CR_ACCESS_DENIED 0x00000033 +#define CR_CALL_NOT_IMPLEMENTED 0x00000034 +#define CR_INVALID_PROPERTY 0x00000035 +#define CR_DEVICE_INTERFACE_ACTIVE 0x00000036 +#define CR_NO_SUCH_DEVICE_INTERFACE 0x00000037 +#define CR_INVALID_REFERENCE_STRING 0x00000038 +#define CR_INVALID_CONFLICT_LIST 0x00000039 +#define CR_INVALID_INDEX 0x0000003A +#define CR_INVALID_STRUCTURE_SIZE 0x0000003B + +#define RegDisposition_OpenAlways 0x00000000 +#define RegDisposition_OpenExisting 0x00000001 +#define RegDisposition_Bits 0x00000001 + + +typedef DWORD RETURN_TYPE; +typedef RETURN_TYPE CONFIGRET; + +typedef HANDLE HMACHINE; +typedef HMACHINE *PHMACHINE; + +typedef DWORD_PTR RES_DES; +typedef RES_DES *PRES_DES; + +typedef DWORD_PTR RANGE_ELEMENT; +typedef RANGE_ELEMENT *PRANGE_ELEMENT; + +typedef ULONG_PTR CONFLICT_LIST; +typedef CONFLICT_LIST *PCONFLICT_LIST; + +typedef DWORD_PTR LOG_CONF; +typedef LOG_CONF *PLOG_CONF; + +typedef ULONG PRIORITY; +typedef PRIORITY *PPRIORITY; + +typedef DWORD_PTR RANGE_LIST; +typedef RANGE_LIST *PRANGE_LIST; + +typedef DWORD DEVNODE, DEVINST; +typedef DEVNODE *PDEVNODE, *PDEVINST; + +typedef CHAR *DEVNODEID_A, *DEVINSTID_A; +typedef WCHAR *DEVNODEID_W, *DEVINSTID_W; + +#ifdef UNICODE +typedef DEVNODEID_W DEVNODEID; +typedef DEVINSTID_W DEVINSTID; +#else +typedef DEVNODEID_A DEVNODEID; +typedef DEVINSTID_A DEVINSTID; +#endif + +typedef ULONG REGDISPOSITION; + +typedef ULONG RESOURCEID; +typedef RESOURCEID *PRESOURCEID; + +#define CM_RESDES_WIDTH_DEFAULT 0x00000000 +#define CM_RESDES_WIDTH_32 0x00000001 +#define CM_RESDES_WIDTH_64 0x00000002 +#define CM_RESDES_WIDTH_BITS 0x00000003 + + +#define MAX_CONFIG_VALUE 9999 +#define MAX_INSTANCE_VALUE 9999 + +#define MAX_DEVICE_ID_LEN 200 +#define MAX_DEVNODE_ID_LEN MAX_DEVICE_ID_LEN + +#define MAX_CLASS_NAME_LEN 32 +#define MAX_GUID_STRING_LEN 39 +#define MAX_PROFILE_LEN 80 + + +#define ResType_All 0x00000000 +#define ResType_None 0x00000000 +#define ResType_Mem 0x00000001 +#define ResType_IO 0x00000002 +#define ResType_DMA 0x00000003 +#define ResType_IRQ 0x00000004 +#define ResType_DoNotUse 0x00000005 +#define ResType_BusNumber 0x00000006 +#define ResType_MAX 0x00000006 +#define ResType_Ignored_Bit 0x00008000 +#define ResType_ClassSpecific 0x0000FFFF +#define ResType_Reserved 0x00008000 +#define ResType_DevicePrivate 0x00008001 +#define ResType_PcCardConfig 0x00008002 +#define ResType_MfCardConfig 0x00008003 + +#define CM_GETIDLIST_FILTER_NONE 0x00000000 +#define CM_GETIDLIST_FILTER_ENUMERATOR 0x00000001 +#define CM_GETIDLIST_FILTER_SERVICE 0x00000002 +#define CM_GETIDLIST_FILTER_EJECTRELATIONS 0x00000004 +#define CM_GETIDLIST_FILTER_REMOVALRELATIONS 0x00000008 +#define CM_GETIDLIST_FILTER_POWERRELATIONS 0x00000010 +#define CM_GETIDLIST_FILTER_BUSRELATIONS 0x00000020 +#define CM_GETIDLIST_DONOTGENERATE 0x10000040 +#define CM_GETIDLIST_FILTER_BITS 0x1000007F + +#define CM_GET_DEVICE_INTERFACE_LIST_PRESENT 0x00000000 +#define CM_GET_DEVICE_INTERFACE_LIST_ALL_DEVICES 0x00000001 +#define CM_GET_DEVICE_INTERFACE_LIST_BITS 0x00000001 + +#define CM_DRP_DEVICEDESC 0x00000001 +#define CM_DRP_HARDWAREID 0x00000002 +#define CM_DRP_COMPATIBLEIDS 0x00000003 +#define CM_DRP_UNUSED0 0x00000004 +#define CM_DRP_SERVICE 0x00000005 +#define CM_DRP_UNUSED1 0x00000006 +#define CM_DRP_UNUSED2 0x00000007 +#define CM_DRP_CLASS 0x00000008 +#define CM_DRP_CLASSGUID 0x00000009 +#define CM_DRP_DRIVER 0x0000000A +#define CM_DRP_CONFIGFLAGS 0x0000000B +#define CM_DRP_MFG 0x0000000C +#define CM_DRP_FRIENDLYNAME 0x0000000D +#define CM_DRP_LOCATION_INFORMATION 0x0000000E +#define CM_DRP_PHYSICAL_DEVICE_OBJECT_NAME 0x0000000F +#define CM_DRP_CAPABILITIES 0x00000010 +#define CM_DRP_UI_NUMBER 0x00000011 +#define CM_DRP_UPPERFILTERS 0x00000012 +#define CM_DRP_LOWERFILTERS 0x00000013 +#define CM_DRP_BUSTYPEGUID 0x00000014 +#define CM_DRP_LEGACYBUSTYPE 0x00000015 +#define CM_DRP_BUSNUMBER 0x00000016 +#define CM_DRP_ENUMERATOR_NAME 0x00000017 + +#define CM_DRP_MIN 0x00000001 +#define CM_DRP_MAX 0x00000017 + +#define CM_REGISTRY_HARDWARE 0x00000000 +#define CM_REGISTRY_SOFTWARE 0x00000001 +#define CM_REGISTRY_USER 0x00000100 +#define CM_REGISTRY_CONFIG 0x00000200 +#define CM_REGISTRY_BITS 0x00000301 + + +typedef struct BusNumber_Des_s { + DWORD BUSD_Count; + DWORD BUSD_Type; + DWORD BUSD_Flags; + ULONG BUSD_Alloc_Base; + ULONG BUSD_Alloc_End; +} BUSNUMBER_DES, *PBUSNUMBER_DES; + +typedef struct BusNumber_Range_s { + ULONG BUSR_Min; + ULONG BUSR_Max; + ULONG BUSR_nBusNumbers; + ULONG BUSR_Flags; +} BUSNUMBER_RANGE, *PBUSNUMBER_RANGE; + +#define BusNumberType_Range sizeof(BUSNUMBER_RANGE) + +typedef struct BusNumber_Resource_s { + BUSNUMBER_DES BusNumber_Header; + BUSNUMBER_RANGE BusNumber_Data[ANYSIZE_ARRAY]; +} BUSNUMBER_RESOURCE, *PBUSNUMBER_RESOURCE; + +typedef struct CS_Des_s { + DWORD CSD_SignatureLength; + DWORD CSD_LegacyDataOffset; + DWORD CSD_LegacyDataSize; + DWORD CSD_Flags; + GUID CSD_ClassGuid; + BYTE CSD_Signature[ANYSIZE_ARRAY]; +} CS_DES, *PCS_DES; + +typedef struct CS_Resource_s { + CS_DES CS_Header; +} CS_RESOURCE, *PCS_RESOURCE; + +typedef struct DevPrivate_Des_s { + DWORD PD_Count; + DWORD PD_Type; + DWORD PD_Data1; + DWORD PD_Data2; + DWORD PD_Data3; + DWORD PD_Flags; +} DEVPRIVATE_DES, *PDEVPRIVATE_DES; + +typedef struct DevPrivate_Range_s { + DWORD PR_Data1; + DWORD PR_Data2; + DWORD PR_Data3; +} DEVPRIVATE_RANGE, *PDEVPRIVATE_RANGE; + +#define PType_Range sizeof(DEVPRIVATE_RANGE) + +typedef struct DevPrivate_Resource_s { + DEVPRIVATE_DES PRV_Header; + DEVPRIVATE_RANGE PRV_Data[ANYSIZE_ARRAY]; +} DEVPRIVATE_RESOURCE, *PDEVPRIVATE_RESOURCE; + +/* DMA_DES.DD_Flags constants and masks */ +#define mDD_Width 0x3 +#define fDD_BYTE 0x0 +#define fDD_WORD 0x1 +#define fDD_DWORD 0x2 +#define fDD_BYTE_AND_WORD 0x3 + +#define mDD_BusMaster 0x4 +#define fDD_NoBusMaster 0x0 +#define fDD_BusMaster 0x4 + +#define mDD_Type 0x18 +#define fDD_TypeStandard 0x00 +#define fDD_TypeA 0x08 +#define fDD_TypeB 0x10 +#define fDD_TypeF 0x18 + +typedef struct DMA_Des_s { + DWORD DD_Count; + DWORD DD_Type; + DWORD DD_Flags; + ULONG DD_Alloc_Chan; +} DMA_DES, *PDMA_DES; + +typedef struct DMA_Range_s { + ULONG DR_Min; + ULONG DR_Max; + ULONG DR_Flags; +} DMA_RANGE, *PDMA_RANGE; + +#define DType_Range sizeof(DMA_RANGE) + +typedef struct DMA_Resource_s { + DMA_DES DMA_Header; + DMA_RANGE DMA_Data[ANYSIZE_ARRAY]; +} DMA_RESOURCE, *PDMA_RESOURCE; + +/* IO_DES.Type constants and masks */ +#define fIOD_PortType 0x1 +#define fIOD_Memory 0x0 +#define fIOD_IO 0x1 +#define fIOD_DECODE 0x00fc +#define fIOD_10_BIT_DECODE 0x0004 +#define fIOD_12_BIT_DECODE 0x0008 +#define fIOD_16_BIT_DECODE 0x0010 +#define fIOD_POSITIVE_DECODE 0x0020 +#define fIOD_PASSIVE_DECODE 0x0040 +#define fIOD_WINDOW_DECODE 0x0080 + +typedef struct IO_Des_s { + DWORD IOD_Count; + DWORD IOD_Type; + DWORDLONG IOD_Alloc_Base; + DWORDLONG IOD_Alloc_End; + DWORD IOD_DesFlags; +} IO_DES, *PIO_DES; + +/* IO_RANGE.IOR_Alias constants */ +#define IO_ALIAS_10_BIT_DECODE 0x00000004 +#define IO_ALIAS_12_BIT_DECODE 0x00000010 +#define IO_ALIAS_16_BIT_DECODE 0x00000000 +#define IO_ALIAS_POSITIVE_DECODE 0x000000FF + +typedef struct IO_Range_s { + DWORDLONG IOR_Align; + DWORD IOR_nPorts; + DWORDLONG IOR_Min; + DWORDLONG IOR_Max; + DWORD IOR_RangeFlags; + DWORDLONG IOR_Alias; +} IO_RANGE, *PIO_RANGE; + +#define IOType_Range sizeof(IO_RANGE) + +typedef struct IO_Resource_s { + IO_DES IO_Header; + IO_RANGE IO_Data[ANYSIZE_ARRAY]; +} IO_RESOURCE, *PIO_RESOURCE; + +/* IRQ_DES.IRQD_flags constants */ +#define mIRQD_Share 0x1 +#define fIRQD_Exclusive 0x0 +#define fIRQD_Share 0x1 + +#define fIRQD_Share_Bit 0 +#define fIRQD_Level_Bit 1 + +#define mIRQD_Edge_Level 0x2 +#define fIRQD_Level 0x0 +#define fIRQD_Edge 0x2 + +typedef struct IRQ_Des_32_s { + DWORD IRQD_Count; + DWORD IRQD_Type; + DWORD IRQD_Flags; + ULONG IRQD_Alloc_Num; + ULONG32 IRQD_Affinity; +} IRQ_DES_32, *PIRQ_DES_32; + +typedef struct IRQ_Des_64_s { + DWORD IRQD_Count; + DWORD IRQD_Type; + DWORD IRQD_Flags; + ULONG IRQD_Alloc_Num; + ULONG64 IRQD_Affinity; +} IRQ_DES_64, *PIRQ_DES_64; + +#ifdef _WIN64 +typedef IRQ_DES_64 IRQ_DES; +typedef PIRQ_DES_64 PIRQ_DES; +#else +typedef IRQ_DES_32 IRQ_DES; +typedef PIRQ_DES_32 PIRQ_DES; +#endif + +typedef struct IRQ_Range_s { + ULONG IRQR_Min; + ULONG IRQR_Max; + ULONG IRQR_Flags; +} IRQ_RANGE, *PIRQ_RANGE; + +#define IRQType_Range sizeof(IRQ_RANGE) + +typedef struct IRQ_Resource_s { + IRQ_DES IRQ_Header; + IRQ_RANGE IRQ_Data[ANYSIZE_ARRAY]; +} IRQ_RESOURCE, *PIRQ_RESOURCE; + +/* MEM_DES.MD_Flags constants */ +#define mMD_MemoryType 0x1 +#define fMD_MemoryType mMD_MemoryType +#define fMD_ROM 0x0 +#define fMD_RAM 0x1 + +#define mMD_32_24 0x2 +#define fMD_32_24 mMD_32_24 +#define fMD_24 0x0 +#define fMD_32 0x2 + +#define mMD_Prefetchable 0x4 +#define fMD_Prefetchable mMD_Prefetchable +#define fMD_Pref mMD_Prefetchable +#define fMD_PrefetchDisallowed 0x0 +#define fMD_PrefetchAllowed 0x4 + +#define mMD_Readable 0x8 +#define fMD_Readable mMD_Readable +#define fMD_ReadAllowed 0x0 +#define fMD_ReadDisallowed 0x8 + +#define mMD_CombinedWrite 0x10 +#define fMD_CombinedWrite mMD_CombinedWrite +#define fMD_CombinedWriteDisallowed 0x0 +#define fMD_CombinedWriteAllowed 0x10 + +#define mMD_Cacheable 0x20 +#define fMD_NonCacheable 0x0 +#define fMD_Cacheable 0x20 + +typedef struct Mem_Des_s { + DWORD MD_Count; + DWORD MD_Type; + DWORDLONG MD_Alloc_Base; + DWORDLONG MD_Alloc_End; + DWORD MD_Flags; + DWORD MD_Reserved; +} MEM_DES, *PMEM_DES; + +typedef struct Mem_Range_s { + DWORDLONG MR_Align; + ULONG MR_nBytes; + DWORDLONG MR_Min; + DWORDLONG MR_Max; + DWORD MR_Flags; + DWORD MR_Reserved; +} MEM_RANGE, *PMEM_RANGE; + +#define MType_Range sizeof(MEM_RANGE) + +typedef struct Mem_Resource_s { + MEM_DES MEM_Header; + MEM_RANGE MEM_Data[ANYSIZE_ARRAY]; +} MEM_RESOURCE, *PMEM_RESOURCE; + +/* MFCARD_DES.PMF_Flags constants */ +#define fPMF_AUDIO_ENABLE 0x8 +#define mPMF_AUDIO_ENABLE fPMF_AUDIO_ENABLE + +typedef struct MfCard_Des_s { + DWORD PMF_Count; + DWORD PMF_Type; + DWORD PMF_Flags; + BYTE PMF_ConfigOptions; + BYTE PMF_IoResourceIndex; + BYTE PMF_Reserved[2]; + DWORD PMF_ConfigRegisterBase; +} MFCARD_DES, *PMFCARD_DES; + +typedef struct MfCard_Resource_s { + MFCARD_DES MfCard_Header; +} MFCARD_RESOURCE, *PMFCARD_RESOURCE; + +/* PCCARD_DES.PCD_Flags constants */ + +typedef struct PcCard_Des_s { + DWORD PCD_Count; + DWORD PCD_Type; + DWORD PCD_Flags; + BYTE PCD_ConfigIndex; + BYTE PCD_Reserved[3]; + DWORD PCD_MemoryCardBase1; + DWORD PCD_MemoryCardBase2; +} PCCARD_DES, *PPCCARD_DES; + +#define mPCD_IO_8_16 0x1 +#define fPCD_IO_8 0x0 +#define fPCD_IO_16 0x1 +#define mPCD_MEM_8_16 0x2 +#define fPCD_MEM_8 0x0 +#define fPCD_MEM_16 0x2 +#define mPCD_MEM_A_C 0xC +#define fPCD_MEM1_A 0x4 +#define fPCD_MEM2_A 0x8 +#define fPCD_IO_ZW_8 0x10 +#define fPCD_IO_SRC_16 0x20 +#define fPCD_IO_WS_16 0x40 +#define mPCD_MEM_WS 0x300 +#define fPCD_MEM_WS_ONE 0x100 +#define fPCD_MEM_WS_TWO 0x200 +#define fPCD_MEM_WS_THREE 0x300 + +#define fPCD_MEM_A 0x4 + +#define fPCD_ATTRIBUTES_PER_WINDOW 0x8000 + +#define fPCD_IO1_16 0x00010000 +#define fPCD_IO1_ZW_8 0x00020000 +#define fPCD_IO1_SRC_16 0x00040000 +#define fPCD_IO1_WS_16 0x00080000 + +#define fPCD_IO2_16 0x00100000 +#define fPCD_IO2_ZW_8 0x00200000 +#define fPCD_IO2_SRC_16 0x00400000 +#define fPCD_IO2_WS_16 0x00800000 + +#define mPCD_MEM1_WS 0x03000000 +#define fPCD_MEM1_WS_ONE 0x01000000 +#define fPCD_MEM1_WS_TWO 0x02000000 +#define fPCD_MEM1_WS_THREE 0x03000000 +#define fPCD_MEM1_16 0x04000000 + +#define mPCD_MEM2_WS 0x30000000 +#define fPCD_MEM2_WS_ONE 0x10000000 +#define fPCD_MEM2_WS_TWO 0x20000000 +#define fPCD_MEM2_WS_THREE 0x30000000 +#define fPCD_MEM2_16 0x40000000 + +#define PCD_MAX_MEMORY 2 +#define PCD_MAX_IO 2 + +typedef struct PcCard_Resource_s { + PCCARD_DES PcCard_Header; +} PCCARD_RESOURCE, *PPCCARD_RESOURCE; + + +/* CONFLICT_DETAILS.CD.ulMask constants */ +#define CM_CDMASK_DEVINST 0x00000001 +#define CM_CDMASK_RESDES 0x00000002 +#define CM_CDMASK_FLAGS 0x00000004 +#define CM_CDMASK_DESCRIPTION 0x00000008 +#define CM_CDMASK_VALID 0x0000000F + +/* CONFLICT_DETAILS.CD.ulFlags constants */ +#define CM_CDFLAGS_DRIVER 0x00000001 +#define CM_CDFLAGS_ROOT_OWNED 0x00000002 +#define CM_CDFLAGS_RESERVED 0x00000004 + +typedef struct _CONFLICT_DETAILS_A { + ULONG CD_ulSize; + ULONG CD_ulMask; + DEVINST CD_dnDevInst; + RES_DES CD_rdResDes; + ULONG CD_ulFlags; + CHAR CD_szDescription[MAX_PATH]; +} CONFLICT_DETAILS_A , *PCONFLICT_DETAILS_A; + +typedef struct _CONFLICT_DETAILS_W { + ULONG CD_ulSize; + ULONG CD_ulMask; + DEVINST CD_dnDevInst; + RES_DES CD_rdResDes; + ULONG CD_ulFlags; + WCHAR CD_szDescription[MAX_PATH]; +} CONFLICT_DETAILS_W , *PCONFLICT_DETAILS_W; + +#ifdef UNICODE +typedef CONFLICT_DETAILS_W CONFLICT_DETAILS; +typedef PCONFLICT_DETAILS_W PCONFLICT_DETAILS; +#else +typedef CONFLICT_DETAILS_A CONFLICT_DETAILS; +typedef PCONFLICT_DETAILS_A PCONFLICT_DETAILS; +#endif + + +#define CMP_MAGIC 0x01234567 + + +CMAPI +CONFIGRET +WINAPI +CMP_Init_Detection( + IN DWORD dwMagic); + +/* FIXME: Missing CMP_RegisterNotification */ + +CMAPI +CONFIGRET +WINAPI +CMP_Report_LogOn( + IN DWORD dwMagic, + IN DWORD dwProcessId); + +/* FIXME: Missing CMP_UnregisterNotification */ +/* FIXME: Missing CMP_WaitNoPendingInstallEvents */ +/* FIXME: Missing CMP_WaitServicesAvailable */ + +/* CM_Add_Empty_Log_Conf.ulFlags constants */ +#define PRIORITY_EQUAL_FIRST 0x00000008 +#define PRIORITY_EQUAL_LAST 0x00000000 +#define PRIORITY_BIT 0x00000008 + +CMAPI +CONFIGRET +WINAPI +CM_Add_Empty_Log_Conf( + OUT PLOG_CONF plcLogConf, + IN DEVINST dnDevInst, + IN PRIORITY Priority, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Add_Empty_Log_Conf_Ex( + OUT PLOG_CONF plcLogConf, + IN DEVINST dnDevInst, + IN PRIORITY Priority, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +/* CM_Add_ID.ulFlags constants */ +#define CM_ADD_ID_HARDWARE 0x00000000 +#define CM_ADD_ID_COMPATIBLE 0x00000001 +#define CM_ADD_ID_BITS 0x00000001 + +CMAPI +CONFIGRET +WINAPI +CM_Add_IDA( + IN DEVINST dnDevInst, + IN PSTR pszID, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Add_ID_ExA( + IN DEVINST dnDevInst, + IN PSTR pszID, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Add_ID_ExW( + IN DEVINST dnDevInst, + IN PWSTR pszID, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Add_IDW( + IN DEVINST dnDevInst, + IN PWSTR pszID, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +#ifdef UNICODE +#define CM_Add_ID CM_Add_IDW +#define CM_Add_ID_Ex CM_Add_ID_ExW +#else +#define CM_Add_ID CM_Add_IDA +#define CM_Add_ID_Ex CM_Add_ID_ExA +#endif /* UNICODE */ + +/* FIXME: Obsolete CM_Add_Range */ + +CMAPI +CONFIGRET +WINAPI +CM_Add_Res_Des( + OUT PRES_DES prdResDes, + IN LOG_CONF lcLogConf, + IN RESOURCEID ResourceID, + IN PCVOID ResourceData, + IN ULONG ResourceLen, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Add_Res_Des_Ex( + OUT PRES_DES prdResDes, + IN LOG_CONF lcLogConf, + IN RESOURCEID ResourceID, + IN PCVOID ResourceData, + IN ULONG ResourceLen, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Connect_MachineA( + IN PCSTR UNCServerName, + OUT PHMACHINE phMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Connect_MachineW( + IN PCWSTR UNCServerName, + OUT PHMACHINE phMachine); + +#ifdef UNICODE +#define CM_Connect_Machine CM_Connect_MachineW +#else +#define CM_Connect_Machine CM_Connect_MachineA +#endif /* UNICODE */ + +/* Flags for CM_Create_DevNode[_Ex].ulFlags constants */ +#define CM_CREATE_DEVNODE_NORMAL 0x00000000 +#define CM_CREATE_DEVNODE_NO_WAIT_INSTALL 0x00000001 +#define CM_CREATE_DEVNODE_PHANTOM 0x00000002 +#define CM_CREATE_DEVNODE_GENERATE_ID 0x00000004 +#define CM_CREATE_DEVNODE_DO_NOT_INSTALL 0x00000008 +#define CM_CREATE_DEVNODE_BITS 0x0000000F + +#define CM_CREATE_DEVINST_NORMAL CM_CREATE_DEVNODE_NORMAL +#define CM_CREATE_DEVINST_NO_WAIT_INSTALL CM_CREATE_DEVNODE_NO_WAIT_INSTALL +#define CM_CREATE_DEVINST_PHANTOM CM_CREATE_DEVNODE_PHANTOM +#define CM_CREATE_DEVINST_GENERATE_ID CM_CREATE_DEVNODE_GENERATE_ID +#define CM_CREATE_DEVINST_DO_NOT_INSTALL CM_CREATE_DEVNODE_DO_NOT_INSTALL +#define CM_CREATE_DEVINST_BITS CM_CREATE_DEVNODE_BITS + +CMAPI +CONFIGRET +WINAPI +CM_Create_DevNodeA( + OUT PDEVINST pdnDevInst, + IN DEVINSTID_A pDeviceID, + IN DEVINST dnParent, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Create_DevNodeW( + OUT PDEVINST pdnDevInst, + IN DEVINSTID_W pDeviceID, + IN DEVINST dnParent, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Create_DevNode_ExA( + OUT PDEVINST pdnDevInst, + IN DEVINSTID_A pDeviceID, + IN DEVINST dnParent, + IN ULONG ulFlags, + IN HANDLE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Create_DevNode_ExW( + OUT PDEVINST pdnDevInst, + IN DEVINSTID_W pDeviceID, + IN DEVINST dnParent, + IN ULONG ulFlags, + IN HANDLE hMachine); + +#define CM_Create_DevInstW CM_Create_DevNodeW +#define CM_Create_DevInstA CM_Create_DevNodeA +#define CM_Create_DevInst_ExW CM_Create_DevNode_ExW +#define CM_Create_DevInst_ExA CM_Create_DevNode_ExA +#ifdef UNICODE +#define CM_Create_DevNode CM_Create_DevNodeW +#define CM_Create_DevInst CM_Create_DevNodeW +#define CM_Create_DevNode_Ex CM_Create_DevNode_ExW +#define CM_Create_DevInst_Ex CM_Create_DevInst_ExW +#else +#define CM_Create_DevNode CM_Create_DevNodeA +#define CM_Create_DevInst CM_Create_DevNodeA +#define CM_Create_DevNode_Ex CM_Create_DevNode_ExA +#define CM_Create_DevInst_Ex CM_Create_DevNode_ExA +#endif /* UNICODE */ + +/* FIXME: Obsolete CM_Create_Range_List */ + +/* Flags for CM_Delete_Class_Key.ulFlags constants */ +#define CM_DELETE_CLASS_ONLY 0x00000000 +#define CM_DELETE_CLASS_SUBKEYS 0x00000001 +#define CM_DELETE_CLASS_BITS 0x00000001 + +CMAPI +CONFIGRET +WINAPI +CM_Delete_Class_Key( + IN LPGUID ClassGuid, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Delete_Class_Key_Ex( + IN LPGUID ClassGuid, + IN ULONG ulFlags, + IN HANDLE hMachine); + +/* FIXME: Obsolete CM_Delete_DevNode_Key */ +/* FIXME: Obsolete CM_Delete_DevNode_Key_Ex */ +/* FIXME: Obsolete CM_Delete_Range */ +/* FIXME: Obsolete CM_Detected_Resource_Conflict */ +/* FIXME: Obsolete CM_Detected_Resource_Conflict_Ex */ + +CMAPI +CONFIGRET +WINAPI +CM_Disable_DevNode( + IN DEVINST dnDevInst, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Disable_DevNode_Ex( + IN DEVINST dnDevInst, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +#define CM_Disable_DevInst CM_Disable_DevNode +#define CM_Disable_DevInst_Ex CM_Disable_DevNode_Ex + +CMAPI +CONFIGRET +WINAPI +CM_Disconnect_Machine( + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Enable_DevNode( + IN DEVINST dnDevInst, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Enable_DevNode_Ex( + IN DEVINST dnDevInst, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +#define CM_Enable_DevInst CM_Enable_DevNode +#define CM_Enable_DevInst_Ex CM_Enable_DevNode_Ex + +CMAPI +CONFIGRET +WINAPI +CM_Enumerate_Classes( + IN ULONG ulClassIndex, + OUT LPGUID ClassGuid, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Enumerate_Classes_Ex( + IN ULONG ulClassIndex, + OUT LPGUID ClassGuid, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Enumerate_EnumeratorsA( + IN ULONG ulEnumIndex, + OUT PCHAR Buffer, + IN OUT PULONG pulLength, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Enumerate_Enumerators_ExA( + IN ULONG ulEnumIndex, + OUT PCHAR Buffer, + IN OUT PULONG pulLength, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Enumerate_Enumerators_ExW( + IN ULONG ulEnumIndex, + OUT PWCHAR Buffer, + IN OUT PULONG pulLength, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Enumerate_EnumeratorsW( + IN ULONG ulEnumIndex, + OUT PWCHAR Buffer, + IN OUT PULONG pulLength, + IN ULONG ulFlags); + +#ifdef UNICODE +#define CM_Enumerate_Enumerators CM_Enumerate_EnumeratorsW +#define CM_Enumerate_Enumerators_Ex CM_Enumerate_Enumerators_ExW +#else +#define CM_Enumerate_Enumerators CM_Enumerate_EnumeratorsA +#define CM_Enumerate_Enumerators_Ex CM_Enumerate_Enumerators_ExA +#endif /* UNICODE */ + +/* FIXME: Obsolete CM_Find_Range */ +/* FIXME: Obsolete CM_First_Range */ + +CMAPI +CONFIGRET +WINAPI +CM_Free_Log_Conf( + IN LOG_CONF lcLogConfToBeFreed, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Free_Log_Conf_Ex( + IN LOG_CONF lcLogConfToBeFreed, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Free_Log_Conf_Handle( + IN LOG_CONF lcLogConf); + +/* FIXME: Obsolete CM_Free_Range_List */ + +CMAPI +CONFIGRET +WINAPI +CM_Free_Res_Des( + OUT PRES_DES prdResDes, + IN RES_DES rdResDes, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Free_Res_Des_Ex( + OUT PRES_DES prdResDes, + IN RES_DES rdResDes, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Free_Res_Des_Handle( + IN RES_DES rdResDes); + +CMAPI +CONFIGRET +WINAPI +CM_Free_Resource_Conflict_Handle( + IN CONFLICT_LIST clConflictList); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Child( + OUT PDEVINST pdnDevInst, + IN DEVINST dnDevInst, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Child_Ex( + OUT PDEVINST pdnDevInst, + IN DEVINST dnDevInst, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Class_NameA( + IN LPGUID ClassGuid, + OUT PCHAR Buffer, + IN OUT PULONG pulLength, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Class_NameW( + IN LPGUID ClassGuid, + OUT PWCHAR Buffer, + IN OUT PULONG pulLength, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Class_Name_ExA( + IN LPGUID ClassGuid, + OUT PCHAR Buffer, + IN OUT PULONG pulLength, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Class_Name_ExW( + IN LPGUID ClassGuid, + OUT PWCHAR Buffer, + IN OUT PULONG pulLength, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +#ifdef UNICODE +#define CM_Get_Class_Name CM_Get_Class_NameW +#define CM_Get_Class_Name_Ex CM_Get_Class_Name_ExW +#else +#define CM_Get_Class_Name CM_Get_Class_NameA +#define CM_Get_Class_Name_Ex CM_Get_Class_Name_ExA +#endif /* UNICODE */ + +CMAPI +CONFIGRET +WINAPI +CM_Get_Class_Key_NameA( + IN LPGUID ClassGuid, + OUT LPSTR pszKeyName, + IN OUT PULONG pulLength, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Class_Key_NameW( + IN LPGUID ClassGuid, + OUT LPWSTR pszKeyName, + IN OUT PULONG pulLength, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Class_Key_Name_ExA( + IN LPGUID ClassGuid, + OUT LPSTR pszKeyName, + IN OUT PULONG pulLength, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Class_Key_Name_ExW( + IN LPGUID ClassGuid, + OUT LPWSTR pszKeyName, + IN OUT PULONG pulLength, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +#ifdef UNICODE +#define CM_Get_Class_Key_Name CM_Get_Class_Key_NameW +#define CM_Get_Class_Key_Name_Ex CM_Get_Class_Key_Name_ExW +#else +#define CM_Get_Class_Key_Name CM_Get_Class_Key_NameA +#define CM_Get_Class_Key_Name_Ex CM_Get_Class_Key_Name_ExA +#endif /* UNICODE */ + +/* FIXME: Obsolete CM_Get_Class_Registry_Property */ + +CMAPI +CONFIGRET +WINAPI +CM_Get_Depth( + OUT PULONG pulDepth, + IN DEVINST dnDevInst, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Depth_Ex( + OUT PULONG pulDepth, + IN DEVINST dnDevInst, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Device_IDA( + IN DEVINST dnDevInst, + OUT PCHAR Buffer, + IN ULONG BufferLen, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Device_ID_ExA( + IN DEVINST dnDevInst, + OUT PCHAR Buffer, + IN ULONG BufferLen, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Device_ID_ExW( + IN DEVINST dnDevInst, + OUT PWCHAR Buffer, + IN ULONG BufferLen, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Device_IDW( + IN DEVINST dnDevInst, + OUT PWCHAR Buffer, + IN ULONG BufferLen, + IN ULONG ulFlags); + +#ifdef UNICODE +#define CM_Get_Device_ID CM_Get_Device_IDW +#define CM_Get_Device_ID_Ex CM_Get_Device_ID_ExW +#else +#define CM_Get_Device_ID CM_Get_Device_IDA +#define CM_Get_Device_ID_Ex CM_Get_Device_ID_ExA +#endif /* UNICODE */ + +CMAPI +CONFIGRET +WINAPI +CM_Get_Device_ID_ListA( + IN PCSTR pszFilter, OPTIONAL + OUT PCHAR Buffer, + IN ULONG BufferLen, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Device_ID_List_ExA( + IN PCSTR pszFilter, OPTIONAL + OUT PCHAR Buffer, + IN ULONG BufferLen, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Device_ID_List_ExW( + IN PCWSTR pszFilter, OPTIONAL + OUT PWCHAR Buffer, + IN ULONG BufferLen, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Device_ID_ListW( + IN PCWSTR pszFilter, OPTIONAL + OUT PWCHAR Buffer, + IN ULONG BufferLen, + IN ULONG ulFlags); + +#ifdef UNICODE +#define CM_Get_Device_ID_List CM_Get_Device_ID_ListW +#define CM_Get_Device_ID_List_Ex CM_Get_Device_ID_List_ExW +#else +#define CM_Get_Device_ID_List CM_Get_Device_ID_ListA +#define CM_Get_Device_ID_List_Ex CM_Get_Device_ID_List_ExA +#endif /* UNICODE */ + +CMAPI +CONFIGRET +WINAPI +CM_Get_Device_ID_List_SizeA( + OUT PULONG pulLen, + IN PCSTR pszFilter, OPTIONAL + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Device_ID_List_Size_ExA( + OUT PULONG pulLen, + IN PCSTR pszFilter, OPTIONAL + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Device_ID_List_Size_ExW( + OUT PULONG pulLen, + IN PCWSTR pszFilter, OPTIONAL + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Device_ID_List_SizeW( + OUT PULONG pulLen, + IN PCWSTR pszFilter, OPTIONAL + IN ULONG ulFlags); + +#ifdef UNICODE +#define CM_Get_Device_ID_List_Size CM_Get_Device_ID_List_SizeW +#define CM_Get_Device_ID_List_Size_Ex CM_Get_Device_ID_List_Size_ExW +#else +#define CM_Get_Device_ID_List_Size CM_Get_Device_ID_List_SizeA +#define CM_Get_Device_ID_List_Size_Ex CM_Get_Device_ID_List_Size_ExA +#endif /* UNICODE */ + +CMAPI +CONFIGRET +WINAPI +CM_Get_Device_ID_Size( + OUT PULONG pulLen, + IN DEVINST dnDevInst, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Device_ID_Size_Ex( + OUT PULONG pulLen, + IN DEVINST dnDevInst, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +/* FIXME: Obsolete CM_Get_Device_Interface_Alias */ +/* FIXME: Obsolete CM_Get_Device_Interface_Alias_Ex */ +/* FIXME: Obsolete CM_Get_Device_Interface_List */ +/* FIXME: Obsolete CM_Get_Device_Interface_List_Ex */ +/* FIXME: Obsolete CM_Get_Device_Interface_List_Size */ +/* FIXME: Obsolete CM_Get_Device_Interface_List_Size_Ex */ +/* FIXME: Obsolete CM_Get_DevNode_Custom_Property */ +/* FIXME: Obsolete CM_Get_DevNode_Custom_Property_Ex */ + +CMAPI +CONFIGRET +WINAPI +CM_Get_DevNode_Registry_PropertyA( + IN DEVINST dnDevInst, + IN ULONG ulProperty, + OUT PULONG pulRegDataType, OPTIONAL + OUT PVOID Buffer, OPTIONAL + IN OUT PULONG pulLength, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Get_DevNode_Registry_PropertyW( + IN DEVINST dnDevInst, + IN ULONG ulProperty, + OUT PULONG pulRegDataType, OPTIONAL + OUT PVOID Buffer, OPTIONAL + IN OUT PULONG pulLength, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Get_DevNode_Registry_Property_ExA( + IN DEVINST dnDevInst, + IN ULONG ulProperty, + OUT PULONG pulRegDataType, OPTIONAL + OUT PVOID Buffer, OPTIONAL + IN OUT PULONG pulLength, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Get_DevNode_Registry_Property_ExW( + IN DEVINST dnDevInst, + IN ULONG ulProperty, + OUT PULONG pulRegDataType, OPTIONAL + OUT PVOID Buffer, OPTIONAL + IN OUT PULONG pulLength, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +#define CM_Get_DevInst_Registry_PropertyW CM_Get_DevNode_Registry_PropertyW +#define CM_Get_DevInst_Registry_PropertyA CM_Get_DevNode_Registry_PropertyA +#define CM_Get_DevInst_Registry_Property_ExW CM_Get_DevNode_Registry_Property_ExW +#define CM_Get_DevInst_Registry_Property_ExA CM_Get_DevNode_Registry_Property_ExA + +#ifdef UNICODE +#define CM_Get_DevInst_Registry_Property CM_Get_DevNode_Registry_PropertyW +#define CM_Get_DevInst_Registry_Property_Ex CM_Get_DevNode_Registry_Property_ExW +#define CM_Get_DevNode_Registry_Property CM_Get_DevNode_Registry_PropertyW +#define CM_Get_DevNode_Registry_Property_Ex CM_Get_DevNode_Registry_Property_ExW +#else +#define CM_Get_DevInst_Registry_Property CM_Get_DevNode_Registry_PropertyA +#define CM_Get_DevInst_Registry_Property_Ex CM_Get_DevNode_Registry_Property_ExA +#define CM_Get_DevNode_Registry_Property CM_Get_DevNode_Registry_PropertyA +#define CM_Get_DevNode_Registry_Property_Ex CM_Get_DevNode_Registry_Property_ExA +#endif /* UNICODE */ + +CMAPI +CONFIGRET +WINAPI +CM_Get_DevNode_Status( + OUT PULONG pulStatus, + OUT PULONG pulProblemNumber, + IN DEVINST dnDevInst, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Get_DevNode_Status_Ex( + OUT PULONG pulStatus, + OUT PULONG pulProblemNumber, + IN DEVINST dnDevInst, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +#define CM_Get_DevInst_Status CM_Get_DevNode_Status +#define CM_Get_DevInst_Status_Ex CM_Get_DevNode_Status_Ex + +/* CM_Get_First_Log_Conf.ulFlags constants */ +#define BASIC_LOG_CONF 0x00000000 /* Specifies the req list. */ +#define FILTERED_LOG_CONF 0x00000001 /* Specifies the filtered req list. */ +#define ALLOC_LOG_CONF 0x00000002 /* Specifies the Alloc Element. */ +#define BOOT_LOG_CONF 0x00000003 /* Specifies the RM Alloc Element. */ +#define FORCED_LOG_CONF 0x00000004 /* Specifies the Forced Log Conf */ +#define OVERRIDE_LOG_CONF 0x00000005 /* Specifies the Override req list. */ +#define NUM_LOG_CONF 0x00000006 /* Number of Log Conf type */ +#define LOG_CONF_BITS 0x00000007 /* The bits of the log conf type. */ + +CMAPI +CONFIGRET +WINAPI +CM_Get_First_Log_Conf( + OUT PLOG_CONF plcLogConf, OPTIONAL + IN DEVINST dnDevInst, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Get_First_Log_Conf_Ex( + OUT PLOG_CONF plcLogConf, OPTIONAL + IN DEVINST dnDevInst, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Global_State( + OUT PULONG pulState, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Global_State_Ex( + OUT PULONG pulState, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +/* FIXME: Obsolete CM_Get_Hardware_Profile_Info */ +/* FIXME: Obsolete CM_Get_Hardware_Profile_Info_Ex */ +/* FIXME: Obsolete CM_Get_HW_Prof_Flags */ +/* FIXME: Obsolete CM_Get_HW_Prof_Flags_Ex */ + +CMAPI +CONFIGRET +WINAPI +CM_Get_Log_Conf_Priority( + IN LOG_CONF lcLogConf, + OUT PPRIORITY pPriority, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Log_Conf_Priority_Ex( + IN LOG_CONF lcLogConf, + OUT PPRIORITY pPriority, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Next_Log_Conf( + OUT PLOG_CONF plcLogConf, OPTIONAL + IN LOG_CONF lcLogConf, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Next_Log_Conf_Ex( + OUT PLOG_CONF plcLogConf, OPTIONAL + IN LOG_CONF lcLogConf, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Next_Res_Des( + OUT PRES_DES prdResDes, + IN RES_DES rdResDes, + IN RESOURCEID ForResource, + OUT PRESOURCEID pResourceID, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Next_Res_Des_Ex( + OUT PRES_DES prdResDes, + IN RES_DES rdResDes, + IN RESOURCEID ForResource, + OUT PRESOURCEID pResourceID, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Parent( + OUT PDEVINST pdnDevInst, + IN DEVINST dnDevInst, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Parent_Ex( + OUT PDEVINST pdnDevInst, + IN DEVINST dnDevInst, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Res_Des_Data( + IN RES_DES rdResDes, + OUT PVOID Buffer, + IN ULONG BufferLen, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Res_Des_Data_Ex( + IN RES_DES rdResDes, + OUT PVOID Buffer, + IN ULONG BufferLen, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Res_Des_Data_Size( + OUT PULONG pulSize, + IN RES_DES rdResDes, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Res_Des_Data_Size_Ex( + OUT PULONG pulSize, + IN RES_DES rdResDes, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Resource_Conflict_Count( + IN CONFLICT_LIST clConflictList, + OUT PULONG pulCount); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Resource_Conflict_DetailsA( + IN CONFLICT_LIST clConflictList, + IN ULONG ulIndex, + IN OUT PCONFLICT_DETAILS_A pConflictDetails); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Resource_Conflict_DetailsW( + IN CONFLICT_LIST clConflictList, + IN ULONG ulIndex, + IN OUT PCONFLICT_DETAILS_W pConflictDetails); + +#ifdef UNICODE +#define CM_Get_Resource_Conflict_Details CM_Get_Resource_Conflict_DetailsW +#else +#define CM_Get_Resource_Conflict_Details CM_Get_Resource_Conflict_DetailsA +#endif /* UNICODE */ + +CMAPI +CONFIGRET +WINAPI +CM_Get_Sibling( + OUT PDEVINST pdnDevInst, + IN DEVINST DevInst, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Get_Sibling_Ex( + OUT PDEVINST pdnDevInst, + IN DEVINST DevInst, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +WORD +WINAPI +CM_Get_Version( + VOID); + +CMAPI +WORD +WINAPI +CM_Get_Version_Ex( + IN HMACHINE hMachine); + +/* FIXME: Obsolete CM_Intersect_Range_List */ +/* FIXME: Obsolete CM_Invert_Range_List */ + +CMAPI +CONFIGRET +WINAPI +CM_Is_Dock_Station_Present( + OUT PBOOL pbPresent); + +CMAPI +CONFIGRET +WINAPI +CM_Is_Dock_Station_Present_Ex( + OUT PBOOL pbPresent, + IN HMACHINE hMachine); + +/* CM_Locate_DevNode.ulFlags constants */ +#define CM_LOCATE_DEVNODE_NORMAL 0x00000000 +#define CM_LOCATE_DEVNODE_PHANTOM 0x00000001 +#define CM_LOCATE_DEVNODE_CANCELREMOVE 0x00000002 +#define CM_LOCATE_DEVNODE_NOVALIDATION 0x00000004 +#define CM_LOCATE_DEVNODE_BITS 0x00000007 + +#define CM_LOCATE_DEVINST_NORMAL CM_LOCATE_DEVNODE_NORMAL +#define CM_LOCATE_DEVINST_PHANTOM CM_LOCATE_DEVNODE_PHANTOM +#define CM_LOCATE_DEVINST_CANCELREMOVE CM_LOCATE_DEVNODE_CANCELREMOVE +#define CM_LOCATE_DEVINST_NOVALIDATION CM_LOCATE_DEVNODE_NOVALIDATION +#define CM_LOCATE_DEVINST_BITS CM_LOCATE_DEVNODE_BITS + +CMAPI +CONFIGRET +WINAPI +CM_Locate_DevNodeA( + OUT PDEVINST pdnDevInst, + IN DEVINSTID_A pDeviceID, OPTIONAL + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Locate_DevNode_ExA( + OUT PDEVINST pdnDevInst, + IN DEVINSTID_A pDeviceID, OPTIONAL + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Locate_DevNode_ExW( + OUT PDEVINST pdnDevInst, + IN DEVINSTID_W pDeviceID, OPTIONAL + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Locate_DevNodeW( + OUT PDEVINST pdnDevInst, + IN DEVINSTID_W pDeviceID, OPTIONAL + IN ULONG ulFlags); + +#define CM_Locate_DevInstA CM_Locate_DevNodeA +#define CM_Locate_DevInstW CM_Locate_DevNodeW +#define CM_Locate_DevInst_ExA CM_Locate_DevNode_ExA +#define CM_Locate_DevInst_ExW CM_Locate_DevNode_ExW + +#ifdef UNICODE +#define CM_Locate_DevNode CM_Locate_DevNodeW +#define CM_Locate_DevInst CM_Locate_DevNodeW +#define CM_Locate_DevNode_Ex CM_Locate_DevNode_ExW +#define CM_Locate_DevInst_Ex CM_Locate_DevNode_ExW +#else +#define CM_Locate_DevNode CM_Locate_DevNodeA +#define CM_Locate_DevInst CM_Locate_DevNodeA +#define CM_Locate_DevNode_Ex CM_Locate_DevNode_ExA +#define CM_Locate_DevInst_Ex CM_Locate_DevNode_ExA +#endif /* UNICODE */ + +/* FIXME: Obsolete CM_Merge_Range_List */ + +CMAPI +CONFIGRET +WINAPI +CM_Modify_Res_Des( + OUT PRES_DES prdResDes, + IN RES_DES rdResDes, + IN RESOURCEID ResourceID, + IN PCVOID ResourceData, + IN ULONG ResourceLen, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Modify_Res_Des_Ex( + OUT PRES_DES prdResDes, + IN RES_DES rdResDes, + IN RESOURCEID ResourceID, + IN PCVOID ResourceData, + IN ULONG ResourceLen, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +/* FIXME: Obsolete CM_Move_DevNode */ +/* FIXME: Obsolete CM_Move_DevNode_Ex */ +/* FIXME: Obsolete CM_Next_Range */ + +CMAPI +CONFIGRET +WINAPI +CM_Open_Class_KeyA( + IN LPGUID ClassGuid, OPTIONAL + IN LPCSTR pszClassName, OPTIONAL + IN REGSAM samDesired, + IN REGDISPOSITION Disposition, + OUT PHKEY phkClass, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Open_Class_KeyW( + IN LPGUID ClassGuid, OPTIONAL + IN LPCWSTR pszClassName, OPTIONAL + IN REGSAM samDesired, + IN REGDISPOSITION Disposition, + OUT PHKEY phkClass, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Open_Class_Key_ExA( + IN LPGUID pszClassGuid, OPTIONAL + IN LPCSTR pszClassName, OPTIONAL + IN REGSAM samDesired, + IN REGDISPOSITION Disposition, + OUT PHKEY phkClass, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Open_Class_Key_ExW( + IN LPGUID pszClassGuid, OPTIONAL + IN LPCWSTR pszClassName, OPTIONAL + IN REGSAM samDesired, + IN REGDISPOSITION Disposition, + OUT PHKEY phkClass, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +#ifdef UNICODE +#define CM_Open_Class_Key CM_Open_Class_KeyW +#define CM_Open_Class_Key_Ex CM_Open_Class_Key_ExW +#else +#define CM_Open_Class_Key CM_Open_Class_KeyA +#define CM_Open_Class_Key_Ex CM_Open_Class_Key_ExA +#endif /* UNICODE */ + +/* FIXME: Obsolete CM_Open_DevNode_Key */ +/* FIXME: Obsolete CM_Open_DevNode_Key_Ex */ + +/* CM_Query_And_Remove_SubTree.ulFlags constants */ +#define CM_REMOVE_UI_OK 0x00000000 +#define CM_REMOVE_UI_NOT_OK 0x00000001 +#define CM_REMOVE_NO_RESTART 0x00000002 +#define CM_REMOVE_BITS 0x00000003 + +CMAPI +CONFIGRET +WINAPI +CM_Query_And_Remove_SubTreeA( + IN DEVINST dnAncestor, + OUT PPNP_VETO_TYPE pVetoType, + OUT LPSTR pszVetoName, + IN ULONG ulNameLength, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Query_And_Remove_SubTreeW( + IN DEVINST dnAncestor, + OUT PPNP_VETO_TYPE pVetoType, + OUT LPWSTR pszVetoName, + IN ULONG ulNameLength, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Query_And_Remove_SubTree_ExA( + IN DEVINST dnAncestor, + OUT PPNP_VETO_TYPE pVetoType, + OUT LPSTR pszVetoName, + IN ULONG ulNameLength, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Query_And_Remove_SubTree_ExW( + IN DEVINST dnAncestor, + OUT PPNP_VETO_TYPE pVetoType, + OUT LPWSTR pszVetoName, + IN ULONG ulNameLength, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +/* FIXME: Obsolete CM_Query_Arbitrator_Free_Data */ +/* FIXME: Obsolete CM_Query_Arbitrator_Free_Data_Ex */ +/* FIXME: Obsolete CM_Query_Arbitrator_Free_Size */ +/* FIXME: Obsolete CM_Query_Arbitrator_Free_Size_Ex */ +/* FIXME: Obsolete CM_Query_Arbitrator_Free_Size_Ex */ +/* FIXME: Obsolete CM_Query_Remove_SubTree */ +/* FIXME: Obsolete CM_Query_Remove_SubTree_Ex */ + +CMAPI +CONFIGRET +WINAPI +CM_Query_Resource_Conflict_List( + OUT PCONFLICT_LIST pclConflictList, + IN DEVINST dnDevInst, + IN RESOURCEID ResourceID, + IN PCVOID ResourceData, + IN ULONG ResourceLen, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +/* CM_Reenumerate_DevNode.ulFlags constants */ +#define CM_REENUMERATE_NORMAL 0x00000000 +#define CM_REENUMERATE_SYNCHRONOUS 0x00000001 +#define CM_REENUMERATE_RETRY_INSTALLATION 0x00000002 +#define CM_REENUMERATE_ASYNCHRONOUS 0x00000004 +#define CM_REENUMERATE_BITS 0x00000007 + +CMAPI +CONFIGRET +WINAPI +CM_Reenumerate_DevNode( + IN DEVINST dnDevInst, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Reenumerate_DevNode_Ex( + IN DEVINST dnDevInst, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +#define CM_Reenumerate_DevInst CM_Reenumerate_DevNode +#define CM_Reenumerate_DevInst_Ex CM_Reenumerate_DevNode_Ex + +/* FIXME: Obsolete CM_Register_Device_Driver */ +/* FIXME: Obsolete CM_Register_Device_Driver_Ex */ +/* FIXME: Obsolete CM_Register_Device_Interface */ +/* FIXME: Obsolete CM_Register_Device_Interface_Ex */ +/* FIXME: Obsolete CM_Remove_SubTree */ +/* FIXME: Obsolete CM_Remove_SubTree_Ex */ + +CMAPI +CONFIGRET +WINAPI +CM_Request_Device_EjectA( + IN DEVINST dnDevInst, + OUT PPNP_VETO_TYPE pVetoType, + OUT LPSTR pszVetoName, + IN ULONG ulNameLength, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Request_Device_Eject_ExW( + IN DEVINST dnDevInst, + OUT PPNP_VETO_TYPE pVetoType, + OUT LPWSTR pszVetoName, + IN ULONG ulNameLength, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Request_Device_Eject_ExA( + IN DEVINST dnDevInst, + OUT PPNP_VETO_TYPE pVetoType, + OUT LPSTR pszVetoName, + IN ULONG ulNameLength, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Request_Device_EjectW( + IN DEVINST dnDevInst, + OUT PPNP_VETO_TYPE pVetoType, + OUT LPWSTR pszVetoName, + IN ULONG ulNameLength, + IN ULONG ulFlags); + +#ifdef UNICODE +#define CM_Request_Device_Eject CM_Request_Device_EjectW +#define CM_Request_Device_Eject_Ex CM_Request_Device_Eject_ExW +#else +#define CM_Request_Device_Eject CM_Request_Device_EjectA +#define CM_Request_Device_Eject_Ex CM_Request_Device_Eject_ExA +#endif /* UNICODE */ + +CMAPI +CONFIGRET +WINAPI +CM_Request_Eject_PC( + VOID); + +CMAPI +CONFIGRET +WINAPI +CM_Request_Eject_PC_Ex( + IN HMACHINE hMachine); + +/* CM_Run_Detection[_Ex].ulFlags constants */ +#define CM_DETECT_NEW_PROFILE 0x00000001 +#define CM_DETECT_CRASHED 0x00000002 +#define CM_DETECT_HWPROF_FIRST_BOOT 0x00000004 +#define CM_DETECT_RUN 0x80000000 +#define CM_DETECT_BITS 0x80000007 + +CMAPI +CONFIGRET +WINAPI +CM_Run_Detection( + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Run_Detection_Ex( + IN ULONG ulFlags, + IN HMACHINE hMachine); + +/* FIXME: Obsolete CM_Set_Class_Registry_Property */ + +CMAPI +CONFIGRET +WINAPI +CM_Set_DevNode_Problem( + IN DEVINST dnDevInst, + IN ULONG ulProblem, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Set_DevNode_Problem_Ex( + IN DEVINST dnDevInst, + IN ULONG ulProblem, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +#define CM_Set_DevInst_Problem CM_Set_DevNode_Problem +#define CM_Set_DevInst_Problem_Ex CM_Set_DevNode_Problem_Ex + +CMAPI +CONFIGRET +WINAPI +CM_Set_DevNode_Registry_PropertyA( + IN DEVINST dnDevInst, + IN ULONG ulProperty, + IN PCVOID Buffer, OPTIONAL + IN ULONG ulLength, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Set_DevNode_Registry_PropertyW( + IN DEVINST dnDevInst, + IN ULONG ulProperty, + IN PCVOID Buffer, OPTIONAL + IN ULONG ulLength, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Set_DevNode_Registry_Property_ExA( + IN DEVINST dnDevInst, + IN ULONG ulProperty, + IN PCVOID Buffer, OPTIONAL + IN ULONG ulLength, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Set_DevNode_Registry_Property_ExW( + IN DEVINST dnDevInst, + IN ULONG ulProperty, + IN PCVOID Buffer, OPTIONAL + IN ULONG ulLength, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +#define CM_Set_DevInst_Registry_PropertyW CM_Set_DevNode_Registry_PropertyW +#define CM_Set_DevInst_Registry_PropertyA CM_Set_DevNode_Registry_PropertyA +#define CM_Set_DevInst_Registry_Property_ExW CM_Set_DevNode_Registry_Property_ExW +#define CM_Set_DevInst_Registry_Property_ExA CM_Set_DevNode_Registry_Property_ExA + +#ifdef UNICODE +#define CM_Set_DevInst_Registry_Property CM_Set_DevNode_Registry_PropertyW +#define CM_Set_DevInst_Registry_Property_Ex CM_Set_DevNode_Registry_Property_ExW +#define CM_Set_DevNode_Registry_Property CM_Set_DevNode_Registry_PropertyW +#define CM_Set_DevNode_Registry_Property_Ex CM_Set_DevNode_Registry_Property_ExW +#else +#define CM_Set_DevInst_Registry_Property CM_Set_DevNode_Registry_PropertyA +#define CM_Set_DevInst_Registry_Property_Ex CM_Set_DevNode_Registry_Property_ExA +#define CM_Set_DevNode_Registry_Property CM_Set_DevNode_Registry_PropertyA +#define CM_Set_DevNode_Registry_Property_Ex CM_Set_DevNode_Registry_Property_ExA +#endif /* UNICODE */ + +/* FIXME: Obsolete CM_Set_HW_Prof */ +/* FIXME: Obsolete CM_Set_HW_Prof_Ex */ +/* FIXME: Obsolete CM_Set_HW_Prof_Flags */ +/* FIXME: Obsolete CM_Set_HW_Prof_Flags_Ex */ +/* FIXME: Obsolete CM_Setup_DevNode */ +/* FIXME: Obsolete CM_Setup_DevNode_Ex */ +/* FIXME: Obsolete CM_Test_Range_Available */ +/* FIXME: Obsolete CM_Uninstall_DevNode */ +/* FIXME: Obsolete CM_Uninstall_DevNode_Ex */ +/* FIXME: Obsolete CM_Unregister_Device_Interface */ +/* FIXME: Obsolete CM_Unregister_Device_Interface_Ex */ + +#define CM_WaitNoPendingInstallEvents CMP_WaitNoPendingInstallEvents + +CMAPI +DWORD +WINAPI +CMP_WaitNoPendingInstallEvents( + IN DWORD dwTimeout); + +#include + +#ifdef __cplusplus +} +#endif + +#endif /* _CFGMGR32_H_ */ diff --git a/reactos/include/ddk/csq.h b/reactos/include/ddk/csq.h new file mode 100644 index 00000000000..b08d02c27e0 --- /dev/null +++ b/reactos/include/ddk/csq.h @@ -0,0 +1,289 @@ +/* + * Cancel-Safe Queue Library + * Copyright (c) 2004, Vizzini (vizzini@plasmic.com) + * Licensed under the GNU GPL for the ReactOS project + * + * This header defines the interface to the ReactOS Cancel-Safe Queue library. + * This interface is based on and is similar to the Microsoft Cancel-Safe + * Queue interface. + * + * BACKGROUND + * + * IRP queuing is a royal pain in the butt, due to the fact that there are + * tons of built-in race conditions. IRP handling is difficult in general, + * but the cancel logic has been particularly complicated due to some subtle + * races, coupled with the fact that the system interfaces have changed over + * time. + * + * Walter Oney (2nd. Ed. of Programming the Windows Driver Model) states a + * common opinion among driver developers when he says that it is foolish + * to try to roll your own cancel logic. There are only a very few people + * who have gotten it right in the past. He suggests, instead, that you + * either use his own well-tested code, or use the code in the Microsoft + * Cancel-Safe Queue Library. + * + * We cannot do either, of course, due to copyright issues. I have therefore + * created this clone of the Microsoft library in order to concentrate all + * of the IRP-queuing bugs in one place. I'm quite sure there are problems + * here, so if you are a driver writer, I'd be glad to hear your feedback. + * + * Apart from that, please try to use these routines, rather than building + * your own. If you think you have found a bug, please bring it up with me + * or on-list, as this is complicated and non-obvious stuff. Don't just + * change this and hope for the best! + * + * USAGE + * + * This library follows exactly the same interface as the Microsoft Cancel-Safe + * Queue routines (IoCsqXxx()). As such, the authoritative reference is the + * current DDK. There is also a DDK sample called "cancel" that has an + * example of how to use this code. I have also provided a sample driver + * that makes use of this queue. Finally, please do read the header and the + * source if you're curious about the inner workings of these routines. + */ + +#ifndef _REACTOS_CSQ_H +#define _REACTOS_CSQ_H + +/* + * Prevent including the CSQ definitions twice. They're present in NTDDK + * now too, except the *_EX versions. + */ +#ifndef IO_TYPE_CSQ_IRP_CONTEXT + +struct _IO_CSQ; + + +/* + * CSQ Callbacks + * + * The cancel-safe queue is implemented as a set of IoCsqXxx() OS routines + * copuled with a set of driver callbacks to handle the basic operations of + * the queue. You need to supply one of each of these functions in your own + * driver. These routines are also documented in the DDK under CsqXxx(). + * That is the authoritative documentation. + */ + +/* + * Function to insert an IRP in the queue. No need to worry about locking; + * just tack it onto your list or something. + * + * Sample implementation: + * + VOID NTAPI CsqInsertIrp(PIO_CSQ Csq, PIRP Irp) + { + KdPrint(("Inserting IRP 0x%x into CSQ\n", Irp)); + InsertTailList(&IrpQueue, &Irp->Tail.Overlay.ListEntry); + } + * + */ +typedef VOID (NTAPI *PIO_CSQ_INSERT_IRP) (struct _IO_CSQ *Csq, + PIRP Irp); + + +/* + * Function to remove an IRP from the queue. + * + * Sample: + * + VOID NTAPI CsqRemoveIrp(PIO_CSQ Csq, PIRP Irp) + { + KdPrint(("Removing IRP 0x%x from CSQ\n", Irp)); + RemoveEntryList(&Irp->Tail.Overlay.ListEntry); + } + * + */ +typedef VOID (NTAPI *PIO_CSQ_REMOVE_IRP) (struct _IO_CSQ *Csq, + PIRP Irp); + +/* + * Function to look for an IRP in the queue + * + * Sample: + * + PIRP NTAPI CsqPeekNextIrp(PIO_CSQ Csq, PIRP Irp, PVOID PeekContext) + { + KdPrint(("Peeking for next IRP\n")); + + if(Irp) + return CONTAINING_RECORD(&Irp->Tail.Overlay.ListEntry.Flink, IRP, Tail.Overlay.ListEntry); + + if(IsListEmpty(&IrpQueue)) + return NULL; + + return CONTAINING_RECORD(IrpQueue.Flink, IRP, Tail.Overlay.ListEntry); + } + * + */ +typedef PIRP (NTAPI *PIO_CSQ_PEEK_NEXT_IRP) (struct _IO_CSQ *Csq, + PIRP Irp, + PVOID PeekContext); + +/* + * Lock the queue. This can be a spinlock, a mutex, or whatever + * else floats your boat. + * + * Sample: + * + VOID NTAPI CsqAcquireLock(PIO_CSQ Csq, PKIRQL Irql) + { + KdPrint(("Acquiring spin lock\n")); + KeAcquireSpinLock(&IrpQueueLock, Irql); + } + * + */ +typedef VOID (NTAPI *PIO_CSQ_ACQUIRE_LOCK) (struct _IO_CSQ *Csq, + PKIRQL Irql); + +/* + * Unlock the queue: + * + VOID NTAPI CsqReleaseLock(PIO_CSQ Csq, KIRQL Irql) + { + KdPrint(("Releasing spin lock\n")); + KeReleaseSpinLock(&IrpQueueLock, Irql); + } + * + */ +typedef VOID (NTAPI *PIO_CSQ_RELEASE_LOCK) (struct _IO_CSQ *Csq, + KIRQL Irql); + +/* + * Finally, this is called by the queue library when it wants to complete + * a canceled IRP. + * + * Sample: + * + VOID NTAPI CsqCompleteCancelledIrp(PIO_CSQ Csq, PIRP Irp) + { + KdPrint(("cancelling irp 0x%x\n", Irp)); + Irp->IoStatus.Status = STATUS_CANCELLED; + Irp->IoStatus.Information = 0; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + } + * + */ +typedef VOID (NTAPI *PIO_CSQ_COMPLETE_CANCELED_IRP) (struct _IO_CSQ *Csq, + PIRP Irp); + + +/* + * STRUCTURES + * + * NOTE: Please do not use these directly. You will make incompatible code + * if you do. Always only use the documented IoCsqXxx() interfaces and you + * will amass much Good Karma. + */ +#define IO_TYPE_CSQ_IRP_CONTEXT 1 +#define IO_TYPE_CSQ 2 + +/* + * IO_CSQ - Queue control structure + */ +typedef struct _IO_CSQ { + ULONG Type; + PIO_CSQ_INSERT_IRP CsqInsertIrp; + PIO_CSQ_REMOVE_IRP CsqRemoveIrp; + PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp; + PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock; + PIO_CSQ_RELEASE_LOCK CsqReleaseLock; + PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp; + PVOID ReservePointer; /* must be NULL */ +} IO_CSQ, *PIO_CSQ; + +/* + * IO_CSQ_IRP_CONTEXT - Context used to track an IRP in the CSQ + */ +typedef struct _IO_CSQ_IRP_CONTEXT { + ULONG Type; + PIRP Irp; + PIO_CSQ Csq; +} IO_CSQ_IRP_CONTEXT, *PIO_CSQ_IRP_CONTEXT; + +#endif /* IO_TYPE_CSQ_IRP_CONTEXT */ + +/* See IO_TYPE_CSQ_* above */ +#define IO_TYPE_CSQ_EX 3 + +/* + * Function to insert an IRP into the queue with extended context information. + * This is useful if you need to be able to de-queue particular IRPs more + * easily in some cases. + * + * Same deal as above; sample implementation: + * + NTSTATUS NTAPI CsqInsertIrpEx(PIO_CSQ Csq, PIRP Irp, PVOID InsertContext) + { + CsqInsertIrp(Csq, Irp); + return STATUS_PENDING; + } + * + */ +typedef NTSTATUS (NTAPI *PIO_CSQ_INSERT_IRP_EX) (struct _IO_CSQ *Csq, + PIRP Irp, + PVOID InsertContext); + +/* + * CANCEL-SAFE QUEUE DDIs + * + * These device driver interfaces are called to make use of the queue. Again, + * authoritative documentation for these functions is in the DDK. The csqtest + * driver also makes use of some of them. + */ + + +/* + * Call this in DriverEntry or similar in order to set up the Csq structure. + * As long as the Csq struct and the functions you pass in are resident, + * there are no IRQL restrictions. + */ +NTSTATUS NTAPI IoCsqInitialize(PIO_CSQ Csq, + PIO_CSQ_INSERT_IRP CsqInsertIrp, + PIO_CSQ_REMOVE_IRP CsqRemoveIrp, + PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp, + PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock, + PIO_CSQ_RELEASE_LOCK CsqReleaseLock, + PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp); + +/* + * Same as above, except you provide a CsqInsertIrpEx routine instead of + * CsqInsertIrp. This eventually allows you to supply extra tracking + * information for use with the queue. + */ +NTSTATUS NTAPI IoCsqInitializeEx(PIO_CSQ Csq, + PIO_CSQ_INSERT_IRP_EX CsqInsertIrpEx, + PIO_CSQ_REMOVE_IRP CsqRemoveIrp, + PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp, + PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock, + PIO_CSQ_RELEASE_LOCK CsqReleaseLock, + PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp); + +/* + * Insert an IRP into the queue + */ +VOID NTAPI IoCsqInsertIrp(PIO_CSQ Csq, + PIRP Irp, + PIO_CSQ_IRP_CONTEXT Context); + +/* + * Insert an IRP into the queue, with special context maintained that + * makes it easy to find IRPs in the queue + */ +NTSTATUS NTAPI IoCsqInsertIrpEx(PIO_CSQ Csq, + PIRP Irp, + PIO_CSQ_IRP_CONTEXT Context, + PVOID InsertContext); + +/* + * Remove a particular IRP from the queue + */ +PIRP NTAPI IoCsqRemoveIrp(PIO_CSQ Csq, + PIO_CSQ_IRP_CONTEXT Context); + +/* + * Remove the next IRP from the queue + */ +PIRP NTAPI IoCsqRemoveNextIrp(PIO_CSQ Csq, + PVOID PeekContext); + +#endif /* _REACTOS_CSQ_H */ diff --git a/reactos/include/ddk/d3dhal.h b/reactos/include/ddk/d3dhal.h new file mode 100644 index 00000000000..867901ae339 --- /dev/null +++ b/reactos/include/ddk/d3dhal.h @@ -0,0 +1,525 @@ +/* + * Direct3D driver interface + * (DirectX 7 version) + * + * Copyright (C) 2001 Ove Kaaven + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef _D3DHAL_H_ +#define _D3DHAL_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/***************************************************************************** + * device info structures + */ +typedef struct _D3DDeviceDesc_V1 { + DWORD dwSize; + DWORD dwFlags; + D3DCOLORMODEL dcmColorModel; + DWORD dwDevCaps; + D3DTRANSFORMCAPS dtcTransformCaps; + BOOL bClipping; + D3DLIGHTINGCAPS dlcLightingCaps; + D3DPRIMCAPS dpcLineCaps; + D3DPRIMCAPS dpcTriCaps; + DWORD dwDeviceRenderBitDepth; + DWORD dwDeviceZBufferBitDepth; + DWORD dwMaxBufferSize; + DWORD dwMaxVertexCount; +} D3DDEVICEDESC_V1,*LPD3DDEVICEDESC_V1; + +/* this is to allow keeping the bulk of our OpenGL code out of x11drv */ +#define D3DDD_WINE_OPENGL_DEVICE 0x00008000 + +typedef struct _D3DHAL_GLOBALDRIVERDATA { + DWORD dwSize; + D3DDEVICEDESC_V1 hwCaps; + DWORD dwNumVertices; + DWORD dwNumClipVertices; + DWORD dwNumTextureFormats; + LPDDSURFACEDESC lpTextureFormats; +} D3DHAL_GLOBALDRIVERDATA,*LPD3DHAL_GLOBALDRIVERDATA; + +typedef struct _D3DHAL_D3DEXTENDEDCAPS { + DWORD dwSize; + /* DirectX 5 */ + DWORD dwMinTextureWidth, dwMaxTextureWidth; + DWORD dwMinTextureHeight, dwMaxTextureHeight; + DWORD dwMinStippleWidth, dwMaxStippleWidth; + DWORD dwMinStippleHeight, dwMaxStippleHeight; + /* DirectX 6 */ + DWORD dwMaxTextureRepeat; + DWORD dwMaxTextureAspectRatio; + DWORD dwMaxAnisotropy; + D3DVALUE dvGuardBandLeft; + D3DVALUE dvGuardBandTop; + D3DVALUE dvGuardBandRight; + D3DVALUE dvGuardBandBottom; + D3DVALUE dvExtentsAdjust; + DWORD dwStencilCaps; + DWORD dwFVFCaps; + DWORD dwTextureOpCaps; + WORD wMaxTextureBlendStages; + WORD wMaxSimultaneousTextures; + /* DirectX 7 */ + DWORD dwMaxActiveLights; + D3DVALUE dvMaxVertexW; + WORD wMaxUserClipPlanes; + WORD wMaxVertexBlendMatrices; + DWORD dwVertexProcessingCaps; + DWORD dwReserved1; + DWORD dwReserved2; + DWORD dwReserved3; + DWORD dwReserved4; +} D3DHAL_D3DEXTENDEDCAPS,*LPD3DHAL_D3DEXTENDEDCAPS; + +/***************************************************************************** + * d3d->driver callbacks + */ +typedef struct _D3DHAL_CONTEXTCREATEDATA *LPD3DHAL_CONTEXTCREATEDATA; +typedef struct _D3DHAL_CONTEXTDESTROYDATA *LPD3DHAL_CONTEXTDESTROYDATA; +typedef struct _D3DHAL_CONTEXTDESTROYALLDATA *LPD3DHAL_CONTEXTDESTROYALLDATA; +typedef struct _D3DHAL_SCENECAPTUREDATA *LPD3DHAL_SCENECAPTUREDATA; +typedef struct _D3DHAL_RENDERSTATEDATA *LPD3DHAL_RENDERSTATEDATA; +typedef struct _D3DHAL_RENDERPRIMITIVEDATA *LPD3DHAL_RENDERPRIMITIVEDATA; +typedef struct _D3DHAL_TEXTURECREATEDATA *LPD3DHAL_TEXTURECREATEDATA; +typedef struct _D3DHAL_TEXTUREDESTROYDATA *LPD3DHAL_TEXTUREDESTROYDATA; +typedef struct _D3DHAL_TEXTURESWAPDATA *LPD3DHAL_TEXTURESWAPDATA; +typedef struct _D3DHAL_TEXTUREGETSURFDATA *LPD3DHAL_TEXTUREGETSURFDATA; +typedef struct _D3DHAL_GETSTATEDATA *LPD3DHAL_GETSTATEDATA; + +typedef DWORD (PASCAL *LPD3DHAL_CONTEXTCREATECB) (LPD3DHAL_CONTEXTCREATEDATA); +typedef DWORD (PASCAL *LPD3DHAL_CONTEXTDESTROYCB) (LPD3DHAL_CONTEXTDESTROYDATA); +typedef DWORD (PASCAL *LPD3DHAL_CONTEXTDESTROYALLCB)(LPD3DHAL_CONTEXTDESTROYALLDATA); +typedef DWORD (PASCAL *LPD3DHAL_SCENECAPTURECB) (LPD3DHAL_SCENECAPTUREDATA); +typedef DWORD (PASCAL *LPD3DHAL_RENDERSTATECB) (LPD3DHAL_RENDERSTATEDATA); +typedef DWORD (PASCAL *LPD3DHAL_RENDERPRIMITIVECB) (LPD3DHAL_RENDERPRIMITIVEDATA); +typedef DWORD (PASCAL *LPD3DHAL_TEXTURECREATECB) (LPD3DHAL_TEXTURECREATEDATA); +typedef DWORD (PASCAL *LPD3DHAL_TEXTUREDESTROYCB) (LPD3DHAL_TEXTUREDESTROYDATA); +typedef DWORD (PASCAL *LPD3DHAL_TEXTURESWAPCB) (LPD3DHAL_TEXTURESWAPDATA); +typedef DWORD (PASCAL *LPD3DHAL_TEXTUREGETSURFCB) (LPD3DHAL_TEXTUREGETSURFDATA); +typedef DWORD (PASCAL *LPD3DHAL_GETSTATECB) (LPD3DHAL_GETSTATEDATA); + +typedef struct _D3DHAL_CALLBACKS { + DWORD dwSize; + LPD3DHAL_CONTEXTCREATECB ContextCreate; + LPD3DHAL_CONTEXTDESTROYCB ContextDestroy; + LPD3DHAL_CONTEXTDESTROYALLCB ContextDestroyAll; + LPD3DHAL_SCENECAPTURECB SceneCapture; + LPVOID lpReserved10; + LPVOID lpReserved11; + LPD3DHAL_RENDERSTATECB RenderState; + LPD3DHAL_RENDERPRIMITIVECB RenderPrimitive; + DWORD dwReserved; + LPD3DHAL_TEXTURECREATECB TextureCreate; + LPD3DHAL_TEXTUREDESTROYCB TextureDestroy; + LPD3DHAL_TEXTURESWAPCB TextureSwap; + LPD3DHAL_TEXTUREGETSURFCB TextureGetSurf; + /* now why did MS create CALLBACKS2 and CALLBACKS3 structures if + * all these reserved fields were available? we may never know */ + LPVOID lpReserved12; + LPVOID lpReserved13; + LPVOID lpReserved14; + LPVOID lpReserved15; + LPVOID lpReserved16; + LPVOID lpReserved17; + LPVOID lpReserved18; + LPVOID lpReserved19; + LPVOID lpReserved20; + LPVOID lpReserved21; + LPD3DHAL_GETSTATECB GetState; + DWORD dwReserved0; + DWORD dwReserved1; + DWORD dwReserved2; + DWORD dwReserved3; + DWORD dwReserved4; + DWORD dwReserved5; + DWORD dwReserved6; + DWORD dwReserved7; + DWORD dwReserved8; + DWORD dwReserved9; +} D3DHAL_CALLBACKS,*LPD3DHAL_CALLBACKS; + +typedef struct _D3DHAL_SETRENDERTARGETDATA *LPD3DHAL_SETRENDERTARGETDATA; +typedef struct _D3DHAL_CLEARDATA *LPD3DHAL_CLEARDATA; +typedef struct _D3DHAL_DRAWONEPRIMITIVEDATA *LPD3DHAL_DRAWONEPRIMITIVEDATA; +typedef struct _D3DHAL_DRAWONEINDEXEDPRIMITIVEDATA *LPD3DHAL_DRAWONEINDEXEDPRIMITIVEDATA; +typedef struct _D3DHAL_DRAWPRIMITIVESDATA *LPD3DHAL_DRAWPRIMITIVESDATA; + +typedef DWORD (PASCAL *LPD3DHAL_SETRENDERTARGETCB) (LPD3DHAL_SETRENDERTARGETDATA); +typedef DWORD (PASCAL *LPD3DHAL_CLEARCB) (LPD3DHAL_CLEARDATA); +typedef DWORD (PASCAL *LPD3DHAL_DRAWONEPRIMITIVECB) (LPD3DHAL_DRAWONEPRIMITIVEDATA); +typedef DWORD (PASCAL *LPD3DHAL_DRAWONEINDEXEDPRIMITIVECB)(LPD3DHAL_DRAWONEINDEXEDPRIMITIVEDATA); +typedef DWORD (PASCAL *LPD3DHAL_DRAWPRIMITIVESCB) (LPD3DHAL_DRAWPRIMITIVESDATA); + +typedef struct _D3DHAL_CALLBACKS2 { + DWORD dwSize; + DWORD dwFlags; + LPD3DHAL_SETRENDERTARGETCB SetRenderTarget; + LPD3DHAL_CLEARCB Clear; + LPD3DHAL_DRAWONEPRIMITIVECB DrawOnePrimitive; + LPD3DHAL_DRAWONEINDEXEDPRIMITIVECB DrawOneIndexedPrimitive; + LPD3DHAL_DRAWPRIMITIVESCB DrawPrimitives; +} D3DHAL_CALLBACKS2,*LPD3DHAL_CALLBACKS2; + +typedef struct _D3DHAL_CLEAR2DATA *LPD3DHAL_CLEAR2DATA; +typedef struct _D3DHAL_VALIDATETEXTURESTAGESTATEDATA *LPD3DHAL_VALIDATETEXTURESTAGESTATEDATA; +typedef struct _D3DHAL_DRAWPRIMITIVES2DATA *LPD3DHAL_DRAWPRIMITIVES2DATA; + +typedef DWORD (PASCAL *LPD3DHAL_CLEAR2CB) (LPD3DHAL_CLEAR2DATA); +typedef DWORD (PASCAL *LPD3DHAL_VALIDATETEXTURESTAGESTATECB)(LPD3DHAL_VALIDATETEXTURESTAGESTATEDATA); +typedef DWORD (PASCAL *LPD3DHAL_DRAWPRIMITIVES2CB) (LPD3DHAL_DRAWPRIMITIVES2DATA); + +typedef struct _D3DHAL_CALLBACKS3 { + DWORD dwSize; + DWORD dwFlags; + LPD3DHAL_CLEAR2CB Clear2; + LPVOID lpvReserved; + LPD3DHAL_VALIDATETEXTURESTAGESTATECB ValidateTextureStageState; + LPD3DHAL_DRAWPRIMITIVES2CB DrawPrimitives2; +} D3DHAL_CALLBACKS3,*LPD3DHAL_CALLBACKS3; + +/***************************************************************************** + * parameter structures + */ +typedef struct _D3DHAL_CONTEXTCREATEDATA { + union { + LPDDRAWI_DIRECTDRAW_GBL lpDDGbl; /* pre-DirectX 7 */ + LPDDRAWI_DIRECTDRAW_LCL lpDDLcl; /* DirectX 7 */ + } DUMMYUNIONNAME1; + union { + LPDIRECTDRAWSURFACE lpDDS; + LPDDRAWI_DDRAWSURFACE_LCL lpDDSLcl; /* DirectX 7 */ + } DUMMYUNIONNAME2; + union { + LPDIRECTDRAWSURFACE lpDDSZ; + LPDDRAWI_DDRAWSURFACE_LCL lpDDSZLcl; /* DirectX 7 */ + } DUMMYUNIONNAME3; + union { + DWORD dwPID; + ULONG_PTR dwrstates; + } DUMMYUNIONNAME4; + ULONG_PTR dwhContext; + HRESULT ddrval; +} D3DHAL_CONTEXTCREATEDATA; + +typedef struct _D3DHAL_CONTEXTDESTROYDATA { + ULONG_PTR dwhContext; + HRESULT ddrval; +} D3DHAL_CONTEXTDESTROYDATA; + +typedef struct _D3DHAL_CONTEXTDESTROYALLDATA { + DWORD dwPID; + HRESULT ddrval; +} D3DHAL_CONTEXTDESTROYALLDATA; + +typedef struct _D3DHAL_SCENECAPTUREDATA { + ULONG_PTR dwhContext; + DWORD dwFlag; + HRESULT ddrval; +} D3DHAL_SCENECAPTUREDATA; + +#define D3DHAL_SCENE_CAPTURE_START 0x00000000 +#define D3DHAL_SCENE_CAPTURE_END 0x00000001 + +typedef struct _D3DHAL_SETRENDERTARGETDATA { + ULONG_PTR dwhContext; + union { + LPDIRECTDRAWSURFACE lpDDS; + LPDDRAWI_DDRAWSURFACE_LCL lpDDSLcl; + } DUMMYUNIONNAME1; + union { + LPDIRECTDRAWSURFACE lpDDSZ; + LPDDRAWI_DDRAWSURFACE_LCL lpDDSZLcl; + } DUMMYUNIONNAME2; + HRESULT ddrval; +} D3DHAL_SETRENDERTARGETDATA; + +typedef struct _D3DHAL_DRAWPRIMITIVES2DATA { + ULONG_PTR dwhContext; + DWORD dwFlags; + DWORD dwVertexType; + LPDDRAWI_DDRAWSURFACE_LCL lpDDCommands; + DWORD dwCommandOffset; + DWORD dwCommandLength; + union { + LPDDRAWI_DDRAWSURFACE_LCL lpDDVertex; + LPVOID lpVertices; + } DUMMYUNIONNAME1; + DWORD dwVertexOffset; + DWORD dwVertexLength; + DWORD dwReqVertexBufSize; + DWORD dwReqCommandBufSize; + LPDWORD lpdwRStates; + union { + DWORD dwVertexSize; + HRESULT ddrval; + } DUMMYUNIONNAME2; + DWORD dwErrorOffset; +} D3DHAL_DRAWPRIMITIVES2DATA; + +#define D3DHALDP2_USERMEMVERTICES 0x00000001 +#define D3DHALDP2_EXECUTEBUFFER 0x00000002 +#define D3DHALDP2_SWAPVERTEXBUFFER 0x00000004 +#define D3DHALDP2_SWAPCOMMANDBUFFER 0x00000008 +#define D3DHALDP2_REQVERTEXBUFSIZE 0x00000010 +#define D3DHALDP2_REQCOMMANDBUFSIZE 0x00000020 +#define D3DHALDP2_VIDMEMVERTEXBUF 0x00000040 +#define D3DHALDP2_VIDMEMCOMMANDBUF 0x00000080 + +/***************************************************************************** + * DrawPrimitives2 command structures + */ +typedef struct _D3DHAL_DP2COMMAND { + BYTE bCommand; + BYTE bReserved; + union { + WORD wPrimitiveCount; + WORD wStateCount; + } DUMMYUNIONNAME; +} D3DHAL_DP2COMMAND,*LPD3DHAL_DP2COMMAND; + +typedef enum _D3DHAL_DP2OPERATION { + D3DDP2OP_POINTS = 1, + D3DDP2OP_INDEXEDLINELIST = 2, + D3DDP2OP_INDEXEDTRIANGLELIST = 3, + D3DDP2OP_RESERVED0 = 4, + D3DDP2OP_RENDERSTATE = 8, + D3DDP2OP_LINELIST = 15, + D3DDP2OP_LINESTRIP = 16, + D3DDP2OP_INDEXEDLINESTRIP = 17, + D3DDP2OP_TRIANGLELIST = 18, + D3DDP2OP_TRIANGLESTRIP = 19, + D3DDP2OP_INDEXEDTRIANGLESTRIP = 20, + D3DDP2OP_TRIANGLEFAN = 21, + D3DDP2OP_INDEXEDTRIANGLEFAN = 22, + D3DDP2OP_TRIANGLEFAN_IMM = 23, + D3DDP2OP_LINELIST_IMM = 24, + D3DDP2OP_TEXTURESTAGESTATE = 25, + D3DDP2OP_INDEXEDTRIANGLELIST2 = 26, + D3DDP2OP_INDEXEDLINELIST2 = 27, + D3DDP2OP_VIEWPORTINFO = 28, + D3DDP2OP_WINFO = 29, + /* pre-DirectX 7 interfaces */ + D3DDP2OP_SETPALETTE = 30, + D3DDP2OP_UPDATEPALETTE = 31, + /* DirectX 7 interfaces */ + D3DDP2OP_ZRANGE = 32, + D3DDP2OP_SETMATERIAL = 33, + D3DDP2OP_SETLIGHT = 34, + D3DDP2OP_CREATELIGHT = 35, + D3DDP2OP_SETTRANSFORM = 36, + D3DDP2OP_EXT = 37, + D3DDP2OP_TEXBLT = 38, + D3DDP2OP_STATESET = 39, + D3DDP2OP_SETPRIORITY = 40, + /* all interfaces */ + D3DDP2OP_SETRENDERTARGET = 41, + D3DDP2OP_CLEAR = 42, + /* DirectX 7 interfaces */ + D3DDP2OP_SETTEXLOD = 43, + D3DPP2OP_SETCLIPPLANE = 44 +} D3DHAL_DP2OPERATION; + +/* point primitives */ + +typedef struct _D3DHAL_POINTS { + WORD wCount; + WORD wVStart; +} D3DHAL_DP2POINTS,*LPD3DHAL_DP2POINTS; + +/* line primitives */ + +typedef struct _D3DHAL_DP2STARTVERTEX { + WORD wVStart; +} D3DHAL_DP2STARTVERTEX,*LPD3DHAL_DP2STARTVERTEX; + +typedef struct _D3DHAL_DP2LINELIST { + WORD wVStart; +} D3DHAL_DP2LINELIST,*LPD3DHAL_DP2LINELIST; + +typedef struct _D3DHAL_DP2INDEXEDLINELIST { + WORD wV1; + WORD wV2; +} D3DHAL_DP2INDEXEDLINELIST,*LPD3DHAL_DP2INDEXEDLINELIST; + +typedef struct _D3DHAL_DP2LINESTRIP { + WORD wVStart; +} D3DHAL_DP2LINESTRIP,*LPD3DHAL_DP2LINESTRIP; + +typedef struct _D3DHAL_DP2INDEXEDLINESTRIP { + WORD wV[2]; +} D3DHAL_DP2INDEXEDLINESTRIP,*LPD3DHAL_DP2INDEXEDLINESTRIP; + +/* triangle primitives */ + +typedef struct _D3DHAL_DP2TRIANGLELIST { + WORD wVStart; +} D3DHAL_DP2TRIANGLELIST,*LPD3DHAL_DP2TRIANGLELIST; + +typedef struct _D3DHAL_DP2INDEXEDTRIANGLELIST { + WORD wV1; + WORD wV2; + WORD wV3; + WORD wFlags; +} D3DHAL_DP2INDEXEDTRIANGLELIST,*LPD3DHAL_DP2INDEXEDTRIANGLELIST; + +typedef struct _D3DHAL_DP2INDEXEDTRIANGLELIST2 { + WORD wV1; + WORD wV2; + WORD wV3; +} D3DHAL_DP2INDEXEDTRIANGLELIST2,*LPD3DHAL_DP2INDEXEDTRIANGLELIST2; + +typedef struct _D3DHAL_DP2TRIANGLESTRIP { + WORD wVStart; +} D3DHAL_DP2TRIANGLESTRIP,*LPD3DHAL_DP2TRIANGLESTRIP; + +typedef struct _D3DHAL_DP2INDEXEDTRIANGLESTRIP { + WORD wV[3]; +} D3DHAL_DP2INDEXEDTRIANGLESTRIP,*LPD3DHAL_DP2INDEXEDTRIANGLESTRIP; + +typedef struct _D3DHAL_DP2TRIANGLEFAN { + WORD wVStart; +} D3DHAL_DP2TRIANGLEFAN,*LPD3DHAL_DP2TRIANGLEFAN; + +typedef struct _D3DHAL_DP2INDEXEDTRIANGLEFAN { + WORD wV[3]; +} D3DHAL_DP2INDEXEDTRIANGLEFAN,*LPD3DHAL_DP2INDEXEDTRIANGLEFAN; + +typedef struct _D3DHAL_DP2TRIANGLEFAN_IMM { + DWORD dwEdgeFlags; +} D3DHAL_DP2TRIANGLEFAN_IMM,*LPD3DHAL_DP2TRIANGLEFAN_IMM; + +/* render states */ +typedef struct _D3DHAL_DP2RENDERSTATE { + D3DRENDERSTATETYPE RenderState; + union { + D3DVALUE dvState; + DWORD dwState; + } DUMMYUNIONNAME; +} D3DHAL_DP2RENDERSTATE,*LPD3DHAL_DP2RENDERSTATE; + +typedef struct _D3DHAL_DP2TEXTURESTAGESTATE { + WORD wStage; + WORD TSState; + DWORD dwValue; +} D3DHAL_DP2TEXTURESTAGESTATE,*LPD3DHAL_DP2TEXTURESTAGESTATE; + +#define D3DTSS_TEXTUREMAP 0 + +typedef struct _D3DHAL_DP2VIEWPORTINFO { + DWORD dwX; + DWORD dwY; + DWORD dwWidth; + DWORD dwHeight; +} D3DHAL_DP2VIEWPORTINFO,*LPD3DHAL_DP2VIEWPORTINFO; + +typedef struct _D3DHAL_DP2WINFO { + D3DVALUE dwWNear; + D3DVALUE dwWFar; +} D3DHAL_DP2WINFO,*LPD3DHAL_DP2WINFO; + +typedef struct _D3DHAL_DP2SETPALETTE { + DWORD dwPaletteHandle; + DWORD dwPaletteFlags; + DWORD dwSurfaceHandle; +} D3DHAL_DP2SETPALETTE,*LPD3DHAL_DP2SETPALETTE; + +typedef struct _D3DHAL_DP2UPDATEPALETTE { + DWORD dwPaletteHandle; + WORD wStartIndex; + WORD wNumEntries; +} D3DHAL_DP2UPDATEPALETTE,*LPD3DHAL_DP2UPDATEPALETTE; + +typedef struct _D3DHAL_DP2ZRANGE { + D3DVALUE dvMinZ; + D3DVALUE dvMaxZ; +} D3DHAL_DP2ZRANGE,*LPD3DHAL_DP2ZRANGE; + +typedef D3DMATERIAL7 D3DHAL_DP2SETMATERIAL,*LPD3DHAL_DP2SETMATERIAL; + +typedef struct _D3DHAL_DP2SETLIGHT { + DWORD dwIndex; + DWORD dwDataType; +} D3DHAL_DP2SETLIGHT,*LPD3DHAL_DP2SETLIGHT; + +#define D3DHAL_SETLIGHT_ENABLE 0 +#define D3DHAL_SETLIGHT_DISABLE 1 +#define D3DHAL_SETLIGHT_DATA 2 + +typedef struct _D3DHAL_DP2CREATELIGHT { + DWORD dwIndex; +} D3DHAL_DP2CREATELIGHT,*LPD3DHAL_DP2CREATELIGHT; + +typedef struct _D3DHAL_DP2SETTRANSFORM { + D3DTRANSFORMSTATETYPE xfrmType; + D3DMATRIX matrix; +} D3DHAL_DP2SETTRANSFORM,*LPD3DHAL_DP2SETTRANSFORM; + +typedef struct _D3DHAL_DP2TEXBLT { + DWORD dwDDDestSurface; + DWORD dwDDSrcSurface; + POINT pDest; + RECTL rSrc; + DWORD dwFlags; +} D3DHAL_DP2TEXBLT,*LPD3DHAL_DP2TEXBLT; + +typedef struct _D3DHAL_DP2STATESET { + DWORD dwOperation; + DWORD dwParam; + D3DSTATEBLOCKTYPE sbType; +} D3DHAL_DP2STATESET,*LPD3DHAL_DP2STATESET; + +#define D3DHAL_STATESETBEGIN 0 +#define D3DHAL_STATESETEND 1 +#define D3DHAL_STATESETDELETE 2 +#define D3DHAL_STATESETEXECUTE 3 +#define D3DHAL_STATESETCAPTURE 4 + +typedef struct _D3DHAL_DP2SETPRIORITY { + DWORD dwDDSurface; + DWORD dwPriority; +} D3DHAL_DP2SETPRIORITY,*LPD3DHAL_DP2SETPRIORITY; + +typedef struct _D3DHAL_DP2SETRENDERTARGET { + DWORD hRenderTarget; + DWORD hZBuffer; +} D3DHAL_DP2SETRENDERTARGET,*LPD3DHAL_DP2SETRENDERTARGET; + +typedef struct _D3DHAL_DP2CLEAR { + DWORD dwFlags; + DWORD dwFillColor; + D3DVALUE dvFillDepth; + DWORD dwFillStencil; + RECT Rects[1]; +} D3DHAL_DP2CLEAR,*LPD3DHAL_DP2CLEAR; + +typedef struct _D3DHAL_DP2SETTEXLOD { + DWORD dwDDSurface; + DWORD dwLOD; +} D3DHAL_DP2SETTEXLOD,*LPD3DHAL_DP2SETTEXLOD; + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* _D3DHAL_H_ */ diff --git a/reactos/include/ddk/d3dnthal.h b/reactos/include/ddk/d3dnthal.h new file mode 100644 index 00000000000..90e91300713 --- /dev/null +++ b/reactos/include/ddk/d3dnthal.h @@ -0,0 +1,209 @@ +/* + * Direct3D NT driver interface + */ + +#ifndef __DDK_D3DNTHAL_H +#define __DDK_D3DNTHAL_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +DEFINE_GUID(GUID_D3DCallbacks, 0x7BF06990, 0x8794, 0x11D0, 0x91, 0x39, 0x08, 0x00, 0x36, 0xD2, 0xEF, 0x02); +DEFINE_GUID(GUID_D3DCallbacks3, 0xDDF41230, 0xEC0A, 0x11D0, 0xA9, 0xB6, 0x00, 0xAA, 0x00, 0xC0, 0x99, 0x3E); +DEFINE_GUID(GUID_D3DExtendedCaps, 0x7DE41F80, 0x9D93, 0x11D0, 0x89, 0xAB, 0x00, 0xA0, 0xC9, 0x05, 0x41, 0x29); +DEFINE_GUID(GUID_D3DParseUnknownCommandCallback, 0x2E04FFA0, 0x98E4, 0x11D1, 0x8C, 0xE1, 0x00, 0xA0, 0xC9, 0x06, 0x29, 0xA8); +DEFINE_GUID(GUID_ZPixelFormats, 0x93869880, 0x36CF, 0x11D1, 0x9B, 0x1B, 0x00, 0xAA, 0x00, 0xBB, 0xB8, 0xAE); +DEFINE_GUID(GUID_DDStereoMode, 0xF828169C, 0xA8E8, 0x11D2, 0xA1, 0xF2, 0x00, 0xA0, 0xC9, 0x83, 0xEA, 0xF6); + +typedef struct _D3DNTHAL_CONTEXTCREATEDATA +{ + union + { + PDD_DIRECTDRAW_GLOBAL lpDDGbl; + PDD_DIRECTDRAW_LOCAL lpDDLcl; + }; + union + { + PDD_SURFACE_LOCAL lpDDS; + PDD_SURFACE_LOCAL lpDDSLcl; + }; + union + { + PDD_SURFACE_LOCAL lpDDSZ; + PDD_SURFACE_LOCAL lpDDSZLcl; + }; + DWORD dwPID; + ULONG_PTR dwhContext; + HRESULT ddrval; +} D3DNTHAL_CONTEXTCREATEDATA, *LPD3DNTHAL_CONTEXTCREATEDATA; + +typedef struct _D3DNTHAL_CONTEXTDESTROYDATA +{ + ULONG_PTR dwhContext; + HRESULT ddrval; +} D3DNTHAL_CONTEXTDESTROYDATA, *LPD3DNTHAL_CONTEXTDESTROYDATA; + +typedef struct _D3DNTHAL_CONTEXTDESTROYALLDATA +{ + DWORD dwPID; + HRESULT ddrval; +} D3DNTHAL_CONTEXTDESTROYALLDATA, *LPD3DNTHAL_CONTEXTDESTROYALLDATA; + +typedef struct _D3DNTHAL_SCENECAPTUREDATA +{ + ULONG_PTR dwhContext; + DWORD dwFlag; + HRESULT ddrval; +} D3DNTHAL_SCENECAPTUREDATA, *LPD3DNTHAL_SCENECAPTUREDATA; + +typedef struct _D3DNTHAL_TEXTURECREATEDATA +{ + ULONG_PTR dwhContext; + HANDLE hDDS; + ULONG_PTR dwHandle; + HRESULT ddrval; +} D3DNTHAL_TEXTURECREATEDATA, *LPD3DNTHAL_TEXTURECREATEDATA; + +typedef struct _D3DNTHAL_TEXTUREDESTROYDATA +{ + ULONG_PTR dwhContext; + ULONG_PTR dwHandle; + HRESULT ddrval; +} D3DNTHAL_TEXTUREDESTROYDATA, *LPD3DNTHAL_TEXTUREDESTROYDATA; + +typedef struct _D3DNTHAL_TEXTURESWAPDATA +{ + ULONG_PTR dwhContext; + ULONG_PTR dwHandle1; + ULONG_PTR dwHandle2; + HRESULT ddrval; +} D3DNTHAL_TEXTURESWAPDATA, *LPD3DNTHAL_TEXTURESWAPDATA; + +typedef struct _D3DNTHAL_TEXTUREGETSURFDATA +{ + ULONG_PTR dwhContext; + HANDLE hDDS; + ULONG_PTR dwHandle; + HRESULT ddrval; +} D3DNTHAL_TEXTUREGETSURFDATA, *LPD3DNTHAL_TEXTUREGETSURFDATA; + +typedef DWORD (APIENTRY *LPD3DNTHAL_CONTEXTCREATECB)(LPD3DNTHAL_CONTEXTCREATEDATA); +typedef DWORD (APIENTRY *LPD3DNTHAL_CONTEXTDESTROYCB)(LPD3DNTHAL_CONTEXTDESTROYDATA); +typedef DWORD (APIENTRY *LPD3DNTHAL_CONTEXTDESTROYALLCB)(LPD3DNTHAL_CONTEXTDESTROYALLDATA); +typedef DWORD (APIENTRY *LPD3DNTHAL_SCENECAPTURECB)(LPD3DNTHAL_SCENECAPTUREDATA); +typedef DWORD (APIENTRY *LPD3DNTHAL_TEXTURECREATECB)(LPD3DNTHAL_TEXTURECREATEDATA); +typedef DWORD (APIENTRY *LPD3DNTHAL_TEXTUREDESTROYCB)(LPD3DNTHAL_TEXTUREDESTROYDATA); +typedef DWORD (APIENTRY *LPD3DNTHAL_TEXTURESWAPCB)(LPD3DNTHAL_TEXTURESWAPDATA); +typedef DWORD (APIENTRY *LPD3DNTHAL_TEXTUREGETSURFCB)(LPD3DNTHAL_TEXTUREGETSURFDATA); + +typedef struct _D3DNTHALDeviceDesc_V1 +{ + DWORD dwSize; + DWORD dwFlags; + D3DCOLORMODEL dcmColorModel; + DWORD dwDevCaps; + D3DTRANSFORMCAPS dtcTransformCaps; + BOOL bClipping; + D3DLIGHTINGCAPS dlcLightingCaps; + D3DPRIMCAPS dpcLineCaps; + D3DPRIMCAPS dpcTriCaps; + DWORD dwDeviceRenderBitDepth; + DWORD dwDeviceZBufferBitDepth; + DWORD dwMaxBufferSize; + DWORD dwMaxVertexCount; +} D3DNTHALDEVICEDESC_V1, *LPD3DNTHALDEVICEDESC_V1; + +typedef struct _D3DNTHAL_GLOBALDRIVERDATA +{ + DWORD dwSize; + D3DNTHALDEVICEDESC_V1 hwCaps; + DWORD dwNumVertices; + DWORD dwNumClipVertices; + DWORD dwNumTextureFormats; + LPDDSURFACEDESC lpTextureFormats; +} D3DNTHAL_GLOBALDRIVERDATA, *LPD3DNTHAL_GLOBALDRIVERDATA; + +typedef struct _D3DNTHAL_CALLBACKS +{ + DWORD dwSize; + LPD3DNTHAL_CONTEXTCREATECB ContextCreate; + LPD3DNTHAL_CONTEXTDESTROYCB ContextDestroy; + LPD3DNTHAL_CONTEXTDESTROYALLCB ContextDestroyAll; + LPD3DNTHAL_SCENECAPTURECB SceneCapture; + LPVOID dwReserved10; + LPVOID dwReserved11; + LPVOID dwReserved22; + LPVOID dwReserved23; + ULONG_PTR dwReserved; + LPD3DNTHAL_TEXTURECREATECB TextureCreate; + LPD3DNTHAL_TEXTUREDESTROYCB TextureDestroy; + LPD3DNTHAL_TEXTURESWAPCB TextureSwap; + LPD3DNTHAL_TEXTUREGETSURFCB TextureGetSurf; + LPVOID dwReserved12; + LPVOID dwReserved13; + LPVOID dwReserved14; + LPVOID dwReserved15; + LPVOID dwReserved16; + LPVOID dwReserved17; + LPVOID dwReserved18; + LPVOID dwReserved19; + LPVOID dwReserved20; + LPVOID dwReserved21; + LPVOID dwReserved24; + ULONG_PTR dwReserved0; + ULONG_PTR dwReserved1; + ULONG_PTR dwReserved2; + ULONG_PTR dwReserved3; + ULONG_PTR dwReserved4; + ULONG_PTR dwReserved5; + ULONG_PTR dwReserved6; + ULONG_PTR dwReserved7; + ULONG_PTR dwReserved8; + ULONG_PTR dwReserved9; +} D3DNTHAL_CALLBACKS, *LPD3DNTHAL_CALLBACKS; + +typedef struct _D3DNTHAL_VALIDATETEXTURESTAGESTATEDATA +{ + ULONG_PTR dwhContext; + DWORD dwFlags; + ULONG_PTR dwReserved; + DWORD dwNumPasses; + HRESULT ddrval; +} D3DNTHAL_VALIDATETEXTURESTAGESTATEDATA, FAR *LPD3DNTHAL_VALIDATETEXTURESTAGESTATEDATA; + +typedef struct _D3DNTHAL_DRAWPRIMITIVES2DATA +{ + ULONG_PTR dwhContext; + DWORD dwFlags; + DWORD dwVertexType; + PDD_SURFACE_LOCAL lpDDCommands; + DWORD dwCommandOffset; + DWORD dwCommandLength; + union + { + PDD_SURFACE_LOCAL lpDDVertex; + LPVOID lpVertices; + }; + DWORD dwVertexOffset; + DWORD dwVertexLength; + DWORD dwReqVertexBufSize; + DWORD dwReqCommandBufSize; + LPDWORD lpdwRStates; + union + { + DWORD dwVertexSize; + HRESULT ddrval; + }; + DWORD dwErrorOffset; +} D3DNTHAL_DRAWPRIMITIVES2DATA, FAR *LPD3DNTHAL_DRAWPRIMITIVES2DATA; + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __DDK_D3DNTHAL_H */ diff --git a/reactos/include/ddk/d4drvif.h b/reactos/include/ddk/d4drvif.h new file mode 100644 index 00000000000..15debe7e584 --- /dev/null +++ b/reactos/include/ddk/d4drvif.h @@ -0,0 +1,103 @@ +/* + * d4drvif.h + * + * DOT4 driver IOCTL interface + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __D4DRVIF_H +#define __D4DRVIF_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include "d4iface.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define FILE_DEVICE_DOT4 0x3a +#define IOCTL_DOT4_USER_BASE 2049 + +#define IOCTL_DOT4_ADD_ACTIVITY_BROADCAST \ + CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 4, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_DOT4_CLOSE_CHANNEL \ + CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 1, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_DOT4_CREATE_SOCKET \ + CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 7, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) + +#define IOCTL_DOT4_DESTROY_SOCKET \ + CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 9, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) + +#define IOCTL_DOT4_OPEN_CHANNEL \ + CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 0, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) + +#define IOCTL_DOT4_READ \ + CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 2, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) + +#define IOCTL_DOT4_REMOVE_ACTIVITY_BROADCAST \ + CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 5, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_DOT4_WAIT_ACTIVITY_BROADCAST \ + CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 6, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) + +#define IOCTL_DOT4_WAIT_FOR_CHANNEL \ + CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 8, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) + +#define IOCTL_DOT4_WRITE \ + CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 3, METHOD_IN_DIRECT, FILE_ANY_ACCESS) + + +#define MAX_SERVICE_LENGTH 40 + +typedef struct _DOT4_DC_CREATE_DATA { + unsigned char bPsid; + CHAR pServiceName[MAX_SERVICE_LENGTH + 1]; + unsigned char bType; + ULONG ulBufferSize; + USHORT usMaxHtoPPacketSize; + USHORT usMaxPtoHPacketSize; + unsigned char bHsid; +} DOT4_DC_CREATE_DATA, *PDOT4_DC_CREATE_DATA; + +typedef struct _DOT4_DC_DESTROY_DATA { + unsigned char bHsid; +} DOT4_DC_DESTROY_DATA, *PDOT4_DC_DESTROY_DATA; + +typedef struct _DOT4_DC_OPEN_DATA { + unsigned char bHsid; + unsigned char fAddActivity; + CHANNEL_HANDLE hChannelHandle; +} DOT4_DC_OPEN_DATA, *PDOT4_DC_OPEN_DATA; + +typedef struct _DOT4_DRIVER_CMD { + CHANNEL_HANDLE hChannelHandle; + ULONG ulSize; + ULONG ulOffset; + ULONG ulTimeout; +} DOT4_DRIVER_CMD, *PDOT4_DRIVER_CMD; + +#ifdef __cplusplus +} +#endif + +#endif /* __D4DRVIF_H */ diff --git a/reactos/include/ddk/d4iface.h b/reactos/include/ddk/d4iface.h new file mode 100644 index 00000000000..f04cf1954ba --- /dev/null +++ b/reactos/include/ddk/d4iface.h @@ -0,0 +1,82 @@ +/* + * d4iface.h + * + * DOT4 interface + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __D4IFACE_H +#define __D4IFACE_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define DOT4_MAX_CHANNELS 128 +#define NO_TIMEOUT 0 + +#define DOT4_CHANNEL 0 +#define HP_MESSAGE_PROCESSOR 1 +#define PRINTER_CHANNEL 2 +#define SCANNER_CHANNEL 4 +#define MIO_COMMAND_PROCESSOR 5 +#define ECHO_CHANNEL 6 +#define FAX_SEND_CHANNEL 7 +#define FAX_RECV_CHANNEL 8 +#define DIAGNOSTIC_CHANNEL 9 +#define HP_RESERVED 10 +#define IMAGE_DOWNLOAD 11 +#define HOST_DATASTORE_UPLOAD 12 +#define HOST_DATASTORE_DOWNLOAD 13 +#define CONFIG_UPLOAD 14 +#define CONFIG_DOWNLOAD 15 + +#define STREAM_TYPE_CHANNEL 1 +#define PACKET_TYPE_CHANNEL 2 + +/* DOT4_ACTIVITY.ulMessage flags */ +#define DOT4_STREAM_RECEIVED 0x100 +#define DOT4_STREAM_CREDITS 0x101 +#define DOT4_MESSAGE_RECEIVED 0x102 +#define DOT4_DISCONNECT 0x103 +#define DOT4_CHANNEL_CLOSED 0x105 + +typedef unsigned long CHANNEL_HANDLE, *PCHANNEL_HANDLE; + +typedef struct _DOT4_ACTIVITY { + ULONG ulMessage; + ULONG ulByteCount; + CHANNEL_HANDLE hChannel; +} DOT4_ACTIVITY, *PDOT4_ACTIVITY; + +typedef struct _DOT4_WMI_XFER_INFO { + ULONG ulStreamBytesWritten; + ULONG ulStreamBytesRead; + ULONG ulPacketBytesWritten; + ULONG ulPacketBytesRead; +} DOT4_WMI_XFER_INFO, *PDOT4_WMI_XFER_INFO; + +#ifdef __cplusplus +} +#endif + +#endif /* __D4IFACE_H */ diff --git a/reactos/include/ddk/dciddi.h b/reactos/include/ddk/dciddi.h new file mode 100644 index 00000000000..c5708e26880 --- /dev/null +++ b/reactos/include/ddk/dciddi.h @@ -0,0 +1,59 @@ +/* + * DCI driver interface + * + * Copyright (C) 2001 Ove Kaaven + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __WINE_DCIDDI_H +#define __WINE_DCIDDI_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* DCI Command Escape */ +#define DCICOMMAND 3075 +#define DCI_VERSION 0x0100 + +#define DCICREATEPRIMARYSURFACE 1 +#define DCICREATEOFFSCREENSURFACE 2 +#define DCICREATEOVERLAYSURFACE 3 +#define DCIENUMSURFACE 4 +#define DCIESCAPE 5 + +/* DCI Errors */ +#define DCI_OK 0 + + +typedef int DCIRVAL; /* DCI callback return type */ + +/***************************************************************************** + * Escape command structures + */ +typedef struct _DCICMD { + DWORD dwCommand; + DWORD dwParam1; + DWORD dwParam2; + DWORD dwVersion; + DWORD dwReserved; +} DCICMD,*LPDCICMD; + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __WINE_DCIDDI_H */ diff --git a/reactos/include/ddk/ddkernel.h b/reactos/include/ddk/ddkernel.h new file mode 100644 index 00000000000..9133b907931 --- /dev/null +++ b/reactos/include/ddk/ddkernel.h @@ -0,0 +1,97 @@ +/* $Id$ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: + * PURPOSE: Directx headers + * PROGRAMMER: Magnus Olsen (greatlrd) + * + */ + +#ifndef __DDKM_INCLUDED__ +#define __DDKM_INCLUDED__ + +#if defined (_WIN32) && !defined (_NO_COM) +DEFINE_GUID (IID_IDirectDrawKernel, 0x8D56C120,0x6A08,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); +DEFINE_GUID (IID_IDirectDrawSurfaceKernel, 0x60755DA0,0x6A40,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); +#endif + +typedef struct _DDKERNELCAPS +{ + DWORD dwSize; + DWORD dwCaps; + DWORD dwIRQCaps; +} DDKERNELCAPS, *LPDDKERNELCAPS; + +#define DDKERNELCAPS_SKIPFIELDS 0x00000001 +#define DDKERNELCAPS_AUTOFLIP 0x00000002 +#define DDKERNELCAPS_SETSTATE 0x00000004 +#define DDKERNELCAPS_LOCK 0x00000008 +#define DDKERNELCAPS_FLIPVIDEOPORT 0x00000010 +#define DDKERNELCAPS_FLIPOVERLAY 0x00000020 +#define DDKERNELCAPS_CAPTURE_SYSMEM 0x00000040 +#define DDKERNELCAPS_CAPTURE_NONLOCALVIDMEM 0x00000080 +#define DDKERNELCAPS_FIELDPOLARITY 0x00000100 +#define DDKERNELCAPS_CAPTURE_INVERTED 0x00000200 +#define DDIRQ_DISPLAY_VSYNC 0x00000001 +#define DDIRQ_RESERVED1 0x00000002 +#define DDIRQ_VPORT0_VSYNC 0x00000004 +#define DDIRQ_VPORT0_LINE 0x00000008 +#define DDIRQ_VPORT1_VSYNC 0x00000010 +#define DDIRQ_VPORT1_LINE 0x00000020 +#define DDIRQ_VPORT2_VSYNC 0x00000040 +#define DDIRQ_VPORT2_LINE 0x00000080 +#define DDIRQ_VPORT3_VSYNC 0x00000100 +#define DDIRQ_VPORT3_LINE 0x00000200 +#define DDIRQ_VPORT4_VSYNC 0x00000400 +#define DDIRQ_VPORT4_LINE 0x00000800 +#define DDIRQ_VPORT5_VSYNC 0x00001000 +#define DDIRQ_VPORT5_LINE 0x00002000 +#define DDIRQ_VPORT6_VSYNC 0x00004000 +#define DDIRQ_VPORT6_LINE 0x00008000 +#define DDIRQ_VPORT7_VSYNC 0x00010000 +#define DDIRQ_VPORT7_LINE 0x00020000 +#define DDIRQ_VPORT8_VSYNC 0x00040000 +#define DDIRQ_VPORT8_LINE 0x00080000 +#define DDIRQ_VPORT9_VSYNC 0x00010000 +#define DDIRQ_VPORT9_LINE 0x00020000 + +typedef struct IDirectDrawKernel* LPDIRECTDRAWKERNEL; +typedef struct IDirectDrawSurfaceKernel* LPDIRECTDRAWSURFACEKERNEL; + +#if defined(_WIN32) && !defined(_NO_COM) + +#undef INTERFACE +#define INTERFACE IDirectDrawKernel +DECLARE_INTERFACE_ (IDirectDrawKernel, IUnknown) +{ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD(GetKernelHandle) (THIS_ ULONG*) PURE; + STDMETHOD(ReleaseKernelHandle) (THIS) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirectDrawSurfaceKernel +DECLARE_INTERFACE_ (IDirectDrawSurfaceKernel, IUnknown) +{ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD(GetKernelHandle) (THIS_ ULONG*) PURE; + STDMETHOD(ReleaseKernelHandle) (THIS) PURE; +}; + +#undef INTERFACE +#endif // defined(_WIN32) && !defined(_NO_COM) + +#ifdef __cplusplus +}; +#endif + +#endif + + + + diff --git a/reactos/include/ddk/ddkmapi.h b/reactos/include/ddk/ddkmapi.h new file mode 100644 index 00000000000..b0a177f2989 --- /dev/null +++ b/reactos/include/ddk/ddkmapi.h @@ -0,0 +1,332 @@ +/* + * ddkmapi.h + * + * DirectDraw support for DxApi function + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __DDKMAPI_H +#define __DDKMAPI_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(_DXAPI_) + #define DXAPI DECLSPEC_EXPORT +#else + #define DXAPI DECLSPEC_IMPORT +#endif + +DXAPI +DWORD +FAR PASCAL +DxApi( + IN DWORD dwFunctionNum, + IN LPVOID lpvInBuffer, + IN DWORD cbInBuffer, + OUT LPVOID lpvOutBuffer, + OUT DWORD cbOutBuffer); + +typedef DWORD (FAR PASCAL *LPDXAPI)( + DWORD dwFunctionNum, + LPVOID lpvInBuffer, + DWORD cbInBuffer, + LPVOID lpvOutBuffer, + DWORD cbOutBuffer); + + +#define DXAPI_MAJORVERSION 1 +#define DXAPI_MINORVERSION 0 + +#define DD_FIRST_DXAPI 0x500 + +#define DD_DXAPI_GETVERSIONNUMBER (DD_FIRST_DXAPI) +#define DD_DXAPI_CLOSEHANDLE (DD_FIRST_DXAPI+1) +#define DD_DXAPI_OPENDIRECTDRAW (DD_FIRST_DXAPI+2) +#define DD_DXAPI_OPENSURFACE (DD_FIRST_DXAPI+3) +#define DD_DXAPI_OPENVIDEOPORT (DD_FIRST_DXAPI+4) +#define DD_DXAPI_GETKERNELCAPS (DD_FIRST_DXAPI+5) +#define DD_DXAPI_GET_VP_FIELD_NUMBER (DD_FIRST_DXAPI+6) +#define DD_DXAPI_SET_VP_FIELD_NUMBER (DD_FIRST_DXAPI+7) +#define DD_DXAPI_SET_VP_SKIP_FIELD (DD_FIRST_DXAPI+8) +#define DD_DXAPI_GET_SURFACE_STATE (DD_FIRST_DXAPI+9) +#define DD_DXAPI_SET_SURFACE_STATE (DD_FIRST_DXAPI+10) +#define DD_DXAPI_LOCK (DD_FIRST_DXAPI+11) +#define DD_DXAPI_FLIP_OVERLAY (DD_FIRST_DXAPI+12) +#define DD_DXAPI_FLIP_VP (DD_FIRST_DXAPI+13) +#define DD_DXAPI_GET_CURRENT_VP_AUTOFLIP_SURFACE (DD_FIRST_DXAPI+14) +#define DD_DXAPI_GET_LAST_VP_AUTOFLIP_SURFACE (DD_FIRST_DXAPI+15) +#define DD_DXAPI_REGISTER_CALLBACK (DD_FIRST_DXAPI+16) +#define DD_DXAPI_UNREGISTER_CALLBACK (DD_FIRST_DXAPI+17) +#define DD_DXAPI_GET_POLARITY (DD_FIRST_DXAPI+18) +#define DD_DXAPI_OPENVPCAPTUREDEVICE (DD_FIRST_DXAPI+19) +#define DD_DXAPI_ADDVPCAPTUREBUFFER (DD_FIRST_DXAPI+20) +#define DD_DXAPI_FLUSHVPCAPTUREBUFFERS (DD_FIRST_DXAPI+21) + + +typedef struct _DDCAPBUFFINFO { + DWORD dwFieldNumber; + DWORD bPolarity; + LARGE_INTEGER liTimeStamp; + DWORD ddRVal; +} DDCAPBUFFINFO, FAR * LPDDCAPBUFFINFO; + +/* DDADDVPCAPTUREBUFF.dwFlags constants */ +#define DDADDBUFF_SYSTEMMEMORY 0x0001 +#define DDADDBUFF_NONLOCALVIDMEM 0x0002 +#define DDADDBUFF_INVERT 0x0004 + +typedef struct _DDADDVPCAPTUREBUFF { + HANDLE hCapture; + DWORD dwFlags; + PMDL pMDL; + PKEVENT pKEvent; + LPDDCAPBUFFINFO lpBuffInfo; +} DDADDVPCAPTUREBUFF, FAR * LPDDADDVPCAPTUREBUFF; + +typedef struct _DDCLOSEHANDLE { + HANDLE hHandle; +} DDCLOSEHANDLE, FAR *LPDDCLOSEHANDLE; + +typedef struct _DDFLIPOVERLAY { + HANDLE hDirectDraw; + HANDLE hCurrentSurface; + HANDLE hTargetSurface; + DWORD dwFlags; +} DDFLIPOVERLAY, FAR *LPDDFLIPOVERLAY; + +typedef struct _DDFLIPVIDEOPORT { + HANDLE hDirectDraw; + HANDLE hVideoPort; + HANDLE hCurrentSurface; + HANDLE hTargetSurface; + DWORD dwFlags; +} DDFLIPVIDEOPORT, FAR *LPDDFLIPVIDEOPORT; + +typedef struct _DDGETAUTOFLIPIN { + HANDLE hDirectDraw; + HANDLE hVideoPort; +} DDGETAUTOFLIPIN, FAR *LPDDGETAUTOFLIPIN; + +typedef struct _DDGETAUTOFLIPOUT { + DWORD ddRVal; + HANDLE hVideoSurface; + HANDLE hVBISurface; + BOOL bPolarity; +} DDGETAUTOFLIPOUT, FAR *LPDDGETAUTOFLIPOUT; + +typedef struct _DDGETPOLARITYIN { + HANDLE hDirectDraw; + HANDLE hVideoPort; +} DDGETPOLARITYIN, FAR *LPDDGETPOLARITYIN; + +typedef struct _DDGETPOLARITYOUT { + DWORD ddRVal; + BOOL bPolarity; +} DDGETPOLARITYOUT, FAR *LPDDGETPOLARITYOUT; + +typedef struct _DDGETSURFACESTATEIN { + HANDLE hDirectDraw; + HANDLE hSurface; +} DDGETSURFACESTATEIN, FAR *LPDDGETSURFACESTATEIN; + +/* DDGETSURFACESTATEOUT.dwStateCaps/dwStateStatus constants */ +#define DDSTATE_BOB 0x0001 +#define DDSTATE_WEAVE 0x0002 +#define DDSTATE_EXPLICITLY_SET 0x0004 +#define DDSTATE_SOFTWARE_AUTOFLIP 0x0008 +#define DDSTATE_SKIPEVENFIELDS 0x0010 + +typedef struct _DDGETSURFACESTATEOUT { + DWORD ddRVal; + DWORD dwStateCaps; + DWORD dwStateStatus; +} DDGETSURFACESTATEOUT, FAR *LPDDGETSURFACESTATEOUT; + +typedef struct _DDGETFIELDNUMIN { + HANDLE hDirectDraw; + HANDLE hVideoPort; +} DDGETFIELDNUMIN, FAR *LPDDGETFIELDNUMIN; + +typedef struct _DDGETFIELDNUMOUT { + DWORD ddRVal; + DWORD dwFieldNum; +} DDGETFIELDNUMOUT, FAR *LPDDGETFIELDNUMOUT; + +typedef struct _DDGETKERNELCAPSOUT { + DWORD ddRVal; + DWORD dwCaps; + DWORD dwIRQCaps; +} DDGETKERNELCAPSOUT, FAR *LPDDGETKERNELCAPSOUT; + +typedef struct _DDGETVERSIONNUMBER { + DWORD ddRVal; + DWORD dwMajorVersion; + DWORD dwMinorVersion; +} DDGETVERSIONNUMBER, FAR *LPDDGETVERSIONNUMBER; + +typedef struct _DDLOCKIN { + HANDLE hDirectDraw; + HANDLE hSurface; +} DDLOCKIN, FAR *LPDDLOCKIN; + +typedef struct _DDLOCKOUT { + DWORD ddRVal; + DWORD dwSurfHeight; + DWORD dwSurfWidth; + LONG lSurfPitch; + PVOID lpSurface; + DWORD SurfaceCaps; + DWORD dwFormatFlags; + DWORD dwFormatFourCC; + DWORD dwFormatBitCount; + _ANONYMOUS_UNION union { + DWORD dwRBitMask; + DWORD dwYBitMask; + } DUMMYUNIONNAME; + _ANONYMOUS_UNION union { + DWORD dwGBitMask; + DWORD dwUBitMask; + } DUMMYUNIONNAME2; + _ANONYMOUS_UNION union { + DWORD dwBBitMask; + DWORD dwVBitMask; + } DUMMYUNIONNAME3; +} DDLOCKOUT, FAR *LPDDLOCKOUT; + +/* LPDD_NOTIFYCALLBACK.dwFlags constants */ +#define DDNOTIFY_DISPLAY_VSYNC 0x0001 +#define DDNOTIFY_VP_VSYNC 0x0002 +#define DDNOTIFY_VP_LINE 0x0004 +#define DDNOTIFY_PRERESCHANGE 0x0008 +#define DDNOTIFY_POSTRESCHANGE 0x0010 +#define DDNOTIFY_PREDOSBOX 0x0020 +#define DDNOTIFY_POSTDOSBOX 0x0040 +#define DDNOTIFY_CLOSEDIRECTDRAW 0x0080 +#define DDNOTIFY_CLOSESURFACE 0x0100 +#define DDNOTIFY_CLOSEVIDEOPORT 0x0200 +#define DDNOTIFY_CLOSECAPTURE 0x0400 + +typedef ULONG (FAR PASCAL *LPDD_NOTIFYCALLBACK)( + DWORD dwFlags, + PVOID pContext, + DWORD dwParam1, + DWORD dwParam2); + +typedef struct _DDOPENDIRECTDRAWIN { + ULONG_PTR dwDirectDrawHandle; + LPDD_NOTIFYCALLBACK pfnDirectDrawClose; + PVOID pContext; +} DDOPENDIRECTDRAWIN, FAR *LPDDOPENDIRECTDRAWIN; + +typedef struct _DDOPENDIRECTDRAWOUT { + DWORD ddRVal; + HANDLE hDirectDraw; +} DDOPENDIRECTDRAWOUT, FAR *LPDDOPENDIRECTDRAWOUT; + +typedef struct _DDOPENSURFACEIN { + HANDLE hDirectDraw; + ULONG_PTR dwSurfaceHandle; + LPDD_NOTIFYCALLBACK pfnSurfaceClose; + PVOID pContext; +} DDOPENSURFACEIN, FAR *LPDDOPENSURFACEIN; + +typedef struct _DDOPENSURFACEOUT { + DWORD ddRVal; + HANDLE hSurface; +} DDOPENSURFACEOUT, FAR *LPDDOPENSURFACEOUT; + +typedef struct _DDOPENVIDEOPORTIN { + HANDLE hDirectDraw; + ULONG dwVideoPortHandle; + LPDD_NOTIFYCALLBACK pfnVideoPortClose; + PVOID pContext; +} DDOPENVIDEOPORTIN, FAR *LPDDOPENVIDEOPORTIN; + +typedef struct _DDOPENVIDEOPORTOUT { + DWORD ddRVal; + HANDLE hVideoPort; +} DDOPENVIDEOPORTOUT, FAR *LPDDOPENVIDEOPORTOUT; + +/* DDOPENVPCAPTUREDEVICEIN.dwFlags constants */ +#define DDOPENCAPTURE_VIDEO 0x0001 +#define DDOPENCAPTURE_VBI 0x0002 + +typedef struct _DDOPENVPCAPTUREDEVICEIN { + HANDLE hDirectDraw; + HANDLE hVideoPort; + DWORD dwStartLine; + DWORD dwEndLine; + DWORD dwCaptureEveryNFields; + LPDD_NOTIFYCALLBACK pfnCaptureClose; + PVOID pContext; + DWORD dwFlags; +} DDOPENVPCAPTUREDEVICEIN, FAR * LPDDOPENVPCAPTUREDEVICEIN; + +typedef struct _DDOPENVPCAPTUREDEVICEOUT { + DWORD ddRVal; + HANDLE hCapture; +} DDOPENVPCAPTUREDEVICEOUT, FAR * LPDDOPENVPCAPTUREDEVICEOUT; + +/* DDREGISTERCALLBACK.dwEvents constants */ +#define DDEVENT_DISPLAY_VSYNC 0x0001 +#define DDEVENT_VP_VSYNC 0x0002 +#define DDEVENT_VP_LINE 0x0004 +#define DDEVENT_PRERESCHANGE 0x0008 +#define DDEVENT_POSTRESCHANGE 0x0010 +#define DDEVENT_PREDOSBOX 0x0020 +#define DDEVENT_POSTDOSBOX 0x0040 + +typedef struct _DDREGISTERCALLBACK { + HANDLE hDirectDraw; + ULONG dwEvents; + LPDD_NOTIFYCALLBACK pfnCallback; + ULONG_PTR dwParam1; + ULONG_PTR dwParam2; + PVOID pContext; +} DDREGISTERCALLBACK, FAR *LPDDREGISTERCALLBACK; + +typedef struct _DDSETSURFACETATE { + HANDLE hDirectDraw; + HANDLE hSurface; + DWORD dwState; + DWORD dwStartField; +} DDSETSURFACESTATE, FAR *LPDDSETSURFACESTATE; + +typedef struct _DDSETFIELDNUM { + HANDLE hDirectDraw; + HANDLE hVideoPort; + DWORD dwFieldNum; +} DDSETFIELDNUM, FAR *LPDDSETFIELDNUM; + +typedef struct _DDSETSKIPFIELD { + HANDLE hDirectDraw; + HANDLE hVideoPort; + DWORD dwStartField; +} DDSETSKIPFIELD, FAR *LPDDSETSKIPFIELD; + +#ifdef __cplusplus +} +#endif + +#endif /* __DDKMAPI_H */ diff --git a/reactos/include/ddk/ddrawi.h b/reactos/include/ddk/ddrawi.h new file mode 100644 index 00000000000..0e4384251d1 --- /dev/null +++ b/reactos/include/ddk/ddrawi.h @@ -0,0 +1,2187 @@ +/* + * DirectDraw driver interface + * (DirectX 7 version) + * + * Copyright (C) 2001 Ove Kaaven + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __DDRAWI_INCLUDED__ +#define __DDRAWI_INCLUDED__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define OBJECT_ISROOT 0x80000000 + +#include +#include +#include +#include + +#define DDAPI WINAPI + +#define VALID_ALIGNMENT(align) \ + (!((align==0)||(align%2)!= 0 )) + +/* the DirectDraw versions */ +#define DD_VERSION 0x0200 /* compatibility version */ +#define DD_RUNTIME_VERSION 0x0902 /* actual version */ + +/* the HAL version returned from QUERYESCSUPPORT - DCICOMMAND */ +#define DD_HAL_VERSION 0x0100 + +/* more DCICOMMAND escapes */ +#ifndef DCICOMMAND +#define DCICOMMAND 3075 +#endif + +#define DDCREATEDRIVEROBJECT 10 +#define DDGET32BITDRIVERNAME 11 +#define DDNEWCALLBACKFNS 12 +#define DDVERSIONINFO 13 + + + +#define DDUNSUPPORTEDMODE ((DWORD) -1) + +#include "dciddi.h" + +#ifndef CCHDEVICENAME +#define CCHDEVICENAME 32 +#endif +#define MAX_DRIVER_NAME CCHDEVICENAME + +#define DDHAL_DRIVER_DLLNAME "DDRAW16.DLL" +#define DDHAL_APP_DLLNAME "DDRAW.DLL" + + + +/* GUID */ +#ifdef _WIN32 +DEFINE_GUID(GUID_MiscellaneousCallbacks, 0xefd60cc0, 0x49e7, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a); +DEFINE_GUID(GUID_VideoPortCallbacks, 0xefd60cc1, 0x49e7, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a); +DEFINE_GUID(GUID_ColorControlCallbacks, 0xefd60cc2, 0x49e7, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a); +DEFINE_GUID(GUID_VideoPortCaps, 0xefd60cc3, 0x49e7, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a); +DEFINE_GUID(GUID_D3DCallbacks2, 0x0ba584e1, 0x70b6, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a); +DEFINE_GUID(GUID_D3DCallbacks3, 0xddf41230, 0xec0a, 0x11d0, 0xa9, 0xb6, 0x00, 0xaa, 0x00, 0xc0, 0x99, 0x3e); +DEFINE_GUID(GUID_NonLocalVidMemCaps, 0x86c4fa80, 0x8d84, 0x11d0, 0x94, 0xe8, 0x00, 0xc0, 0x4f, 0xc3, 0x41, 0x37); +DEFINE_GUID(GUID_KernelCallbacks, 0x80863800, 0x6B06, 0x11D0, 0x9B, 0x06, 0x0, 0xA0, 0xC9, 0x03, 0xA3, 0xB8); +DEFINE_GUID(GUID_KernelCaps, 0xFFAA7540, 0x7AA8, 0x11D0, 0x9B, 0x06, 0x00, 0xA0, 0xC9, 0x03, 0xA3, 0xB8); +DEFINE_GUID(GUID_D3DExtendedCaps, 0x7de41f80, 0x9d93, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29); +DEFINE_GUID(GUID_ZPixelFormats, 0x93869880, 0x36cf, 0x11d1, 0x9b, 0x1b, 0x0, 0xaa, 0x0, 0xbb, 0xb8, 0xae); +DEFINE_GUID(GUID_DDMoreSurfaceCaps, 0x3b8a0466, 0xf269, 0x11d1, 0x88, 0x0b, 0x0, 0xc0, 0x4f, 0xd9, 0x30, 0xc5); +DEFINE_GUID(GUID_DDStereoMode, 0xf828169c, 0xa8e8, 0x11d2, 0xa1, 0xf2, 0x0, 0xa0, 0xc9, 0x83, 0xea, 0xf6); +DEFINE_GUID(GUID_OptSurfaceKmodeInfo, 0xe05c8472, 0x51d4, 0x11d1, 0x8c, 0xce, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8); +DEFINE_GUID(GUID_OptSurfaceUmodeInfo, 0x9d792804, 0x5fa8, 0x11d1, 0x8c, 0xd0, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8); +DEFINE_GUID(GUID_UserModeDriverInfo, 0xf0b0e8e2, 0x5f97, 0x11d1, 0x8c, 0xd0, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8); +DEFINE_GUID(GUID_UserModeDriverPassword, 0x97f861b6, 0x60a1, 0x11d1, 0x8c, 0xd0, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8); +DEFINE_GUID(GUID_D3DParseUnknownCommandCallback, 0x2e04ffa0, 0x98e4, 0x11d1, 0x8c, 0xe1, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8); +DEFINE_GUID(GUID_MotionCompCallbacks, 0xb1122b40, 0x5dA5, 0x11d1, 0x8f, 0xcF, 0x00, 0xc0, 0x4f, 0xc2, 0x9b, 0x4e); +DEFINE_GUID(GUID_Miscellaneous2Callbacks, 0x406B2F00, 0x3E5A, 0x11D1, 0xB6, 0x40, 0x00, 0xAA, 0x00, 0xA1, 0xF9, 0x6A); +#endif + +#ifndef _WIN32 +#undef E_NOTIMPL +#undef E_OUTOFMEMORY +#undef E_INVALIDARG +#undef E_FAIL +#define E_NOTIMPL 0x80004001L +#define E_OUTOFMEMORY 0x8007000EL +#define E_INVALIDARG 0x80070057L +#define E_FAIL 0x80004005L +#endif + + +/***************************************************************************** + * Initialization stuff + */ +typedef struct { + char szName[260]; + char szEntryPoint[64]; + DWORD dwContext; +} DD32BITDRIVERDATA,*LPDD32BITDRIVERDATA; + +typedef struct { + DWORD dwHALVersion; + ULONG_PTR dwReserved1; + ULONG_PTR dwReserved2; +} DDVERSIONDATA,*LPDDVERSIONDATA; + +typedef DWORD (PASCAL *LPDD32BITDRIVERINIT)(DWORD dwContext); + + + +/* predeclare some structures */ +typedef struct _DDHALINFO *LPDDHALINFO; +typedef struct _DDRAWI_DIRECTDRAW_INT *LPDDRAWI_DIRECTDRAW_INT; +typedef struct _DDRAWI_DIRECTDRAW_LCL *LPDDRAWI_DIRECTDRAW_LCL; +typedef struct _DDRAWI_DIRECTDRAW_GBL *LPDDRAWI_DIRECTDRAW_GBL; +typedef struct _DDRAWI_DDRAWSURFACE_INT *LPDDRAWI_DDRAWSURFACE_INT; +typedef struct _DDRAWI_DDRAWSURFACE_LCL *LPDDRAWI_DDRAWSURFACE_LCL; +typedef struct _DDRAWI_DDRAWSURFACE_GBL *LPDDRAWI_DDRAWSURFACE_GBL; +typedef struct _DDRAWI_DDRAWSURFACE_MORE *LPDDRAWI_DDRAWSURFACE_MORE; +typedef struct _DDRAWI_DDRAWSURFACE_GBL_MORE *LPDDRAWI_DDRAWSURFACE_GBL_MORE; +typedef struct _DDRAWI_DDRAWPALETTE_INT *LPDDRAWI_DDRAWPALETTE_INT; +typedef struct _DDRAWI_DDRAWPALETTE_LCL *LPDDRAWI_DDRAWPALETTE_LCL; +typedef struct _DDRAWI_DDRAWPALETTE_GBL *LPDDRAWI_DDRAWPALETTE_GBL; +typedef struct _DDRAWI_DDRAWCLIPPER_INT *LPDDRAWI_DDRAWCLIPPER_INT; +typedef struct _DDRAWI_DDRAWCLIPPER_LCL *LPDDRAWI_DDRAWCLIPPER_LCL; +typedef struct _DDRAWI_DDRAWCLIPPER_GBL *LPDDRAWI_DDRAWCLIPPER_GBL; +typedef struct _DDRAWI_DDVIDEOPORT_INT *LPDDRAWI_DDVIDEOPORT_INT; +typedef struct _DDRAWI_DDVIDEOPORT_LCL *LPDDRAWI_DDVIDEOPORT_LCL; +typedef struct _DDRAWI_DDMOTIONCOMP_INT *LPDDRAWI_DDMOTIONCOMP_INT; +typedef struct _DDRAWI_DDMOTIONCOMP_LCL *LPDDRAWI_DDMOTIONCOMP_LCL; + +/***************************************************************************** + * driver->ddraw callbacks + */ +typedef BOOL (DDAPI *LPDDHAL_SETINFO)(LPDDHALINFO lpDDHalInfo, BOOL reset); +typedef FLATPTR (DDAPI *LPDDHAL_VIDMEMALLOC)(LPDDRAWI_DIRECTDRAW_GBL lpDD, int heap, DWORD dwWidth, DWORD dwHeight); +typedef void (DDAPI *LPDDHAL_VIDMEMFREE)(LPDDRAWI_DIRECTDRAW_GBL lpDD, int heap, FLATPTR fpMem); + +typedef struct { + DWORD dwSize; + LPDDHAL_SETINFO lpSetInfo; + LPDDHAL_VIDMEMALLOC lpVidMemAlloc; + LPDDHAL_VIDMEMFREE lpVidMemFree; +} DDHALDDRAWFNS,*LPDDHALDDRAWFNS; + +/***************************************************************************** + * mode info structure + */ +typedef struct _DDHALMODEINFO { + DWORD dwWidth; + DWORD dwHeight; + LONG lPitch; + DWORD dwBPP; + WORD wFlags; + WORD wRefreshRate; + DWORD dwRBitMask; + DWORD dwGBitMask; + DWORD dwBBitMask; + DWORD dwAlphaBitMask; +} DDHALMODEINFO,*LPDDHALMODEINFO; + + + + +#define DDMODEINFO_PALETTIZED 0x0001 +#define DDMODEINFO_MODEX 0x0002 +#define DDMODEINFO_UNSUPPORTED 0x0004 +#define DDMODEINFO_STANDARDVGA 0x0008 +#define DDMODEINFO_MAXREFRESH 0x0010 +#define DDMODEINFO_STEREO 0x0020 + +/***************************************************************************** + * video memory info structure + */ +typedef struct _VIDMEM { + DWORD dwFlags; + FLATPTR fpStart; + union { + FLATPTR fpEnd; + DWORD dwWidth; + }; + DDSCAPS ddsCaps; + DDSCAPS ddsCapsAlt; + union { + LPVMEMHEAP lpHeap; + DWORD dwHeight; + }; +} VIDMEM; + + + + +#define VIDMEM_ISLINEAR 0x00000001 +#define VIDMEM_ISRECTANGULAR 0x00000002 +#define VIDMEM_ISHEAP 0x00000004 +#define VIDMEM_ISNONLOCAL 0x00000008 +#define VIDMEM_ISWC 0x00000010 +#define VIDMEM_ISDISABLED 0x00000020 + + +typedef struct _VIDMEMINFO { + FLATPTR fpPrimary; + DWORD dwFlags; + DWORD dwDisplayWidth; + DWORD dwDisplayHeight; + LONG lDisplayPitch; + DDPIXELFORMAT ddpfDisplay; + DWORD dwOffscreenAlign; + DWORD dwOverlayAlign; + DWORD dwTextureAlign; + DWORD dwZBufferAlign; + DWORD dwAlphaAlign; + DWORD dwNumHeaps; + LPVIDMEM pvmList; +} VIDMEMINFO,*LPVIDMEMINFO; + + + +typedef struct _HEAPALIAS { + FLATPTR fpVidMem; + LPVOID lpAlias; + DWORD dwAliasSize; +} HEAPALIAS,*LPHEAPALIAS; + +typedef struct _HEAPALIASINFO { + DWORD dwRefCnt; + DWORD dwFlags; + DWORD dwNumHeaps; + LPHEAPALIAS lpAliases; +} HEAPALIASINFO,*LPHEAPALIASINFO; + +#define HEAPALIASINFO_MAPPEDREAL 0x00000001 +#define HEAPALIASINFO_MAPPEDDUMMY 0x00000002 + +/***************************************************************************** + * capabilities structures + */ +typedef struct _DDCORECAPS { + DWORD dwSize; + DWORD dwCaps; + DWORD dwCaps2; + DWORD dwCKeyCaps; + DWORD dwFXCaps; + DWORD dwFXAlphaCaps; + DWORD dwPalCaps; + DWORD dwSVCaps; + DWORD dwAlphaBltConstBitDepths; + DWORD dwAlphaBltPixelBitDepths; + DWORD dwAlphaBltSurfaceBitDepths; + DWORD dwAlphaOverlayConstBitDepths; + DWORD dwAlphaOverlayPixelBitDepths; + DWORD dwAlphaOverlaySurfaceBitDepths; + DWORD dwZBufferBitDepths; + DWORD dwVidMemTotal; + DWORD dwVidMemFree; + DWORD dwMaxVisibleOverlays; + DWORD dwCurrVisibleOverlays; + DWORD dwNumFourCCCodes; + DWORD dwAlignBoundarySrc; + DWORD dwAlignSizeSrc; + DWORD dwAlignBoundaryDest; + DWORD dwAlignSizeDest; + DWORD dwAlignStrideAlign; + DWORD dwRops[DD_ROP_SPACE]; + DDSCAPS ddsCaps; + DWORD dwMinOverlayStretch; + DWORD dwMaxOverlayStretch; + DWORD dwMinLiveVideoStretch; + DWORD dwMaxLiveVideoStretch; + DWORD dwMinHwCodecStretch; + DWORD dwMaxHwCodecStretch; + DWORD dwReserved1; + DWORD dwReserved2; + DWORD dwReserved3; + DWORD dwSVBCaps; + DWORD dwSVBCKeyCaps; + DWORD dwSVBFXCaps; + DWORD dwSVBRops[DD_ROP_SPACE]; + DWORD dwVSBCaps; + DWORD dwVSBCKeyCaps; + DWORD dwVSBFXCaps; + DWORD dwVSBRops[DD_ROP_SPACE]; + DWORD dwSSBCaps; + DWORD dwSSBCKeyCaps; + DWORD dwSSBFXCaps; + DWORD dwSSBRops[DD_ROP_SPACE]; + DWORD dwMaxVideoPorts; + DWORD dwCurrVideoPorts; + DWORD dwSVBCaps2; +} DDCORECAPS,*LPDDCORECAPS; + +typedef struct _DDNONLOCALVIDMEMCAPS { + DWORD dwSize; + DWORD dwNLVBCaps; + DWORD dwNLVBCaps2; + DWORD dwNLVBCKeyCaps; + DWORD dwNLVBFXCaps; + DWORD dwNLVBRops[DD_ROP_SPACE]; +} DDNONLOCALVIDMEMCAPS,*LPDDNONLOCALVIDMEMCAPS; + + + +#define DDSCAPS_EXECUTEBUFFER DDSCAPS_RESERVED2 +#define DDSCAPS2_VERTEXBUFFER DDSCAPS2_RESERVED1 +#define DDSCAPS2_COMMANDBUFFER DDSCAPS2_RESERVED2 + + + + +/***************************************************************************** + * ddraw->driver callbacks + */ +#define DDHAL_DRIVER_NOTHANDLED 0 +#define DDHAL_DRIVER_HANDLED 1 +#define DDHAL_DRIVER_NOCKEYHW 2 + +typedef struct _DDHAL_DESTROYDRIVERDATA *LPDDHAL_DESTROYDRIVERDATA; +typedef struct _DDHAL_CREATESURFACEDATA *LPDDHAL_CREATESURFACEDATA; +typedef struct _DDHAL_DRVSETCOLORKEYDATA *LPDDHAL_DRVSETCOLORKEYDATA; +typedef struct _DDHAL_SETMODEDATA *LPDDHAL_SETMODEDATA; +typedef struct _DDHAL_WAITFORVERTICALBLANKDATA *LPDDHAL_WAITFORVERTICALBLANKDATA; +typedef struct _DDHAL_CANCREATESURFACEDATA *LPDDHAL_CANCREATESURFACEDATA; +typedef struct _DDHAL_CREATEPALETTEDATA *LPDDHAL_CREATEPALETTEDATA; +typedef struct _DDHAL_GETSCANLINEDATA *LPDDHAL_GETSCANLINEDATA; +typedef struct _DDHAL_SETEXCLUSIVEMODEDATA *LPDDHAL_SETEXCLUSIVEMODEDATA; +typedef struct _DDHAL_FLIPTOGDISURFACEDATA *LPDDHAL_FLIPTOGDISURFACEDATA; + +typedef DWORD (PASCAL *LPDDHAL_DESTROYDRIVER) (LPDDHAL_DESTROYDRIVERDATA); +typedef DWORD (PASCAL *LPDDHAL_CREATESURFACE) (LPDDHAL_CREATESURFACEDATA); +typedef DWORD (PASCAL *LPDDHAL_SETCOLORKEY) (LPDDHAL_DRVSETCOLORKEYDATA); +typedef DWORD (PASCAL *LPDDHAL_SETMODE) (LPDDHAL_SETMODEDATA); +typedef DWORD (PASCAL *LPDDHAL_WAITFORVERTICALBLANK)(LPDDHAL_WAITFORVERTICALBLANKDATA); +typedef DWORD (PASCAL *LPDDHAL_CANCREATESURFACE) (LPDDHAL_CANCREATESURFACEDATA ); +typedef DWORD (PASCAL *LPDDHAL_CREATEPALETTE) (LPDDHAL_CREATEPALETTEDATA); +typedef DWORD (PASCAL *LPDDHAL_GETSCANLINE) (LPDDHAL_GETSCANLINEDATA); +typedef DWORD (PASCAL *LPDDHAL_SETEXCLUSIVEMODE) (LPDDHAL_SETEXCLUSIVEMODEDATA); +typedef DWORD (PASCAL *LPDDHAL_FLIPTOGDISURFACE) (LPDDHAL_FLIPTOGDISURFACEDATA); + + + +typedef struct _DDHAL_DDCALLBACKS { + DWORD dwSize; + DWORD dwFlags; + LPDDHAL_DESTROYDRIVER DestroyDriver; + LPDDHAL_CREATESURFACE CreateSurface; + LPDDHAL_SETCOLORKEY SetColorKey; + LPDDHAL_SETMODE SetMode; + LPDDHAL_WAITFORVERTICALBLANK WaitForVerticalBlank; + LPDDHAL_CANCREATESURFACE CanCreateSurface; + LPDDHAL_CREATEPALETTE CreatePalette; + LPDDHAL_GETSCANLINE GetScanLine; + /* DirectX 2 */ + LPDDHAL_SETEXCLUSIVEMODE SetExclusiveMode; + LPDDHAL_FLIPTOGDISURFACE FlipToGDISurface; +} DDHAL_DDCALLBACKS,*LPDDHAL_DDCALLBACKS; + + + +typedef struct _DDHAL_DESTROYSURFACEDATA *LPDDHAL_DESTROYSURFACEDATA; +typedef struct _DDHAL_FLIPDATA *LPDDHAL_FLIPDATA; +typedef struct _DDHAL_SETCLIPLISTDATA *LPDDHAL_SETCLIPLISTDATA; +typedef struct _DDHAL_LOCKDATA *LPDDHAL_LOCKDATA; +typedef struct _DDHAL_UNLOCKDATA *LPDDHAL_UNLOCKDATA; +typedef struct _DDHAL_BLTDATA *LPDDHAL_BLTDATA; +typedef struct _DDHAL_SETCOLORKEYDATA *LPDDHAL_SETCOLORKEYDATA; +typedef struct _DDHAL_ADDATTACHEDSURFACEDATA *LPDDHAL_ADDATTACHEDSURFACEDATA; +typedef struct _DDHAL_GETBLTSTATUSDATA *LPDDHAL_GETBLTSTATUSDATA; +typedef struct _DDHAL_GETFLIPSTATUSDATA *LPDDHAL_GETFLIPSTATUSDATA; +typedef struct _DDHAL_UPDATEOVERLAYDATA *LPDDHAL_UPDATEOVERLAYDATA; +typedef struct _DDHAL_SETOVERLAYPOSITIONDATA *LPDDHAL_SETOVERLAYPOSITIONDATA; +typedef struct _DDHAL_SETPALETTEDATA *LPDDHAL_SETPALETTEDATA; + +typedef DWORD (PASCAL *LPDDHALSURFCB_DESTROYSURFACE) (LPDDHAL_DESTROYSURFACEDATA); +typedef DWORD (PASCAL *LPDDHALSURFCB_FLIP) (LPDDHAL_FLIPDATA); +typedef DWORD (PASCAL *LPDDHALSURFCB_SETCLIPLIST) (LPDDHAL_SETCLIPLISTDATA); +typedef DWORD (PASCAL *LPDDHALSURFCB_LOCK) (LPDDHAL_LOCKDATA); +typedef DWORD (PASCAL *LPDDHALSURFCB_UNLOCK) (LPDDHAL_UNLOCKDATA); +typedef DWORD (PASCAL *LPDDHALSURFCB_BLT) (LPDDHAL_BLTDATA); +typedef DWORD (PASCAL *LPDDHALSURFCB_SETCOLORKEY) (LPDDHAL_SETCOLORKEYDATA); +typedef DWORD (PASCAL *LPDDHALSURFCB_ADDATTACHEDSURFACE)(LPDDHAL_ADDATTACHEDSURFACEDATA); +typedef DWORD (PASCAL *LPDDHALSURFCB_GETBLTSTATUS) (LPDDHAL_GETBLTSTATUSDATA); +typedef DWORD (PASCAL *LPDDHALSURFCB_GETFLIPSTATUS) (LPDDHAL_GETFLIPSTATUSDATA); +typedef DWORD (PASCAL *LPDDHALSURFCB_UPDATEOVERLAY) (LPDDHAL_UPDATEOVERLAYDATA); +typedef DWORD (PASCAL *LPDDHALSURFCB_SETOVERLAYPOSITION)(LPDDHAL_SETOVERLAYPOSITIONDATA); +typedef DWORD (PASCAL *LPDDHALSURFCB_SETPALETTE) (LPDDHAL_SETPALETTEDATA); + +typedef struct _DDHAL_DDSURFACECALLBACKS { + DWORD dwSize; + DWORD dwFlags; + LPDDHALSURFCB_DESTROYSURFACE DestroySurface; + LPDDHALSURFCB_FLIP Flip; + LPDDHALSURFCB_SETCLIPLIST SetClipList; + LPDDHALSURFCB_LOCK Lock; + LPDDHALSURFCB_UNLOCK Unlock; + LPDDHALSURFCB_BLT Blt; + LPDDHALSURFCB_SETCOLORKEY SetColorKey; + LPDDHALSURFCB_ADDATTACHEDSURFACE AddAttachedSurface; + LPDDHALSURFCB_GETBLTSTATUS GetBltStatus; + LPDDHALSURFCB_GETFLIPSTATUS GetFlipStatus; + LPDDHALSURFCB_UPDATEOVERLAY UpdateOverlay; + LPDDHALSURFCB_SETOVERLAYPOSITION SetOverlayPosition; + LPVOID reserved4; + LPDDHALSURFCB_SETPALETTE SetPalette; +} DDHAL_DDSURFACECALLBACKS,*LPDDHAL_DDSURFACECALLBACKS; + + + +typedef struct _DDHAL_DESTROYPALETTEDATA *LPDDHAL_DESTROYPALETTEDATA; +typedef struct _DDHAL_SETENTRIESDATA *LPDDHAL_SETENTRIESDATA; + +typedef DWORD (PASCAL *LPDDHALPALCB_DESTROYPALETTE)(LPDDHAL_DESTROYPALETTEDATA); +typedef DWORD (PASCAL *LPDDHALPALCB_SETENTRIES) (LPDDHAL_SETENTRIESDATA); + +typedef struct _DDHAL_DDPALETTECALLBACKS { + DWORD dwSize; + DWORD dwFlags; + LPDDHALPALCB_DESTROYPALETTE DestroyPalette; + LPDDHALPALCB_SETENTRIES SetEntries; +} DDHAL_DDPALETTECALLBACKS,*LPDDHAL_DDPALETTECALLBACKS; + +typedef DWORD (PASCAL *LPDDHALEXEBUFCB_CANCREATEEXEBUF)(LPDDHAL_CANCREATESURFACEDATA); +typedef DWORD (PASCAL *LPDDHALEXEBUFCB_CREATEEXEBUF) (LPDDHAL_CREATESURFACEDATA); +typedef DWORD (PASCAL *LPDDHALEXEBUFCB_DESTROYEXEBUF) (LPDDHAL_DESTROYSURFACEDATA); +typedef DWORD (PASCAL *LPDDHALEXEBUFCB_LOCKEXEBUF) (LPDDHAL_LOCKDATA); +typedef DWORD (PASCAL *LPDDHALEXEBUFCB_UNLOCKEXEBUF) (LPDDHAL_UNLOCKDATA); + +typedef struct _DDHAL_DDEXEBUFCALLBACKS { + DWORD dwSize; + DWORD dwFlags; + LPDDHALEXEBUFCB_CANCREATEEXEBUF CanCreateExecuteBuffer; + LPDDHALEXEBUFCB_CREATEEXEBUF CreateExecuteBuffer; + LPDDHALEXEBUFCB_DESTROYEXEBUF DestroyExecuteBuffer; + LPDDHALEXEBUFCB_LOCKEXEBUF LockExecuteBuffer; + LPDDHALEXEBUFCB_UNLOCKEXEBUF UnlockExecuteBuffer; +} DDHAL_DDEXEBUFCALLBACKS,*LPDDHAL_DDEXEBUFCALLBACKS; + +typedef struct _DDHAL_GETAVAILDRIVERMEMORYDATA *LPDDHAL_GETAVAILDRIVERMEMORYDATA; +typedef struct _DDHAL_UPDATENONLOCALHEAPDATA *LPDDHAL_UPDATENONLOCALHEAPDATA; +typedef struct _DDHAL_GETHEAPALIGNMENTDATA *LPDDHAL_GETHEAPALIGNMENTDATA; + +typedef DWORD (PASCAL *LPDDHAL_GETAVAILDRIVERMEMORY)(LPDDHAL_GETAVAILDRIVERMEMORYDATA); +typedef DWORD (PASCAL *LPDDHAL_UPDATENONLOCALHEAP) (LPDDHAL_UPDATENONLOCALHEAPDATA); +typedef DWORD (PASCAL *LPDDHAL_GETHEAPALIGNMENT) (LPDDHAL_GETHEAPALIGNMENTDATA); + +typedef struct _DDHAL_DDMISCELLANEOUSCALLBACKS { + DWORD dwSize; + DWORD dwFlags; + LPDDHAL_GETAVAILDRIVERMEMORY GetAvailDriverMemory; + LPDDHAL_UPDATENONLOCALHEAP UpdateNonLocalHeap; + LPDDHAL_GETHEAPALIGNMENT GetHeapAlignment; + LPDDHALSURFCB_GETBLTSTATUS GetSysmemBltStatus; +} DDHAL_DDMISCELLANEOUSCALLBACKS,*LPDDHAL_DDMISCELLANEOUSCALLBACKS; + +typedef struct _DDHAL_CREATESURFACEEXDATA *LPDDHAL_CREATESURFACEEXDATA; +typedef struct _DDHAL_GETDRIVERSTATEDATA *LPDDHAL_GETDRIVERSTATEDATA; +typedef struct _DDHAL_DESTROYDDLOCALDATA *LPDDHAL_DESTROYDDLOCALDATA; + +typedef DWORD (PASCAL *LPDDHAL_CREATESURFACEEX)(LPDDHAL_CREATESURFACEEXDATA); +typedef DWORD (PASCAL *LPDDHAL_GETDRIVERSTATE) (LPDDHAL_GETDRIVERSTATEDATA); +typedef DWORD (PASCAL *LPDDHAL_DESTROYDDLOCAL) (LPDDHAL_DESTROYDDLOCALDATA); + +typedef struct _DDHAL_DDMISCELLANEOUS2CALLBACKS { + DWORD dwSize; + DWORD dwFlags; + LPVOID Reserved; + LPDDHAL_CREATESURFACEEX CreateSurfaceEx; + LPDDHAL_GETDRIVERSTATE GetDriverState; + LPDDHAL_DESTROYDDLOCAL DestroyDDLocal; +} DDHAL_DDMISCELLANEOUS2CALLBACKS,*LPDDHAL_DDMISCELLANEOUS2CALLBACKS; + + +typedef struct _DDHAL_CANCREATEVPORTDATA *LPDDHAL_CANCREATEVPORTDATA; +typedef struct _DDHAL_CREATEVPORTDATA *LPDDHAL_CREATEVPORTDATA; +typedef struct _DDHAL_FLIPVPORTDATA *LPDDHAL_FLIPVPORTDATA; +typedef struct _DDHAL_GETVPORTCONNECTDATA *LPDDHAL_GETVPORTCONNECTDATA; +typedef struct _DDHAL_GETVPORTBANDWIDTHDATA *LPDDHAL_GETVPORTBANDWIDTHDATA; +typedef struct _DDHAL_GETVPORTINPUTFORMATDATA *LPDDHAL_GETVPORTINPUTFORMATDATA; +typedef struct _DDHAL_GETVPORTOUTPUTFORMATDATA *LPDDHAL_GETVPORTOUTPUTFORMATDATA; +typedef struct _DDHAL_GETVPORTFIELDDATA *LPDDHAL_GETVPORTFIELDDATA; +typedef struct _DDHAL_GETVPORTLINEDATA *LPDDHAL_GETVPORTLINEDATA; +typedef struct _DDHAL_DESTROYVPORTDATA *LPDDHAL_DESTROYVPORTDATA; +typedef struct _DDHAL_GETVPORTFLIPSTATUSDATA *LPDDHAL_GETVPORTFLIPSTATUSDATA; +typedef struct _DDHAL_UPDATEVPORTDATA *LPDDHAL_UPDATEVPORTDATA; +typedef struct _DDHAL_WAITFORVPORTSYNCDATA *LPDDHAL_WAITFORVPORTSYNCDATA; +typedef struct _DDHAL_GETVPORTSIGNALDATA *LPDDHAL_GETVPORTSIGNALDATA; +typedef struct _DDHAL_VPORTCOLORDATA *LPDDHAL_VPORTCOLORDATA; + +typedef DWORD (PASCAL *LPDDHALVPORTCB_CANCREATEVIDEOPORT)(LPDDHAL_CANCREATEVPORTDATA); +typedef DWORD (PASCAL *LPDDHALVPORTCB_CREATEVIDEOPORT)(LPDDHAL_CREATEVPORTDATA); +typedef DWORD (PASCAL *LPDDHALVPORTCB_FLIP)(LPDDHAL_FLIPVPORTDATA); +typedef DWORD (PASCAL *LPDDHALVPORTCB_GETBANDWIDTH)(LPDDHAL_GETVPORTBANDWIDTHDATA); +typedef DWORD (PASCAL *LPDDHALVPORTCB_GETINPUTFORMATS)(LPDDHAL_GETVPORTINPUTFORMATDATA); +typedef DWORD (PASCAL *LPDDHALVPORTCB_GETOUTPUTFORMATS)(LPDDHAL_GETVPORTOUTPUTFORMATDATA); +typedef DWORD (PASCAL *LPDDHALVPORTCB_GETFIELD)(LPDDHAL_GETVPORTFIELDDATA); +typedef DWORD (PASCAL *LPDDHALVPORTCB_GETLINE)(LPDDHAL_GETVPORTLINEDATA); +typedef DWORD (PASCAL *LPDDHALVPORTCB_GETVPORTCONNECT)(LPDDHAL_GETVPORTCONNECTDATA); +typedef DWORD (PASCAL *LPDDHALVPORTCB_DESTROYVPORT)(LPDDHAL_DESTROYVPORTDATA); +typedef DWORD (PASCAL *LPDDHALVPORTCB_GETFLIPSTATUS)(LPDDHAL_GETVPORTFLIPSTATUSDATA); +typedef DWORD (PASCAL *LPDDHALVPORTCB_UPDATE)(LPDDHAL_UPDATEVPORTDATA); +typedef DWORD (PASCAL *LPDDHALVPORTCB_WAITFORSYNC)(LPDDHAL_WAITFORVPORTSYNCDATA); +typedef DWORD (PASCAL *LPDDHALVPORTCB_GETSIGNALSTATUS)(LPDDHAL_GETVPORTSIGNALDATA); +typedef DWORD (PASCAL *LPDDHALVPORTCB_COLORCONTROL)(LPDDHAL_VPORTCOLORDATA); + +typedef struct _DDHAL_DDVIDEOPORTCALLBACKS +{ + DWORD dwSize; + DWORD dwFlags; + LPDDHALVPORTCB_CANCREATEVIDEOPORT CanCreateVideoPort; + LPDDHALVPORTCB_CREATEVIDEOPORT CreateVideoPort; + LPDDHALVPORTCB_FLIP FlipVideoPort; + LPDDHALVPORTCB_GETBANDWIDTH GetVideoPortBandwidth; + LPDDHALVPORTCB_GETINPUTFORMATS GetVideoPortInputFormats; + LPDDHALVPORTCB_GETOUTPUTFORMATS GetVideoPortOutputFormats; + LPVOID lpReserved1; + LPDDHALVPORTCB_GETFIELD GetVideoPortField; + LPDDHALVPORTCB_GETLINE GetVideoPortLine; + LPDDHALVPORTCB_GETVPORTCONNECT GetVideoPortConnectInfo; + LPDDHALVPORTCB_DESTROYVPORT DestroyVideoPort; + LPDDHALVPORTCB_GETFLIPSTATUS GetVideoPortFlipStatus; + LPDDHALVPORTCB_UPDATE UpdateVideoPort; + LPDDHALVPORTCB_WAITFORSYNC WaitForVideoPortSync; + LPDDHALVPORTCB_GETSIGNALSTATUS GetVideoSignalStatus; + LPDDHALVPORTCB_COLORCONTROL ColorControl; +} DDHAL_DDVIDEOPORTCALLBACKS; + + +typedef struct _DDHAL_COLORCONTROLDATA *LPDDHAL_COLORCONTROLDATA; + +typedef DWORD (PASCAL *LPDDHALCOLORCB_COLORCONTROL)(LPDDHAL_COLORCONTROLDATA); + + +typedef struct _DDHAL_DDCOLORCONTROLCALLBACKS +{ + DWORD dwSize; + DWORD dwFlags; + LPDDHALCOLORCB_COLORCONTROL ColorControl; +} DDHAL_DDCOLORCONTROLCALLBACKS; + +typedef struct _DDHAL_SYNCSURFACEDATA *LPDDHAL_SYNCSURFACEDATA; +typedef struct _DDHAL_SYNCVIDEOPORTDATA *LPDDHAL_SYNCVIDEOPORTDATA; + +typedef DWORD (PASCAL *LPDDHALKERNELCB_SYNCSURFACE)(LPDDHAL_SYNCSURFACEDATA); +typedef DWORD (PASCAL *LPDDHALKERNELCB_SYNCVIDEOPORT)(LPDDHAL_SYNCVIDEOPORTDATA); + +typedef struct _DDHAL_DDKERNELCALLBACKS +{ + DWORD dwSize; + DWORD dwFlags; + LPDDHALKERNELCB_SYNCSURFACE SyncSurfaceData; + LPDDHALKERNELCB_SYNCVIDEOPORT SyncVideoPortData; +} DDHAL_DDKERNELCALLBACKS, *LPDDHAL_DDKERNELCALLBACKS; + +typedef struct _DDHAL_GETMOCOMPGUIDSDATA *LPDDHAL_GETMOCOMPGUIDSDATA; +typedef struct _DDHAL_GETMOCOMPFORMATSDATA *LPDDHAL_GETMOCOMPFORMATSDATA; +typedef struct _DDHAL_CREATEMOCOMPDATA *LPDDHAL_CREATEMOCOMPDATA; +typedef struct _DDHAL_GETMOCOMPCOMPBUFFDATA *LPDDHAL_GETMOCOMPCOMPBUFFDATA; +typedef struct _DDHAL_GETINTERNALMOCOMPDATA *LPDDHAL_GETINTERNALMOCOMPDATA; +typedef struct _DDHAL_BEGINMOCOMPFRAMEDATA *LPDDHAL_BEGINMOCOMPFRAMEDATA; +typedef struct _DDHAL_ENDMOCOMPFRAMEDATA *LPDDHAL_ENDMOCOMPFRAMEDATA; +typedef struct _DDHAL_RENDERMOCOMPDATA *LPDDHAL_RENDERMOCOMPDATA; +typedef struct _DDHAL_QUERYMOCOMPSTATUSDATA *LPDDHAL_QUERYMOCOMPSTATUSDATA; +typedef struct _DDHAL_DESTROYMOCOMPDATA *LPDDHAL_DESTROYMOCOMPDATA; + +typedef DWORD (PASCAL *LPDDHALMOCOMPCB_GETGUIDS)( LPDDHAL_GETMOCOMPGUIDSDATA); +typedef DWORD (PASCAL *LPDDHALMOCOMPCB_GETFORMATS)( LPDDHAL_GETMOCOMPFORMATSDATA); +typedef DWORD (PASCAL *LPDDHALMOCOMPCB_CREATE)( LPDDHAL_CREATEMOCOMPDATA); +typedef DWORD (PASCAL *LPDDHALMOCOMPCB_GETCOMPBUFFINFO)( LPDDHAL_GETMOCOMPCOMPBUFFDATA); +typedef DWORD (PASCAL *LPDDHALMOCOMPCB_GETINTERNALINFO)( LPDDHAL_GETINTERNALMOCOMPDATA); +typedef DWORD (PASCAL *LPDDHALMOCOMPCB_BEGINFRAME)( LPDDHAL_BEGINMOCOMPFRAMEDATA); +typedef DWORD (PASCAL *LPDDHALMOCOMPCB_ENDFRAME)( LPDDHAL_ENDMOCOMPFRAMEDATA); +typedef DWORD (PASCAL *LPDDHALMOCOMPCB_RENDER)( LPDDHAL_RENDERMOCOMPDATA); +typedef DWORD (PASCAL *LPDDHALMOCOMPCB_QUERYSTATUS)( LPDDHAL_QUERYMOCOMPSTATUSDATA); +typedef DWORD (PASCAL *LPDDHALMOCOMPCB_DESTROY)( LPDDHAL_DESTROYMOCOMPDATA); + +typedef struct _DDHAL_DDMOTIONCOMPCALLBACKS +{ + DWORD dwSize; + DWORD dwFlags; + LPDDHALMOCOMPCB_GETGUIDS GetMoCompGuids; + LPDDHALMOCOMPCB_GETFORMATS GetMoCompFormats; + LPDDHALMOCOMPCB_CREATE CreateMoComp; + LPDDHALMOCOMPCB_GETCOMPBUFFINFO GetMoCompBuffInfo; + LPDDHALMOCOMPCB_GETINTERNALINFO GetInternalMoCompInfo; + LPDDHALMOCOMPCB_BEGINFRAME BeginMoCompFrame; + LPDDHALMOCOMPCB_ENDFRAME EndMoCompFrame; + LPDDHALMOCOMPCB_RENDER RenderMoComp; + LPDDHALMOCOMPCB_QUERYSTATUS QueryMoCompStatus; + LPDDHALMOCOMPCB_DESTROY DestroyMoComp; +} DDHAL_DDMOTIONCOMPCALLBACKS, *LPDDHAL_DDMOTIONCOMPCALLBACKS; + + + +typedef HRESULT (WINAPI *LPDDGAMMACALIBRATORPROC)(LPDDGAMMARAMP, LPBYTE); + + + +/***************************************************************************** + * driver info structure + * + * The HAL is queried for additional callbacks via the GetDriverInfo callback. + */ +typedef struct _DDHAL_GETDRIVERINFODATA *LPDDHAL_GETDRIVERINFODATA; +typedef DWORD (PASCAL *LPDDHAL_GETDRIVERINFO)(LPDDHAL_GETDRIVERINFODATA); + + +typedef struct _DDHAL_GETDRIVERINFODATA { + DWORD dwSize; + DWORD dwFlags; + GUID guidInfo; + DWORD dwExpectedSize; + LPVOID lpvData; + DWORD dwActualSize; + HRESULT ddRVal; + ULONG_PTR dwContext; + +} DDHAL_GETDRIVERINFODATA; + +typedef struct _DDHALINFO { + DWORD dwSize; + LPDDHAL_DDCALLBACKS lpDDCallbacks; + LPDDHAL_DDSURFACECALLBACKS lpDDSurfaceCallbacks; + LPDDHAL_DDPALETTECALLBACKS lpDDPaletteCallbacks; + VIDMEMINFO vmiData; + DDCORECAPS ddCaps; + DWORD dwMonitorFrequency; + LPDDHAL_GETDRIVERINFO GetDriverInfo; + DWORD dwModeIndex; + LPDWORD lpdwFourCC; + DWORD dwNumModes; + LPDDHALMODEINFO lpModeInfo; + DWORD dwFlags; + LPVOID lpPDevice; + DWORD hInstance; + /* DirectX 2 */ + ULONG_PTR lpD3DGlobalDriverData; + ULONG_PTR lpD3DHALCallbacks; + LPDDHAL_DDEXEBUFCALLBACKS lpDDExeBufCallbacks; +} DDHALINFO; + + + +#define DDPALETTECALLBACKSSIZE sizeof( DDHAL_DDPALETTECALLBACKS ) +#define DDSURFACECALLBACKSSIZE sizeof( DDHAL_DDSURFACECALLBACKS ) +#define DDMISCELLANEOUSCALLBACKSSIZE sizeof(DDHAL_DDMISCELLANEOUSCALLBACKS) +#define DDMISCELLANEOUS2CALLBACKSSIZE sizeof(DDHAL_DDMISCELLANEOUS2CALLBACKS) +#define DDEXEBUFCALLBACKSSIZE sizeof( DDHAL_DDEXEBUFCALLBACKS ) +#define DDVIDEOPORTCALLBACKSSIZE sizeof( DDHAL_DDVIDEOPORTCALLBACKS ) +#define DDCOLORCONTROLCALLBACKSSIZE sizeof( DDHAL_DDCOLORCONTROLCALLBACKS ) +#define DDKERNELCALLBACKSSIZE sizeof(DDHAL_DDKERNELCALLBACKS) +#define DDMOTIONCOMPCALLBACKSSIZE sizeof( DDHAL_DDMOTIONCOMPCALLBACKS ) + +#define MAX_PALETTE_SIZE 256 + +#define MAX_AUTOFLIP_BUFFERS 10 +#define DDSCAPS2_INDEXBUFFER DDSCAPS2_RESERVED3 +#define DDSCAPS3_VIDEO DDSCAPS3_RESERVED2 +#define D3DFMT_INTERNAL_D32 71 +#define D3DFMT_INTERNAL_S1D15 72 +#define D3DFMT_INTERNAL_D15S1 73 +#define D3DFMT_INTERNAL_S8D24 74 +#define D3DFMT_INTERNAL_D24S8 75 +#define D3DFMT_INTERNAL_X8D24 76 +#define D3DFMT_INTERNAL_D24X8 77 +#define DDHAL_PLEASEALLOC_BLOCKSIZE 0x00000002l +#define DDHAL_PLEASEALLOC_LINEARSIZE 0x00000003l + +#define DDHAL_CB32_DESTROYDRIVER 0x00000001l +#define DDHAL_CB32_CREATESURFACE 0x00000002l +#define DDHAL_CB32_SETCOLORKEY 0x00000004l +#define DDHAL_CB32_SETMODE 0x00000008l +#define DDHAL_CB32_WAITFORVERTICALBLANK 0x00000010l +#define DDHAL_CB32_CANCREATESURFACE 0x00000020l +#define DDHAL_CB32_CREATEPALETTE 0x00000040l +#define DDHAL_CB32_GETSCANLINE 0x00000080l +#define DDHAL_CB32_SETEXCLUSIVEMODE 0x00000100l +#define DDHAL_CB32_FLIPTOGDISURFACE 0x00000200l +#define DDHAL_PALCB32_DESTROYPALETTE 0x00000001l +#define DDHAL_PALCB32_SETENTRIES 0x00000002l +#define DDHALINFO_ISPRIMARYDISPLAY 0x00000001 +#define DDHALINFO_MODEXILLEGAL 0x00000002 +#define DDHALINFO_GETDRIVERINFOSET 0x00000004 +#define DDHALINFO_GETDRIVERINFO2 0x00000008 +#define DDRAWI_VPORTSTART 0x0001 +#define DDRAWI_VPORTSTOP 0x0002 +#define DDRAWI_VPORTUPDATE 0x0003 +#define DDRAWI_VPORTGETCOLOR 0x0001 +#define DDRAWI_VPORTSETCOLOR 0x0002 +#define DDHAL_SURFCB32_DESTROYSURFACE 0x00000001 +#define DDHAL_SURFCB32_FLIP 0x00000002 +#define DDHAL_SURFCB32_SETCLIPLIST 0x00000004 +#define DDHAL_SURFCB32_LOCK 0x00000008 +#define DDHAL_SURFCB32_UNLOCK 0x00000010 +#define DDHAL_SURFCB32_BLT 0x00000020 +#define DDHAL_SURFCB32_SETCOLORKEY 0x00000040 +#define DDHAL_SURFCB32_ADDATTACHEDSURFACE 0x00000080 +#define DDHAL_SURFCB32_GETBLTSTATUS 0x00000100 +#define DDHAL_SURFCB32_GETFLIPSTATUS 0x00000200 +#define DDHAL_SURFCB32_UPDATEOVERLAY 0x00000400 +#define DDHAL_SURFCB32_SETOVERLAYPOSITION 0x00000800 +#define DDHAL_SURFCB32_RESERVED4 0x00001000 +#define DDHAL_SURFCB32_SETPALETTE 0x00002000 +#define DDHAL_MISCCB32_GETAVAILDRIVERMEMORY 0x00000001 +#define DDHAL_MISCCB32_UPDATENONLOCALHEAP 0x00000002 +#define DDHAL_MISCCB32_GETHEAPALIGNMENT 0x00000004 +#define DDHAL_MISCCB32_GETSYSMEMBLTSTATUS 0x00000008 +#define DDHAL_MISC2CB32_ALPHABLT 0x00000001 +#define DDHAL_MISC2CB32_CREATESURFACEEX 0x00000002 +#define DDHAL_MISC2CB32_GETDRIVERSTATE 0x00000004 +#define DDHAL_MISC2CB32_DESTROYDDLOCAL 0x00000008 +#define DDHAL_EXEBUFCB32_CANCREATEEXEBUF 0x00000001 +#define DDHAL_EXEBUFCB32_CREATEEXEBUF 0x00000002 +#define DDHAL_EXEBUFCB32_DESTROYEXEBUF 0x00000004 +#define DDHAL_EXEBUFCB32_LOCKEXEBUF 0x00000008 +#define DDHAL_EXEBUFCB32_UNLOCKEXEBUF 0x00000010 +#define DDHAL_VPORT32_CANCREATEVIDEOPORT 0x00000001 +#define DDHAL_VPORT32_CREATEVIDEOPORT 0x00000002 +#define DDHAL_VPORT32_FLIP 0x00000004 +#define DDHAL_VPORT32_GETBANDWIDTH 0x00000008 +#define DDHAL_VPORT32_GETINPUTFORMATS 0x00000010 +#define DDHAL_VPORT32_GETOUTPUTFORMATS 0x00000020 +#define DDHAL_VPORT32_GETFIELD 0x00000080 +#define DDHAL_VPORT32_GETLINE 0x00000100 +#define DDHAL_VPORT32_GETCONNECT 0x00000200 +#define DDHAL_VPORT32_DESTROY 0x00000400 +#define DDHAL_VPORT32_GETFLIPSTATUS 0x00000800 +#define DDHAL_VPORT32_UPDATE 0x00001000 +#define DDHAL_VPORT32_WAITFORSYNC 0x00002000 +#define DDHAL_VPORT32_GETSIGNALSTATUS 0x00004000 +#define DDHAL_VPORT32_COLORCONTROL 0x00008000 +#define DDHAL_COLOR_COLORCONTROL 0x00000001 +#define DDHAL_KERNEL_SYNCSURFACEDATA 0x00000001 +#define DDHAL_KERNEL_SYNCVIDEOPORTDATA 0x00000002 +#define DDHAL_MOCOMP32_GETGUIDS 0x00000001 +#define DDHAL_MOCOMP32_GETFORMATS 0x00000002 +#define DDHAL_MOCOMP32_CREATE 0x00000004 +#define DDHAL_MOCOMP32_GETCOMPBUFFINFO 0x00000008 +#define DDHAL_MOCOMP32_GETINTERNALINFO 0x00000010 +#define DDHAL_MOCOMP32_BEGINFRAME 0x00000020 +#define DDHAL_MOCOMP32_ENDFRAME 0x00000040 +#define DDHAL_MOCOMP32_RENDER 0x00000080 +#define DDHAL_MOCOMP32_QUERYSTATUS 0x00000100 +#define DDHAL_MOCOMP32_DESTROY 0x00000200 + + +/* where the high-level ddraw implementation stores the callbacks */ +typedef struct _DDHAL_CALLBACKS { + DDHAL_DDCALLBACKS cbDDCallbacks; + DDHAL_DDSURFACECALLBACKS cbDDSurfaceCallbacks; + DDHAL_DDPALETTECALLBACKS cbDDPaletteCallbacks; + DDHAL_DDCALLBACKS HALDD; + DDHAL_DDSURFACECALLBACKS HALDDSurface; + DDHAL_DDPALETTECALLBACKS HALDDPalette; + DDHAL_DDCALLBACKS HELDD; + DDHAL_DDSURFACECALLBACKS HELDDSurface; + DDHAL_DDPALETTECALLBACKS HELDDPalette; + DDHAL_DDEXEBUFCALLBACKS cbDDExeBufCallbacks; + DDHAL_DDEXEBUFCALLBACKS HALDDExeBuf; + DDHAL_DDEXEBUFCALLBACKS HELDDExeBuf; + DDHAL_DDVIDEOPORTCALLBACKS cbDDVideoPortCallbacks; + DDHAL_DDVIDEOPORTCALLBACKS HALDDVideoPort; + DDHAL_DDCOLORCONTROLCALLBACKS cbDDColorControlCallbacks; + DDHAL_DDCOLORCONTROLCALLBACKS HALDDColorControl; + DDHAL_DDMISCELLANEOUSCALLBACKS cbDDMiscellaneousCallbacks; + DDHAL_DDMISCELLANEOUSCALLBACKS HALDDMiscellaneous; + DDHAL_DDKERNELCALLBACKS cbDDKernelCallbacks; + DDHAL_DDKERNELCALLBACKS HALDDKernel; + DDHAL_DDMOTIONCOMPCALLBACKS cbDDMotionCompCallbacks; + DDHAL_DDMOTIONCOMPCALLBACKS HALDDMotionComp; +} DDHAL_CALLBACKS,*LPDDHAL_CALLBACKS; + +/***************************************************************************** + * parameter structures + */ +typedef struct _DDHAL_DESTROYDRIVERDATA { + LPDDRAWI_DIRECTDRAW_GBL lpDD; + HRESULT ddRVal; + LPDDHAL_DESTROYDRIVER DestroyDriver; +} DDHAL_DESTROYDRIVERDATA; + +typedef struct _DDHAL_SETMODEDATA { + LPDDRAWI_DIRECTDRAW_GBL lpDD; + DWORD dwModeIndex; + HRESULT ddRVal; + LPDDHAL_SETMODE SetMode; + BOOL inexcl; + BOOL useRefreshRate; +} DDHAL_SETMODEDATA; + +typedef struct _DDHAL_CREATESURFACEDATA { + LPDDRAWI_DIRECTDRAW_GBL lpDD; + LPDDSURFACEDESC lpDDSurfaceDesc; + LPDDRAWI_DDRAWSURFACE_LCL * lplpSList; + DWORD dwSCnt; + HRESULT ddRVal; + LPDDHAL_CREATESURFACE CreateSurface; +} DDHAL_CREATESURFACEDATA; + +typedef struct _DDHAL_CANCREATESURFACEDATA { + LPDDRAWI_DIRECTDRAW_GBL lpDD; + LPDDSURFACEDESC lpDDSurfaceDesc; + DWORD bIsDifferentPixelFormat; + HRESULT ddRVal; + LPDDHAL_CANCREATESURFACE CanCreateSurface; +} DDHAL_CANCREATESURFACEDATA; + +typedef struct _DDHAL_CREATEPALETTEDATA { + LPDDRAWI_DIRECTDRAW_GBL lpDD; + LPDDRAWI_DDRAWPALETTE_GBL lpDDPalette; + LPPALETTEENTRY lpColorTable; + HRESULT ddRVal; + LPDDHAL_CREATEPALETTE CreatePalette; + BOOL is_excl; +} DDHAL_CREATEPALETTEDATA; + +typedef struct _DDHAL_SETEXCLUSIVEMODEDATA { + LPDDRAWI_DIRECTDRAW_GBL lpDD; + DWORD dwEnterExcl; + DWORD dwReserved; + HRESULT ddRVal; + LPDDHAL_SETEXCLUSIVEMODE SetExclusiveMode; +} DDHAL_SETEXCLUSIVEMODEDATA; + +/* surfaces */ +typedef struct _DDHAL_DESTROYSURFACEDATA { + LPDDRAWI_DIRECTDRAW_GBL lpDD; + LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface; + HRESULT ddRVal; + LPDDHALSURFCB_DESTROYSURFACE DestroySurface; +} DDHAL_DESTROYSURFACEDATA; + +typedef struct _DDHAL_FLIPDATA { + LPDDRAWI_DIRECTDRAW_GBL lpDD; + LPDDRAWI_DDRAWSURFACE_LCL lpSurfCurr; + LPDDRAWI_DDRAWSURFACE_LCL lpSurfTarg; + DWORD dwFlags; + HRESULT ddRVal; + LPDDHALSURFCB_FLIP Flip; + LPDDRAWI_DDRAWSURFACE_LCL lpSurfCurrLeft; + LPDDRAWI_DDRAWSURFACE_LCL lpSurfTargLeft; +} DDHAL_FLIPDATA; + +typedef struct _DDHAL_LOCKDATA { + LPDDRAWI_DIRECTDRAW_GBL lpDD; + LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface; + DWORD bHasRect; + RECTL rArea; + LPVOID lpSurfData; + HRESULT ddRVal; + LPDDHALSURFCB_LOCK Lock; + DWORD dwFlags; +} DDHAL_LOCKDATA; + +typedef struct _DDHAL_UNLOCKDATA { + LPDDRAWI_DIRECTDRAW_GBL lpDD; + LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface; + HRESULT ddRVal; + LPDDHALSURFCB_UNLOCK Unlock; +} DDHAL_UNLOCKDATA; + +typedef struct _DDHAL_BLTDATA { + LPDDRAWI_DIRECTDRAW_GBL lpDD; + LPDDRAWI_DDRAWSURFACE_LCL lpDDDestSurface; + RECTL rDest; + LPDDRAWI_DDRAWSURFACE_LCL lpDDSrcSurface; + RECTL rSrc; + DWORD dwFlags; + DWORD dwROPFlags; + DDBLTFX bltFX; + HRESULT ddRVal; + LPDDHALSURFCB_BLT Blt; + BOOL IsClipped; + RECTL rOrigDest; + RECTL rOrigSrc; + DWORD dwRectCnt; + LPRECT prDestRects; +} DDHAL_BLTDATA; + +typedef struct _DDHAL_SETPALETTEDATA { + LPDDRAWI_DIRECTDRAW_GBL lpDD; + LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface; + LPDDRAWI_DDRAWPALETTE_GBL lpDDPalette; + HRESULT ddRVal; + LPDDHALSURFCB_SETPALETTE SetPalette; + BOOL Attach; +} DDHAL_SETPALETTEDATA; + +/* palettes */ +typedef struct _DDHAL_DESTROYPALETTEDATA { + LPDDRAWI_DIRECTDRAW_GBL lpDD; + LPDDRAWI_DDRAWPALETTE_GBL lpDDPalette; + HRESULT ddRVal; + LPDDHALPALCB_DESTROYPALETTE DestroyPalette; +} DDHAL_DESTROYPALETTEDATA; + +typedef struct _DDHAL_SETENTRIESDATA { + LPDDRAWI_DIRECTDRAW_GBL lpDD; + LPDDRAWI_DDRAWPALETTE_GBL lpDDPalette; + DWORD dwBase; + DWORD dwNumEntries; + LPPALETTEENTRY lpEntries; + HRESULT ddRVal; + LPDDHALPALCB_SETENTRIES SetEntries; +} DDHAL_SETENTRIESDATA; + + +typedef struct _DDHAL_CANCREATEVPORTDATA +{ + LPDDRAWI_DIRECTDRAW_LCL lpDD; + LPDDVIDEOPORTDESC lpDDVideoPortDesc; + HRESULT ddRVal; + LPDDHALVPORTCB_CANCREATEVIDEOPORT CanCreateVideoPort; +} DDHAL_CANCREATEVPORTDATA; + +typedef struct _DDHAL_CREATEVPORTDATA +{ + LPDDRAWI_DIRECTDRAW_LCL lpDD; + LPDDVIDEOPORTDESC lpDDVideoPortDesc; + LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; + HRESULT ddRVal; + LPDDHALVPORTCB_CREATEVIDEOPORT CreateVideoPort; +} DDHAL_CREATEVPORTDATA; + +typedef struct _DDHAL_GETVPORTBANDWIDTHDATA +{ + LPDDRAWI_DIRECTDRAW_LCL lpDD; + LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; + LPDDPIXELFORMAT lpddpfFormat; + DWORD dwWidth; + DWORD dwHeight; + DWORD dwFlags; + LPDDVIDEOPORTBANDWIDTH lpBandwidth; + HRESULT ddRVal; + LPDDHALVPORTCB_GETBANDWIDTH GetVideoPortBandwidth; +} DDHAL_GETVPORTBANDWIDTHDATA; + +typedef struct _DDHAL_GETVPORTINPUTFORMATDATA +{ + LPDDRAWI_DIRECTDRAW_LCL lpDD; + LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; + DWORD dwFlags; + LPDDPIXELFORMAT lpddpfFormat; + DWORD dwNumFormats; + HRESULT ddRVal; + LPDDHALVPORTCB_GETINPUTFORMATS GetVideoPortInputFormats; +} DDHAL_GETVPORTINPUTFORMATDATA; + +typedef struct _DDHAL_GETVPORTFIELDDATA +{ + LPDDRAWI_DIRECTDRAW_LCL lpDD; + LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; + BOOL bField; + HRESULT ddRVal; + LPDDHALVPORTCB_GETFIELD GetVideoPortField; +} DDHAL_GETVPORTFIELDDATA; + +typedef struct _DDHAL_GETVPORTOUTPUTFORMATDATA +{ + LPDDRAWI_DIRECTDRAW_LCL lpDD; + LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; + DWORD dwFlags; + LPDDPIXELFORMAT lpddpfInputFormat; + LPDDPIXELFORMAT lpddpfOutputFormats; + DWORD dwNumFormats; + HRESULT ddRVal; + LPDDHALVPORTCB_GETOUTPUTFORMATS GetVideoPortOutputFormats; +} DDHAL_GETVPORTOUTPUTFORMATDATA; + +typedef struct _DDHAL_GETVPORTLINEDATA +{ + LPDDRAWI_DIRECTDRAW_LCL lpDD; + LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; + DWORD dwLine; + HRESULT ddRVal; + LPDDHALVPORTCB_GETLINE GetVideoPortLine; +} DDHAL_GETVPORTLINEDATA; + +typedef struct _DDHAL_DESTROYVPORTDATA +{ + LPDDRAWI_DIRECTDRAW_LCL lpDD; + LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; + HRESULT ddRVal; + LPDDHALVPORTCB_DESTROYVPORT DestroyVideoPort; +} DDHAL_DESTROYVPORTDATA; + +typedef struct _DDHAL_GETVPORTFLIPSTATUSDATA +{ + LPDDRAWI_DIRECTDRAW_LCL lpDD; + FLATPTR fpSurface; + HRESULT ddRVal; + LPDDHALVPORTCB_GETFLIPSTATUS GetVideoPortFlipStatus; +} DDHAL_GETVPORTFLIPSTATUSDATA; + +typedef struct _DDHAL_UPDATEVPORTDATA +{ + LPDDRAWI_DIRECTDRAW_LCL lpDD; + LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; + LPDDRAWI_DDRAWSURFACE_INT *lplpDDSurface; + LPDDRAWI_DDRAWSURFACE_INT *lplpDDVBISurface; + LPDDVIDEOPORTINFO lpVideoInfo; + DWORD dwFlags; + DWORD dwNumAutoflip; + DWORD dwNumVBIAutoflip; + HRESULT ddRVal; + LPDDHALVPORTCB_UPDATE UpdateVideoPort; +} DDHAL_UPDATEVPORTDATA; + +typedef struct _DDHAL_WAITFORVPORTSYNCDATA +{ + LPDDRAWI_DIRECTDRAW_LCL lpDD; + LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; + DWORD dwFlags; + DWORD dwLine; + DWORD dwTimeOut; + HRESULT ddRVal; + LPDDHALVPORTCB_WAITFORSYNC WaitForVideoPortSync; +} DDHAL_WAITFORVPORTSYNCDATA; + +typedef struct _DDHAL_GETVPORTSIGNALDATA +{ + LPDDRAWI_DIRECTDRAW_LCL lpDD; + LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; + DWORD dwStatus; + HRESULT ddRVal; + LPDDHALVPORTCB_GETSIGNALSTATUS GetVideoSignalStatus; +} DDHAL_GETVPORTSIGNALDATA; + +typedef struct _DDHAL_VPORTCOLORDATA +{ + LPDDRAWI_DIRECTDRAW_LCL lpDD; + LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; + DWORD dwFlags; + LPDDCOLORCONTROL lpColorData; + HRESULT ddRVal; + LPDDHALVPORTCB_COLORCONTROL ColorControl; +} DDHAL_VPORTCOLORDATA; + +typedef struct _DDHAL_FLIPVPORTDATA +{ + LPDDRAWI_DIRECTDRAW_LCL lpDD; + LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; + LPDDRAWI_DDRAWSURFACE_LCL lpSurfCurr; + LPDDRAWI_DDRAWSURFACE_LCL lpSurfTarg; + HRESULT ddRVal; + LPDDHALVPORTCB_FLIP FlipVideoPort; +} DDHAL_FLIPVPORTDATA; + +typedef struct _DDHAL_GETVPORTCONNECTDATA +{ + LPDDRAWI_DIRECTDRAW_LCL lpDD; + DWORD dwPortId; + LPDDVIDEOPORTCONNECT lpConnect; + DWORD dwNumEntries; + HRESULT ddRVal; + LPDDHALVPORTCB_GETVPORTCONNECT GetVideoPortConnectInfo; +} DDHAL_GETVPORTCONNECTDATA; + +typedef struct _DDHAL_SYNCSURFACEDATA +{ + DWORD dwSize; + LPDDRAWI_DIRECTDRAW_LCL lpDD; + LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface; + DWORD dwSurfaceOffset; + ULONG_PTR fpLockPtr; + LONG lPitch; + DWORD dwOverlayOffset; + DWORD dwOverlaySrcWidth; + DWORD dwOverlaySrcHeight; + DWORD dwOverlayDestWidth; + DWORD dwOverlayDestHeight; + ULONG_PTR dwDriverReserved1; + ULONG_PTR dwDriverReserved2; + ULONG_PTR dwDriverReserved3; + HRESULT ddRVal; +} DDHAL_SYNCSURFACEDATA; + +typedef struct _DDHAL_SYNCVIDEOPORTDATA +{ + DWORD dwSize; + LPDDRAWI_DIRECTDRAW_LCL lpDD; + LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; + DWORD dwOriginOffset; + DWORD dwHeight; + DWORD dwVBIHeight; + ULONG_PTR dwDriverReserved1; + ULONG_PTR dwDriverReserved2; + ULONG_PTR dwDriverReserved3; + HRESULT ddRVal; +} DDHAL_SYNCVIDEOPORTDATA; + +typedef struct _DDHAL_DESTROYDDLOCALDATA +{ + DWORD dwFlags; + LPDDRAWI_DIRECTDRAW_LCL pDDLcl; + HRESULT ddRVal; +} DDHAL_DESTROYDDLOCALDATA; + +typedef struct _DDHAL_CREATESURFACEEXDATA { + DWORD dwFlags; + LPDDRAWI_DIRECTDRAW_LCL lpDDLcl; + LPDDRAWI_DDRAWSURFACE_LCL lpDDSLcl; + HRESULT ddRVal; +} DDHAL_CREATESURFACEEXDATA; + +typedef struct _DDHAL_GETHEAPALIGNMENTDATA +{ + ULONG_PTR dwInstance; + DWORD dwHeap; + HRESULT ddRVal; + LPDDHAL_GETHEAPALIGNMENT GetHeapAlignment; + HEAPALIGNMENT Alignment; +} DDHAL_GETHEAPALIGNMENTDATA; + + +typedef struct _DDMORESURFACECAPS +{ + DWORD dwSize; + DDSCAPSEX ddsCapsMore; + struct tagExtendedHeapRestrictions + { + DDSCAPSEX ddsCapsEx; + DDSCAPSEX ddsCapsExAlt; + } ddsExtendedHeapRestrictions[1]; +} DDMORESURFACECAPS, * LPDDMORESURFACECAPS; + +typedef struct _DDSTEREOMODE +{ + DWORD dwSize; + DWORD dwHeight; + DWORD dwWidth; + DWORD dwBpp; + DWORD dwRefreshRate; + BOOL bSupported; + +} DDSTEREOMODE, * LPDDSTEREOMODE; + +/***************************************************************************** + * high-level ddraw implementation structures + */ +typedef struct _IUNKNOWN_LIST { + struct _IUNKNOWN_LIST * lpLink; + LPGUID lpGuid; + +#ifndef _NO_COM + IUnknown * lpIUnknown; +#else + LPVOID lpIUnknown; +#endif /* _NO_COM */ +} IUNKNOWN_LIST,*LPIUNKNOWN_LIST; + + +typedef struct _PROCESS_LIST { + struct _PROCESS_LIST * lpLink; + DWORD dwProcessId; + DWORD dwRefCnt; + DWORD dwAlphaDepth; + DWORD dwZDepth; +} PROCESS_LIST,*LPPROCESS_LIST; + +typedef struct _ATTACHLIST { + DWORD dwFlags; + struct _ATTACHLIST * lpLink; + LPDDRAWI_DDRAWSURFACE_LCL lpAttached; + LPDDRAWI_DDRAWSURFACE_INT lpIAttached; +} ATTACHLIST,*LPATTACHLIST; + +#define DDAL_IMPLICIT 0x00000001 + +typedef struct _ACCESSRECTLIST { + struct _ACCESSRECTLIST * lpLink; + RECT rDest; + LPDDRAWI_DIRECTDRAW_LCL lpOwner; + LPVOID lpSurfaceData; + DWORD dwFlags; + LPHEAPALIASINFO lpHeapAliasInfo; +} ACCESSRECTLIST,*LPACCESSRECTLIST; + +#define ACCESSRECT_VRAMSTYLE 0x00000001 +#define ACCESSRECT_NOTHOLDINGWIN16LOCK 0x00000002 +#define ACCESSRECT_BROKEN 0x00000004 + +typedef struct _DBLNODE { + struct _DBLNODE * next; + struct _DBLNODE * prev; + LPDDRAWI_DDRAWSURFACE_LCL object; + LPDDRAWI_DDRAWSURFACE_INT object_int; +} DBLNODE,*LPDBLNODE; + +typedef struct _DDRAWI_DIRECTDRAW_INT { + LPVOID lpVtbl; + LPDDRAWI_DIRECTDRAW_LCL lpLcl; + LPDDRAWI_DIRECTDRAW_INT lpLink; + DWORD dwIntRefCnt; +} DDRAWI_DIRECTDRAW_INT; + + +typedef struct _DDRAWI_DIRECTDRAW_LCL { + DWORD lpDDMore; + LPDDRAWI_DIRECTDRAW_GBL lpGbl; + DWORD dwUnused0; + DWORD dwLocalFlags; + DWORD dwLocalRefCnt; + DWORD dwProcessId; +#ifndef _NO_COM + IUnknown * pUnkOuter; +#else + PVOID pUnkOuter; +#endif + DWORD dwObsolete1; + ULONG_PTR hWnd; + ULONG_PTR hDC; + DWORD dwErrorMode; + LPDDRAWI_DDRAWSURFACE_INT lpPrimary; + LPDDRAWI_DDRAWSURFACE_INT lpCB; + DWORD dwPreferredMode; + /* DirectX 2 */ + HINSTANCE hD3DInstance; +#ifndef _NO_COM + IUnknown * pD3DIUnknown; +#else + PVOID pD3DIUnknown; +#endif + LPDDHAL_CALLBACKS lpDDCB; + ULONG_PTR hDDVxd; + /* DirectX 5.0 */ + DWORD dwAppHackFlags; + /* DirectX 5.0A */ + ULONG_PTR hFocusWnd; + DWORD dwHotTracking; + DWORD dwIMEState; + /* DirectX 6.0 */ + ULONG_PTR hWndPopup; + ULONG_PTR hDD; + ULONG_PTR hGammaCalibrator; + LPDDGAMMACALIBRATORPROC lpGammaCalibrator; +} DDRAWI_DIRECTDRAW_LCL; + + +#define DDRAWILCL_HASEXCLUSIVEMODE 0x00000001 +#define DDRAWILCL_ISFULLSCREEN 0x00000002 +#define DDRAWILCL_SETCOOPCALLED 0x00000004 +#define DDRAWILCL_ACTIVEYES 0x00000008 +#define DDRAWILCL_ACTIVENO 0x00000010 +#define DDRAWILCL_HOOKEDHWND 0x00000020 +#define DDRAWILCL_ALLOWMODEX 0x00000040 +#define DDRAWILCL_V1SCLBEHAVIOUR 0x00000080 +#define DDRAWILCL_MODEHASBEENCHANGED 0x00000100 +#define DDRAWILCL_CREATEDWINDOW 0x00000200 +#define DDRAWILCL_DIRTYDC 0x00000400 +#define DDRAWILCL_DISABLEINACTIVATE 0x00000800 +#define DDRAWILCL_CURSORCLIPPED 0x00001000 +#define DDRAWILCL_EXPLICITMONITOR 0x00002000 +#define DDRAWILCL_MULTITHREADED 0x00004000 +#define DDRAWILCL_FPUSETUP 0x00008000 +#define DDRAWILCL_POWEREDDOWN 0x00010000 +#define DDRAWILCL_DIRECTDRAW7 0x00020000 +#define DDRAWILCL_ATTEMPTEDD3DCONTEXT 0x00040000 +#define DDRAWILCL_FPUPRESERVE 0x00080000 +#define DDRAWILCL_DX8DRIVER 0x00100000 +#define DDRAWILCL_DIRECTDRAW8 0x00200000 + + +typedef struct _DDRAWI_DIRECTDRAW_GBL { + DWORD dwRefCnt; + DWORD dwFlags; + FLATPTR fpPrimaryOrig; + DDCORECAPS ddCaps; + DWORD dwInternal1; + DWORD dwUnused1[9]; + LPDDHAL_CALLBACKS lpDDCBtmp; + LPDDRAWI_DDRAWSURFACE_INT dsList; + LPDDRAWI_DDRAWPALETTE_INT palList; + LPDDRAWI_DDRAWCLIPPER_INT clipperList; + LPDDRAWI_DIRECTDRAW_GBL lp16DD; + DWORD dwMaxOverlays; + DWORD dwCurrOverlays; + DWORD dwMonitorFrequency; + DDCORECAPS ddHELCaps; + DWORD dwUnused2[50]; + DDCOLORKEY ddckCKDestOverlay; + DDCOLORKEY ddckCKSrcOverlay; + VIDMEMINFO vmiData; + LPVOID lpDriverHandle; + LPDDRAWI_DIRECTDRAW_LCL lpExclusiveOwner; + DWORD dwModeIndex; + DWORD dwModeIndexOrig; + DWORD dwNumFourCC; + LPDWORD lpdwFourCC; + DWORD dwNumModes; + LPDDHALMODEINFO lpModeInfo; + PROCESS_LIST plProcessList; + DWORD dwSurfaceLockCount; + DWORD dwAliasedLockCnt; + ULONG_PTR dwReserved3; + ULONG_PTR hDD; + char cObsolete[12]; + DWORD dwReserved1; + DWORD dwReserved2; + DBLNODE dbnOverlayRoot; + volatile LPWORD lpwPDeviceFlags; + DWORD dwPDevice; + DWORD dwWin16LockCnt; + DWORD dwUnused3; + DWORD hInstance; + DWORD dwEvent16; + DWORD dwSaveNumModes; + /* DirectX 2 */ + ULONG_PTR lpD3DGlobalDriverData; + ULONG_PTR lpD3DHALCallbacks; + DDCORECAPS ddBothCaps; + /* DirectX 5.0 */ + LPDDVIDEOPORTCAPS lpDDVideoPortCaps; + LPDDRAWI_DDVIDEOPORT_INT dvpList; + ULONG_PTR lpD3DHALCallbacks2; + RECT rectDevice; + DWORD cMonitors; + LPVOID gpbmiSrc; + LPVOID gpbmiDest; + LPHEAPALIASINFO phaiHeapAliases; + ULONG_PTR hKernelHandle; + ULONG_PTR pfnNotifyProc; + LPDDKERNELCAPS lpDDKernelCaps; + LPDDNONLOCALVIDMEMCAPS lpddNLVCaps; + LPDDNONLOCALVIDMEMCAPS lpddNLVHELCaps; + LPDDNONLOCALVIDMEMCAPS lpddNLVBothCaps; + ULONG_PTR lpD3DExtendedCaps; + /* DirectX 5.0A */ + DWORD dwDOSBoxEvent; + RECT rectDesktop; + char cDriverName[MAX_DRIVER_NAME]; + /* DirectX 6.0 */ + ULONG_PTR lpD3DHALCallbacks3; + DWORD dwNumZPixelFormats; + LPDDPIXELFORMAT lpZPixelFormats; + LPDDRAWI_DDMOTIONCOMP_INT mcList; + DWORD hDDVxd; + DDSCAPSEX ddsCapsMore; +} DDRAWI_DIRECTDRAW_GBL; + +#define DDRAWI_xxxxxxxxx1 0x00000001 +#define DDRAWI_xxxxxxxxx2 0x00000002 +#define DDRAWI_VIRTUALDESKTOP 0x00000008 +#define DDRAWI_MODEX 0x00000010 +#define DDRAWI_DISPLAYDRV 0x00000020 +#define DDRAWI_FULLSCREEN 0x00000040 +#define DDRAWI_MODECHANGED 0x00000080 +#define DDRAWI_NOHARDWARE 0x00000100 +#define DDRAWI_PALETTEINIT 0x00000200 +#define DDRAWI_NOEMULATION 0x00000400 +#define DDRAWI_HASCKEYDESTOVERLAY 0x00000800 +#define DDRAWI_HASCKEYSRCOVERLAY 0x00001000 +#define DDRAWI_HASGDIPALETTE 0x00002000 +#define DDRAWI_EMULATIONINITIALIZED 0x00004000 +#define DDRAWI_HASGDIPALETTE_EXCLUSIVE 0x00008000 +#define DDRAWI_MODEXILLEGAL 0x00010000 +#define DDRAWI_FLIPPEDTOGDI 0x00020000 +#define DDRAWI_NEEDSWIN16FORVRAMLOCK 0x00040000 +#define DDRAWI_PDEVICEVRAMBITCLEARED 0x00080000 +#define DDRAWI_STANDARDVGA 0x00100000 +#define DDRAWI_EXTENDEDALIGNMENT 0x00200000 +#define DDRAWI_CHANGINGMODE 0x00400000 +#define DDRAWI_GDIDRV 0x00800000 +#define DDRAWI_ATTACHEDTODESKTOP 0x01000000 +#define DDRAWI_UMODELOADED 0x02000000 +#define DDRAWI_DDRAWDATANOTFETCHED 0x04000000 +#define DDRAWI_SECONDARYDRIVERLOADED 0x08000000 +#define DDRAWI_TESTINGMODES 0x10000000 +#define DDRAWI_DRIVERINFO2 0x20000000 +#define DDRAWI_BADPDEV 0x40000000 + + +/* surfaces */ +typedef struct _DDRAWI_DDRAWSURFACE_INT { + LPVOID lpVtbl; + LPDDRAWI_DDRAWSURFACE_LCL lpLcl; + LPDDRAWI_DDRAWSURFACE_INT lpLink; + DWORD dwIntRefCnt; +} DDRAWI_DDRAWSURFACE_INT; + +typedef struct _DDRAWI_DDRAWSURFACE_GBL { + DWORD dwRefCnt; + DWORD dwGlobalFlags; + union { + LPACCESSRECTLIST lpRectList; + DWORD dwBlockSizeY; + LONG lSlicePitch; + }; + union { + LPVMEMHEAP lpVidMemHeap; + DWORD dwBlockSizeX; + }; + union { + LPDDRAWI_DIRECTDRAW_GBL lpDD; + LPVOID lpDDHandle; + }; + FLATPTR fpVidMem; + union { + LONG lPitch; + DWORD dwLinearSize; + }; + WORD wHeight; + WORD wWidth; + DWORD dwUsageCount; + ULONG_PTR dwReserved1; + DDPIXELFORMAT ddpfSurface; +} DDRAWI_DDRAWSURFACE_GBL; + +#define DDRAWISURFGBL_MEMFREE 0x00000001L +#define DDRAWISURFGBL_SYSMEMREQUESTED 0x00000002L +#define DDRAWISURFGBL_ISGDISURFACE 0x00000004L +#define DDRAWISURFGBL_SOFTWAREAUTOFLIP 0x00000008L +#define DDRAWISURFGBL_LOCKNOTHOLDINGWIN16LOCK 0x00000010L +#define DDRAWISURFGBL_LOCKVRAMSTYLE 0x00000020L +#define DDRAWISURFGBL_LOCKBROKEN 0x00000040L +#define DDRAWISURFGBL_IMPLICITHANDLE 0x00000080L +#define DDRAWISURFGBL_ISCLIENTMEM 0x00000100L +#define DDRAWISURFGBL_HARDWAREOPSOURCE 0x00000200L +#define DDRAWISURFGBL_HARDWAREOPDEST 0x00000400L +#define DDRAWISURFGBL_HARDWAREOPSTARTED (DDRAWISURFGBL_HARDWAREOPSOURCE|DDRAWISURFGBL_HARDWAREOPDEST) +#define DDRAWISURFGBL_VPORTINTERLEAVED 0x00000800L +#define DDRAWISURFGBL_VPORTDATA 0x00001000L +#define DDRAWISURFGBL_LATEALLOCATELINEAR 0x00002000L +#define DDRAWISURFGBL_SYSMEMEXECUTEBUFFER 0x00004000L +#define DDRAWISURFGBL_FASTLOCKHELD 0x00008000L +#define DDRAWISURFGBL_READONLYLOCKHELD 0x00010000L +#define DDRAWISURFGBL_DX8SURFACE 0x00080000L +#define DDRAWISURFGBL_DDHELDONTFREE 0x00100000L +#define DDRAWISURFGBL_NOTIFYWHENUNLOCKED 0x00200000L +#define DDRAWISURFGBL_RESERVED0 0x80000000L // Reserved flag + +typedef struct _DDRAWI_DDRAWSURFACE_GBL_MORE { + DWORD dwSize; + union { + DWORD dwPhysicalPageTable; + FLATPTR fpPhysicalVidMem; + }; + LPDWORD pPageTable; + DWORD cPages; + ULONG_PTR dwSavedDCContext; + FLATPTR fpAliasedVidMem; + ULONG_PTR dwDriverReserved; + ULONG_PTR dwHELReserved; + DWORD cPageUnlocks; + ULONG_PTR hKernelSurface; + DWORD dwKernelRefCnt; + LPDDCOLORCONTROL lpColorInfo; + FLATPTR fpNTAlias; + DWORD dwContentsStamp; + LPVOID lpvUnswappedDriverReserved; + LPVOID lpDDRAWReserved2; + DWORD dwDDRAWReserved1; + DWORD dwDDRAWReserved2; + FLATPTR fpAliasOfVidMem; +} DDRAWI_DDRAWSURFACE_GBL_MORE; + +/* the MS version of this macro was somewhat obfuscated and unreadable + * (possibly because of mediocre MS coders)... so I simplified it... + * (and so I commit no copyright violations either, hah) */ +#define GET_LPDDRAWSURFACE_GBL_MORE(psurf_gbl) \ + (*(((LPDDRAWI_DDRAWSURFACE_GBL_MORE *)(psurf_gbl)) - 1)) + +#define SURFACE_PHYSICALVIDMEM( psurf_gbl ) \ + ( GET_LPDDRAWSURFACE_GBL_MORE(psurf_gbl )->fpPhysicalVidMem ) + + +typedef struct _DISPLAYMODEINFO +{ + WORD wWidth; + WORD wHeight; + BYTE wBPP; + BYTE wMonitorsAttachedToDesktop; + WORD wRefreshRate; +} DISPLAYMODEINFO, *LPDISPLAYMODEINFO; + +#define EQUAL_DISPLAYMODE ( A, B ) (0 == memcmp(&(A), &(B), sizeof (DISPLAYMODEINFO))) + + + + +typedef struct _DDRAWI_DDRAWSURFACE_MORE { + DWORD dwSize; + IUNKNOWN_LIST * lpIUnknowns; + LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl; + DWORD dwPageLockCount; + DWORD dwBytesAllocated; + LPDDRAWI_DIRECTDRAW_INT lpDD_int; + DWORD dwMipMapCount; + LPDDRAWI_DDRAWCLIPPER_INT lpDDIClipper; + /* DirectX 5.0 */ + LPHEAPALIASINFO lpHeapAliasInfo; + DWORD dwOverlayFlags; + VOID *rgjunc; + LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; + LPDDOVERLAYFX lpddOverlayFX; + DDSCAPSEX ddsCapsEx; + DWORD dwTextureStage; + LPVOID lpDDRAWReserved; + LPVOID lpDDRAWReserved2; + LPVOID lpDDrawReserved3; + DWORD dwDDrawReserved4; + LPVOID lpDDrawReserved5; + LPDWORD lpGammaRamp; + LPDWORD lpOriginalGammaRamp; + LPVOID lpDDrawReserved6; + #ifndef WIN95 + DISPLAYMODEINFO dmiDDrawReserved7; + #endif + DWORD dwSurfaceHandle; + DWORD qwDDrawReserved8[2]; + LPVOID lpDDrawReserved9; + DWORD cSurfaces; + LPDDSURFACEDESC2 pCreatedDDSurfaceDesc2; + LPDDRAWI_DDRAWSURFACE_LCL *slist; + DWORD dwFVF; + LPVOID lpVB; +} DDRAWI_DDRAWSURFACE_MORE; + + + +typedef struct _DDRAWI_DDRAWSURFACE_LCL { + LPDDRAWI_DDRAWSURFACE_MORE lpSurfMore; + LPDDRAWI_DDRAWSURFACE_GBL lpGbl; + ULONG_PTR hDDSurface; + LPATTACHLIST lpAttachList; + LPATTACHLIST lpAttachListFrom; + DWORD dwLocalRefCnt; + DWORD dwProcessId; + DWORD dwFlags; + DDSCAPS ddsCaps; + union + { + LPDDRAWI_DDRAWPALETTE_INT lpDDPalette; + LPDDRAWI_DDRAWPALETTE_INT lp16DDPalette; + }; + union + { + LPDDRAWI_DDRAWCLIPPER_LCL lpDDClipper; + LPDDRAWI_DDRAWCLIPPER_INT lp16DDClipper; + }; + DWORD dwModeCreatedIn; + DWORD dwBackBufferCount; + DDCOLORKEY ddckCKDestBlt; + DDCOLORKEY ddckCKSrcBlt; + ULONG_PTR hDC; + ULONG_PTR dwReserved1; + DDCOLORKEY ddckCKSrcOverlay; + DDCOLORKEY ddckCKDestOverlay; + LPDDRAWI_DDRAWSURFACE_INT lpSurfaceOverlaying; + DBLNODE dbnOverlayNode; + RECT rcOverlaySrc; + RECT rcOverlayDest; + DWORD dwClrXparent; + DWORD dwAlpha; + LONG lOverlayX; + LONG lOverlayY; +} DDRAWI_DDRAWSURFACE_LCL; + +#define DDRAWISURF_ATTACHED 0x00000001L +#define DDRAWISURF_IMPLICITCREATE 0x00000002L +#define DDRAWISURF_ISFREE 0x00000004L +#define DDRAWISURF_ATTACHED_FROM 0x00000008L +#define DDRAWISURF_IMPLICITROOT 0x00000010L +#define DDRAWISURF_PARTOFPRIMARYCHAIN 0x00000020L +#define DDRAWISURF_DATAISALIASED 0x00000040L +#define DDRAWISURF_HASDC 0x00000080L +#define DDRAWISURF_HASCKEYDESTOVERLAY 0x00000100L +#define DDRAWISURF_HASCKEYDESTBLT 0x00000200L +#define DDRAWISURF_HASCKEYSRCOVERLAY 0x00000400L +#define DDRAWISURF_HASCKEYSRCBLT 0x00000800L +#define DDRAWISURF_LOCKEXCLUDEDCURSOR 0x00001000L +#define DDRAWISURF_HASPIXELFORMAT 0x00002000L +#define DDRAWISURF_HASOVERLAYDATA 0x00004000L +#define DDRAWISURF_SETGAMMA 0x00008000L +#define DDRAWISURF_SW_CKEYDESTOVERLAY 0x00010000L +#define DDRAWISURF_SW_CKEYDESTBLT 0x00020000L +#define DDRAWISURF_SW_CKEYSRCOVERLAY 0x00040000L +#define DDRAWISURF_SW_CKEYSRCBLT 0x00080000L +#define DDRAWISURF_HW_CKEYDESTOVERLAY 0x00100000L +#define DDRAWISURF_HW_CKEYDESTBLT 0x00200000L +#define DDRAWISURF_HW_CKEYSRCOVERLAY 0x00400000L +#define DDRAWISURF_HW_CKEYSRCBLT 0x00800000L +#define DDRAWISURF_INMASTERSPRITELIST 0x01000000L +#define DDRAWISURF_HELCB 0x02000000L +#define DDRAWISURF_FRONTBUFFER 0x04000000L +#define DDRAWISURF_BACKBUFFER 0x08000000L +#define DDRAWISURF_INVALID 0x10000000L +#define DDRAWISURF_DCIBUSY 0x20000000L +#define DDRAWISURF_GETDCNULL 0x40000000L +#define DDRAWISURF_STEREOSURFACELEFT 0x20000000L +#define DDRAWISURF_DRIVERMANAGED 0x40000000L +#define DDRAWISURF_DCILOCK 0x80000000L + +/* palettes */ +typedef struct _DDRAWI_DDRAWPALETTE_INT { + LPVOID lpVtbl; + LPDDRAWI_DDRAWPALETTE_LCL lpLcl; + LPDDRAWI_DDRAWPALETTE_INT lpLink; + DWORD dwIntRefCnt; +} DDRAWI_DDRAWPALETTE_INT; + +typedef struct _DDRAWI_DDRAWPALETTE_GBL { + DWORD dwRefCnt; + DWORD dwFlags; + LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl; + DWORD dwProcessId; + LPPALETTEENTRY lpColorTable; + union { + ULONG_PTR dwReserved1; + HPALETTE hHELGDIPalette; + }; + DWORD dwDriverReserved; + DWORD dwContentsStamp; + DWORD dwSaveStamp; + DWORD dwHandle; +} DDRAWI_DDRAWPALETTE_GBL; + +#define DDRAWIPAL_256 0x00000001 +#define DDRAWIPAL_16 0x00000002 +#define DDRAWIPAL_GDI 0x00000004 +#define DDRAWIPAL_STORED_8 0x00000008 +#define DDRAWIPAL_STORED_16 0x00000010 +#define DDRAWIPAL_STORED_24 0x00000020 +#define DDRAWIPAL_EXCLUSIVE 0x00000040 +#define DDRAWIPAL_INHEL 0x00000080 +#define DDRAWIPAL_DIRTY 0x00000100 +#define DDRAWIPAL_ALLOW256 0x00000200 +#define DDRAWIPAL_4 0x00000400 +#define DDRAWIPAL_2 0x00000800 +#define DDRAWIPAL_STORED_8INDEX 0x00001000 +#define DDRAWIPAL_ALPHA 0x00002000 + +#define D3DFORMAT_OP_TEXTURE 0x00000001L +#define D3DFORMAT_OP_VOLUMETEXTURE 0x00000002L +#define D3DFORMAT_OP_CUBETEXTURE 0x00000004L +#define D3DFORMAT_OP_OFFSCREEN_RENDERTARGET 0x00000008L +#define D3DFORMAT_OP_SAME_FORMAT_RENDERTARGET 0x00000010L +#define D3DFORMAT_OP_ZSTENCIL 0x00000040L +#define D3DFORMAT_OP_ZSTENCIL_WITH_ARBITRARY_COLOR_DEPTH 0x00000080L +#define D3DFORMAT_OP_SAME_FORMAT_UP_TO_ALPHA_RENDERTARGET 0x00000100L +#define D3DFORMAT_OP_DISPLAYMODE 0x00000400L +#define D3DFORMAT_OP_3DACCELERATION 0x00000800L +#define D3DFORMAT_OP_PIXELSIZE 0x00001000L +#define D3DFORMAT_OP_CONVERT_TO_ARGB 0x00002000L +#define D3DFORMAT_OP_OFFSCREENPLAIN 0x00004000L +#define D3DFORMAT_OP_SRGBREAD 0x00008000L +#define D3DFORMAT_OP_BUMPMAP 0x00010000L +#define D3DFORMAT_OP_NOFILTER 0x00040000L +#define DDPF_D3DFORMAT 0x00200000l +#define DDPF_NOVEL_TEXTURE_FORMAT 0x00100000l +#define D3DFORMAT_MEMBEROFGROUP_ARGB 0x00080000L +#define D3DFORMAT_OP_SRGBWRITE 0x00100000L +#define D3DFORMAT_OP_NOALPHABLEND 0x00200000L +#define D3DFORMAT_OP_AUTOGENMIPMAP 0x00400000L +#define D3DFORMAT_OP_VERTEXTEXTURE 0x00800000L +#define D3DFORMAT_OP_NOTEXCOORDWRAPNORMIP 0x01000000L +#define DELETED_OK 0 +#define DELETED_LASTONE 1 +#define DELETED_NOTFOUND 2 +#define DDCALLBACKSSIZE_V1 ( offsetof( DDHAL_DDCALLBACKS, SetExclusiveMode ) ) +#define DDCALLBACKSSIZE sizeof( DDHAL_DDCALLBACKS ) +#define DDRAWICLIP_WATCHWINDOW 0x00000001 +#define DDRAWICLIP_ISINITIALIZED 0x00000002 +#define DDRAWICLIP_INMASTERSPRITELIST 0x00000004 +#define PFINDEX_UNINITIALIZED (0UL) +#define PFINDEX_UNSUPPORTED (~0UL) +#define ROP_HAS_SOURCE 0x00000001 +#define ROP_HAS_PATTERN 0x00000002 +#define ROP_HAS_SOURCEPATTERN ROP_HAS_PATTERN | ROP_HAS_SOURCE +#define DDRAWIVPORT_ON 0x00000001 +#define DDRAWIVPORT_SOFTWARE_AUTOFLIP 0x00000002 +#define DDRAWIVPORT_COLORKEYANDINTERP 0x00000004 +#define DDRAWIVPORT_NOKERNELHANDLES 0x00000008 +#define DDRAWIVPORT_SOFTWARE_BOB 0x00000010 +#define DDRAWIVPORT_VBION 0x00000020 +#define DDRAWIVPORT_VIDEOON 0x00000040 +#define DDRAWI_GETCOLOR 0x0001 +#define DDRAWI_SETCOLOR 0x0002 +#define DDMCQUERY_READ 0x00000001 +#define DDWAITVB_I_TESTVB 0x80000006 + + +#define DDBLT_ANYALPHA \ + (DDBLT_ALPHASRCSURFACEOVERRIDE | DDBLT_ALPHASRCCONSTOVERRIDE | \ + DDBLT_ALPHASRC | DDBLT_ALPHADESTSURFACEOVERRIDE | \ + DDBLT_ALPHADESTCONSTOVERRIDE | DDBLT_ALPHADEST) + +#define DDHAL_ALIGNVALIDCAPS (DDSCAPS_OFFSCREENPLAIN | DDSCAPS_EXECUTEBUFFER | \ + DDSCAPS_OVERLAY | DDSCAPS_TEXTURE | \ + DDSCAPS_ZBUFFER | DDSCAPS_ALPHA | DDSCAPS_FLIP ) + + +#define DDHALINFOSIZE_V2 sizeof(DDHALINFO) + +#define DDOVER_ANYALPHA \ + (DDOVER_ALPHASRCSURFACEOVERRIDE | DDOVER_ALPHASRCCONSTOVERRIDE | \ + DDOVER_ALPHASRC | DDOVER_ALPHADESTSURFACEOVERRIDE | \ + DDOVER_ALPHADESTCONSTOVERRIDE | DDOVER_ALPHADEST) + + +typedef struct _DDRAWI_DDRAWPALETTE_LCL { + DWORD lpPalMore; + LPDDRAWI_DDRAWPALETTE_GBL lpGbl; + ULONG_PTR dwUnused0; + DWORD dwLocalRefCnt; +#ifndef _NO_COM + IUnknown * pUnkOuter; +#else + PVOID pUnkOuter; +#endif + LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl; + ULONG_PTR dwReserved1; + /* DirectX 6.0 */ + ULONG_PTR dwDDRAWReserved1; + ULONG_PTR dwDDRAWReserved2; + ULONG_PTR dwDDRAWReserved3; +} DDRAWI_DDRAWPALETTE_LCL; + + +typedef struct _DDMCCOMPBUFFERINFO +{ + DWORD dwSize; + DWORD dwNumCompBuffers; + DWORD dwWidthToCreate; + DWORD dwHeightToCreate; + DWORD dwBytesToAllocate; + DDSCAPS2 ddCompCaps; + DDPIXELFORMAT ddPixelFormat; +} DDMCCOMPBUFFERINFO, *LPDDMCCOMPBUFFERINFO; + +typedef struct _DDMCBUFFERINFO +{ + DWORD dwSize; + LPDDRAWI_DDRAWSURFACE_LCL lpCompSurface; + DWORD dwDataOffset; + DWORD dwDataSize; + LPVOID lpPrivate; +} DDMCBUFFERINFO, *LPDDMCBUFFERINFO; + +typedef struct _DDHAL_GETDRIVERSTATEDATA { + DWORD dwFlags; + union + { + ULONG_PTR dwhContext; + }; + LPDWORD lpdwStates; + DWORD dwLength; + HRESULT ddRVal; +} DDHAL_GETDRIVERSTATEDATA; + +typedef struct _DDHAL_ADDATTACHEDSURFACEDATA +{ + LPDDRAWI_DIRECTDRAW_GBL lpDD; + LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface; + LPDDRAWI_DDRAWSURFACE_LCL lpSurfAttached; + HRESULT ddRVal; + LPDDHALSURFCB_ADDATTACHEDSURFACE AddAttachedSurface; +} DDHAL_ADDATTACHEDSURFACEDATA; + + + +typedef struct _DDHAL_BEGINMOCOMPFRAMEDATA +{ + LPDDRAWI_DIRECTDRAW_LCL lpDD; + LPDDRAWI_DDMOTIONCOMP_LCL lpMoComp; + LPDDRAWI_DDRAWSURFACE_LCL lpDestSurface; + DWORD dwInputDataSize; + LPVOID lpInputData; + DWORD dwOutputDataSize; + LPVOID lpOutputData; + HRESULT ddRVal; + LPDDHALMOCOMPCB_BEGINFRAME BeginMoCompFrame; +} DDHAL_BEGINMOCOMPFRAMEDATA; + +typedef struct _DDHAL_COLORCONTROLDATA +{ + LPDDRAWI_DIRECTDRAW_GBL lpDD; + LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface; + LPDDCOLORCONTROL lpColorData; + DWORD dwFlags; + HRESULT ddRVal; + LPDDHALCOLORCB_COLORCONTROL ColorControl; +} DDHAL_COLORCONTROLDATA; + +typedef struct _DDHAL_CREATEMOCOMPDATA +{ + LPDDRAWI_DIRECTDRAW_LCL lpDD; + LPDDRAWI_DDMOTIONCOMP_LCL lpMoComp; + LPGUID lpGuid; + DWORD dwUncompWidth; + DWORD dwUncompHeight; + DDPIXELFORMAT ddUncompPixelFormat; + LPVOID lpData; + DWORD dwDataSize; + HRESULT ddRVal; + LPDDHALMOCOMPCB_CREATE CreateMoComp; +} DDHAL_CREATEMOCOMPDATA; + +typedef struct _DDHAL_DESTROYMOCOMPDATA +{ + LPDDRAWI_DIRECTDRAW_LCL lpDD; + LPDDRAWI_DDMOTIONCOMP_LCL lpMoComp; + HRESULT ddRVal; + LPDDHALMOCOMPCB_DESTROY DestroyMoComp; +} DDHAL_DESTROYMOCOMPDATA; + +typedef struct _DDHAL_ENDMOCOMPFRAMEDATA +{ + LPDDRAWI_DIRECTDRAW_LCL lpDD; + LPDDRAWI_DDMOTIONCOMP_LCL lpMoComp; + LPVOID lpInputData; + DWORD dwInputDataSize; + HRESULT ddRVal; + LPDDHALMOCOMPCB_ENDFRAME EndMoCompFrame; +} DDHAL_ENDMOCOMPFRAMEDATA; + +typedef struct _DDHAL_FLIPTOGDISURFACEDATA +{ + LPDDRAWI_DIRECTDRAW_GBL lpDD; + DWORD dwToGDI; + DWORD dwReserved; + HRESULT ddRVal; + LPDDHAL_FLIPTOGDISURFACE FlipToGDISurface; +} DDHAL_FLIPTOGDISURFACEDATA; + +typedef struct _DDHAL_GETAVAILDRIVERMEMORYDATA +{ + LPDDRAWI_DIRECTDRAW_GBL lpDD; + DDSCAPS DDSCaps; + DWORD dwTotal; + DWORD dwFree; + HRESULT ddRVal; + LPDDHAL_GETAVAILDRIVERMEMORY GetAvailDriverMemory; + DDSCAPSEX ddsCapsEx; + +} DDHAL_GETAVAILDRIVERMEMORYDATA; + +typedef struct _DDHAL_GETBLTSTATUSDATA +{ + LPDDRAWI_DIRECTDRAW_GBL lpDD; + LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface; + DWORD dwFlags; + HRESULT ddRVal; + LPDDHALSURFCB_GETBLTSTATUS GetBltStatus; +} DDHAL_GETBLTSTATUSDATA; + +typedef struct _DDHAL_GETFLIPSTATUSDATA +{ + LPDDRAWI_DIRECTDRAW_GBL lpDD; + LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface; + DWORD dwFlags; + HRESULT ddRVal; + LPDDHALSURFCB_GETFLIPSTATUS GetFlipStatus; +} DDHAL_GETFLIPSTATUSDATA; + +typedef struct _DDHAL_GETINTERNALMOCOMPDATA +{ + LPDDRAWI_DIRECTDRAW_LCL lpDD; + LPGUID lpGuid; + DWORD dwWidth; + DWORD dwHeight; + DDPIXELFORMAT ddPixelFormat; + DWORD dwScratchMemAlloc; + HRESULT ddRVal; + LPDDHALMOCOMPCB_GETINTERNALINFO GetInternalMoCompInfo; +} DDHAL_GETINTERNALMOCOMPDATA; + +typedef struct _DDHAL_GETMOCOMPCOMPBUFFDATA +{ + LPDDRAWI_DIRECTDRAW_LCL lpDD; + LPGUID lpGuid; + DWORD dwWidth; + DWORD dwHeight; + DDPIXELFORMAT ddPixelFormat; + DWORD dwNumTypesCompBuffs; + LPDDMCCOMPBUFFERINFO lpCompBuffInfo; + HRESULT ddRVal; + LPDDHALMOCOMPCB_GETCOMPBUFFINFO GetMoCompBuffInfo; +} DDHAL_GETMOCOMPCOMPBUFFDATA; + +typedef struct _DDHAL_GETMOCOMPGUIDSDATA +{ + LPDDRAWI_DIRECTDRAW_LCL lpDD; + DWORD dwNumGuids; + LPGUID lpGuids; + HRESULT ddRVal; + LPDDHALMOCOMPCB_GETGUIDS GetMoCompGuids; +} DDHAL_GETMOCOMPGUIDSDATA; + +typedef struct _DDHAL_GETMOCOMPFORMATSDATA +{ + LPDDRAWI_DIRECTDRAW_LCL lpDD; + LPGUID lpGuid; + DWORD dwNumFormats; + LPDDPIXELFORMAT lpFormats; + HRESULT ddRVal; + LPDDHALMOCOMPCB_GETFORMATS GetMoCompFormats; +} DDHAL_GETMOCOMPFORMATSDATA; + +typedef struct _DDHAL_GETSCANLINEDATA +{ + LPDDRAWI_DIRECTDRAW_GBL lpDD; + DWORD dwScanLine; + HRESULT ddRVal; + LPDDHAL_GETSCANLINE GetScanLine; +} DDHAL_GETSCANLINEDATA; + +typedef struct _DDHAL_QUERYMOCOMPSTATUSDATA +{ + LPDDRAWI_DIRECTDRAW_LCL lpDD; + LPDDRAWI_DDMOTIONCOMP_LCL lpMoComp; + LPDDRAWI_DDRAWSURFACE_LCL lpSurface; + DWORD dwFlags; + HRESULT ddRVal; + LPDDHALMOCOMPCB_QUERYSTATUS QueryMoCompStatus; +} DDHAL_QUERYMOCOMPSTATUSDATA; + +typedef struct _DDHAL_RENDERMOCOMPDATA +{ + LPDDRAWI_DIRECTDRAW_LCL lpDD; + LPDDRAWI_DDMOTIONCOMP_LCL lpMoComp; + DWORD dwNumBuffers; + LPDDMCBUFFERINFO lpBufferInfo; + DWORD dwFunction; + LPVOID lpInputData; + DWORD dwInputDataSize; + LPVOID lpOutputData; + DWORD dwOutputDataSize; + HRESULT ddRVal; + LPDDHALMOCOMPCB_RENDER RenderMoComp; +} DDHAL_RENDERMOCOMPDATA; + +typedef struct _DDHAL_SETCOLORKEYDATA +{ + LPDDRAWI_DIRECTDRAW_GBL lpDD; + LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface; + DWORD dwFlags; + DDCOLORKEY ckNew; + HRESULT ddRVal; + LPDDHALSURFCB_SETCOLORKEY SetColorKey; +} DDHAL_SETCOLORKEYDATA; + +typedef struct _DDHAL_SETOVERLAYPOSITIONDATA +{ + LPDDRAWI_DIRECTDRAW_GBL lpDD; + LPDDRAWI_DDRAWSURFACE_LCL lpDDSrcSurface; + LPDDRAWI_DDRAWSURFACE_LCL lpDDDestSurface; + LONG lXPos; + LONG lYPos; + HRESULT ddRVal; + LPDDHALSURFCB_SETOVERLAYPOSITION SetOverlayPosition; +} DDHAL_SETOVERLAYPOSITIONDATA; + +typedef struct _DDHAL_UPDATEOVERLAYDATA +{ + LPDDRAWI_DIRECTDRAW_GBL lpDD; + LPDDRAWI_DDRAWSURFACE_LCL lpDDDestSurface; + RECTL rDest; + LPDDRAWI_DDRAWSURFACE_LCL lpDDSrcSurface; + RECTL rSrc; + DWORD dwFlags; + DDOVERLAYFX overlayFX; + HRESULT ddRVal; + LPDDHALSURFCB_UPDATEOVERLAY UpdateOverlay; +} DDHAL_UPDATEOVERLAYDATA; + +typedef struct _DDHAL_WAITFORVERTICALBLANKDATA +{ + LPDDRAWI_DIRECTDRAW_GBL lpDD; + DWORD dwFlags; + DWORD bIsInVB; + ULONG_PTR hEvent; + HRESULT ddRVal; + LPDDHAL_WAITFORVERTICALBLANK WaitForVerticalBlank; +} DDHAL_WAITFORVERTICALBLANKDATA; + +typedef struct _DDHAL_DRVSETCOLORKEYDATA +{ + LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface; + DWORD dwFlags; + DDCOLORKEY ckNew; + HRESULT ddRVal; + LPDDHAL_SETCOLORKEY SetColorKey; +} DDHAL_DRVSETCOLORKEYDATA; + +typedef struct _DDMONITORINFO +{ + WORD Manufacturer; + WORD Product; + DWORD SerialNumber; + GUID DeviceIdentifier; + int Mode640x480; + int Mode800x600; + int Mode1024x768; + int Mode1280x1024; + int Mode1600x1200; + int ModeReserved1; + int ModeReserved2; + int ModeReserved3; +} DDMONITORINFO, FAR *LPDDMONITORINFO; + +typedef struct _DDRAWI_DDRAWCLIPPER_INT +{ + LPVOID lpVtbl; + LPDDRAWI_DDRAWCLIPPER_LCL lpLcl; + LPDDRAWI_DDRAWCLIPPER_INT lpLink; + DWORD dwIntRefCnt; +} DDRAWI_DDRAWCLIPPER_INT; + +typedef struct _DDHAL_UPDATENONLOCALHEAPDATA +{ + LPDDRAWI_DIRECTDRAW_GBL lpDD; + DWORD dwHeap; + FLATPTR fpGARTLin; + FLATPTR fpGARTDev; + ULONG_PTR ulPolicyMaxBytes; + HRESULT ddRVal; + LPDDHAL_UPDATENONLOCALHEAP UpdateNonLocalHeap; +} DDHAL_UPDATENONLOCALHEAPDATA; + +typedef struct _DDHAL_SETCLIPLISTDATA +{ + LPDDRAWI_DIRECTDRAW_GBL lpDD; + LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface; + HRESULT ddRVal; + LPDDHALSURFCB_SETCLIPLIST SetClipList; +} DDHAL_SETCLIPLISTDATA; + +typedef struct _DDRAWI_DDMOTIONCOMP_LCL +{ + LPDDRAWI_DIRECTDRAW_LCL lpDD; + GUID guid; + DWORD dwUncompWidth; + DWORD dwUncompHeight; + DDPIXELFORMAT ddUncompPixelFormat; + DWORD dwInternalFlags; + DWORD dwRefCnt; + DWORD dwProcessId; + HANDLE hMoComp; + DWORD dwDriverReserved1; + DWORD dwDriverReserved2; + DWORD dwDriverReserved3; + LPVOID lpDriverReserved1; + LPVOID lpDriverReserved2; + LPVOID lpDriverReserved3; +} DDRAWI_DDMOTIONCOMP_LCL; + +typedef struct _DDRAWI_DDMOTIONCOMP_INT +{ + LPVOID lpVtbl; + LPDDRAWI_DDMOTIONCOMP_LCL lpLcl; + LPDDRAWI_DDMOTIONCOMP_INT lpLink; + DWORD dwIntRefCnt; +} DDRAWI_DDMOTIONCOMP_INT; + + +typedef struct _DDRAWI_DDVIDEOPORT_LCL +{ + LPDDRAWI_DIRECTDRAW_LCL lpDD; + DDVIDEOPORTDESC ddvpDesc; + DDVIDEOPORTINFO ddvpInfo; + LPDDRAWI_DDRAWSURFACE_INT lpSurface; + LPDDRAWI_DDRAWSURFACE_INT lpVBISurface; + LPDDRAWI_DDRAWSURFACE_INT *lpFlipInts; + DWORD dwNumAutoflip; + DWORD dwProcessID; + DWORD dwStateFlags; + DWORD dwFlags; + DWORD dwRefCnt; + FLATPTR fpLastFlip; + ULONG_PTR dwReserved1; + ULONG_PTR dwReserved2; + HANDLE hDDVideoPort; + DWORD dwNumVBIAutoflip; + LPDDVIDEOPORTDESC lpVBIDesc; + LPDDVIDEOPORTDESC lpVideoDesc; + LPDDVIDEOPORTINFO lpVBIInfo; + LPDDVIDEOPORTINFO lpVideoInfo; + DWORD dwVBIProcessID; + LPDDRAWI_DDVIDEOPORT_INT lpVPNotify; +} DDRAWI_DDVIDEOPORT_LCL; + + +typedef struct _DDRAWI_DDVIDEOPORT_INT +{ + LPVOID lpVtbl; + LPDDRAWI_DDVIDEOPORT_LCL lpLcl; + LPDDRAWI_DDVIDEOPORT_INT lpLink; + DWORD dwIntRefCnt; + DWORD dwFlags; +} DDRAWI_DDVIDEOPORT_INT; + + +typedef struct _DDRAWI_DDRAWCLIPPER_LCL +{ + DWORD lpClipMore; + LPDDRAWI_DDRAWCLIPPER_GBL lpGbl; + LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl; + DWORD dwLocalRefCnt; +#ifndef _NO_COM + IUnknown *pUnkOuter; +#else + PVOID *pUnkOuter; +#endif + LPDDRAWI_DIRECTDRAW_INT lpDD_int; + ULONG_PTR dwReserved1; +#ifndef _NO_COM + IUnknown * pAddrefedThisOwner; +#else + PVOID pAddrefedThisOwner; +#endif +} DDRAWI_DDRAWCLIPPER_LCL; + + + +typedef struct _DDRAWI_DDRAWCLIPPER_GBL +{ + DWORD dwRefCnt; + DWORD dwFlags; + LPDDRAWI_DIRECTDRAW_GBL lpDD; + DWORD dwProcessId; + ULONG_PTR dwReserved1; + ULONG_PTR hWnd; + LPRGNDATA lpStaticClipList; +} DDRAWI_DDRAWCLIPPER_GBL; + +typedef BOOL (PASCAL *LPDDHEL_INIT)(LPDDRAWI_DIRECTDRAW_GBL,BOOL); + +extern HRESULT DDAPI + LateAllocateSurfaceMem( + LPDIRECTDRAWSURFACE lpSurface, + DWORD dwPleaseAllocType, + DWORD dwWidthInBytesOrSize, + DWORD dwHeight); + + LPDIRECTDRAWSURFACE GetNextMipMap( + LPDIRECTDRAWSURFACE lpLevel); + + + +typedef struct IDirectDrawClipperVtbl DIRECTDRAWCLIPPERCALLBACKS; +typedef struct IDirectDrawPaletteVtbl DIRECTDRAWPALETTECALLBACKS; +typedef struct IDirectDrawSurfaceVtbl DIRECTDRAWSURFACECALLBACKS; +typedef struct IDirectDrawSurface2Vtbl DIRECTDRAWSURFACE2CALLBACKS; +typedef struct IDirectDrawSurface3Vtbl DIRECTDRAWSURFACE3CALLBACKS; +typedef struct IDirectDrawSurface4Vtbl DIRECTDRAWSURFACE4CALLBACKS; +typedef struct IDirectDrawSurface7Vtbl DIRECTDRAWSURFACE7CALLBACKS; +typedef struct IDirectDrawColorControlVtbl DIRECTDRAWCOLORCONTROLCALLBACKS; +typedef struct IDirectDrawVtbl DIRECTDRAWCALLBACKS; +typedef struct IDirectDraw2Vtbl DIRECTDRAW2CALLBACKS; +typedef struct IDirectDraw4Vtbl DIRECTDRAW4CALLBACKS; +typedef struct IDirectDraw7Vtbl DIRECTDRAW7CALLBACKS; +typedef struct IDirectDrawKernelVtbl DIRECTDRAWKERNELCALLBACKS; +typedef struct IDirectDrawSurfaceKernelVtbl DIRECTDRAWSURFACEKERNELCALLBACKS; +typedef struct IDirectDrawGammaControlVtbl DIRECTDRAWGAMMACONTROLCALLBACKS; + + +typedef DIRECTDRAWCLIPPERCALLBACKS FAR *LPDIRECTDRAWCLIPPERCALLBACKS; +typedef DIRECTDRAWPALETTECALLBACKS FAR *LPDIRECTDRAWPALETTECALLBACKS; +typedef DIRECTDRAWSURFACECALLBACKS FAR *LPDIRECTDRAWSURFACECALLBACKS; +typedef DIRECTDRAWCALLBACKS FAR *LPDIRECTDRAWCALLBACKS; + +HRESULT CALLBACK + D3DParseUnknownCommand (LPVOID lpvCommands, + LPVOID *lplpvReturnedCommand); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __DDRAWI_INCLUDED__ */ diff --git a/reactos/include/ddk/ddrawint.h b/reactos/include/ddk/ddrawint.h new file mode 100644 index 00000000000..c0048670ebc --- /dev/null +++ b/reactos/include/ddk/ddrawint.h @@ -0,0 +1,1461 @@ +/* + * DirectDraw NT driver interface + */ + +#ifndef __DD_INCLUDED__ +#define __DD_INCLUDED__ + +#ifndef _NO_DDRAWINT_NO_COM +#ifndef _NO_COM +#define _NO_COM +#include +#include /* FIXME: We shouldn't include this header. */ +#undef _NO_COM +#else +#include +#include /* FIXME: We shouldn't include this header. */ +#endif +#else +#include +#include /* FIXME: We shouldn't include this header. */ +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + +DEFINE_GUID( GUID_MiscellaneousCallbacks, 0xEFD60CC0, 0x49e7, 0x11d0, 0x88, 0x9d, 0x0, 0xaa, 0x0, 0xbb, 0xb7, 0x6a); +DEFINE_GUID( GUID_Miscellaneous2Callbacks, 0x406B2F00, 0x3E5A, 0x11D1, 0xB6, 0x40, 0x00, 0xAA, 0x00, 0xA1, 0xF9, 0x6A); +DEFINE_GUID( GUID_VideoPortCallbacks, 0xefd60cc1, 0x49e7, 0x11d0, 0x88, 0x9d, 0x0, 0xaa, 0x0, 0xbb, 0xb7, 0x6a); +DEFINE_GUID( GUID_ColorControlCallbacks, 0xefd60cc2, 0x49e7, 0x11d0, 0x88, 0x9d, 0x0, 0xaa, 0x0, 0xbb, 0xb7, 0x6a); +DEFINE_GUID( GUID_MotionCompCallbacks, 0xb1122b40, 0x5dA5, 0x11d1, 0x8f, 0xcF, 0x00, 0xc0, 0x4f, 0xc2, 0x9b, 0x4e); +DEFINE_GUID( GUID_VideoPortCaps, 0xefd60cc3, 0x49e7, 0x11d0, 0x88, 0x9d, 0x0, 0xaa, 0x0, 0xbb, 0xb7, 0x6a); +DEFINE_GUID( GUID_D3DCaps, 0x7bf06991, 0x8794, 0x11d0, 0x91, 0x39, 0x08, 0x00, 0x36, 0xd2, 0xef, 0x02); +DEFINE_GUID( GUID_D3DExtendedCaps, 0x7de41f80, 0x9d93, 0x11d0, 0x89, 0xab, 0x00, 0xa0, 0xc9, 0x05, 0x41, 0x29); +DEFINE_GUID( GUID_D3DCallbacks, 0x7bf06990, 0x8794, 0x11d0, 0x91, 0x39, 0x08, 0x00, 0x36, 0xd2, 0xef, 0x02); +DEFINE_GUID( GUID_D3DCallbacks2, 0xba584e1, 0x70b6, 0x11d0, 0x88, 0x9d, 0x0, 0xaa, 0x0, 0xbb, 0xb7, 0x6a); +DEFINE_GUID( GUID_D3DCallbacks3, 0xddf41230, 0xec0a, 0x11d0, 0xa9, 0xb6, 0x00, 0xaa, 0x00, 0xc0, 0x99, 0x3e); +DEFINE_GUID( GUID_NonLocalVidMemCaps, 0x86c4fa80, 0x8d84, 0x11d0, 0x94, 0xe8, 0x00, 0xc0, 0x4f, 0xc3, 0x41, 0x37); +DEFINE_GUID( GUID_KernelCallbacks, 0x80863800, 0x6B06, 0x11D0, 0x9B, 0x06, 0x0, 0xA0, 0xC9, 0x03, 0xA3, 0xB8); +DEFINE_GUID( GUID_KernelCaps, 0xFFAA7540, 0x7AA8, 0x11D0, 0x9B, 0x06, 0x00, 0xA0, 0xC9, 0x03, 0xA3, 0xB8); +DEFINE_GUID( GUID_ZPixelFormats, 0x93869880, 0x36cf, 0x11d1, 0x9b, 0x1b, 0x0, 0xaa, 0x0, 0xbb, 0xb8, 0xae); +DEFINE_GUID( GUID_DDMoreCaps, 0x880baf30, 0xb030, 0x11d0, 0x8e, 0xa7, 0x00, 0x60, 0x97, 0x97, 0xea, 0x5b); +DEFINE_GUID( GUID_D3DParseUnknownCommandCallback, 0x2e04ffa0, 0x98e4, 0x11d1, 0x8c, 0xe1, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8); +DEFINE_GUID( GUID_NTCallbacks, 0x6fe9ecde, 0xdf89, 0x11d1, 0x9d, 0xb0, 0x00, 0x60, 0x08, 0x27, 0x71, 0xba); +DEFINE_GUID( GUID_DDMoreSurfaceCaps, 0x3b8a0466, 0xf269, 0x11d1, 0x88, 0x0b, 0x0, 0xc0, 0x4f, 0xd9, 0x30, 0xc5); +DEFINE_GUID( GUID_GetHeapAlignment, 0x42e02f16, 0x7b41, 0x11d2, 0x8b, 0xff, 0x0, 0xa0, 0xc9, 0x83, 0xea, 0xf6); +DEFINE_GUID( GUID_UpdateNonLocalHeap, 0x42e02f17, 0x7b41, 0x11d2, 0x8b, 0xff, 0x0, 0xa0, 0xc9, 0x83, 0xea, 0xf6); +DEFINE_GUID( GUID_NTPrivateDriverCaps, 0xfad16a23, 0x7b66, 0x11d2, 0x83, 0xd7, 0x0, 0xc0, 0x4f, 0x7c, 0xe5, 0x8c); +DEFINE_GUID( GUID_DDStereoMode, 0xf828169c, 0xa8e8, 0x11d2, 0xa1, 0xf2, 0x0, 0xa0, 0xc9, 0x83, 0xea, 0xf6); +DEFINE_GUID( GUID_VPE2Callbacks, 0x52882147, 0x2d47, 0x469a, 0xa0, 0xd1, 0x3, 0x45, 0x58, 0x90, 0xf6, 0xc8); + + + +typedef struct _DD_VIDEOPORT_LOCAL *PDD_VIDEOPORT_LOCAL; + +/************************************************************************/ +/* _DD_GETHEAPALIGNMENTDATA is defined in dmemmgr.h */ + /************************************************************************/ +struct _DD_GETHEAPALIGNMENTDATA; +typedef struct _DD_GETHEAPALIGNMENTDATA *PDD_GETHEAPALIGNMENTDATA; + +/************************************************************************/ +/* Video memory info structures */ +/************************************************************************/ + + +typedef ULONG_PTR FLATPTR; + +typedef struct _VIDEOMEMORY +{ + DWORD dwFlags; + FLATPTR fpStart; + union + { + FLATPTR fpEnd; + DWORD dwWidth; + }; + DDSCAPS ddsCaps; + DDSCAPS ddsCapsAlt; + union + { + LPVMEMHEAP lpHeap; + DWORD dwHeight; + }; +} VIDEOMEMORY, *PVIDEOMEMORY; + +typedef struct _VIDEOMEMORYINFO +{ + FLATPTR fpPrimary; + DWORD dwFlags; + DWORD dwDisplayWidth; + DWORD dwDisplayHeight; + LONG lDisplayPitch; + DDPIXELFORMAT ddpfDisplay; + DWORD dwOffscreenAlign; + DWORD dwOverlayAlign; + DWORD dwTextureAlign; + DWORD dwZBufferAlign; + DWORD dwAlphaAlign; + PVOID pvPrimary; +} VIDEOMEMORYINFO; +typedef VIDEOMEMORYINFO *LPVIDEOMEMORYINFO; + +/************************************************************************/ +/* DDI representation of the DirectDraw object */ +/************************************************************************/ + +typedef struct _DD_DIRECTDRAW_GLOBAL +{ + PVOID dhpdev; + ULONG_PTR dwReserved1; + ULONG_PTR dwReserved2; + LPDDVIDEOPORTCAPS lpDDVideoPortCaps; +} DD_DIRECTDRAW_GLOBAL, *PDD_DIRECTDRAW_GLOBAL; + +typedef struct _DD_DIRECTDRAW_LOCAL +{ + PDD_DIRECTDRAW_GLOBAL lpGbl; +} DD_DIRECTDRAW_LOCAL, *PDD_DIRECTDRAW_LOCAL; + +/************************************************************************/ +/* DDI representation of the DirectDrawSurface object */ +/************************************************************************/ + +typedef struct _DD_SURFACE_GLOBAL +{ + union + { + DWORD dwBlockSizeY; + LONG lSlicePitch; + }; + + union + { + PVIDEOMEMORY lpVidMemHeap; + DWORD dwBlockSizeX; + DWORD dwUserMemSize; + }; + + FLATPTR fpVidMem; + union + { + LONG lPitch; + DWORD dwLinearSize; + }; + LONG yHint; + LONG xHint; + DWORD wHeight; + DWORD wWidth; + ULONG_PTR dwReserved1; + DDPIXELFORMAT ddpfSurface; + FLATPTR fpHeapOffset; + HANDLE hCreatorProcess; +} DD_SURFACE_GLOBAL, *PDD_SURFACE_GLOBAL; + +typedef struct _DD_SURFACE_MORE +{ + DWORD dwMipMapCount; + PDD_VIDEOPORT_LOCAL lpVideoPort; + DWORD dwOverlayFlags; + DDSCAPSEX ddsCapsEx; + DWORD dwSurfaceHandle; +} DD_SURFACE_MORE, *PDD_SURFACE_MORE; + +typedef struct _DD_ATTACHLIST *PDD_ATTACHLIST; + +typedef struct _DD_SURFACE_LOCAL +{ + PDD_SURFACE_GLOBAL lpGbl; + DWORD dwFlags; + DDSCAPS ddsCaps; + ULONG_PTR dwReserved1; + union + { + DDCOLORKEY ddckCKSrcOverlay; + DDCOLORKEY ddckCKSrcBlt; + }; + union + { + DDCOLORKEY ddckCKDestOverlay; + DDCOLORKEY ddckCKDestBlt; + }; + PDD_SURFACE_MORE lpSurfMore; + PDD_ATTACHLIST lpAttachList; + PDD_ATTACHLIST lpAttachListFrom; + RECT rcOverlaySrc; +} DD_SURFACE_LOCAL, *PDD_SURFACE_LOCAL; + +typedef struct _DD_ATTACHLIST +{ + PDD_ATTACHLIST lpLink; + PDD_SURFACE_LOCAL lpAttached; +} DD_ATTACHLIST; + +typedef struct _DD_SURFACE_INT +{ + PDD_SURFACE_LOCAL lpLcl; +} DD_SURFACE_INT, *PDD_SURFACE_INT; + +/************************************************************************/ +/* DDI representation of the DirectDrawPalette object */ +/************************************************************************/ + +typedef struct _DD_PALETTE_GLOBAL +{ + ULONG_PTR Reserved1; +} DD_PALETTE_GLOBAL, *PDD_PALETTE_GLOBAL; + +/************************************************************************/ +/* DDI representation of the DirectDrawVideo object */ +/************************************************************************/ + +typedef struct +{ + PDD_DIRECTDRAW_LOCAL lpDD; + GUID guid; + DWORD dwUncompWidth; + DWORD dwUncompHeight; + DDPIXELFORMAT ddUncompPixelFormat; + DWORD dwDriverReserved1; + DWORD dwDriverReserved2; + DWORD dwDriverReserved3; + LPVOID lpDriverReserved1; + LPVOID lpDriverReserved2; + LPVOID lpDriverReserved3; +} DD_MOTIONCOMP_LOCAL, *PDD_MOTIONCOMP_LOCAL; + + +typedef struct _DD_VIDEOPORT_LOCAL +{ + PDD_DIRECTDRAW_LOCAL lpDD; + DDVIDEOPORTDESC ddvpDesc; + DDVIDEOPORTINFO ddvpInfo; + PDD_SURFACE_INT lpSurface; + PDD_SURFACE_INT lpVBISurface; + DWORD dwNumAutoflip; + DWORD dwNumVBIAutoflip; + ULONG_PTR dwReserved1; + ULONG_PTR dwReserved2; + ULONG_PTR dwReserved3; +} DD_VIDEOPORT_LOCAL ; + +/************************************************************************/ +/* IDirectDrawSurface callbacks */ +/************************************************************************/ + +typedef struct _DD_LOCKDATA +{ + PDD_DIRECTDRAW_GLOBAL lpDD; + PDD_SURFACE_LOCAL lpDDSurface; + DWORD bHasRect; + RECTL rArea; + LPVOID lpSurfData; + HRESULT ddRVal; + PVOID Lock; + DWORD dwFlags; + FLATPTR fpProcess; +} DD_LOCKDATA, *PDD_LOCKDATA; +typedef DWORD (STDCALL *PDD_SURFCB_LOCK)(PDD_LOCKDATA); + + +typedef struct _DD_UNLOCKDATA +{ + PDD_DIRECTDRAW_GLOBAL lpDD; + PDD_SURFACE_LOCAL lpDDSurface; + HRESULT ddRVal; + PVOID Unlock; +} DD_UNLOCKDATA, *PDD_UNLOCKDATA; +typedef DWORD (STDCALL *PDD_SURFCB_UNLOCK)(PDD_UNLOCKDATA); + +#define DDABLT_SRCOVERDEST 0x00000001 +#define DDBLT_AFLAGS 0x80000000 + + + +typedef struct _DD_BLTDATA +{ + PDD_DIRECTDRAW_GLOBAL lpDD; + PDD_SURFACE_LOCAL lpDDDestSurface; + RECTL rDest; + PDD_SURFACE_LOCAL lpDDSrcSurface; + RECTL rSrc; + DWORD dwFlags; + DWORD dwROPFlags; + DDBLTFX bltFX; + HRESULT ddRVal; + PVOID Blt; + BOOL IsClipped; + RECTL rOrigDest; + RECTL rOrigSrc; + DWORD dwRectCnt; + LPRECT prDestRects; + DWORD dwAFlags; + DDARGB ddargbScaleFactors; +} DD_BLTDATA, *PDD_BLTDATA; +typedef DWORD (STDCALL *PDD_SURFCB_BLT)(PDD_BLTDATA); + +typedef struct _DD_UPDATEOVERLAYDATA +{ + PDD_DIRECTDRAW_GLOBAL lpDD; + PDD_SURFACE_LOCAL lpDDDestSurface; + RECTL rDest; + PDD_SURFACE_LOCAL lpDDSrcSurface; + RECTL rSrc; + DWORD dwFlags; + DDOVERLAYFX overlayFX; + HRESULT ddRVal; + PVOID UpdateOverlay; +} DD_UPDATEOVERLAYDATA, *PDD_UPDATEOVERLAYDATA; +typedef DWORD (STDCALL *PDD_SURFCB_UPDATEOVERLAY)(PDD_UPDATEOVERLAYDATA); + +typedef struct _DD_SETOVERLAYPOSITIONDATA +{ + PDD_DIRECTDRAW_GLOBAL lpDD; + PDD_SURFACE_LOCAL lpDDSrcSurface; + PDD_SURFACE_LOCAL lpDDDestSurface; + LONG lXPos; + LONG lYPos; + HRESULT ddRVal; + PVOID SetOverlayPosition; +} DD_SETOVERLAYPOSITIONDATA, *PDD_SETOVERLAYPOSITIONDATA; +typedef DWORD (STDCALL *PDD_SURFCB_SETOVERLAYPOSITION)(PDD_SETOVERLAYPOSITIONDATA); + +typedef struct _DD_SETPALETTEDATA +{ + PDD_DIRECTDRAW_GLOBAL lpDD; + PDD_SURFACE_LOCAL lpDDSurface; + PDD_PALETTE_GLOBAL lpDDPalette; + HRESULT ddRVal; + PVOID SetPalette; + BOOL Attach; +} DD_SETPALETTEDATA, *PDD_SETPALETTEDATA; +typedef DWORD (STDCALL *PDD_SURFCB_SETPALETTE)(PDD_SETPALETTEDATA); + +typedef struct _DD_FLIPDATA +{ + PDD_DIRECTDRAW_GLOBAL lpDD; + PDD_SURFACE_LOCAL lpSurfCurr; + PDD_SURFACE_LOCAL lpSurfTarg; + DWORD dwFlags; + HRESULT ddRVal; + PVOID Flip; + PDD_SURFACE_LOCAL lpSurfCurrLeft; + PDD_SURFACE_LOCAL lpSurfTargLeft; +} DD_FLIPDATA, *PDD_FLIPDATA; +typedef DWORD (STDCALL *PDD_SURFCB_FLIP)(PDD_FLIPDATA); + +typedef struct _DD_DESTROYSURFACEDATA +{ + PDD_DIRECTDRAW_GLOBAL lpDD; + PDD_SURFACE_LOCAL lpDDSurface; + HRESULT ddRVal; + PVOID DestroySurface; +} DD_DESTROYSURFACEDATA, *PDD_DESTROYSURFACEDATA; +typedef DWORD (STDCALL *PDD_SURFCB_DESTROYSURFACE)(PDD_DESTROYSURFACEDATA); + +typedef struct _DD_SETCLIPLISTDATA +{ + PDD_DIRECTDRAW_GLOBAL lpDD; + PDD_SURFACE_LOCAL lpDDSurface; + HRESULT ddRVal; + PVOID SetClipList; +} DD_SETCLIPLISTDATA, *PDD_SETCLIPLISTDATA; +typedef DWORD (STDCALL *PDD_SURFCB_SETCLIPLIST)(PDD_SETCLIPLISTDATA); + +typedef struct _DD_ADDATTACHEDSURFACEDATA +{ + PDD_DIRECTDRAW_GLOBAL lpDD; + PDD_SURFACE_LOCAL lpDDSurface; + PDD_SURFACE_LOCAL lpSurfAttached; + HRESULT ddRVal; + PVOID AddAttachedSurface; +} DD_ADDATTACHEDSURFACEDATA, *PDD_ADDATTACHEDSURFACEDATA; +typedef DWORD (STDCALL *PDD_SURFCB_ADDATTACHEDSURFACE)(PDD_ADDATTACHEDSURFACEDATA); + +typedef struct _DD_SETCOLORKEYDATA +{ + PDD_DIRECTDRAW_GLOBAL lpDD; + PDD_SURFACE_LOCAL lpDDSurface; + DWORD dwFlags; + DDCOLORKEY ckNew; + HRESULT ddRVal; + PVOID SetColorKey; +} DD_SETCOLORKEYDATA, *PDD_SETCOLORKEYDATA; +typedef DWORD (STDCALL *PDD_SURFCB_SETCOLORKEY)(PDD_SETCOLORKEYDATA); + +typedef struct _DD_GETBLTSTATUSDATA +{ + PDD_DIRECTDRAW_GLOBAL lpDD; + PDD_SURFACE_LOCAL lpDDSurface; + DWORD dwFlags; + HRESULT ddRVal; + PVOID GetBltStatus; +} DD_GETBLTSTATUSDATA, *PDD_GETBLTSTATUSDATA; +typedef DWORD (STDCALL *PDD_SURFCB_GETBLTSTATUS)(PDD_GETBLTSTATUSDATA); + +typedef struct _DD_GETFLIPSTATUSDATA +{ + PDD_DIRECTDRAW_GLOBAL lpDD; + PDD_SURFACE_LOCAL lpDDSurface; + DWORD dwFlags; + HRESULT ddRVal; + PVOID GetFlipStatus; +} DD_GETFLIPSTATUSDATA, *PDD_GETFLIPSTATUSDATA; +typedef DWORD (STDCALL *PDD_SURFCB_GETFLIPSTATUS)(PDD_GETFLIPSTATUSDATA); + +typedef struct DD_SURFACECALLBACKS +{ + DWORD dwSize; + DWORD dwFlags; + PDD_SURFCB_DESTROYSURFACE DestroySurface; + PDD_SURFCB_FLIP Flip; + PDD_SURFCB_SETCLIPLIST SetClipList; + PDD_SURFCB_LOCK Lock; + PDD_SURFCB_UNLOCK Unlock; + PDD_SURFCB_BLT Blt; + PDD_SURFCB_SETCOLORKEY SetColorKey; + PDD_SURFCB_ADDATTACHEDSURFACE AddAttachedSurface; + PDD_SURFCB_GETBLTSTATUS GetBltStatus; + PDD_SURFCB_GETFLIPSTATUS GetFlipStatus; + PDD_SURFCB_UPDATEOVERLAY UpdateOverlay; + PDD_SURFCB_SETOVERLAYPOSITION SetOverlayPosition; + PVOID reserved4; + PDD_SURFCB_SETPALETTE SetPalette; +} DD_SURFACECALLBACKS, *PDD_SURFACECALLBACKS; + + +#define DDHAL_SURFCB32_DESTROYSURFACE 0x00000001 +#define DDHAL_SURFCB32_FLIP 0x00000002 +#define DDHAL_SURFCB32_SETCLIPLIST 0x00000004 +#define DDHAL_SURFCB32_LOCK 0x00000008 +#define DDHAL_SURFCB32_UNLOCK 0x00000010 +#define DDHAL_SURFCB32_BLT 0x00000020 +#define DDHAL_SURFCB32_SETCOLORKEY 0x00000040 +#define DDHAL_SURFCB32_ADDATTACHEDSURFACE 0x00000080 +#define DDHAL_SURFCB32_GETBLTSTATUS 0x00000100 +#define DDHAL_SURFCB32_GETFLIPSTATUS 0x00000200 +#define DDHAL_SURFCB32_UPDATEOVERLAY 0x00000400 +#define DDHAL_SURFCB32_SETOVERLAYPOSITION 0x00000800 +#define DDHAL_SURFCB32_RESERVED4 0x00001000 +#define DDHAL_SURFCB32_SETPALETTE 0x00002000 +/************************************************************************/ +/* IDirectDraw callbacks */ +/************************************************************************/ + +typedef struct _DD_CREATESURFACEDATA +{ + PDD_DIRECTDRAW_GLOBAL lpDD; + DDSURFACEDESC *lpDDSurfaceDesc; + PDD_SURFACE_LOCAL *lplpSList; + DWORD dwSCnt; + HRESULT ddRVal; + PVOID CreateSurface; +} DD_CREATESURFACEDATA, *PDD_CREATESURFACEDATA; +typedef DWORD (STDCALL *PDD_CREATESURFACE)(PDD_CREATESURFACEDATA); + +typedef struct _DD_DRVSETCOLORKEYDATA +{ + PDD_SURFACE_LOCAL lpDDSurface; + DWORD dwFlags; + DDCOLORKEY ckNew; + HRESULT ddRVal; + PVOID SetColorKey; +} DD_DRVSETCOLORKEYDATA, *PDD_DRVSETCOLORKEYDATA; +typedef DWORD (STDCALL *PDD_SETCOLORKEY)(PDD_DRVSETCOLORKEYDATA); + +#define DDWAITVB_I_TESTVB 0x80000006 + +typedef struct _DD_WAITFORVERTICALBLANKDATA +{ + PDD_DIRECTDRAW_GLOBAL lpDD; + DWORD dwFlags; + DWORD bIsInVB; + DWORD hEvent; + HRESULT ddRVal; + PVOID WaitForVerticalBlank; +} DD_WAITFORVERTICALBLANKDATA, *PDD_WAITFORVERTICALBLANKDATA; +typedef DWORD (STDCALL *PDD_WAITFORVERTICALBLANK)(PDD_WAITFORVERTICALBLANKDATA); + +typedef struct _DD_CANCREATESURFACEDATA +{ + PDD_DIRECTDRAW_GLOBAL lpDD; + DDSURFACEDESC *lpDDSurfaceDesc; + DWORD bIsDifferentPixelFormat; + HRESULT ddRVal; + PVOID CanCreateSurface; +} DD_CANCREATESURFACEDATA, *PDD_CANCREATESURFACEDATA; +typedef DWORD (STDCALL *PDD_CANCREATESURFACE)(PDD_CANCREATESURFACEDATA); + +typedef struct _DD_CREATEPALETTEDATA +{ + PDD_DIRECTDRAW_GLOBAL lpDD; + PDD_PALETTE_GLOBAL lpDDPalette; + LPPALETTEENTRY lpColorTable; + HRESULT ddRVal; + PVOID CreatePalette; + BOOL is_excl; +} DD_CREATEPALETTEDATA, *PDD_CREATEPALETTEDATA; +typedef DWORD (STDCALL *PDD_CREATEPALETTE)(PDD_CREATEPALETTEDATA); + +typedef struct _DD_GETSCANLINEDATA +{ + PDD_DIRECTDRAW_GLOBAL lpDD; + DWORD dwScanLine; + HRESULT ddRVal; + PVOID GetScanLine; +} DD_GETSCANLINEDATA, *PDD_GETSCANLINEDATA; +typedef DWORD (STDCALL *PDD_GETSCANLINE)(PDD_GETSCANLINEDATA); + +typedef struct _DD_MAPMEMORYDATA +{ + PDD_DIRECTDRAW_GLOBAL lpDD; + BOOL bMap; + HANDLE hProcess; + FLATPTR fpProcess; + HRESULT ddRVal; +} DD_MAPMEMORYDATA, *PDD_MAPMEMORYDATA; +typedef DWORD (STDCALL *PDD_MAPMEMORY)(PDD_MAPMEMORYDATA); + + + + +typedef struct _DD_DESTROYDRIVERDATA *PDD_DESTROYDRIVERDATA; +typedef struct _DD_SETMODEDATA *PDD_SETMODEDATA; + +typedef DWORD (APIENTRY *PDD_DESTROYDRIVER)(PDD_DESTROYDRIVERDATA); +typedef DWORD (APIENTRY *PDD_SETMODE)(PDD_SETMODEDATA); + +typedef struct DD_CALLBACKS +{ + DWORD dwSize; + DWORD dwFlags; + PDD_DESTROYDRIVER DestroyDriver; + PDD_CREATESURFACE CreateSurface; + PDD_SETCOLORKEY SetColorKey; + PDD_SETMODE SetMode; + PDD_WAITFORVERTICALBLANK WaitForVerticalBlank; + PDD_CANCREATESURFACE CanCreateSurface; + PDD_CREATEPALETTE CreatePalette; + PDD_GETSCANLINE GetScanLine; + PDD_MAPMEMORY MapMemory; +} DD_CALLBACKS, *PDD_CALLBACKS; + + + +#define DDHAL_CB32_DESTROYDRIVER 0x00000001l +#define DDHAL_CB32_CREATESURFACE 0x00000002l +#define DDHAL_CB32_SETCOLORKEY 0x00000004l +#define DDHAL_CB32_SETMODE 0x00000008l +#define DDHAL_CB32_WAITFORVERTICALBLANK 0x00000010l +#define DDHAL_CB32_CANCREATESURFACE 0x00000020l +#define DDHAL_CB32_CREATEPALETTE 0x00000040l +#define DDHAL_CB32_GETSCANLINE 0x00000080l +#define DDHAL_CB32_MAPMEMORY 0x80000000l + +typedef struct _DD_GETAVAILDRIVERMEMORYDATA +{ + PDD_DIRECTDRAW_GLOBAL lpDD; + DDSCAPS DDSCaps; + DWORD dwTotal; + DWORD dwFree; + HRESULT ddRVal; + PVOID GetAvailDriverMemory; +} DD_GETAVAILDRIVERMEMORYDATA, *PDD_GETAVAILDRIVERMEMORYDATA; +typedef DWORD (STDCALL *PDD_GETAVAILDRIVERMEMORY)(PDD_GETAVAILDRIVERMEMORYDATA); + +typedef struct _DD_MISCELLANEOUSCALLBACKS +{ + DWORD dwSize; + DWORD dwFlags; + PDD_GETAVAILDRIVERMEMORY GetAvailDriverMemory; +} DD_MISCELLANEOUSCALLBACKS, *PDD_MISCELLANEOUSCALLBACKS; + +#define DDHAL_MISCCB32_GETAVAILDRIVERMEMORY 0x00000001 + +typedef DWORD (STDCALL *PDD_ALPHABLT)(PDD_BLTDATA); + +typedef struct _DD_CREATESURFACEEXDATA +{ + DWORD dwFlags; + PDD_DIRECTDRAW_LOCAL lpDDLcl; + PDD_SURFACE_LOCAL lpDDSLcl; + HRESULT ddRVal; +} DD_CREATESURFACEEXDATA, *PDD_CREATESURFACEEXDATA; +typedef DWORD (STDCALL *PDD_CREATESURFACEEX)(PDD_CREATESURFACEEXDATA); + +typedef struct _DD_GETDRIVERSTATEDATA +{ + DWORD dwFlags; + union + { + PDD_DIRECTDRAW_GLOBAL lpDD; + DWORD_PTR dwhContext; + }; + LPDWORD lpdwStates; + DWORD dwLength; + HRESULT ddRVal; +} DD_GETDRIVERSTATEDATA, *PDD_GETDRIVERSTATEDATA; +typedef DWORD (STDCALL *PDD_GETDRIVERSTATE)(PDD_GETDRIVERSTATEDATA); + +typedef struct _DD_DESTROYDDLOCALDATA +{ + DWORD dwFlags; + PDD_DIRECTDRAW_LOCAL pDDLcl; + HRESULT ddRVal; +} DD_DESTROYDDLOCALDATA, *PDD_DESTROYDDLOCALDATA; +typedef DWORD (STDCALL *PDD_DESTROYDDLOCAL)(PDD_DESTROYDDLOCALDATA); + + + +typedef struct _DD_MISCELLANEOUS2CALLBACKS +{ + DWORD dwSize; + DWORD dwFlags; + PDD_ALPHABLT AlphaBlt; + PDD_CREATESURFACEEX CreateSurfaceEx; + PDD_GETDRIVERSTATE GetDriverState; + PDD_DESTROYDDLOCAL DestroyDDLocal; +} DD_MISCELLANEOUS2CALLBACKS, *PDD_MISCELLANEOUS2CALLBACKS; + + +#define DDHAL_MISC2CB32_ALPHABLT 0x00000001 +#define DDHAL_MISC2CB32_CREATESURFACEEX 0x00000002 +#define DDHAL_MISC2CB32_GETDRIVERSTATE 0x00000004 +#define DDHAL_MISC2CB32_DESTROYDDLOCAL 0x00000008 + + +typedef struct _DD_FREEDRIVERMEMORYDATA +{ + PDD_DIRECTDRAW_GLOBAL lpDD; + PDD_SURFACE_LOCAL lpDDSurface; + HRESULT ddRVal; + PVOID FreeDriverMemory; +} DD_FREEDRIVERMEMORYDATA, *PDD_FREEDRIVERMEMORYDATA; +typedef DWORD (STDCALL *PDD_FREEDRIVERMEMORY)(PDD_FREEDRIVERMEMORYDATA); + +typedef struct _DD_SETEXCLUSIVEMODEDATA +{ + PDD_DIRECTDRAW_GLOBAL lpDD; + DWORD dwEnterExcl; + DWORD dwReserved; + HRESULT ddRVal; + PVOID SetExclusiveMode; +} DD_SETEXCLUSIVEMODEDATA, *PDD_SETEXCLUSIVEMODEDATA; +typedef DWORD (STDCALL *PDD_SETEXCLUSIVEMODE)(PDD_SETEXCLUSIVEMODEDATA); + +typedef struct _DD_FLIPTOGDISURFACEDATA +{ + PDD_DIRECTDRAW_GLOBAL lpDD; + DWORD dwToGDI; + DWORD dwReserved; + HRESULT ddRVal; + PVOID FlipToGDISurface; +} DD_FLIPTOGDISURFACEDATA, *PDD_FLIPTOGDISURFACEDATA; +typedef DWORD (STDCALL *PDD_FLIPTOGDISURFACE)(PDD_FLIPTOGDISURFACEDATA); + + + +typedef struct _DD_NTCALLBACKS +{ + DWORD dwSize; + DWORD dwFlags; + PDD_FREEDRIVERMEMORY FreeDriverMemory; + PDD_SETEXCLUSIVEMODE SetExclusiveMode; + PDD_FLIPTOGDISURFACE FlipToGDISurface; +} DD_NTCALLBACKS, *PDD_NTCALLBACKS; + + +#define DDHAL_NTCB32_FREEDRIVERMEMORY 0x00000001 +#define DDHAL_NTCB32_SETEXCLUSIVEMODE 0x00000002 +#define DDHAL_NTCB32_FLIPTOGDISURFACE 0x00000004 + +/************************************************************************/ +/* IDirectDrawPalette callbacks */ +/************************************************************************/ + +typedef struct _DD_DESTROYPALETTEDATA +{ + PDD_DIRECTDRAW_GLOBAL lpDD; + PDD_PALETTE_GLOBAL lpDDPalette; + HRESULT ddRVal; + PVOID DestroyPalette; +} DD_DESTROYPALETTEDATA, *PDD_DESTROYPALETTEDATA; +typedef DWORD (STDCALL *PDD_PALCB_DESTROYPALETTE)(PDD_DESTROYPALETTEDATA); + +typedef struct _DD_SETENTRIESDATA +{ + PDD_DIRECTDRAW_GLOBAL lpDD; + PDD_PALETTE_GLOBAL lpDDPalette; + DWORD dwBase; + DWORD dwNumEntries; + LPPALETTEENTRY lpEntries; + HRESULT ddRVal; + PVOID SetEntries; +} DD_SETENTRIESDATA, *PDD_SETENTRIESDATA; +typedef DWORD (STDCALL *PDD_PALCB_SETENTRIES)(PDD_SETENTRIESDATA); + +typedef struct DD_PALETTECALLBACKS +{ + DWORD dwSize; + DWORD dwFlags; + PDD_PALCB_DESTROYPALETTE DestroyPalette; + PDD_PALCB_SETENTRIES SetEntries; +} DD_PALETTECALLBACKS, *PDD_PALETTECALLBACKS; + +#define DDHAL_PALCB32_DESTROYPALETTE 0x00000001l +#define DDHAL_PALCB32_SETENTRIES 0x00000002l + +/************************************************************************/ +/* IDirectDrawVideoport callbacks */ +/************************************************************************/ + +typedef struct _DD_CANCREATEVPORTDATA +{ + PDD_DIRECTDRAW_LOCAL lpDD; + LPDDVIDEOPORTDESC lpDDVideoPortDesc; + HRESULT ddRVal; + PVOID CanCreateVideoPort; +} DD_CANCREATEVPORTDATA, *PDD_CANCREATEVPORTDATA; +typedef DWORD (STDCALL *PDD_VPORTCB_CANCREATEVIDEOPORT)(PDD_CANCREATEVPORTDATA); + +typedef struct _DD_CREATEVPORTDATA +{ + PDD_DIRECTDRAW_LOCAL lpDD; + LPDDVIDEOPORTDESC lpDDVideoPortDesc; + PDD_VIDEOPORT_LOCAL lpVideoPort; + HRESULT ddRVal; + PVOID CreateVideoPort; +} DD_CREATEVPORTDATA, *PDD_CREATEVPORTDATA; +typedef DWORD (STDCALL *PDD_VPORTCB_CREATEVIDEOPORT)(PDD_CREATEVPORTDATA); + +typedef struct _DD_FLIPVPORTDATA +{ + PDD_DIRECTDRAW_LOCAL lpDD; + PDD_VIDEOPORT_LOCAL lpVideoPort; + PDD_SURFACE_LOCAL lpSurfCurr; + PDD_SURFACE_LOCAL lpSurfTarg; + HRESULT ddRVal; + PVOID FlipVideoPort; +} DD_FLIPVPORTDATA, *PDD_FLIPVPORTDATA; +typedef DWORD (STDCALL *PDD_VPORTCB_FLIP)(PDD_FLIPVPORTDATA); + +typedef struct _DD_GETVPORTBANDWIDTHDATA +{ + PDD_DIRECTDRAW_LOCAL lpDD; + PDD_VIDEOPORT_LOCAL lpVideoPort; + LPDDPIXELFORMAT lpddpfFormat; + DWORD dwWidth; + DWORD dwHeight; + DWORD dwFlags; + LPDDVIDEOPORTBANDWIDTH lpBandwidth; + HRESULT ddRVal; + PVOID GetVideoPortBandwidth; +} DD_GETVPORTBANDWIDTHDATA, *PDD_GETVPORTBANDWIDTHDATA; +typedef DWORD (STDCALL *PDD_VPORTCB_GETBANDWIDTH)(PDD_GETVPORTBANDWIDTHDATA); + +typedef struct _DD_GETVPORTINPUTFORMATDATA +{ + PDD_DIRECTDRAW_LOCAL lpDD; + PDD_VIDEOPORT_LOCAL lpVideoPort; + DWORD dwFlags; + LPDDPIXELFORMAT lpddpfFormat; + DWORD dwNumFormats; + HRESULT ddRVal; + PVOID GetVideoPortInputFormats; +} DD_GETVPORTINPUTFORMATDATA, *PDD_GETVPORTINPUTFORMATDATA; +typedef DWORD (STDCALL *PDD_VPORTCB_GETINPUTFORMATS)(PDD_GETVPORTINPUTFORMATDATA); + +typedef struct _DD_GETVPORTOUTPUTFORMATDATA +{ + PDD_DIRECTDRAW_LOCAL lpDD; + PDD_VIDEOPORT_LOCAL lpVideoPort; + DWORD dwFlags; + LPDDPIXELFORMAT lpddpfInputFormat; + LPDDPIXELFORMAT lpddpfOutputFormats; + DWORD dwNumFormats; + HRESULT ddRVal; + PVOID GetVideoPortInputFormats; +} DD_GETVPORTOUTPUTFORMATDATA, *PDD_GETVPORTOUTPUTFORMATDATA; +typedef DWORD (STDCALL *PDD_VPORTCB_GETOUTPUTFORMATS)(PDD_GETVPORTOUTPUTFORMATDATA); + +typedef struct _DD_GETVPORTFIELDDATA +{ + PDD_DIRECTDRAW_LOCAL lpDD; + PDD_VIDEOPORT_LOCAL lpVideoPort; + BOOL bField; + HRESULT ddRVal; + PVOID GetVideoPortField; +} DD_GETVPORTFIELDDATA, *PDD_GETVPORTFIELDDATA; +typedef DWORD (STDCALL *PDD_VPORTCB_GETFIELD)(PDD_GETVPORTFIELDDATA); + +typedef struct _DD_GETVPORTLINEDATA +{ + PDD_DIRECTDRAW_LOCAL lpDD; + PDD_VIDEOPORT_LOCAL lpVideoPort; + DWORD dwLine; + HRESULT ddRVal; + PVOID GetVideoPortLine; +} DD_GETVPORTLINEDATA, *PDD_GETVPORTLINEDATA; +typedef DWORD (STDCALL *PDD_VPORTCB_GETLINE)(PDD_GETVPORTLINEDATA); + +typedef struct _DD_GETVPORTCONNECTDATA +{ + PDD_DIRECTDRAW_LOCAL lpDD; + DWORD dwPortId; + LPDDVIDEOPORTCONNECT lpConnect; + DWORD dwNumEntries; + HRESULT ddRVal; + PVOID GetVideoPortConnectInfo; +} DD_GETVPORTCONNECTDATA, *PDD_GETVPORTCONNECTDATA; +typedef DWORD (STDCALL *PDD_VPORTCB_GETVPORTCONNECT)(PDD_GETVPORTCONNECTDATA); + +typedef struct _DD_DESTROYVPORTDATA +{ + PDD_DIRECTDRAW_LOCAL lpDD; + PDD_VIDEOPORT_LOCAL lpVideoPort; + HRESULT ddRVal; + PVOID DestroyVideoPort; +} DD_DESTROYVPORTDATA, *PDD_DESTROYVPORTDATA; +typedef DWORD (STDCALL *PDD_VPORTCB_DESTROYVPORT)(PDD_DESTROYVPORTDATA); + +typedef struct _DD_GETVPORTFLIPSTATUSDATA +{ + PDD_DIRECTDRAW_LOCAL lpDD; + FLATPTR fpSurface; + HRESULT ddRVal; + PVOID GetVideoPortFlipStatus; +} DD_GETVPORTFLIPSTATUSDATA, *PDD_GETVPORTFLIPSTATUSDATA; +typedef DWORD (STDCALL *PDD_VPORTCB_GETFLIPSTATUS)(PDD_GETVPORTFLIPSTATUSDATA); + + + +typedef struct _DD_UPDATEVPORTDATA +{ + PDD_DIRECTDRAW_LOCAL lpDD; + PDD_VIDEOPORT_LOCAL lpVideoPort; + PDD_SURFACE_INT *lplpDDSurface; + PDD_SURFACE_INT *lplpDDVBISurface; + LPDDVIDEOPORTINFO lpVideoInfo; + DWORD dwFlags; + DWORD dwNumAutoflip; + DWORD dwNumVBIAutoflip; + HRESULT ddRVal; + PVOID UpdateVideoPort; +} DD_UPDATEVPORTDATA, *PDD_UPDATEVPORTDATA; +typedef DWORD (STDCALL *PDD_VPORTCB_UPDATE)(PDD_UPDATEVPORTDATA); + +typedef struct _DD_WAITFORVPORTSYNCDATA +{ + PDD_DIRECTDRAW_LOCAL lpDD; + PDD_VIDEOPORT_LOCAL lpVideoPort; + DWORD dwFlags; + DWORD dwLine; + DWORD dwTimeOut; + HRESULT ddRVal; + PVOID UpdateVideoPort; +} DD_WAITFORVPORTSYNCDATA, *PDD_WAITFORVPORTSYNCDATA; +typedef DWORD (STDCALL *PDD_VPORTCB_WAITFORSYNC)(PDD_WAITFORVPORTSYNCDATA); + +typedef struct _DD_GETVPORTSIGNALDATA +{ + PDD_DIRECTDRAW_LOCAL lpDD; + PDD_VIDEOPORT_LOCAL lpVideoPort; + DWORD dwStatus; + HRESULT ddRVal; + PVOID GetVideoSignalStatus; +} DD_GETVPORTSIGNALDATA, *PDD_GETVPORTSIGNALDATA; +typedef DWORD (STDCALL *PDD_VPORTCB_GETSIGNALSTATUS)(PDD_GETVPORTSIGNALDATA); + + + +typedef struct _DD_VPORTCOLORDATA +{ + PDD_DIRECTDRAW_LOCAL lpDD; + PDD_VIDEOPORT_LOCAL lpVideoPort; + DWORD dwFlags; + LPDDCOLORCONTROL lpColorData; + HRESULT ddRVal; + PVOID ColorControl; +} DD_VPORTCOLORDATA, *PDD_VPORTCOLORDATA; +typedef DWORD (STDCALL *PDD_VPORTCB_COLORCONTROL)(PDD_VPORTCOLORDATA); + + +typedef struct DD_VIDEOPORTCALLBACKS +{ + DWORD dwSize; + DWORD dwFlags; + PDD_VPORTCB_CANCREATEVIDEOPORT CanCreateVideoPort; + PDD_VPORTCB_CREATEVIDEOPORT CreateVideoPort; + PDD_VPORTCB_FLIP FlipVideoPort; + PDD_VPORTCB_GETBANDWIDTH GetVideoPortBandwidth; + PDD_VPORTCB_GETINPUTFORMATS GetVideoPortInputFormats; + PDD_VPORTCB_GETOUTPUTFORMATS GetVideoPortOutputFormats; + PVOID lpReserved1; + PDD_VPORTCB_GETFIELD GetVideoPortField; + PDD_VPORTCB_GETLINE GetVideoPortLine; + PDD_VPORTCB_GETVPORTCONNECT GetVideoPortConnectInfo; + PDD_VPORTCB_DESTROYVPORT DestroyVideoPort; + PDD_VPORTCB_GETFLIPSTATUS GetVideoPortFlipStatus; + PDD_VPORTCB_UPDATE UpdateVideoPort; + PDD_VPORTCB_WAITFORSYNC WaitForVideoPortSync; + PDD_VPORTCB_GETSIGNALSTATUS GetVideoSignalStatus; + PDD_VPORTCB_COLORCONTROL ColorControl; +} DD_VIDEOPORTCALLBACKS, *PDD_VIDEOPORTCALLBACKS; + +#define DDHAL_VPORT32_CANCREATEVIDEOPORT 0x00000001 +#define DDHAL_VPORT32_CREATEVIDEOPORT 0x00000002 +#define DDHAL_VPORT32_FLIP 0x00000004 +#define DDHAL_VPORT32_GETBANDWIDTH 0x00000008 +#define DDHAL_VPORT32_GETINPUTFORMATS 0x00000010 +#define DDHAL_VPORT32_GETOUTPUTFORMATS 0x00000020 +#define DDHAL_VPORT32_GETFIELD 0x00000080 +#define DDHAL_VPORT32_GETLINE 0x00000100 +#define DDHAL_VPORT32_GETCONNECT 0x00000200 +#define DDHAL_VPORT32_DESTROY 0x00000400 +#define DDHAL_VPORT32_GETFLIPSTATUS 0x00000800 +#define DDHAL_VPORT32_UPDATE 0x00001000 +#define DDHAL_VPORT32_WAITFORSYNC 0x00002000 +#define DDHAL_VPORT32_GETSIGNALSTATUS 0x00004000 +#define DDHAL_VPORT32_COLORCONTROL 0x00008000 + + +/************************************************************************/ +/* IDirectDrawColorControl callbacks */ +/************************************************************************/ + +#define DDRAWI_GETCOLOR 0x0001 +#define DDRAWI_SETCOLOR 0x0002 + +typedef struct _DD_COLORCONTROLDATA +{ + PDD_DIRECTDRAW_GLOBAL lpDD; + PDD_SURFACE_LOCAL lpDDSurface; + LPDDCOLORCONTROL lpColorData; + DWORD dwFlags; + HRESULT ddRVal; + PVOID ColorControl; +} DD_COLORCONTROLDATA, *PDD_COLORCONTROLDATA; +typedef DWORD (STDCALL *PDD_COLORCB_COLORCONTROL)(PDD_COLORCONTROLDATA); + + + +typedef struct _DD_COLORCONTROLCALLBACKS +{ + DWORD dwSize; + DWORD dwFlags; + PDD_COLORCB_COLORCONTROL ColorControl; +} DD_COLORCONTROLCALLBACKS, *PDD_COLORCONTROLCALLBACKS; + +#define DDHAL_COLOR_COLORCONTROL 0x00000001 + +/************************************************************************/ +/* IDirectDrawVideo callbacks */ +/************************************************************************/ + +typedef struct _DD_GETMOCOMPGUIDSDATA +{ + PDD_DIRECTDRAW_LOCAL lpDD; + DWORD dwNumGuids; + GUID *lpGuids; + HRESULT ddRVal; +} DD_GETMOCOMPGUIDSDATA, *PDD_GETMOCOMPGUIDSDATA; +typedef DWORD (STDCALL *PDD_MOCOMPCB_GETGUIDS)(PDD_GETMOCOMPGUIDSDATA); + +typedef struct _DD_GETMOCOMPFORMATSDATA +{ + PDD_DIRECTDRAW_LOCAL lpDD; + GUID *lpGuid; + DWORD dwNumFormats; + LPDDPIXELFORMAT lpFormats; + HRESULT ddRVal; +} DD_GETMOCOMPFORMATSDATA, *PDD_GETMOCOMPFORMATSDATA; +typedef DWORD (STDCALL *PDD_MOCOMPCB_GETFORMATS)(PDD_GETMOCOMPFORMATSDATA); + +typedef struct _DD_CREATEMOCOMPDATA +{ + PDD_DIRECTDRAW_LOCAL lpDD; + PDD_MOTIONCOMP_LOCAL lpMoComp; + GUID *lpGuid; + DWORD dwUncompWidth; + DWORD dwUncompHeight; + DDPIXELFORMAT ddUncompPixelFormat; + LPVOID lpData; + DWORD dwDataSize; + HRESULT ddRVal; +} DD_CREATEMOCOMPDATA, *PDD_CREATEMOCOMPDATA; +typedef DWORD (STDCALL *PDD_MOCOMPCB_CREATE)(PDD_CREATEMOCOMPDATA); + +typedef struct _DDCOMPBUFFERINFO +{ + DWORD dwSize; + DWORD dwNumCompBuffers; + DWORD dwWidthToCreate; + DWORD dwHeightToCreate; + DWORD dwBytesToAllocate; + DDSCAPS2 ddCompCaps; + DDPIXELFORMAT ddPixelFormat; +} DDCOMPBUFFERINFO, *LPDDCOMPBUFFERINFO; + +typedef struct _DD_GETMOCOMPCOMPBUFFDATA +{ + PDD_DIRECTDRAW_LOCAL lpDD; + GUID *lpGuid; + DWORD dwWidth; + DWORD dwHeight; + DDPIXELFORMAT ddPixelFormat; + DWORD dwNumTypesCompBuffs; + LPDDCOMPBUFFERINFO lpCompBuffInfo; + HRESULT ddRVal; +} DD_GETMOCOMPCOMPBUFFDATA, *PDD_GETMOCOMPCOMPBUFFDATA; +typedef DWORD (STDCALL *PDD_MOCOMPCB_GETCOMPBUFFINFO)(PDD_GETMOCOMPCOMPBUFFDATA); + +typedef struct _DD_GETINTERNALMOCOMPDATA +{ + PDD_DIRECTDRAW_LOCAL lpDD; + GUID *lpGuid; + DWORD dwWidth; + DWORD dwHeight; + DDPIXELFORMAT ddPixelFormat; + DWORD dwScratchMemAlloc; + HRESULT ddRVal; +} DD_GETINTERNALMOCOMPDATA, *PDD_GETINTERNALMOCOMPDATA; +typedef DWORD (STDCALL *PDD_MOCOMPCB_GETINTERNALINFO)(PDD_GETINTERNALMOCOMPDATA); + +typedef struct _DD_BEGINMOCOMPFRAMEDATA +{ + PDD_DIRECTDRAW_LOCAL lpDD; + PDD_MOTIONCOMP_LOCAL lpMoComp; + PDD_SURFACE_LOCAL lpDestSurface; + DWORD dwInputDataSize; + LPVOID lpInputData; + DWORD dwOutputDataSize; + LPVOID lpOutputData; + HRESULT ddRVal; +} DD_BEGINMOCOMPFRAMEDATA, *PDD_BEGINMOCOMPFRAMEDATA; +typedef DWORD (STDCALL *PDD_MOCOMPCB_BEGINFRAME)(PDD_BEGINMOCOMPFRAMEDATA); + +typedef struct _DD_ENDMOCOMPFRAMEDATA +{ + PDD_DIRECTDRAW_LOCAL lpDD; + PDD_MOTIONCOMP_LOCAL lpMoComp; + LPVOID lpInputData; + DWORD dwInputDataSize; + HRESULT ddRVal; +} DD_ENDMOCOMPFRAMEDATA, *PDD_ENDMOCOMPFRAMEDATA; +typedef DWORD (STDCALL *PDD_MOCOMPCB_ENDFRAME)(PDD_ENDMOCOMPFRAMEDATA); + +typedef struct _DDMOCOMPBUFFERINFO +{ + DWORD dwSize; + PDD_SURFACE_LOCAL lpCompSurface; + DWORD dwDataOffset; + DWORD dwDataSize; + LPVOID lpPrivate; +} DDMOCOMPBUFFERINFO, *LPDDMOCOMPBUFFERINFO; + +typedef struct _DD_RENDERMOCOMPDATA +{ + PDD_DIRECTDRAW_LOCAL lpDD; + PDD_MOTIONCOMP_LOCAL lpMoComp; + DWORD dwNumBuffers; + LPDDMOCOMPBUFFERINFO lpBufferInfo; + DWORD dwFunction; + LPVOID lpInputData; + DWORD dwInputDataSize; + LPVOID lpOutputData; + DWORD dwOutputDataSize; + HRESULT ddRVal; +} DD_RENDERMOCOMPDATA, *PDD_RENDERMOCOMPDATA; +typedef DWORD (STDCALL *PDD_MOCOMPCB_RENDER)(PDD_RENDERMOCOMPDATA); + +#define DDMCQUERY_READ 0x00000001 + +typedef struct _DD_QUERYMOCOMPSTATUSDATA +{ + PDD_DIRECTDRAW_LOCAL lpDD; + PDD_MOTIONCOMP_LOCAL lpMoComp; + PDD_SURFACE_LOCAL lpSurface; + DWORD dwFlags; + HRESULT ddRVal; +} DD_QUERYMOCOMPSTATUSDATA, *PDD_QUERYMOCOMPSTATUSDATA; +typedef DWORD (STDCALL *PDD_MOCOMPCB_QUERYSTATUS)(PDD_QUERYMOCOMPSTATUSDATA); + +typedef struct _DD_DESTROYMOCOMPDATA +{ + PDD_DIRECTDRAW_LOCAL lpDD; + PDD_MOTIONCOMP_LOCAL lpMoComp; + HRESULT ddRVal; +} DD_DESTROYMOCOMPDATA, *PDD_DESTROYMOCOMPDATA; +typedef DWORD (STDCALL *PDD_MOCOMPCB_DESTROY)(PDD_DESTROYMOCOMPDATA); + + + +typedef struct DD_MOTIONCOMPCALLBACKS +{ + DWORD dwSize; + DWORD dwFlags; + PDD_MOCOMPCB_GETGUIDS GetMoCompGuids; + PDD_MOCOMPCB_GETFORMATS GetMoCompFormats; + PDD_MOCOMPCB_CREATE CreateMoComp; + PDD_MOCOMPCB_GETCOMPBUFFINFO GetMoCompBuffInfo; + PDD_MOCOMPCB_GETINTERNALINFO GetInternalMoCompInfo; + PDD_MOCOMPCB_BEGINFRAME BeginMoCompFrame; + PDD_MOCOMPCB_ENDFRAME EndMoCompFrame; + PDD_MOCOMPCB_RENDER RenderMoComp; + PDD_MOCOMPCB_QUERYSTATUS QueryMoCompStatus; + PDD_MOCOMPCB_DESTROY DestroyMoComp; +} DD_MOTIONCOMPCALLBACKS, *PDD_MOTIONCOMPCALLBACKS; + +#define DDHAL_MOCOMP32_GETGUIDS 0x00000001 +#define DDHAL_MOCOMP32_GETFORMATS 0x00000002 +#define DDHAL_MOCOMP32_CREATE 0x00000004 +#define DDHAL_MOCOMP32_GETCOMPBUFFINFO 0x00000008 +#define DDHAL_MOCOMP32_GETINTERNALINFO 0x00000010 +#define DDHAL_MOCOMP32_BEGINFRAME 0x00000020 +#define DDHAL_MOCOMP32_ENDFRAME 0x00000040 +#define DDHAL_MOCOMP32_RENDER 0x00000080 +#define DDHAL_MOCOMP32_QUERYSTATUS 0x00000100 +#define DDHAL_MOCOMP32_DESTROY 0x00000200 + +/************************************************************************/ +/* D3D buffer callbacks */ +/************************************************************************/ + +typedef struct _DD_D3DBUFCALLBACKS +{ + DWORD dwSize; + DWORD dwFlags; + PDD_CANCREATESURFACE CanCreateD3DBuffer; + PDD_CREATESURFACE CreateD3DBuffer; + PDD_SURFCB_DESTROYSURFACE DestroyD3DBuffer; + PDD_SURFCB_LOCK LockD3DBuffer; + PDD_SURFCB_UNLOCK UnlockD3DBuffer; +} DD_D3DBUFCALLBACKS, *PDD_D3DBUFCALLBACKS; + +/************************************************************************/ +/* DdGetDriverInfo callback */ +/************************************************************************/ + +typedef struct _DD_GETDRIVERINFODATA +{ + // Input: + PVOID dhpdev; + DWORD dwSize; + DWORD dwFlags; + GUID guidInfo; + DWORD dwExpectedSize; + PVOID lpvData; + // Output: + DWORD dwActualSize; + HRESULT ddRVal; +} DD_GETDRIVERINFODATA, *PDD_GETDRIVERINFODATA; +typedef DWORD (STDCALL *PDD_GETDRIVERINFO)(PDD_GETDRIVERINFODATA); + + + + +/************************************************************************/ +/* Driver info structures */ +/************************************************************************/ + +typedef struct _DDNTCORECAPS +{ + DWORD dwSize; + DWORD dwCaps; + DWORD dwCaps2; + DWORD dwCKeyCaps; + DWORD dwFXCaps; + DWORD dwFXAlphaCaps; + DWORD dwPalCaps; + DWORD dwSVCaps; + DWORD dwAlphaBltConstBitDepths; + DWORD dwAlphaBltPixelBitDepths; + DWORD dwAlphaBltSurfaceBitDepths; + DWORD dwAlphaOverlayConstBitDepths; + DWORD dwAlphaOverlayPixelBitDepths; + DWORD dwAlphaOverlaySurfaceBitDepths; + DWORD dwZBufferBitDepths; + DWORD dwVidMemTotal; + DWORD dwVidMemFree; + DWORD dwMaxVisibleOverlays; + DWORD dwCurrVisibleOverlays; + DWORD dwNumFourCCCodes; + DWORD dwAlignBoundarySrc; + DWORD dwAlignSizeSrc; + DWORD dwAlignBoundaryDest; + DWORD dwAlignSizeDest; + DWORD dwAlignStrideAlign; + DWORD dwRops[DD_ROP_SPACE]; + DDSCAPS ddsCaps; + DWORD dwMinOverlayStretch; + DWORD dwMaxOverlayStretch; + DWORD dwMinLiveVideoStretch; + DWORD dwMaxLiveVideoStretch; + DWORD dwMinHwCodecStretch; + DWORD dwMaxHwCodecStretch; + DWORD dwReserved1; + DWORD dwReserved2; + DWORD dwReserved3; + DWORD dwSVBCaps; + DWORD dwSVBCKeyCaps; + DWORD dwSVBFXCaps; + DWORD dwSVBRops[DD_ROP_SPACE]; + DWORD dwVSBCaps; + DWORD dwVSBCKeyCaps; + DWORD dwVSBFXCaps; + DWORD dwVSBRops[DD_ROP_SPACE]; + DWORD dwSSBCaps; + DWORD dwSSBCKeyCaps; + DWORD dwSSBFXCaps; + DWORD dwSSBRops[DD_ROP_SPACE]; + DWORD dwMaxVideoPorts; + DWORD dwCurrVideoPorts; + DWORD dwSVBCaps2; +} DDNTCORECAPS, *PDDNTCORECAPS; + + +typedef struct _DD_HALINFO_V4 +{ + DWORD dwSize; + VIDEOMEMORYINFO vmiData; + DDNTCORECAPS ddCaps; + PDD_GETDRIVERINFO GetDriverInfo; + DWORD dwFlags; +} DD_HALINFO_V4, *PDD_HALINFO_V4; + +typedef struct _DD_HALINFO +{ + DWORD dwSize; + VIDEOMEMORYINFO vmiData; + DDNTCORECAPS ddCaps; + PDD_GETDRIVERINFO GetDriverInfo; + DWORD dwFlags; + PVOID lpD3DGlobalDriverData; + PVOID lpD3DHALCallbacks; + PDD_D3DBUFCALLBACKS lpD3DBufCallbacks; +} DD_HALINFO, *PDD_HALINFO; + + + +typedef struct _DD_NONLOCALVIDMEMCAPS +{ + DWORD dwSize; + DWORD dwNLVBCaps; + DWORD dwNLVBCaps2; + DWORD dwNLVBCKeyCaps; + DWORD dwNLVBFXCaps; + DWORD dwNLVBRops[DD_ROP_SPACE]; +} DD_NONLOCALVIDMEMCAPS, *PDD_NONLOCALVIDMEMCAPS; + + + +typedef struct _DD_MORESURFACECAPS +{ + DWORD dwSize; + DDSCAPSEX ddsCapsMore; + struct tagNTExtendedHeapRestrictions + { + DDSCAPSEX ddsCapsEx; + DDSCAPSEX ddsCapsExAlt; + } ddsExtendedHeapRestrictions[1]; +} DD_MORESURFACECAPS, *PDD_MORESURFACECAPS; + + +/*********************************************************/ +/* Kernel Callbacks */ +/*********************************************************/ +typedef struct _DD_SYNCSURFACEDATA +{ + PDD_DIRECTDRAW_LOCAL lpDD; + PDD_SURFACE_LOCAL lpDDSurface; + DWORD dwSurfaceOffset; + ULONG_PTR fpLockPtr; + LONG lPitch; + DWORD dwOverlayOffset; + ULONG dwDriverReserved1; + ULONG dwDriverReserved2; + ULONG dwDriverReserved3; + ULONG dwDriverReserved4; + HRESULT ddRVal; +} DD_SYNCSURFACEDATA, *PDD_SYNCSURFACEDATA; +typedef DWORD (STDCALL *PDD_KERNELCB_SYNCSURFACE)(PDD_SYNCSURFACEDATA); + +typedef struct _DD_SYNCVIDEOPORTDATA +{ + PDD_DIRECTDRAW_LOCAL lpDD; + PDD_VIDEOPORT_LOCAL lpVideoPort; + DWORD dwOriginOffset; + DWORD dwHeight; + DWORD dwVBIHeight; + ULONG dwDriverReserved1; + ULONG dwDriverReserved2; + ULONG dwDriverReserved3; + HRESULT ddRVal; +} DD_SYNCVIDEOPORTDATA, *PDD_SYNCVIDEOPORTDATA; +typedef DWORD (STDCALL *PDD_KERNELCB_SYNCVIDEOPORT)(PDD_SYNCVIDEOPORTDATA); + + +typedef struct DD_NTPRIVATEDRIVERCAPS +{ + DWORD dwSize; + DWORD dwPrivateCaps; +} DD_NTPRIVATEDRIVERCAPS; + +typedef struct _DD_UPDATENONLOCALHEAPDATA +{ + PDD_DIRECTDRAW_GLOBAL lpDD; + DWORD dwHeap; + FLATPTR fpGARTLin; + FLATPTR fpGARTDev; + ULONG_PTR ulPolicyMaxBytes; + HRESULT ddRVal; + VOID* UpdateNonLocalHeap; +} DD_UPDATENONLOCALHEAPDATA, *PDD_UPDATENONLOCALHEAPDATA; + +typedef struct _DD_STEREOMODE +{ + DWORD dwSize; + DWORD dwHeight; + DWORD dwWidth; + DWORD dwBpp; + DWORD dwRefreshRate; + BOOL bSupported; +} DD_STEREOMODE, *PDD_STEREOMODE; + +typedef struct _DD_MORECAPS +{ + DWORD dwSize; + DWORD dwAlphaCaps; + DWORD dwSVBAlphaCaps; + DWORD dwVSBAlphaCaps; + DWORD dwSSBAlphaCaps; + DWORD dwFilterCaps; + DWORD dwSVBFilterCaps; + DWORD dwVSBFilterCaps; + DWORD dwSSBFilterCaps; +} DD_MORECAPS, *PDD_MORECAPS; + +typedef struct _DD_CLIPPER_GLOBAL +{ + ULONG_PTR dwReserved1; +} DD_CLIPPER_GLOBAL; + +typedef struct _DD_CLIPPER_LOCAL +{ + ULONG_PTR dwReserved1; +} DD_CLIPPER_LOCAL; + +typedef struct _DD_PALETTE_LOCAL +{ + ULONG dwReserved0; + ULONG_PTR dwReserved1; +} DD_PALETTE_LOCAL; + + +typedef struct DD_KERNELCALLBACKS +{ + DWORD dwSize; + DWORD dwFlags; + PDD_KERNELCB_SYNCSURFACE SyncSurfaceData; + PDD_KERNELCB_SYNCVIDEOPORT SyncVideoPortData; +} DD_KERNELCALLBACKS, *PDD_KERNELCALLBACKS; +typedef DWORD (STDCALL *PDD_KERNELCB_SYNCVIDEOPORT)(PDD_SYNCVIDEOPORTDATA); + + + +#define MAX_AUTOFLIP_BUFFERS 10 +#define DDSCAPS_EXECUTEBUFFER DDSCAPS_RESERVED2 +#define DDSCAPS_COMMANDBUFFER DDSCAPS_RESERVED3 +#define DDSCAPS_VERTEXBUFFER DDSCAPS_RESERVED4 +#define DDPF_D3DFORMAT 0x00200000l +#define D3DFORMAT_OP_TEXTURE 0x00000001L +#define D3DFORMAT_OP_VOLUMETEXTURE 0x00000002L +#define D3DFORMAT_OP_CUBETEXTURE 0x00000004L +#define D3DFORMAT_OP_OFFSCREEN_RENDERTARGET 0x00000008L +#define D3DFORMAT_OP_SAME_FORMAT_RENDERTARGET 0x00000010L +#define D3DFORMAT_OP_ZSTENCIL 0x00000040L +#define D3DFORMAT_OP_ZSTENCIL_WITH_ARBITRARY_COLOR_DEPTH 0x00000080L +#define D3DFORMAT_OP_SAME_FORMAT_UP_TO_ALPHA_RENDERTARGET 0x00000100L +#define D3DFORMAT_OP_DISPLAYMODE 0x00000400L +#define D3DFORMAT_OP_3DACCELERATION 0x00000800L +#define D3DFORMAT_OP_PIXELSIZE 0x00001000L +#define D3DFORMAT_OP_CONVERT_TO_ARGB 0x00002000L +#define D3DFORMAT_OP_OFFSCREENPLAIN 0x00004000L +#define D3DFORMAT_OP_SRGBREAD 0x00008000L +#define D3DFORMAT_OP_BUMPMAP 0x00010000L +#define D3DFORMAT_OP_DMAP 0x00020000L +#define D3DFORMAT_OP_NOFILTER 0x00040000L +#define D3DFORMAT_MEMBEROFGROUP_ARGB 0x00080000L +#define D3DFORMAT_OP_SRGBWRITE 0x00100000L +#define D3DFORMAT_OP_NOALPHABLEND 0x00200000L +#define D3DFORMAT_OP_AUTOGENMIPMAP 0x00400000L +#define D3DFORMAT_OP_VERTEXTEXTURE 0x00800000L +#define D3DFORMAT_OP_NOTEXCOORDWRAPNORMIP 0x01000000L + +#define DDHAL_PLEASEALLOC_BLOCKSIZE 0x00000002l +#define DDHAL_PLEASEALLOC_USERMEM 0x00000004l + +#define VIDMEM_ISLINEAR 0x00000001l +#define VIDMEM_ISRECTANGULAR 0x00000002l +#define VIDMEM_ISHEAP 0x00000004l +#define VIDMEM_ISNONLOCAL 0x00000008l +#define VIDMEM_ISWC 0x00000010l +#define VIDMEM_HEAPDISABLED 0x00000020l + +#define DDHAL_CREATESURFACEEX_SWAPHANDLES 0x00000001l + +#define DDHAL_KERNEL_SYNCSURFACEDATA 0x00000001l +#define DDHAL_KERNEL_SYNCVIDEOPORTDATA 0x00000002l + +#define DDHAL_DRIVER_NOTHANDLED 0x00000000l +#define DDHAL_DRIVER_HANDLED 0x00000001l +#define DDHAL_DRIVER_NOCKEYHW 0x00000002l + +#define DDRAWISURF_HASCKEYSRCBLT 0x00000800L +#define DDRAWISURF_HASPIXELFORMAT 0x00002000L +#define DDRAWISURF_HASOVERLAYDATA 0x00004000L +#define DDRAWISURF_FRONTBUFFER 0x04000000L +#define DDRAWISURF_BACKBUFFER 0x08000000L +#define DDRAWISURF_INVALID 0x10000000L +#define DDRAWISURF_DRIVERMANAGED 0x40000000L + +#define ROP_HAS_SOURCE 0x00000001l +#define ROP_HAS_PATTERN 0x00000002l +#define ROP_HAS_SOURCEPATTERN ROP_HAS_SOURCE | ROP_HAS_PATTERN + +#define DDHAL_EXEBUFCB32_CANCREATEEXEBUF 0x00000001l +#define DDHAL_EXEBUFCB32_CREATEEXEBUF 0x00000002l +#define DDHAL_EXEBUFCB32_DESTROYEXEBUF 0x00000004l +#define DDHAL_EXEBUFCB32_LOCKEXEBUF 0x00000008l +#define DDHAL_EXEBUFCB32_UNLOCKEXEBUF 0x00000010l + +#define DDHAL_D3DBUFCB32_CANCREATED3DBUF DDHAL_EXEBUFCB32_CANCREATEEXEBUF +#define DDHAL_D3DBUFCB32_CREATED3DBUF DDHAL_EXEBUFCB32_CREATEEXEBUF +#define DDHAL_D3DBUFCB32_DESTROYD3DBUF DDHAL_EXEBUFCB32_DESTROYEXEBUF +#define DDHAL_D3DBUFCB32_LOCKD3DBUF DDHAL_EXEBUFCB32_LOCKEXEBUF +#define DDHAL_D3DBUFCB32_UNLOCKD3DBUF DDHAL_EXEBUFCB32_UNLOCKEXEBUF + +#define DDHALINFO_GETDRIVERINFOSET 0x00000004l +#define DDHALINFO_GETDRIVERINFO2 0x00000008l + +#define DDRAWIVPORT_ON 0x00000001 +#define DDRAWIVPORT_SOFTWARE_AUTOFLIP 0x00000002 +#define DDRAWIVPORT_COLORKEYANDINTERP 0x00000004 + +#define DDHAL_PRIVATECAP_ATOMICSURFACECREATION 0x00000001l +#define DDHAL_PRIVATECAP_NOTIFYPRIMARYCREATION 0x00000002l +#define DDHAL_PRIVATECAP_RESERVED1 0x00000004l + +#define DDRAWI_VPORTSTART 0x0001 +#define DDRAWI_VPORTSTOP 0x0002 +#define DDRAWI_VPORTUPDATE 0x0003 +#define DDRAWI_VPORTGETCOLOR 0x0001 +#define DDRAWI_VPORTSETCOLOR 0x0002 + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __DD_INCLUDED__ */ diff --git a/reactos/include/ddk/dmemmgr.h b/reactos/include/ddk/dmemmgr.h new file mode 100644 index 00000000000..0276bfb5308 --- /dev/null +++ b/reactos/include/ddk/dmemmgr.h @@ -0,0 +1,150 @@ + +/* $Id: $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: + * PURPOSE: Directx headers + * PROGRAMMER: Magnus Olsen (greatlrd) + * + */ + +#ifndef __DMEMMGR_INCLUDED__ +#define __DMEMMGR_INCLUDED__ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef __NTDDKCOMP__ +typedef ULONG_PTR FLATPTR; +typedef struct _VIDMEM *LPVIDMEM; +#else +typedef ULONG_PTR FLATPTR; +typedef struct _VIDEOMEMORY *LPVIDMEM; +#endif + +#define SURFACEALIGN_DISCARDABLE 0x00000001 +#define VMEMHEAP_LINEAR 0x00000001 +#define VMEMHEAP_RECTANGULAR 0x00000002 +#define VMEMHEAP_ALIGNMENT 0x00000004 + +typedef struct _VMEML +{ + struct _VMEML *next; + FLATPTR ptr; + DWORD size; + BOOL bDiscardable; +} VMEML, *LPVMEML, *LPLPVMEML; + +typedef struct _VMEMR +{ + struct _VMEMR *next; + struct _VMEMR *prev; + + struct _VMEMR *pUp; + struct _VMEMR *pDown; + struct _VMEMR *pLeft; + struct _VMEMR *pRight; + FLATPTR ptr; + DWORD size; + DWORD x; + DWORD y; + DWORD cx; + DWORD cy; + DWORD flags; + FLATPTR pBits; + BOOL bDiscardable; +} VMEMR, *LPVMEMR, *LPLPVMEMR; + + +typedef struct _SURFACEALIGNMENT +{ + union + { + struct + { + DWORD dwStartAlignment; + DWORD dwPitchAlignment; + DWORD dwFlags; + DWORD dwReserved2; + } Linear; + struct + { + DWORD dwXAlignment; + DWORD dwYAlignment; + DWORD dwFlags; + DWORD dwReserved2; + } Rectangular; + }; +} SURFACEALIGNMENT, *LPSURFACEALIGNMENT; + +typedef struct _HEAPALIGNMENT +{ + DWORD dwSize; + DDSCAPS ddsCaps; + DWORD dwReserved; + SURFACEALIGNMENT ExecuteBuffer; + SURFACEALIGNMENT Overlay; + SURFACEALIGNMENT Texture; + SURFACEALIGNMENT ZBuffer; + SURFACEALIGNMENT AlphaBuffer; + SURFACEALIGNMENT Offscreen; + SURFACEALIGNMENT FlipTarget; +} HEAPALIGNMENT, *LPHEAPALIGNMENT; + + +typedef struct _VMEMHEAP +{ + DWORD dwFlags; + DWORD stride; + LPVOID freeList; + LPVOID allocList; + DWORD dwTotalSize; + FLATPTR fpGARTLin; + FLATPTR fpGARTDev; + DWORD dwCommitedSize; + DWORD dwCoalesceCount; + HEAPALIGNMENT Alignment; + DDSCAPSEX ddsCapsEx; + DDSCAPSEX ddsCapsExAlt; +#ifndef IS_16 + LARGE_INTEGER liPhysAGPBase; +#endif + HANDLE hdevAGP; + LPVOID pvPhysRsrv; + BYTE* pAgpCommitMask; + DWORD dwAgpCommitMaskSize; +} VMEMHEAP; + +typedef VMEMHEAP FAR *LPVMEMHEAP; + +typedef struct _DD_GETHEAPALIGNMENTDATA +{ + ULONG_PTR dwInstance; + DWORD dwHeap; + HRESULT ddRVal; + VOID* GetHeapAlignment; + HEAPALIGNMENT Alignment; +} DD_GETHEAPALIGNMENTDATA, *PDD_GETHEAPALIGNMENTDATA; + +extern void WINAPI VidMemFree( LPVMEMHEAP pvmh, FLATPTR ptr); + +extern FLATPTR WINAPI + HeapVidMemAllocAligned( + LPVIDMEM lpVidMem, + DWORD dwWidth, + DWORD dwHeight, + LPSURFACEALIGNMENT lpAlignment , + LPLONG lpNewPitch ); + + +#ifndef __NTDDKCOMP__ +extern FLATPTR WINAPI VidMemAlloc( LPVMEMHEAP pvmh, DWORD width, DWORD height); +#endif + +#ifdef __cplusplus +}; +#endif + +#endif diff --git a/reactos/include/ddk/dvp.h b/reactos/include/ddk/dvp.h new file mode 100644 index 00000000000..6c0507ade4f --- /dev/null +++ b/reactos/include/ddk/dvp.h @@ -0,0 +1,268 @@ + +/* $Id$ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: + * PURPOSE: Directx headers + * PROGRAMMER: Magnus Olsen (greatlrd) + * + */ + +#ifndef __DVP_INCLUDED__ +#define __DVP_INCLUDED__ + +DEFINE_GUID( IID_IDDVideoPortContainer, 0x6C142760,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); +DEFINE_GUID( IID_IDirectDrawVideoPort, 0xB36D93E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 ); +DEFINE_GUID( IID_IDirectDrawVideoPortNotify, 0xA655FB94,0x0589,0x4E57,0xB3,0x33,0x56,0x7A,0x89,0x46,0x8C,0x88); + +DEFINE_GUID( DDVPTYPE_E_HREFH_VREFH, 0x54F39980L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); +DEFINE_GUID( DDVPTYPE_E_HREFH_VREFL, 0x92783220L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); +DEFINE_GUID( DDVPTYPE_E_HREFL_VREFH, 0xA07A02E0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); +DEFINE_GUID( DDVPTYPE_E_HREFL_VREFL, 0xE09C77E0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); +DEFINE_GUID( DDVPTYPE_CCIR656, 0xFCA326A0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); +DEFINE_GUID( DDVPTYPE_BROOKTREE, 0x1352A560L,0xDA61,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); +DEFINE_GUID( DDVPTYPE_PHILIPS, 0x332CF160L,0xDA61,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); + + +typedef struct _DDVIDEOPORTCONNECT +{ + DWORD dwSize; + DWORD dwPortWidth; + GUID guidTypeID; + DWORD dwFlags; + ULONG_PTR dwReserved1; +} DDVIDEOPORTCONNECT; + +typedef struct _DDVIDEOPORTDESC { + DWORD dwSize; + DWORD dwFieldWidth; + DWORD dwVBIWidth; + DWORD dwFieldHeight; + DWORD dwMicrosecondsPerField; + DWORD dwMaxPixelsPerSecond; + DWORD dwVideoPortID; + DWORD dwReserved1; + DDVIDEOPORTCONNECT VideoPortType; + ULONG_PTR dwReserved2; + ULONG_PTR dwReserved3; +} DDVIDEOPORTDESC; + +typedef struct _DDVIDEOPORTBANDWIDTH +{ + DWORD dwSize; + DWORD dwOverlay; + DWORD dwColorkey; + DWORD dwYInterpolate; + DWORD dwYInterpAndColorkey; + ULONG_PTR dwReserved1; + ULONG_PTR dwReserved2; +} DDVIDEOPORTBANDWIDTH; + +typedef struct _DDVIDEOPORTCAPS +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwMaxWidth; + DWORD dwMaxVBIWidth; + DWORD dwMaxHeight; + DWORD dwVideoPortID; + DWORD dwCaps; + DWORD dwFX; + DWORD dwNumAutoFlipSurfaces; + DWORD dwAlignVideoPortBoundary; + DWORD dwAlignVideoPortPrescaleWidth; + DWORD dwAlignVideoPortCropBoundary; + DWORD dwAlignVideoPortCropWidth; + DWORD dwPreshrinkXStep; + DWORD dwPreshrinkYStep; + DWORD dwNumVBIAutoFlipSurfaces; + DWORD dwNumPreferredAutoflip; + WORD wNumFilterTapsX; + WORD wNumFilterTapsY; +} DDVIDEOPORTCAPS; + +typedef struct _DDVIDEOPORTINFO +{ + DWORD dwSize; + DWORD dwOriginX; + DWORD dwOriginY; + DWORD dwVPFlags; + RECT rCrop; + DWORD dwPrescaleWidth; + DWORD dwPrescaleHeight; + LPDDPIXELFORMAT lpddpfInputFormat; + LPDDPIXELFORMAT lpddpfVBIInputFormat; + LPDDPIXELFORMAT lpddpfVBIOutputFormat; + DWORD dwVBIHeight; + ULONG_PTR dwReserved1; + ULONG_PTR dwReserved2; +} DDVIDEOPORTINFO; + +typedef struct _DDVIDEOPORTSTATUS +{ + DWORD dwSize; + BOOL bInUse; + DWORD dwFlags; + DWORD dwReserved1; + DDVIDEOPORTCONNECT VideoPortType; + ULONG_PTR dwReserved2; + ULONG_PTR dwReserved3; +} DDVIDEOPORTSTATUS; + +typedef struct _DDVIDEOPORTNOTIFY +{ + LARGE_INTEGER ApproximateTimeStamp; + LONG lField; + UINT dwSurfaceIndex; + LONG lDone; +} DDVIDEOPORTNOTIFY; + + +#define DDVPCONNECT_DOUBLECLOCK 0x00000001 +#define DDVPCONNECT_VACT 0x00000002 +#define DDVPCONNECT_INVERTPOLARITY 0x00000004 +#define DDVPCONNECT_DISCARDSVREFDATA 0x00000008 +#define DDVPCONNECT_HALFLINE 0x00000010 +#define DDVPCONNECT_INTERLACED 0x00000020 +#define DDVPCONNECT_SHAREEVEN 0x00000040 +#define DDVPCONNECT_SHAREODD 0x00000080 +#define DDVPCAPS_AUTOFLIP 0x00000001 +#define DDVPCAPS_INTERLACED 0x00000002 +#define DDVPCAPS_NONINTERLACED 0x00000004 +#define DDVPCAPS_READBACKFIELD 0x00000008 +#define DDVPCAPS_READBACKLINE 0x00000010 +#define DDVPCAPS_SHAREABLE 0x00000020 +#define DDVPCAPS_SKIPEVENFIELDS 0x00000040 +#define DDVPCAPS_SKIPODDFIELDS 0x00000080 +#define DDVPCAPS_SYNCMASTER 0x00000100 +#define DDVPCAPS_VBISURFACE 0x00000200 +#define DDVPCAPS_COLORCONTROL 0x00000400 +#define DDVPCAPS_OVERSAMPLEDVBI 0x00000800 +#define DDVPCAPS_SYSTEMMEMORY 0x00001000 +#define DDVPCAPS_VBIANDVIDEOINDEPENDENT 0x00002000 +#define DDVPCAPS_HARDWAREDEINTERLACE 0x00004000 +#define DDVPFX_CROPTOPDATA 0x00000001 +#define DDVPFX_CROPX 0x00000002 +#define DDVPFX_CROPY 0x00000004 +#define DDVPFX_INTERLEAVE 0x00000008 +#define DDVPFX_MIRRORLEFTRIGHT 0x00000010 +#define DDVPFX_MIRRORUPDOWN 0x00000020 +#define DDVPFX_PRESHRINKX 0x00000040 +#define DDVPFX_PRESHRINKY 0x00000080 +#define DDVPFX_PRESHRINKXB 0x00000100 +#define DDVPFX_PRESHRINKYB 0x00000200 +#define DDVPFX_PRESHRINKXS 0x00000400 +#define DDVPFX_PRESHRINKYS 0x00000800 +#define DDVPFX_PRESTRETCHX 0x00001000 +#define DDVPFX_PRESTRETCHY 0x00002000 +#define DDVPFX_PRESTRETCHXN 0x00004000 +#define DDVPFX_PRESTRETCHYN 0x00008000 +#define DDVPFX_VBICONVERT 0x00010000 +#define DDVPFX_VBINOSCALE 0x00020000 +#define DDVPFX_IGNOREVBIXCROP 0x00040000 +#define DDVPFX_VBINOINTERLEAVE 0x00080000 +#define DDVP_AUTOFLIP 0x00000001 +#define DDVP_CONVERT 0x00000002 +#define DDVP_CROP 0x00000004 +#define DDVP_INTERLEAVE 0x00000008 +#define DDVP_MIRRORLEFTRIGHT 0x00000010 +#define DDVP_MIRRORUPDOWN 0x00000020 +#define DDVP_PRESCALE 0x00000040 +#define DDVP_SKIPEVENFIELDS 0x00000080 +#define DDVP_SKIPODDFIELDS 0x00000100 +#define DDVP_SYNCMASTER 0x00000200 +#define DDVP_VBICONVERT 0x00000400 +#define DDVP_VBINOSCALE 0x00000800 +#define DDVP_OVERRIDEBOBWEAVE 0x00001000 +#define DDVP_IGNOREVBIXCROP 0x00002000 +#define DDVP_VBINOINTERLEAVE 0x00004000 +#define DDVP_HARDWAREDEINTERLACE 0x00008000 +#define DDVPFORMAT_VIDEO 0x00000001 +#define DDVPFORMAT_VBI 0x00000002 +#define DDVPTARGET_VIDEO 0x00000001 +#define DDVPTARGET_VBI 0x00000002 +#define DDVPWAIT_BEGIN 0x00000001 +#define DDVPWAIT_END 0x00000002 +#define DDVPWAIT_LINE 0x00000003 +#define DDVPFLIP_VIDEO 0x00000001 +#define DDVPFLIP_VBI 0x00000002 +#define DDVPSQ_NOSIGNAL 0x00000001 +#define DDVPSQ_SIGNALOK 0x00000002 +#define DDVPB_VIDEOPORT 0x00000001 +#define DDVPB_OVERLAY 0x00000002 +#define DDVPB_TYPE 0x00000004 +#define DDVPBCAPS_SOURCE 0x00000001 +#define DDVPBCAPS_DESTINATION 0x00000002 +#define DDVPCREATE_VBIONLY 0x00000001 +#define DDVPCREATE_VIDEOONLY 0x00000002 +#define DDVPSTATUS_VBIONLY 0x00000001 +#define DDVPSTATUS_VIDEOONLY 0x00000002 + +typedef struct _DDVIDEOPORTCONNECT *LPDDVIDEOPORTCONNECT; +typedef struct _DDVIDEOPORTCAPS *LPDDVIDEOPORTCAPS; +typedef struct _DDVIDEOPORTDESC *LPDDVIDEOPORTDESC; +typedef struct _DDVIDEOPORTINFO *LPDDVIDEOPORTINFO; +typedef struct _DDVIDEOPORTBANDWIDTH *LPDDVIDEOPORTBANDWIDTH; +typedef struct _DDVIDEOPORTSTATUS *LPDDVIDEOPORTSTATUS; +typedef struct _DDVIDEOPORTNOTIFY *LPDDVIDEOPORTNOTIFY; + +typedef struct IDirectDrawVideoPort* LPDIRECTDRAWVIDEOPORT; +typedef struct IDDVideoPortContainer* LPDDVIDEOPORTCONTAINER; +typedef struct IDirectDrawVideoPortNotify* LPDIRECTDRAWVIDEOPORTNOTIFY; + +typedef HRESULT (FAR PASCAL * LPDDENUMVIDEOCALLBACK)(LPDDVIDEOPORTCAPS, LPVOID); + +#if !defined (_NO_COM) && defined (_WIN32) + +#undef INTERFACE +#define INTERFACE IDDVideoPortContainer +DECLARE_INTERFACE_ (IDDVideoPortContainer, IUnknown) +{ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD(CreateVideoPort)(THIS_ DWORD, LPDDVIDEOPORTDESC, LPDIRECTDRAWVIDEOPORT*, IUnknown*) PURE; + STDMETHOD(EnumVideoPorts) (THIS_ DWORD, LPDDVIDEOPORTCAPS, LPVOID, LPDDENUMVIDEOCALLBACK) PURE; + STDMETHOD(GetVideoPortConnectInfo) (THIS_ DWORD, LPDWORD, LPDDVIDEOPORTCONNECT) PURE; + STDMETHOD(QueryVideoPortStatus) (THIS_ DWORD, LPDDVIDEOPORTSTATUS) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirectDrawVideoPort +DECLARE_INTERFACE_ (IDirectDrawVideoPort, IUnknown) +{ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD(Flip) (THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE; + STDMETHOD(GetBandwidthInfo)(THIS_ LPDDPIXELFORMAT, DWORD, DWORD, DWORD, LPDDVIDEOPORTBANDWIDTH) PURE; + STDMETHOD(GetColorControls) (THIS_ LPDDCOLORCONTROL) PURE; + STDMETHOD(GetInputFormats)(THIS_ LPDWORD, LPDDPIXELFORMAT, DWORD) PURE; + STDMETHOD(GetOutputFormats)(THIS_ LPDDPIXELFORMAT, LPDWORD, LPDDPIXELFORMAT, DWORD) PURE; + STDMETHOD(GetFieldPolarity) (THIS_ LPBOOL) PURE; + STDMETHOD(GetVideoLine) (THIS_ LPDWORD) PURE; + STDMETHOD(GetVideoSignalStatus) (THIS_ LPDWORD) PURE; + STDMETHOD(SetColorControls) (THIS_ LPDDCOLORCONTROL) PURE; + STDMETHOD(SetTargetSurface) (THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE; + STDMETHOD(StartVideo) (THIS_ LPDDVIDEOPORTINFO) PURE; + STDMETHOD(StopVideo) (THIS) PURE; + STDMETHOD(UpdateVideo) (THIS_ LPDDVIDEOPORTINFO) PURE; + STDMETHOD(WaitForSync) (THIS_ DWORD, DWORD, DWORD) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirectDrawVideoPortNotify +DECLARE_INTERFACE_( IDirectDrawVideoPortNotify, IUnknown ) +{ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD(AcquireNotification) (THIS_ HANDLE*, LPDDVIDEOPORTNOTIFY) PURE; + STDMETHOD(ReleaseNotification) (THIS_ HANDLE) PURE; +}; + +#undef INTERFACE + +#endif // !defined (_NO_COM) && defined (_WIN32) +#endif // __DVP_INCLUDED__ diff --git a/reactos/include/ddk/hidclass.h b/reactos/include/ddk/hidclass.h new file mode 100644 index 00000000000..6e41a9013e4 --- /dev/null +++ b/reactos/include/ddk/hidclass.h @@ -0,0 +1,152 @@ +/* + * hidclass.h + * + * HID class driver interface + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __HIDCLASS_H +#define __HIDCLASS_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include "hidpi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define HID_REVISION 0x00000001 + +DEFINE_GUID (GUID_DEVINTERFACE_HID, \ + 0x4D1E55B2L, 0xF16F, 0x11CF, 0x88, 0xCB, 0x00, 0x11, 0x11, 0x00, 0x00, 0x30); +DEFINE_GUID (GUID_HID_INTERFACE_NOTIFY, \ + 0x2c4e2e88L, 0x25e6, 0x4c33, 0x88, 0x2f, 0x3d, 0x82, 0xe6, 0x07, 0x36, 0x81); +DEFINE_GUID (GUID_HID_INTERFACE_HIDPARSE, \ + 0xf5c315a5, 0x69ac, 0x4bc2, 0x92, 0x79, 0xd0, 0xb6, 0x45, 0x76, 0xf4, 0x4b); + +#define GUID_CLASS_INPUT GUID_DEVINTERFACE_HID + +#define GUID_CLASS_INPUT_STR "4D1E55B2-F16F-11CF-88CB-001111000030" + + +#define HID_CTL_CODE(id) \ + CTL_CODE (FILE_DEVICE_KEYBOARD, (id), METHOD_NEITHER, FILE_ANY_ACCESS) +#define HID_BUFFER_CTL_CODE(id) \ + CTL_CODE (FILE_DEVICE_KEYBOARD, (id), METHOD_BUFFERED, FILE_ANY_ACCESS) +#define HID_IN_CTL_CODE(id) \ + CTL_CODE (FILE_DEVICE_KEYBOARD, (id), METHOD_IN_DIRECT, FILE_ANY_ACCESS) +#define HID_OUT_CTL_CODE(id) \ + CTL_CODE (FILE_DEVICE_KEYBOARD, (id), METHOD_OUT_DIRECT, FILE_ANY_ACCESS) + + +#define IOCTL_GET_PHYSICAL_DESCRIPTOR HID_OUT_CTL_CODE(102) +#define IOCTL_HID_FLUSH_QUEUE HID_CTL_CODE(101) +#define IOCTL_HID_GET_COLLECTION_DESCRIPTOR HID_CTL_CODE(100) +#define IOCTL_HID_GET_COLLECTION_INFORMATION HID_BUFFER_CTL_CODE(106) +#define IOCTL_HID_GET_FEATURE HID_OUT_CTL_CODE(100) +#define IOCTL_HID_GET_HARDWARE_ID HID_OUT_CTL_CODE(103) +#define IOCTL_HID_GET_INDEXED_STRING HID_OUT_CTL_CODE(120) +#define IOCTL_HID_GET_INPUT_REPORT HID_OUT_CTL_CODE(104) +#define IOCTL_HID_GET_MANUFACTURER_STRING HID_OUT_CTL_CODE(110) +#define IOCTL_GET_NUM_DEVICE_INPUT_BUFFERS HID_BUFFER_CTL_CODE(104) +#define IOCTL_HID_GET_POLL_FREQUENCY_MSEC HID_BUFFER_CTL_CODE(102) +#define IOCTL_HID_GET_PRODUCT_STRING HID_OUT_CTL_CODE(111) +#define IOCTL_HID_GET_SERIALNUMBER_STRING HID_OUT_CTL_CODE(112) +#define IOCTL_HID_SET_FEATURE HID_IN_CTL_CODE(100) +#define IOCTL_SET_NUM_DEVICE_INPUT_BUFFERS HID_BUFFER_CTL_CODE(105) +#define IOCTL_HID_SET_OUTPUT_REPORT HID_IN_CTL_CODE(101) +#define IOCTL_HID_SET_POLL_FREQUENCY_MSEC HID_BUFFER_CTL_CODE(103) + +#define IOCTL_HID_GET_DRIVER_CONFIG HID_BUFFER_CTL_CODE(100) +#define IOCTL_HID_SET_DRIVER_CONFIG HID_BUFFER_CTL_CODE(101) +#define IOCTL_HID_GET_MS_GENRE_DESCRIPTOR HID_OUT_CTL_CODE(121) + + +enum DeviceObjectState { + DeviceObjectStarted = 0, + DeviceObjectStopped, + DeviceObjectRemoved +}; + +typedef VOID DDKAPI (*PHID_STATUS_CHANGE)( + PVOID Context, + enum DeviceObjectState State); + +typedef NTSTATUS DDKAPI (*PHIDP_GETCAPS)( + IN PHIDP_PREPARSED_DATA PreparsedData, + OUT PHIDP_CAPS Capabilities); + +typedef struct _HID_COLLECTION_INFORMATION { + ULONG DescriptorSize; + BOOLEAN Polled; + UCHAR Reserved1[1]; + USHORT VendorID; + USHORT ProductID; + USHORT VersionNumber; +} HID_COLLECTION_INFORMATION, *PHID_COLLECTION_INFORMATION; + +typedef struct _HID_DRIVER_CONFIG { + ULONG Size; + ULONG RingBufferSize; +} HID_DRIVER_CONFIG, *PHID_DRIVER_CONFIG; + +typedef struct _HID_INTERFACE_HIDPARSE { +#ifdef __cplusplus + INTERFACE i; +#else + /* GCC doesn't support including unnamed structs, so INTERFACE is + expanded here */ + USHORT Size; + USHORT Version; + PVOID Context; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; +#endif + PHIDP_GETCAPS HidpGetCaps; +} HID_INTERFACE_HIDPARSE, *PHID_INTERFACE_HIDPARSE; + +typedef struct _HID_INTERFACE_NOTIFY_PNP { +#ifdef __cplusplus + INTERFACE i; +#else + /* GCC doesn't support including unnamed structs, so INTERFACE is + expanded here */ + USHORT Size; + USHORT Version; + PVOID Context; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; +#endif + PHID_STATUS_CHANGE StatusChangeFn; + PVOID CallbackContext; +} HID_INTERFACE_NOTIFY_PNP, *PHID_INTERFACE_NOTIFY_PNP; + +typedef struct _HID_XFER_PACKET { + PUCHAR reportBuffer; + ULONG reportBufferLen; + UCHAR reportId; +} HID_XFER_PACKET, *PHID_XFER_PACKET; + +#ifdef __cplusplus +} +#endif + +#endif /* __HIDCLASS_H */ diff --git a/reactos/include/ddk/hidpi.h b/reactos/include/ddk/hidpi.h new file mode 100644 index 00000000000..3c19e36816f --- /dev/null +++ b/reactos/include/ddk/hidpi.h @@ -0,0 +1,634 @@ +/* + * hidpi.h + * + * Public Interface for HID parsing library. + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __HIDPI_H +#define __HIDPI_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include "hidusage.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(_HIDPI_) + #define HIDAPI DECLSPEC_EXPORT +#else + #define HIDAPI DECLSPEC_IMPORT +#endif + +typedef PUCHAR PHIDP_REPORT_DESCRIPTOR; +typedef struct _HIDP_PREPARSED_DATA * PHIDP_PREPARSED_DATA; + +typedef struct _HIDP_UNKNOWN_TOKEN { + UCHAR Token; + UCHAR Reserved[3]; + ULONG BitField; +} HIDP_UNKNOWN_TOKEN, *PHIDP_UNKNOWN_TOKEN; + +typedef enum _HIDP_KEYBOARD_DIRECTION { + HidP_Keyboard_Break, + HidP_Keyboard_Make +} HIDP_KEYBOARD_DIRECTION; + +typedef struct _HIDP_KEYBOARD_MODIFIER_STATE { + _ANONYMOUS_UNION union { + _ANONYMOUS_STRUCT struct { + ULONG LeftControl : 1; + ULONG LeftShift : 1; + ULONG LeftAlt : 1; + ULONG LeftGUI : 1; + ULONG RightControl : 1; + ULONG RightShift : 1; + ULONG RightAlt : 1; + ULONG RigthGUI : 1; + ULONG CapsLock : 1; + ULONG ScollLock : 1; + ULONG NumLock : 1; + ULONG Reserved : 21; + } DUMMYSTRUCTNAME; + ULONG ul; + } DUMMYUNIONNAME; +} HIDP_KEYBOARD_MODIFIER_STATE, *PHIDP_KEYBOARD_MODIFIER_STATE; + +typedef BOOLEAN (DDKAPI *PHIDP_INSERT_SCANCODES)( + IN PVOID Context, + IN PCHAR NewScanCodes, + IN ULONG Length); + +typedef struct _USAGE_AND_PAGE { + USAGE Usage; + USAGE UsagePage; +} USAGE_AND_PAGE, *PUSAGE_AND_PAGE; + +typedef struct _HIDD_ATTRIBUTES { + ULONG Size; + USHORT VendorID; + USHORT ProductID; + USHORT VersionNumber; +} HIDD_ATTRIBUTES, *PHIDD_ATTRIBUTES; + +typedef struct _HIDD_CONFIGURATION { + PVOID cookie; + ULONG size; + ULONG RingBufferSize; +} HIDD_CONFIGURATION, *PHIDD_CONFIGURATION; + +HIDAPI +NTSTATUS +DDKAPI +HidP_TranslateUsageAndPagesToI8042ScanCodes( + IN PUSAGE_AND_PAGE ChangedUsageList, + IN ULONG UsageListLength, + IN HIDP_KEYBOARD_DIRECTION KeyAction, + IN OUT PHIDP_KEYBOARD_MODIFIER_STATE ModifierState, + IN PHIDP_INSERT_SCANCODES InsertCodesProcedure, + IN PVOID InsertCodesContext); + +HIDAPI +NTSTATUS +DDKAPI +HidP_TranslateUsagesToI8042ScanCodes( + IN PUSAGE ChangedUsageList, + IN ULONG UsageListLength, + IN HIDP_KEYBOARD_DIRECTION KeyAction, + IN OUT PHIDP_KEYBOARD_MODIFIER_STATE ModifierState, + IN PHIDP_INSERT_SCANCODES InsertCodesProcedure, + IN PVOID InsertCodesContext); + +typedef struct _HIDP_BUTTON_CAPS { + USAGE UsagePage; + UCHAR ReportID; + BOOLEAN IsAlias; + USHORT BitField; + USHORT LinkCollection; + USAGE LinkUsage; + USAGE LinkUsagePage; + BOOLEAN IsRange; + BOOLEAN IsStringRange; + BOOLEAN IsDesignatorRange; + BOOLEAN IsAbsolute; + ULONG Reserved[10]; + _ANONYMOUS_UNION union { + struct { + USAGE UsageMin, UsageMax; + USHORT StringMin, StringMax; + USHORT DesignatorMin, DesignatorMax; + USHORT DataIndexMin, DataIndexMax; + } Range; + struct { + USAGE Usage, Reserved1; + USHORT StringIndex, Reserved2; + USHORT DesignatorIndex, Reserved3; + USHORT DataIndex, Reserved4; + } NotRange; + } DUMMYUNIONNAME; +} HIDP_BUTTON_CAPS, *PHIDP_BUTTON_CAPS; + +typedef struct _HIDP_CAPS { + USAGE Usage; + USAGE UsagePage; + USHORT InputReportByteLength; + USHORT OutputReportByteLength; + USHORT FeatureReportByteLength; + USHORT Reserved[17]; + USHORT NumberLinkCollectionNodes; + USHORT NumberInputButtonCaps; + USHORT NumberInputValueCaps; + USHORT NumberInputDataIndices; + USHORT NumberOutputButtonCaps; + USHORT NumberOutputValueCaps; + USHORT NumberOutputDataIndices; + USHORT NumberFeatureButtonCaps; + USHORT NumberFeatureValueCaps; + USHORT NumberFeatureDataIndices; +} HIDP_CAPS, *PHIDP_CAPS; + +typedef struct _HIDP_DATA { + USHORT DataIndex; + USHORT Reserved; + _ANONYMOUS_UNION union { + ULONG RawValue; + BOOLEAN On; + } DUMMYUNIONNAME; +} HIDP_DATA, *PHIDP_DATA; + +typedef struct _HIDP_EXTENDED_ATTRIBUTES { + UCHAR NumGlobalUnknowns; + UCHAR Reserved[3]; + PHIDP_UNKNOWN_TOKEN GlobalUnknowns; + ULONG Data[1]; +} HIDP_EXTENDED_ATTRIBUTES, *PHIDP_EXTENDED_ATTRIBUTES; + +#define HIDP_LINK_COLLECTION_ROOT ((USHORT) -1) +#define HIDP_LINK_COLLECTION_UNSPECIFIED ((USHORT) 0) + +typedef struct _HIDP_LINK_COLLECTION_NODE { + USAGE LinkUsage; + USAGE LinkUsagePage; + USHORT Parent; + USHORT NumberOfChildren; + USHORT NextSibling; + USHORT FirstChild; + ULONG CollectionType: 8; + ULONG IsAlias: 1; + ULONG Reserved: 23; + PVOID UserContext; +} HIDP_LINK_COLLECTION_NODE, *PHIDP_LINK_COLLECTION_NODE; + +typedef struct _HIDP_VALUE_CAPS { + USAGE UsagePage; + UCHAR ReportID; + BOOLEAN IsAlias; + USHORT BitField; + USHORT LinkCollection; + USAGE LinkUsage; + USAGE LinkUsagePage; + BOOLEAN IsRange; + BOOLEAN IsStringRange; + BOOLEAN IsDesignatorRange; + BOOLEAN IsAbsolute; + BOOLEAN HasNull; + UCHAR Reserved; + USHORT BitSize; + USHORT ReportCount; + USHORT Reserved2[5]; + ULONG UnitsExp; + ULONG Units; + LONG LogicalMin, LogicalMax; + LONG PhysicalMin, PhysicalMax; + _ANONYMOUS_UNION union { + struct { + USAGE UsageMin, UsageMax; + USHORT StringMin, StringMax; + USHORT DesignatorMin, DesignatorMax; + USHORT DataIndexMin, DataIndexMax; + } Range; + struct { + USAGE Usage, Reserved1; + USHORT StringIndex, Reserved2; + USHORT DesignatorIndex, Reserved3; + USHORT DataIndex, Reserved4; + } NotRange; + } DUMMYUNIONNAME; +} HIDP_VALUE_CAPS, *PHIDP_VALUE_CAPS; + +typedef enum _HIDP_REPORT_TYPE { + HidP_Input, + HidP_Output, + HidP_Feature +} HIDP_REPORT_TYPE; + +#define FACILITY_HID_ERROR_CODE 0x11 + +#define HIDP_ERROR_CODES(SEV, CODE) \ + ((NTSTATUS) (((SEV) << 28) | (FACILITY_HID_ERROR_CODE << 16) | (CODE))) + +#define HIDP_STATUS_SUCCESS (HIDP_ERROR_CODES(0x0, 0)) +#define HIDP_STATUS_NULL (HIDP_ERROR_CODES(0x8, 1)) +#define HIDP_STATUS_INVALID_PREPARSED_DATA (HIDP_ERROR_CODES(0xC, 1)) +#define HIDP_STATUS_INVALID_REPORT_TYPE (HIDP_ERROR_CODES(0xC, 2)) +#define HIDP_STATUS_INVALID_REPORT_LENGTH (HIDP_ERROR_CODES(0xC, 3)) +#define HIDP_STATUS_USAGE_NOT_FOUND (HIDP_ERROR_CODES(0xC, 4)) +#define HIDP_STATUS_VALUE_OUT_OF_RANGE (HIDP_ERROR_CODES(0xC, 5)) +#define HIDP_STATUS_BAD_LOG_PHY_VALUES (HIDP_ERROR_CODES(0xC, 6)) +#define HIDP_STATUS_BUFFER_TOO_SMALL (HIDP_ERROR_CODES(0xC, 7)) +#define HIDP_STATUS_INTERNAL_ERROR (HIDP_ERROR_CODES(0xC, 8)) +#define HIDP_STATUS_I8042_TRANS_UNKNOWN (HIDP_ERROR_CODES(0xC, 9)) +#define HIDP_STATUS_INCOMPATIBLE_REPORT_ID (HIDP_ERROR_CODES(0xC, 0xA)) +#define HIDP_STATUS_NOT_VALUE_ARRAY (HIDP_ERROR_CODES(0xC, 0xB)) +#define HIDP_STATUS_IS_VALUE_ARRAY (HIDP_ERROR_CODES(0xC, 0xC)) +#define HIDP_STATUS_DATA_INDEX_NOT_FOUND (HIDP_ERROR_CODES(0xC, 0xD)) +#define HIDP_STATUS_DATA_INDEX_OUT_OF_RANGE (HIDP_ERROR_CODES(0xC, 0xE)) +#define HIDP_STATUS_BUTTON_NOT_PRESSED (HIDP_ERROR_CODES(0xC, 0xF)) +#define HIDP_STATUS_REPORT_DOES_NOT_EXIST (HIDP_ERROR_CODES(0xC, 0x10)) +#define HIDP_STATUS_NOT_IMPLEMENTED (HIDP_ERROR_CODES(0xC, 0x20)) +#define HIDP_STATUS_I8242_TRANS_UNKNOWN HIDP_STATUS_I8042_TRANS_UNKNOWN + + +#if !defined(_HIDPI_NO_FUNCTION_MACROS_) +/* + * NTSTATUS + * HidP_GetButtonCaps( + * IN HIDP_REPORT_TYPE ReportType, + * OUT PHIDP_BUTTON_CAPS ButtonCaps, + * IN OUT PULONG ButtonCapsLength, + * IN PHIDP_PREPARSED_DATA PreparsedData); + */ +#define HidP_GetButtonCaps(_Type_, _Caps_, _Len_, _Data_) \ + HidP_GetSpecificButtonCaps(_Type_, 0, 0, 0, _Caps_, _Len_, _Data_) + +/* + * NTSTATUS + * HidP_GetButtons( + * IN HIDP_REPORT_TYPE ReportType, + * IN USAGE UsagePage, + * IN USHORT LinkCollection, + * OUT USAGE *UsageList, + * IN OUT ULONG *UsageLength, + * IN PHIDP_PREPARSED_DATA PreparsedData, + * IN PCHAR Report, + * IN ULONG ReportLength); + */ +#define HidP_GetButtons(Rty, UPa, LCo, ULi, ULe, Ppd, Rep, RLe) \ + HidP_GetUsages(Rty, UPa, LCo, ULi, ULe, Ppd, Rep, RLe) + +#define HidP_GetButtonListLength(RTy, UPa, Ppd) \ + HidP_GetUsageListLength(Rty, UPa, Ppd) + + +/* + * NTSTATUS + * HidP_GetButtonsEx( + * IN HIDP_REPORT_TYPE ReportType, + * IN USHORT LinkCollection, + * OUT PUSAGE_AND_PAGE ButtonList, + * IN OUT ULONG *UsageLength, + * IN PHIDP_PREPARSED_DATA PreparsedData, + * IN PCHAR Report, + * IN ULONG ReportLength); + */ +#define HidP_GetButtonsEx(RT, LC, BL, UL, PD, R, RL) \ + HidP_GetUsagesEx(RT, LC, BL, UL, PD, R, RL) + +#endif /* _HIDPI_NO_FUNCTION_MACROS_ */ + +HIDAPI +NTSTATUS +DDKAPI +HidP_GetCaps( + IN PHIDP_PREPARSED_DATA PreparsedData, + OUT PHIDP_CAPS Capabilities); + +HIDAPI +NTSTATUS +DDKAPI +HidP_GetData( + IN HIDP_REPORT_TYPE ReportType, + OUT PHIDP_DATA DataList, + IN OUT PULONG DataLength, + IN PHIDP_PREPARSED_DATA PreparsedData, + IN PCHAR Report, + IN ULONG ReportLength); + +HIDAPI +NTSTATUS +DDKAPI +HidP_GetExtendedAttributes( + IN HIDP_REPORT_TYPE ReportType, + IN USHORT DataIndex, + IN PHIDP_PREPARSED_DATA PreparsedData, + OUT PHIDP_EXTENDED_ATTRIBUTES Attributes, + IN OUT PULONG LengthAttributes); + +HIDAPI +NTSTATUS +DDKAPI +HidP_GetLinkCollectionNodes( + OUT PHIDP_LINK_COLLECTION_NODE LinkCollectionNodes, + IN OUT PULONG LinkCollectionNodesLength, + IN PHIDP_PREPARSED_DATA PreparsedData); + +HIDAPI +NTSTATUS +DDKAPI +HidP_GetScaledUsageValue( + IN HIDP_REPORT_TYPE ReportType, + IN USAGE UsagePage, + IN USHORT LinkCollection OPTIONAL, + IN USAGE Usage, + OUT PLONG UsageValue, + IN PHIDP_PREPARSED_DATA PreparsedData, + IN PCHAR Report, + IN ULONG ReportLength); + +HIDAPI +NTSTATUS +DDKAPI +HidP_GetSpecificButtonCaps( + IN HIDP_REPORT_TYPE ReportType, + IN USAGE UsagePage, + IN USHORT LinkCollection, + IN USAGE Usage, + OUT PHIDP_BUTTON_CAPS ButtonCaps, + IN OUT PULONG ButtonCapsLength, + IN PHIDP_PREPARSED_DATA PreparsedData); + +HIDAPI +NTSTATUS +DDKAPI +HidP_GetSpecificValueCaps( + IN HIDP_REPORT_TYPE ReportType, + IN USAGE UsagePage, + IN USHORT LinkCollection, + IN USAGE Usage, + OUT PHIDP_VALUE_CAPS ValueCaps, + IN OUT PULONG ValueCapsLength, + IN PHIDP_PREPARSED_DATA PreparsedData); + +HIDAPI +NTSTATUS +DDKAPI +HidP_GetUsages( + IN HIDP_REPORT_TYPE ReportType, + IN USAGE UsagePage, + IN USHORT LinkCollection OPTIONAL, + OUT USAGE *UsageList, + IN OUT ULONG *UsageLength, + IN PHIDP_PREPARSED_DATA PreparsedData, + IN PCHAR Report, + IN ULONG ReportLength); + +HIDAPI +NTSTATUS +DDKAPI +HidP_GetUsagesEx( + IN HIDP_REPORT_TYPE ReportType, + IN USHORT LinkCollection, + OUT PUSAGE_AND_PAGE ButtonList, + IN OUT ULONG *UsageLength, + IN PHIDP_PREPARSED_DATA PreparsedData, + IN PCHAR Report, + IN ULONG ReportLength); + +HIDAPI +NTSTATUS +DDKAPI +HidP_GetUsageValue( + IN HIDP_REPORT_TYPE ReportType, + IN USAGE UsagePage, + IN USHORT LinkCollection, + IN USAGE Usage, + OUT PULONG UsageValue, + IN PHIDP_PREPARSED_DATA PreparsedData, + IN PCHAR Report, + IN ULONG ReportLength); + +HIDAPI +NTSTATUS +DDKAPI +HidP_GetUsageValueArray( + IN HIDP_REPORT_TYPE ReportType, + IN USAGE UsagePage, + IN USHORT LinkCollection OPTIONAL, + IN USAGE Usage, + OUT PCHAR UsageValue, + IN USHORT UsageValueByteLength, + IN PHIDP_PREPARSED_DATA PreparsedData, + IN PCHAR Report, + IN ULONG ReportLength); + +#if !defined(_HIDPI_NO_FUNCTION_MACROS_) + +/* + * NTSTATUS + * HidP_GetValueCaps( + * IN HIDP_REPORT_TYPE ReportType, + * OUT PHIDP_VALUE_CAPS ValueCaps, + * IN OUT PULONG ValueCapsLength, + * IN PHIDP_PREPARSED_DATA PreparsedData); + */ +#define HidP_GetValueCaps(_Type_, _Caps_, _Len_, _Data_) \ + HidP_GetSpecificValueCaps (_Type_, 0, 0, 0, _Caps_, _Len_, _Data_) + +#endif /* _HIDPI_NO_FUNCTION_MACROS_ */ + +HIDAPI +NTSTATUS +DDKAPI +HidP_InitializeReportForID( + IN HIDP_REPORT_TYPE ReportType, + IN UCHAR ReportID, + IN PHIDP_PREPARSED_DATA PreparsedData, + IN OUT PCHAR Report, + IN ULONG ReportLength); + +#if !defined(_HIDPI_NO_FUNCTION_MACROS_) + +/* + * BOOLEAN + * HidP_IsSameUsageAndPage( + * USAGE_AND_PAGE u1, + * USAGE_AND_PAGE u2); + */ +#define HidP_IsSameUsageAndPage(u1, u2) ((* (PULONG) &u1) == (* (PULONG) &u2)) + +#endif /* _HIDPI_NO_FUNCTION_MACROS_ */ + +HIDAPI +ULONG +DDKAPI +HidP_MaxDataListLength( + IN HIDP_REPORT_TYPE ReportType, + IN PHIDP_PREPARSED_DATA PreparsedData); + +HIDAPI +ULONG +DDKAPI +HidP_MaxUsageListLength( + IN HIDP_REPORT_TYPE ReportType, + IN USAGE UsagePage OPTIONAL, + IN PHIDP_PREPARSED_DATA PreparsedData); + +#if !defined(_HIDPI_NO_FUNCTION_MACROS_) + +/* + * NTSTATUS + * HidP_SetButtons( + * IN HIDP_REPORT_TYPE ReportType, + * IN USAGE UsagePage, + * IN USHORT LinkCollection, + * IN PUSAGE UsageList, + * IN OUT PULONG UsageLength, + * IN PHIDP_PREPARSED_DATA PreparsedData, + * IN OUT PCHAR Report, + * IN ULONG ReportLength); + */ +#define HidP_SetButtons(RT, UP, LC, UL1, UL2, PD, R, RL) \ + HidP_SetUsages(RT, UP, LC, UL1, UL2, PD, R, RL) + +#endif /* _HIDPI_NO_FUNCTION_MACROS_ */ + +HIDAPI +NTSTATUS +DDKAPI +HidP_SetData( + IN HIDP_REPORT_TYPE ReportType, + IN PHIDP_DATA DataList, + IN OUT PULONG DataLength, + IN PHIDP_PREPARSED_DATA PreparsedData, + IN OUT PCHAR Report, + IN ULONG ReportLength); + +HIDAPI +NTSTATUS +DDKAPI +HidP_SetScaledUsageValue( + IN HIDP_REPORT_TYPE ReportType, + IN USAGE UsagePage, + IN USHORT LinkCollection OPTIONAL, + IN USAGE Usage, + IN LONG UsageValue, + IN PHIDP_PREPARSED_DATA PreparsedData, + IN OUT PCHAR Report, + IN ULONG ReportLength); + +HIDAPI +NTSTATUS +DDKAPI +HidP_SetUsages( + IN HIDP_REPORT_TYPE ReportType, + IN USAGE UsagePage, + IN USHORT LinkCollection, /* Optional */ + IN PUSAGE UsageList, + IN OUT PULONG UsageLength, + IN PHIDP_PREPARSED_DATA PreparsedData, + IN OUT PCHAR Report, + IN ULONG ReportLength); + +HIDAPI +NTSTATUS +DDKAPI +HidP_SetUsageValue( + IN HIDP_REPORT_TYPE ReportType, + IN USAGE UsagePage, + IN USHORT LinkCollection, + IN USAGE Usage, + IN ULONG UsageValue, + IN PHIDP_PREPARSED_DATA PreparsedData, + IN OUT PCHAR Report, + IN ULONG ReportLength); + +HIDAPI +NTSTATUS +DDKAPI +HidP_SetUsageValueArray( + IN HIDP_REPORT_TYPE ReportType, + IN USAGE UsagePage, + IN USHORT LinkCollection OPTIONAL, + IN USAGE Usage, + IN PCHAR UsageValue, + IN USHORT UsageValueByteLength, + IN PHIDP_PREPARSED_DATA PreparsedData, + OUT PCHAR Report, + IN ULONG ReportLength); + +#if !defined(_HIDPI_NO_FUNCTION_MACROS_) + +/* + * NTSTATUS + * HidP_UnsetButtons( + * IN HIDP_REPORT_TYPE ReportType, + * IN USAGE UsagePage, + * IN USHORT LinkCollection, + * IN PUSAGE UsageList, + * IN OUT PULONG UsageLength, + * IN PHIDP_PREPARSED_DATA PreparsedData, + * IN OUT PCHAR Report, + * IN ULONG ReportLength); + */ +#define HidP_UnsetButtons(RT, UP, LC, UL1, UL2, PD, R, RL) \ + HidP_UnsetUsages(RT, UP, LC, UL1, UL2, PD, R, RL) + +#endif /* _HIDPI_NO_FUNCTION_MACROS_ */ + +HIDAPI +NTSTATUS +DDKAPI +HidP_UnsetUsages( + IN HIDP_REPORT_TYPE ReportType, + IN USAGE UsagePage, + IN USHORT LinkCollection, + IN PUSAGE UsageList, + IN OUT PULONG UsageLength, + IN PHIDP_PREPARSED_DATA PreparsedData, + IN OUT PCHAR Report, + IN ULONG ReportLength); + +HIDAPI +NTSTATUS +DDKAPI +HidP_UsageAndPageListDifference( + IN PUSAGE_AND_PAGE PreviousUsageList, + IN PUSAGE_AND_PAGE CurrentUsageList, + OUT PUSAGE_AND_PAGE BreakUsageList, + OUT PUSAGE_AND_PAGE MakeUsageList, + IN ULONG UsageListLength); + +HIDAPI +NTSTATUS +DDKAPI +HidP_UsageListDifference( + IN PUSAGE PreviousUsageList, + IN PUSAGE CurrentUsageList, + OUT PUSAGE BreakUsageList, + OUT PUSAGE MakeUsageList, + IN ULONG UsageListLength); + +#ifdef __cplusplus +} +#endif + +#endif /* __HIDPI_H */ diff --git a/reactos/include/ddk/hidusage.h b/reactos/include/ddk/hidusage.h new file mode 100644 index 00000000000..1f82af98d85 --- /dev/null +++ b/reactos/include/ddk/hidusage.h @@ -0,0 +1,210 @@ +/* + * hidusage.h + * + * HID usages + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __HIDUSAGE_H +#define __HIDUSAGE_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef USHORT USAGE, *PUSAGE; + +#define HID_USAGE_GENERIC_POINTER ((USAGE) 0x01) +#define HID_USAGE_GENERIC_MOUSE ((USAGE) 0x02) +#define HID_USAGE_GENERIC_JOYSTICK ((USAGE) 0x04) +#define HID_USAGE_GENERIC_GAMEPAD ((USAGE) 0x05) +#define HID_USAGE_GENERIC_KEYBOARD ((USAGE) 0x06) +#define HID_USAGE_GENERIC_KEYPAD ((USAGE) 0x07) +#define HID_USAGE_GENERIC_SYSTEM_CTL ((USAGE) 0x80) +#define HID_USAGE_GENERIC_X ((USAGE) 0x30) +#define HID_USAGE_GENERIC_Y ((USAGE) 0x31) +#define HID_USAGE_GENERIC_Z ((USAGE) 0x32) +#define HID_USAGE_GENERIC_RX ((USAGE) 0x33) +#define HID_USAGE_GENERIC_RY ((USAGE) 0x34) +#define HID_USAGE_GENERIC_RZ ((USAGE) 0x35) +#define HID_USAGE_GENERIC_SLIDER ((USAGE) 0x36) +#define HID_USAGE_GENERIC_DIAL ((USAGE) 0x37) +#define HID_USAGE_GENERIC_WHEEL ((USAGE) 0x38) +#define HID_USAGE_GENERIC_HATSWITCH ((USAGE) 0x39) +#define HID_USAGE_GENERIC_COUNTED_BUFFER ((USAGE) 0x3A) +#define HID_USAGE_GENERIC_BYTE_COUNT ((USAGE) 0x3B) +#define HID_USAGE_GENERIC_MOTION_WAKEUP ((USAGE) 0x3C) +#define HID_USAGE_GENERIC_VX ((USAGE) 0x40) +#define HID_USAGE_GENERIC_VY ((USAGE) 0x41) +#define HID_USAGE_GENERIC_VZ ((USAGE) 0x42) +#define HID_USAGE_GENERIC_VBRX ((USAGE) 0x43) +#define HID_USAGE_GENERIC_VBRY ((USAGE) 0x44) +#define HID_USAGE_GENERIC_VBRZ ((USAGE) 0x45) +#define HID_USAGE_GENERIC_VNO ((USAGE) 0x46) +#define HID_USAGE_GENERIC_SYSCTL_POWER ((USAGE) 0x81) +#define HID_USAGE_GENERIC_SYSCTL_SLEEP ((USAGE) 0x82) +#define HID_USAGE_GENERIC_SYSCTL_WAKE ((USAGE) 0x83) +#define HID_USAGE_GENERIC_SYSCTL_CONTEXT_MENU ((USAGE) 0x84) +#define HID_USAGE_GENERIC_SYSCTL_MAIN_MENU ((USAGE) 0x85) +#define HID_USAGE_GENERIC_SYSCTL_APP_MENU ((USAGE) 0x86) +#define HID_USAGE_GENERIC_SYSCTL_HELP_MENU ((USAGE) 0x87) +#define HID_USAGE_GENERIC_SYSCTL_MENU_EXIT ((USAGE) 0x88) +#define HID_USAGE_GENERIC_SYSCTL_MENU_SELECT ((USAGE) 0x89) +#define HID_USAGE_GENERIC_SYSCTL_MENU_RIGHT ((USAGE) 0x8A) +#define HID_USAGE_GENERIC_SYSCTL_MENU_LEFT ((USAGE) 0x8B) +#define HID_USAGE_GENERIC_SYSCTL_MENU_UP ((USAGE) 0x8C) +#define HID_USAGE_GENERIC_SYSCTL_MENU_DOWN ((USAGE) 0x8D) + +#define HID_USAGE_KEYBOARD_NOEVENT ((USAGE) 0x00) +#define HID_USAGE_KEYBOARD_ROLLOVER ((USAGE) 0x01) +#define HID_USAGE_KEYBOARD_POSTFAIL ((USAGE) 0x02) +#define HID_USAGE_KEYBOARD_UNDEFINED ((USAGE) 0x03) +#define HID_USAGE_KEYBOARD_aA ((USAGE) 0x04) +#define HID_USAGE_KEYBOARD_zZ ((USAGE) 0x1D) +#define HID_USAGE_KEYBOARD_ONE ((USAGE) 0x1E) +#define HID_USAGE_KEYBOARD_ZERO ((USAGE) 0x27) +#define HID_USAGE_KEYBOARD_LCTRL ((USAGE) 0xE0) +#define HID_USAGE_KEYBOARD_LSHFT ((USAGE) 0xE1) +#define HID_USAGE_KEYBOARD_LALT ((USAGE) 0xE2) +#define HID_USAGE_KEYBOARD_LGUI ((USAGE) 0xE3) +#define HID_USAGE_KEYBOARD_RCTRL ((USAGE) 0xE4) +#define HID_USAGE_KEYBOARD_RSHFT ((USAGE) 0xE5) +#define HID_USAGE_KEYBOARD_RALT ((USAGE) 0xE6) +#define HID_USAGE_KEYBOARD_RGUI ((USAGE) 0xE7) +#define HID_USAGE_KEYBOARD_SCROLL_LOCK ((USAGE) 0x47) +#define HID_USAGE_KEYBOARD_NUM_LOCK ((USAGE) 0x53) +#define HID_USAGE_KEYBOARD_CAPS_LOCK ((USAGE) 0x39) +#define HID_USAGE_KEYBOARD_F1 ((USAGE) 0x3A) +#define HID_USAGE_KEYBOARD_F12 ((USAGE) 0x45) +#define HID_USAGE_KEYBOARD_RETURN ((USAGE) 0x28) +#define HID_USAGE_KEYBOARD_ESCAPE ((USAGE) 0x29) +#define HID_USAGE_KEYBOARD_DELETE ((USAGE) 0x2A) +#define HID_USAGE_KEYBOARD_PRINT_SCREEN ((USAGE) 0x46) + +#define HID_USAGE_LED_NUM_LOCK ((USAGE) 0x01) +#define HID_USAGE_LED_CAPS_LOCK ((USAGE) 0x02) +#define HID_USAGE_LED_SCROLL_LOCK ((USAGE) 0x03) +#define HID_USAGE_LED_COMPOSE ((USAGE) 0x04) +#define HID_USAGE_LED_KANA ((USAGE) 0x05) +#define HID_USAGE_LED_POWER ((USAGE) 0x06) +#define HID_USAGE_LED_SHIFT ((USAGE) 0x07) +#define HID_USAGE_LED_DO_NOT_DISTURB ((USAGE) 0x08) +#define HID_USAGE_LED_MUTE ((USAGE) 0x09) +#define HID_USAGE_LED_TONE_ENABLE ((USAGE) 0x0A) +#define HID_USAGE_LED_HIGH_CUT_FILTER ((USAGE) 0x0B) +#define HID_USAGE_LED_LOW_CUT_FILTER ((USAGE) 0x0C) +#define HID_USAGE_LED_EQUALIZER_ENABLE ((USAGE) 0x0D) +#define HID_USAGE_LED_SOUND_FIELD_ON ((USAGE) 0x0E) +#define HID_USAGE_LED_SURROUND_FIELD_ON ((USAGE) 0x0F) +#define HID_USAGE_LED_REPEAT ((USAGE) 0x10) +#define HID_USAGE_LED_STEREO ((USAGE) 0x11) +#define HID_USAGE_LED_SAMPLING_RATE_DETECT ((USAGE) 0x12) +#define HID_USAGE_LED_SPINNING ((USAGE) 0x13) +#define HID_USAGE_LED_CAV ((USAGE) 0x14) +#define HID_USAGE_LED_CLV ((USAGE) 0x15) +#define HID_USAGE_LED_RECORDING_FORMAT_DET ((USAGE) 0x16) +#define HID_USAGE_LED_OFF_HOOK ((USAGE) 0x17) +#define HID_USAGE_LED_RING ((USAGE) 0x18) +#define HID_USAGE_LED_MESSAGE_WAITING ((USAGE) 0x19) +#define HID_USAGE_LED_DATA_MODE ((USAGE) 0x1A) +#define HID_USAGE_LED_BATTERY_OPERATION ((USAGE) 0x1B) +#define HID_USAGE_LED_BATTERY_OK ((USAGE) 0x1C) +#define HID_USAGE_LED_BATTERY_LOW ((USAGE) 0x1D) +#define HID_USAGE_LED_SPEAKER ((USAGE) 0x1E) +#define HID_USAGE_LED_HEAD_SET ((USAGE) 0x1F) +#define HID_USAGE_LED_HOLD ((USAGE) 0x20) +#define HID_USAGE_LED_MICROPHONE ((USAGE) 0x21) +#define HID_USAGE_LED_COVERAGE ((USAGE) 0x22) +#define HID_USAGE_LED_NIGHT_MODE ((USAGE) 0x23) +#define HID_USAGE_LED_SEND_CALLS ((USAGE) 0x24) +#define HID_USAGE_LED_CALL_PICKUP ((USAGE) 0x25) +#define HID_USAGE_LED_CONFERENCE ((USAGE) 0x26) +#define HID_USAGE_LED_STAND_BY ((USAGE) 0x27) +#define HID_USAGE_LED_CAMERA_ON ((USAGE) 0x28) +#define HID_USAGE_LED_CAMERA_OFF ((USAGE) 0x29) +#define HID_USAGE_LED_ON_LINE ((USAGE) 0x2A) +#define HID_USAGE_LED_OFF_LINE ((USAGE) 0x2B) +#define HID_USAGE_LED_BUSY ((USAGE) 0x2C) +#define HID_USAGE_LED_READY ((USAGE) 0x2D) +#define HID_USAGE_LED_PAPER_OUT ((USAGE) 0x2E) +#define HID_USAGE_LED_PAPER_JAM ((USAGE) 0x2F) +#define HID_USAGE_LED_REMOTE ((USAGE) 0x30) +#define HID_USAGE_LED_FORWARD ((USAGE) 0x31) +#define HID_USAGE_LED_REVERSE ((USAGE) 0x32) +#define HID_USAGE_LED_STOP ((USAGE) 0x33) +#define HID_USAGE_LED_REWIND ((USAGE) 0x34) +#define HID_USAGE_LED_FAST_FORWARD ((USAGE) 0x35) +#define HID_USAGE_LED_PLAY ((USAGE) 0x36) +#define HID_USAGE_LED_PAUSE ((USAGE) 0x37) +#define HID_USAGE_LED_RECORD ((USAGE) 0x38) +#define HID_USAGE_LED_ERROR ((USAGE) 0x39) +#define HID_USAGE_LED_SELECTED_INDICATOR ((USAGE) 0x3A) +#define HID_USAGE_LED_IN_USE_INDICATOR ((USAGE) 0x3B) +#define HID_USAGE_LED_MULTI_MODE_INDICATOR ((USAGE) 0x3C) +#define HID_USAGE_LED_INDICATOR_ON ((USAGE) 0x3D) +#define HID_USAGE_LED_INDICATOR_FLASH ((USAGE) 0x3E) +#define HID_USAGE_LED_INDICATOR_SLOW_BLINK ((USAGE) 0x3F) +#define HID_USAGE_LED_INDICATOR_FAST_BLINK ((USAGE) 0x40) +#define HID_USAGE_LED_INDICATOR_OFF ((USAGE) 0x41) +#define HID_USAGE_LED_FLASH_ON_TIME ((USAGE) 0x42) +#define HID_USAGE_LED_SLOW_BLINK_ON_TIME ((USAGE) 0x43) +#define HID_USAGE_LED_SLOW_BLINK_OFF_TIME ((USAGE) 0x44) +#define HID_USAGE_LED_FAST_BLINK_ON_TIME ((USAGE) 0x45) +#define HID_USAGE_LED_FAST_BLINK_OFF_TIME ((USAGE) 0x46) +#define HID_USAGE_LED_INDICATOR_COLOR ((USAGE) 0x47) +#define HID_USAGE_LED_RED ((USAGE) 0x48) +#define HID_USAGE_LED_GREEN ((USAGE) 0x49) +#define HID_USAGE_LED_AMBER ((USAGE) 0x4A) +#define HID_USAGE_LED_GENERIC_INDICATOR ((USAGE) 0x3B) + +#define HID_USAGE_PAGE_UNDEFINED ((USAGE) 0x00) +#define HID_USAGE_PAGE_GENERIC ((USAGE) 0x01) +#define HID_USAGE_PAGE_SIMULATION ((USAGE) 0x02) +#define HID_USAGE_PAGE_VR ((USAGE) 0x03) +#define HID_USAGE_PAGE_SPORT ((USAGE) 0x04) +#define HID_USAGE_PAGE_GAME ((USAGE) 0x05) +#define HID_USAGE_PAGE_KEYBOARD ((USAGE) 0x07) +#define HID_USAGE_PAGE_LED ((USAGE) 0x08) +#define HID_USAGE_PAGE_BUTTON ((USAGE) 0x09) +#define HID_USAGE_PAGE_ORDINAL ((USAGE) 0x0A) +#define HID_USAGE_PAGE_TELEPHONY ((USAGE) 0x0B) +#define HID_USAGE_PAGE_CONSUMER ((USAGE) 0x0C) +#define HID_USAGE_PAGE_DIGITIZER ((USAGE) 0x0D) +#define HID_USAGE_PAGE_UNICODE ((USAGE) 0x10) +#define HID_USAGE_PAGE_ALPHANUMERIC ((USAGE) 0x14) + +#define HID_USAGE_TELEPHONY_PHONE ((USAGE) 0x01) +#define HID_USAGE_TELEPHONY_ANSWERING_MACHINE ((USAGE) 0x02) +#define HID_USAGE_TELEPHONY_MESSAGE_CONTROLS ((USAGE) 0x03) +#define HID_USAGE_TELEPHONY_HANDSET ((USAGE) 0x04) +#define HID_USAGE_TELEPHONY_HEADSET ((USAGE) 0x05) +#define HID_USAGE_TELEPHONY_KEYPAD ((USAGE) 0x06) +#define HID_USAGE_TELEPHONY_PROGRAMMABLE_BUTTON ((USAGE) 0x07) + +#define HID_USAGE_SIMULATION_RUDDER ((USAGE) 0xBA) +#define HID_USAGE_SIMULATION_THROTTLE ((USAGE) 0xBB) + +#ifdef __cplusplus +} +#endif + +#endif /* __HIDUSAGE_H */ diff --git a/reactos/include/ddk/ide.h b/reactos/include/ddk/ide.h new file mode 100644 index 00000000000..e8eeb9ad800 --- /dev/null +++ b/reactos/include/ddk/ide.h @@ -0,0 +1,305 @@ +/* + * ide.h + * + * IDE driver interface + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Hervé Poussineau + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __IDE_H +#define __IDE_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define MAX_IDE_CHANNEL 2 +#define MAX_IDE_LINE 2 +#define MAX_IDE_DEVICE 2 + +#include +typedef struct _IDENTIFY_DATA { + USHORT GeneralConfiguration; /* 00 */ + USHORT NumCylinders; /* 02 */ + USHORT Reserved1; /* 04 */ + USHORT NumHeads; /* 06 */ + USHORT UnformattedBytesPerTrack; /* 08 */ + USHORT UnformattedBytesPerSector; /* 10 */ + USHORT NumSectorsPerTrack; /* 12 */ + USHORT VendorUnique1[3]; /* 14 */ + UCHAR SerialNumber[20]; /* 20 */ + USHORT BufferType; /* 40 */ + USHORT BufferSectorSize; /* 42 */ + USHORT NumberOfEccBytes; /* 44 */ + UCHAR FirmwareRevision[8]; /* 46 */ + UCHAR ModelNumber[40]; /* 54 */ + UCHAR MaximumBlockTransfer; /* 94 */ + UCHAR VendorUnique2; /* 95 */ + USHORT DoubleWordIo; /* 96 */ + USHORT Capabilities; /* 98 */ + USHORT Reserved2; /* 100 */ + UCHAR VendorUnique3; /* 102 */ + UCHAR PioCycleTimingMode; /* 103 */ + UCHAR VendorUnique4; /* 104 */ + UCHAR DmaCycleTimingMode; /* 105 */ + USHORT TranslationFieldsValid:3; /* 106 */ + USHORT Reserved3:13; /* - */ + USHORT NumberOfCurrentCylinders; /* 108 */ + USHORT NumberOfCurrentHeads; /* 110 */ + USHORT CurrentSectorsPerTrack; /* 112 */ + ULONG CurrentSectorCapacity; /* 114 */ + USHORT CurrentMultiSectorSetting; /* 118 */ + ULONG UserAddressableSectors; /* 120 */ + USHORT SingleWordDMASupport:8; /* 124 */ + USHORT SingleWordDMAActive:8; /* - */ + USHORT MultiWordDMASupport:8; /* 126 */ + USHORT MultiWordDMAActive:8; /* - */ + USHORT AdvancedPIOModes:8; /* 128 */ + USHORT Reserved4:8; /* - */ + USHORT MinimumMWXferCycleTime; /* 130 */ + USHORT RecommendedMWXferCycleTime; /* 132 */ + USHORT MinimumPIOCycleTime; /* 134 */ + USHORT MinimumPIOCycleTimeIORDY; /* 136 */ + USHORT Reserved5[11]; /* 138 */ + USHORT MajorRevision; /* 160 */ + USHORT MinorRevision; /* 162 */ + USHORT Reserved6; /* 164 */ + USHORT CommandSetSupport; /* 166 */ + USHORT Reserved6a[2]; /* 168 */ + USHORT CommandSetActive; /* 172 */ + USHORT Reserved6b; /* 174 */ + USHORT UltraDMASupport:8; /* 176 */ + USHORT UltraDMAActive:8; /* - */ + USHORT Reserved7[11]; /* 178 */ + ULONG Max48BitLBA[2]; /* 200 */ + USHORT Reserved7a[22]; /* 208 */ + USHORT LastLun:3; /* 252 */ + USHORT Reserved8:13; /* - */ + USHORT MediaStatusNotification:2; /* 254 */ + USHORT Reserved9:6; /* - */ + USHORT DeviceWriteProtect:1; /* - */ + USHORT Reserved10:7; /* - */ + USHORT Reserved11[128]; /* 256 */ +} IDENTIFY_DATA, *PIDENTIFY_DATA; + +typedef struct _EXTENDED_IDENTIFY_DATA { + USHORT GeneralConfiguration; /* 00 */ + USHORT NumCylinders; /* 02 */ + USHORT Reserved1; /* 04 */ + USHORT NumHeads; /* 06 */ + USHORT UnformattedBytesPerTrack; /* 08 */ + USHORT UnformattedBytesPerSector; /* 10 */ + USHORT NumSectorsPerTrack; /* 12 */ + union + { + USHORT VendorUnique1[3]; /* 14 */ + struct + { + UCHAR InterSectorGap; /* 14 */ + UCHAR InterSectorGapSize; /* - */ + UCHAR Reserved16; /* 16 */ + UCHAR BytesInPLO; /* - */ + USHORT VendorUniqueCnt; /* 18 */ + } u; + }; + UCHAR SerialNumber[20]; /* 20 */ + USHORT BufferType; /* 40 */ + USHORT BufferSectorSize; /* 42 */ + USHORT NumberOfEccBytes; /* 44 */ + UCHAR FirmwareRevision[8]; /* 46 */ + UCHAR ModelNumber[40]; /* 54 */ + UCHAR MaximumBlockTransfer; /* 94 */ + UCHAR VendorUnique2; /* 95 */ + USHORT DoubleWordIo; /* 96 */ + USHORT Capabilities; /* 98 */ + USHORT Reserved2; /* 100 */ + UCHAR VendorUnique3; /* 102 */ + UCHAR PioCycleTimingMode; /* 103 */ + UCHAR VendorUnique4; /* 104 */ + UCHAR DmaCycleTimingMode; /* 105 */ + USHORT TranslationFieldsValid:3; /* 106 */ + USHORT Reserved3:13; /* - */ + USHORT NumberOfCurrentCylinders; /* 108 */ + USHORT NumberOfCurrentHeads; /* 110 */ + USHORT CurrentSectorsPerTrack; /* 112 */ + ULONG CurrentSectorCapacity; /* 114 */ + USHORT CurrentMultiSectorSetting; /* 118 */ + ULONG UserAddressableSectors; /* 120 */ + USHORT SingleWordDMASupport:8; /* 124 */ + USHORT SingleWordDMAActive:8; /* - */ + USHORT MultiWordDMASupport:8; /* 126 */ + USHORT MultiWordDMAActive:8; /* - */ + USHORT AdvancedPIOModes:8; /* 128 */ + USHORT Reserved4:8; /* - */ + USHORT MinimumMWXferCycleTime; /* 130 */ + USHORT RecommendedMWXferCycleTime; /* 132 */ + USHORT MinimumPIOCycleTime; /* 134 */ + USHORT MinimumPIOCycleTimeIORDY; /* 136 */ + USHORT Reserved5[11]; /* 138 */ + USHORT MajorRevision; /* 160 */ + USHORT MinorRevision; /* 162 */ + USHORT Reserved6; /* 164 */ + USHORT CommandSetSupport; /* 166 */ + USHORT Reserved6a[2]; /* 168 */ + USHORT CommandSetActive; /* 172 */ + USHORT Reserved6b; /* 174 */ + USHORT UltraDMASupport:8; /* 176 */ + USHORT UltraDMAActive:8; /* - */ + USHORT Reserved7[11]; /* 178 */ + ULONG Max48BitLBA[2]; /* 200 */ + USHORT Reserved7a[22]; /* 208 */ + USHORT LastLun:3; /* 252 */ + USHORT Reserved8:13; /* - */ + USHORT MediaStatusNotification:2; /* 254 */ + USHORT Reserved9:6; /* - */ + USHORT DeviceWriteProtect:1; /* - */ + USHORT Reserved10:7; /* - */ + USHORT Reserved11[128]; /* 256 */ +} EXTENDED_IDENTIFY_DATA, *PEXTENDED_IDENTIFY_DATA; +#include + +typedef struct _PCIIDE_TRANSFER_MODE_SELECT +{ + ULONG Channel; + BOOLEAN DevicePresent[MAX_IDE_DEVICE * MAX_IDE_LINE]; + BOOLEAN FixedDisk[MAX_IDE_DEVICE * MAX_IDE_LINE]; + BOOLEAN IoReadySupported[MAX_IDE_DEVICE * MAX_IDE_LINE]; + ULONG DeviceTransferModeSupported[MAX_IDE_DEVICE * MAX_IDE_LINE]; + ULONG BestPioCycleTime[MAX_IDE_DEVICE * MAX_IDE_LINE]; + ULONG BestSwDmaCycleTime[MAX_IDE_DEVICE * MAX_IDE_LINE]; + ULONG BestMwDmaCycleTime[MAX_IDE_DEVICE * MAX_IDE_LINE]; + ULONG BestUDmaCycleTime[MAX_IDE_DEVICE * MAX_IDE_LINE]; + ULONG DeviceTransferModeCurrent[MAX_IDE_DEVICE * MAX_IDE_LINE]; + ULONG UserChoiceTransferMode[MAX_IDE_DEVICE * MAX_IDE_LINE]; + ULONG EnableUDMA66; + IDENTIFY_DATA IdentifyData[MAX_IDE_DEVICE]; + ULONG DeviceTransferModeSelected[MAX_IDE_DEVICE * MAX_IDE_LINE]; + PULONG TransferModeTimingTable; + ULONG TransferModeTableLength; +} PCIIDE_TRANSFER_MODE_SELECT, *PPCIIDE_TRANSFER_MODE_SELECT; + +typedef enum +{ + ChannelDisabled = 0, + ChannelEnabled, + ChannelStateUnknown +} IDE_CHANNEL_STATE; + +typedef IDE_CHANNEL_STATE +(NTAPI *PCIIDE_CHANNEL_ENABLED)( + IN PVOID DeviceExtension, + IN ULONG Channel); + +typedef BOOLEAN +(NTAPI *PCIIDE_SYNC_ACCESS_REQUIRED)( + IN PVOID DeviceExtension); + +typedef NTSTATUS +(NTAPI *PCIIDE_TRANSFER_MODE_SELECT_FUNC)( + IN PVOID DeviceExtension, + IN OUT PPCIIDE_TRANSFER_MODE_SELECT XferMode); + +typedef ULONG +(NTAPI *PCIIDE_USEDMA_FUNC)( + IN PVOID DeviceExtension, + IN PUCHAR CdbCommand, + IN PUCHAR Slave); + +typedef NTSTATUS +(NTAPI *PCIIDE_UDMA_MODES_SUPPORTED)( + IN IDENTIFY_DATA IdentifyData, + OUT PULONG BestXferMode, + OUT PULONG CurrentXferMode); + +typedef struct _IDE_CONTROLLER_PROPERTIES +{ + ULONG Size; + ULONG ExtensionSize; + ULONG SupportedTransferMode[MAX_IDE_CHANNEL][MAX_IDE_DEVICE]; + PCIIDE_CHANNEL_ENABLED PciIdeChannelEnabled; + PCIIDE_SYNC_ACCESS_REQUIRED PciIdeSyncAccessRequired; + PCIIDE_TRANSFER_MODE_SELECT_FUNC PciIdeTransferModeSelect; + BOOLEAN IgnoreActiveBitForAtaDevice; + BOOLEAN AlwaysClearBusMasterInterrupt; + PCIIDE_USEDMA_FUNC PciIdeUseDma; + ULONG AlignmentRequirement; + ULONG DefaultPIO; + PCIIDE_UDMA_MODES_SUPPORTED PciIdeUdmaModesSupported; +} IDE_CONTROLLER_PROPERTIES, *PIDE_CONTROLLER_PROPERTIES; + +typedef NTSTATUS +(NTAPI *PCONTROLLER_PROPERTIES)( + IN PVOID DeviceExtension, + IN PIDE_CONTROLLER_PROPERTIES ControllerProperties); + +NTSTATUS NTAPI +PciIdeXInitialize( + IN PDRIVER_OBJECT DriverObject, + IN PUNICODE_STRING RegistryPath, + IN PCONTROLLER_PROPERTIES HwGetControllerProperties, + IN ULONG ExtensionSize); + +NTSTATUS NTAPI +PciIdeXGetBusData( + IN PVOID DeviceExtension, + IN PVOID Buffer, + IN ULONG ConfigDataOffset, + IN ULONG BufferLength); + +NTSTATUS NTAPI +PciIdeXSetBusData( + IN PVOID DeviceExtension, + IN PVOID Buffer, + IN PVOID DataMask, + IN ULONG ConfigDataOffset, + IN ULONG BufferLength); + +/* Bit field values for + * PCIIDE_TRANSFER_MODE_SELECT.DeviceTransferModeSupported and + * IDE_CONTROLLER_PROPERTIES.SupportedTransferMode + */ +// PIO Modes +#define PIO_MODE0 (1 << 0) +#define PIO_MODE1 (1 << 1) +#define PIO_MODE2 (1 << 2) +#define PIO_MODE3 (1 << 3) +#define PIO_MODE4 (1 << 4) +// Single-word DMA Modes +#define SWDMA_MODE0 (1 << 5) +#define SWDMA_MODE1 (1 << 6) +#define SWDMA_MODE2 (1 << 7) +// Multi-word DMA Modes +#define MWDMA_MODE0 (1 << 8) +#define MWDMA_MODE1 (1 << 9) +#define MWDMA_MODE2 (1 << 10) +// Ultra DMA Modes +#define UDMA_MODE0 (1 << 11) +#define UDMA_MODE1 (1 << 12) +#define UDMA_MODE2 (1 << 13) +#define UDMA_MODE3 (1 << 14) +#define UDMA_MODE4 (1 << 15) +#define UDMA_MODE5 (1 << 16) + +#ifdef __cplusplus +} +#endif + +#endif /* __IDE_H */ diff --git a/reactos/include/ddk/kbdmou.h b/reactos/include/ddk/kbdmou.h new file mode 100644 index 00000000000..3010a282644 --- /dev/null +++ b/reactos/include/ddk/kbdmou.h @@ -0,0 +1,91 @@ +/* + * kbdmou.h + * + * Structures and definitions for Keyboard/Mouse class and port drivers. + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Filip Navara + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __KBDMOU_H +#define __KBDMOU_H + +#include +#include + +#define DD_KEYBOARD_PORT_DEVICE_NAME "\\Device\\KeyboardPort" +#define DD_KEYBOARD_PORT_DEVICE_NAME_U L"\\Device\\KeyboardPort" +#define DD_KEYBOARD_PORT_BASE_NAME_U L"KeyboardPort" +#define DD_POINTER_PORT_DEVICE_NAME "\\Device\\PointerPort" +#define DD_POINTER_PORT_DEVICE_NAME_U L"\\Device\\PointerPort" +#define DD_POINTER_PORT_BASE_NAME_U L"PointerPort" + +#define DD_KEYBOARD_CLASS_BASE_NAME_U L"KeyboardClass" +#define DD_POINTER_CLASS_BASE_NAME_U L"PointerClass" + +#define DD_KEYBOARD_RESOURCE_CLASS_NAME_U L"Keyboard" +#define DD_POINTER_RESOURCE_CLASS_NAME_U L"Pointer" +#define DD_KEYBOARD_MOUSE_COMBO_RESOURCE_CLASS_NAME_U L"Keyboard/Pointer" + +#define POINTER_PORTS_MAXIMUM 8 +#define KEYBOARD_PORTS_MAXIMUM 8 + +#define KBDMOU_COULD_NOT_SEND_COMMAND 0x0000 +#define KBDMOU_COULD_NOT_SEND_PARAM 0x0001 +#define KBDMOU_NO_RESPONSE 0x0002 +#define KBDMOU_INCORRECT_RESPONSE 0x0004 + +#define I8042_ERROR_VALUE_BASE 1000 +#define INPORT_ERROR_VALUE_BASE 2000 +#define SERIAL_MOUSE_ERROR_VALUE_BASE 3000 + +#define IOCTL_INTERNAL_KEYBOARD_CONNECT \ + CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0080, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_KEYBOARD_DISCONNECT \ + CTL_CODE(FILE_DEVICE_KEYBOARD,0x0100, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_KEYBOARD_ENABLE \ + CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0200, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_KEYBOARD_DISABLE \ + CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0400, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_MOUSE_CONNECT \ + CTL_CODE(FILE_DEVICE_MOUSE, 0x0080, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_MOUSE_DISCONNECT \ + CTL_CODE(FILE_DEVICE_MOUSE, 0x0100, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_MOUSE_ENABLE \ + CTL_CODE(FILE_DEVICE_MOUSE, 0x0200, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_MOUSE_DISABLE \ + CTL_CODE(FILE_DEVICE_MOUSE, 0x0400, METHOD_NEITHER, FILE_ANY_ACCESS) + +typedef struct _CONNECT_DATA { + PDEVICE_OBJECT ClassDeviceObject; + PVOID ClassService; +} CONNECT_DATA, *PCONNECT_DATA; + +typedef VOID +(STDAPICALLTYPE *PSERVICE_CALLBACK_ROUTINE)( + IN PVOID NormalContext, + IN PVOID SystemArgument1, + IN PVOID SystemArgument2, + IN OUT PVOID SystemArgument3); + +#endif /* __KBDMOU_H */ diff --git a/reactos/include/ddk/mcd.h b/reactos/include/ddk/mcd.h new file mode 100644 index 00000000000..cc76de2e0b0 --- /dev/null +++ b/reactos/include/ddk/mcd.h @@ -0,0 +1,142 @@ +/* + * mcd.h + * + * Media changer driver interface + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __MCD_H +#define __MCD_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include "srb.h" +#include "scsi.h" +#include "ntddchgr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(_MCD_) + #define CHANGERAPI DECLSPEC_EXPORT +#else + #define CHANGERAPI DECLSPEC_IMPORT +#endif + +#ifdef DebugPrint +#undef DebugPrint +#endif + +#ifdef DBG +#define DebugPrint(x) ChangerClassDebugPrint x +#else +#define DebugPrint(x) +#endif + +#define MAXIMUM_CHANGER_INQUIRY_DATA 252 + +CHANGERAPI +PVOID +DDKAPI +ChangerClassAllocatePool( + IN POOL_TYPE PoolType, + IN ULONG NumberOfBytes); + +VOID +ChangerClassDebugPrint( + ULONG DebugPrintLevel, + PCCHAR DebugMessage, + ...); + +CHANGERAPI +PVOID +DDKAPI +ChangerClassFreePool( + IN PVOID PoolToFree); + +CHANGERAPI +NTSTATUS +DDKAPI +ChangerClassSendSrbSynchronous( + IN PDEVICE_OBJECT DeviceObject, + IN PSCSI_REQUEST_BLOCK Srb, + IN PVOID Buffer, + IN ULONG BufferSize, + IN BOOLEAN WriteToDevice); + + +typedef NTSTATUS DDKAPI +(*CHANGER_INITIALIZE)( + IN PDEVICE_OBJECT DeviceObject); + +typedef ULONG DDKAPI +(*CHANGER_EXTENSION_SIZE)( + VOID); + +typedef VOID DDKAPI +(*CHANGER_ERROR_ROUTINE)( + PDEVICE_OBJECT DeviceObject, + PSCSI_REQUEST_BLOCK Srb, + NTSTATUS *Status, + BOOLEAN *Retry); + +typedef NTSTATUS DDKAPI +(*CHANGER_COMMAND_ROUTINE)( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp); + +typedef NTSTATUS DDKAPI +(*CHANGER_PERFORM_DIAGNOSTICS)( + IN PDEVICE_OBJECT DeviceObject, + OUT PWMI_CHANGER_PROBLEM_DEVICE_ERROR ChangerDeviceError); + +typedef struct _MCD_INIT_DATA { + ULONG InitDataSize; + CHANGER_EXTENSION_SIZE ChangerAdditionalExtensionSize; + CHANGER_INITIALIZE ChangerInitialize; + CHANGER_ERROR_ROUTINE ChangerError; + CHANGER_PERFORM_DIAGNOSTICS ChangerPerformDiagnostics; + CHANGER_COMMAND_ROUTINE ChangerGetParameters; + CHANGER_COMMAND_ROUTINE ChangerGetStatus; + CHANGER_COMMAND_ROUTINE ChangerGetProductData; + CHANGER_COMMAND_ROUTINE ChangerSetAccess; + CHANGER_COMMAND_ROUTINE ChangerGetElementStatus; + CHANGER_COMMAND_ROUTINE ChangerInitializeElementStatus; + CHANGER_COMMAND_ROUTINE ChangerSetPosition; + CHANGER_COMMAND_ROUTINE ChangerExchangeMedium; + CHANGER_COMMAND_ROUTINE ChangerMoveMedium; + CHANGER_COMMAND_ROUTINE ChangerReinitializeUnit; + CHANGER_COMMAND_ROUTINE ChangerQueryVolumeTags; +} MCD_INIT_DATA, *PMCD_INIT_DATA; + +CHANGERAPI +NTSTATUS +DDKAPI +ChangerClassInitialize( + IN PDRIVER_OBJECT DriverObject, + IN PUNICODE_STRING RegistryPath, + IN PMCD_INIT_DATA MCDInitData); + +#ifdef __cplusplus +} +#endif + +#endif /* __MCD_H */ diff --git a/reactos/include/ddk/miniport.h b/reactos/include/ddk/miniport.h new file mode 100644 index 00000000000..e492bc4ca1d --- /dev/null +++ b/reactos/include/ddk/miniport.h @@ -0,0 +1,75 @@ +/* + * miniport.h + * + * Type definitions for miniport drivers + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __MINIPORT_H +#define __MINIPORT_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define EMULATOR_READ_ACCESS 0x01 +#define EMULATOR_WRITE_ACCESS 0x02 + +typedef enum _EMULATOR_PORT_ACCESS_TYPE { + Uchar, + Ushort, + Ulong +} EMULATOR_PORT_ACCESS_TYPE, *PEMULATOR_PORT_ACCESS_TYPE; + + +typedef struct _EMULATOR_ACCESS_ENTRY { + ULONG BasePort; + ULONG NumConsecutivePorts; + EMULATOR_PORT_ACCESS_TYPE AccessType; + UCHAR AccessMode; + UCHAR StringSupport; + PVOID Routine; +} EMULATOR_ACCESS_ENTRY, *PEMULATOR_ACCESS_ENTRY; + +#ifndef VIDEO_ACCESS_RANGE_DEFINED /* also in video.h */ +#define VIDEO_ACCESS_RANGE_DEFINED +typedef struct _VIDEO_ACCESS_RANGE { + PHYSICAL_ADDRESS RangeStart; + ULONG RangeLength; + UCHAR RangeInIoSpace; + UCHAR RangeVisible; + UCHAR RangeShareable; + UCHAR RangePassive; +} VIDEO_ACCESS_RANGE, *PVIDEO_ACCESS_RANGE; +#endif + +typedef VOID DDKAPI +(*PBANKED_SECTION_ROUTINE)( + IN ULONG ReadBank, + IN ULONG WriteBank, + IN PVOID Context); + +#ifdef __cplusplus +} +#endif + +#endif /* __MINIPORT_H */ diff --git a/reactos/include/ddk/minitape.h b/reactos/include/ddk/minitape.h new file mode 100644 index 00000000000..07c87a0129c --- /dev/null +++ b/reactos/include/ddk/minitape.h @@ -0,0 +1,221 @@ +/* + * minitape.h + * + * Minitape driver interface + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ +#ifndef __MINITAPE_H +#define __MINITAPE_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#pragma pack(push,4) + +#define MEDIA_ERASEABLE 0x00000001 +#define MEDIA_WRITE_ONCE 0x00000002 +#define MEDIA_READ_ONLY 0x00000004 +#define MEDIA_READ_WRITE 0x00000008 +#define MEDIA_WRITE_PROTECTED 0x00000100 +#define MEDIA_CURRENTLY_MOUNTED 0x80000000 + +typedef enum _TAPE_STATUS { + TAPE_STATUS_SEND_SRB_AND_CALLBACK, + TAPE_STATUS_CALLBACK, + TAPE_STATUS_CHECK_TEST_UNIT_READY, + TAPE_STATUS_SUCCESS, + TAPE_STATUS_INSUFFICIENT_RESOURCES, + TAPE_STATUS_NOT_IMPLEMENTED, + TAPE_STATUS_INVALID_DEVICE_REQUEST, + TAPE_STATUS_INVALID_PARAMETER, + TAPE_STATUS_MEDIA_CHANGED, + TAPE_STATUS_BUS_RESET, + TAPE_STATUS_SETMARK_DETECTED, + TAPE_STATUS_FILEMARK_DETECTED, + TAPE_STATUS_BEGINNING_OF_MEDIA, + TAPE_STATUS_END_OF_MEDIA, + TAPE_STATUS_BUFFER_OVERFLOW, + TAPE_STATUS_NO_DATA_DETECTED, + TAPE_STATUS_EOM_OVERFLOW, + TAPE_STATUS_NO_MEDIA, + TAPE_STATUS_IO_DEVICE_ERROR, + TAPE_STATUS_UNRECOGNIZED_MEDIA, + TAPE_STATUS_DEVICE_NOT_READY, + TAPE_STATUS_MEDIA_WRITE_PROTECTED, + TAPE_STATUS_DEVICE_DATA_ERROR, + TAPE_STATUS_NO_SUCH_DEVICE, + TAPE_STATUS_INVALID_BLOCK_LENGTH, + TAPE_STATUS_IO_TIMEOUT, + TAPE_STATUS_DEVICE_NOT_CONNECTED, + TAPE_STATUS_DATA_OVERRUN, + TAPE_STATUS_DEVICE_BUSY, + TAPE_STATUS_REQUIRES_CLEANING, + TAPE_STATUS_CLEANER_CARTRIDGE_INSTALLED +} TAPE_STATUS, *PTAPE_STATUS; + +#define INQUIRYDATABUFFERSIZE 36 +#ifndef _INQUIRYDATA_DEFINED /* also in scsi.h */ +#define _INQUIRYDATA_DEFINED +typedef struct _INQUIRYDATA { + UCHAR DeviceType : 5; + UCHAR DeviceTypeQualifier : 3; + UCHAR DeviceTypeModifier : 7; + UCHAR RemovableMedia : 1; + union { + UCHAR Versions; + struct { + UCHAR ANSIVersion : 3; + UCHAR ECMAVersion : 3; + UCHAR ISOVersion : 2; + }; + }; + UCHAR ResponseDataFormat : 4; + UCHAR HiSupport : 1; + UCHAR NormACA : 1; + UCHAR TerminateTask : 1; + UCHAR AERC : 1; + UCHAR AdditionalLength; + UCHAR Reserved; + UCHAR Addr16 : 1; + UCHAR Addr32 : 1; + UCHAR AckReqQ: 1; + UCHAR MediumChanger : 1; + UCHAR MultiPort : 1; + UCHAR ReservedBit2 : 1; + UCHAR EnclosureServices : 1; + UCHAR ReservedBit3 : 1; + UCHAR SoftReset : 1; + UCHAR CommandQueue : 1; + UCHAR TransferDisable : 1; + UCHAR LinkedCommands : 1; + UCHAR Synchronous : 1; + UCHAR Wide16Bit : 1; + UCHAR Wide32Bit : 1; + UCHAR RelativeAddressing : 1; + UCHAR VendorId[8]; + UCHAR ProductId[16]; + UCHAR ProductRevisionLevel[4]; + UCHAR VendorSpecific[20]; + UCHAR Reserved3[40]; +} INQUIRYDATA, *PINQUIRYDATA; +#endif + +typedef struct _MODE_CAPABILITIES_PAGE { + UCHAR PageCode : 6; + UCHAR Reserved1 : 2; + UCHAR PageLength; + UCHAR Reserved2[2]; + UCHAR RO : 1; + UCHAR Reserved3 : 4; + UCHAR SPREV : 1; + UCHAR Reserved4 : 2; + UCHAR Reserved5 : 3; + UCHAR EFMT : 1; + UCHAR Reserved6 : 1; + UCHAR QFA : 1; + UCHAR Reserved7 : 2; + UCHAR LOCK : 1; + UCHAR LOCKED : 1; + UCHAR PREVENT : 1; + UCHAR UNLOAD : 1; + UCHAR Reserved8 : 2; + UCHAR ECC : 1; + UCHAR CMPRS : 1; + UCHAR Reserved9 : 1; + UCHAR BLK512 : 1; + UCHAR BLK1024 : 1; + UCHAR Reserved10 : 4; + UCHAR SLOWB : 1; + UCHAR MaximumSpeedSupported[2]; + UCHAR MaximumStoredDefectedListEntries[2]; + UCHAR ContinuousTransferLimit[2]; + UCHAR CurrentSpeedSelected[2]; + UCHAR BufferSize[2]; + UCHAR Reserved11[2]; +} MODE_CAPABILITIES_PAGE, *PMODE_CAPABILITIES_PAGE; + +typedef BOOLEAN DDKAPI +(*TAPE_VERIFY_INQUIRY_ROUTINE)( + IN PINQUIRYDATA InquiryData, + IN PMODE_CAPABILITIES_PAGE ModeCapabilitiesPage); + +typedef VOID DDKAPI +(*TAPE_EXTENSION_INIT_ROUTINE)( + IN PVOID MinitapeExtension, + IN PINQUIRYDATA InquiryData, + IN PMODE_CAPABILITIES_PAGE ModeCapabilitiesPage); + +typedef VOID DDKAPI +(*TAPE_ERROR_ROUTINE)( + IN PVOID MinitapeExtension, + IN PSCSI_REQUEST_BLOCK Srb, + IN OUT PTAPE_STATUS TapeStatus); + +typedef TAPE_STATUS DDKAPI +(*TAPE_PROCESS_COMMAND_ROUTINE)( + IN OUT PVOID MinitapeExtension, + IN OUT PVOID CommandExtension, + IN OUT PVOID CommandParameters, + IN OUT PSCSI_REQUEST_BLOCK Srb, + IN ULONG CallNumber, + IN TAPE_STATUS StatusOfLastCommand, + IN OUT PULONG RetryFlags); + +#define TAPE_RETRY_MASK 0x0000FFFF +#define IGNORE_ERRORS 0x00010000 +#define RETURN_ERRORS 0x00020000 + +typedef struct _TAPE_INIT_DATA { + TAPE_VERIFY_INQUIRY_ROUTINE VerifyInquiry; + BOOLEAN QueryModeCapabilitiesPage; + ULONG MinitapeExtensionSize; + TAPE_EXTENSION_INIT_ROUTINE ExtensionInit; + ULONG DefaultTimeOutValue; + TAPE_ERROR_ROUTINE TapeError; + ULONG CommandExtensionSize; + TAPE_PROCESS_COMMAND_ROUTINE CreatePartition; + TAPE_PROCESS_COMMAND_ROUTINE Erase; + TAPE_PROCESS_COMMAND_ROUTINE GetDriveParameters; + TAPE_PROCESS_COMMAND_ROUTINE GetMediaParameters; + TAPE_PROCESS_COMMAND_ROUTINE GetPosition; + TAPE_PROCESS_COMMAND_ROUTINE GetStatus; + TAPE_PROCESS_COMMAND_ROUTINE Prepare; + TAPE_PROCESS_COMMAND_ROUTINE SetDriveParameters; + TAPE_PROCESS_COMMAND_ROUTINE SetMediaParameters; + TAPE_PROCESS_COMMAND_ROUTINE SetPosition; + TAPE_PROCESS_COMMAND_ROUTINE WriteMarks; + TAPE_PROCESS_COMMAND_ROUTINE PreProcessReadWrite; /* optional */ +} TAPE_INIT_DATA, *PTAPE_INIT_DATA; + +typedef struct _TAPE_PHYS_POSITION { + ULONG SeekBlockAddress; + ULONG SpaceBlockCount; +} TAPE_PHYS_POSITION, PTAPE_PHYS_POSITION; + +#pragma pack(pop) + +#ifdef __cplusplus +} +#endif + +#endif /* __MINITAPE_H */ diff --git a/reactos/include/ddk/mountdev.h b/reactos/include/ddk/mountdev.h new file mode 100644 index 00000000000..e11ef1d9808 --- /dev/null +++ b/reactos/include/ddk/mountdev.h @@ -0,0 +1,78 @@ +/* + * mountdev.h + * + * Mount point manager/mounted devices interface. + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __MOUNTDEV_H +#define __MOUNTDEV_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include "mountmgr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define IOCTL_MOUNTDEV_QUERY_DEVICE_NAME \ + CTL_CODE(MOUNTDEVCONTROLTYPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_MOUNTDEV_QUERY_UNIQUE_ID \ + CTL_CODE(MOUNTDEVCONTROLTYPE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_MOUNTDEV_UNIQUE_ID_CHANGE_NOTIFY \ + CTL_CODE(MOUNTDEVCONTROLTYPE, 1, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME \ + CTL_CODE(MOUNTDEVCONTROLTYPE, 3, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_MOUNTDEV_LINK_CREATED \ + CTL_CODE(MOUNTDEVCONTROLTYPE, 4, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_MOUNTDEV_LINK_DELETED \ + CTL_CODE(MOUNTDEVCONTROLTYPE, 5, METHOD_BUFFERED, FILE_ANY_ACCESS) + + +typedef struct _MOUNTDEV_SUGGESTED_LINK_NAME { + BOOLEAN UseOnlyIfThereAreNoOtherLinks; + USHORT NameLength; + WCHAR Name[1]; +} MOUNTDEV_SUGGESTED_LINK_NAME, *PMOUNTDEV_SUGGESTED_LINK_NAME; + +typedef struct _MOUNTDEV_UNIQUE_ID { + USHORT UniqueIdLength; + UCHAR UniqueId[1]; +} MOUNTDEV_UNIQUE_ID, *PMOUNTDEV_UNIQUE_ID; + +typedef struct _MOUNTDEV_UNIQUE_ID_CHANGE_NOTIFY_OUTPUT { + ULONG Size; + USHORT OldUniqueIdOffset; + USHORT OldUniqueIdLength; + USHORT NewUniqueIdOffset; + USHORT NewUniqueIdLength; +} MOUNTDEV_UNIQUE_ID_CHANGE_NOTIFY_OUTPUT; + +#ifdef __cplusplus +} +#endif + +#endif /* __MOUNTDEV_H */ diff --git a/reactos/include/ddk/mountmgr.h b/reactos/include/ddk/mountmgr.h new file mode 100644 index 00000000000..170e2732656 --- /dev/null +++ b/reactos/include/ddk/mountmgr.h @@ -0,0 +1,137 @@ +/* + * mountmgr.h + * + * Mount point manager interface. + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __MOUNTMGR_H +#define __MOUNTMGR_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +DEFINE_GUID(MOUNTDEV_MOUNTED_DEVICE_GUID, + 0x53f5630d, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b); + +#define MOUNTMGRCONTROLTYPE ((ULONG)'m') +#define MOUNTDEVCONTROLTYPE ((ULONG)'M') + +#define MOUNTMGR_DEVICE_NAME L"\\Device\\MountPointManager" +#define MOUNTMGR_DOS_DEVICE_NAME L"\\\\.\\MountPointManager" + +#define IOCTL_MOUNTMGR_CREATE_POINT \ + CTL_CODE(MOUNTMGRCONTROLTYPE, 0, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_MOUNTMGR_QUERY_POINTS \ + CTL_CODE(MOUNTMGRCONTROLTYPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_MOUNTMGR_DELETE_POINTS \ + CTL_CODE(MOUNTMGRCONTROLTYPE, 1, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_MOUNTMGR_DELETE_POINTS_DBONLY \ + CTL_CODE(MOUNTMGRCONTROLTYPE, 3, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_MOUNTMGR_NEXT_DRIVE_LETTER \ + CTL_CODE(MOUNTMGRCONTROLTYPE, 4, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_MOUNTMGR_AUTO_DL_ASSIGNMENTS \ + CTL_CODE(MOUNTMGRCONTROLTYPE, 5, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_MOUNTMGR_VOLUME_MOUNT_POINT_CREATED \ + CTL_CODE(MOUNTMGRCONTROLTYPE, 6, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_MOUNTMGR_VOLUME_MOUNT_POINT_DELETED \ + CTL_CODE(MOUNTMGRCONTROLTYPE, 7, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_MOUNTMGR_CHANGE_NOTIFY \ + CTL_CODE(MOUNTMGRCONTROLTYPE, 8, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_MOUNTMGR_KEEP_LINKS_WHEN_OFFLINE \ + CTL_CODE(MOUNTMGRCONTROLTYPE, 9, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_MOUNTMGR_CHECK_UNPROCESSED_VOLUMES \ + CTL_CODE(MOUNTMGRCONTROLTYPE, 10, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_MOUNTMGR_VOLUME_ARRIVAL_NOTIFICATION \ + CTL_CODE(MOUNTMGRCONTROLTYPE, 11, METHOD_BUFFERED, FILE_READ_ACCESS) + + +typedef struct _MOUNTDEV_NAME { + USHORT NameLength; + WCHAR Name[1]; +} MOUNTDEV_NAME, *PMOUNTDEV_NAME; + +typedef struct _MOUNTMGR_CHANGE_NOTIFY_INFO { + ULONG EpicNumber; +} MOUNTMGR_CHANGE_NOTIFY_INFO, *PMOUNTMGR_CHANGE_NOTIFY_INFO; + +typedef struct _MOUNTMGR_CREATE_POINT_INPUT { + USHORT SymbolicLinkNameOffset; + USHORT SymbolicLinkNameLength; + USHORT DeviceNameOffset; + USHORT DeviceNameLength; +} MOUNTMGR_CREATE_POINT_INPUT, *PMOUNTMGR_CREATE_POINT_INPUT; + +typedef struct _MOUNTMGR_DRIVE_LETTER_INFORMATION { + BOOLEAN DriveLetterWasAssigned; + UCHAR CurrentDriveLetter; +} MOUNTMGR_DRIVE_LETTER_INFORMATION, *PMOUNTMGR_DRIVE_LETTER_INFORMATION; + +typedef struct _MOUNTMGR_DRIVE_LETTER_TARGET { + USHORT DeviceNameLength; + WCHAR DeviceName[1]; +} MOUNTMGR_DRIVE_LETTER_TARGET, *PMOUNTMGR_DRIVE_LETTER_TARGET; + +typedef struct _MOUNTMGR_MOUNT_POINT { + ULONG SymbolicLinkNameOffset; + USHORT SymbolicLinkNameLength; + ULONG UniqueIdOffset; + USHORT UniqueIdLength; + ULONG DeviceNameOffset; + USHORT DeviceNameLength; +} MOUNTMGR_MOUNT_POINT, *PMOUNTMGR_MOUNT_POINT; + +typedef struct _MOUNTMGR_MOUNT_POINTS { + ULONG Size; + ULONG NumberOfMountPoints; + MOUNTMGR_MOUNT_POINT MountPoints[1]; +} MOUNTMGR_MOUNT_POINTS, *PMOUNTMGR_MOUNT_POINTS; + +typedef struct _MOUNTMGR_TARGET_NAME { + USHORT DeviceNameLength; + WCHAR DeviceName[1]; +} MOUNTMGR_TARGET_NAME, *PMOUNTMGR_TARGET_NAME; + +typedef struct _MOUNTMGR_VOLUME_MOUNT_POINT { + USHORT SourceVolumeNameOffset; + USHORT SourceVolumeNameLength; + USHORT TargetVolumeNameOffset; + USHORT TargetVolumeNameLength; +} MOUNTMGR_VOLUME_MOUNT_POINT, *PMOUNTMGR_VOLUME_MOUNT_POINT; + +#ifdef __cplusplus +} +#endif + +#endif /* __MOUNTMGR_H */ diff --git a/reactos/include/ddk/ndis.h b/reactos/include/ddk/ndis.h new file mode 100644 index 00000000000..76cd5d33b53 --- /dev/null +++ b/reactos/include/ddk/ndis.h @@ -0,0 +1,5437 @@ +/* + * ndis.h + * + * Network Device Interface Specification definitions + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * DEFINES: i386 - Target platform is i386 + * NDIS_WRAPPER - Define only for NDIS library + * NDIS_MINIPORT_DRIVER - Define only for NDIS miniport drivers + * NDIS40 - Use NDIS 4.0 structures by default + * NDIS50 - Use NDIS 5.0 structures by default + * NDIS51 - Use NDIS 5.1 structures by default + * NDIS40_MINIPORT - Building NDIS 4.0 miniport driver + * NDIS50_MINIPORT - Building NDIS 5.0 miniport driver + * NDIS51_MINIPORT - Building NDIS 5.1 miniport driver + */ + +#ifndef __NDIS_H +#define __NDIS_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include "ntddk.h" +#include "ntddndis.h" +#include "netpnp.h" +#include "netevent.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(NDIS_WRAPPER) + #define NDISAPI DECLSPEC_EXPORT +#else + #define NDISAPI DECLSPEC_IMPORT +#endif + +#if defined(NDIS50_MINIPORT) && !defined(NDIS_MINIPORT_MAJOR_VERSION) && !defined(NDIS_MINIPORT_MINOR_VERSION) +#define NDIS_MINIPORT_MAJOR_VERSION 5 +#define NDIS_MINIPORT_MINOR_VERSION 0 +#endif + +#if defined(NDIS51_MINIPORT) && !defined(NDIS_MINIPORT_MAJOR_VERSION) && !defined(NDIS_MINIPORT_MINOR_VERSION) +#define NDIS_MINIPORT_MAJOR_VERSION 5 +#define NDIS_MINIPORT_MINOR_VERSION 1 +#endif + +#if defined(NDIS50) && !defined(NDIS_PROTOCOL_MAJOR_VERSION) && !defined(NDIS_PROTOCOL_MINOR_VERSION) +#define NDIS_PROTOCOL_MAJOR_VERSION 5 +#define NDIS_PROTOCOL_MINOR_VERSION 0 +#endif + +#if defined(NDIS51) && !defined(NDIS_PROTOCOL_MAJOR_VERSION) && !defined(NDIS_PROTOCOL_MINOR_VERSION) +#define NDIS_PROTOCOL_MAJOR_VERSION 5 +#define NDIS_PROTOCOL_MINOR_VERSION 1 +#endif + +#if defined(NDIS_MINIPORT_DRIVER) && !defined(BINARY_COMPATIBLE) +#define BINARY_COMPATIBLE 1 +#endif + +#if !defined(_M_IX86) && BINARY_COMPATIBLE +#undef BINARY_COMPATIBLE +#define BINARY_COMPATIBLE 0 +#endif + +#if 1 +/* FIXME: */ +typedef PVOID QUEUED_CLOSE; +#endif + +typedef ULONG NDIS_OID, *PNDIS_OID; + +typedef struct _X_FILTER FDDI_FILTER, *PFDDI_FILTER; +typedef struct _X_FILTER TR_FILTER, *PTR_FILTER; +typedef struct _X_FILTER NULL_FILTER, *PNULL_FILTER; + +typedef struct _REFERENCE { + KSPIN_LOCK SpinLock; + USHORT ReferenceCount; + BOOLEAN Closing; +} REFERENCE, * PREFERENCE; + + +/* NDIS base types */ + +typedef struct _NDIS_SPIN_LOCK { + KSPIN_LOCK SpinLock; + KIRQL OldIrql; +} NDIS_SPIN_LOCK, * PNDIS_SPIN_LOCK; + +typedef struct _NDIS_EVENT { + KEVENT Event; +} NDIS_EVENT, *PNDIS_EVENT; + +typedef PVOID NDIS_HANDLE, *PNDIS_HANDLE; +typedef int NDIS_STATUS, *PNDIS_STATUS; + +typedef ANSI_STRING NDIS_ANSI_STRING, *PNDIS_ANSI_STRING; +typedef UNICODE_STRING NDIS_STRING, *PNDIS_STRING; + +typedef MDL NDIS_BUFFER, *PNDIS_BUFFER; +typedef ULONG NDIS_ERROR_CODE, *PNDIS_ERROR_CODE; + + +/* NDIS_STATUS constants */ +#define NDIS_STATUS_SUCCESS ((NDIS_STATUS)STATUS_SUCCESS) +#define NDIS_STATUS_PENDING ((NDIS_STATUS)STATUS_PENDING) +#define NDIS_STATUS_NOT_RECOGNIZED ((NDIS_STATUS)0x00010001L) +#define NDIS_STATUS_NOT_COPIED ((NDIS_STATUS)0x00010002L) +#define NDIS_STATUS_NOT_ACCEPTED ((NDIS_STATUS)0x00010003L) +#define NDIS_STATUS_CALL_ACTIVE ((NDIS_STATUS)0x00010007L) +#define NDIS_STATUS_ONLINE ((NDIS_STATUS)0x40010003L) +#define NDIS_STATUS_RESET_START ((NDIS_STATUS)0x40010004L) +#define NDIS_STATUS_RESET_END ((NDIS_STATUS)0x40010005L) +#define NDIS_STATUS_RING_STATUS ((NDIS_STATUS)0x40010006L) +#define NDIS_STATUS_CLOSED ((NDIS_STATUS)0x40010007L) +#define NDIS_STATUS_WAN_LINE_UP ((NDIS_STATUS)0x40010008L) +#define NDIS_STATUS_WAN_LINE_DOWN ((NDIS_STATUS)0x40010009L) +#define NDIS_STATUS_WAN_FRAGMENT ((NDIS_STATUS)0x4001000AL) +#define NDIS_STATUS_MEDIA_CONNECT ((NDIS_STATUS)0x4001000BL) +#define NDIS_STATUS_MEDIA_DISCONNECT ((NDIS_STATUS)0x4001000CL) +#define NDIS_STATUS_HARDWARE_LINE_UP ((NDIS_STATUS)0x4001000DL) +#define NDIS_STATUS_HARDWARE_LINE_DOWN ((NDIS_STATUS)0x4001000EL) +#define NDIS_STATUS_INTERFACE_UP ((NDIS_STATUS)0x4001000FL) +#define NDIS_STATUS_INTERFACE_DOWN ((NDIS_STATUS)0x40010010L) +#define NDIS_STATUS_MEDIA_BUSY ((NDIS_STATUS)0x40010011L) +#define NDIS_STATUS_MEDIA_SPECIFIC_INDICATION ((NDIS_STATUS)0x40010012L) +#define NDIS_STATUS_WW_INDICATION NDIS_STATUS_MEDIA_SPECIFIC_INDICATION +#define NDIS_STATUS_LINK_SPEED_CHANGE ((NDIS_STATUS)0x40010013L) +#define NDIS_STATUS_WAN_GET_STATS ((NDIS_STATUS)0x40010014L) +#define NDIS_STATUS_WAN_CO_FRAGMENT ((NDIS_STATUS)0x40010015L) +#define NDIS_STATUS_WAN_CO_LINKPARAMS ((NDIS_STATUS)0x40010016L) + +#define NDIS_STATUS_NOT_RESETTABLE ((NDIS_STATUS)0x80010001L) +#define NDIS_STATUS_SOFT_ERRORS ((NDIS_STATUS)0x80010003L) +#define NDIS_STATUS_HARD_ERRORS ((NDIS_STATUS)0x80010004L) +#define NDIS_STATUS_BUFFER_OVERFLOW ((NDIS_STATUS)STATUS_BUFFER_OVERFLOW) + +#define NDIS_STATUS_FAILURE ((NDIS_STATUS)STATUS_UNSUCCESSFUL) +#define NDIS_STATUS_RESOURCES ((NDIS_STATUS)STATUS_INSUFFICIENT_RESOURCES) +#define NDIS_STATUS_CLOSING ((NDIS_STATUS)0xC0010002L) +#define NDIS_STATUS_BAD_VERSION ((NDIS_STATUS)0xC0010004L) +#define NDIS_STATUS_BAD_CHARACTERISTICS ((NDIS_STATUS)0xC0010005L) +#define NDIS_STATUS_ADAPTER_NOT_FOUND ((NDIS_STATUS)0xC0010006L) +#define NDIS_STATUS_OPEN_FAILED ((NDIS_STATUS)0xC0010007L) +#define NDIS_STATUS_DEVICE_FAILED ((NDIS_STATUS)0xC0010008L) +#define NDIS_STATUS_MULTICAST_FULL ((NDIS_STATUS)0xC0010009L) +#define NDIS_STATUS_MULTICAST_EXISTS ((NDIS_STATUS)0xC001000AL) +#define NDIS_STATUS_MULTICAST_NOT_FOUND ((NDIS_STATUS)0xC001000BL) +#define NDIS_STATUS_REQUEST_ABORTED ((NDIS_STATUS)0xC001000CL) +#define NDIS_STATUS_RESET_IN_PROGRESS ((NDIS_STATUS)0xC001000DL) +#define NDIS_STATUS_CLOSING_INDICATING ((NDIS_STATUS)0xC001000EL) +#define NDIS_STATUS_NOT_SUPPORTED ((NDIS_STATUS)STATUS_NOT_SUPPORTED) +#define NDIS_STATUS_INVALID_PACKET ((NDIS_STATUS)0xC001000FL) +#define NDIS_STATUS_OPEN_LIST_FULL ((NDIS_STATUS)0xC0010010L) +#define NDIS_STATUS_ADAPTER_NOT_READY ((NDIS_STATUS)0xC0010011L) +#define NDIS_STATUS_ADAPTER_NOT_OPEN ((NDIS_STATUS)0xC0010012L) +#define NDIS_STATUS_NOT_INDICATING ((NDIS_STATUS)0xC0010013L) +#define NDIS_STATUS_INVALID_LENGTH ((NDIS_STATUS)0xC0010014L) +#define NDIS_STATUS_INVALID_DATA ((NDIS_STATUS)0xC0010015L) +#define NDIS_STATUS_BUFFER_TOO_SHORT ((NDIS_STATUS)0xC0010016L) +#define NDIS_STATUS_INVALID_OID ((NDIS_STATUS)0xC0010017L) +#define NDIS_STATUS_ADAPTER_REMOVED ((NDIS_STATUS)0xC0010018L) +#define NDIS_STATUS_UNSUPPORTED_MEDIA ((NDIS_STATUS)0xC0010019L) +#define NDIS_STATUS_GROUP_ADDRESS_IN_USE ((NDIS_STATUS)0xC001001AL) +#define NDIS_STATUS_FILE_NOT_FOUND ((NDIS_STATUS)0xC001001BL) +#define NDIS_STATUS_ERROR_READING_FILE ((NDIS_STATUS)0xC001001CL) +#define NDIS_STATUS_ALREADY_MAPPED ((NDIS_STATUS)0xC001001DL) +#define NDIS_STATUS_RESOURCE_CONFLICT ((NDIS_STATUS)0xC001001EL) +#define NDIS_STATUS_NO_CABLE ((NDIS_STATUS)0xC001001FL) + +#define NDIS_STATUS_INVALID_SAP ((NDIS_STATUS)0xC0010020L) +#define NDIS_STATUS_SAP_IN_USE ((NDIS_STATUS)0xC0010021L) +#define NDIS_STATUS_INVALID_ADDRESS ((NDIS_STATUS)0xC0010022L) +#define NDIS_STATUS_VC_NOT_ACTIVATED ((NDIS_STATUS)0xC0010023L) +#define NDIS_STATUS_DEST_OUT_OF_ORDER ((NDIS_STATUS)0xC0010024L) +#define NDIS_STATUS_VC_NOT_AVAILABLE ((NDIS_STATUS)0xC0010025L) +#define NDIS_STATUS_CELLRATE_NOT_AVAILABLE ((NDIS_STATUS)0xC0010026L) +#define NDIS_STATUS_INCOMPATABLE_QOS ((NDIS_STATUS)0xC0010027L) +#define NDIS_STATUS_AAL_PARAMS_UNSUPPORTED ((NDIS_STATUS)0xC0010028L) +#define NDIS_STATUS_NO_ROUTE_TO_DESTINATION ((NDIS_STATUS)0xC0010029L) + +#define NDIS_STATUS_TOKEN_RING_OPEN_ERROR ((NDIS_STATUS)0xC0011000L) +#define NDIS_STATUS_INVALID_DEVICE_REQUEST ((NDIS_STATUS)STATUS_INVALID_DEVICE_REQUEST) +#define NDIS_STATUS_NETWORK_UNREACHABLE ((NDIS_STATUS)STATUS_NETWORK_UNREACHABLE) + + +/* NDIS error codes for error logging */ + +#define NDIS_ERROR_CODE_RESOURCE_CONFLICT EVENT_NDIS_RESOURCE_CONFLICT +#define NDIS_ERROR_CODE_OUT_OF_RESOURCES EVENT_NDIS_OUT_OF_RESOURCE +#define NDIS_ERROR_CODE_HARDWARE_FAILURE EVENT_NDIS_HARDWARE_FAILURE +#define NDIS_ERROR_CODE_ADAPTER_NOT_FOUND EVENT_NDIS_ADAPTER_NOT_FOUND +#define NDIS_ERROR_CODE_INTERRUPT_CONNECT EVENT_NDIS_INTERRUPT_CONNECT +#define NDIS_ERROR_CODE_DRIVER_FAILURE EVENT_NDIS_DRIVER_FAILURE +#define NDIS_ERROR_CODE_BAD_VERSION EVENT_NDIS_BAD_VERSION +#define NDIS_ERROR_CODE_TIMEOUT EVENT_NDIS_TIMEOUT +#define NDIS_ERROR_CODE_NETWORK_ADDRESS EVENT_NDIS_NETWORK_ADDRESS +#define NDIS_ERROR_CODE_UNSUPPORTED_CONFIGURATION EVENT_NDIS_UNSUPPORTED_CONFIGURATION +#define NDIS_ERROR_CODE_INVALID_VALUE_FROM_ADAPTER EVENT_NDIS_INVALID_VALUE_FROM_ADAPTER +#define NDIS_ERROR_CODE_MISSING_CONFIGURATION_PARAMETER EVENT_NDIS_MISSING_CONFIGURATION_PARAMETER +#define NDIS_ERROR_CODE_BAD_IO_BASE_ADDRESS EVENT_NDIS_BAD_IO_BASE_ADDRESS +#define NDIS_ERROR_CODE_RECEIVE_SPACE_SMALL EVENT_NDIS_RECEIVE_SPACE_SMALL +#define NDIS_ERROR_CODE_ADAPTER_DISABLED EVENT_NDIS_ADAPTER_DISABLED + + +/* Memory allocation flags. Used by Ndis[Allocate|Free]Memory */ +#define NDIS_MEMORY_CONTIGUOUS 0x00000001 +#define NDIS_MEMORY_NONCACHED 0x00000002 + +/* NIC attribute flags. Used by NdisMSetAttributes(Ex) */ +#define NDIS_ATTRIBUTE_IGNORE_PACKET_TIMEOUT 0x00000001 +#define NDIS_ATTRIBUTE_IGNORE_REQUEST_TIMEOUT 0x00000002 +#define NDIS_ATTRIBUTE_IGNORE_TOKEN_RING_ERRORS 0x00000004 +#define NDIS_ATTRIBUTE_BUS_MASTER 0x00000008 +#define NDIS_ATTRIBUTE_INTERMEDIATE_DRIVER 0x00000010 +#define NDIS_ATTRIBUTE_DESERIALIZE 0x00000020 +#define NDIS_ATTRIBUTE_NO_HALT_ON_SUSPEND 0x00000040 +#define NDIS_ATTRIBUTE_SURPRISE_REMOVE_OK 0x00000080 +#define NDIS_ATTRIBUTE_NOT_CO_NDIS 0x00000100 +#define NDIS_ATTRIBUTE_USES_SAFE_BUFFER_APIS 0x00000200 + + +/* Lock */ + +typedef union _NDIS_RW_LOCK_REFCOUNT { + UINT RefCount; + UCHAR cacheLine[16]; +} NDIS_RW_LOCK_REFCOUNT; + +typedef struct _NDIS_RW_LOCK { + union { + struct { + KSPIN_LOCK SpinLock; + PVOID Context; + }; + UCHAR Reserved[16]; + }; + + NDIS_RW_LOCK_REFCOUNT RefCount[MAXIMUM_PROCESSORS]; +} NDIS_RW_LOCK, *PNDIS_RW_LOCK; + +typedef struct _LOCK_STATE { + USHORT LockState; + KIRQL OldIrql; +} LOCK_STATE, *PLOCK_STATE; + + + +/* Timer */ + +typedef VOID DDKAPI +(*PNDIS_TIMER_FUNCTION)( + IN PVOID SystemSpecific1, + IN PVOID FunctionContext, + IN PVOID SystemSpecific2, + IN PVOID SystemSpecific3); + +typedef struct _NDIS_TIMER { + KTIMER Timer; + KDPC Dpc; +} NDIS_TIMER, *PNDIS_TIMER; + + + +/* Hardware */ + +typedef CM_MCA_POS_DATA NDIS_MCA_POS_DATA, *PNDIS_MCA_POS_DATA; +typedef CM_EISA_SLOT_INFORMATION NDIS_EISA_SLOT_INFORMATION, *PNDIS_EISA_SLOT_INFORMATION; +typedef CM_EISA_FUNCTION_INFORMATION NDIS_EISA_FUNCTION_INFORMATION, *PNDIS_EISA_FUNCTION_INFORMATION; +typedef CM_PARTIAL_RESOURCE_LIST NDIS_RESOURCE_LIST, *PNDIS_RESOURCE_LIST; + +/* Hardware status codes (OID_GEN_HARDWARE_STATUS) */ +typedef enum _NDIS_HARDWARE_STATUS { + NdisHardwareStatusReady, + NdisHardwareStatusInitializing, + NdisHardwareStatusReset, + NdisHardwareStatusClosing, + NdisHardwareStatusNotReady +} NDIS_HARDWARE_STATUS, *PNDIS_HARDWARE_STATUS; + +/* OID_GEN_GET_TIME_CAPS */ +typedef struct _GEN_GET_TIME_CAPS { + ULONG Flags; + ULONG ClockPrecision; +} GEN_GET_TIME_CAPS, *PGEN_GET_TIME_CAPS; + +/* Flag bits */ +#define READABLE_LOCAL_CLOCK 0x00000001 +#define CLOCK_NETWORK_DERIVED 0x00000002 +#define CLOCK_PRECISION 0x00000004 +#define RECEIVE_TIME_INDICATION_CAPABLE 0x00000008 +#define TIMED_SEND_CAPABLE 0x00000010 +#define TIME_STAMP_CAPABLE 0x00000020 + +/* OID_GEN_GET_NETCARD_TIME */ +typedef struct _GEN_GET_NETCARD_TIME { + ULONGLONG ReadTime; +} GEN_GET_NETCARD_TIME, *PGEN_GET_NETCARD_TIME; + +/* NDIS driver medium (OID_GEN_MEDIA_SUPPORTED / OID_GEN_MEDIA_IN_USE) */ +typedef enum _NDIS_MEDIUM { + NdisMedium802_3, + NdisMedium802_5, + NdisMediumFddi, + NdisMediumWan, + NdisMediumLocalTalk, + NdisMediumDix, + NdisMediumArcnetRaw, + NdisMediumArcnet878_2, + NdisMediumAtm, + NdisMediumWirelessWan, + NdisMediumIrda, + NdisMediumBpc, + NdisMediumCoWan, + NdisMedium1394, + NdisMediumMax +} NDIS_MEDIUM, *PNDIS_MEDIUM; + +/* NDIS packet filter bits (OID_GEN_CURRENT_PACKET_FILTER) */ +#define NDIS_PACKET_TYPE_DIRECTED 0x00000001 +#define NDIS_PACKET_TYPE_MULTICAST 0x00000002 +#define NDIS_PACKET_TYPE_ALL_MULTICAST 0x00000004 +#define NDIS_PACKET_TYPE_BROADCAST 0x00000008 +#define NDIS_PACKET_TYPE_SOURCE_ROUTING 0x00000010 +#define NDIS_PACKET_TYPE_PROMISCUOUS 0x00000020 +#define NDIS_PACKET_TYPE_SMT 0x00000040 +#define NDIS_PACKET_TYPE_ALL_LOCAL 0x00000080 +#define NDIS_PACKET_TYPE_GROUP 0x00001000 +#define NDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x00002000 +#define NDIS_PACKET_TYPE_FUNCTIONAL 0x00004000 +#define NDIS_PACKET_TYPE_MAC_FRAME 0x00008000 + +/* NDIS protocol option bits (OID_GEN_PROTOCOL_OPTIONS) */ +#define NDIS_PROT_OPTION_ESTIMATED_LENGTH 0x00000001 +#define NDIS_PROT_OPTION_NO_LOOPBACK 0x00000002 +#define NDIS_PROT_OPTION_NO_RSVD_ON_RCVPKT 0x00000004 + +/* NDIS MAC option bits (OID_GEN_MAC_OPTIONS) */ +#define NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA 0x00000001 +#define NDIS_MAC_OPTION_RECEIVE_SERIALIZED 0x00000002 +#define NDIS_MAC_OPTION_TRANSFERS_NOT_PEND 0x00000004 +#define NDIS_MAC_OPTION_NO_LOOPBACK 0x00000008 +#define NDIS_MAC_OPTION_FULL_DUPLEX 0x00000010 +#define NDIS_MAC_OPTION_EOTX_INDICATION 0x00000020 +#define NDIS_MAC_OPTION_8021P_PRIORITY 0x00000040 +#define NDIS_MAC_OPTION_RESERVED 0x80000000 + +/* State of the LAN media (OID_GEN_MEDIA_CONNECT_STATUS) */ +typedef enum _NDIS_MEDIA_STATE { + NdisMediaStateConnected, + NdisMediaStateDisconnected +} NDIS_MEDIA_STATE, *PNDIS_MEDIA_STATE; + +/* OID_GEN_SUPPORTED_GUIDS */ +typedef struct _NDIS_GUID { + GUID Guid; + union { + NDIS_OID Oid; + NDIS_STATUS Status; + } u; + ULONG Size; + ULONG Flags; +} NDIS_GUID, *PNDIS_GUID; + +#define NDIS_GUID_TO_OID 0x00000001 +#define NDIS_GUID_TO_STATUS 0x00000002 +#define NDIS_GUID_ANSI_STRING 0x00000004 +#define NDIS_GUID_UNICODE_STRING 0x00000008 +#define NDIS_GUID_ARRAY 0x00000010 + +typedef HANDLE PNDIS_PACKET_POOL; + +/* NDIS_PACKET_PRIVATE.Flags constants */ +#define fPACKET_CONTAINS_MEDIA_SPECIFIC_INFO 0x40 +#define fPACKET_ALLOCATED_BY_NDIS 0x80 + +typedef struct _NDIS_PACKET_PRIVATE { + UINT PhysicalCount; + UINT TotalLength; + PNDIS_BUFFER Head; + PNDIS_BUFFER Tail; + PNDIS_PACKET_POOL Pool; + UINT Count; + ULONG Flags; + BOOLEAN ValidCounts; + UCHAR NdisPacketFlags; + USHORT NdisPacketOobOffset; +} NDIS_PACKET_PRIVATE, * PNDIS_PACKET_PRIVATE; + +typedef struct _NDIS_PACKET { + NDIS_PACKET_PRIVATE Private; + union { + struct { + UCHAR MiniportReserved[2 * sizeof(PVOID)]; + UCHAR WrapperReserved[2 * sizeof(PVOID)]; + }; + struct { + UCHAR MiniportReservedEx[3 * sizeof(PVOID)]; + UCHAR WrapperReservedEx[sizeof(PVOID)]; + }; + struct { + UCHAR MacReserved[4 * sizeof(PVOID)]; + }; + }; + ULONG_PTR Reserved[2]; + UCHAR ProtocolReserved[1]; +} NDIS_PACKET, *PNDIS_PACKET, **PPNDIS_PACKET; + +typedef enum _NDIS_CLASS_ID { + NdisClass802_3Priority, + NdisClassWirelessWanMbxMailbox, + NdisClassIrdaPacketInfo, + NdisClassAtmAALInfo +} NDIS_CLASS_ID; + +typedef struct MediaSpecificInformation { + UINT NextEntryOffset; + NDIS_CLASS_ID ClassId; + UINT Size; + UCHAR ClassInformation[1]; +} MEDIA_SPECIFIC_INFORMATION; + +typedef struct _NDIS_PACKET_OOB_DATA { + _ANONYMOUS_UNION union { + ULONGLONG TimeToSend; + ULONGLONG TimeSent; + } DUMMYUNIONNAME; + ULONGLONG TimeReceived; + UINT HeaderSize; + UINT SizeMediaSpecificInfo; + PVOID MediaSpecificInformation; + NDIS_STATUS Status; +} NDIS_PACKET_OOB_DATA, *PNDIS_PACKET_OOB_DATA; + +typedef struct _NDIS_PM_PACKET_PATTERN { + ULONG Priority; + ULONG Reserved; + ULONG MaskSize; + ULONG PatternOffset; + ULONG PatternSize; + ULONG PatternFlags; +} NDIS_PM_PACKET_PATTERN, *PNDIS_PM_PACKET_PATTERN; + + +/* Request types used by NdisRequest */ +typedef enum _NDIS_REQUEST_TYPE { + NdisRequestQueryInformation, + NdisRequestSetInformation, + NdisRequestQueryStatistics, + NdisRequestOpen, + NdisRequestClose, + NdisRequestSend, + NdisRequestTransferData, + NdisRequestReset, + NdisRequestGeneric1, + NdisRequestGeneric2, + NdisRequestGeneric3, + NdisRequestGeneric4 +} NDIS_REQUEST_TYPE, *PNDIS_REQUEST_TYPE; + +typedef struct _NDIS_REQUEST { + UCHAR MacReserved[4 * sizeof(PVOID)]; + NDIS_REQUEST_TYPE RequestType; + union _DATA { + struct QUERY_INFORMATION { + NDIS_OID Oid; + PVOID InformationBuffer; + UINT InformationBufferLength; + UINT BytesWritten; + UINT BytesNeeded; + } QUERY_INFORMATION; + struct SET_INFORMATION { + NDIS_OID Oid; + PVOID InformationBuffer; + UINT InformationBufferLength; + UINT BytesRead; + UINT BytesNeeded; + } SET_INFORMATION; + } DATA; +#if (defined(NDIS50) || defined(NDIS51)) + UCHAR NdisReserved[9 * sizeof(PVOID)]; + union { + UCHAR CallMgrReserved[2 * sizeof(PVOID)]; + UCHAR ProtocolReserved[2 * sizeof(PVOID)]; + }; + UCHAR MiniportReserved[2 * sizeof(PVOID)]; +#endif +} NDIS_REQUEST, *PNDIS_REQUEST; + + + +/* Wide Area Networks definitions */ + +typedef struct _NDIS_WAN_PACKET { + LIST_ENTRY WanPacketQueue; + PUCHAR CurrentBuffer; + ULONG CurrentLength; + PUCHAR StartBuffer; + PUCHAR EndBuffer; + PVOID ProtocolReserved1; + PVOID ProtocolReserved2; + PVOID ProtocolReserved3; + PVOID ProtocolReserved4; + PVOID MacReserved1; + PVOID MacReserved2; + PVOID MacReserved3; + PVOID MacReserved4; +} NDIS_WAN_PACKET, *PNDIS_WAN_PACKET; + + + +/* DMA channel information */ + +typedef struct _NDIS_DMA_DESCRIPTION { + BOOLEAN DemandMode; + BOOLEAN AutoInitialize; + BOOLEAN DmaChannelSpecified; + DMA_WIDTH DmaWidth; + DMA_SPEED DmaSpeed; + ULONG DmaPort; + ULONG DmaChannel; +} NDIS_DMA_DESCRIPTION, *PNDIS_DMA_DESCRIPTION; + +typedef struct _NDIS_DMA_BLOCK { + PVOID MapRegisterBase; + KEVENT AllocationEvent; + PADAPTER_OBJECT SystemAdapterObject; + PVOID Miniport; + BOOLEAN InProgress; +} NDIS_DMA_BLOCK, *PNDIS_DMA_BLOCK; + +typedef UCHAR NDIS_DMA_SIZE; + +#define NDIS_DMA_24BITS ((NDIS_DMA_SIZE)0) +#define NDIS_DMA_32BITS ((NDIS_DMA_SIZE)1) +#define NDIS_DMA_64BITS ((NDIS_DMA_SIZE)2) + +typedef enum _NDIS_PROCESSOR_TYPE { + NdisProcessorX86, + NdisProcessorMips, + NdisProcessorAlpha, + NdisProcessorPpc, + NdisProcessorAmd64 +} NDIS_PROCESSOR_TYPE, *PNDIS_PROCESSOR_TYPE; + +typedef enum _NDIS_ENVIRONMENT_TYPE { + NdisEnvironmentWindows, + NdisEnvironmentWindowsNt +} NDIS_ENVIRONMENT_TYPE, *PNDIS_ENVIRONMENT_TYPE; + +/* Possible hardware architecture */ +typedef enum _NDIS_INTERFACE_TYPE { + NdisInterfaceInternal = Internal, + NdisInterfaceIsa = Isa, + NdisInterfaceEisa = Eisa, + NdisInterfaceMca = MicroChannel, + NdisInterfaceTurboChannel = TurboChannel, + NdisInterfacePci = PCIBus, + NdisInterfacePcMcia = PCMCIABus, + NdisInterfaceCBus = CBus, + NdisInterfaceMPIBus = MPIBus, + NdisInterfaceMPSABus = MPSABus, + NdisInterfaceProcessorInternal = ProcessorInternal, + NdisInterfaceInternalPowerBus = InternalPowerBus, + NdisInterfacePNPISABus = PNPISABus, + NdisInterfacePNPBus = PNPBus, + NdisMaximumInterfaceType +} NDIS_INTERFACE_TYPE, *PNDIS_INTERFACE_TYPE; + +#define NdisInterruptLevelSensitive LevelSensitive +#define NdisInterruptLatched Latched +typedef KINTERRUPT_MODE NDIS_INTERRUPT_MODE, *PNDIS_INTERRUPT_MODE; + + +typedef enum _NDIS_PARAMETER_TYPE { + NdisParameterInteger, + NdisParameterHexInteger, + NdisParameterString, + NdisParameterMultiString, + NdisParameterBinary +} NDIS_PARAMETER_TYPE, *PNDIS_PARAMETER_TYPE; + +typedef struct { + USHORT Length; + PVOID Buffer; +} BINARY_DATA; + +typedef struct _NDIS_CONFIGURATION_PARAMETER { + NDIS_PARAMETER_TYPE ParameterType; + union { + ULONG IntegerData; + NDIS_STRING StringData; + BINARY_DATA BinaryData; + } ParameterData; +} NDIS_CONFIGURATION_PARAMETER, *PNDIS_CONFIGURATION_PARAMETER; + + +typedef PHYSICAL_ADDRESS NDIS_PHYSICAL_ADDRESS, *PNDIS_PHYSICAL_ADDRESS; + +typedef struct _NDIS_PHYSICAL_ADDRESS_UNIT { + NDIS_PHYSICAL_ADDRESS PhysicalAddress; + UINT Length; +} NDIS_PHYSICAL_ADDRESS_UNIT, *PNDIS_PHYSICAL_ADDRESS_UNIT; + +typedef struct _NDIS_WAN_LINE_DOWN { + UCHAR RemoteAddress[6]; + UCHAR LocalAddress[6]; +} NDIS_WAN_LINE_DOWN, *PNDIS_WAN_LINE_DOWN; + +typedef struct _NDIS_WAN_LINE_UP { + ULONG LinkSpeed; + ULONG MaximumTotalSize; + NDIS_WAN_QUALITY Quality; + USHORT SendWindow; + UCHAR RemoteAddress[6]; + OUT UCHAR LocalAddress[6]; + ULONG ProtocolBufferLength; + PUCHAR ProtocolBuffer; + USHORT ProtocolType; + NDIS_STRING DeviceName; +} NDIS_WAN_LINE_UP, *PNDIS_WAN_LINE_UP; + + +typedef VOID DDKAPI +(*ADAPTER_SHUTDOWN_HANDLER)( + IN PVOID ShutdownContext); + + +typedef struct _OID_LIST OID_LIST, *POID_LIST; + +/* PnP state */ + +typedef enum _NDIS_PNP_DEVICE_STATE { + NdisPnPDeviceAdded, + NdisPnPDeviceStarted, + NdisPnPDeviceQueryStopped, + NdisPnPDeviceStopped, + NdisPnPDeviceQueryRemoved, + NdisPnPDeviceRemoved, + NdisPnPDeviceSurpriseRemoved +} NDIS_PNP_DEVICE_STATE; + +#define NDIS_DEVICE_NOT_STOPPABLE 0x00000001 +#define NDIS_DEVICE_NOT_REMOVEABLE 0x00000002 +#define NDIS_DEVICE_NOT_SUSPENDABLE 0x00000004 +#define NDIS_DEVICE_DISABLE_PM 0x00000008 +#define NDIS_DEVICE_DISABLE_WAKE_UP 0x00000010 +#define NDIS_DEVICE_DISABLE_WAKE_ON_RECONNECT 0x00000020 +#define NDIS_DEVICE_RESERVED 0x00000040 +#define NDIS_DEVICE_DISABLE_WAKE_ON_MAGIC_PACKET 0x00000080 +#define NDIS_DEVICE_DISABLE_WAKE_ON_PATTERN_MATCH 0x00000100 + + +/* OID_GEN_NETWORK_LAYER_ADDRESSES */ +typedef struct _NETWORK_ADDRESS { + USHORT AddressLength; + USHORT AddressType; + UCHAR Address[1]; +} NETWORK_ADDRESS, *PNETWORK_ADDRESS; + +typedef struct _NETWORK_ADDRESS_LIST { + LONG AddressCount; + USHORT AddressType; + NETWORK_ADDRESS Address[1]; +} NETWORK_ADDRESS_LIST, *PNETWORK_ADDRESS_LIST; + +/* Protocol types supported by NDIS */ +#define NDIS_PROTOCOL_ID_DEFAULT 0x00 +#define NDIS_PROTOCOL_ID_TCP_IP 0x02 +#define NDIS_PROTOCOL_ID_IPX 0x06 +#define NDIS_PROTOCOL_ID_NBF 0x07 +#define NDIS_PROTOCOL_ID_MAX 0x0F +#define NDIS_PROTOCOL_ID_MASK 0x0F + + +/* OID_GEN_TRANSPORT_HEADER_OFFSET */ +typedef struct _TRANSPORT_HEADER_OFFSET { + USHORT ProtocolType; + USHORT HeaderOffset; +} TRANSPORT_HEADER_OFFSET, *PTRANSPORT_HEADER_OFFSET; + + +/* OID_GEN_CO_LINK_SPEED / OID_GEN_CO_MINIMUM_LINK_SPEED */ +typedef struct _NDIS_CO_LINK_SPEED { + ULONG Outbound; + ULONG Inbound; +} NDIS_CO_LINK_SPEED, *PNDIS_CO_LINK_SPEED; + +typedef ULONG NDIS_AF, *PNDIS_AF; +#define CO_ADDRESS_FAMILY_Q2931 ((NDIS_AF)0x1) +#define CO_ADDRESS_FAMILY_PSCHED ((NDIS_AF)0x2) +#define CO_ADDRESS_FAMILY_L2TP ((NDIS_AF)0x3) +#define CO_ADDRESS_FAMILY_IRDA ((NDIS_AF)0x4) +#define CO_ADDRESS_FAMILY_1394 ((NDIS_AF)0x5) +#define CO_ADDRESS_FAMILY_PPP ((NDIS_AF)0x6) +#define CO_ADDRESS_FAMILY_TAPI ((NDIS_AF)0x800) +#define CO_ADDRESS_FAMILY_TAPI_PROXY ((NDIS_AF)0x801) + +#define CO_ADDRESS_FAMILY_PROXY 0x80000000 + +typedef struct { + NDIS_AF AddressFamily; + ULONG MajorVersion; + ULONG MinorVersion; +} CO_ADDRESS_FAMILY, *PCO_ADDRESS_FAMILY; + +typedef struct _CO_SPECIFIC_PARAMETERS { + ULONG ParamType; + ULONG Length; + UCHAR Parameters[1]; +} CO_SPECIFIC_PARAMETERS, *PCO_SPECIFIC_PARAMETERS; + +typedef struct _CO_CALL_MANAGER_PARAMETERS { + FLOWSPEC Transmit; + FLOWSPEC Receive; + CO_SPECIFIC_PARAMETERS CallMgrSpecific; +} CO_CALL_MANAGER_PARAMETERS, *PCO_CALL_MANAGER_PARAMETERS; + +/* CO_MEDIA_PARAMETERS.Flags constants */ +#define RECEIVE_TIME_INDICATION 0x00000001 +#define USE_TIME_STAMPS 0x00000002 +#define TRANSMIT_VC 0x00000004 +#define RECEIVE_VC 0x00000008 +#define INDICATE_ERRED_PACKETS 0x00000010 +#define INDICATE_END_OF_TX 0x00000020 +#define RESERVE_RESOURCES_VC 0x00000040 +#define ROUND_DOWN_FLOW 0x00000080 +#define ROUND_UP_FLOW 0x00000100 + +typedef struct _CO_MEDIA_PARAMETERS { + ULONG Flags; + ULONG ReceivePriority; + ULONG ReceiveSizeHint; + CO_SPECIFIC_PARAMETERS MediaSpecific; +} CO_MEDIA_PARAMETERS, *PCO_MEDIA_PARAMETERS; + +/* CO_CALL_PARAMETERS.Flags constants */ +#define PERMANENT_VC 0x00000001 +#define CALL_PARAMETERS_CHANGED 0x00000002 +#define QUERY_CALL_PARAMETERS 0x00000004 +#define BROADCAST_VC 0x00000008 +#define MULTIPOINT_VC 0x00000010 + +typedef struct _CO_CALL_PARAMETERS { + ULONG Flags; + PCO_CALL_MANAGER_PARAMETERS CallMgrParameters; + PCO_MEDIA_PARAMETERS MediaParameters; +} CO_CALL_PARAMETERS, *PCO_CALL_PARAMETERS; + +typedef struct _CO_SAP { + ULONG SapType; + ULONG SapLength; + UCHAR Sap[1]; +} CO_SAP, *PCO_SAP; + +typedef struct _NDIS_IPSEC_PACKET_INFO { + _ANONYMOUS_UNION union { + struct { + NDIS_HANDLE OffloadHandle; + NDIS_HANDLE NextOffloadHandle; + } Transmit; + struct { + ULONG SA_DELETE_REQ : 1; + ULONG CRYPTO_DONE : 1; + ULONG NEXT_CRYPTO_DONE : 1; + ULONG CryptoStatus; + } Receive; + } DUMMYUNIONNAME; +} NDIS_IPSEC_PACKET_INFO, *PNDIS_IPSEC_PACKET_INFO; + +/* NDIS_MAC_FRAGMENT.Errors constants */ +#define WAN_ERROR_CRC 0x00000001 +#define WAN_ERROR_FRAMING 0x00000002 +#define WAN_ERROR_HARDWAREOVERRUN 0x00000004 +#define WAN_ERROR_BUFFEROVERRUN 0x00000008 +#define WAN_ERROR_TIMEOUT 0x00000010 +#define WAN_ERROR_ALIGNMENT 0x00000020 + +typedef struct _NDIS_MAC_FRAGMENT { + NDIS_HANDLE NdisLinkContext; + ULONG Errors; +} NDIS_MAC_FRAGMENT, *PNDIS_MAC_FRAGMENT; + +typedef struct _NDIS_MAC_LINE_DOWN { + NDIS_HANDLE NdisLinkContext; +} NDIS_MAC_LINE_DOWN, *PNDIS_MAC_LINE_DOWN; + +typedef struct _NDIS_MAC_LINE_UP { + ULONG LinkSpeed; + NDIS_WAN_QUALITY Quality; + USHORT SendWindow; + NDIS_HANDLE ConnectionWrapperID; + NDIS_HANDLE NdisLinkHandle; + NDIS_HANDLE NdisLinkContext; +} NDIS_MAC_LINE_UP, *PNDIS_MAC_LINE_UP; + +typedef struct _NDIS_PACKET_8021Q_INFO { + _ANONYMOUS_UNION union { + struct { + UINT32 UserPriority : 3; + UINT32 CanonicalFormatId : 1; + UINT32 VlanId : 12; + UINT32 Reserved : 16; + } TagHeader; + PVOID Value; + } DUMMYUNIONNAME; +} NDIS_PACKET_8021Q_INFO, *PNDIS_PACKET_8021Q_INFO; + +typedef enum _NDIS_PER_PACKET_INFO { + TcpIpChecksumPacketInfo, + IpSecPacketInfo, + TcpLargeSendPacketInfo, + ClassificationHandlePacketInfo, + NdisReserved, + ScatterGatherListPacketInfo, + Ieee8021QInfo, + OriginalPacketInfo, + PacketCancelId, + MaxPerPacketInfo +} NDIS_PER_PACKET_INFO, *PNDIS_PER_PACKET_INFO; + +typedef struct _NDIS_PACKET_EXTENSION { + PVOID NdisPacketInfo[MaxPerPacketInfo]; +} NDIS_PACKET_EXTENSION, *PNDIS_PACKET_EXTENSION; + +/* + * PNDIS_PACKET + * NDIS_GET_ORIGINAL_PACKET( + * IN PNDIS_PACKET Packet); + */ +#define NDIS_GET_ORIGINAL_PACKET(Packet) \ + NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, OriginalPacketInfo) + +/* + * PVOID + * NDIS_GET_PACKET_CANCEL_ID( + * IN PNDIS_PACKET Packet); + */ +#define NDIS_GET_PACKET_CANCEL_ID(Packet) \ + NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, PacketCancelId) + +/* + * PNDIS_PACKET_EXTENSION + * NDIS_PACKET_EXTENSION_FROM_PACKET( + * IN PNDIS_PACKET Packet); + */ +#define NDIS_PACKET_EXTENSION_FROM_PACKET(Packet) \ + ((PNDIS_PACKET_EXTENSION)((PUCHAR)(Packet) \ + + (Packet)->Private.NdisPacketOobOffset + sizeof(NDIS_PACKET_OOB_DATA))) + +/* + * PVOID + * NDIS_PER_PACKET_INFO_FROM_PACKET( + * IN OUT PNDIS_PACKET Packet, + * IN NDIS_PER_PACKET_INFO InfoType); + */ +#define NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, InfoType) \ + ((PNDIS_PACKET_EXTENSION)((PUCHAR)(Packet) + (Packet)->Private.NdisPacketOobOffset \ + + sizeof(NDIS_PACKET_OOB_DATA)))->NdisPacketInfo[(InfoType)] + +/* + * VOID + * NDIS_SET_ORIGINAL_PACKET( + * IN OUT PNDIS_PACKET Packet, + * IN PNDIS_PACKET OriginalPacket); + */ +#define NDIS_SET_ORIGINAL_PACKET(Packet, OriginalPacket) \ + NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, OriginalPacketInfo) = (OriginalPacket) + +/* + * VOID + * NDIS_SET_PACKET_CANCEL_ID( + * IN PNDIS_PACKET Packet + * IN ULONG_PTR CancelId); + */ +#define NDIS_SET_PACKET_CANCEL_ID(Packet, CancelId) \ + NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, PacketCancelId) = (CancelId) + +typedef enum _NDIS_TASK { + TcpIpChecksumNdisTask, + IpSecNdisTask, + TcpLargeSendNdisTask, + MaxNdisTask +} NDIS_TASK, *PNDIS_TASK; + +typedef struct _NDIS_TASK_IPSEC { + struct { + ULONG AH_ESP_COMBINED; + ULONG TRANSPORT_TUNNEL_COMBINED; + ULONG V4_OPTIONS; + ULONG RESERVED; + } Supported; + + struct { + ULONG MD5 : 1; + ULONG SHA_1 : 1; + ULONG Transport : 1; + ULONG Tunnel : 1; + ULONG Send : 1; + ULONG Receive : 1; + } V4AH; + + struct { + ULONG DES : 1; + ULONG RESERVED : 1; + ULONG TRIPLE_DES : 1; + ULONG NULL_ESP : 1; + ULONG Transport : 1; + ULONG Tunnel : 1; + ULONG Send : 1; + ULONG Receive : 1; + } V4ESP; +} NDIS_TASK_IPSEC, *PNDIS_TASK_IPSEC; + +typedef struct _NDIS_TASK_OFFLOAD { + ULONG Version; + ULONG Size; + NDIS_TASK Task; + ULONG OffsetNextTask; + ULONG TaskBufferLength; + UCHAR TaskBuffer[1]; +} NDIS_TASK_OFFLOAD, *PNDIS_TASK_OFFLOAD; + +/* NDIS_TASK_OFFLOAD_HEADER.Version constants */ +#define NDIS_TASK_OFFLOAD_VERSION 1 + +typedef enum _NDIS_ENCAPSULATION { + UNSPECIFIED_Encapsulation, + NULL_Encapsulation, + IEEE_802_3_Encapsulation, + IEEE_802_5_Encapsulation, + LLC_SNAP_ROUTED_Encapsulation, + LLC_SNAP_BRIDGED_Encapsulation +} NDIS_ENCAPSULATION; + +typedef struct _NDIS_ENCAPSULATION_FORMAT { + NDIS_ENCAPSULATION Encapsulation; + struct { + ULONG FixedHeaderSize : 1; + ULONG Reserved : 31; + } Flags; + ULONG EncapsulationHeaderSize; +} NDIS_ENCAPSULATION_FORMAT, *PNDIS_ENCAPSULATION_FORMAT; + +typedef struct _NDIS_TASK_TCP_IP_CHECKSUM { + struct { + ULONG IpOptionsSupported:1; + ULONG TcpOptionsSupported:1; + ULONG TcpChecksum:1; + ULONG UdpChecksum:1; + ULONG IpChecksum:1; + } V4Transmit; + + struct { + ULONG IpOptionsSupported : 1; + ULONG TcpOptionsSupported : 1; + ULONG TcpChecksum : 1; + ULONG UdpChecksum : 1; + ULONG IpChecksum : 1; + } V4Receive; + + struct { + ULONG IpOptionsSupported : 1; + ULONG TcpOptionsSupported : 1; + ULONG TcpChecksum : 1; + ULONG UdpChecksum : 1; + } V6Transmit; + + struct { + ULONG IpOptionsSupported : 1; + ULONG TcpOptionsSupported : 1; + ULONG TcpChecksum : 1; + ULONG UdpChecksum : 1; + } V6Receive; +} NDIS_TASK_TCP_IP_CHECKSUM, *PNDIS_TASK_TCP_IP_CHECKSUM; + +typedef struct _NDIS_TASK_TCP_LARGE_SEND { + ULONG Version; + ULONG MaxOffLoadSize; + ULONG MinSegmentCount; + BOOLEAN TcpOptions; + BOOLEAN IpOptions; +} NDIS_TASK_TCP_LARGE_SEND, *PNDIS_TASK_TCP_LARGE_SEND; + +typedef struct _NDIS_TCP_IP_CHECKSUM_PACKET_INFO { + _ANONYMOUS_UNION union { + struct { + ULONG NdisPacketChecksumV4 : 1; + ULONG NdisPacketChecksumV6 : 1; + ULONG NdisPacketTcpChecksum : 1; + ULONG NdisPacketUdpChecksum : 1; + ULONG NdisPacketIpChecksum : 1; + } Transmit; + + struct { + ULONG NdisPacketTcpChecksumFailed : 1; + ULONG NdisPacketUdpChecksumFailed : 1; + ULONG NdisPacketIpChecksumFailed : 1; + ULONG NdisPacketTcpChecksumSucceeded : 1; + ULONG NdisPacketUdpChecksumSucceeded : 1; + ULONG NdisPacketIpChecksumSucceeded : 1; + ULONG NdisPacketLoopback : 1; + } Receive; + ULONG Value; + } DUMMYUNIONNAME; +} NDIS_TCP_IP_CHECKSUM_PACKET_INFO, *PNDIS_TCP_IP_CHECKSUM_PACKET_INFO; + +typedef struct _NDIS_WAN_CO_FRAGMENT { + ULONG Errors; +} NDIS_WAN_CO_FRAGMENT, *PNDIS_WAN_CO_FRAGMENT; + +typedef struct _NDIS_WAN_FRAGMENT { + UCHAR RemoteAddress[6]; + UCHAR LocalAddress[6]; +} NDIS_WAN_FRAGMENT, *PNDIS_WAN_FRAGMENT; + +typedef struct _WAN_CO_LINKPARAMS { + ULONG TransmitSpeed; + ULONG ReceiveSpeed; + ULONG SendWindow; +} WAN_CO_LINKPARAMS, *PWAN_CO_LINKPARAMS; + + +/* Call Manager */ + +typedef VOID DDKAPI +(*CM_ACTIVATE_VC_COMPLETE_HANDLER)( + IN NDIS_STATUS Status, + IN NDIS_HANDLE CallMgrVcContext, + IN PCO_CALL_PARAMETERS CallParameters); + +typedef NDIS_STATUS DDKAPI +(*CM_ADD_PARTY_HANDLER)( + IN NDIS_HANDLE CallMgrVcContext, + IN OUT PCO_CALL_PARAMETERS CallParameters, + IN NDIS_HANDLE NdisPartyHandle, + OUT PNDIS_HANDLE CallMgrPartyContext); + +typedef NDIS_STATUS DDKAPI +(*CM_CLOSE_AF_HANDLER)( + IN NDIS_HANDLE CallMgrAfContext); + +typedef NDIS_STATUS DDKAPI +(*CM_CLOSE_CALL_HANDLER)( + IN NDIS_HANDLE CallMgrVcContext, + IN NDIS_HANDLE CallMgrPartyContext OPTIONAL, + IN PVOID CloseData OPTIONAL, + IN UINT Size OPTIONAL); + +typedef NDIS_STATUS DDKAPI +(*CM_DEREG_SAP_HANDLER)( + IN NDIS_HANDLE CallMgrSapContext); + +typedef VOID DDKAPI +(*CM_DEACTIVATE_VC_COMPLETE_HANDLER)( + IN NDIS_STATUS Status, + IN NDIS_HANDLE CallMgrVcContext); + +typedef NDIS_STATUS DDKAPI +(*CM_DROP_PARTY_HANDLER)( + IN NDIS_HANDLE CallMgrPartyContext, + IN PVOID CloseData OPTIONAL, + IN UINT Size OPTIONAL); + +typedef VOID DDKAPI +(*CM_INCOMING_CALL_COMPLETE_HANDLER)( + IN NDIS_STATUS Status, + IN NDIS_HANDLE CallMgrVcContext, + IN PCO_CALL_PARAMETERS CallParameters); + +typedef NDIS_STATUS DDKAPI +(*CM_MAKE_CALL_HANDLER)( + IN NDIS_HANDLE CallMgrVcContext, + IN OUT PCO_CALL_PARAMETERS CallParameters, + IN NDIS_HANDLE NdisPartyHandle OPTIONAL, + OUT PNDIS_HANDLE CallMgrPartyContext OPTIONAL); + +typedef NDIS_STATUS DDKAPI +(*CM_MODIFY_CALL_QOS_HANDLER)( + IN NDIS_HANDLE CallMgrVcContext, + IN PCO_CALL_PARAMETERS CallParameters); + +typedef NDIS_STATUS DDKAPI +(*CM_OPEN_AF_HANDLER)( + IN NDIS_HANDLE CallMgrBindingContext, + IN PCO_ADDRESS_FAMILY AddressFamily, + IN NDIS_HANDLE NdisAfHandle, + OUT PNDIS_HANDLE CallMgrAfContext); + +typedef NDIS_STATUS DDKAPI +(*CM_REG_SAP_HANDLER)( + IN NDIS_HANDLE CallMgrAfContext, + IN PCO_SAP Sap, + IN NDIS_HANDLE NdisSapHandle, + OUT PNDIS_HANDLE CallMgrSapContext); + +typedef NDIS_STATUS DDKAPI +(*CO_CREATE_VC_HANDLER)( + IN NDIS_HANDLE ProtocolAfContext, + IN NDIS_HANDLE NdisVcHandle, + OUT PNDIS_HANDLE ProtocolVcContext); + +typedef NDIS_STATUS DDKAPI +(*CO_DELETE_VC_HANDLER)( + IN NDIS_HANDLE ProtocolVcContext); + +typedef VOID DDKAPI +(*CO_REQUEST_COMPLETE_HANDLER)( + IN NDIS_STATUS Status, + IN NDIS_HANDLE ProtocolAfContext OPTIONAL, + IN NDIS_HANDLE ProtocolVcContext OPTIONAL, + IN NDIS_HANDLE ProtocolPartyContext OPTIONAL, + IN PNDIS_REQUEST NdisRequest); + +typedef NDIS_STATUS DDKAPI +(*CO_REQUEST_HANDLER)( + IN NDIS_HANDLE ProtocolAfContext, + IN NDIS_HANDLE ProtocolVcContext OPTIONAL, + IN NDIS_HANDLE ProtocolPartyContext OPTIONAL, + IN OUT PNDIS_REQUEST NdisRequest); + +typedef struct _NDIS_CALL_MANAGER_CHARACTERISTICS { + UCHAR MajorVersion; + UCHAR MinorVersion; + USHORT Filler; + UINT Reserved; + CO_CREATE_VC_HANDLER CmCreateVcHandler; + CO_DELETE_VC_HANDLER CmDeleteVcHandler; + CM_OPEN_AF_HANDLER CmOpenAfHandler; + CM_CLOSE_AF_HANDLER CmCloseAfHandler; + CM_REG_SAP_HANDLER CmRegisterSapHandler; + CM_DEREG_SAP_HANDLER CmDeregisterSapHandler; + CM_MAKE_CALL_HANDLER CmMakeCallHandler; + CM_CLOSE_CALL_HANDLER CmCloseCallHandler; + CM_INCOMING_CALL_COMPLETE_HANDLER CmIncomingCallCompleteHandler; + CM_ADD_PARTY_HANDLER CmAddPartyHandler; + CM_DROP_PARTY_HANDLER CmDropPartyHandler; + CM_ACTIVATE_VC_COMPLETE_HANDLER CmActivateVcCompleteHandler; + CM_DEACTIVATE_VC_COMPLETE_HANDLER CmDeactivateVcCompleteHandler; + CM_MODIFY_CALL_QOS_HANDLER CmModifyCallQoSHandler; + CO_REQUEST_HANDLER CmRequestHandler; + CO_REQUEST_COMPLETE_HANDLER CmRequestCompleteHandler; +} NDIS_CALL_MANAGER_CHARACTERISTICS, *PNDIS_CALL_MANAGER_CHARACTERISTICS; + + + +/* Call Manager clients */ + +typedef VOID (*CL_OPEN_AF_COMPLETE_HANDLER)( + IN NDIS_STATUS Status, + IN NDIS_HANDLE ProtocolAfContext, + IN NDIS_HANDLE NdisAfHandle); + +typedef VOID DDKAPI +(*CL_CLOSE_AF_COMPLETE_HANDLER)( + IN NDIS_STATUS Status, + IN NDIS_HANDLE ProtocolAfContext); + +typedef VOID DDKAPI +(*CL_REG_SAP_COMPLETE_HANDLER)( + IN NDIS_STATUS Status, + IN NDIS_HANDLE ProtocolSapContext, + IN PCO_SAP Sap, + IN NDIS_HANDLE NdisSapHandle); + +typedef VOID DDKAPI +(*CL_DEREG_SAP_COMPLETE_HANDLER)( + IN NDIS_STATUS Status, + IN NDIS_HANDLE ProtocolSapContext); + +typedef VOID DDKAPI +(*CL_MAKE_CALL_COMPLETE_HANDLER)( + IN NDIS_STATUS Status, + IN NDIS_HANDLE ProtocolVcContext, + IN NDIS_HANDLE NdisPartyHandle OPTIONAL, + IN PCO_CALL_PARAMETERS CallParameters); + +typedef VOID DDKAPI +(*CL_MODIFY_CALL_QOS_COMPLETE_HANDLER)( + IN NDIS_STATUS Status, + IN NDIS_HANDLE ProtocolVcContext, + IN PCO_CALL_PARAMETERS CallParameters); + +typedef VOID DDKAPI +(*CL_CLOSE_CALL_COMPLETE_HANDLER)( + IN NDIS_STATUS Status, + IN NDIS_HANDLE ProtocolVcContext, + IN NDIS_HANDLE ProtocolPartyContext OPTIONAL); + +typedef VOID DDKAPI +(*CL_ADD_PARTY_COMPLETE_HANDLER)( + IN NDIS_STATUS Status, + IN NDIS_HANDLE ProtocolPartyContext, + IN NDIS_HANDLE NdisPartyHandle, + IN PCO_CALL_PARAMETERS CallParameters); + +typedef VOID DDKAPI +(*CL_DROP_PARTY_COMPLETE_HANDLER)( + IN NDIS_STATUS Status, + IN NDIS_HANDLE ProtocolPartyContext); + +typedef NDIS_STATUS DDKAPI +(*CL_INCOMING_CALL_HANDLER)( + IN NDIS_HANDLE ProtocolSapContext, + IN NDIS_HANDLE ProtocolVcContext, + IN OUT PCO_CALL_PARAMETERS CallParameters); + +typedef VOID DDKAPI +(*CL_INCOMING_CALL_QOS_CHANGE_HANDLER)( + IN NDIS_HANDLE ProtocolVcContext, + IN PCO_CALL_PARAMETERS CallParameters); + +typedef VOID DDKAPI +(*CL_INCOMING_CLOSE_CALL_HANDLER)( + IN NDIS_STATUS CloseStatus, + IN NDIS_HANDLE ProtocolVcContext, + IN PVOID CloseData OPTIONAL, + IN UINT Size OPTIONAL); + +typedef VOID DDKAPI +(*CL_INCOMING_DROP_PARTY_HANDLER)( + IN NDIS_STATUS DropStatus, + IN NDIS_HANDLE ProtocolPartyContext, + IN PVOID CloseData OPTIONAL, + IN UINT Size OPTIONAL); + +typedef VOID DDKAPI +(*CL_CALL_CONNECTED_HANDLER)( + IN NDIS_HANDLE ProtocolVcContext); + + +typedef struct _NDIS_CLIENT_CHARACTERISTICS { + UCHAR MajorVersion; + UCHAR MinorVersion; + USHORT Filler; + UINT Reserved; + CO_CREATE_VC_HANDLER ClCreateVcHandler; + CO_DELETE_VC_HANDLER ClDeleteVcHandler; + CO_REQUEST_HANDLER ClRequestHandler; + CO_REQUEST_COMPLETE_HANDLER ClRequestCompleteHandler; + CL_OPEN_AF_COMPLETE_HANDLER ClOpenAfCompleteHandler; + CL_CLOSE_AF_COMPLETE_HANDLER ClCloseAfCompleteHandler; + CL_REG_SAP_COMPLETE_HANDLER ClRegisterSapCompleteHandler; + CL_DEREG_SAP_COMPLETE_HANDLER ClDeregisterSapCompleteHandler; + CL_MAKE_CALL_COMPLETE_HANDLER ClMakeCallCompleteHandler; + CL_MODIFY_CALL_QOS_COMPLETE_HANDLER ClModifyCallQoSCompleteHandler; + CL_CLOSE_CALL_COMPLETE_HANDLER ClCloseCallCompleteHandler; + CL_ADD_PARTY_COMPLETE_HANDLER ClAddPartyCompleteHandler; + CL_DROP_PARTY_COMPLETE_HANDLER ClDropPartyCompleteHandler; + CL_INCOMING_CALL_HANDLER ClIncomingCallHandler; + CL_INCOMING_CALL_QOS_CHANGE_HANDLER ClIncomingCallQoSChangeHandler; + CL_INCOMING_CLOSE_CALL_HANDLER ClIncomingCloseCallHandler; + CL_INCOMING_DROP_PARTY_HANDLER ClIncomingDropPartyHandler; + CL_CALL_CONNECTED_HANDLER ClCallConnectedHandler; +} NDIS_CLIENT_CHARACTERISTICS, *PNDIS_CLIENT_CHARACTERISTICS; + + +/* NDIS protocol structures */ + +/* Prototypes for NDIS 3.0 protocol characteristics */ + +typedef VOID DDKAPI +(*OPEN_ADAPTER_COMPLETE_HANDLER)( + IN NDIS_HANDLE ProtocolBindingContext, + IN NDIS_STATUS Status, + IN NDIS_STATUS OpenErrorStatus); + +typedef VOID DDKAPI +(*CLOSE_ADAPTER_COMPLETE_HANDLER)( + IN NDIS_HANDLE ProtocolBindingContext, + IN NDIS_STATUS Status); + +typedef VOID DDKAPI +(*RESET_COMPLETE_HANDLER)( + IN NDIS_HANDLE ProtocolBindingContext, + IN NDIS_STATUS Status); + +typedef VOID DDKAPI +(*REQUEST_COMPLETE_HANDLER)( + IN NDIS_HANDLE ProtocolBindingContext, + IN PNDIS_REQUEST NdisRequest, + IN NDIS_STATUS Status); + +typedef VOID DDKAPI +(*STATUS_HANDLER)( + IN NDIS_HANDLE ProtocolBindingContext, + IN NDIS_STATUS GeneralStatus, + IN PVOID StatusBuffer, + IN UINT StatusBufferSize); + +typedef VOID DDKAPI +(*STATUS_COMPLETE_HANDLER)( + IN NDIS_HANDLE ProtocolBindingContext); + +typedef VOID DDKAPI +(*SEND_COMPLETE_HANDLER)( + IN NDIS_HANDLE ProtocolBindingContext, + IN PNDIS_PACKET Packet, + IN NDIS_STATUS Status); + +typedef VOID DDKAPI +(*WAN_SEND_COMPLETE_HANDLER)( + IN NDIS_HANDLE ProtocolBindingContext, + IN PNDIS_WAN_PACKET Packet, + IN NDIS_STATUS Status); + +typedef VOID DDKAPI +(*TRANSFER_DATA_COMPLETE_HANDLER)( + IN NDIS_HANDLE ProtocolBindingContext, + IN PNDIS_PACKET Packet, + IN NDIS_STATUS Status, + IN UINT BytesTransferred); + +typedef VOID DDKAPI +(*WAN_TRANSFER_DATA_COMPLETE_HANDLER)( + VOID); + + +typedef NDIS_STATUS DDKAPI +(*RECEIVE_HANDLER)( + IN NDIS_HANDLE ProtocolBindingContext, + IN NDIS_HANDLE MacReceiveContext, + IN PVOID HeaderBuffer, + IN UINT HeaderBufferSize, + IN PVOID LookAheadBuffer, + IN UINT LookaheadBufferSize, + IN UINT PacketSize); + +typedef NDIS_STATUS DDKAPI +(*WAN_RECEIVE_HANDLER)( + IN NDIS_HANDLE NdisLinkHandle, + IN PUCHAR Packet, + IN ULONG PacketSize); + +typedef VOID DDKAPI +(*RECEIVE_COMPLETE_HANDLER)( + IN NDIS_HANDLE ProtocolBindingContext); + + +/* Protocol characteristics for NDIS 3.0 protocols */ + +#define NDIS30_PROTOCOL_CHARACTERISTICS_S \ + UCHAR MajorNdisVersion; \ + UCHAR MinorNdisVersion; \ + USHORT Filler; \ + _ANONYMOUS_UNION union { \ + UINT Reserved; \ + UINT Flags; \ + } DUMMYUNIONNAME; \ + OPEN_ADAPTER_COMPLETE_HANDLER OpenAdapterCompleteHandler; \ + CLOSE_ADAPTER_COMPLETE_HANDLER CloseAdapterCompleteHandler; \ + _ANONYMOUS_UNION union { \ + SEND_COMPLETE_HANDLER SendCompleteHandler; \ + WAN_SEND_COMPLETE_HANDLER WanSendCompleteHandler; \ + } DUMMYUNIONNAME2; \ + _ANONYMOUS_UNION union { \ + TRANSFER_DATA_COMPLETE_HANDLER TransferDataCompleteHandler; \ + WAN_TRANSFER_DATA_COMPLETE_HANDLER WanTransferDataCompleteHandler; \ + } DUMMYUNIONNAME3; \ + RESET_COMPLETE_HANDLER ResetCompleteHandler; \ + REQUEST_COMPLETE_HANDLER RequestCompleteHandler; \ + _ANONYMOUS_UNION union { \ + RECEIVE_HANDLER ReceiveHandler; \ + WAN_RECEIVE_HANDLER WanReceiveHandler; \ + } DUMMYUNIONNAME4; \ + RECEIVE_COMPLETE_HANDLER ReceiveCompleteHandler; \ + STATUS_HANDLER StatusHandler; \ + STATUS_COMPLETE_HANDLER StatusCompleteHandler; \ + NDIS_STRING Name; + +typedef struct _NDIS30_PROTOCOL_CHARACTERISTICS { + NDIS30_PROTOCOL_CHARACTERISTICS_S +} NDIS30_PROTOCOL_CHARACTERISTICS, *PNDIS30_PROTOCOL_CHARACTERISTICS; + + +/* Prototypes for NDIS 4.0 protocol characteristics */ + +typedef INT DDKAPI +(*RECEIVE_PACKET_HANDLER)( + IN NDIS_HANDLE ProtocolBindingContext, + IN PNDIS_PACKET Packet); + +typedef VOID DDKAPI +(*BIND_HANDLER)( + OUT PNDIS_STATUS Status, + IN NDIS_HANDLE BindContext, + IN PNDIS_STRING DeviceName, + IN PVOID SystemSpecific1, + IN PVOID SystemSpecific2); + +typedef VOID DDKAPI +(*UNBIND_HANDLER)( + OUT PNDIS_STATUS Status, + IN NDIS_HANDLE ProtocolBindingContext, + IN NDIS_HANDLE UnbindContext); + +typedef NDIS_STATUS DDKAPI +(*PNP_EVENT_HANDLER)( + IN NDIS_HANDLE ProtocolBindingContext, + IN PNET_PNP_EVENT NetPnPEvent); + +typedef VOID DDKAPI +(*UNLOAD_PROTOCOL_HANDLER)( + VOID); + + +/* Protocol characteristics for NDIS 4.0 protocols */ + +#ifdef __cplusplus + +#define NDIS40_PROTOCOL_CHARACTERISTICS_S \ + NDIS30_PROTOCOL_CHARACTERISTICS Ndis30Chars; \ + RECEIVE_PACKET_HANDLER ReceivePacketHandler; \ + BIND_HANDLER BindAdapterHandler; \ + UNBIND_HANDLER UnbindAdapterHandler; \ + PNP_EVENT_HANDLER PnPEventHandler; \ + UNLOAD_PROTOCOL_HANDLER UnloadHandler; + +#else /* !__cplusplus */ + +#define NDIS40_PROTOCOL_CHARACTERISTICS_S \ + NDIS30_PROTOCOL_CHARACTERISTICS_S \ + RECEIVE_PACKET_HANDLER ReceivePacketHandler; \ + BIND_HANDLER BindAdapterHandler; \ + UNBIND_HANDLER UnbindAdapterHandler; \ + PNP_EVENT_HANDLER PnPEventHandler; \ + UNLOAD_PROTOCOL_HANDLER UnloadHandler; + +#endif /* __cplusplus */ + +typedef struct _NDIS40_PROTOCOL_CHARACTERISTICS { + NDIS40_PROTOCOL_CHARACTERISTICS_S +} NDIS40_PROTOCOL_CHARACTERISTICS, *PNDIS40_PROTOCOL_CHARACTERISTICS; + +/* Prototypes for NDIS 5.0 protocol characteristics */ + +typedef VOID DDKAPI +(*CO_SEND_COMPLETE_HANDLER)( + IN NDIS_STATUS Status, + IN NDIS_HANDLE ProtocolVcContext, + IN PNDIS_PACKET Packet); + +typedef VOID DDKAPI +(*CO_STATUS_HANDLER)( + IN NDIS_HANDLE ProtocolBindingContext, + IN NDIS_HANDLE ProtocolVcContext OPTIONAL, + IN NDIS_STATUS GeneralStatus, + IN PVOID StatusBuffer, + IN UINT StatusBufferSize); + +typedef UINT DDKAPI +(*CO_RECEIVE_PACKET_HANDLER)( + IN NDIS_HANDLE ProtocolBindingContext, + IN NDIS_HANDLE ProtocolVcContext, + IN PNDIS_PACKET Packet); + +typedef VOID DDKAPI +(*CO_AF_REGISTER_NOTIFY_HANDLER)( + IN NDIS_HANDLE ProtocolBindingContext, + IN PCO_ADDRESS_FAMILY AddressFamily); + +#ifdef __cplusplus \ + +#define NDIS50_PROTOCOL_CHARACTERISTICS_S \ + NDIS40_PROTOCOL_CHARACTERISTICS Ndis40Chars; \ + PVOID ReservedHandlers[4]; \ + CO_SEND_COMPLETE_HANDLER CoSendCompleteHandler; \ + CO_STATUS_HANDLER CoStatusHandler; \ + CO_RECEIVE_PACKET_HANDLER CoReceivePacketHandler; \ + CO_AF_REGISTER_NOTIFY_HANDLER CoAfRegisterNotifyHandler; + +#else /* !__cplusplus */ + +#define NDIS50_PROTOCOL_CHARACTERISTICS_S \ + NDIS40_PROTOCOL_CHARACTERISTICS_S \ + PVOID ReservedHandlers[4]; \ + CO_SEND_COMPLETE_HANDLER CoSendCompleteHandler; \ + CO_STATUS_HANDLER CoStatusHandler; \ + CO_RECEIVE_PACKET_HANDLER CoReceivePacketHandler; \ + CO_AF_REGISTER_NOTIFY_HANDLER CoAfRegisterNotifyHandler; + +#endif /* !__cplusplus */ + +typedef struct _NDIS50_PROTOCOL_CHARACTERISTICS { + NDIS50_PROTOCOL_CHARACTERISTICS_S +} NDIS50_PROTOCOL_CHARACTERISTICS, *PNDIS50_PROTOCOL_CHARACTERISTICS; + +#if defined(NDIS50) || defined(NDIS51) +typedef struct _NDIS_PROTOCOL_CHARACTERISTICS { + NDIS50_PROTOCOL_CHARACTERISTICS_S; +} NDIS_PROTOCOL_CHARACTERISTICS, *PNDIS_PROTOCOL_CHARACTERISTICS; +#elif defined(NDIS40) +typedef struct _NDIS_PROTOCOL_CHARACTERISTICS { + NDIS40_PROTOCOL_CHARACTERISTICS_S; +} NDIS_PROTOCOL_CHARACTERISTICS, *PNDIS_PROTOCOL_CHARACTERISTICS; +#else /* NDIS30 */ +typedef struct _NDIS_PROTOCOL_CHARACTERISTICS { + NDIS30_PROTOCOL_CHARACTERISTICS_S +} NDIS_PROTOCOL_CHARACTERISTICS, *PNDIS_PROTOCOL_CHARACTERISTICS; +#endif + + + +/* Buffer management routines */ + +NDISAPI +VOID +DDKAPI +NdisAllocateBuffer( + OUT PNDIS_STATUS Status, + OUT PNDIS_BUFFER *Buffer, + IN NDIS_HANDLE PoolHandle, + IN PVOID VirtualAddress, + IN UINT Length); + + +NDISAPI +VOID +DDKAPI +NdisAllocateBufferPool( + OUT PNDIS_STATUS Status, + OUT PNDIS_HANDLE PoolHandle, + IN UINT NumberOfDescriptors); + +NDISAPI +VOID +DDKAPI +NdisAllocatePacket( + OUT PNDIS_STATUS Status, + OUT PNDIS_PACKET *Packet, + IN NDIS_HANDLE PoolHandle); + +NDISAPI +VOID +DDKAPI +NdisAllocatePacketPool( + OUT PNDIS_STATUS Status, + OUT PNDIS_HANDLE PoolHandle, + IN UINT NumberOfDescriptors, + IN UINT ProtocolReservedLength); + +NDISAPI +VOID +DDKAPI +NdisCopyBuffer( + OUT PNDIS_STATUS Status, + OUT PNDIS_BUFFER *Buffer, + IN NDIS_HANDLE PoolHandle, + IN PVOID MemoryDescriptor, + IN UINT Offset, + IN UINT Length); + +NDISAPI +VOID +DDKAPI +NdisCopyFromPacketToPacket( + IN PNDIS_PACKET Destination, + IN UINT DestinationOffset, + IN UINT BytesToCopy, + IN PNDIS_PACKET Source, + IN UINT SourceOffset, + OUT PUINT BytesCopied); + +/* + * VOID + * NdisCopyLookaheadData( + * IN PVOID Destination, + * IN PVOID Source, + * IN ULONG Length, + * IN ULONG ReceiveFlags); + */ + +#ifdef _M_IX86 +#define NdisCopyLookaheadData(Destination, Source, Length, MacOptions) \ + RtlCopyMemory(Destination, Source, Length) +#else +#define NdisCopyLookaheadData(Destination, Source, Length, MacOptions) \ + { \ + if ((MacOptions) & NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA) \ + { \ + RtlCopyMemory(_Destination, _Source, _Length); \ + } \ + else \ + { \ + PUCHAR _Src = (PUCHAR)(Source); \ + PUCHAR _Dest = (PUCHAR)(Destination); \ + PUCHAR _End = _Dest + (Length); \ + while (_Dest < _End) \ + *_Dest++ = *_Src++; \ + } \ + } +#endif + +NDISAPI +VOID +DDKAPI +NdisDprAllocatePacket( + OUT PNDIS_STATUS Status, + OUT PNDIS_PACKET *Packet, + IN NDIS_HANDLE PoolHandle); + +NDISAPI +VOID +DDKAPI +NdisDprAllocatePacketNonInterlocked( + OUT PNDIS_STATUS Status, + OUT PNDIS_PACKET *Packet, + IN NDIS_HANDLE PoolHandle); + +NDISAPI +VOID +DDKAPI +NdisDprFreePacket( + IN PNDIS_PACKET Packet); + +NDISAPI +VOID +DDKAPI +NdisDprFreePacketNonInterlocked( + IN PNDIS_PACKET Packet); + +NDISAPI +VOID +DDKAPI +NdisFreeBufferPool( + IN NDIS_HANDLE PoolHandle); + +NDISAPI +VOID +DDKAPI +NdisFreePacket( + IN PNDIS_PACKET Packet); + +NDISAPI +VOID +DDKAPI +NdisFreePacketPool( + IN NDIS_HANDLE PoolHandle); + +NDISAPI +VOID +DDKAPI +NdisReturnPackets( + IN PNDIS_PACKET *PacketsToReturn, + IN UINT NumberOfPackets); + +NDISAPI +VOID +DDKAPI +NdisUnchainBufferAtBack( + IN OUT PNDIS_PACKET Packet, + OUT PNDIS_BUFFER *Buffer); + +NDISAPI +VOID +DDKAPI +NdisUnchainBufferAtFront( + IN OUT PNDIS_PACKET Packet, + OUT PNDIS_BUFFER *Buffer); + +NDISAPI +VOID +DDKAPI +NdisAdjustBufferLength( + IN PNDIS_BUFFER Buffer, + IN UINT Length); + +NDISAPI +ULONG +DDKAPI +NdisBufferLength( + IN PNDIS_BUFFER Buffer); + +NDISAPI +PVOID +DDKAPI +NdisBufferVirtualAddress( + IN PNDIS_BUFFER Buffer); + +NDISAPI +ULONG +DDKAPI +NDIS_BUFFER_TO_SPAN_PAGES( + IN PNDIS_BUFFER Buffer); + +NDISAPI +VOID +DDKAPI +NdisFreeBuffer( + IN PNDIS_BUFFER Buffer); + +#if BINARY_COMPATIBLE + +NDISAPI +VOID +DDKAPI +NdisGetBufferPhysicalArraySize( + IN PNDIS_BUFFER Buffer, + OUT PUINT ArraySize); + +NDISAPI +VOID +DDKAPI +NdisGetFirstBufferFromPacket( + IN PNDIS_PACKET _Packet, + OUT PNDIS_BUFFER *_FirstBuffer, + OUT PVOID *_FirstBufferVA, + OUT PUINT _FirstBufferLength, + OUT PUINT _TotalBufferLength); + +NDISAPI +VOID +DDKAPI +NdisQueryBuffer( + IN PNDIS_BUFFER Buffer, + OUT PVOID *VirtualAddress OPTIONAL, + OUT PUINT Length); + +NDISAPI +VOID +DDKAPI +NdisQueryBufferOffset( + IN PNDIS_BUFFER Buffer, + OUT PUINT Offset, + OUT PUINT Length); + +#else + +/* + * VOID + * NdisGetBufferPhysicalArraySize( + * IN PNDIS_BUFFER Buffer, + * OUT PUINT ArraySize); + */ +#define NdisGetBufferPhysicalArraySize(Buffer, \ + ArraySize) \ +{ \ + (*(ArraySize) = NDIS_BUFFER_TO_SPAN_PAGES(Buffer)) \ +} + +/* + * VOID + * NdisGetFirstBufferFromPacket( + * IN PNDIS_PACKET _Packet, + * OUT PNDIS_BUFFER * _FirstBuffer, + * OUT PVOID * _FirstBufferVA, + * OUT PUINT _FirstBufferLength, + * OUT PUINT _TotalBufferLength) + */ +#define NdisGetFirstBufferFromPacket(_Packet, \ + _FirstBuffer, \ + _FirstBufferVA, \ + _FirstBufferLength, \ + _TotalBufferLength) \ +{ \ + PNDIS_BUFFER _Buffer; \ + \ + _Buffer = (_Packet)->Private.Head; \ + *(_FirstBuffer) = _Buffer; \ + if (_Buffer != NULL) \ + { \ + *(_FirstBufferVA) = MmGetSystemAddressForMdl(_Buffer); \ + *(_FirstBufferLength) = MmGetMdlByteCount(_Buffer); \ + _Buffer = _Buffer->Next; \ + *(_TotalBufferLength) = *(_FirstBufferLength); \ + while (_Buffer != NULL) { \ + *(_TotalBufferLength) += MmGetMdlByteCount(_Buffer); \ + _Buffer = _Buffer->Next; \ + } \ + } \ + else \ + { \ + *(_FirstBufferVA) = 0; \ + *(_FirstBufferLength) = 0; \ + *(_TotalBufferLength) = 0; \ + } \ +} + +/* + * VOID + * NdisQueryBuffer( + * IN PNDIS_BUFFER Buffer, + * OUT PVOID *VirtualAddress OPTIONAL, + * OUT PUINT Length) + */ +#define NdisQueryBuffer(Buffer, \ + VirtualAddress, \ + Length) \ +{ \ + if (VirtualAddress) \ + *((PVOID*)VirtualAddress) = MmGetSystemAddressForMdl(Buffer); \ + \ + *((PUINT)Length) = MmGetMdlByteCount(Buffer); \ +} + + +/* + * VOID + * NdisQueryBufferOffset( + * IN PNDIS_BUFFER Buffer, + * OUT PUINT Offset, + * OUT PUINT Length); + */ +#define NdisQueryBufferOffset(Buffer, \ + Offset, \ + Length) \ +{ \ + *((PUINT)Offset) = MmGetMdlByteOffset(Buffer); \ + *((PUINT)Length) = MmGetMdlByteCount(Buffer); \ +} + +#endif /* BINARY_COMPATIBLE */ + +/* + * PVOID + * NDIS_BUFFER_LINKAGE( + * IN PNDIS_BUFFER Buffer); + */ +#define NDIS_BUFFER_LINKAGE(Buffer)(Buffer)->Next; + + +/* + * VOID + * NdisChainBufferAtBack( + * IN OUT PNDIS_PACKET Packet, + * IN OUT PNDIS_BUFFER Buffer) + */ +#define NdisChainBufferAtBack(Packet, \ + Buffer) \ +{ \ + PNDIS_BUFFER NdisBuffer = (Buffer); \ + \ + while (NdisBuffer->Next != NULL) \ + NdisBuffer = NdisBuffer->Next; \ + \ + NdisBuffer->Next = NULL; \ + \ + if ((Packet)->Private.Head != NULL) \ + (Packet)->Private.Tail->Next = (Buffer); \ + else \ + (Packet)->Private.Head = (Buffer); \ + \ + (Packet)->Private.Tail = NdisBuffer; \ + (Packet)->Private.ValidCounts = FALSE; \ +} + + +/* + * VOID + * NdisChainBufferAtFront( + * IN OUT PNDIS_PACKET Packet, + * IN OUT PNDIS_BUFFER Buffer) + */ +#define NdisChainBufferAtFront(Packet, \ + Buffer) \ +{ \ + PNDIS_BUFFER _NdisBuffer = (Buffer); \ + \ + while (_NdisBuffer->Next != NULL) \ + _NdisBuffer = _NdisBuffer->Next; \ + \ + if ((Packet)->Private.Head == NULL) \ + (Packet)->Private.Tail = _NdisBuffer; \ + \ + _NdisBuffer->Next = (Packet)->Private.Head; \ + (Packet)->Private.Head = (Buffer); \ + (Packet)->Private.ValidCounts = FALSE; \ +} + + +/* + * VOID + * NdisGetNextBuffer( + * IN PNDIS_BUFFER CurrentBuffer, + * OUT PNDIS_BUFFER * NextBuffer) + */ +#define NdisGetNextBuffer(CurrentBuffer, \ + NextBuffer) \ +{ \ + *(NextBuffer) = (CurrentBuffer)->Next; \ +} + + +/* + * UINT + * NdisGetPacketFlags( + * IN PNDIS_PACKET Packet); + */ +#define NdisGetPacketFlags(Packet)(Packet)->Private.Flags; + + +/* + * VOID + * NdisClearPacketFlags( + * IN PNDIS_PACKET Packet, + * IN UINT Flags); + */ +#define NdisClearPacketFlags(Packet, Flags) \ + (Packet)->Private.Flags &= ~(Flags) + + +/* + * VOID + * NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO( + * IN PNDIS_PACKET Packet, + * IN PPVOID pMediaSpecificInfo, + * IN PUINT pSizeMediaSpecificInfo); + */ +#define NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO(_Packet, \ + _pMediaSpecificInfo, \ + _pSizeMediaSpecificInfo) \ +{ \ + if (!((_Packet)->Private.NdisPacketFlags & fPACKET_ALLOCATED_BY_NDIS) || \ + !((_Packet)->Private.NdisPacketFlags & fPACKET_CONTAINS_MEDIA_SPECIFIC_INFO)) \ + { \ + *(_pMediaSpecificInfo) = NULL; \ + *(_pSizeMediaSpecificInfo) = 0; \ + } \ + else \ + { \ + *(_pMediaSpecificInfo) = ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \ + (_Packet)->Private.NdisPacketOobOffset))->MediaSpecificInformation; \ + *(_pSizeMediaSpecificInfo) = ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \ + (_Packet)->Private.NdisPacketOobOffset))->SizeMediaSpecificInfo; \ + } \ +} + + +/* + * ULONG + * NDIS_GET_PACKET_PROTOCOL_TYPE( + * IN PNDIS_PACKET Packet); + */ +#define NDIS_GET_PACKET_PROTOCOL_TYPE(_Packet) \ + ((_Packet)->Private.Flags & NDIS_PROTOCOL_ID_MASK) + +/* + * ULONG + * NDIS_GET_PACKET_HEADER_SIZE( + * IN PNDIS_PACKET Packet); + */ +#define NDIS_GET_PACKET_HEADER_SIZE(_Packet) \ + ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \ + (_Packet)->Private.NdisPacketOobOffset))->HeaderSize + + +/* + * NDIS_STATUS + * NDIS_GET_PACKET_STATUS( + * IN PNDIS_PACKET Packet); + */ +#define NDIS_GET_PACKET_STATUS(_Packet) \ + ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \ + (_Packet)->Private.NdisPacketOobOffset))->Status + + +/* + * ULONGLONG + * NDIS_GET_PACKET_TIME_RECEIVED( + * IN PNDIS_PACKET Packet); + */ +#define NDIS_GET_PACKET_TIME_RECEIVED(_Packet) \ + ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \ + (_Packet)->Private.NdisPacketOobOffset))->TimeReceived + + +/* + * ULONGLONG + * NDIS_GET_PACKET_TIME_SENT( + * IN PNDIS_PACKET Packet); + */ +#define NDIS_GET_PACKET_TIME_SENT(_Packet) \ + ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \ + (_Packet)->Private.NdisPacketOobOffset))->TimeSent + + +/* + * ULONGLONG + * NDIS_GET_PACKET_TIME_TO_SEND( + * IN PNDIS_PACKET Packet); + */ +#define NDIS_GET_PACKET_TIME_TO_SEND(_Packet) \ + ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \ + (_Packet)->Private.NdisPacketOobOffset))->TimeToSend + + +/* + * PNDIS_PACKET_OOB_DATA + * NDIS_OOB_DATA_FROM_PACKET( + * IN PNDIS_PACKET Packet); + */ +#define NDIS_OOB_DATA_FROM_PACKET(_Packet) \ + (PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \ + (_Packet)->Private.NdisPacketOobOffset) + + +/* + * VOID + * NdisQueryPacket( + * IN PNDIS_PACKET Packet, + * OUT PUINT PhysicalBufferCount OPTIONAL, + * OUT PUINT BufferCount OPTIONAL, + * OUT PNDIS_BUFFER *FirstBuffer OPTIONAL, + * OUT PUINT TotalPacketLength OPTIONAL); + */ +#define NdisQueryPacket(Packet, \ + PhysicalBufferCount, \ + BufferCount, \ + FirstBuffer, \ + TotalPacketLength) \ +{ \ + if (FirstBuffer) \ + *((PNDIS_BUFFER*)FirstBuffer) = (Packet)->Private.Head; \ + if ((TotalPacketLength) || (BufferCount) || (PhysicalBufferCount)) \ + { \ + if (!(Packet)->Private.ValidCounts) { \ + UINT _Offset; \ + UINT _PacketLength; \ + PNDIS_BUFFER _NdisBuffer; \ + UINT _PhysicalBufferCount = 0; \ + UINT _TotalPacketLength = 0; \ + UINT _Count = 0; \ + \ + for (_NdisBuffer = (Packet)->Private.Head; \ + _NdisBuffer != (PNDIS_BUFFER)NULL; \ + _NdisBuffer = _NdisBuffer->Next) \ + { \ + _PhysicalBufferCount += NDIS_BUFFER_TO_SPAN_PAGES(_NdisBuffer); \ + NdisQueryBufferOffset(_NdisBuffer, &_Offset, &_PacketLength); \ + _TotalPacketLength += _PacketLength; \ + _Count++; \ + } \ + (Packet)->Private.PhysicalCount = _PhysicalBufferCount; \ + (Packet)->Private.TotalLength = _TotalPacketLength; \ + (Packet)->Private.Count = _Count; \ + (Packet)->Private.ValidCounts = TRUE; \ + } \ + \ + if (PhysicalBufferCount) \ + *((PUINT)PhysicalBufferCount) = (Packet)->Private.PhysicalCount; \ + \ + if (BufferCount) \ + *((PUINT)BufferCount) = (Packet)->Private.Count; \ + \ + if (TotalPacketLength) \ + *((PUINT)TotalPacketLength) = (Packet)->Private.TotalLength; \ + } \ +} + +/* + * VOID + * NdisQueryPacketLength( + * IN PNDIS_PACKET Packet, + * OUT PUINT PhysicalBufferCount OPTIONAL, + * OUT PUINT BufferCount OPTIONAL, + * OUT PNDIS_BUFFER *FirstBuffer OPTIONAL, + * OUT PUINT TotalPacketLength OPTIONAL); + */ +#define NdisQueryPacketLength(Packet, \ + TotalPacketLength) \ +{ \ + if ((TotalPacketLength)) \ + { \ + if (!(Packet)->Private.ValidCounts) { \ + UINT _Offset; \ + UINT _PacketLength; \ + PNDIS_BUFFER _NdisBuffer; \ + UINT _PhysicalBufferCount = 0; \ + UINT _TotalPacketLength = 0; \ + UINT _Count = 0; \ + \ + for (_NdisBuffer = (Packet)->Private.Head; \ + _NdisBuffer != (PNDIS_BUFFER)NULL; \ + _NdisBuffer = _NdisBuffer->Next) \ + { \ + _PhysicalBufferCount += NDIS_BUFFER_TO_SPAN_PAGES(_NdisBuffer); \ + NdisQueryBufferOffset(_NdisBuffer, &_Offset, &_PacketLength); \ + _TotalPacketLength += _PacketLength; \ + _Count++; \ + } \ + (Packet)->Private.PhysicalCount = _PhysicalBufferCount; \ + (Packet)->Private.TotalLength = _TotalPacketLength; \ + (Packet)->Private.Count = _Count; \ + (Packet)->Private.ValidCounts = TRUE; \ + } \ + \ + if (TotalPacketLength) \ + *((PUINT)TotalPacketLength) = (Packet)->Private.TotalLength; \ + } \ +} + + +/* + * VOID + * NdisRecalculatePacketCounts( + * IN OUT PNDIS_PACKET Packet); + */ +#define NdisRecalculatePacketCounts(Packet) \ +{ \ + PNDIS_BUFFER _Buffer = (Packet)->Private.Head; \ + if (_Buffer != NULL) \ + { \ + while (_Buffer->Next != NULL) \ + { \ + ´_Buffer = _Buffer->Next; \ + } \ + (Packet)->Private.Tail = _Buffer; \ + } \ + (Packet)->Private.ValidCounts = FALSE; \ +} + + +/* + * VOID + * NdisReinitializePacket( + * IN OUT PNDIS_PACKET Packet); + */ +#define NdisReinitializePacketCounts(Packet) \ +{ \ + (Packet)->Private.Head = (PNDIS_BUFFER)NULL; \ + (Packet)->Private.ValidCounts = FALSE; \ +} + + +/* + * VOID + * NdisSetPacketFlags( + * IN PNDIS_PACKET Packet, + * IN UINT Flags); + */ +#define NdisSetPacketFlags(Packet, Flags) \ + (Packet)->Private.Flags |= (Flags); + + +/* + * VOID + * NDIS_SET_PACKET_HEADER_SIZE( + * IN PNDIS_PACKET Packet, + * IN UINT HdrSize); + */ +#define NDIS_SET_PACKET_HEADER_SIZE(_Packet, _HdrSize) \ + ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \ + (_Packet)->Private.NdisPacketOobOffset))->HeaderSize = (_HdrSize) + + +/* + * VOID + * NDIS_SET_PACKET_MEDIA_SPECIFIC_INFO( + * IN PNDIS_PACKET Packet, + * IN PVOID MediaSpecificInfo, + * IN UINT SizeMediaSpecificInfo); + */ +#define NDIS_SET_PACKET_MEDIA_SPECIFIC_INFO(_Packet, \ + _MediaSpecificInfo, \ + _SizeMediaSpecificInfo) \ +{ \ + if ((_Packet)->Private.NdisPacketFlags & fPACKET_ALLOCATED_BY_NDIS) \ + { \ + (_Packet)->Private.NdisPacketFlags |= fPACKET_CONTAINS_MEDIA_SPECIFIC_INFO; \ + ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \ + (_Packet)->Private.NdisPacketOobOffset))->MediaSpecificInformation = \ + (_MediaSpecificInfo); \ + ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \ + (_Packet)->Private.NdisPacketOobOffset))->SizeMediaSpecificInfo = \ + (_SizeMediaSpecificInfo); \ + } \ +} + + +/* + * VOID + * NDIS_SET_PACKET_STATUS( + * IN PNDIS_PACKET Packet, + * IN NDIS_STATUS Status); + */ +#define NDIS_SET_PACKET_STATUS(_Packet, _Status) \ + ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \ + (_Packet)->Private.NdisPacketOobOffset))->Status = (_Status) + + +/* + * VOID + * NDIS_SET_PACKET_TIME_RECEIVED( + * IN PNDIS_PACKET Packet, + * IN ULONGLONG TimeReceived); + */ +#define NDIS_SET_PACKET_TIME_RECEIVED(_Packet, _TimeReceived) \ + ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \ + (_Packet)->Private.NdisPacketOobOffset))->TimeReceived = (_TimeReceived) + + +/* + * VOID + * NDIS_SET_PACKET_TIME_SENT( + * IN PNDIS_PACKET Packet, + * IN ULONGLONG TimeSent); + */ +#define NDIS_SET_PACKET_TIME_SENT(_Packet, _TimeSent) \ + ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \ + (_Packet)->Private.NdisPacketOobOffset))->TimeSent = (_TimeSent) + + +/* + * VOID + * NDIS_SET_PACKET_TIME_TO_SEND( + * IN PNDIS_PACKET Packet, + * IN ULONGLONG TimeToSend); + */ +#define NDIS_SET_PACKET_TIME_TO_SEND(_Packet, _TimeToSend) \ + ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \ + (_Packet)->Private.NdisPacketOobOffset))->TimeToSend = (_TimeToSend) + + +/* + * VOID + * NdisSetSendFlags( + * IN PNDIS_PACKET Packet, + * IN UINT Flags); + */ +#define NdisSetSendFlags(_Packet,_Flags)(_Packet)->Private.Flags = (_Flags) + + + +/* Memory management routines */ + +#if BINARY_COMPATIBLE + +NDISAPI +VOID +DDKAPI +NdisCreateLookaheadBufferFromSharedMemory( + IN PVOID pSharedMemory, + IN UINT LookaheadLength, + OUT PVOID *pLookaheadBuffer); + +NDISAPI +VOID +DDKAPI +NdisDestroyLookaheadBufferFromSharedMemory( + IN PVOID pLookaheadBuffer); + +#else + +/* + * VOID + * NdisCreateLookaheadBufferFromSharedMemory( + * IN PVOID pSharedMemory, + * IN UINT LookaheadLength, + * OUT PVOID *pLookaheadBuffer) + */ +#define NdisCreateLookaheadBufferFromSharedMemory(_pSharedMemory, \ + _LookaheadLength, \ + _pLookaheadBuffer) \ + ((*(_pLookaheadBuffer)) = (_pSharedMemory)) + +/* + * VOID + * NdisDestroyLookaheadBufferFromSharedMemory( + * IN PVOID pLookaheadBuffer) + */ +#define NdisDestroyLookaheadBufferFromSharedMemory(_pLookaheadBuffer) + +#endif + +#if defined(_M_IX86) || defined(_M_AMD64) + +/* + * VOID + * NdisMoveMappedMemory( + * OUT PVOID Destination, + * IN PVOID Source, + * IN ULONG Length); + */ +#define NdisMoveMappedMemory(Destination, Source, Length) \ + RtlCopyMemory(Destination, Source, Length) + +/* + * VOID + * NdisZeroMappedMemory( + * IN PVOID Destination, + * IN ULONG Length); + */ +#define NdisZeroMappedMemory(Destination, Length) \ + RtlZeroMemory(Destination, Length) + +#else + +#define NdisMoveMappedMemory(Destination, Source, Length) \ +{ + PUCHAR _Dest = Destination, _Src = Source, _End = _Dest + Length; + while (_Dest < _End) + *_Dest++ = _Src++; +} + +#define NdisZeroMappedMemory(Destination, Length) \ +{ + PUCHAR _Dest = Destination, _End = _Dest + Length; + while (_Dest < _End) + *_Dest++ = 0; +} + +#endif /* _M_IX86 or _M_AMD64 */ + +/* + * VOID + * NdisMoveFromMappedMemory( + * OUT PVOID Destination, + * IN PVOID Source, + * IN ULONG Length); + */ +#define NdisMoveFromMappedMemory(Destination, Source, Length) \ + NdisMoveMappedMemory(Destination, Source, Length) + +/* + * VOID + * NdisMoveToMappedMemory( + * OUT PVOID Destination, + * IN PVOID Source, + * IN ULONG Length); + */ +#define NdisMoveToMappedMemory(Destination, Source, Length) \ + NdisMoveMappedMemory(Destination, Source, Length) + +/* + * VOID + * NdisMUpdateSharedMemory( + * IN NDIS_HANDLE MiniportAdapterHandle, + * IN ULONG Length, + * IN PVOID VirtualAddress, + * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress); + */ +#define NdisMUpdateSharedMemory(_H, _L, _V, _P) \ + NdisUpdateSharedMemory(_H, _L, _V, _P) + +NDISAPI +NDIS_STATUS +DDKAPI +NdisAllocateMemory( + OUT PVOID *VirtualAddress, + IN UINT Length, + IN UINT MemoryFlags, + IN NDIS_PHYSICAL_ADDRESS HighestAcceptableAddress); + +NDISAPI +VOID +DDKAPI +NdisFreeMemory( + IN PVOID VirtualAddress, + IN UINT Length, + IN UINT MemoryFlags); + +NDISAPI +VOID +DDKAPI +NdisImmediateReadSharedMemory( + IN NDIS_HANDLE WrapperConfigurationContext, + IN ULONG SharedMemoryAddress, + OUT PUCHAR Buffer, + IN ULONG Length); + +NDISAPI +VOID +DDKAPI +NdisImmediateWriteSharedMemory( + IN NDIS_HANDLE WrapperConfigurationContext, + IN ULONG SharedMemoryAddress, + IN PUCHAR Buffer, + IN ULONG Length); + +NDISAPI +VOID +DDKAPI +NdisMAllocateSharedMemory( + IN NDIS_HANDLE MiniportAdapterHandle, + IN ULONG Length, + IN BOOLEAN Cached, + OUT PVOID *VirtualAddress, + OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisMAllocateSharedMemoryAsync( + IN NDIS_HANDLE MiniportAdapterHandle, + IN ULONG Length, + IN BOOLEAN Cached, + IN PVOID Context); + +#if defined(NDIS50) + +#define NdisUpdateSharedMemory(NdisAdapterHandle, \ + Length, \ + VirtualAddress, \ + PhysicalAddress) + +#else + +NDISAPI +VOID +DDKAPI +NdisUpdateSharedMemory( + IN NDIS_HANDLE NdisAdapterHandle, + IN ULONG Length, + IN PVOID VirtualAddress, + IN NDIS_PHYSICAL_ADDRESS PhysicalAddress); + +#endif /* defined(NDIS50) */ + +/* + * ULONG + * NdisGetPhysicalAddressHigh( + * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress); + */ +#define NdisGetPhysicalAddressHigh(PhysicalAddress) \ + ((PhysicalAddress).HighPart) + +/* + * VOID + * NdisSetPhysicalAddressHigh( + * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress, + * IN ULONG Value); + */ +#define NdisSetPhysicalAddressHigh(PhysicalAddress, Value) \ + ((PhysicalAddress).HighPart) = (Value) + +/* + * ULONG + * NdisGetPhysicalAddressLow( + * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress); + */ +#define NdisGetPhysicalAddressLow(PhysicalAddress) \ + ((PhysicalAddress).LowPart) + + +/* + * VOID + * NdisSetPhysicalAddressLow( + * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress, + * IN ULONG Value); + */ +#define NdisSetPhysicalAddressLow(PhysicalAddress, Value) \ + ((PhysicalAddress).LowPart) = (Value) + +/* + * VOID + * NDIS_PHYSICAL_ADDRESS_CONST( + * IN ULONG Low, + * IN LONG High); + */ +#define NDIS_PHYSICAL_ADDRESS_CONST(Low, High) \ + { {(ULONG)(Low), (LONG)(High)} } + +/* + * ULONG + * NdisEqualMemory( + * IN CONST VOID *Source1, + * IN CONST VOID *Source2, + * IN ULONG Length); + */ +#define NdisEqualMemory(Source1, Source2, Length) \ + RtlEqualMemory(Source1, Source2, Length) + +/* + * VOID + * NdisFillMemory( + * IN PVOID Destination, + * IN ULONG Length, + * IN UCHAR Fill); + */ +#define NdisFillMemory(Destination, Length, Fill) \ + RtlFillMemory(Destination, Length, Fill) + +/* + * VOID + * NdisMoveMemory( + * OUT PVOID Destination, + * IN PVOID Source, + * IN ULONG Length); + */ +#define NdisMoveMemory(Destination, Source, Length) \ + RtlCopyMemory(Destination, Source, Length) + + +/* + * VOID + * NdisRetrieveUlong( + * IN PULONG DestinationAddress, + * IN PULONG SourceAddress); + */ +#define NdisRetrieveUlong(DestinationAddress, SourceAddress) \ + RtlRetrieveUlong(DestinationAddress, SourceAddress) + + +/* + * VOID + * NdisStoreUlong( + * IN PULONG DestinationAddress, + * IN ULONG Value); + */ +#define NdisStoreUlong(DestinationAddress, Value) \ + RtlStoreUlong(DestinationAddress, Value) + + +/* + * VOID + * NdisZeroMemory( + * IN PVOID Destination, + * IN ULONG Length) + */ +#define NdisZeroMemory(Destination, Length) \ + RtlZeroMemory(Destination, Length) + + + +/* Configuration routines */ + +NDISAPI +VOID +DDKAPI +NdisOpenConfiguration( + OUT PNDIS_STATUS Status, + OUT PNDIS_HANDLE ConfigurationHandle, + IN NDIS_HANDLE WrapperConfigurationContext); + +NDISAPI +VOID +DDKAPI +NdisReadNetworkAddress( + OUT PNDIS_STATUS Status, + OUT PVOID *NetworkAddress, + OUT PUINT NetworkAddressLength, + IN NDIS_HANDLE ConfigurationHandle); + +NDISAPI +VOID +DDKAPI +NdisReadEisaSlotInformation( + OUT PNDIS_STATUS Status, + IN NDIS_HANDLE WrapperConfigurationContext, + OUT PUINT SlotNumber, + OUT PNDIS_EISA_FUNCTION_INFORMATION EisaData); + +NDISAPI +VOID +DDKAPI +NdisReadEisaSlotInformationEx( + OUT PNDIS_STATUS Status, + IN NDIS_HANDLE WrapperConfigurationContext, + OUT PUINT SlotNumber, + OUT PNDIS_EISA_FUNCTION_INFORMATION *EisaData, + OUT PUINT NumberOfFunctions); + +NDISAPI +ULONG +DDKAPI +NdisReadPciSlotInformation( + IN NDIS_HANDLE NdisAdapterHandle, + IN ULONG SlotNumber, + IN ULONG Offset, + IN PVOID Buffer, + IN ULONG Length); + +NDISAPI +ULONG +DDKAPI +NdisWritePciSlotInformation( + IN NDIS_HANDLE NdisAdapterHandle, + IN ULONG SlotNumber, + IN ULONG Offset, + IN PVOID Buffer, + IN ULONG Length); + + + +/* String management routines */ + +NDISAPI +NDIS_STATUS +DDKAPI +NdisAnsiStringToUnicodeString( + IN OUT PNDIS_STRING DestinationString, + IN PNDIS_ANSI_STRING SourceString); + +/* + * BOOLEAN + * NdisEqualString( + * IN PNDIS_STRING String1, + * IN PNDIS_STRING String2, + * IN BOOLEAN CaseInsensitive); + */ +#define NdisEqualString(_String1, _String2, _CaseInsensitive) \ + RtlEqualUnicodeString(_String1, _String2, _CaseInsensitive) + +NDISAPI +VOID +DDKAPI +NdisInitAnsiString( + IN OUT PNDIS_ANSI_STRING DestinationString, + IN PCSTR SourceString); + +NDISAPI +VOID +DDKAPI +NdisInitUnicodeString( + IN OUT PNDIS_STRING DestinationString, + IN PCWSTR SourceString); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisUnicodeStringToAnsiString( + IN OUT PNDIS_ANSI_STRING DestinationString, + IN PNDIS_STRING SourceString); + +#define NdisFreeString(_s) NdisFreeMemory((_s).Buffer, (_s).MaximumLength, 0) +#define NdisPrintString(_s) DbgPrint("%ls", (_s).Buffer) + + +/* Spin lock reoutines */ + +#if BINARY_COMPATIBLE + +NDISAPI +VOID +DDKAPI +NdisAllocateSpinLock( + IN PNDIS_SPIN_LOCK SpinLock); + +NDISAPI +VOID +DDKAPI +NdisFreeSpinLock( + IN PNDIS_SPIN_LOCK SpinLock); + +NDISAPI +VOID +DDKAPI +NdisAcquireSpinLock( + IN PNDIS_SPIN_LOCK SpinLock); + +NDISAPI +VOID +DDKAPI +NdisReleaseSpinLock( + IN PNDIS_SPIN_LOCK SpinLock); + +NDISAPI +VOID +DDKAPI +NdisDprAcquireSpinLock( + IN PNDIS_SPIN_LOCK SpinLock); + +NDISAPI +VOID +DDKAPI +NdisDprReleaseSpinLock( + IN PNDIS_SPIN_LOCK SpinLock); + +#else + +/* + * VOID + * NdisAllocateSpinLock( + * IN PNDIS_SPIN_LOCK SpinLock); + */ +#define NdisAllocateSpinLock(_SpinLock) \ + KeInitializeSpinLock(&(_SpinLock)->SpinLock) + +/* + * VOID + * NdisFreeSpinLock( + * IN PNDIS_SPIN_LOCK SpinLock); + */ +#define NdisFreeSpinLock(_SpinLock) + +/* + * VOID + * NdisAcquireSpinLock( + * IN PNDIS_SPIN_LOCK SpinLock); + */ +#define NdisAcquireSpinLock(_SpinLock) \ + KeAcquireSpinLock(&(_SpinLock)->SpinLock, &(_SpinLock)->OldIrql) + +/* + * VOID + * NdisReleaseSpinLock( + * IN PNDIS_SPIN_LOCK SpinLock); + */ +#define NdisReleaseSpinLock(_SpinLock) \ + KeReleaseSpinLock(&(_SpinLock)->SpinLock, (_SpinLock)->OldIrql) + +/* + * VOID + * NdisDprAcquireSpinLock( + * IN PNDIS_SPIN_LOCK SpinLock); + */ +#define NdisDprAcquireSpinLock(_SpinLock) \ +{ \ + KeAcquireSpinLockAtDpcLevel(&(_SpinLock)->SpinLock); \ + (_SpinLock)->OldIrql = DISPATCH_LEVEL; \ +} + +/* + * VOID + * NdisDprReleaseSpinLock( + * IN PNDIS_SPIN_LOCK SpinLock); + */ +#define NdisDprReleaseSpinLock(_SpinLock) \ + KeReleaseSpinLockFromDpcLevel(&(_SpinLock)->SpinLock) + +#endif /* BINARY_COMPATIBLE */ + +/* I/O routines */ + +/* + * VOID + * NdisRawReadPortBufferUchar( + * IN ULONG Port, + * OUT PUCHAR Buffer, + * IN ULONG Length); + */ +#define NdisRawReadPortBufferUchar(Port, Buffer, Length) \ + READ_PORT_BUFFER_UCHAR((PUCHAR)(Port), (PUCHAR)(Buffer), (Length)) + +/* + * VOID + * NdisRawReadPortBufferUlong( + * IN ULONG Port, + * OUT PULONG Buffer, + * IN ULONG Length); + */ +#define NdisRawReadPortBufferUlong(Port, Buffer, Length) \ + READ_PORT_BUFFER_ULONG((PULONG)(Port), (PULONG)(Buffer), (Length)) + +/* + * VOID + * NdisRawReadPortBufferUshort( + * IN ULONG Port, + * OUT PUSHORT Buffer, + * IN ULONG Length); + */ +#define NdisRawReadPortBufferUshort(Port, Buffer, Length) \ + READ_PORT_BUFFER_USHORT((PUSHORT)(Port), (PUSHORT)(Buffer), (Length)) + + +/* + * VOID + * NdisRawReadPortUchar( + * IN ULONG Port, + * OUT PUCHAR Data); + */ +#define NdisRawReadPortUchar(Port, Data) \ + *(Data) = READ_PORT_UCHAR((PUCHAR)(Port)) + +/* + * VOID + * NdisRawReadPortUlong( + * IN ULONG Port, + * OUT PULONG Data); + */ +#define NdisRawReadPortUlong(Port, Data) \ + *(Data) = READ_PORT_ULONG((PULONG)(Port)) + +/* + * VOID + * NdisRawReadPortUshort( + * IN ULONG Port, + * OUT PUSHORT Data); + */ +#define NdisRawReadPortUshort(Port, Data) \ + *(Data) = READ_PORT_USHORT((PUSHORT)(Port)) + + +/* + * VOID + * NdisRawWritePortBufferUchar( + * IN ULONG Port, + * IN PUCHAR Buffer, + * IN ULONG Length); + */ +#define NdisRawWritePortBufferUchar(Port, Buffer, Length) \ + WRITE_PORT_BUFFER_UCHAR((PUCHAR)(Port), (PUCHAR)(Buffer), (Length)) + +/* + * VOID + * NdisRawWritePortBufferUlong( + * IN ULONG Port, + * IN PULONG Buffer, + * IN ULONG Length); + */ +#define NdisRawWritePortBufferUlong(Port, Buffer, Length) \ + WRITE_PORT_BUFFER_ULONG((PULONG)(Port), (PULONG)(Buffer), (Length)) + +/* + * VOID + * NdisRawWritePortBufferUshort( + * IN ULONG Port, + * IN PUSHORT Buffer, + * IN ULONG Length); + */ +#define NdisRawWritePortBufferUshort(Port, Buffer, Length) \ + WRITE_PORT_BUFFER_USHORT((PUSHORT)(Port), (PUSHORT)(Buffer), (Length)) + + +/* + * VOID + * NdisRawWritePortUchar( + * IN ULONG Port, + * IN UCHAR Data); + */ +#define NdisRawWritePortUchar(Port, Data) \ + WRITE_PORT_UCHAR((PUCHAR)(Port), (UCHAR)(Data)) + +/* + * VOID + * NdisRawWritePortUlong( + * IN ULONG Port, + * IN ULONG Data); + */ +#define NdisRawWritePortUlong(Port, Data) \ + WRITE_PORT_ULONG((PULONG)(Port), (ULONG)(Data)) + +/* + * VOID + * NdisRawWritePortUshort( + * IN ULONG Port, + * IN USHORT Data); + */ +#define NdisRawWritePortUshort(Port, Data) \ + WRITE_PORT_USHORT((PUSHORT)(Port), (USHORT)(Data)) + + +/* + * VOID + * NdisReadRegisterUchar( + * IN PUCHAR Register, + * OUT PUCHAR Data); + */ +#define NdisReadRegisterUchar(Register, Data) \ + *(Data) = *(Register) + +/* + * VOID + * NdisReadRegisterUlong( + * IN PULONG Register, + * OUT PULONG Data); + */ +#define NdisReadRegisterUlong(Register, Data) \ + *(Data) = *(Register) + +/* + * VOID + * NdisReadRegisterUshort( + * IN PUSHORT Register, + * OUT PUSHORT Data); + */ +#define NdisReadRegisterUshort(Register, Data) \ + *(Data) = *(Register) + +/* + * VOID + * NdisReadRegisterUchar( + * IN PUCHAR Register, + * IN UCHAR Data); + */ +#define NdisWriteRegisterUchar(Register, Data) \ + WRITE_REGISTER_UCHAR((Register), (Data)) + +/* + * VOID + * NdisReadRegisterUlong( + * IN PULONG Register, + * IN ULONG Data); + */ +#define NdisWriteRegisterUlong(Register, Data) \ + WRITE_REGISTER_ULONG((Register), (Data)) + +/* + * VOID + * NdisReadRegisterUshort( + * IN PUSHORT Register, + * IN USHORT Data); + */ +#define NdisWriteRegisterUshort(Register, Data) \ + WRITE_REGISTER_USHORT((Register), (Data)) + + +/* Linked lists */ + +/* + * VOID + * NdisInitializeListHead( + * IN PLIST_ENTRY ListHead); + */ +#define NdisInitializeListHead(_ListHead) \ + InitializeListHead(_ListHead) + +/* + * PLIST_ENTRY + * NdisInterlockedInsertHeadList( + * IN PLIST_ENTRY ListHead, + * IN PLIST_ENTRY ListEntry, + * IN PNDIS_SPIN_LOCK SpinLock); + */ +#define NdisInterlockedInsertHeadList(_ListHead, _ListEntry, _SpinLock) \ + ExInterlockedInsertHeadList(_ListHead, _ListEntry, &(_SpinLock)->SpinLock) + +/* + * PLIST_ENTRY + * NdisInterlockedInsertTailList( + * IN PLIST_ENTRY ListHead, + * IN PLIST_ENTRY ListEntry, + * IN PNDIS_SPIN_LOCK SpinLock); + */ +#define NdisInterlockedInsertTailList(_ListHead, _ListEntry, _SpinLock) \ + ExInterlockedInsertTailList(_ListHead, _ListEntry, &(_SpinLock)->SpinLock) + +/* + * PLIST_ENTRY + * NdisInterlockedRemoveHeadList( + * IN PLIST_ENTRY ListHead, + * IN PNDIS_SPIN_LOCK SpinLock); +*/ +#define NdisInterlockedRemoveHeadList(_ListHead, _SpinLock) \ + ExInterlockedRemoveHeadList(_ListHead, &(_SpinLock)->SpinLock) + +/* + * VOID + * NdisInitializeSListHead( + * IN PSLIST_HEADER SListHead); + */ +#define NdisInitializeSListHead(SListHead) ExInitializeSListHead(SListHead) + +/* + * USHORT NdisQueryDepthSList( + * IN PSLIST_HEADER SListHead); + */ +#define NdisQueryDepthSList(SListHead) ExQueryDepthSList(SListHead) + + + +/* Interlocked routines */ + +/* + * LONG + * NdisInterlockedDecrement( + * IN PLONG Addend); + */ +#define NdisInterlockedDecrement(Addend) InterlockedDecrement(Addend) + +/* + * LONG + * NdisInterlockedIncrement( + * IN PLONG Addend); + */ +#define NdisInterlockedIncrement(Addend) InterlockedIncrement(Addend) + +/* + * VOID + * NdisInterlockedAddUlong( + * IN PULONG Addend, + * IN ULONG Increment, + * IN PNDIS_SPIN_LOCK SpinLock); + */ +#define NdisInterlockedAddUlong(_Addend, _Increment, _SpinLock) \ + ExInterlockedAddUlong(_Addend, _Increment, &(_SpinLock)->SpinLock) + + + +/* Miscellaneous routines */ + +NDISAPI +VOID +DDKAPI +NdisCloseConfiguration( + IN NDIS_HANDLE ConfigurationHandle); + +NDISAPI +VOID +DDKAPI +NdisReadConfiguration( + OUT PNDIS_STATUS Status, + OUT PNDIS_CONFIGURATION_PARAMETER *ParameterValue, + IN NDIS_HANDLE ConfigurationHandle, + IN PNDIS_STRING Keyword, + IN NDIS_PARAMETER_TYPE ParameterType); + +NDISAPI +VOID +DDKAPI +NdisWriteConfiguration( + OUT PNDIS_STATUS Status, + IN NDIS_HANDLE WrapperConfigurationContext, + IN PNDIS_STRING Keyword, + IN PNDIS_CONFIGURATION_PARAMETER ParameterValue); + +NDISAPI +VOID +DDKCDECLAPI +NdisWriteErrorLogEntry( + IN NDIS_HANDLE NdisAdapterHandle, + IN NDIS_ERROR_CODE ErrorCode, + IN ULONG NumberOfErrorValues, + IN ...); + +/* + * VOID + * NdisStallExecution( + * IN UINT MicrosecondsToStall) + */ +#define NdisStallExecution KeStallExecutionProcessor + +#if BINARY_COMPATIBLE + +NDISAPI +VOID +DDKAPI +NdisGetCurrentSystemTime( + IN PLARGE_INTEGER pSystemTime); + +#else + +/* + * VOID + * NdisGetCurrentSystemTime( + * IN PLARGE_INTEGER pSystemTime); + */ +#define NdisGetCurrentSystemTime KeQuerySystemTime + +#endif + +NDISAPI +CCHAR +DDKAPI +NdisSystemProcessorCount(VOID); + +NDISAPI +VOID +DDKAPI +NdisGetCurrentProcessorCpuUsage( + OUT PULONG pCpuUsage); + + + +/* NDIS helper macros */ + +/* + * VOID + * NDIS_INIT_FUNCTION(FunctionName) + */ +#define NDIS_INIT_FUNCTION(FunctionName) \ + alloc_text(init, FunctionName) + +/* + * VOID + * NDIS_PAGABLE_FUNCTION(FunctionName) + */ +#define NDIS_PAGEABLE_FUNCTION(FunctionName) \ + alloc_text(page, FunctionName) + +#define NDIS_PAGABLE_FUNCTION NDIS_PAGEABLE_FUNCTION + + +/* NDIS 4.0 extensions */ + +NDISAPI +VOID +DDKAPI +NdisMFreeSharedMemory( + IN NDIS_HANDLE MiniportAdapterHandle, + IN ULONG Length, + IN BOOLEAN Cached, + IN PVOID VirtualAddress, + IN NDIS_PHYSICAL_ADDRESS PhysicalAddress); + +NDISAPI +VOID +DDKAPI +NdisMWanIndicateReceive( + OUT PNDIS_STATUS Status, + IN NDIS_HANDLE MiniportAdapterHandle, + IN NDIS_HANDLE NdisLinkContext, + IN PUCHAR PacketBuffer, + IN UINT PacketSize); + +NDISAPI +VOID +DDKAPI +NdisMWanIndicateReceiveComplete( + IN NDIS_HANDLE MiniportAdapterHandle); + +NDISAPI +VOID +DDKAPI +NdisMWanSendComplete( + IN NDIS_HANDLE MiniportAdapterHandle, + IN PNDIS_WAN_PACKET Packet, + IN NDIS_STATUS Status); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisPciAssignResources( + IN NDIS_HANDLE NdisMacHandle, + IN NDIS_HANDLE NdisWrapperHandle, + IN NDIS_HANDLE WrapperConfigurationContext, + IN ULONG SlotNumber, + OUT PNDIS_RESOURCE_LIST *AssignedResources); + + +/* NDIS 5.0 extensions */ + +NDISAPI +VOID +DDKAPI +NdisAcquireReadWriteLock( + IN PNDIS_RW_LOCK Lock, + IN BOOLEAN fWrite, + IN PLOCK_STATE LockState); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisAllocateMemoryWithTag( + OUT PVOID *VirtualAddress, + IN UINT Length, + IN ULONG Tag); + +NDISAPI +VOID +DDKAPI +NdisAllocatePacketPoolEx( + OUT PNDIS_STATUS Status, + OUT PNDIS_HANDLE PoolHandle, + IN UINT NumberOfDescriptors, + IN UINT NumberOfOverflowDescriptors, + IN UINT ProtocolReservedLength); + +NDISAPI +VOID +DDKAPI +NdisCompletePnPEvent( + IN NDIS_STATUS Status, + IN NDIS_HANDLE NdisBindingHandle, + IN PNET_PNP_EVENT NetPnPEvent); + +NDISAPI +VOID +DDKAPI +NdisGetCurrentProcessorCounts( + OUT PULONG pIdleCount, + OUT PULONG pKernelAndUser, + OUT PULONG pIndex); + +NDISAPI +VOID +DDKAPI +NdisGetDriverHandle( + IN PNDIS_HANDLE NdisBindingHandle, + OUT PNDIS_HANDLE NdisDriverHandle); + +NDISAPI +PNDIS_PACKET +DDKAPI +NdisGetReceivedPacket( + IN PNDIS_HANDLE NdisBindingHandle, + IN PNDIS_HANDLE MacContext); + +NDISAPI +VOID +DDKAPI +NdisGetSystemUptime( + OUT PULONG pSystemUpTime); + +NDISAPI +VOID +DDKAPI +NdisInitializeReadWriteLock( + IN PNDIS_RW_LOCK Lock); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisMDeregisterDevice( + IN NDIS_HANDLE NdisDeviceHandle); + +NDISAPI +VOID +DDKAPI +NdisMGetDeviceProperty( + IN NDIS_HANDLE MiniportAdapterHandle, + IN OUT PDEVICE_OBJECT *PhysicalDeviceObject OPTIONAL, + IN OUT PDEVICE_OBJECT *FunctionalDeviceObject OPTIONAL, + IN OUT PDEVICE_OBJECT *NextDeviceObject OPTIONAL, + IN OUT PCM_RESOURCE_LIST *AllocatedResources OPTIONAL, + IN OUT PCM_RESOURCE_LIST *AllocatedResourcesTranslated OPTIONAL); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisMInitializeScatterGatherDma( + IN NDIS_HANDLE MiniportAdapterHandle, + IN BOOLEAN Dma64BitAddresses, + IN ULONG MaximumPhysicalMapping); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisMPromoteMiniport( + IN NDIS_HANDLE MiniportAdapterHandle); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisMQueryAdapterInstanceName( + OUT PNDIS_STRING AdapterInstanceName, + IN NDIS_HANDLE MiniportAdapterHandle); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisMRegisterDevice( + IN NDIS_HANDLE NdisWrapperHandle, + IN PNDIS_STRING DeviceName, + IN PNDIS_STRING SymbolicName, + IN PDRIVER_DISPATCH MajorFunctions[], + OUT PDEVICE_OBJECT *pDeviceObject, + OUT NDIS_HANDLE *NdisDeviceHandle); + +NDISAPI +VOID +DDKAPI +NdisMRegisterUnloadHandler( + IN NDIS_HANDLE NdisWrapperHandle, + IN PDRIVER_UNLOAD UnloadHandler); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisMRemoveMiniport( + IN NDIS_HANDLE MiniportAdapterHandle); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisMSetMiniportSecondary( + IN NDIS_HANDLE MiniportAdapterHandle, + IN NDIS_HANDLE PrimaryMiniportAdapterHandle); + +NDISAPI +VOID +DDKAPI +NdisOpenConfigurationKeyByIndex( + OUT PNDIS_STATUS Status, + IN NDIS_HANDLE ConfigurationHandle, + IN ULONG Index, + OUT PNDIS_STRING KeyName, + OUT PNDIS_HANDLE KeyHandle); + +NDISAPI +VOID +DDKAPI +NdisOpenConfigurationKeyByName( + OUT PNDIS_STATUS Status, + IN NDIS_HANDLE ConfigurationHandle, + IN PNDIS_STRING SubKeyName, + OUT PNDIS_HANDLE SubKeyHandle); + +NDISAPI +UINT +DDKAPI +NdisPacketPoolUsage( + IN NDIS_HANDLE PoolHandle); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisQueryAdapterInstanceName( + OUT PNDIS_STRING AdapterInstanceName, + IN NDIS_HANDLE NdisBindingHandle); + +NDISAPI +ULONG +DDKAPI +NdisReadPcmciaAttributeMemory( + IN NDIS_HANDLE NdisAdapterHandle, + IN ULONG Offset, + IN PVOID Buffer, + IN ULONG Length); + +NDISAPI +VOID +DDKAPI +NdisReleaseReadWriteLock( + IN PNDIS_RW_LOCK Lock, + IN PLOCK_STATE LockState); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisWriteEventLogEntry( + IN PVOID LogHandle, + IN NDIS_STATUS EventCode, + IN ULONG UniqueEventValue, + IN USHORT NumStrings, + IN PVOID StringsList OPTIONAL, + IN ULONG DataSize, + IN PVOID Data OPTIONAL); + +NDISAPI +ULONG +DDKAPI +NdisWritePcmciaAttributeMemory( + IN NDIS_HANDLE NdisAdapterHandle, + IN ULONG Offset, + IN PVOID Buffer, + IN ULONG Length); + + +/* Connectionless services */ + +NDISAPI +NDIS_STATUS +DDKAPI +NdisClAddParty( + IN NDIS_HANDLE NdisVcHandle, + IN NDIS_HANDLE ProtocolPartyContext, + IN OUT PCO_CALL_PARAMETERS CallParameters, + OUT PNDIS_HANDLE NdisPartyHandle); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisClCloseAddressFamily( + IN NDIS_HANDLE NdisAfHandle); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisClCloseCall( + IN NDIS_HANDLE NdisVcHandle, + IN NDIS_HANDLE NdisPartyHandle OPTIONAL, + IN PVOID Buffer OPTIONAL, + IN UINT Size); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisClDeregisterSap( + IN NDIS_HANDLE NdisSapHandle); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisClDropParty( + IN NDIS_HANDLE NdisPartyHandle, + IN PVOID Buffer OPTIONAL, + IN UINT Size); + +NDISAPI +VOID +DDKAPI +NdisClIncomingCallComplete( + IN NDIS_STATUS Status, + IN NDIS_HANDLE NdisVcHandle, + IN PCO_CALL_PARAMETERS CallParameters); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisClMakeCall( + IN NDIS_HANDLE NdisVcHandle, + IN OUT PCO_CALL_PARAMETERS CallParameters, + IN NDIS_HANDLE ProtocolPartyContext OPTIONAL, + OUT PNDIS_HANDLE NdisPartyHandle OPTIONAL); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisClModifyCallQoS( + IN NDIS_HANDLE NdisVcHandle, + IN PCO_CALL_PARAMETERS CallParameters); + + +NDISAPI +NDIS_STATUS +DDKAPI +NdisClOpenAddressFamily( + IN NDIS_HANDLE NdisBindingHandle, + IN PCO_ADDRESS_FAMILY AddressFamily, + IN NDIS_HANDLE ProtocolAfContext, + IN PNDIS_CLIENT_CHARACTERISTICS ClCharacteristics, + IN UINT SizeOfClCharacteristics, + OUT PNDIS_HANDLE NdisAfHandle); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisClRegisterSap( + IN NDIS_HANDLE NdisAfHandle, + IN NDIS_HANDLE ProtocolSapContext, + IN PCO_SAP Sap, + OUT PNDIS_HANDLE NdisSapHandle); + + +/* Call Manager services */ + +NDISAPI +NDIS_STATUS +DDKAPI +NdisCmActivateVc( + IN NDIS_HANDLE NdisVcHandle, + IN OUT PCO_CALL_PARAMETERS CallParameters); + +NDISAPI +VOID +DDKAPI +NdisCmAddPartyComplete( + IN NDIS_STATUS Status, + IN NDIS_HANDLE NdisPartyHandle, + IN NDIS_HANDLE CallMgrPartyContext OPTIONAL, + IN PCO_CALL_PARAMETERS CallParameters); + +NDISAPI +VOID +DDKAPI +NdisCmCloseAddressFamilyComplete( + IN NDIS_STATUS Status, + IN NDIS_HANDLE NdisAfHandle); + +NDISAPI +VOID +DDKAPI +NdisCmCloseCallComplete( + IN NDIS_STATUS Status, + IN NDIS_HANDLE NdisVcHandle, + IN NDIS_HANDLE NdisPartyHandle OPTIONAL); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisCmDeactivateVc( + IN NDIS_HANDLE NdisVcHandle); + +NDISAPI +VOID +DDKAPI +NdisCmDeregisterSapComplete( + IN NDIS_STATUS Status, + IN NDIS_HANDLE NdisSapHandle); + +NDISAPI +VOID +DDKAPI +NdisCmDispatchCallConnected( + IN NDIS_HANDLE NdisVcHandle); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisCmDispatchIncomingCall( + IN NDIS_HANDLE NdisSapHandle, + IN NDIS_HANDLE NdisVcHandle, + IN PCO_CALL_PARAMETERS CallParameters); + +NDISAPI +VOID +DDKAPI +NdisCmDispatchIncomingCallQoSChange( + IN NDIS_HANDLE NdisVcHandle, + IN PCO_CALL_PARAMETERS CallParameters); + +NDISAPI +VOID +DDKAPI +NdisCmDispatchIncomingCloseCall( + IN NDIS_STATUS CloseStatus, + IN NDIS_HANDLE NdisVcHandle, + IN PVOID Buffer OPTIONAL, + IN UINT Size); + +NDISAPI +VOID +DDKAPI +NdisCmDispatchIncomingDropParty( + IN NDIS_STATUS DropStatus, + IN NDIS_HANDLE NdisPartyHandle, + IN PVOID Buffer OPTIONAL, + IN UINT Size); + +NDISAPI +VOID +DDKAPI +NdisCmDropPartyComplete( + IN NDIS_STATUS Status, + IN NDIS_HANDLE NdisPartyHandle); + +NDISAPI +VOID +DDKAPI +NdisCmMakeCallComplete( + IN NDIS_STATUS Status, + IN NDIS_HANDLE NdisVcHandle, + IN NDIS_HANDLE NdisPartyHandle OPTIONAL, + IN NDIS_HANDLE CallMgrPartyContext OPTIONAL, + IN PCO_CALL_PARAMETERS CallParameters); + +NDISAPI +VOID +DDKAPI +NdisCmModifyCallQoSComplete( + IN NDIS_STATUS Status, + IN NDIS_HANDLE NdisVcHandle, + IN PCO_CALL_PARAMETERS CallParameters); + +NDISAPI +VOID +DDKAPI +NdisCmOpenAddressFamilyComplete( + IN NDIS_STATUS Status, + IN NDIS_HANDLE NdisAfHandle, + IN NDIS_HANDLE CallMgrAfContext); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisCmRegisterAddressFamily( + IN NDIS_HANDLE NdisBindingHandle, + IN PCO_ADDRESS_FAMILY AddressFamily, + IN PNDIS_CALL_MANAGER_CHARACTERISTICS CmCharacteristics, + IN UINT SizeOfCmCharacteristics); + +NDISAPI +VOID +DDKAPI +NdisCmRegisterSapComplete( + IN NDIS_STATUS Status, + IN NDIS_HANDLE NdisSapHandle, + IN NDIS_HANDLE CallMgrSapContext); + + +NDISAPI +NDIS_STATUS +DDKAPI +NdisMCmActivateVc( + IN NDIS_HANDLE NdisVcHandle, + IN PCO_CALL_PARAMETERS CallParameters); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisMCmCreateVc( + IN NDIS_HANDLE MiniportAdapterHandle, + IN NDIS_HANDLE NdisAfHandle, + IN NDIS_HANDLE MiniportVcContext, + OUT PNDIS_HANDLE NdisVcHandle); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisMCmDeactivateVc( + IN NDIS_HANDLE NdisVcHandle); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisMCmDeleteVc( + IN NDIS_HANDLE NdisVcHandle); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisMCmRegisterAddressFamily( + IN NDIS_HANDLE MiniportAdapterHandle, + IN PCO_ADDRESS_FAMILY AddressFamily, + IN PNDIS_CALL_MANAGER_CHARACTERISTICS CmCharacteristics, + IN UINT SizeOfCmCharacteristics); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisMCmRequest( + IN NDIS_HANDLE NdisAfHandle, + IN NDIS_HANDLE NdisVcHandle OPTIONAL, + IN NDIS_HANDLE NdisPartyHandle OPTIONAL, + IN OUT PNDIS_REQUEST NdisRequest); + + +/* Connection-oriented services */ + +NDISAPI +NDIS_STATUS +DDKAPI +NdisCoCreateVc( + IN NDIS_HANDLE NdisBindingHandle, + IN NDIS_HANDLE NdisAfHandle OPTIONAL, + IN NDIS_HANDLE ProtocolVcContext, + IN OUT PNDIS_HANDLE NdisVcHandle); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisCoDeleteVc( + IN NDIS_HANDLE NdisVcHandle); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisCoRequest( + IN NDIS_HANDLE NdisBindingHandle, + IN NDIS_HANDLE NdisAfHandle OPTIONAL, + IN NDIS_HANDLE NdisVcHandle OPTIONAL, + IN NDIS_HANDLE NdisPartyHandle OPTIONAL, + IN OUT PNDIS_REQUEST NdisRequest); + +NDISAPI +VOID +DDKAPI +NdisCoRequestComplete( + IN NDIS_STATUS Status, + IN NDIS_HANDLE NdisAfHandle, + IN NDIS_HANDLE NdisVcHandle OPTIONAL, + IN NDIS_HANDLE NdisPartyHandle OPTIONAL, + IN PNDIS_REQUEST NdisRequest); + +NDISAPI +VOID +DDKAPI +NdisCoSendPackets( + IN NDIS_HANDLE NdisVcHandle, + IN PPNDIS_PACKET PacketArray, + IN UINT NumberOfPackets); + +NDISAPI +VOID +DDKAPI +NdisMCoActivateVcComplete( + IN NDIS_STATUS Status, + IN NDIS_HANDLE NdisVcHandle, + IN PCO_CALL_PARAMETERS CallParameters); + +NDISAPI +VOID +DDKAPI +NdisMCoDeactivateVcComplete( + IN NDIS_STATUS Status, + IN NDIS_HANDLE NdisVcHandle); + +NDISAPI +VOID +DDKAPI +NdisMCoIndicateReceivePacket( + IN NDIS_HANDLE NdisVcHandle, + IN PPNDIS_PACKET PacketArray, + IN UINT NumberOfPackets); + +NDISAPI +VOID +DDKAPI +NdisMCoIndicateStatus( + IN NDIS_HANDLE MiniportAdapterHandle, + IN NDIS_HANDLE NdisVcHandle OPTIONAL, + IN NDIS_STATUS GeneralStatus, + IN PVOID StatusBuffer OPTIONAL, + IN ULONG StatusBufferSize); + +NDISAPI +VOID +DDKAPI +NdisMCoReceiveComplete( + IN NDIS_HANDLE MiniportAdapterHandle); + +NDISAPI +VOID +DDKAPI +NdisMCoRequestComplete( + IN NDIS_STATUS Status, + IN NDIS_HANDLE MiniportAdapterHandle, + IN PNDIS_REQUEST Request); + +NDISAPI +VOID +DDKAPI +NdisMCoSendComplete( + IN NDIS_STATUS Status, + IN NDIS_HANDLE NdisVcHandle, + IN PNDIS_PACKET Packet); + + +/* NDIS 5.0 extensions for intermediate drivers */ + +NDISAPI +VOID +DDKAPI +NdisIMAssociateMiniport( + IN NDIS_HANDLE DriverHandle, + IN NDIS_HANDLE ProtocolHandle); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisIMCancelInitializeDeviceInstance( + IN NDIS_HANDLE DriverHandle, + IN PNDIS_STRING DeviceInstance); + +NDISAPI +VOID +DDKAPI +NdisIMCopySendCompletePerPacketInfo( + IN PNDIS_PACKET DstPacket, + IN PNDIS_PACKET SrcPacket); + +NDISAPI +VOID +DDKAPI +NdisIMCopySendPerPacketInfo( + IN PNDIS_PACKET DstPacket, + IN PNDIS_PACKET SrcPacket); + +NDISAPI +VOID +DDKAPI +NdisIMDeregisterLayeredMiniport( + IN NDIS_HANDLE DriverHandle); + +NDISAPI +NDIS_HANDLE +DDKAPI +NdisIMGetBindingContext( + IN NDIS_HANDLE NdisBindingHandle); + +NDISAPI +NDIS_HANDLE +DDKAPI +NdisIMGetDeviceContext( + IN NDIS_HANDLE MiniportAdapterHandle); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisIMInitializeDeviceInstanceEx( + IN NDIS_HANDLE DriverHandle, + IN PNDIS_STRING DriverInstance, + IN NDIS_HANDLE DeviceContext OPTIONAL); + +NDISAPI +PSINGLE_LIST_ENTRY +DDKAPI +NdisInterlockedPopEntrySList( + IN PSLIST_HEADER ListHead, + IN PKSPIN_LOCK Lock); + +NDISAPI +PSINGLE_LIST_ENTRY +DDKAPI +NdisInterlockedPushEntrySList( + IN PSLIST_HEADER ListHead, + IN PSINGLE_LIST_ENTRY ListEntry, + IN PKSPIN_LOCK Lock); + +NDISAPI +VOID +DDKAPI +NdisQueryBufferSafe( + IN PNDIS_BUFFER Buffer, + OUT PVOID *VirtualAddress OPTIONAL, + OUT PUINT Length, + IN UINT Priority); + +/* Prototypes for NDIS_MINIPORT_CHARACTERISTICS */ + +typedef BOOLEAN DDKAPI +(*W_CHECK_FOR_HANG_HANDLER)( + IN NDIS_HANDLE MiniportAdapterContext); + +typedef VOID DDKAPI +(*W_DISABLE_INTERRUPT_HANDLER)( + IN NDIS_HANDLE MiniportAdapterContext); + +typedef VOID DDKAPI +(*W_ENABLE_INTERRUPT_HANDLER)( + IN NDIS_HANDLE MiniportAdapterContext); + +typedef VOID DDKAPI +(*W_HALT_HANDLER)( + IN NDIS_HANDLE MiniportAdapterContext); + +typedef VOID DDKAPI +(*W_HANDLE_INTERRUPT_HANDLER)( + IN NDIS_HANDLE MiniportAdapterContext); + +typedef NDIS_STATUS DDKAPI +(*W_INITIALIZE_HANDLER)( + OUT PNDIS_STATUS OpenErrorStatus, + OUT PUINT SelectedMediumIndex, + IN PNDIS_MEDIUM MediumArray, + IN UINT MediumArraySize, + IN NDIS_HANDLE MiniportAdapterContext, + IN NDIS_HANDLE WrapperConfigurationContext); + +typedef VOID DDKAPI +(*W_ISR_HANDLER)( + OUT PBOOLEAN InterruptRecognized, + OUT PBOOLEAN QueueMiniportHandleInterrupt, + IN NDIS_HANDLE MiniportAdapterContext); + +typedef NDIS_STATUS DDKAPI +(*W_QUERY_INFORMATION_HANDLER)( + IN NDIS_HANDLE MiniportAdapterContext, + IN NDIS_OID Oid, + IN PVOID InformationBuffer, + IN ULONG InformationBufferLength, + OUT PULONG BytesWritten, + OUT PULONG BytesNeeded); + +typedef NDIS_STATUS DDKAPI +(*W_RECONFIGURE_HANDLER)( + OUT PNDIS_STATUS OpenErrorStatus, + IN NDIS_HANDLE MiniportAdapterContext, + IN NDIS_HANDLE WrapperConfigurationContext); + +typedef NDIS_STATUS DDKAPI +(*W_RESET_HANDLER)( + OUT PBOOLEAN AddressingReset, + IN NDIS_HANDLE MiniportAdapterContext); + +typedef NDIS_STATUS DDKAPI +(*W_SEND_HANDLER)( + IN NDIS_HANDLE MiniportAdapterContext, + IN PNDIS_PACKET Packet, + IN UINT Flags); + +typedef NDIS_STATUS DDKAPI +(*WM_SEND_HANDLER)( + IN NDIS_HANDLE MiniportAdapterContext, + IN NDIS_HANDLE NdisLinkHandle, + IN PNDIS_WAN_PACKET Packet); + +typedef NDIS_STATUS DDKAPI +(*W_SET_INFORMATION_HANDLER)( + IN NDIS_HANDLE MiniportAdapterContext, + IN NDIS_OID Oid, + IN PVOID InformationBuffer, + IN ULONG InformationBufferLength, + OUT PULONG BytesRead, + OUT PULONG BytesNeeded); + +typedef NDIS_STATUS DDKAPI +(*W_TRANSFER_DATA_HANDLER)( + OUT PNDIS_PACKET Packet, + OUT PUINT BytesTransferred, + IN NDIS_HANDLE MiniportAdapterContext, + IN NDIS_HANDLE MiniportReceiveContext, + IN UINT ByteOffset, + IN UINT BytesToTransfer); + +typedef NDIS_STATUS DDKAPI +(*WM_TRANSFER_DATA_HANDLER)( + VOID); + + +/* NDIS structures available only to miniport drivers */ + +#define NDIS30_MINIPORT_CHARACTERISTICS_S \ + UCHAR MajorNdisVersion; \ + UCHAR MinorNdisVersion; \ + USHORT Filler; \ + UINT Reserved; \ + W_CHECK_FOR_HANG_HANDLER CheckForHangHandler; \ + W_DISABLE_INTERRUPT_HANDLER DisableInterruptHandler; \ + W_ENABLE_INTERRUPT_HANDLER EnableInterruptHandler; \ + W_HALT_HANDLER HaltHandler; \ + W_HANDLE_INTERRUPT_HANDLER HandleInterruptHandler; \ + W_INITIALIZE_HANDLER InitializeHandler; \ + W_ISR_HANDLER ISRHandler; \ + W_QUERY_INFORMATION_HANDLER QueryInformationHandler; \ + W_RECONFIGURE_HANDLER ReconfigureHandler; \ + W_RESET_HANDLER ResetHandler; \ + _ANONYMOUS_UNION union { \ + W_SEND_HANDLER SendHandler; \ + WM_SEND_HANDLER WanSendHandler; \ + } _UNION_NAME(u1); \ + W_SET_INFORMATION_HANDLER SetInformationHandler; \ + _ANONYMOUS_UNION union { \ + W_TRANSFER_DATA_HANDLER TransferDataHandler; \ + WM_TRANSFER_DATA_HANDLER WanTransferDataHandler; \ + } _UNION_NAME(u2); + +typedef struct _NDIS30_MINIPORT_CHARACTERISTICS { + NDIS30_MINIPORT_CHARACTERISTICS_S +} NDIS30_MINIPORT_CHARACTERISTICS, *PSNDIS30_MINIPORT_CHARACTERISTICS; + + +/* Extensions for NDIS 4.0 miniports */ + +typedef VOID DDKAPI +(*W_SEND_PACKETS_HANDLER)( + IN NDIS_HANDLE MiniportAdapterContext, + IN PPNDIS_PACKET PacketArray, + IN UINT NumberOfPackets); + +typedef VOID DDKAPI +(*W_RETURN_PACKET_HANDLER)( + IN NDIS_HANDLE MiniportAdapterContext, + IN PNDIS_PACKET Packet); + +typedef VOID DDKAPI +(*W_ALLOCATE_COMPLETE_HANDLER)( + IN NDIS_HANDLE MiniportAdapterContext, + IN PVOID VirtualAddress, + IN PNDIS_PHYSICAL_ADDRESS PhysicalAddress, + IN ULONG Length, + IN PVOID Context); + +#ifdef __cplusplus + +#define NDIS40_MINIPORT_CHARACTERISTICS_S \ + NDIS30_MINIPORT_CHARACTERISTICS Ndis30Chars; \ + W_RETURN_PACKET_HANDLER ReturnPacketHandler; \ + W_SEND_PACKETS_HANDLER SendPacketsHandler; \ + W_ALLOCATE_COMPLETE_HANDLER AllocateCompleteHandler; + +#else /* !__cplusplus */ + +#define NDIS40_MINIPORT_CHARACTERISTICS_S \ + NDIS30_MINIPORT_CHARACTERISTICS_S \ + W_RETURN_PACKET_HANDLER ReturnPacketHandler; \ + W_SEND_PACKETS_HANDLER SendPacketsHandler; \ + W_ALLOCATE_COMPLETE_HANDLER AllocateCompleteHandler; + +#endif /* !__cplusplus */ + +typedef struct _NDIS40_MINIPORT_CHARACTERISTICS { + NDIS40_MINIPORT_CHARACTERISTICS_S +} NDIS40_MINIPORT_CHARACTERISTICS, *PNDIS40_MINIPORT_CHARACTERISTICS; + + +/* Extensions for NDIS 5.0 miniports */ + +typedef NDIS_STATUS DDKAPI +(*W_CO_CREATE_VC_HANDLER)( + IN NDIS_HANDLE MiniportAdapterContext, + IN NDIS_HANDLE NdisVcHandle, + OUT PNDIS_HANDLE MiniportVcContext); + +typedef NDIS_STATUS DDKAPI +(*W_CO_DELETE_VC_HANDLER)( + IN NDIS_HANDLE MiniportVcContext); + +typedef NDIS_STATUS DDKAPI +(*W_CO_ACTIVATE_VC_HANDLER)( + IN NDIS_HANDLE MiniportVcContext, + IN OUT PCO_CALL_PARAMETERS CallParameters); + +typedef NDIS_STATUS DDKAPI +(*W_CO_DEACTIVATE_VC_HANDLER)( + IN NDIS_HANDLE MiniportVcContext); + +typedef VOID DDKAPI +(*W_CO_SEND_PACKETS_HANDLER)( + IN NDIS_HANDLE MiniportVcContext, + IN PPNDIS_PACKET PacketArray, + IN UINT NumberOfPackets); + +typedef NDIS_STATUS DDKAPI +(*W_CO_REQUEST_HANDLER)( + IN NDIS_HANDLE MiniportAdapterContext, + IN NDIS_HANDLE MiniportVcContext OPTIONAL, + IN OUT PNDIS_REQUEST NdisRequest); + +#ifdef __cplusplus + +#define NDIS50_MINIPORT_CHARACTERISTICS_S \ + NDIS40_MINIPORT_CHARACTERISTICS Ndis40Chars; \ + W_CO_CREATE_VC_HANDLER CoCreateVcHandler; \ + W_CO_DELETE_VC_HANDLER CoDeleteVcHandler; \ + W_CO_ACTIVATE_VC_HANDLER CoActivateVcHandler; \ + W_CO_DEACTIVATE_VC_HANDLER CoDeactivateVcHandler; \ + W_CO_SEND_PACKETS_HANDLER CoSendPacketsHandler; \ + W_CO_REQUEST_HANDLER CoRequestHandler; + +#else /* !__cplusplus */ + +#define NDIS50_MINIPORT_CHARACTERISTICS_S \ + NDIS40_MINIPORT_CHARACTERISTICS_S \ + W_CO_CREATE_VC_HANDLER CoCreateVcHandler; \ + W_CO_DELETE_VC_HANDLER CoDeleteVcHandler; \ + W_CO_ACTIVATE_VC_HANDLER CoActivateVcHandler; \ + W_CO_DEACTIVATE_VC_HANDLER CoDeactivateVcHandler; \ + W_CO_SEND_PACKETS_HANDLER CoSendPacketsHandler; \ + W_CO_REQUEST_HANDLER CoRequestHandler; + +#endif /* !__cplusplus */ + +typedef struct _NDIS50_MINIPORT_CHARACTERISTICS { + NDIS50_MINIPORT_CHARACTERISTICS_S +} NDIS50_MINIPORT_CHARACTERISTICS, *PSNDIS50_MINIPORT_CHARACTERISTICS; + + +/* Extensions for NDIS 5.1 miniports */ + +typedef VOID DDKAPI +(*W_CANCEL_SEND_PACKETS_HANDLER)( + IN NDIS_HANDLE MiniportAdapterContext, + IN PVOID CancelId); + + +#if defined(NDIS51_MINIPORT) +typedef struct _NDIS_MINIPORT_CHARACTERISTICS { + NDIS50_MINIPORT_CHARACTERISTICS_S +} NDIS_MINIPORT_CHARACTERISTICS, *PNDIS_MINIPORT_CHARACTERISTICS; +#elif defined(NDIS50_MINIPORT) +typedef struct _NDIS_MINIPORT_CHARACTERISTICS { + NDIS50_MINIPORT_CHARACTERISTICS_S +} NDIS_MINIPORT_CHARACTERISTICS, *PNDIS_MINIPORT_CHARACTERISTICS; +#elif defined(NDIS40_MINIPORT) +typedef struct _NDIS_MINIPORT_CHARACTERISTICS { + NDIS40_MINIPORT_CHARACTERISTICS_S +} NDIS_MINIPORT_CHARACTERISTICS, *PNDIS_MINIPORT_CHARACTERISTICS; +#else /* NDIS30 */ +typedef struct _NDIS_MINIPORT_CHARACTERISTICS { + NDIS30_MINIPORT_CHARACTERISTICS_S +} NDIS_MINIPORT_CHARACTERISTICS, *PNDIS_MINIPORT_CHARACTERISTICS; +#endif + + +typedef NDIS_STATUS DDKAPI +(*SEND_HANDLER)( + IN NDIS_HANDLE MacBindingHandle, + IN PNDIS_PACKET Packet); + +typedef NDIS_STATUS DDKAPI +(*TRANSFER_DATA_HANDLER)( + IN NDIS_HANDLE MacBindingHandle, + IN NDIS_HANDLE MacReceiveContext, + IN UINT ByteOffset, + IN UINT BytesToTransfer, + OUT PNDIS_PACKET Packet, + OUT PUINT BytesTransferred); + +typedef NDIS_STATUS DDKAPI +(*RESET_HANDLER)( + IN NDIS_HANDLE MacBindingHandle); + +typedef NDIS_STATUS DDKAPI +(*REQUEST_HANDLER)( + IN NDIS_HANDLE MacBindingHandle, + IN PNDIS_REQUEST NdisRequest); + + + +/* Structures available only to full MAC drivers */ + +typedef BOOLEAN DDKAPI +(*PNDIS_INTERRUPT_SERVICE)( + IN PVOID InterruptContext); + +typedef VOID DDKAPI +(*PNDIS_DEFERRED_PROCESSING)( + IN PVOID SystemSpecific1, + IN PVOID InterruptContext, + IN PVOID SystemSpecific2, + IN PVOID SystemSpecific3); + + + +typedef struct _NDIS_MINIPORT_BLOCK NDIS_MINIPORT_BLOCK, *PNDIS_MINIPORT_BLOCK; +typedef struct _NDIS_PROTOCOL_BLOCK NDIS_PROTOCOL_BLOCK, *PNDIS_PROTOCOL_BLOCK; +typedef struct _NDIS_OPEN_BLOCK NDIS_OPEN_BLOCK, *PNDIS_OPEN_BLOCK; +typedef struct _NDIS_M_DRIVER_BLOCK NDIS_M_DRIVER_BLOCK, *PNDIS_M_DRIVER_BLOCK; +typedef struct _NDIS_AF_LIST NDIS_AF_LIST, *PNDIS_AF_LIST; + + +typedef struct _NDIS_MINIPORT_INTERRUPT { + PKINTERRUPT InterruptObject; + KSPIN_LOCK DpcCountLock; + PVOID MiniportIdField; + W_ISR_HANDLER MiniportIsr; + W_HANDLE_INTERRUPT_HANDLER MiniportDpc; + KDPC InterruptDpc; + PNDIS_MINIPORT_BLOCK Miniport; + UCHAR DpcCount; + BOOLEAN Filler1; + KEVENT DpcsCompletedEvent; + BOOLEAN SharedInterrupt; + BOOLEAN IsrRequested; +} NDIS_MINIPORT_INTERRUPT, *PNDIS_MINIPORT_INTERRUPT; + +typedef struct _NDIS_MINIPORT_TIMER { + KTIMER Timer; + KDPC Dpc; + PNDIS_TIMER_FUNCTION MiniportTimerFunction; + PVOID MiniportTimerContext; + PNDIS_MINIPORT_BLOCK Miniport; + struct _NDIS_MINIPORT_TIMER *NextDeferredTimer; +} NDIS_MINIPORT_TIMER, *PNDIS_MINIPORT_TIMER; + +typedef struct _NDIS_INTERRUPT { + PKINTERRUPT InterruptObject; + KSPIN_LOCK DpcCountLock; + PNDIS_INTERRUPT_SERVICE MacIsr; + PNDIS_DEFERRED_PROCESSING MacDpc; + KDPC InterruptDpc; + PVOID InterruptContext; + UCHAR DpcCount; + BOOLEAN Removing; + KEVENT DpcsCompletedEvent; +} NDIS_INTERRUPT, *PNDIS_INTERRUPT; + + +typedef struct _MAP_REGISTER_ENTRY { + PVOID MapRegister; + BOOLEAN WriteToDevice; +} MAP_REGISTER_ENTRY, *PMAP_REGISTER_ENTRY; + + +typedef enum _NDIS_WORK_ITEM_TYPE { + NdisWorkItemRequest, + NdisWorkItemSend, + NdisWorkItemReturnPackets, + NdisWorkItemResetRequested, + NdisWorkItemResetInProgress, + NdisWorkItemHalt, + NdisWorkItemSendLoopback, + NdisWorkItemMiniportCallback, + NdisMaxWorkItems +} NDIS_WORK_ITEM_TYPE, *PNDIS_WORK_ITEM_TYPE; + +#define NUMBER_OF_WORK_ITEM_TYPES NdisMaxWorkItems +#define NUMBER_OF_SINGLE_WORK_ITEMS 6 + +typedef struct _NDIS_MINIPORT_WORK_ITEM { + SINGLE_LIST_ENTRY Link; + NDIS_WORK_ITEM_TYPE WorkItemType; + PVOID WorkItemContext; +} NDIS_MINIPORT_WORK_ITEM, *PNDIS_MINIPORT_WORK_ITEM; + + +typedef struct _NDIS_BIND_PATHS { + UINT Number; + NDIS_STRING Paths[1]; +} NDIS_BIND_PATHS, *PNDIS_BIND_PATHS; + +#define DECLARE_UNKNOWN_STRUCT(BaseName) \ + typedef struct _##BaseName BaseName, *P##BaseName; + +#define DECLARE_UNKNOWN_PROTOTYPE(Name) \ + typedef VOID (*(Name))(VOID); + +#define ETH_LENGTH_OF_ADDRESS 6 + +DECLARE_UNKNOWN_STRUCT(ETH_BINDING_INFO) + +DECLARE_UNKNOWN_PROTOTYPE(ETH_ADDRESS_CHANGE) +DECLARE_UNKNOWN_PROTOTYPE(ETH_FILTER_CHANGE) +DECLARE_UNKNOWN_PROTOTYPE(ETH_DEFERRED_CLOSE) + +typedef struct _ETH_FILTER { + PNDIS_SPIN_LOCK Lock; + CHAR (*MCastAddressBuf)[ETH_LENGTH_OF_ADDRESS]; + struct _NDIS_MINIPORT_BLOCK *Miniport; + UINT CombinedPacketFilter; + PETH_BINDING_INFO OpenList; + ETH_ADDRESS_CHANGE AddressChangeAction; + ETH_FILTER_CHANGE FilterChangeAction; + ETH_DEFERRED_CLOSE CloseAction; + UINT MaxMulticastAddresses; + UINT NumAddresses; + UCHAR AdapterAddress[ETH_LENGTH_OF_ADDRESS]; + UINT OldCombinedPacketFilter; + CHAR (*OldMCastAddressBuf)[ETH_LENGTH_OF_ADDRESS]; + UINT OldNumAddresses; + PETH_BINDING_INFO DirectedList; + PETH_BINDING_INFO BMList; + PETH_BINDING_INFO MCastSet; +#if defined(NDIS_WRAPPER) + UINT NumOpens; + PVOID BindListLock; +#endif +} ETH_FILTER, *PETH_FILTER; + +typedef VOID DDKAPI +(*ETH_RCV_COMPLETE_HANDLER)( + IN PETH_FILTER Filter); + +typedef VOID DDKAPI +(*ETH_RCV_INDICATE_HANDLER)( + IN PETH_FILTER Filter, + IN NDIS_HANDLE MacReceiveContext, + IN PCHAR Address, + IN PVOID HeaderBuffer, + IN UINT HeaderBufferSize, + IN PVOID LookaheadBuffer, + IN UINT LookaheadBufferSize, + IN UINT PacketSize); + +typedef VOID DDKAPI +(*FDDI_RCV_COMPLETE_HANDLER)( + IN PFDDI_FILTER Filter); + +typedef VOID DDKAPI +(*FDDI_RCV_INDICATE_HANDLER)( + IN PFDDI_FILTER Filter, + IN NDIS_HANDLE MacReceiveContext, + IN PCHAR Address, + IN UINT AddressLength, + IN PVOID HeaderBuffer, + IN UINT HeaderBufferSize, + IN PVOID LookaheadBuffer, + IN UINT LookaheadBufferSize, + IN UINT PacketSize); + +typedef VOID DDKAPI +(*FILTER_PACKET_INDICATION_HANDLER)( + IN NDIS_HANDLE Miniport, + IN PPNDIS_PACKET PacketArray, + IN UINT NumberOfPackets); + +typedef VOID DDKAPI +(*TR_RCV_COMPLETE_HANDLER)( + IN PTR_FILTER Filter); + +typedef VOID DDKAPI +(*TR_RCV_INDICATE_HANDLER)( + IN PTR_FILTER Filter, + IN NDIS_HANDLE MacReceiveContext, + IN PVOID HeaderBuffer, + IN UINT HeaderBufferSize, + IN PVOID LookaheadBuffer, + IN UINT LookaheadBufferSize, + IN UINT PacketSize); + +typedef VOID DDKAPI +(*WAN_RCV_COMPLETE_HANDLER)( + IN NDIS_HANDLE MiniportAdapterHandle, + IN NDIS_HANDLE NdisLinkContext); + +typedef VOID DDKAPI +(*WAN_RCV_HANDLER)( + OUT PNDIS_STATUS Status, + IN NDIS_HANDLE MiniportAdapterHandle, + IN NDIS_HANDLE NdisLinkContext, + IN PUCHAR Packet, + IN ULONG PacketSize); + +typedef VOID DDKFASTAPI +(*NDIS_M_DEQUEUE_WORK_ITEM)( + IN PNDIS_MINIPORT_BLOCK Miniport, + IN NDIS_WORK_ITEM_TYPE WorkItemType, + OUT PVOID *WorkItemContext); + +typedef NDIS_STATUS DDKFASTAPI +(*NDIS_M_QUEUE_NEW_WORK_ITEM)( + IN PNDIS_MINIPORT_BLOCK Miniport, + IN NDIS_WORK_ITEM_TYPE WorkItemType, + IN PVOID WorkItemContext); + +typedef NDIS_STATUS DDKFASTAPI +(*NDIS_M_QUEUE_WORK_ITEM)( + IN PNDIS_MINIPORT_BLOCK Miniport, + IN NDIS_WORK_ITEM_TYPE WorkItemType, + IN PVOID WorkItemContext); + +typedef VOID DDKAPI +(*NDIS_M_REQ_COMPLETE_HANDLER)( + IN NDIS_HANDLE MiniportAdapterHandle, + IN NDIS_STATUS Status); + +typedef VOID DDKAPI +(*NDIS_M_RESET_COMPLETE_HANDLER)( + IN NDIS_HANDLE MiniportAdapterHandle, + IN NDIS_STATUS Status, + IN BOOLEAN AddressingReset); + +typedef VOID DDKAPI +(*NDIS_M_SEND_COMPLETE_HANDLER)( + IN NDIS_HANDLE MiniportAdapterHandle, + IN PNDIS_PACKET Packet, + IN NDIS_STATUS Status); + +typedef VOID DDKAPI +(*NDIS_M_SEND_RESOURCES_HANDLER)( + IN NDIS_HANDLE MiniportAdapterHandle); + +typedef BOOLEAN DDKFASTAPI +(*NDIS_M_START_SENDS)( + IN PNDIS_MINIPORT_BLOCK Miniport); + +typedef VOID DDKAPI +(*NDIS_M_STATUS_HANDLER)( + IN NDIS_HANDLE MiniportHandle, + IN NDIS_STATUS GeneralStatus, + IN PVOID StatusBuffer, + IN UINT StatusBufferSize); + +typedef VOID DDKAPI +(*NDIS_M_STS_COMPLETE_HANDLER)( + IN NDIS_HANDLE MiniportAdapterHandle); + +typedef VOID DDKAPI +(*NDIS_M_TD_COMPLETE_HANDLER)( + IN NDIS_HANDLE MiniportAdapterHandle, + IN PNDIS_PACKET Packet, + IN NDIS_STATUS Status, + IN UINT BytesTransferred); + +typedef VOID (DDKAPI *NDIS_WM_SEND_COMPLETE_HANDLER)( + IN NDIS_HANDLE MiniportAdapterHandle, + IN PVOID Packet, + IN NDIS_STATUS Status); + + +#if ARCNET + +#define ARC_SEND_BUFFERS 8 +#define ARC_HEADER_SIZE 4 + +typedef struct _NDIS_ARC_BUF { + NDIS_HANDLE ArcnetBufferPool; + PUCHAR ArcnetLookaheadBuffer; + UINT NumFree; + ARC_BUFFER_LIST ArcnetBuffers[ARC_SEND_BUFFERS]; +} NDIS_ARC_BUF, *PNDIS_ARC_BUF; + +#endif /* ARCNET */ + +typedef struct _NDIS_LOG { + PNDIS_MINIPORT_BLOCK Miniport; + KSPIN_LOCK LogLock; + PIRP Irp; + UINT TotalSize; + UINT CurrentSize; + UINT InPtr; + UINT OutPtr; + UCHAR LogBuf[1]; +} NDIS_LOG, *PNDIS_LOG; + +#if ARCNET +#define FILTERDBS_ARCNET_S \ + PARC_FILTER ArcDB; +#else /* !ARCNET */ +#define FILTERDBS_ARCNET_S \ + PVOID XXXDB; +#endif /* !ARCNET */ + +#define FILTERDBS_S \ + _ANONYMOUS_UNION union { \ + PETH_FILTER EthDB; \ + PNULL_FILTER NullDB; \ + } DUMMYUNIONNAME; \ + PTR_FILTER TrDB; \ + PFDDI_FILTER FddiDB; \ + FILTERDBS_ARCNET_S + +typedef struct _FILTERDBS { + FILTERDBS_S +} FILTERDBS, *PFILTERDBS; + + +struct _NDIS_MINIPORT_BLOCK { + PVOID Signature; + PNDIS_MINIPORT_BLOCK NextMiniport; + PNDIS_M_DRIVER_BLOCK DriverHandle; + NDIS_HANDLE MiniportAdapterContext; + UNICODE_STRING MiniportName; + PNDIS_BIND_PATHS BindPaths; + NDIS_HANDLE OpenQueue; + REFERENCE ShortRef; + NDIS_HANDLE DeviceContext; + UCHAR Padding1; + UCHAR LockAcquired; + UCHAR PmodeOpens; + UCHAR AssignedProcessor; + KSPIN_LOCK Lock; + PNDIS_REQUEST MediaRequest; + PNDIS_MINIPORT_INTERRUPT Interrupt; + ULONG Flags; + ULONG PnPFlags; + LIST_ENTRY PacketList; + PNDIS_PACKET FirstPendingPacket; + PNDIS_PACKET ReturnPacketsQueue; + ULONG RequestBuffer; + PVOID SetMCastBuffer; + PNDIS_MINIPORT_BLOCK PrimaryMiniport; + PVOID WrapperContext; + PVOID BusDataContext; + ULONG PnPCapabilities; + PCM_RESOURCE_LIST Resources; + NDIS_TIMER WakeUpDpcTimer; + UNICODE_STRING BaseName; + UNICODE_STRING SymbolicLinkName; + ULONG CheckForHangSeconds; + USHORT CFHangTicks; + USHORT CFHangCurrentTick; + NDIS_STATUS ResetStatus; + NDIS_HANDLE ResetOpen; + FILTERDBS_S + FILTER_PACKET_INDICATION_HANDLER PacketIndicateHandler; + NDIS_M_SEND_COMPLETE_HANDLER SendCompleteHandler; + NDIS_M_SEND_RESOURCES_HANDLER SendResourcesHandler; + NDIS_M_RESET_COMPLETE_HANDLER ResetCompleteHandler; + NDIS_MEDIUM MediaType; + ULONG BusNumber; + NDIS_INTERFACE_TYPE BusType; + NDIS_INTERFACE_TYPE AdapterType; + PDEVICE_OBJECT DeviceObject; + PDEVICE_OBJECT PhysicalDeviceObject; + PDEVICE_OBJECT NextDeviceObject; + PMAP_REGISTER_ENTRY MapRegisters; + PNDIS_AF_LIST CallMgrAfList; + PVOID MiniportThread; + PVOID SetInfoBuf; + USHORT SetInfoBufLen; + USHORT MaxSendPackets; + NDIS_STATUS FakeStatus; + PVOID LockHandler; + PUNICODE_STRING pAdapterInstanceName; + PNDIS_MINIPORT_TIMER TimerQueue; + UINT MacOptions; + PNDIS_REQUEST PendingRequest; + UINT MaximumLongAddresses; + UINT MaximumShortAddresses; + UINT CurrentLookahead; + UINT MaximumLookahead; + W_HANDLE_INTERRUPT_HANDLER HandleInterruptHandler; + W_DISABLE_INTERRUPT_HANDLER DisableInterruptHandler; + W_ENABLE_INTERRUPT_HANDLER EnableInterruptHandler; + W_SEND_PACKETS_HANDLER SendPacketsHandler; + NDIS_M_START_SENDS DeferredSendHandler; + ETH_RCV_INDICATE_HANDLER EthRxIndicateHandler; + TR_RCV_INDICATE_HANDLER TrRxIndicateHandler; + FDDI_RCV_INDICATE_HANDLER FddiRxIndicateHandler; + ETH_RCV_COMPLETE_HANDLER EthRxCompleteHandler; + TR_RCV_COMPLETE_HANDLER TrRxCompleteHandler; + FDDI_RCV_COMPLETE_HANDLER FddiRxCompleteHandler; + NDIS_M_STATUS_HANDLER StatusHandler; + NDIS_M_STS_COMPLETE_HANDLER StatusCompleteHandler; + NDIS_M_TD_COMPLETE_HANDLER TDCompleteHandler; + NDIS_M_REQ_COMPLETE_HANDLER QueryCompleteHandler; + NDIS_M_REQ_COMPLETE_HANDLER SetCompleteHandler; + NDIS_WM_SEND_COMPLETE_HANDLER WanSendCompleteHandler; + WAN_RCV_HANDLER WanRcvHandler; + WAN_RCV_COMPLETE_HANDLER WanRcvCompleteHandler; +#if defined(NDIS_WRAPPER) + PNDIS_MINIPORT_BLOCK NextGlobalMiniport; + SINGLE_LIST_ENTRY WorkQueue[NUMBER_OF_WORK_ITEM_TYPES]; + SINGLE_LIST_ENTRY SingleWorkItems[NUMBER_OF_SINGLE_WORK_ITEMS]; + UCHAR SendFlags; + UCHAR TrResetRing; + UCHAR ArcnetAddress; + UCHAR XState; + _ANONYMOUS_UNION union { +#if ARCNET + PNDIS_ARC_BUF ArcBuf; +#endif + PVOID BusInterface; + } DUMMYUNIONNAME; + PNDIS_LOG Log; + ULONG SlotNumber; + PCM_RESOURCE_LIST AllocatedResources; + PCM_RESOURCE_LIST AllocatedResourcesTranslated; + SINGLE_LIST_ENTRY PatternList; + NDIS_PNP_CAPABILITIES PMCapabilities; + DEVICE_CAPABILITIES DeviceCaps; + ULONG WakeUpEnable; + DEVICE_POWER_STATE CurrentDevicePowerState; + PIRP pIrpWaitWake; + SYSTEM_POWER_STATE WaitWakeSystemState; + LARGE_INTEGER VcIndex; + KSPIN_LOCK VcCountLock; + LIST_ENTRY WmiEnabledVcs; + PNDIS_GUID pNdisGuidMap; + PNDIS_GUID pCustomGuidMap; + USHORT VcCount; + USHORT cNdisGuidMap; + USHORT cCustomGuidMap; + USHORT CurrentMapRegister; + PKEVENT AllocationEvent; + USHORT BaseMapRegistersNeeded; + USHORT SGMapRegistersNeeded; + ULONG MaximumPhysicalMapping; + NDIS_TIMER MediaDisconnectTimer; + USHORT MediaDisconnectTimeOut; + USHORT InstanceNumber; + NDIS_EVENT OpenReadyEvent; + NDIS_PNP_DEVICE_STATE PnPDeviceState; + NDIS_PNP_DEVICE_STATE OldPnPDeviceState; + PGET_SET_DEVICE_DATA SetBusData; + PGET_SET_DEVICE_DATA GetBusData; + KDPC DeferredDpc; +#if 0 + /* FIXME: */ + NDIS_STATS NdisStats; +#else + ULONG NdisStats; +#endif + PNDIS_PACKET IndicatedPacket[MAXIMUM_PROCESSORS]; + PKEVENT RemoveReadyEvent; + PKEVENT AllOpensClosedEvent; + PKEVENT AllRequestsCompletedEvent; + ULONG InitTimeMs; + NDIS_MINIPORT_WORK_ITEM WorkItemBuffer[NUMBER_OF_SINGLE_WORK_ITEMS]; + PDMA_ADAPTER SystemAdapterObject; + ULONG DriverVerifyFlags; + POID_LIST OidList; + USHORT InternalResetCount; + USHORT MiniportResetCount; + USHORT MediaSenseConnectCount; + USHORT MediaSenseDisconnectCount; + PNDIS_PACKET *xPackets; + ULONG UserModeOpenReferences; + _ANONYMOUS_UNION union { + PVOID SavedSendHandler; + PVOID SavedWanSendHandler; + } DUMMYUNIONNAME2; + PVOID SavedSendPacketsHandler; + PVOID SavedCancelSendPacketsHandler; + W_SEND_PACKETS_HANDLER WSendPacketsHandler; + ULONG MiniportAttributes; + PDMA_ADAPTER SavedSystemAdapterObject; + USHORT NumOpens; + USHORT CFHangXTicks; + ULONG RequestCount; + ULONG IndicatedPacketsCount; + ULONG PhysicalMediumType; + PNDIS_REQUEST LastRequest; + LONG DmaAdapterRefCount; + PVOID FakeMac; + ULONG LockDbg; + ULONG LockDbgX; + PVOID LockThread; + ULONG InfoFlags; + KSPIN_LOCK TimerQueueLock; + PKEVENT ResetCompletedEvent; + PKEVENT QueuedBindingCompletedEvent; + PKEVENT DmaResourcesReleasedEvent; + FILTER_PACKET_INDICATION_HANDLER SavedPacketIndicateHandler; + ULONG RegisteredInterrupts; + PNPAGED_LOOKASIDE_LIST SGListLookasideList; + ULONG ScatterGatherListSize; +#endif /* _NDIS_ */ +}; + + +/* Handler prototypes for NDIS_OPEN_BLOCK */ + +typedef NDIS_STATUS (DDKAPI *WAN_SEND_HANDLER)( + IN NDIS_HANDLE MacBindingHandle, + IN NDIS_HANDLE LinkHandle, + IN PVOID Packet); + +/* NDIS 4.0 extension */ + +typedef VOID (DDKAPI *SEND_PACKETS_HANDLER)( + IN NDIS_HANDLE MiniportAdapterContext, + IN PPNDIS_PACKET PacketArray, + IN UINT NumberOfPackets); + +#if defined(NDIS_WRAPPER) +#define NDIS_COMMON_OPEN_BLOCK_WRAPPER_S \ + ULONG Flags; \ + ULONG References; \ + KSPIN_LOCK SpinLock; \ + NDIS_HANDLE FilterHandle; \ + ULONG ProtocolOptions; \ + USHORT CurrentLookahead; \ + USHORT ConnectDampTicks; \ + USHORT DisconnectDampTicks; \ + W_SEND_HANDLER WSendHandler; \ + W_TRANSFER_DATA_HANDLER WTransferDataHandler; \ + W_SEND_PACKETS_HANDLER WSendPacketsHandler; \ + W_CANCEL_SEND_PACKETS_HANDLER CancelSendPacketsHandler; \ + ULONG WakeUpEnable; \ + PKEVENT CloseCompleteEvent; \ + QUEUED_CLOSE QC; \ + ULONG AfReferences; \ + PNDIS_OPEN_BLOCK NextGlobalOpen; +#else +#define NDIS_COMMON_OPEN_BLOCK_WRAPPER_S +#endif + +#define NDIS_COMMON_OPEN_BLOCK_S \ + PVOID MacHandle; \ + NDIS_HANDLE BindingHandle; \ + PNDIS_MINIPORT_BLOCK MiniportHandle; \ + PNDIS_PROTOCOL_BLOCK ProtocolHandle; \ + NDIS_HANDLE ProtocolBindingContext; \ + PNDIS_OPEN_BLOCK MiniportNextOpen; \ + PNDIS_OPEN_BLOCK ProtocolNextOpen; \ + NDIS_HANDLE MiniportAdapterContext; \ + BOOLEAN Reserved1; \ + BOOLEAN Reserved2; \ + BOOLEAN Reserved3; \ + BOOLEAN Reserved4; \ + PNDIS_STRING BindDeviceName; \ + KSPIN_LOCK Reserved5; \ + PNDIS_STRING RootDeviceName; \ + _ANONYMOUS_UNION union { \ + SEND_HANDLER SendHandler; \ + WAN_SEND_HANDLER WanSendHandler; \ + } DUMMYUNIONNAME; \ + TRANSFER_DATA_HANDLER TransferDataHandler; \ + SEND_COMPLETE_HANDLER SendCompleteHandler; \ + TRANSFER_DATA_COMPLETE_HANDLER TransferDataCompleteHandler; \ + RECEIVE_HANDLER ReceiveHandler; \ + RECEIVE_COMPLETE_HANDLER ReceiveCompleteHandler; \ + WAN_RECEIVE_HANDLER WanReceiveHandler; \ + REQUEST_COMPLETE_HANDLER RequestCompleteHandler; \ + RECEIVE_PACKET_HANDLER ReceivePacketHandler; \ + SEND_PACKETS_HANDLER SendPacketsHandler; \ + RESET_HANDLER ResetHandler; \ + REQUEST_HANDLER RequestHandler; \ + RESET_COMPLETE_HANDLER ResetCompleteHandler; \ + STATUS_HANDLER StatusHandler; \ + STATUS_COMPLETE_HANDLER StatusCompleteHandler; \ + NDIS_COMMON_OPEN_BLOCK_WRAPPER_S + +typedef struct _NDIS_COMMON_OPEN_BLOCK { + NDIS_COMMON_OPEN_BLOCK_S +} NDIS_COMMON_OPEN_BLOCK; + +struct _NDIS_OPEN_BLOCK +{ +#ifdef __cplusplus + NDIS_COMMON_OPEN_BLOCK NdisCommonOpenBlock; +#else + NDIS_COMMON_OPEN_BLOCK_S +#endif +#if defined(NDIS_WRAPPER) + struct _NDIS_OPEN_CO + { + struct _NDIS_CO_AF_BLOCK * NextAf; + W_CO_CREATE_VC_HANDLER MiniportCoCreateVcHandler; + W_CO_REQUEST_HANDLER MiniportCoRequestHandler; + CO_CREATE_VC_HANDLER CoCreateVcHandler; + CO_DELETE_VC_HANDLER CoDeleteVcHandler; + PVOID CmActivateVcCompleteHandler; + PVOID CmDeactivateVcCompleteHandler; + PVOID CoRequestCompleteHandler; + LIST_ENTRY ActiveVcHead; + LIST_ENTRY InactiveVcHead; + LONG PendingAfNotifications; + PKEVENT AfNotifyCompleteEvent; + }; +#endif /* _NDIS_ */ +}; + + + +/* Routines for NDIS miniport drivers */ + +NDISAPI +VOID +DDKAPI +NdisInitializeWrapper( + OUT PNDIS_HANDLE NdisWrapperHandle, + IN PVOID SystemSpecific1, + IN PVOID SystemSpecific2, + IN PVOID SystemSpecific3); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisMAllocateMapRegisters( + IN NDIS_HANDLE MiniportAdapterHandle, + IN UINT DmaChannel, + IN NDIS_DMA_SIZE DmaSize, + IN ULONG PhysicalMapRegistersNeeded, + IN ULONG MaximumPhysicalMapping); + +/* + * VOID + * NdisMArcIndicateReceive( + * IN NDIS_HANDLE MiniportAdapterHandle, + * IN PUCHAR HeaderBuffer, + * IN PUCHAR DataBuffer, + * IN UINT Length); + */ +#define NdisMArcIndicateReceive(MiniportAdapterHandle, \ + HeaderBuffer, \ + DataBuffer, \ + Length) \ +{ \ + ArcFilterDprIndicateReceive( \ + (((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->ArcDB), \ + (HeaderBuffer), \ + (DataBuffer), \ + (Length)); \ +} + +/* + * VOID + * NdisMArcIndicateReceiveComplete( + * IN NDIS_HANDLE MiniportAdapterHandle); + */ +#define NdisMArcIndicateReceiveComplete(MiniportAdapterHandle) \ +{ \ + if (((PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle)->EthDB) \ + { \ + NdisMEthIndicateReceiveComplete(_H); \ + } \ + \ + ArcFilterDprIndicateReceiveComplete( \ + ((PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle)->ArcDB); \ +} + +NDISAPI +VOID +DDKAPI +NdisMCloseLog( + IN NDIS_HANDLE LogHandle); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisMCreateLog( + IN NDIS_HANDLE MiniportAdapterHandle, + IN UINT Size, + OUT PNDIS_HANDLE LogHandle); + +NDISAPI +VOID +DDKAPI +NdisMDeregisterAdapterShutdownHandler( + IN NDIS_HANDLE MiniportHandle); + +NDISAPI +VOID +DDKAPI +NdisMDeregisterInterrupt( + IN PNDIS_MINIPORT_INTERRUPT Interrupt); + +NDISAPI +VOID +DDKAPI +NdisMDeregisterIoPortRange( + IN NDIS_HANDLE MiniportAdapterHandle, + IN UINT InitialPort, + IN UINT NumberOfPorts, + IN PVOID PortOffset); + +/* + * VOID + * NdisMEthIndicateReceive( + * IN NDIS_HANDLE MiniportAdapterHandle, + * IN NDIS_HANDLE MiniportReceiveContext, + * IN PVOID HeaderBuffer, + * IN UINT HeaderBufferSize, + * IN PVOID LookaheadBuffer, + * IN UINT LookaheadBufferSize, + * IN UINT PacketSize); + */ +#define NdisMEthIndicateReceive(MiniportAdapterHandle, \ + MiniportReceiveContext, \ + HeaderBuffer, \ + HeaderBufferSize, \ + LookaheadBuffer, \ + LookaheadBufferSize, \ + PacketSize) \ +{ \ + (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->EthRxIndicateHandler)( \ + ((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->EthDB, \ + (MiniportReceiveContext), \ + (HeaderBuffer), \ + (HeaderBuffer), \ + (HeaderBufferSize), \ + (LookaheadBuffer), \ + (LookaheadBufferSize), \ + (PacketSize)); \ +} + +/* + * VOID + * NdisMEthIndicateReceiveComplete( + * IN NDIS_HANDLE MiniportAdapterHandle); + */ +#define NdisMEthIndicateReceiveComplete(MiniportAdapterHandle) \ +{ \ + (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->EthRxCompleteHandler)( \ + ((PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle)->EthDB); \ +} + +/* + * VOID + * NdisMFddiIndicateReceive( + * IN NDIS_HANDLE MiniportAdapterHandle, + * IN NDIS_HANDLE MiniportReceiveContext, + * IN PVOID HeaderBuffer, + * IN UINT HeaderBufferSize, + * IN PVOID LookaheadBuffer, + * IN UINT LookaheadBufferSize, + * IN UINT PacketSize); + */ +#define NdisMFddiIndicateReceive(MiniportAdapterHandle, \ + MiniportReceiveContext, \ + HeaderBuffer, \ + HeaderBufferSize, \ + LookaheadBuffer, \ + LookaheadBufferSize, \ + PacketSize) \ +{ \ + (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->FddiRxIndicateHandler)( \ + (((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->FddiDB), \ + (MiniportReceiveContext), \ + (PUCHAR)(HeaderBuffer) + 1, \ + (((*(PUCHAR*)(HeaderBuffer)) & 0x40) ? \ + FDDI_LENGTH_OF_LONG_ADDRESS : \ + FDDI_LENGTH_OF_SHORT_ADDRESS), \ + (HeaderBuffer), \ + (HeaderBufferSize), \ + (LookaheadBuffer), \ + (LookaheadBufferSize), \ + (PacketSize)); \ +} + + + +/* + * VOID + * NdisMFddiIndicateReceiveComplete( + * IN NDIS_HANDLE MiniportAdapterHandle); + */ +#define NdisMFddiIndicateReceiveComplete(MiniportAdapterHandle) \ +{ \ + (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->FddiRxCompleteHandler)( \ + ((PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle)->FddiDB); \ +} + +NDISAPI +VOID +DDKAPI +NdisMFlushLog( + IN NDIS_HANDLE LogHandle); + +NDISAPI +VOID +DDKAPI +NdisMFreeMapRegisters( + IN NDIS_HANDLE MiniportAdapterHandle); + +/* + * VOID + * NdisMIndicateStatus( + * IN NDIS_HANDLE MiniportAdapterHandle, + * IN NDIS_STATUS GeneralStatus, + * IN PVOID StatusBuffer, + * IN UINT StatusBufferSize); + */ + +#define NdisMIndicateStatus(MiniportAdapterHandle, \ + GeneralStatus, StatusBuffer, StatusBufferSize) \ + (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->StatusHandler)( \ + MiniportAdapterHandle, GeneralStatus, StatusBuffer, StatusBufferSize) + +/* + * VOID + * NdisMIndicateStatusComplete( + * IN NDIS_HANDLE MiniportAdapterHandle); + */ +#define NdisMIndicateStatusComplete(MiniportAdapterHandle) \ + (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->StatusCompleteHandler)( \ + MiniportAdapterHandle) + +/* + * VOID + * NdisMInitializeWrapper( + * OUT PNDIS_HANDLE NdisWrapperHandle, + * IN PVOID SystemSpecific1, + * IN PVOID SystemSpecific2, + * IN PVOID SystemSpecific3); + */ +#define NdisMInitializeWrapper(NdisWrapperHandle, \ + SystemSpecific1, \ + SystemSpecific2, \ + SystemSpecific3) \ + NdisInitializeWrapper((NdisWrapperHandle), \ + (SystemSpecific1), \ + (SystemSpecific2), \ + (SystemSpecific3)) + +NDISAPI +NDIS_STATUS +DDKAPI +NdisMMapIoSpace( + OUT PVOID *VirtualAddress, + IN NDIS_HANDLE MiniportAdapterHandle, + IN NDIS_PHYSICAL_ADDRESS PhysicalAddress, + IN UINT Length); + +/* + * VOID + * NdisMQueryInformationComplete( + * IN NDIS_HANDLE MiniportAdapterHandle, + * IN NDIS_STATUS Status); + */ +#define NdisMQueryInformationComplete(MiniportAdapterHandle, Status) \ + (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->QueryCompleteHandler)(MiniportAdapterHandle, Status) + +NDISAPI +VOID +DDKAPI +NdisMRegisterAdapterShutdownHandler( + IN NDIS_HANDLE MiniportHandle, + IN PVOID ShutdownContext, + IN ADAPTER_SHUTDOWN_HANDLER ShutdownHandler); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisMRegisterInterrupt( + OUT PNDIS_MINIPORT_INTERRUPT Interrupt, + IN NDIS_HANDLE MiniportAdapterHandle, + IN UINT InterruptVector, + IN UINT InterruptLevel, + IN BOOLEAN RequestIsr, + IN BOOLEAN SharedInterrupt, + IN NDIS_INTERRUPT_MODE InterruptMode); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisMRegisterIoPortRange( + OUT PVOID *PortOffset, + IN NDIS_HANDLE MiniportAdapterHandle, + IN UINT InitialPort, + IN UINT NumberOfPorts); + +NDISAPI +NDIS_STATUS +DDKAPI +NdisMRegisterMiniport( + IN NDIS_HANDLE NdisWrapperHandle, + IN PNDIS_MINIPORT_CHARACTERISTICS MiniportCharacteristics, + IN UINT CharacteristicsLength); + +NDISAPI +VOID +DDKAPI +NdisMSetTimer( + IN PNDIS_MINIPORT_TIMER Timer, + IN UINT MillisecondsToDelay); + +NDISAPI +VOID +DDKAPI +NdisMInitializeTimer( + IN OUT PNDIS_MINIPORT_TIMER Timer, + IN NDIS_HANDLE MiniportAdapterHandle, + IN PNDIS_TIMER_FUNCTION TimerFunction, + IN PVOID FunctionContext); + +NDISAPI +VOID +DDKAPI +NdisMSetPeriodicTimer( + IN PNDIS_MINIPORT_TIMER Timer, + IN UINT MillisecondPeriod); + +NDISAPI +VOID +DDKAPI +NdisMCancelTimer( + IN PNDIS_MINIPORT_TIMER Timer, + OUT PBOOLEAN TimerCancelled); + +#if !defined(NDIS_WRAPPER) + +/* + * VOID + * NdisMResetComplete( + * IN NDIS_HANDLE MiniportAdapterHandle, + * IN NDIS_STATUS Status, + * IN BOOLEAN AddressingReset); + */ +#define NdisMResetComplete(MiniportAdapterHandle, \ + Status, \ + AddressingReset) \ +{ \ + (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->ResetCompleteHandler)( \ + MiniportAdapterHandle, Status, AddressingReset); \ +} + +/* + * VOID + * NdisMSendComplete( + * IN NDIS_HANDLE MiniportAdapterHandle, + * IN PNDIS_PACKET Packet, + * IN NDIS_STATUS Status); + */ +#define NdisMSendComplete(MiniportAdapterHandle, \ + Packet, \ + Status) \ +{ \ + (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->SendCompleteHandler)( \ + MiniportAdapterHandle, Packet, Status); \ +} + +/* + * VOID + * NdisMSendResourcesAvailable( + * IN NDIS_HANDLE MiniportAdapterHandle); + */ +#define NdisMSendResourcesAvailable(MiniportAdapterHandle) \ +{ \ + (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->SendResourcesHandler)( \ + MiniportAdapterHandle); \ +} + +/* + * VOID + * NdisMTransferDataComplete( + * IN NDIS_HANDLE MiniportAdapterHandle, + * IN PNDIS_PACKET Packet, + * IN NDIS_STATUS Status, + * IN UINT BytesTransferred); + */ +#define NdisMTransferDataComplete(MiniportAdapterHandle, \ + Packet, \ + Status, \ + BytesTransferred) \ +{ \ + (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->TDCompleteHandler)( \ + MiniportAdapterHandle, Packet, Status, BytesTransferred) \ +} + +#endif /* !_NDIS_ */ + + +/* + * VOID + * NdisMSetAttributes( + * IN NDIS_HANDLE MiniportAdapterHandle, + * IN NDIS_HANDLE MiniportAdapterContext, + * IN BOOLEAN BusMaster, + * IN NDIS_INTERFACE_TYPE AdapterType); + */ +#define NdisMSetAttributes(MiniportAdapterHandle, \ + MiniportAdapterContext, \ + BusMaster, \ + AdapterType) \ + NdisMSetAttributesEx(MiniportAdapterHandle, \ + MiniportAdapterContext, \ + 0, \ + (BusMaster) ? NDIS_ATTRIBUTE_BUS_MASTER : 0, \ + AdapterType) + +NDISAPI +VOID +DDKAPI +NdisMSetAttributesEx( + IN NDIS_HANDLE MiniportAdapterHandle, + IN NDIS_HANDLE MiniportAdapterContext, + IN UINT CheckForHangTimeInSeconds OPTIONAL, + IN ULONG AttributeFlags, + IN NDIS_INTERFACE_TYPE AdapterType); + +/* + * VOID + * NdisMSetInformationComplete( + * IN NDIS_HANDLE MiniportAdapterHandle, + * IN NDIS_STATUS Status); + */ +#define NdisMSetInformationComplete(MiniportAdapterHandle, \ + Status) \ + (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->SetCompleteHandler)( \ + MiniportAdapterHandle, Status) + +NDISAPI +VOID +DDKAPI +NdisMSleep( + IN ULONG MicrosecondsToSleep); + +NDISAPI +BOOLEAN +DDKAPI +NdisMSynchronizeWithInterrupt( + IN PNDIS_MINIPORT_INTERRUPT Interrupt, + IN PVOID SynchronizeFunction, + IN PVOID SynchronizeContext); + +/* + * VOID + * NdisMTrIndicateReceive( + * IN NDIS_HANDLE MiniportAdapterHandle, + * IN NDIS_HANDLE MiniportReceiveContext, + * IN PVOID HeaderBuffer, + * IN UINT HeaderBufferSize, + * IN PVOID LookaheadBuffer, + * IN UINT LookaheadBufferSize, + * IN UINT PacketSize); + */ +#define NdisMTrIndicateReceive(MiniportAdapterHandle, \ + MiniportReceiveContext, \ + HeaderBuffer, \ + HeaderBufferSize, \ + LookaheadBuffer, \ + LookaheadBufferSize, \ + PacketSize) \ +{ \ + (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->TrRxIndicateHandler)( \ + (((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->TrDB), \ + (MiniportReceiveContext), \ + (HeaderBuffer), \ + (HeaderBuffer), \ + (HeaderBufferSize), \ + (LookaheadBuffer), \ + (LookaheadBufferSize), \ + (PacketSize)); \ +} + +/* + * VOID + * NdisMTrIndicateReceiveComplete( + * IN NDIS_HANDLE MiniportAdapterHandle); + */ +#define NdisMTrIndicateReceiveComplete(MiniportAdapterHandle) \ +{ \ + (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->TrRxCompleteHandler)( \ + ((PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle)->TrDB); \ +} + +NDISAPI +NDIS_STATUS +DDKAPI +NdisMWriteLogData( + IN NDIS_HANDLE LogHandle, + IN PVOID LogBuffer, + IN UINT LogBufferSize); + +NDISAPI +VOID +DDKAPI +NdisMQueryAdapterResources( + OUT PNDIS_STATUS Status, + IN NDIS_HANDLE WrapperConfigurationContext, + OUT PNDIS_RESOURCE_LIST ResourceList, + IN OUT PUINT BufferSize); + +NDISAPI +VOID +DDKAPI +NdisTerminateWrapper( + IN NDIS_HANDLE NdisWrapperHandle, + IN PVOID SystemSpecific); + +NDISAPI +VOID +DDKAPI +NdisMUnmapIoSpace( + IN NDIS_HANDLE MiniportAdapterHandle, + IN PVOID VirtualAddress, + IN UINT Length); + + + +/* Event functions */ + +NDISAPI +VOID +DDKAPI +NdisInitializeEvent( + IN PNDIS_EVENT Event); + +NDISAPI +VOID +DDKAPI +NdisSetEvent( + IN PNDIS_EVENT Event); + +NDISAPI +VOID +DDKAPI +NdisResetEvent( + IN PNDIS_EVENT Event); + +NDISAPI +BOOLEAN +DDKAPI +NdisWaitEvent( + IN PNDIS_EVENT Event, + IN UINT Timeout); + + + +/* NDIS intermediate miniport structures */ + +typedef VOID (DDKAPI *W_MINIPORT_CALLBACK)( + IN NDIS_HANDLE MiniportAdapterContext, + IN PVOID CallbackContext); + + + +/* Routines for intermediate miniport drivers */ + +NDISAPI +NDIS_STATUS +DDKAPI +NdisIMDeInitializeDeviceInstance( + IN NDIS_HANDLE NdisMiniportHandle); + +/* + * NDIS_STATUS + * NdisIMInitializeDeviceInstance( + * IN NDIS_HANDLE DriverHandle, + * IN PNDIS_STRING DeviceInstance); + */ +#define NdisIMInitializeDeviceInstance(DriverHandle, DeviceInstance) \ + NdisIMInitializeDeviceInstanceEx(DriverHandle, DeviceInstance, NULL) + +NDISAPI +NDIS_STATUS +DDKAPI +NdisIMRegisterLayeredMiniport( + IN NDIS_HANDLE NdisWrapperHandle, + IN PNDIS_MINIPORT_CHARACTERISTICS MiniportCharacteristics, + IN UINT CharacteristicsLength, + OUT PNDIS_HANDLE DriverHandle); + + +/* Functions obsoleted by NDIS 5.0 */ + +NDISAPI +VOID +DDKAPI +NdisFreeDmaChannel( + IN PNDIS_HANDLE NdisDmaHandle); + +NDISAPI +VOID +DDKAPI +NdisSetupDmaTransfer( + OUT PNDIS_STATUS Status, + IN PNDIS_HANDLE NdisDmaHandle, + IN PNDIS_BUFFER Buffer, + IN ULONG Offset, + IN ULONG Length, + IN BOOLEAN WriteToDevice); + +NDISAPI +NTSTATUS +DDKAPI +NdisUpcaseUnicodeString( + OUT PUNICODE_STRING DestinationString, + IN PUNICODE_STRING SourceString); + + +/* Routines for NDIS protocol drivers */ + +NDISAPI +VOID +DDKAPI +NdisRequest( + OUT PNDIS_STATUS Status, + IN NDIS_HANDLE NdisBindingHandle, + IN PNDIS_REQUEST NdisRequest); + +NDISAPI +VOID +DDKAPI +NdisReset( + OUT PNDIS_STATUS Status, + IN NDIS_HANDLE NdisBindingHandle); + +NDISAPI +VOID +DDKAPI +NdisSend( + OUT PNDIS_STATUS Status, + IN NDIS_HANDLE NdisBindingHandle, + IN PNDIS_PACKET Packet); + +NDISAPI +VOID +DDKAPI +NdisSendPackets( + IN NDIS_HANDLE NdisBindingHandle, + IN PPNDIS_PACKET PacketArray, + IN UINT NumberOfPackets); + +NDISAPI +VOID +DDKAPI +NdisTransferData( + OUT PNDIS_STATUS Status, + IN NDIS_HANDLE NdisBindingHandle, + IN NDIS_HANDLE MacReceiveContext, + IN UINT ByteOffset, + IN UINT BytesToTransfer, + IN OUT PNDIS_PACKET Packet, + OUT PUINT BytesTransferred); + +NDISAPI +VOID +DDKAPI +NdisCloseAdapter( + OUT PNDIS_STATUS Status, + IN NDIS_HANDLE NdisBindingHandle); + +NDISAPI +VOID +DDKAPI +NdisCompleteBindAdapter( + IN NDIS_HANDLE BindAdapterContext, + IN NDIS_STATUS Status, + IN NDIS_STATUS OpenStatus); + +NDISAPI +VOID +DDKAPI +NdisCompleteUnbindAdapter( + IN NDIS_HANDLE UnbindAdapterContext, + IN NDIS_STATUS Status); + +NDISAPI +VOID +DDKAPI +NdisDeregisterProtocol( + OUT PNDIS_STATUS Status, + IN NDIS_HANDLE NdisProtocolHandle); + +NDISAPI +VOID +DDKAPI +NdisOpenAdapter( + OUT PNDIS_STATUS Status, + OUT PNDIS_STATUS OpenErrorStatus, + OUT PNDIS_HANDLE NdisBindingHandle, + OUT PUINT SelectedMediumIndex, + IN PNDIS_MEDIUM MediumArray, + IN UINT MediumArraySize, + IN NDIS_HANDLE NdisProtocolHandle, + IN NDIS_HANDLE ProtocolBindingContext, + IN PNDIS_STRING AdapterName, + IN UINT OpenOptions, + IN PSTRING AddressingInformation); + +NDISAPI +VOID +DDKAPI +NdisOpenProtocolConfiguration( + OUT PNDIS_STATUS Status, + OUT PNDIS_HANDLE ConfigurationHandle, + IN PNDIS_STRING ProtocolSection); + +NDISAPI +VOID +DDKAPI +NdisRegisterProtocol( + OUT PNDIS_STATUS Status, + OUT PNDIS_HANDLE NdisProtocolHandle, + IN PNDIS_PROTOCOL_CHARACTERISTICS ProtocolCharacteristics, + IN UINT CharacteristicsLength); + +/* Obsoleted in Windows XP */ + +/* Prototypes for NDIS_MAC_CHARACTERISTICS */ + +typedef NDIS_STATUS (*OPEN_ADAPTER_HANDLER)( + OUT PNDIS_STATUS OpenErrorStatus, + OUT NDIS_HANDLE *MacBindingHandle, + OUT PUINT SelectedMediumIndex, + IN PNDIS_MEDIUM MediumArray, + IN UINT MediumArraySize, + IN NDIS_HANDLE NdisBindingContext, + IN NDIS_HANDLE MacAdapterContext, + IN UINT OpenOptions, + IN PSTRING AddressingInformation OPTIONAL); + +typedef NDIS_STATUS (DDKAPI *CLOSE_ADAPTER_HANDLER)( + IN NDIS_HANDLE MacBindingHandle); + +typedef NDIS_STATUS (DDKAPI *WAN_TRANSFER_DATA_HANDLER)( + VOID); + +typedef NDIS_STATUS (DDKAPI *QUERY_GLOBAL_STATISTICS_HANDLER)( + IN NDIS_HANDLE MacAdapterContext, + IN PNDIS_REQUEST NdisRequest); + +typedef VOID (DDKAPI *UNLOAD_MAC_HANDLER)( + IN NDIS_HANDLE MacMacContext); + +typedef NDIS_STATUS (DDKAPI *ADD_ADAPTER_HANDLER)( + IN NDIS_HANDLE MacMacContext, + IN NDIS_HANDLE WrapperConfigurationContext, + IN PNDIS_STRING AdapterName); + +typedef VOID (*REMOVE_ADAPTER_HANDLER)( + IN NDIS_HANDLE MacAdapterContext); + +typedef struct _NDIS_MAC_CHARACTERISTICS { + UCHAR MajorNdisVersion; + UCHAR MinorNdisVersion; + USHORT Filler; + UINT Reserved; + OPEN_ADAPTER_HANDLER OpenAdapterHandler; + CLOSE_ADAPTER_HANDLER CloseAdapterHandler; + SEND_HANDLER SendHandler; + TRANSFER_DATA_HANDLER TransferDataHandler; + RESET_HANDLER ResetHandler; + REQUEST_HANDLER RequestHandler; + QUERY_GLOBAL_STATISTICS_HANDLER QueryGlobalStatisticsHandler; + UNLOAD_MAC_HANDLER UnloadMacHandler; + ADD_ADAPTER_HANDLER AddAdapterHandler; + REMOVE_ADAPTER_HANDLER RemoveAdapterHandler; + NDIS_STRING Name; +} NDIS_MAC_CHARACTERISTICS, *PNDIS_MAC_CHARACTERISTICS; + +typedef NDIS_MAC_CHARACTERISTICS NDIS_WAN_MAC_CHARACTERISTICS; +typedef NDIS_WAN_MAC_CHARACTERISTICS *PNDIS_WAN_MAC_CHARACTERISTICS; + +#ifdef __cplusplus +} +#endif + +#endif /* __NDIS_H */ + +/* EOF */ diff --git a/reactos/include/ddk/ndisguid.h b/reactos/include/ddk/ndisguid.h new file mode 100644 index 00000000000..27b8777bfb5 --- /dev/null +++ b/reactos/include/ddk/ndisguid.h @@ -0,0 +1,439 @@ +/* + * ndisguid.h + * + * GUIDs for NDIS drivers + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __NDISGUID_H +#define __NDISGUID_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +DEFINE_GUID(GUID_NDIS_LAN_CLASS, + 0xad498944, 0x762f, 0x11d0, 0x8d, 0xcb, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_ENUMERATE_ADAPTER, + 0x981f2d7f, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_ENUMERATE_VC, + 0x981f2d82, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_NOTIFY_ADAPTER_ARRIVAL, + 0x981f2d81, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_NOTIFY_ADAPTER_REMOVAL, + 0x981f2d80, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_NOTIFY_VC_ARRIVAL, + 0x182f9e0c, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_NOTIFY_VC_REMOVAL, + 0x981f2d79, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_NOTIFY_BIND, + 0x5413531c, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_NOTIFY_UNBIND, + 0x6e3ce1ec, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_WAKE_ON_MAGIC_PACKET_ONLY, + 0xa14f1c97, 0x8839, 0x4f8a, 0x99, 0x96, 0xa2, 0x89, 0x96, 0xeb, 0xbf, 0x1d); + + +DEFINE_GUID(GUID_NDIS_802_3_CURRENT_ADDRESS, + 0x44795700, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_802_3_MAC_OPTIONS, + 0x44795703, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_802_3_MAXIMUM_LIST_SIZE, + 0x44795702, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_802_3_MULTICAST_LIST, + 0x44795701, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_802_3_PERMANENT_ADDRESS, + 0x447956ff, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_802_3_RCV_ERROR_ALIGNMENT, + 0x44795704, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_802_3_XMIT_MORE_COLLISIONS, + 0x44795706, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_802_3_XMIT_ONE_COLLISION, + 0x44795705, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_802_5_CURRENT_ADDRESS, + 0x44795708, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_802_5_CURRENT_FUNCTIONAL, + 0x44795709, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_802_5_CURRENT_GROUP, + 0x4479570a, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_802_5_CURRENT_RING_STATE, + 0xacf14032, 0xa61c, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_802_5_CURRENT_RING_STATUS, + 0x890a36ec, 0xa61c, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_802_5_LAST_OPEN_STATUS, + 0x4479570b, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_802_5_PERMANENT_ADDRESS, + 0x44795707, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_802_5_LINE_ERRORS, + 0xacf14033, 0xa61c, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_802_5_LOST_FRAMES, + 0xacf14034, 0xa61c, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + + +DEFINE_GUID(GUID_NDIS_802_11_ADD_WEP, + 0x4307bff0, 0x2129, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); + +DEFINE_GUID(GUID_NDIS_802_11_AUTHENTICATION_MODE, + 0x43920a24, 0x2129, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); + +DEFINE_GUID(GUID_NDIS_802_11_BSSID, + 0x2504b6c2, 0x1fa5, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); + +DEFINE_GUID(GUID_NDIS_802_11_BSSID_LIST, + 0x69526f9a, 0x2062, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); + +DEFINE_GUID(GUID_NDIS_802_11_BASIC_RATES, + 0x4a198516, 0x2068, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); + +DEFINE_GUID(GUID_NDIS_802_11_CONFIGURATION, + 0x4a4df982, 0x2068, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); + +DEFINE_GUID(GUID_NDIS_802_11_DESIRED_RATES, + 0x452ee08e, 0x2536, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); + +DEFINE_GUID(GUID_NDIS_802_11_DISASSOCIATE, + 0x43671f40, 0x2129, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); + +DEFINE_GUID(GUID_NDIS_802_11_FRAGMENTATION_THRESHOLD, + 0x69aaa7c4, 0x2062, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); + +DEFINE_GUID(GUID_NDIS_802_11_INFRASTRUCTURE_MODE, + 0x697d5a7e, 0x2062, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); + +DEFINE_GUID(GUID_NDIS_802_11_NETWORK_TYPES_SUPPORTED, + 0x8531d6e6, 0x2041, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); + +DEFINE_GUID(GUID_NDIS_802_11_NETWORK_TYPE_IN_USE, + 0x857e2326, 0x2041, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); + +DEFINE_GUID(GUID_NDIS_802_11_NUMBER_OF_ANTENNAS, + 0x01779336, 0x2064, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); + +DEFINE_GUID(GUID_NDIS_802_11_POWER_MODE, + 0x85be837c, 0x2041, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); + +DEFINE_GUID(GUID_NDIS_802_11_RATES_SUPPORTED, + 0x49db8722, 0x2068, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); + +DEFINE_GUID(GUID_NDIS_802_11_REMOVE_WEP, + 0x433c345c, 0x2129, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); + +DEFINE_GUID(GUID_NDIS_802_11_PRIVACY_FILTER, + 0x6733c4e9, 0x4792, 0x11d4, 0x97, 0xf1, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); + +DEFINE_GUID(GUID_NDIS_802_11_RSSI, + 0x1507db16, 0x2053, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); + +DEFINE_GUID(GUID_NDIS_802_11_RSSI_TRIGGER, + 0x155689b8, 0x2053, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); + +DEFINE_GUID(GUID_NDIS_802_11_RTS_THRESHOLD, + 0x0134d07e, 0x2064, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); + +DEFINE_GUID(GUID_NDIS_802_11_RX_ANTENNA_SELECTED, + 0x01ac07a2, 0x2064, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); + +DEFINE_GUID(GUID_NDIS_802_11_SSID, + 0x7d2a90ea, 0x2041, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); + +DEFINE_GUID(GUID_NDIS_802_11_STATISTICS, + 0x42bb73b0, 0x2129, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); + +DEFINE_GUID(GUID_NDIS_802_11_TX_POWER_LEVEL, + 0x11e6ba76, 0x2053, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); + +DEFINE_GUID(GUID_NDIS_802_11_TX_ANTENNA_SELECTED, + 0x01dbb74a, 0x2064, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); + + +DEFINE_GUID(GUID_NDIS_ATM_HW_CURRENT_ADDRESS, + 0x791ad1a1, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_ATM_MAX_AAL0_PACKET_SIZE, + 0x791ad1a5, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_ATM_MAX_AAL1_PACKET_SIZE, + 0x791ad1a6, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_ATM_MAX_AAL34_PACKET_SIZE, + 0x791ad1a7, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_ATM_MAX_AAL5_PACKET_SIZE, + 0x791ad191, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_ATM_MAX_ACTIVE_VCI_BITS, + 0x791ad1a3, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_ATM_MAX_ACTIVE_VCS, + 0x791ad1a2, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_ATM_MAX_ACTIVE_VPI_BITS, + 0x791ad1a4, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_ATM_SUPPORTED_AAL_TYPES, + 0x791ad1a0, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_ATM_SUPPORTED_SERVICE_CATEGORY, + 0x791ad19f, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_ATM_SUPPORTED_VC_RATES, + 0x791ad19e, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + + +DEFINE_GUID(GUID_NDIS_ATM_RCV_CELLS_DROPPED, + 0x0a21480c, 0xe35f, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_ATM_RCV_CELLS_OK, + 0x0a21480a, 0xe35f, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_ATM_XMIT_CELLS_OK, + 0x0a21480b, 0xe35f, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + + +DEFINE_GUID(GUID_NDIS_FDDI_LONG_CURRENT_ADDR, + 0xacf14036, 0xa61c, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_FDDI_LONG_MAX_LIST_SIZE, + 0xacf14038, 0xa61c, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_FDDI_LONG_MULTICAST_LIST, + 0xacf14037, 0xa61c, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_FDDI_LONG_PERMANENT_ADDR, + 0xacf14035, 0xa61c, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_FDDI_SHORT_CURRENT_ADDR, + 0xacf1403a, 0xa61c, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_FDDI_SHORT_MAX_LIST_SIZE, + 0xacf1403c, 0xa61c, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_FDDI_SHORT_MULTICAST_LIST, + 0xacf1403b, 0xa61c, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_FDDI_SHORT_PERMANENT_ADDR, + 0xacf14039, 0xa61c, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + + +DEFINE_GUID(GUID_NDIS_FDDI_ATTACHMENT_TYPE, + 0xacf1403d, 0xa61c, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_FDDI_DOWNSTREAM_NODE_LONG, + 0xacf1403f, 0xa61c, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_FDDI_FRAME_ERRORS, + 0xacf14040, 0xa61c, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_FDDI_FRAMES_LOST, + 0xacf14041, 0xa61c, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_FDDI_LCT_FAILURES, + 0xacf14043, 0xa61c, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_FDDI_LCONNECTION_STATE, + 0xacf14045, 0xa61c, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_FDDI_LEM_REJECTS, + 0xacf14044, 0xa61c, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_FDDI_RING_MGT_STATE, + 0xacf14042, 0xa61c, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_FDDI_UPSTREAM_NODE_LONG, + 0xacf1403e, 0xa61c, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + + +DEFINE_GUID(GUID_NDIS_GEN_CURRENT_LOOKAHEAD, + 0x5ec10361, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_CURRENT_PACKET_FILTER, + 0x5ec10360, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_DRIVER_VERSION, + 0x5ec10362, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_HARDWARE_STATUS, + 0x5ec10354, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_MEDIA_IN_USE, + 0x5ec10356, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_MEDIA_SUPPORTED, + 0x5ec10355, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_LINK_SPEED, + 0x5ec10359, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_MAC_OPTIONS, + 0x5ec10365, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_MAXIMUM_LOOKAHEAD, + 0x5ec10357, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_MAXIMUM_FRAME_SIZE, + 0x5ec10358, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_MAXIMUM_SEND_PACKETS, + 0x5ec10367, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_MAXIMUM_TOTAL_SIZE, + 0x5ec10363, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_MEDIA_CONNECT_STATUS, + 0x5ec10366, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_RECEIVE_BLOCK_SIZE, + 0x5ec1035d, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_RECEIVE_BUFFER_SPACE, + 0x5ec1035b, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_TRANSMIT_BUFFER_SPACE, + 0x5ec1035a, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_TRANSMIT_BLOCK_SIZE, + 0x5ec1035c, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_VENDOR_DESCRIPTION, + 0x5ec1035f, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_VENDOR_DRIVER_VERSION, + 0x447956f9, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_VENDOR_ID, + 0x5ec1035e, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + + +DEFINE_GUID(GUID_NDIS_GEN_RCV_ERROR, + 0x447956fd, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_RCV_NO_BUFFER, + 0x447956fe, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_RCV_OK, + 0x447956fb, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_XMIT_ERROR, + 0x447956fc, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_XMIT_OK, + 0x447956fa, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + + +DEFINE_GUID(GUID_NDIS_GEN_CO_DRIVER_VERSION, + 0x791ad198, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_CO_HARDWARE_STATUS, + 0x791ad192, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_CO_LINK_SPEED, + 0x791ad195, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_CO_MAC_OPTIONS, + 0x791ad19a, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_CO_MEDIA_SUPPORTED, + 0x791ad193, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_CO_MEDIA_IN_USE, + 0x791ad194, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_CO_MEDIA_CONNECT_STATUS, + 0x791ad19b, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_CO_MINIMUM_LINK_SPEED, + 0x791ad19d, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_CO_VENDOR_DESCRIPTION, + 0x791ad197, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_CO_VENDOR_DRIVER_VERSION, + 0x791ad19c, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_CO_VENDOR_ID, + 0x791ad196, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + + +DEFINE_GUID(GUID_NDIS_GEN_CO_RCV_PDUS_ERROR, + 0x0a214808, 0xe35f, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_CO_RCV_PDUS_OK, + 0x0a214806, 0xe35f, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_CO_RCV_PDUS_NO_BUFFER, + 0x0a214809, 0xe35f, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_CO_XMIT_PDUS_ERROR, + 0x0a214807, 0xe35f, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_GEN_CO_XMIT_PDUS_OK, + 0x0a214805, 0xe35f, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + + +DEFINE_GUID(GUID_NDIS_STATUS_LINK_SPEED_CHANGE, + 0x981f2d85, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_STATUS_MEDIA_CONNECT, + 0x981f2d7d, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_STATUS_MEDIA_DISCONNECT, + 0x981f2d7e, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_STATUS_MEDIA_SPECIFIC_INDICATION, + 0x981f2d84, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_STATUS_RESET_END, + 0x981f2d77, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +DEFINE_GUID(GUID_NDIS_STATUS_RESET_START, + 0x981f2d76, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); + +#ifdef __cplusplus +} +#endif + +#endif /* __NDISGUID_H */ diff --git a/reactos/include/ddk/ndistapi.h b/reactos/include/ddk/ndistapi.h new file mode 100644 index 00000000000..09aa3d03ef4 --- /dev/null +++ b/reactos/include/ddk/ndistapi.h @@ -0,0 +1,1308 @@ +/* + * ndistapi.h + * + * NDIS Telephony API + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __NDISTAPI_H +#define __NDISTAPI_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include "ndis.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef NDIS_TAPI_CURRENT_VERSION +#define NDIS_TAPI_CURRENT_VERSION 0x00010003 +#endif + +typedef ULONG_PTR HTAPI_LINE; +typedef ULONG_PTR HDRV_LINE; +typedef ULONG_PTR HTAPI_CALL; +typedef ULONG_PTR HDRV_CALL; + +#define NDIS_STATUS_TAPI_ADDRESSBLOCKED ((NDIS_STATUS)0xC0012000L) +#define NDIS_STATUS_TAPI_BEARERMODEUNAVAIL ((NDIS_STATUS)0xC0012001L) +#define NDIS_STATUS_TAPI_CALLUNAVAIL ((NDIS_STATUS)0xC0012002L) +#define NDIS_STATUS_TAPI_DIALBILLING ((NDIS_STATUS)0xC0012003L) +#define NDIS_STATUS_TAPI_DIALDIALTONE ((NDIS_STATUS)0xC0012004L) +#define NDIS_STATUS_TAPI_DIALPROMPT ((NDIS_STATUS)0xC0012005L) +#define NDIS_STATUS_TAPI_DIALQUIET ((NDIS_STATUS)0xC0012006L) +#define NDIS_STATUS_TAPI_INCOMPATIBLEEXTVERSION ((NDIS_STATUS)0xC0012007L) +#define NDIS_STATUS_TAPI_INUSE ((NDIS_STATUS)0xC0012008L) +#define NDIS_STATUS_TAPI_INVALADDRESS ((NDIS_STATUS)0xC0012009L) +#define NDIS_STATUS_TAPI_INVALADDRESSID ((NDIS_STATUS)0xC001200AL) +#define NDIS_STATUS_TAPI_INVALADDRESSMODE ((NDIS_STATUS)0xC001200BL) +#define NDIS_STATUS_TAPI_INVALBEARERMODE ((NDIS_STATUS)0xC001200CL) +#define NDIS_STATUS_TAPI_INVALCALLHANDLE ((NDIS_STATUS)0xC001200DL) +#define NDIS_STATUS_TAPI_INVALCALLPARAMS ((NDIS_STATUS)0xC001200EL) +#define NDIS_STATUS_TAPI_INVALCALLSTATE ((NDIS_STATUS)0xC001200FL) +#define NDIS_STATUS_TAPI_INVALDEVICECLASS ((NDIS_STATUS)0xC0012010L) +#define NDIS_STATUS_TAPI_INVALLINEHANDLE ((NDIS_STATUS)0xC0012011L) +#define NDIS_STATUS_TAPI_INVALLINESTATE ((NDIS_STATUS)0xC0012012L) +#define NDIS_STATUS_TAPI_INVALMEDIAMODE ((NDIS_STATUS)0xC0012013L) +#define NDIS_STATUS_TAPI_INVALRATE ((NDIS_STATUS)0xC0012014L) +#define NDIS_STATUS_TAPI_NODRIVER ((NDIS_STATUS)0xC0012015L) +#define NDIS_STATUS_TAPI_OPERATIONUNAVAIL ((NDIS_STATUS)0xC0012016L) +#define NDIS_STATUS_TAPI_RATEUNAVAIL ((NDIS_STATUS)0xC0012017L) +#define NDIS_STATUS_TAPI_RESOURCEUNAVAIL ((NDIS_STATUS)0xC0012018L) +#define NDIS_STATUS_TAPI_STRUCTURETOOSMALL ((NDIS_STATUS)0xC0012019L) +#define NDIS_STATUS_TAPI_USERUSERINFOTOOBIG ((NDIS_STATUS)0xC001201AL) +#define NDIS_STATUS_TAPI_ALLOCATED ((NDIS_STATUS)0xC001201BL) +#define NDIS_STATUS_TAPI_INVALADDRESSSTATE ((NDIS_STATUS)0xC001201CL) +#define NDIS_STATUS_TAPI_INVALPARAM ((NDIS_STATUS)0xC001201DL) +#define NDIS_STATUS_TAPI_NODEVICE ((NDIS_STATUS)0xC001201EL) +#define NDIS_STATUS_TAPI_DISCONNECTMODE_NORMAL ((NDIS_STATUS)0xC0012020L) +#define NDIS_STATUS_TAPI_DISCONNECTMODE_UNKNOWN ((NDIS_STATUS)0xC0012021L) +#define NDIS_STATUS_TAPI_DISCONNECTMODE_REJECT ((NDIS_STATUS)0xC0012022L) +#define NDIS_STATUS_TAPI_DISCONNECTMODE_PICKUP ((NDIS_STATUS)0xC0012023L) +#define NDIS_STATUS_TAPI_DISCONNECTMODE_FORWARDED ((NDIS_STATUS)0xC0012024L) +#define NDIS_STATUS_TAPI_DISCONNECTMODE_BUSY ((NDIS_STATUS)0xC0012025L) +#define NDIS_STATUS_TAPI_DISCONNECTMODE_NOANSWER ((NDIS_STATUS)0xC0012026L) +#define NDIS_STATUS_TAPI_DISCONNECTMODE_BADADDRESS ((NDIS_STATUS)0xC0012027L) +#define NDIS_STATUS_TAPI_DISCONNECTMODE_UNREACHABLE ((NDIS_STATUS)0xC0012028L) +#define NDIS_STATUS_TAPI_DISCONNECTMODE_CONGESTION ((NDIS_STATUS)0xC0012029L) +#define NDIS_STATUS_TAPI_DISCONNECTMODE_INCOMPATIBLE ((NDIS_STATUS)0xC001202AL) +#define NDIS_STATUS_TAPI_DISCONNECTMODE_UNAVAIL ((NDIS_STATUS)0xC001202BL) +#define NDIS_STATUS_TAPI_RECV_DIGIT ((NDIS_STATUS)0x40010020L) + +#define LINE_ADDRESSSTATE 0L +#define LINE_CALLINFO 1L +#define LINE_CALLSTATE 2L +#define LINE_CLOSE 3L +#define LINE_DEVSPECIFIC 4L +#define LINE_DEVSPECIFICFEATURE 5L +#define LINE_GATHERDIGITS 6L +#define LINE_GENERATE 7L +#define LINE_LINEDEVSTATE 8L +#define LINE_MONITORDIGITS 9L +#define LINE_MONITORMEDIA 10L +#define LINE_MONITORTONE 11L +#define LINE_REPLY 12L +#define LINE_REQUEST 13L +#define LINE_CREATE 19L +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) +#define LINE_AGENTSPECIFIC 21L +#define LINE_AGENTSTATUS 22L +#define LINE_APPNEWCALL 23L +#define LINE_PROXYREQUEST 24L +#define LINE_REMOVE 25L +#endif +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020002) +#define LINE_AGENTSESSIONSTATUS 27L +#define LINE_QUEUESTATUS 28L +#define LINE_AGENTSTATUSEX 29L +#define LINE_GROUPSTATUS 30L +#define LINE_PROXYSTATUS 31L +#endif +#if (TAPI_CURRENT_VERSION >= 0x00030000) +#define LINE_APPNEWCALLHUB 32L +#define LINE_CALLHUBCLOSE 33L +#define LINE_DEVSPECIFICEX 34L +#endif + +#define TSPI_MESSAGE_BASE 500L +#define LINE_NEWCALL TSPI_MESSAGE_BASE +#define LINE_CALLDEVSPECIFIC (TSPI_MESSAGE_BASE + 1L) +#define STRINGFORMAT_ASCII 0x00000001 +#define STRINGFORMAT_DBCS 0x00000002 +#define STRINGFORMAT_UNICODE 0x00000003 +#define STRINGFORMAT_BINARY 0x00000004 + +#define LINEADDRCAPFLAGS_FWDNUMRINGS 0x00000001 +#define LINEADDRCAPFLAGS_PICKUPGROUPID 0x00000002 +#define LINEADDRCAPFLAGS_SECURE 0x00000004 +#define LINEADDRCAPFLAGS_BLOCKIDDEFAULT 0x00000008 +#define LINEADDRCAPFLAGS_BLOCKIDOVERRIDE 0x00000010 +#define LINEADDRCAPFLAGS_DIALED 0x00000020 +#define LINEADDRCAPFLAGS_ORIGOFFHOOK 0x00000040 +#define LINEADDRCAPFLAGS_DESTOFFHOOK 0x00000080 +#define LINEADDRCAPFLAGS_FWDCONSULT 0x00000100 +#define LINEADDRCAPFLAGS_SETUPCONFNULL 0x00000200 +#define LINEADDRCAPFLAGS_AUTORECONNECT 0x00000400 +#define LINEADDRCAPFLAGS_COMPLETIONID 0x00000800 +#define LINEADDRCAPFLAGS_TRANSFERHELD 0x00001000 +#define LINEADDRCAPFLAGS_TRANSFERMAKE 0x00002000 +#define LINEADDRCAPFLAGS_CONFERENCEHELD 0x00004000 +#define LINEADDRCAPFLAGS_CONFERENCEMAKE 0x00008000 +#define LINEADDRCAPFLAGS_PARTIALDIAL 0x00010000 +#define LINEADDRCAPFLAGS_FWDSTATUSVALID 0x00020000 +#define LINEADDRCAPFLAGS_FWDINTEXTADDR 0x00040000 +#define LINEADDRCAPFLAGS_FWDBUSYNAADDR 0x00080000 +#define LINEADDRCAPFLAGS_ACCEPTTOALERT 0x00100000 +#define LINEADDRCAPFLAGS_CONFDROP 0x00200000 +#define LINEADDRCAPFLAGS_PICKUPCALLWAIT 0x00400000 +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) +#define LINEADDRCAPFLAGS_PREDICTIVEDIALER 0x00800000 +#define LINEADDRCAPFLAGS_QUEUE 0x01000000 +#define LINEADDRCAPFLAGS_ROUTEPOINT 0x02000000 +#define LINEADDRCAPFLAGS_HOLDMAKESNEW 0x04000000 +#define LINEADDRCAPFLAGS_NOINTERNALCALLS 0x08000000 +#define LINEADDRCAPFLAGS_NOEXTERNALCALLS 0x10000000 +#define LINEADDRCAPFLAGS_SETCALLINGID 0x20000000 +#endif +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00030000) +#define LINEADDRCAPFLAGS_ACDGROUP 0x40000000 +#define LINEADDRCAPFLAGS_NOPSTNADDRESSTRANSLATION \ + 0x80000000 +#endif + +#define LINEADDRESSMODE_ADDRESSID 0x00000001 +#define LINEADDRESSMODE_DIALABLEADDR 0x00000002 +#define LINEADDRESSSHARING_PRIVATE 0x00000001 +#define LINEADDRESSSHARING_BRIDGEDEXCL 0x00000002 +#define LINEADDRESSSHARING_BRIDGEDNEW 0x00000004 +#define LINEADDRESSSHARING_BRIDGEDSHARED 0x00000008 +#define LINEADDRESSSHARING_MONITORED 0x00000010 +#define LINEADDRESSSTATE_OTHER 0x00000001 +#define LINEADDRESSSTATE_DEVSPECIFIC 0x00000002 +#define LINEADDRESSSTATE_INUSEZERO 0x00000004 +#define LINEADDRESSSTATE_INUSEONE 0x00000008 +#define LINEADDRESSSTATE_INUSEMANY 0x00000010 +#define LINEADDRESSSTATE_NUMCALLS 0x00000020 +#define LINEADDRESSSTATE_FORWARD 0x00000040 +#define LINEADDRESSSTATE_TERMINALS 0x00000080 + +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00030000) +#define LINEADDRESSTYPE_PHONENUMBER 0x00000001 +#define LINEADDRESSTYPE_SDP 0x00000002 +#define LINEADDRESSTYPE_EMAILNAME 0x00000004 +#define LINEADDRESSTYPE_DOMAINNAME 0x00000008 +#define LINEADDRESSTYPE_IPADDRESS 0x00000010 +#endif + +#define LINEADDRFEATURE_FORWARD 0x00000001 +#define LINEADDRFEATURE_MAKECALL 0x00000002 +#define LINEADDRFEATURE_PICKUP 0x00000004 +#define LINEADDRFEATURE_SETMEDIACONTROL 0x00000008 +#define LINEADDRFEATURE_SETTERMINAL 0x00000010 +#define LINEADDRFEATURE_SETUPCONF 0x00000020 +#define LINEADDRFEATURE_UNCOMPLETECALL 0x00000040 +#define LINEADDRFEATURE_UNPARK 0x00000080 +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) +#define LINEADDRFEATURE_PICKUPHELD 0x00000100 +#define LINEADDRFEATURE_PICKUPGROUP 0x00000200 +#define LINEADDRFEATURE_PICKUPDIRECT 0x00000400 +#define LINEADDRFEATURE_PICKUPWAITING 0x00000800 +#define LINEADDRFEATURE_FORWARDFWD 0x00001000 +#define LINEADDRFEATURE_FORWARDDND 0x00002000 +#endif + +#define LINEANSWERMODE_NONE 0x00000001 +#define LINEANSWERMODE_DROP 0x00000002 +#define LINEANSWERMODE_HOLD 0x00000004 + +#define LINEBEARERMODE_VOICE 0x00000001 +#define LINEBEARERMODE_SPEECH 0x00000002 +#define LINEBEARERMODE_MULTIUSE 0x00000004 +#define LINEBEARERMODE_DATA 0x00000008 +#define LINEBEARERMODE_ALTSPEECHDATA 0x00000010 +#define LINEBEARERMODE_NONCALLSIGNALING 0x00000020 +#define LINEBEARERMODE_PASSTHROUGH 0x00000040 +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) +#define LINEBEARERMODE_RESTRICTEDDATA 0x00000080 +#endif + +#define LINEBUSYMODE_STATION 0x00000001 +#define LINEBUSYMODE_TRUNK 0x00000002 +#define LINEBUSYMODE_UNKNOWN 0x00000004 +#define LINEBUSYMODE_UNAVAIL 0x00000008 + +#define LINECALLCOMPLCOND_BUSY 0x00000001 +#define LINECALLCOMPLCOND_NOANSWER 0x00000002 + +#define LINECALLCOMPLMODE_CAMPON 0x00000001 +#define LINECALLCOMPLMODE_CALLBACK 0x00000002 +#define LINECALLCOMPLMODE_INTRUDE 0x00000004 +#define LINECALLCOMPLMODE_MESSAGE 0x00000008 + +#define LINECALLFEATURE_ACCEPT 0x00000001 +#define LINECALLFEATURE_ADDTOCONF 0x00000002 +#define LINECALLFEATURE_ANSWER 0x00000004 +#define LINECALLFEATURE_BLINDTRANSFER 0x00000008 +#define LINECALLFEATURE_COMPLETECALL 0x00000010 +#define LINECALLFEATURE_COMPLETETRANSF 0x00000020 +#define LINECALLFEATURE_DIAL 0x00000040 +#define LINECALLFEATURE_DROP 0x00000080 +#define LINECALLFEATURE_GATHERDIGITS 0x00000100 +#define LINECALLFEATURE_GENERATEDIGITS 0x00000200 +#define LINECALLFEATURE_GENERATETONE 0x00000400 +#define LINECALLFEATURE_HOLD 0x00000800 +#define LINECALLFEATURE_MONITORDIGITS 0x00001000 +#define LINECALLFEATURE_MONITORMEDIA 0x00002000 +#define LINECALLFEATURE_MONITORTONES 0x00004000 +#define LINECALLFEATURE_PARK 0x00008000 +#define LINECALLFEATURE_PREPAREADDCONF 0x00010000 +#define LINECALLFEATURE_REDIRECT 0x00020000 +#define LINECALLFEATURE_REMOVEFROMCONF 0x00040000 +#define LINECALLFEATURE_SECURECALL 0x00080000 +#define LINECALLFEATURE_SENDUSERUSER 0x00100000 +#define LINECALLFEATURE_SETCALLPARAMS 0x00200000 +#define LINECALLFEATURE_SETMEDIACONTROL 0x00400000 +#define LINECALLFEATURE_SETTERMINAL 0x00800000 +#define LINECALLFEATURE_SETUPCONF 0x01000000 +#define LINECALLFEATURE_SETUPTRANSFER 0x02000000 +#define LINECALLFEATURE_SWAPHOLD 0x04000000 +#define LINECALLFEATURE_UNHOLD 0x08000000 +#define LINECALLFEATURE_RELEASEUSERUSERINFO \ + 0x10000000 +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) +#define LINECALLFEATURE_SETTREATMENT 0x20000000 +#define LINECALLFEATURE_SETQOS 0x40000000 +#define LINECALLFEATURE_SETCALLDATA 0x80000000 +#endif + +#define LINECALLINFOSTATE_OTHER 0x00000001 +#define LINECALLINFOSTATE_DEVSPECIFIC 0x00000002 +#define LINECALLINFOSTATE_BEARERMODE 0x00000004 +#define LINECALLINFOSTATE_RATE 0x00000008 +#define LINECALLINFOSTATE_MEDIAMODE 0x00000010 +#define LINECALLINFOSTATE_APPSPECIFIC 0x00000020 +#define LINECALLINFOSTATE_CALLID 0x00000040 +#define LINECALLINFOSTATE_RELATEDCALLID 0x00000080 +#define LINECALLINFOSTATE_ORIGIN 0x00000100 +#define LINECALLINFOSTATE_REASON 0x00000200 +#define LINECALLINFOSTATE_COMPLETIONID 0x00000400 +#define LINECALLINFOSTATE_NUMOWNERINCR 0x00000800 +#define LINECALLINFOSTATE_NUMOWNERDECR 0x00001000 +#define LINECALLINFOSTATE_NUMMONITORS 0x00002000 +#define LINECALLINFOSTATE_TRUNK 0x00004000 +#define LINECALLINFOSTATE_CALLERID 0x00008000 +#define LINECALLINFOSTATE_CALLEDID 0x00010000 +#define LINECALLINFOSTATE_CONNECTEDID 0x00020000 +#define LINECALLINFOSTATE_REDIRECTIONID 0x00040000 +#define LINECALLINFOSTATE_REDIRECTINGID 0x00080000 +#define LINECALLINFOSTATE_DISPLAY 0x00100000 +#define LINECALLINFOSTATE_USERUSERINFO 0x00200000 +#define LINECALLINFOSTATE_HIGHLEVELCOMP 0x00400000 +#define LINECALLINFOSTATE_LOWLEVELCOMP 0x00800000 +#define LINECALLINFOSTATE_CHARGINGINFO 0x01000000 +#define LINECALLINFOSTATE_TERMINAL 0x02000000 +#define LINECALLINFOSTATE_DIALPARAMS 0x04000000 +#define LINECALLINFOSTATE_MONITORMODES 0x08000000 +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) +#define LINECALLINFOSTATE_TREATMENT 0x10000000 +#define LINECALLINFOSTATE_QOS 0x20000000 +#define LINECALLINFOSTATE_CALLDATA 0x40000000 +#endif + +#define LINECALLORIGIN_OUTBOUND 0x00000001 +#define LINECALLORIGIN_INTERNAL 0x00000002 +#define LINECALLORIGIN_EXTERNAL 0x00000004 +#define LINECALLORIGIN_UNKNOWN 0x00000010 +#define LINECALLORIGIN_UNAVAIL 0x00000020 +#define LINECALLORIGIN_CONFERENCE 0x00000040 +#define LINECALLORIGIN_INBOUND 0x00000080 + +#define LINECALLPARAMFLAGS_SECURE 0x00000001 +#define LINECALLPARAMFLAGS_IDLE 0x00000002 +#define LINECALLPARAMFLAGS_BLOCKID 0x00000004 +#define LINECALLPARAMFLAGS_ORIGOFFHOOK 0x00000008 +#define LINECALLPARAMFLAGS_DESTOFFHOOK 0x00000010 +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) +#define LINECALLPARAMFLAGS_NOHOLDCONFERENCE \ + 0x00000020 +#define LINECALLPARAMFLAGS_PREDICTIVEDIAL 0x00000040 +#define LINECALLPARAMFLAGS_ONESTEPTRANSFER \ + 0x00000080 +#endif + +#define LINECALLPARTYID_BLOCKED 0x00000001 +#define LINECALLPARTYID_OUTOFAREA 0x00000002 +#define LINECALLPARTYID_NAME 0x00000004 +#define LINECALLPARTYID_ADDRESS 0x00000008 +#define LINECALLPARTYID_PARTIAL 0x00000010 +#define LINECALLPARTYID_UNKNOWN 0x00000020 +#define LINECALLPARTYID_UNAVAIL 0x00000040 + +#define LINECALLPRIVILEGE_NONE 0x00000001 +#define LINECALLPRIVILEGE_MONITOR 0x00000002 +#define LINECALLPRIVILEGE_OWNER 0x00000004 + +#define LINECALLREASON_DIRECT 0x00000001 +#define LINECALLREASON_FWDBUSY 0x00000002 +#define LINECALLREASON_FWDNOANSWER 0x00000004 +#define LINECALLREASON_FWDUNCOND 0x00000008 +#define LINECALLREASON_PICKUP 0x00000010 +#define LINECALLREASON_UNPARK 0x00000020 +#define LINECALLREASON_REDIRECT 0x00000040 +#define LINECALLREASON_CALLCOMPLETION 0x00000080 +#define LINECALLREASON_TRANSFER 0x00000100 +#define LINECALLREASON_REMINDER 0x00000200 +#define LINECALLREASON_UNKNOWN 0x00000400 +#define LINECALLREASON_UNAVAIL 0x00000800 +#define LINECALLREASON_INTRUDE 0x00001000 +#define LINECALLREASON_PARKED 0x00002000 +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) +#define LINECALLREASON_CAMPEDON 0x00004000 +#define LINECALLREASON_ROUTEREQUEST 0x00008000 +#endif + +#define LINECALLSELECT_LINE 0x00000001 +#define LINECALLSELECT_ADDRESS 0x00000002 +#define LINECALLSELECT_CALL 0x00000004 +#if (NDIS_TAPI_CURRENT_VERSION > 0x00020000) +#define LINECALLSELECT_DEVICEID 0x00000008 +#endif +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00030000) +#define LINECALLSELECT_CALLID 0x00000010 +#endif + +#define LINECALLSTATE_IDLE 0x00000001 +#define LINECALLSTATE_OFFERING 0x00000002 +#define LINECALLSTATE_ACCEPTED 0x00000004 +#define LINECALLSTATE_DIALTONE 0x00000008 +#define LINECALLSTATE_DIALING 0x00000010 +#define LINECALLSTATE_RINGBACK 0x00000020 +#define LINECALLSTATE_BUSY 0x00000040 +#define LINECALLSTATE_SPECIALINFO 0x00000080 +#define LINECALLSTATE_CONNECTED 0x00000100 +#define LINECALLSTATE_PROCEEDING 0x00000200 +#define LINECALLSTATE_ONHOLD 0x00000400 +#define LINECALLSTATE_CONFERENCED 0x00000800 +#define LINECALLSTATE_ONHOLDPENDCONF 0x00001000 +#define LINECALLSTATE_ONHOLDPENDTRANSFER 0x00002000 +#define LINECALLSTATE_DISCONNECTED 0x00004000 +#define LINECALLSTATE_UNKNOWN 0x00008000 + +#define LINEDEVCAPFLAGS_CROSSADDRCONF 0x00000001 +#define LINEDEVCAPFLAGS_HIGHLEVCOMP 0x00000002 +#define LINEDEVCAPFLAGS_LOWLEVCOMP 0x00000004 +#define LINEDEVCAPFLAGS_MEDIACONTROL 0x00000008 +#define LINEDEVCAPFLAGS_MULTIPLEADDR 0x00000010 +#define LINEDEVCAPFLAGS_CLOSEDROP 0x00000020 +#define LINEDEVCAPFLAGS_DIALBILLING 0x00000040 +#define LINEDEVCAPFLAGS_DIALQUIET 0x00000080 +#define LINEDEVCAPFLAGS_DIALDIALTONE 0x00000100 +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00030000) +#define LINEDEVCAPFLAGS_MSP 0x00000200 +#define LINEDEVCAPFLAGS_CALLHUB 0x00000400 +#define LINEDEVCAPFLAGS_CALLHUBTRACKING 0x00000800 +#define LINEDEVCAPFLAGS_PRIVATEOBJECTS 0x00001000 +#endif + +#define LINEDEVSTATE_OTHER 0x00000001 +#define LINEDEVSTATE_RINGING 0x00000002 +#define LINEDEVSTATE_CONNECTED 0x00000004 +#define LINEDEVSTATE_DISCONNECTED 0x00000008 +#define LINEDEVSTATE_MSGWAITON 0x00000010 +#define LINEDEVSTATE_MSGWAITOFF 0x00000020 +#define LINEDEVSTATE_INSERVICE 0x00000040 +#define LINEDEVSTATE_OUTOFSERVICE 0x00000080 +#define LINEDEVSTATE_MAINTENANCE 0x00000100 +#define LINEDEVSTATE_OPEN 0x00000200 +#define LINEDEVSTATE_CLOSE 0x00000400 +#define LINEDEVSTATE_NUMCALLS 0x00000800 +#define LINEDEVSTATE_NUMCOMPLETIONS 0x00001000 +#define LINEDEVSTATE_TERMINALS 0x00002000 +#define LINEDEVSTATE_ROAMMODE 0x00004000 +#define LINEDEVSTATE_BATTERY 0x00008000 +#define LINEDEVSTATE_SIGNAL 0x00010000 +#define LINEDEVSTATE_DEVSPECIFIC 0x00020000 +#define LINEDEVSTATE_REINIT 0x00040000 +#define LINEDEVSTATE_LOCK 0x00080000 + +#define LINEDEVSTATUSFLAGS_CONNECTED 0x00000001 +#define LINEDEVSTATUSFLAGS_MSGWAIT 0x00000002 +#define LINEDEVSTATUSFLAGS_INSERVICE 0x00000004 +#define LINEDEVSTATUSFLAGS_LOCKED 0x00000008 + +#define LINEDIALTONEMODE_NORMAL 0x00000001 +#define LINEDIALTONEMODE_SPECIAL 0x00000002 +#define LINEDIALTONEMODE_INTERNAL 0x00000004 +#define LINEDIALTONEMODE_EXTERNAL 0x00000008 +#define LINEDIALTONEMODE_UNKNOWN 0x00000010 +#define LINEDIALTONEMODE_UNAVAIL 0x00000020 + +#define LINEDIGITMODE_PULSE 0x00000001 +#define LINEDIGITMODE_DTMF 0x00000002 +#define LINEDIGITMODE_DTMFEND 0x00000004 + +#define LINEDISCONNECTMODE_NORMAL 0x00000001 +#define LINEDISCONNECTMODE_UNKNOWN 0x00000002 +#define LINEDISCONNECTMODE_REJECT 0x00000004 +#define LINEDISCONNECTMODE_PICKUP 0x00000008 +#define LINEDISCONNECTMODE_FORWARDED 0x00000010 +#define LINEDISCONNECTMODE_BUSY 0x00000020 +#define LINEDISCONNECTMODE_NOANSWER 0x00000040 +#define LINEDISCONNECTMODE_BADADDRESS 0x00000080 +#define LINEDISCONNECTMODE_UNREACHABLE 0x00000100 +#define LINEDISCONNECTMODE_CONGESTION 0x00000200 +#define LINEDISCONNECTMODE_INCOMPATIBLE 0x00000400 +#define LINEDISCONNECTMODE_UNAVAIL 0x00000800 +#define LINEDISCONNECTMODE_NODIALTONE 0x00001000 +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) +#define LINEDISCONNECTMODE_NUMBERCHANGED 0x00002000 +#define LINEDISCONNECTMODE_OUTOFORDER 0x00004000 +#define LINEDISCONNECTMODE_TEMPFAILURE 0x00008000 +#define LINEDISCONNECTMODE_QOSUNAVAIL 0x00010000 +#define LINEDISCONNECTMODE_BLOCKED 0x00020000 +#define LINEDISCONNECTMODE_DONOTDISTURB 0x00040000 +#define LINEDISCONNECTMODE_CANCELLED 0x00080000 +#endif + +#define LINEFEATURE_DEVSPECIFIC 0x00000001 +#define LINEFEATURE_DEVSPECIFICFEAT 0x00000002 +#define LINEFEATURE_FORWARD 0x00000004 +#define LINEFEATURE_MAKECALL 0x00000008 +#define LINEFEATURE_SETMEDIACONTROL 0x00000010 +#define LINEFEATURE_SETTERMINAL 0x00000020 +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) +#define LINEFEATURE_SETDEVSTATUS 0x00000040 +#define LINEFEATURE_FORWARDFWD 0x00000080 +#define LINEFEATURE_FORWARDDND 0x00000100 +#endif + +#define LINEFORWARDMODE_UNCOND 0x00000001 +#define LINEFORWARDMODE_UNCONDINTERNAL 0x00000002 +#define LINEFORWARDMODE_UNCONDEXTERNAL 0x00000004 +#define LINEFORWARDMODE_UNCONDSPECIFIC 0x00000008 +#define LINEFORWARDMODE_BUSY 0x00000010 +#define LINEFORWARDMODE_BUSYINTERNAL 0x00000020 +#define LINEFORWARDMODE_BUSYEXTERNAL 0x00000040 +#define LINEFORWARDMODE_BUSYSPECIFIC 0x00000080 +#define LINEFORWARDMODE_NOANSW 0x00000100 +#define LINEFORWARDMODE_NOANSWINTERNAL 0x00000200 +#define LINEFORWARDMODE_NOANSWEXTERNAL 0x00000400 +#define LINEFORWARDMODE_NOANSWSPECIFIC 0x00000800 +#define LINEFORWARDMODE_BUSYNA 0x00001000 +#define LINEFORWARDMODE_BUSYNAINTERNAL 0x00002000 +#define LINEFORWARDMODE_BUSYNAEXTERNAL 0x00004000 +#define LINEFORWARDMODE_BUSYNASPECIFIC 0x00008000 + +#define LINEGATHERTERM_BUFFERFULL 0x00000001 +#define LINEGATHERTERM_TERMDIGIT 0x00000002 +#define LINEGATHERTERM_FIRSTTIMEOUT 0x00000004 +#define LINEGATHERTERM_INTERTIMEOUT 0x00000008 +#define LINEGATHERTERM_CANCEL 0x00000010 + +#define LINEGENERATETERM_DONE 0x00000001 +#define LINEGENERATETERM_CANCEL 0x00000002 + +#define LINEMEDIACONTROL_NONE 0x00000001 +#define LINEMEDIACONTROL_START 0x00000002 +#define LINEMEDIACONTROL_RESET 0x00000004 +#define LINEMEDIACONTROL_PAUSE 0x00000008 +#define LINEMEDIACONTROL_RESUME 0x00000010 +#define LINEMEDIACONTROL_RATEUP 0x00000020 +#define LINEMEDIACONTROL_RATEDOWN 0x00000040 +#define LINEMEDIACONTROL_RATENORMAL 0x00000080 +#define LINEMEDIACONTROL_VOLUMEUP 0x00000100 +#define LINEMEDIACONTROL_VOLUMEDOWN 0x00000200 +#define LINEMEDIACONTROL_VOLUMENORMAL 0x00000400 + +#define LINEMEDIAMODE_UNKNOWN 0x00000002 +#define LINEMEDIAMODE_INTERACTIVEVOICE 0x00000004 +#define LINEMEDIAMODE_AUTOMATEDVOICE 0x00000008 +#define LINEMEDIAMODE_DATAMODEM 0x00000010 +#define LINEMEDIAMODE_G3FAX 0x00000020 +#define LINEMEDIAMODE_TDD 0x00000040 +#define LINEMEDIAMODE_G4FAX 0x00000080 +#define LINEMEDIAMODE_DIGITALDATA 0x00000100 +#define LINEMEDIAMODE_TELETEX 0x00000200 +#define LINEMEDIAMODE_VIDEOTEX 0x00000400 +#define LINEMEDIAMODE_TELEX 0x00000800 +#define LINEMEDIAMODE_MIXED 0x00001000 +#define LINEMEDIAMODE_ADSI 0x00002000 + +#define LINEMEDIAMODE_VOICEVIEW 0x00004000 +#define LAST_LINEMEDIAMODE 0x00004000 +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020001) +#define LINEMEDIAMODE_VIDEO 0x00008000 +#define LAST_LINEMEDIAMODE 0x00008000 +#endif + +#define LINEPARKMODE_DIRECTED 0x00000001 +#define LINEPARKMODE_NONDIRECTED 0x00000002 + +#define LINEREMOVEFROMCONF_NONE 0x00000001 +#define LINEREMOVEFROMCONF_LAST 0x00000002 +#define LINEREMOVEFROMCONF_ANY 0x00000003 + +#define LINEREQUESTMODE_MAKECALL 0x00000001 +#define LINEREQUESTMODE_MEDIACALL 0x00000002 +#define LINEREQUESTMODE_DROP 0x00000004 + +#define LAST_LINEREQUESTMODE LINEREQUESTMODE_MEDIACALL + +#define LINEROAMMODE_UNKNOWN 0x00000001 +#define LINEROAMMODE_UNAVAIL 0x00000002 +#define LINEROAMMODE_HOME 0x00000004 +#define LINEROAMMODE_ROAMA 0x00000008 +#define LINEROAMMODE_ROAMB 0x00000010 + +#define LINESPECIALINFO_NOCIRCUIT 0x00000001 +#define LINESPECIALINFO_CUSTIRREG 0x00000002 +#define LINESPECIALINFO_REORDER 0x00000004 +#define LINESPECIALINFO_UNKNOWN 0x00000008 +#define LINESPECIALINFO_UNAVAIL 0x00000010 + +#define LINETERMDEV_PHONE 0x00000001 +#define LINETERMDEV_HEADSET 0x00000002 +#define LINETERMDEV_SPEAKER 0x00000004 + +#define LINETERMMODE_BUTTONS 0x00000001 +#define LINETERMMODE_LAMPS 0x00000002 +#define LINETERMMODE_DISPLAY 0x00000004 +#define LINETERMMODE_RINGER 0x00000008 +#define LINETERMMODE_HOOKSWITCH 0x00000010 +#define LINETERMMODE_MEDIATOLINE 0x00000020 +#define LINETERMMODE_MEDIAFROMLINE 0x00000040 +#define LINETERMMODE_MEDIABIDIRECT 0x00000080 + +#define LINETERMSHARING_PRIVATE 0x00000001 +#define LINETERMSHARING_SHAREDEXCL 0x00000002 +#define LINETERMSHARING_SHAREDCONF 0x00000004 + +#define LINETONEMODE_CUSTOM 0x00000001 +#define LINETONEMODE_RINGBACK 0x00000002 +#define LINETONEMODE_BUSY 0x00000004 +#define LINETONEMODE_BEEP 0x00000008 +#define LINETONEMODE_BILLING 0x00000010 + +#define LINETRANSFERMODE_TRANSFER 0x00000001 +#define LINETRANSFERMODE_CONFERENCE 0x00000002 + +#define LINETOLLLISTOPTION_ADD 0x00000001 +#define LINETOLLLISTOPTION_REMOVE 0x00000002 + +#define LINETRANSLATEOPTION_CARDOVERRIDE 0x00000001 + +#define LINETRANSLATERESULT_CANONICAL 0x00000001 +#define LINETRANSLATERESULT_INTERNATIONAL 0x00000002 +#define LINETRANSLATERESULT_LONGDISTANCE 0x00000004 +#define LINETRANSLATERESULT_LOCAL 0x00000008 +#define LINETRANSLATERESULT_INTOLLLIST 0x00000010 +#define LINETRANSLATERESULT_NOTINTOLLLIST 0x00000020 +#define LINETRANSLATERESULT_DIALBILLING 0x00000040 +#define LINETRANSLATERESULT_DIALQUIET 0x00000080 +#define LINETRANSLATERESULT_DIALDIALTONE 0x00000100 +#define LINETRANSLATERESULT_DIALPROMPT 0x00000200 +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) +#define LINETRANSLATERESULT_VOICEDETECT 0x00000400 +#endif + +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00030000) +#define LINETRANSLATERESULT_NOTRANSLATION 0x00000800 +#endif + + +typedef struct _NDIS_VAR_DATA_DESC { + USHORT Length; + USHORT MaximumLength; + LONG Offset; +} NDIS_VAR_DATA_DESC, *PNDIS_VAR_DATA_DESC; + +typedef struct _LINE_DIAL_PARAMS { + ULONG ulDialPause; + ULONG ulDialSpeed; + ULONG ulDigitDuration; + ULONG ulWaitForDialtone; +} LINE_DIAL_PARAMS, *PLINE_DIAL_PARAMS; + +typedef struct _LINE_ADDRESS_CAPS { + ULONG ulTotalSize; + ULONG ulNeededSize; + ULONG ulUsedSize; + ULONG ulLineDeviceID; + ULONG ulAddressSize; + ULONG ulAddressOffset; + ULONG ulDevSpecificSize; + ULONG ulDevSpecificOffset; + ULONG ulAddressSharing; + ULONG ulAddressStates; + ULONG ulCallInfoStates; + ULONG ulCallerIDFlags; + ULONG ulCalledIDFlags; + ULONG ulConnectedIDFlags; + ULONG ulRedirectionIDFlags; + ULONG ulRedirectingIDFlags; + ULONG ulCallStates; + ULONG ulDialToneModes; + ULONG ulBusyModes; + ULONG ulSpecialInfo; + ULONG ulDisconnectModes; + ULONG ulMaxNumActiveCalls; + ULONG ulMaxNumOnHoldCalls; + ULONG ulMaxNumOnHoldPendingCalls; + ULONG ulMaxNumConference; + ULONG ulMaxNumTransConf; + ULONG ulAddrCapFlags; + ULONG ulCallFeatures; + ULONG ulRemoveFromConfCaps; + ULONG ulRemoveFromConfState; + ULONG ulTransferModes; + ULONG ulParkModes; + ULONG ulForwardModes; + ULONG ulMaxForwardEntries; + ULONG ulMaxSpecificEntries; + ULONG ulMinFwdNumRings; + ULONG ulMaxFwdNumRings; + ULONG ulMaxCallCompletions; + ULONG ulCallCompletionConds; + ULONG ulCallCompletionModes; + ULONG ulNumCompletionMessages; + ULONG ulCompletionMsgTextEntrySize; + ULONG ulCompletionMsgTextSize; + ULONG ulCompletionMsgTextOffset; +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00010004) + ULONG ulAddressFeatures; +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) + ULONG ulPredictiveAutoTransferStates; + ULONG ulNumCallTreatments; + ULONG ulCallTreatmentListSize; + ULONG ulCallTreatmentListOffset; + ULONG ulDeviceClassesSize; + ULONG ulDeviceClassesOffset; + ULONG ulMaxCallDataSize; + ULONG ulCallFeatures2; + ULONG ulMaxNoAnswerTimeout; + ULONG ulConnectedModes; + ULONG ulOfferingModes; + ULONG ulAvailableMediaModes; +#endif +#endif +} LINE_ADDRESS_CAPS, *PLINE_ADDRESS_CAPS; + +typedef struct _LINE_ADDRESS_STATUS { + ULONG ulTotalSize; + ULONG ulNeededSize; + ULONG ulUsedSize; + ULONG ulNumInUse; + ULONG ulNumActiveCalls; + ULONG ulNumOnHoldCalls; + ULONG ulNumOnHoldPendCalls; + ULONG ulAddressFeatures; + ULONG ulNumRingsNoAnswer; + ULONG ulForwardNumEntries; + ULONG ulForwardSize; + ULONG ulForwardOffset; + ULONG ulTerminalModesSize; + ULONG ulTerminalModesOffset; + ULONG ulDevSpecificSize; + ULONG ulDevSpecificOffset; +} LINE_ADDRESS_STATUS, *PLINE_ADDRESS_STATUS; + +typedef struct _LINE_CALL_INFO { + ULONG ulTotalSize; + ULONG ulNeededSize; + ULONG ulUsedSize; + ULONG hLine; + ULONG ulLineDeviceID; + ULONG ulAddressID; + ULONG ulBearerMode; + ULONG ulRate; + ULONG ulMediaMode; + ULONG ulAppSpecific; + ULONG ulCallID; + ULONG ulRelatedCallID; + ULONG ulCallParamFlags; + ULONG ulCallStates; + ULONG ulMonitorDigitModes; + ULONG ulMonitorMediaModes; + LINE_DIAL_PARAMS DialParams; + ULONG ulOrigin; + ULONG ulReason; + ULONG ulCompletionID; + ULONG ulNumOwners; + ULONG ulNumMonitors; + ULONG ulCountryCode; + ULONG ulTrunk; + ULONG ulCallerIDFlags; + ULONG ulCallerIDSize; + ULONG ulCallerIDOffset; + ULONG ulCallerIDNameSize; + ULONG ulCallerIDNameOffset; + ULONG ulCalledIDFlags; + ULONG ulCalledIDSize; + ULONG ulCalledIDOffset; + ULONG ulCalledIDNameSize; + ULONG ulCalledIDNameOffset; + ULONG ulConnectedIDFlags; + ULONG ulConnectedIDSize; + ULONG ulConnectedIDOffset; + ULONG ulConnectedIDNameSize; + ULONG ulConnectedIDNameOffset; + ULONG ulRedirectionIDFlags; + ULONG ulRedirectionIDSize; + ULONG ulRedirectionIDOffset; + ULONG ulRedirectionIDNameSize; + ULONG ulRedirectionIDNameOffset; + ULONG ulRedirectingIDFlags; + ULONG ulRedirectingIDSize; + ULONG ulRedirectingIDOffset; + ULONG ulRedirectingIDNameSize; + ULONG ulRedirectingIDNameOffset; + ULONG ulAppNameSize; + ULONG ulAppNameOffset; + ULONG ulDisplayableAddressSize; + ULONG ulDisplayableAddressOffset; + ULONG ulCalledPartySize; + ULONG ulCalledPartyOffset; + ULONG ulCommentSize; + ULONG ulCommentOffset; + ULONG ulDisplaySize; + ULONG ulDisplayOffset; + ULONG ulUserUserInfoSize; + ULONG ulUserUserInfoOffset; + ULONG ulHighLevelCompSize; + ULONG ulHighLevelCompOffset; + ULONG ulLowLevelCompSize; + ULONG ulLowLevelCompOffset; + ULONG ulChargingInfoSize; + ULONG ulChargingInfoOffset; + ULONG ulTerminalModesSize; + ULONG ulTerminalModesOffset; + ULONG ulDevSpecificSize; + ULONG ulDevSpecificOffset; +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) + ULONG ulCallTreatment; + ULONG ulCallDataSize; + ULONG ulCallDataOffset; + ULONG ulSendingFlowspecSize; + ULONG ulSendingFlowspecOffset; + ULONG ulReceivingFlowspecSize; + ULONG ulReceivingFlowspecOffset; +#endif +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00030000) + ULONG ulCallerIDAddressType; + ULONG ulCalledIDAddressType; + ULONG ulConnectedIDAddressType; + ULONG ulRedirectionIDAddressType; + ULONG ulRedirectingIDAddressType; +#endif +} LINE_CALL_INFO, *PLINE_CALL_INFO; + +typedef struct _LINE_CALL_PARAMS { + ULONG ulTotalSize; + ULONG ulBearerMode; + ULONG ulMinRate; + ULONG ulMaxRate; + ULONG ulMediaMode; + ULONG ulCallParamFlags; + ULONG ulAddressMode; + ULONG ulAddressID; + LINE_DIAL_PARAMS DialParams; + ULONG ulOrigAddressSize; + ULONG ulOrigAddressOffset; + ULONG ulDisplayableAddressSize; + ULONG ulDisplayableAddressOffset; + ULONG ulCalledPartySize; + ULONG ulCalledPartyOffset; + ULONG ulCommentSize; + ULONG ulCommentOffset; + ULONG ulUserUserInfoSize; + ULONG ulUserUserInfoOffset; + ULONG ulHighLevelCompSize; + ULONG ulHighLevelCompOffset; + ULONG ulLowLevelCompSize; + ULONG ulLowLevelCompOffset; + ULONG ulDevSpecificSize; + ULONG ulDevSpecificOffset; +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) + ULONG ulPredictiveAutoTransferStates; + ULONG ulTargetAddressSize; + ULONG ulTargetAddressOffset; + ULONG ulSendingFlowspecSize; + ULONG ulSendingFlowspecOffset; + ULONG ulReceivingFlowspecSize; + ULONG ulReceivingFlowspecOffset; + ULONG ulDeviceClassSize; + ULONG ulDeviceClassOffset; + ULONG ulDeviceConfigSize; + ULONG ulDeviceConfigOffset; + ULONG ulCallDataSize; + ULONG ulCallDataOffset; + ULONG ulNoAnswerTimeout; + ULONG ulCallingPartyIDSize; + ULONG ulCallingPartyIDOffset; +#endif +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00030000) + ULONG ulAddressType; +#endif +} LINE_CALL_PARAMS, *PLINE_CALL_PARAMS; + +typedef struct _LINE_CALL_STATUS { + ULONG ulTotalSize; + ULONG ulNeededSize; + ULONG ulUsedSize; + ULONG ulCallState; + ULONG ulCallStateMode; + ULONG ulCallPrivilege; + ULONG ulCallFeatures; + ULONG ulDevSpecificSize; + ULONG ulDevSpecificOffset; +} LINE_CALL_STATUS, *PLINE_CALL_STATUS; + +typedef struct _LINE_DEV_CAPS { + ULONG ulTotalSize; + ULONG ulNeededSize; + ULONG ulUsedSize; + ULONG ulProviderInfoSize; + ULONG ulProviderInfoOffset; + ULONG ulSwitchInfoSize; + ULONG ulSwitchInfoOffset; + ULONG ulPermanentLineID; + ULONG ulLineNameSize; + ULONG ulLineNameOffset; + ULONG ulStringFormat; + ULONG ulAddressModes; + ULONG ulNumAddresses; + ULONG ulBearerModes; + ULONG ulMaxRate; + ULONG ulMediaModes; + ULONG ulGenerateToneModes; + ULONG ulGenerateToneMaxNumFreq; + ULONG ulGenerateDigitModes; + ULONG ulMonitorToneMaxNumFreq; + ULONG ulMonitorToneMaxNumEntries; + ULONG ulMonitorDigitModes; + ULONG ulGatherDigitsMinTimeout; + ULONG ulGatherDigitsMaxTimeout; + ULONG ulMedCtlDigitMaxListSize; + ULONG ulMedCtlMediaMaxListSize; + ULONG ulMedCtlToneMaxListSize; + ULONG ulMedCtlCallStateMaxListSize; + ULONG ulDevCapFlags; + ULONG ulMaxNumActiveCalls; + ULONG ulAnswerMode; + ULONG ulRingModes; + ULONG ulLineStates; + ULONG ulUUIAcceptSize; + ULONG ulUUIAnswerSize; + ULONG ulUUIMakeCallSize; + ULONG ulUUIDropSize; + ULONG ulUUISendUserUserInfoSize; + ULONG ulUUICallInfoSize; + LINE_DIAL_PARAMS MinDialParams; + LINE_DIAL_PARAMS MaxDialParams; + LINE_DIAL_PARAMS DefaultDialParams; + ULONG ulNumTerminals; + ULONG ulTerminalCapsSize; + ULONG ulTerminalCapsOffset; + ULONG ulTerminalTextEntrySize; + ULONG ulTerminalTextSize; + ULONG ulTerminalTextOffset; + ULONG ulDevSpecificSize; + ULONG ulDevSpecificOffset; +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00010004) + ULONG ulLineFeatures; +#endif +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) + ULONG ulSettableDevStatus; + ULONG ulDeviceClassesSize; + ULONG ulDeviceClassesOffset; +#endif +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020002) + GUID PermanentLineGuid; +#endif +#if (NDIS_TAPI_CURRENT_VERSION >= 0x00030000) + ULONG ulAddressTypes; + GUID ProtocolGuid; + ULONG ulAvailableTracking; +#endif +} LINE_DEV_CAPS, *PLINE_DEV_CAPS; + +typedef struct _LINE_DEV_STATUS { + ULONG ulTotalSize; + ULONG ulNeededSize; + ULONG ulUsedSize; + ULONG ulNumOpens; + ULONG ulOpenMediaModes; + ULONG ulNumActiveCalls; + ULONG ulNumOnHoldCalls; + ULONG ulNumOnHoldPendCalls; + ULONG ulLineFeatures; + ULONG ulNumCallCompletions; + ULONG ulRingMode; + ULONG ulSignalLevel; + ULONG ulBatteryLevel; + ULONG ulRoamMode; + ULONG ulDevStatusFlags; + ULONG ulTerminalModesSize; + ULONG ulTerminalModesOffset; + ULONG ulDevSpecificSize; + ULONG ulDevSpecificOffset; +} LINE_DEV_STATUS, *PLINE_DEV_STATUS; + +typedef struct _LINE_EXTENSION_ID { + ULONG ulExtensionID0; + ULONG ulExtensionID1; + ULONG ulExtensionID2; + ULONG ulExtensionID3; +} LINE_EXTENSION_ID, *PLINE_EXTENSION_ID; + +typedef struct _VAR_STRING { + ULONG ulTotalSize; + ULONG ulNeededSize; + ULONG ulUsedSize; + ULONG ulStringFormat; + ULONG ulStringSize; + ULONG ulStringOffset; +} VAR_STRING, *PVAR_STRING; + +typedef struct _NDIS_TAPI_ANSWER { + IN ULONG ulRequestID; + IN HDRV_CALL hdCall; + IN ULONG ulUserUserInfoSize; + IN UCHAR UserUserInfo[1]; +} NDIS_TAPI_ANSWER, *PNDIS_TAPI_ANSWER; + +typedef struct _NDIS_TAPI_CLOSE { + IN ULONG ulRequestID; + IN HDRV_LINE hdLine; +} NDIS_TAPI_CLOSE, *PNDIS_TAPI_CLOSE; + +typedef struct _NDIS_TAPI_CLOSE_CALL { + IN ULONG ulRequestID; + IN HDRV_CALL hdCall; +} NDIS_TAPI_CLOSE_CALL, *PNDIS_TAPI_CLOSE_CALL; + +typedef struct _NDIS_TAPI_CONDITIONAL_MEDIA_DETECTION { + IN ULONG ulRequestID; + IN HDRV_LINE hdLine; + IN ULONG ulMediaModes; + IN LINE_CALL_PARAMS LineCallParams; +} NDIS_TAPI_CONDITIONAL_MEDIA_DETECTION, *PNDIS_TAPI_CONDITIONAL_MEDIA_DETECTION; + +typedef struct _NDIS_TAPI_DROP { + IN ULONG ulRequestID; + IN HDRV_CALL hdCall; + IN ULONG ulUserUserInfoSize; + IN UCHAR UserUserInfo[1]; +} NDIS_TAPI_DROP, *PNDIS_TAPI_DROP; + +typedef struct _NDIS_TAPI_PROVIDER_SHUTDOWN { + IN ULONG ulRequestID; +} NDIS_TAPI_PROVIDER_SHUTDOWN, *PNDIS_TAPI_PROVIDER_SHUTDOWN; + +typedef struct _NDIS_TAPI_SET_APP_SPECIFIC { + IN ULONG ulRequestID; + IN HDRV_CALL hdCall; + IN ULONG ulAppSpecific; +} NDIS_TAPI_SET_APP_SPECIFIC, *PNDIS_TAPI_SET_APP_SPECIFIC; + +typedef struct _NDIS_TAPI_SET_CALL_PARAMS { + IN ULONG ulRequestID; + IN HDRV_CALL hdCall; + IN ULONG ulBearerMode; + IN ULONG ulMinRate; + IN ULONG ulMaxRate; + IN BOOLEAN bSetLineDialParams; + IN LINE_DIAL_PARAMS LineDialParams; +} NDIS_TAPI_SET_CALL_PARAMS, *PNDIS_TAPI_SET_CALL_PARAMS; + +typedef struct _NDIS_TAPI_SET_DEFAULT_MEDIA_DETECTION { + IN ULONG ulRequestID; + IN HDRV_LINE hdLine; + IN ULONG ulMediaModes; +} NDIS_TAPI_SET_DEFAULT_MEDIA_DETECTION, *PNDIS_TAPI_SET_DEFAULT_MEDIA_DETECTION; + +typedef struct _NDIS_TAPI_SET_DEV_CONFIG { + IN ULONG ulRequestID; + IN ULONG ulDeviceID; + IN ULONG ulDeviceClassSize; + IN ULONG ulDeviceClassOffset; + IN ULONG ulDeviceConfigSize; + IN UCHAR DeviceConfig[1]; +} NDIS_TAPI_SET_DEV_CONFIG, *PNDIS_TAPI_SET_DEV_CONFIG; + +typedef struct _NDIS_TAPI_SET_MEDIA_MODE { + IN ULONG ulRequestID; + IN HDRV_CALL hdCall; + IN ULONG ulMediaMode; +} NDIS_TAPI_SET_MEDIA_MODE, *PNDIS_TAPI_SET_MEDIA_MODE; + +typedef struct _NDIS_TAPI_SET_STATUS_MESSAGES { + IN ULONG ulRequestID; + IN HDRV_LINE hdLine; + IN ULONG ulLineStates; + IN ULONG ulAddressStates; +} NDIS_TAPI_SET_STATUS_MESSAGES, *PNDIS_TAPI_SET_STATUS_MESSAGES; + +typedef struct _NDIS_TAPI_ACCEPT { + IN ULONG ulRequestID; + IN HDRV_CALL hdCall; + IN ULONG ulUserUserInfoSize; + IN UCHAR UserUserInfo[1]; +} NDIS_TAPI_ACCEPT, *PNDIS_TAPI_ACCEPT; + +typedef struct _NDIS_TAPI_DIAL { + IN ULONG ulRequestID; + IN HDRV_CALL hdCall; + IN ULONG ulDestAddressSize; + IN CHAR szDestAddress[1]; +} NDIS_TAPI_DIAL, *PNDIS_TAPI_DIAL; + +typedef struct _NDIS_TAPI_EVENT { + IN HTAPI_LINE htLine; + IN HTAPI_CALL htCall; + IN ULONG ulMsg; + IN ULONG ulParam1; + IN ULONG ulParam2; + IN ULONG ulParam3; +} NDIS_TAPI_EVENT, *PNDIS_TAPI_EVENT; + +typedef struct _NDIS_TAPI_OPEN { + IN ULONG ulRequestID; + IN ULONG ulDeviceID; + IN HTAPI_LINE htLine; + OUT HDRV_LINE hdLine; +} NDIS_TAPI_OPEN, *PNDIS_TAPI_OPEN; + +typedef struct _NDIS_TAPI_SECURE_CALL { + IN ULONG ulRequestID; + IN HDRV_CALL hdCall; +} NDIS_TAPI_SECURE_CALL, *PNDIS_TAPI_SECURE_CALL; + +typedef struct _NDIS_TAPI_SELECT_EXT_VERSION { + IN ULONG ulRequestID; + IN HDRV_LINE hdLine; + IN ULONG ulExtVersion; +} NDIS_TAPI_SELECT_EXT_VERSION, *PNDIS_TAPI_SELECT_EXT_VERSION; + +typedef struct _NDIS_TAPI_SEND_USER_USER_INFO { + IN ULONG ulRequestID; + IN HDRV_CALL hdCall; + IN ULONG ulUserUserInfoSize; + IN UCHAR UserUserInfo[1]; +} NDIS_TAPI_SEND_USER_USER_INFO, *PNDIS_TAPI_SEND_USER_USER_INFO; + + +typedef struct _NDIS_TAPI_CONFIG_DIALOG { + IN ULONG ulRequestID; + IN ULONG ulDeviceID; + IN ULONG ulDeviceClassSize; + IN ULONG ulDeviceClassOffset; + IN ULONG ulLibraryNameTotalSize; + OUT ULONG ulLibraryNameNeededSize; + OUT CHAR szLibraryName[1]; +} NDIS_TAPI_CONFIG_DIALOG, *PNDIS_TAPI_CONFIG_DIALOG; + +typedef struct _NDIS_TAPI_DEV_SPECIFIC { + IN ULONG ulRequestID; + IN HDRV_LINE hdLine; + IN ULONG ulAddressID; + IN HDRV_CALL hdCall; + IN OUT ULONG ulParamsSize; + IN OUT UCHAR Params[1]; +} NDIS_TAPI_DEV_SPECIFIC, *PNDIS_TAPI_DEV_SPECIFIC; + +typedef struct _NDIS_TAPI_GET_ADDRESS_CAPS { + IN ULONG ulRequestID; + IN ULONG ulDeviceID; + IN ULONG ulAddressID; + IN ULONG ulExtVersion; + OUT LINE_ADDRESS_CAPS LineAddressCaps; +} NDIS_TAPI_GET_ADDRESS_CAPS, *PNDIS_TAPI_GET_ADDRESS_CAPS; + +typedef struct _NDIS_TAPI_GET_ADDRESS_ID { + IN ULONG ulRequestID; + IN HDRV_LINE hdLine; + OUT ULONG ulAddressID; + IN ULONG ulAddressMode; + IN ULONG ulAddressSize; + IN CHAR szAddress[1]; +} NDIS_TAPI_GET_ADDRESS_ID, *PNDIS_TAPI_GET_ADDRESS_ID; + +typedef struct _NDIS_TAPI_GET_ADDRESS_STATUS { + IN ULONG ulRequestID; + IN HDRV_LINE hdLine; + IN ULONG ulAddressID; + OUT LINE_ADDRESS_STATUS LineAddressStatus; +} NDIS_TAPI_GET_ADDRESS_STATUS, *PNDIS_TAPI_GET_ADDRESS_STATUS; + +typedef struct _NDIS_TAPI_GET_CALL_ADDRESS_ID { + IN ULONG ulRequestID; + IN HDRV_CALL hdCall; + OUT ULONG ulAddressID; +} NDIS_TAPI_GET_CALL_ADDRESS_ID, *PNDIS_TAPI_GET_CALL_ADDRESS_ID; + +typedef struct _NDIS_TAPI_GET_CALL_INFO { + ULONG ulRequestID; + IN HDRV_CALL hdCall; + OUT LINE_CALL_INFO LineCallInfo; +} NDIS_TAPI_GET_CALL_INFO, *PNDIS_TAPI_GET_CALL_INFO; + +typedef struct _NDIS_TAPI_GET_CALL_STATUS { + IN ULONG ulRequestID; + IN HDRV_CALL hdCall; + OUT LINE_CALL_STATUS LineCallStatus; +} NDIS_TAPI_GET_CALL_STATUS, *PNDIS_TAPI_GET_CALL_STATUS; + +typedef struct _NDIS_TAPI_GET_DEV_CAPS { + IN ULONG ulRequestID; + IN ULONG ulDeviceID; + IN ULONG ulExtVersion; + OUT LINE_DEV_CAPS LineDevCaps; +} NDIS_TAPI_GET_DEV_CAPS, *PNDIS_TAPI_GET_DEV_CAPS; + +typedef struct _NDIS_TAPI_GET_DEV_CONFIG { + IN ULONG ulRequestID; + IN ULONG ulDeviceID; + IN ULONG ulDeviceClassSize; + IN ULONG ulDeviceClassOffset; + OUT VAR_STRING DeviceConfig; +} NDIS_TAPI_GET_DEV_CONFIG, *PNDIS_TAPI_GET_DEV_CONFIG; + +typedef struct _NDIS_TAPI_GET_EXTENSION_ID { + IN ULONG ulRequestID; + IN ULONG ulDeviceID; + OUT LINE_EXTENSION_ID LineExtensionID; +} NDIS_TAPI_GET_EXTENSION_ID, *PNDIS_TAPI_GET_EXTENSION_ID; + +typedef struct _NDIS_TAPI_GET_ID { + IN ULONG ulRequestID; + IN HDRV_LINE hdLine; + IN ULONG ulAddressID; + IN HDRV_CALL hdCall; + IN ULONG ulSelect; + IN ULONG ulDeviceClassSize; + IN ULONG ulDeviceClassOffset; + OUT VAR_STRING DeviceID; +} NDIS_TAPI_GET_ID, *PNDIS_TAPI_GET_ID; + +typedef struct _NDIS_TAPI_GET_LINE_DEV_STATUS { + IN ULONG ulRequestID; + IN HDRV_LINE hdLine; + OUT LINE_DEV_STATUS LineDevStatus; +} NDIS_TAPI_GET_LINE_DEV_STATUS, *PNDIS_TAPI_GET_LINE_DEV_STATUS; + +typedef struct _NDIS_TAPI_MAKE_CALL { + IN ULONG ulRequestID; + IN HDRV_LINE hdLine; + IN HTAPI_CALL htCall; + OUT HDRV_CALL hdCall; + IN ULONG ulDestAddressSize; + IN ULONG ulDestAddressOffset; + IN BOOLEAN bUseDefaultLineCallParams; + IN LINE_CALL_PARAMS LineCallParams; +} NDIS_TAPI_MAKE_CALL, *PNDIS_TAPI_MAKE_CALL; + +typedef struct _NDIS_TAPI_NEGOTIATE_EXT_VERSION { + IN ULONG ulRequestID; + IN ULONG ulDeviceID; + IN ULONG ulLowVersion; + IN ULONG ulHighVersion; + OUT ULONG ulExtVersion; +} NDIS_TAPI_NEGOTIATE_EXT_VERSION, *PNDIS_TAPI_NEGOTIATE_EXT_VERSION; + +typedef struct _NDIS_TAPI_PROVIDER_INITIALIZE { + IN ULONG ulRequestID; + IN ULONG ulDeviceIDBase; + OUT ULONG ulNumLineDevs; + OUT ULONG ulProviderID; +} NDIS_TAPI_PROVIDER_INITIALIZE, *PNDIS_TAPI_PROVIDER_INITIALIZE; + + +#define CO_TAPI_VERSION NDIS_TAPI_CURRENT_VERSION + +#define CO_TAPI_FLAG_OUTGOING_CALL 0x00000001 +#define CO_TAPI_FLAG_INCOMING_CALL 0x00000002 +#define CO_TAPI_FLAG_USE_DEFAULT_CALLPARAMS 0x00000004 + +#define AF_TAPI_SAP_TYPE 0x00008000 + +typedef struct _CO_TAPI_ADDRESS_CAPS { + IN ULONG ulLineID; + IN ULONG ulAddressID; + OUT ULONG ulFlags; + OUT LINE_ADDRESS_CAPS LineAddressCaps; +} CO_TAPI_ADDRESS_CAPS, *PCO_TAPI_ADDRESS_CAPS; + +/* CO_TAPI_CM_CAPS.ulFlags constants */ +#define CO_TAPI_FLAG_PER_LINE_CAPS 0x00000001 + +typedef struct _CO_TAPI_CM_CAPS { + OUT ULONG ulCoTapiVersion; + OUT ULONG ulNumLines; + OUT ULONG ulFlags; +} CO_TAPI_CM_CAPS, *PCO_TAPI_CM_CAPS; + +typedef struct _CO_TAPI_CALL_DIAGNOSTICS { + OUT ULONG ulOrigin; + OUT ULONG ulReason; + OUT NDIS_VAR_DATA_DESC DiagInfo; +} CO_TAPI_CALL_DIAGNOSTICS, *PCO_TAPI_CALL_DIAGNOSTICS; + + +/* CO_TAPI_LINE_CAPS.ulFlags constants */ +#define CO_TAPI_FLAG_PER_ADDRESS_CAPS 0x00000001 + +typedef struct _CO_TAPI_LINE_CAPS { + IN ULONG ulLineID; + OUT ULONG ulFlags; + OUT LINE_DEV_CAPS LineDevCaps; +} CO_TAPI_LINE_CAPS, *PCO_TAPI_LINE_CAPS; + +typedef struct _CO_TAPI_TRANSLATE_NDIS_CALLPARAMS { + IN ULONG ulFlags; + IN NDIS_VAR_DATA_DESC NdisCallParams; + OUT NDIS_VAR_DATA_DESC LineCallInfo; +} CO_TAPI_TRANSLATE_NDIS_CALLPARAMS, *PCO_TAPI_TRANSLATE_NDIS_CALLPARAMS; + +typedef struct _CO_TAPI_TRANSLATE_TAPI_CALLPARAMS { + IN ULONG ulLineID; + IN ULONG ulAddressID; + IN ULONG ulFlags; + IN NDIS_VAR_DATA_DESC DestAddress; + IN NDIS_VAR_DATA_DESC LineCallParams; + OUT NDIS_VAR_DATA_DESC NdisCallParams; +} CO_TAPI_TRANSLATE_TAPI_CALLPARAMS, *PCO_TAPI_TRANSLATE_TAPI_CALLPARAMS; + +/* CO_TAPI_TRANSLATE_SAP.ulLineID constants */ +#define CO_TAPI_LINE_ID_UNSPECIFIED 0xFFFFFFFF + +/* CO_TAPI_TRANSLATE_SAP.ulAddressID constants */ +#define CO_TAPI_ADDRESS_ID_UNSPECIFIED 0xFFFFFFFF + +typedef struct _CO_TAPI_TRANSLATE_SAP { + IN ULONG ulLineID; + IN ULONG ulAddressID; + IN ULONG ulMediaModes; + IN ULONG Reserved; + OUT ULONG NumberOfSaps; + OUT NDIS_VAR_DATA_DESC NdisSapParams[1]; +} CO_AF_TAPI_SAP, *PCO_AF_TAPI_SAP; + +typedef struct _CO_AF_TAPI_INCOMING_CALL_PARAMETERS { + IN ULONG ulLineID; + IN ULONG ulAddressID; + IN ULONG ulFlags; + IN NDIS_VAR_DATA_DESC LineCallInfo; +} CO_AF_TAPI_INCOMING_CALL_PARAMETERS, *PCO_AF_TAPI_INCOMING_CALL_PARAMETERS; + +typedef struct _CO_AF_TAPI_MAKE_CALL_PARAMETERS { + IN ULONG ulLineID; + IN ULONG ulAddressID; + IN ULONG ulFlags; + IN NDIS_VAR_DATA_DESC DestAddress; + IN NDIS_VAR_DATA_DESC LineCallParams; +} CO_AF_TAPI_MAKE_CALL_PARAMETERS, *PCO_AF_TAPI_MAKE_CALL_PARAMETERS; + +#ifdef __cplusplus +} +#endif + +#endif /* __NDISTAPI_H */ diff --git a/reactos/include/ddk/ndiswan.h b/reactos/include/ddk/ndiswan.h new file mode 100644 index 00000000000..89553b65495 --- /dev/null +++ b/reactos/include/ddk/ndiswan.h @@ -0,0 +1,251 @@ +/* + * ndiswan.h + * + * Definitions for NDIS WAN miniport drivers + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __NDISWAN_H +#define __NDISWAN_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include "ndis.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define NDIS_USE_WAN_WRAPPER 0x00000001 + +#define NDIS_STATUS_TAPI_INDICATION ((NDIS_STATUS)0x40010080L) + +/* NDIS_WAN_INFO.FramingBits constants */ +#define RAS_FRAMING 0x00000001 +#define RAS_COMPRESSION 0x00000002 + +#define ARAP_V1_FRAMING 0x00000004 +#define ARAP_V2_FRAMING 0x00000008 +#define ARAP_FRAMING (ARAP_V1_FRAMING | ARAP_V2_FRAMING) + +#define PPP_MULTILINK_FRAMING 0x00000010 +#define PPP_SHORT_SEQUENCE_HDR_FORMAT 0x00000020 +#define PPP_MC_MULTILINK_FRAMING 0x00000040 + +#define PPP_FRAMING 0x00000100 +#define PPP_COMPRESS_ADDRESS_CONTROL 0x00000200 +#define PPP_COMPRESS_PROTOCOL_FIELD 0x00000400 +#define PPP_ACCM_SUPPORTED 0x00000800 + +#define SLIP_FRAMING 0x00001000 +#define SLIP_VJ_COMPRESSION 0x00002000 +#define SLIP_VJ_AUTODETECT 0x00004000 + +#define MEDIA_NRZ_ENCODING 0x00010000 +#define MEDIA_NRZI_ENCODING 0x00020000 +#define MEDIA_NLPID 0x00040000 + +#define RFC_1356_FRAMING 0x00100000 +#define RFC_1483_FRAMING 0x00200000 +#define RFC_1490_FRAMING 0x00400000 +#define LLC_ENCAPSULATION 0x00800000 + +#define SHIVA_FRAMING 0x01000000 +#define NBF_PRESERVE_MAC_ADDRESS 0x01000000 + +#define PASS_THROUGH_MODE 0x10000000 +#define RAW_PASS_THROUGH_MODE 0x20000000 + +#define TAPI_PROVIDER 0x80000000 + +typedef struct _NDIS_WAN_INFO { + OUT ULONG MaxFrameSize; + OUT ULONG MaxTransmit; + OUT ULONG HeaderPadding; + OUT ULONG TailPadding; + OUT ULONG Endpoints; + OUT UINT MemoryFlags; + OUT NDIS_PHYSICAL_ADDRESS HighestAcceptableAddress; + OUT ULONG FramingBits; + OUT ULONG DesiredACCM; +} NDIS_WAN_INFO, *PNDIS_WAN_INFO; + +typedef struct _NDIS_WAN_GET_LINK_INFO { + IN NDIS_HANDLE NdisLinkHandle; + OUT ULONG MaxSendFrameSize; + OUT ULONG MaxRecvFrameSize; + OUT ULONG HeaderPadding; + OUT ULONG TailPadding; + OUT ULONG SendFramingBits; + OUT ULONG RecvFramingBits; + OUT ULONG SendCompressionBits; + OUT ULONG RecvCompressionBits; + OUT ULONG SendACCM; + OUT ULONG RecvACCM; +} NDIS_WAN_GET_LINK_INFO, *PNDIS_WAN_GET_LINK_INFO; + +typedef struct _NDIS_WAN_SET_LINK_INFO { + IN NDIS_HANDLE NdisLinkHandle; + IN ULONG MaxSendFrameSize; + IN ULONG MaxRecvFrameSize; + IN ULONG HeaderPadding; + IN ULONG TailPadding; + IN ULONG SendFramingBits; + IN ULONG RecvFramingBits; + IN ULONG SendCompressionBits; + IN ULONG RecvCompressionBits; + IN ULONG SendACCM; + IN ULONG RecvACCM; +} NDIS_WAN_SET_LINK_INFO, *PNDIS_WAN_SET_LINK_INFO; + +/* NDIS_WAN_COMPRESS_INFO.MSCompType constants */ +#define NDISWAN_COMPRESSION 0x00000001 +#define NDISWAN_ENCRYPTION 0x00000010 +#define NDISWAN_40_ENCRYPTION 0x00000020 +#define NDISWAN_128_ENCRYPTION 0x00000040 +#define NDISWAN_56_ENCRYPTION 0x00000080 +#define NDISWAN_HISTORY_LESS 0x01000000 + +/* NDIS_WAN_COMPRESS_INFO.CompType constants */ +#define COMPTYPE_OUI 0 +#define COMPTYPE_NT31RAS 254 +#define COMPTYPE_NONE 255 + +typedef struct _NDIS_WAN_COMPRESS_INFO { + UCHAR SessionKey[8]; + ULONG MSCompType; + UCHAR CompType; + USHORT CompLength; + _ANONYMOUS_UNION union { + struct { + UCHAR CompOUI[3]; + UCHAR CompSubType; + UCHAR CompValues[32]; + } Proprietary; + struct { + UCHAR CompValues[32]; + } Public; + } DUMMYUNIONNAME; +} NDIS_WAN_COMPRESS_INFO; + +typedef NDIS_WAN_COMPRESS_INFO *PNDIS_WAN_COMPRESS_INFO; + +typedef struct _NDIS_WAN_GET_COMP_INFO { + IN NDIS_HANDLE NdisLinkHandle; + OUT NDIS_WAN_COMPRESS_INFO SendCapabilities; + OUT NDIS_WAN_COMPRESS_INFO RecvCapabilities; +} NDIS_WAN_GET_COMP_INFO, *PNDIS_WAN_GET_COMP_INFO; + +typedef struct _NDIS_WAN_SET_COMP_INFO { + IN NDIS_HANDLE NdisLinkHandle; + IN NDIS_WAN_COMPRESS_INFO SendCapabilities; + IN NDIS_WAN_COMPRESS_INFO RecvCapabilities; +} NDIS_WAN_SET_COMP_INFO, *PNDIS_WAN_SET_COMP_INFO; + +typedef struct _NDIS_WAN_GET_STATS_INFO { + IN NDIS_HANDLE NdisLinkHandle; + OUT ULONG BytesSent; + OUT ULONG BytesRcvd; + OUT ULONG FramesSent; + OUT ULONG FramesRcvd; + OUT ULONG CRCErrors; + OUT ULONG TimeoutErrors; + OUT ULONG AlignmentErrors; + OUT ULONG SerialOverrunErrors; + OUT ULONG FramingErrors; + OUT ULONG BufferOverrunErrors; + OUT ULONG BytesTransmittedUncompressed; + OUT ULONG BytesReceivedUncompressed; + OUT ULONG BytesTransmittedCompressed; + OUT ULONG BytesReceivedCompressed; +} NDIS_WAN_GET_STATS_INFO, *PNDIS_WAN_GET_STATS_INFO; + +#define NdisMWanInitializeWrapper(NdisWrapperHandle, \ + SystemSpecific1, \ + SystemSpecific2, \ + SystemSpecific3) \ +{ \ + NdisMInitializeWrapper(NdisWrapperHandle, \ + SystemSpecific1, \ + SystemSpecific2, \ + SystemSpecific3); \ +} + +typedef struct _NDIS_WAN_CO_INFO { + OUT ULONG MaxFrameSize; + OUT ULONG MaxSendWindow; + OUT ULONG FramingBits; + OUT ULONG DesiredACCM; +} NDIS_WAN_CO_INFO, *PNDIS_WAN_CO_INFO; + +typedef struct _NDIS_WAN_CO_GET_LINK_INFO { + OUT ULONG MaxSendFrameSize; + OUT ULONG MaxRecvFrameSize; + OUT ULONG SendFramingBits; + OUT ULONG RecvFramingBits; + OUT ULONG SendCompressionBits; + OUT ULONG RecvCompressionBits; + OUT ULONG SendACCM; + OUT ULONG RecvACCM; +} NDIS_WAN_CO_GET_LINK_INFO, *PNDIS_WAN_CO_GET_LINK_INFO; + +typedef struct _NDIS_WAN_CO_SET_LINK_INFO { + IN ULONG MaxSendFrameSize; + IN ULONG MaxRecvFrameSize; + IN ULONG SendFramingBits; + IN ULONG RecvFramingBits; + IN ULONG SendCompressionBits; + IN ULONG RecvCompressionBits; + IN ULONG SendACCM; + IN ULONG RecvACCM; +} NDIS_WAN_CO_SET_LINK_INFO, *PNDIS_WAN_CO_SET_LINK_INFO; + +typedef struct _NDIS_WAN_CO_GET_COMP_INFO { + OUT NDIS_WAN_COMPRESS_INFO SendCapabilities; + OUT NDIS_WAN_COMPRESS_INFO RecvCapabilities; +} NDIS_WAN_CO_GET_COMP_INFO, *PNDIS_WAN_CO_GET_COMP_INFO; + +typedef struct _NDIS_WAN_CO_SET_COMP_INFO { + IN NDIS_WAN_COMPRESS_INFO SendCapabilities; + IN NDIS_WAN_COMPRESS_INFO RecvCapabilities; +} NDIS_WAN_CO_SET_COMP_INFO, *PNDIS_WAN_CO_SET_COMP_INFO; + +typedef struct _NDIS_WAN_CO_GET_STATS_INFO { + OUT ULONG BytesSent; + OUT ULONG BytesRcvd; + OUT ULONG FramesSent; + OUT ULONG FramesRcvd; + OUT ULONG CRCErrors; + OUT ULONG TimeoutErrors; + OUT ULONG AlignmentErrors; + OUT ULONG SerialOverrunErrors; + OUT ULONG FramingErrors; + OUT ULONG BufferOverrunErrors; + OUT ULONG BytesTransmittedUncompressed; + OUT ULONG BytesReceivedUncompressed; + OUT ULONG BytesTransmittedCompressed; + OUT ULONG BytesReceivedCompressed; +} NDIS_WAN_CO_GET_STATS_INFO, *PNDIS_WAN_CO_GET_STATS_INFO; + +#ifdef __cplusplus +} +#endif + +#endif /* __NDISWAN_H */ diff --git a/reactos/include/ddk/netevent.h b/reactos/include/ddk/netevent.h new file mode 100644 index 00000000000..0cf66e03217 --- /dev/null +++ b/reactos/include/ddk/netevent.h @@ -0,0 +1,42 @@ +/* + * netevent.h + * + * Network events + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __NETEVENT_H +#define __NETEVENT_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#define EVENT_TRANSPORT_REGISTER_FAILED 0xC000232CL + +#define EVENT_TRANSPORT_ADAPTER_NOT_FOUND 0xC000232EL + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __NETEVENT_H */ diff --git a/reactos/include/ddk/netpnp.h b/reactos/include/ddk/netpnp.h new file mode 100644 index 00000000000..09ea55e182b --- /dev/null +++ b/reactos/include/ddk/netpnp.h @@ -0,0 +1,69 @@ +/* + * netpnp.h + * + * Network Plug and Play event support + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __NETPNP_H +#define __NETPNP_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum _NET_PNP_EVENT_CODE { + NetEventSetPower, + NetEventQueryPower, + NetEventQueryRemoveDevice, + NetEventCancelRemoveDevice, + NetEventReconfigure, + NetEventBindList, + NetEventBindsComplete, + NetEventPnPCapabilities, + NetEventMaximum +} NET_PNP_EVENT_CODE, *PNET_PNP_EVENT_CODE; + +typedef struct _NET_PNP_EVENT { + NET_PNP_EVENT_CODE NetEvent; + PVOID Buffer; + ULONG BufferLength; + ULONG_PTR NdisReserved[4]; + ULONG_PTR TransportReserved[4]; + ULONG_PTR TdiReserved[4]; + ULONG_PTR TdiClientReserved[4]; +} NET_PNP_EVENT, *PNET_PNP_EVENT; + +typedef enum _NET_DEVICE_POWER_STATE { + NetDeviceStateUnspecified, + NetDeviceStateD0, + NetDeviceStateD1, + NetDeviceStateD2, + NetDeviceStateD3, + NetDeviceStateMaximum +} NET_DEVICE_POWER_STATE, *PNET_DEVICE_POWER_STATE; + +#ifdef __cplusplus +} +#endif + +#endif /* __NETPNP_H */ diff --git a/reactos/include/ddk/newdev.h b/reactos/include/ddk/newdev.h new file mode 100644 index 00000000000..9e317790009 --- /dev/null +++ b/reactos/include/ddk/newdev.h @@ -0,0 +1,66 @@ +/* + * newdev.h + * + * Driver installation DLL interface + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __NEWDEV_H +#define __NEWDEV_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* UpdateDriverForPlugAndPlayDevices.InstallFlags constants */ +#define INSTALLFLAG_FORCE 0x00000001 +#define INSTALLFLAG_READONLY 0x00000002 +#define INSTALLFLAG_NONINTERACTIVE 0x00000004 +#define INSTALLFLAG_BITS 0x00000007 + +BOOL WINAPI +UpdateDriverForPlugAndPlayDevicesA( + HWND hwndParent, + LPCSTR HardwareId, + LPCSTR FullInfPath, + DWORD InstallFlags, + PBOOL bRebootRequired OPTIONAL); + +BOOL WINAPI +UpdateDriverForPlugAndPlayDevicesW( + HWND hwndParent, + LPCWSTR HardwareId, + LPCWSTR FullInfPath, + DWORD InstallFlags, + PBOOL bRebootRequired OPTIONAL); + +#ifdef UNICODE +#define UpdateDriverForPlugAndPlayDevices UpdateDriverForPlugAndPlayDevicesW +#else +#define UpdateDriverForPlugAndPlayDevices UpdateDriverForPlugAndPlayDevicesA +#endif /* UNICODE */ + +#ifdef __cplusplus +} +#endif + +#endif /* __NEWDEV_H */ diff --git a/reactos/include/ddk/ntagp.h b/reactos/include/ddk/ntagp.h new file mode 100644 index 00000000000..d7d7411af7c --- /dev/null +++ b/reactos/include/ddk/ntagp.h @@ -0,0 +1,109 @@ +/* + * ntagp.h + * + * NT AGP bus driver interface + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Gregor Anich + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __NTAGP_H +#define __NTAGP_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include "video.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define AGP_BUS_INTERFACE_V1 1L +#define AGP_BUS_INTERFACE_V2 2L + +/* Indicates wether the GART supports mapping of physical memory for the CPU */ +#define AGP_CAPABILITIES_MAP_PHYSICAL 0x00000001L + +typedef NTSTATUS +(DDKAPI *PAGP_BUS_COMMIT_MEMORY)( + IN PVOID AgpContext, + IN PVOID MapHandle, + IN ULONG NumberOfPages, + IN ULONG OffsetInPages, + IN OUT PMDL Mdl OPTIONAL, + OUT PHYSICAL_ADDRESS *MemoryBase); + +typedef NTSTATUS +(DDKAPI *PAGP_BUS_FREE_MEMORY)( + IN PVOID AgpContext, + IN PVOID MapHandle, + IN ULONG NumberOfPages, + IN ULONG OffsetInPages); + +typedef NTSTATUS +(DDKAPI *PAGP_BUS_RELEASE_MEMORY)( + IN PVOID AgpContext, + IN PVOID MapHandle); + +typedef NTSTATUS +(DDKAPI *PAGP_BUS_RESERVE_MEMORY)( + IN PVOID AgpContext, + IN ULONG NumberOfPages, + IN MEMORY_CACHING_TYPE MemoryType, + OUT PVOID *MapHandle, + OUT PHYSICAL_ADDRESS *PhysicalAddress OPTIONAL); + +typedef NTSTATUS +(DDKAPI *PAGP_BUS_SET_RATE)( + IN PVOID AgpContext, + IN ULONG AgpRate); + +typedef NTSTATUS +(DDKAPI *PAGP_GET_MAPPED_PAGES)( + IN PVOID AgpContext, + IN PVOID MapHandle, + IN ULONG NumberOfPages, + IN ULONG OffsetInPages, + OUT PMDL Mdl); + +typedef struct _AGP_BUS_INTERFACE_STANDARD { + USHORT Size; + USHORT Version; + PVOID AgpContext; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; + + ULONG Capabilities; + PAGP_BUS_RESERVE_MEMORY ReserveMemory; + PAGP_BUS_RELEASE_MEMORY ReleaseMemory; + PAGP_BUS_COMMIT_MEMORY CommitMemory; + PAGP_BUS_FREE_MEMORY FreeMemory; + PAGP_GET_MAPPED_PAGES GetMappedPages; + PAGP_BUS_SET_RATE SetRate; +} AGP_BUS_INTERFACE_STANDARD, *PAGP_BUS_INTERFACE_STANDARD; + +#define AGP_BUS_INTERFACE_V2_SIZE sizeof(AGP_BUS_INTERFACE_STANDARD) +#define AGP_BUS_INTERFACE_V1_SIZE \ + (AGP_BUS_INTERFACE_V2_SIZE - sizeof(PAGP_BUS_SET_RATE)) + +#ifdef __cplusplus +} +#endif + +#endif /* __NTAGP_H */ + diff --git a/reactos/include/ddk/ntdd8042.h b/reactos/include/ddk/ntdd8042.h new file mode 100644 index 00000000000..99be12c1e4f --- /dev/null +++ b/reactos/include/ddk/ntdd8042.h @@ -0,0 +1,212 @@ +/* + * ntdd8042.h + * + * i8042 IOCTL interface. + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __NTDD8042_H +#define __NTDD8042_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include "ntddkbd.h" +#include "ntddmou.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define IOCTL_INTERNAL_I8042_CONTROLLER_WRITE_BUFFER \ + CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0FF2, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_I8042_HOOK_KEYBOARD \ + CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0FF0, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_I8042_KEYBOARD_START_INFORMATION \ + CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0FF3, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_I8042_KEYBOARD_WRITE_BUFFER \ + CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0FF1, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_I8042_HOOK_MOUSE \ + CTL_CODE(FILE_DEVICE_MOUSE, 0x0FF0, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_I8042_MOUSE_START_INFORMATION \ + CTL_CODE(FILE_DEVICE_MOUSE, 0x0FF3, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_I8042_MOUSE_WRITE_BUFFER \ + CTL_CODE(FILE_DEVICE_MOUSE, 0x0FF1, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define I8042_POWER_SYS_BUTTON 0x0001 +#define I8042_SLEEP_SYS_BUTTON 0x0002 +#define I8042_WAKE_SYS_BUTTON 0x0004 +#define I8042_SYS_BUTTONS (I8042_POWER_SYS_BUTTON | \ + I8042_SLEEP_SYS_BUTTON | \ + I8042_WAKE_SYS_BUTTON) + +typedef enum _TRANSMIT_STATE { + Idle = 0, + SendingBytes +} TRANSMIT_STATE; + +typedef struct _OUTPUT_PACKET { + PUCHAR Bytes; + ULONG CurrentByte; + ULONG ByteCount; + TRANSMIT_STATE State; +} OUTPUT_PACKET, *POUTPUT_PACKET; + +typedef enum _KEYBOARD_SCAN_STATE { + Normal, + GotE0, + GotE1 +} KEYBOARD_SCAN_STATE, *PKEYBOARD_SCAN_STATE; + +typedef enum _MOUSE_STATE { + MouseIdle, + XMovement, + YMovement, + ZMovement, + MouseExpectingACK, + MouseResetting +} MOUSE_STATE, *PMOUSE_STATE; + +typedef enum _MOUSE_RESET_SUBSTATE { + ExpectingReset, + ExpectingResetId, + ExpectingGetDeviceIdACK, + ExpectingGetDeviceIdValue, + ExpectingSetResolutionDefaultACK, + ExpectingSetResolutionDefaultValueACK, + ExpectingSetResolutionACK, + ExpectingSetResolutionValueACK, + ExpectingSetScaling1to1ACK, + ExpectingSetScaling1to1ACK2, + ExpectingSetScaling1to1ACK3, + ExpectingReadMouseStatusACK, + ExpectingReadMouseStatusByte1, + ExpectingReadMouseStatusByte2, + ExpectingReadMouseStatusByte3, + StartPnPIdDetection, + ExpectingLoopSetSamplingRateACK, + ExpectingLoopSetSamplingRateValueACK, + ExpectingPnpIdByte1, + ExpectingPnpIdByte2, + ExpectingPnpIdByte3, + ExpectingPnpIdByte4, + ExpectingPnpIdByte5, + ExpectingPnpIdByte6, + ExpectingPnpIdByte7, + EnableWheel, + Enable5Buttons, + ExpectingGetDeviceId2ACK, + ExpectingGetDeviceId2Value, + ExpectingSetSamplingRateACK, + ExpectingSetSamplingRateValueACK, + ExpectingEnableACK, + ExpectingFinalResolutionACK, + ExpectingFinalResolutionValueACK, + ExpectingGetDeviceIdDetectACK, + ExpectingGetDeviceIdDetectValue, + CustomHookStateMinimum = 100, + CustomHookStateMaximum = 999, + I8042ReservedMinimum = 1000 +} MOUSE_RESET_SUBSTATE, *PMOUSE_RESET_SUBSTATE; + +typedef struct _INTERNAL_I8042_START_INFORMATION { + ULONG Size; + PKINTERRUPT InterruptObject; + ULONG Reserved[8]; +} INTERNAL_I8042_START_INFORMATION, *PINTERNAL_I8042_START_INFORMATION; + +typedef VOID DDKAPI +(*PI8042_ISR_WRITE_PORT)( + IN PVOID Context, + IN UCHAR Value); + +typedef VOID DDKAPI +(*PI8042_QUEUE_PACKET)( + IN PVOID Context); + +typedef NTSTATUS DDKAPI +(*PI8042_SYNCH_READ_PORT) ( + IN PVOID Context, + OUT PUCHAR Value, + IN BOOLEAN WaitForACK); + +typedef NTSTATUS DDKAPI +(*PI8042_SYNCH_WRITE_PORT)( + IN PVOID Context, + IN UCHAR Value, + IN BOOLEAN WaitForACK); + + +typedef NTSTATUS DDKAPI +(*PI8042_KEYBOARD_INITIALIZATION_ROUTINE)( + IN PVOID InitializationContext, + IN PVOID SynchFuncContext, + IN PI8042_SYNCH_READ_PORT ReadPort, + IN PI8042_SYNCH_WRITE_PORT WritePort, + OUT PBOOLEAN TurnTranslationOn); + +typedef BOOLEAN DDKAPI +(*PI8042_KEYBOARD_ISR)( + PVOID IsrContext, + PKEYBOARD_INPUT_DATA CurrentInput, + POUTPUT_PACKET CurrentOutput, + UCHAR StatusByte, + PUCHAR Byte, + PBOOLEAN ContinueProcessing, + PKEYBOARD_SCAN_STATE ScanState); + +typedef struct _INTERNAL_I8042_HOOK_KEYBOARD { + OUT PVOID Context; + OUT PI8042_KEYBOARD_INITIALIZATION_ROUTINE InitializationRoutine; + OUT PI8042_KEYBOARD_ISR IsrRoutine; + IN PI8042_ISR_WRITE_PORT IsrWritePort; + IN PI8042_QUEUE_PACKET QueueKeyboardPacket; + IN PVOID CallContext; +} INTERNAL_I8042_HOOK_KEYBOARD, *PINTERNAL_I8042_HOOK_KEYBOARD; + +typedef BOOLEAN DDKAPI +(*PI8042_MOUSE_ISR)( + PVOID IsrContext, + PMOUSE_INPUT_DATA CurrentInput, + POUTPUT_PACKET CurrentOutput, + UCHAR StatusByte, + PUCHAR Byte, + PBOOLEAN ContinueProcessing, + PMOUSE_STATE MouseState, + PMOUSE_RESET_SUBSTATE ResetSubState); + +typedef struct _INTERNAL_I8042_HOOK_MOUSE { + OUT PVOID Context; + OUT PI8042_MOUSE_ISR IsrRoutine; + IN PI8042_ISR_WRITE_PORT IsrWritePort; + IN PI8042_QUEUE_PACKET QueueMousePacket; + IN PVOID CallContext; +} INTERNAL_I8042_HOOK_MOUSE, *PINTERNAL_I8042_HOOK_MOUSE; + +#ifdef __cplusplus +} +#endif + +#endif /* __NTDD8042_H */ diff --git a/reactos/include/ddk/ntddbeep.h b/reactos/include/ddk/ntddbeep.h new file mode 100644 index 00000000000..83a5012937b --- /dev/null +++ b/reactos/include/ddk/ntddbeep.h @@ -0,0 +1,52 @@ +/* + * ntddbeep.h + * + * Beep device IOCTL interface + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __NTDDBEEP_H +#define __NTDDBEEP_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define DD_BEEP_DEVICE_NAME "\\Device\\Beep" +#define DD_BEEP_DEVICE_NAME_U L"\\Device\\Beep" + +#define IOCTL_BEEP_SET \ + CTL_CODE(FILE_DEVICE_BEEP, 0, METHOD_BUFFERED, FILE_ANY_ACCESS) + +typedef struct _BEEP_SET_PARAMETERS { + ULONG Frequency; + ULONG Duration; +} BEEP_SET_PARAMETERS, *PBEEP_SET_PARAMETERS; + +#define BEEP_FREQUENCY_MINIMUM 0x25 +#define BEEP_FREQUENCY_MAXIMUM 0x7FFF + +#ifdef __cplusplus +} +#endif + +#endif /* __NTDDBEEP_H */ diff --git a/reactos/include/ddk/ntddcdrm.h b/reactos/include/ddk/ntddcdrm.h new file mode 100644 index 00000000000..306d734daa4 --- /dev/null +++ b/reactos/include/ddk/ntddcdrm.h @@ -0,0 +1,346 @@ +/* + * ntddcdrm.h + * + * CDROM IOCTL interface. + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __NTDDCDRM_H +#define __NTDDCDRM_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include "ntddstor.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define IOCTL_CDROM_BASE FILE_DEVICE_CD_ROM + +#define IOCTL_CDROM_CHECK_VERIFY \ + CTL_CODE(IOCTL_CDROM_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_CDROM_FIND_NEW_DEVICES \ + CTL_CODE(IOCTL_CDROM_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_CDROM_GET_CONTROL \ + CTL_CODE(IOCTL_CDROM_BASE, 0x000D, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_CDROM_GET_DRIVE_GEOMETRY \ + CTL_CODE(IOCTL_CDROM_BASE, 0x0013, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_CDROM_GET_LAST_SESSION \ + CTL_CODE(IOCTL_CDROM_BASE, 0x000E, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_CDROM_GET_VOLUME \ + CTL_CODE(IOCTL_CDROM_BASE, 0x0005, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_CDROM_PAUSE_AUDIO \ + CTL_CODE(IOCTL_CDROM_BASE, 0x0003, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_CDROM_PLAY_AUDIO_MSF \ + CTL_CODE(IOCTL_CDROM_BASE, 0x0006, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_CDROM_RAW_READ \ + CTL_CODE(IOCTL_CDROM_BASE, 0x000F, METHOD_OUT_DIRECT, FILE_READ_ACCESS) + +#define IOCTL_CDROM_READ_Q_CHANNEL \ + CTL_CODE(IOCTL_CDROM_BASE, 0x000B, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_CDROM_READ_TOC \ + CTL_CODE(IOCTL_CDROM_BASE, 0x0000, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_CDROM_READ_TOC_EX \ + CTL_CODE(IOCTL_CDROM_BASE, 0x0015, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_CDROM_RESUME_AUDIO \ + CTL_CODE(IOCTL_CDROM_BASE, 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_CDROM_SEEK_AUDIO_MSF \ + CTL_CODE(IOCTL_CDROM_BASE, 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_CDROM_SET_VOLUME \ + CTL_CODE(IOCTL_CDROM_BASE, 0x000A, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_CDROM_SIMBAD \ + CTL_CODE(IOCTL_CDROM_BASE, 0x1003, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_CDROM_STOP_AUDIO \ + CTL_CODE(IOCTL_CDROM_BASE, 0x0002, METHOD_BUFFERED, FILE_READ_ACCESS) + + +#define MAXIMUM_NUMBER_TRACKS 100 +#define MAXIMUM_CDROM_SIZE 804 +#define MINIMUM_CDROM_READ_TOC_EX_SIZE 2 + +typedef struct _TRACK_DATA { + UCHAR Reserved; + UCHAR Control : 4; + UCHAR Adr : 4; + UCHAR TrackNumber; + UCHAR Reserved1; + UCHAR Address[4]; +} TRACK_DATA, *PTRACK_DATA; + +/* CDROM_DISK_DATA.DiskData flags */ +#define CDROM_DISK_AUDIO_TRACK 0x00000001 +#define CDROM_DISK_DATA_TRACK 0x00000002 + +typedef struct _CDROM_DISK_DATA { + ULONG DiskData; +} CDROM_DISK_DATA, *PCDROM_DISK_DATA; + +typedef struct _CDROM_PLAY_AUDIO_MSF { + UCHAR StartingM; + UCHAR StartingS; + UCHAR StartingF; + UCHAR EndingM; + UCHAR EndingS; + UCHAR EndingF; +} CDROM_PLAY_AUDIO_MSF, *PCDROM_PLAY_AUDIO_MSF; + +/* CDROM_READ_TOC_EX.Format constants */ +#define CDROM_READ_TOC_EX_FORMAT_TOC 0x00 +#define CDROM_READ_TOC_EX_FORMAT_SESSION 0x01 +#define CDROM_READ_TOC_EX_FORMAT_FULL_TOC 0x02 +#define CDROM_READ_TOC_EX_FORMAT_PMA 0x03 +#define CDROM_READ_TOC_EX_FORMAT_ATIP 0x04 +#define CDROM_READ_TOC_EX_FORMAT_CDTEXT 0x05 + +typedef struct _CDROM_READ_TOC_EX { + UCHAR Format : 4; + UCHAR Reserved1 : 3; + UCHAR Msf : 1; + UCHAR SessionTrack; + UCHAR Reserved2; + UCHAR Reserved3; +} CDROM_READ_TOC_EX, *PCDROM_READ_TOC_EX; + +typedef struct _CDROM_SEEK_AUDIO_MSF { + UCHAR M; + UCHAR S; + UCHAR F; +} CDROM_SEEK_AUDIO_MSF, *PCDROM_SEEK_AUDIO_MSF; + +/* CDROM_SUB_Q_DATA_FORMAT.Format constants */ +#define IOCTL_CDROM_SUB_Q_CHANNEL 0x00 +#define IOCTL_CDROM_CURRENT_POSITION 0x01 +#define IOCTL_CDROM_MEDIA_CATALOG 0x02 +#define IOCTL_CDROM_TRACK_ISRC 0x03 + +typedef struct _CDROM_SUB_Q_DATA_FORMAT { + UCHAR Format; + UCHAR Track; +} CDROM_SUB_Q_DATA_FORMAT, *PCDROM_SUB_Q_DATA_FORMAT; + +typedef struct _CDROM_TOC { + UCHAR Length[2]; + UCHAR FirstTrack; + UCHAR LastTrack; + TRACK_DATA TrackData[MAXIMUM_NUMBER_TRACKS]; +} CDROM_TOC, *PCDROM_TOC; + +#define CDROM_TOC_SIZE sizeof(CDROM_TOC) + +typedef struct _CDROM_TOC_ATIP_DATA_BLOCK { + UCHAR CdrwReferenceSpeed : 3; + UCHAR Reserved3 : 1; + UCHAR WritePower : 3; + UCHAR True1 : 1; + UCHAR Reserved4 : 6; + UCHAR UnrestrictedUse : 1; + UCHAR Reserved5 : 1; + UCHAR A3Valid : 1; + UCHAR A2Valid : 1; + UCHAR A1Valid : 1; + UCHAR Reserved6 : 3; + UCHAR IsCdrw : 1; + UCHAR True2 : 1; + UCHAR Reserved7; + UCHAR LeadInMsf[3]; + UCHAR Reserved8; + UCHAR LeadOutMsf[3]; + UCHAR Reserved9; + UCHAR A1Values[3]; + UCHAR Reserved10; + UCHAR A2Values[3]; + UCHAR Reserved11; + UCHAR A3Values[3]; + UCHAR Reserved12; +} CDROM_TOC_ATIP_DATA_BLOCK, *PCDROM_TOC_ATIP_DATA_BLOCK; + +typedef struct _CDROM_TOC_ATIP_DATA { + UCHAR Length[2]; + UCHAR Reserved1; + UCHAR Reserved2; + CDROM_TOC_ATIP_DATA_BLOCK Descriptors[0]; +} CDROM_TOC_ATIP_DATA, *PCDROM_TOC_ATIP_DATA; + +/* CDROM_TOC_CD_TEXT_DATA_BLOCK.PackType constants */ +#define CDROM_CD_TEXT_PACK_ALBUM_NAME 0x80 +#define CDROM_CD_TEXT_PACK_PERFORMER 0x81 +#define CDROM_CD_TEXT_PACK_SONGWRITER 0x82 +#define CDROM_CD_TEXT_PACK_COMPOSER 0x83 +#define CDROM_CD_TEXT_PACK_ARRANGER 0x84 +#define CDROM_CD_TEXT_PACK_MESSAGES 0x85 +#define CDROM_CD_TEXT_PACK_DISC_ID 0x86 +#define CDROM_CD_TEXT_PACK_GENRE 0x87 +#define CDROM_CD_TEXT_PACK_TOC_INFO 0x88 +#define CDROM_CD_TEXT_PACK_TOC_INFO2 0x89 +#define CDROM_CD_TEXT_PACK_UPC_EAN 0x8e +#define CDROM_CD_TEXT_PACK_SIZE_INFO 0x8f + +typedef struct _CDROM_TOC_CD_TEXT_DATA_BLOCK { + UCHAR PackType; + UCHAR TrackNumber : 7; + UCHAR ExtensionFlag : 1; + UCHAR SequenceNumber; + UCHAR CharacterPosition : 4; + UCHAR BlockNumber : 3; + UCHAR Unicode : 1; + _ANONYMOUS_UNION union { + UCHAR Text[12]; + WCHAR WText[6]; + } DUMMYUNIONNAME; + UCHAR CRC[2]; +} CDROM_TOC_CD_TEXT_DATA_BLOCK, *PCDROM_TOC_CD_TEXT_DATA_BLOCK; + +typedef struct _CDROM_TOC_CD_TEXT_DATA { + UCHAR Length[2]; + UCHAR Reserved1; + UCHAR Reserved2; + CDROM_TOC_CD_TEXT_DATA_BLOCK Descriptors[0]; +} CDROM_TOC_CD_TEXT_DATA, *PCDROM_TOC_CD_TEXT_DATA; + +/* CDROM_TOC_FULL_TOC_DATA_BLOCK.Adr constants */ +#define ADR_NO_MODE_INFORMATION 0x0 +#define ADR_ENCODES_CURRENT_POSITION 0x1 +#define ADR_ENCODES_MEDIA_CATALOG 0x2 +#define ADR_ENCODES_ISRC 0x3 + +typedef struct _CDROM_TOC_FULL_TOC_DATA_BLOCK { + UCHAR SessionNumber; + UCHAR Control : 4; + UCHAR Adr : 4; + UCHAR Reserved1; + UCHAR Point; + UCHAR MsfExtra[3]; + UCHAR Zero; + UCHAR Msf[3]; +} CDROM_TOC_FULL_TOC_DATA_BLOCK, *PCDROM_TOC_FULL_TOC_DATA_BLOCK; + +typedef struct _CDROM_TOC_FULL_TOC_DATA { + UCHAR Length[2]; + UCHAR FirstCompleteSession; + UCHAR LastCompleteSession; + CDROM_TOC_FULL_TOC_DATA_BLOCK Descriptors[0]; +} CDROM_TOC_FULL_TOC_DATA, *PCDROM_TOC_FULL_TOC_DATA; + +typedef struct _CDROM_TOC_PMA_DATA { + UCHAR Length[2]; + UCHAR Reserved1; + UCHAR Reserved2; + CDROM_TOC_FULL_TOC_DATA_BLOCK Descriptors[0]; +} CDROM_TOC_PMA_DATA, *PCDROM_TOC_PMA_DATA; + +/* SUB_Q_HEADER.AudioStatus constants */ +#define AUDIO_STATUS_NOT_SUPPORTED 0x00 +#define AUDIO_STATUS_IN_PROGRESS 0x11 +#define AUDIO_STATUS_PAUSED 0x12 +#define AUDIO_STATUS_PLAY_COMPLETE 0x13 +#define AUDIO_STATUS_PLAY_ERROR 0x14 +#define AUDIO_STATUS_NO_STATUS 0x15 + +typedef struct _SUB_Q_HEADER { + UCHAR Reserved; + UCHAR AudioStatus; + UCHAR DataLength[2]; +} SUB_Q_HEADER, *PSUB_Q_HEADER; + +typedef struct _SUB_Q_MEDIA_CATALOG_NUMBER { + SUB_Q_HEADER Header; + UCHAR FormatCode; + UCHAR Reserved[3]; + UCHAR Reserved1 : 7; + UCHAR Mcval :1; + UCHAR MediaCatalog[15]; +} SUB_Q_MEDIA_CATALOG_NUMBER, *PSUB_Q_MEDIA_CATALOG_NUMBER; + +typedef struct _SUB_Q_TRACK_ISRC { + SUB_Q_HEADER Header; + UCHAR FormatCode; + UCHAR Reserved0; + UCHAR Track; + UCHAR Reserved1; + UCHAR Reserved2 : 7; + UCHAR Tcval : 1; + UCHAR TrackIsrc[15]; +} SUB_Q_TRACK_ISRC, *PSUB_Q_TRACK_ISRC; + +typedef struct _SUB_Q_CURRENT_POSITION { + SUB_Q_HEADER Header; + UCHAR FormatCode; + UCHAR Control : 4; + UCHAR ADR : 4; + UCHAR TrackNumber; + UCHAR IndexNumber; + UCHAR AbsoluteAddress[4]; + UCHAR TrackRelativeAddress[4]; +} SUB_Q_CURRENT_POSITION, *PSUB_Q_CURRENT_POSITION; + +typedef union _SUB_Q_CHANNEL_DATA { + SUB_Q_CURRENT_POSITION CurrentPosition; + SUB_Q_MEDIA_CATALOG_NUMBER MediaCatalog; + SUB_Q_TRACK_ISRC TrackIsrc; +} SUB_Q_CHANNEL_DATA, *PSUB_Q_CHANNEL_DATA; + +/* CDROM_AUDIO_CONTROL.LbaFormat constants */ +#define AUDIO_WITH_PREEMPHASIS 0x1 +#define DIGITAL_COPY_PERMITTED 0x2 +#define AUDIO_DATA_TRACK 0x4 +#define TWO_FOUR_CHANNEL_AUDIO 0x8 + +typedef struct _CDROM_AUDIO_CONTROL { + UCHAR LbaFormat; + USHORT LogicalBlocksPerSecond; +} CDROM_AUDIO_CONTROL, *PCDROM_AUDIO_CONTROL; + +typedef struct _VOLUME_CONTROL { + UCHAR PortVolume[4]; +} VOLUME_CONTROL, *PVOLUME_CONTROL; + +typedef enum _TRACK_MODE_TYPE { + YellowMode2, + XAForm2, + CDDA +} TRACK_MODE_TYPE, *PTRACK_MODE_TYPE; + +typedef struct __RAW_READ_INFO { + LARGE_INTEGER DiskOffset; + ULONG SectorCount; + TRACK_MODE_TYPE TrackMode; +} RAW_READ_INFO, *PRAW_READ_INFO; + +#ifdef __cplusplus +} +#endif + +#endif /* __NTDDCDRM_H */ diff --git a/reactos/include/ddk/ntddcdvd.h b/reactos/include/ddk/ntddcdvd.h new file mode 100644 index 00000000000..7df2b5f3f37 --- /dev/null +++ b/reactos/include/ddk/ntddcdvd.h @@ -0,0 +1,212 @@ +/* + * ntddcdvd.h + * + * DVD IOCTL interface. + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __NTDDCDVD_H +#define __NTDDCDVD_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include "ntddstor.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define IOCTL_DVD_BASE FILE_DEVICE_DVD + +#define IOCTL_DVD_END_SESSION \ + CTL_CODE(IOCTL_DVD_BASE, 0x0403, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_DVD_GET_REGION \ + CTL_CODE(IOCTL_DVD_BASE, 0x0405, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_DVD_READ_KEY \ + CTL_CODE(IOCTL_DVD_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_DVD_READ_STRUCTURE \ + CTL_CODE(IOCTL_DVD_BASE, 0x0450, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_DVD_SEND_KEY \ + CTL_CODE(IOCTL_DVD_BASE, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_DVD_START_SESSION \ + CTL_CODE(IOCTL_DVD_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_DVD_SET_READ_AHEAD \ + CTL_CODE(IOCTL_DVD_BASE, 0x0404, METHOD_BUFFERED, FILE_READ_ACCESS) + + +typedef ULONG DVD_SESSION_ID, *PDVD_SESSION_ID; + +typedef struct _STORAGE_SET_READ_AHEAD { + LARGE_INTEGER TriggerAddress; + LARGE_INTEGER TargetAddress; +} STORAGE_SET_READ_AHEAD, *PSTORAGE_SET_READ_AHEAD; + +typedef enum DVD_STRUCTURE_FORMAT { + DvdPhysicalDescriptor, + DvdCopyrightDescriptor, + DvdDiskKeyDescriptor, + DvdBCADescriptor, + DvdManufacturerDescriptor, + DvdMaxDescriptor +} DVD_STRUCTURE_FORMAT, *PDVD_STRUCTURE_FORMAT; + +#include +typedef struct DVD_READ_STRUCTURE { + LARGE_INTEGER BlockByteOffset; + DVD_STRUCTURE_FORMAT Format; + DVD_SESSION_ID SessionId; + UCHAR LayerNumber; +} DVD_READ_STRUCTURE, *PDVD_READ_STRUCTURE; +#include + +typedef struct _DVD_DESCRIPTOR_HEADER { + USHORT Length; + UCHAR Reserved[2]; + UCHAR Data[0]; +} DVD_DESCRIPTOR_HEADER, *PDVD_DESCRIPTOR_HEADER; + +#include +typedef struct _DVD_LAYER_DESCRIPTOR { + UCHAR BookVersion : 4; + UCHAR BookType : 4; + UCHAR MinimumRate : 4; + UCHAR DiskSize : 4; + UCHAR LayerType : 4; + UCHAR TrackPath : 1; + UCHAR NumberOfLayers : 2; + UCHAR Reserved1 : 1; + UCHAR TrackDensity : 4; + UCHAR LinearDensity : 4; + ULONG StartingDataSector; + ULONG EndDataSector; + ULONG EndLayerZeroSector; + UCHAR Reserved5 : 7; + UCHAR BCAFlag : 1; + UCHAR Reserved6; +} DVD_LAYER_DESCRIPTOR, *PDVD_LAYER_DESCRIPTOR; +#include + +typedef struct _DVD_COPYRIGHT_DESCRIPTOR { + UCHAR CopyrightProtectionType; + UCHAR RegionManagementInformation; + USHORT Reserved; +} DVD_COPYRIGHT_DESCRIPTOR, *PDVD_COPYRIGHT_DESCRIPTOR; + +typedef struct _DVD_DISK_KEY_DESCRIPTOR { + UCHAR DiskKeyData[2048]; +} DVD_DISK_KEY_DESCRIPTOR, *PDVD_DISK_KEY_DESCRIPTOR; + +typedef enum _DVD_KEY_TYPE { + DvdChallengeKey = 0x01, + DvdBusKey1, + DvdBusKey2, + DvdTitleKey, + DvdAsf, + DvdSetRpcKey = 0x6, + DvdGetRpcKey = 0x8, + DvdDiskKey = 0x80, + DvdInvalidateAGID = 0x3f +} DVD_KEY_TYPE; + +typedef struct _DVD_COPY_PROTECT_KEY { + ULONG KeyLength; + DVD_SESSION_ID SessionId; + DVD_KEY_TYPE KeyType; + ULONG KeyFlags; + union { + HANDLE FileHandle; + LARGE_INTEGER TitleOffset; + } Parameters; + UCHAR KeyData[0]; +} DVD_COPY_PROTECT_KEY, *PDVD_COPY_PROTECT_KEY; + +#define DVD_CHALLENGE_KEY_LENGTH (12 + sizeof(DVD_COPY_PROTECT_KEY)) +#define DVD_BUS_KEY_LENGTH (8 + sizeof(DVD_COPY_PROTECT_KEY)) +#define DVD_TITLE_KEY_LENGTH (8 + sizeof(DVD_COPY_PROTECT_KEY)) +#define DVD_DISK_KEY_LENGTH (2048 + sizeof(DVD_COPY_PROTECT_KEY)) +#define DVD_RPC_KEY_LENGTH (sizeof(DVD_RPC_KEY) + sizeof(DVD_COPY_PROTECT_KEY)) +#define DVD_SET_RPC_KEY_LENGTH (sizeof(DVD_SET_RPC_KEY) + sizeof(DVD_COPY_PROTECT_KEY)) +#define DVD_ASF_LENGTH (sizeof(DVD_ASF) + sizeof(DVD_COPY_PROTECT_KEY)) + +#define DVD_END_ALL_SESSIONS ((DVD_SESSION_ID) 0xffffffff) + + +#define DVD_CGMS_RESERVED_MASK 0x00000078 + +#define DVD_CGMS_COPY_PROTECT_MASK 0x00000018 +#define DVD_CGMS_COPY_PERMITTED 0x00000000 +#define DVD_CGMS_COPY_ONCE 0x00000010 +#define DVD_CGMS_NO_COPY 0x00000018 + +#define DVD_COPYRIGHT_MASK 0x00000040 +#define DVD_NOT_COPYRIGHTED 0x00000000 +#define DVD_COPYRIGHTED 0x00000040 + +#define DVD_SECTOR_PROTECT_MASK 0x00000020 +#define DVD_SECTOR_NOT_PROTECTED 0x00000000 +#define DVD_SECTOR_PROTECTED 0x00000020 + + +typedef struct _DVD_BCA_DESCRIPTOR { + UCHAR BCAInformation[0]; +} DVD_BCA_DESCRIPTOR, *PDVD_BCA_DESCRIPTOR; + +typedef struct _DVD_MANUFACTURER_DESCRIPTOR { + UCHAR ManufacturingInformation[2048]; +} DVD_MANUFACTURER_DESCRIPTOR, *PDVD_MANUFACTURER_DESCRIPTOR; + +typedef struct _DVD_RPC_KEY { + UCHAR UserResetsAvailable : 3; + UCHAR ManufacturerResetsAvailable : 3; + UCHAR TypeCode : 2; + UCHAR RegionMask; + UCHAR RpcScheme; + UCHAR Reserved2[1]; +} DVD_RPC_KEY, *PDVD_RPC_KEY; + +typedef struct _DVD_SET_RPC_KEY { + UCHAR PreferredDriveRegionCode; + UCHAR Reserved[3]; +} DVD_SET_RPC_KEY, *PDVD_SET_RPC_KEY; + +typedef struct _DVD_ASF { + UCHAR Reserved0[3]; + UCHAR SuccessFlag : 1; + UCHAR Reserved1 : 7; +} DVD_ASF, *PDVD_ASF; + +typedef struct _DVD_REGION { + UCHAR CopySystem; + UCHAR RegionData; + UCHAR SystemRegion; + UCHAR ResetCount; +} DVD_REGION, *PDVD_REGION; + +#ifdef __cplusplus +} +#endif + +#endif /* __NTDDCDVD_H */ diff --git a/reactos/include/ddk/ntddchgr.h b/reactos/include/ddk/ntddchgr.h new file mode 100644 index 00000000000..082c4743549 --- /dev/null +++ b/reactos/include/ddk/ntddchgr.h @@ -0,0 +1,352 @@ +/* + * ntddchgr.h + * + * Media changer IOCTL interface. + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __NTDDCHGR_H +#define __NTDDCHGR_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include "ntddstor.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define DD_CHANGER_DEVICE_NAME "\\Device\\Changer" +#define DD_CHANGER_DEVICE_NAME_U L"\\Device\\Changer" + +#define IOCTL_CHANGER_BASE FILE_DEVICE_CHANGER + +#define IOCTL_CHANGER_EXCHANGE_MEDIUM \ + CTL_CODE(IOCTL_CHANGER_BASE, 0x0008, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_CHANGER_GET_ELEMENT_STATUS \ + CTL_CODE(IOCTL_CHANGER_BASE, 0x0005, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_CHANGER_GET_PARAMETERS \ + CTL_CODE(IOCTL_CHANGER_BASE, 0x0000, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_CHANGER_GET_PRODUCT_DATA \ + CTL_CODE(IOCTL_CHANGER_BASE, 0x0002, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_CHANGER_GET_STATUS \ + CTL_CODE(IOCTL_CHANGER_BASE, 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_CHANGER_INITIALIZE_ELEMENT_STATUS \ + CTL_CODE(IOCTL_CHANGER_BASE, 0x0006, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_CHANGER_MOVE_MEDIUM \ + CTL_CODE(IOCTL_CHANGER_BASE, 0x0009, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_CHANGER_QUERY_VOLUME_TAGS \ + CTL_CODE(IOCTL_CHANGER_BASE, 0x000B, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_CHANGER_REINITIALIZE_TRANSPORT \ + CTL_CODE(IOCTL_CHANGER_BASE, 0x000A, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_CHANGER_SET_ACCESS \ + CTL_CODE(IOCTL_CHANGER_BASE, 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_CHANGER_SET_POSITION \ + CTL_CODE(IOCTL_CHANGER_BASE, 0x0007, METHOD_BUFFERED, FILE_READ_ACCESS) + + +#define MAX_VOLUME_ID_SIZE 36 +#define MAX_VOLUME_TEMPLATE_SIZE 40 + +typedef enum _ELEMENT_TYPE { + AllElements, + ChangerTransport, + ChangerSlot, + ChangerIEPort, + ChangerDrive, + ChangerDoor, + ChangerKeypad, + ChangerMaxElement +} ELEMENT_TYPE, *PELEMENT_TYPE; + +typedef struct _CHANGER_ELEMENT { + ELEMENT_TYPE ElementType; + ULONG ElementAddress; +} CHANGER_ELEMENT, *PCHANGER_ELEMENT; + +typedef struct _CHANGER_ELEMENT_LIST { + CHANGER_ELEMENT Element; + ULONG NumberOfElements; +} CHANGER_ELEMENT_LIST, *PCHANGER_ELEMENT_LIST; + +typedef struct _CHANGER_INITIALIZE_ELEMENT_STATUS { + CHANGER_ELEMENT_LIST ElementList; + BOOLEAN BarCodeScan; +} CHANGER_INITIALIZE_ELEMENT_STATUS, *PCHANGER_INITIALIZE_ELEMENT_STATUS; + +typedef struct _CHANGER_READ_ELEMENT_STATUS { + CHANGER_ELEMENT_LIST ElementList; + BOOLEAN VolumeTagInfo; +} CHANGER_READ_ELEMENT_STATUS, *PCHANGER_READ_ELEMENT_STATUS; + + +typedef struct _CHANGER_SET_POSITION { + CHANGER_ELEMENT Transport; + CHANGER_ELEMENT Destination; + BOOLEAN Flip; +} CHANGER_SET_POSITION, *PCHANGER_SET_POSITION; + +typedef struct _CHANGER_EXCHANGE_MEDIUM { + CHANGER_ELEMENT Transport; + CHANGER_ELEMENT Source; + CHANGER_ELEMENT Destination1; + CHANGER_ELEMENT Destination2; + BOOLEAN Flip1; + BOOLEAN Flip2; +} CHANGER_EXCHANGE_MEDIUM, *PCHANGER_EXCHANGE_MEDIUM; + +typedef struct _CHANGER_MOVE_MEDIUM { + CHANGER_ELEMENT Transport; + CHANGER_ELEMENT Source; + CHANGER_ELEMENT Destination; + BOOLEAN Flip; +} CHANGER_MOVE_MEDIUM, *PCHANGER_MOVE_MEDIUM; + +#define VENDOR_ID_LENGTH 8 +#define PRODUCT_ID_LENGTH 16 +#define REVISION_LENGTH 4 +#define SERIAL_NUMBER_LENGTH 32 + +typedef struct _CHANGER_PRODUCT_DATA { + UCHAR VendorId[VENDOR_ID_LENGTH]; + UCHAR ProductId[PRODUCT_ID_LENGTH]; + UCHAR Revision[REVISION_LENGTH]; + UCHAR SerialNumber[SERIAL_NUMBER_LENGTH]; + UCHAR DeviceType; +} CHANGER_PRODUCT_DATA, *PCHANGER_PRODUCT_DATA; + +/* CHANGER_SET_ACCESS.Control constants */ +#define LOCK_ELEMENT 0 +#define UNLOCK_ELEMENT 1 +#define EXTEND_IEPORT 2 +#define RETRACT_IEPORT 3 + +typedef struct _CHANGER_SET_ACCESS { + CHANGER_ELEMENT Element; + ULONG Control; +} CHANGER_SET_ACCESS, *PCHANGER_SET_ACCESS; + + +typedef enum _CHANGER_DEVICE_PROBLEM_TYPE { + DeviceProblemNone, + DeviceProblemHardware, + DeviceProblemCHMError, + DeviceProblemDoorOpen, + DeviceProblemCalibrationError, + DeviceProblemTargetFailure, + DeviceProblemCHMMoveError, + DeviceProblemCHMZeroError, + DeviceProblemCartridgeInsertError, + DeviceProblemPositionError, + DeviceProblemSensorError, + DeviceProblemCartridgeEjectError, + DeviceProblemGripperError, + DeviceProblemDriveError +} CHANGER_DEVICE_PROBLEM_TYPE, *PCHANGER_DEVICE_PROBLEM_TYPE; + +/* CHANGER_ELEMENT_STATUS(_EX).Flags constants */ +#define ELEMENT_STATUS_FULL 0x00000001 +#define ELEMENT_STATUS_IMPEXP 0x00000002 +#define ELEMENT_STATUS_EXCEPT 0x00000004 +#define ELEMENT_STATUS_ACCESS 0x00000008 +#define ELEMENT_STATUS_EXENAB 0x00000010 +#define ELEMENT_STATUS_INENAB 0x00000020 +#define ELEMENT_STATUS_PRODUCT_DATA 0x00000040 +#define ELEMENT_STATUS_LUN_VALID 0x00001000 +#define ELEMENT_STATUS_ID_VALID 0x00002000 +#define ELEMENT_STATUS_NOT_BUS 0x00008000 +#define ELEMENT_STATUS_INVERT 0x00400000 +#define ELEMENT_STATUS_SVALID 0x00800000 +#define ELEMENT_STATUS_PVOLTAG 0x10000000 +#define ELEMENT_STATUS_AVOLTAG 0x20000000 + +/* CHANGER_ELEMENT_STATUS(_EX).ExceptionCode constants */ +#define ERROR_LABEL_UNREADABLE 0x00000001 +#define ERROR_LABEL_QUESTIONABLE 0x00000002 +#define ERROR_SLOT_NOT_PRESENT 0x00000004 +#define ERROR_DRIVE_NOT_INSTALLED 0x00000008 +#define ERROR_TRAY_MALFUNCTION 0x00000010 +#define ERROR_INIT_STATUS_NEEDED 0x00000011 +#define ERROR_UNHANDLED_ERROR 0xFFFFFFFF + +typedef struct _CHANGER_ELEMENT_STATUS { + CHANGER_ELEMENT Element; + CHANGER_ELEMENT SrcElementAddress; + ULONG Flags; + ULONG ExceptionCode; + UCHAR TargetId; + UCHAR Lun; + USHORT Reserved; + UCHAR PrimaryVolumeID[MAX_VOLUME_ID_SIZE]; + UCHAR AlternateVolumeID[MAX_VOLUME_ID_SIZE]; +} CHANGER_ELEMENT_STATUS, *PCHANGER_ELEMENT_STATUS; + +typedef struct _CHANGER_ELEMENT_STATUS_EX { + CHANGER_ELEMENT Element; + CHANGER_ELEMENT SrcElementAddress; + ULONG Flags; + ULONG ExceptionCode; + UCHAR TargetId; + UCHAR Lun; + USHORT Reserved; + UCHAR PrimaryVolumeID[MAX_VOLUME_ID_SIZE]; + UCHAR AlternateVolumeID[MAX_VOLUME_ID_SIZE]; + UCHAR VendorIdentification[VENDOR_ID_LENGTH]; + UCHAR ProductIdentification[PRODUCT_ID_LENGTH]; + UCHAR SerialNumber[SERIAL_NUMBER_LENGTH]; +} CHANGER_ELEMENT_STATUS_EX, *PCHANGER_ELEMENT_STATUS_EX; + +/* CHANGER_SEND_VOLUME_TAG_INFORMATION.ActionCode constants */ +#define SEARCH_ALL 0x0 +#define SEARCH_PRIMARY 0x1 +#define SEARCH_ALTERNATE 0x2 +#define SEARCH_ALL_NO_SEQ 0x4 +#define SEARCH_PRI_NO_SEQ 0x5 +#define SEARCH_ALT_NO_SEQ 0x6 +#define ASSERT_PRIMARY 0x8 +#define ASSERT_ALTERNATE 0x9 +#define REPLACE_PRIMARY 0xA +#define REPLACE_ALTERNATE 0xB +#define UNDEFINE_PRIMARY 0xC +#define UNDEFINE_ALTERNATE 0xD + +typedef struct _CHANGER_SEND_VOLUME_TAG_INFORMATION { + CHANGER_ELEMENT StartingElement; + ULONG ActionCode; + UCHAR VolumeIDTemplate[MAX_VOLUME_TEMPLATE_SIZE]; +} CHANGER_SEND_VOLUME_TAG_INFORMATION, *PCHANGER_SEND_VOLUME_TAG_INFORMATION; + +/* GET_CHANGER_PARAMETERS.Features0 constants */ +#define CHANGER_BAR_CODE_SCANNER_INSTALLED 0x00000001 +#define CHANGER_INIT_ELEM_STAT_WITH_RANGE 0x00000002 +#define CHANGER_CLOSE_IEPORT 0x00000004 +#define CHANGER_OPEN_IEPORT 0x00000008 +#define CHANGER_STATUS_NON_VOLATILE 0x00000010 +#define CHANGER_EXCHANGE_MEDIA 0x00000020 +#define CHANGER_CLEANER_SLOT 0x00000040 +#define CHANGER_LOCK_UNLOCK 0x00000080 +#define CHANGER_CARTRIDGE_MAGAZINE 0x00000100 +#define CHANGER_MEDIUM_FLIP 0x00000200 +#define CHANGER_POSITION_TO_ELEMENT 0x00000400 +#define CHANGER_REPORT_IEPORT_STATE 0x00000800 +#define CHANGER_STORAGE_DRIVE 0x00001000 +#define CHANGER_STORAGE_IEPORT 0x00002000 +#define CHANGER_STORAGE_SLOT 0x00004000 +#define CHANGER_STORAGE_TRANSPORT 0x00008000 +#define CHANGER_DRIVE_CLEANING_REQUIRED 0x00010000 +#define CHANGER_PREDISMOUNT_EJECT_REQUIRED 0x00020000 +#define CHANGER_CLEANER_ACCESS_NOT_VALID 0x00040000 +#define CHANGER_PREMOUNT_EJECT_REQUIRED 0x00080000 +#define CHANGER_VOLUME_IDENTIFICATION 0x00100000 +#define CHANGER_VOLUME_SEARCH 0x00200000 +#define CHANGER_VOLUME_ASSERT 0x00400000 +#define CHANGER_VOLUME_REPLACE 0x00800000 +#define CHANGER_VOLUME_UNDEFINE 0x01000000 +#define CHANGER_SERIAL_NUMBER_VALID 0x04000000 +#define CHANGER_DEVICE_REINITIALIZE_CAPABLE 0x08000000 +#define CHANGER_KEYPAD_ENABLE_DISABLE 0x10000000 +#define CHANGER_DRIVE_EMPTY_ON_DOOR_ACCESS 0x20000000 +#define CHANGER_RESERVED_BIT 0x80000000 + +/* GET_CHANGER_PARAMETERS.Features1 constants */ +#define CHANGER_PREDISMOUNT_ALIGN_TO_SLOT 0x80000001 +#define CHANGER_PREDISMOUNT_ALIGN_TO_DRIVE 0x80000002 +#define CHANGER_CLEANER_AUTODISMOUNT 0x80000004 +#define CHANGER_TRUE_EXCHANGE_CAPABLE 0x80000008 +#define CHANGER_SLOTS_USE_TRAYS 0x80000010 +#define CHANGER_RTN_MEDIA_TO_ORIGINAL_ADDR 0x80000020 +#define CHANGER_CLEANER_OPS_NOT_SUPPORTED 0x80000040 +#define CHANGER_IEPORT_USER_CONTROL_OPEN 0x80000080 +#define CHANGER_IEPORT_USER_CONTROL_CLOSE 0x80000100 +#define CHANGER_MOVE_EXTENDS_IEPORT 0x80000200 +#define CHANGER_MOVE_RETRACTS_IEPORT 0x80000400 + +/* GET_CHANGER_PARAMETERS.MoveFrom,ExchangeFrom,PositionCapabilities constants */ +#define CHANGER_TO_TRANSPORT 0x01 +#define CHANGER_TO_SLOT 0x02 +#define CHANGER_TO_IEPORT 0x04 +#define CHANGER_TO_DRIVE 0x08 + +/* GET_CHANGER_PARAMETERS.LockUnlockCapabilities constants */ +#define LOCK_UNLOCK_IEPORT 0x01 +#define LOCK_UNLOCK_DOOR 0x02 +#define LOCK_UNLOCK_KEYPAD 0x04 + +typedef struct _GET_CHANGER_PARAMETERS { + ULONG Size; + USHORT NumberTransportElements; + USHORT NumberStorageElements; + USHORT NumberCleanerSlots; + USHORT NumberIEElements; + USHORT NumberDataTransferElements; + USHORT NumberOfDoors; + USHORT FirstSlotNumber; + USHORT FirstDriveNumber; + USHORT FirstTransportNumber; + USHORT FirstIEPortNumber; + USHORT FirstCleanerSlotAddress; + USHORT MagazineSize; + ULONG DriveCleanTimeout; + ULONG Features0; + ULONG Features1; + UCHAR MoveFromTransport; + UCHAR MoveFromSlot; + UCHAR MoveFromIePort; + UCHAR MoveFromDrive; + UCHAR ExchangeFromTransport; + UCHAR ExchangeFromSlot; + UCHAR ExchangeFromIePort; + UCHAR ExchangeFromDrive; + UCHAR LockUnlockCapabilities; + UCHAR PositionCapabilities; + UCHAR Reserved1[2]; + ULONG Reserved2[2]; +} GET_CHANGER_PARAMETERS, * PGET_CHANGER_PARAMETERS; + +typedef struct READ_ELEMENT_ADDRESS_INFO { + ULONG NumberOfElements; + CHANGER_ELEMENT_STATUS ElementStatus[1]; +} READ_ELEMENT_ADDRESS_INFO, *PREAD_ELEMENT_ADDRESS_INFO; + +typedef struct _TAPE_WMI_OPERATIONS { + ULONG Method; + ULONG DataBufferSize; + PVOID DataBuffer; +} TAPE_WMI_OPERATIONS, *PTAPE_WMI_OPERATIONS; + +typedef struct _WMI_CHANGER_PROBLEM_DEVICE_ERROR { + ULONG ChangerProblemType; +} WMI_CHANGER_PROBLEM_DEVICE_ERROR, *PWMI_CHANGER_PROBLEM_DEVICE_ERROR; + +#ifdef __cplusplus +} +#endif + +#endif /* __NTDDCHGR_H */ diff --git a/reactos/include/ddk/ntdddisk.h b/reactos/include/ddk/ntdddisk.h new file mode 100644 index 00000000000..f2f8efb8afb --- /dev/null +++ b/reactos/include/ddk/ntdddisk.h @@ -0,0 +1,572 @@ +/* + * ntdddisk.h + * + * Disk IOCTL interface. + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __NTDDDISK_H +#define __NTDDDISK_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include "ntddstor.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define DD_DISK_DEVICE_NAME "\\Device\\UNKNOWN" +#define DD_DISK_DEVICE_NAME_U L"\\Device\\UNKNOWN" + +#define IOCTL_DISK_BASE FILE_DEVICE_DISK + +#define IOCTL_DISK_CHECK_VERIFY \ + CTL_CODE(IOCTL_DISK_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_DISK_CONTROLLER_NUMBER \ + CTL_CODE(IOCTL_DISK_BASE, 0x0011, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_DISK_CREATE_DISK \ + CTL_CODE(IOCTL_DISK_BASE, 0x0016, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_DISK_DELETE_DRIVE_LAYOUT \ + CTL_CODE(IOCTL_DISK_BASE, 0x0040, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_DISK_FIND_NEW_DEVICES \ + CTL_CODE(IOCTL_DISK_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_DISK_FORMAT_TRACKS \ + CTL_CODE(IOCTL_DISK_BASE, 0x0006, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_DISK_FORMAT_TRACKS_EX \ + CTL_CODE(IOCTL_DISK_BASE, 0x000b, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_DISK_GET_CACHE_INFORMATION \ + CTL_CODE(IOCTL_DISK_BASE, 0x0035, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_DISK_GET_DRIVE_GEOMETRY \ + CTL_CODE(IOCTL_DISK_BASE, 0x0000, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_DISK_GET_DRIVE_GEOMETRY_EX \ + CTL_CODE(IOCTL_DISK_BASE, 0x0028, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_DISK_GET_DRIVE_LAYOUT \ + CTL_CODE(IOCTL_DISK_BASE, 0x0003, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_DISK_GET_DRIVE_LAYOUT_EX \ + CTL_CODE(IOCTL_DISK_BASE, 0x0014, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_DISK_GET_MEDIA_TYPES \ + CTL_CODE(IOCTL_DISK_BASE, 0x0300, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_DISK_GET_LENGTH_INFO \ + CTL_CODE(IOCTL_DISK_BASE, 0x0017, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_DISK_GET_PARTITION_INFO \ + CTL_CODE(IOCTL_DISK_BASE, 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_DISK_GET_PARTITION_INFO_EX \ + CTL_CODE(IOCTL_DISK_BASE, 0x0012, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_DISK_GROW_PARTITION \ + CTL_CODE(IOCTL_DISK_BASE, 0x0034, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_DISK_HISTOGRAM_STRUCTURE \ + CTL_CODE(IOCTL_DISK_BASE, 0x000c, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_DISK_HISTOGRAM_DATA \ + CTL_CODE(IOCTL_DISK_BASE, 0x000d, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_DISK_HISTOGRAM_RESET \ + CTL_CODE(IOCTL_DISK_BASE, 0x000e, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_DISK_INTERNAL_CLEAR_VERIFY \ + CTL_CODE(IOCTL_DISK_BASE, 0x0101, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_DISK_INTERNAL_SET_VERIFY \ + CTL_CODE(IOCTL_DISK_BASE, 0x0100, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_DISK_IS_WRITABLE \ + CTL_CODE(IOCTL_DISK_BASE, 0x0009, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_DISK_LOGGING \ + CTL_CODE(IOCTL_DISK_BASE, 0x000a, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_DISK_PERFORMANCE \ + CTL_CODE(IOCTL_DISK_BASE, 0x0008, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_DISK_PERFORMANCE_OFF \ + CTL_CODE(IOCTL_DISK_BASE, 0x0018, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_DISK_REASSIGN_BLOCKS \ + CTL_CODE(IOCTL_DISK_BASE, 0x0007, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_DISK_REQUEST_DATA \ + CTL_CODE(IOCTL_DISK_BASE, 0x0010, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_DISK_REQUEST_STRUCTURE \ + CTL_CODE(IOCTL_DISK_BASE, 0x000f, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_DISK_RESERVE \ + CTL_CODE(IOCTL_DISK_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_DISK_SET_CACHE_INFORMATION \ + CTL_CODE(IOCTL_DISK_BASE, 0x0036, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_DISK_SET_DRIVE_LAYOUT \ + CTL_CODE(IOCTL_DISK_BASE, 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_DISK_SET_DRIVE_LAYOUT_EX \ + CTL_CODE(IOCTL_DISK_BASE, 0x0015, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_DISK_SET_PARTITION_INFO \ + CTL_CODE(IOCTL_DISK_BASE, 0x0002, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_DISK_SET_PARTITION_INFO_EX \ + CTL_CODE(IOCTL_DISK_BASE, 0x0013, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_DISK_UPDATE_DRIVE_SIZE \ + CTL_CODE(IOCTL_DISK_BASE, 0x0032, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_DISK_VERIFY \ + CTL_CODE(IOCTL_DISK_BASE, 0x0005, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define SMART_GET_VERSION \ + CTL_CODE(IOCTL_DISK_BASE, 0x0020, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define SMART_RCV_DRIVE_DATA \ + CTL_CODE(IOCTL_DISK_BASE, 0x0022, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define SMART_SEND_DRIVE_COMMAND \ + CTL_CODE(IOCTL_DISK_BASE, 0x0021, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + + +#define PARTITION_ENTRY_UNUSED 0x00 +#define PARTITION_FAT_12 0x01 +#define PARTITION_XENIX_1 0x02 +#define PARTITION_XENIX_2 0x03 +#define PARTITION_FAT_16 0x04 +#define PARTITION_EXTENDED 0x05 +#define PARTITION_HUGE 0x06 +#define PARTITION_IFS 0x07 +#define PARTITION_OS2BOOTMGR 0x0A +#define PARTITION_FAT32 0x0B +#define PARTITION_FAT32_XINT13 0x0C +#define PARTITION_XINT13 0x0E +#define PARTITION_XINT13_EXTENDED 0x0F +#define PARTITION_PREP 0x41 +#define PARTITION_LDM 0x42 +#define PARTITION_UNIX 0x63 +#define VALID_NTFT 0xC0 +#define PARTITION_NTFT 0x80 + +#define IsFTPartition( PartitionType ) \ + (((PartitionType) & PARTITION_NTFT) && \ + IsRecognizedPartition(PartitionType)) + +#define IsContainerPartition(PartitionType) \ + (((PartitionType) == PARTITION_EXTENDED) || \ + ((PartitionType) == PARTITION_XINT13_EXTENDED)) + +#define IsRecognizedPartition(PartitionType) ( \ + (((PartitionType) & PARTITION_NTFT) && (((PartitionType) & ~0xC0) == PARTITION_FAT_12)) || \ + (((PartitionType) & PARTITION_NTFT) && (((PartitionType) & ~0xC0) == PARTITION_HUGE)) || \ + (((PartitionType) & PARTITION_NTFT) && (((PartitionType) & ~0xC0) == PARTITION_IFS)) || \ + (((PartitionType) & PARTITION_NTFT) && (((PartitionType) & ~0xC0) == PARTITION_FAT32)) || \ + (((PartitionType) & PARTITION_NTFT) && (((PartitionType) & ~0xC0) == PARTITION_FAT32_XINT13)) || \ + (((PartitionType) & PARTITION_NTFT) && (((PartitionType) & ~0xC0) == PARTITION_XINT13)) || \ + ((PartitionType) == PARTITION_FAT_12) || \ + ((PartitionType) == PARTITION_FAT_16) || \ + ((PartitionType) == PARTITION_HUGE) || \ + ((PartitionType) == PARTITION_IFS) || \ + ((PartitionType) == PARTITION_FAT32) || \ + ((PartitionType) == PARTITION_FAT32_XINT13) || \ + ((PartitionType) == PARTITION_XINT13)) + +#define WMI_DISK_GEOMETRY_GUID \ + {0x25007f51, 0x57c2, 0x11d1, {0xa5, 0x28, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0x10}} + +typedef USHORT BAD_TRACK_NUMBER; +typedef USHORT *PBAD_TRACK_NUMBER; + +typedef enum _MEDIA_TYPE { + Unknown, + F5_1Pt2_512, + F3_1Pt44_512, + F3_2Pt88_512, + F3_20Pt8_512, + F3_720_512, + F5_360_512, + F5_320_512, + F5_320_1024, + F5_180_512, + F5_160_512, + RemovableMedia, + FixedMedia, + F3_120M_512, + F3_640_512, + F5_640_512, + F5_720_512, + F3_1Pt2_512, + F3_1Pt23_1024, + F5_1Pt23_1024, + F3_128Mb_512, + F3_230Mb_512, + F8_256_128 +} MEDIA_TYPE, *PMEDIA_TYPE; + +typedef enum _DETECTION_TYPE { + DetectNone, + DetectInt13, + DetectExInt13 +} DETECTION_TYPE; + +typedef struct _DISK_CONTROLLER_NUMBER { + ULONG ControllerNumber; + ULONG DiskNumber; +} DISK_CONTROLLER_NUMBER, *PDISK_CONTROLLER_NUMBER; + +typedef struct _DISK_INT13_INFO { + USHORT DriveSelect; + ULONG MaxCylinders; + USHORT SectorsPerTrack; + USHORT MaxHeads; + USHORT NumberDrives; +} DISK_INT13_INFO, *PDISK_INT13_INFO; + +typedef struct _DISK_EX_INT13_INFO { + USHORT ExBufferSize; + USHORT ExFlags; + ULONG ExCylinders; + ULONG ExHeads; + ULONG ExSectorsPerTrack; + ULONG64 ExSectorsPerDrive; + USHORT ExSectorSize; + USHORT ExReserved; +} DISK_EX_INT13_INFO, *PDISK_EX_INT13_INFO; + +typedef struct _DISK_DETECTION_INFO { + ULONG SizeOfDetectInfo; + DETECTION_TYPE DetectionType; + _ANONYMOUS_UNION union { + _ANONYMOUS_STRUCT struct { + DISK_INT13_INFO Int13; + DISK_EX_INT13_INFO ExInt13; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; +} DISK_DETECTION_INFO, *PDISK_DETECTION_INFO; + +typedef struct _DISK_GEOMETRY { + LARGE_INTEGER Cylinders; + MEDIA_TYPE MediaType; + ULONG TracksPerCylinder; + ULONG SectorsPerTrack; + ULONG BytesPerSector; +} DISK_GEOMETRY, *PDISK_GEOMETRY; + +typedef struct _DISK_GEOMETRY_EX { + DISK_GEOMETRY Geometry; + LARGE_INTEGER DiskSize; + UCHAR Data[1]; +} DISK_GEOMETRY_EX, *PDISK_GEOMETRY_EX; + +#define DiskGeometryGetPartition(Geometry) \ + ((PDISK_PARTITION_INFO)((Geometry) + 1)) + +#define DiskGeometryGetDetect(Geometry)\ + ((PDISK_DETECTION_INFO)(((PBYTE)DiskGeometryGetPartition(Geometry) + \ + DiskGeometryGetPartition(Geometry)->SizeOfPartitionInfo))) + +typedef struct _PARTITION_INFORMATION { + LARGE_INTEGER StartingOffset; + LARGE_INTEGER PartitionLength; + DWORD HiddenSectors; + DWORD PartitionNumber; + BYTE PartitionType; + BOOLEAN BootIndicator; + BOOLEAN RecognizedPartition; + BOOLEAN RewritePartition; +} PARTITION_INFORMATION, *PPARTITION_INFORMATION; + +typedef struct _PARTITION_INFORMATION_GPT { + GUID PartitionType; + GUID PartitionId; + ULONG64 Attributes; + WCHAR Name [36]; +} PARTITION_INFORMATION_GPT, *PPARTITION_INFORMATION_GPT; + +typedef struct _DISK_PARTITION_INFO { + ULONG SizeOfPartitionInfo; + PARTITION_STYLE PartitionStyle; + _ANONYMOUS_UNION union { + struct { + ULONG Signature; + ULONG CheckSum; + } Mbr; + struct { + GUID DiskId; + } Gpt; + } DUMMYUNIONNAME; +} DISK_PARTITION_INFO, *PDISK_PARTITION_INFO; + +typedef struct _DISK_PERFORMANCE { + LARGE_INTEGER BytesRead; + LARGE_INTEGER BytesWritten; + LARGE_INTEGER ReadTime; + LARGE_INTEGER WriteTime; + LARGE_INTEGER IdleTime; + ULONG ReadCount; + ULONG WriteCount; + ULONG QueueDepth; + ULONG SplitCount; + LARGE_INTEGER QueryTime; + ULONG StorageDeviceNumber; + WCHAR StorageManagerName[8]; +} DISK_PERFORMANCE, *PDISK_PERFORMANCE; + +typedef struct _PARTITION_INFORMATION_MBR { + UCHAR PartitionType; + BOOLEAN BootIndicator; + BOOLEAN RecognizedPartition; + ULONG HiddenSectors; +} PARTITION_INFORMATION_MBR, *PPARTITION_INFORMATION_MBR; + +typedef struct _PARTITION_INFORMATION_EX { + PARTITION_STYLE PartitionStyle; + LARGE_INTEGER StartingOffset; + LARGE_INTEGER PartitionLength; + ULONG PartitionNumber; + BOOLEAN RewritePartition; + _ANONYMOUS_UNION union { + PARTITION_INFORMATION_MBR Mbr; + PARTITION_INFORMATION_GPT Gpt; + } DUMMYUNIONNAME; +} PARTITION_INFORMATION_EX, *PPARTITION_INFORMATION_EX; + +typedef struct _DRIVE_LAYOUT_INFORMATION { + ULONG PartitionCount; + ULONG Signature; + PARTITION_INFORMATION PartitionEntry[1]; +} DRIVE_LAYOUT_INFORMATION, *PDRIVE_LAYOUT_INFORMATION; + +typedef struct _DRIVE_LAYOUT_INFORMATION_MBR { + ULONG Signature; +} DRIVE_LAYOUT_INFORMATION_MBR, *PDRIVE_LAYOUT_INFORMATION_MBR; + +typedef struct _DRIVE_LAYOUT_INFORMATION_GPT { + GUID DiskId; + LARGE_INTEGER StartingUsableOffset; + LARGE_INTEGER UsableLength; + ULONG MaxPartitionCount; +} DRIVE_LAYOUT_INFORMATION_GPT, *PDRIVE_LAYOUT_INFORMATION_GPT; + +typedef struct _DRIVE_LAYOUT_INFORMATION_EX { + ULONG PartitionStyle; + ULONG PartitionCount; + union { + DRIVE_LAYOUT_INFORMATION_MBR Mbr; + DRIVE_LAYOUT_INFORMATION_GPT Gpt; + }; + PARTITION_INFORMATION_EX PartitionEntry[1]; +} DRIVE_LAYOUT_INFORMATION_EX, *PDRIVE_LAYOUT_INFORMATION_EX; + +typedef struct _FORMAT_EX_PARAMETERS { + MEDIA_TYPE MediaType; + ULONG StartCylinderNumber; + ULONG EndCylinderNumber; + ULONG StartHeadNumber; + ULONG EndHeadNumber; + USHORT FormatGapLength; + USHORT SectorsPerTrack; + USHORT SectorNumber[1]; +} FORMAT_EX_PARAMETERS, *PFORMAT_EX_PARAMETERS; + +typedef struct _FORMAT_PARAMETERS { + MEDIA_TYPE MediaType; + ULONG StartCylinderNumber; + ULONG EndCylinderNumber; + ULONG StartHeadNumber; + ULONG EndHeadNumber; +} FORMAT_PARAMETERS, *PFORMAT_PARAMETERS; + +typedef struct _GET_LENGTH_INFORMATION { + LARGE_INTEGER Length; +} GET_LENGTH_INFORMATION, *PGET_LENGTH_INFORMATION; + +typedef struct _REASSIGN_BLOCKS { + WORD Reserved; + WORD Count; + DWORD BlockNumber[1]; +} REASSIGN_BLOCKS, *PREASSIGN_BLOCKS; + +typedef struct _SET_PARTITION_INFORMATION { + UCHAR PartitionType; +} SET_PARTITION_INFORMATION, *PSET_PARTITION_INFORMATION; + +typedef SET_PARTITION_INFORMATION SET_PARTITION_INFORMATION_MBR; +typedef PARTITION_INFORMATION_GPT SET_PARTITION_INFORMATION_GPT; + +typedef struct _SET_PARTITION_INFORMATION_EX { + PARTITION_STYLE PartitionStyle; + _ANONYMOUS_UNION union { + SET_PARTITION_INFORMATION_MBR Mbr; + SET_PARTITION_INFORMATION_GPT Gpt; + } DUMMYUNIONNAME; +} SET_PARTITION_INFORMATION_EX, *PSET_PARTITION_INFORMATION_EX; + +typedef struct _VERIFY_INFORMATION { + LARGE_INTEGER StartingOffset; + DWORD Length; +} VERIFY_INFORMATION, *PVERIFY_INFORMATION; + +typedef enum { + EqualPriority, + KeepPrefetchedData, + KeepReadData +} DISK_CACHE_RETENTION_PRIORITY; + +typedef struct _DISK_CACHE_INFORMATION { + BOOLEAN ParametersSavable; + BOOLEAN ReadCacheEnabled; + BOOLEAN WriteCacheEnabled; + DISK_CACHE_RETENTION_PRIORITY ReadRetentionPriority; + DISK_CACHE_RETENTION_PRIORITY WriteRetentionPriority; + USHORT DisablePrefetchTransferLength; + BOOLEAN PrefetchScalar; + _ANONYMOUS_UNION union { + struct { + USHORT Minimum; + USHORT Maximum; + USHORT MaximumBlocks; + } ScalarPrefetch; + struct { + USHORT Minimum; + USHORT Maximum; + } BlockPrefetch; + } DUMMYUNIONNAME; +} DISK_CACHE_INFORMATION, *PDISK_CACHE_INFORMATION; + +typedef struct _DISK_GROW_PARTITION { + ULONG PartitionNumber; + LARGE_INTEGER BytesToGrow; +} DISK_GROW_PARTITION, *PDISK_GROW_PARTITION; + +/* GETVERSIONINPARAMS.fCapabilities constants */ +#define CAP_ATA_ID_CMD 1 +#define CAP_ATAPI_ID_CMD 2 +#define CAP_SMART_CMD 4 + +typedef struct _GETVERSIONINPARAMS { + UCHAR bVersion; + UCHAR bRevision; + UCHAR bReserved; + UCHAR bIDEDeviceMap; + ULONG fCapabilities; + ULONG dwReserved[4]; +} GETVERSIONINPARAMS, *PGETVERSIONINPARAMS, *LPGETVERSIONINPARAMS; + +/* IDEREGS.bCommandReg constants */ +#define ATAPI_ID_CMD 0xA1 +#define ID_CMD 0xEC +#define SMART_CMD 0xB0 + +#define SMART_CYL_LOW 0x4F +#define SMART_CYL_HI 0xC2 + +typedef struct _IDEREGS { + UCHAR bFeaturesReg; + UCHAR bSectorCountReg; + UCHAR bSectorNumberReg; + UCHAR bCylLowReg; + UCHAR bCylHighReg; + UCHAR bDriveHeadReg; + UCHAR bCommandReg; + UCHAR bReserved; +} IDEREGS, *PIDEREGS, *LPIDEREGS; + +#include +typedef struct _SENDCMDINPARAMS { + ULONG cBufferSize; + IDEREGS irDriveRegs; + UCHAR bDriveNumber; + UCHAR bReserved[3]; + ULONG dwReserved[4]; + UCHAR bBuffer[1]; +} SENDCMDINPARAMS, *PSENDCMDINPARAMS, *LPSENDCMDINPARAMS; +#include + +/* DRIVERSTATUS.bDriverError constants */ +#define SMART_NO_ERROR 0 +#define SMART_IDE_ERROR 1 +#define SMART_INVALID_FLAG 2 +#define SMART_INVALID_COMMAND 3 +#define SMART_INVALID_BUFFER 4 +#define SMART_INVALID_DRIVE 5 +#define SMART_INVALID_IOCTL 6 +#define SMART_ERROR_NO_MEM 7 +#define SMART_INVALID_REGISTER 8 +#define SMART_NOT_SUPPORTED 9 +#define SMART_NO_IDE_DEVICE 10 + +#define SMART_OFFLINE_ROUTINE_OFFLINE 0 +#define SMART_SHORT_SELFTEST_OFFLINE 1 +#define SMART_EXTENDED_SELFTEST_OFFLINE 2 +#define SMART_ABORT_OFFLINE_SELFTEST 127 +#define SMART_SHORT_SELFTEST_CAPTIVE 129 +#define SMART_EXTENDED_SELFTEST_CAPTIVE 130 + +typedef struct _DRIVERSTATUS { + UCHAR bDriverError; + UCHAR bIDEError; + UCHAR bReserved[2]; + ULONG dwReserved[2]; +} DRIVERSTATUS, *PDRIVERSTATUS, *LPDRIVERSTATUS; + +#define READ_ATTRIBUTE_BUFFER_SIZE 512 +#define IDENTIFY_BUFFER_SIZE 512 +#define READ_THRESHOLD_BUFFER_SIZE 512 +#define SMART_LOG_SECTOR_SIZE 512 + +#include +typedef struct _SENDCMDOUTPARAMS { + ULONG cBufferSize; + DRIVERSTATUS DriverStatus; + UCHAR bBuffer[1]; +} SENDCMDOUTPARAMS, *PSENDCMDOUTPARAMS, *LPSENDCMDOUTPARAMS; +#include + +#define READ_ATTRIBUTES 0xD0 +#define READ_THRESHOLDS 0xD1 +#define ENABLE_DISABLE_AUTOSAVE 0xD2 +#define SAVE_ATTRIBUTE_VALUES 0xD3 +#define EXECUTE_OFFLINE_DIAGS 0xD4 +#define SMART_READ_LOG 0xD5 +#define SMART_WRITE_LOG 0xd6 +#define ENABLE_SMART 0xD8 +#define DISABLE_SMART 0xD9 +#define RETURN_SMART_STATUS 0xDA +#define ENABLE_DISABLE_AUTO_OFFLINE 0xDB + +#ifdef __cplusplus +} +#endif + +#endif /* __NTDDDISK_H */ diff --git a/reactos/include/ddk/ntddk.h b/reactos/include/ddk/ntddk.h new file mode 100644 index 00000000000..e6a721ffa08 --- /dev/null +++ b/reactos/include/ddk/ntddk.h @@ -0,0 +1,83 @@ +/* + * ntddk.h + * + * Windows Device Driver Kit + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * DEFINES: + * DBG - Debugging enabled/disabled (0/1) + * POOL_TAGGING - Enable pool tagging + * _X86_ - X86 environment + */ + +#ifndef __NTDDK_H +#define __NTDDK_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include +#include +#include +#include +#include + +/* Base types, structures and definitions */ +typedef short CSHORT; +typedef ULONG CLONG; +typedef CCHAR *PCCHAR; +typedef CSHORT *PCSHORT; +typedef CLONG *PCLONG; +typedef CONST int CINT; +typedef CONST char *PCSZ; + +#ifndef STATIC +#define STATIC static +#endif + +#ifndef CALLBACK +#define CALLBACK +#endif + +#ifndef DECL_IMPORT +#define DECL_IMPORT __declspec(dllimport) +#endif + +#ifndef DECL_EXPORT +#define DECL_EXPORT __declspec(dllexport) +#endif + +/* Windows NT status codes */ +#include "ntstatus.h" + +/* Windows NT definitions exported to user mode */ +#include + +/* Windows Device Driver Kit */ +#include "winddk.h" + +/* Definitions only in Windows XP */ +#include "winxp.h" + +/* Definitions only in Windows 2000 */ +#include "win2k.h" + +/* Definitions only in Windows NT 4 */ +#include "winnt4.h" + +#endif /* __NTDDK_H */ diff --git a/reactos/include/ddk/ntddkbd.h b/reactos/include/ddk/ntddkbd.h new file mode 100644 index 00000000000..56bc23acfb2 --- /dev/null +++ b/reactos/include/ddk/ntddkbd.h @@ -0,0 +1,133 @@ +/* + * ntddkbd.h + * + * Keyboard IOCTL interface + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __NTDDKBD_H +#define __NTDDKBD_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define DD_KEYBOARD_DEVICE_NAME "\\Device\\KeyboardClass" +#define DD_KEYBOARD_DEVICE_NAME_U L"\\Device\\KeyboardClass" + +#define IOCTL_KEYBOARD_QUERY_ATTRIBUTES \ + CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0000, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_KEYBOARD_QUERY_INDICATORS \ + CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0010, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_KEYBOARD_QUERY_INDICATOR_TRANSLATION \ + CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0020, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_KEYBOARD_QUERY_TYPEMATIC \ + CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0008, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_KEYBOARD_SET_TYPEMATIC \ + CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0001, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_KEYBOARD_SET_INDICATORS \ + CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0002, METHOD_BUFFERED, FILE_ANY_ACCESS) + + +DEFINE_GUID(GUID_DEVINTERFACE_KEYBOARD, \ + 0x884b96c3, 0x56ef, 0x11d1, 0xbc, 0x8c, 0x00, 0xa0, 0xc9, 0x14, 0x05, 0xdd); + +#define KEYBOARD_ERROR_VALUE_BASE 10000 + +/* KEYBOARD_INPUT_DATA.MakeCode constants */ +#define KEYBOARD_OVERRUN_MAKE_CODE 0xFF + +/* KEYBOARD_INPUT_DATA.Flags constants */ +#define KEY_MAKE 0 +#define KEY_BREAK 1 +#define KEY_E0 2 +#define KEY_E1 4 + +typedef struct _KEYBOARD_INPUT_DATA { + USHORT UnitId; + USHORT MakeCode; + USHORT Flags; + USHORT Reserved; + ULONG ExtraInformation; +} KEYBOARD_INPUT_DATA, *PKEYBOARD_INPUT_DATA; + + +typedef struct _KEYBOARD_TYPEMATIC_PARAMETERS { + USHORT UnitId; + USHORT Rate; + USHORT Delay; +} KEYBOARD_TYPEMATIC_PARAMETERS, *PKEYBOARD_TYPEMATIC_PARAMETERS; + +typedef struct _KEYBOARD_ID { + UCHAR Type; + UCHAR Subtype; +} KEYBOARD_ID, *PKEYBOARD_ID; + +#define ENHANCED_KEYBOARD(Id) ((Id).Type == 2 || (Id).Type == 4 || FAREAST_KEYBOARD(Id)) +#define FAREAST_KEYBOARD(Id) ((Id).Type == 7 || (Id).Type == 8) + +typedef struct _KEYBOARD_INDICATOR_PARAMETERS { + USHORT UnitId; + USHORT LedFlags; +} KEYBOARD_INDICATOR_PARAMETERS, *PKEYBOARD_INDICATOR_PARAMETERS; + +typedef struct _INDICATOR_LIST { + USHORT MakeCode; + USHORT IndicatorFlags; +} INDICATOR_LIST, *PINDICATOR_LIST; + +typedef struct _KEYBOARD_INDICATOR_TRANSLATION { + USHORT NumberOfIndicatorKeys; + INDICATOR_LIST IndicatorList[1]; +} KEYBOARD_INDICATOR_TRANSLATION, *PKEYBOARD_INDICATOR_TRANSLATION; + +typedef struct _KEYBOARD_ATTRIBUTES { + KEYBOARD_ID KeyboardIdentifier; + USHORT KeyboardMode; + USHORT NumberOfFunctionKeys; + USHORT NumberOfIndicators; + USHORT NumberOfKeysTotal; + ULONG InputDataQueueLength; + KEYBOARD_TYPEMATIC_PARAMETERS KeyRepeatMinimum; + KEYBOARD_TYPEMATIC_PARAMETERS KeyRepeatMaximum; +} KEYBOARD_ATTRIBUTES, *PKEYBOARD_ATTRIBUTES; + +typedef struct _KEYBOARD_UNIT_ID_PARAMETER { + USHORT UnitId; +} KEYBOARD_UNIT_ID_PARAMETER, *PKEYBOARD_UNIT_ID_PARAMETER; + +typedef struct _KEYBOARD_IME_STATUS { + USHORT UnitId; + ULONG ImeOpen; + ULONG ImeConvMode; +} KEYBOARD_IME_STATUS, *PKEYBOARD_IME_STATUS; + +#ifdef __cplusplus +} +#endif + +#endif /* __NTDDKBD_H */ diff --git a/reactos/include/ddk/ntddmou.h b/reactos/include/ddk/ntddmou.h new file mode 100644 index 00000000000..a9a3ef4f1c7 --- /dev/null +++ b/reactos/include/ddk/ntddmou.h @@ -0,0 +1,113 @@ +/* + * ntddmou.h + * + * Mouse device IOCTL interface. + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __NTDDMOU_H +#define __NTDDMOU_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define DD_MOUSE_DEVICE_NAME "\\Device\\PointerClass" +#define DD_MOUSE_DEVICE_NAME_U L"\\Device\\PointerClass" + +#define IOCTL_MOUSE_QUERY_ATTRIBUTES \ + CTL_CODE(FILE_DEVICE_MOUSE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS) + +DEFINE_GUID(GUID_DEVINTERFACE_MOUSE, \ + 0x378de44c, 0x56ef, 0x11d1, 0xbc, 0x8c, 0x00, 0xa0, 0xc9, 0x14, 0x05, 0xdd); + +#define MOUSE_ERROR_VALUE_BASE 20000 + +/* MOUSE_INPUT_DATA.ButtonFlags constants */ +#define MOUSE_LEFT_BUTTON_DOWN 0x0001 +#define MOUSE_LEFT_BUTTON_UP 0x0002 +#define MOUSE_RIGHT_BUTTON_DOWN 0x0004 +#define MOUSE_RIGHT_BUTTON_UP 0x0008 +#define MOUSE_MIDDLE_BUTTON_DOWN 0x0010 +#define MOUSE_MIDDLE_BUTTON_UP 0x0020 +#define MOUSE_BUTTON_4_DOWN 0x0040 +#define MOUSE_BUTTON_4_UP 0x0080 +#define MOUSE_BUTTON_5_DOWN 0x0100 +#define MOUSE_BUTTON_5_UP 0x0200 +#define MOUSE_WHEEL 0x0400 + +#define MOUSE_BUTTON_1_DOWN MOUSE_LEFT_BUTTON_DOWN +#define MOUSE_BUTTON_1_UP MOUSE_LEFT_BUTTON_UP +#define MOUSE_BUTTON_2_DOWN MOUSE_RIGHT_BUTTON_DOWN +#define MOUSE_BUTTON_2_UP MOUSE_RIGHT_BUTTON_UP +#define MOUSE_BUTTON_3_DOWN MOUSE_MIDDLE_BUTTON_DOWN +#define MOUSE_BUTTON_3_UP MOUSE_MIDDLE_BUTTON_UP + +/* MOUSE_INPUT_DATA.Flags constants */ +#define MOUSE_MOVE_RELATIVE 0 +#define MOUSE_MOVE_ABSOLUTE 1 +#define MOUSE_VIRTUAL_DESKTOP 0x02 +#define MOUSE_ATTRIBUTES_CHANGED 0x04 + +typedef struct _MOUSE_INPUT_DATA { + USHORT UnitId; + USHORT Flags; + _ANONYMOUS_UNION union { + ULONG Buttons; + _ANONYMOUS_STRUCT struct { + USHORT ButtonFlags; + USHORT ButtonData; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + ULONG RawButtons; + LONG LastX; + LONG LastY; + ULONG ExtraInformation; +} MOUSE_INPUT_DATA, *PMOUSE_INPUT_DATA; + +typedef struct _MOUSE_UNIT_ID_PARAMETER { + USHORT UnitId; +} MOUSE_UNIT_ID_PARAMETER, *PMOUSE_UNIT_ID_PARAMETER; + +/* MOUSE_ATTRIBUTES.MouseIdentifier constants */ +#define MOUSE_INPORT_HARDWARE 0x0001 +#define MOUSE_I8042_HARDWARE 0x0002 +#define MOUSE_SERIAL_HARDWARE 0x0004 +#define BALLPOINT_I8042_HARDWARE 0x0008 +#define BALLPOINT_SERIAL_HARDWARE 0x0010 +#define WHEELMOUSE_I8042_HARDWARE 0x0020 +#define WHEELMOUSE_SERIAL_HARDWARE 0x0040 +#define MOUSE_HID_HARDWARE 0x0080 +#define WHEELMOUSE_HID_HARDWARE 0x0100 + +typedef struct _MOUSE_ATTRIBUTES { + USHORT MouseIdentifier; + USHORT NumberOfButtons; + USHORT SampleRate; + ULONG InputDataQueueLength; +} MOUSE_ATTRIBUTES, *PMOUSE_ATTRIBUTES; + +#ifdef __cplusplus +} +#endif + +#endif /* __NTDDMOU_H */ diff --git a/reactos/include/ddk/ntddndis.h b/reactos/include/ddk/ntddndis.h new file mode 100644 index 00000000000..3371abac1a3 --- /dev/null +++ b/reactos/include/ddk/ntddndis.h @@ -0,0 +1,186 @@ +/* + * ntddndis.h + * + * NDIS device driver interface + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __NTDDNDIS_H +#define __NTDDNDIS_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#pragma pack(push,4) + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum _NDIS_WAN_QUALITY { + NdisWanRaw, + NdisWanErrorControl, + NdisWanReliable +} NDIS_WAN_QUALITY, *PNDIS_WAN_QUALITY; + +typedef enum _NDIS_DEVICE_POWER_STATE { + NdisDeviceStateUnspecified = 0, + NdisDeviceStateD0, + NdisDeviceStateD1, + NdisDeviceStateD2, + NdisDeviceStateD3, + NdisDeviceStateMaximum +} NDIS_DEVICE_POWER_STATE, *PNDIS_DEVICE_POWER_STATE; + +typedef struct _NDIS_PM_WAKE_UP_CAPABILITIES { + NDIS_DEVICE_POWER_STATE MinMagicPacketWakeUp; + NDIS_DEVICE_POWER_STATE MinPatternWakeUp; + NDIS_DEVICE_POWER_STATE MinLinkChangeWakeUp; +} NDIS_PM_WAKE_UP_CAPABILITIES, *PNDIS_PM_WAKE_UP_CAPABILITIES; + +/* NDIS_PNP_CAPABILITIES.Flags constants */ +#define NDIS_DEVICE_WAKE_UP_ENABLE 0x00000001 +#define NDIS_DEVICE_WAKE_ON_PATTERN_MATCH_ENABLE 0x00000002 +#define NDIS_DEVICE_WAKE_ON_MAGIC_PACKET_ENABLE 0x00000004 + +typedef struct _NDIS_PNP_CAPABILITIES { + ULONG Flags; + NDIS_PM_WAKE_UP_CAPABILITIES WakeUpCapabilities; +} NDIS_PNP_CAPABILITIES, *PNDIS_PNP_CAPABILITIES; + +/* Required Object IDs (OIDs) */ +#define OID_GEN_SUPPORTED_LIST 0x00010101 +#define OID_GEN_HARDWARE_STATUS 0x00010102 +#define OID_GEN_MEDIA_SUPPORTED 0x00010103 +#define OID_GEN_MEDIA_IN_USE 0x00010104 +#define OID_GEN_MAXIMUM_LOOKAHEAD 0x00010105 +#define OID_GEN_MAXIMUM_FRAME_SIZE 0x00010106 +#define OID_GEN_LINK_SPEED 0x00010107 +#define OID_GEN_TRANSMIT_BUFFER_SPACE 0x00010108 +#define OID_GEN_RECEIVE_BUFFER_SPACE 0x00010109 +#define OID_GEN_TRANSMIT_BLOCK_SIZE 0x0001010A +#define OID_GEN_RECEIVE_BLOCK_SIZE 0x0001010B +#define OID_GEN_VENDOR_ID 0x0001010C +#define OID_GEN_VENDOR_DESCRIPTION 0x0001010D +#define OID_GEN_CURRENT_PACKET_FILTER 0x0001010E +#define OID_GEN_CURRENT_LOOKAHEAD 0x0001010F +#define OID_GEN_DRIVER_VERSION 0x00010110 +#define OID_GEN_MAXIMUM_TOTAL_SIZE 0x00010111 +#define OID_GEN_PROTOCOL_OPTIONS 0x00010112 +#define OID_GEN_MAC_OPTIONS 0x00010113 +#define OID_GEN_MEDIA_CONNECT_STATUS 0x00010114 +#define OID_GEN_MAXIMUM_SEND_PACKETS 0x00010115 +#define OID_GEN_VENDOR_DRIVER_VERSION 0x00010116 +#define OID_GEN_SUPPORTED_GUIDS 0x00010117 +#define OID_GEN_NETWORK_LAYER_ADDRESSES 0x00010118 +#define OID_GEN_TRANSPORT_HEADER_OFFSET 0x00010119 +#define OID_GEN_MACHINE_NAME 0x0001021A +#define OID_GEN_RNDIS_CONFIG_PARAMETER 0x0001021B +#define OID_GEN_VLAN_ID 0x0001021C + +/* Optional OIDs */ +#define OID_GEN_MEDIA_CAPABILITIES 0x00010201 +#define OID_GEN_PHYSICAL_MEDIUM 0x00010202 + +/* Required statistics OIDs */ +#define OID_GEN_XMIT_OK 0x00020101 +#define OID_GEN_RCV_OK 0x00020102 +#define OID_GEN_XMIT_ERROR 0x00020103 +#define OID_GEN_RCV_ERROR 0x00020104 +#define OID_GEN_RCV_NO_BUFFER 0x00020105 + +/* Optional statistics OIDs */ +#define OID_GEN_DIRECTED_BYTES_XMIT 0x00020201 +#define OID_GEN_DIRECTED_FRAMES_XMIT 0x00020202 +#define OID_GEN_MULTICAST_BYTES_XMIT 0x00020203 +#define OID_GEN_MULTICAST_FRAMES_XMIT 0x00020204 +#define OID_GEN_BROADCAST_BYTES_XMIT 0x00020205 +#define OID_GEN_BROADCAST_FRAMES_XMIT 0x00020206 +#define OID_GEN_DIRECTED_BYTES_RCV 0x00020207 +#define OID_GEN_DIRECTED_FRAMES_RCV 0x00020208 +#define OID_GEN_MULTICAST_BYTES_RCV 0x00020209 +#define OID_GEN_MULTICAST_FRAMES_RCV 0x0002020A +#define OID_GEN_BROADCAST_BYTES_RCV 0x0002020B +#define OID_GEN_BROADCAST_FRAMES_RCV 0x0002020C +#define OID_GEN_RCV_CRC_ERROR 0x0002020D +#define OID_GEN_TRANSMIT_QUEUE_LENGTH 0x0002020E +#define OID_GEN_GET_TIME_CAPS 0x0002020F +#define OID_GEN_GET_NETCARD_TIME 0x00020210 +#define OID_GEN_NETCARD_LOAD 0x00020211 +#define OID_GEN_DEVICE_PROFILE 0x00020212 +#define OID_GEN_INIT_TIME_MS 0x00020213 +#define OID_GEN_RESET_COUNTS 0x00020214 +#define OID_GEN_MEDIA_SENSE_COUNTS 0x00020215 +#define OID_GEN_FRIENDLY_NAME 0x00020216 +#define OID_GEN_MINIPORT_INFO 0x00020217 +#define OID_GEN_RESET_VERIFY_PARAMETERS 0x00020218 + +/* IEEE 802.3 (Ethernet) OIDs */ +#define NDIS_802_3_MAC_OPTION_PRIORITY 0x00000001 + +#define OID_802_3_PERMANENT_ADDRESS 0x01010101 +#define OID_802_3_CURRENT_ADDRESS 0x01010102 +#define OID_802_3_MULTICAST_LIST 0x01010103 +#define OID_802_3_MAXIMUM_LIST_SIZE 0x01010104 +#define OID_802_3_MAC_OPTIONS 0x01010105 +#define OID_802_3_RCV_ERROR_ALIGNMENT 0x01020101 +#define OID_802_3_XMIT_ONE_COLLISION 0x01020102 +#define OID_802_3_XMIT_MORE_COLLISIONS 0x01020103 +#define OID_802_3_XMIT_DEFERRED 0x01020201 +#define OID_802_3_XMIT_MAX_COLLISIONS 0x01020202 +#define OID_802_3_RCV_OVERRUN 0x01020203 +#define OID_802_3_XMIT_UNDERRUN 0x01020204 +#define OID_802_3_XMIT_HEARTBEAT_FAILURE 0x01020205 +#define OID_802_3_XMIT_TIMES_CRS_LOST 0x01020206 +#define OID_802_3_XMIT_LATE_COLLISIONS 0x01020207 + +/* OID_GEN_MINIPORT_INFO constants */ +#define NDIS_MINIPORT_BUS_MASTER 0x00000001 +#define NDIS_MINIPORT_WDM_DRIVER 0x00000002 +#define NDIS_MINIPORT_SG_LIST 0x00000004 +#define NDIS_MINIPORT_SUPPORTS_MEDIA_QUERY 0x00000008 +#define NDIS_MINIPORT_INDICATES_PACKETS 0x00000010 +#define NDIS_MINIPORT_IGNORE_PACKET_QUEUE 0x00000020 +#define NDIS_MINIPORT_IGNORE_REQUEST_QUEUE 0x00000040 +#define NDIS_MINIPORT_IGNORE_TOKEN_RING_ERRORS 0x00000080 +#define NDIS_MINIPORT_INTERMEDIATE_DRIVER 0x00000100 +#define NDIS_MINIPORT_IS_NDIS_5 0x00000200 +#define NDIS_MINIPORT_IS_CO 0x00000400 +#define NDIS_MINIPORT_DESERIALIZE 0x00000800 +#define NDIS_MINIPORT_REQUIRES_MEDIA_POLLING 0x00001000 +#define NDIS_MINIPORT_SUPPORTS_MEDIA_SENSE 0x00002000 +#define NDIS_MINIPORT_NETBOOT_CARD 0x00004000 +#define NDIS_MINIPORT_PM_SUPPORTED 0x00008000 +#define NDIS_MINIPORT_SUPPORTS_MAC_ADDRESS_OVERWRITE 0x00010000 +#define NDIS_MINIPORT_USES_SAFE_BUFFER_APIS 0x00020000 +#define NDIS_MINIPORT_HIDDEN 0x00040000 +#define NDIS_MINIPORT_SWENUM 0x00080000 +#define NDIS_MINIPORT_SURPRISE_REMOVE_OK 0x00100000 +#define NDIS_MINIPORT_NO_HALT_ON_SUSPEND 0x00200000 +#define NDIS_MINIPORT_HARDWARE_DEVICE 0x00400000 +#define NDIS_MINIPORT_SUPPORTS_CANCEL_SEND_PACKETS 0x00800000 +#define NDIS_MINIPORT_64BITS_DMA 0x01000000 + +#pragma pack(pop) + +#ifdef __cplusplus +} +#endif + +#endif /* __NTDDNDIS_H */ diff --git a/reactos/include/ddk/ntddpar.h b/reactos/include/ddk/ntddpar.h new file mode 100644 index 00000000000..360157651e6 --- /dev/null +++ b/reactos/include/ddk/ntddpar.h @@ -0,0 +1,117 @@ +/* + * ntddpar.h + * + * Parallel port driver interface + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __NTDDPAR_H +#define __NTDDPAR_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Parallel port device GUIDs */ + +DEFINE_GUID (GUID_DEVINTERFACE_PARALLEL, + 0x97F76EF0, 0xF883, 0x11D0, 0xAF, 0x1F, 0x00, 0x00, 0xF8, 0x00, 0x84, 0x5C); +DEFINE_GUID (GUID_DEVINTERFACE_PARCLASS, + 0x811FC6A5, 0xF728, 0x11D0, 0xA5, 0x37, 0x00, 0x00, 0xF8, 0x75, 0x3E, 0xD1); + +#define GUID_PARALLEL_DEVICE GUID_DEVINTERFACE_PARALLEL +#define GUID_PARCLASS_DEVICE GUID_DEVINTERFACE_PARCLASS + + +#define IOCTL_IEEE1284_GET_MODE \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 5, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_IEEE1284_NEGOTIATE \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 6, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_PAR_GET_DEFAULT_MODES \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 10, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_PAR_GET_DEVICE_CAPS \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 9, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_PAR_IS_PORT_FREE \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 21, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_PAR_QUERY_DEVICE_ID \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 3, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_PAR_QUERY_DEVICE_ID_SIZE \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 4, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_PAR_QUERY_INFORMATION \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 1, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_PAR_QUERY_LOCATION \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 22, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_PAR_QUERY_RAW_DEVICE_ID \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 12, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_PAR_SET_INFORMATION \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 2, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_PAR_SET_READ_ADDRESS \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 8, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_PAR_SET_WRITE_ADDRESS \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 7, METHOD_BUFFERED, FILE_ANY_ACCESS) + +typedef struct _PAR_DEVICE_ID_SIZE_INFORMATION { + ULONG DeviceIdSize; +} PAR_DEVICE_ID_SIZE_INFORMATION, *PPAR_DEVICE_ID_SIZE_INFORMATION; + +#define PARALLEL_INIT 0x01 +#define PARALLEL_AUTOFEED 0x02 +#define PARALLEL_PAPER_EMPTY 0x04 +#define PARALLEL_OFF_LINE 0x08 +#define PARALLEL_POWER_OFF 0x10 +#define PARALLEL_NOT_CONNECTED 0x20 +#define PARALLEL_BUSY 0x40 +#define PARALLEL_SELECTED 0x80 + +typedef struct _PAR_QUERY_INFORMATION { + UCHAR Status; +} PAR_QUERY_INFORMATION, *PPAR_QUERY_INFORMATION; + +typedef struct _PAR_SET_INFORMATION { + UCHAR Init; +} PAR_SET_INFORMATION, *PPAR_SET_INFORMATION; + +typedef struct _PARCLASS_NEGOTIATION_MASK { + USHORT usReadMask; + USHORT usWriteMask; +} PARCLASS_NEGOTIATION_MASK, *PPARCLASS_NEGOTIATION_MASK; + +#define NONE 0x0000 +#define CENTRONICS 0x0001 +#define IEEE_COMPATIBILITY 0x0002 +#define NIBBLE 0x0004 +#define CHANNEL_NIBBLE 0x0008 +#define BYTE_BIDIR 0x0010 +#define EPP_HW 0x0020 +#define EPP_SW 0x0040 +#define EPP_ANY 0x0060 +#define BOUNDED_ECP 0x0080 +#define ECP_HW_NOIRQ 0x0100 +#define ECP_HW_IRQ 0x0200 +#define ECP_SW 0x0400 +#define ECP_ANY 0x0780 + +#ifdef __cplusplus +} +#endif + +#endif /* __NTDDPAR_H */ diff --git a/reactos/include/ddk/ntddpcm.h b/reactos/include/ddk/ntddpcm.h new file mode 100644 index 00000000000..aeb07a8c2fc --- /dev/null +++ b/reactos/include/ddk/ntddpcm.h @@ -0,0 +1,163 @@ +/* + * ntddpcm.h + * + * PCMCIA IOCTL interface + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __NTDDPCM_H +#define __NTDDPCM_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define IOCTL_PCMCIA_BASE FILE_DEVICE_CONTROLLER + +#define DD_PCMCIA_DEVICE_NAME "\\\\.\\Pcmcia" +#define DD_PCMCIA_DEVICE_NAME_U L"\\\\.\\Pcmcia" + +#define IOCTL_GET_TUPLE_DATA \ + CTL_CODE(IOCTL_PCMCIA_BASE, 3000, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_SOCKET_INFORMATION \ + CTL_CODE(IOCTL_PCMCIA_BASE, 3004, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define DEVICE_IDENTIFIER_LENGTH 64 +#define DRIVER_NAME_LENGTH 32 +#define MANUFACTURER_NAME_LENGTH 64 + +#define PcmciaInvalidControllerType 0xffffffff + +typedef struct _TUPLE_REQUEST { + USHORT Socket; +} TUPLE_REQUEST, *PTUPLE_REQUEST; + +typedef enum _PCMCIA_CONTROLLER_CLASS { + PcmciaInvalidControllerClass = -1, + PcmciaIntelCompatible, + PcmciaCardBusCompatible, + PcmciaElcController, + PcmciaDatabook, + PcmciaPciPcmciaBridge, + PcmciaCirrusLogic, + PcmciaTI, + PcmciaTopic, + PcmciaRicoh, + PcmciaDatabookCB, + PcmciaOpti, + PcmciaTrid, + PcmciaO2Micro, + PcmciaNEC, + PcmciaNEC_98 +} PCMCIA_CONTROLLER_CLASS, *PPCMCIA_CONTROLLER_CLASS; + +typedef struct _PCMCIA_SOCKET_INFORMATION { + USHORT Socket; + USHORT TupleCrc; + UCHAR Manufacturer[MANUFACTURER_NAME_LENGTH]; + UCHAR Identifier[DEVICE_IDENTIFIER_LENGTH]; + UCHAR DriverName[DRIVER_NAME_LENGTH]; + UCHAR DeviceFunctionId; + UCHAR Reserved; + UCHAR CardInSocket; + UCHAR CardEnabled; + ULONG ControllerType; +} PCMCIA_SOCKET_INFORMATION, *PPCMCIA_SOCKET_INFORMATION; + +#define PcmciaClassFromControllerType(type) ((PCMCIA_CONTROLLER_CLASS)((type) & 0xff)) +#define PcmciaModelFromControllerType(type) (((type) >> 8) & 0x3ffff) +#define PcmciaRevisionFromControllerType(type) ((type) >> 26) + + +DEFINE_GUID(GUID_PCMCIA_INTERFACE_STANDARD, \ + 0xbed5dadfL, 0x38fb, 0x11d1, 0x94, 0x62, 0x00, 0xc0, 0x4f, 0xb9, 0x60, 0xee); + +typedef ULONG MEMORY_SPACE; + +typedef ULONG STDCALL +(*PPCMCIA_READ_WRITE_CONFIG)( + IN PVOID Context, + IN ULONG WhichSpace, + IN PUCHAR Buffer, + IN ULONG Offset, + IN ULONG Length); + +#define PCCARD_PCI_CONFIGURATION_SPACE 0 +#define PCCARD_ATTRIBUTE_MEMORY 1 +#define PCCARD_COMMON_MEMORY 2 +#define PCCARD_ATTRIBUTE_MEMORY_INDIRECT 3 +#define PCCARD_COMMON_MEMORY_INDIRECT 4 + +typedef struct _PCMCIA_BUS_INTERFACE_STANDARD { + USHORT Size; + USHORT Version; + PVOID Context; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; + PPCMCIA_READ_WRITE_CONFIG ReadConfig; + PPCMCIA_READ_WRITE_CONFIG WriteConfig; +} PCMCIA_BUS_INTERFACE_STANDARD, *PPCMCIA_BUS_INTERFACE_STANDARD; + +#define PCMCIA_MEMORY_8BIT_ACCESS 0 +#define PCMCIA_MEMORY_16BIT_ACCESS 1 + +typedef BOOLEAN STDCALL +(*PPCMCIA_MODIFY_MEMORY_WINDOW)( + IN PVOID Context, + IN ULONGLONG HostBase, + IN ULONGLONG CardBase, + IN BOOLEAN Enable, + IN ULONG WindowSize OPTIONAL, + IN UCHAR AccessSpeed OPTIONAL, + IN UCHAR BusWidth OPTIONAL, + IN BOOLEAN IsAttributeMemory OPTIONAL); + +#define PCMCIA_VPP_0V 0 +#define PCMCIA_VPP_12V 1 +#define PCMCIA_VPP_IS_VCC 2 + +typedef BOOLEAN STDCALL +(*PPCMCIA_SET_VPP)( + IN PVOID Context, + IN UCHAR VppLevel); + +typedef BOOLEAN STDCALL +(*PPCMCIA_IS_WRITE_PROTECTED)( + IN PVOID Context); + +typedef struct _PCMCIA_INTERFACE_STANDARD { + USHORT Size; + USHORT Version; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; + PVOID Context; + PPCMCIA_MODIFY_MEMORY_WINDOW ModifyMemoryWindow; + PPCMCIA_SET_VPP SetVpp; + PPCMCIA_IS_WRITE_PROTECTED IsWriteProtected; +} PCMCIA_INTERFACE_STANDARD, *PPCMCIA_INTERFACE_STANDARD; + +#ifdef __cplusplus +} +#endif + +#endif /* __NTDDPCM_H */ diff --git a/reactos/include/ddk/ntddscsi.h b/reactos/include/ddk/ntddscsi.h new file mode 100644 index 00000000000..0d434a24e48 --- /dev/null +++ b/reactos/include/ddk/ntddscsi.h @@ -0,0 +1,175 @@ +/* + * ntddscsi.h + * + * SCSI port IOCTL interface. + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __NTDDSCSI_H +#define __NTDDSCSI_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define DD_SCSI_DEVICE_NAME "\\Device\\ScsiPort" +#define DD_SCSI_DEVICE_NAME_U L"\\Device\\ScsiPort" + +#define IOCTL_SCSI_BASE FILE_DEVICE_CONTROLLER + +#define IOCTL_SCSI_FREE_DUMP_POINTERS \ + CTL_CODE(IOCTL_SCSI_BASE, 0x0409, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_SCSI_GET_INQUIRY_DATA \ + CTL_CODE(IOCTL_SCSI_BASE, 0x0403, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_SCSI_GET_CAPABILITIES \ + CTL_CODE(IOCTL_SCSI_BASE, 0x0404, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_SCSI_GET_ADDRESS \ + CTL_CODE(IOCTL_SCSI_BASE, 0x0406, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_SCSI_GET_DUMP_POINTERS \ + CTL_CODE(IOCTL_SCSI_BASE, 0x0408, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_SCSI_MINIPORT \ + CTL_CODE(IOCTL_SCSI_BASE, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_SCSI_PASS_THROUGH \ + CTL_CODE(IOCTL_SCSI_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_SCSI_PASS_THROUGH_DIRECT \ + CTL_CODE(IOCTL_SCSI_BASE, 0x0405, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_SCSI_RESCAN_BUS \ + CTL_CODE(IOCTL_SCSI_BASE, 0x0407, METHOD_BUFFERED, FILE_ANY_ACCESS) + + +DEFINE_GUID(ScsiRawInterfaceGuid, \ + 0x53f56309L, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b); + +DEFINE_GUID(WmiScsiAddressGuid, \ + 0x53f5630fL, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b); + +typedef struct _SCSI_PASS_THROUGH { + USHORT Length; + UCHAR ScsiStatus; + UCHAR PathId; + UCHAR TargetId; + UCHAR Lun; + UCHAR CdbLength; + UCHAR SenseInfoLength; + UCHAR DataIn; + ULONG DataTransferLength; + ULONG TimeOutValue; + ULONG_PTR DataBufferOffset; + ULONG SenseInfoOffset; + UCHAR Cdb[16]; +} SCSI_PASS_THROUGH, *PSCSI_PASS_THROUGH; + +typedef struct _SCSI_PASS_THROUGH_DIRECT { + USHORT Length; + UCHAR ScsiStatus; + UCHAR PathId; + UCHAR TargetId; + UCHAR Lun; + UCHAR CdbLength; + UCHAR SenseInfoLength; + UCHAR DataIn; + ULONG DataTransferLength; + ULONG TimeOutValue; + PVOID DataBuffer; + ULONG SenseInfoOffset; + UCHAR Cdb[16]; +} SCSI_PASS_THROUGH_DIRECT, *PSCSI_PASS_THROUGH_DIRECT; + +typedef struct _SRB_IO_CONTROL { + ULONG HeaderLength; + UCHAR Signature[8]; + ULONG Timeout; + ULONG ControlCode; + ULONG ReturnCode; + ULONG Length; +} SRB_IO_CONTROL, *PSRB_IO_CONTROL; + +typedef struct _SCSI_ADDRESS { + ULONG Length; + UCHAR PortNumber; + UCHAR PathId; + UCHAR TargetId; + UCHAR Lun; +} SCSI_ADDRESS, *PSCSI_ADDRESS; + +typedef struct _SCSI_BUS_DATA { + UCHAR NumberOfLogicalUnits; + UCHAR InitiatorBusId; + ULONG InquiryDataOffset; +}SCSI_BUS_DATA, *PSCSI_BUS_DATA; + +typedef struct _SCSI_ADAPTER_BUS_INFO { + UCHAR NumberOfBuses; + SCSI_BUS_DATA BusData[1]; +} SCSI_ADAPTER_BUS_INFO, *PSCSI_ADAPTER_BUS_INFO; + +typedef struct _IO_SCSI_CAPABILITIES { + ULONG Length; + ULONG MaximumTransferLength; + ULONG MaximumPhysicalPages; + ULONG SupportedAsynchronousEvents; + ULONG AlignmentMask; + BOOLEAN TaggedQueuing; + BOOLEAN AdapterScansDown; + BOOLEAN AdapterUsesPio; +} IO_SCSI_CAPABILITIES, *PIO_SCSI_CAPABILITIES; + +typedef struct _SCSI_INQUIRY_DATA { + UCHAR PathId; + UCHAR TargetId; + UCHAR Lun; + BOOLEAN DeviceClaimed; + ULONG InquiryDataLength; + ULONG NextInquiryDataOffset; + UCHAR InquiryData[1]; +} SCSI_INQUIRY_DATA, *PSCSI_INQUIRY_DATA; + +#define SCSI_IOCTL_DATA_OUT 0 +#define SCSI_IOCTL_DATA_IN 1 +#define SCSI_IOCTL_DATA_UNSPECIFIED 2 + +typedef struct _DUMP_POINTERS { + struct _ADAPTER_OBJECT *AdapterObject; + PVOID MappedRegisterBase; + PVOID DumpData; + PVOID CommonBufferVa; + LARGE_INTEGER CommonBufferPa; + ULONG CommonBufferSize; + BOOLEAN AllocateCommonBuffers; + BOOLEAN UseDiskDump; + UCHAR Spare1[2]; + PVOID DeviceObject; +} DUMP_POINTERS, *PDUMP_POINTERS; + +#ifdef __cplusplus +} +#endif + +#endif /* __NTDDSCSI_H */ diff --git a/reactos/include/ddk/ntddser.h b/reactos/include/ddk/ntddser.h new file mode 100644 index 00000000000..7f6286d99df --- /dev/null +++ b/reactos/include/ddk/ntddser.h @@ -0,0 +1,447 @@ +/* + * ntddser.h + * + * Serial port driver interface + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __NTDDSER_H +#define __NTDDSER_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* GUIDs */ + +DEFINE_GUID(GUID_DEVINTERFACE_COMPORT, + 0x86e0d1e0L, 0x8089, 0x11d0, 0x9c, 0xe4, 0x08, 0x00, 0x3e, 0x30, 0x1f, 0x73); + +DEFINE_GUID(GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR, + 0x4D36E978L, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); + +#define IOCTL_SERIAL_CLEAR_STATS \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 36, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_CLR_DTR \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 10, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_CLR_RTS \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 13, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_CONFIG_SIZE \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 32, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_GET_BAUD_RATE \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 20, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_GET_CHARS \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 22, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_GET_COMMSTATUS \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 27, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_GET_DTRRTS \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 30, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_GET_HANDFLOW \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 24, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_GET_LINE_CONTROL \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 21, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_GET_MODEM_CONTROL \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 37, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_GET_MODEMSTATUS \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 26, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_GET_PROPERTIES \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 29, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_GET_STATS \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 35, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_GET_TIMEOUTS \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 8, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_GET_WAIT_MASK \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 16, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_IMMEDIATE_CHAR \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 6, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_LSRMST_INSERT \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 31, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_PURGE \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 19, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_RESET_DEVICE \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 11, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_SET_BAUD_RATE \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 1, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_SET_BREAK_ON \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 4, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_SET_BREAK_OFF \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 5, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_SET_CHARS \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 23, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_SET_DTR \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 9, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_SET_FIFO_CONTROL \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 39, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_SET_HANDFLOW \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 25, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_SET_LINE_CONTROL \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 3, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_SET_MODEM_CONTROL \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 38, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_SET_QUEUE_SIZE \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 2, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_SET_RTS \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 12, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_SET_TIMEOUTS \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 7, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_SET_WAIT_MASK \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 17, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_SET_XOFF \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 14, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_SET_XON \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 15, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_WAIT_ON_MASK \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 18, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_XOFF_COUNTER \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 28, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_SERIAL_INTERNAL_BASIC_SETTINGS \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 3, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_INTERNAL_CANCEL_WAIT_WAKE \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 2, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_INTERNAL_DO_WAIT_WAKE \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 1, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERIAL_INTERNAL_RESTORE_SETTINGS \ + CTL_CODE (FILE_DEVICE_SERIAL_PORT, 4, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_SERENUM_PORT_DESC \ + CTL_CODE (FILE_DEVICE_SERENUM, 130, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SERENUM_GET_PORT_NAME \ + CTL_CODE (FILE_DEVICE_SERENUM, 131, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_SERENUM_REMOVE_SELF \ + CTL_CODE (FILE_DEVICE_SERENUM, 129, METHOD_NEITHER, FILE_ANY_ACCESS) + + +typedef struct _SERIAL_BAUD_RATE { + ULONG BaudRate; +} SERIAL_BAUD_RATE, *PSERIAL_BAUD_RATE; + +/* SERIAL_BAUD_RATE.BaudRate constants */ +#define SERIAL_BAUD_075 0x00000001 +#define SERIAL_BAUD_110 0x00000002 +#define SERIAL_BAUD_134_5 0x00000004 +#define SERIAL_BAUD_150 0x00000008 +#define SERIAL_BAUD_300 0x00000010 +#define SERIAL_BAUD_600 0x00000020 +#define SERIAL_BAUD_1200 0x00000040 +#define SERIAL_BAUD_1800 0x00000080 +#define SERIAL_BAUD_2400 0x00000100 +#define SERIAL_BAUD_4800 0x00000200 +#define SERIAL_BAUD_7200 0x00000400 +#define SERIAL_BAUD_9600 0x00000800 +#define SERIAL_BAUD_14400 0x00001000 +#define SERIAL_BAUD_19200 0x00002000 +#define SERIAL_BAUD_38400 0x00004000 +#define SERIAL_BAUD_56K 0x00008000 +#define SERIAL_BAUD_128K 0x00010000 +#define SERIAL_BAUD_115200 0x00020000 +#define SERIAL_BAUD_57600 0x00040000 +#define SERIAL_BAUD_USER 0x10000000 + +typedef struct _SERIAL_CHARS { + UCHAR EofChar; + UCHAR ErrorChar; + UCHAR BreakChar; + UCHAR EventChar; + UCHAR XonChar; + UCHAR XoffChar; +} SERIAL_CHARS, *PSERIAL_CHARS; + +typedef struct _SERIAL_STATUS { + ULONG Errors; + ULONG HoldReasons; + ULONG AmountInInQueue; + ULONG AmountInOutQueue; + BOOLEAN EofReceived; + BOOLEAN WaitForImmediate; +} SERIAL_STATUS, *PSERIAL_STATUS; + +typedef struct _SERIAL_HANDFLOW { + ULONG ControlHandShake; + ULONG FlowReplace; + LONG XonLimit; + LONG XoffLimit; +} SERIAL_HANDFLOW, *PSERIAL_HANDFLOW; + +#define SERIAL_DTR_MASK 0x00000003 +#define SERIAL_DTR_CONTROL 0x00000001 +#define SERIAL_DTR_HANDSHAKE 0x00000002 +#define SERIAL_CTS_HANDSHAKE 0x00000008 +#define SERIAL_DSR_HANDSHAKE 0x00000010 +#define SERIAL_DCD_HANDSHAKE 0x00000020 +#define SERIAL_OUT_HANDSHAKEMASK 0x00000038 +#define SERIAL_DSR_SENSITIVITY 0x00000040 +#define SERIAL_ERROR_ABORT 0x80000000 +#define SERIAL_CONTROL_INVALID 0x7fffff84 +#define SERIAL_AUTO_TRANSMIT 0x00000001 +#define SERIAL_AUTO_RECEIVE 0x00000002 +#define SERIAL_ERROR_CHAR 0x00000004 +#define SERIAL_NULL_STRIPPING 0x00000008 +#define SERIAL_BREAK_CHAR 0x00000010 +#define SERIAL_RTS_MASK 0x000000c0 +#define SERIAL_RTS_CONTROL 0x00000040 +#define SERIAL_RTS_HANDSHAKE 0x00000080 +#define SERIAL_TRANSMIT_TOGGLE 0x000000c0 +#define SERIAL_XOFF_CONTINUE 0x80000000 +#define SERIAL_FLOW_INVALID 0x7fffff20 + +typedef struct _SERIAL_LINE_CONTROL { + UCHAR StopBits; + UCHAR Parity; + UCHAR WordLength; +} SERIAL_LINE_CONTROL, *PSERIAL_LINE_CONTROL; + +/* SERIAL_LINE_CONTROL.StopBits constants */ +#define STOP_BIT_1 0x00 +#define STOP_BITS_1_5 0x01 +#define STOP_BITS_2 0x02 + +/* SERIAL_LINE_CONTROL.Parity constants */ +#define NO_PARITY 0x00 +#define ODD_PARITY 0x01 +#define EVEN_PARITY 0x02 +#define MARK_PARITY 0x03 +#define SPACE_PARITY 0x04 + +/* IOCTL_SERIAL_(GET_MODEM_CONTROL, SET_MODEM_CONTROL) flags */ +#define SERIAL_IOC_MCR_DTR 0x00000001 +#define SERIAL_IOC_MCR_RTS 0x00000002 +#define SERIAL_IOC_MCR_OUT1 0x00000004 +#define SERIAL_IOC_MCR_OUT2 0x00000008 +#define SERIAL_IOC_MCR_LOOP 0x00000010 + +typedef struct _SERIAL_COMMPROP { + USHORT PacketLength; + USHORT PacketVersion; + ULONG ServiceMask; + ULONG Reserved1; + ULONG MaxTxQueue; + ULONG MaxRxQueue; + ULONG MaxBaud; + ULONG ProvSubType; + ULONG ProvCapabilities; + ULONG SettableParams; + ULONG SettableBaud; + USHORT SettableData; + USHORT SettableStopParity; + ULONG CurrentTxQueue; + ULONG CurrentRxQueue; + ULONG ProvSpec1; + ULONG ProvSpec2; + WCHAR ProvChar[1]; +} SERIAL_COMMPROP, *PSERIAL_COMMPROP; + +/* SERIAL_COMMPROP.SettableParams flags */ +#define SERIAL_SP_PARITY 0x0001 +#define SERIAL_SP_BAUD 0x0002 +#define SERIAL_SP_DATABITS 0x0004 +#define SERIAL_SP_STOPBITS 0x0008 +#define SERIAL_SP_HANDSHAKING 0x0010 +#define SERIAL_SP_PARITY_CHECK 0x0020 +#define SERIAL_SP_CARRIER_DETECT 0x0040 + +/* SERIAL_COMMPROP.ProvCapabilities flags */ +#define SERIAL_PCF_DTRDSR 0x00000001 +#define SERIAL_PCF_RTSCTS 0x00000002 +#define SERIAL_PCF_CD 0x00000004 +#define SERIAL_PCF_PARITY_CHECK 0x00000008 +#define SERIAL_PCF_XONXOFF 0x00000010 +#define SERIAL_PCF_SETXCHAR 0x00000020 +#define SERIAL_PCF_TOTALTIMEOUTS 0x00000040 +#define SERIAL_PCF_INTTIMEOUTS 0x00000080 +#define SERIAL_PCF_SPECIALCHARS 0x00000100 +#define SERIAL_PCF_16BITMODE 0x00000200 + +/* SERIAL_COMMPROP.SettableData flags */ +#define SERIAL_DATABITS_5 0x0001 +#define SERIAL_DATABITS_6 0x0002 +#define SERIAL_DATABITS_7 0x0004 +#define SERIAL_DATABITS_8 0x0008 +#define SERIAL_DATABITS_16 0x0010 +#define SERIAL_DATABITS_16X 0x0020 + +/* SERIAL_COMMPROP.SettableStopParity flags */ +#define SERIAL_STOPBITS_10 0x0001 +#define SERIAL_STOPBITS_15 0x0002 +#define SERIAL_STOPBITS_20 0x0004 +#define SERIAL_PARITY_NONE 0x0100 +#define SERIAL_PARITY_ODD 0x0200 +#define SERIAL_PARITY_EVEN 0x0400 +#define SERIAL_PARITY_MARK 0x0800 +#define SERIAL_PARITY_SPACE 0x1000 + +typedef struct _SERIALPERF_STATS { + ULONG ReceivedCount; + ULONG TransmittedCount; + ULONG FrameErrorCount; + ULONG SerialOverrunErrorCount; + ULONG BufferOverrunErrorCount; + ULONG ParityErrorCount; +} SERIALPERF_STATS, *PSERIALPERF_STATS; + +typedef struct _SERIAL_TIMEOUTS { + ULONG ReadIntervalTimeout; + ULONG ReadTotalTimeoutMultiplier; + ULONG ReadTotalTimeoutConstant; + ULONG WriteTotalTimeoutMultiplier; + ULONG WriteTotalTimeoutConstant; +} SERIAL_TIMEOUTS, *PSERIAL_TIMEOUTS; + +/* IOCTL_SERIAL_(GET_WAIT_MASK, SET_WAIT_MASK, WAIT_ON_MASK) flags */ +#define SERIAL_EV_RXCHAR 0x0001 +#define SERIAL_EV_RXFLAG 0x0002 +#define SERIAL_EV_TXEMPTY 0x0004 +#define SERIAL_EV_CTS 0x0008 +#define SERIAL_EV_DSR 0x0010 +#define SERIAL_EV_RLSD 0x0020 +#define SERIAL_EV_BREAK 0x0040 +#define SERIAL_EV_ERR 0x0080 +#define SERIAL_EV_RING 0x0100 +#define SERIAL_EV_PERR 0x0200 +#define SERIAL_EV_RX80FULL 0x0400 +#define SERIAL_EV_EVENT1 0x0800 +#define SERIAL_EV_EVENT2 0x1000 + +/* IOCTL_SERIAL_LSRMST_INSERT constants */ +#define SERIAL_LSRMST_LSR_DATA 0x01 +#define SERIAL_LSRMST_LSR_NODATA 0x02 +#define SERIAL_LSRMST_MST 0x03 +#define SERIAL_LSRMST_ESCAPE 0x00 + +/* IOCTL_SERIAL_PURGE constants */ +#define SERIAL_PURGE_TXABORT 0x00000001 +#define SERIAL_PURGE_RXABORT 0x00000002 +#define SERIAL_PURGE_TXCLEAR 0x00000004 +#define SERIAL_PURGE_RXCLEAR 0x00000008 + +/* IOCTL_SERIAL_SET_FIFO_CONTROL constants */ +#define SERIAL_IOC_FCR_FIFO_ENABLE 0x00000001 +#define SERIAL_IOC_FCR_RCVR_RESET 0x00000002 +#define SERIAL_IOC_FCR_XMIT_RESET 0x00000004 +#define SERIAL_IOC_FCR_DMA_MODE 0x00000008 +#define SERIAL_IOC_FCR_RES1 0x00000010 +#define SERIAL_IOC_FCR_RES2 0x00000020 +#define SERIAL_IOC_FCR_RCVR_TRIGGER_LSB 0x00000040 +#define SERIAL_IOC_FCR_RCVR_TRIGGER_MSB 0x00000080 + +typedef struct _SERIAL_QUEUE_SIZE { + ULONG InSize; + ULONG OutSize; +} SERIAL_QUEUE_SIZE, *PSERIAL_QUEUE_SIZE; + +typedef struct _SERIAL_XOFF_COUNTER { + ULONG Timeout; + LONG Counter; + UCHAR XoffChar; +} SERIAL_XOFF_COUNTER, *PSERIAL_XOFF_COUNTER; + +typedef struct _SERIAL_BASIC_SETTINGS { + SERIAL_TIMEOUTS Timeouts; + SERIAL_HANDFLOW HandFlow; + ULONG RxFifo; + ULONG TxFifo; +} SERIAL_BASIC_SETTINGS, *PSERIAL_BASIC_SETTINGS; + +typedef struct _SERENUM_PORT_DESC { + ULONG Size; + PVOID PortHandle; + PHYSICAL_ADDRESS PortAddress; + USHORT Reserved[1]; +} SERENUM_PORT_DESC, *PSERENUM_PORT_DESC; + +typedef UCHAR STDCALL +(*PSERENUM_READPORT)( + PVOID SerPortAddress); + +typedef VOID STDCALL +(*PSERENUM_WRITEPORT)( + PVOID SerPortAddress, + UCHAR Value); + +typedef enum _SERENUM_PORTION { + SerenumFirstHalf, + SerenumSecondHalf, + SerenumWhole +} SERENUM_PORTION; + +typedef struct _SERENUM_PORT_PARAMETERS { + ULONG Size; + PSERENUM_READPORT ReadAccessor; + PSERENUM_WRITEPORT WriteAccessor; + PVOID SerPortAddress; + PVOID HardwareHandle; + SERENUM_PORTION Portion; + USHORT NumberAxis; + USHORT Reserved[3]; +} SERENUM_PORT_PARAMETERS, *PSERENUM_PORT_PARAMETERS; + +#define SERIAL_ERROR_BREAK 0x00000001 +#define SERIAL_ERROR_FRAMING 0x00000002 +#define SERIAL_ERROR_OVERRUN 0x00000004 +#define SERIAL_ERROR_QUEUEOVERRUN 0x00000008 +#define SERIAL_ERROR_PARITY 0x00000010 + +#define SERIAL_SP_UNSPECIFIED 0x00000000 +#define SERIAL_SP_RS232 0x00000001 +#define SERIAL_SP_PARALLEL 0x00000002 +#define SERIAL_SP_RS422 0x00000003 +#define SERIAL_SP_RS423 0x00000004 +#define SERIAL_SP_RS449 0x00000005 +#define SERIAL_SP_MODEM 0X00000006 +#define SERIAL_SP_FAX 0x00000021 +#define SERIAL_SP_SCANNER 0x00000022 +#define SERIAL_SP_BRIDGE 0x00000100 +#define SERIAL_SP_LAT 0x00000101 +#define SERIAL_SP_TELNET 0x00000102 +#define SERIAL_SP_X25 0x00000103 +#define SERIAL_SP_SERIALCOMM 0x00000001 + +#define SERIAL_TX_WAITING_FOR_CTS 0x00000001 +#define SERIAL_TX_WAITING_FOR_DSR 0x00000002 +#define SERIAL_TX_WAITING_FOR_DCD 0x00000004 +#define SERIAL_TX_WAITING_FOR_XON 0x00000008 +#define SERIAL_TX_WAITING_XOFF_SENT 0x00000010 +#define SERIAL_TX_WAITING_ON_BREAK 0x00000020 +#define SERIAL_RX_WAITING_FOR_DSR 0x00000040 + +#define SERIAL_DTR_STATE 0x00000001 +#define SERIAL_RTS_STATE 0x00000002 +#define SERIAL_CTS_STATE 0x00000010 +#define SERIAL_DSR_STATE 0x00000020 +#define SERIAL_RI_STATE 0x00000040 +#define SERIAL_DCD_STATE 0x00000080 + +typedef struct _SERIALCONFIG { + ULONG Size; + USHORT Version; + ULONG SubType; + ULONG ProvOffset; + ULONG ProviderSize; + WCHAR ProviderData[1]; +} SERIALCONFIG,*PSERIALCONFIG; + +#ifdef __cplusplus +} +#endif + +#endif /* __NTDDSER_H */ diff --git a/reactos/include/ddk/ntddstor.h b/reactos/include/ddk/ntddstor.h new file mode 100644 index 00000000000..ed66158d17a --- /dev/null +++ b/reactos/include/ddk/ntddstor.h @@ -0,0 +1,331 @@ +/* + * ntddstor.h + * + * Storage class IOCTL interface. + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __NTDDSTOR_H +#define __NTDDSTOR_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define IOCTL_STORAGE_BASE FILE_DEVICE_MASS_STORAGE + +#define IOCTL_STORAGE_CHECK_VERIFY \ + CTL_CODE(IOCTL_STORAGE_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_STORAGE_CHECK_VERIFY2 \ + CTL_CODE(IOCTL_STORAGE_BASE, 0x0200, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_STORAGE_EJECT_MEDIA \ + CTL_CODE(IOCTL_STORAGE_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_STORAGE_EJECTION_CONTROL \ + CTL_CODE(IOCTL_STORAGE_BASE, 0x0250, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_STORAGE_FIND_NEW_DEVICES \ + CTL_CODE(IOCTL_STORAGE_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_STORAGE_GET_DEVICE_NUMBER \ + CTL_CODE(IOCTL_STORAGE_BASE, 0x0420, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER \ + CTL_CODE(IOCTL_STORAGE_BASE, 0x0304, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_STORAGE_GET_MEDIA_TYPES \ + CTL_CODE(IOCTL_STORAGE_BASE, 0x0300, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_STORAGE_GET_MEDIA_TYPES_EX \ + CTL_CODE(IOCTL_STORAGE_BASE, 0x0301, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_STORAGE_LOAD_MEDIA \ + CTL_CODE(IOCTL_STORAGE_BASE, 0x0203, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_STORAGE_LOAD_MEDIA2 \ + CTL_CODE(IOCTL_STORAGE_BASE, 0x0203, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_STORAGE_MCN_CONTROL \ + CTL_CODE(IOCTL_STORAGE_BASE, 0x0251, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_STORAGE_MEDIA_REMOVAL \ + CTL_CODE(IOCTL_STORAGE_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_STORAGE_PREDICT_FAILURE \ + CTL_CODE(IOCTL_STORAGE_BASE, 0x0440, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_STORAGE_QUERY_PROPERTY \ + CTL_CODE(IOCTL_STORAGE_BASE, 0x0500, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_STORAGE_RELEASE \ + CTL_CODE(IOCTL_STORAGE_BASE, 0x0205, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_STORAGE_RESERVE \ + CTL_CODE(IOCTL_STORAGE_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_STORAGE_RESET_BUS \ + CTL_CODE(IOCTL_STORAGE_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_STORAGE_RESET_DEVICE \ + CTL_CODE(IOCTL_STORAGE_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + + +DEFINE_GUID(GUID_DEVINTERFACE_DISK, + 0x53f56307L, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b); + +DEFINE_GUID(GUID_DEVINTERFACE_CDROM, + 0x53f56308L, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b); + +DEFINE_GUID(GUID_DEVINTERFACE_PARTITION, + 0x53f5630aL, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b); + +DEFINE_GUID(GUID_DEVINTERFACE_TAPE, + 0x53f5630bL, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b); + +DEFINE_GUID(GUID_DEVINTERFACE_WRITEONCEDISK, + 0x53f5630cL, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b); + +DEFINE_GUID(GUID_DEVINTERFACE_VOLUME, + 0x53f5630dL, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b); + +DEFINE_GUID(GUID_DEVINTERFACE_MEDIUMCHANGER, + 0x53f56310L, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b); + +DEFINE_GUID(GUID_DEVINTERFACE_FLOPPY, + 0x53f56311L, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b); + +DEFINE_GUID(GUID_DEVINTERFACE_CDCHANGER, + 0x53f56312L, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b); + +DEFINE_GUID(GUID_DEVINTERFACE_STORAGEPORT, + 0x2accfe60L, 0xc130, 0x11d2, 0xb0, 0x82, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b); + + +typedef enum _STORAGE_MEDIA_TYPE { + DDS_4mm = 0x20, + MiniQic, + Travan, + QIC, + MP_8mm, + AME_8mm, + AIT1_8mm, + DLT, + NCTP, + IBM_3480, + IBM_3490E, + IBM_Magstar_3590, + IBM_Magstar_MP, + STK_DATA_D3, + SONY_DTF, + DV_6mm, + DMI, + SONY_D2, + CLEANER_CARTRIDGE, + CD_ROM, + CD_R, + CD_RW, + DVD_ROM, + DVD_R, + DVD_RW, + MO_3_RW, + MO_5_WO, + MO_5_RW, + MO_5_LIMDOW, + PC_5_WO, + PC_5_RW, + PD_5_RW, + ABL_5_WO, + PINNACLE_APEX_5_RW, + SONY_12_WO, + PHILIPS_12_WO, + HITACHI_12_WO, + CYGNET_12_WO, + KODAK_14_WO, + MO_NFR_525, + NIKON_12_RW, + IOMEGA_ZIP, + IOMEGA_JAZ, + SYQUEST_EZ135, + SYQUEST_EZFLYER, + SYQUEST_SYJET, + AVATAR_F2, + MP2_8mm, + DST_S, + DST_M, + DST_L, + VXATape_1, + VXATape_2, + STK_9840, + LTO_Ultrium, + LTO_Accelis, + DVD_RAM, + AIT_8mm, + ADR_1, + ADR_2 +} STORAGE_MEDIA_TYPE, *PSTORAGE_MEDIA_TYPE; + +typedef enum _STORAGE_BUS_TYPE { + BusTypeUnknown = 0x00, + BusTypeScsi, + BusTypeAtapi, + BusTypeAta, + BusType1394, + BusTypeSsa, + BusTypeFibre, + BusTypeUsb, + BusTypeRAID, + BusTypeMaxReserved = 0x7F +} STORAGE_BUS_TYPE, *PSTORAGE_BUS_TYPE; + +/* DEVICE_MEDIA_INFO.DeviceSpecific.DiskInfo.MediaCharacteristics constants */ +#define MEDIA_ERASEABLE 0x00000001 +#define MEDIA_WRITE_ONCE 0x00000002 +#define MEDIA_READ_ONLY 0x00000004 +#define MEDIA_READ_WRITE 0x00000008 +#define MEDIA_WRITE_PROTECTED 0x00000100 +#define MEDIA_CURRENTLY_MOUNTED 0x80000000 + +typedef struct _DEVICE_MEDIA_INFO { + union { + struct { + LARGE_INTEGER Cylinders; + STORAGE_MEDIA_TYPE MediaType; + ULONG TracksPerCylinder; + ULONG SectorsPerTrack; + ULONG BytesPerSector; + ULONG NumberMediaSides; + ULONG MediaCharacteristics; + } DiskInfo; + struct { + LARGE_INTEGER Cylinders; + STORAGE_MEDIA_TYPE MediaType; + ULONG TracksPerCylinder; + ULONG SectorsPerTrack; + ULONG BytesPerSector; + ULONG NumberMediaSides; + ULONG MediaCharacteristics; + } RemovableDiskInfo; + struct { + STORAGE_MEDIA_TYPE MediaType; + ULONG MediaCharacteristics; + ULONG CurrentBlockSize; + STORAGE_BUS_TYPE BusType; + union { + struct { + UCHAR MediumType; + UCHAR DensityCode; + } ScsiInformation; + } BusSpecificData; + } TapeInfo; + } DeviceSpecific; +} DEVICE_MEDIA_INFO, *PDEVICE_MEDIA_INFO; + +typedef struct _GET_MEDIA_TYPES { + ULONG DeviceType; + ULONG MediaInfoCount; + DEVICE_MEDIA_INFO MediaInfo[1]; +} GET_MEDIA_TYPES, *PGET_MEDIA_TYPES; + +typedef struct _STORAGE_ADAPTER_DESCRIPTOR { + ULONG Version; + ULONG Size; + ULONG MaximumTransferLength; + ULONG MaximumPhysicalPages; + ULONG AlignmentMask; + BOOLEAN AdapterUsesPio; + BOOLEAN AdapterScansDown; + BOOLEAN CommandQueueing; + BOOLEAN AcceleratedTransfer; + STORAGE_BUS_TYPE BusType; + USHORT BusMajorVersion; + USHORT BusMinorVersion; +} STORAGE_ADAPTER_DESCRIPTOR, *PSTORAGE_ADAPTER_DESCRIPTOR; + +typedef struct _STORAGE_BUS_RESET_REQUEST { + UCHAR PathId; +} STORAGE_BUS_RESET_REQUEST, *PSTORAGE_BUS_RESET_REQUEST; + +typedef struct _STORAGE_DESCRIPTOR_HEADER { + ULONG Version; + ULONG Size; +} STORAGE_DESCRIPTOR_HEADER, *PSTORAGE_DESCRIPTOR_HEADER; + +typedef struct _STORAGE_DEVICE_DESCRIPTOR { + ULONG Version; + ULONG Size; + UCHAR DeviceType; + UCHAR DeviceTypeModifier; + BOOLEAN RemovableMedia; + BOOLEAN CommandQueueing; + ULONG VendorIdOffset; + ULONG ProductIdOffset; + ULONG ProductRevisionOffset; + ULONG SerialNumberOffset; + STORAGE_BUS_TYPE BusType; + ULONG RawPropertiesLength; + UCHAR RawDeviceProperties[1]; +} STORAGE_DEVICE_DESCRIPTOR, *PSTORAGE_DEVICE_DESCRIPTOR; + +typedef struct _STORAGE_DEVICE_ID_DESCRIPTOR { + ULONG Version; + ULONG Size; + ULONG NumberOfIdentifiers; + UCHAR Identifiers[1]; +} STORAGE_DEVICE_ID_DESCRIPTOR, *PSTORAGE_DEVICE_ID_DESCRIPTOR; + +typedef struct _STORAGE_DEVICE_NUMBER { + DEVICE_TYPE DeviceType; + ULONG DeviceNumber; + ULONG PartitionNumber; +} STORAGE_DEVICE_NUMBER, *PSTORAGE_DEVICE_NUMBER; + +typedef struct _STORAGE_PREDICT_FAILURE { + ULONG PredictFailure; + UCHAR VendorSpecific[512]; +} STORAGE_PREDICT_FAILURE, *PSTORAGE_PREDICT_FAILURE; + +typedef enum _STORAGE_PROPERTY_ID { + StorageDeviceProperty = 0, + StorageAdapterProperty, + StorageDeviceIdProperty +} STORAGE_PROPERTY_ID, *PSTORAGE_PROPERTY_ID; + +typedef enum _STORAGE_QUERY_TYPE { + PropertyStandardQuery = 0, + PropertyExistsQuery, + PropertyMaskQuery, + PropertyQueryMaxDefined +} STORAGE_QUERY_TYPE, *PSTORAGE_QUERY_TYPE; + +typedef struct _STORAGE_PROPERTY_QUERY { + STORAGE_PROPERTY_ID PropertyId; + STORAGE_QUERY_TYPE QueryType; + UCHAR AdditionalParameters[1]; +} STORAGE_PROPERTY_QUERY, *PSTORAGE_PROPERTY_QUERY; + +#ifdef __cplusplus +} +#endif + +#endif /* __NTDDSTOR_H */ diff --git a/reactos/include/ddk/ntddtape.h b/reactos/include/ddk/ntddtape.h new file mode 100644 index 00000000000..4ee7b05c9ad --- /dev/null +++ b/reactos/include/ddk/ntddtape.h @@ -0,0 +1,78 @@ +/* + * ntddtape.h + * + * Tape device IOCTL interface. + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __NTDDTAPE_H +#define __NTDDTAPE_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include "ntddstor.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define DD_TAPE_DEVICE_NAME "\\Device\\Tape" +#define DD_TAPE_DEVICE_NAME_U L"\\Device\\Tape" + +#define IOCTL_TAPE_BASE FILE_DEVICE_TAPE + +#define IOCTL_TAPE_CHECK_VERIFY CTL_CODE(IOCTL_TAPE_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS) +#define IOCTL_TAPE_CREATE_PARTITION CTL_CODE(IOCTL_TAPE_BASE, 0x000a, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) +#define IOCTL_TAPE_ERASE CTL_CODE(IOCTL_TAPE_BASE, 0x0000, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) +#define IOCTL_TAPE_FIND_NEW_DEVICES CTL_CODE(IOCTL_DISK_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS) +#define IOCTL_TAPE_GET_DRIVE_PARAMS CTL_CODE(IOCTL_TAPE_BASE, 0x0005, METHOD_BUFFERED, FILE_READ_ACCESS) +#define IOCTL_TAPE_GET_MEDIA_PARAMS CTL_CODE(IOCTL_TAPE_BASE, 0x0007, METHOD_BUFFERED, FILE_READ_ACCESS) +#define IOCTL_TAPE_GET_POSITION CTL_CODE(IOCTL_TAPE_BASE, 0x0003, METHOD_BUFFERED, FILE_READ_ACCESS) +#define IOCTL_TAPE_GET_STATUS CTL_CODE(IOCTL_TAPE_BASE, 0x0009, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_TAPE_PREPARE CTL_CODE(IOCTL_TAPE_BASE, 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS) +#define IOCTL_TAPE_SET_DRIVE_PARAMS CTL_CODE(IOCTL_TAPE_BASE, 0x0006, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) +#define IOCTL_TAPE_SET_MEDIA_PARAMS CTL_CODE(IOCTL_TAPE_BASE, 0x0008, METHOD_BUFFERED, FILE_READ_ACCESS) +#define IOCTL_TAPE_SET_POSITION CTL_CODE(IOCTL_TAPE_BASE, 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS) +#define IOCTL_TAPE_WRITE_MARKS CTL_CODE(IOCTL_TAPE_BASE, 0x0002, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + + +typedef enum _TAPE_DRIVE_PROBLEM_TYPE { + TapeDriveProblemNone, + TapeDriveReadWriteWarning, + TapeDriveReadWriteError, + TapeDriveReadWarning, + TapeDriveWriteWarning, + TapeDriveReadError, + TapeDriveWriteError, + TapeDriveHardwareError, + TapeDriveUnsupportedMedia, + TapeDriveScsiConnectionError, + TapeDriveTimetoClean, + TapeDriveCleanDriveNow, + TapeDriveMediaLifeExpired, + TapeDriveSnappedTape +} TAPE_DRIVE_PROBLEM_TYPE; + +#ifdef __cplusplus +} +#endif + +#endif /* __NTDDTAPE_H */ diff --git a/reactos/include/ddk/ntddtdi.h b/reactos/include/ddk/ntddtdi.h new file mode 100644 index 00000000000..a4f558a5e5b --- /dev/null +++ b/reactos/include/ddk/ntddtdi.h @@ -0,0 +1,59 @@ +/* + * ntddtdi.h + * + * TDI IOCTL interface + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __NTDDTDI_H +#define __NTDDTDI_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define DD_TDI_DEVICE_NAME "\\Device\\UNKNOWN" +#define DD_TDI_DEVICE_NAME_U L"\\Device\\UNKNOWN" + +#define _TDI_CONTROL_CODE(Request, Method) \ + CTL_CODE(FILE_DEVICE_TRANSPORT, Request, Method, FILE_ANY_ACCESS) + +#define IOCTL_TDI_ACCEPT _TDI_CONTROL_CODE(0, METHOD_BUFFERED) +#define IOCTL_TDI_CONNECT _TDI_CONTROL_CODE(1, METHOD_BUFFERED) +#define IOCTL_TDI_DISCONNECT _TDI_CONTROL_CODE(2, METHOD_BUFFERED) +#define IOCTL_TDI_LISTEN _TDI_CONTROL_CODE(3, METHOD_BUFFERED) +#define IOCTL_TDI_QUERY_INFORMATION _TDI_CONTROL_CODE(4, METHOD_OUT_DIRECT) +#define IOCTL_TDI_RECEIVE _TDI_CONTROL_CODE(5, METHOD_OUT_DIRECT) +#define IOCTL_TDI_RECEIVE_DATAGRAM _TDI_CONTROL_CODE(6, METHOD_OUT_DIRECT) +#define IOCTL_TDI_SEND _TDI_CONTROL_CODE(7, METHOD_IN_DIRECT) +#define IOCTL_TDI_SEND_DATAGRAM _TDI_CONTROL_CODE(8, METHOD_IN_DIRECT) +#define IOCTL_TDI_SET_EVENT_HANDLER _TDI_CONTROL_CODE(9, METHOD_BUFFERED) +#define IOCTL_TDI_SET_INFORMATION _TDI_CONTROL_CODE(10, METHOD_IN_DIRECT) +#define IOCTL_TDI_ASSOCIATE_ADDRESS _TDI_CONTROL_CODE(11, METHOD_BUFFERED) +#define IOCTL_TDI_DISASSOCIATE_ADDRESS _TDI_CONTROL_CODE(12, METHOD_BUFFERED) +#define IOCTL_TDI_ACTION _TDI_CONTROL_CODE(13, METHOD_OUT_DIRECT) + +#ifdef __cplusplus +} +#endif + +#endif /* __NTDDTDI_H */ diff --git a/reactos/include/ddk/ntddvdeo.h b/reactos/include/ddk/ntddvdeo.h new file mode 100644 index 00000000000..239a89a1253 --- /dev/null +++ b/reactos/include/ddk/ntddvdeo.h @@ -0,0 +1,437 @@ +/* + * ntddvdeo.h + * + * Definitions for video devices + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __NTDDVDEO_H +#define __NTDDVDEO_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define VIDEO_DEVICE_NAME "DISPLAY%d" +#define WVIDEO_DEVICE_NAME L"DISPLAY%d" + +#define DD_FULLSCREEN_VIDEO_DEVICE_NAME L"\\Device\\FSVideo" + +DEFINE_GUID(GUID_DEVINTERFACE_DISPLAY_ADAPTER, \ + 0x5b45201d, 0xf2f2, 0x4f3b, 0x85, 0xbb, 0x30, 0xff, 0x1f, 0x95, 0x35, 0x99); + + +#define IOCTL_VIDEO_DISABLE_CURSOR \ + CTL_CODE (FILE_DEVICE_VIDEO, 0x109, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_DISABLE_POINTER \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x10f, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_ENABLE_CURSOR \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x108, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_ENABLE_POINTER \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x10e, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_FREE_PUBLIC_ACCESS_RANGES \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x119, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_GET_BANK_SELECT_CODE \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x115, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_GET_CHILD_STATE \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x120, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_GET_POWER_MANAGEMENT \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x11c, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_HANDLE_VIDEOPARAMETERS \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x08, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_LOAD_AND_SET_FONT \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x105, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_MAP_VIDEO_MEMORY \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x116, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_QUERY_AVAIL_MODES \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x100, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_QUERY_COLOR_CAPABILITIES \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x11a, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_QUERY_CURRENT_MODE \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x102, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_QUERY_CURSOR_ATTR \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x10b, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_QUERY_CURSOR_POSITION \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x10d, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x101, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_QUERY_POINTER_ATTR \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x111, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_QUERY_POINTER_CAPABILITIES \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x114, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_QUERY_POINTER_POSITION \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x113, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_QUERY_PUBLIC_ACCESS_RANGES \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x118, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_RESET_DEVICE \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x104, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_RESTORE_HARDWARE_STATE \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x81, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_SAVE_HARDWARE_STATE \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x80, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_SET_CHILD_STATE_CONFIGURATION \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x122, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_SET_COLOR_REGISTERS \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x107, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_SET_CURRENT_MODE \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x103, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_SET_CURSOR_ATTR \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x10a, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_SET_CURSOR_POSITION \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x10c, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_SET_PALETTE_REGISTERS \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x106, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_SET_POINTER_ATTR \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x110, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_SET_POINTER_POSITION \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x112, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_SET_POWER_MANAGEMENT \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x11b, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_SHARE_VIDEO_MEMORY \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x11d, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_SWITCH_DUALVIEW \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x123, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_UNMAP_VIDEO_MEMORY \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x117, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_UNSHARE_VIDEO_MEMORY \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x11e, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VIDEO_VALIDATE_CHILD_STATE_CONFIGURATION \ + CTL_CODE(FILE_DEVICE_VIDEO, 0x121, METHOD_BUFFERED, FILE_ANY_ACCESS) + + + +typedef struct _VIDEO_MEMORY { + PVOID RequestedVirtualAddress; +} VIDEO_MEMORY, *PVIDEO_MEMORY; + +typedef struct _VIDEO_MEMORY_INFORMATION { + PVOID VideoRamBase; + ULONG VideoRamLength; + PVOID FrameBufferBase; + ULONG FrameBufferLength; +} VIDEO_MEMORY_INFORMATION, *PVIDEO_MEMORY_INFORMATION; + +/* VIDEO_MODE.RequestedMode */ +#define VIDEO_MODE_MAP_MEM_LINEAR 0x40000000 +#define VIDEO_MODE_NO_ZERO_MEMORY 0x80000000 + +typedef struct _VIDEO_MODE { + ULONG RequestedMode; +} VIDEO_MODE, *PVIDEO_MODE; + +/* VIDEO_MODE_INFORMATION.AttributeFlags */ +#define VIDEO_MODE_COLOR 0x0001 +#define VIDEO_MODE_GRAPHICS 0x0002 +#define VIDEO_MODE_PALETTE_DRIVEN 0x0004 +#define VIDEO_MODE_MANAGED_PALETTE 0x0008 +#define VIDEO_MODE_INTERLACED 0x0010 +#define VIDEO_MODE_NO_OFF_SCREEN 0x0020 +#define VIDEO_MODE_NO_64_BIT_ACCESS 0x0040 +#define VIDEO_MODE_BANKED 0x0080 +#define VIDEO_MODE_LINEAR 0x0100 + +typedef struct _VIDEO_MODE_INFORMATION { + ULONG Length; + ULONG ModeIndex; + ULONG VisScreenWidth; + ULONG VisScreenHeight; + ULONG ScreenStride; + ULONG NumberOfPlanes; + ULONG BitsPerPlane; + ULONG Frequency; + ULONG XMillimeter; + ULONG YMillimeter; + ULONG NumberRedBits; + ULONG NumberGreenBits; + ULONG NumberBlueBits; + ULONG RedMask; + ULONG GreenMask; + ULONG BlueMask; + ULONG AttributeFlags; + ULONG VideoMemoryBitmapWidth; + ULONG VideoMemoryBitmapHeight; + ULONG DriverSpecificAttributeFlags; +} VIDEO_MODE_INFORMATION, *PVIDEO_MODE_INFORMATION; + +typedef struct _VIDEO_NUM_MODES { + ULONG NumModes; + ULONG ModeInformationLength; +} VIDEO_NUM_MODES, *PVIDEO_NUM_MODES; + +typedef enum _VIDEO_POWER_STATE { + VideoPowerUnspecified = 0, + VideoPowerOn = 1, + VideoPowerStandBy, + VideoPowerSuspend, + VideoPowerOff, + VideoPowerHibernate, + VideoPowerShutdown, + VideoPowerMaximum +} VIDEO_POWER_STATE, *PVIDEO_POWER_STATE; + +typedef struct _VIDEO_POWER_MANAGEMENT { + ULONG Length; + ULONG DPMSVersion; + ULONG PowerState; +} VIDEO_POWER_MANAGEMENT, *PVIDEO_POWER_MANAGEMENT; + +typedef struct _VIDEO_PUBLIC_ACCESS_RANGES { + ULONG InIoSpace; + ULONG MappedInIoSpace; + PVOID VirtualAddress; +} VIDEO_PUBLIC_ACCESS_RANGES, *PVIDEO_PUBLIC_ACCESS_RANGES; + +typedef struct _VIDEO_SHARE_MEMORY { + HANDLE ProcessHandle; + ULONG ViewOffset; + ULONG ViewSize; + PVOID RequestedVirtualAddress; +} VIDEO_SHARE_MEMORY, *PVIDEO_SHARE_MEMORY; + +typedef struct _VIDEO_SHARE_MEMORY_INFORMATION { + ULONG SharedViewOffset; + ULONG SharedViewSize; + PVOID VirtualAddress; +} VIDEO_SHARE_MEMORY_INFORMATION, *PVIDEO_SHARE_MEMORY_INFORMATION; + +/* VIDEO_BANK_SELECT.BankingFlags constants */ +#define PLANAR_HC 0x00000001 + +/* VIDEO_BANK_SELECT.BankingType and PlanarHCBankingType constants */ +typedef enum _VIDEO_BANK_TYPE { + VideoNotBanked = 0, + VideoBanked1RW, + VideoBanked1R1W, + VideoBanked2RW, + NumVideoBankTypes +} VIDEO_BANK_TYPE, *PVIDEO_BANK_TYPE; + +typedef struct _VIDEO_BANK_SELECT { + ULONG Length; + ULONG Size; + ULONG BankingFlags; + ULONG BankingType; + ULONG PlanarHCBankingType; + ULONG BitmapWidthInBytes; + ULONG BitmapSize; + ULONG Granularity; + ULONG PlanarHCGranularity; + ULONG CodeOffset; + ULONG PlanarHCBankCodeOffset; + ULONG PlanarHCEnableCodeOffset; + ULONG PlanarHCDisableCodeOffset; +} VIDEO_BANK_SELECT, *PVIDEO_BANK_SELECT; + +typedef struct _VIDEO_LOAD_FONT_INFORMATION { + USHORT WidthInPixels; + USHORT HeightInPixels; + ULONG FontSize; + UCHAR Font[1]; +} VIDEO_LOAD_FONT_INFORMATION, *PVIDEO_LOAD_FONT_INFORMATION; + +/* VIDEO_COLOR_CAPABILITIES.AttributeFlags constants */ +#define VIDEO_DEVICE_COLOR 0x00000001 +#define VIDEO_OPTIONAL_GAMMET_TABLE 0x00000002 + +typedef struct _VIDEO_COLOR_CAPABILITIES { + ULONG Length; + ULONG AttributeFlags; + LONG RedPhosphoreDecay; + LONG GreenPhosphoreDecay; + LONG BluePhosphoreDecay; + LONG WhiteChromaticity_x; + LONG WhiteChromaticity_y; + LONG WhiteChromaticity_Y; + LONG RedChromaticity_x; + LONG RedChromaticity_y; + LONG GreenChromaticity_x; + LONG GreenChromaticity_y; + LONG BlueChromaticity_x; + LONG BlueChromaticity_y; + LONG WhiteGamma; + LONG RedGamma; + LONG GreenGamma; + LONG BlueGamma; +} VIDEO_COLOR_CAPABILITIES, *PVIDEO_COLOR_CAPABILITIES; + +typedef struct _VIDEO_CURSOR_ATTRIBUTES { + USHORT Width; + USHORT Height; + SHORT Column; + SHORT Row; + UCHAR Rate; + UCHAR Enable; +} VIDEO_CURSOR_ATTRIBUTES, *PVIDEO_CURSOR_ATTRIBUTES; + +typedef struct _VIDEO_CURSOR_POSITION { + SHORT Column; + SHORT Row; +} VIDEO_CURSOR_POSITION, *PVIDEO_CURSOR_POSITION; + +typedef struct _VIDEO_POINTER_ATTRIBUTES { + ULONG Flags; + ULONG Width; + ULONG Height; + ULONG WidthInBytes; + ULONG Enable; + SHORT Column; + SHORT Row; + UCHAR Pixels[1]; +} VIDEO_POINTER_ATTRIBUTES, *PVIDEO_POINTER_ATTRIBUTES; + +/* VIDEO_POINTER_CAPABILITIES.Flags */ +#define VIDEO_MODE_ASYNC_POINTER 0x01 +#define VIDEO_MODE_MONO_POINTER 0x02 +#define VIDEO_MODE_COLOR_POINTER 0x04 +#define VIDEO_MODE_ANIMATE_START 0x08 +#define VIDEO_MODE_ANIMATE_UPDATE 0x10 + +typedef struct _VIDEO_POINTER_CAPABILITIES { + ULONG Flags; + ULONG MaxWidth; + ULONG MaxHeight; + ULONG HWPtrBitmapStart; + ULONG HWPtrBitmapEnd; +} VIDEO_POINTER_CAPABILITIES, *PVIDEO_POINTER_CAPABILITIES; + +typedef struct _VIDEO_POINTER_POSITION { + SHORT Column; + SHORT Row; +} VIDEO_POINTER_POSITION, *PVIDEO_POINTER_POSITION; + + +/* VIDEO_HARDWARE_STATE_HEADER.VGAStateFlags constants */ +#define VIDEO_STATE_NON_STANDARD_VGA 0x00000001 +#define VIDEO_STATE_UNEMULATED_VGA_STATE 0x00000002 +#define VIDEO_STATE_PACKED_CHAIN4_MODE 0x00000004 + +typedef struct _VIDEO_HARDWARE_STATE_HEADER { + ULONG Length; + UCHAR PortValue[0x30]; + ULONG AttribIndexDataState; + ULONG BasicSequencerOffset; + ULONG BasicCrtContOffset; + ULONG BasicGraphContOffset; + ULONG BasicAttribContOffset; + ULONG BasicDacOffset; + ULONG BasicLatchesOffset; + ULONG ExtendedSequencerOffset; + ULONG ExtendedCrtContOffset; + ULONG ExtendedGraphContOffset; + ULONG ExtendedAttribContOffset; + ULONG ExtendedDacOffset; + ULONG ExtendedValidatorStateOffset; + ULONG ExtendedMiscDataOffset; + ULONG PlaneLength; + ULONG Plane1Offset; + ULONG Plane2Offset; + ULONG Plane3Offset; + ULONG Plane4Offset; + ULONG VGAStateFlags; + ULONG DIBOffset; + ULONG DIBBitsPerPixel; + ULONG DIBXResolution; + ULONG DIBYResolution; + ULONG DIBXlatOffset; + ULONG DIBXlatLength; + ULONG VesaInfoOffset; + PVOID FrameBufferData; +} VIDEO_HARDWARE_STATE_HEADER, *PVIDEO_HARDWARE_STATE_HEADER; + +typedef struct _VIDEO_CLUTDATA { + UCHAR Red; + UCHAR Green; + UCHAR Blue; + UCHAR Unused; +} VIDEO_CLUTDATA, *PVIDEO_CLUTDATA; + +typedef struct { + USHORT NumEntries; + USHORT FirstEntry; + union { + VIDEO_CLUTDATA RgbArray; + ULONG RgbLong; + } LookupTable[1]; +} VIDEO_CLUT, *PVIDEO_CLUT; + +typedef struct _VIDEO_PALETTE_DATA { + USHORT NumEntries; + USHORT FirstEntry; + USHORT Colors[1]; +} VIDEO_PALETTE_DATA, *PVIDEO_PALETTE_DATA; + +typedef struct _VIDEO_HARDWARE_STATE { + PVIDEO_HARDWARE_STATE_HEADER StateHeader; + ULONG StateLength; +} VIDEO_HARDWARE_STATE, *PVIDEO_HARDWARE_STATE; + +#define VIDEO_CHILD_ACTIVE 0x00000001 +#define VIDEO_CHILD_DETACHED 0x00000002 +#define VIDEO_CHILD_NOPRUNE_FREQ 0x80000000 +#define VIDEO_CHILD_NOPRUNE_RESOLUTION 0x40000000 + +#define VIDEO_DUALVIEW_REMOVABLE 0x00000001 +#define VIDEO_DUALVIEW_PRIMARY 0x80000000 +#define VIDEO_DUALVIEW_SECONDARY 0x40000000 + +#ifdef __cplusplus +} +#endif + +#endif /* __NTDDVDEO_H */ diff --git a/reactos/include/ddk/ntddvol.h b/reactos/include/ddk/ntddvol.h new file mode 100644 index 00000000000..5472723c043 --- /dev/null +++ b/reactos/include/ddk/ntddvol.h @@ -0,0 +1,139 @@ +/* + * ntddvol.h + * + * Volume IOCTL interface. + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __NTDDVOL_H +#define __NTDDVOL_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define IOCTL_VOLUME_BASE ((ULONG) 'V') + +#define IOCTL_VOLUME_LOGICAL_TO_PHYSICAL \ + CTL_CODE(IOCTL_VOLUME_BASE, 8, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VOLUME_PHYSICAL_TO_LOGICAL \ + CTL_CODE(IOCTL_VOLUME_BASE, 9, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VOLUME_READ_PLEX \ + CTL_CODE(IOCTL_VOLUME_BASE, 11, METHOD_OUT_DIRECT, FILE_READ_ACCESS) + +#define IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS \ + CTL_CODE(IOCTL_VOLUME_BASE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VOLUME_IS_CLUSTERED \ + CTL_CODE(IOCTL_VOLUME_BASE, 12, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VOLUME_QUERY_VOLUME_NUMBER \ + CTL_CODE(IOCTL_VOLUME_BASE, 7, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VOLUME_IS_PARTITION \ + CTL_CODE(IOCTL_VOLUME_BASE, 10, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VOLUME_SET_GPT_ATTRIBUTES \ + CTL_CODE(IOCTL_VOLUME_BASE, 13, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VOLUME_GET_GPT_ATTRIBUTES \ + CTL_CODE(IOCTL_VOLUME_BASE, 14, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VOLUME_SUPPORTS_ONLINE_OFFLINE \ + CTL_CODE(IOCTL_VOLUME_BASE, 1, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VOLUME_ONLINE \ + CTL_CODE(IOCTL_VOLUME_BASE, 2, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_VOLUME_OFFLINE \ + CTL_CODE(IOCTL_VOLUME_BASE, 3, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +#define IOCTL_VOLUME_IS_OFFLINE \ + CTL_CODE(IOCTL_VOLUME_BASE, 4, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VOLUME_IS_IO_CAPABLE \ + CTL_CODE(IOCTL_VOLUME_BASE, 5, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_VOLUME_QUERY_FAILOVER_SET \ + CTL_CODE(IOCTL_VOLUME_BASE, 6, METHOD_BUFFERED, FILE_ANY_ACCESS) + + +typedef struct _VOLUME_LOGICAL_OFFSET { + LONGLONG LogicalOffset; +} VOLUME_LOGICAL_OFFSET, *PVOLUME_LOGICAL_OFFSET; + +typedef struct _VOLUME_PHYSICAL_OFFSET { + ULONG DiskNumber; + LONGLONG Offset; +} VOLUME_PHYSICAL_OFFSET, *PVOLUME_PHYSICAL_OFFSET; + +typedef struct _VOLUME_PHYSICAL_OFFSETS { + ULONG NumberOfPhysicalOffsets; + VOLUME_PHYSICAL_OFFSET PhysicalOffset[1]; +} VOLUME_PHYSICAL_OFFSETS, *PVOLUME_PHYSICAL_OFFSETS; + +typedef struct _VOLUME_READ_PLEX_INPUT { + LARGE_INTEGER ByteOffset; + ULONG Length; + ULONG PlexNumber; +} VOLUME_READ_PLEX_INPUT, *PVOLUME_READ_PLEX_INPUT; + +typedef struct _VOLUME_GET_GPT_ATTRIBUTES_INFORMATION { + ULONGLONG GptAttributes; +} VOLUME_GET_GPT_ATTRIBUTES_INFORMATION, *PVOLUME_GET_GPT_ATTRIBUTES_INFORMATION; + +typedef struct _VOLUME_SET_GPT_ATTRIBUTES_INFORMATION { + ULONGLONG GptAttributes; + BOOLEAN RevertOnClose; + BOOLEAN ApplyToAllConnectedVolumes; + USHORT Reserved1; + ULONG Reserved2; +} VOLUME_SET_GPT_ATTRIBUTES_INFORMATION, *PVOLUME_SET_GPT_ATTRIBUTES_INFORMATION; + +typedef struct _DISK_EXTENT { + ULONG DiskNumber; + LARGE_INTEGER StartingOffset; + LARGE_INTEGER ExtentLength; +} DISK_EXTENT, *PDISK_EXTENT; + +typedef struct _VOLUME_DISK_EXTENTS { + ULONG NumberOfDiskExtents; + DISK_EXTENT Extents[1]; +} VOLUME_DISK_EXTENTS, *PVOLUME_DISK_EXTENTS; + +typedef struct _VOLUME_NUMBER { + ULONG VolumeNumber; + WCHAR VolumeManagerName[8]; +} VOLUME_NUMBER, *PVOLUME_NUMBER; + +typedef struct _VOLUME_FAILOVER_SET { + ULONG NumberOfDisks; + ULONG DiskNumbers[1]; +} VOLUME_FAILOVER_SET, *PVOLUME_FAILOVER_SET; + +#ifdef __cplusplus +} +#endif + +#endif /* __NTDDVOL_H */ diff --git a/reactos/include/ddk/ntifs.h b/reactos/include/ddk/ntifs.h new file mode 100644 index 00000000000..c685c3317dc --- /dev/null +++ b/reactos/include/ddk/ntifs.h @@ -0,0 +1,4989 @@ +/* + * ntifs.h + * + * Windows NT Filesystem Driver Developer Kit + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Bo Brantén + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef _NTIFS_ +#define _NTIFS_ +#define _GNU_NTIFS_ + +#if __GNUC__ >= 3 +#pragma GCC system_header +#endif + +#include "ntddk.h" +#include "csq.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#pragma pack(push,4) + +#define VER_PRODUCTBUILD 10000 + +#ifndef NTSYSAPI +#define NTSYSAPI +#endif + +#ifndef NTKERNELAPI +#define NTKERNELAPI DECLSPEC_IMPORT +#endif + +typedef struct _SE_EXPORTS *PSE_EXPORTS; + +#ifdef _NTOSKRNL_ +extern PUCHAR FsRtlLegalAnsiCharacterArray; +#else +extern DECLSPEC_IMPORT PUCHAR FsRtlLegalAnsiCharacterArray; +#endif +extern PSE_EXPORTS SeExports; +extern PACL SePublicDefaultDacl; +extern PACL SeSystemDefaultDacl; + +extern KSPIN_LOCK IoStatisticsLock; +extern ULONG IoReadOperationCount; +extern ULONG IoWriteOperationCount; +extern ULONG IoOtherOperationCount; +extern LARGE_INTEGER IoReadTransferCount; +extern LARGE_INTEGER IoWriteTransferCount; +extern LARGE_INTEGER IoOtherTransferCount; + +#define ANSI_DOS_STAR ('<') +#define ANSI_DOS_QM ('>') +#define ANSI_DOS_DOT ('"') + +#define DOS_STAR (L'<') +#define DOS_QM (L'>') +#define DOS_DOT (L'"') + +/* also in winnt.h */ +#define ACCESS_MIN_MS_ACE_TYPE (0x0) +#define ACCESS_ALLOWED_ACE_TYPE (0x0) +#define ACCESS_DENIED_ACE_TYPE (0x1) +#define SYSTEM_AUDIT_ACE_TYPE (0x2) +#define SYSTEM_ALARM_ACE_TYPE (0x3) +#define ACCESS_MAX_MS_V2_ACE_TYPE (0x3) +#define ACCESS_ALLOWED_COMPOUND_ACE_TYPE (0x4) +#define ACCESS_MAX_MS_V3_ACE_TYPE (0x4) +#define ACCESS_MIN_MS_OBJECT_ACE_TYPE (0x5) +#define ACCESS_ALLOWED_OBJECT_ACE_TYPE (0x5) +#define ACCESS_DENIED_OBJECT_ACE_TYPE (0x6) +#define SYSTEM_AUDIT_OBJECT_ACE_TYPE (0x7) +#define SYSTEM_ALARM_OBJECT_ACE_TYPE (0x8) +#define ACCESS_MAX_MS_OBJECT_ACE_TYPE (0x8) +#define ACCESS_MAX_MS_V4_ACE_TYPE (0x8) +#define ACCESS_MAX_MS_ACE_TYPE (0x8) +#define ACCESS_ALLOWED_CALLBACK_ACE_TYPE (0x9) +#define ACCESS_DENIED_CALLBACK_ACE_TYPE (0xA) +#define ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE (0xB) +#define ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE (0xC) +#define SYSTEM_AUDIT_CALLBACK_ACE_TYPE (0xD) +#define SYSTEM_ALARM_CALLBACK_ACE_TYPE (0xE) +#define SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE (0xF) +#define SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE (0x10) +#define ACCESS_MAX_MS_V5_ACE_TYPE (0x10) + +#define COMPRESSION_FORMAT_NONE (0x0000) +#define COMPRESSION_FORMAT_DEFAULT (0x0001) +#define COMPRESSION_FORMAT_LZNT1 (0x0002) +#define COMPRESSION_ENGINE_STANDARD (0x0000) +#define COMPRESSION_ENGINE_MAXIMUM (0x0100) +#define COMPRESSION_ENGINE_HIBER (0x0200) + +#define FILE_ACTION_ADDED 0x00000001 +#define FILE_ACTION_REMOVED 0x00000002 +#define FILE_ACTION_MODIFIED 0x00000003 +#define FILE_ACTION_RENAMED_OLD_NAME 0x00000004 +#define FILE_ACTION_RENAMED_NEW_NAME 0x00000005 +#define FILE_ACTION_ADDED_STREAM 0x00000006 +#define FILE_ACTION_REMOVED_STREAM 0x00000007 +#define FILE_ACTION_MODIFIED_STREAM 0x00000008 +#define FILE_ACTION_REMOVED_BY_DELETE 0x00000009 +#define FILE_ACTION_ID_NOT_TUNNELLED 0x0000000A +#define FILE_ACTION_TUNNELLED_ID_COLLISION 0x0000000B +/* end winnt.h */ + +#define FILE_EA_TYPE_BINARY 0xfffe +#define FILE_EA_TYPE_ASCII 0xfffd +#define FILE_EA_TYPE_BITMAP 0xfffb +#define FILE_EA_TYPE_METAFILE 0xfffa +#define FILE_EA_TYPE_ICON 0xfff9 +#define FILE_EA_TYPE_EA 0xffee +#define FILE_EA_TYPE_MVMT 0xffdf +#define FILE_EA_TYPE_MVST 0xffde +#define FILE_EA_TYPE_ASN1 0xffdd +#define FILE_EA_TYPE_FAMILY_IDS 0xff01 + +#define FILE_NEED_EA 0x00000080 + +/* also in winnt.h */ +#define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001 +#define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002 +#define FILE_NOTIFY_CHANGE_NAME 0x00000003 +#define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004 +#define FILE_NOTIFY_CHANGE_SIZE 0x00000008 +#define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010 +#define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020 +#define FILE_NOTIFY_CHANGE_CREATION 0x00000040 +#define FILE_NOTIFY_CHANGE_EA 0x00000080 +#define FILE_NOTIFY_CHANGE_SECURITY 0x00000100 +#define FILE_NOTIFY_CHANGE_STREAM_NAME 0x00000200 +#define FILE_NOTIFY_CHANGE_STREAM_SIZE 0x00000400 +#define FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800 +#define FILE_NOTIFY_VALID_MASK 0x00000fff +/* end winnt.h */ + +#define FILE_OPLOCK_BROKEN_TO_LEVEL_2 0x00000007 +#define FILE_OPLOCK_BROKEN_TO_NONE 0x00000008 + +#define FILE_OPBATCH_BREAK_UNDERWAY 0x00000009 + +#define FILE_CASE_SENSITIVE_SEARCH 0x00000001 +#define FILE_CASE_PRESERVED_NAMES 0x00000002 +#define FILE_UNICODE_ON_DISK 0x00000004 +#define FILE_PERSISTENT_ACLS 0x00000008 +#define FILE_FILE_COMPRESSION 0x00000010 +#define FILE_VOLUME_QUOTAS 0x00000020 +#define FILE_SUPPORTS_SPARSE_FILES 0x00000040 +#define FILE_SUPPORTS_REPARSE_POINTS 0x00000080 +#define FILE_SUPPORTS_REMOTE_STORAGE 0x00000100 +#define FS_LFN_APIS 0x00004000 +#define FILE_VOLUME_IS_COMPRESSED 0x00008000 +#define FILE_SUPPORTS_OBJECT_IDS 0x00010000 +#define FILE_SUPPORTS_ENCRYPTION 0x00020000 +#define FILE_NAMED_STREAMS 0x00040000 + +#define FILE_PIPE_BYTE_STREAM_TYPE 0x00000000 +#define FILE_PIPE_MESSAGE_TYPE 0x00000001 + +#define FILE_PIPE_BYTE_STREAM_MODE 0x00000000 +#define FILE_PIPE_MESSAGE_MODE 0x00000001 + +#define FILE_PIPE_QUEUE_OPERATION 0x00000000 +#define FILE_PIPE_COMPLETE_OPERATION 0x00000001 + +#define FILE_PIPE_INBOUND 0x00000000 +#define FILE_PIPE_OUTBOUND 0x00000001 +#define FILE_PIPE_FULL_DUPLEX 0x00000002 + +#define FILE_PIPE_DISCONNECTED_STATE 0x00000001 +#define FILE_PIPE_LISTENING_STATE 0x00000002 +#define FILE_PIPE_CONNECTED_STATE 0x00000003 +#define FILE_PIPE_CLOSING_STATE 0x00000004 + +#define FILE_PIPE_CLIENT_END 0x00000000 +#define FILE_PIPE_SERVER_END 0x00000001 + +#define FILE_PIPE_READ_DATA 0x00000000 +#define FILE_PIPE_WRITE_SPACE 0x00000001 + +#define FILE_STORAGE_TYPE_SPECIFIED 0x00000041 /* FILE_DIRECTORY_FILE | FILE_NON_DIRECTORY_FILE */ +#define FILE_STORAGE_TYPE_DEFAULT (StorageTypeDefault << FILE_STORAGE_TYPE_SHIFT) +#define FILE_STORAGE_TYPE_DIRECTORY (StorageTypeDirectory << FILE_STORAGE_TYPE_SHIFT) +#define FILE_STORAGE_TYPE_FILE (StorageTypeFile << FILE_STORAGE_TYPE_SHIFT) +#define FILE_STORAGE_TYPE_DOCFILE (StorageTypeDocfile << FILE_STORAGE_TYPE_SHIFT) +#define FILE_STORAGE_TYPE_JUNCTION_POINT (StorageTypeJunctionPoint << FILE_STORAGE_TYPE_SHIFT) +#define FILE_STORAGE_TYPE_CATALOG (StorageTypeCatalog << FILE_STORAGE_TYPE_SHIFT) +#define FILE_STORAGE_TYPE_STRUCTURED_STORAGE (StorageTypeStructuredStorage << FILE_STORAGE_TYPE_SHIFT) +#define FILE_STORAGE_TYPE_EMBEDDING (StorageTypeEmbedding << FILE_STORAGE_TYPE_SHIFT) +#define FILE_STORAGE_TYPE_STREAM (StorageTypeStream << FILE_STORAGE_TYPE_SHIFT) +#define FILE_MINIMUM_STORAGE_TYPE FILE_STORAGE_TYPE_DEFAULT +#define FILE_MAXIMUM_STORAGE_TYPE FILE_STORAGE_TYPE_STREAM +#define FILE_STORAGE_TYPE_MASK 0x000f0000 +#define FILE_STORAGE_TYPE_SHIFT 16 + +#define FILE_VC_QUOTA_NONE 0x00000000 +#define FILE_VC_QUOTA_TRACK 0x00000001 +#define FILE_VC_QUOTA_ENFORCE 0x00000002 +#define FILE_VC_QUOTA_MASK 0x00000003 + +#define FILE_VC_QUOTAS_LOG_VIOLATIONS 0x00000004 +#define FILE_VC_CONTENT_INDEX_DISABLED 0x00000008 + +#define FILE_VC_LOG_QUOTA_THRESHOLD 0x00000010 +#define FILE_VC_LOG_QUOTA_LIMIT 0x00000020 +#define FILE_VC_LOG_VOLUME_THRESHOLD 0x00000040 +#define FILE_VC_LOG_VOLUME_LIMIT 0x00000080 + +#define FILE_VC_QUOTAS_INCOMPLETE 0x00000100 +#define FILE_VC_QUOTAS_REBUILDING 0x00000200 + +#define FILE_VC_VALID_MASK 0x000003ff + +#define FSRTL_FLAG_FILE_MODIFIED (0x01) +#define FSRTL_FLAG_FILE_LENGTH_CHANGED (0x02) +#define FSRTL_FLAG_LIMIT_MODIFIED_PAGES (0x04) +#define FSRTL_FLAG_ACQUIRE_MAIN_RSRC_EX (0x08) +#define FSRTL_FLAG_ACQUIRE_MAIN_RSRC_SH (0x10) +#define FSRTL_FLAG_USER_MAPPED_FILE (0x20) +#define FSRTL_FLAG_EOF_ADVANCE_ACTIVE (0x80) + +#define FSRTL_FLAG2_DO_MODIFIED_WRITE (0x01) + +#define FSRTL_FSP_TOP_LEVEL_IRP (0x01) +#define FSRTL_CACHE_TOP_LEVEL_IRP (0x02) +#define FSRTL_MOD_WRITE_TOP_LEVEL_IRP (0x03) +#define FSRTL_FAST_IO_TOP_LEVEL_IRP (0x04) +#define FSRTL_MAX_TOP_LEVEL_IRP_FLAG (0x04) + +#define FSRTL_VOLUME_DISMOUNT 1 +#define FSRTL_VOLUME_DISMOUNT_FAILED 2 +#define FSRTL_VOLUME_LOCK 3 +#define FSRTL_VOLUME_LOCK_FAILED 4 +#define FSRTL_VOLUME_UNLOCK 5 +#define FSRTL_VOLUME_MOUNT 6 + +#define FSRTL_WILD_CHARACTER 0x08 + +#define FSRTL_FAT_LEGAL 0x01 +#define FSRTL_HPFS_LEGAL 0x02 +#define FSRTL_NTFS_LEGAL 0x04 +#define FSRTL_WILD_CHARACTER 0x08 +#define FSRTL_OLE_LEGAL 0x10 +#define FSRTL_NTFS_STREAM_LEGAL 0x14 + +#ifdef _X86_ +#define HARDWARE_PTE HARDWARE_PTE_X86 +#define PHARDWARE_PTE PHARDWARE_PTE_X86 +#else +#define HARDWARE_PTE ULONG +#define PHARDWARE_PTE PULONG +#endif + +#define IO_CHECK_CREATE_PARAMETERS 0x0200 +#define IO_ATTACH_DEVICE 0x0400 + +#define IO_ATTACH_DEVICE_API 0x80000000 +/* also in winnt.h */ +#define IO_COMPLETION_QUERY_STATE 0x0001 +#define IO_COMPLETION_MODIFY_STATE 0x0002 +#define IO_COMPLETION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3) +/* end winnt.h */ +#define IO_FILE_OBJECT_NON_PAGED_POOL_CHARGE 64 +#define IO_FILE_OBJECT_PAGED_POOL_CHARGE 1024 + +#define IO_TYPE_APC 18 +#define IO_TYPE_DPC 19 +#define IO_TYPE_DEVICE_QUEUE 20 +#define IO_TYPE_EVENT_PAIR 21 +#define IO_TYPE_INTERRUPT 22 +#define IO_TYPE_PROFILE 23 + +#define IRP_BEING_VERIFIED 0x10 + +#define MAILSLOT_CLASS_FIRSTCLASS 1 +#define MAILSLOT_CLASS_SECONDCLASS 2 + +#define MAILSLOT_SIZE_AUTO 0 + +#define MAP_PROCESS 1L +#define MAP_SYSTEM 2L +#define MEM_DOS_LIM 0x40000000 +/* also in winnt.h */ +#define MEM_IMAGE SEC_IMAGE +/* end winnt.h */ +#define OB_TYPE_TYPE 1 +#define OB_TYPE_DIRECTORY 2 +#define OB_TYPE_SYMBOLIC_LINK 3 +#define OB_TYPE_TOKEN 4 +#define OB_TYPE_PROCESS 5 +#define OB_TYPE_THREAD 6 +#define OB_TYPE_EVENT 7 +#define OB_TYPE_EVENT_PAIR 8 +#define OB_TYPE_MUTANT 9 +#define OB_TYPE_SEMAPHORE 10 +#define OB_TYPE_TIMER 11 +#define OB_TYPE_PROFILE 12 +#define OB_TYPE_WINDOW_STATION 13 +#define OB_TYPE_DESKTOP 14 +#define OB_TYPE_SECTION 15 +#define OB_TYPE_KEY 16 +#define OB_TYPE_PORT 17 +#define OB_TYPE_ADAPTER 18 +#define OB_TYPE_CONTROLLER 19 +#define OB_TYPE_DEVICE 20 +#define OB_TYPE_DRIVER 21 +#define OB_TYPE_IO_COMPLETION 22 +#define OB_TYPE_FILE 23 + +#define PIN_WAIT (1) +#define PIN_EXCLUSIVE (2) +#define PIN_NO_READ (4) +#define PIN_IF_BCB (8) + +#define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE 1 +#define RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING 2 + +/* also in winnt.h */ +#define SEC_BASED 0x00200000 +#define SEC_NO_CHANGE 0x00400000 +#define SEC_FILE 0x00800000 +#define SEC_IMAGE 0x01000000 +#define SEC_VLM 0x02000000 +#define SEC_RESERVE 0x04000000 +#define SEC_COMMIT 0x08000000 +#define SEC_NOCACHE 0x10000000 + +#define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1} +#define SECURITY_WORLD_RID (0x00000000L) + +#define SID_REVISION 1 +#define SID_MAX_SUB_AUTHORITIES 15 +#define SID_RECOMMENDED_SUB_AUTHORITIES 1 + +#define TOKEN_ASSIGN_PRIMARY (0x0001) +#define TOKEN_DUPLICATE (0x0002) +#define TOKEN_IMPERSONATE (0x0004) +#define TOKEN_QUERY (0x0008) +#define TOKEN_QUERY_SOURCE (0x0010) +#define TOKEN_ADJUST_PRIVILEGES (0x0020) +#define TOKEN_ADJUST_GROUPS (0x0040) +#define TOKEN_ADJUST_DEFAULT (0x0080) +#define TOKEN_ADJUST_SESSIONID (0x0100) + +#define TOKEN_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED |\ + TOKEN_ASSIGN_PRIMARY |\ + TOKEN_DUPLICATE |\ + TOKEN_IMPERSONATE |\ + TOKEN_QUERY |\ + TOKEN_QUERY_SOURCE |\ + TOKEN_ADJUST_PRIVILEGES |\ + TOKEN_ADJUST_GROUPS |\ + TOKEN_ADJUST_DEFAULT |\ + TOKEN_ADJUST_SESSIONID) + +#define TOKEN_READ (STANDARD_RIGHTS_READ |\ + TOKEN_QUERY) + +#define TOKEN_WRITE (STANDARD_RIGHTS_WRITE |\ + TOKEN_ADJUST_PRIVILEGES |\ + TOKEN_ADJUST_GROUPS |\ + TOKEN_ADJUST_DEFAULT) + +#define TOKEN_EXECUTE (STANDARD_RIGHTS_EXECUTE) + +#define TOKEN_SOURCE_LENGTH 8 +/* end winnt.h */ + +#define TOKEN_HAS_TRAVERSE_PRIVILEGE 0x01 +#define TOKEN_HAS_BACKUP_PRIVILEGE 0x02 +#define TOKEN_HAS_RESTORE_PRIVILEGE 0x04 +#define TOKEN_HAS_ADMIN_GROUP 0x08 +#define TOKEN_IS_RESTRICTED 0x10 + +#define VACB_MAPPING_GRANULARITY (0x40000) +#define VACB_OFFSET_SHIFT (18) + +#define SE_OWNER_DEFAULTED 0x0001 +#define SE_GROUP_DEFAULTED 0x0002 +#define SE_DACL_PRESENT 0x0004 +#define SE_DACL_DEFAULTED 0x0008 +#define SE_SACL_PRESENT 0x0010 +#define SE_SACL_DEFAULTED 0x0020 +#define SE_DACL_UNTRUSTED 0x0040 +#define SE_SERVER_SECURITY 0x0080 +#define SE_DACL_AUTO_INHERIT_REQ 0x0100 +#define SE_SACL_AUTO_INHERIT_REQ 0x0200 +#define SE_DACL_AUTO_INHERITED 0x0400 +#define SE_SACL_AUTO_INHERITED 0x0800 +#define SE_DACL_PROTECTED 0x1000 +#define SE_SACL_PROTECTED 0x2000 +#define SE_RM_CONTROL_VALID 0x4000 +#define SE_SELF_RELATIVE 0x8000 + +#define FSCTL_REQUEST_OPLOCK_LEVEL_1 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 0, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_REQUEST_OPLOCK_LEVEL_2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 1, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_REQUEST_BATCH_OPLOCK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 2, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_OPLOCK_BREAK_ACKNOWLEDGE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 3, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_OPBATCH_ACK_CLOSE_PENDING CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 4, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_OPLOCK_BREAK_NOTIFY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 5, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_LOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 6, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_UNLOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 7, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_DISMOUNT_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 8, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define FSCTL_IS_VOLUME_MOUNTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 10, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_IS_PATHNAME_VALID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 11, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_MARK_VOLUME_DIRTY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 12, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define FSCTL_QUERY_RETRIEVAL_POINTERS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 14, METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSCTL_GET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 15, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_SET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 16, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA) + + +#define FSCTL_MARK_AS_SYSTEM_HIVE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 19, METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSCTL_OPLOCK_BREAK_ACK_NO_2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 20, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_INVALIDATE_VOLUMES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 21, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_QUERY_FAT_BPB CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 22, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_REQUEST_FILTER_OPLOCK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 23, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_FILESYSTEM_GET_STATISTICS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 24, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#if (VER_PRODUCTBUILD >= 1381) + +#define FSCTL_GET_NTFS_VOLUME_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 25, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_GET_NTFS_FILE_RECORD CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 26, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_GET_VOLUME_BITMAP CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 27, METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSCTL_GET_RETRIEVAL_POINTERS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 28, METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSCTL_MOVE_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 29, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_IS_VOLUME_DIRTY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 30, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_GET_HFS_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 31, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_ALLOW_EXTENDED_DASD_IO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 32, METHOD_NEITHER, FILE_ANY_ACCESS) + +#endif /* (VER_PRODUCTBUILD >= 1381) */ + +#if (VER_PRODUCTBUILD >= 2195) + +#define FSCTL_READ_PROPERTY_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 33, METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSCTL_WRITE_PROPERTY_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 34, METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSCTL_FIND_FILES_BY_SID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 35, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define FSCTL_DUMP_PROPERTY_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 37, METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSCTL_SET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 38, METHOD_BUFFERED, FILE_WRITE_DATA) +#define FSCTL_GET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 39, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_DELETE_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 40, METHOD_BUFFERED, FILE_WRITE_DATA) +#define FSCTL_SET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 41, METHOD_BUFFERED, FILE_WRITE_DATA) +#define FSCTL_GET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_DELETE_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 43, METHOD_BUFFERED, FILE_WRITE_DATA) +#define FSCTL_ENUM_USN_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 44, METHOD_NEITHER, FILE_READ_DATA) +#define FSCTL_SECURITY_ID_CHECK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 45, METHOD_NEITHER, FILE_READ_DATA) +#define FSCTL_READ_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 46, METHOD_NEITHER, FILE_READ_DATA) +#define FSCTL_SET_OBJECT_ID_EXTENDED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 47, METHOD_BUFFERED, FILE_WRITE_DATA) +#define FSCTL_CREATE_OR_GET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 48, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_SET_SPARSE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 49, METHOD_BUFFERED, FILE_WRITE_DATA) +#define FSCTL_SET_ZERO_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 50, METHOD_BUFFERED, FILE_WRITE_DATA) +#define FSCTL_QUERY_ALLOCATED_RANGES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 51, METHOD_NEITHER, FILE_READ_DATA) +#define FSCTL_ENABLE_UPGRADE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 52, METHOD_BUFFERED, FILE_WRITE_DATA) +#define FSCTL_SET_ENCRYPTION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 53, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_ENCRYPTION_FSCTL_IO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 54, METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSCTL_WRITE_RAW_ENCRYPTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 55, METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSCTL_READ_RAW_ENCRYPTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 56, METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSCTL_CREATE_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 57, METHOD_NEITHER, FILE_READ_DATA) +#define FSCTL_READ_FILE_USN_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 58, METHOD_NEITHER, FILE_READ_DATA) +#define FSCTL_WRITE_USN_CLOSE_RECORD CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 59, METHOD_NEITHER, FILE_READ_DATA) +#define FSCTL_EXTEND_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 60, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_QUERY_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 61, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_DELETE_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 62, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_MARK_HANDLE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 63, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_SIS_COPYFILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 64, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_SIS_LINK_FILES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 65, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA) +#define FSCTL_HSM_MSG CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 66, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA) +#define FSCTL_NSS_CONTROL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 67, METHOD_BUFFERED, FILE_WRITE_DATA) +#define FSCTL_HSM_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 68, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA) +#define FSCTL_RECALL_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 69, METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSCTL_NSS_RCONTROL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 70, METHOD_BUFFERED, FILE_READ_DATA) +#define FSCTL_READ_FROM_PLEX CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 71, METHOD_OUT_DIRECT, FILE_READ_DATA) +#define FSCTL_FILE_PREFETCH CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 72, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +#define FSCTL_MAILSLOT_PEEK CTL_CODE(FILE_DEVICE_MAILSLOT, 0, METHOD_NEITHER, FILE_READ_DATA) + +#define FSCTL_NETWORK_SET_CONFIGURATION_INFO CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 102, METHOD_IN_DIRECT, FILE_ANY_ACCESS) +#define FSCTL_NETWORK_GET_CONFIGURATION_INFO CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 103, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) +#define FSCTL_NETWORK_GET_CONNECTION_INFO CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 104, METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSCTL_NETWORK_ENUMERATE_CONNECTIONS CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 105, METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSCTL_NETWORK_DELETE_CONNECTION CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 107, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_NETWORK_GET_STATISTICS CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 116, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_NETWORK_SET_DOMAIN_NAME CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 120, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_NETWORK_REMOTE_BOOT_INIT_SCRT CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 250, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define FSCTL_PIPE_ASSIGN_EVENT CTL_CODE(FILE_DEVICE_NAMED_PIPE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_PIPE_DISCONNECT CTL_CODE(FILE_DEVICE_NAMED_PIPE, 1, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_PIPE_LISTEN CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_PIPE_PEEK CTL_CODE(FILE_DEVICE_NAMED_PIPE, 3, METHOD_BUFFERED, FILE_READ_DATA) +#define FSCTL_PIPE_QUERY_EVENT CTL_CODE(FILE_DEVICE_NAMED_PIPE, 4, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_PIPE_TRANSCEIVE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 5, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA) +#define FSCTL_PIPE_WAIT CTL_CODE(FILE_DEVICE_NAMED_PIPE, 6, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_PIPE_IMPERSONATE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 7, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_PIPE_SET_CLIENT_PROCESS CTL_CODE(FILE_DEVICE_NAMED_PIPE, 8, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_PIPE_QUERY_CLIENT_PROCESS CTL_CODE(FILE_DEVICE_NAMED_PIPE, 9, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_PIPE_INTERNAL_READ CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2045, METHOD_BUFFERED, FILE_READ_DATA) +#define FSCTL_PIPE_INTERNAL_WRITE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2046, METHOD_BUFFERED, FILE_WRITE_DATA) +#define FSCTL_PIPE_INTERNAL_TRANSCEIVE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2047, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA) +#define FSCTL_PIPE_INTERNAL_READ_OVFLOW CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2048, METHOD_BUFFERED, FILE_READ_DATA) + +#define IOCTL_REDIR_QUERY_PATH CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 99, METHOD_NEITHER, FILE_ANY_ACCESS) + +typedef PVOID OPLOCK, *POPLOCK; + +typedef struct _CACHE_MANAGER_CALLBACKS *PCACHE_MANAGER_CALLBACKS; +typedef struct _FILE_GET_QUOTA_INFORMATION *PFILE_GET_QUOTA_INFORMATION; +typedef struct _HANDLE_TABLE *PHANDLE_TABLE; +typedef struct _KPROCESS *PKPROCESS; +typedef struct _KQUEUE *PKQUEUE; +typedef struct _KTRAP_FRAME *PKTRAP_FRAME; +typedef struct _OBJECT_DIRECTORY *POBJECT_DIRECTORY; +typedef struct _SHARED_CACHE_MAP *PSHARED_CACHE_MAP; +typedef struct _VACB *PVACB; +typedef struct _VAD_HEADER *PVAD_HEADER; + +typedef ULONG LBN; +typedef LBN *PLBN; + +typedef ULONG VBN; +typedef VBN *PVBN; + +typedef struct _NOTIFY_SYNC +{ + ULONG Unknown0; + ULONG Unknown1; + ULONG Unknown2; + USHORT Unknown3; + USHORT Unknown4; + ULONG Unknown5; + ULONG Unknown6; + ULONG Unknown7; + ULONG Unknown8; + ULONG Unknown9; + ULONG Unknown10; +} NOTIFY_SYNC, * PNOTIFY_SYNC; + +typedef enum _FAST_IO_POSSIBLE { + FastIoIsNotPossible, + FastIoIsPossible, + FastIoIsQuestionable +} FAST_IO_POSSIBLE; + +typedef enum _FILE_STORAGE_TYPE { + StorageTypeDefault = 1, + StorageTypeDirectory, + StorageTypeFile, + StorageTypeJunctionPoint, + StorageTypeCatalog, + StorageTypeStructuredStorage, + StorageTypeEmbedding, + StorageTypeStream +} FILE_STORAGE_TYPE; + +typedef enum _OBJECT_INFO_CLASS { + ObjectBasicInfo, + ObjectNameInfo, + ObjectTypeInfo, + ObjectAllTypesInfo, + ObjectProtectionInfo +} OBJECT_INFO_CLASS; + +typedef struct _KAPC_STATE { + LIST_ENTRY ApcListHead[2]; + PKPROCESS Process; + BOOLEAN KernelApcInProgress; + BOOLEAN KernelApcPending; + BOOLEAN UserApcPending; +} KAPC_STATE, *PKAPC_STATE, *RESTRICTED_POINTER PRKAPC_STATE; + +typedef struct _BITMAP_RANGE { + LIST_ENTRY Links; + LARGE_INTEGER BasePage; + ULONG FirstDirtyPage; + ULONG LastDirtyPage; + ULONG DirtyPages; + PULONG Bitmap; +} BITMAP_RANGE, *PBITMAP_RANGE; + +typedef struct _CACHE_UNINITIALIZE_EVENT { + struct _CACHE_UNINITIALIZE_EVENT *Next; + KEVENT Event; +} CACHE_UNINITIALIZE_EVENT, *PCACHE_UNINITIALIZE_EVENT; + +typedef struct _CC_FILE_SIZES { + LARGE_INTEGER AllocationSize; + LARGE_INTEGER FileSize; + LARGE_INTEGER ValidDataLength; +} CC_FILE_SIZES, *PCC_FILE_SIZES; + +typedef struct _COMPRESSED_DATA_INFO { + USHORT CompressionFormatAndEngine; + UCHAR CompressionUnitShift; + UCHAR ChunkShift; + UCHAR ClusterShift; + UCHAR Reserved; + USHORT NumberOfChunks; + ULONG CompressedChunkSizes[ANYSIZE_ARRAY]; +} COMPRESSED_DATA_INFO, *PCOMPRESSED_DATA_INFO; + +typedef struct _SID_IDENTIFIER_AUTHORITY { + BYTE Value[6]; +} SID_IDENTIFIER_AUTHORITY,*PSID_IDENTIFIER_AUTHORITY,*LPSID_IDENTIFIER_AUTHORITY; +typedef PVOID PSID; +typedef struct _SID { + BYTE Revision; + BYTE SubAuthorityCount; + SID_IDENTIFIER_AUTHORITY IdentifierAuthority; + DWORD SubAuthority[ANYSIZE_ARRAY]; +} SID, *PISID; +typedef struct _SID_AND_ATTRIBUTES { + PSID Sid; + DWORD Attributes; +} SID_AND_ATTRIBUTES, *PSID_AND_ATTRIBUTES; +typedef SID_AND_ATTRIBUTES SID_AND_ATTRIBUTES_ARRAY[ANYSIZE_ARRAY]; +typedef SID_AND_ATTRIBUTES_ARRAY *PSID_AND_ATTRIBUTES_ARRAY; +typedef struct _TOKEN_SOURCE { + CHAR SourceName[TOKEN_SOURCE_LENGTH]; + LUID SourceIdentifier; +} TOKEN_SOURCE,*PTOKEN_SOURCE; +typedef struct _TOKEN_CONTROL { + LUID TokenId; + LUID AuthenticationId; + LUID ModifiedId; + TOKEN_SOURCE TokenSource; +} TOKEN_CONTROL,*PTOKEN_CONTROL; +typedef struct _TOKEN_DEFAULT_DACL { + PACL DefaultDacl; +} TOKEN_DEFAULT_DACL,*PTOKEN_DEFAULT_DACL; +typedef struct _TOKEN_GROUPS { + DWORD GroupCount; + SID_AND_ATTRIBUTES Groups[ANYSIZE_ARRAY]; +} TOKEN_GROUPS,*PTOKEN_GROUPS,*LPTOKEN_GROUPS; +typedef struct _TOKEN_GROUPS_AND_PRIVILEGES { + ULONG SidCount; + ULONG SidLength; + PSID_AND_ATTRIBUTES Sids; + ULONG RestrictedSidCount; + ULONG RestrictedSidLength; + PSID_AND_ATTRIBUTES RestrictedSids; + ULONG PrivilegeCount; + ULONG PrivilegeLength; + PLUID_AND_ATTRIBUTES Privileges; + LUID AuthenticationId; +} TOKEN_GROUPS_AND_PRIVILEGES, *PTOKEN_GROUPS_AND_PRIVILEGES; +typedef struct _TOKEN_ORIGIN { + LUID OriginatingLogonSession; +} TOKEN_ORIGIN, *PTOKEN_ORIGIN; +typedef struct _TOKEN_OWNER { + PSID Owner; +} TOKEN_OWNER,*PTOKEN_OWNER; +typedef struct _TOKEN_PRIMARY_GROUP { + PSID PrimaryGroup; +} TOKEN_PRIMARY_GROUP,*PTOKEN_PRIMARY_GROUP; +typedef struct _TOKEN_PRIVILEGES { + DWORD PrivilegeCount; + LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]; +} TOKEN_PRIVILEGES,*PTOKEN_PRIVILEGES,*LPTOKEN_PRIVILEGES; +typedef enum tagTOKEN_TYPE { + TokenPrimary = 1, + TokenImpersonation +} TOKEN_TYPE,*PTOKEN_TYPE; +typedef struct _TOKEN_STATISTICS { + LUID TokenId; + LUID AuthenticationId; + LARGE_INTEGER ExpirationTime; + TOKEN_TYPE TokenType; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; + DWORD DynamicCharged; + DWORD DynamicAvailable; + DWORD GroupCount; + DWORD PrivilegeCount; + LUID ModifiedId; +} TOKEN_STATISTICS, *PTOKEN_STATISTICS; +typedef struct _TOKEN_USER { + SID_AND_ATTRIBUTES User; +} TOKEN_USER, *PTOKEN_USER; +typedef DWORD SECURITY_INFORMATION,*PSECURITY_INFORMATION; +typedef WORD SECURITY_DESCRIPTOR_CONTROL,*PSECURITY_DESCRIPTOR_CONTROL; +typedef struct _SECURITY_DESCRIPTOR { + BYTE Revision; + BYTE Sbz1; + SECURITY_DESCRIPTOR_CONTROL Control; + PSID Owner; + PSID Group; + PACL Sacl; + PACL Dacl; +} SECURITY_DESCRIPTOR, *PISECURITY_DESCRIPTOR; +typedef struct _SECURITY_DESCRIPTOR_RELATIVE { + BYTE Revision; + BYTE Sbz1; + SECURITY_DESCRIPTOR_CONTROL Control; + DWORD Owner; + DWORD Group; + DWORD Sacl; + DWORD Dacl; +} SECURITY_DESCRIPTOR_RELATIVE, *PISECURITY_DESCRIPTOR_RELATIVE; +typedef enum _TOKEN_INFORMATION_CLASS { + TokenUser=1,TokenGroups,TokenPrivileges,TokenOwner, + TokenPrimaryGroup,TokenDefaultDacl,TokenSource,TokenType, + TokenImpersonationLevel,TokenStatistics,TokenRestrictedSids, + TokenSessionId,TokenGroupsAndPrivileges,TokenSessionReference, + TokenSandBoxInert,TokenAuditPolicy,TokenOrigin, +} TOKEN_INFORMATION_CLASS; + +typedef struct _FILE_ACCESS_INFORMATION { + ACCESS_MASK AccessFlags; +} FILE_ACCESS_INFORMATION, *PFILE_ACCESS_INFORMATION; + +typedef struct _FILE_ALLOCATION_INFORMATION { + LARGE_INTEGER AllocationSize; +} FILE_ALLOCATION_INFORMATION, *PFILE_ALLOCATION_INFORMATION; + +typedef struct _FILE_BOTH_DIR_INFORMATION { + ULONG NextEntryOffset; + ULONG FileIndex; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + LARGE_INTEGER EndOfFile; + LARGE_INTEGER AllocationSize; + ULONG FileAttributes; + ULONG FileNameLength; + ULONG EaSize; + CCHAR ShortNameLength; + WCHAR ShortName[12]; + WCHAR FileName[1]; +} FILE_BOTH_DIR_INFORMATION, *PFILE_BOTH_DIR_INFORMATION; + +typedef struct _FILE_COMPLETION_INFORMATION { + HANDLE Port; + PVOID Key; +} FILE_COMPLETION_INFORMATION, *PFILE_COMPLETION_INFORMATION; + +typedef struct _FILE_COMPRESSION_INFORMATION { + LARGE_INTEGER CompressedFileSize; + USHORT CompressionFormat; + UCHAR CompressionUnitShift; + UCHAR ChunkShift; + UCHAR ClusterShift; + UCHAR Reserved[3]; +} FILE_COMPRESSION_INFORMATION, *PFILE_COMPRESSION_INFORMATION; + +typedef struct _FILE_COPY_ON_WRITE_INFORMATION { + BOOLEAN ReplaceIfExists; + HANDLE RootDirectory; + ULONG FileNameLength; + WCHAR FileName[1]; +} FILE_COPY_ON_WRITE_INFORMATION, *PFILE_COPY_ON_WRITE_INFORMATION; + +typedef struct _FILE_DIRECTORY_INFORMATION { + ULONG NextEntryOffset; + ULONG FileIndex; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + LARGE_INTEGER EndOfFile; + LARGE_INTEGER AllocationSize; + ULONG FileAttributes; + ULONG FileNameLength; + WCHAR FileName[1]; +} FILE_DIRECTORY_INFORMATION, *PFILE_DIRECTORY_INFORMATION; + +typedef struct _FILE_FULL_DIRECTORY_INFORMATION { + ULONG NextEntryOffset; + ULONG FileIndex; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + LARGE_INTEGER EndOfFile; + LARGE_INTEGER AllocationSize; + ULONG FileAttributes; + ULONG FileNameLength; + ULONG EaSize; + WCHAR FileName[0]; +} FILE_FULL_DIRECTORY_INFORMATION, *PFILE_FULL_DIRECTORY_INFORMATION; + +typedef struct _FILE_BOTH_DIRECTORY_INFORMATION { + ULONG NextEntryOffset; + ULONG FileIndex; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + LARGE_INTEGER EndOfFile; + LARGE_INTEGER AllocationSize; + ULONG FileAttributes; + ULONG FileNameLength; + ULONG EaSize; + CHAR ShortNameLength; + WCHAR ShortName[12]; + WCHAR FileName[0]; +} FILE_BOTH_DIRECTORY_INFORMATION, *PFILE_BOTH_DIRECTORY_INFORMATION; + +typedef struct _FILE_EA_INFORMATION { + ULONG EaSize; +} FILE_EA_INFORMATION, *PFILE_EA_INFORMATION; + +typedef struct _FILE_FS_ATTRIBUTE_INFORMATION { + ULONG FileSystemAttributes; + ULONG MaximumComponentNameLength; + ULONG FileSystemNameLength; + WCHAR FileSystemName[1]; +} FILE_FS_ATTRIBUTE_INFORMATION, *PFILE_FS_ATTRIBUTE_INFORMATION; + +typedef struct _FILE_FS_CONTROL_INFORMATION { + LARGE_INTEGER FreeSpaceStartFiltering; + LARGE_INTEGER FreeSpaceThreshold; + LARGE_INTEGER FreeSpaceStopFiltering; + LARGE_INTEGER DefaultQuotaThreshold; + LARGE_INTEGER DefaultQuotaLimit; + ULONG FileSystemControlFlags; +} FILE_FS_CONTROL_INFORMATION, *PFILE_FS_CONTROL_INFORMATION; + +typedef struct _FILE_FS_FULL_SIZE_INFORMATION { + LARGE_INTEGER TotalAllocationUnits; + LARGE_INTEGER CallerAvailableAllocationUnits; + LARGE_INTEGER ActualAvailableAllocationUnits; + ULONG SectorsPerAllocationUnit; + ULONG BytesPerSector; +} FILE_FS_FULL_SIZE_INFORMATION, *PFILE_FS_FULL_SIZE_INFORMATION; + +typedef struct _FILE_FS_LABEL_INFORMATION { + ULONG VolumeLabelLength; + WCHAR VolumeLabel[1]; +} FILE_FS_LABEL_INFORMATION, *PFILE_FS_LABEL_INFORMATION; + +#if (VER_PRODUCTBUILD >= 2195) + +typedef struct _FILE_FS_OBJECT_ID_INFORMATION { + UCHAR ObjectId[16]; + UCHAR ExtendedInfo[48]; +} FILE_FS_OBJECT_ID_INFORMATION, *PFILE_FS_OBJECT_ID_INFORMATION; + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +typedef struct _FILE_FS_SIZE_INFORMATION { + LARGE_INTEGER TotalAllocationUnits; + LARGE_INTEGER AvailableAllocationUnits; + ULONG SectorsPerAllocationUnit; + ULONG BytesPerSector; +} FILE_FS_SIZE_INFORMATION, *PFILE_FS_SIZE_INFORMATION; + +typedef struct _FILE_FS_VOLUME_INFORMATION { + LARGE_INTEGER VolumeCreationTime; + ULONG VolumeSerialNumber; + ULONG VolumeLabelLength; + BOOLEAN SupportsObjects; + WCHAR VolumeLabel[1]; +} FILE_FS_VOLUME_INFORMATION, *PFILE_FS_VOLUME_INFORMATION; + +typedef struct _FILE_FULL_DIR_INFORMATION { + ULONG NextEntryOffset; + ULONG FileIndex; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + LARGE_INTEGER EndOfFile; + LARGE_INTEGER AllocationSize; + ULONG FileAttributes; + ULONG FileNameLength; + ULONG EaSize; + WCHAR FileName[1]; +} FILE_FULL_DIR_INFORMATION, *PFILE_FULL_DIR_INFORMATION; + +typedef struct _FILE_GET_EA_INFORMATION { + ULONG NextEntryOffset; + UCHAR EaNameLength; + CHAR EaName[1]; +} FILE_GET_EA_INFORMATION, *PFILE_GET_EA_INFORMATION; + +typedef struct _FILE_GET_QUOTA_INFORMATION { + ULONG NextEntryOffset; + ULONG SidLength; + SID Sid; +} FILE_GET_QUOTA_INFORMATION, *PFILE_GET_QUOTA_INFORMATION; + +typedef struct _FILE_QUOTA_INFORMATION +{ + ULONG NextEntryOffset; + ULONG SidLength; + LARGE_INTEGER ChangeTime; + LARGE_INTEGER QuotaUsed; + LARGE_INTEGER QuotaThreshold; + LARGE_INTEGER QuotaLimit; + SID Sid; +} FILE_QUOTA_INFORMATION, *PFILE_QUOTA_INFORMATION; + +typedef struct _FILE_INTERNAL_INFORMATION { + LARGE_INTEGER IndexNumber; +} FILE_INTERNAL_INFORMATION, *PFILE_INTERNAL_INFORMATION; + +typedef struct _FILE_LINK_INFORMATION { + BOOLEAN ReplaceIfExists; + HANDLE RootDirectory; + ULONG FileNameLength; + WCHAR FileName[1]; +} FILE_LINK_INFORMATION, *PFILE_LINK_INFORMATION; + +typedef struct _FILE_LOCK_INFO { + LARGE_INTEGER StartingByte; + LARGE_INTEGER Length; + BOOLEAN ExclusiveLock; + ULONG Key; + PFILE_OBJECT FileObject; + PEPROCESS Process; + LARGE_INTEGER EndingByte; +} FILE_LOCK_INFO, *PFILE_LOCK_INFO; + +/* raw internal file lock struct returned from FsRtlGetNextFileLock */ +typedef struct _FILE_SHARED_LOCK_ENTRY { + PVOID Unknown1; + PVOID Unknown2; + FILE_LOCK_INFO FileLock; +} FILE_SHARED_LOCK_ENTRY, *PFILE_SHARED_LOCK_ENTRY; + +/* raw internal file lock struct returned from FsRtlGetNextFileLock */ +typedef struct _FILE_EXCLUSIVE_LOCK_ENTRY { + LIST_ENTRY ListEntry; + PVOID Unknown1; + PVOID Unknown2; + FILE_LOCK_INFO FileLock; +} FILE_EXCLUSIVE_LOCK_ENTRY, *PFILE_EXCLUSIVE_LOCK_ENTRY; + +typedef NTSTATUS (*PCOMPLETE_LOCK_IRP_ROUTINE) ( + IN PVOID Context, + IN PIRP Irp +); + +typedef VOID (NTAPI *PUNLOCK_ROUTINE) ( + IN PVOID Context, + IN PFILE_LOCK_INFO FileLockInfo +); + +typedef struct _FILE_LOCK { + PCOMPLETE_LOCK_IRP_ROUTINE CompleteLockIrpRoutine; + PUNLOCK_ROUTINE UnlockRoutine; + BOOLEAN FastIoIsQuestionable; + BOOLEAN Pad[3]; + PVOID LockInformation; + FILE_LOCK_INFO LastReturnedLockInfo; + PVOID LastReturnedLock; +} FILE_LOCK, *PFILE_LOCK; + +typedef struct _FILE_MAILSLOT_PEEK_BUFFER { + ULONG ReadDataAvailable; + ULONG NumberOfMessages; + ULONG MessageLength; +} FILE_MAILSLOT_PEEK_BUFFER, *PFILE_MAILSLOT_PEEK_BUFFER; + +typedef struct _FILE_MAILSLOT_QUERY_INFORMATION { + ULONG MaximumMessageSize; + ULONG MailslotQuota; + ULONG NextMessageSize; + ULONG MessagesAvailable; + LARGE_INTEGER ReadTimeout; +} FILE_MAILSLOT_QUERY_INFORMATION, *PFILE_MAILSLOT_QUERY_INFORMATION; + +typedef struct _FILE_MAILSLOT_SET_INFORMATION { + PLARGE_INTEGER ReadTimeout; +} FILE_MAILSLOT_SET_INFORMATION, *PFILE_MAILSLOT_SET_INFORMATION; + +typedef struct _FILE_MODE_INFORMATION { + ULONG Mode; +} FILE_MODE_INFORMATION, *PFILE_MODE_INFORMATION; + +typedef struct _FILE_ALL_INFORMATION { + FILE_BASIC_INFORMATION BasicInformation; + FILE_STANDARD_INFORMATION StandardInformation; + FILE_INTERNAL_INFORMATION InternalInformation; + FILE_EA_INFORMATION EaInformation; + FILE_ACCESS_INFORMATION AccessInformation; + FILE_POSITION_INFORMATION PositionInformation; + FILE_MODE_INFORMATION ModeInformation; + FILE_ALIGNMENT_INFORMATION AlignmentInformation; + FILE_NAME_INFORMATION NameInformation; +} FILE_ALL_INFORMATION, *PFILE_ALL_INFORMATION; + +typedef struct _FILE_NAMES_INFORMATION { + ULONG NextEntryOffset; + ULONG FileIndex; + ULONG FileNameLength; + WCHAR FileName[1]; +} FILE_NAMES_INFORMATION, *PFILE_NAMES_INFORMATION; + +typedef struct _FILE_OBJECTID_INFORMATION { + LONGLONG FileReference; + UCHAR ObjectId[16]; + _ANONYMOUS_UNION union { + struct { + UCHAR BirthVolumeId[16]; + UCHAR BirthObjectId[16]; + UCHAR DomainId[16]; + } ; + UCHAR ExtendedInfo[48]; + } DUMMYUNIONNAME; +} FILE_OBJECTID_INFORMATION, *PFILE_OBJECTID_INFORMATION; + +typedef struct _FILE_OLE_CLASSID_INFORMATION { + GUID ClassId; +} FILE_OLE_CLASSID_INFORMATION, *PFILE_OLE_CLASSID_INFORMATION; + +typedef struct _FILE_OLE_ALL_INFORMATION { + FILE_BASIC_INFORMATION BasicInformation; + FILE_STANDARD_INFORMATION StandardInformation; + FILE_INTERNAL_INFORMATION InternalInformation; + FILE_EA_INFORMATION EaInformation; + FILE_ACCESS_INFORMATION AccessInformation; + FILE_POSITION_INFORMATION PositionInformation; + FILE_MODE_INFORMATION ModeInformation; + FILE_ALIGNMENT_INFORMATION AlignmentInformation; + USN LastChangeUsn; + USN ReplicationUsn; + LARGE_INTEGER SecurityChangeTime; + FILE_OLE_CLASSID_INFORMATION OleClassIdInformation; + FILE_OBJECTID_INFORMATION ObjectIdInformation; + FILE_STORAGE_TYPE StorageType; + ULONG OleStateBits; + ULONG OleId; + ULONG NumberOfStreamReferences; + ULONG StreamIndex; + ULONG SecurityId; + BOOLEAN ContentIndexDisable; + BOOLEAN InheritContentIndexDisable; + FILE_NAME_INFORMATION NameInformation; +} FILE_OLE_ALL_INFORMATION, *PFILE_OLE_ALL_INFORMATION; + +typedef struct _FILE_OLE_DIR_INFORMATION { + ULONG NextEntryOffset; + ULONG FileIndex; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + LARGE_INTEGER EndOfFile; + LARGE_INTEGER AllocationSize; + ULONG FileAttributes; + ULONG FileNameLength; + FILE_STORAGE_TYPE StorageType; + GUID OleClassId; + ULONG OleStateBits; + BOOLEAN ContentIndexDisable; + BOOLEAN InheritContentIndexDisable; + WCHAR FileName[1]; +} FILE_OLE_DIR_INFORMATION, *PFILE_OLE_DIR_INFORMATION; + +typedef struct _FILE_OLE_INFORMATION { + LARGE_INTEGER SecurityChangeTime; + FILE_OLE_CLASSID_INFORMATION OleClassIdInformation; + FILE_OBJECTID_INFORMATION ObjectIdInformation; + FILE_STORAGE_TYPE StorageType; + ULONG OleStateBits; + BOOLEAN ContentIndexDisable; + BOOLEAN InheritContentIndexDisable; +} FILE_OLE_INFORMATION, *PFILE_OLE_INFORMATION; + +typedef struct _FILE_OLE_STATE_BITS_INFORMATION { + ULONG StateBits; + ULONG StateBitsMask; +} FILE_OLE_STATE_BITS_INFORMATION, *PFILE_OLE_STATE_BITS_INFORMATION; + +typedef struct _FILE_PIPE_ASSIGN_EVENT_BUFFER { + HANDLE EventHandle; + ULONG KeyValue; +} FILE_PIPE_ASSIGN_EVENT_BUFFER, *PFILE_PIPE_ASSIGN_EVENT_BUFFER; + +typedef struct _FILE_PIPE_CLIENT_PROCESS_BUFFER { + PVOID ClientSession; + PVOID ClientProcess; +} FILE_PIPE_CLIENT_PROCESS_BUFFER, *PFILE_PIPE_CLIENT_PROCESS_BUFFER; + +typedef struct _FILE_PIPE_EVENT_BUFFER { + ULONG NamedPipeState; + ULONG EntryType; + ULONG ByteCount; + ULONG KeyValue; + ULONG NumberRequests; +} FILE_PIPE_EVENT_BUFFER, *PFILE_PIPE_EVENT_BUFFER; + +typedef struct _FILE_PIPE_PEEK_BUFFER +{ + ULONG NamedPipeState; + ULONG ReadDataAvailable; + ULONG NumberOfMessages; + ULONG MessageLength; + CHAR Data[1]; +} FILE_PIPE_PEEK_BUFFER, *PFILE_PIPE_PEEK_BUFFER; + +typedef struct _FILE_PIPE_INFORMATION { + ULONG ReadMode; + ULONG CompletionMode; +} FILE_PIPE_INFORMATION, *PFILE_PIPE_INFORMATION; + +typedef struct _FILE_PIPE_LOCAL_INFORMATION { + ULONG NamedPipeType; + ULONG NamedPipeConfiguration; + ULONG MaximumInstances; + ULONG CurrentInstances; + ULONG InboundQuota; + ULONG ReadDataAvailable; + ULONG OutboundQuota; + ULONG WriteQuotaAvailable; + ULONG NamedPipeState; + ULONG NamedPipeEnd; +} FILE_PIPE_LOCAL_INFORMATION, *PFILE_PIPE_LOCAL_INFORMATION; + +typedef struct _FILE_PIPE_REMOTE_INFORMATION { + LARGE_INTEGER CollectDataTime; + ULONG MaximumCollectionCount; +} FILE_PIPE_REMOTE_INFORMATION, *PFILE_PIPE_REMOTE_INFORMATION; + +typedef struct _FILE_PIPE_WAIT_FOR_BUFFER { + LARGE_INTEGER Timeout; + ULONG NameLength; + BOOLEAN TimeoutSpecified; + WCHAR Name[1]; +} FILE_PIPE_WAIT_FOR_BUFFER, *PFILE_PIPE_WAIT_FOR_BUFFER; + +typedef struct _FILE_RENAME_INFORMATION { + BOOLEAN ReplaceIfExists; + HANDLE RootDirectory; + ULONG FileNameLength; + WCHAR FileName[1]; +} FILE_RENAME_INFORMATION, *PFILE_RENAME_INFORMATION; + +typedef struct _FILE_STREAM_INFORMATION { + ULONG NextEntryOffset; + ULONG StreamNameLength; + LARGE_INTEGER StreamSize; + LARGE_INTEGER StreamAllocationSize; + WCHAR StreamName[1]; +} FILE_STREAM_INFORMATION, *PFILE_STREAM_INFORMATION; + +typedef struct _FILE_TRACKING_INFORMATION { + HANDLE DestinationFile; + ULONG ObjectInformationLength; + CHAR ObjectInformation[1]; +} FILE_TRACKING_INFORMATION, *PFILE_TRACKING_INFORMATION; + +#if (VER_PRODUCTBUILD >= 2195) +typedef struct _FILE_ZERO_DATA_INFORMATION { + LARGE_INTEGER FileOffset; + LARGE_INTEGER BeyondFinalZero; +} FILE_ZERO_DATA_INFORMATION, *PFILE_ZERO_DATA_INFORMATION; + +typedef struct FILE_ALLOCATED_RANGE_BUFFER { + LARGE_INTEGER FileOffset; + LARGE_INTEGER Length; +} FILE_ALLOCATED_RANGE_BUFFER, *PFILE_ALLOCATED_RANGE_BUFFER; +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +typedef struct _FSRTL_COMMON_FCB_HEADER { + CSHORT NodeTypeCode; + CSHORT NodeByteSize; + UCHAR Flags; + UCHAR IsFastIoPossible; +#if (VER_PRODUCTBUILD >= 1381) + UCHAR Flags2; + UCHAR Reserved; +#endif /* (VER_PRODUCTBUILD >= 1381) */ + PERESOURCE Resource; + PERESOURCE PagingIoResource; + LARGE_INTEGER AllocationSize; + LARGE_INTEGER FileSize; + LARGE_INTEGER ValidDataLength; +} FSRTL_COMMON_FCB_HEADER, *PFSRTL_COMMON_FCB_HEADER; + +#if (VER_PRODUCTBUILD >= 2600) + +typedef struct _FSRTL_ADVANCED_FCB_HEADER { + CSHORT NodeTypeCode; + CSHORT NodeByteSize; + UCHAR Flags; + UCHAR IsFastIoPossible; + UCHAR Flags2; + UCHAR Reserved; + PERESOURCE Resource; + PERESOURCE PagingIoResource; + LARGE_INTEGER AllocationSize; + LARGE_INTEGER FileSize; + LARGE_INTEGER ValidDataLength; + PFAST_MUTEX FastMutex; + LIST_ENTRY FilterContexts; +} FSRTL_ADVANCED_FCB_HEADER, *PFSRTL_ADVANCED_FCB_HEADER; + +typedef struct _FSRTL_PER_STREAM_CONTEXT { + LIST_ENTRY Links; + PVOID OwnerId; + PVOID InstanceId; + PFREE_FUNCTION FreeCallback; +} FSRTL_PER_STREAM_CONTEXT, *PFSRTL_PER_STREAM_CONTEXT; + +#endif /* (VER_PRODUCTBUILD >= 2600) */ + +typedef struct _BASE_MCB +{ + ULONG MaximumPairCount; + ULONG PairCount; + POOL_TYPE PoolType; + PVOID Mapping; +} BASE_MCB; +typedef BASE_MCB *PBASE_MCB; + +typedef struct _LARGE_MCB +{ + PFAST_MUTEX FastMutex; + BASE_MCB BaseMcb; +} LARGE_MCB; +typedef LARGE_MCB *PLARGE_MCB; + +typedef struct _MCB +{ + LARGE_MCB DummyFieldThatSizesThisStructureCorrectly; +} MCB; +typedef MCB *PMCB; + +typedef struct _GENERATE_NAME_CONTEXT { + USHORT Checksum; + BOOLEAN CheckSumInserted; + UCHAR NameLength; + WCHAR NameBuffer[8]; + ULONG ExtensionLength; + WCHAR ExtensionBuffer[4]; + ULONG LastIndexValue; +} GENERATE_NAME_CONTEXT, *PGENERATE_NAME_CONTEXT; + +typedef struct _MAPPING_PAIR { + ULONGLONG Vcn; + ULONGLONG Lcn; +} MAPPING_PAIR, *PMAPPING_PAIR; + +typedef struct _GET_RETRIEVAL_DESCRIPTOR { + ULONG NumberOfPairs; + ULONGLONG StartVcn; + MAPPING_PAIR Pair[1]; +} GET_RETRIEVAL_DESCRIPTOR, *PGET_RETRIEVAL_DESCRIPTOR; + +typedef struct _IO_CLIENT_EXTENSION { + struct _IO_CLIENT_EXTENSION *NextExtension; + PVOID ClientIdentificationAddress; +} IO_CLIENT_EXTENSION, *PIO_CLIENT_EXTENSION; + +typedef struct _IO_COMPLETION_BASIC_INFORMATION { + LONG Depth; +} IO_COMPLETION_BASIC_INFORMATION, *PIO_COMPLETION_BASIC_INFORMATION; + +typedef struct _KQUEUE { + DISPATCHER_HEADER Header; + LIST_ENTRY EntryListHead; + ULONG CurrentCount; + ULONG MaximumCount; + LIST_ENTRY ThreadListHead; +} KQUEUE, *PKQUEUE, *RESTRICTED_POINTER PRKQUEUE; + +typedef struct _MBCB { + CSHORT NodeTypeCode; + CSHORT NodeIsInZone; + ULONG PagesToWrite; + ULONG DirtyPages; + ULONG Reserved; + LIST_ENTRY BitmapRanges; + LONGLONG ResumeWritePage; + BITMAP_RANGE BitmapRange1; + BITMAP_RANGE BitmapRange2; + BITMAP_RANGE BitmapRange3; +} MBCB, *PMBCB; + +typedef struct _MOVEFILE_DESCRIPTOR { + HANDLE FileHandle; + ULONG Reserved; + LARGE_INTEGER StartVcn; + LARGE_INTEGER TargetLcn; + ULONG NumVcns; + ULONG Reserved1; +} MOVEFILE_DESCRIPTOR, *PMOVEFILE_DESCRIPTOR; + +typedef struct _OBJECT_BASIC_INFO { + ULONG Attributes; + ACCESS_MASK GrantedAccess; + ULONG HandleCount; + ULONG ReferenceCount; + ULONG PagedPoolUsage; + ULONG NonPagedPoolUsage; + ULONG Reserved[3]; + ULONG NameInformationLength; + ULONG TypeInformationLength; + ULONG SecurityDescriptorLength; + LARGE_INTEGER CreateTime; +} OBJECT_BASIC_INFO, *POBJECT_BASIC_INFO; + +typedef struct _OBJECT_HANDLE_ATTRIBUTE_INFO { + BOOLEAN Inherit; + BOOLEAN ProtectFromClose; +} OBJECT_HANDLE_ATTRIBUTE_INFO, *POBJECT_HANDLE_ATTRIBUTE_INFO; + +typedef struct _OBJECT_NAME_INFO { + UNICODE_STRING ObjectName; + WCHAR ObjectNameBuffer[1]; +} OBJECT_NAME_INFO, *POBJECT_NAME_INFO; + +typedef struct _OBJECT_PROTECTION_INFO { + BOOLEAN Inherit; + BOOLEAN ProtectHandle; +} OBJECT_PROTECTION_INFO, *POBJECT_PROTECTION_INFO; + +typedef struct _OBJECT_TYPE_INFO { + UNICODE_STRING ObjectTypeName; + UCHAR Unknown[0x58]; + WCHAR ObjectTypeNameBuffer[1]; +} OBJECT_TYPE_INFO, *POBJECT_TYPE_INFO; + +typedef struct _OBJECT_ALL_TYPES_INFO { + ULONG NumberOfObjectTypes; + OBJECT_TYPE_INFO ObjectsTypeInfo[1]; +} OBJECT_ALL_TYPES_INFO, *POBJECT_ALL_TYPES_INFO; + + +typedef struct _PATHNAME_BUFFER { + ULONG PathNameLength; + WCHAR Name[1]; +} PATHNAME_BUFFER, *PPATHNAME_BUFFER; + +#if (VER_PRODUCTBUILD >= 2600) + +typedef struct _PRIVATE_CACHE_MAP_FLAGS { + ULONG DontUse : 16; + ULONG ReadAheadActive : 1; + ULONG ReadAheadEnabled : 1; + ULONG Available : 14; +} PRIVATE_CACHE_MAP_FLAGS, *PPRIVATE_CACHE_MAP_FLAGS; + +typedef struct _PRIVATE_CACHE_MAP { + _ANONYMOUS_UNION union { + CSHORT NodeTypeCode; + PRIVATE_CACHE_MAP_FLAGS Flags; + ULONG UlongFlags; + } DUMMYUNIONNAME; + ULONG ReadAheadMask; + PFILE_OBJECT FileObject; + LARGE_INTEGER FileOffset1; + LARGE_INTEGER BeyondLastByte1; + LARGE_INTEGER FileOffset2; + LARGE_INTEGER BeyondLastByte2; + LARGE_INTEGER ReadAheadOffset[2]; + ULONG ReadAheadLength[2]; + KSPIN_LOCK ReadAheadSpinLock; + LIST_ENTRY PrivateLinks; +} PRIVATE_CACHE_MAP, *PPRIVATE_CACHE_MAP; + +#endif + +typedef struct _PUBLIC_BCB { + CSHORT NodeTypeCode; + CSHORT NodeByteSize; + ULONG MappedLength; + LARGE_INTEGER MappedFileOffset; +} PUBLIC_BCB, *PPUBLIC_BCB; + +typedef struct _QUERY_PATH_REQUEST { + ULONG PathNameLength; + PIO_SECURITY_CONTEXT SecurityContext; + WCHAR FilePathName[1]; +} QUERY_PATH_REQUEST, *PQUERY_PATH_REQUEST; + +typedef struct _QUERY_PATH_RESPONSE { + ULONG LengthAccepted; +} QUERY_PATH_RESPONSE, *PQUERY_PATH_RESPONSE; + +typedef struct _RETRIEVAL_POINTERS_BUFFER { + ULONG ExtentCount; + LARGE_INTEGER StartingVcn; + struct { + LARGE_INTEGER NextVcn; + LARGE_INTEGER Lcn; + } Extents[1]; +} RETRIEVAL_POINTERS_BUFFER, *PRETRIEVAL_POINTERS_BUFFER; + +typedef struct _RTL_SPLAY_LINKS { + struct _RTL_SPLAY_LINKS *Parent; + struct _RTL_SPLAY_LINKS *LeftChild; + struct _RTL_SPLAY_LINKS *RightChild; +} RTL_SPLAY_LINKS, *PRTL_SPLAY_LINKS; + +typedef enum _RTL_GENERIC_COMPARE_RESULTS +{ + GenericLessThan, + GenericGreaterThan, + GenericEqual +} RTL_GENERIC_COMPARE_RESULTS; + +#if defined(USE_LPC6432) +#define LPC_CLIENT_ID CLIENT_ID64 +#define LPC_SIZE_T ULONGLONG +#define LPC_PVOID ULONGLONG +#define LPC_HANDLE ULONGLONG +#else +#define LPC_CLIENT_ID CLIENT_ID +#define LPC_SIZE_T SIZE_T +#define LPC_PVOID PVOID +#define LPC_HANDLE HANDLE +#endif + +typedef struct _PORT_MESSAGE +{ + union + { + struct + { + CSHORT DataLength; + CSHORT TotalLength; + } s1; + ULONG Length; + } u1; + union + { + struct + { + CSHORT Type; + CSHORT DataInfoOffset; + } s2; + ULONG ZeroInit; + } u2; + union + { + LPC_CLIENT_ID ClientId; + double DoNotUseThisField; + }; + ULONG MessageId; + union + { + LPC_SIZE_T ClientViewSize; + ULONG CallbackId; + }; +} PORT_MESSAGE, *PPORT_MESSAGE; + +typedef struct _PORT_VIEW +{ + ULONG Length; + LPC_HANDLE SectionHandle; + ULONG SectionOffset; + LPC_SIZE_T ViewSize; + LPC_PVOID ViewBase; + LPC_PVOID ViewRemoteBase; +} PORT_VIEW, *PPORT_VIEW; + +typedef struct _REMOTE_PORT_VIEW +{ + ULONG Length; + LPC_SIZE_T ViewSize; + LPC_PVOID ViewBase; +} REMOTE_PORT_VIEW, *PREMOTE_PORT_VIEW; + +typedef struct _SE_EXPORTS { + + LUID SeCreateTokenPrivilege; + LUID SeAssignPrimaryTokenPrivilege; + LUID SeLockMemoryPrivilege; + LUID SeIncreaseQuotaPrivilege; + LUID SeUnsolicitedInputPrivilege; + LUID SeTcbPrivilege; + LUID SeSecurityPrivilege; + LUID SeTakeOwnershipPrivilege; + LUID SeLoadDriverPrivilege; + LUID SeCreatePagefilePrivilege; + LUID SeIncreaseBasePriorityPrivilege; + LUID SeSystemProfilePrivilege; + LUID SeSystemtimePrivilege; + LUID SeProfileSingleProcessPrivilege; + LUID SeCreatePermanentPrivilege; + LUID SeBackupPrivilege; + LUID SeRestorePrivilege; + LUID SeShutdownPrivilege; + LUID SeDebugPrivilege; + LUID SeAuditPrivilege; + LUID SeSystemEnvironmentPrivilege; + LUID SeChangeNotifyPrivilege; + LUID SeRemoteShutdownPrivilege; + + PSID SeNullSid; + PSID SeWorldSid; + PSID SeLocalSid; + PSID SeCreatorOwnerSid; + PSID SeCreatorGroupSid; + + PSID SeNtAuthoritySid; + PSID SeDialupSid; + PSID SeNetworkSid; + PSID SeBatchSid; + PSID SeInteractiveSid; + PSID SeLocalSystemSid; + PSID SeAliasAdminsSid; + PSID SeAliasUsersSid; + PSID SeAliasGuestsSid; + PSID SeAliasPowerUsersSid; + PSID SeAliasAccountOpsSid; + PSID SeAliasSystemOpsSid; + PSID SeAliasPrintOpsSid; + PSID SeAliasBackupOpsSid; + + PSID SeAuthenticatedUsersSid; + + PSID SeRestrictedSid; + PSID SeAnonymousLogonSid; + + LUID SeUndockPrivilege; + LUID SeSyncAgentPrivilege; + LUID SeEnableDelegationPrivilege; + +} SE_EXPORTS, *PSE_EXPORTS; + +typedef struct +{ + LARGE_INTEGER StartingLcn; +} STARTING_LCN_INPUT_BUFFER, *PSTARTING_LCN_INPUT_BUFFER; + +typedef struct _STARTING_VCN_INPUT_BUFFER { + LARGE_INTEGER StartingVcn; +} STARTING_VCN_INPUT_BUFFER, *PSTARTING_VCN_INPUT_BUFFER; + +typedef struct _SECURITY_CLIENT_CONTEXT { + SECURITY_QUALITY_OF_SERVICE SecurityQos; + PACCESS_TOKEN ClientToken; + BOOLEAN DirectlyAccessClientToken; + BOOLEAN DirectAccessEffectiveOnly; + BOOLEAN ServerIsRemote; + TOKEN_CONTROL ClientTokenControl; +} SECURITY_CLIENT_CONTEXT, *PSECURITY_CLIENT_CONTEXT; + +typedef struct _ACE_HEADER +{ + UCHAR AceType; + UCHAR AceFlags; + USHORT AceSize; +} ACE_HEADER, *PACE_HEADER; + +typedef struct _TUNNEL { + FAST_MUTEX Mutex; + PRTL_SPLAY_LINKS Cache; + LIST_ENTRY TimerQueue; + USHORT NumEntries; +} TUNNEL, *PTUNNEL; + +typedef struct _VACB { + PVOID BaseAddress; + PSHARED_CACHE_MAP SharedCacheMap; + union { + LARGE_INTEGER FileOffset; + USHORT ActiveCount; + } Overlay; + LIST_ENTRY LruList; +} VACB, *PVACB; + +typedef struct _VAD_HEADER { + PVOID StartVPN; + PVOID EndVPN; + PVAD_HEADER ParentLink; + PVAD_HEADER LeftLink; + PVAD_HEADER RightLink; + ULONG Flags; /* LSB = CommitCharge */ + PVOID ControlArea; + PVOID FirstProtoPte; + PVOID LastPTE; + ULONG Unknown; + LIST_ENTRY Secured; +} VAD_HEADER, *PVAD_HEADER; + +typedef struct +{ + LARGE_INTEGER StartingLcn; + LARGE_INTEGER BitmapSize; + UCHAR Buffer[1]; +} VOLUME_BITMAP_BUFFER, *PVOLUME_BITMAP_BUFFER; + +#if (VER_PRODUCTBUILD >= 2600) + +typedef BOOLEAN +(NTAPI *PFILTER_REPORT_CHANGE) ( + IN PVOID NotifyContext, + IN PVOID FilterContext +); + +typedef enum _FS_FILTER_SECTION_SYNC_TYPE { + SyncTypeOther = 0, + SyncTypeCreateSection +} FS_FILTER_SECTION_SYNC_TYPE, *PFS_FILTER_SECTION_SYNC_TYPE; + +typedef union _FS_FILTER_PARAMETERS { + struct { + PLARGE_INTEGER EndingOffset; + } AcquireForModifiedPageWriter; + + struct { + PERESOURCE ResourceToRelease; + } ReleaseForModifiedPageWriter; + + struct { + FS_FILTER_SECTION_SYNC_TYPE SyncType; + ULONG PageProtection; + } AcquireForSectionSynchronization; + + struct { + PVOID Argument1; + PVOID Argument2; + PVOID Argument3; + PVOID Argument4; + PVOID Argument5; + } Others; +} FS_FILTER_PARAMETERS, *PFS_FILTER_PARAMETERS; + +typedef struct _FS_FILTER_CALLBACK_DATA { + ULONG SizeOfFsFilterCallbackData; + UCHAR Operation; + UCHAR Reserved; + struct _DEVICE_OBJECT *DeviceObject; + struct _FILE_OBJECT *FileObject; + FS_FILTER_PARAMETERS Parameters; +} FS_FILTER_CALLBACK_DATA, *PFS_FILTER_CALLBACK_DATA; + +typedef NTSTATUS +(NTAPI *PFS_FILTER_CALLBACK) ( + IN PFS_FILTER_CALLBACK_DATA Data, + OUT PVOID *CompletionContext +); + +typedef VOID +(NTAPI *PFS_FILTER_COMPLETION_CALLBACK) ( + IN PFS_FILTER_CALLBACK_DATA Data, + IN NTSTATUS OperationStatus, + IN PVOID CompletionContext +); + +typedef struct _FS_FILTER_CALLBACKS { + ULONG SizeOfFsFilterCallbacks; + ULONG Reserved; + PFS_FILTER_CALLBACK PreAcquireForSectionSynchronization; + PFS_FILTER_COMPLETION_CALLBACK PostAcquireForSectionSynchronization; + PFS_FILTER_CALLBACK PreReleaseForSectionSynchronization; + PFS_FILTER_COMPLETION_CALLBACK PostReleaseForSectionSynchronization; + PFS_FILTER_CALLBACK PreAcquireForCcFlush; + PFS_FILTER_COMPLETION_CALLBACK PostAcquireForCcFlush; + PFS_FILTER_CALLBACK PreReleaseForCcFlush; + PFS_FILTER_COMPLETION_CALLBACK PostReleaseForCcFlush; + PFS_FILTER_CALLBACK PreAcquireForModifiedPageWriter; + PFS_FILTER_COMPLETION_CALLBACK PostAcquireForModifiedPageWriter; + PFS_FILTER_CALLBACK PreReleaseForModifiedPageWriter; + PFS_FILTER_COMPLETION_CALLBACK PostReleaseForModifiedPageWriter; +} FS_FILTER_CALLBACKS, *PFS_FILTER_CALLBACKS; + +typedef struct _READ_LIST { + PFILE_OBJECT FileObject; + ULONG NumberOfEntries; + LOGICAL IsImage; + FILE_SEGMENT_ELEMENT List[ANYSIZE_ARRAY]; +} READ_LIST, *PREAD_LIST; + +#endif + +typedef NTSTATUS +(NTAPI * PRTL_HEAP_COMMIT_ROUTINE) ( + IN PVOID Base, + IN OUT PVOID *CommitAddress, + IN OUT PSIZE_T CommitSize +); + +typedef struct _RTL_HEAP_PARAMETERS { + ULONG Length; + SIZE_T SegmentReserve; + SIZE_T SegmentCommit; + SIZE_T DeCommitFreeBlockThreshold; + SIZE_T DeCommitTotalFreeThreshold; + SIZE_T MaximumAllocationSize; + SIZE_T VirtualMemoryThreshold; + SIZE_T InitialCommit; + SIZE_T InitialReserve; + PRTL_HEAP_COMMIT_ROUTINE CommitRoutine; + SIZE_T Reserved[2]; +} RTL_HEAP_PARAMETERS, *PRTL_HEAP_PARAMETERS; + +NTKERNELAPI +BOOLEAN +NTAPI +CcCanIWrite ( + IN PFILE_OBJECT FileObject, + IN ULONG BytesToWrite, + IN BOOLEAN Wait, + IN BOOLEAN Retrying +); + +NTKERNELAPI +BOOLEAN +NTAPI +CcCopyRead ( + IN PFILE_OBJECT FileObject, + IN PLARGE_INTEGER FileOffset, + IN ULONG Length, + IN BOOLEAN Wait, + OUT PVOID Buffer, + OUT PIO_STATUS_BLOCK IoStatus +); + +NTKERNELAPI +BOOLEAN +NTAPI +CcCopyWrite ( + IN PFILE_OBJECT FileObject, + IN PLARGE_INTEGER FileOffset, + IN ULONG Length, + IN BOOLEAN Wait, + IN PVOID Buffer +); + +#define CcCopyWriteWontFlush(FO, FOFF, LEN) ((LEN) <= 0x10000) + +typedef VOID (NTAPI *PCC_POST_DEFERRED_WRITE) ( + IN PVOID Context1, + IN PVOID Context2 +); + +NTKERNELAPI +VOID +NTAPI +CcDeferWrite ( + IN PFILE_OBJECT FileObject, + IN PCC_POST_DEFERRED_WRITE PostRoutine, + IN PVOID Context1, + IN PVOID Context2, + IN ULONG BytesToWrite, + IN BOOLEAN Retrying +); + +NTKERNELAPI +VOID +NTAPI +CcFastCopyRead ( + IN PFILE_OBJECT FileObject, + IN ULONG FileOffset, + IN ULONG Length, + IN ULONG PageCount, + OUT PVOID Buffer, + OUT PIO_STATUS_BLOCK IoStatus +); + +NTKERNELAPI +VOID +NTAPI +CcFastCopyWrite ( + IN PFILE_OBJECT FileObject, + IN ULONG FileOffset, + IN ULONG Length, + IN PVOID Buffer +); + +NTKERNELAPI +VOID +NTAPI +CcFlushCache ( + IN PSECTION_OBJECT_POINTERS SectionObjectPointer, + IN PLARGE_INTEGER FileOffset OPTIONAL, + IN ULONG Length, + OUT PIO_STATUS_BLOCK IoStatus OPTIONAL +); + +typedef VOID (*PDIRTY_PAGE_ROUTINE) ( + IN PFILE_OBJECT FileObject, + IN PLARGE_INTEGER FileOffset, + IN ULONG Length, + IN PLARGE_INTEGER OldestLsn, + IN PLARGE_INTEGER NewestLsn, + IN PVOID Context1, + IN PVOID Context2 +); + +NTKERNELAPI +LARGE_INTEGER +NTAPI +CcGetDirtyPages ( + IN PVOID LogHandle, + IN PDIRTY_PAGE_ROUTINE DirtyPageRoutine, + IN PVOID Context1, + IN PVOID Context2 +); + +NTKERNELAPI +PFILE_OBJECT +NTAPI +CcGetFileObjectFromBcb ( + IN PVOID Bcb +); + +NTKERNELAPI +PFILE_OBJECT +NTAPI +CcGetFileObjectFromSectionPtrs ( + IN PSECTION_OBJECT_POINTERS SectionObjectPointer +); + +#define CcGetFileSizePointer(FO) ( \ + ((PLARGE_INTEGER)((FO)->SectionObjectPointer->SharedCacheMap) + 1) \ +) + +#if (VER_PRODUCTBUILD >= 2195) + +NTKERNELAPI +LARGE_INTEGER +NTAPI +CcGetFlushedValidData ( + IN PSECTION_OBJECT_POINTERS SectionObjectPointer, + IN BOOLEAN BcbListHeld +); + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +NTKERNELAPI +LARGE_INTEGER +NTAPI +CcGetLsnForFileObject ( + IN PFILE_OBJECT FileObject, + OUT PLARGE_INTEGER OldestLsn OPTIONAL +); + +typedef BOOLEAN (NTAPI *PACQUIRE_FOR_LAZY_WRITE) ( + IN PVOID Context, + IN BOOLEAN Wait +); + +typedef VOID (NTAPI *PRELEASE_FROM_LAZY_WRITE) ( + IN PVOID Context +); + +typedef BOOLEAN (NTAPI *PACQUIRE_FOR_READ_AHEAD) ( + IN PVOID Context, + IN BOOLEAN Wait +); + +typedef VOID (NTAPI *PRELEASE_FROM_READ_AHEAD) ( + IN PVOID Context +); + +typedef struct _CACHE_MANAGER_CALLBACKS { + PACQUIRE_FOR_LAZY_WRITE AcquireForLazyWrite; + PRELEASE_FROM_LAZY_WRITE ReleaseFromLazyWrite; + PACQUIRE_FOR_READ_AHEAD AcquireForReadAhead; + PRELEASE_FROM_READ_AHEAD ReleaseFromReadAhead; +} CACHE_MANAGER_CALLBACKS, *PCACHE_MANAGER_CALLBACKS; + +NTKERNELAPI +VOID +NTAPI +CcInitializeCacheMap ( + IN PFILE_OBJECT FileObject, + IN PCC_FILE_SIZES FileSizes, + IN BOOLEAN PinAccess, + IN PCACHE_MANAGER_CALLBACKS Callbacks, + IN PVOID LazyWriteContext +); + +#define CcIsFileCached(FO) ( \ + ((FO)->SectionObjectPointer != NULL) && \ + (((PSECTION_OBJECT_POINTERS)(FO)->SectionObjectPointer)->SharedCacheMap != NULL) \ +) + +NTKERNELAPI +BOOLEAN +NTAPI +CcIsThereDirtyData ( + IN PVPB Vpb +); + +NTKERNELAPI +BOOLEAN +NTAPI +CcMapData ( + IN PFILE_OBJECT FileObject, + IN PLARGE_INTEGER FileOffset, + IN ULONG Length, + IN BOOLEAN Wait, + OUT PVOID *Bcb, + OUT PVOID *Buffer +); + +NTKERNELAPI +VOID +NTAPI +CcMdlRead ( + IN PFILE_OBJECT FileObject, + IN PLARGE_INTEGER FileOffset, + IN ULONG Length, + OUT PMDL *MdlChain, + OUT PIO_STATUS_BLOCK IoStatus +); + +NTKERNELAPI +VOID +NTAPI +CcMdlReadComplete ( + IN PFILE_OBJECT FileObject, + IN PMDL MdlChain +); + +NTKERNELAPI +VOID +NTAPI +CcMdlWriteComplete ( + IN PFILE_OBJECT FileObject, + IN PLARGE_INTEGER FileOffset, + IN PMDL MdlChain +); + +NTKERNELAPI +BOOLEAN +NTAPI +CcPinMappedData ( + IN PFILE_OBJECT FileObject, + IN PLARGE_INTEGER FileOffset, + IN ULONG Length, +#if (VER_PRODUCTBUILD >= 2195) + IN ULONG Flags, +#else + IN BOOLEAN Wait, +#endif + IN OUT PVOID *Bcb +); + +NTKERNELAPI +BOOLEAN +NTAPI +CcPinRead ( + IN PFILE_OBJECT FileObject, + IN PLARGE_INTEGER FileOffset, + IN ULONG Length, +#if (VER_PRODUCTBUILD >= 2195) + IN ULONG Flags, +#else + IN BOOLEAN Wait, +#endif + OUT PVOID *Bcb, + OUT PVOID *Buffer +); + +NTKERNELAPI +VOID +NTAPI +CcPrepareMdlWrite ( + IN PFILE_OBJECT FileObject, + IN PLARGE_INTEGER FileOffset, + IN ULONG Length, + OUT PMDL *MdlChain, + OUT PIO_STATUS_BLOCK IoStatus +); + +NTKERNELAPI +BOOLEAN +NTAPI +CcPreparePinWrite ( + IN PFILE_OBJECT FileObject, + IN PLARGE_INTEGER FileOffset, + IN ULONG Length, + IN BOOLEAN Zero, +#if (VER_PRODUCTBUILD >= 2195) + IN ULONG Flags, +#else + IN BOOLEAN Wait, +#endif + OUT PVOID *Bcb, + OUT PVOID *Buffer +); + +NTKERNELAPI +BOOLEAN +NTAPI +CcPurgeCacheSection ( + IN PSECTION_OBJECT_POINTERS SectionObjectPointer, + IN PLARGE_INTEGER FileOffset OPTIONAL, + IN ULONG Length, + IN BOOLEAN UninitializeCacheMaps +); + +#define CcReadAhead(FO, FOFF, LEN) ( \ + if ((LEN) >= 256) { \ + CcScheduleReadAhead((FO), (FOFF), (LEN)); \ + } \ +) + +#if (VER_PRODUCTBUILD >= 2195) + +NTKERNELAPI +PVOID +NTAPI +CcRemapBcb ( + IN PVOID Bcb +); + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +NTKERNELAPI +VOID +NTAPI +CcRepinBcb ( + IN PVOID Bcb +); + +NTKERNELAPI +VOID +NTAPI +CcScheduleReadAhead ( + IN PFILE_OBJECT FileObject, + IN PLARGE_INTEGER FileOffset, + IN ULONG Length +); + +NTKERNELAPI +VOID +NTAPI +CcSetAdditionalCacheAttributes ( + IN PFILE_OBJECT FileObject, + IN BOOLEAN DisableReadAhead, + IN BOOLEAN DisableWriteBehind +); + +NTKERNELAPI +VOID +NTAPI +CcSetBcbOwnerPointer ( + IN PVOID Bcb, + IN PVOID OwnerPointer +); + +NTKERNELAPI +VOID +NTAPI +CcSetDirtyPageThreshold ( + IN PFILE_OBJECT FileObject, + IN ULONG DirtyPageThreshold +); + +NTKERNELAPI +VOID +NTAPI +CcSetDirtyPinnedData ( + IN PVOID BcbVoid, + IN PLARGE_INTEGER Lsn OPTIONAL +); + +NTKERNELAPI +VOID +NTAPI +CcSetFileSizes ( + IN PFILE_OBJECT FileObject, + IN PCC_FILE_SIZES FileSizes +); + +typedef VOID (NTAPI *PFLUSH_TO_LSN) ( + IN PVOID LogHandle, + IN PLARGE_INTEGER Lsn +); + +NTKERNELAPI +VOID +NTAPI +CcSetLogHandleForFile ( + IN PFILE_OBJECT FileObject, + IN PVOID LogHandle, + IN PFLUSH_TO_LSN FlushToLsnRoutine +); + +NTKERNELAPI +VOID +NTAPI +CcSetReadAheadGranularity ( + IN PFILE_OBJECT FileObject, + IN ULONG Granularity /* default: PAGE_SIZE */ + /* allowed: 2^n * PAGE_SIZE */ +); + +NTKERNELAPI +BOOLEAN +NTAPI +CcUninitializeCacheMap ( + IN PFILE_OBJECT FileObject, + IN PLARGE_INTEGER TruncateSize OPTIONAL, + IN PCACHE_UNINITIALIZE_EVENT UninitializeCompleteEvent OPTIONAL +); + +NTKERNELAPI +VOID +NTAPI +CcUnpinData ( + IN PVOID Bcb +); + +NTKERNELAPI +VOID +NTAPI +CcUnpinDataForThread ( + IN PVOID Bcb, + IN ERESOURCE_THREAD ResourceThreadId +); + +NTKERNELAPI +VOID +NTAPI +CcUnpinRepinnedBcb ( + IN PVOID Bcb, + IN BOOLEAN WriteThrough, + OUT PIO_STATUS_BLOCK IoStatus +); + +#if (VER_PRODUCTBUILD >= 2195) + +NTKERNELAPI +NTSTATUS +NTAPI +CcWaitForCurrentLazyWriterActivity ( + VOID +); + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +NTKERNELAPI +BOOLEAN +NTAPI +CcZeroData ( + IN PFILE_OBJECT FileObject, + IN PLARGE_INTEGER StartOffset, + IN PLARGE_INTEGER EndOffset, + IN BOOLEAN Wait +); + +NTKERNELAPI +VOID +NTAPI +ExDisableResourceBoostLite ( + IN PERESOURCE Resource +); + +NTKERNELAPI +ULONG +NTAPI +ExQueryPoolBlockSize ( + IN PVOID PoolBlock, + OUT PBOOLEAN QuotaCharged +); + +#if (VER_PRODUCTBUILD >= 2600) + +#ifndef __NTOSKRNL__ +NTKERNELAPI +VOID +FASTCALL +ExInitializeRundownProtection ( + IN PEX_RUNDOWN_REF RunRef +); + +NTKERNELAPI +VOID +FASTCALL +ExReInitializeRundownProtection ( + IN PEX_RUNDOWN_REF RunRef +); + +NTKERNELAPI +BOOLEAN +FASTCALL +ExAcquireRundownProtection ( + IN PEX_RUNDOWN_REF RunRef +); + +NTKERNELAPI +BOOLEAN +FASTCALL +ExAcquireRundownProtectionEx ( + IN PEX_RUNDOWN_REF RunRef, + IN ULONG Count +); + +NTKERNELAPI +VOID +FASTCALL +ExReleaseRundownProtection ( + IN PEX_RUNDOWN_REF RunRef +); + +NTKERNELAPI +VOID +FASTCALL +ExReleaseRundownProtectionEx ( + IN PEX_RUNDOWN_REF RunRef, + IN ULONG Count +); + +NTKERNELAPI +VOID +FASTCALL +ExRundownCompleted ( + IN PEX_RUNDOWN_REF RunRef +); + +NTKERNELAPI +VOID +FASTCALL +ExWaitForRundownProtectionRelease ( + IN PEX_RUNDOWN_REF RunRef +); + +#endif +#endif /* (VER_PRODUCTBUILD >= 2600) */ + +#define FlagOn(x, f) ((x) & (f)) + +NTKERNELAPI +VOID +NTAPI +FsRtlAddToTunnelCache ( + IN PTUNNEL Cache, + IN ULONGLONG DirectoryKey, + IN PUNICODE_STRING ShortName, + IN PUNICODE_STRING LongName, + IN BOOLEAN KeyByShortName, + IN ULONG DataLength, + IN PVOID Data +); + +#if (VER_PRODUCTBUILD >= 2195) + +PFILE_LOCK +NTAPI +FsRtlAllocateFileLock ( + IN PCOMPLETE_LOCK_IRP_ROUTINE CompleteLockIrpRoutine OPTIONAL, + IN PUNLOCK_ROUTINE UnlockRoutine OPTIONAL +); + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +NTKERNELAPI +PVOID +NTAPI +FsRtlAllocatePool ( + IN POOL_TYPE PoolType, + IN ULONG NumberOfBytes +); + +NTKERNELAPI +PVOID +NTAPI +FsRtlAllocatePoolWithQuota ( + IN POOL_TYPE PoolType, + IN ULONG NumberOfBytes +); + +NTKERNELAPI +PVOID +NTAPI +FsRtlAllocatePoolWithQuotaTag ( + IN POOL_TYPE PoolType, + IN ULONG NumberOfBytes, + IN ULONG Tag +); + +NTKERNELAPI +PVOID +NTAPI +FsRtlAllocatePoolWithTag ( + IN POOL_TYPE PoolType, + IN ULONG NumberOfBytes, + IN ULONG Tag +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlAreNamesEqual ( + IN PUNICODE_STRING Name1, + IN PUNICODE_STRING Name2, + IN BOOLEAN IgnoreCase, + IN PWCHAR UpcaseTable OPTIONAL +); + +#define FsRtlAreThereCurrentFileLocks(FL) ( \ + ((FL)->FastIoIsQuestionable) \ +) + +/* + FsRtlCheckLockForReadAccess: + + All this really does is pick out the lock parameters from the irp (io stack + location?), get IoGetRequestorProcess, and pass values on to + FsRtlFastCheckLockForRead. +*/ +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlCheckLockForReadAccess ( + IN PFILE_LOCK FileLock, + IN PIRP Irp +); + +/* + FsRtlCheckLockForWriteAccess: + + All this really does is pick out the lock parameters from the irp (io stack + location?), get IoGetRequestorProcess, and pass values on to + FsRtlFastCheckLockForWrite. +*/ +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlCheckLockForWriteAccess ( + IN PFILE_LOCK FileLock, + IN PIRP Irp +); + +typedef +VOID +(NTAPI*POPLOCK_WAIT_COMPLETE_ROUTINE) ( + IN PVOID Context, + IN PIRP Irp +); + +typedef +VOID +(NTAPI*POPLOCK_FS_PREPOST_IRP) ( + IN PVOID Context, + IN PIRP Irp +); + +NTKERNELAPI +NTSTATUS +NTAPI +FsRtlCheckOplock ( + IN POPLOCK Oplock, + IN PIRP Irp, + IN PVOID Context, + IN POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine OPTIONAL, + IN POPLOCK_FS_PREPOST_IRP PostIrpRoutine OPTIONAL +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlCopyRead ( + IN PFILE_OBJECT FileObject, + IN PLARGE_INTEGER FileOffset, + IN ULONG Length, + IN BOOLEAN Wait, + IN ULONG LockKey, + OUT PVOID Buffer, + OUT PIO_STATUS_BLOCK IoStatus, + IN PDEVICE_OBJECT DeviceObject +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlCopyWrite ( + IN PFILE_OBJECT FileObject, + IN PLARGE_INTEGER FileOffset, + IN ULONG Length, + IN BOOLEAN Wait, + IN ULONG LockKey, + IN PVOID Buffer, + OUT PIO_STATUS_BLOCK IoStatus, + IN PDEVICE_OBJECT DeviceObject +); + +NTKERNELAPI +PVOID +NTAPI +RtlCreateHeap ( + IN ULONG Flags, + IN PVOID HeapBase OPTIONAL, + IN SIZE_T ReserveSize OPTIONAL, + IN SIZE_T CommitSize OPTIONAL, + IN PVOID Lock OPTIONAL, + IN PRTL_HEAP_PARAMETERS Parameters OPTIONAL +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlCurrentBatchOplock ( + IN POPLOCK Oplock +); + +NTKERNELAPI +VOID +NTAPI +FsRtlDeleteKeyFromTunnelCache ( + IN PTUNNEL Cache, + IN ULONGLONG DirectoryKey +); + +NTKERNELAPI +VOID +NTAPI +FsRtlDeleteTunnelCache ( + IN PTUNNEL Cache +); + +NTKERNELAPI +VOID +NTAPI +FsRtlDeregisterUncProvider ( + IN HANDLE Handle +); + +NTKERNELAPI +PVOID +NTAPI +RtlDestroyHeap( + IN PVOID HeapHandle +); + +NTKERNELAPI +VOID +NTAPI +FsRtlDissectDbcs ( + IN ANSI_STRING Name, + OUT PANSI_STRING FirstPart, + OUT PANSI_STRING RemainingPart +); + +NTKERNELAPI +VOID +NTAPI +FsRtlDissectName ( + IN UNICODE_STRING Name, + OUT PUNICODE_STRING FirstPart, + OUT PUNICODE_STRING RemainingPart +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlDoesDbcsContainWildCards ( + IN PANSI_STRING Name +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlDoesNameContainWildCards ( + IN PUNICODE_STRING Name +); + +#define FsRtlEnterFileSystem KeEnterCriticalRegion + +#define FsRtlExitFileSystem KeLeaveCriticalRegion + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlFastCheckLockForRead ( + IN PFILE_LOCK FileLock, + IN PLARGE_INTEGER FileOffset, + IN PLARGE_INTEGER Length, + IN ULONG Key, + IN PFILE_OBJECT FileObject, + IN PEPROCESS Process +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlFastCheckLockForWrite ( + IN PFILE_LOCK FileLock, + IN PLARGE_INTEGER FileOffset, + IN PLARGE_INTEGER Length, + IN ULONG Key, + IN PFILE_OBJECT FileObject, + IN PEPROCESS Process +); + +#define FsRtlFastLock(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) ( \ + FsRtlPrivateLock(A1, A2, A3, A4, A5, A6, A7, A8, A9, NULL, A10, A11) \ +) + +NTKERNELAPI +NTSTATUS +NTAPI +FsRtlFastUnlockAll ( + IN PFILE_LOCK FileLock, + IN PFILE_OBJECT FileObject, + IN PEPROCESS Process, + IN PVOID Context OPTIONAL +); +/* ret: STATUS_RANGE_NOT_LOCKED */ + +NTKERNELAPI +NTSTATUS +NTAPI +FsRtlFastUnlockAllByKey ( + IN PFILE_LOCK FileLock, + IN PFILE_OBJECT FileObject, + IN PEPROCESS Process, + IN ULONG Key, + IN PVOID Context OPTIONAL +); +/* ret: STATUS_RANGE_NOT_LOCKED */ + +NTKERNELAPI +NTSTATUS +NTAPI +FsRtlFastUnlockSingle ( + IN PFILE_LOCK FileLock, + IN PFILE_OBJECT FileObject, + IN PLARGE_INTEGER FileOffset, + IN PLARGE_INTEGER Length, + IN PEPROCESS Process, + IN ULONG Key, + IN PVOID Context OPTIONAL, + IN BOOLEAN AlreadySynchronized +); +/* ret: STATUS_RANGE_NOT_LOCKED */ + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlFindInTunnelCache ( + IN PTUNNEL Cache, + IN ULONGLONG DirectoryKey, + IN PUNICODE_STRING Name, + OUT PUNICODE_STRING ShortName, + OUT PUNICODE_STRING LongName, + IN OUT PULONG DataLength, + OUT PVOID Data +); + +#if (VER_PRODUCTBUILD >= 2195) + +NTKERNELAPI +VOID +NTAPI +FsRtlFreeFileLock ( + IN PFILE_LOCK FileLock +); + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +NTKERNELAPI +NTSTATUS +NTAPI +FsRtlGetFileSize ( + IN PFILE_OBJECT FileObject, + IN OUT PLARGE_INTEGER FileSize +); + +/* + FsRtlGetNextFileLock: + + ret: NULL if no more locks + + Internals: + FsRtlGetNextFileLock uses FileLock->LastReturnedLockInfo and + FileLock->LastReturnedLock as storage. + LastReturnedLock is a pointer to the 'raw' lock inkl. double linked + list, and FsRtlGetNextFileLock needs this to get next lock on subsequent + calls with Restart = FALSE. +*/ +NTKERNELAPI +PFILE_LOCK_INFO +NTAPI +FsRtlGetNextFileLock ( + IN PFILE_LOCK FileLock, + IN BOOLEAN Restart +); + +NTKERNELAPI +VOID +NTAPI +FsRtlInitializeFileLock ( + IN PFILE_LOCK FileLock, + IN PCOMPLETE_LOCK_IRP_ROUTINE CompleteLockIrpRoutine OPTIONAL, + IN PUNLOCK_ROUTINE UnlockRoutine OPTIONAL +); + +NTKERNELAPI +VOID +NTAPI +FsRtlInitializeOplock ( + IN OUT POPLOCK Oplock +); + +NTKERNELAPI +VOID +NTAPI +FsRtlInitializeTunnelCache ( + IN PTUNNEL Cache +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlIsNameInExpression ( + IN PUNICODE_STRING Expression, + IN PUNICODE_STRING Name, + IN BOOLEAN IgnoreCase, + IN PWCHAR UpcaseTable OPTIONAL +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlIsNtstatusExpected ( + IN NTSTATUS Ntstatus +); + +#define NLS_OEM_LEAD_BYTE_INFO NlsOemLeadByteInfo + +extern PUSHORT NlsOemLeadByteInfo; + +#define FsRtlIsLeadDbcsCharacter(DBCS_CHAR) ( \ + (BOOLEAN)((UCHAR)(DBCS_CHAR) < 0x80 ? FALSE : \ + (NLS_MB_CODE_PAGE_TAG && \ + (NLS_OEM_LEAD_BYTE_INFO[(UCHAR)(DBCS_CHAR)] != 0))) \ +) + +#define FsRtlIsAnsiCharacterWild(C) ( \ + FlagOn(FsRtlLegalAnsiCharacterArray[(UCHAR)(C)], FSRTL_WILD_CHARACTER ) \ +) + +#define FsRtlIsUnicodeCharacterWild(C) ( \ + (((C) >= 0x40) ? \ + FALSE : \ + FlagOn(FsRtlLegalAnsiCharacterArray[(C)], FSRTL_WILD_CHARACTER )) \ +) + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlMdlReadDev ( + IN PFILE_OBJECT FileObject, + IN PLARGE_INTEGER FileOffset, + IN ULONG Length, + IN ULONG LockKey, + OUT PMDL *MdlChain, + OUT PIO_STATUS_BLOCK IoStatus, + IN PDEVICE_OBJECT DeviceObject +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlMdlReadComplete ( + IN PFILE_OBJECT FileObject, + IN PMDL MdlChain +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlMdlReadCompleteDev ( + IN PFILE_OBJECT FileObject, + IN PMDL MdlChain, + IN PDEVICE_OBJECT DeviceObject +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlPrepareMdlWriteDev ( + IN PFILE_OBJECT FileObject, + IN PLARGE_INTEGER FileOffset, + IN ULONG Length, + IN ULONG LockKey, + OUT PMDL *MdlChain, + OUT PIO_STATUS_BLOCK IoStatus, + IN PDEVICE_OBJECT DeviceObject +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlMdlWriteComplete ( + IN PFILE_OBJECT FileObject, + IN PLARGE_INTEGER FileOffset, + IN PMDL MdlChain +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlMdlWriteCompleteDev ( + IN PFILE_OBJECT FileObject, + IN PLARGE_INTEGER FileOffset, + IN PMDL MdlChain, + IN PDEVICE_OBJECT DeviceObject +); + +NTKERNELAPI +NTSTATUS +NTAPI +FsRtlNormalizeNtstatus ( + IN NTSTATUS Exception, + IN NTSTATUS GenericException +); + +NTKERNELAPI +VOID +NTAPI +FsRtlNotifyChangeDirectory ( + IN PNOTIFY_SYNC NotifySync, + IN PVOID FsContext, + IN PSTRING FullDirectoryName, + IN PLIST_ENTRY NotifyList, + IN BOOLEAN WatchTree, + IN ULONG CompletionFilter, + IN PIRP NotifyIrp +); + +NTKERNELAPI +VOID +NTAPI +FsRtlNotifyCleanup ( + IN PNOTIFY_SYNC NotifySync, + IN PLIST_ENTRY NotifyList, + IN PVOID FsContext +); + +typedef BOOLEAN (*PCHECK_FOR_TRAVERSE_ACCESS) ( + IN PVOID NotifyContext, + IN PVOID TargetContext, + IN PSECURITY_SUBJECT_CONTEXT SubjectContext +); + +NTKERNELAPI +VOID +NTAPI +FsRtlNotifyFullChangeDirectory ( + IN PNOTIFY_SYNC NotifySync, + IN PLIST_ENTRY NotifyList, + IN PVOID FsContext, + IN PSTRING FullDirectoryName, + IN BOOLEAN WatchTree, + IN BOOLEAN IgnoreBuffer, + IN ULONG CompletionFilter, + IN PIRP NotifyIrp, + IN PCHECK_FOR_TRAVERSE_ACCESS TraverseCallback OPTIONAL, + IN PSECURITY_SUBJECT_CONTEXT SubjectContext OPTIONAL +); + +NTKERNELAPI +VOID +NTAPI +FsRtlNotifyFullReportChange ( + IN PNOTIFY_SYNC NotifySync, + IN PLIST_ENTRY NotifyList, + IN PSTRING FullTargetName, + IN USHORT TargetNameOffset, + IN PSTRING StreamName OPTIONAL, + IN PSTRING NormalizedParentName OPTIONAL, + IN ULONG FilterMatch, + IN ULONG Action, + IN PVOID TargetContext +); + +NTKERNELAPI +VOID +NTAPI +FsRtlNotifyInitializeSync ( + IN PNOTIFY_SYNC *NotifySync +); + +NTKERNELAPI +VOID +NTAPI +FsRtlNotifyReportChange ( + IN PNOTIFY_SYNC NotifySync, + IN PLIST_ENTRY NotifyList, + IN PSTRING FullTargetName, + IN PUSHORT FileNamePartLength, + IN ULONG FilterMatch +); + +NTKERNELAPI +VOID +NTAPI +FsRtlNotifyUninitializeSync ( + IN PNOTIFY_SYNC *NotifySync +); + +#if (VER_PRODUCTBUILD >= 2195) + +NTKERNELAPI +NTSTATUS +NTAPI +FsRtlNotifyVolumeEvent ( + IN PFILE_OBJECT FileObject, + IN ULONG EventCode +); + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +NTKERNELAPI +NTSTATUS +NTAPI +FsRtlOplockFsctrl ( + IN POPLOCK Oplock, + IN PIRP Irp, + IN ULONG OpenCount +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlOplockIsFastIoPossible ( + IN POPLOCK Oplock +); + +/* + FsRtlPrivateLock: + + ret: IoStatus->Status: STATUS_PENDING, STATUS_LOCK_NOT_GRANTED + + Internals: + -Calls IoCompleteRequest if Irp + -Uses exception handling / ExRaiseStatus with STATUS_INSUFFICIENT_RESOURCES +*/ +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlPrivateLock ( + IN PFILE_LOCK FileLock, + IN PFILE_OBJECT FileObject, + IN PLARGE_INTEGER FileOffset, + IN PLARGE_INTEGER Length, + IN PEPROCESS Process, + IN ULONG Key, + IN BOOLEAN FailImmediately, + IN BOOLEAN ExclusiveLock, + OUT PIO_STATUS_BLOCK IoStatus, + IN PIRP Irp OPTIONAL, + IN PVOID Context, + IN BOOLEAN AlreadySynchronized +); + +/* + FsRtlProcessFileLock: + + ret: + -STATUS_INVALID_DEVICE_REQUEST + -STATUS_RANGE_NOT_LOCKED from unlock routines. + -STATUS_PENDING, STATUS_LOCK_NOT_GRANTED from FsRtlPrivateLock + (redirected IoStatus->Status). + + Internals: + -switch ( Irp->CurrentStackLocation->MinorFunction ) + lock: return FsRtlPrivateLock; + unlocksingle: return FsRtlFastUnlockSingle; + unlockall: return FsRtlFastUnlockAll; + unlockallbykey: return FsRtlFastUnlockAllByKey; + default: IofCompleteRequest with STATUS_INVALID_DEVICE_REQUEST; + return STATUS_INVALID_DEVICE_REQUEST; + + -'AllwaysZero' is passed thru as 'AllwaysZero' to lock / unlock routines. + -'Irp' is passet thru as 'Irp' to FsRtlPrivateLock. +*/ +NTKERNELAPI +NTSTATUS +NTAPI +FsRtlProcessFileLock ( + IN PFILE_LOCK FileLock, + IN PIRP Irp, + IN PVOID Context OPTIONAL +); + +NTKERNELAPI +NTSTATUS +NTAPI +FsRtlRegisterUncProvider ( + IN OUT PHANDLE MupHandle, + IN PUNICODE_STRING RedirectorDeviceName, + IN BOOLEAN MailslotsSupported +); + +typedef VOID +(NTAPI *PFSRTL_STACK_OVERFLOW_ROUTINE) ( + IN PVOID Context, + IN PKEVENT Event +); + +NTKERNELAPI +VOID +NTAPI +FsRtlPostStackOverflow ( + IN PVOID Context, + IN PKEVENT Event, + IN PFSRTL_STACK_OVERFLOW_ROUTINE StackOverflowRoutine +); + +NTKERNELAPI +VOID +NTAPI +FsRtlPostPagingFileStackOverflow ( + IN PVOID Context, + IN PKEVENT Event, + IN PFSRTL_STACK_OVERFLOW_ROUTINE StackOverflowRoutine +); + +NTKERNELAPI +VOID +NTAPI +FsRtlUninitializeFileLock ( + IN PFILE_LOCK FileLock +); + +NTKERNELAPI +VOID +NTAPI +FsRtlUninitializeOplock ( + IN OUT POPLOCK Oplock +); + +NTSYSAPI +VOID +NTAPI +HalDisplayString ( + IN PCHAR String +); + +NTSYSAPI +VOID +NTAPI +HalQueryRealTimeClock ( + IN OUT PTIME_FIELDS TimeFields +); + +NTSYSAPI +VOID +NTAPI +HalSetRealTimeClock ( + IN PTIME_FIELDS TimeFields +); + +NTKERNELAPI +NTSTATUS +NTAPI +IoAttachDeviceToDeviceStackSafe( + IN PDEVICE_OBJECT SourceDevice, + IN PDEVICE_OBJECT TargetDevice, + OUT PDEVICE_OBJECT *AttachedToDeviceObject +); + +NTKERNELAPI +VOID +NTAPI +IoAcquireVpbSpinLock ( + OUT PKIRQL Irql +); + +NTKERNELAPI +NTSTATUS +NTAPI +IoCheckDesiredAccess ( + IN OUT PACCESS_MASK DesiredAccess, + IN ACCESS_MASK GrantedAccess +); + +NTKERNELAPI +NTSTATUS +NTAPI +IoCheckEaBufferValidity ( + IN PFILE_FULL_EA_INFORMATION EaBuffer, + IN ULONG EaLength, + OUT PULONG ErrorOffset +); + +NTKERNELAPI +NTSTATUS +NTAPI +IoCheckFunctionAccess ( + IN ACCESS_MASK GrantedAccess, + IN UCHAR MajorFunction, + IN UCHAR MinorFunction, + IN ULONG IoControlCode, + IN PVOID Argument1 OPTIONAL, + IN PVOID Argument2 OPTIONAL +); + +#if (VER_PRODUCTBUILD >= 2195) + +NTKERNELAPI +NTSTATUS +NTAPI +IoCheckQuotaBufferValidity ( + IN PFILE_QUOTA_INFORMATION QuotaBuffer, + IN ULONG QuotaLength, + OUT PULONG ErrorOffset +); + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +NTKERNELAPI +PFILE_OBJECT +NTAPI +IoCreateStreamFileObject ( + IN PFILE_OBJECT FileObject OPTIONAL, + IN PDEVICE_OBJECT DeviceObject OPTIONAL +); + +#if (VER_PRODUCTBUILD >= 2195) + +NTKERNELAPI +PFILE_OBJECT +NTAPI +IoCreateStreamFileObjectLite ( + IN PFILE_OBJECT FileObject OPTIONAL, + IN PDEVICE_OBJECT DeviceObject OPTIONAL +); + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +NTKERNELAPI +BOOLEAN +NTAPI +IoFastQueryNetworkAttributes ( + IN POBJECT_ATTRIBUTES ObjectAttributes, + IN ACCESS_MASK DesiredAccess, + IN ULONG OpenOptions, + OUT PIO_STATUS_BLOCK IoStatus, + OUT PFILE_NETWORK_OPEN_INFORMATION Buffer +); + +NTKERNELAPI +PDEVICE_OBJECT +NTAPI +IoGetAttachedDevice ( + IN PDEVICE_OBJECT DeviceObject +); + +NTKERNELAPI +PDEVICE_OBJECT +NTAPI +IoGetBaseFileSystemDeviceObject ( + IN PFILE_OBJECT FileObject +); + +NTKERNELAPI +PEPROCESS +NTAPI +IoGetRequestorProcess ( + IN PIRP Irp +); + +#if (VER_PRODUCTBUILD >= 2195) + +NTKERNELAPI +ULONG +NTAPI +IoGetRequestorProcessId ( + IN PIRP Irp +); + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +NTKERNELAPI +PIRP +NTAPI +IoGetTopLevelIrp ( + VOID +); + +#define IoIsFileOpenedExclusively(FileObject) ( \ + (BOOLEAN) !( \ + (FileObject)->SharedRead || \ + (FileObject)->SharedWrite || \ + (FileObject)->SharedDelete \ + ) \ +) + +NTKERNELAPI +BOOLEAN +NTAPI +IoIsOperationSynchronous ( + IN PIRP Irp +); + +NTKERNELAPI +BOOLEAN +NTAPI +IoIsSystemThread ( + IN PETHREAD Thread +); + +#if (VER_PRODUCTBUILD >= 2195) + +NTKERNELAPI +BOOLEAN +NTAPI +IoIsValidNameGraftingBuffer ( + IN PIRP Irp, + IN PREPARSE_DATA_BUFFER ReparseBuffer +); + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +NTKERNELAPI +NTSTATUS +NTAPI +IoPageRead ( + IN PFILE_OBJECT FileObject, + IN PMDL Mdl, + IN PLARGE_INTEGER Offset, + IN PKEVENT Event, + OUT PIO_STATUS_BLOCK IoStatusBlock +); + +NTKERNELAPI +NTSTATUS +NTAPI +IoQueryFileInformation ( + IN PFILE_OBJECT FileObject, + IN FILE_INFORMATION_CLASS FileInformationClass, + IN ULONG Length, + OUT PVOID FileInformation, + OUT PULONG ReturnedLength +); + +NTKERNELAPI +NTSTATUS +NTAPI +IoQueryVolumeInformation ( + IN PFILE_OBJECT FileObject, + IN FS_INFORMATION_CLASS FsInformationClass, + IN ULONG Length, + OUT PVOID FsInformation, + OUT PULONG ReturnedLength +); + +NTKERNELAPI +VOID +NTAPI +IoQueueThreadIrp( + IN PIRP Irp +); + +NTKERNELAPI +VOID +NTAPI +IoRegisterFileSystem ( + IN OUT PDEVICE_OBJECT DeviceObject +); + +#if (VER_PRODUCTBUILD >= 1381) + +typedef VOID (NTAPI *PDRIVER_FS_NOTIFICATION) ( + IN PDEVICE_OBJECT DeviceObject, + IN BOOLEAN DriverActive +); + +NTKERNELAPI +NTSTATUS +NTAPI +IoRegisterFsRegistrationChange ( + IN PDRIVER_OBJECT DriverObject, + IN PDRIVER_FS_NOTIFICATION DriverNotificationRoutine +); + +#endif /* (VER_PRODUCTBUILD >= 1381) */ + +NTKERNELAPI +VOID +NTAPI +IoReleaseVpbSpinLock ( + IN KIRQL Irql +); + +NTKERNELAPI +VOID +NTAPI +IoSetDeviceToVerify ( + IN PETHREAD Thread, + IN PDEVICE_OBJECT DeviceObject +); + +NTKERNELAPI +NTSTATUS +NTAPI +IoSetInformation ( + IN PFILE_OBJECT FileObject, + IN FILE_INFORMATION_CLASS FileInformationClass, + IN ULONG Length, + IN PVOID FileInformation +); + +NTKERNELAPI +VOID +NTAPI +IoSetTopLevelIrp ( + IN PIRP Irp +); + +NTKERNELAPI +NTSTATUS +NTAPI +IoSynchronousPageWrite ( + IN PFILE_OBJECT FileObject, + IN PMDL Mdl, + IN PLARGE_INTEGER FileOffset, + IN PKEVENT Event, + OUT PIO_STATUS_BLOCK IoStatusBlock +); + +NTKERNELAPI +PEPROCESS +NTAPI +IoThreadToProcess ( + IN PETHREAD Thread +); + +NTKERNELAPI +VOID +NTAPI +IoUnregisterFileSystem ( + IN OUT PDEVICE_OBJECT DeviceObject +); + +#if (VER_PRODUCTBUILD >= 1381) + +NTKERNELAPI +VOID +NTAPI +IoUnregisterFsRegistrationChange ( + IN PDRIVER_OBJECT DriverObject, + IN PDRIVER_FS_NOTIFICATION DriverNotificationRoutine +); + +#endif /* (VER_PRODUCTBUILD >= 1381) */ + +NTKERNELAPI +NTSTATUS +NTAPI +IoVerifyVolume ( + IN PDEVICE_OBJECT DeviceObject, + IN BOOLEAN AllowRawMount +); + +NTKERNELAPI +VOID +NTAPI +KeAttachProcess ( + IN PKPROCESS Process +); + +NTKERNELAPI +VOID +NTAPI +KeDetachProcess ( + VOID +); + +NTKERNELAPI +VOID +NTAPI +KeInitializeQueue ( + IN PRKQUEUE Queue, + IN ULONG Count OPTIONAL +); + +NTKERNELAPI +LONG +NTAPI +KeInsertHeadQueue ( + IN PRKQUEUE Queue, + IN PLIST_ENTRY Entry +); + +NTKERNELAPI +LONG +NTAPI +KeInsertQueue ( + IN PRKQUEUE Queue, + IN PLIST_ENTRY Entry +); + +NTKERNELAPI +BOOLEAN +NTAPI +KeInsertQueueApc ( + IN PKAPC Apc, + IN PVOID SystemArgument1, + IN PVOID SystemArgument2, + IN KPRIORITY PriorityBoost +); + +NTKERNELAPI +LONG +NTAPI +KeReadStateQueue ( + IN PRKQUEUE Queue +); + +NTKERNELAPI +PLIST_ENTRY +NTAPI +KeRemoveQueue ( + IN PRKQUEUE Queue, + IN KPROCESSOR_MODE WaitMode, + IN PLARGE_INTEGER Timeout OPTIONAL +); + +NTKERNELAPI +PLIST_ENTRY +NTAPI +KeRundownQueue ( + IN PRKQUEUE Queue +); + +NTKERNELAPI +VOID +NTAPI +KeInitializeMutant ( + IN PRKMUTANT Mutant, + IN BOOLEAN InitialOwner +); + +NTKERNELAPI +LONG +NTAPI +KeReadStateMutant ( + IN PRKMUTANT Mutant +); + +NTKERNELAPI +LONG +NTAPI +KeReleaseMutant ( + IN PRKMUTANT Mutant, + IN KPRIORITY Increment, + IN BOOLEAN Abandoned, + IN BOOLEAN Wait +); + +#if (VER_PRODUCTBUILD >= 2195) + +NTKERNELAPI +VOID +NTAPI +KeStackAttachProcess ( + IN PKPROCESS Process, + OUT PKAPC_STATE ApcState +); + +NTKERNELAPI +VOID +NTAPI +KeUnstackDetachProcess ( + IN PKAPC_STATE ApcState +); + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +NTKERNELAPI +BOOLEAN +NTAPI +KeSetKernelStackSwapEnable( + IN BOOLEAN Enable +); + +NTKERNELAPI +BOOLEAN +NTAPI +MmCanFileBeTruncated ( + IN PSECTION_OBJECT_POINTERS SectionObjectPointer, + IN PLARGE_INTEGER NewFileSize +); + +NTKERNELAPI +BOOLEAN +NTAPI +MmFlushImageSection ( + IN PSECTION_OBJECT_POINTERS SectionObjectPointer, + IN MMFLUSH_TYPE FlushType +); + +NTKERNELAPI +BOOLEAN +NTAPI +MmForceSectionClosed ( + IN PSECTION_OBJECT_POINTERS SectionObjectPointer, + IN BOOLEAN DelayClose +); + +#if (VER_PRODUCTBUILD >= 1381) + +NTKERNELAPI +BOOLEAN +NTAPI +MmIsRecursiveIoFault ( + VOID +); + +#else + +#define MmIsRecursiveIoFault() ( \ + (PsGetCurrentThread()->DisablePageFaultClustering) | \ + (PsGetCurrentThread()->ForwardClusterOnly) \ +) + +#endif + + +NTKERNELAPI +BOOLEAN +NTAPI +MmSetAddressRangeModified ( + IN PVOID Address, + IN ULONG Length +); + +NTKERNELAPI +NTSTATUS +NTAPI +ObCreateObject ( + IN KPROCESSOR_MODE ObjectAttributesAccessMode OPTIONAL, + IN POBJECT_TYPE ObjectType, + IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, + IN KPROCESSOR_MODE AccessMode, + IN OUT PVOID ParseContext OPTIONAL, + IN ULONG ObjectSize, + IN ULONG PagedPoolCharge OPTIONAL, + IN ULONG NonPagedPoolCharge OPTIONAL, + OUT PVOID *Object +); + +NTKERNELAPI +ULONG +NTAPI +ObGetObjectPointerCount ( + IN PVOID Object +); + +NTKERNELAPI +NTSTATUS +NTAPI +ObInsertObject ( + IN PVOID Object, + IN PACCESS_STATE PassedAccessState OPTIONAL, + IN ACCESS_MASK DesiredAccess, + IN ULONG AdditionalReferences, + OUT PVOID *ReferencedObject OPTIONAL, + OUT PHANDLE Handle +); + +NTKERNELAPI +VOID +NTAPI +ObMakeTemporaryObject ( + IN PVOID Object +); + +NTKERNELAPI +NTSTATUS +NTAPI +ObOpenObjectByPointer ( + IN PVOID Object, + IN ULONG HandleAttributes, + IN PACCESS_STATE PassedAccessState OPTIONAL, + IN ACCESS_MASK DesiredAccess OPTIONAL, + IN POBJECT_TYPE ObjectType OPTIONAL, + IN KPROCESSOR_MODE AccessMode, + OUT PHANDLE Handle +); + +NTKERNELAPI +NTSTATUS +NTAPI +ObQueryNameString ( + IN PVOID Object, + OUT POBJECT_NAME_INFORMATION ObjectNameInfo, + IN ULONG Length, + OUT PULONG ReturnLength +); + +NTKERNELAPI +NTSTATUS +NTAPI +ObQueryObjectAuditingByHandle ( + IN HANDLE Handle, + OUT PBOOLEAN GenerateOnClose +); + +NTKERNELAPI +NTSTATUS +NTAPI +ObReferenceObjectByName ( + IN PUNICODE_STRING ObjectName, + IN ULONG Attributes, + IN PACCESS_STATE PassedAccessState OPTIONAL, + IN ACCESS_MASK DesiredAccess OPTIONAL, + IN POBJECT_TYPE ObjectType, + IN KPROCESSOR_MODE AccessMode, + IN OUT PVOID ParseContext OPTIONAL, + OUT PVOID *Object +); + +NTKERNELAPI +NTSTATUS +NTAPI +PsAssignImpersonationToken ( + IN PETHREAD Thread, + IN HANDLE Token +); + +NTKERNELAPI +VOID +NTAPI +PsChargePoolQuota ( + IN PEPROCESS Process, + IN POOL_TYPE PoolType, + IN ULONG Amount +); + +NTKERNELAPI +NTSTATUS +NTAPI +PsChargeProcessPoolQuota ( + IN PEPROCESS Process, + IN POOL_TYPE PoolType, + IN ULONG_PTR Amount +); + +#define PsDereferenceImpersonationToken(T) \ + {if (ARGUMENT_PRESENT(T)) { \ + (ObDereferenceObject((T))); \ + } else { \ + ; \ + } \ +} + +#define PsDereferencePrimaryToken(T) (ObDereferenceObject((T))) + +NTKERNELAPI +BOOLEAN +NTAPI +PsDisableImpersonation( + IN PETHREAD Thread, + IN PSE_IMPERSONATION_STATE ImpersonationState +); + +NTKERNELAPI +LARGE_INTEGER +NTAPI +PsGetProcessExitTime ( + VOID +); + +NTKERNELAPI +NTSTATUS +NTAPI +PsImpersonateClient( + IN PETHREAD Thread, + IN PACCESS_TOKEN Token, + IN BOOLEAN CopyOnOpen, + IN BOOLEAN EffectiveOnly, + IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel +); + +NTKERNELAPI +BOOLEAN +NTAPI +PsIsSystemThread( + IN PETHREAD Thread +); + +NTKERNELAPI +BOOLEAN +NTAPI +PsIsThreadTerminating ( + IN PETHREAD Thread +); + +NTKERNELAPI +NTSTATUS +NTAPI +PsLookupProcessByProcessId ( + IN HANDLE ProcessId, + OUT PEPROCESS *Process +); + +NTKERNELAPI +NTSTATUS +NTAPI +PsLookupProcessThreadByCid ( + IN PCLIENT_ID Cid, + OUT PEPROCESS *Process OPTIONAL, + OUT PETHREAD *Thread +); + +NTKERNELAPI +NTSTATUS +NTAPI +PsLookupThreadByThreadId ( + IN HANDLE UniqueThreadId, + OUT PETHREAD *Thread +); + +NTKERNELAPI +PACCESS_TOKEN +NTAPI +PsReferenceImpersonationToken ( + IN PETHREAD Thread, + OUT PBOOLEAN CopyOnUse, + OUT PBOOLEAN EffectiveOnly, + OUT PSECURITY_IMPERSONATION_LEVEL Level +); + +NTKERNELAPI +HANDLE +NTAPI +PsReferencePrimaryToken ( + IN PEPROCESS Process +); + +NTKERNELAPI +VOID +NTAPI +PsRestoreImpersonation( + IN PETHREAD Thread, + IN PSE_IMPERSONATION_STATE ImpersonationState +); + +NTKERNELAPI +VOID +NTAPI +PsReturnPoolQuota ( + IN PEPROCESS Process, + IN POOL_TYPE PoolType, + IN ULONG Amount +); + +NTKERNELAPI +VOID +NTAPI +PsRevertToSelf ( + VOID +); + +NTSYSAPI +NTSTATUS +NTAPI +RtlAbsoluteToSelfRelativeSD ( + IN PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor, + IN OUT PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor, + IN PULONG BufferLength +); + +NTSYSAPI +PVOID +NTAPI +RtlAllocateHeap ( + IN HANDLE HeapHandle, + IN ULONG Flags, + IN ULONG Size +); + +NTSYSAPI +NTSTATUS +NTAPI +RtlCompressBuffer ( + IN USHORT CompressionFormatAndEngine, + IN PUCHAR UncompressedBuffer, + IN ULONG UncompressedBufferSize, + OUT PUCHAR CompressedBuffer, + IN ULONG CompressedBufferSize, + IN ULONG UncompressedChunkSize, + OUT PULONG FinalCompressedSize, + IN PVOID WorkSpace +); + +NTSYSAPI +NTSTATUS +NTAPI +RtlCompressChunks ( + IN PUCHAR UncompressedBuffer, + IN ULONG UncompressedBufferSize, + OUT PUCHAR CompressedBuffer, + IN ULONG CompressedBufferSize, + IN OUT PCOMPRESSED_DATA_INFO CompressedDataInfo, + IN ULONG CompressedDataInfoLength, + IN PVOID WorkSpace +); + +NTSYSAPI +NTSTATUS +NTAPI +RtlConvertSidToUnicodeString ( + OUT PUNICODE_STRING DestinationString, + IN PSID Sid, + IN BOOLEAN AllocateDestinationString +); + +NTSYSAPI +NTSTATUS +NTAPI +RtlCopySid ( + IN ULONG Length, + IN PSID Destination, + IN PSID Source +); + +NTSYSAPI +BOOLEAN +NTAPI +RtlCreateUnicodeString( + PUNICODE_STRING DestinationString, + PCWSTR SourceString +); + +NTSYSAPI +NTSTATUS +NTAPI +RtlDecompressBuffer ( + IN USHORT CompressionFormat, + OUT PUCHAR UncompressedBuffer, + IN ULONG UncompressedBufferSize, + IN PUCHAR CompressedBuffer, + IN ULONG CompressedBufferSize, + OUT PULONG FinalUncompressedSize +); + +NTSYSAPI +NTSTATUS +NTAPI +RtlDecompressChunks ( + OUT PUCHAR UncompressedBuffer, + IN ULONG UncompressedBufferSize, + IN PUCHAR CompressedBuffer, + IN ULONG CompressedBufferSize, + IN PUCHAR CompressedTail, + IN ULONG CompressedTailSize, + IN PCOMPRESSED_DATA_INFO CompressedDataInfo +); + +NTSYSAPI +NTSTATUS +NTAPI +RtlDecompressFragment ( + IN USHORT CompressionFormat, + OUT PUCHAR UncompressedFragment, + IN ULONG UncompressedFragmentSize, + IN PUCHAR CompressedBuffer, + IN ULONG CompressedBufferSize, + IN ULONG FragmentOffset, + OUT PULONG FinalUncompressedSize, + IN PVOID WorkSpace +); + +NTSYSAPI +NTSTATUS +NTAPI +RtlDescribeChunk ( + IN USHORT CompressionFormat, + IN OUT PUCHAR *CompressedBuffer, + IN PUCHAR EndOfCompressedBufferPlus1, + OUT PUCHAR *ChunkBuffer, + OUT PULONG ChunkSize +); + +NTSYSAPI +NTSTATUS +NTAPI +RtlDowncaseUnicodeString( + IN OUT PUNICODE_STRING UniDest, + IN PCUNICODE_STRING UniSource, + IN BOOLEAN AllocateDestinationString +); + +NTSYSAPI +NTSTATUS +NTAPI +RtlDuplicateUnicodeString( + IN ULONG Flags, + IN PCUNICODE_STRING SourceString, + OUT PUNICODE_STRING DestinationString +); + +NTSYSAPI +BOOLEAN +NTAPI +RtlEqualSid ( + IN PSID Sid1, + IN PSID Sid2 +); + +NTSYSAPI +VOID +NTAPI +RtlFillMemoryUlong ( + IN PVOID Destination, + IN ULONG Length, + IN ULONG Fill +); + +NTSYSAPI +BOOLEAN +NTAPI +RtlFreeHeap ( + IN HANDLE HeapHandle, + IN ULONG Flags, + IN PVOID P +); + +NTSYSAPI +VOID +NTAPI +RtlGenerate8dot3Name ( + IN PUNICODE_STRING Name, + IN BOOLEAN AllowExtendedCharacters, + IN OUT PGENERATE_NAME_CONTEXT Context, + OUT PUNICODE_STRING Name8dot3 +); + +NTSYSAPI +NTSTATUS +NTAPI +RtlGetCompressionWorkSpaceSize ( + IN USHORT CompressionFormatAndEngine, + OUT PULONG CompressBufferWorkSpaceSize, + OUT PULONG CompressFragmentWorkSpaceSize +); + +NTSYSAPI +NTSTATUS +NTAPI +RtlGetDaclSecurityDescriptor ( + IN PSECURITY_DESCRIPTOR SecurityDescriptor, + OUT PBOOLEAN DaclPresent, + OUT PACL *Dacl, + OUT PBOOLEAN DaclDefaulted +); + +NTSYSAPI +NTSTATUS +NTAPI +RtlGetGroupSecurityDescriptor ( + IN PSECURITY_DESCRIPTOR SecurityDescriptor, + OUT PSID *Group, + OUT PBOOLEAN GroupDefaulted +); + +NTSYSAPI +NTSTATUS +NTAPI +RtlGetOwnerSecurityDescriptor ( + IN PSECURITY_DESCRIPTOR SecurityDescriptor, + OUT PSID *Owner, + OUT PBOOLEAN OwnerDefaulted +); + +NTSYSAPI +NTSTATUS +NTAPI +RtlInitializeSid ( + IN OUT PSID Sid, + IN PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, + IN UCHAR SubAuthorityCount +); + +NTSYSAPI +BOOLEAN +NTAPI +RtlIsNameLegalDOS8Dot3( + IN PCUNICODE_STRING Name, + IN OUT POEM_STRING OemName OPTIONAL, + IN OUT PBOOLEAN NameContainsSpaces OPTIONAL +); + +NTSYSAPI +ULONG +NTAPI +RtlLengthRequiredSid ( + IN ULONG SubAuthorityCount +); + +NTSYSAPI +ULONG +NTAPI +RtlLengthSid ( + IN PSID Sid +); + +NTSYSAPI +ULONG +NTAPI +RtlNtStatusToDosError ( + IN NTSTATUS Status +); + +NTSYSAPI +NTSTATUS +NTAPI +RtlReserveChunk ( + IN USHORT CompressionFormat, + IN OUT PUCHAR *CompressedBuffer, + IN PUCHAR EndOfCompressedBufferPlus1, + OUT PUCHAR *ChunkBuffer, + IN ULONG ChunkSize +); + +NTSYSAPI +VOID +NTAPI +RtlSecondsSince1970ToTime ( + IN ULONG SecondsSince1970, + OUT PLARGE_INTEGER Time +); + +NTSYSAPI +NTSTATUS +NTAPI +RtlSetGroupSecurityDescriptor ( + IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor, + IN PSID Group, + IN BOOLEAN GroupDefaulted +); + +NTSYSAPI +NTSTATUS +NTAPI +RtlSetOwnerSecurityDescriptor ( + IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor, + IN PSID Owner, + IN BOOLEAN OwnerDefaulted +); + +NTSYSAPI +NTSTATUS +NTAPI +RtlSetSaclSecurityDescriptor ( + IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor, + IN BOOLEAN SaclPresent, + IN PACL Sacl, + IN BOOLEAN SaclDefaulted +); + +NTSYSAPI +PUCHAR +NTAPI +RtlSubAuthorityCountSid ( + IN PSID Sid +); + +NTSYSAPI +PULONG +NTAPI +RtlSubAuthoritySid ( + IN PSID Sid, + IN ULONG SubAuthority +); + +/* RTL Splay Tree Functions */ +NTSYSAPI +PRTL_SPLAY_LINKS +NTAPI +RtlSplay(PRTL_SPLAY_LINKS Links); + +NTSYSAPI +PRTL_SPLAY_LINKS +NTAPI +RtlDelete(PRTL_SPLAY_LINKS Links); + +NTSYSAPI +VOID +NTAPI +RtlDeleteNoSplay( + PRTL_SPLAY_LINKS Links, + PRTL_SPLAY_LINKS *Root +); + +NTSYSAPI +PRTL_SPLAY_LINKS +NTAPI +RtlSubtreeSuccessor(PRTL_SPLAY_LINKS Links); + +NTSYSAPI +PRTL_SPLAY_LINKS +NTAPI +RtlSubtreePredecessor(PRTL_SPLAY_LINKS Links); + +NTSYSAPI +PRTL_SPLAY_LINKS +NTAPI +RtlRealSuccessor(PRTL_SPLAY_LINKS Links); + +NTSYSAPI +PRTL_SPLAY_LINKS +NTAPI +RtlRealPredecessor(PRTL_SPLAY_LINKS Links); + +#define RtlIsLeftChild(Links) \ + (RtlLeftChild(RtlParent(Links)) == (PRTL_SPLAY_LINKS)(Links)) + +#define RtlIsRightChild(Links) \ + (RtlRightChild(RtlParent(Links)) == (PRTL_SPLAY_LINKS)(Links)) + +#define RtlRightChild(Links) \ + ((PRTL_SPLAY_LINKS)(Links))->RightChild + +#define RtlIsRoot(Links) \ + (RtlParent(Links) == (PRTL_SPLAY_LINKS)(Links)) + +#define RtlLeftChild(Links) \ + ((PRTL_SPLAY_LINKS)(Links))->LeftChild + +#define RtlParent(Links) \ + ((PRTL_SPLAY_LINKS)(Links))->Parent + +#define RtlInitializeSplayLinks(Links) \ + { \ + PRTL_SPLAY_LINKS _SplayLinks; \ + _SplayLinks = (PRTL_SPLAY_LINKS)(Links); \ + _SplayLinks->Parent = _SplayLinks; \ + _SplayLinks->LeftChild = NULL; \ + _SplayLinks->RightChild = NULL; \ + } + +#define RtlInsertAsLeftChild(ParentLinks,ChildLinks) \ + { \ + PRTL_SPLAY_LINKS _SplayParent; \ + PRTL_SPLAY_LINKS _SplayChild; \ + _SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \ + _SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \ + _SplayParent->LeftChild = _SplayChild; \ + _SplayChild->Parent = _SplayParent; \ + } + +#define RtlInsertAsRightChild(ParentLinks,ChildLinks) \ + { \ + PRTL_SPLAY_LINKS _SplayParent; \ + PRTL_SPLAY_LINKS _SplayChild; \ + _SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \ + _SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \ + _SplayParent->RightChild = _SplayChild; \ + _SplayChild->Parent = _SplayParent; \ + } + +NTSYSAPI +BOOLEAN +NTAPI +RtlValidSid ( + IN PSID Sid +); + +NTKERNELAPI +NTSTATUS +NTAPI +SeAppendPrivileges ( + PACCESS_STATE AccessState, + PPRIVILEGE_SET Privileges +); + +NTKERNELAPI +BOOLEAN +NTAPI +SeAuditingFileEvents ( + IN BOOLEAN AccessGranted, + IN PSECURITY_DESCRIPTOR SecurityDescriptor +); + +NTKERNELAPI +BOOLEAN +NTAPI +SeAuditingFileOrGlobalEvents ( + IN BOOLEAN AccessGranted, + IN PSECURITY_DESCRIPTOR SecurityDescriptor, + IN PSECURITY_SUBJECT_CONTEXT SubjectContext +); + +NTKERNELAPI +VOID +NTAPI +SeCaptureSubjectContext ( + OUT PSECURITY_SUBJECT_CONTEXT SubjectContext +); + +NTKERNELAPI +NTSTATUS +NTAPI +SeCreateClientSecurity ( + IN PETHREAD Thread, + IN PSECURITY_QUALITY_OF_SERVICE QualityOfService, + IN BOOLEAN RemoteClient, + OUT PSECURITY_CLIENT_CONTEXT ClientContext +); + +#if (VER_PRODUCTBUILD >= 2195) + +NTKERNELAPI +NTSTATUS +NTAPI +SeCreateClientSecurityFromSubjectContext ( + IN PSECURITY_SUBJECT_CONTEXT SubjectContext, + IN PSECURITY_QUALITY_OF_SERVICE QualityOfService, + IN BOOLEAN ServerIsRemote, + OUT PSECURITY_CLIENT_CONTEXT ClientContext +); + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +#define SeDeleteClientSecurity(C) { \ + if (SeTokenType((C)->ClientToken) == TokenPrimary) { \ + PsDereferencePrimaryToken( (C)->ClientToken ); \ + } else { \ + PsDereferenceImpersonationToken( (C)->ClientToken ); \ + } \ +} + +NTKERNELAPI +VOID +NTAPI +SeDeleteObjectAuditAlarm ( + IN PVOID Object, + IN HANDLE Handle +); + +#define SeEnableAccessToExports() SeExports = *(PSE_EXPORTS *)SeExports; + +NTKERNELAPI +VOID +NTAPI +SeFreePrivileges ( + IN PPRIVILEGE_SET Privileges +); + +NTKERNELAPI +VOID +NTAPI +SeImpersonateClient ( + IN PSECURITY_CLIENT_CONTEXT ClientContext, + IN PETHREAD ServerThread OPTIONAL +); + +#if (VER_PRODUCTBUILD >= 2195) + +NTKERNELAPI +NTSTATUS +NTAPI +SeImpersonateClientEx ( + IN PSECURITY_CLIENT_CONTEXT ClientContext, + IN PETHREAD ServerThread OPTIONAL +); + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +NTKERNELAPI +VOID +NTAPI +SeLockSubjectContext ( + IN PSECURITY_SUBJECT_CONTEXT SubjectContext +); + +NTKERNELAPI +NTSTATUS +NTAPI +SeMarkLogonSessionForTerminationNotification ( + IN PLUID LogonId +); + +NTKERNELAPI +VOID +NTAPI +SeOpenObjectAuditAlarm ( + IN PUNICODE_STRING ObjectTypeName, + IN PVOID Object OPTIONAL, + IN PUNICODE_STRING AbsoluteObjectName OPTIONAL, + IN PSECURITY_DESCRIPTOR SecurityDescriptor, + IN PACCESS_STATE AccessState, + IN BOOLEAN ObjectCreated, + IN BOOLEAN AccessGranted, + IN KPROCESSOR_MODE AccessMode, + OUT PBOOLEAN GenerateOnClose +); + +NTKERNELAPI +VOID +NTAPI +SeOpenObjectForDeleteAuditAlarm ( + IN PUNICODE_STRING ObjectTypeName, + IN PVOID Object OPTIONAL, + IN PUNICODE_STRING AbsoluteObjectName OPTIONAL, + IN PSECURITY_DESCRIPTOR SecurityDescriptor, + IN PACCESS_STATE AccessState, + IN BOOLEAN ObjectCreated, + IN BOOLEAN AccessGranted, + IN KPROCESSOR_MODE AccessMode, + OUT PBOOLEAN GenerateOnClose +); + +NTKERNELAPI +BOOLEAN +NTAPI +SePrivilegeCheck ( + IN OUT PPRIVILEGE_SET RequiredPrivileges, + IN PSECURITY_SUBJECT_CONTEXT SubjectContext, + IN KPROCESSOR_MODE AccessMode +); + +NTKERNELAPI +NTSTATUS +NTAPI +SeQueryAuthenticationIdToken ( + IN PACCESS_TOKEN Token, + OUT PLUID LogonId +); + +#if (VER_PRODUCTBUILD >= 2195) + +NTKERNELAPI +NTSTATUS +NTAPI +SeQueryInformationToken ( + IN PACCESS_TOKEN Token, + IN TOKEN_INFORMATION_CLASS TokenInformationClass, + OUT PVOID *TokenInformation +); + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +NTKERNELAPI +NTSTATUS +NTAPI +SeQuerySecurityDescriptorInfo ( + IN PSECURITY_INFORMATION SecurityInformation, + OUT PSECURITY_DESCRIPTOR SecurityDescriptor, + IN OUT PULONG Length, + IN PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor +); + +#if (VER_PRODUCTBUILD >= 2195) + +NTKERNELAPI +NTSTATUS +NTAPI +SeQuerySessionIdToken ( + IN PACCESS_TOKEN Token, + IN PULONG SessionId +); + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +#define SeQuerySubjectContextToken( SubjectContext ) \ + ( ARGUMENT_PRESENT( \ + ((PSECURITY_SUBJECT_CONTEXT) SubjectContext)->ClientToken \ + ) ? \ + ((PSECURITY_SUBJECT_CONTEXT) SubjectContext)->ClientToken : \ + ((PSECURITY_SUBJECT_CONTEXT) SubjectContext)->PrimaryToken ) + +typedef NTSTATUS (*PSE_LOGON_SESSION_TERMINATED_ROUTINE) ( + IN PLUID LogonId +); + +NTKERNELAPI +NTSTATUS +NTAPI +SeRegisterLogonSessionTerminatedRoutine ( + IN PSE_LOGON_SESSION_TERMINATED_ROUTINE CallbackRoutine +); + +NTKERNELAPI +VOID +NTAPI +SeReleaseSubjectContext ( + IN PSECURITY_SUBJECT_CONTEXT SubjectContext +); + +NTKERNELAPI +VOID +NTAPI +SeSetAccessStateGenericMapping ( + PACCESS_STATE AccessState, + PGENERIC_MAPPING GenericMapping +); + +NTKERNELAPI +NTSTATUS +NTAPI +SeSetSecurityDescriptorInfo ( + IN PVOID Object OPTIONAL, + IN PSECURITY_INFORMATION SecurityInformation, + IN PSECURITY_DESCRIPTOR SecurityDescriptor, + IN OUT PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor, + IN POOL_TYPE PoolType, + IN PGENERIC_MAPPING GenericMapping +); + +#if (VER_PRODUCTBUILD >= 2195) + +NTKERNELAPI +NTSTATUS +NTAPI +SeSetSecurityDescriptorInfoEx ( + IN PVOID Object OPTIONAL, + IN PSECURITY_INFORMATION SecurityInformation, + IN PSECURITY_DESCRIPTOR ModificationDescriptor, + IN OUT PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor, + IN ULONG AutoInheritFlags, + IN POOL_TYPE PoolType, + IN PGENERIC_MAPPING GenericMapping +); + +NTKERNELAPI +BOOLEAN +NTAPI +SeTokenIsAdmin ( + IN PACCESS_TOKEN Token +); + +NTKERNELAPI +BOOLEAN +NTAPI +SeTokenIsRestricted ( + IN PACCESS_TOKEN Token +); + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +NTKERNELAPI +TOKEN_TYPE +NTAPI +SeTokenType ( + IN PACCESS_TOKEN Token +); + +NTKERNELAPI +VOID +NTAPI +SeUnlockSubjectContext ( + IN PSECURITY_SUBJECT_CONTEXT SubjectContext +); + +NTKERNELAPI +NTSTATUS +NTAPI +SeUnregisterLogonSessionTerminatedRoutine ( + IN PSE_LOGON_SESSION_TERMINATED_ROUTINE CallbackRoutine +); + +#if (VER_PRODUCTBUILD >= 2195) + +NTSYSAPI +NTSTATUS +NTAPI +ZwAdjustPrivilegesToken ( + IN HANDLE TokenHandle, + IN BOOLEAN DisableAllPrivileges, + IN PTOKEN_PRIVILEGES NewState, + IN ULONG BufferLength, + OUT PTOKEN_PRIVILEGES PreviousState OPTIONAL, + OUT PULONG ReturnLength +); + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +NTSYSAPI +NTSTATUS +NTAPI +ZwAlertThread ( + IN HANDLE ThreadHandle +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwAllocateVirtualMemory ( + IN HANDLE ProcessHandle, + IN OUT PVOID *BaseAddress, + IN ULONG ZeroBits, + IN OUT PULONG RegionSize, + IN ULONG AllocationType, + IN ULONG Protect +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwAccessCheckAndAuditAlarm ( + IN PUNICODE_STRING SubsystemName, + IN PVOID HandleId, + IN PUNICODE_STRING ObjectTypeName, + IN PUNICODE_STRING ObjectName, + IN PSECURITY_DESCRIPTOR SecurityDescriptor, + IN ACCESS_MASK DesiredAccess, + IN PGENERIC_MAPPING GenericMapping, + IN BOOLEAN ObjectCreation, + OUT PACCESS_MASK GrantedAccess, + OUT PBOOLEAN AccessStatus, + OUT PBOOLEAN GenerateOnClose +); + +#if (VER_PRODUCTBUILD >= 2195) + +NTSYSAPI +NTSTATUS +NTAPI +ZwCancelIoFile ( + IN HANDLE FileHandle, + OUT PIO_STATUS_BLOCK IoStatusBlock +); + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +NTSYSAPI +NTSTATUS +NTAPI +ZwClearEvent ( + IN HANDLE EventHandle +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwCloseObjectAuditAlarm ( + IN PUNICODE_STRING SubsystemName, + IN PVOID HandleId, + IN BOOLEAN GenerateOnClose +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwCreateSection ( + OUT PHANDLE SectionHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, + IN PLARGE_INTEGER MaximumSize OPTIONAL, + IN ULONG SectionPageProtection, + IN ULONG AllocationAttributes, + IN HANDLE FileHandle OPTIONAL +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwCreateSymbolicLinkObject ( + OUT PHANDLE SymbolicLinkHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes, + IN PUNICODE_STRING TargetName +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwDeleteFile ( + IN POBJECT_ATTRIBUTES ObjectAttributes +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwDeleteValueKey ( + IN HANDLE Handle, + IN PUNICODE_STRING Name +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwDeviceIoControlFile ( + IN HANDLE FileHandle, + IN HANDLE Event OPTIONAL, + IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, + IN PVOID ApcContext OPTIONAL, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN ULONG IoControlCode, + IN PVOID InputBuffer OPTIONAL, + IN ULONG InputBufferLength, + OUT PVOID OutputBuffer OPTIONAL, + IN ULONG OutputBufferLength +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwDisplayString ( + IN PUNICODE_STRING String +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwDuplicateObject ( + IN HANDLE SourceProcessHandle, + IN HANDLE SourceHandle, + IN HANDLE TargetProcessHandle OPTIONAL, + OUT PHANDLE TargetHandle OPTIONAL, + IN ACCESS_MASK DesiredAccess, + IN ULONG HandleAttributes, + IN ULONG Options +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwDuplicateToken ( + IN HANDLE ExistingTokenHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes, + IN BOOLEAN EffectiveOnly, + IN TOKEN_TYPE TokenType, + OUT PHANDLE NewTokenHandle +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwFlushInstructionCache ( + IN HANDLE ProcessHandle, + IN PVOID BaseAddress OPTIONAL, + IN ULONG FlushSize +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwFlushBuffersFile( + IN HANDLE FileHandle, + OUT PIO_STATUS_BLOCK IoStatusBlock +); + +#if (VER_PRODUCTBUILD >= 2195) + +NTSYSAPI +NTSTATUS +NTAPI +ZwFlushVirtualMemory ( + IN HANDLE ProcessHandle, + IN OUT PVOID *BaseAddress, + IN OUT PULONG FlushSize, + OUT PIO_STATUS_BLOCK IoStatusBlock +); + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +NTSYSAPI +NTSTATUS +NTAPI +ZwFreeVirtualMemory ( + IN HANDLE ProcessHandle, + IN OUT PVOID *BaseAddress, + IN OUT PULONG RegionSize, + IN ULONG FreeType +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwFsControlFile ( + IN HANDLE FileHandle, + IN HANDLE Event OPTIONAL, + IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, + IN PVOID ApcContext OPTIONAL, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN ULONG FsControlCode, + IN PVOID InputBuffer OPTIONAL, + IN ULONG InputBufferLength, + OUT PVOID OutputBuffer OPTIONAL, + IN ULONG OutputBufferLength +); + +#if (VER_PRODUCTBUILD >= 2195) + +NTSYSAPI +NTSTATUS +NTAPI +ZwInitiatePowerAction ( + IN POWER_ACTION SystemAction, + IN SYSTEM_POWER_STATE MinSystemState, + IN ULONG Flags, + IN BOOLEAN Asynchronous +); + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +NTSYSAPI +NTSTATUS +NTAPI +ZwLoadDriver ( + /* "\\Registry\\Machine\\System\\CurrentControlSet\\Services\\" */ + IN PUNICODE_STRING RegistryPath +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwLoadKey ( + IN POBJECT_ATTRIBUTES KeyObjectAttributes, + IN POBJECT_ATTRIBUTES FileObjectAttributes +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwNotifyChangeKey ( + IN HANDLE KeyHandle, + IN HANDLE EventHandle OPTIONAL, + IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, + IN PVOID ApcContext OPTIONAL, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN ULONG NotifyFilter, + IN BOOLEAN WatchSubtree, + IN PVOID Buffer, + IN ULONG BufferLength, + IN BOOLEAN Asynchronous +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwOpenDirectoryObject ( + OUT PHANDLE DirectoryHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwOpenEvent ( + OUT PHANDLE EventHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwOpenProcess ( + OUT PHANDLE ProcessHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes, + IN PCLIENT_ID ClientId OPTIONAL +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwOpenProcessToken ( + IN HANDLE ProcessHandle, + IN ACCESS_MASK DesiredAccess, + OUT PHANDLE TokenHandle +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwOpenThread ( + OUT PHANDLE ThreadHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes, + IN PCLIENT_ID ClientId +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwOpenThreadToken ( + IN HANDLE ThreadHandle, + IN ACCESS_MASK DesiredAccess, + IN BOOLEAN OpenAsSelf, + OUT PHANDLE TokenHandle +); + +#if (VER_PRODUCTBUILD >= 2195) + +NTSYSAPI +NTSTATUS +NTAPI +ZwPowerInformation ( + IN POWER_INFORMATION_LEVEL PowerInformationLevel, + IN PVOID InputBuffer OPTIONAL, + IN ULONG InputBufferLength, + OUT PVOID OutputBuffer OPTIONAL, + IN ULONG OutputBufferLength +); + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +NTSYSAPI +NTSTATUS +NTAPI +ZwPulseEvent ( + IN HANDLE EventHandle, + OUT PLONG PreviousState OPTIONAL +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwQueryDefaultLocale ( + IN BOOLEAN ThreadOrSystem, + OUT PLCID Locale +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwQueryDirectoryFile ( + IN HANDLE FileHandle, + IN HANDLE Event OPTIONAL, + IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, + IN PVOID ApcContext OPTIONAL, + OUT PIO_STATUS_BLOCK IoStatusBlock, + OUT PVOID FileInformation, + IN ULONG Length, + IN FILE_INFORMATION_CLASS FileInformationClass, + IN BOOLEAN ReturnSingleEntry, + IN PUNICODE_STRING FileName OPTIONAL, + IN BOOLEAN RestartScan +); + +#if (VER_PRODUCTBUILD >= 2195) + +NTSYSAPI +NTSTATUS +NTAPI +ZwQueryDirectoryObject ( + IN HANDLE DirectoryHandle, + OUT PVOID Buffer, + IN ULONG Length, + IN BOOLEAN ReturnSingleEntry, + IN BOOLEAN RestartScan, + IN OUT PULONG Context, + OUT PULONG ReturnLength OPTIONAL +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwQueryEaFile ( + IN HANDLE FileHandle, + OUT PIO_STATUS_BLOCK IoStatusBlock, + OUT PVOID Buffer, + IN ULONG Length, + IN BOOLEAN ReturnSingleEntry, + IN PVOID EaList OPTIONAL, + IN ULONG EaListLength, + IN PULONG EaIndex OPTIONAL, + IN BOOLEAN RestartScan +); + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +NTSYSAPI +NTSTATUS +NTAPI +ZwQueryInformationProcess ( + IN HANDLE ProcessHandle, + IN PROCESSINFOCLASS ProcessInformationClass, + OUT PVOID ProcessInformation, + IN ULONG ProcessInformationLength, + OUT PULONG ReturnLength OPTIONAL +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwQueryInformationToken ( + IN HANDLE TokenHandle, + IN TOKEN_INFORMATION_CLASS TokenInformationClass, + OUT PVOID TokenInformation, + IN ULONG Length, + OUT PULONG ResultLength +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwQuerySecurityObject ( + IN HANDLE FileHandle, + IN SECURITY_INFORMATION SecurityInformation, + OUT PSECURITY_DESCRIPTOR SecurityDescriptor, + IN ULONG Length, + OUT PULONG ResultLength +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwQueryVolumeInformationFile ( + IN HANDLE FileHandle, + OUT PIO_STATUS_BLOCK IoStatusBlock, + OUT PVOID FsInformation, + IN ULONG Length, + IN FS_INFORMATION_CLASS FsInformationClass +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwReplaceKey ( + IN POBJECT_ATTRIBUTES NewFileObjectAttributes, + IN HANDLE KeyHandle, + IN POBJECT_ATTRIBUTES OldFileObjectAttributes +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwResetEvent ( + IN HANDLE EventHandle, + OUT PLONG PreviousState OPTIONAL +); + +#if (VER_PRODUCTBUILD >= 2195) + +NTSYSAPI +NTSTATUS +NTAPI +ZwRestoreKey ( + IN HANDLE KeyHandle, + IN HANDLE FileHandle, + IN ULONG Flags +); + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +NTSYSAPI +NTSTATUS +NTAPI +ZwSaveKey ( + IN HANDLE KeyHandle, + IN HANDLE FileHandle +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwSetDefaultLocale ( + IN BOOLEAN ThreadOrSystem, + IN LCID Locale +); + +#if (VER_PRODUCTBUILD >= 2195) + +NTSYSAPI +NTSTATUS +NTAPI +ZwSetDefaultUILanguage ( + IN LANGID LanguageId +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwSetEaFile ( + IN HANDLE FileHandle, + OUT PIO_STATUS_BLOCK IoStatusBlock, + OUT PVOID Buffer, + IN ULONG Length +); + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +NTSYSAPI +NTSTATUS +NTAPI +ZwSetEvent ( + IN HANDLE EventHandle, + OUT PLONG PreviousState OPTIONAL +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwSetInformationProcess ( + IN HANDLE ProcessHandle, + IN PROCESSINFOCLASS ProcessInformationClass, + IN PVOID ProcessInformation, + IN ULONG ProcessInformationLength +); + +#if (VER_PRODUCTBUILD >= 2195) + +NTSYSAPI +NTSTATUS +NTAPI +ZwSetSecurityObject ( + IN HANDLE Handle, + IN SECURITY_INFORMATION SecurityInformation, + IN PSECURITY_DESCRIPTOR SecurityDescriptor +); + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +NTSYSAPI +NTSTATUS +NTAPI +ZwSetSystemTime ( + IN PLARGE_INTEGER NewTime, + OUT PLARGE_INTEGER OldTime OPTIONAL +); + +#if (VER_PRODUCTBUILD >= 2195) + +NTSYSAPI +NTSTATUS +NTAPI +ZwSetVolumeInformationFile ( + IN HANDLE FileHandle, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN PVOID FsInformation, + IN ULONG Length, + IN FS_INFORMATION_CLASS FsInformationClass +); + +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +NTSYSAPI +NTSTATUS +NTAPI +ZwTerminateProcess ( + IN HANDLE ProcessHandle OPTIONAL, + IN NTSTATUS ExitStatus +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwUnloadDriver ( + /* "\\Registry\\Machine\\System\\CurrentControlSet\\Services\\" */ + IN PUNICODE_STRING RegistryPath +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwUnloadKey ( + IN POBJECT_ATTRIBUTES KeyObjectAttributes +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwWaitForSingleObject ( + IN HANDLE Handle, + IN BOOLEAN Alertable, + IN PLARGE_INTEGER Timeout OPTIONAL +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwWaitForMultipleObjects ( + IN ULONG HandleCount, + IN PHANDLE Handles, + IN WAIT_TYPE WaitType, + IN BOOLEAN Alertable, + IN PLARGE_INTEGER Timeout OPTIONAL +); + +NTSYSAPI +NTSTATUS +NTAPI +ZwYieldExecution ( + VOID +); + +#pragma pack(pop) + +#ifdef __cplusplus +} +#endif + +#endif /* _NTIFS_ */ diff --git a/reactos/include/ddk/ntnls.h b/reactos/include/ddk/ntnls.h new file mode 100644 index 00000000000..1c325db68c9 --- /dev/null +++ b/reactos/include/ddk/ntnls.h @@ -0,0 +1,52 @@ +/* + * ntnls.h + * + * Structures and definitions for NLS data types. + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Alex Ionescu + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __NTNLS_H +#define __NTNLS_H + +#define MAXIMUM_LEADBYTES 12 + +typedef struct _CPTABLEINFO +{ + USHORT CodePage; + USHORT MaximumCharacterSize; + USHORT DefaultChar; + USHORT UniDefaultChar; + USHORT TransDefaultChar; + USHORT TransUniDefaultChar; + USHORT DBCSCodePage; + UCHAR LeadByte[MAXIMUM_LEADBYTES]; + PUSHORT MultiByteTable; + PVOID WideCharTable; + PUSHORT DBCSRanges; + PUSHORT DBCSOffsets; +} CPTABLEINFO, *PCPTABLEINFO; + +typedef struct _NLSTABLEINFO +{ + CPTABLEINFO OemTableInfo; + CPTABLEINFO AnsiTableInfo; + PUSHORT UpperCaseTable; + PUSHORT LowerCaseTable; +} NLSTABLEINFO, *PNLSTABLEINFO; + +#endif /* __NTNLS_H */ diff --git a/reactos/include/ddk/ntpoapi.h b/reactos/include/ddk/ntpoapi.h new file mode 100644 index 00000000000..3dacf56cb96 --- /dev/null +++ b/reactos/include/ddk/ntpoapi.h @@ -0,0 +1,227 @@ +/* + * ntpoapi.h + * + * APIs for power management. + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __NTPOAPI_H +#define __NTPOAPI_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include "batclass.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define POWER_PERF_SCALE 100 +#define PERF_LEVEL_TO_PERCENT(x) (((x) * 1000) / (POWER_PERF_SCALE * 10)) +#define PERCENT_TO_PERF_LEVEL(x) (((x) * POWER_PERF_SCALE * 10) / 1000) + +typedef struct _PROCESSOR_IDLE_TIMES { + ULONGLONG StartTime; + ULONGLONG EndTime; + ULONG IdleHandlerReserved[4]; +} PROCESSOR_IDLE_TIMES, *PPROCESSOR_IDLE_TIMES; + +typedef BOOLEAN +(DDKFASTAPI*PPROCESSOR_IDLE_HANDLER)( + IN OUT PPROCESSOR_IDLE_TIMES IdleTimes); + +typedef struct _PROCESSOR_IDLE_HANDLER_INFO { + ULONG HardwareLatency; + PPROCESSOR_IDLE_HANDLER Handler; +} PROCESSOR_IDLE_HANDLER_INFO, *PPROCESSOR_IDLE_HANDLER_INFO; + +typedef VOID +(DDKFASTAPI*PSET_PROCESSOR_THROTTLE)( + IN UCHAR Throttle); + +typedef NTSTATUS +(DDKFASTAPI*PSET_PROCESSOR_THROTTLE2)( + IN UCHAR Throttle); + +#define MAX_IDLE_HANDLERS 3 + +typedef struct _PROCESSOR_STATE_HANDLER { + UCHAR ThrottleScale; + BOOLEAN ThrottleOnIdle; + PSET_PROCESSOR_THROTTLE SetThrottle; + ULONG NumIdleHandlers; + PROCESSOR_IDLE_HANDLER_INFO IdleHandler[MAX_IDLE_HANDLERS]; +} PROCESSOR_STATE_HANDLER, *PPROCESSOR_STATE_HANDLER; + +typedef enum _POWER_STATE_HANDLER_TYPE { + PowerStateSleeping1, + PowerStateSleeping2, + PowerStateSleeping3, + PowerStateSleeping4, + PowerStateSleeping4Firmware, + PowerStateShutdownReset, + PowerStateShutdownOff, + PowerStateMaximum +} POWER_STATE_HANDLER_TYPE, *PPOWER_STATE_HANDLER_TYPE; + +typedef NTSTATUS +(DDKAPI*PENTER_STATE_SYSTEM_HANDLER)( + IN PVOID SystemContext); + +typedef NTSTATUS +(DDKAPI*PENTER_STATE_HANDLER)( + IN PVOID Context, + IN PENTER_STATE_SYSTEM_HANDLER SystemHandler OPTIONAL, + IN PVOID SystemContext, + IN LONG NumberProcessors, + IN VOLATILE PLONG Number); + +typedef struct _POWER_STATE_HANDLER { + POWER_STATE_HANDLER_TYPE Type; + BOOLEAN RtcWake; + UCHAR Spare[3]; + PENTER_STATE_HANDLER Handler; + PVOID Context; +} POWER_STATE_HANDLER, *PPOWER_STATE_HANDLER; + +typedef NTSTATUS +(STDCALL*PENTER_STATE_NOTIFY_HANDLER)( + IN POWER_STATE_HANDLER_TYPE State, + IN PVOID Context, + IN BOOLEAN Entering); + +typedef struct _POWER_STATE_NOTIFY_HANDLER { + PENTER_STATE_NOTIFY_HANDLER Handler; + PVOID Context; +} POWER_STATE_NOTIFY_HANDLER, *PPOWER_STATE_NOTIFY_HANDLER; + +NTOSAPI +NTSTATUS +DDKAPI +NtPowerInformation( + IN POWER_INFORMATION_LEVEL InformationLevel, + IN PVOID InputBuffer OPTIONAL, + IN ULONG InputBufferLength, + OUT PVOID OutputBuffer OPTIONAL, + IN ULONG OutputBufferLength); + +#define PROCESSOR_STATE_TYPE_PERFORMANCE 1 +#define PROCESSOR_STATE_TYPE_THROTTLE 2 + +typedef struct _PROCESSOR_PERF_LEVEL { + UCHAR PercentFrequency; + UCHAR Reserved; + USHORT Flags; +} PROCESSOR_PERF_LEVEL, *PPROCESSOR_PERF_LEVEL; + +typedef struct _PROCESSOR_PERF_STATE { + UCHAR PercentFrequency; + UCHAR MinCapacity; + USHORT Power; + UCHAR IncreaseLevel; + UCHAR DecreaseLevel; + USHORT Flags; + ULONG IncreaseTime; + ULONG DecreaseTime; + ULONG IncreaseCount; + ULONG DecreaseCount; + ULONGLONG PerformanceTime; +} PROCESSOR_PERF_STATE, *PPROCESSOR_PERF_STATE; + +typedef struct _PROCESSOR_STATE_HANDLER2 { + ULONG NumIdleHandlers; + PROCESSOR_IDLE_HANDLER_INFO IdleHandler[MAX_IDLE_HANDLERS]; + PSET_PROCESSOR_THROTTLE2 SetPerfLevel; + ULONG HardwareLatency; + UCHAR NumPerfStates; + PROCESSOR_PERF_LEVEL PerfLevel[1]; +} PROCESSOR_STATE_HANDLER2, *PPROCESSOR_STATE_HANDLER2; + +NTOSAPI +NTSTATUS +DDKAPI +NtSetThreadExecutionState( + IN EXECUTION_STATE esFlags, + OUT EXECUTION_STATE *PreviousFlags); + +NTOSAPI +NTSTATUS +DDKAPI +NtRequestWakeupLatency( + IN LATENCY_TIME latency); + +NTOSAPI +NTSTATUS +DDKAPI +NtInitiatePowerAction( + IN POWER_ACTION SystemAction, + IN SYSTEM_POWER_STATE MinSystemState, + IN ULONG Flags, + IN BOOLEAN Asynchronous); + +NTOSAPI +NTSTATUS +DDKAPI +NtSetSystemPowerState( + IN POWER_ACTION SystemAction, + IN SYSTEM_POWER_STATE MinSystemState, + IN ULONG Flags); + +NTOSAPI +NTSTATUS +DDKAPI +NtGetDevicePowerState( + IN HANDLE Device, + OUT DEVICE_POWER_STATE *State); + +NTOSAPI +NTSTATUS +DDKAPI +NtCancelDeviceWakeupRequest( + IN HANDLE Device); + +NTOSAPI +BOOLEAN +DDKAPI +NtIsSystemResumeAutomatic( + VOID); + +NTOSAPI +NTSTATUS +DDKAPI +NtRequestDeviceWakeup( + IN HANDLE Device); + +#define WINLOGON_LOCK_ON_SLEEP 0x00000001 + +typedef struct _PROCESSOR_POWER_INFORMATION { + ULONG Number; + ULONG MaxMhz; + ULONG CurrentMhz; + ULONG MhzLimit; + ULONG MaxIdleState; + ULONG CurrentIdleState; +} PROCESSOR_POWER_INFORMATION, *PPROCESSOR_POWER_INFORMATION; + +#ifdef __cplusplus +} +#endif + +#endif /* __NTPOAPI_H */ diff --git a/reactos/include/ddk/ntstatus.h b/reactos/include/ddk/ntstatus.h new file mode 100644 index 00000000000..61b04fbd858 --- /dev/null +++ b/reactos/include/ddk/ntstatus.h @@ -0,0 +1,1105 @@ +/* + * ntstatus.h + * + * Windows NT status codes + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef _NTSTATUS_H +#define _NTSTATUS_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(STATUS_SUCCESS) +#define STATUS_SUCCESS ((NTSTATUS)0x00000000L) +#endif /* !STATUS_SUCCESS */ +#define FACILITY_DEBUGGER 0x1 +#define FACILITY_RPC_RUNTIME 0x2 +#define FACILITY_RPC_STUBS 0x3 +#define FACILITY_IO_ERROR_CODE 0x4 +#define FACILITY_TERMINAL_SERVER 0xA +#define FACILITY_USB_ERROR_CODE 0x10 +#define FACILITY_HID_ERROR_CODE 0x11 +#define FACILITY_FIREWIRE_ERROR_CODE 0x12 +#define FACILITY_CLUSTER_ERROR_CODE 0x13 +#define FACILITY_ACPI_ERROR_CODE 0x14 +#define FACILITY_SXS_ERROR_CODE 0x15 +#define STATUS_SEVERITY_SUCCESS 0x0 +#define STATUS_SEVERITY_INFORMATIONAL 0x1 +#define STATUS_SEVERITY_WARNING 0x2 +#define STATUS_SEVERITY_ERROR 0x3 +#define STATUS_WAIT_0 ((NTSTATUS)0x00000000L) +#define STATUS_WAIT_1 ((NTSTATUS)0x00000001L) +#define STATUS_WAIT_2 ((NTSTATUS)0x00000002L) +#define STATUS_WAIT_3 ((NTSTATUS)0x00000003L) +#define STATUS_WAIT_63 ((NTSTATUS)0x0000003FL) +#define STATUS_ABANDONED ((NTSTATUS)0x00000080L) +#define STATUS_ABANDONED_WAIT_0 ((NTSTATUS)0x00000080L) +#define STATUS_ABANDONED_WAIT_63 ((NTSTATUS)0x000000BFL) +#define STATUS_USER_APC ((NTSTATUS)0x000000C0L) +#define STATUS_KERNEL_APC ((NTSTATUS)0x00000100L) +#define STATUS_ALERTED ((NTSTATUS)0x00000101L) +#define STATUS_TIMEOUT ((NTSTATUS)0x00000102L) +#define STATUS_PENDING ((NTSTATUS)0x00000103L) +#define STATUS_REPARSE ((NTSTATUS)0x00000104L) +#define STATUS_MORE_ENTRIES ((NTSTATUS)0x00000105L) +#define STATUS_NOT_ALL_ASSIGNED ((NTSTATUS)0x00000106L) +#define STATUS_SOME_NOT_MAPPED ((NTSTATUS)0x00000107L) +#define STATUS_OPLOCK_BREAK_IN_PROGRESS ((NTSTATUS)0x00000108L) +#define STATUS_VOLUME_MOUNTED ((NTSTATUS)0x00000109L) +#define STATUS_RXACT_COMMITTED ((NTSTATUS)0x0000010AL) +#define STATUS_NOTIFY_CLEANUP ((NTSTATUS)0x0000010BL) +#define STATUS_NOTIFY_ENUM_DIR ((NTSTATUS)0x0000010CL) +#define STATUS_NO_QUOTAS_FOR_ACCOUNT ((NTSTATUS)0x0000010DL) +#define STATUS_PRIMARY_TRANSPORT_CONNECT_FAILED ((NTSTATUS)0x0000010EL) +#define STATUS_PAGE_FAULT_TRANSITION ((NTSTATUS)0x00000110L) +#define STATUS_PAGE_FAULT_DEMAND_ZERO ((NTSTATUS)0x00000111L) +#define STATUS_PAGE_FAULT_COPY_ON_WRITE ((NTSTATUS)0x00000112L) +#define STATUS_PAGE_FAULT_GUARD_PAGE ((NTSTATUS)0x00000113L) +#define STATUS_PAGE_FAULT_PAGING_FILE ((NTSTATUS)0x00000114L) +#define STATUS_CACHE_PAGE_LOCKED ((NTSTATUS)0x00000115L) +#define STATUS_CRASH_DUMP ((NTSTATUS)0x00000116L) +#define STATUS_BUFFER_ALL_ZEROS ((NTSTATUS)0x00000117L) +#define STATUS_REPARSE_OBJECT ((NTSTATUS)0x00000118L) +#define STATUS_RESOURCE_REQUIREMENTS_CHANGED ((NTSTATUS)0x00000119L) +#define STATUS_TRANSLATION_COMPLETE ((NTSTATUS)0x00000120L) +#define STATUS_DS_MEMBERSHIP_EVALUATED_LOCALLY ((NTSTATUS)0x00000121L) +#define STATUS_NOTHING_TO_TERMINATE ((NTSTATUS)0x00000122L) +#define STATUS_PROCESS_NOT_IN_JOB ((NTSTATUS)0x00000123L) +#define STATUS_PROCESS_IN_JOB ((NTSTATUS)0x00000124L) +#define STATUS_OBJECT_NAME_EXISTS ((NTSTATUS)0x40000000L) +#define STATUS_THREAD_WAS_SUSPENDED ((NTSTATUS)0x40000001L) +#define STATUS_WORKING_SET_LIMIT_RANGE ((NTSTATUS)0x40000002L) +#define STATUS_IMAGE_NOT_AT_BASE ((NTSTATUS)0x40000003L) +#define STATUS_RXACT_STATE_CREATED ((NTSTATUS)0x40000004L) +#define STATUS_SEGMENT_NOTIFICATION ((NTSTATUS)0x40000005L) +#define STATUS_LOCAL_USER_SESSION_KEY ((NTSTATUS)0x40000006L) +#define STATUS_BAD_CURRENT_DIRECTORY ((NTSTATUS)0x40000007L) +#define STATUS_SERIAL_MORE_WRITES ((NTSTATUS)0x40000008L) +#define STATUS_REGISTRY_RECOVERED ((NTSTATUS)0x40000009L) +#define STATUS_FT_READ_RECOVERY_FROM_BACKUP ((NTSTATUS)0x4000000AL) +#define STATUS_FT_WRITE_RECOVERY ((NTSTATUS)0x4000000BL) +#define STATUS_SERIAL_COUNTER_TIMEOUT ((NTSTATUS)0x4000000CL) +#define STATUS_NULL_LM_PASSWORD ((NTSTATUS)0x4000000DL) +#define STATUS_IMAGE_MACHINE_TYPE_MISMATCH ((NTSTATUS)0x4000000EL) +#define STATUS_RECEIVE_PARTIAL ((NTSTATUS)0x4000000FL) +#define STATUS_RECEIVE_EXPEDITED ((NTSTATUS)0x40000010L) +#define STATUS_RECEIVE_PARTIAL_EXPEDITED ((NTSTATUS)0x40000011L) +#define STATUS_EVENT_DONE ((NTSTATUS)0x40000012L) +#define STATUS_EVENT_PENDING ((NTSTATUS)0x40000013L) +#define STATUS_CHECKING_FILE_SYSTEM ((NTSTATUS)0x40000014L) +#define STATUS_FATAL_APP_EXIT ((NTSTATUS)0x40000015L) +#define STATUS_PREDEFINED_HANDLE ((NTSTATUS)0x40000016L) +#define STATUS_WAS_UNLOCKED ((NTSTATUS)0x40000017L) +#define STATUS_SERVICE_NOTIFICATION ((NTSTATUS)0x40000018L) +#define STATUS_WAS_LOCKED ((NTSTATUS)0x40000019L) +#define STATUS_LOG_HARD_ERROR ((NTSTATUS)0x4000001AL) +#define STATUS_ALREADY_WIN32 ((NTSTATUS)0x4000001BL) +#define STATUS_WX86_UNSIMULATE ((NTSTATUS)0x4000001CL) +#define STATUS_WX86_CONTINUE ((NTSTATUS)0x4000001DL) +#define STATUS_WX86_SINGLE_STEP ((NTSTATUS)0x4000001EL) +#define STATUS_WX86_BREAKPOINT ((NTSTATUS)0x4000001FL) +#define STATUS_WX86_EXCEPTION_CONTINUE ((NTSTATUS)0x40000020L) +#define STATUS_WX86_EXCEPTION_LASTCHANCE ((NTSTATUS)0x40000021L) +#define STATUS_WX86_EXCEPTION_CHAIN ((NTSTATUS)0x40000022L) +#define STATUS_IMAGE_MACHINE_TYPE_MISMATCH_EXE ((NTSTATUS)0x40000023L) +#define STATUS_NO_YIELD_PERFORMED ((NTSTATUS)0x40000024L) +#define STATUS_TIMER_RESUME_IGNORED ((NTSTATUS)0x40000025L) +#define STATUS_ARBITRATION_UNHANDLED ((NTSTATUS)0x40000026L) +#define STATUS_CARDBUS_NOT_SUPPORTED ((NTSTATUS)0x40000027L) +#define STATUS_WX86_CREATEWX86TIB ((NTSTATUS)0x40000028L) +#define STATUS_MP_PROCESSOR_MISMATCH ((NTSTATUS)0x40000029L) +#define STATUS_HIBERNATED ((NTSTATUS)0x4000002AL) +#define STATUS_RESUME_HIBERNATION ((NTSTATUS)0x4000002BL) +#define STATUS_GUARD_PAGE_VIOLATION ((NTSTATUS)0x80000001L) +#define STATUS_DATATYPE_MISALIGNMENT ((NTSTATUS)0x80000002L) +#define STATUS_BREAKPOINT ((NTSTATUS)0x80000003L) +#define STATUS_SINGLE_STEP ((NTSTATUS)0x80000004L) +#define STATUS_BUFFER_OVERFLOW ((NTSTATUS)0x80000005L) +#define STATUS_NO_MORE_FILES ((NTSTATUS)0x80000006L) +#define STATUS_WAKE_SYSTEM_DEBUGGER ((NTSTATUS)0x80000007L) +#define STATUS_HANDLES_CLOSED ((NTSTATUS)0x8000000AL) +#define STATUS_NO_INHERITANCE ((NTSTATUS)0x8000000BL) +#define STATUS_GUID_SUBSTITUTION_MADE ((NTSTATUS)0x8000000CL) +#define STATUS_PARTIAL_COPY ((NTSTATUS)0x8000000DL) +#define STATUS_DEVICE_PAPER_EMPTY ((NTSTATUS)0x8000000EL) +#define STATUS_DEVICE_POWERED_OFF ((NTSTATUS)0x8000000FL) +#define STATUS_DEVICE_OFF_LINE ((NTSTATUS)0x80000010L) +#define STATUS_DEVICE_BUSY ((NTSTATUS)0x80000011L) +#define STATUS_NO_MORE_EAS ((NTSTATUS)0x80000012L) +#define STATUS_INVALID_EA_NAME ((NTSTATUS)0x80000013L) +#define STATUS_EA_LIST_INCONSISTENT ((NTSTATUS)0x80000014L) +#define STATUS_INVALID_EA_FLAG ((NTSTATUS)0x80000015L) +#define STATUS_VERIFY_REQUIRED ((NTSTATUS)0x80000016L) +#define STATUS_EXTRANEOUS_INFORMATION ((NTSTATUS)0x80000017L) +#define STATUS_RXACT_COMMIT_NECESSARY ((NTSTATUS)0x80000018L) +#define STATUS_NO_MORE_ENTRIES ((NTSTATUS)0x8000001AL) +#define STATUS_FILEMARK_DETECTED ((NTSTATUS)0x8000001BL) +#define STATUS_MEDIA_CHANGED ((NTSTATUS)0x8000001CL) +#define STATUS_BUS_RESET ((NTSTATUS)0x8000001DL) +#define STATUS_END_OF_MEDIA ((NTSTATUS)0x8000001EL) +#define STATUS_BEGINNING_OF_MEDIA ((NTSTATUS)0x8000001FL) +#define STATUS_MEDIA_CHECK ((NTSTATUS)0x80000020L) +#define STATUS_SETMARK_DETECTED ((NTSTATUS)0x80000021L) +#define STATUS_NO_DATA_DETECTED ((NTSTATUS)0x80000022L) +#define STATUS_REDIRECTOR_HAS_OPEN_HANDLES ((NTSTATUS)0x80000023L) +#define STATUS_SERVER_HAS_OPEN_HANDLES ((NTSTATUS)0x80000024L) +#define STATUS_ALREADY_DISCONNECTED ((NTSTATUS)0x80000025L) +#define STATUS_LONGJUMP ((NTSTATUS)0x80000026L) +#define STATUS_CLEANER_CARTRIDGE_INSTALLED ((NTSTATUS)0x80000027L) +#define STATUS_PLUGPLAY_QUERY_VETOED ((NTSTATUS)0x80000028L) +#define STATUS_UNWIND_CONSOLIDATE ((NTSTATUS)0x80000029L) +#define STATUS_CLUSTER_NODE_ALREADY_UP ((NTSTATUS)0x80130001L) +#define STATUS_CLUSTER_NODE_ALREADY_DOWN ((NTSTATUS)0x80130002L) +#define STATUS_CLUSTER_NETWORK_ALREADY_ONLINE ((NTSTATUS)0x80130003L) +#define STATUS_CLUSTER_NETWORK_ALREADY_OFFLINE ((NTSTATUS)0x80130004L) +#define STATUS_CLUSTER_NODE_ALREADY_MEMBER ((NTSTATUS)0x80130005L) +#define STATUS_UNSUCCESSFUL ((NTSTATUS)0xC0000001L) +#define STATUS_NOT_IMPLEMENTED ((NTSTATUS)0xC0000002L) +#define STATUS_INVALID_INFO_CLASS ((NTSTATUS)0xC0000003L) +#define STATUS_INFO_LENGTH_MISMATCH ((NTSTATUS)0xC0000004L) +#define STATUS_ACCESS_VIOLATION ((NTSTATUS)0xC0000005L) +#define STATUS_IN_PAGE_ERROR ((NTSTATUS)0xC0000006L) +#define STATUS_PAGEFILE_QUOTA ((NTSTATUS)0xC0000007L) +#define STATUS_INVALID_HANDLE ((NTSTATUS)0xC0000008L) +#define STATUS_BAD_INITIAL_STACK ((NTSTATUS)0xC0000009L) +#define STATUS_BAD_INITIAL_PC ((NTSTATUS)0xC000000AL) +#define STATUS_INVALID_CID ((NTSTATUS)0xC000000BL) +#define STATUS_TIMER_NOT_CANCELED ((NTSTATUS)0xC000000CL) +#define STATUS_INVALID_PARAMETER ((NTSTATUS)0xC000000DL) +#define STATUS_NO_SUCH_DEVICE ((NTSTATUS)0xC000000EL) +#define STATUS_NO_SUCH_FILE ((NTSTATUS)0xC000000FL) +#define STATUS_INVALID_DEVICE_REQUEST ((NTSTATUS)0xC0000010L) +#define STATUS_END_OF_FILE ((NTSTATUS)0xC0000011L) +#define STATUS_WRONG_VOLUME ((NTSTATUS)0xC0000012L) +#define STATUS_NO_MEDIA_IN_DEVICE ((NTSTATUS)0xC0000013L) +#define STATUS_UNRECOGNIZED_MEDIA ((NTSTATUS)0xC0000014L) +#define STATUS_NONEXISTENT_SECTOR ((NTSTATUS)0xC0000015L) +#define STATUS_MORE_PROCESSING_REQUIRED ((NTSTATUS)0xC0000016L) +#define STATUS_NO_MEMORY ((NTSTATUS)0xC0000017L) +#define STATUS_CONFLICTING_ADDRESSES ((NTSTATUS)0xC0000018L) +#define STATUS_NOT_MAPPED_VIEW ((NTSTATUS)0xC0000019L) +#define STATUS_UNABLE_TO_FREE_VM ((NTSTATUS)0xC000001AL) +#define STATUS_UNABLE_TO_DELETE_SECTION ((NTSTATUS)0xC000001BL) +#define STATUS_INVALID_SYSTEM_SERVICE ((NTSTATUS)0xC000001CL) +#define STATUS_ILLEGAL_INSTRUCTION ((NTSTATUS)0xC000001DL) +#define STATUS_INVALID_LOCK_SEQUENCE ((NTSTATUS)0xC000001EL) +#define STATUS_INVALID_VIEW_SIZE ((NTSTATUS)0xC000001FL) +#define STATUS_INVALID_FILE_FOR_SECTION ((NTSTATUS)0xC0000020L) +#define STATUS_ALREADY_COMMITTED ((NTSTATUS)0xC0000021L) +#define STATUS_ACCESS_DENIED ((NTSTATUS)0xC0000022L) +#define STATUS_BUFFER_TOO_SMALL ((NTSTATUS)0xC0000023L) +#define STATUS_OBJECT_TYPE_MISMATCH ((NTSTATUS)0xC0000024L) +#define STATUS_NONCONTINUABLE_EXCEPTION ((NTSTATUS)0xC0000025L) +#define STATUS_INVALID_DISPOSITION ((NTSTATUS)0xC0000026L) +#define STATUS_UNWIND ((NTSTATUS)0xC0000027L) +#define STATUS_BAD_STACK ((NTSTATUS)0xC0000028L) +#define STATUS_INVALID_UNWIND_TARGET ((NTSTATUS)0xC0000029L) +#define STATUS_NOT_LOCKED ((NTSTATUS)0xC000002AL) +#define STATUS_PARITY_ERROR ((NTSTATUS)0xC000002BL) +#define STATUS_UNABLE_TO_DECOMMIT_VM ((NTSTATUS)0xC000002CL) +#define STATUS_NOT_COMMITTED ((NTSTATUS)0xC000002DL) +#define STATUS_INVALID_PORT_ATTRIBUTES ((NTSTATUS)0xC000002EL) +#define STATUS_PORT_MESSAGE_TOO_LONG ((NTSTATUS)0xC000002FL) +#define STATUS_INVALID_PARAMETER_MIX ((NTSTATUS)0xC0000030L) +#define STATUS_INVALID_QUOTA_LOWER ((NTSTATUS)0xC0000031L) +#define STATUS_DISK_CORRUPT_ERROR ((NTSTATUS)0xC0000032L) +#define STATUS_OBJECT_NAME_INVALID ((NTSTATUS)0xC0000033L) +#define STATUS_OBJECT_NAME_NOT_FOUND ((NTSTATUS)0xC0000034L) +#define STATUS_OBJECT_NAME_COLLISION ((NTSTATUS)0xC0000035L) +#define STATUS_PORT_DISCONNECTED ((NTSTATUS)0xC0000037L) +#define STATUS_DEVICE_ALREADY_ATTACHED ((NTSTATUS)0xC0000038L) +#define STATUS_OBJECT_PATH_INVALID ((NTSTATUS)0xC0000039L) +#define STATUS_OBJECT_PATH_NOT_FOUND ((NTSTATUS)0xC000003AL) +#define STATUS_OBJECT_PATH_SYNTAX_BAD ((NTSTATUS)0xC000003BL) +#define STATUS_DATA_OVERRUN ((NTSTATUS)0xC000003CL) +#define STATUS_DATA_LATE_ERROR ((NTSTATUS)0xC000003DL) +#define STATUS_DATA_ERROR ((NTSTATUS)0xC000003EL) +#define STATUS_CRC_ERROR ((NTSTATUS)0xC000003FL) +#define STATUS_SECTION_TOO_BIG ((NTSTATUS)0xC0000040L) +#define STATUS_PORT_CONNECTION_REFUSED ((NTSTATUS)0xC0000041L) +#define STATUS_INVALID_PORT_HANDLE ((NTSTATUS)0xC0000042L) +#define STATUS_SHARING_VIOLATION ((NTSTATUS)0xC0000043L) +#define STATUS_QUOTA_EXCEEDED ((NTSTATUS)0xC0000044L) +#define STATUS_INVALID_PAGE_PROTECTION ((NTSTATUS)0xC0000045L) +#define STATUS_MUTANT_NOT_OWNED ((NTSTATUS)0xC0000046L) +#define STATUS_SEMAPHORE_LIMIT_EXCEEDED ((NTSTATUS)0xC0000047L) +#define STATUS_PORT_ALREADY_SET ((NTSTATUS)0xC0000048L) +#define STATUS_SECTION_NOT_IMAGE ((NTSTATUS)0xC0000049L) +#define STATUS_SUSPEND_COUNT_EXCEEDED ((NTSTATUS)0xC000004AL) +#define STATUS_THREAD_IS_TERMINATING ((NTSTATUS)0xC000004BL) +#define STATUS_BAD_WORKING_SET_LIMIT ((NTSTATUS)0xC000004CL) +#define STATUS_INCOMPATIBLE_FILE_MAP ((NTSTATUS)0xC000004DL) +#define STATUS_SECTION_PROTECTION ((NTSTATUS)0xC000004EL) +#define STATUS_EAS_NOT_SUPPORTED ((NTSTATUS)0xC000004FL) +#define STATUS_EA_TOO_LARGE ((NTSTATUS)0xC0000050L) +#define STATUS_NONEXISTENT_EA_ENTRY ((NTSTATUS)0xC0000051L) +#define STATUS_NO_EAS_ON_FILE ((NTSTATUS)0xC0000052L) +#define STATUS_EA_CORRUPT_ERROR ((NTSTATUS)0xC0000053L) +#define STATUS_FILE_LOCK_CONFLICT ((NTSTATUS)0xC0000054L) +#define STATUS_LOCK_NOT_GRANTED ((NTSTATUS)0xC0000055L) +#define STATUS_DELETE_PENDING ((NTSTATUS)0xC0000056L) +#define STATUS_CTL_FILE_NOT_SUPPORTED ((NTSTATUS)0xC0000057L) +#define STATUS_UNKNOWN_REVISION ((NTSTATUS)0xC0000058L) +#define STATUS_REVISION_MISMATCH ((NTSTATUS)0xC0000059L) +#define STATUS_INVALID_OWNER ((NTSTATUS)0xC000005AL) +#define STATUS_INVALID_PRIMARY_GROUP ((NTSTATUS)0xC000005BL) +#define STATUS_NO_IMPERSONATION_TOKEN ((NTSTATUS)0xC000005CL) +#define STATUS_CANT_DISABLE_MANDATORY ((NTSTATUS)0xC000005DL) +#define STATUS_NO_LOGON_SERVERS ((NTSTATUS)0xC000005EL) +#define STATUS_NO_SUCH_LOGON_SESSION ((NTSTATUS)0xC000005FL) +#define STATUS_NO_SUCH_PRIVILEGE ((NTSTATUS)0xC0000060L) +#define STATUS_PRIVILEGE_NOT_HELD ((NTSTATUS)0xC0000061L) +#define STATUS_INVALID_ACCOUNT_NAME ((NTSTATUS)0xC0000062L) +#define STATUS_USER_EXISTS ((NTSTATUS)0xC0000063L) +#define STATUS_NO_SUCH_USER ((NTSTATUS)0xC0000064L) +#define STATUS_GROUP_EXISTS ((NTSTATUS)0xC0000065L) +#define STATUS_NO_SUCH_GROUP ((NTSTATUS)0xC0000066L) +#define STATUS_MEMBER_IN_GROUP ((NTSTATUS)0xC0000067L) +#define STATUS_MEMBER_NOT_IN_GROUP ((NTSTATUS)0xC0000068L) +#define STATUS_LAST_ADMIN ((NTSTATUS)0xC0000069L) +#define STATUS_WRONG_PASSWORD ((NTSTATUS)0xC000006AL) +#define STATUS_ILL_FORMED_PASSWORD ((NTSTATUS)0xC000006BL) +#define STATUS_PASSWORD_RESTRICTION ((NTSTATUS)0xC000006CL) +#define STATUS_LOGON_FAILURE ((NTSTATUS)0xC000006DL) +#define STATUS_ACCOUNT_RESTRICTION ((NTSTATUS)0xC000006EL) +#define STATUS_INVALID_LOGON_HOURS ((NTSTATUS)0xC000006FL) +#define STATUS_INVALID_WORKSTATION ((NTSTATUS)0xC0000070L) +#define STATUS_PASSWORD_EXPIRED ((NTSTATUS)0xC0000071L) +#define STATUS_ACCOUNT_DISABLED ((NTSTATUS)0xC0000072L) +#define STATUS_NONE_MAPPED ((NTSTATUS)0xC0000073L) +#define STATUS_TOO_MANY_LUIDS_REQUESTED ((NTSTATUS)0xC0000074L) +#define STATUS_LUIDS_EXHAUSTED ((NTSTATUS)0xC0000075L) +#define STATUS_INVALID_SUB_AUTHORITY ((NTSTATUS)0xC0000076L) +#define STATUS_INVALID_ACL ((NTSTATUS)0xC0000077L) +#define STATUS_INVALID_SID ((NTSTATUS)0xC0000078L) +#define STATUS_INVALID_SECURITY_DESCR ((NTSTATUS)0xC0000079L) +#define STATUS_PROCEDURE_NOT_FOUND ((NTSTATUS)0xC000007AL) +#define STATUS_INVALID_IMAGE_FORMAT ((NTSTATUS)0xC000007BL) +#define STATUS_NO_TOKEN ((NTSTATUS)0xC000007CL) +#define STATUS_BAD_INHERITANCE_ACL ((NTSTATUS)0xC000007DL) +#define STATUS_RANGE_NOT_LOCKED ((NTSTATUS)0xC000007EL) +#define STATUS_DISK_FULL ((NTSTATUS)0xC000007FL) +#define STATUS_SERVER_DISABLED ((NTSTATUS)0xC0000080L) +#define STATUS_SERVER_NOT_DISABLED ((NTSTATUS)0xC0000081L) +#define STATUS_TOO_MANY_GUIDS_REQUESTED ((NTSTATUS)0xC0000082L) +#define STATUS_GUIDS_EXHAUSTED ((NTSTATUS)0xC0000083L) +#define STATUS_INVALID_ID_AUTHORITY ((NTSTATUS)0xC0000084L) +#define STATUS_AGENTS_EXHAUSTED ((NTSTATUS)0xC0000085L) +#define STATUS_INVALID_VOLUME_LABEL ((NTSTATUS)0xC0000086L) +#define STATUS_SECTION_NOT_EXTENDED ((NTSTATUS)0xC0000087L) +#define STATUS_NOT_MAPPED_DATA ((NTSTATUS)0xC0000088L) +#define STATUS_RESOURCE_DATA_NOT_FOUND ((NTSTATUS)0xC0000089L) +#define STATUS_RESOURCE_TYPE_NOT_FOUND ((NTSTATUS)0xC000008AL) +#define STATUS_RESOURCE_NAME_NOT_FOUND ((NTSTATUS)0xC000008BL) +#define STATUS_ARRAY_BOUNDS_EXCEEDED ((NTSTATUS)0xC000008CL) +#define STATUS_FLOAT_DENORMAL_OPERAND ((NTSTATUS)0xC000008DL) +#define STATUS_FLOAT_DIVIDE_BY_ZERO ((NTSTATUS)0xC000008EL) +#define STATUS_FLOAT_INEXACT_RESULT ((NTSTATUS)0xC000008FL) +#define STATUS_FLOAT_INVALID_OPERATION ((NTSTATUS)0xC0000090L) +#define STATUS_FLOAT_OVERFLOW ((NTSTATUS)0xC0000091L) +#define STATUS_FLOAT_STACK_CHECK ((NTSTATUS)0xC0000092L) +#define STATUS_FLOAT_UNDERFLOW ((NTSTATUS)0xC0000093L) +#define STATUS_INTEGER_DIVIDE_BY_ZERO ((NTSTATUS)0xC0000094L) +#define STATUS_INTEGER_OVERFLOW ((NTSTATUS)0xC0000095L) +#define STATUS_PRIVILEGED_INSTRUCTION ((NTSTATUS)0xC0000096L) +#define STATUS_TOO_MANY_PAGING_FILES ((NTSTATUS)0xC0000097L) +#define STATUS_FILE_INVALID ((NTSTATUS)0xC0000098L) +#define STATUS_ALLOTTED_SPACE_EXCEEDED ((NTSTATUS)0xC0000099L) +#define STATUS_INSUFFICIENT_RESOURCES ((NTSTATUS)0xC000009AL) +#define STATUS_DFS_EXIT_PATH_FOUND ((NTSTATUS)0xC000009BL) +#define STATUS_DEVICE_DATA_ERROR ((NTSTATUS)0xC000009CL) +#define STATUS_DEVICE_NOT_CONNECTED ((NTSTATUS)0xC000009DL) +#define STATUS_DEVICE_POWER_FAILURE ((NTSTATUS)0xC000009EL) +#define STATUS_FREE_VM_NOT_AT_BASE ((NTSTATUS)0xC000009FL) +#define STATUS_MEMORY_NOT_ALLOCATED ((NTSTATUS)0xC00000A0L) +#define STATUS_WORKING_SET_QUOTA ((NTSTATUS)0xC00000A1L) +#define STATUS_MEDIA_WRITE_PROTECTED ((NTSTATUS)0xC00000A2L) +#define STATUS_DEVICE_NOT_READY ((NTSTATUS)0xC00000A3L) +#define STATUS_INVALID_GROUP_ATTRIBUTES ((NTSTATUS)0xC00000A4L) +#define STATUS_BAD_IMPERSONATION_LEVEL ((NTSTATUS)0xC00000A5L) +#define STATUS_CANT_OPEN_ANONYMOUS ((NTSTATUS)0xC00000A6L) +#define STATUS_BAD_VALIDATION_CLASS ((NTSTATUS)0xC00000A7L) +#define STATUS_BAD_TOKEN_TYPE ((NTSTATUS)0xC00000A8L) +#define STATUS_BAD_MASTER_BOOT_RECORD ((NTSTATUS)0xC00000A9L) +#define STATUS_INSTRUCTION_MISALIGNMENT ((NTSTATUS)0xC00000AAL) +#define STATUS_INSTANCE_NOT_AVAILABLE ((NTSTATUS)0xC00000ABL) +#define STATUS_PIPE_NOT_AVAILABLE ((NTSTATUS)0xC00000ACL) +#define STATUS_INVALID_PIPE_STATE ((NTSTATUS)0xC00000ADL) +#define STATUS_PIPE_BUSY ((NTSTATUS)0xC00000AEL) +#define STATUS_ILLEGAL_FUNCTION ((NTSTATUS)0xC00000AFL) +#define STATUS_PIPE_DISCONNECTED ((NTSTATUS)0xC00000B0L) +#define STATUS_PIPE_CLOSING ((NTSTATUS)0xC00000B1L) +#define STATUS_PIPE_CONNECTED ((NTSTATUS)0xC00000B2L) +#define STATUS_PIPE_LISTENING ((NTSTATUS)0xC00000B3L) +#define STATUS_INVALID_READ_MODE ((NTSTATUS)0xC00000B4L) +#define STATUS_IO_TIMEOUT ((NTSTATUS)0xC00000B5L) +#define STATUS_FILE_FORCED_CLOSED ((NTSTATUS)0xC00000B6L) +#define STATUS_PROFILING_NOT_STARTED ((NTSTATUS)0xC00000B7L) +#define STATUS_PROFILING_NOT_STOPPED ((NTSTATUS)0xC00000B8L) +#define STATUS_COULD_NOT_INTERPRET ((NTSTATUS)0xC00000B9L) +#define STATUS_FILE_IS_A_DIRECTORY ((NTSTATUS)0xC00000BAL) +#define STATUS_NOT_SUPPORTED ((NTSTATUS)0xC00000BBL) +#define STATUS_REMOTE_NOT_LISTENING ((NTSTATUS)0xC00000BCL) +#define STATUS_DUPLICATE_NAME ((NTSTATUS)0xC00000BDL) +#define STATUS_BAD_NETWORK_PATH ((NTSTATUS)0xC00000BEL) +#define STATUS_NETWORK_BUSY ((NTSTATUS)0xC00000BFL) +#define STATUS_DEVICE_DOES_NOT_EXIST ((NTSTATUS)0xC00000C0L) +#define STATUS_TOO_MANY_COMMANDS ((NTSTATUS)0xC00000C1L) +#define STATUS_ADAPTER_HARDWARE_ERROR ((NTSTATUS)0xC00000C2L) +#define STATUS_INVALID_NETWORK_RESPONSE ((NTSTATUS)0xC00000C3L) +#define STATUS_UNEXPECTED_NETWORK_ERROR ((NTSTATUS)0xC00000C4L) +#define STATUS_BAD_REMOTE_ADAPTER ((NTSTATUS)0xC00000C5L) +#define STATUS_PRINT_QUEUE_FULL ((NTSTATUS)0xC00000C6L) +#define STATUS_NO_SPOOL_SPACE ((NTSTATUS)0xC00000C7L) +#define STATUS_PRINT_CANCELLED ((NTSTATUS)0xC00000C8L) +#define STATUS_NETWORK_NAME_DELETED ((NTSTATUS)0xC00000C9L) +#define STATUS_NETWORK_ACCESS_DENIED ((NTSTATUS)0xC00000CAL) +#define STATUS_BAD_DEVICE_TYPE ((NTSTATUS)0xC00000CBL) +#define STATUS_BAD_NETWORK_NAME ((NTSTATUS)0xC00000CCL) +#define STATUS_TOO_MANY_NAMES ((NTSTATUS)0xC00000CDL) +#define STATUS_TOO_MANY_SESSIONS ((NTSTATUS)0xC00000CEL) +#define STATUS_SHARING_PAUSED ((NTSTATUS)0xC00000CFL) +#define STATUS_REQUEST_NOT_ACCEPTED ((NTSTATUS)0xC00000D0L) +#define STATUS_REDIRECTOR_PAUSED ((NTSTATUS)0xC00000D1L) +#define STATUS_NET_WRITE_FAULT ((NTSTATUS)0xC00000D2L) +#define STATUS_PROFILING_AT_LIMIT ((NTSTATUS)0xC00000D3L) +#define STATUS_NOT_SAME_DEVICE ((NTSTATUS)0xC00000D4L) +#define STATUS_FILE_RENAMED ((NTSTATUS)0xC00000D5L) +#define STATUS_VIRTUAL_CIRCUIT_CLOSED ((NTSTATUS)0xC00000D6L) +#define STATUS_NO_SECURITY_ON_OBJECT ((NTSTATUS)0xC00000D7L) +#define STATUS_CANT_WAIT ((NTSTATUS)0xC00000D8L) +#define STATUS_PIPE_EMPTY ((NTSTATUS)0xC00000D9L) +#define STATUS_CANT_ACCESS_DOMAIN_INFO ((NTSTATUS)0xC00000DAL) +#define STATUS_CANT_TERMINATE_SELF ((NTSTATUS)0xC00000DBL) +#define STATUS_INVALID_SERVER_STATE ((NTSTATUS)0xC00000DCL) +#define STATUS_INVALID_DOMAIN_STATE ((NTSTATUS)0xC00000DDL) +#define STATUS_INVALID_DOMAIN_ROLE ((NTSTATUS)0xC00000DEL) +#define STATUS_NO_SUCH_DOMAIN ((NTSTATUS)0xC00000DFL) +#define STATUS_DOMAIN_EXISTS ((NTSTATUS)0xC00000E0L) +#define STATUS_DOMAIN_LIMIT_EXCEEDED ((NTSTATUS)0xC00000E1L) +#define STATUS_OPLOCK_NOT_GRANTED ((NTSTATUS)0xC00000E2L) +#define STATUS_INVALID_OPLOCK_PROTOCOL ((NTSTATUS)0xC00000E3L) +#define STATUS_INTERNAL_DB_CORRUPTION ((NTSTATUS)0xC00000E4L) +#define STATUS_INTERNAL_ERROR ((NTSTATUS)0xC00000E5L) +#define STATUS_GENERIC_NOT_MAPPED ((NTSTATUS)0xC00000E6L) +#define STATUS_BAD_DESCRIPTOR_FORMAT ((NTSTATUS)0xC00000E7L) +#define STATUS_INVALID_USER_BUFFER ((NTSTATUS)0xC00000E8L) +#define STATUS_UNEXPECTED_IO_ERROR ((NTSTATUS)0xC00000E9L) +#define STATUS_UNEXPECTED_MM_CREATE_ERR ((NTSTATUS)0xC00000EAL) +#define STATUS_UNEXPECTED_MM_MAP_ERROR ((NTSTATUS)0xC00000EBL) +#define STATUS_UNEXPECTED_MM_EXTEND_ERR ((NTSTATUS)0xC00000ECL) +#define STATUS_NOT_LOGON_PROCESS ((NTSTATUS)0xC00000EDL) +#define STATUS_LOGON_SESSION_EXISTS ((NTSTATUS)0xC00000EEL) +#define STATUS_INVALID_PARAMETER_1 ((NTSTATUS)0xC00000EFL) +#define STATUS_INVALID_PARAMETER_2 ((NTSTATUS)0xC00000F0L) +#define STATUS_INVALID_PARAMETER_3 ((NTSTATUS)0xC00000F1L) +#define STATUS_INVALID_PARAMETER_4 ((NTSTATUS)0xC00000F2L) +#define STATUS_INVALID_PARAMETER_5 ((NTSTATUS)0xC00000F3L) +#define STATUS_INVALID_PARAMETER_6 ((NTSTATUS)0xC00000F4L) +#define STATUS_INVALID_PARAMETER_7 ((NTSTATUS)0xC00000F5L) +#define STATUS_INVALID_PARAMETER_8 ((NTSTATUS)0xC00000F6L) +#define STATUS_INVALID_PARAMETER_9 ((NTSTATUS)0xC00000F7L) +#define STATUS_INVALID_PARAMETER_10 ((NTSTATUS)0xC00000F8L) +#define STATUS_INVALID_PARAMETER_11 ((NTSTATUS)0xC00000F9L) +#define STATUS_INVALID_PARAMETER_12 ((NTSTATUS)0xC00000FAL) +#define STATUS_REDIRECTOR_NOT_STARTED ((NTSTATUS)0xC00000FBL) +#define STATUS_REDIRECTOR_STARTED ((NTSTATUS)0xC00000FCL) +#define STATUS_STACK_OVERFLOW ((NTSTATUS)0xC00000FDL) +#define STATUS_NO_SUCH_PACKAGE ((NTSTATUS)0xC00000FEL) +#define STATUS_BAD_FUNCTION_TABLE ((NTSTATUS)0xC00000FFL) +#define STATUS_VARIABLE_NOT_FOUND ((NTSTATUS)0xC0000100L) +#define STATUS_DIRECTORY_NOT_EMPTY ((NTSTATUS)0xC0000101L) +#define STATUS_FILE_CORRUPT_ERROR ((NTSTATUS)0xC0000102L) +#define STATUS_NOT_A_DIRECTORY ((NTSTATUS)0xC0000103L) +#define STATUS_BAD_LOGON_SESSION_STATE ((NTSTATUS)0xC0000104L) +#define STATUS_LOGON_SESSION_COLLISION ((NTSTATUS)0xC0000105L) +#define STATUS_NAME_TOO_LONG ((NTSTATUS)0xC0000106L) +#define STATUS_FILES_OPEN ((NTSTATUS)0xC0000107L) +#define STATUS_CONNECTION_IN_USE ((NTSTATUS)0xC0000108L) +#define STATUS_MESSAGE_NOT_FOUND ((NTSTATUS)0xC0000109L) +#define STATUS_PROCESS_IS_TERMINATING ((NTSTATUS)0xC000010AL) +#define STATUS_INVALID_LOGON_TYPE ((NTSTATUS)0xC000010BL) +#define STATUS_NO_GUID_TRANSLATION ((NTSTATUS)0xC000010CL) +#define STATUS_CANNOT_IMPERSONATE ((NTSTATUS)0xC000010DL) +#define STATUS_IMAGE_ALREADY_LOADED ((NTSTATUS)0xC000010EL) +#define STATUS_ABIOS_NOT_PRESENT ((NTSTATUS)0xC000010FL) +#define STATUS_ABIOS_LID_NOT_EXIST ((NTSTATUS)0xC0000110L) +#define STATUS_ABIOS_LID_ALREADY_OWNED ((NTSTATUS)0xC0000111L) +#define STATUS_ABIOS_NOT_LID_OWNER ((NTSTATUS)0xC0000112L) +#define STATUS_ABIOS_INVALID_COMMAND ((NTSTATUS)0xC0000113L) +#define STATUS_ABIOS_INVALID_LID ((NTSTATUS)0xC0000114L) +#define STATUS_ABIOS_SELECTOR_NOT_AVAILABLE ((NTSTATUS)0xC0000115L) +#define STATUS_ABIOS_INVALID_SELECTOR ((NTSTATUS)0xC0000116L) +#define STATUS_NO_LDT ((NTSTATUS)0xC0000117L) +#define STATUS_INVALID_LDT_SIZE ((NTSTATUS)0xC0000118L) +#define STATUS_INVALID_LDT_OFFSET ((NTSTATUS)0xC0000119L) +#define STATUS_INVALID_LDT_DESCRIPTOR ((NTSTATUS)0xC000011AL) +#define STATUS_INVALID_IMAGE_NE_FORMAT ((NTSTATUS)0xC000011BL) +#define STATUS_RXACT_INVALID_STATE ((NTSTATUS)0xC000011CL) +#define STATUS_RXACT_COMMIT_FAILURE ((NTSTATUS)0xC000011DL) +#define STATUS_MAPPED_FILE_SIZE_ZERO ((NTSTATUS)0xC000011EL) +#define STATUS_TOO_MANY_OPENED_FILES ((NTSTATUS)0xC000011FL) +#define STATUS_CANCELLED ((NTSTATUS)0xC0000120L) +#define STATUS_CANNOT_DELETE ((NTSTATUS)0xC0000121L) +#define STATUS_INVALID_COMPUTER_NAME ((NTSTATUS)0xC0000122L) +#define STATUS_FILE_DELETED ((NTSTATUS)0xC0000123L) +#define STATUS_SPECIAL_ACCOUNT ((NTSTATUS)0xC0000124L) +#define STATUS_SPECIAL_GROUP ((NTSTATUS)0xC0000125L) +#define STATUS_SPECIAL_USER ((NTSTATUS)0xC0000126L) +#define STATUS_MEMBERS_PRIMARY_GROUP ((NTSTATUS)0xC0000127L) +#define STATUS_FILE_CLOSED ((NTSTATUS)0xC0000128L) +#define STATUS_TOO_MANY_THREADS ((NTSTATUS)0xC0000129L) +#define STATUS_THREAD_NOT_IN_PROCESS ((NTSTATUS)0xC000012AL) +#define STATUS_TOKEN_ALREADY_IN_USE ((NTSTATUS)0xC000012BL) +#define STATUS_PAGEFILE_QUOTA_EXCEEDED ((NTSTATUS)0xC000012CL) +#define STATUS_COMMITMENT_LIMIT ((NTSTATUS)0xC000012DL) +#define STATUS_INVALID_IMAGE_LE_FORMAT ((NTSTATUS)0xC000012EL) +#define STATUS_INVALID_IMAGE_NOT_MZ ((NTSTATUS)0xC000012FL) +#define STATUS_INVALID_IMAGE_PROTECT ((NTSTATUS)0xC0000130L) +#define STATUS_INVALID_IMAGE_WIN_16 ((NTSTATUS)0xC0000131L) +#define STATUS_LOGON_SERVER_CONFLICT ((NTSTATUS)0xC0000132L) +#define STATUS_TIME_DIFFERENCE_AT_DC ((NTSTATUS)0xC0000133L) +#define STATUS_SYNCHRONIZATION_REQUIRED ((NTSTATUS)0xC0000134L) +#define STATUS_DLL_NOT_FOUND ((NTSTATUS)0xC0000135L) +#define STATUS_OPEN_FAILED ((NTSTATUS)0xC0000136L) +#define STATUS_IO_PRIVILEGE_FAILED ((NTSTATUS)0xC0000137L) +#define STATUS_ORDINAL_NOT_FOUND ((NTSTATUS)0xC0000138L) +#define STATUS_ENTRYPOINT_NOT_FOUND ((NTSTATUS)0xC0000139L) +#define STATUS_CONTROL_C_EXIT ((NTSTATUS)0xC000013AL) +#define STATUS_LOCAL_DISCONNECT ((NTSTATUS)0xC000013BL) +#define STATUS_REMOTE_DISCONNECT ((NTSTATUS)0xC000013CL) +#define STATUS_REMOTE_RESOURCES ((NTSTATUS)0xC000013DL) +#define STATUS_LINK_FAILED ((NTSTATUS)0xC000013EL) +#define STATUS_LINK_TIMEOUT ((NTSTATUS)0xC000013FL) +#define STATUS_INVALID_CONNECTION ((NTSTATUS)0xC0000140L) +#define STATUS_INVALID_ADDRESS ((NTSTATUS)0xC0000141L) +#define STATUS_DLL_INIT_FAILED ((NTSTATUS)0xC0000142L) +#define STATUS_MISSING_SYSTEMFILE ((NTSTATUS)0xC0000143L) +#define STATUS_UNHANDLED_EXCEPTION ((NTSTATUS)0xC0000144L) +#define STATUS_APP_INIT_FAILURE ((NTSTATUS)0xC0000145L) +#define STATUS_PAGEFILE_CREATE_FAILED ((NTSTATUS)0xC0000146L) +#define STATUS_NO_PAGEFILE ((NTSTATUS)0xC0000147L) +#define STATUS_INVALID_LEVEL ((NTSTATUS)0xC0000148L) +#define STATUS_WRONG_PASSWORD_CORE ((NTSTATUS)0xC0000149L) +#define STATUS_ILLEGAL_FLOAT_CONTEXT ((NTSTATUS)0xC000014AL) +#define STATUS_PIPE_BROKEN ((NTSTATUS)0xC000014BL) +#define STATUS_REGISTRY_CORRUPT ((NTSTATUS)0xC000014CL) +#define STATUS_REGISTRY_IO_FAILED ((NTSTATUS)0xC000014DL) +#define STATUS_NO_EVENT_PAIR ((NTSTATUS)0xC000014EL) +#define STATUS_UNRECOGNIZED_VOLUME ((NTSTATUS)0xC000014FL) +#define STATUS_SERIAL_NO_DEVICE_INITED ((NTSTATUS)0xC0000150L) +#define STATUS_NO_SUCH_ALIAS ((NTSTATUS)0xC0000151L) +#define STATUS_MEMBER_NOT_IN_ALIAS ((NTSTATUS)0xC0000152L) +#define STATUS_MEMBER_IN_ALIAS ((NTSTATUS)0xC0000153L) +#define STATUS_ALIAS_EXISTS ((NTSTATUS)0xC0000154L) +#define STATUS_LOGON_NOT_GRANTED ((NTSTATUS)0xC0000155L) +#define STATUS_TOO_MANY_SECRETS ((NTSTATUS)0xC0000156L) +#define STATUS_SECRET_TOO_LONG ((NTSTATUS)0xC0000157L) +#define STATUS_INTERNAL_DB_ERROR ((NTSTATUS)0xC0000158L) +#define STATUS_FULLSCREEN_MODE ((NTSTATUS)0xC0000159L) +#define STATUS_TOO_MANY_CONTEXT_IDS ((NTSTATUS)0xC000015AL) +#define STATUS_LOGON_TYPE_NOT_GRANTED ((NTSTATUS)0xC000015BL) +#define STATUS_NOT_REGISTRY_FILE ((NTSTATUS)0xC000015CL) +#define STATUS_NT_CROSS_ENCRYPTION_REQUIRED ((NTSTATUS)0xC000015DL) +#define STATUS_DOMAIN_CTRLR_CONFIG_ERROR ((NTSTATUS)0xC000015EL) +#define STATUS_FT_MISSING_MEMBER ((NTSTATUS)0xC000015FL) +#define STATUS_ILL_FORMED_SERVICE_ENTRY ((NTSTATUS)0xC0000160L) +#define STATUS_ILLEGAL_CHARACTER ((NTSTATUS)0xC0000161L) +#define STATUS_UNMAPPABLE_CHARACTER ((NTSTATUS)0xC0000162L) +#define STATUS_UNDEFINED_CHARACTER ((NTSTATUS)0xC0000163L) +#define STATUS_FLOPPY_VOLUME ((NTSTATUS)0xC0000164L) +#define STATUS_FLOPPY_ID_MARK_NOT_FOUND ((NTSTATUS)0xC0000165L) +#define STATUS_FLOPPY_WRONG_CYLINDER ((NTSTATUS)0xC0000166L) +#define STATUS_FLOPPY_UNKNOWN_ERROR ((NTSTATUS)0xC0000167L) +#define STATUS_FLOPPY_BAD_REGISTERS ((NTSTATUS)0xC0000168L) +#define STATUS_DISK_RECALIBRATE_FAILED ((NTSTATUS)0xC0000169L) +#define STATUS_DISK_OPERATION_FAILED ((NTSTATUS)0xC000016AL) +#define STATUS_DISK_RESET_FAILED ((NTSTATUS)0xC000016BL) +#define STATUS_SHARED_IRQ_BUSY ((NTSTATUS)0xC000016CL) +#define STATUS_FT_ORPHANING ((NTSTATUS)0xC000016DL) +#define STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT ((NTSTATUS)0xC000016EL) +#define STATUS_PARTITION_FAILURE ((NTSTATUS)0xC0000172L) +#define STATUS_INVALID_BLOCK_LENGTH ((NTSTATUS)0xC0000173L) +#define STATUS_DEVICE_NOT_PARTITIONED ((NTSTATUS)0xC0000174L) +#define STATUS_UNABLE_TO_LOCK_MEDIA ((NTSTATUS)0xC0000175L) +#define STATUS_UNABLE_TO_UNLOAD_MEDIA ((NTSTATUS)0xC0000176L) +#define STATUS_EOM_OVERFLOW ((NTSTATUS)0xC0000177L) +#define STATUS_NO_MEDIA ((NTSTATUS)0xC0000178L) +#define STATUS_NO_SUCH_MEMBER ((NTSTATUS)0xC000017AL) +#define STATUS_INVALID_MEMBER ((NTSTATUS)0xC000017BL) +#define STATUS_KEY_DELETED ((NTSTATUS)0xC000017CL) +#define STATUS_NO_LOG_SPACE ((NTSTATUS)0xC000017DL) +#define STATUS_TOO_MANY_SIDS ((NTSTATUS)0xC000017EL) +#define STATUS_LM_CROSS_ENCRYPTION_REQUIRED ((NTSTATUS)0xC000017FL) +#define STATUS_KEY_HAS_CHILDREN ((NTSTATUS)0xC0000180L) +#define STATUS_CHILD_MUST_BE_VOLATILE ((NTSTATUS)0xC0000181L) +#define STATUS_DEVICE_CONFIGURATION_ERROR ((NTSTATUS)0xC0000182L) +#define STATUS_DRIVER_INTERNAL_ERROR ((NTSTATUS)0xC0000183L) +#define STATUS_INVALID_DEVICE_STATE ((NTSTATUS)0xC0000184L) +#define STATUS_IO_DEVICE_ERROR ((NTSTATUS)0xC0000185L) +#define STATUS_DEVICE_PROTOCOL_ERROR ((NTSTATUS)0xC0000186L) +#define STATUS_BACKUP_CONTROLLER ((NTSTATUS)0xC0000187L) +#define STATUS_LOG_FILE_FULL ((NTSTATUS)0xC0000188L) +#define STATUS_TOO_LATE ((NTSTATUS)0xC0000189L) +#define STATUS_NO_TRUST_LSA_SECRET ((NTSTATUS)0xC000018AL) +#define STATUS_NO_TRUST_SAM_ACCOUNT ((NTSTATUS)0xC000018BL) +#define STATUS_TRUSTED_DOMAIN_FAILURE ((NTSTATUS)0xC000018CL) +#define STATUS_TRUSTED_RELATIONSHIP_FAILURE ((NTSTATUS)0xC000018DL) +#define STATUS_EVENTLOG_FILE_CORRUPT ((NTSTATUS)0xC000018EL) +#define STATUS_EVENTLOG_CANT_START ((NTSTATUS)0xC000018FL) +#define STATUS_TRUST_FAILURE ((NTSTATUS)0xC0000190L) +#define STATUS_MUTANT_LIMIT_EXCEEDED ((NTSTATUS)0xC0000191L) +#define STATUS_NETLOGON_NOT_STARTED ((NTSTATUS)0xC0000192L) +#define STATUS_ACCOUNT_EXPIRED ((NTSTATUS)0xC0000193L) +#define STATUS_POSSIBLE_DEADLOCK ((NTSTATUS)0xC0000194L) +#define STATUS_NETWORK_CREDENTIAL_CONFLICT ((NTSTATUS)0xC0000195L) +#define STATUS_REMOTE_SESSION_LIMIT ((NTSTATUS)0xC0000196L) +#define STATUS_EVENTLOG_FILE_CHANGED ((NTSTATUS)0xC0000197L) +#define STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT ((NTSTATUS)0xC0000198L) +#define STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT ((NTSTATUS)0xC0000199L) +#define STATUS_NOLOGON_SERVER_TRUST_ACCOUNT ((NTSTATUS)0xC000019AL) +#define STATUS_DOMAIN_TRUST_INCONSISTENT ((NTSTATUS)0xC000019BL) +#define STATUS_FS_DRIVER_REQUIRED ((NTSTATUS)0xC000019CL) +#define STATUS_NO_USER_SESSION_KEY ((NTSTATUS)0xC0000202L) +#define STATUS_USER_SESSION_DELETED ((NTSTATUS)0xC0000203L) +#define STATUS_RESOURCE_LANG_NOT_FOUND ((NTSTATUS)0xC0000204L) +#define STATUS_INSUFF_SERVER_RESOURCES ((NTSTATUS)0xC0000205L) +#define STATUS_INVALID_BUFFER_SIZE ((NTSTATUS)0xC0000206L) +#define STATUS_INVALID_ADDRESS_COMPONENT ((NTSTATUS)0xC0000207L) +#define STATUS_INVALID_ADDRESS_WILDCARD ((NTSTATUS)0xC0000208L) +#define STATUS_TOO_MANY_ADDRESSES ((NTSTATUS)0xC0000209L) +#define STATUS_ADDRESS_ALREADY_EXISTS ((NTSTATUS)0xC000020AL) +#define STATUS_ADDRESS_CLOSED ((NTSTATUS)0xC000020BL) +#define STATUS_CONNECTION_DISCONNECTED ((NTSTATUS)0xC000020CL) +#define STATUS_CONNECTION_RESET ((NTSTATUS)0xC000020DL) +#define STATUS_TOO_MANY_NODES ((NTSTATUS)0xC000020EL) +#define STATUS_TRANSACTION_ABORTED ((NTSTATUS)0xC000020FL) +#define STATUS_TRANSACTION_TIMED_OUT ((NTSTATUS)0xC0000210L) +#define STATUS_TRANSACTION_NO_RELEASE ((NTSTATUS)0xC0000211L) +#define STATUS_TRANSACTION_NO_MATCH ((NTSTATUS)0xC0000212L) +#define STATUS_TRANSACTION_RESPONDED ((NTSTATUS)0xC0000213L) +#define STATUS_TRANSACTION_INVALID_ID ((NTSTATUS)0xC0000214L) +#define STATUS_TRANSACTION_INVALID_TYPE ((NTSTATUS)0xC0000215L) +#define STATUS_NOT_SERVER_SESSION ((NTSTATUS)0xC0000216L) +#define STATUS_NOT_CLIENT_SESSION ((NTSTATUS)0xC0000217L) +#define STATUS_CANNOT_LOAD_REGISTRY_FILE ((NTSTATUS)0xC0000218L) +#define STATUS_DEBUG_ATTACH_FAILED ((NTSTATUS)0xC0000219L) +#define STATUS_SYSTEM_PROCESS_TERMINATED ((NTSTATUS)0xC000021AL) +#define STATUS_DATA_NOT_ACCEPTED ((NTSTATUS)0xC000021BL) +#define STATUS_NO_BROWSER_SERVERS_FOUND ((NTSTATUS)0xC000021CL) +#define STATUS_VDM_HARD_ERROR ((NTSTATUS)0xC000021DL) +#define STATUS_DRIVER_CANCEL_TIMEOUT ((NTSTATUS)0xC000021EL) +#define STATUS_REPLY_MESSAGE_MISMATCH ((NTSTATUS)0xC000021FL) +#define STATUS_MAPPED_ALIGNMENT ((NTSTATUS)0xC0000220L) +#define STATUS_IMAGE_CHECKSUM_MISMATCH ((NTSTATUS)0xC0000221L) +#define STATUS_LOST_WRITEBEHIND_DATA ((NTSTATUS)0xC0000222L) +#define STATUS_CLIENT_SERVER_PARAMETERS_INVALID ((NTSTATUS)0xC0000223L) +#define STATUS_PASSWORD_MUST_CHANGE ((NTSTATUS)0xC0000224L) +#define STATUS_NOT_FOUND ((NTSTATUS)0xC0000225L) +#define STATUS_NOT_TINY_STREAM ((NTSTATUS)0xC0000226L) +#define STATUS_RECOVERY_FAILURE ((NTSTATUS)0xC0000227L) +#define STATUS_STACK_OVERFLOW_READ ((NTSTATUS)0xC0000228L) +#define STATUS_FAIL_CHECK ((NTSTATUS)0xC0000229L) +#define STATUS_DUPLICATE_OBJECTID ((NTSTATUS)0xC000022AL) +#define STATUS_OBJECTID_EXISTS ((NTSTATUS)0xC000022BL) +#define STATUS_CONVERT_TO_LARGE ((NTSTATUS)0xC000022CL) +#define STATUS_RETRY ((NTSTATUS)0xC000022DL) +#define STATUS_FOUND_OUT_OF_SCOPE ((NTSTATUS)0xC000022EL) +#define STATUS_ALLOCATE_BUCKET ((NTSTATUS)0xC000022FL) +#define STATUS_PROPSET_NOT_FOUND ((NTSTATUS)0xC0000230L) +#define STATUS_MARSHALL_OVERFLOW ((NTSTATUS)0xC0000231L) +#define STATUS_INVALID_VARIANT ((NTSTATUS)0xC0000232L) +#define STATUS_DOMAIN_CONTROLLER_NOT_FOUND ((NTSTATUS)0xC0000233L) +#define STATUS_ACCOUNT_LOCKED_OUT ((NTSTATUS)0xC0000234L) +#define STATUS_HANDLE_NOT_CLOSABLE ((NTSTATUS)0xC0000235L) +#define STATUS_CONNECTION_REFUSED ((NTSTATUS)0xC0000236L) +#define STATUS_GRACEFUL_DISCONNECT ((NTSTATUS)0xC0000237L) +#define STATUS_ADDRESS_ALREADY_ASSOCIATED ((NTSTATUS)0xC0000238L) +#define STATUS_ADDRESS_NOT_ASSOCIATED ((NTSTATUS)0xC0000239L) +#define STATUS_CONNECTION_INVALID ((NTSTATUS)0xC000023AL) +#define STATUS_CONNECTION_ACTIVE ((NTSTATUS)0xC000023BL) +#define STATUS_NETWORK_UNREACHABLE ((NTSTATUS)0xC000023CL) +#define STATUS_HOST_UNREACHABLE ((NTSTATUS)0xC000023DL) +#define STATUS_PROTOCOL_UNREACHABLE ((NTSTATUS)0xC000023EL) +#define STATUS_PORT_UNREACHABLE ((NTSTATUS)0xC000023FL) +#define STATUS_REQUEST_ABORTED ((NTSTATUS)0xC0000240L) +#define STATUS_CONNECTION_ABORTED ((NTSTATUS)0xC0000241L) +#define STATUS_BAD_COMPRESSION_BUFFER ((NTSTATUS)0xC0000242L) +#define STATUS_USER_MAPPED_FILE ((NTSTATUS)0xC0000243L) +#define STATUS_AUDIT_FAILED ((NTSTATUS)0xC0000244L) +#define STATUS_TIMER_RESOLUTION_NOT_SET ((NTSTATUS)0xC0000245L) +#define STATUS_CONNECTION_COUNT_LIMIT ((NTSTATUS)0xC0000246L) +#define STATUS_LOGIN_TIME_RESTRICTION ((NTSTATUS)0xC0000247L) +#define STATUS_LOGIN_WKSTA_RESTRICTION ((NTSTATUS)0xC0000248L) +#define STATUS_IMAGE_MP_UP_MISMATCH ((NTSTATUS)0xC0000249L) +#define STATUS_INSUFFICIENT_LOGON_INFO ((NTSTATUS)0xC0000250L) +#define STATUS_BAD_DLL_ENTRYPOINT ((NTSTATUS)0xC0000251L) +#define STATUS_BAD_SERVICE_ENTRYPOINT ((NTSTATUS)0xC0000252L) +#define STATUS_LPC_REPLY_LOST ((NTSTATUS)0xC0000253L) +#define STATUS_IP_ADDRESS_CONFLICT1 ((NTSTATUS)0xC0000254L) +#define STATUS_IP_ADDRESS_CONFLICT2 ((NTSTATUS)0xC0000255L) +#define STATUS_REGISTRY_QUOTA_LIMIT ((NTSTATUS)0xC0000256L) +#define STATUS_PATH_NOT_COVERED ((NTSTATUS)0xC0000257L) +#define STATUS_NO_CALLBACK_ACTIVE ((NTSTATUS)0xC0000258L) +#define STATUS_LICENSE_QUOTA_EXCEEDED ((NTSTATUS)0xC0000259L) +#define STATUS_PWD_TOO_SHORT ((NTSTATUS)0xC000025AL) +#define STATUS_PWD_TOO_RECENT ((NTSTATUS)0xC000025BL) +#define STATUS_PWD_HISTORY_CONFLICT ((NTSTATUS)0xC000025CL) +#define STATUS_PLUGPLAY_NO_DEVICE ((NTSTATUS)0xC000025EL) +#define STATUS_UNSUPPORTED_COMPRESSION ((NTSTATUS)0xC000025FL) +#define STATUS_INVALID_HW_PROFILE ((NTSTATUS)0xC0000260L) +#define STATUS_INVALID_PLUGPLAY_DEVICE_PATH ((NTSTATUS)0xC0000261L) +#define STATUS_DRIVER_ORDINAL_NOT_FOUND ((NTSTATUS)0xC0000262L) +#define STATUS_DRIVER_ENTRYPOINT_NOT_FOUND ((NTSTATUS)0xC0000263L) +#define STATUS_RESOURCE_NOT_OWNED ((NTSTATUS)0xC0000264L) +#define STATUS_TOO_MANY_LINKS ((NTSTATUS)0xC0000265L) +#define STATUS_QUOTA_LIST_INCONSISTENT ((NTSTATUS)0xC0000266L) +#define STATUS_FILE_IS_OFFLINE ((NTSTATUS)0xC0000267L) +#define STATUS_EVALUATION_EXPIRATION ((NTSTATUS)0xC0000268L) +#define STATUS_ILLEGAL_DLL_RELOCATION ((NTSTATUS)0xC0000269L) +#define STATUS_LICENSE_VIOLATION ((NTSTATUS)0xC000026AL) +#define STATUS_DLL_INIT_FAILED_LOGOFF ((NTSTATUS)0xC000026BL) +#define STATUS_DRIVER_UNABLE_TO_LOAD ((NTSTATUS)0xC000026CL) +#define STATUS_DFS_UNAVAILABLE ((NTSTATUS)0xC000026DL) +#define STATUS_VOLUME_DISMOUNTED ((NTSTATUS)0xC000026EL) +#define STATUS_WX86_INTERNAL_ERROR ((NTSTATUS)0xC000026FL) +#define STATUS_WX86_FLOAT_STACK_CHECK ((NTSTATUS)0xC0000270L) +#define STATUS_VALIDATE_CONTINUE ((NTSTATUS)0xC0000271L) +#define STATUS_NO_MATCH ((NTSTATUS)0xC0000272L) +#define STATUS_NO_MORE_MATCHES ((NTSTATUS)0xC0000273L) +#define STATUS_NOT_A_REPARSE_POINT ((NTSTATUS)0xC0000275L) +#define STATUS_IO_REPARSE_TAG_INVALID ((NTSTATUS)0xC0000276L) +#define STATUS_IO_REPARSE_TAG_MISMATCH ((NTSTATUS)0xC0000277L) +#define STATUS_IO_REPARSE_DATA_INVALID ((NTSTATUS)0xC0000278L) +#define STATUS_IO_REPARSE_TAG_NOT_HANDLED ((NTSTATUS)0xC0000279L) +#define STATUS_REPARSE_POINT_NOT_RESOLVED ((NTSTATUS)0xC0000280L) +#define STATUS_DIRECTORY_IS_A_REPARSE_POINT ((NTSTATUS)0xC0000281L) +#define STATUS_RANGE_LIST_CONFLICT ((NTSTATUS)0xC0000282L) +#define STATUS_SOURCE_ELEMENT_EMPTY ((NTSTATUS)0xC0000283L) +#define STATUS_DESTINATION_ELEMENT_FULL ((NTSTATUS)0xC0000284L) +#define STATUS_ILLEGAL_ELEMENT_ADDRESS ((NTSTATUS)0xC0000285L) +#define STATUS_MAGAZINE_NOT_PRESENT ((NTSTATUS)0xC0000286L) +#define STATUS_REINITIALIZATION_NEEDED ((NTSTATUS)0xC0000287L) +#define STATUS_DEVICE_REQUIRES_CLEANING ((NTSTATUS)0x80000288L) +#define STATUS_DEVICE_DOOR_OPEN ((NTSTATUS)0x80000289L) +#define STATUS_ENCRYPTION_FAILED ((NTSTATUS)0xC000028AL) +#define STATUS_DECRYPTION_FAILED ((NTSTATUS)0xC000028BL) +#define STATUS_RANGE_NOT_FOUND ((NTSTATUS)0xC000028CL) +#define STATUS_NO_RECOVERY_POLICY ((NTSTATUS)0xC000028DL) +#define STATUS_NO_EFS ((NTSTATUS)0xC000028EL) +#define STATUS_WRONG_EFS ((NTSTATUS)0xC000028FL) +#define STATUS_NO_USER_KEYS ((NTSTATUS)0xC0000290L) +#define STATUS_FILE_NOT_ENCRYPTED ((NTSTATUS)0xC0000291L) +#define STATUS_NOT_EXPORT_FORMAT ((NTSTATUS)0xC0000292L) +#define STATUS_FILE_ENCRYPTED ((NTSTATUS)0xC0000293L) +#define STATUS_WAKE_SYSTEM ((NTSTATUS)0x40000294L) +#define STATUS_WMI_GUID_NOT_FOUND ((NTSTATUS)0xC0000295L) +#define STATUS_WMI_INSTANCE_NOT_FOUND ((NTSTATUS)0xC0000296L) +#define STATUS_WMI_ITEMID_NOT_FOUND ((NTSTATUS)0xC0000297L) +#define STATUS_WMI_TRY_AGAIN ((NTSTATUS)0xC0000298L) +#define STATUS_SHARED_POLICY ((NTSTATUS)0xC0000299L) +#define STATUS_POLICY_OBJECT_NOT_FOUND ((NTSTATUS)0xC000029AL) +#define STATUS_POLICY_ONLY_IN_DS ((NTSTATUS)0xC000029BL) +#define STATUS_VOLUME_NOT_UPGRADED ((NTSTATUS)0xC000029CL) +#define STATUS_REMOTE_STORAGE_NOT_ACTIVE ((NTSTATUS)0xC000029DL) +#define STATUS_REMOTE_STORAGE_MEDIA_ERROR ((NTSTATUS)0xC000029EL) +#define STATUS_NO_TRACKING_SERVICE ((NTSTATUS)0xC000029FL) +#define STATUS_SERVER_SID_MISMATCH ((NTSTATUS)0xC00002A0L) +#define STATUS_DS_NO_ATTRIBUTE_OR_VALUE ((NTSTATUS)0xC00002A1L) +#define STATUS_DS_INVALID_ATTRIBUTE_SYNTAX ((NTSTATUS)0xC00002A2L) +#define STATUS_DS_ATTRIBUTE_TYPE_UNDEFINED ((NTSTATUS)0xC00002A3L) +#define STATUS_DS_ATTRIBUTE_OR_VALUE_EXISTS ((NTSTATUS)0xC00002A4L) +#define STATUS_DS_BUSY ((NTSTATUS)0xC00002A5L) +#define STATUS_DS_UNAVAILABLE ((NTSTATUS)0xC00002A6L) +#define STATUS_DS_NO_RIDS_ALLOCATED ((NTSTATUS)0xC00002A7L) +#define STATUS_DS_NO_MORE_RIDS ((NTSTATUS)0xC00002A8L) +#define STATUS_DS_INCORRECT_ROLE_OWNER ((NTSTATUS)0xC00002A9L) +#define STATUS_DS_RIDMGR_INIT_ERROR ((NTSTATUS)0xC00002AAL) +#define STATUS_DS_OBJ_CLASS_VIOLATION ((NTSTATUS)0xC00002ABL) +#define STATUS_DS_CANT_ON_NON_LEAF ((NTSTATUS)0xC00002ACL) +#define STATUS_DS_CANT_ON_RDN ((NTSTATUS)0xC00002ADL) +#define STATUS_DS_CANT_MOD_OBJ_CLASS ((NTSTATUS)0xC00002AEL) +#define STATUS_DS_CROSS_DOM_MOVE_FAILED ((NTSTATUS)0xC00002AFL) +#define STATUS_DS_GC_NOT_AVAILABLE ((NTSTATUS)0xC00002B0L) +#define STATUS_DIRECTORY_SERVICE_REQUIRED ((NTSTATUS)0xC00002B1L) +#define STATUS_REPARSE_ATTRIBUTE_CONFLICT ((NTSTATUS)0xC00002B2L) +#define STATUS_CANT_ENABLE_DENY_ONLY ((NTSTATUS)0xC00002B3L) +#define STATUS_FLOAT_MULTIPLE_FAULTS ((NTSTATUS)0xC00002B4L) +#define STATUS_FLOAT_MULTIPLE_TRAPS ((NTSTATUS)0xC00002B5L) +#define STATUS_DEVICE_REMOVED ((NTSTATUS)0xC00002B6L) +#define STATUS_JOURNAL_DELETE_IN_PROGRESS ((NTSTATUS)0xC00002B7L) +#define STATUS_JOURNAL_NOT_ACTIVE ((NTSTATUS)0xC00002B8L) +#define STATUS_NOINTERFACE ((NTSTATUS)0xC00002B9L) +#define STATUS_DS_ADMIN_LIMIT_EXCEEDED ((NTSTATUS)0xC00002C1L) +#define STATUS_DRIVER_FAILED_SLEEP ((NTSTATUS)0xC00002C2L) +#define STATUS_MUTUAL_AUTHENTICATION_FAILED ((NTSTATUS)0xC00002C3L) +#define STATUS_CORRUPT_SYSTEM_FILE ((NTSTATUS)0xC00002C4L) +#define STATUS_DATATYPE_MISALIGNMENT_ERROR ((NTSTATUS)0xC00002C5L) +#define STATUS_WMI_READ_ONLY ((NTSTATUS)0xC00002C6L) +#define STATUS_WMI_SET_FAILURE ((NTSTATUS)0xC00002C7L) +#define STATUS_COMMITMENT_MINIMUM ((NTSTATUS)0xC00002C8L) +#define STATUS_REG_NAT_CONSUMPTION ((NTSTATUS)0xC00002C9L) +#define STATUS_TRANSPORT_FULL ((NTSTATUS)0xC00002CAL) +#define STATUS_DS_SAM_INIT_FAILURE ((NTSTATUS)0xC00002CBL) +#define STATUS_ONLY_IF_CONNECTED ((NTSTATUS)0xC00002CCL) +#define STATUS_DS_SENSITIVE_GROUP_VIOLATION ((NTSTATUS)0xC00002CDL) +#define STATUS_PNP_RESTART_ENUMERATION ((NTSTATUS)0xC00002CEL) +#define STATUS_JOURNAL_ENTRY_DELETED ((NTSTATUS)0xC00002CFL) +#define STATUS_DS_CANT_MOD_PRIMARYGROUPID ((NTSTATUS)0xC00002D0L) +#define STATUS_SYSTEM_IMAGE_BAD_SIGNATURE ((NTSTATUS)0xC00002D1L) +#define STATUS_PNP_REBOOT_REQUIRED ((NTSTATUS)0xC00002D2L) +#define STATUS_POWER_STATE_INVALID ((NTSTATUS)0xC00002D3L) +#define STATUS_DS_INVALID_GROUP_TYPE ((NTSTATUS)0xC00002D4L) +#define STATUS_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN ((NTSTATUS)0xC00002D5L) +#define STATUS_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN ((NTSTATUS)0xC00002D6L) +#define STATUS_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER ((NTSTATUS)0xC00002D7L) +#define STATUS_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER ((NTSTATUS)0xC00002D8L) +#define STATUS_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER ((NTSTATUS)0xC00002D9L) +#define STATUS_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER ((NTSTATUS)0xC00002DAL) +#define STATUS_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER ((NTSTATUS)0xC00002DBL) +#define STATUS_DS_HAVE_PRIMARY_MEMBERS ((NTSTATUS)0xC00002DCL) +#define STATUS_WMI_NOT_SUPPORTED ((NTSTATUS)0xC00002DDL) +#define STATUS_INSUFFICIENT_POWER ((NTSTATUS)0xC00002DEL) +#define STATUS_SAM_NEED_BOOTKEY_PASSWORD ((NTSTATUS)0xC00002DFL) +#define STATUS_SAM_NEED_BOOTKEY_FLOPPY ((NTSTATUS)0xC00002E0L) +#define STATUS_DS_CANT_START ((NTSTATUS)0xC00002E1L) +#define STATUS_DS_INIT_FAILURE ((NTSTATUS)0xC00002E2L) +#define STATUS_SAM_INIT_FAILURE ((NTSTATUS)0xC00002E3L) +#define STATUS_DS_GC_REQUIRED ((NTSTATUS)0xC00002E4L) +#define STATUS_DS_LOCAL_MEMBER_OF_LOCAL_ONLY ((NTSTATUS)0xC00002E5L) +#define STATUS_DS_NO_FPO_IN_UNIVERSAL_GROUPS ((NTSTATUS)0xC00002E6L) +#define STATUS_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED ((NTSTATUS)0xC00002E7L) +#define STATUS_MULTIPLE_FAULT_VIOLATION ((NTSTATUS)0xC00002E8L) +#define STATUS_CURRENT_DOMAIN_NOT_ALLOWED ((NTSTATUS)0xC00002E9L) +#define STATUS_CANNOT_MAKE ((NTSTATUS)0xC00002EAL) +#define STATUS_SYSTEM_SHUTDOWN ((NTSTATUS)0xC00002EBL) +#define STATUS_DS_INIT_FAILURE_CONSOLE ((NTSTATUS)0xC00002ECL) +#define STATUS_DS_SAM_INIT_FAILURE_CONSOLE ((NTSTATUS)0xC00002EDL) +#define STATUS_UNFINISHED_CONTEXT_DELETED ((NTSTATUS)0xC00002EEL) +#define STATUS_NO_TGT_REPLY ((NTSTATUS)0xC00002EFL) +#define STATUS_OBJECTID_NOT_FOUND ((NTSTATUS)0xC00002F0L) +#define STATUS_NO_IP_ADDRESSES ((NTSTATUS)0xC00002F1L) +#define STATUS_WRONG_CREDENTIAL_HANDLE ((NTSTATUS)0xC00002F2L) +#define STATUS_CRYPTO_SYSTEM_INVALID ((NTSTATUS)0xC00002F3L) +#define STATUS_MAX_REFERRALS_EXCEEDED ((NTSTATUS)0xC00002F4L) +#define STATUS_MUST_BE_KDC ((NTSTATUS)0xC00002F5L) +#define STATUS_STRONG_CRYPTO_NOT_SUPPORTED ((NTSTATUS)0xC00002F6L) +#define STATUS_TOO_MANY_PRINCIPALS ((NTSTATUS)0xC00002F7L) +#define STATUS_NO_PA_DATA ((NTSTATUS)0xC00002F8L) +#define STATUS_PKINIT_NAME_MISMATCH ((NTSTATUS)0xC00002F9L) +#define STATUS_SMARTCARD_LOGON_REQUIRED ((NTSTATUS)0xC00002FAL) +#define STATUS_KDC_INVALID_REQUEST ((NTSTATUS)0xC00002FBL) +#define STATUS_KDC_UNABLE_TO_REFER ((NTSTATUS)0xC00002FCL) +#define STATUS_KDC_UNKNOWN_ETYPE ((NTSTATUS)0xC00002FDL) +#define STATUS_SHUTDOWN_IN_PROGRESS ((NTSTATUS)0xC00002FEL) +#define STATUS_SERVER_SHUTDOWN_IN_PROGRESS ((NTSTATUS)0xC00002FFL) +#define STATUS_NOT_SUPPORTED_ON_SBS ((NTSTATUS)0xC0000300L) +#define STATUS_WMI_GUID_DISCONNECTED ((NTSTATUS)0xC0000301L) +#define STATUS_WMI_ALREADY_DISABLED ((NTSTATUS)0xC0000302L) +#define STATUS_WMI_ALREADY_ENABLED ((NTSTATUS)0xC0000303L) +#define STATUS_MFT_TOO_FRAGMENTED ((NTSTATUS)0xC0000304L) +#define STATUS_COPY_PROTECTION_FAILURE ((NTSTATUS)0xC0000305L) +#define STATUS_CSS_AUTHENTICATION_FAILURE ((NTSTATUS)0xC0000306L) +#define STATUS_CSS_KEY_NOT_PRESENT ((NTSTATUS)0xC0000307L) +#define STATUS_CSS_KEY_NOT_ESTABLISHED ((NTSTATUS)0xC0000308L) +#define STATUS_CSS_SCRAMBLED_SECTOR ((NTSTATUS)0xC0000309L) +#define STATUS_CSS_REGION_MISMATCH ((NTSTATUS)0xC000030AL) +#define STATUS_CSS_RESETS_EXHAUSTED ((NTSTATUS)0xC000030BL) +#define STATUS_PKINIT_FAILURE ((NTSTATUS)0xC0000320L) +#define STATUS_SMARTCARD_SUBSYSTEM_FAILURE ((NTSTATUS)0xC0000321L) +#define STATUS_NO_KERB_KEY ((NTSTATUS)0xC0000322L) +#define STATUS_HOST_DOWN ((NTSTATUS)0xC0000350L) +#define STATUS_UNSUPPORTED_PREAUTH ((NTSTATUS)0xC0000351L) +#define STATUS_EFS_ALG_BLOB_TOO_BIG ((NTSTATUS)0xC0000352L) +#define STATUS_PORT_NOT_SET ((NTSTATUS)0xC0000353L) +#define STATUS_DEBUGGER_INACTIVE ((NTSTATUS)0xC0000354L) +#define STATUS_DS_VERSION_CHECK_FAILURE ((NTSTATUS)0xC0000355L) +#define STATUS_AUDITING_DISABLED ((NTSTATUS)0xC0000356L) +#define STATUS_PRENT4_MACHINE_ACCOUNT ((NTSTATUS)0xC0000357L) +#define STATUS_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER ((NTSTATUS)0xC0000358L) +#define STATUS_INVALID_IMAGE_WIN_32 ((NTSTATUS)0xC0000359L) +#define STATUS_INVALID_IMAGE_WIN_64 ((NTSTATUS)0xC000035AL) +#define STATUS_BAD_BINDINGS ((NTSTATUS)0xC000035BL) +#define STATUS_NETWORK_SESSION_EXPIRED ((NTSTATUS)0xC000035CL) +#define STATUS_APPHELP_BLOCK ((NTSTATUS)0xC000035DL) +#define STATUS_ALL_SIDS_FILTERED ((NTSTATUS)0xC000035EL) +#define STATUS_NOT_SAFE_MODE_DRIVER ((NTSTATUS)0xC000035FL) +#define STATUS_ACCESS_DISABLED_BY_POLICY_DEFAULT ((NTSTATUS)0xC0000361L) +#define STATUS_ACCESS_DISABLED_BY_POLICY_PATH ((NTSTATUS)0xC0000362L) +#define STATUS_ACCESS_DISABLED_BY_POLICY_PUBLISHER ((NTSTATUS)0xC0000363L) +#define STATUS_ACCESS_DISABLED_BY_POLICY_OTHER ((NTSTATUS)0xC0000364L) +#define STATUS_FAILED_DRIVER_ENTRY ((NTSTATUS)0xC0000365L) +#define STATUS_DEVICE_ENUMERATION_ERROR ((NTSTATUS)0xC0000366L) +#define STATUS_WAIT_FOR_OPLOCK ((NTSTATUS)0x00000367L) +#define STATUS_MOUNT_POINT_NOT_RESOLVED ((NTSTATUS)0xC0000368L) +#define STATUS_INVALID_DEVICE_OBJECT_PARAMETER ((NTSTATUS)0xC0000369L) +#define STATUS_MCA_OCCURED ((NTSTATUS)0xC000036AL) +#define STATUS_DRIVER_BLOCKED_CRITICAL ((NTSTATUS)0xC000036BL) +#define STATUS_DRIVER_BLOCKED ((NTSTATUS)0xC000036CL) +#define STATUS_DRIVER_DATABASE_ERROR ((NTSTATUS)0xC000036DL) +#define STATUS_SYSTEM_HIVE_TOO_LARGE ((NTSTATUS)0xC000036EL) +#define STATUS_INVALID_IMPORT_OF_NON_DLL ((NTSTATUS)0xC000036FL) +#define STATUS_DS_SHUTTING_DOWN ((NTSTATUS)0x40000370L) +#define STATUS_SMARTCARD_WRONG_PIN ((NTSTATUS)0xC0000380L) +#define STATUS_SMARTCARD_CARD_BLOCKED ((NTSTATUS)0xC0000381L) +#define STATUS_SMARTCARD_CARD_NOT_AUTHENTICATED ((NTSTATUS)0xC0000382L) +#define STATUS_SMARTCARD_NO_CARD ((NTSTATUS)0xC0000383L) +#define STATUS_SMARTCARD_NO_KEY_CONTAINER ((NTSTATUS)0xC0000384L) +#define STATUS_SMARTCARD_NO_CERTIFICATE ((NTSTATUS)0xC0000385L) +#define STATUS_SMARTCARD_NO_KEYSET ((NTSTATUS)0xC0000386L) +#define STATUS_SMARTCARD_IO_ERROR ((NTSTATUS)0xC0000387L) +#define STATUS_DOWNGRADE_DETECTED ((NTSTATUS)0xC0000388L) +#define STATUS_SMARTCARD_CERT_REVOKED ((NTSTATUS)0xC0000389L) +#define STATUS_ISSUING_CA_UNTRUSTED ((NTSTATUS)0xC000038AL) +#define STATUS_REVOCATION_OFFLINE_C ((NTSTATUS)0xC000038BL) +#define STATUS_PKINIT_CLIENT_FAILURE ((NTSTATUS)0xC000038CL) +#define STATUS_SMARTCARD_CERT_EXPIRED ((NTSTATUS)0xC000038DL) +#define STATUS_DRIVER_FAILED_PRIOR_UNLOAD ((NTSTATUS)0xC000038EL) +#define STATUS_WOW_ASSERTION ((NTSTATUS)0xC0009898L) +#define RPC_NT_INVALID_STRING_BINDING ((NTSTATUS)0xC0020001L) +#define RPC_NT_WRONG_KIND_OF_BINDING ((NTSTATUS)0xC0020002L) +#define RPC_NT_INVALID_BINDING ((NTSTATUS)0xC0020003L) +#define RPC_NT_PROTSEQ_NOT_SUPPORTED ((NTSTATUS)0xC0020004L) +#define RPC_NT_INVALID_RPC_PROTSEQ ((NTSTATUS)0xC0020005L) +#define RPC_NT_INVALID_STRING_UUID ((NTSTATUS)0xC0020006L) +#define RPC_NT_INVALID_ENDPOINT_FORMAT ((NTSTATUS)0xC0020007L) +#define RPC_NT_INVALID_NET_ADDR ((NTSTATUS)0xC0020008L) +#define RPC_NT_NO_ENDPOINT_FOUND ((NTSTATUS)0xC0020009L) +#define RPC_NT_INVALID_TIMEOUT ((NTSTATUS)0xC002000AL) +#define RPC_NT_OBJECT_NOT_FOUND ((NTSTATUS)0xC002000BL) +#define RPC_NT_ALREADY_REGISTERED ((NTSTATUS)0xC002000CL) +#define RPC_NT_TYPE_ALREADY_REGISTERED ((NTSTATUS)0xC002000DL) +#define RPC_NT_ALREADY_LISTENING ((NTSTATUS)0xC002000EL) +#define RPC_NT_NO_PROTSEQS_REGISTERED ((NTSTATUS)0xC002000FL) +#define RPC_NT_NOT_LISTENING ((NTSTATUS)0xC0020010L) +#define RPC_NT_UNKNOWN_MGR_TYPE ((NTSTATUS)0xC0020011L) +#define RPC_NT_UNKNOWN_IF ((NTSTATUS)0xC0020012L) +#define RPC_NT_NO_BINDINGS ((NTSTATUS)0xC0020013L) +#define RPC_NT_NO_PROTSEQS ((NTSTATUS)0xC0020014L) +#define RPC_NT_CANT_CREATE_ENDPOINT ((NTSTATUS)0xC0020015L) +#define RPC_NT_OUT_OF_RESOURCES ((NTSTATUS)0xC0020016L) +#define RPC_NT_SERVER_UNAVAILABLE ((NTSTATUS)0xC0020017L) +#define RPC_NT_SERVER_TOO_BUSY ((NTSTATUS)0xC0020018L) +#define RPC_NT_INVALID_NETWORK_OPTIONS ((NTSTATUS)0xC0020019L) +#define RPC_NT_NO_CALL_ACTIVE ((NTSTATUS)0xC002001AL) +#define RPC_NT_CALL_FAILED ((NTSTATUS)0xC002001BL) +#define RPC_NT_CALL_FAILED_DNE ((NTSTATUS)0xC002001CL) +#define RPC_NT_PROTOCOL_ERROR ((NTSTATUS)0xC002001DL) +#define RPC_NT_UNSUPPORTED_TRANS_SYN ((NTSTATUS)0xC002001FL) +#define RPC_NT_UNSUPPORTED_TYPE ((NTSTATUS)0xC0020021L) +#define RPC_NT_INVALID_TAG ((NTSTATUS)0xC0020022L) +#define RPC_NT_INVALID_BOUND ((NTSTATUS)0xC0020023L) +#define RPC_NT_NO_ENTRY_NAME ((NTSTATUS)0xC0020024L) +#define RPC_NT_INVALID_NAME_SYNTAX ((NTSTATUS)0xC0020025L) +#define RPC_NT_UNSUPPORTED_NAME_SYNTAX ((NTSTATUS)0xC0020026L) +#define RPC_NT_UUID_NO_ADDRESS ((NTSTATUS)0xC0020028L) +#define RPC_NT_DUPLICATE_ENDPOINT ((NTSTATUS)0xC0020029L) +#define RPC_NT_UNKNOWN_AUTHN_TYPE ((NTSTATUS)0xC002002AL) +#define RPC_NT_MAX_CALLS_TOO_SMALL ((NTSTATUS)0xC002002BL) +#define RPC_NT_STRING_TOO_LONG ((NTSTATUS)0xC002002CL) +#define RPC_NT_PROTSEQ_NOT_FOUND ((NTSTATUS)0xC002002DL) +#define RPC_NT_PROCNUM_OUT_OF_RANGE ((NTSTATUS)0xC002002EL) +#define RPC_NT_BINDING_HAS_NO_AUTH ((NTSTATUS)0xC002002FL) +#define RPC_NT_UNKNOWN_AUTHN_SERVICE ((NTSTATUS)0xC0020030L) +#define RPC_NT_UNKNOWN_AUTHN_LEVEL ((NTSTATUS)0xC0020031L) +#define RPC_NT_INVALID_AUTH_IDENTITY ((NTSTATUS)0xC0020032L) +#define RPC_NT_UNKNOWN_AUTHZ_SERVICE ((NTSTATUS)0xC0020033L) +#define EPT_NT_INVALID_ENTRY ((NTSTATUS)0xC0020034L) +#define EPT_NT_CANT_PERFORM_OP ((NTSTATUS)0xC0020035L) +#define EPT_NT_NOT_REGISTERED ((NTSTATUS)0xC0020036L) +#define RPC_NT_NOTHING_TO_EXPORT ((NTSTATUS)0xC0020037L) +#define RPC_NT_INCOMPLETE_NAME ((NTSTATUS)0xC0020038L) +#define RPC_NT_INVALID_VERS_OPTION ((NTSTATUS)0xC0020039L) +#define RPC_NT_NO_MORE_MEMBERS ((NTSTATUS)0xC002003AL) +#define RPC_NT_NOT_ALL_OBJS_UNEXPORTED ((NTSTATUS)0xC002003BL) +#define RPC_NT_INTERFACE_NOT_FOUND ((NTSTATUS)0xC002003CL) +#define RPC_NT_ENTRY_ALREADY_EXISTS ((NTSTATUS)0xC002003DL) +#define RPC_NT_ENTRY_NOT_FOUND ((NTSTATUS)0xC002003EL) +#define RPC_NT_NAME_SERVICE_UNAVAILABLE ((NTSTATUS)0xC002003FL) +#define RPC_NT_INVALID_NAF_ID ((NTSTATUS)0xC0020040L) +#define RPC_NT_CANNOT_SUPPORT ((NTSTATUS)0xC0020041L) +#define RPC_NT_NO_CONTEXT_AVAILABLE ((NTSTATUS)0xC0020042L) +#define RPC_NT_INTERNAL_ERROR ((NTSTATUS)0xC0020043L) +#define RPC_NT_ZERO_DIVIDE ((NTSTATUS)0xC0020044L) +#define RPC_NT_ADDRESS_ERROR ((NTSTATUS)0xC0020045L) +#define RPC_NT_FP_DIV_ZERO ((NTSTATUS)0xC0020046L) +#define RPC_NT_FP_UNDERFLOW ((NTSTATUS)0xC0020047L) +#define RPC_NT_FP_OVERFLOW ((NTSTATUS)0xC0020048L) +#define RPC_NT_NO_MORE_ENTRIES ((NTSTATUS)0xC0030001L) +#define RPC_NT_SS_CHAR_TRANS_OPEN_FAIL ((NTSTATUS)0xC0030002L) +#define RPC_NT_SS_CHAR_TRANS_SHORT_FILE ((NTSTATUS)0xC0030003L) +#define RPC_NT_SS_IN_NULL_CONTEXT ((NTSTATUS)0xC0030004L) +#define RPC_NT_SS_CONTEXT_MISMATCH ((NTSTATUS)0xC0030005L) +#define RPC_NT_SS_CONTEXT_DAMAGED ((NTSTATUS)0xC0030006L) +#define RPC_NT_SS_HANDLES_MISMATCH ((NTSTATUS)0xC0030007L) +#define RPC_NT_SS_CANNOT_GET_CALL_HANDLE ((NTSTATUS)0xC0030008L) +#define RPC_NT_NULL_REF_POINTER ((NTSTATUS)0xC0030009L) +#define RPC_NT_ENUM_VALUE_OUT_OF_RANGE ((NTSTATUS)0xC003000AL) +#define RPC_NT_BYTE_COUNT_TOO_SMALL ((NTSTATUS)0xC003000BL) +#define RPC_NT_BAD_STUB_DATA ((NTSTATUS)0xC003000CL) +#define RPC_NT_CALL_IN_PROGRESS ((NTSTATUS)0xC0020049L) +#define RPC_NT_NO_MORE_BINDINGS ((NTSTATUS)0xC002004AL) +#define RPC_NT_GROUP_MEMBER_NOT_FOUND ((NTSTATUS)0xC002004BL) +#define EPT_NT_CANT_CREATE ((NTSTATUS)0xC002004CL) +#define RPC_NT_INVALID_OBJECT ((NTSTATUS)0xC002004DL) +#define RPC_NT_NO_INTERFACES ((NTSTATUS)0xC002004FL) +#define RPC_NT_CALL_CANCELLED ((NTSTATUS)0xC0020050L) +#define RPC_NT_BINDING_INCOMPLETE ((NTSTATUS)0xC0020051L) +#define RPC_NT_COMM_FAILURE ((NTSTATUS)0xC0020052L) +#define RPC_NT_UNSUPPORTED_AUTHN_LEVEL ((NTSTATUS)0xC0020053L) +#define RPC_NT_NO_PRINC_NAME ((NTSTATUS)0xC0020054L) +#define RPC_NT_NOT_RPC_ERROR ((NTSTATUS)0xC0020055L) +#define RPC_NT_UUID_LOCAL_ONLY ((NTSTATUS)0x40020056L) +#define RPC_NT_SEC_PKG_ERROR ((NTSTATUS)0xC0020057L) +#define RPC_NT_NOT_CANCELLED ((NTSTATUS)0xC0020058L) +#define RPC_NT_INVALID_ES_ACTION ((NTSTATUS)0xC0030059L) +#define RPC_NT_WRONG_ES_VERSION ((NTSTATUS)0xC003005AL) +#define RPC_NT_WRONG_STUB_VERSION ((NTSTATUS)0xC003005BL) +#define RPC_NT_INVALID_PIPE_OBJECT ((NTSTATUS)0xC003005CL) +#define RPC_NT_INVALID_PIPE_OPERATION ((NTSTATUS)0xC003005DL) +#define RPC_NT_WRONG_PIPE_VERSION ((NTSTATUS)0xC003005EL) +#define RPC_NT_PIPE_CLOSED ((NTSTATUS)0xC003005FL) +#define RPC_NT_PIPE_DISCIPLINE_ERROR ((NTSTATUS)0xC0030060L) +#define RPC_NT_PIPE_EMPTY ((NTSTATUS)0xC0030061L) +#define RPC_NT_INVALID_ASYNC_HANDLE ((NTSTATUS)0xC0020062L) +#define RPC_NT_INVALID_ASYNC_CALL ((NTSTATUS)0xC0020063L) +#define RPC_NT_SEND_INCOMPLETE ((NTSTATUS)0x400200AFL) +#define STATUS_ACPI_INVALID_OPCODE ((NTSTATUS)0xC0140001L) +#define STATUS_ACPI_STACK_OVERFLOW ((NTSTATUS)0xC0140002L) +#define STATUS_ACPI_ASSERT_FAILED ((NTSTATUS)0xC0140003L) +#define STATUS_ACPI_INVALID_INDEX ((NTSTATUS)0xC0140004L) +#define STATUS_ACPI_INVALID_ARGUMENT ((NTSTATUS)0xC0140005L) +#define STATUS_ACPI_FATAL ((NTSTATUS)0xC0140006L) +#define STATUS_ACPI_INVALID_SUPERNAME ((NTSTATUS)0xC0140007L) +#define STATUS_ACPI_INVALID_ARGTYPE ((NTSTATUS)0xC0140008L) +#define STATUS_ACPI_INVALID_OBJTYPE ((NTSTATUS)0xC0140009L) +#define STATUS_ACPI_INVALID_TARGETTYPE ((NTSTATUS)0xC014000AL) +#define STATUS_ACPI_INCORRECT_ARGUMENT_COUNT ((NTSTATUS)0xC014000BL) +#define STATUS_ACPI_ADDRESS_NOT_MAPPED ((NTSTATUS)0xC014000CL) +#define STATUS_ACPI_INVALID_EVENTTYPE ((NTSTATUS)0xC014000DL) +#define STATUS_ACPI_HANDLER_COLLISION ((NTSTATUS)0xC014000EL) +#define STATUS_ACPI_INVALID_DATA ((NTSTATUS)0xC014000FL) +#define STATUS_ACPI_INVALID_REGION ((NTSTATUS)0xC0140010L) +#define STATUS_ACPI_INVALID_ACCESS_SIZE ((NTSTATUS)0xC0140011L) +#define STATUS_ACPI_ACQUIRE_GLOBAL_LOCK ((NTSTATUS)0xC0140012L) +#define STATUS_ACPI_ALREADY_INITIALIZED ((NTSTATUS)0xC0140013L) +#define STATUS_ACPI_NOT_INITIALIZED ((NTSTATUS)0xC0140014L) +#define STATUS_ACPI_INVALID_MUTEX_LEVEL ((NTSTATUS)0xC0140015L) +#define STATUS_ACPI_MUTEX_NOT_OWNED ((NTSTATUS)0xC0140016L) +#define STATUS_ACPI_MUTEX_NOT_OWNER ((NTSTATUS)0xC0140017L) +#define STATUS_ACPI_RS_ACCESS ((NTSTATUS)0xC0140018L) +#define STATUS_ACPI_INVALID_TABLE ((NTSTATUS)0xC0140019L) +#define STATUS_ACPI_REG_HANDLER_FAILED ((NTSTATUS)0xC0140020L) +#define STATUS_ACPI_POWER_REQUEST_FAILED ((NTSTATUS)0xC0140021L) +#define STATUS_CTX_WINSTATION_NAME_INVALID ((NTSTATUS)0xC00A0001L) +#define STATUS_CTX_INVALID_PD ((NTSTATUS)0xC00A0002L) +#define STATUS_CTX_PD_NOT_FOUND ((NTSTATUS)0xC00A0003L) +#define STATUS_CTX_CDM_CONNECT ((NTSTATUS)0x400A0004L) +#define STATUS_CTX_CDM_DISCONNECT ((NTSTATUS)0x400A0005L) +#define STATUS_CTX_CLOSE_PENDING ((NTSTATUS)0xC00A0006L) +#define STATUS_CTX_NO_OUTBUF ((NTSTATUS)0xC00A0007L) +#define STATUS_CTX_MODEM_INF_NOT_FOUND ((NTSTATUS)0xC00A0008L) +#define STATUS_CTX_INVALID_MODEMNAME ((NTSTATUS)0xC00A0009L) +#define STATUS_CTX_RESPONSE_ERROR ((NTSTATUS)0xC00A000AL) +#define STATUS_CTX_MODEM_RESPONSE_TIMEOUT ((NTSTATUS)0xC00A000BL) +#define STATUS_CTX_MODEM_RESPONSE_NO_CARRIER ((NTSTATUS)0xC00A000CL) +#define STATUS_CTX_MODEM_RESPONSE_NO_DIALTONE ((NTSTATUS)0xC00A000DL) +#define STATUS_CTX_MODEM_RESPONSE_BUSY ((NTSTATUS)0xC00A000EL) +#define STATUS_CTX_MODEM_RESPONSE_VOICE ((NTSTATUS)0xC00A000FL) +#define STATUS_CTX_TD_ERROR ((NTSTATUS)0xC00A0010L) +#define STATUS_CTX_LICENSE_CLIENT_INVALID ((NTSTATUS)0xC00A0012L) +#define STATUS_CTX_LICENSE_NOT_AVAILABLE ((NTSTATUS)0xC00A0013L) +#define STATUS_CTX_LICENSE_EXPIRED ((NTSTATUS)0xC00A0014L) +#define STATUS_CTX_WINSTATION_NOT_FOUND ((NTSTATUS)0xC00A0015L) +#define STATUS_CTX_WINSTATION_NAME_COLLISION ((NTSTATUS)0xC00A0016L) +#define STATUS_CTX_WINSTATION_BUSY ((NTSTATUS)0xC00A0017L) +#define STATUS_CTX_BAD_VIDEO_MODE ((NTSTATUS)0xC00A0018L) +#define STATUS_CTX_GRAPHICS_INVALID ((NTSTATUS)0xC00A0022L) +#define STATUS_CTX_NOT_CONSOLE ((NTSTATUS)0xC00A0024L) +#define STATUS_CTX_CLIENT_QUERY_TIMEOUT ((NTSTATUS)0xC00A0026L) +#define STATUS_CTX_CONSOLE_DISCONNECT ((NTSTATUS)0xC00A0027L) +#define STATUS_CTX_CONSOLE_CONNECT ((NTSTATUS)0xC00A0028L) +#define STATUS_CTX_SHADOW_DENIED ((NTSTATUS)0xC00A002AL) +#define STATUS_CTX_WINSTATION_ACCESS_DENIED ((NTSTATUS)0xC00A002BL) +#define STATUS_CTX_INVALID_WD ((NTSTATUS)0xC00A002EL) +#define STATUS_CTX_WD_NOT_FOUND ((NTSTATUS)0xC00A002FL) +#define STATUS_CTX_SHADOW_INVALID ((NTSTATUS)0xC00A0030L) +#define STATUS_CTX_SHADOW_DISABLED ((NTSTATUS)0xC00A0031L) +#define STATUS_RDP_PROTOCOL_ERROR ((NTSTATUS)0xC00A0032L) +#define STATUS_CTX_CLIENT_LICENSE_NOT_SET ((NTSTATUS)0xC00A0033L) +#define STATUS_CTX_CLIENT_LICENSE_IN_USE ((NTSTATUS)0xC00A0034L) +#define STATUS_CTX_SHADOW_ENDED_BY_MODE_CHANGE ((NTSTATUS)0xC00A0035L) +#define STATUS_CTX_SHADOW_NOT_RUNNING ((NTSTATUS)0xC00A0036L) +#define STATUS_PNP_BAD_MPS_TABLE ((NTSTATUS)0xC0040035L) +#define STATUS_PNP_TRANSLATION_FAILED ((NTSTATUS)0xC0040036L) +#define STATUS_PNP_IRQ_TRANSLATION_FAILED ((NTSTATUS)0xC0040037L) +#define STATUS_SXS_SECTION_NOT_FOUND ((NTSTATUS)0xC0150001L) +#define STATUS_SXS_CANT_GEN_ACTCTX ((NTSTATUS)0xC0150002L) +#define STATUS_SXS_INVALID_ACTCTXDATA_FORMAT ((NTSTATUS)0xC0150003L) +#define STATUS_SXS_ASSEMBLY_NOT_FOUND ((NTSTATUS)0xC0150004L) +#define STATUS_SXS_MANIFEST_FORMAT_ERROR ((NTSTATUS)0xC0150005L) +#define STATUS_SXS_MANIFEST_PARSE_ERROR ((NTSTATUS)0xC0150006L) +#define STATUS_SXS_ACTIVATION_CONTEXT_DISABLED ((NTSTATUS)0xC0150007L) +#define STATUS_SXS_KEY_NOT_FOUND ((NTSTATUS)0xC0150008L) +#define STATUS_SXS_VERSION_CONFLICT ((NTSTATUS)0xC0150009L) +#define STATUS_SXS_WRONG_SECTION_TYPE ((NTSTATUS)0xC015000AL) +#define STATUS_SXS_THREAD_QUERIES_DISABLED ((NTSTATUS)0xC015000BL) +#define STATUS_SXS_ASSEMBLY_MISSING ((NTSTATUS)0xC015000CL) +#define STATUS_SXS_RELEASE_ACTIVATION_CONTEXT ((NTSTATUS)0x4015000DL) +#define STATUS_SXS_PROCESS_DEFAULT_ALREADY_SET ((NTSTATUS)0xC015000EL) +#define STATUS_SXS_EARLY_DEACTIVATION ((NTSTATUS)0xC015000FL) +#define STATUS_SXS_INVALID_DEACTIVATION ((NTSTATUS)0xC0150010L) +#define STATUS_SXS_MULTIPLE_DEACTIVATION ((NTSTATUS)0xC0150011L) +#define STATUS_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY ((NTSTATUS)0xC0150012L) +#define STATUS_SXS_PROCESS_TERMINATION_REQUESTED ((NTSTATUS)0xC0150013L) +#define STATUS_CLUSTER_INVALID_NODE ((NTSTATUS)0xC0130001L) +#define STATUS_CLUSTER_NODE_EXISTS ((NTSTATUS)0xC0130002L) +#define STATUS_CLUSTER_JOIN_IN_PROGRESS ((NTSTATUS)0xC0130003L) +#define STATUS_CLUSTER_NODE_NOT_FOUND ((NTSTATUS)0xC0130004L) +#define STATUS_CLUSTER_LOCAL_NODE_NOT_FOUND ((NTSTATUS)0xC0130005L) +#define STATUS_CLUSTER_NETWORK_EXISTS ((NTSTATUS)0xC0130006L) +#define STATUS_CLUSTER_NETWORK_NOT_FOUND ((NTSTATUS)0xC0130007L) +#define STATUS_CLUSTER_NETINTERFACE_EXISTS ((NTSTATUS)0xC0130008L) +#define STATUS_CLUSTER_NETINTERFACE_NOT_FOUND ((NTSTATUS)0xC0130009L) +#define STATUS_CLUSTER_INVALID_REQUEST ((NTSTATUS)0xC013000AL) +#define STATUS_CLUSTER_INVALID_NETWORK_PROVIDER ((NTSTATUS)0xC013000BL) +#define STATUS_CLUSTER_NODE_DOWN ((NTSTATUS)0xC013000CL) +#define STATUS_CLUSTER_NODE_UNREACHABLE ((NTSTATUS)0xC013000DL) +#define STATUS_CLUSTER_NODE_NOT_MEMBER ((NTSTATUS)0xC013000EL) +#define STATUS_CLUSTER_JOIN_NOT_IN_PROGRESS ((NTSTATUS)0xC013000FL) +#define STATUS_CLUSTER_INVALID_NETWORK ((NTSTATUS)0xC0130010L) +#define STATUS_CLUSTER_NO_NET_ADAPTERS ((NTSTATUS)0xC0130011L) +#define STATUS_CLUSTER_NODE_UP ((NTSTATUS)0xC0130012L) +#define STATUS_CLUSTER_NODE_PAUSED ((NTSTATUS)0xC0130013L) +#define STATUS_CLUSTER_NODE_NOT_PAUSED ((NTSTATUS)0xC0130014L) +#define STATUS_CLUSTER_NO_SECURITY_CONTEXT ((NTSTATUS)0xC0130015L) +#define STATUS_CLUSTER_NETWORK_NOT_INTERNAL ((NTSTATUS)0xC0130016L) +#define STATUS_CLUSTER_POISONED ((NTSTATUS)0xC0130017L) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/reactos/include/ddk/parallel.h b/reactos/include/ddk/parallel.h new file mode 100644 index 00000000000..57b5796b9c6 --- /dev/null +++ b/reactos/include/ddk/parallel.h @@ -0,0 +1,276 @@ +/* + * parallel.h + * + * ParPort driver interface + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __PARALLEL_H +#define __PARALLEL_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include "ntddpar.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define DD_PARALLEL_PORT_BASE_NAME "ParallelPort" +#define DD_PARALLEL_PORT_BASE_NAME_U L"ParallelPort" + +#define IOCTL_INTERNAL_DESELECT_DEVICE \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 24, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_INTERNAL_GET_MORE_PARALLEL_PORT_INFO \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 17, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_INTERNAL_GET_PARALLEL_PNP_INFO \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 21, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_INTERNAL_GET_PARALLEL_PORT_INFO \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 12, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_INTERNAL_INIT_1284_3_BUS \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 22, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_INTERNAL_PARALLEL_CLEAR_CHIP_MODE \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 20, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_INTERNAL_PARALLEL_CONNECT_INTERRUPT \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 13, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_INTERNAL_PARALLEL_DISCONNECT_INTERRUPT \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 14, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_INTERNAL_PARALLEL_PORT_ALLOCATE \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 11, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_INTERNAL_PARALLEL_PORT_FREE \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 40, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_INTERNAL_PARALLEL_SET_CHIP_MODE \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 19, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_INTERNAL_RELEASE_PARALLEL_PORT_INFO \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 15, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_INTERNAL_SELECT_DEVICE \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 23, METHOD_BUFFERED, FILE_ANY_ACCESS) + + +typedef struct _PARALLEL_1284_COMMAND { + UCHAR ID; + UCHAR Port; + ULONG CommandFlags; +} PARALLEL_1284_COMMAND, *PPARALLEL_1284_COMMAND; + +/* PARALLEL_1284_COMMAND.CommandFlags */ +#define PAR_END_OF_CHAIN_DEVICE 0x00000001 +#define PAR_HAVE_PORT_KEEP_PORT 0x00000002 + +typedef struct _MORE_PARALLEL_PORT_INFORMATION { + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + ULONG InterruptLevel; + ULONG InterruptVector; + KAFFINITY InterruptAffinity; + KINTERRUPT_MODE InterruptMode; +} MORE_PARALLEL_PORT_INFORMATION, *PMORE_PARALLEL_PORT_INFORMATION; + +typedef NTSTATUS DDKAPI +(*PPARALLEL_SET_CHIP_MODE)( + IN PVOID SetChipContext, + IN UCHAR ChipMode); + +typedef NTSTATUS DDKAPI +(*PPARALLEL_CLEAR_CHIP_MODE)( + IN PVOID ClearChipContext, + IN UCHAR ChipMode); + +typedef NTSTATUS DDKAPI +(*PPARCHIP_CLEAR_CHIP_MODE)( + IN PVOID ClearChipContext, + IN UCHAR ChipMode); + +typedef NTSTATUS DDKAPI +(*PPARALLEL_TRY_SELECT_ROUTINE)( + IN PVOID TrySelectContext, + IN PVOID TrySelectCommand); + +typedef NTSTATUS DDKAPI +(*PPARALLEL_DESELECT_ROUTINE)( + IN PVOID DeselectContext, + IN PVOID DeselectCommand); + +/* PARALLEL_PNP_INFORMATION.HardwareCapabilities */ +#define PPT_NO_HARDWARE_PRESENT 0x00000000 +#define PPT_ECP_PRESENT 0x00000001 +#define PPT_EPP_PRESENT 0x00000002 +#define PPT_EPP_32_PRESENT 0x00000004 +#define PPT_BYTE_PRESENT 0x00000008 +#define PPT_BIDI_PRESENT 0x00000008 +#define PPT_1284_3_PRESENT 0x00000010 + +typedef struct _PARALLEL_PNP_INFORMATION { + PHYSICAL_ADDRESS OriginalEcpController; + PUCHAR EcpController; + ULONG SpanOfEcpController; + ULONG PortNumber; + ULONG HardwareCapabilities; + PPARALLEL_SET_CHIP_MODE TrySetChipMode; + PPARALLEL_CLEAR_CHIP_MODE ClearChipMode; + ULONG FifoDepth; + ULONG FifoWidth; + PHYSICAL_ADDRESS EppControllerPhysicalAddress; + ULONG SpanOfEppController; + ULONG Ieee1284_3DeviceCount; + PPARALLEL_TRY_SELECT_ROUTINE TrySelectDevice; + PPARALLEL_DESELECT_ROUTINE DeselectDevice; + PVOID Context; + ULONG CurrentMode; + PWSTR PortName; +} PARALLEL_PNP_INFORMATION, *PPARALLEL_PNP_INFORMATION; + +typedef BOOLEAN DDKAPI +(*PPARALLEL_TRY_ALLOCATE_ROUTINE)( + IN PVOID TryAllocateContext); + +typedef VOID DDKAPI +(*PPARALLEL_FREE_ROUTINE)( + IN PVOID FreeContext); + +typedef ULONG DDKAPI +(*PPARALLEL_QUERY_WAITERS_ROUTINE)( + IN PVOID QueryAllocsContext); + +typedef struct _PARALLEL_PORT_INFORMATION { + PHYSICAL_ADDRESS OriginalController; + PUCHAR Controller; + ULONG SpanOfController; + PPARALLEL_TRY_ALLOCATE_ROUTINE TryAllocatePort; + PPARALLEL_FREE_ROUTINE FreePort; + PPARALLEL_QUERY_WAITERS_ROUTINE QueryNumWaiters; + PVOID Context; +} PARALLEL_PORT_INFORMATION, *PPARALLEL_PORT_INFORMATION; + +/* PARALLEL_CHIP_MODE.ModeFlags */ +#define INITIAL_MODE 0x00 +#define PARCHIP_ECR_ARBITRATOR 0x01 + +typedef struct _PARALLEL_CHIP_MODE { + UCHAR ModeFlags; + BOOLEAN success; +} PARALLEL_CHIP_MODE, *PPARALLEL_CHIP_MODE; + +typedef VOID DDKAPI +(*PPARALLEL_DEFERRED_ROUTINE)( + IN PVOID DeferredContext); + +typedef struct _PARALLEL_INTERRUPT_SERVICE_ROUTINE { + PKSERVICE_ROUTINE InterruptServiceRoutine; + PVOID InterruptServiceContext; + PPARALLEL_DEFERRED_ROUTINE DeferredPortCheckRoutine; + PVOID DeferredPortCheckContext; +} PARALLEL_INTERRUPT_SERVICE_ROUTINE, *PPARALLEL_INTERRUPT_SERVICE_ROUTINE; + + +#define IOCTL_INTERNAL_DISCONNECT_IDLE \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 32, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_INTERNAL_LOCK_PORT \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 37, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_INTERNAL_LOCK_PORT_NO_SELECT \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 52, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_INTERNAL_PARCLASS_CONNECT \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 30, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_INTERNAL_PARCLASS_DISCONNECT \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 31, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_INTERNAL_UNLOCK_PORT \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 38, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_INTERNAL_UNLOCK_PORT_NO_DESELECT \ + CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 53, METHOD_BUFFERED, FILE_ANY_ACCESS) + +typedef USHORT DDKAPI +(*PDETERMINE_IEEE_MODES)( + IN PVOID Context); + +typedef enum _PARALLEL_SAFETY { + SAFE_MODE, + UNSAFE_MODE +} PARALLEL_SAFETY; + +typedef NTSTATUS DDKAPI +(*PNEGOTIATE_IEEE_MODE)( + IN PVOID Context, + IN USHORT ModeMaskFwd, + IN USHORT ModeMaskRev, + IN PARALLEL_SAFETY ModeSafety, + IN BOOLEAN IsForward); + +typedef NTSTATUS DDKAPI +(*PTERMINATE_IEEE_MODE)( + IN PVOID Context); + +typedef NTSTATUS DDKAPI +(*PPARALLEL_IEEE_FWD_TO_REV)( + IN PVOID Context); + +typedef NTSTATUS DDKAPI +(*PPARALLEL_IEEE_REV_TO_FWD)( + IN PVOID Context); + +typedef NTSTATUS DDKAPI +(*PPARALLEL_READ)( + IN PVOID Context, + OUT PVOID Buffer, + IN ULONG NumBytesToRead, + OUT PULONG NumBytesRead, + IN UCHAR Channel); + +typedef NTSTATUS DDKAPI +(*PPARALLEL_WRITE)( + IN PVOID Context, + OUT PVOID Buffer, + IN ULONG NumBytesToWrite, + OUT PULONG NumBytesWritten, + IN UCHAR Channel); + +typedef NTSTATUS DDKAPI +(*PPARALLEL_TRYSELECT_DEVICE)( + IN PVOID Context, + IN PARALLEL_1284_COMMAND Command); + +typedef NTSTATUS DDKAPI +(*PPARALLEL_DESELECT_DEVICE)( + IN PVOID Context, + IN PARALLEL_1284_COMMAND Command); + +typedef struct _PARCLASS_INFORMATION { + PUCHAR Controller; + PUCHAR EcrController; + ULONG SpanOfController; + PDETERMINE_IEEE_MODES DetermineIeeeModes; + PNEGOTIATE_IEEE_MODE NegotiateIeeeMode; + PTERMINATE_IEEE_MODE TerminateIeeeMode; + PPARALLEL_IEEE_FWD_TO_REV IeeeFwdToRevMode; + PPARALLEL_IEEE_REV_TO_FWD IeeeRevToFwdMode; + PPARALLEL_READ ParallelRead; + PPARALLEL_WRITE ParallelWrite; + PVOID ParclassContext; + ULONG HardwareCapabilities; + ULONG FifoDepth; + ULONG FifoWidth; + PPARALLEL_TRYSELECT_DEVICE ParallelTryselect; + PPARALLEL_DESELECT_DEVICE ParallelDeSelect; +} PARCLASS_INFORMATION, *PPARCLASS_INFORMATION; + +#ifdef __cplusplus +} +#endif + +#endif /* __PARALLEL_H */ diff --git a/reactos/include/ddk/pfhook.h b/reactos/include/ddk/pfhook.h new file mode 100644 index 00000000000..845132ae055 --- /dev/null +++ b/reactos/include/ddk/pfhook.h @@ -0,0 +1,74 @@ +/* + * pfhook.h + * + * Packet filter API + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __PFHOOK_H +#define __PFHOOK_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define DD_IPFLTRDRVR_DEVICE_NAME L"\\Device\\IPFILTERDRIVER" + +#define INVALID_PF_IF_INDEX 0xffffffff +#define ZERO_PF_IP_ADDR 0 + +typedef ULONG IPAddr; + +typedef enum _PF_FORWARD_ACTION { + PF_FORWARD = 0, + PF_DROP = 1, + PF_PASS = 2, + PF_ICMP_ON_DROP = 3 +} PF_FORWARD_ACTION; + +typedef PF_FORWARD_ACTION STDCALL +(*PacketFilterExtensionPtr)( + IN unsigned char *PacketHeader, + IN unsigned char *Packet, + IN unsigned int PacketLength, + IN unsigned int RecvInterfaceIndex, + IN unsigned int SendInterfaceIndex, + IN IPAddr RecvLinkNextHop, + IN IPAddr SendLinkNextHop); + +typedef struct _PF_SET_EXTENSION_HOOK_INFO { + PacketFilterExtensionPtr ExtensionPointer; +} PF_SET_EXTENSION_HOOK_INFO, *PPF_SET_EXTENSION_HOOK_INFO; + +#define FSCTL_IPFLTRDRVR_BASE FILE_DEVICE_NETWORK + +#define _IPFLTRDRVR_CTL_CODE(function, method, access) \ + CTL_CODE(FSCTL_IPFLTRDRVR_BASE, function, method, access) + +#define IOCTL_PF_SET_EXTENSION_POINTER \ + _IPFLTRDRVR_CTL_CODE(22, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#ifdef __cplusplus +} +#endif + +#endif /* __PFHOOK_H */ diff --git a/reactos/include/ddk/poclass.h b/reactos/include/ddk/poclass.h new file mode 100644 index 00000000000..79c2f60c44a --- /dev/null +++ b/reactos/include/ddk/poclass.h @@ -0,0 +1,117 @@ +/* + * poclass.h + * + * Power policy driver interface + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __POCLASS_H +#define __POCLASS_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include "batclass.h" + +#ifdef __cplusplus +extern "C" { +#endif + +DEFINE_GUID(GUID_CLASS_INPUT, + 0x4D1E55B2L, 0xF16F, 0x11CF, 0x88, 0xCB, 0x00, 0x11, 0x11, 0x00, 0x00, 0x30); + +DEFINE_GUID(GUID_DEVICE_LID, + 0x4AFA3D52L, 0x74A7, 0x11d0, 0xbe, 0x5e, 0x00, 0xA0, 0xC9, 0x06, 0x28, 0x57); + +DEFINE_GUID(GUID_DEVICE_MEMORY, + 0x3fd0f03dL, 0x92e0, 0x45fb, 0xb7, 0x5c, 0x5e, 0xd8, 0xff, 0xb0, 0x10, 0x21); + +DEFINE_GUID(GUID_DEVICE_MESSAGE_INDICATOR, + 0XCD48A365L, 0xfa94, 0x4ce2, 0xa2, 0x32, 0xa1, 0xb7, 0x64, 0xe5, 0xd8, 0xb4); + +DEFINE_GUID(GUID_DEVICE_PROCESSOR, + 0x97fadb10L, 0x4e33, 0x40ae, 0x35, 0x9c, 0x8b, 0xef, 0x02, 0x9d, 0xbd, 0xd0); + +DEFINE_GUID(GUID_DEVICE_SYS_BUTTON, + 0x4AFA3D53L, 0x74A7, 0x11d0, 0xbe, 0x5e, 0x00, 0xA0, 0xC9, 0x06, 0x28, 0x57); + +DEFINE_GUID(GUID_DEVICE_THERMAL_ZONE, + 0x4AFA3D51L, 0x74A7, 0x11d0, 0xbe, 0x5e, 0x00, 0xA0, 0xC9, 0x06, 0x28, 0x57); + + +#define IOCTL_GET_PROCESSOR_OBJ_INFO \ + CTL_CODE(FILE_DEVICE_BATTERY, 0x60, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_GET_SYS_BUTTON_CAPS \ + CTL_CODE(FILE_DEVICE_BATTERY, 0x50, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_GET_SYS_BUTTON_EVENT \ + CTL_CODE(FILE_DEVICE_BATTERY, 0x51, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_SET_SYS_MESSAGE_INDICATOR \ + CTL_CODE(FILE_DEVICE_BATTERY, 0x70, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_NOTIFY_SWITCH_EVENT \ + CTL_CODE(FILE_DEVICE_BATTERY, 0x40, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_THERMAL_QUERY_INFORMATION \ + CTL_CODE(FILE_DEVICE_BATTERY, 0x20, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_THERMAL_SET_COOLING_POLICY \ + CTL_CODE(FILE_DEVICE_BATTERY, 0x21, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_QUERY_LID \ + CTL_CODE(FILE_DEVICE_BATTERY, 0x30, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_RUN_ACTIVE_COOLING_METHOD \ + CTL_CODE(FILE_DEVICE_BATTERY, 0x22, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define SYS_BUTTON_POWER 0x00000001 +#define SYS_BUTTON_SLEEP 0x00000002 +#define SYS_BUTTON_LID 0x00000004 +#define SYS_BUTTON_WAKE 0x80000000 + +#define MAX_ACTIVE_COOLING_LEVELS 10 +#define ACTIVE_COOLING 0 +#define PASSIVE_COOLING 1 + +typedef struct _THERMAL_INFORMATION { + ULONG ThermalStamp; + ULONG ThermalConstant1; + ULONG ThermalConstant2; + KAFFINITY Processors; + ULONG SamplingPeriod; + ULONG CurrentTemperature; + ULONG PassiveTripPoint; + ULONG CriticalTripPoint; + UCHAR ActiveTripPointCount; + ULONG ActiveTripPoint[MAX_ACTIVE_COOLING_LEVELS]; +} THERMAL_INFORMATION, *PTHERMAL_INFORMATION; + +typedef struct _PROCESSOR_OBJECT_INFO { + ULONG PhysicalID; + ULONG PBlkAddress; + UCHAR PBlkLength; +} PROCESSOR_OBJECT_INFO, *PPROCESSOR_OBJECT_INFO; + +#ifdef __cplusplus +} +#endif + +#endif /* __POCLASS_H */ diff --git a/reactos/include/ddk/prntfont.h b/reactos/include/ddk/prntfont.h new file mode 100644 index 00000000000..523f3abe791 --- /dev/null +++ b/reactos/include/ddk/prntfont.h @@ -0,0 +1,286 @@ +/* + * prntfont.h + * + * Declarations for Windows NT printer driver font metrics + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Filip Navara + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __PRNTFONT_H +#define __PRNTFONT_H + +#define UNIFM_VERSION_1_0 0x10000 +#define UNI_GLYPHSETDATA_VERSION_1_0 0x10000 + +#define UFM_SOFT 1 +#define UFM_CART 2 +#define UFM_SCALABLE 4 + +#define DF_TYPE_HPINTELLIFONT 0 +#define DF_TYPE_TRUETYPE 1 +#define DF_TYPE_PST1 2 +#define DF_TYPE_CAPSL 3 +#define DF_TYPE_OEM1 4 +#define DF_TYPE_OEM2 5 +#define DF_NOITALIC 1 +#define DF_NOUNDER 2 +#define DF_XM_CR 4 +#define DF_NO_BOLD 8 +#define DF_NO_DOUBLE_UNDERLINE 16 +#define DF_NO_STRIKETHRU 32 +#define DF_BKSP_OK 64 + +#define MTYPE_COMPOSE 1 +#define MTYPE_DIRECT 2 +#define MTYPE_PAIRED 4 +#define MTYPE_FORMAT_MASK 7 +#define MTYPE_SINGLE 8 +#define MTYPE_DOUBLE 16 +#define MTYPE_DOUBLEBYTECHAR_MASK 24 +#define MTYPE_REPLACE 32 +#define MTYPE_ADD 64 +#define MTYPE_DISABLE 128 +#define MTYPE_PREDEFIN_MASK 192 + +#define CC_NOPRECNV 0x0000FFFF +#define CC_DEFAULT 0 +#define CC_CP437 -1 +#define CC_CP850 -2 +#define CC_CP863 -3 +#define CC_BIG5 -10 +#define CC_ISC -11 +#define CC_JIS -12 +#define CC_JIS_ANK -13 +#define CC_NS86 -14 +#define CC_TCA -15 +#define CC_GB2312 -16 +#define CC_SJIS -17 +#define CC_WANSUNG -18 + +#define UFF_FILE_MAGIC TAG('1','F','F','U') +#define UFF_VERSION_NUMBER 0x10001 +#define FONT_DIR_SORTED 1 +#define FONT_REC_SIG TAG('C','E','R','F') +#define WINNT_INSTALLER_SIG TAG('I','F','T','N') + +#define FONT_FL_UFM 0x0001 +#define FONT_FL_IFI 0x0002 +#define FONT_FL_SOFTFONT 0x0004 +#define FONT_FL_PERMANENT_SF 0x0008 +#define FONT_FL_DEVICEFONT 0x0010 +#define FONT_FL_GLYPHSET_GTT 0x0020 +#define FONT_FL_GLYPHSET_RLE 0x0040 +#define FONT_FL_RESERVED 0x8000 + +#define DATA_UFM_SIG TAG('M','F','U','D') +#define DATA_IFI_SIG TAG('I','F','I','D') +#define DATA_GTT_SIG TAG('T','T','G','D') +#define DATA_CTT_SIG TAG('T','T','C','D') +#define DATA_VAR_SIG TAG('R','A','V','D') + +#define FG_CANCHANGE 128 +#define WM_FI_FILENAME 900 + +#define GET_UNIDRVINFO(pUFM) ((PUNIDRVINFO)((ULONG_PTR)(pUFM) + (pUFM)->loUnidrvInfo)) +#define GET_IFIMETRICS(pUFM) ((IFIMETRICS*)((ULONG_PTR)(pUFM) + (pUFM)->loIFIMetrics)) +#define GET_EXTTEXTMETRIC(pUFM) ((EXTTEXTMETRIC*)((ULONG_PTR)(pUFM) + (pUFM)->loExtTextMetric)) +#define GET_WIDTHTABLE(pUFM) ((PWIDTHTABLE)((ULONG_PTR)(pUFM) + (pUFM)->loWidthTable)) +#define GET_KERNDATA(pUFM) ((PKERNDATA)((ULONG_PTR)(pUFM) + (pUFM)->loKernPair)) +#define GET_SELECT_CMD(pUni) ((PCHAR)(pUni) + (pUni)->SelectFont.loOffset) +#define GET_UNSELECT_CMD(pUni) ((PCHAR)(pUni) + (pUni)->UnSelectFont.loOffset) +#define GET_GLYPHRUN(pGTT) ((PGLYPHRUN)((ULONG_PTR)(pGTT) + ((PUNI_GLYPHSETDATA)pGTT)->loRunOffset)) +#define GET_CODEPAGEINFO(pGTT) ((PUNI_CODEPAGEINFO)((ULONG_PTR)(pGTT) + ((PUNI_GLYPHSETDATA)pGTT)->loCodePageOffset)) +#define GET_MAPTABLE(pGTT) ((PMAPTABLE)((ULONG_PTR)(pGTT) + ((PUNI_GLYPHSETDATA)pGTT)->loMapTableOffset)) + +typedef struct _UNIFM_HDR +{ + DWORD dwSize; + DWORD dwVersion; + ULONG ulDefaultCodepage; + LONG lGlyphSetDataRCID; + DWORD loUnidrvInfo; + DWORD loIFIMetrics; + DWORD loExtTextMetric; + DWORD loWidthTable; + DWORD loKernPair; + DWORD dwReserved[2]; +} UNIFM_HDR, *PUNIFM_HDR; + +typedef struct _INVOC +{ + DWORD dwCount; + DWORD loOffset; +} INVOC, *PINVOC; + +typedef struct _UNIDRVINFO +{ + DWORD dwSize; + DWORD flGenFlags; + WORD wType; + WORD fCaps; + WORD wXRes; + WORD wYRes; + SHORT sYAdjust; + SHORT sYMoved; + WORD wPrivateData; + SHORT sShift; + INVOC SelectFont; + INVOC UnSelectFont; + WORD wReserved[4]; +} UNIDRVINFO, *PUNIDRVINFO; + +typedef struct _EXTTEXTMETRIC +{ + SHORT emSize; + SHORT emPointSize; + SHORT emOrientation; + SHORT emMasterHeight; + SHORT emMinScale; + SHORT emMaxScale; + SHORT emMasterUnits; + SHORT emCapHeight; + SHORT emXHeight; + SHORT emLowerCaseAscent; + SHORT emLowerCaseDescent; + SHORT emSlant; + SHORT emSuperScript; + SHORT emSubScript; + SHORT emSuperScriptSize; + SHORT emSubScriptSize; + SHORT emUnderlineOffset; + SHORT emUnderlineWidth; + SHORT emDoubleUpperUnderlineOffset; + SHORT emDoubleLowerUnderlineOffset; + SHORT emDoubleUpperUnderlineWidth; + SHORT emDoubleLowerUnderlineWidth; + SHORT emStrikeOutOffset; + SHORT emStrikeOutWidth; + WORD emKernPairs; + WORD emKernTracks; +} EXTTEXTMETRIC, *PEXTTEXTMETRIC; + +typedef struct _WIDTHRUN +{ + WORD wStartGlyph; + WORD wGlyphCount; + DWORD loCharWidthOffset; +} WIDTHRUN, *PWIDTHRUN; + +typedef struct _WIDTHTABLE +{ + DWORD dwSize; + DWORD dwRunNum; + WIDTHRUN WidthRun[1]; +} WIDTHTABLE, *PWIDTHTABLE; + +typedef struct _KERNDATA +{ + DWORD dwSize; + DWORD dwKernPairNum; + FD_KERNINGPAIR KernPair[1]; +} KERNDATA, *PKERNDATA; + +typedef struct _UNI_GLYPHSETDATA +{ + DWORD dwSize; + DWORD dwVersion; + DWORD dwFlags; + LONG lPredefinedID; + DWORD dwGlyphCount; + DWORD dwRunCount; + DWORD loRunOffset; + DWORD dwCodePageCount; + DWORD loCodePageOffset; + DWORD loMapTableOffset; + DWORD dwReserved[2]; +} UNI_GLYPHSETDATA, *PUNI_GLYPHSETDATA; + +typedef struct _UNI_CODEPAGEINFO +{ + DWORD dwCodePage; + INVOC SelectSymbolSet; + INVOC UnSelectSymbolSet; +} UNI_CODEPAGEINFO, *PUNI_CODEPAGEINFO; + +typedef struct _GLYPHRUN +{ + WCHAR wcLow; + WORD wGlyphCount; +} GLYPHRUN, *PGLYPHRUN; + +typedef struct _TRANSDATA +{ + BYTE ubCodePageID; + BYTE ubType; + union + { + SHORT sCode; + BYTE ubCode; + BYTE ubPairs[2]; + } uCode; +} TRANSDATA, *PTRANSDATA; + +typedef struct _MAPTABLE { + DWORD dwSize; + DWORD dwGlyphNum; + TRANSDATA Trans[1]; +} MAPTABLE, *PMAPTABLE; + +typedef struct _UFF_FILEHEADER { + DWORD dwSignature; + DWORD dwVersion; + DWORD dwSize; + DWORD nFonts; + DWORD nGlyphSets; + DWORD nVarData; + DWORD offFontDir; + DWORD dwFlags; + DWORD dwReserved[4]; +} UFF_FILEHEADER, *PUFF_FILEHEADER; + +typedef struct _UFF_FONTDIRECTORY { + DWORD dwSignature; + WORD wSize; + WORD wFontID; + SHORT sGlyphID; + WORD wFlags; + DWORD dwInstallerSig; + DWORD offFontName; + DWORD offCartridgeName; + DWORD offFontData; + DWORD offGlyphData; + DWORD offVarData; +} UFF_FONTDIRECTORY, *PUFF_FONTDIRECTORY; + +typedef struct _DATA_HEADER { + DWORD dwSignature; + WORD wSize; + WORD wDataID; + DWORD dwDataSize; + DWORD dwReserved; +} DATA_HEADER, *PDATA_HEADER; + +typedef struct _OEMFONTINSTPARAM { + DWORD cbSize; + HANDLE hPrinter; + HANDLE hModule; + HANDLE hHeap; + DWORD dwFlags; + PWSTR pFontInstallerName; +} OEMFONTINSTPARAM, *POEMFONTINSTPARAM; + +#endif /* __PRNTFONT_H */ diff --git a/reactos/include/ddk/scsi.h b/reactos/include/ddk/scsi.h new file mode 100644 index 00000000000..640ae9e58b8 --- /dev/null +++ b/reactos/include/ddk/scsi.h @@ -0,0 +1,1695 @@ +/* + * scsi.h + * + * SCSI port and class interface. + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef _NTSCSI_ +#define _NTSCSI_ + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef union _CDB { + struct _CDB6GENERIC { + UCHAR OperationCode; + UCHAR Immediate : 1; + UCHAR CommandUniqueBits : 4; + UCHAR LogicalUnitNumber : 3; + UCHAR CommandUniqueBytes[3]; + UCHAR Link : 1; + UCHAR Flag : 1; + UCHAR Reserved : 4; + UCHAR VendorUnique : 2; + } CDB6GENERIC, *PCDB6GENERIC; + + struct _CDB6READWRITE { + UCHAR OperationCode; + UCHAR LogicalBlockMsb1 : 5; + UCHAR LogicalUnitNumber : 3; + UCHAR LogicalBlockMsb0; + UCHAR LogicalBlockLsb; + UCHAR TransferBlocks; + UCHAR Control; + } CDB6READWRITE, *PCDB6READWRITE; + + struct _CDB6INQUIRY { + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR LogicalUnitNumber : 3; + UCHAR PageCode; + UCHAR IReserved; + UCHAR AllocationLength; + UCHAR Control; + } CDB6INQUIRY, *PCDB6INQUIRY; + + struct _CDB6INQUIRY3 { + UCHAR OperationCode; + UCHAR EnableVitalProductData : 1; + UCHAR CommandSupportData : 1; + UCHAR Reserved1 : 6; + UCHAR PageCode; + UCHAR Reserved2; + UCHAR AllocationLength; + UCHAR Control; + } CDB6INQUIRY3, *PCDB6INQUIRY3; + + struct _CDB6VERIFY { + UCHAR OperationCode; + UCHAR Fixed : 1; + UCHAR ByteCompare : 1; + UCHAR Immediate : 1; + UCHAR Reserved : 2; + UCHAR LogicalUnitNumber : 3; + UCHAR VerificationLength[3]; + UCHAR Control; + } CDB6VERIFY, *PCDB6VERIFY; + + struct _CDB6FORMAT { + UCHAR OperationCode; + UCHAR FormatControl : 5; + UCHAR LogicalUnitNumber : 3; + UCHAR FReserved1; + UCHAR InterleaveMsb; + UCHAR InterleaveLsb; + UCHAR FReserved2; + } CDB6FORMAT, *PCDB6FORMAT; + + struct _CDB10 { + UCHAR OperationCode; + UCHAR RelativeAddress : 1; + UCHAR Reserved1 : 2; + UCHAR ForceUnitAccess : 1; + UCHAR DisablePageOut : 1; + UCHAR LogicalUnitNumber : 3; + UCHAR LogicalBlockByte0; + UCHAR LogicalBlockByte1; + UCHAR LogicalBlockByte2; + UCHAR LogicalBlockByte3; + UCHAR Reserved2; + UCHAR TransferBlocksMsb; + UCHAR TransferBlocksLsb; + UCHAR Control; + } CDB10, *PCDB10; + + struct _CDB12 { + UCHAR OperationCode; + UCHAR RelativeAddress : 1; + UCHAR Reserved1 : 2; + UCHAR ForceUnitAccess : 1; + UCHAR DisablePageOut : 1; + UCHAR LogicalUnitNumber : 3; + UCHAR LogicalBlock[4]; + UCHAR TransferLength[4]; + UCHAR Reserved2; + UCHAR Control; + } CDB12, *PCDB12; + + struct _PAUSE_RESUME { + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR LogicalUnitNumber : 3; + UCHAR Reserved2[6]; + UCHAR Action; + UCHAR Control; + } PAUSE_RESUME, *PPAUSE_RESUME; + + struct _READ_TOC { + UCHAR OperationCode; + UCHAR Reserved0 : 1; + UCHAR Msf : 1; + UCHAR Reserved1 : 3; + UCHAR LogicalUnitNumber : 3; + UCHAR Format2 : 4; + UCHAR Reserved2 : 4; + UCHAR Reserved3[3]; + UCHAR StartingTrack; + UCHAR AllocationLength[2]; + UCHAR Control : 6; + UCHAR Format : 2; + } READ_TOC, *PREAD_TOC; + + struct _READ_DISK_INFORMATION { + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR Lun : 3; + UCHAR Reserved2[5]; + UCHAR AllocationLength[2]; + UCHAR Control; + } READ_DISK_INFORMATION, *PREAD_DISK_INFORMATION; + + struct _READ_TRACK_INFORMATION { + UCHAR OperationCode; + UCHAR Track : 1; + UCHAR Reserved1 : 3; + UCHAR Reserved2 : 1; + UCHAR Lun : 3; + UCHAR BlockAddress[4]; + UCHAR Reserved3; + UCHAR AllocationLength[2]; + UCHAR Control; + } READ_TRACK_INFORMATION, *PREAD_TRACK_INFORMATION; + + struct _RESERVE_TRACK_RZONE { + UCHAR OperationCode; + UCHAR Reserved1[4]; + UCHAR ReservationSize[4]; + UCHAR Control; + } RESERVE_TRACK_RZONE, *PRESERVE_TRACK_RZONE; + + struct _SEND_OPC_INFORMATION { + UCHAR OperationCode; + UCHAR DoOpc : 1; + UCHAR Reserved : 7; + UCHAR Reserved1[5]; + UCHAR ParameterListLength[2]; + UCHAR Reserved2; + } SEND_OPC_INFORMATION, *PSEND_OPC_INFORMATION; + + struct _CLOSE_TRACK { + UCHAR OperationCode; + UCHAR Immediate : 1; + UCHAR Reserved1 : 7; + UCHAR Track : 1; + UCHAR Session : 1; + UCHAR Reserved2 : 6; + UCHAR Reserved3; + UCHAR TrackNumber[2]; + UCHAR Reserved4[3]; + UCHAR Control; + } CLOSE_TRACK, *PCLOSE_TRACK; + + struct _SEND_CUE_SHEET { + UCHAR OperationCode; + UCHAR Reserved[5]; + UCHAR CueSheetSize[3]; + UCHAR Control; + } SEND_CUE_SHEET, *PSEND_CUE_SHEET; + + struct _READ_HEADER { + UCHAR OperationCode; + UCHAR Reserved1 : 1; + UCHAR Msf : 1; + UCHAR Reserved2 : 3; + UCHAR Lun : 3; + UCHAR LogicalBlockAddress[4]; + UCHAR Reserved3; + UCHAR AllocationLength[2]; + UCHAR Control; + } READ_HEADER, *PREAD_HEADER; + + struct _PLAY_AUDIO { + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR LogicalUnitNumber : 3; + UCHAR StartingBlockAddress[4]; + UCHAR Reserved2; + UCHAR PlayLength[2]; + UCHAR Control; + } PLAY_AUDIO, *PPLAY_AUDIO; + + struct _PLAY_AUDIO_MSF { + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR LogicalUnitNumber : 3; + UCHAR Reserved2; + UCHAR StartingM; + UCHAR StartingS; + UCHAR StartingF; + UCHAR EndingM; + UCHAR EndingS; + UCHAR EndingF; + UCHAR Control; + } PLAY_AUDIO_MSF, *PPLAY_AUDIO_MSF; + +/* FIXME: Should the union be anonymous in C++ too? If so, + can't define named types _LBA and _MSF within anonymous union + for C++. */ + struct _PLAY_CD { + UCHAR OperationCode; + UCHAR Reserved1 : 1; + UCHAR CMSF : 1; + UCHAR ExpectedSectorType : 3; + UCHAR Lun : 3; +#ifndef __cplusplus + _ANONYMOUS_UNION +#endif + union { + struct _LBA { + UCHAR StartingBlockAddress[4]; + UCHAR PlayLength[4]; + } LBA; + + struct _MSF { + UCHAR Reserved1; + UCHAR StartingM; + UCHAR StartingS; + UCHAR StartingF; + UCHAR EndingM; + UCHAR EndingS; + UCHAR EndingF; + UCHAR Reserved2; + } MSF; + #ifndef __cplusplus + }DUMMYUNIONNAME; + #else + }u; + #endif + + UCHAR Audio : 1; + UCHAR Composite : 1; + UCHAR Port1 : 1; + UCHAR Port2 : 1; + UCHAR Reserved2 : 3; + UCHAR Speed : 1; + UCHAR Control; + } PLAY_CD, *PPLAY_CD; + + struct _SCAN_CD { + UCHAR OperationCode; + UCHAR RelativeAddress : 1; + UCHAR Reserved1 : 3; + UCHAR Direct : 1; + UCHAR Lun : 3; + UCHAR StartingAddress[4]; + UCHAR Reserved2[3]; + UCHAR Reserved3 : 6; + UCHAR Type : 2; + UCHAR Reserved4; + UCHAR Control; + } SCAN_CD, *PSCAN_CD; + + struct _STOP_PLAY_SCAN { + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR Lun : 3; + UCHAR Reserved2[7]; + UCHAR Control; + } STOP_PLAY_SCAN, *PSTOP_PLAY_SCAN; + + struct _SUBCHANNEL { + UCHAR OperationCode; + UCHAR Reserved0 : 1; + UCHAR Msf : 1; + UCHAR Reserved1 : 3; + UCHAR LogicalUnitNumber : 3; + UCHAR Reserved2 : 6; + UCHAR SubQ : 1; + UCHAR Reserved3 : 1; + UCHAR Format; + UCHAR Reserved4[2]; + UCHAR TrackNumber; + UCHAR AllocationLength[2]; + UCHAR Control; + } SUBCHANNEL, *PSUBCHANNEL; + + struct _READ_CD { + UCHAR OperationCode; + UCHAR RelativeAddress : 1; + UCHAR Reserved0 : 1; + UCHAR ExpectedSectorType : 3; + UCHAR Lun : 3; + UCHAR StartingLBA[4]; + UCHAR TransferBlocks[3]; + UCHAR Reserved2 : 1; + UCHAR ErrorFlags : 2; + UCHAR IncludeEDC : 1; + UCHAR IncludeUserData : 1; + UCHAR HeaderCode : 2; + UCHAR IncludeSyncData : 1; + UCHAR SubChannelSelection : 3; + UCHAR Reserved3 : 5; + UCHAR Control; + } READ_CD, *PREAD_CD; + + struct _READ_CD_MSF { + UCHAR OperationCode; + UCHAR RelativeAddress : 1; + UCHAR Reserved1 : 1; + UCHAR ExpectedSectorType : 3; + UCHAR Lun : 3; + UCHAR Reserved2; + UCHAR StartingM; + UCHAR StartingS; + UCHAR StartingF; + UCHAR EndingM; + UCHAR EndingS; + UCHAR EndingF; + UCHAR Reserved3; + UCHAR Reserved4 : 1; + UCHAR ErrorFlags : 2; + UCHAR IncludeEDC : 1; + UCHAR IncludeUserData : 1; + UCHAR HeaderCode : 2; + UCHAR IncludeSyncData : 1; + UCHAR SubChannelSelection : 3; + UCHAR Reserved5 : 5; + UCHAR Control; + } READ_CD_MSF, *PREAD_CD_MSF; + + struct _PLXTR_READ_CDDA { + UCHAR OperationCode; + UCHAR Reserved0 : 5; + UCHAR LogicalUnitNumber : 3; + UCHAR LogicalBlockByte0; + UCHAR LogicalBlockByte1; + UCHAR LogicalBlockByte2; + UCHAR LogicalBlockByte3; + UCHAR TransferBlockByte0; + UCHAR TransferBlockByte1; + UCHAR TransferBlockByte2; + UCHAR TransferBlockByte3; + UCHAR SubCode; + UCHAR Control; + } PLXTR_READ_CDDA, *PPLXTR_READ_CDDA; + + struct _NEC_READ_CDDA { + UCHAR OperationCode; + UCHAR Reserved0; + UCHAR LogicalBlockByte0; + UCHAR LogicalBlockByte1; + UCHAR LogicalBlockByte2; + UCHAR LogicalBlockByte3; + UCHAR Reserved1; + UCHAR TransferBlockByte0; + UCHAR TransferBlockByte1; + UCHAR Control; + } NEC_READ_CDDA, *PNEC_READ_CDDA; + + struct _MODE_SENSE { + UCHAR OperationCode; + UCHAR Reserved1 : 3; + UCHAR Dbd : 1; + UCHAR Reserved2 : 1; + UCHAR LogicalUnitNumber : 3; + UCHAR PageCode : 6; + UCHAR Pc : 2; + UCHAR Reserved3; + UCHAR AllocationLength; + UCHAR Control; + } MODE_SENSE, *PMODE_SENSE; + + struct _MODE_SENSE10 { + UCHAR OperationCode; + UCHAR Reserved1 : 3; + UCHAR Dbd : 1; + UCHAR Reserved2 : 1; + UCHAR LogicalUnitNumber : 3; + UCHAR PageCode : 6; + UCHAR Pc : 2; + UCHAR Reserved3[4]; + UCHAR AllocationLength[2]; + UCHAR Control; + } MODE_SENSE10, *PMODE_SENSE10; + + struct _MODE_SELECT { + UCHAR OperationCode; + UCHAR SPBit : 1; + UCHAR Reserved1 : 3; + UCHAR PFBit : 1; + UCHAR LogicalUnitNumber : 3; + UCHAR Reserved2[2]; + UCHAR ParameterListLength; + UCHAR Control; + } MODE_SELECT, *PMODE_SELECT; + + struct _MODE_SELECT10 { + UCHAR OperationCode; + UCHAR SPBit : 1; + UCHAR Reserved1 : 3; + UCHAR PFBit : 1; + UCHAR LogicalUnitNumber : 3; + UCHAR Reserved2[5]; + UCHAR ParameterListLength[2]; + UCHAR Control; + } MODE_SELECT10, *PMODE_SELECT10; + + struct _LOCATE { + UCHAR OperationCode; + UCHAR Immediate : 1; + UCHAR CPBit : 1; + UCHAR BTBit : 1; + UCHAR Reserved1 : 2; + UCHAR LogicalUnitNumber : 3; + UCHAR Reserved3; + UCHAR LogicalBlockAddress[4]; + UCHAR Reserved4; + UCHAR Partition; + UCHAR Control; + } LOCATE, *PLOCATE; + + struct _LOGSENSE { + UCHAR OperationCode; + UCHAR SPBit : 1; + UCHAR PPCBit : 1; + UCHAR Reserved1 : 3; + UCHAR LogicalUnitNumber : 3; + UCHAR PageCode : 6; + UCHAR PCBit : 2; + UCHAR Reserved2; + UCHAR Reserved3; + UCHAR ParameterPointer[2]; + UCHAR AllocationLength[2]; + UCHAR Control; + } LOGSENSE, *PLOGSENSE; + + struct _LOGSELECT { + UCHAR OperationCode; + UCHAR SPBit : 1; + UCHAR PCRBit : 1; + UCHAR Reserved1 : 3; + UCHAR LogicalUnitNumber : 3; + UCHAR Reserved : 6; + UCHAR PCBit : 2; + UCHAR Reserved2[4]; + UCHAR ParameterListLength[2]; + UCHAR Control; + } LOGSELECT, *PLOGSELECT; + + struct _PRINT { + UCHAR OperationCode; + UCHAR Reserved : 5; + UCHAR LogicalUnitNumber : 3; + UCHAR TransferLength[3]; + UCHAR Control; + } PRINT, *PPRINT; + + struct _SEEK { + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR LogicalUnitNumber : 3; + UCHAR LogicalBlockAddress[4]; + UCHAR Reserved2[3]; + UCHAR Control; + } SEEK, *PSEEK; + + struct _ERASE { + UCHAR OperationCode; + UCHAR Long : 1; + UCHAR Immediate : 1; + UCHAR Reserved1 : 3; + UCHAR LogicalUnitNumber : 3; + UCHAR Reserved2[3]; + UCHAR Control; + } ERASE, *PERASE; + + struct _START_STOP { + UCHAR OperationCode; + UCHAR Immediate: 1; + UCHAR Reserved1 : 4; + UCHAR LogicalUnitNumber : 3; + UCHAR Reserved2[2]; + UCHAR Start : 1; + UCHAR LoadEject : 1; + UCHAR Reserved3 : 6; + UCHAR Control; + } START_STOP, *PSTART_STOP; + + struct _MEDIA_REMOVAL { + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR LogicalUnitNumber : 3; + UCHAR Reserved2[2]; + + UCHAR Prevent : 1; + UCHAR Persistant : 1; + UCHAR Reserved3 : 6; + + UCHAR Control; + } MEDIA_REMOVAL, *PMEDIA_REMOVAL; + + struct _SEEK_BLOCK { + UCHAR OperationCode; + UCHAR Immediate : 1; + UCHAR Reserved1 : 7; + UCHAR BlockAddress[3]; + UCHAR Link : 1; + UCHAR Flag : 1; + UCHAR Reserved2 : 4; + UCHAR VendorUnique : 2; + } SEEK_BLOCK, *PSEEK_BLOCK; + + struct _REQUEST_BLOCK_ADDRESS { + UCHAR OperationCode; + UCHAR Reserved1[3]; + UCHAR AllocationLength; + UCHAR Link : 1; + UCHAR Flag : 1; + UCHAR Reserved2 : 4; + UCHAR VendorUnique : 2; + } REQUEST_BLOCK_ADDRESS, *PREQUEST_BLOCK_ADDRESS; + + struct _PARTITION { + UCHAR OperationCode; + UCHAR Immediate : 1; + UCHAR Sel: 1; + UCHAR PartitionSelect : 6; + UCHAR Reserved1[3]; + UCHAR Control; + } PARTITION, *PPARTITION; + + struct _WRITE_TAPE_MARKS { + UCHAR OperationCode; + UCHAR Immediate : 1; + UCHAR WriteSetMarks: 1; + UCHAR Reserved : 3; + UCHAR LogicalUnitNumber : 3; + UCHAR TransferLength[3]; + UCHAR Control; + } WRITE_TAPE_MARKS, *PWRITE_TAPE_MARKS; + + struct _SPACE_TAPE_MARKS { + UCHAR OperationCode; + UCHAR Code : 3; + UCHAR Reserved : 2; + UCHAR LogicalUnitNumber : 3; + UCHAR NumMarksMSB ; + UCHAR NumMarks; + UCHAR NumMarksLSB; + union { + UCHAR value; + struct { + UCHAR Link : 1; + UCHAR Flag : 1; + UCHAR Reserved : 4; + UCHAR VendorUnique : 2; + } Fields; + } Byte6; + } SPACE_TAPE_MARKS, *PSPACE_TAPE_MARKS; + + struct _READ_POSITION { + UCHAR Operation; + UCHAR BlockType : 1; + UCHAR Reserved1 : 4; + UCHAR Lun : 3; + UCHAR Reserved2[7]; + UCHAR Control; + } READ_POSITION, *PREAD_POSITION; + + struct _CDB6READWRITETAPE { + UCHAR OperationCode; + UCHAR VendorSpecific : 5; + UCHAR Reserved : 3; + UCHAR TransferLenMSB; + UCHAR TransferLen; + UCHAR TransferLenLSB; + UCHAR Link : 1; + UCHAR Flag : 1; + UCHAR Reserved1 : 4; + UCHAR VendorUnique : 2; + } CDB6READWRITETAPE, *PCDB6READWRITETAPE; + + struct _INIT_ELEMENT_STATUS { + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR LogicalUnitNubmer : 3; + UCHAR Reserved2[3]; + UCHAR Reserved3 : 7; + UCHAR NoBarCode : 1; + } INIT_ELEMENT_STATUS, *PINIT_ELEMENT_STATUS; + + struct _INITIALIZE_ELEMENT_RANGE { + UCHAR OperationCode; + UCHAR Range : 1; + UCHAR Reserved1 : 4; + UCHAR LogicalUnitNubmer : 3; + UCHAR FirstElementAddress[2]; + UCHAR Reserved2[2]; + UCHAR NumberOfElements[2]; + UCHAR Reserved3; + UCHAR Reserved4 : 7; + UCHAR NoBarCode : 1; + } INITIALIZE_ELEMENT_RANGE, *PINITIALIZE_ELEMENT_RANGE; + + struct _POSITION_TO_ELEMENT { + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR LogicalUnitNumber : 3; + UCHAR TransportElementAddress[2]; + UCHAR DestinationElementAddress[2]; + UCHAR Reserved2[2]; + UCHAR Flip : 1; + UCHAR Reserved3 : 7; + UCHAR Control; + } POSITION_TO_ELEMENT, *PPOSITION_TO_ELEMENT; + + struct _MOVE_MEDIUM { + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR LogicalUnitNumber : 3; + UCHAR TransportElementAddress[2]; + UCHAR SourceElementAddress[2]; + UCHAR DestinationElementAddress[2]; + UCHAR Reserved2[2]; + UCHAR Flip : 1; + UCHAR Reserved3 : 7; + UCHAR Control; + } MOVE_MEDIUM, *PMOVE_MEDIUM; + + struct _EXCHANGE_MEDIUM { + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR LogicalUnitNumber : 3; + UCHAR TransportElementAddress[2]; + UCHAR SourceElementAddress[2]; + UCHAR Destination1ElementAddress[2]; + UCHAR Destination2ElementAddress[2]; + UCHAR Flip1 : 1; + UCHAR Flip2 : 1; + UCHAR Reserved3 : 6; + UCHAR Control; + } EXCHANGE_MEDIUM, *PEXCHANGE_MEDIUM; + + struct _READ_ELEMENT_STATUS { + UCHAR OperationCode; + UCHAR ElementType : 4; + UCHAR VolTag : 1; + UCHAR LogicalUnitNumber : 3; + UCHAR StartingElementAddress[2]; + UCHAR NumberOfElements[2]; + UCHAR Reserved1; + UCHAR AllocationLength[3]; + UCHAR Reserved2; + UCHAR Control; + } READ_ELEMENT_STATUS, *PREAD_ELEMENT_STATUS; + + struct _SEND_VOLUME_TAG { + UCHAR OperationCode; + UCHAR ElementType : 4; + UCHAR Reserved1 : 1; + UCHAR LogicalUnitNumber : 3; + UCHAR StartingElementAddress[2]; + UCHAR Reserved2; + UCHAR ActionCode : 5; + UCHAR Reserved3 : 3; + UCHAR Reserved4[2]; + UCHAR ParameterListLength[2]; + UCHAR Reserved5; + UCHAR Control; + } SEND_VOLUME_TAG, *PSEND_VOLUME_TAG; + + struct _REQUEST_VOLUME_ELEMENT_ADDRESS { + UCHAR OperationCode; + UCHAR ElementType : 4; + UCHAR VolTag : 1; + UCHAR LogicalUnitNumber : 3; + UCHAR StartingElementAddress[2]; + UCHAR NumberElements[2]; + UCHAR Reserved1; + UCHAR AllocationLength[3]; + UCHAR Reserved2; + UCHAR Control; + } REQUEST_VOLUME_ELEMENT_ADDRESS, *PREQUEST_VOLUME_ELEMENT_ADDRESS; + + struct _LOAD_UNLOAD { + UCHAR OperationCode; + UCHAR Immediate : 1; + UCHAR Reserved1 : 4; + UCHAR Lun : 3; + UCHAR Reserved2[2]; + UCHAR Start : 1; + UCHAR LoadEject : 1; + UCHAR Reserved3: 6; + UCHAR Reserved4[3]; + UCHAR Slot; + UCHAR Reserved5[3]; + } LOAD_UNLOAD, *PLOAD_UNLOAD; + + struct _MECH_STATUS { + UCHAR OperationCode; + UCHAR Reserved : 5; + UCHAR Lun : 3; + UCHAR Reserved1[6]; + UCHAR AllocationLength[2]; + UCHAR Reserved2[1]; + UCHAR Control; + } MECH_STATUS, *PMECH_STATUS; + + struct _SYNCHRONIZE_CACHE10 { + + UCHAR OperationCode; + + UCHAR RelAddr : 1; + UCHAR Immediate : 1; + UCHAR Reserved : 3; + UCHAR Lun : 3; + + UCHAR LogicalBlockAddress[4]; + UCHAR Reserved2; + UCHAR BlockCount[2]; + UCHAR Control; + } SYNCHRONIZE_CACHE10, *PSYNCHRONIZE_CACHE10; + + struct _GET_EVENT_STATUS_NOTIFICATION { + UCHAR OperationCode; + + UCHAR Immediate : 1; + UCHAR Reserved : 4; + UCHAR Lun : 3; + + UCHAR Reserved2[2]; + UCHAR NotificationClassRequest; + UCHAR Reserved3[2]; + UCHAR EventListLength[2]; + + UCHAR Control; + } GET_EVENT_STATUS_NOTIFICATION, *PGET_EVENT_STATUS_NOTIFICATION; + + struct _READ_DVD_STRUCTURE { + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR Lun : 3; + UCHAR RMDBlockNumber[4]; + UCHAR LayerNumber; + UCHAR Format; + UCHAR AllocationLength[2]; + UCHAR Reserved3 : 6; + UCHAR AGID : 2; + UCHAR Control; + } READ_DVD_STRUCTURE, *PREAD_DVD_STRUCTURE; + + struct _SEND_DVD_STRUCTURE { + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR Lun : 3; + UCHAR Reserved2[5]; + UCHAR Format; + UCHAR ParameterListLength[2]; + UCHAR Reserved3; + UCHAR Control; + } SEND_DVD_STRUCTURE, *PSEND_DVD_STRUCTURE; + + struct _SEND_KEY { + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR Lun : 3; + UCHAR Reserved2[6]; + UCHAR ParameterListLength[2]; + UCHAR KeyFormat : 6; + UCHAR AGID : 2; + UCHAR Control; + } SEND_KEY, *PSEND_KEY; + + struct _REPORT_KEY { + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR Lun : 3; + UCHAR LogicalBlockAddress[4]; + UCHAR Reserved2[2]; + UCHAR AllocationLength[2]; + UCHAR KeyFormat : 6; + UCHAR AGID : 2; + UCHAR Control; + } REPORT_KEY, *PREPORT_KEY; + + struct _SET_READ_AHEAD { + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR Lun : 3; + UCHAR TriggerLBA[4]; + UCHAR ReadAheadLBA[4]; + UCHAR Reserved2; + UCHAR Control; + } SET_READ_AHEAD, *PSET_READ_AHEAD; + + struct _READ_FORMATTED_CAPACITIES { + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR Lun : 3; + UCHAR Reserved2[5]; + UCHAR AllocationLength[2]; + UCHAR Control; + } READ_FORMATTED_CAPACITIES, *PREAD_FORMATTED_CAPACITIES; + + struct _REPORT_LUNS { + UCHAR OperationCode; + UCHAR Reserved1[5]; + UCHAR AllocationLength[4]; + UCHAR Reserved2[1]; + UCHAR Control; + } REPORT_LUNS, *PREPORT_LUNS; + + struct _PERSISTENT_RESERVE_IN { + UCHAR OperationCode; + UCHAR ServiceAction : 5; + UCHAR Reserved1 : 3; + UCHAR Reserved2[5]; + UCHAR AllocationLength[2]; + UCHAR Control; + } PERSISTENT_RESERVE_IN, *PPERSISTENT_RESERVE_IN; + + struct _PERSISTENT_RESERVE_OUT { + UCHAR OperationCode; + UCHAR ServiceAction : 5; + UCHAR Reserved1 : 3; + UCHAR Type : 4; + UCHAR Scope : 4; + UCHAR Reserved2[4]; + UCHAR ParameterListLength[2]; + UCHAR Control; + } PERSISTENT_RESERVE_OUT, *PPERSISTENT_RESERVE_OUT; + + struct _GET_CONFIGURATION { + UCHAR OperationCode; + UCHAR RequestType : 1; + UCHAR Reserved1 : 7; + UCHAR StartingFeature[2]; + UCHAR Reserved2[3]; + UCHAR AllocationLength[2]; + UCHAR Control; + } GET_CONFIGURATION, *PGET_CONFIGURATION; + + struct _SET_CD_SPEED { + UCHAR OperationCode; + UCHAR Reserved1; + UCHAR ReadSpeed[2]; + UCHAR WriteSpeed[2]; + UCHAR Reserved2[5]; + UCHAR Control; + } SET_CD_SPEED, *PSET_CD_SPEED; + + ULONG AsUlong[4]; + UCHAR AsByte[16]; +} CDB, *PCDB; + +#ifndef _INQUIRYDATA_DEFINED /* also in minitape.h */ +#define _INQUIRYDATA_DEFINED + +#define INQUIRYDATABUFFERSIZE 36 + +typedef struct _INQUIRYDATA { + UCHAR DeviceType : 5; + UCHAR DeviceTypeQualifier : 3; + UCHAR DeviceTypeModifier : 7; + UCHAR RemovableMedia : 1; + _ANONYMOUS_UNION union { + UCHAR Versions; + _ANONYMOUS_STRUCT struct { + UCHAR ANSIVersion : 3; + UCHAR ECMAVersion : 3; + UCHAR ISOVersion : 2; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + UCHAR ResponseDataFormat : 4; + UCHAR HiSupport : 1; + UCHAR NormACA : 1; + UCHAR TerminateTask : 1; + UCHAR AERC : 1; + UCHAR AdditionalLength; + UCHAR Reserved; + UCHAR Addr16 : 1; + UCHAR Addr32 : 1; + UCHAR AckReqQ: 1; + UCHAR MediumChanger : 1; + UCHAR MultiPort : 1; + UCHAR ReservedBit2 : 1; + UCHAR EnclosureServices : 1; + UCHAR ReservedBit3 : 1; + UCHAR SoftReset : 1; + UCHAR CommandQueue : 1; + UCHAR TransferDisable : 1; + UCHAR LinkedCommands : 1; + UCHAR Synchronous : 1; + UCHAR Wide16Bit : 1; + UCHAR Wide32Bit : 1; + UCHAR RelativeAddressing : 1; + UCHAR VendorId[8]; + UCHAR ProductId[16]; + UCHAR ProductRevisionLevel[4]; + UCHAR VendorSpecific[20]; + UCHAR Reserved3[40]; +} INQUIRYDATA, *PINQUIRYDATA; +#endif + +/* INQUIRYDATA.DeviceType constants */ +#define DIRECT_ACCESS_DEVICE 0x00 +#define SEQUENTIAL_ACCESS_DEVICE 0x01 +#define PRINTER_DEVICE 0x02 +#define PROCESSOR_DEVICE 0x03 +#define WRITE_ONCE_READ_MULTIPLE_DEVICE 0x04 +#define READ_ONLY_DIRECT_ACCESS_DEVICE 0x05 +#define SCANNER_DEVICE 0x06 +#define OPTICAL_DEVICE 0x07 +#define MEDIUM_CHANGER 0x08 +#define COMMUNICATION_DEVICE 0x09 +#define LOGICAL_UNIT_NOT_PRESENT_DEVICE 0x7F +#define DEVICE_QUALIFIER_NOT_SUPPORTED 0x03 + +/* INQUIRYDATA.DeviceTypeQualifier constants */ +#define DEVICE_CONNECTED 0x00 + +#define SCSISTAT_GOOD 0x00 +#define SCSISTAT_CHECK_CONDITION 0x02 +#define SCSISTAT_CONDITION_MET 0x04 +#define SCSISTAT_BUSY 0x08 +#define SCSISTAT_INTERMEDIATE 0x10 +#define SCSISTAT_INTERMEDIATE_COND_MET 0x14 +#define SCSISTAT_RESERVATION_CONFLICT 0x18 +#define SCSISTAT_COMMAND_TERMINATED 0x22 +#define SCSISTAT_QUEUE_FULL 0x28 + +/* Mode Sense/Select page constants */ +#define MODE_PAGE_ERROR_RECOVERY 0x01 +#define MODE_PAGE_DISCONNECT 0x02 +#define MODE_PAGE_FORMAT_DEVICE 0x03 +#define MODE_PAGE_RIGID_GEOMETRY 0x04 +#define MODE_PAGE_FLEXIBILE 0x05 +#define MODE_PAGE_WRITE_PARAMETERS 0x05 +#define MODE_PAGE_VERIFY_ERROR 0x07 +#define MODE_PAGE_CACHING 0x08 +#define MODE_PAGE_PERIPHERAL 0x09 +#define MODE_PAGE_CONTROL 0x0A +#define MODE_PAGE_MEDIUM_TYPES 0x0B +#define MODE_PAGE_NOTCH_PARTITION 0x0C +#define MODE_PAGE_CD_AUDIO_CONTROL 0x0E +#define MODE_PAGE_DATA_COMPRESS 0x0F +#define MODE_PAGE_DEVICE_CONFIG 0x10 +#define MODE_PAGE_MEDIUM_PARTITION 0x11 +#define MODE_PAGE_CDVD_FEATURE_SET 0x18 +#define MODE_PAGE_POWER_CONDITION 0x1A +#define MODE_PAGE_FAULT_REPORTING 0x1C +#define MODE_PAGE_CDVD_INACTIVITY 0x1D +#define MODE_PAGE_ELEMENT_ADDRESS 0x1D +#define MODE_PAGE_TRANSPORT_GEOMETRY 0x1E +#define MODE_PAGE_DEVICE_CAPABILITIES 0x1F +#define MODE_PAGE_CAPABILITIES 0x2A +#define MODE_SENSE_RETURN_ALL 0x3f +#define MODE_SENSE_CURRENT_VALUES 0x00 +#define MODE_SENSE_CHANGEABLE_VALUES 0x40 +#define MODE_SENSE_DEFAULT_VAULES 0x80 +#define MODE_SENSE_SAVED_VALUES 0xc0 + +/* SCSI CDB operation codes */ +#define SCSIOP_TEST_UNIT_READY 0x00 +#define SCSIOP_REZERO_UNIT 0x01 +#define SCSIOP_REWIND 0x01 +#define SCSIOP_REQUEST_BLOCK_ADDR 0x02 +#define SCSIOP_REQUEST_SENSE 0x03 +#define SCSIOP_FORMAT_UNIT 0x04 +#define SCSIOP_READ_BLOCK_LIMITS 0x05 +#define SCSIOP_REASSIGN_BLOCKS 0x07 +#define SCSIOP_INIT_ELEMENT_STATUS 0x07 +#define SCSIOP_READ6 0x08 +#define SCSIOP_RECEIVE 0x08 +#define SCSIOP_WRITE6 0x0A +#define SCSIOP_PRINT 0x0A +#define SCSIOP_SEND 0x0A +#define SCSIOP_SEEK6 0x0B +#define SCSIOP_TRACK_SELECT 0x0B +#define SCSIOP_SLEW_PRINT 0x0B +#define SCSIOP_SEEK_BLOCK 0x0C +#define SCSIOP_PARTITION 0x0D +#define SCSIOP_READ_REVERSE 0x0F +#define SCSIOP_WRITE_FILEMARKS 0x10 +#define SCSIOP_FLUSH_BUFFER 0x10 +#define SCSIOP_SPACE 0x11 +#define SCSIOP_INQUIRY 0x12 +#define SCSIOP_VERIFY6 0x13 +#define SCSIOP_RECOVER_BUF_DATA 0x14 +#define SCSIOP_MODE_SELECT 0x15 +#define SCSIOP_RESERVE_UNIT 0x16 +#define SCSIOP_RELEASE_UNIT 0x17 +#define SCSIOP_COPY 0x18 +#define SCSIOP_ERASE 0x19 +#define SCSIOP_MODE_SENSE 0x1A +#define SCSIOP_START_STOP_UNIT 0x1B +#define SCSIOP_STOP_PRINT 0x1B +#define SCSIOP_LOAD_UNLOAD 0x1B +#define SCSIOP_RECEIVE_DIAGNOSTIC 0x1C +#define SCSIOP_SEND_DIAGNOSTIC 0x1D +#define SCSIOP_MEDIUM_REMOVAL 0x1E + +#define SCSIOP_READ_FORMATTED_CAPACITY 0x23 +#define SCSIOP_READ_CAPACITY 0x25 +#define SCSIOP_READ 0x28 +#define SCSIOP_WRITE 0x2A +#define SCSIOP_SEEK 0x2B +#define SCSIOP_LOCATE 0x2B +#define SCSIOP_POSITION_TO_ELEMENT 0x2B +#define SCSIOP_WRITE_VERIFY 0x2E +#define SCSIOP_VERIFY 0x2F +#define SCSIOP_SEARCH_DATA_HIGH 0x30 +#define SCSIOP_SEARCH_DATA_EQUAL 0x31 +#define SCSIOP_SEARCH_DATA_LOW 0x32 +#define SCSIOP_SET_LIMITS 0x33 +#define SCSIOP_READ_POSITION 0x34 +#define SCSIOP_SYNCHRONIZE_CACHE 0x35 +#define SCSIOP_COMPARE 0x39 +#define SCSIOP_COPY_COMPARE 0x3A +#define SCSIOP_WRITE_DATA_BUFF 0x3B +#define SCSIOP_READ_DATA_BUFF 0x3C +#define SCSIOP_CHANGE_DEFINITION 0x40 +#define SCSIOP_READ_SUB_CHANNEL 0x42 +#define SCSIOP_READ_TOC 0x43 +#define SCSIOP_READ_HEADER 0x44 +#define SCSIOP_PLAY_AUDIO 0x45 +#define SCSIOP_GET_CONFIGURATION 0x46 +#define SCSIOP_PLAY_AUDIO_MSF 0x47 +#define SCSIOP_PLAY_TRACK_INDEX 0x48 +#define SCSIOP_PLAY_TRACK_RELATIVE 0x49 +#define SCSIOP_GET_EVENT_STATUS 0x4A +#define SCSIOP_PAUSE_RESUME 0x4B +#define SCSIOP_LOG_SELECT 0x4C +#define SCSIOP_LOG_SENSE 0x4D +#define SCSIOP_STOP_PLAY_SCAN 0x4E +#define SCSIOP_READ_DISK_INFORMATION 0x51 +#define SCSIOP_READ_TRACK_INFORMATION 0x52 +#define SCSIOP_RESERVE_TRACK_RZONE 0x53 +#define SCSIOP_SEND_OPC_INFORMATION 0x54 +#define SCSIOP_MODE_SELECT10 0x55 +#define SCSIOP_MODE_SENSE10 0x5A +#define SCSIOP_CLOSE_TRACK_SESSION 0x5B +#define SCSIOP_READ_BUFFER_CAPACITY 0x5C +#define SCSIOP_SEND_CUE_SHEET 0x5D +#define SCSIOP_PERSISTENT_RESERVE_IN 0x5E +#define SCSIOP_PERSISTENT_RESERVE_OUT 0x5F + +#define SCSIOP_REPORT_LUNS 0xA0 +#define SCSIOP_BLANK 0xA1 +#define SCSIOP_SEND_KEY 0xA3 +#define SCSIOP_REPORT_KEY 0xA4 +#define SCSIOP_MOVE_MEDIUM 0xA5 +#define SCSIOP_LOAD_UNLOAD_SLOT 0xA6 +#define SCSIOP_EXCHANGE_MEDIUM 0xA6 +#define SCSIOP_SET_READ_AHEAD 0xA7 +#define SCSIOP_READ_DVD_STRUCTURE 0xAD +#define SCSIOP_REQUEST_VOL_ELEMENT 0xB5 +#define SCSIOP_SEND_VOLUME_TAG 0xB6 +#define SCSIOP_READ_ELEMENT_STATUS 0xB8 +#define SCSIOP_READ_CD_MSF 0xB9 +#define SCSIOP_SCAN_CD 0xBA +#define SCSIOP_SET_CD_SPEED 0xBB +#define SCSIOP_PLAY_CD 0xBC +#define SCSIOP_MECHANISM_STATUS 0xBD +#define SCSIOP_READ_CD 0xBE +#define SCSIOP_SEND_DVD_STRUCTURE 0xBF +#define SCSIOP_INIT_ELEMENT_RANGE 0xE7 + +#define SCSIOP_DENON_EJECT_DISC 0xE6 +#define SCSIOP_DENON_STOP_AUDIO 0xE7 +#define SCSIOP_DENON_PLAY_AUDIO 0xE8 +#define SCSIOP_DENON_READ_TOC 0xE9 +#define SCSIOP_DENON_READ_SUBCODE 0xEB + +#define SCSIMESS_MODIFY_DATA_POINTER 0x00 +#define SCSIMESS_SYNCHRONOUS_DATA_REQ 0x01 +#define SCSIMESS_WIDE_DATA_REQUEST 0x03 + +#define SCSIMESS_MODIFY_DATA_LENGTH 5 +#define SCSIMESS_SYNCH_DATA_LENGTH 3 +#define SCSIMESS_WIDE_DATA_LENGTH 2 + +#define SCSIMESS_ABORT 0x06 +#define SCSIMESS_ABORT_WITH_TAG 0x0D +#define SCSIMESS_BUS_DEVICE_RESET 0x0C +#define SCSIMESS_CLEAR_QUEUE 0x0E +#define SCSIMESS_COMMAND_COMPLETE 0x00 +#define SCSIMESS_DISCONNECT 0x04 +#define SCSIMESS_EXTENDED_MESSAGE 0x01 +#define SCSIMESS_IDENTIFY 0x80 +#define SCSIMESS_IDENTIFY_WITH_DISCON 0xC0 +#define SCSIMESS_IGNORE_WIDE_RESIDUE 0x23 +#define SCSIMESS_INITIATE_RECOVERY 0x0F +#define SCSIMESS_INIT_DETECTED_ERROR 0x05 +#define SCSIMESS_LINK_CMD_COMP 0x0A +#define SCSIMESS_LINK_CMD_COMP_W_FLAG 0x0B +#define SCSIMESS_MESS_PARITY_ERROR 0x09 +#define SCSIMESS_MESSAGE_REJECT 0x07 +#define SCSIMESS_NO_OPERATION 0x08 +#define SCSIMESS_HEAD_OF_QUEUE_TAG 0x21 +#define SCSIMESS_ORDERED_QUEUE_TAG 0x22 +#define SCSIMESS_SIMPLE_QUEUE_TAG 0x20 +#define SCSIMESS_RELEASE_RECOVERY 0x10 +#define SCSIMESS_RESTORE_POINTERS 0x03 +#define SCSIMESS_SAVE_DATA_POINTER 0x02 +#define SCSIMESS_TERMINATE_IO_PROCESS 0x11 + +#define CDB_FORCE_MEDIA_ACCESS 0x08 + +#define CDB_RETURN_ON_COMPLETION 0 +#define CDB_RETURN_IMMEDIATE 1 + +#define CDB_INQUIRY_EVPD 0x01 + +#define LUN0_FORMAT_SAVING_DEFECT_LIST 0 +#define USE_DEFAULTMSB 0 +#define USE_DEFAULTLSB 0 + +#define START_UNIT_CODE 0x01 +#define STOP_UNIT_CODE 0x00 + +typedef struct _SENSE_DATA { + UCHAR ErrorCode : 7; + UCHAR Valid : 1; + UCHAR SegmentNumber; + UCHAR SenseKey : 4; + UCHAR Reserved : 1; + UCHAR IncorrectLength : 1; + UCHAR EndOfMedia : 1; + UCHAR FileMark : 1; + UCHAR Information[4]; + UCHAR AdditionalSenseLength; + UCHAR CommandSpecificInformation[4]; + UCHAR AdditionalSenseCode; + UCHAR AdditionalSenseCodeQualifier; + UCHAR FieldReplaceableUnitCode; + UCHAR SenseKeySpecific[3]; +} SENSE_DATA, *PSENSE_DATA; + +#define SENSE_BUFFER_SIZE 18 + +/* Sense codes */ +#define SCSI_SENSE_NO_SENSE 0x00 +#define SCSI_SENSE_RECOVERED_ERROR 0x01 +#define SCSI_SENSE_NOT_READY 0x02 +#define SCSI_SENSE_MEDIUM_ERROR 0x03 +#define SCSI_SENSE_HARDWARE_ERROR 0x04 +#define SCSI_SENSE_ILLEGAL_REQUEST 0x05 +#define SCSI_SENSE_UNIT_ATTENTION 0x06 +#define SCSI_SENSE_DATA_PROTECT 0x07 +#define SCSI_SENSE_BLANK_CHECK 0x08 +#define SCSI_SENSE_UNIQUE 0x09 +#define SCSI_SENSE_COPY_ABORTED 0x0A +#define SCSI_SENSE_ABORTED_COMMAND 0x0B +#define SCSI_SENSE_EQUAL 0x0C +#define SCSI_SENSE_VOL_OVERFLOW 0x0D +#define SCSI_SENSE_MISCOMPARE 0x0E +#define SCSI_SENSE_RESERVED 0x0F + +/* Additional tape bit */ +#define SCSI_ILLEGAL_LENGTH 0x20 +#define SCSI_EOM 0x40 +#define SCSI_FILE_MARK 0x80 + +/* Additional Sense codes */ +#define SCSI_ADSENSE_NO_SENSE 0x00 +#define SCSI_ADSENSE_NO_SEEK_COMPLETE 0x02 +#define SCSI_ADSENSE_LUN_NOT_READY 0x04 +#define SCSI_ADSENSE_WRITE_ERROR 0x0C +#define SCSI_ADSENSE_TRACK_ERROR 0x14 +#define SCSI_ADSENSE_SEEK_ERROR 0x15 +#define SCSI_ADSENSE_REC_DATA_NOECC 0x17 +#define SCSI_ADSENSE_REC_DATA_ECC 0x18 +#define SCSI_ADSENSE_ILLEGAL_COMMAND 0x20 +#define SCSI_ADSENSE_ILLEGAL_BLOCK 0x21 +#define SCSI_ADSENSE_INVALID_CDB 0x24 +#define SCSI_ADSENSE_INVALID_LUN 0x25 +#define SCSI_ADSENSE_WRITE_PROTECT 0x27 +#define SCSI_ADSENSE_MEDIUM_CHANGED 0x28 +#define SCSI_ADSENSE_BUS_RESET 0x29 +#define SCSI_ADSENSE_INSUFFICIENT_TIME_FOR_OPERATION 0x2E +#define SCSI_ADSENSE_INVALID_MEDIA 0x30 +#define SCSI_ADSENSE_NO_MEDIA_IN_DEVICE 0x3a +#define SCSI_ADSENSE_POSITION_ERROR 0x3b +#define SCSI_ADSENSE_OPERATOR_REQUEST 0x5a +#define SCSI_ADSENSE_FAILURE_PREDICTION_THRESHOLD_EXCEEDED 0x5d +#define SCSI_ADSENSE_ILLEGAL_MODE_FOR_THIS_TRACK 0x64 +#define SCSI_ADSENSE_COPY_PROTECTION_FAILURE 0x6f +#define SCSI_ADSENSE_POWER_CALIBRATION_ERROR 0x73 +#define SCSI_ADSENSE_VENDOR_UNIQUE 0x80 +#define SCSI_ADSENSE_MUSIC_AREA 0xA0 +#define SCSI_ADSENSE_DATA_AREA 0xA1 +#define SCSI_ADSENSE_VOLUME_OVERFLOW 0xA7 + +#define SCSI_SENSEQ_CAUSE_NOT_REPORTABLE 0x00 +#define SCSI_SENSEQ_BECOMING_READY 0x01 +#define SCSI_SENSEQ_INIT_COMMAND_REQUIRED 0x02 +#define SCSI_SENSEQ_MANUAL_INTERVENTION_REQUIRED 0x03 +#define SCSI_SENSEQ_FORMAT_IN_PROGRESS 0x04 +#define SCSI_SENSEQ_REBUILD_IN_PROGRESS 0x05 +#define SCSI_SENSEQ_RECALCULATION_IN_PROGRESS 0x06 +#define SCSI_SENSEQ_OPERATION_IN_PROGRESS 0x07 +#define SCSI_SENSEQ_LONG_WRITE_IN_PROGRESS 0x08 +#define SCSI_SENSEQ_LOSS_OF_STREAMING 0x09 +#define SCSI_SENSEQ_PADDING_BLOCKS_ADDED 0x0A + + +#define FILE_DEVICE_SCSI 0x0000001b + +#define IOCTL_SCSI_EXECUTE_IN ((FILE_DEVICE_SCSI << 16) + 0x0011) +#define IOCTL_SCSI_EXECUTE_OUT ((FILE_DEVICE_SCSI << 16) + 0x0012) +#define IOCTL_SCSI_EXECUTE_NONE ((FILE_DEVICE_SCSI << 16) + 0x0013) + +/* SMART support in ATAPI */ +#define IOCTL_SCSI_MINIPORT_SMART_VERSION ((FILE_DEVICE_SCSI << 16) + 0x0500) +#define IOCTL_SCSI_MINIPORT_IDENTIFY ((FILE_DEVICE_SCSI << 16) + 0x0501) +#define IOCTL_SCSI_MINIPORT_READ_SMART_ATTRIBS ((FILE_DEVICE_SCSI << 16) + 0x0502) +#define IOCTL_SCSI_MINIPORT_READ_SMART_THRESHOLDS ((FILE_DEVICE_SCSI << 16) + 0x0503) +#define IOCTL_SCSI_MINIPORT_ENABLE_SMART ((FILE_DEVICE_SCSI << 16) + 0x0504) +#define IOCTL_SCSI_MINIPORT_DISABLE_SMART ((FILE_DEVICE_SCSI << 16) + 0x0505) +#define IOCTL_SCSI_MINIPORT_RETURN_STATUS ((FILE_DEVICE_SCSI << 16) + 0x0506) +#define IOCTL_SCSI_MINIPORT_ENABLE_DISABLE_AUTOSAVE ((FILE_DEVICE_SCSI << 16) + 0x0507) +#define IOCTL_SCSI_MINIPORT_SAVE_ATTRIBUTE_VALUES ((FILE_DEVICE_SCSI << 16) + 0x0508) +#define IOCTL_SCSI_MINIPORT_EXECUTE_OFFLINE_DIAGS ((FILE_DEVICE_SCSI << 16) + 0x0509) +#define IOCTL_SCSI_MINIPORT_ENABLE_DISABLE_AUTO_OFFLINE ((FILE_DEVICE_SCSI << 16) + 0x050a) +#define IOCTL_SCSI_MINIPORT_READ_SMART_LOG ((FILE_DEVICE_SCSI << 16) + 0x050b) +#define IOCTL_SCSI_MINIPORT_WRITE_SMART_LOG ((FILE_DEVICE_SCSI << 16) + 0x050c) + +/* CLUSTER support */ +#define IOCTL_SCSI_MINIPORT_NOT_QUORUM_CAPABLE ((FILE_DEVICE_SCSI << 16) + 0x0520) +#define IOCTL_SCSI_MINIPORT_NOT_CLUSTER_CAPABLE ((FILE_DEVICE_SCSI << 16) + 0x0521) + +/* Read Capacity Data. Returned in Big Endian format */ +typedef struct _READ_CAPACITY_DATA { + ULONG LogicalBlockAddress; + ULONG BytesPerBlock; +} READ_CAPACITY_DATA, *PREAD_CAPACITY_DATA; + +/* Read Block Limits Data. Returned in Big Endian format */ +typedef struct _READ_BLOCK_LIMITS { + UCHAR Reserved; + UCHAR BlockMaximumSize[3]; + UCHAR BlockMinimumSize[2]; +} READ_BLOCK_LIMITS_DATA, *PREAD_BLOCK_LIMITS_DATA; + +#define MODE_BLOCK_DESC_LENGTH 8 +#define MODE_HEADER_LENGTH 4 +#define MODE_HEADER_LENGTH10 8 + +typedef struct _MODE_PARAMETER_HEADER { + UCHAR ModeDataLength; + UCHAR MediumType; + UCHAR DeviceSpecificParameter; + UCHAR BlockDescriptorLength; +} MODE_PARAMETER_HEADER, *PMODE_PARAMETER_HEADER; + +typedef struct _MODE_PARAMETER_HEADER10 { + UCHAR ModeDataLength[2]; + UCHAR MediumType; + UCHAR DeviceSpecificParameter; + UCHAR Reserved[2]; + UCHAR BlockDescriptorLength[2]; +} MODE_PARAMETER_HEADER10, *PMODE_PARAMETER_HEADER10; + +#define MODE_FD_SINGLE_SIDE 0x01 +#define MODE_FD_DOUBLE_SIDE 0x02 +#define MODE_FD_MAXIMUM_TYPE 0x1E +#define MODE_DSP_FUA_SUPPORTED 0x10 +#define MODE_DSP_WRITE_PROTECT 0x80 + +typedef struct _MODE_PARAMETER_BLOCK { + UCHAR DensityCode; + UCHAR NumberOfBlocks[3]; + UCHAR Reserved; + UCHAR BlockLength[3]; +} MODE_PARAMETER_BLOCK, *PMODE_PARAMETER_BLOCK; + +typedef struct _MODE_DISCONNECT_PAGE { + UCHAR PageCode : 6; + UCHAR Reserved : 1; + UCHAR PageSavable : 1; + UCHAR PageLength; + UCHAR BufferFullRatio; + UCHAR BufferEmptyRatio; + UCHAR BusInactivityLimit[2]; + UCHAR BusDisconnectTime[2]; + UCHAR BusConnectTime[2]; + UCHAR MaximumBurstSize[2]; + UCHAR DataTransferDisconnect : 2; + UCHAR Reserved2[3]; +} MODE_DISCONNECT_PAGE, *PMODE_DISCONNECT_PAGE; + +typedef struct _MODE_CACHING_PAGE { + UCHAR PageCode : 6; + UCHAR Reserved : 1; + UCHAR PageSavable : 1; + UCHAR PageLength; + UCHAR ReadDisableCache : 1; + UCHAR MultiplicationFactor : 1; + UCHAR WriteCacheEnable : 1; + UCHAR Reserved2 : 5; + UCHAR WriteRetensionPriority : 4; + UCHAR ReadRetensionPriority : 4; + UCHAR DisablePrefetchTransfer[2]; + UCHAR MinimumPrefetch[2]; + UCHAR MaximumPrefetch[2]; + UCHAR MaximumPrefetchCeiling[2]; +} MODE_CACHING_PAGE, *PMODE_CACHING_PAGE; + +typedef struct _MODE_CDROM_WRITE_PARAMETERS_PAGE { + UCHAR PageLength; + UCHAR WriteType : 4; + UCHAR TestWrite : 1; + UCHAR LinkSizeValid : 1; + UCHAR BufferUnderrunFreeEnabled : 1; + UCHAR Reserved2 : 1; + UCHAR TrackMode : 4; + UCHAR Copy : 1; + UCHAR FixedPacket : 1; + UCHAR MultiSession : 2; + UCHAR DataBlockType : 4; + UCHAR Reserved3 : 4; + UCHAR LinkSize; + UCHAR Reserved4; + UCHAR HostApplicationCode : 6; + UCHAR Reserved5 : 2; + UCHAR SessionFormat; + UCHAR Reserved6; + UCHAR PacketSize[4]; + UCHAR AudioPauseLength[2]; + UCHAR Reserved7 : 7; + UCHAR MediaCatalogNumberValid : 1; + UCHAR MediaCatalogNumber[13]; + UCHAR MediaCatalogNumberZero; + UCHAR MediaCatalogNumberAFrame; + UCHAR Reserved8 : 7; + UCHAR ISRCValid : 1; + UCHAR ISRCCountry[2]; + UCHAR ISRCOwner[3]; + UCHAR ISRCRecordingYear[2]; + UCHAR ISRCSerialNumber[5]; + UCHAR ISRCZero; + UCHAR ISRCAFrame; + UCHAR ISRCReserved; + UCHAR SubHeaderData[4]; +} MODE_CDROM_WRITE_PARAMETERS_PAGE, *PMODE_CDROM_WRITE_PARAMETERS_PAGE; + +typedef struct _MODE_FLEXIBLE_DISK_PAGE { + UCHAR PageCode : 6; + UCHAR Reserved : 1; + UCHAR PageSavable : 1; + UCHAR PageLength; + UCHAR TransferRate[2]; + UCHAR NumberOfHeads; + UCHAR SectorsPerTrack; + UCHAR BytesPerSector[2]; + UCHAR NumberOfCylinders[2]; + UCHAR StartWritePrecom[2]; + UCHAR StartReducedCurrent[2]; + UCHAR StepRate[2]; + UCHAR StepPluseWidth; + UCHAR HeadSettleDelay[2]; + UCHAR MotorOnDelay; + UCHAR MotorOffDelay; + UCHAR Reserved2 : 5; + UCHAR MotorOnAsserted : 1; + UCHAR StartSectorNumber : 1; + UCHAR TrueReadySignal : 1; + UCHAR StepPlusePerCyclynder : 4; + UCHAR Reserved3 : 4; + UCHAR WriteCompenstation; + UCHAR HeadLoadDelay; + UCHAR HeadUnloadDelay; + UCHAR Pin2Usage : 4; + UCHAR Pin34Usage : 4; + UCHAR Pin1Usage : 4; + UCHAR Pin4Usage : 4; + UCHAR MediumRotationRate[2]; + UCHAR Reserved4[2]; +} MODE_FLEXIBLE_DISK_PAGE, *PMODE_FLEXIBLE_DISK_PAGE; + +typedef struct _MODE_FORMAT_PAGE { + UCHAR PageCode : 6; + UCHAR Reserved : 1; + UCHAR PageSavable : 1; + UCHAR PageLength; + UCHAR TracksPerZone[2]; + UCHAR AlternateSectorsPerZone[2]; + UCHAR AlternateTracksPerZone[2]; + UCHAR AlternateTracksPerLogicalUnit[2]; + UCHAR SectorsPerTrack[2]; + UCHAR BytesPerPhysicalSector[2]; + UCHAR Interleave[2]; + UCHAR TrackSkewFactor[2]; + UCHAR CylinderSkewFactor[2]; + UCHAR Reserved2 : 4; + UCHAR SurfaceFirst : 1; + UCHAR RemovableMedia : 1; + UCHAR HardSectorFormating : 1; + UCHAR SoftSectorFormating : 1; + UCHAR Reserved3[3]; +} MODE_FORMAT_PAGE, *PMODE_FORMAT_PAGE; + +typedef struct _MODE_RIGID_GEOMETRY_PAGE { + UCHAR PageCode : 6; + UCHAR Reserved : 1; + UCHAR PageSavable : 1; + UCHAR PageLength; + UCHAR NumberOfCylinders[3]; + UCHAR NumberOfHeads; + UCHAR StartWritePrecom[3]; + UCHAR StartReducedCurrent[3]; + UCHAR DriveStepRate[2]; + UCHAR LandZoneCyclinder[3]; + UCHAR RotationalPositionLock : 2; + UCHAR Reserved2 : 6; + UCHAR RotationOffset; + UCHAR Reserved3; + UCHAR RoataionRate[2]; + UCHAR Reserved4[2]; +} MODE_RIGID_GEOMETRY_PAGE, *PMODE_RIGID_GEOMETRY_PAGE; + +typedef struct _MODE_READ_WRITE_RECOVERY_PAGE { + UCHAR PageCode : 6; + UCHAR Reserved1 : 1; + UCHAR PSBit : 1; + UCHAR PageLength; + UCHAR DCRBit : 1; + UCHAR DTEBit : 1; + UCHAR PERBit : 1; + UCHAR EERBit : 1; + UCHAR RCBit : 1; + UCHAR TBBit : 1; + UCHAR ARRE : 1; + UCHAR AWRE : 1; + UCHAR ReadRetryCount; + UCHAR Reserved4[4]; + UCHAR WriteRetryCount; + UCHAR Reserved5[3]; +} MODE_READ_WRITE_RECOVERY_PAGE, *PMODE_READ_WRITE_RECOVERY_PAGE; + +typedef struct _MODE_READ_RECOVERY_PAGE { + UCHAR PageCode : 6; + UCHAR Reserved1 : 1; + UCHAR PSBit : 1; + UCHAR PageLength; + UCHAR DCRBit : 1; + UCHAR DTEBit : 1; + UCHAR PERBit : 1; + UCHAR Reserved2 : 1; + UCHAR RCBit : 1; + UCHAR TBBit : 1; + UCHAR Reserved3 : 2; + UCHAR ReadRetryCount; + UCHAR Reserved4[4]; +} MODE_READ_RECOVERY_PAGE, *PMODE_READ_RECOVERY_PAGE; + +typedef struct _MODE_INFO_EXCEPTIONS { + UCHAR PageCode : 6; + UCHAR Reserved1 : 1; + UCHAR PSBit : 1; + UCHAR PageLength; + _ANONYMOUS_UNION union { + UCHAR Flags; + _ANONYMOUS_STRUCT struct { + UCHAR LogErr : 1; + UCHAR Reserved2 : 1; + UCHAR Test : 1; + UCHAR Dexcpt : 1; + UCHAR Reserved3 : 3; + UCHAR Perf : 1; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + UCHAR ReportMethod : 4; + UCHAR Reserved4 : 4; + UCHAR IntervalTimer[4]; + UCHAR ReportCount[4]; +} MODE_INFO_EXCEPTIONS, *PMODE_INFO_EXCEPTIONS; + +/* CDROM audio control */ +#define CDB_AUDIO_PAUSE 0x00 +#define CDB_AUDIO_RESUME 0x01 +#define CDB_DEVICE_START 0x11 +#define CDB_DEVICE_STOP 0x10 +#define CDB_EJECT_MEDIA 0x10 +#define CDB_LOAD_MEDIA 0x01 +#define CDB_SUBCHANNEL_HEADER 0x00 +#define CDB_SUBCHANNEL_BLOCK 0x01 + +#define CDROM_AUDIO_CONTROL_PAGE 0x0E +#define MODE_SELECT_IMMEDIATE 0x04 +#define MODE_SELECT_PFBIT 0x10 + +#define CDB_USE_MSF 0x01 + +typedef struct _PORT_OUTPUT { + UCHAR ChannelSelection; + UCHAR Volume; +} PORT_OUTPUT, *PPORT_OUTPUT; + +typedef struct _AUDIO_OUTPUT { + UCHAR CodePage; + UCHAR ParameterLength; + UCHAR Immediate; + UCHAR Reserved[2]; + UCHAR LbaFormat; + UCHAR LogicalBlocksPerSecond[2]; + PORT_OUTPUT PortOutput[4]; +} AUDIO_OUTPUT, *PAUDIO_OUTPUT; + +/* Multisession CDROMs */ +#define GET_LAST_SESSION 0x01 +#define GET_SESSION_DATA 0x02; + +/* Atapi 2.5 changers */ +typedef struct _MECHANICAL_STATUS_INFORMATION_HEADER { + UCHAR CurrentSlot : 5; + UCHAR ChangerState : 2; + UCHAR Fault : 1; + UCHAR Reserved : 5; + UCHAR MechanismState : 3; + UCHAR CurrentLogicalBlockAddress[3]; + UCHAR NumberAvailableSlots; + UCHAR SlotTableLength[2]; +} MECHANICAL_STATUS_INFORMATION_HEADER, *PMECHANICAL_STATUS_INFORMATION_HEADER; + +typedef struct _SLOT_TABLE_INFORMATION { + UCHAR DiscChanged : 1; + UCHAR Reserved : 6; + UCHAR DiscPresent : 1; + UCHAR Reserved2[3]; +} SLOT_TABLE_INFORMATION, *PSLOT_TABLE_INFORMATION; + +typedef struct _MECHANICAL_STATUS { + MECHANICAL_STATUS_INFORMATION_HEADER MechanicalStatusHeader; + SLOT_TABLE_INFORMATION SlotTableInfo[1]; +} MECHANICAL_STATUS, *PMECHANICAL_STATUS; + + +/* Tape definitions */ +typedef struct _TAPE_POSITION_DATA { + UCHAR Reserved1 : 2; + UCHAR BlockPositionUnsupported : 1; + UCHAR Reserved2 : 3; + UCHAR EndOfPartition : 1; + UCHAR BeginningOfPartition : 1; + UCHAR PartitionNumber; + USHORT Reserved3; + UCHAR FirstBlock[4]; + UCHAR LastBlock[4]; + UCHAR Reserved4; + UCHAR NumberOfBlocks[3]; + UCHAR NumberOfBytes[4]; +} TAPE_POSITION_DATA, *PTAPE_POSITION_DATA; + +/* This structure is used to convert little endian ULONGs + to SCSI CDB big endians values. */ +typedef union _EIGHT_BYTE { + _ANONYMOUS_STRUCT struct { + UCHAR Byte0; + UCHAR Byte1; + UCHAR Byte2; + UCHAR Byte3; + UCHAR Byte4; + UCHAR Byte5; + UCHAR Byte6; + UCHAR Byte7; + } DUMMYSTRUCTNAME; + ULONGLONG AsULongLong; +} EIGHT_BYTE, *PEIGHT_BYTE; + +typedef union _FOUR_BYTE { + _ANONYMOUS_STRUCT struct { + UCHAR Byte0; + UCHAR Byte1; + UCHAR Byte2; + UCHAR Byte3; + } DUMMYSTRUCTNAME; + ULONG AsULong; +} FOUR_BYTE, *PFOUR_BYTE; + +typedef union _TWO_BYTE { + _ANONYMOUS_STRUCT struct { + UCHAR Byte0; + UCHAR Byte1; + } DUMMYSTRUCTNAME; + USHORT AsUShort; +} TWO_BYTE, *PTWO_BYTE; + +/* Byte reversing macro for converting between + big- and little-endian formats */ +#define REVERSE_BYTES_QUAD(Destination, Source) { \ + PEIGHT_BYTE _val1 = (PEIGHT_BYTE)(Destination); \ + PEIGHT_BYTE _val2 = (PEIGHT_BYTE)(Source); \ + _val1->Byte7 = _val2->Byte0; \ + _val1->Byte6 = _val2->Byte1; \ + _val1->Byte5 = _val2->Byte2; \ + _val1->Byte4 = _val2->Byte3; \ + _val1->Byte3 = _val2->Byte4; \ + _val1->Byte2 = _val2->Byte5; \ + _val1->Byte1 = _val2->Byte6; \ + _val1->Byte0 = _val2->Byte7; \ +} + +#define REVERSE_BYTES(Destination, Source) { \ + PFOUR_BYTE _val1 = (PFOUR_BYTE)(Destination); \ + PFOUR_BYTE _val2 = (PFOUR_BYTE)(Source); \ + _val1->Byte3 = _val2->Byte0; \ + _val1->Byte2 = _val2->Byte1; \ + _val1->Byte1 = _val2->Byte2; \ + _val1->Byte0 = _val2->Byte3; \ +} + +#define REVERSE_BYTES_SHORT(Destination, Source) { \ + PTWO_BYTE _val1 = (PTWO_BYTE)(Destination); \ + PTWO_BYTE _val2 = (PTWO_BYTE)(Source); \ + _val1->Byte1 = _val2->Byte0; \ + _val1->Byte0 = _val2->Byte1; \ +} + +#define REVERSE_SHORT(Short) { \ + UCHAR _val; \ + PTWO_BYTE _val2 = (PTWO_BYTE)(Short); \ + _val = _val2->Byte0; \ + _val2->Byte0 = _val2->Byte1; \ + _val2->Byte1 = _val; \ +} + +#define REVERSE_LONG(Long) { \ + UCHAR _val; \ + PFOUR_BYTE _val2 = (PFOUR_BYTE)(Long); \ + _val = _val2->Byte3; \ + _val2->Byte3 = _val2->Byte0; \ + _val2->Byte0 = _val; \ + _val = _val2->Byte2; \ + _val2->Byte2 = _val2->Byte1; \ + _val2->Byte1 = _val; \ +} + +#define WHICH_BIT(Data, Bit) { \ + UCHAR _val; \ + for (_val = 0; _val < 32; _val++) { \ + if (((Data) >> _val) == 1) { \ + break; \ + } \ + } \ + ASSERT(_val != 32); \ + (Bit) = _val; \ +} + +#ifdef __cplusplus +} +#endif + +#endif /* _NTSCSI_ */ diff --git a/reactos/include/ddk/scsiscan.h b/reactos/include/ddk/scsiscan.h new file mode 100644 index 00000000000..5e4277dca51 --- /dev/null +++ b/reactos/include/ddk/scsiscan.h @@ -0,0 +1,128 @@ +/* + * scsiscan.h + * + * SCSI scanner driver interface + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __SCSISCAN_H +#define __SCSISCAN_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define IOCTL_SCSISCAN_CMD \ + CTL_CODE(FILE_DEVICE_SCANNER, SCSISCAN_CMD_CODE, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) + +#define IOCTL_SCSISCAN_LOCKDEVICE \ + CTL_CODE(FILE_DEVICE_SCANNER, SCSISCAN_LOCKDEVICE, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) + +#define IOCTL_SCSISCAN_SET_TIMEOUT \ + CTL_CODE(FILE_DEVICE_SCANNER, SCSISCAN_SET_TIMEOUT, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_SCSISCAN_GET_INFO \ + CTL_CODE(FILE_DEVICE_SCANNER, SCSISCAN_GET_INFO, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) + +#define IOCTL_SCSISCAN_UNLOCKDEVICE \ + CTL_CODE(FILE_DEVICE_SCANNER, SCSISCAN_UNLOCKDEVICE, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) + + +/* SCSISCAN_CMD.SrbFlags constants */ +#define SRB_FLAGS_DISABLE_SYNCH_TRANSFER 0x00000008 +#define SRB_FLAGS_DISABLE_AUTOSENSE 0x00000020 +#define SRB_FLAGS_DATA_IN 0x00000040 +#define SRB_FLAGS_DATA_OUT 0x00000080 +#define SRB_FLAGS_NO_DATA_TRANSFER 0x00000000 + +/* SCSISCAN_CMD.pSrbStatus constants */ +#define SRB_STATUS_PENDING 0x00 +#define SRB_STATUS_SUCCESS 0x01 +#define SRB_STATUS_ABORTED 0x02 +#define SRB_STATUS_ABORT_FAILED 0x03 +#define SRB_STATUS_ERROR 0x04 +#define SRB_STATUS_BUSY 0x05 +#define SRB_STATUS_INVALID_REQUEST 0x06 +#define SRB_STATUS_INVALID_PATH_ID 0x07 +#define SRB_STATUS_NO_DEVICE 0x08 +#define SRB_STATUS_TIMEOUT 0x09 +#define SRB_STATUS_SELECTION_TIMEOUT 0x0A +#define SRB_STATUS_COMMAND_TIMEOUT 0x0B +#define SRB_STATUS_MESSAGE_REJECTED 0x0D +#define SRB_STATUS_BUS_RESET 0x0E +#define SRB_STATUS_PARITY_ERROR 0x0F +#define SRB_STATUS_REQUEST_SENSE_FAILED 0x10 +#define SRB_STATUS_NO_HBA 0x11 +#define SRB_STATUS_DATA_OVERRUN 0x12 +#define SRB_STATUS_UNEXPECTED_BUS_FREE 0x13 +#define SRB_STATUS_PHASE_SEQUENCE_FAILURE 0x14 +#define SRB_STATUS_BAD_SRB_BLOCK_LENGTH 0x15 +#define SRB_STATUS_REQUEST_FLUSHED 0x16 +#define SRB_STATUS_INVALID_LUN 0x20 +#define SRB_STATUS_INVALID_TARGET_ID 0x21 +#define SRB_STATUS_BAD_FUNCTION 0x22 +#define SRB_STATUS_ERROR_RECOVERY 0x23 +#define SRB_STATUS_QUEUE_FROZEN 0x40 +#define SRB_STATUS_AUTOSENSE_VALID 0x80 + +#define SRB_STATUS(Status) (Status & ~(SRB_STATUS_AUTOSENSE_VALID | SRB_STATUS_QUEUE_FROZEN)) + +typedef struct _SCSISCAN_CMD { + ULONG Reserved1; + ULONG Size; + ULONG SrbFlags; + UCHAR CdbLength; + UCHAR SenseLength; + UCHAR Reserved2; + UCHAR Reserved3; + ULONG TransferLength; + UCHAR Cdb[16]; + PUCHAR pSrbStatus; + PUCHAR pSenseBuffer; +} SCSISCAN_CMD, *PSCSISCAN_CMD; + +#define MAX_STRING 128 + +/* SCSISCAN_INFO.Flags constants */ +#define SCSISCAN_RESERVED 0x000 +#define SCSISCAN_CMD_CODE 0x004 +#define SCSISCAN_LOCKDEVICE 0x005 +#define SCSISCAN_UNLOCKDEVICE 0x006 +#define SCSISCAN_SET_TIMEOUT 0x007 +#define SCSISCAN_GET_INFO 0x008 + +typedef struct _SCSISCAN_INFO { + ULONG Size; + ULONG Flags; + UCHAR PortNumber; + UCHAR PathId; + UCHAR TargetId; + UCHAR Lun; + UCHAR AdapterName[MAX_STRING]; + ULONG Reserved; +} SCSISCAN_INFO, *PSCSISCAN_INFO; + +#ifdef __cplusplus +} +#endif + +#endif /* __SCSISCAN_H */ diff --git a/reactos/include/ddk/scsiwmi.h b/reactos/include/ddk/scsiwmi.h new file mode 100644 index 00000000000..cdcd9cd64b3 --- /dev/null +++ b/reactos/include/ddk/scsiwmi.h @@ -0,0 +1,208 @@ +/* + * scsiwmi.h + * + * SCSI WMILIB interface. + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __SCSIWMI_H +#define __SCSIWMI_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include "srb.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#pragma pack(push,4) + +typedef struct _SCSIWMI_REQUEST_CONTEXT { + PVOID UserContext; + ULONG BufferSize; + PUCHAR Buffer; + UCHAR MinorFunction; + UCHAR ReturnStatus; + ULONG ReturnSize; +} SCSIWMI_REQUEST_CONTEXT, *PSCSIWMI_REQUEST_CONTEXT; + +#ifdef _GUID_DEFINED +# warning _GUID_DEFINED is deprecated, use GUID_DEFINED instead +#endif + +#if ! (defined _GUID_DEFINED || defined GUID_DEFINED) +#define GUID_DEFINED +typedef struct _GUID { + unsigned long Data1; + unsigned short Data2; + unsigned short Data3; + unsigned char Data4[ 8 ]; +} GUID; +#endif + +typedef struct _SCSIWMIGUIDREGINFO { + LPCGUID Guid; + ULONG InstanceCount; + ULONG Flags; +} SCSIWMIGUIDREGINFO, *PSCSIWMIGUIDREGINFO; + +typedef UCHAR DDKAPI +(*PSCSIWMI_QUERY_REGINFO)( + IN PVOID DeviceContext, + IN PSCSIWMI_REQUEST_CONTEXT RequestContext, + OUT PWCHAR *MofResourceName); + +typedef BOOLEAN DDKAPI +(*PSCSIWMI_QUERY_DATABLOCK)( + IN PVOID Context, + IN PSCSIWMI_REQUEST_CONTEXT DispatchContext, + IN ULONG GuidIndex, + IN ULONG InstanceIndex, + IN ULONG InstanceCount, + IN OUT PULONG InstanceLengthArray, + IN ULONG BufferAvail, + OUT PUCHAR Buffer); + +typedef BOOLEAN DDKAPI +(*PSCSIWMI_SET_DATABLOCK)( + IN PVOID DeviceContext, + IN PSCSIWMI_REQUEST_CONTEXT RequestContext, + IN ULONG GuidIndex, + IN ULONG InstanceIndex, + IN ULONG BufferSize, + IN PUCHAR Buffer); + +typedef BOOLEAN DDKAPI +(*PSCSIWMI_SET_DATAITEM)( + IN PVOID DeviceContext, + IN PSCSIWMI_REQUEST_CONTEXT RequestContext, + IN ULONG GuidIndex, + IN ULONG InstanceIndex, + IN ULONG DataItemId, + IN ULONG BufferSize, + IN PUCHAR Buffer); + +typedef BOOLEAN DDKAPI +(*PSCSIWMI_EXECUTE_METHOD)( + IN PVOID DeviceContext, + IN PSCSIWMI_REQUEST_CONTEXT RequestContext, + IN ULONG GuidIndex, + IN ULONG InstanceIndex, + IN ULONG MethodId, + IN ULONG InBufferSize, + IN ULONG OutBufferSize, + IN OUT PUCHAR Buffer); + +typedef enum _SCSIWMI_ENABLE_DISABLE_CONTROL { + ScsiWmiEventControl, + ScsiWmiDataBlockControl +} SCSIWMI_ENABLE_DISABLE_CONTROL; + +typedef BOOLEAN DDKAPI +(*PSCSIWMI_FUNCTION_CONTROL)( + IN PVOID DeviceContext, + IN PSCSIWMI_REQUEST_CONTEXT RequestContext, + IN ULONG GuidIndex, + IN SCSIWMI_ENABLE_DISABLE_CONTROL Function, + IN BOOLEAN Enable); + +typedef struct _SCSIWMILIB_CONTEXT { + ULONG GuidCount; + PSCSIWMIGUIDREGINFO GuidList; + PSCSIWMI_QUERY_REGINFO QueryWmiRegInfo; + PSCSIWMI_QUERY_DATABLOCK QueryWmiDataBlock; + PSCSIWMI_SET_DATABLOCK SetWmiDataBlock; + PSCSIWMI_SET_DATAITEM SetWmiDataItem; + PSCSIWMI_EXECUTE_METHOD ExecuteWmiMethod; + PSCSIWMI_FUNCTION_CONTROL WmiFunctionControl; +} SCSI_WMILIB_CONTEXT, *PSCSI_WMILIB_CONTEXT; + +SCSIPORTAPI +BOOLEAN +DDKAPI +ScsiPortWmiDispatchFunction( + IN PSCSI_WMILIB_CONTEXT WmiLibInfo, + IN UCHAR MinorFunction, + IN PVOID DeviceContext, + IN PSCSIWMI_REQUEST_CONTEXT RequestContext, + IN PVOID DataPath, + IN ULONG BufferSize, + IN PVOID Buffer); + +#define ScsiPortWmiFireAdapterEvent( \ + HwDeviceExtension, \ + Guid, \ + InstanceIndex, \ + EventDataSize, \ + EventData) \ + ScsiPortWmiFireLogicalUnitEvent( \ + HwDeviceExtension, \ + 0xff, \ + 0, \ + 0, \ + Guid, \ + InstanceIndex, \ + EventDataSize, \ + EventData) + +/* + * ULONG + * ScsiPortWmiGetReturnSize( + * PSCSIWMI_REQUEST_CONTEXT RequestContext); + */ +#define ScsiPortWmiGetReturnSize(RequestContext) \ + ((RequestContext)->ReturnSize) + +/* UCHAR + * ScsiPortWmiGetReturnStatus( + * PSCSIWMI_REQUEST_CONTEXT RequestContext); + */ +#define ScsiPortWmiGetReturnStatus(RequestContext) \ + ((RequestContext)->ReturnStatus) + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortWmiPostProcess( + IN PSCSIWMI_REQUEST_CONTEXT RequestContext, + IN UCHAR SrbStatus, + IN ULONG BufferUsed); + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortWmiFireLogicalUnitEvent( + IN PVOID HwDeviceExtension, + IN UCHAR PathId, + IN UCHAR TargetId, + IN UCHAR Lun, + IN LPGUID Guid, + IN ULONG InstanceIndex, + IN ULONG EventDataSize, + IN PVOID EventData); + +#pragma pack(pop) + +#ifdef __cplusplus +} +#endif + +#endif /* __SCSIWMI_H */ diff --git a/reactos/include/ddk/smbus.h b/reactos/include/ddk/smbus.h new file mode 100644 index 00000000000..6531c15dc4a --- /dev/null +++ b/reactos/include/ddk/smbus.h @@ -0,0 +1,190 @@ +/* + * smbus.h + * + * System Management Bus driver interface + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __SMBUS_H +#define __SMBUS_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(SMBCLASS) + #define SMBCLASSAPI DECLSPEC_IMPORT +#else + #define SMBCLASSAPI DECLSPEC_EXPORT +#endif + +#define SMB_BUS_REQUEST \ + CTL_CODE(FILE_DEVICE_UNKNOWN, 0, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define SMB_DEREGISTER_ALARM_NOTIFY \ + CTL_CODE(FILE_DEVICE_UNKNOWN, 2, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define SMB_REGISTER_ALARM_NOTIFY \ + CTL_CODE(FILE_DEVICE_UNKNOWN, 1, METHOD_NEITHER, FILE_ANY_ACCESS) + + +struct _SMB_CLASS; + +#define SMB_MAX_DATA_SIZE 32 + +/* SMB_REQUEST.Status constants */ +#define SMB_STATUS_OK 0x00 +#define SMB_UNKNOWN_FAILURE 0x07 +#define SMB_ADDRESS_NOT_ACKNOWLEDGED 0x10 +#define SMB_DEVICE_ERROR 0x11 +#define SMB_COMMAND_ACCESS_DENIED 0x12 +#define SMB_UNKNOWN_ERROR 0x13 +#define SMB_DEVICE_ACCESS_DENIED 0x17 +#define SMB_TIMEOUT 0x18 +#define SMB_UNSUPPORTED_PROTOCOL 0x19 +#define SMB_BUS_BUSY 0x1A + +/* SMB_REQUEST.Protocol constants */ +#define SMB_WRITE_QUICK 0x00 +#define SMB_READ_QUICK 0x01 +#define SMB_SEND_BYTE 0x02 +#define SMB_RECEIVE_BYTE 0x03 +#define SMB_WRITE_BYTE 0x04 +#define SMB_READ_BYTE 0x05 +#define SMB_WRITE_WORD 0x06 +#define SMB_READ_WORD 0x07 +#define SMB_WRITE_BLOCK 0x08 +#define SMB_READ_BLOCK 0x09 +#define SMB_PROCESS_CALL 0x0A +#define SMB_MAXIMUM_PROTOCOL 0x0A + +typedef struct _SMB_REQUEST { + UCHAR Status; + UCHAR Protocol; + UCHAR Address; + UCHAR Command; + UCHAR BlockLength; + UCHAR Data[SMB_MAX_DATA_SIZE]; +} SMB_REQUEST, *PSMB_REQUEST; + +typedef VOID STDCALL +(*SMB_ALARM_NOTIFY)( + PVOID Context, + UCHAR Address, + USHORT Data); + +typedef struct _SMB_REGISTER_ALARM { + UCHAR MinAddress; + UCHAR MaxAddress; + SMB_ALARM_NOTIFY NotifyFunction; + PVOID NotifyContext; +} SMB_REGISTER_ALARM, *PSMB_REGISTER_ALARM; + +/* SMB_CLASS.XxxVersion constants */ +#define SMB_CLASS_MAJOR_VERSION 0x0001 +#define SMB_CLASS_MINOR_VERSION 0x0000 + +typedef NTSTATUS DDKAPI +(*SMB_RESET_DEVICE)( + IN struct _SMB_CLASS *SmbClass, + IN PVOID SmbMiniport); + +typedef VOID DDKAPI +(*SMB_START_IO)( + IN struct _SMB_CLASS *SmbClass, + IN PVOID SmbMiniport); + +typedef NTSTATUS DDKAPI +(*SMB_STOP_DEVICE)( + IN struct _SMB_CLASS *SmbClass, + IN PVOID SmbMiniport); + +typedef struct _SMB_CLASS { + USHORT MajorVersion; + USHORT MinorVersion; + PVOID Miniport; + PDEVICE_OBJECT DeviceObject; + PDEVICE_OBJECT PDO; + PDEVICE_OBJECT LowerDeviceObject; + PIRP CurrentIrp; + PSMB_REQUEST CurrentSmb; + SMB_RESET_DEVICE ResetDevice; + SMB_START_IO StartIo; + SMB_STOP_DEVICE StopDevice; +} SMB_CLASS, *PSMB_CLASS; + +SMBCLASSAPI +VOID +DDKAPI +SmbClassAlarm( + IN PSMB_CLASS SmbClass, + IN UCHAR Address, + IN USHORT Data); + +SMBCLASSAPI +VOID +DDKAPI +SmbClassCompleteRequest( + IN PSMB_CLASS SmbClass); + +typedef NTSTATUS DDKAPI +(*PSMB_INITIALIZE_MINIPORT)( + IN PSMB_CLASS SmbClass, + IN PVOID MiniportExtension, + IN PVOID MiniportContext); + +SMBCLASSAPI +NTSTATUS +DDKAPI +SmbClassCreateFdo( + IN PDRIVER_OBJECT DriverObject, + IN PDEVICE_OBJECT PDO, + IN ULONG MiniportExtensionSize, + IN PSMB_INITIALIZE_MINIPORT MiniportInitialize, + IN PVOID MiniportContext, + OUT PDEVICE_OBJECT *FDO); + +SMBCLASSAPI +NTSTATUS +DDKAPI +SmbClassInitializeDevice( + IN ULONG MajorVersion, + IN ULONG MinorVersion, + IN PDRIVER_OBJECT DriverObject); + +SMBCLASSAPI +VOID +DDKAPI +SmbClassLockDevice( + IN PSMB_CLASS SmbClass); + +SMBCLASSAPI +VOID +DDKAPI +SmbClassUnlockDevice( + IN PSMB_CLASS SmbClass); + +#ifdef __cplusplus +} +#endif + +#endif /* __SMBUS_H */ diff --git a/reactos/include/ddk/srb.h b/reactos/include/ddk/srb.h new file mode 100644 index 00000000000..bc889baf2a7 --- /dev/null +++ b/reactos/include/ddk/srb.h @@ -0,0 +1,751 @@ +/* + * scsi.h + * + * Interface between SCSI miniport drivers and the SCSI port driver. + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __SRB_H +#define __SRB_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(_SCSIPORT_) + #define SCSIPORTAPI DECLSPEC_EXPORT +#else + #define SCSIPORTAPI DECLSPEC_IMPORT +#endif + +#ifdef DBG +#define DebugPrint(x) ScsiDebugPrint x +#else +#define DebugPrint(x) +#endif + +typedef PHYSICAL_ADDRESS SCSI_PHYSICAL_ADDRESS, *PSCSI_PHYSICAL_ADDRESS; + +#define SP_UNINITIALIZED_VALUE ((ULONG) ~0) +#define SP_UNTAGGED ((UCHAR) ~0) + +#define SRB_SIMPLE_TAG_REQUEST 0x20 +#define SRB_HEAD_OF_QUEUE_TAG_REQUEST 0x21 +#define SRB_ORDERED_QUEUE_TAG_REQUEST 0x22 + +#define SRB_STATUS_QUEUE_FROZEN 0x40 +#define SRB_STATUS_AUTOSENSE_VALID 0x80 + +#define SRB_STATUS(Status) \ + (Status & ~(SRB_STATUS_AUTOSENSE_VALID | SRB_STATUS_QUEUE_FROZEN)) + +#define MAXIMUM_CDB_SIZE 12 + +#ifdef DBG +#define SCSI_PORT_SIGNATURE 0x54524f50 +#endif + + +#define SCSI_MAXIMUM_LOGICAL_UNITS 8 +#define SCSI_MAXIMUM_TARGETS_PER_BUS 128 +#define SCSI_MAXIMUM_LUNS_PER_TARGET 255 +#define SCSI_MAXIMUM_BUSES 8 +#define SCSI_MINIMUM_PHYSICAL_BREAKS 16 +#define SCSI_MAXIMUM_PHYSICAL_BREAKS 255 +#define SCSI_MAXIMUM_TARGETS 8 + +#define SRB_FUNCTION_WMI 0x17 + +#define SRB_WMI_FLAGS_ADAPTER_REQUEST 0x0001 + +#define SP_BUS_PARITY_ERROR 0x0001 +#define SP_UNEXPECTED_DISCONNECT 0x0002 +#define SP_INVALID_RESELECTION 0x0003 +#define SP_BUS_TIME_OUT 0x0004 +#define SP_PROTOCOL_ERROR 0x0005 +#define SP_INTERNAL_ADAPTER_ERROR 0x0006 +#define SP_REQUEST_TIMEOUT 0x0007 +#define SP_IRQ_NOT_RESPONDING 0x0008 +#define SP_BAD_FW_WARNING 0x0009 +#define SP_BAD_FW_ERROR 0x000a +#define SP_LOST_WMI_MINIPORT_REQUEST 0x000b + +/* SCSI_REQUEST_BLOCK.Function constants */ +#define SRB_FUNCTION_EXECUTE_SCSI 0x00 +#define SRB_FUNCTION_CLAIM_DEVICE 0x01 +#define SRB_FUNCTION_IO_CONTROL 0x02 +#define SRB_FUNCTION_RECEIVE_EVENT 0x03 +#define SRB_FUNCTION_RELEASE_QUEUE 0x04 +#define SRB_FUNCTION_ATTACH_DEVICE 0x05 +#define SRB_FUNCTION_RELEASE_DEVICE 0x06 +#define SRB_FUNCTION_SHUTDOWN 0x07 +#define SRB_FUNCTION_FLUSH 0x08 +#define SRB_FUNCTION_ABORT_COMMAND 0x10 +#define SRB_FUNCTION_RELEASE_RECOVERY 0x11 +#define SRB_FUNCTION_RESET_BUS 0x12 +#define SRB_FUNCTION_RESET_DEVICE 0x13 +#define SRB_FUNCTION_TERMINATE_IO 0x14 +#define SRB_FUNCTION_FLUSH_QUEUE 0x15 +#define SRB_FUNCTION_REMOVE_DEVICE 0x16 +#define SRB_FUNCTION_WMI 0x17 +#define SRB_FUNCTION_LOCK_QUEUE 0x18 +#define SRB_FUNCTION_UNLOCK_QUEUE 0x19 +#define SRB_FUNCTION_RESET_LOGICAL_UNIT 0x20 + +/* SCSI_REQUEST_BLOCK.SrbStatus constants */ +#define SRB_STATUS_PENDING 0x00 +#define SRB_STATUS_SUCCESS 0x01 +#define SRB_STATUS_ABORTED 0x02 +#define SRB_STATUS_ABORT_FAILED 0x03 +#define SRB_STATUS_ERROR 0x04 +#define SRB_STATUS_BUSY 0x05 +#define SRB_STATUS_INVALID_REQUEST 0x06 +#define SRB_STATUS_INVALID_PATH_ID 0x07 +#define SRB_STATUS_NO_DEVICE 0x08 +#define SRB_STATUS_TIMEOUT 0x09 +#define SRB_STATUS_SELECTION_TIMEOUT 0x0A +#define SRB_STATUS_COMMAND_TIMEOUT 0x0B +#define SRB_STATUS_MESSAGE_REJECTED 0x0D +#define SRB_STATUS_BUS_RESET 0x0E +#define SRB_STATUS_PARITY_ERROR 0x0F +#define SRB_STATUS_REQUEST_SENSE_FAILED 0x10 +#define SRB_STATUS_NO_HBA 0x11 +#define SRB_STATUS_DATA_OVERRUN 0x12 +#define SRB_STATUS_UNEXPECTED_BUS_FREE 0x13 +#define SRB_STATUS_PHASE_SEQUENCE_FAILURE 0x14 +#define SRB_STATUS_BAD_SRB_BLOCK_LENGTH 0x15 +#define SRB_STATUS_REQUEST_FLUSHED 0x16 +#define SRB_STATUS_INVALID_LUN 0x20 +#define SRB_STATUS_INVALID_TARGET_ID 0x21 +#define SRB_STATUS_BAD_FUNCTION 0x22 +#define SRB_STATUS_ERROR_RECOVERY 0x23 +#define SRB_STATUS_NOT_POWERED 0x24 +#define SRB_STATUS_INTERNAL_ERROR 0x30 + +/* SCSI_REQUEST_BLOCK.SrbFlags constants */ +#define SRB_FLAGS_QUEUE_ACTION_ENABLE 0x00000002 +#define SRB_FLAGS_DISABLE_DISCONNECT 0x00000004 +#define SRB_FLAGS_DISABLE_SYNCH_TRANSFER 0x00000008 +#define SRB_FLAGS_BYPASS_FROZEN_QUEUE 0x00000010 +#define SRB_FLAGS_DISABLE_AUTOSENSE 0x00000020 +#define SRB_FLAGS_DATA_IN 0x00000040 +#define SRB_FLAGS_DATA_OUT 0x00000080 +#define SRB_FLAGS_NO_DATA_TRANSFER 0x00000000 +#define SRB_FLAGS_UNSPECIFIED_DIRECTION (SRB_FLAGS_DATA_IN | SRB_FLAGS_DATA_OUT) +#define SRB_FLAGS_NO_QUEUE_FREEZE 0x00000100 +#define SRB_FLAGS_ADAPTER_CACHE_ENABLE 0x00000200 +#define SRB_FLAGS_FREE_SENSE_BUFFER 0x00000400 +#define SRB_FLAGS_IS_ACTIVE 0x00010000 +#define SRB_FLAGS_ALLOCATED_FROM_ZONE 0x00020000 +#define SRB_FLAGS_SGLIST_FROM_POOL 0x00040000 +#define SRB_FLAGS_BYPASS_LOCKED_QUEUE 0x00080000 +#define SRB_FLAGS_NO_KEEP_AWAKE 0x00100000 +#define SRB_FLAGS_PORT_DRIVER_ALLOCSENSE 0x00200000 +#define SRB_FLAGS_PORT_DRIVER_SENSEHASPORT 0x00400000 +#define SRB_FLAGS_DONT_START_NEXT_PACKET 0x00800000 +#define SRB_FLAGS_PORT_DRIVER_RESERVED 0x0F000000 +#define SRB_FLAGS_CLASS_DRIVER_RESERVED 0xF0000000 + +typedef struct _SCSI_REQUEST_BLOCK { + USHORT Length; + UCHAR Function; + UCHAR SrbStatus; + UCHAR ScsiStatus; + UCHAR PathId; + UCHAR TargetId; + UCHAR Lun; + UCHAR QueueTag; + UCHAR QueueAction; + UCHAR CdbLength; + UCHAR SenseInfoBufferLength; + ULONG SrbFlags; + ULONG DataTransferLength; + ULONG TimeOutValue; + PVOID DataBuffer; + PVOID SenseInfoBuffer; + struct _SCSI_REQUEST_BLOCK *NextSrb; + PVOID OriginalRequest; + PVOID SrbExtension; + _ANONYMOUS_UNION union { + ULONG InternalStatus; + ULONG QueueSortKey; + } DUMMYUNIONNAME; +#if defined(_WIN64) + ULONG Reserved; +#endif + UCHAR Cdb[16]; +} SCSI_REQUEST_BLOCK, *PSCSI_REQUEST_BLOCK; + +#define SCSI_REQUEST_BLOCK_SIZE sizeof(SCSI_REQUEST_BLOCK) + +typedef struct _ACCESS_RANGE { + SCSI_PHYSICAL_ADDRESS RangeStart; + ULONG RangeLength; + BOOLEAN RangeInMemory; +} ACCESS_RANGE, *PACCESS_RANGE; + +/* PORT_CONFIGURATION_INFORMATION.Dma64BitAddresses constants */ +#define SCSI_DMA64_MINIPORT_SUPPORTED 0x01 +#define SCSI_DMA64_SYSTEM_SUPPORTED 0x80 + +typedef struct _PORT_CONFIGURATION_INFORMATION { + ULONG Length; + ULONG SystemIoBusNumber; + INTERFACE_TYPE AdapterInterfaceType; + ULONG BusInterruptLevel; + ULONG BusInterruptVector; + KINTERRUPT_MODE InterruptMode; + ULONG MaximumTransferLength; + ULONG NumberOfPhysicalBreaks; + ULONG DmaChannel; + ULONG DmaPort; + DMA_WIDTH DmaWidth; + DMA_SPEED DmaSpeed; + ULONG AlignmentMask; + ULONG NumberOfAccessRanges; + ACCESS_RANGE (*AccessRanges)[]; + PVOID Reserved; + UCHAR NumberOfBuses; + UCHAR InitiatorBusId[8]; + BOOLEAN ScatterGather; + BOOLEAN Master; + BOOLEAN CachesData; + BOOLEAN AdapterScansDown; + BOOLEAN AtdiskPrimaryClaimed; + BOOLEAN AtdiskSecondaryClaimed; + BOOLEAN Dma32BitAddresses; + BOOLEAN DemandMode; + BOOLEAN MapBuffers; + BOOLEAN NeedPhysicalAddresses; + BOOLEAN TaggedQueuing; + BOOLEAN AutoRequestSense; + BOOLEAN MultipleRequestPerLu; + BOOLEAN ReceiveEvent; + BOOLEAN RealModeInitialized; + BOOLEAN BufferAccessScsiPortControlled; + UCHAR MaximumNumberOfTargets; + UCHAR ReservedUchars[2]; + ULONG SlotNumber; + ULONG BusInterruptLevel2; + ULONG BusInterruptVector2; + KINTERRUPT_MODE InterruptMode2; + ULONG DmaChannel2; + ULONG DmaPort2; + DMA_WIDTH DmaWidth2; + DMA_SPEED DmaSpeed2; + ULONG DeviceExtensionSize; + ULONG SpecificLuExtensionSize; + ULONG SrbExtensionSize; + UCHAR Dma64BitAddresses; + BOOLEAN ResetTargetSupported; + UCHAR MaximumNumberOfLogicalUnits; + BOOLEAN WmiDataProvider; +} PORT_CONFIGURATION_INFORMATION, *PPORT_CONFIGURATION_INFORMATION; + +#define CONFIG_INFO_VERSION_2 sizeof(PORT_CONFIGURATION_INFORMATION) + +typedef enum _SCSI_NOTIFICATION_TYPE { + RequestComplete, + NextRequest, + NextLuRequest, + ResetDetected, + CallDisableInterrupts, + CallEnableInterrupts, + RequestTimerCall, + BusChangeDetected, + WMIEvent, + WMIReregister +} SCSI_NOTIFICATION_TYPE, *PSCSI_NOTIFICATION_TYPE; + +#ifdef __GNUC__ +__extension__ /* enums limited to range of integer */ +#endif +typedef enum _SCSI_ADAPTER_CONTROL_TYPE { + ScsiQuerySupportedControlTypes = 0, + ScsiStopAdapter, + ScsiRestartAdapter, + ScsiSetBootConfig, + ScsiSetRunningConfig, + ScsiAdapterControlMax, + MakeAdapterControlTypeSizeOfUlong = 0xffffffff +} SCSI_ADAPTER_CONTROL_TYPE, *PSCSI_ADAPTER_CONTROL_TYPE; + +typedef enum _SCSI_ADAPTER_CONTROL_STATUS { + ScsiAdapterControlSuccess = 0, + ScsiAdapterControlUnsuccessful +} SCSI_ADAPTER_CONTROL_STATUS, *PSCSI_ADAPTER_CONTROL_STATUS; + +typedef struct _SCSI_SUPPORTED_CONTROL_TYPE_LIST { + ULONG MaxControlType; + BOOLEAN SupportedTypeList[0]; +} SCSI_SUPPORTED_CONTROL_TYPE_LIST, *PSCSI_SUPPORTED_CONTROL_TYPE_LIST; + +typedef SCSI_ADAPTER_CONTROL_STATUS DDKAPI +(*PHW_ADAPTER_CONTROL)( + IN PVOID DeviceExtension, + IN SCSI_ADAPTER_CONTROL_TYPE ControlType, + IN PVOID Parameters); + +typedef BOOLEAN DDKAPI +(*PHW_ADAPTER_STATE)( + IN PVOID DeviceExtension, + IN PVOID Context, + IN BOOLEAN SaveState); + +#define SP_RETURN_NOT_FOUND 0 +#define SP_RETURN_FOUND 1 +#define SP_RETURN_ERROR 2 +#define SP_RETURN_BAD_CONFIG 3 + +typedef ULONG DDKAPI +(*PHW_FIND_ADAPTER)( + IN PVOID DeviceExtension, + IN PVOID HwContext, + IN PVOID BusInformation, + IN PCHAR ArgumentString, + IN OUT PPORT_CONFIGURATION_INFORMATION ConfigInfo, + OUT PBOOLEAN Again); + +typedef BOOLEAN DDKAPI +(*PHW_INITIALIZE)( + IN PVOID DeviceExtension); + +typedef BOOLEAN DDKAPI +(*PHW_INTERRUPT)( + IN PVOID DeviceExtension); + +typedef BOOLEAN DDKAPI +(*PHW_RESET_BUS)( + IN PVOID DeviceExtension, + IN ULONG PathId); + +typedef VOID DDKAPI +(*PHW_DMA_STARTED)( + IN PVOID DeviceExtension); + +typedef BOOLEAN DDKAPI +(*PHW_STARTIO)( + IN PVOID DeviceExtension, + IN PSCSI_REQUEST_BLOCK Srb); + +typedef VOID DDKAPI +(*PHW_TIMER)( + IN PVOID DeviceExtension); + +typedef struct _HW_INITIALIZATION_DATA { + ULONG HwInitializationDataSize; + INTERFACE_TYPE AdapterInterfaceType; + PHW_INITIALIZE HwInitialize; + PHW_STARTIO HwStartIo; + PHW_INTERRUPT HwInterrupt; + PHW_FIND_ADAPTER HwFindAdapter; + PHW_RESET_BUS HwResetBus; + PHW_DMA_STARTED HwDmaStarted; + PHW_ADAPTER_STATE HwAdapterState; + ULONG DeviceExtensionSize; + ULONG SpecificLuExtensionSize; + ULONG SrbExtensionSize; + ULONG NumberOfAccessRanges; + PVOID Reserved; + BOOLEAN MapBuffers; + BOOLEAN NeedPhysicalAddresses; + BOOLEAN TaggedQueuing; + BOOLEAN AutoRequestSense; + BOOLEAN MultipleRequestPerLu; + BOOLEAN ReceiveEvent; + USHORT VendorIdLength; + PVOID VendorId; + USHORT ReservedUshort; + USHORT DeviceIdLength; + PVOID DeviceId; + PHW_ADAPTER_CONTROL HwAdapterControl; +} HW_INITIALIZATION_DATA, *PHW_INITIALIZATION_DATA; + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortCompleteRequest( + IN PVOID HwDeviceExtension, + IN UCHAR PathId, + IN UCHAR TargetId, + IN UCHAR Lun, + IN UCHAR SrbStatus); + +/* + * ULONG + * ScsiPortConvertPhysicalAddressToUlong( + * IN SCSI_PHYSICAL_ADDRESS Address); + */ +#define ScsiPortConvertPhysicalAddressToUlong(Address) ((Address).LowPart) + +SCSIPORTAPI +SCSI_PHYSICAL_ADDRESS +DDKAPI +ScsiPortConvertUlongToPhysicalAddress( + IN ULONG UlongAddress); + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortFlushDma( + IN PVOID DeviceExtension); + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortFreeDeviceBase( + IN PVOID HwDeviceExtension, + IN PVOID MappedAddress); + +SCSIPORTAPI +ULONG +DDKAPI +ScsiPortGetBusData( + IN PVOID DeviceExtension, + IN ULONG BusDataType, + IN ULONG SystemIoBusNumber, + IN ULONG SlotNumber, + IN PVOID Buffer, + IN ULONG Length); + +SCSIPORTAPI +PVOID +DDKAPI +ScsiPortGetDeviceBase( + IN PVOID HwDeviceExtension, + IN INTERFACE_TYPE BusType, + IN ULONG SystemIoBusNumber, + IN SCSI_PHYSICAL_ADDRESS IoAddress, + IN ULONG NumberOfBytes, + IN BOOLEAN InIoSpace); + +SCSIPORTAPI +PVOID +DDKAPI +ScsiPortGetLogicalUnit( + IN PVOID HwDeviceExtension, + IN UCHAR PathId, + IN UCHAR TargetId, + IN UCHAR Lun); + +SCSIPORTAPI +SCSI_PHYSICAL_ADDRESS +DDKAPI +ScsiPortGetPhysicalAddress( + IN PVOID HwDeviceExtension, + IN PSCSI_REQUEST_BLOCK Srb OPTIONAL, + IN PVOID VirtualAddress, + OUT ULONG *Length); + +SCSIPORTAPI +PSCSI_REQUEST_BLOCK +DDKAPI +ScsiPortGetSrb( + IN PVOID DeviceExtension, + IN UCHAR PathId, + IN UCHAR TargetId, + IN UCHAR Lun, + IN LONG QueueTag); + +SCSIPORTAPI +PVOID +DDKAPI +ScsiPortGetUncachedExtension( + IN PVOID HwDeviceExtension, + IN PPORT_CONFIGURATION_INFORMATION ConfigInfo, + IN ULONG NumberOfBytes); + +SCSIPORTAPI +PVOID +DDKAPI +ScsiPortGetVirtualAddress( + IN PVOID HwDeviceExtension, + IN SCSI_PHYSICAL_ADDRESS PhysicalAddress); + +SCSIPORTAPI +ULONG +DDKAPI +ScsiPortInitialize( + IN PVOID Argument1, + IN PVOID Argument2, + IN struct _HW_INITIALIZATION_DATA *HwInitializationData, + IN PVOID HwContext OPTIONAL); + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortIoMapTransfer( + IN PVOID HwDeviceExtension, + IN PSCSI_REQUEST_BLOCK Srb, + IN ULONG LogicalAddress, + IN ULONG Length); + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortLogError( + IN PVOID HwDeviceExtension, + IN PSCSI_REQUEST_BLOCK Srb OPTIONAL, + IN UCHAR PathId, + IN UCHAR TargetId, + IN UCHAR Lun, + IN ULONG ErrorCode, + IN ULONG UniqueId); + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortMoveMemory( + IN PVOID WriteBuffer, + IN PVOID ReadBuffer, + IN ULONG Length); + +SCSIPORTAPI +VOID +DDKCDECLAPI +ScsiPortNotification( + IN SCSI_NOTIFICATION_TYPE NotificationType, + IN PVOID HwDeviceExtension, + IN ...); + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortQuerySystemTime( + OUT PLARGE_INTEGER CurrentTime); + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortReadPortBufferUchar( + IN PUCHAR Port, + IN PUCHAR Buffer, + IN ULONG Count); + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortReadPortBufferUlong( + IN PULONG Port, + IN PULONG Buffer, + IN ULONG Count); + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortReadPortBufferUshort( + IN PUSHORT Port, + IN PUSHORT Buffer, + IN ULONG Count); + +SCSIPORTAPI +UCHAR +DDKAPI +ScsiPortReadPortUchar( + IN PUCHAR Port); + +SCSIPORTAPI +ULONG +DDKAPI +ScsiPortReadPortUlong( + IN PULONG Port); + +SCSIPORTAPI +USHORT +DDKAPI +ScsiPortReadPortUshort( + IN PUSHORT Port); + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortReadRegisterBufferUchar( + IN PUCHAR Register, + IN PUCHAR Buffer, + IN ULONG Count); + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortReadRegisterBufferUlong( + IN PULONG Register, + IN PULONG Buffer, + IN ULONG Count); + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortReadRegisterBufferUshort( + IN PUSHORT Register, + IN PUSHORT Buffer, + IN ULONG Count); + +SCSIPORTAPI +UCHAR +DDKAPI +ScsiPortReadRegisterUchar( + IN PUCHAR Register); + +SCSIPORTAPI +ULONG +DDKAPI +ScsiPortReadRegisterUlong( + IN PULONG Register); + +SCSIPORTAPI +USHORT +DDKAPI +ScsiPortReadRegisterUshort( + IN PUSHORT Register); + +SCSIPORTAPI +ULONG +DDKAPI +ScsiPortSetBusDataByOffset( + IN PVOID DeviceExtension, + IN ULONG BusDataType, + IN ULONG SystemIoBusNumber, + IN ULONG SlotNumber, + IN PVOID Buffer, + IN ULONG Offset, + IN ULONG Length); + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortStallExecution( + IN ULONG Delay); + +SCSIPORTAPI +BOOLEAN +DDKAPI +ScsiPortValidateRange( + IN PVOID HwDeviceExtension, + IN INTERFACE_TYPE BusType, + IN ULONG SystemIoBusNumber, + IN SCSI_PHYSICAL_ADDRESS IoAddress, + IN ULONG NumberOfBytes, + IN BOOLEAN InIoSpace); + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortWritePortBufferUchar( + IN PUCHAR Port, + IN PUCHAR Buffer, + IN ULONG Count); + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortWritePortBufferUlong( + IN PULONG Port, + IN PULONG Buffer, + IN ULONG Count); + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortWritePortBufferUshort( + IN PUSHORT Port, + IN PUSHORT Buffer, + IN ULONG Count); + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortWritePortUchar( + IN PUCHAR Port, + IN UCHAR Value); + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortWritePortUlong( + IN PULONG Port, + IN ULONG Value); + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortWritePortUshort( + IN PUSHORT Port, + IN USHORT Value); + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortWriteRegisterBufferUchar( + IN PUCHAR Register, + IN PUCHAR Buffer, + IN ULONG Count); + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortWriteRegisterBufferUlong( + IN PULONG Register, + IN PULONG Buffer, + IN ULONG Count); + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortWriteRegisterBufferUshort( + IN PUSHORT Register, + IN PUSHORT Buffer, + IN ULONG Count); + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortWriteRegisterUchar( + IN PUCHAR Register, + IN ULONG Value); + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortWriteRegisterUlong( + IN PULONG Register, + IN ULONG Value); + +SCSIPORTAPI +VOID +DDKAPI +ScsiPortWriteRegisterUshort( + IN PUSHORT Register, + IN USHORT Value); + +SCSIPORTAPI +VOID +DDKCDECLAPI +ScsiDebugPrint( + IN ULONG DebugPrintLevel, + IN PCCHAR DebugMessage, + IN ...); + +#ifdef __cplusplus +} +#endif + +#endif /* __SRB_H */ diff --git a/reactos/include/ddk/storport.h b/reactos/include/ddk/storport.h new file mode 100644 index 00000000000..7ac862433d2 --- /dev/null +++ b/reactos/include/ddk/storport.h @@ -0,0 +1,421 @@ +/* + * storport.h + * + * StorPort interface + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __STORPORT_H +#define __STORPORT_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include "srb.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(_STORPORT_) + #define STORPORTAPI DECLSPEC_EXPORT +#else + #define STORPORTAPI DECLSPEC_IMPORT +#endif + + +typedef PHYSICAL_ADDRESS STOR_PHYSICAL_ADDRESS; + +typedef struct _STOR_SCATTER_GATHER_ELEMENT { + STOR_PHYSICAL_ADDRESS PhysicalAddress; + ULONG Length; + ULONG_PTR Reserved; +} STOR_SCATTER_GATHER_ELEMENT, *PSTOR_SCATTER_GATHER_ELEMENT; + +typedef struct _STOR_SCATTER_GATHER_LIST { + ULONG NumberOfElements; + ULONG_PTR Reserved; + STOR_SCATTER_GATHER_ELEMENT List[0]; +} STOR_SCATTER_GATHER_LIST, *PSTOR_SCATTER_GATHER_LIST; + +typedef struct _SCSI_WMI_REQUEST_BLOCK { + USHORT Length; + UCHAR Function; + UCHAR SrbStatus; + UCHAR WMISubFunction; + UCHAR PathId; + UCHAR TargetId; + UCHAR Lun; + UCHAR Reserved1; + UCHAR WMIFlags; + UCHAR Reserved2[2]; + ULONG SrbFlags; + ULONG DataTransferLength; + ULONG TimeOutValue; + PVOID DataBuffer; + PVOID DataPath; + PVOID Reserved3; + PVOID OriginalRequest; + PVOID SrbExtension; + ULONG Reserved4; + UCHAR Reserved5[16]; +} SCSI_WMI_REQUEST_BLOCK, *PSCSI_WMI_REQUEST_BLOCK; + + +STORPORTAPI +ULONG +DDKAPI +StorPortInitialize( + IN PVOID Argument1, + IN PVOID Argument2, + IN PHW_INITIALIZATION_DATA HwInitializationData, + IN PVOID Unused); + +STORPORTAPI +VOID +DDKAPI +StorPortFreeDeviceBase( + IN PVOID HwDeviceExtension, + IN PVOID MappedAddress); + +STORPORTAPI +ULONG +DDKAPI +StorPortGetBusData( + IN PVOID DeviceExtension, + IN ULONG BusDataType, + IN ULONG SystemIoBusNumber, + IN ULONG SlotNumber, + IN PVOID Buffer, + IN ULONG Length); + +STORPORTAPI +ULONG +DDKAPI +StorPortSetBusDataByOffset( + IN PVOID DeviceExtension, + IN ULONG BusDataType, + IN ULONG SystemIoBusNumber, + IN ULONG SlotNumber, + IN PVOID Buffer, + IN ULONG Offset, + IN ULONG Length); + +STORPORTAPI +PVOID +DDKAPI +StorPortGetDeviceBase( + IN PVOID HwDeviceExtension, + IN INTERFACE_TYPE BusType, + IN ULONG SystemIoBusNumber, + IN SCSI_PHYSICAL_ADDRESS IoAddress, + IN ULONG NumberOfBytes, + IN BOOLEAN InIoSpace); + +STORPORTAPI +PVOID +DDKAPI +StorPortGetLogicalUnit( + IN PVOID HwDeviceExtension, + IN UCHAR PathId, + IN UCHAR TargetId, + IN UCHAR Lun); + +STORPORTAPI +PSCSI_REQUEST_BLOCK +DDKAPI +StorPortGetSrb( + IN PVOID DeviceExtension, + IN UCHAR PathId, + IN UCHAR TargetId, + IN UCHAR Lun, + IN LONG QueueTag); + +STORPORTAPI +STOR_PHYSICAL_ADDRESS +DDKAPI +StorPortGetPhysicalAddress( + IN PVOID HwDeviceExtension, + IN PSCSI_REQUEST_BLOCK Srb, + IN PVOID VirtualAddress, + OUT ULONG *Length); + +STORPORTAPI +PVOID +DDKAPI +StorPortGetVirtualAddress( + IN PVOID HwDeviceExtension, + IN STOR_PHYSICAL_ADDRESS PhysicalAddress); + +STORPORTAPI +PVOID +DDKAPI +StorPortGetUncachedExtension( + IN PVOID HwDeviceExtension, + IN PPORT_CONFIGURATION_INFORMATION ConfigInfo, + IN ULONG NumberOfBytes); + +STORPORTAPI +VOID +DDKCDECLAPI +StorPortNotification( + IN SCSI_NOTIFICATION_TYPE NotificationType, + IN PVOID HwDeviceExtension, + IN ...); + +STORPORTAPI +VOID +DDKAPI +StorPortLogError( + IN PVOID HwDeviceExtension, + IN PSCSI_REQUEST_BLOCK Srb OPTIONAL, + IN UCHAR PathId, + IN UCHAR TargetId, + IN UCHAR Lun, + IN ULONG ErrorCode, + IN ULONG UniqueId); + +STORPORTAPI +VOID +DDKAPI +StorPortCompleteRequest( + IN PVOID HwDeviceExtension, + IN UCHAR PathId, + IN UCHAR TargetId, + IN UCHAR Lun, + IN UCHAR SrbStatus); + +STORPORTAPI +VOID +DDKAPI +StorPortMoveMemory( + IN PVOID WriteBuffer, + IN PVOID ReadBuffer, + IN ULONG Length); + +STORPORTAPI +VOID +DDKAPI +StorPortStallExecution( + IN ULONG Delay); + +STORPORTAPI +STOR_PHYSICAL_ADDRESS +DDKAPI +StorPortConvertUlong64ToPhysicalAddress( + IN ULONG64 UlongAddress); + +STORPORTAPI +ULONG64 +DDKAPI +StorPortConvertPhysicalAddressToUlong64( + IN STOR_PHYSICAL_ADDRESS Address); + +STORPORTAPI +BOOLEAN +DDKAPI +StorPortValidateRange( + IN PVOID HwDeviceExtension, + IN INTERFACE_TYPE BusType, + IN ULONG SystemIoBusNumber, + IN STOR_PHYSICAL_ADDRESS IoAddress, + IN ULONG NumberOfBytes, + IN BOOLEAN InIoSpace); + +STORPORTAPI +VOID +DDKCDECLAPI +StorPortDebugPrint( + IN ULONG DebugPrintLevel, + IN PCCHAR DebugMessage, + IN ...); + +STORPORTAPI +UCHAR +DDKAPI +StorPortReadPortUchar( + IN PUCHAR Port); + +STORPORTAPI +ULONG +DDKAPI +StorPortReadPortUlong( + IN PULONG Port); + +STORPORTAPI +USHORT +DDKAPI +StorPortReadPortUshort( + IN PUSHORT Port); + +STORPORTAPI +UCHAR +DDKAPI +StorPortReadRegisterUchar( + IN PUCHAR Register); + +STORPORTAPI +ULONG +DDKAPI +StorPortReadRegisterUlong( + IN PULONG Register); + +STORPORTAPI +USHORT +DDKAPI +StorPortReadRegisterUshort( + IN PUSHORT Register); + +STORPORTAPI +VOID +DDKAPI +StorPortWritePortUchar( + IN PUCHAR Port, + IN UCHAR Value); + +STORPORTAPI +VOID +DDKAPI +StorPortWritePortUlong( + IN PULONG Port, + IN ULONG Value); + +STORPORTAPI +VOID +DDKAPI +StorPortWritePortUshort( + IN PUSHORT Port, + IN USHORT Value); + +STORPORTAPI +VOID +DDKAPI +StorPortWriteRegisterUchar( + IN PUCHAR Port, + IN UCHAR Value); + +STORPORTAPI +VOID +DDKAPI +StorPortWriteRegisterUlong( + IN PULONG Port, + IN ULONG Value); + +STORPORTAPI +VOID +DDKAPI +StorPortWriteRegisterUshort( + IN PUSHORT Port, + IN USHORT Value); + +STORPORTAPI +BOOLEAN +DDKAPI +StorPortPauseDevice( + IN PVOID HwDeviceExtension, + IN UCHAR PathId, + IN UCHAR TargetId, + IN UCHAR Lun, + IN ULONG TimeOut); + +STORPORTAPI +BOOLEAN +DDKAPI +StorPortResumeDevice( + IN PVOID HwDeviceExtension, + IN UCHAR PathId, + IN UCHAR TargetId, + IN UCHAR Lun); + +STORPORTAPI +BOOLEAN +DDKAPI +StorPortPause( + IN PVOID HwDeviceExtension, + IN ULONG TimeOut); + +STORPORTAPI +BOOLEAN +DDKAPI +StorPortResume( + IN PVOID HwDeviceExtension); + +STORPORTAPI +BOOLEAN +DDKAPI +StorPortDeviceBusy( + IN PVOID HwDeviceExtension, + IN UCHAR PathId, + IN UCHAR TargetId, + IN UCHAR Lun, + IN ULONG RequestsToComplete); + +STORPORTAPI +BOOLEAN +DDKAPI +StorPortDeviceReady( + IN PVOID HwDeviceExtension, + IN UCHAR PathId, + IN UCHAR TargetId, + IN UCHAR Lun); + +STORPORTAPI +BOOLEAN +DDKAPI +StorPortBusy( + IN PVOID HwDeviceExtension, + IN ULONG RequestsToComplete); + +STORPORTAPI +BOOLEAN +DDKAPI +StorPortReady( + IN PVOID HwDeviceExtension); + +STORPORTAPI +PSTOR_SCATTER_GATHER_LIST +DDKAPI +StorPortGetScatterGatherList( + IN PVOID DeviceExtension, + IN PSCSI_REQUEST_BLOCK Srb); + +typedef BOOLEAN DDKAPI +(*PSTOR_SYNCHRONIZED_ACCESS)( + IN PVOID HwDeviceExtension, + IN PVOID Context); + +STORPORTAPI +VOID +DDKAPI +StorPortSynchronizeAccess( + IN PVOID HwDeviceExtension, + IN PSTOR_SYNCHRONIZED_ACCESS SynchronizedAccessRoutine, + IN PVOID Context); + +#ifdef DBG +#define DebugPrint(x) StorPortDebugPrint x +#else +#define DebugPrint(x) +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __STORPORT_H */ diff --git a/reactos/include/ddk/tdi.h b/reactos/include/ddk/tdi.h new file mode 100644 index 00000000000..bd7ba648a07 --- /dev/null +++ b/reactos/include/ddk/tdi.h @@ -0,0 +1,592 @@ +/* + * tdi.h + * + * TDI user mode definitions + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __TDI_H +#define __TDI_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include "ntddtdi.h" +#include "tdistat.h" +#include "netpnp.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Basic types */ + +typedef LONG TDI_STATUS; +typedef PVOID CONNECTION_CONTEXT; + +typedef struct _TDI_CONNECTION_INFORMATION { + LONG UserDataLength; + PVOID UserData; + LONG OptionsLength; + PVOID Options; + LONG RemoteAddressLength; + PVOID RemoteAddress; +} TDI_CONNECTION_INFORMATION, *PTDI_CONNECTION_INFORMATION; + +typedef struct _TDI_REQUEST { + union { + HANDLE AddressHandle; + CONNECTION_CONTEXT ConnectionContext; + HANDLE ControlChannel; + } Handle; + PVOID RequestNotifyObject; + PVOID RequestContext; + TDI_STATUS TdiStatus; +} TDI_REQUEST, *PTDI_REQUEST; + +typedef struct _TDI_REQUEST_STATUS { + TDI_STATUS Status; + PVOID RequestContext; + ULONG BytesTransferred; +} TDI_REQUEST_STATUS, *PTDI_REQUEST_STATUS; + +typedef struct _TDI_CONNECT_REQUEST { + TDI_REQUEST Request; + PTDI_CONNECTION_INFORMATION RequestConnectionInformation; + PTDI_CONNECTION_INFORMATION ReturnConnectionInformation; + LARGE_INTEGER Timeout; +} TDI_REQUEST_CONNECT, *PTDI_REQUEST_CONNECT; + +typedef struct _TDI_REQUEST_ACCEPT { + TDI_REQUEST Request; + PTDI_CONNECTION_INFORMATION RequestConnectionInformation; + PTDI_CONNECTION_INFORMATION ReturnConnectionInformation; +} TDI_REQUEST_ACCEPT, *PTDI_REQUEST_ACCEPT; + +typedef struct _TDI_REQUEST_LISTEN { + TDI_REQUEST Request; + PTDI_CONNECTION_INFORMATION RequestConnectionInformation; + PTDI_CONNECTION_INFORMATION ReturnConnectionInformation; + USHORT ListenFlags; +} TDI_REQUEST_LISTEN, *PTDI_REQUEST_LISTEN; + +typedef struct _TDI_DISCONNECT_REQUEST { + TDI_REQUEST Request; + LARGE_INTEGER Timeout; +} TDI_REQUEST_DISCONNECT, *PTDI_REQUEST_DISCONNECT; + +typedef struct _TDI_REQUEST_SEND { + TDI_REQUEST Request; + USHORT SendFlags; +} TDI_REQUEST_SEND, *PTDI_REQUEST_SEND; + +typedef struct _TDI_REQUEST_RECEIVE { + TDI_REQUEST Request; + USHORT ReceiveFlags; +} TDI_REQUEST_RECEIVE, *PTDI_REQUEST_RECEIVE; + +typedef struct _TDI_REQUEST_SEND_DATAGRAM { + TDI_REQUEST Request; + PTDI_CONNECTION_INFORMATION SendDatagramInformation; +} TDI_REQUEST_SEND_DATAGRAM, *PTDI_REQUEST_SEND_DATAGRAM; + +typedef struct _TDI_REQUEST_RECEIVE_DATAGRAM { + TDI_REQUEST Request; + PTDI_CONNECTION_INFORMATION ReceiveDatagramInformation; + PTDI_CONNECTION_INFORMATION ReturnInformation; + USHORT ReceiveFlags; +} TDI_REQUEST_RECEIVE_DATAGRAM, *PTDI_REQUEST_RECEIVE_DATAGRAM; + +typedef struct _TDI_REQUEST_SET_EVENT { + TDI_REQUEST Request; + LONG EventType; + PVOID EventHandler; + PVOID EventContext; +} TDI_REQUEST_SET_EVENT_HANDLER, *PTDI_REQUEST_SET_EVENT_HANDLER; + +#define TDI_RECEIVE_BROADCAST 0x00000004 +#define TDI_RECEIVE_MULTICAST 0x00000008 +#define TDI_RECEIVE_PARTIAL 0x00000010 +#define TDI_RECEIVE_NORMAL 0x00000020 +#define TDI_RECEIVE_EXPEDITED 0x00000040 +#define TDI_RECEIVE_PEEK 0x00000080 +#define TDI_RECEIVE_NO_RESPONSE_EXP 0x00000100 +#define TDI_RECEIVE_COPY_LOOKAHEAD 0x00000200 +#define TDI_RECEIVE_ENTIRE_MESSAGE 0x00000400 +#define TDI_RECEIVE_AT_DISPATCH_LEVEL 0x00000800 +#define TDI_RECEIVE_CONTROL_INFO 0x00001000 + +/* Listen flags */ +#define TDI_QUERY_ACCEPT 0x00000001 + +/* Options used for both SendOptions and ReceiveIndicators */ +#define TDI_SEND_EXPEDITED 0x0020 +#define TDI_SEND_PARTIAL 0x0040 +#define TDI_SEND_NO_RESPONSE_EXPECTED 0x0080 +#define TDI_SEND_NON_BLOCKING 0x0100 +#define TDI_SEND_AND_DISCONNECT 0x0200 + +/* Disconnect Flags */ +#define TDI_DISCONNECT_WAIT 0x0001 +#define TDI_DISCONNECT_ABORT 0x0002 +#define TDI_DISCONNECT_RELEASE 0x0004 + +/* TdiRequest structure for TdiQueryInformation request */ +typedef struct _TDI_REQUEST_QUERY_INFORMATION { + TDI_REQUEST Request; + ULONG QueryType; + PTDI_CONNECTION_INFORMATION RequestConnectionInformation; +} TDI_REQUEST_QUERY_INFORMATION, *PTDI_REQUEST_QUERY_INFORMATION; + +/* TdiRequest structure for TdiSetInformation request */ +typedef struct _TDI_REQUEST_SET_INFORMATION { + TDI_REQUEST Request; + ULONG SetType; + PTDI_CONNECTION_INFORMATION RequestConnectionInformation; +} TDI_REQUEST_SET_INFORMATION, *PTDI_REQUEST_SET_INFORMATION; + +typedef TDI_REQUEST_SET_INFORMATION TDI_REQ_SET_INFORMATION, *PTDI_REQ_SET_INFORMATION; + +typedef union _TDI_REQUEST_TYPE { + TDI_REQUEST_ACCEPT TdiAccept; + TDI_REQUEST_CONNECT TdiConnect; + TDI_REQUEST_DISCONNECT TdiDisconnect; + TDI_REQUEST_LISTEN TdiListen; + TDI_REQUEST_QUERY_INFORMATION TdiQueryInformation; + TDI_REQUEST_RECEIVE TdiReceive; + TDI_REQUEST_RECEIVE_DATAGRAM TdiReceiveDatagram; + TDI_REQUEST_SEND TdiSend; + TDI_REQUEST_SEND_DATAGRAM TdiSendDatagram; + TDI_REQUEST_SET_EVENT_HANDLER TdiSetEventHandler; + TDI_REQUEST_SET_INFORMATION TdiSetInformation; +} TDI_REQUEST_TYPE, *PTDI_REQUEST_TYPE; + +/* Query information types */ + +/* Generic query info types that must be supported by all transports */ +#define TDI_QUERY_BROADCAST_ADDRESS 0x00000001 +#define TDI_QUERY_PROVIDER_INFO 0x00000002 +#define TDI_QUERY_ADDRESS_INFO 0x00000003 +#define TDI_QUERY_CONNECTION_INFO 0x00000004 +#define TDI_QUERY_PROVIDER_STATISTICS 0x00000005 +#define TDI_QUERY_DATAGRAM_INFO 0x00000006 +#define TDI_QUERY_DATA_LINK_ADDRESS 0x00000007 +#define TDI_QUERY_NETWORK_ADDRESS 0x00000008 +#define TDI_QUERY_MAX_DATAGRAM_INFO 0x00000009 + +/* Netbios specific query information types */ +#define TDI_QUERY_ADAPTER_STATUS 0x00000100 +#define TDI_QUERY_SESSION_STATUS 0x00000200 +#define TDI_QUERY_FIND_NAME 0x00000300 + +/* Structures used for TdiQueryInformation and TdiSetInformation */ + +typedef struct _TDI_ENDPOINT_INFO { + ULONG State; + ULONG Event; + ULONG TransmittedTsdus; + ULONG ReceivedTsdus; + ULONG TransmissionErrors; + ULONG ReceiveErrors; + ULONG MinimumLookaheadData; + ULONG MaximumLookaheadData; + ULONG PriorityLevel; + ULONG SecurityLevel; + ULONG SecurityCompartment; +} TDI_ENDPOINT_INFO, *PTDI_ENDPOINT_INFO; + +typedef struct _TDI_CONNECTION_INFO { + ULONG State; + ULONG Event; + ULONG TransmittedTsdus; + ULONG ReceivedTsdus; + ULONG TransmissionErrors; + ULONG ReceiveErrors; + LARGE_INTEGER Throughput; + LARGE_INTEGER Delay; + ULONG SendBufferSize; + ULONG ReceiveBufferSize; + BOOLEAN Unreliable; +} TDI_CONNECTION_INFO, *PTDI_CONNECTION_INFO; + +typedef struct _TDI_DATAGRAM_INFO { + ULONG MaximumDatagramBytes; + ULONG MaximumDatagramCount; +} TDI_DATAGRAM_INFO, *PTDI_DATAGRAM_INFO; + +typedef struct _TDI_MAX_DATAGRAM_INFO { + ULONG MaxDatagramSize; +} TDI_MAX_DATAGRAM_INFO, *PTDI_MAX_DATAGRAM_INFO; + +typedef struct _TDI_PROVIDER_INFO { + ULONG Version; + ULONG MaxSendSize; + ULONG MaxConnectionUserData; + ULONG MaxDatagramSize; + ULONG ServiceFlags; + ULONG MinimumLookaheadData; + ULONG MaximumLookaheadData; + ULONG NumberOfResources; + LARGE_INTEGER StartTime; +} TDI_PROVIDER_INFO, *PTDI_PROVIDER_INFO; + +#define TDI_SERVICE_CONNECTION_MODE 0x00000001 +#define TDI_SERVICE_ORDERLY_RELEASE 0x00000002 +#define TDI_SERVICE_CONNECTIONLESS_MODE 0x00000004 +#define TDI_SERVICE_ERROR_FREE_DELIVERY 0x00000008 +#define TDI_SERVICE_SECURITY_LEVEL 0x00000010 +#define TDI_SERVICE_BROADCAST_SUPPORTED 0x00000020 +#define TDI_SERVICE_MULTICAST_SUPPORTED 0x00000040 +#define TDI_SERVICE_DELAYED_ACCEPTANCE 0x00000080 +#define TDI_SERVICE_EXPEDITED_DATA 0x00000100 +#define TDI_SERVICE_INTERNAL_BUFFERING 0x00000200 +#define TDI_SERVICE_ROUTE_DIRECTED 0x00000400 +#define TDI_SERVICE_NO_ZERO_LENGTH 0x00000800 +#define TDI_SERVICE_POINT_TO_POINT 0x00001000 +#define TDI_SERVICE_MESSAGE_MODE 0x00002000 +#define TDI_SERVICE_HALF_DUPLEX 0x00004000 +#define TDI_SERVICE_DGRAM_CONNECTION 0x00008000 +#define TDI_SERVICE_FORCE_ACCESS_CHECK 0x00010000 +#define TDI_SERVICE_SEND_AND_DISCONNECT 0x00020000 +#define TDI_SERVICE_DIRECT_ACCEPT 0x00040000 +#define TDI_SERVICE_ACCEPT_LOCAL_ADDR 0x00080000 + +typedef struct _TDI_PROVIDER_RESOURCE_STATS { + ULONG ResourceId; + ULONG MaximumResourceUsed; + ULONG AverageResourceUsed; + ULONG ResourceExhausted; +} TDI_PROVIDER_RESOURCE_STATS, *PTDI_PROVIDER_RESOURCE_STATS; + +typedef struct _TDI_PROVIDER_STATISTICS { + ULONG Version; + ULONG OpenConnections; + ULONG ConnectionsAfterNoRetry; + ULONG ConnectionsAfterRetry; + ULONG LocalDisconnects; + ULONG RemoteDisconnects; + ULONG LinkFailures; + ULONG AdapterFailures; + ULONG SessionTimeouts; + ULONG CancelledConnections; + ULONG RemoteResourceFailures; + ULONG LocalResourceFailures; + ULONG NotFoundFailures; + ULONG NoListenFailures; + ULONG DatagramsSent; + LARGE_INTEGER DatagramBytesSent; + ULONG DatagramsReceived; + LARGE_INTEGER DatagramBytesReceived; + ULONG PacketsSent; + ULONG PacketsReceived; + ULONG DataFramesSent; + LARGE_INTEGER DataFrameBytesSent; + ULONG DataFramesReceived; + LARGE_INTEGER DataFrameBytesReceived; + ULONG DataFramesResent; + LARGE_INTEGER DataFrameBytesResent; + ULONG DataFramesRejected; + LARGE_INTEGER DataFrameBytesRejected; + ULONG ResponseTimerExpirations; + ULONG AckTimerExpirations; + ULONG MaximumSendWindow; + ULONG AverageSendWindow; + ULONG PiggybackAckQueued; + ULONG PiggybackAckTimeouts; + LARGE_INTEGER WastedPacketSpace; + ULONG WastedSpacePackets; + ULONG NumberOfResources; + TDI_PROVIDER_RESOURCE_STATS ResourceStats[1]; +} TDI_PROVIDER_STATISTICS, *PTDI_PROVIDER_STATISTICS; + +#define TDI_EVENT_CONNECT 0 +#define TDI_EVENT_DISCONNECT 1 +#define TDI_EVENT_ERROR 2 +#define TDI_EVENT_RECEIVE 3 +#define TDI_EVENT_RECEIVE_DATAGRAM 4 +#define TDI_EVENT_RECEIVE_EXPEDITED 5 +#define TDI_EVENT_SEND_POSSIBLE 6 + +typedef struct _TDI_REQUEST_ASSOCIATE { + TDI_REQUEST Request; + HANDLE AddressHandle; +} TDI_REQUEST_ASSOCIATE_ADDRESS, *PTDI_REQUEST_ASSOCIATE_ADDRESS; + +#define NDIS_PACKET_POOL_TAG_FOR_NWLNKIPX 'iPDN' +#define NDIS_PACKET_POOL_TAG_FOR_NWLNKSPX 'sPDN' +#define NDIS_PACKET_POOL_TAG_FOR_NWLNKNB 'nPDN' +#define NDIS_PACKET_POOL_TAG_FOR_TCPIP 'tPDN' +#define NDIS_PACKET_POOL_TAG_FOR_NBF 'bPDN' +#define NDIS_PACKET_POOL_TAG_FOR_APPLETALK 'aPDN' + +typedef struct _TA_ADDRESS { + USHORT AddressLength; + USHORT AddressType; + UCHAR Address[1]; +} TA_ADDRESS, *PTA_ADDRESS; + +#define TDI_ADDRESS_TYPE_UNSPEC 0 +#define TDI_ADDRESS_TYPE_UNIX 1 +#define TDI_ADDRESS_TYPE_IP 2 +#define TDI_ADDRESS_TYPE_IMPLINK 3 +#define TDI_ADDRESS_TYPE_PUP 4 +#define TDI_ADDRESS_TYPE_CHAOS 5 +#define TDI_ADDRESS_TYPE_NS 6 +#define TDI_ADDRESS_TYPE_IPX 6 +#define TDI_ADDRESS_TYPE_NBS 7 +#define TDI_ADDRESS_TYPE_ECMA 8 +#define TDI_ADDRESS_TYPE_DATAKIT 9 +#define TDI_ADDRESS_TYPE_CCITT 10 +#define TDI_ADDRESS_TYPE_SNA 11 +#define TDI_ADDRESS_TYPE_DECnet 12 +#define TDI_ADDRESS_TYPE_DLI 13 +#define TDI_ADDRESS_TYPE_LAT 14 +#define TDI_ADDRESS_TYPE_HYLINK 15 +#define TDI_ADDRESS_TYPE_APPLETALK 16 +#define TDI_ADDRESS_TYPE_NETBIOS 17 +#define TDI_ADDRESS_TYPE_8022 18 +#define TDI_ADDRESS_TYPE_OSI_TSAP 19 +#define TDI_ADDRESS_TYPE_NETONE 20 +#define TDI_ADDRESS_TYPE_VNS 21 +#define TDI_ADDRESS_TYPE_NETBIOS_EX 22 +#define TDI_ADDRESS_TYPE_IP6 23 +#define TDI_ADDRESS_TYPE_NETBIOS_UNICODE_EX 24 + +#define TdiTransportAddress "TransportAddress" +#define TdiConnectionContext "ConnectionContext" +#define TDI_TRANSPORT_ADDRESS_LENGTH (sizeof(TdiTransportAddress) - 1) +#define TDI_CONNECTION_CONTEXT_LENGTH (sizeof(TdiConnectionContext) - 1) + +typedef struct _TRANSPORT_ADDRESS { + LONG TAAddressCount; + TA_ADDRESS Address[1]; +} TRANSPORT_ADDRESS, *PTRANSPORT_ADDRESS; + +typedef struct _TDI_ACTION_HEADER { + ULONG TransportId; + USHORT ActionCode; + USHORT Reserved; +} TDI_ACTION_HEADER, *PTDI_ACTION_HEADER; + +typedef struct _TDI_ADDRESS_INFO { + ULONG ActivityCount; + TRANSPORT_ADDRESS Address; +} TDI_ADDRESS_INFO, *PTDI_ADDRESS_INFO; + +#include "pshpack1.h" + +typedef struct _TDI_ADDRESS_8022 { + UCHAR MACAddress[6]; +} TDI_ADDRESS_8022, *PTDI_ADDRESS_8022; + +#define TDI_ADDRESS_LENGTH_8022 sizeof(TDI_ADDRESS_8022); + +typedef struct _TDI_ADDRESS_APPLETALK { + USHORT Network; + UCHAR Node; + UCHAR Socket; +} TDI_ADDRESS_APPLETALK, *PTDI_ADDRESS_APPLETALK; + +#define TDI_ADDRESS_LENGTH_APPLETALK sizeof(TDI_ADDRESS_APPLETALK) + +typedef struct _TDI_ADDRESS_IP { + USHORT sin_port; + ULONG in_addr; + UCHAR sin_zero[8]; +} TDI_ADDRESS_IP, *PTDI_ADDRESS_IP; + +#define TDI_ADDRESS_LENGTH_IP sizeof(TDI_ADDRESS_IP) + +typedef struct _TDI_ADDRESS_IPX { + ULONG NetworkAddress; + UCHAR NodeAddress[6]; + USHORT Socket; +} TDI_ADDRESS_IPX, *PTDI_ADDRESS_IPX; + +#define TDI_ADDRESS_LENGTH_IPX sizeof(TDI_ADDRESS_IPX) + +/* TDI_ADDRESS_NETBIOS.NetbiosNameType constants */ +#define TDI_ADDRESS_NETBIOS_TYPE_UNIQUE 0x0000 +#define TDI_ADDRESS_NETBIOS_TYPE_GROUP 0x0001 +#define TDI_ADDRESS_NETBIOS_TYPE_QUICK_UNIQUE 0x0002 +#define TDI_ADDRESS_NETBIOS_TYPE_QUICK_GROUP 0x0003 + +typedef struct _TDI_ADDRESS_NETBIOS { + USHORT NetbiosNameType; + UCHAR NetbiosName[16]; +} TDI_ADDRESS_NETBIOS, *PTDI_ADDRESS_NETBIOS; + +#define TDI_ADDRESS_LENGTH_NETBIOS sizeof(TDI_ADDRESS_NETBIOS) + +typedef struct _TDI_ADDRESS_NETBIOS_EX { + UCHAR EndpointName[16]; + TDI_ADDRESS_NETBIOS NetbiosAddress; +} TDI_ADDRESS_NETBIOS_EX, *PTDI_ADDRESS_NETBIOS_EX; + +#define TDI_ADDRESS_LENGTH_NETBIOS_EX sizeof(TDI_ADDRESS_NETBIOS_EX) + +/* TDI_ADDRESS_NETONE.NetoneNameType constants */ +#define TDI_ADDRESS_NETONE_TYPE_UNIQUE 0x0000 +#define TDI_ADDRESS_NETONE_TYPE_ROTORED 0x0001 + +typedef struct _TDI_ADDRESS_NETONE { + USHORT NetoneNameType; + UCHAR NetoneName[20]; +} TDI_ADDRESS_NETONE, *PTDI_ADDRESS_NETONE; + +#define TDI_ADDRESS_LENGTH_NETONE sizeof(TDI_ADDRESS_NETONE) + +typedef struct _TDI_ADDRESS_NS +{ + ULONG NetworkAddress; + UCHAR NodeAddress[6]; + USHORT Socket; +} TDI_ADDRESS_NS, *PTDI_ADDRESS_NS; + +#define TDI_ADDRESS_LENGTH_NS sizeof(TDI_ADDRESS_NS) + +#define ISO_MAX_ADDR_LENGTH 64 + +/* TDI_ADDRESS_OSI_TSAP.tp_addr_type constants */ +#define ISO_HIERARCHICAL 0 +#define ISO_NON_HIERARCHICAL 1 + +typedef struct _TDI_ADDRESS_OSI_TSAP { + USHORT tp_addr_type; + USHORT tp_taddr_len; + USHORT tp_tsel_len; + UCHAR tp_addr[ISO_MAX_ADDR_LENGTH]; +} TDI_ADDRESS_OSI_TSAP, *PTDI_ADDRESS_OSI_TSAP; + +#define TDI_ADDRESS_LENGTH_OSI_TSAP sizeof(TDI_ADDRESS_OSI_TSAP) + +typedef struct _TDI_ADDRESS_VNS { + UCHAR net_address[4]; + UCHAR subnet_addr[2]; + UCHAR port[2]; + UCHAR hops; + UCHAR filler[5]; +} TDI_ADDRESS_VNS, *PTDI_ADDRESS_VNS; + +#define TDI_ADDRESS_LENGTH_VNS sizeof(TDI_ADDRESS_VNS) + +typedef struct _TDI_ADDRESS_IP6 { + USHORT sin6_port; + ULONG sin6_flowinfo; + USHORT sin6_addr[8]; + ULONG sin6_scope_id; +} TDI_ADDRESS_IP6, *PTDI_ADDRESS_IP6; + +#define TDI_ADDRESS_LENGTH_IP6 sizeof(TDI_ADDRESS_IP6) + +enum eNameBufferType { + NBT_READONLY = 0, + NBT_WRITEONLY, + NBT_READWRITE, + NBT_WRITTEN +}; + +typedef struct _TDI_ADDRESS_NETBIOS_UNICODE_EX { + USHORT NetbiosNameType; + enum eNameBufferType NameBufferType; + UNICODE_STRING EndpointName; + UNICODE_STRING RemoteName; + WCHAR EndpointBuffer[17]; + WCHAR RemoteNameBuffer[1]; +} TDI_ADDRESS_NETBIOS_UNICODE_EX, *PTDI_ADDRESS_NETBIOS_UNICODE_EX; + +typedef struct _TA_APPLETALK_ADDR { + LONG TAAddressCount; + struct _AddrAtalk { + USHORT AddressLength; + USHORT AddressType; + TDI_ADDRESS_APPLETALK Address[1]; + } Address[1]; +} TA_APPLETALK_ADDRESS, *PTA_APPLETALK_ADDRESS; + +typedef struct _TA_ADDRESS_IP { + LONG TAAddressCount; + struct _AddrIp { + USHORT AddressLength; + USHORT AddressType; + TDI_ADDRESS_IP Address[1]; + } Address[1]; +} TA_IP_ADDRESS, *PTA_IP_ADDRESS; + +typedef struct _TA_ADDRESS_IPX { + LONG TAAddressCount; + struct _AddrIpx { + USHORT AddressLength; + USHORT AddressType; + TDI_ADDRESS_IPX Address[1]; + } Address[1]; +} TA_IPX_ADDRESS, *PTA_IPX_ADDRESS; + +typedef struct _TA_NETBIOS_ADDRESS { + LONG TAAddressCount; + struct _Addr{ + USHORT AddressLength; + USHORT AddressType; + TDI_ADDRESS_NETBIOS Address[1]; + } Address[1]; +} TA_NETBIOS_ADDRESS, *PTA_NETBIOS_ADDRESS; + +typedef struct _TA_ADDRESS_NS { + LONG TAAddressCount; + struct _AddrNs { + USHORT AddressLength; + USHORT AddressType; + TDI_ADDRESS_NS Address[1]; + } Address[1]; +} TA_NS_ADDRESS, *PTA_NS_ADDRESS; + +typedef struct _TA_ADDRESS_VNS { + LONG TAAddressCount; + struct _AddrVns { + USHORT AddressLength; + USHORT AddressType; + TDI_ADDRESS_VNS Address[1]; + } Address[1]; +} TA_VNS_ADDRESS, *PTA_VNS_ADDRESS; + +typedef struct _TA_ADDRESS_IP6 { + LONG TAAddressCount; + struct _AddrIp6 { + USHORT AddressLength; + USHORT AddressType; + TDI_ADDRESS_IP6 Address[1]; + } Address [1]; +} TA_IP6_ADDRESS, *PTA_IP6_ADDRESS; + +typedef struct _TA_ADDRESS_NETBIOS_UNICODE_EX { + LONG TAAddressCount; + struct _AddrNetbiosWCharEx { + USHORT AddressLength; + USHORT AddressType; + TDI_ADDRESS_NETBIOS_UNICODE_EX Address[1]; + } Address [1]; +} TA_NETBIOS_UNICODE_EX_ADDRESS, *PTA_NETBIOS_UNICODE_EX_ADDRESS; + +#include "poppack.h" + +#ifdef __cplusplus +} +#endif + +#endif /* __TDI_H */ diff --git a/reactos/include/ddk/tdiinfo.h b/reactos/include/ddk/tdiinfo.h new file mode 100644 index 00000000000..65731ef9d88 --- /dev/null +++ b/reactos/include/ddk/tdiinfo.h @@ -0,0 +1,108 @@ +/* + * tdiinfo.h + * + * TDI set and query information interface + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __TDIINFO_H +#define __TDIINFO_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct TDIEntityID { + ULONG tei_entity; + ULONG tei_instance; +} TDIEntityID; + +#define MAX_TDI_ENTITIES 4096 +#define INVALID_ENTITY_INSTANCE -1 +#define GENERIC_ENTITY 0 +#define ENTITY_LIST_ID 0 +#define ENTITY_TYPE_ID 1 + +#define AT_ENTITY 0x280 +#define CL_NL_ENTITY 0x301 +#define CL_TL_ENTITY 0x401 +#define CO_NL_ENTITY 0x300 +#define CO_TL_ENTITY 0x400 +#define ER_ENTITY 0x380 +#define IF_ENTITY 0x200 + +#define AT_ARP 0x280 +#define AT_NULL 0x282 +#define CL_TL_NBF 0x401 +#define CL_TL_UDP 0x403 +#define CL_NL_IPX 0x301 +#define CL_NL_IP 0x303 +#define CO_TL_NBF 0x400 +#define CO_TL_SPX 0x402 +#define CO_TL_TCP 0x404 +#define CO_TL_SPP 0x406 +#define ER_ICMP 0x380 +#define IF_GENERIC 0x200 +#define IF_MIB 0x202 + +/* TDIObjectID.toi_class constants */ +#define INFO_CLASS_GENERIC 0x100 +#define INFO_CLASS_PROTOCOL 0x200 +#define INFO_CLASS_IMPLEMENTATION 0x300 + +/* TDIObjectID.toi_type constants */ +#define INFO_TYPE_PROVIDER 0x100 +#define INFO_TYPE_ADDRESS_OBJECT 0x200 +#define INFO_TYPE_CONNECTION 0x300 + +typedef struct _TDIObjectID { + TDIEntityID toi_entity; + ULONG toi_class; + ULONG toi_type; + ULONG toi_id; +} TDIObjectID; + +#define CONTEXT_SIZE 16 + +typedef struct _TCP_REQUEST_QUERY_INFORMATION_EX { + TDIObjectID ID; + ULONG_PTR Context[CONTEXT_SIZE / sizeof(ULONG_PTR)]; +} TCP_REQUEST_QUERY_INFORMATION_EX, *PTCP_REQUEST_QUERY_INFORMATION_EX; + +#if defined(_WIN64) +typedef struct _TCP_REQUEST_QUERY_INFORMATION_EX32 { + TDIObjectID ID; + ULONG32 Context[CONTEXT_SIZE / sizeof(ULONG32)]; +} TCP_REQUEST_QUERY_INFORMATION_EX32, *PTCP_REQUEST_QUERY_INFORMATION_EX32; +#endif /* _WIN64 */ + +typedef struct _TCP_REQUEST_SET_INFORMATION_EX { + TDIObjectID ID; + UINT BufferSize; + UCHAR Buffer[1]; +} TCP_REQUEST_SET_INFORMATION_EX, *PTCP_REQUEST_SET_INFORMATION_EX; + +#ifdef __cplusplus +} +#endif + +#endif /* __TDIINFO_H */ diff --git a/reactos/include/ddk/tdikrnl.h b/reactos/include/ddk/tdikrnl.h new file mode 100644 index 00000000000..ef55f4ab93b --- /dev/null +++ b/reactos/include/ddk/tdikrnl.h @@ -0,0 +1,1161 @@ +/* + * tdikrnl.h + * + * TDI kernel mode definitions + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __TDIKRNL_H +#define __TDIKRNL_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include "tdi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(_TDI_) + #define TDIKRNLAPI DECLSPEC_EXPORT +#else + #define TDIKRNLAPI DECLSPEC_IMPORT +#endif + + +typedef struct _TDI_REQUEST_KERNEL { + ULONG RequestFlags; + PTDI_CONNECTION_INFORMATION RequestConnectionInformation; + PTDI_CONNECTION_INFORMATION ReturnConnectionInformation; + PVOID RequestSpecific; +} TDI_REQUEST_KERNEL, *PTDI_REQUEST_KERNEL; + +/* Request codes */ +#define TDI_ASSOCIATE_ADDRESS 0x01 +#define TDI_DISASSOCIATE_ADDRESS 0x02 +#define TDI_CONNECT 0x03 +#define TDI_LISTEN 0x04 +#define TDI_ACCEPT 0x05 +#define TDI_DISCONNECT 0x06 +#define TDI_SEND 0x07 +#define TDI_RECEIVE 0x08 +#define TDI_SEND_DATAGRAM 0x09 +#define TDI_RECEIVE_DATAGRAM 0x0A +#define TDI_SET_EVENT_HANDLER 0x0B +#define TDI_QUERY_INFORMATION 0x0C +#define TDI_SET_INFORMATION 0x0D +#define TDI_ACTION 0x0E + +#define TDI_DIRECT_SEND 0x27 +#define TDI_DIRECT_SEND_DATAGRAM 0x29 + +#define TDI_TRANSPORT_ADDRESS_FILE 1 +#define TDI_CONNECTION_FILE 2 +#define TDI_CONTROL_CHANNEL_FILE 3 + +/* Internal TDI IOCTLS */ +#define IOCTL_TDI_QUERY_DIRECT_SEND_HANDLER _TDI_CONTROL_CODE(0x80, METHOD_NEITHER) +#define IOCTL_TDI_QUERY_DIRECT_SENDDG_HANDLER _TDI_CONTROL_CODE(0x81, METHOD_NEITHER) + +/* TdiAssociateAddress */ +typedef struct _TDI_REQUEST_KERNEL_ASSOCIATE { + HANDLE AddressHandle; +} TDI_REQUEST_KERNEL_ASSOCIATE, *PTDI_REQUEST_KERNEL_ASSOCIATE; + +/* TdiDisassociateAddress */ +typedef TDI_REQUEST_KERNEL TDI_REQUEST_KERNEL_DISASSOCIATE, + *PTDI_REQUEST_KERNEL_DISASSOCIATE; + +/* TdiAccept */ +typedef struct _TDI_REQUEST_KERNEL_ACCEPT { + PTDI_CONNECTION_INFORMATION RequestConnectionInformation; + PTDI_CONNECTION_INFORMATION ReturnConnectionInformation; +} TDI_REQUEST_KERNEL_ACCEPT, *PTDI_REQUEST_KERNEL_ACCEPT; + +/* TdiConnect */ +typedef TDI_REQUEST_KERNEL TDI_REQUEST_KERNEL_CONNECT, + *PTDI_REQUEST_KERNEL_CONNECT; + +/* TdiDisconnect */ +typedef TDI_REQUEST_KERNEL TDI_REQUEST_KERNEL_DISCONNECT, + *PTDI_REQUEST_KERNEL_DISCONNECT; + +/* TdiListen */ +typedef TDI_REQUEST_KERNEL TDI_REQUEST_KERNEL_LISTEN, + *PTDI_REQUEST_KERNEL_LISTEN; + +/* TdiReceive */ +typedef struct _TDI_REQUEST_KERNEL_RECEIVE { + ULONG ReceiveLength; + ULONG ReceiveFlags; +} TDI_REQUEST_KERNEL_RECEIVE, *PTDI_REQUEST_KERNEL_RECEIVE; + +/* TdiReceiveDatagram */ +typedef struct _TDI_REQUEST_KERNEL_RECEIVEDG { + ULONG ReceiveLength; + PTDI_CONNECTION_INFORMATION ReceiveDatagramInformation; + PTDI_CONNECTION_INFORMATION ReturnDatagramInformation; + ULONG ReceiveFlags; +} TDI_REQUEST_KERNEL_RECEIVEDG, *PTDI_REQUEST_KERNEL_RECEIVEDG; + +/* TdiSend */ +typedef struct _TDI_REQUEST_KERNEL_SEND { + ULONG SendLength; + ULONG SendFlags; +} TDI_REQUEST_KERNEL_SEND, *PTDI_REQUEST_KERNEL_SEND; + +/* TdiSendDatagram */ +typedef struct _TDI_REQUEST_KERNEL_SENDDG { + ULONG SendLength; + PTDI_CONNECTION_INFORMATION SendDatagramInformation; +} TDI_REQUEST_KERNEL_SENDDG, *PTDI_REQUEST_KERNEL_SENDDG; + +/* TdiSetEventHandler */ +typedef struct _TDI_REQUEST_KERNEL_SET_EVENT { + LONG EventType; + PVOID EventHandler; + PVOID EventContext; +} TDI_REQUEST_KERNEL_SET_EVENT, *PTDI_REQUEST_KERNEL_SET_EVENT; + +/* TdiQueryInformation */ +typedef struct _TDI_REQUEST_KERNEL_QUERY_INFO { + LONG QueryType; + PTDI_CONNECTION_INFORMATION RequestConnectionInformation; +} TDI_REQUEST_KERNEL_QUERY_INFORMATION, *PTDI_REQUEST_KERNEL_QUERY_INFORMATION; + +/* TdiSetInformation */ +typedef struct _TDI_REQUEST_KERNEL_SET_INFO { + LONG SetType; + PTDI_CONNECTION_INFORMATION RequestConnectionInformation; +} TDI_REQUEST_KERNEL_SET_INFORMATION, *PTDI_REQUEST_KERNEL_SET_INFORMATION; + + +/* Event types */ +#define TDI_EVENT_CONNECT 0 +#define TDI_EVENT_DISCONNECT 1 +#define TDI_EVENT_ERROR 2 +#define TDI_EVENT_RECEIVE 3 +#define TDI_EVENT_RECEIVE_DATAGRAM 4 +#define TDI_EVENT_RECEIVE_EXPEDITED 5 +#define TDI_EVENT_SEND_POSSIBLE 6 +#define TDI_EVENT_CHAINED_RECEIVE 7 +#define TDI_EVENT_CHAINED_RECEIVE_DATAGRAM 8 +#define TDI_EVENT_CHAINED_RECEIVE_EXPEDITED 9 +#define TDI_EVENT_ERROR_EX 10 + +typedef NTSTATUS DDKAPI +(*PTDI_IND_CONNECT)( + IN PVOID TdiEventContext, + IN LONG RemoteAddressLength, + IN PVOID RemoteAddress, + IN LONG UserDataLength, + IN PVOID UserData, + IN LONG OptionsLength, + IN PVOID Options, + OUT CONNECTION_CONTEXT *ConnectionContext, + OUT PIRP *AcceptIrp); + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiDefaultConnectHandler( + IN PVOID TdiEventContext, + IN LONG RemoteAddressLength, + IN PVOID RemoteAddress, + IN LONG UserDataLength, + IN PVOID UserData, + IN LONG OptionsLength, + IN PVOID Options, + OUT CONNECTION_CONTEXT *ConnectionContext, + OUT PIRP *AcceptIrp); + +typedef NTSTATUS DDKAPI +(*PTDI_IND_DISCONNECT)( + IN PVOID TdiEventContext, + IN CONNECTION_CONTEXT ConnectionContext, + IN LONG DisconnectDataLength, + IN PVOID DisconnectData, + IN LONG DisconnectInformationLength, + IN PVOID DisconnectInformation, + IN ULONG DisconnectFlags); + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiDefaultDisconnectHandler( + IN PVOID TdiEventContext, + IN CONNECTION_CONTEXT ConnectionContext, + IN LONG DisconnectDataLength, + IN PVOID DisconnectData, + IN LONG DisconnectInformationLength, + IN PVOID DisconnectInformation, + IN ULONG DisconnectFlags); + +typedef NTSTATUS DDKAPI +(*PTDI_IND_ERROR)( + IN PVOID TdiEventContext, + IN NTSTATUS Status); + +typedef NTSTATUS DDKAPI +(*PTDI_IND_ERROR_EX)( + IN PVOID TdiEventContext, + IN NTSTATUS Status, + IN PVOID Buffer); + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiDefaultErrorHandler( + IN PVOID TdiEventContext, + IN NTSTATUS Status); + +typedef NTSTATUS DDKAPI +(*PTDI_IND_RECEIVE)( + IN PVOID TdiEventContext, + IN CONNECTION_CONTEXT ConnectionContext, + IN ULONG ReceiveFlags, + IN ULONG BytesIndicated, + IN ULONG BytesAvailable, + OUT ULONG *BytesTaken, + IN PVOID Tsdu, + OUT PIRP *IoRequestPacket); + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiDefaultReceiveHandler( + IN PVOID TdiEventContext, + IN CONNECTION_CONTEXT ConnectionContext, + IN ULONG ReceiveFlags, + IN ULONG BytesIndicated, + IN ULONG BytesAvailable, + OUT ULONG *BytesTaken, + IN PVOID Tsdu, + OUT PIRP *IoRequestPacket); + +typedef NTSTATUS DDKAPI +(*PTDI_IND_RECEIVE_DATAGRAM)( + IN PVOID TdiEventContext, + IN LONG SourceAddressLength, + IN PVOID SourceAddress, + IN LONG OptionsLength, + IN PVOID Options, + IN ULONG ReceiveDatagramFlags, + IN ULONG BytesIndicated, + IN ULONG BytesAvailable, + OUT ULONG *BytesTaken, + IN PVOID Tsdu, + OUT PIRP *IoRequestPacket); + +TDIKRNLAPI +NTSTATUS DDKAPI +TdiDefaultRcvDatagramHandler( + IN PVOID TdiEventContext, + IN LONG SourceAddressLength, + IN PVOID SourceAddress, + IN LONG OptionsLength, + IN PVOID Options, + IN ULONG ReceiveDatagramFlags, + IN ULONG BytesIndicated, + IN ULONG BytesAvailable, + OUT ULONG *BytesTaken, + IN PVOID Tsdu, + OUT PIRP *IoRequestPacket); + +typedef NTSTATUS DDKAPI +(*PTDI_IND_RECEIVE_EXPEDITED)( + IN PVOID TdiEventContext, + IN CONNECTION_CONTEXT ConnectionContext, + IN ULONG ReceiveFlags, + IN ULONG BytesIndicated, + IN ULONG BytesAvailable, + OUT ULONG *BytesTaken, + IN PVOID Tsdu, + OUT PIRP *IoRequestPacket); + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiDefaultRcvExpeditedHandler( + IN PVOID TdiEventContext, + IN CONNECTION_CONTEXT ConnectionContext, + IN ULONG ReceiveFlags, + IN ULONG BytesIndicated, + IN ULONG BytesAvailable, + OUT ULONG *BytesTaken, + IN PVOID Tsdu, + OUT PIRP *IoRequestPacket); + +typedef NTSTATUS DDKAPI +(*PTDI_IND_CHAINED_RECEIVE)( + IN PVOID TdiEventContext, + IN CONNECTION_CONTEXT ConnectionContext, + IN ULONG ReceiveFlags, + IN ULONG ReceiveLength, + IN ULONG StartingOffset, + IN PMDL Tsdu, + IN PVOID TsduDescriptor); + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiDefaultChainedReceiveHandler( + IN PVOID TdiEventContext, + IN CONNECTION_CONTEXT ConnectionContext, + IN ULONG ReceiveFlags, + IN ULONG ReceiveLength, + IN ULONG StartingOffset, + IN PMDL Tsdu, + IN PVOID TsduDescriptor); + +typedef NTSTATUS DDKAPI +(*PTDI_IND_CHAINED_RECEIVE_DATAGRAM)( + IN PVOID TdiEventContext, + IN LONG SourceAddressLength, + IN PVOID SourceAddress, + IN LONG OptionsLength, + IN PVOID Options, + IN ULONG ReceiveDatagramFlags, + IN ULONG ReceiveDatagramLength, + IN ULONG StartingOffset, + IN PMDL Tsdu, + IN PVOID TsduDescriptor); + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiDefaultChainedRcvDatagramHandler( + IN PVOID TdiEventContext, + IN LONG SourceAddressLength, + IN PVOID SourceAddress, + IN LONG OptionsLength, + IN PVOID Options, + IN ULONG ReceiveDatagramFlags, + IN ULONG ReceiveDatagramLength, + IN ULONG StartingOffset, + IN PMDL Tsdu, + IN PVOID TsduDescriptor); + +typedef NTSTATUS DDKAPI +(*PTDI_IND_CHAINED_RECEIVE_EXPEDITED)( + IN PVOID TdiEventContext, + IN CONNECTION_CONTEXT ConnectionContext, + IN ULONG ReceiveFlags, + IN ULONG ReceiveLength, + IN ULONG StartingOffset, + IN PMDL Tsdu, + IN PVOID TsduDescriptor); + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiDefaultChainedRcvExpeditedHandler( + IN PVOID TdiEventContext, + IN CONNECTION_CONTEXT ConnectionContext, + IN ULONG ReceiveFlags, + IN ULONG ReceiveLength, + IN ULONG StartingOffset, + IN PMDL Tsdu, + IN PVOID TsduDescriptor); + +typedef NTSTATUS DDKAPI +(*PTDI_IND_SEND_POSSIBLE)( + IN PVOID TdiEventContext, + IN PVOID ConnectionContext, + IN ULONG BytesAvailable); + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiDefaultSendPossibleHandler( + IN PVOID TdiEventContext, + IN PVOID ConnectionContext, + IN ULONG BytesAvailable); + + + +/* Macros and functions to build IRPs */ + +#define TdiBuildBaseIrp( \ + bIrp, bDevObj, bFileObj, bCompRoutine, bContxt, bIrpSp, bMinor) \ +{ \ + bIrpSp->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL; \ + bIrpSp->MinorFunction = (bMinor); \ + bIrpSp->DeviceObject = (bDevObj); \ + bIrpSp->FileObject = (bFileObj); \ + if (bCompRoutine) \ + IoSetCompletionRoutine(bIrp, bCompRoutine, bContxt, TRUE, TRUE, TRUE) \ + else \ + IoSetCompletionRoutine(bIrp, NULL, NULL, FALSE, FALSE, FALSE); \ +} + +/* + * VOID + * TdiBuildAccept( + * IN PIRP Irp, + * IN PDEVICE_OBJECT DevObj, + * IN PFILE_OBJECT FileObj, + * IN PVOID CompRoutine, + * IN PVOID Contxt, + * IN PTDI_CONNECTION_INFORMATION RequestConnectionInfo, + * OUT PTDI_CONNECTION_INFORMATION ReturnConnectionInfo); + */ +#define TdiBuildAccept( \ + Irp, DevObj, FileObj, CompRoutine, Contxt, \ + RequestConnectionInfo, ReturnConnectionInfo) \ +{ \ + PTDI_REQUEST_KERNEL_ACCEPT _Request; \ + PIO_STACK_LOCATION _IrpSp; \ + \ + _IrpSp = IoGetNextIrpStackLocation(Irp); \ + \ + TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \ + Contxt, _IrpSp, TDI_ACCEPT); \ + \ + _Request = (PTDI_REQUEST_KERNEL_ACCEPT)&_IrpSp->Parameters; \ + _Request->RequestConnectionInformation = (RequestConnectionInfo); \ + _Request->ReturnConnectionInformation = (ReturnConnectionInfo); \ +} + +/* + * VOID + * TdiBuildAction( + * IN PIRP Irp, + * IN PDEVICE_OBJECT DevObj, + * IN PFILE_OBJECT FileObj, + * IN PVOID CompRoutine, + * IN PVOID Contxt, + * IN PMDL MdlAddr); + */ +#define TdiBuildAction( \ + Irp, DevObj, FileObj, CompRoutine, Contxt, MdlAddr) \ +{ \ + PIO_STACK_LOCATION _IrpSp; \ + \ + _IrpSp = IoGetNextIrpStackLocation(Irp); \ + \ + TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \ + Contxt, _IrpSp, TDI_ACTION); \ + \ + (Irp)->MdlAddress = (MdlAddr); \ +} + +/* + * VOID + * TdiBuildAssociateAddress( + * IN PIRP Irp, + * IN PDEVICE_OBJECT DevObj, + * IN PFILE_OBJECT FileObj, + * IN PVOID CompRoutine, + * IN PVOID Contxt, + * IN HANDLE AddrHandle); + */ +#define TdiBuildAssociateAddress( \ + Irp, DevObj, FileObj, CompRoutine, Contxt, AddrHandle) \ +{ \ + PTDI_REQUEST_KERNEL_ASSOCIATE _Request; \ + PIO_STACK_LOCATION _IrpSp; \ + \ + _IrpSp = IoGetNextIrpStackLocation(Irp); \ + \ + TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \ + Contxt, _IrpSp, TDI_ASSOCIATE_ADDRESS); \ + \ + _Request = (PTDI_REQUEST_KERNEL_ASSOCIATE)&_IrpSp->Parameters; \ + _Request->AddressHandle = (HANDLE)(AddrHandle); \ +} + +/* + * VOID + * TdiBuildConnect( + * IN PIRP Irp, + * IN PDEVICE_OBJECT DevObj, + * IN PFILE_OBJECT FileObj, + * IN PVOID CompRoutine, + * IN PVOID Contxt, + * IN PLARGE_INTEGER Time, + * IN PTDI_CONNECTION_INFORMATION RequestConnectionInfo, + * OUT PTDI_CONNECTION_INFORMATION ReturnConnectionInfo); + */ +#define TdiBuildConnect( \ + Irp, DevObj, FileObj, CompRoutine, Contxt, \ + Time, RequestConnectionInfo, ReturnConnectionInfo) \ +{ \ + PTDI_REQUEST_KERNEL _Request; \ + PIO_STACK_LOCATION _IrpSp; \ + \ + _IrpSp = IoGetNextIrpStackLocation(Irp); \ + \ + TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \ + Contxt, _IrpSp, TDI_CONNECT); \ + \ + _Request = (PTDI_REQUEST_KERNEL)&_IrpSp->Parameters; \ + _Request->RequestConnectionInformation = (RequestConnectionInfo); \ + _Request->ReturnConnectionInformation = (ReturnConnectionInfo); \ + _Request->RequestSpecific = (PVOID)(Time); \ +} + +/* + * VOID + * TdiBuildDisassociateAddress( + * IN PIRP Irp, + * IN PDEVICE_OBJECT DevObj, + * IN PFILE_OBJECT FileObj, + * IN PVOID CompRoutine, + * IN PVOID Contxt); + */ +#define TdiBuildDisassociateAddress( \ + Irp, DevObj, FileObj, CompRoutine, Contxt) \ +{ \ + PIO_STACK_LOCATION _IrpSp; \ + \ + _IrpSp = IoGetNextIrpStackLocation(Irp); \ + \ + TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \ + Contxt, _IrpSp, TDI_DISASSOCIATE_ADDRESS); \ +} + +/* + * VOID + * TdiBuildDisconnect( + * IN PIRP Irp, + * IN PDEVICE_OBJECT DevObj, + * IN PFILE_OBJECT FileObj, + * IN PVOID CompRoutine, + * IN PVOID Contxt, + * IN PLARGE_INTEGER Time, + * IN PULONG Flags, + * IN PTDI_CONNECTION_INFORMATION RequestConnectionInfo, + * OUT PTDI_CONNECTION_INFORMATION ReturnConnectionInfo); + */ +#define TdiBuildDisconnect( \ + Irp, DevObj, FileObj, CompRoutine, Contxt, Time, \ + Flags, RequestConnectionInfo, ReturnConnectionInfo) \ +{ \ + PTDI_REQUEST_KERNEL _Request; \ + PIO_STACK_LOCATION _IrpSp; \ + \ + _IrpSp = IoGetNextIrpStackLocation(Irp); \ + \ + TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \ + Contxt, _IrpSp, TDI_DISCONNECT); \ + \ + _Request = (PTDI_REQUEST_KERNEL)&_IrpSp->Parameters; \ + _Request->RequestConnectionInformation = (RequestConnectionInfo); \ + _Request->ReturnConnectionInformation = (ReturnConnectionInfo); \ + _Request->RequestSpecific = (PVOID)(Time); \ + _Request->RequestFlags = (Flags); \ +} + +/* + * PIRP + * TdiBuildInternalDeviceControlIrp( + * IN CCHAR IrpSubFunction, + * IN PDEVICE_OBJECT DeviceObject, + * IN PFILE_OBJECT FileObject, + * IN PKEVENT Event, + * IN PIO_STATUS_BLOCK IoStatusBlock); + */ +#define TdiBuildInternalDeviceControlIrp( \ + IrpSubFunction, DeviceObject, \ + FileObject, Event, IoStatusBlock) \ + IoBuildDeviceIoControlRequest( \ + 0x00000003, DeviceObject, \ + NULL, 0, NULL, 0, \ + TRUE, Event, IoStatusBlock) + +/* + * VOID + * TdiBuildListen( + * IN PIRP Irp, + * IN PDEVICE_OBJECT DevObj, + * IN PFILE_OBJECT FileObj, + * IN PVOID CompRoutine, + * IN PVOID Contxt, + * IN ULONG Flags, + * IN PTDI_CONNECTION_INFORMATION RequestConnectionInfo, + * OUT PTDI_CONNECTION_INFORMATION ReturnConnectionInfo); + */ +#define TdiBuildListen( \ + Irp, DevObj, FileObj, CompRoutine, Contxt, \ + Flags, RequestConnectionInfo, ReturnConnectionInfo) \ +{ \ + PTDI_REQUEST_KERNEL _Request; \ + PIO_STACK_LOCATION _IrpSp; \ + \ + _IrpSp = IoGetNextIrpStackLocation(Irp); \ + \ + TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \ + Contxt, _IrpSp, TDI_LISTEN); \ + \ + _Request = (PTDI_REQUEST_KERNEL)&_IrpSp->Parameters; \ + _Request->RequestConnectionInformation = (RequestConnectionInfo); \ + _Request->ReturnConnectionInformation = (ReturnConnectionInfo); \ + _Request->RequestFlags = (Flags); \ +} + +TDIKRNLAPI +VOID +DDKAPI +TdiBuildNetbiosAddress( + IN PUCHAR NetbiosName, + IN BOOLEAN IsGroupName, + IN OUT PTA_NETBIOS_ADDRESS NetworkName); + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiBuildNetbiosAddressEa( + IN PUCHAR Buffer, + IN BOOLEAN IsGroupName, + IN PUCHAR NetbiosName); + +/* + * VOID + * TdiBuildQueryInformation( + * IN PIRP Irp, + * IN PDEVICE_OBJECT DevObj, + * IN PFILE_OBJECT FileObj, + * IN PVOID CompRoutine, + * IN PVOID Contxt, + * IN UINT QType, + * IN PMDL MdlAddr); + */ +#define TdiBuildQueryInformation( \ + Irp, DevObj, FileObj, CompRoutine, Contxt, QType, MdlAddr) \ +{ \ + PTDI_REQUEST_KERNEL_QUERY_INFORMATION _Request; \ + PIO_STACK_LOCATION _IrpSp; \ + \ + _IrpSp = IoGetNextIrpStackLocation(Irp); \ + \ + TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \ + Contxt, _IrpSp, TDI_QUERY_INFORMATION); \ + \ + _Request = (PTDI_REQUEST_KERNEL_QUERY_INFORMATION)&_IrpSp->Parameters; \ + _Request->RequestConnectionInformation = NULL; \ + _Request->QueryType = (ULONG)(QType); \ + (Irp)->MdlAddress = (MdlAddr); \ +} + +/* + * VOID + * TdiBuildReceive( + * IN PIRP Irp, + * IN PDEVICE_OBJECT DevObj, + * IN PFILE_OBJECT FileObj, + * IN PVOID CompRoutine, + * IN PVOID Contxt, + * IN PMDL MdlAddr, + * IN ULONG InFlags, + * IN ULONG ReceiveLen); + */ +#define TdiBuildReceive( \ + Irp, DevObj, FileObj, CompRoutine, Contxt, \ + MdlAddr, InFlags, ReceiveLen) \ +{ \ + PTDI_REQUEST_KERNEL_RECEIVE _Request; \ + PIO_STACK_LOCATION _IrpSp; \ + \ + _IrpSp = IoGetNextIrpStackLocation(Irp); \ + \ + TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \ + Contxt, _IrpSp, TDI_RECEIVE); \ + \ + _Request = (PTDI_REQUEST_KERNEL_RECEIVE)&_IrpSp->Parameters; \ + _Request->ReceiveFlags = (InFlags); \ + _Request->ReceiveLength = (ReceiveLen); \ + (Irp)->MdlAddress = (MdlAddr); \ +} + +/* + * VOID + * TdiBuildReceiveDatagram( + * IN PIRP Irp, + * IN PDEVICE_OBJECT DevObj, + * IN PFILE_OBJECT FileObj, + * IN PVOID CompRoutine, + * IN PVOID Contxt, + * IN PMDL MdlAddr, + * IN ULONG ReceiveLen, + * IN PTDI_CONNECTION_INFORMATION ReceiveDatagramInfo, + * OUT PTDI_CONNECTION_INFORMATION ReturnInfo, + * ULONG InFlags); + */ +#define TdiBuildReceiveDatagram( \ + Irp, DevObj, FileObj, CompRoutine, Contxt, MdlAddr, \ + ReceiveLen, ReceiveDatagramInfo, ReturnInfo, InFlags) \ +{ \ + PTDI_REQUEST_KERNEL_RECEIVEDG _Request; \ + PIO_STACK_LOCATION _IrpSp; \ + \ + _IrpSp = IoGetNextIrpStackLocation(Irp); \ + \ + TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \ + Contxt, _IrpSp, TDI_RECEIVE_DATAGRAM); \ + \ + _Request = (PTDI_REQUEST_KERNEL_RECEIVEDG)&_IrpSp->Parameters; \ + _Request->ReceiveDatagramInformation = (ReceiveDatagramInfo); \ + _Request->ReturnDatagramInformation = (ReturnInfo); \ + _Request->ReceiveLength = (ReceiveLen); \ + _Request->ReceiveFlags = (InFlags); \ + (Irp)->MdlAddress = (MdlAddr); \ +} + +/* + * VOID + * TdiBuildSend( + * IN PIRP Irp, + * IN PDEVICE_OBJECT DevObj, + * IN PFILE_OBJECT FileObj, + * IN PVOID CompRoutine, + * IN PVOID Contxt, + * IN PMDL MdlAddr, + * IN ULONG InFlags, + * IN ULONG SendLen); + */ +#define TdiBuildSend( \ + Irp, DevObj, FileObj, CompRoutine, Contxt, \ + MdlAddr, InFlags, SendLen) \ +{ \ + PTDI_REQUEST_KERNEL_SEND _Request; \ + PIO_STACK_LOCATION _IrpSp; \ + \ + _IrpSp = IoGetNextIrpStackLocation(Irp); \ + \ + TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \ + Contxt, _IrpSp, TDI_SEND); \ + \ + _Request = (PTDI_REQUEST_KERNEL_SEND)&_IrpSp->Parameters; \ + _Request->SendFlags = (InFlags); \ + _Request->SendLength = (SendLen); \ + (Irp)->MdlAddress = (MdlAddr); \ +} + +/* + * VOID + * TdiBuildSendDatagram( + * IN PIRP Irp, + * IN PDEVICE_OBJECT DevObj, + * IN PFILE_OBJECT FileObj, + * IN PVOID CompRoutine, + * IN PVOID Contxt, + * IN PMDL MdlAddr, + * IN ULONG SendLen, + * IN PTDI_CONNECTION_INFORMATION SendDatagramInfo); + */ +#define TdiBuildSendDatagram( \ + Irp, DevObj, FileObj, CompRoutine, Contxt, \ + MdlAddr, SendLen, SendDatagramInfo) \ +{ \ + PTDI_REQUEST_KERNEL_SENDDG _Request; \ + PIO_STACK_LOCATION _IrpSp; \ + \ + _IrpSp = IoGetNextIrpStackLocation(Irp); \ + \ + TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \ + Contxt, _IrpSp, TDI_SEND_DATAGRAM); \ + \ + _Request = (PTDI_REQUEST_KERNEL_SENDDG)&_IrpSp->Parameters; \ + _Request->SendDatagramInformation = (SendDatagramInfo); \ + _Request->SendLength = (SendLen); \ + (Irp)->MdlAddress = (MdlAddr); \ +} + +/* + * VOID + * TdiBuildSetEventHandler( + * IN PIRP Irp, + * IN PDEVICE_OBJECT DevObj, + * IN PFILE_OBJECT FileObj, + * IN PVOID CompRoutine, + * IN PVOID Contxt, + * IN INT InEventType, + * IN PVOID InEventHandler, + * IN PVOID InEventContext); + */ +#define TdiBuildSetEventHandler( \ + Irp, DevObj, FileObj, CompRoutine, Contxt, \ + InEventType, InEventHandler, InEventContext) \ +{ \ + PTDI_REQUEST_KERNEL_SET_EVENT _Request; \ + PIO_STACK_LOCATION _IrpSp; \ + \ + _IrpSp = IoGetNextIrpStackLocation(Irp); \ + \ + TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \ + Contxt, _IrpSp, TDI_SET_EVENT_HANDLER); \ + \ + _Request = (PTDI_REQUEST_KERNEL_SET_EVENT)&_IrpSp->Parameters; \ + _Request->EventType = (InEventType); \ + _Request->EventHandler = (PVOID)(InEventHandler); \ + _Request->EventContext = (PVOID)(InEventContext); \ +} + +/* + * VOID + * TdiBuildSetInformation( + * IN PIRP Irp, + * IN PDEVICE_OBJECT DevObj, + * IN PFILE_OBJECT FileObj, + * IN PVOID CompRoutine, + * IN PVOID Contxt, + * IN UINT SType, + * IN PMDL MdlAddr); + */ +#define TdiBuildSetInformation( \ + Irp, DevObj, FileObj, CompRoutine, Contxt, SType, MdlAddr) \ +{ \ + PTDI_REQUEST_KERNEL_SET_INFORMATION _Request; \ + PIO_STACK_LOCATION _IrpSp; \ + \ + _IrpSp = IoGetNextIrpStackLocation(Irp); \ + \ + TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \ + Contxt, _IrpSp, TDI_SET_INFORMATION); \ + \ + _Request = (PTDI_REQUEST_KERNEL_SET_INFORMATION)&_IrpSp->Parameters; \ + _Request->RequestConnectionInformation = NULL; \ + _Request->SetType = (ULONG)(SType); \ + (Irp)->MdlAddress = (MdlAddr); \ +} + +/* TDI20_CLIENT_INTERFACE_INFO.TdiVersion constants */ +#define TDI_CURRENT_MAJOR_VERSION 2 +#define TDI_CURRENT_MINOR_VERSION 0 + +#define TDI_CURRENT_VERSION ((TDI_CURRENT_MINOR_VERSION) << 8 \ + | (TDI_CURRENT_MAJOR_VERSION)) + +#define TDI_VERSION_ONE 0x0001 + +typedef enum _TDI_PNP_OPCODE { + TDI_PNP_OP_MIN, + TDI_PNP_OP_ADD, + TDI_PNP_OP_DEL, + TDI_PNP_OP_UPDATE, + TDI_PNP_OP_PROVIDERREADY, + TDI_PNP_OP_NETREADY, + TDI_PNP_OP_ADD_IGNORE_BINDING, + TDI_PNP_OP_DELETE_IGNORE_BINDING, + TDI_PNP_OP_MAX +} TDI_PNP_OPCODE; + +/* TDI_PNP_CONTEXT.ContextType */ +#define TDI_PNP_CONTEXT_TYPE_IF_NAME 0x1 +#define TDI_PNP_CONTEXT_TYPE_IF_ADDR 0x2 +#define TDI_PNP_CONTEXT_TYPE_PDO 0x3 +#define TDI_PNP_CONTEXT_TYPE_FIRST_OR_LAST_IF 0x4 + +typedef struct _TDI_PNP_CONTEXT { + USHORT ContextSize; + USHORT ContextType; + UCHAR ContextData[1]; +} TDI_PNP_CONTEXT, *PTDI_PNP_CONTEXT; + +typedef VOID DDKAPI +(*TDI_ADD_ADDRESS_HANDLER)( + IN PTA_ADDRESS Address); + +typedef VOID DDKAPI +(*TDI_ADD_ADDRESS_HANDLER_V2)( + IN PTA_ADDRESS Address, + IN PUNICODE_STRING DeviceName, + IN PTDI_PNP_CONTEXT Context); + +typedef VOID DDKAPI +(*TDI_BINDING_HANDLER)( + IN TDI_PNP_OPCODE PnPOpcode, + IN PUNICODE_STRING DeviceName, + IN PWSTR MultiSZBindList); + +typedef VOID DDKAPI +(*TDI_BIND_HANDLER)( + IN PUNICODE_STRING DeviceName); + +typedef VOID DDKAPI +(*TDI_DEL_ADDRESS_HANDLER)( + IN PTA_ADDRESS Address); + +typedef VOID DDKAPI +(*TDI_DEL_ADDRESS_HANDLER_V2)( + IN PTA_ADDRESS Address, + IN PUNICODE_STRING DeviceName, + IN PTDI_PNP_CONTEXT Context); + +typedef NTSTATUS DDKAPI +(*TDI_PNP_POWER_HANDLER)( + IN PUNICODE_STRING DeviceName, + IN PNET_PNP_EVENT PowerEvent, + IN PTDI_PNP_CONTEXT Context1, + IN PTDI_PNP_CONTEXT Context2); + +typedef VOID DDKAPI +(*TDI_UNBIND_HANDLER)( + IN PUNICODE_STRING DeviceName); + +typedef VOID DDKAPI +(*ProviderPnPPowerComplete)( + IN PNET_PNP_EVENT NetEvent, + IN NTSTATUS ProviderStatus); + +typedef struct _TDI20_CLIENT_INTERFACE_INFO { + _ANONYMOUS_UNION union { + _ANONYMOUS_STRUCT struct { + UCHAR MajorTdiVersion; + UCHAR MinorTdiVersion; + } DUMMYSTRUCTNAME; + USHORT TdiVersion; + } DUMMYUNIONNAME; + USHORT Unused; + PUNICODE_STRING ClientName; + TDI_PNP_POWER_HANDLER PnPPowerHandler; + _ANONYMOUS_UNION union { + TDI_BINDING_HANDLER BindingHandler; + _ANONYMOUS_STRUCT struct { + TDI_BIND_HANDLER BindHandler; + TDI_UNBIND_HANDLER UnBindHandler; + } DUMMYSTRUCTNAME; + }DUMMYUNIONNAME2; + _ANONYMOUS_UNION union { + _ANONYMOUS_STRUCT struct { + TDI_ADD_ADDRESS_HANDLER_V2 AddAddressHandlerV2; + TDI_DEL_ADDRESS_HANDLER_V2 DelAddressHandlerV2; + } DUMMYSTRUCTNAME; + _ANONYMOUS_STRUCT struct { + TDI_ADD_ADDRESS_HANDLER AddAddressHandler; + TDI_DEL_ADDRESS_HANDLER DelAddressHandler; + } DUMMYSTRUCTNAME2; + } DUMMYUNIONNAME3; +} TDI20_CLIENT_INTERFACE_INFO, *PTDI20_CLIENT_INTERFACE_INFO; + +typedef TDI20_CLIENT_INTERFACE_INFO TDI_CLIENT_INTERFACE_INFO; +typedef TDI_CLIENT_INTERFACE_INFO *PTDI_CLIENT_INTERFACE_INFO; + + +/* TDI functions */ + +/* + * VOID + * TdiCompleteRequest( + * IN PIRP Irp, + * IN NTSTATUS Status); + */ +#define TdiCompleteRequest(Irp, Status) \ +{ \ + (Irp)->IoStatus.Status = (Status); \ + IoCompleteRequest((Irp), IO_NETWORK_INCREMENT); \ +} + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiCopyBufferToMdl( + IN PVOID SourceBuffer, + IN ULONG SourceOffset, + IN ULONG SourceBytesToCopy, + IN PMDL DestinationMdlChain, + IN ULONG DestinationOffset, + IN PULONG BytesCopied); + +/* + * VOID + * TdiCopyLookaheadData( + * IN PVOID Destination, + * IN PVOID Source, + * IN ULONG Length, + * IN ULONG ReceiveFlags); + */ +#define TdiCopyLookaheadData(Destination, Source, Length, ReceiveFlags) \ + RtlCopyMemory(Destination, Source, Length) + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiCopyMdlChainToMdlChain ( + IN PMDL SourceMdlChain, + IN ULONG SourceOffset, + IN PMDL DestinationMdlChain, + IN ULONG DestinationOffset, + OUT PULONG BytesCopied); + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiCopyMdlToBuffer( + IN PMDL SourceMdlChain, + IN ULONG SourceOffset, + IN PVOID DestinationBuffer, + IN ULONG DestinationOffset, + IN ULONG DestinationBufferSize, + OUT PULONG BytesCopied); + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiDeregisterAddressChangeHandler( + IN HANDLE BindingHandle); + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiDeregisterDeviceObject( + IN HANDLE DevRegistrationHandle); + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiDeregisterNetAddress( + IN HANDLE AddrRegistrationHandle); + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiDeregisterPnPHandlers( + IN HANDLE BindingHandle); + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiDeregisterProvider( + IN HANDLE ProviderHandle); + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiEnumerateAddresses( + IN HANDLE BindingHandle); + +TDIKRNLAPI +VOID +DDKAPI +TdiInitialize( + VOID); + +TDIKRNLAPI +VOID +DDKAPI +TdiMapBuffer( + IN PMDL MdlChain); + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiMapUserRequest( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp, + IN PIO_STACK_LOCATION IrpSp); + +TDIKRNLAPI +BOOLEAN +DDKAPI +TdiMatchPdoWithChainedReceiveContext( + IN PVOID TsduDescriptor, + IN PVOID PDO); + +TDIKRNLAPI +VOID +DDKAPI +TdiPnPPowerComplete( + IN HANDLE BindingHandle, + IN PNET_PNP_EVENT PowerEvent, + IN NTSTATUS Status); + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiPnPPowerRequest( + IN PUNICODE_STRING DeviceName, + IN PNET_PNP_EVENT PowerEvent, + IN PTDI_PNP_CONTEXT Context1, + IN PTDI_PNP_CONTEXT Context2, + IN ProviderPnPPowerComplete ProtocolCompletionHandler); + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiProviderReady( + IN HANDLE ProviderHandle); + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiRegisterAddressChangeHandler( + IN TDI_ADD_ADDRESS_HANDLER AddHandler, + IN TDI_DEL_ADDRESS_HANDLER DeleteHandler, + OUT HANDLE *BindingHandle); + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiRegisterDeviceObject( + IN PUNICODE_STRING DeviceName, + OUT HANDLE *DevRegistrationHandle); + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiRegisterNetAddress( + IN PTA_ADDRESS Address, + IN PUNICODE_STRING DeviceName, + IN PTDI_PNP_CONTEXT Context, + OUT HANDLE *AddrRegistrationHandle); + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiRegisterNotificationHandler( + IN TDI_BIND_HANDLER BindHandler, + IN TDI_UNBIND_HANDLER UnbindHandler, + OUT HANDLE *BindingHandle); + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiRegisterPnPHandlers( + IN PTDI_CLIENT_INTERFACE_INFO ClientInterfaceInfo, + IN ULONG InterfaceInfoSize, + OUT HANDLE *BindingHandle); + +TDIKRNLAPI +NTSTATUS +DDKAPI +TdiRegisterProvider( + IN PUNICODE_STRING ProviderName, + OUT HANDLE *ProviderHandle); + +TDIKRNLAPI +VOID +DDKAPI +TdiReturnChainedReceives( + IN PVOID *TsduDescriptors, + IN ULONG NumberOfTsdus); + +TDIKRNLAPI +VOID +DDKAPI +TdiUnmapBuffer( + IN PMDL MdlChain); + +#ifdef __cplusplus +} +#endif + +#endif /* __TDIKRNL_H */ diff --git a/reactos/include/ddk/tdistat.h b/reactos/include/ddk/tdistat.h new file mode 100644 index 00000000000..f0588d2579a --- /dev/null +++ b/reactos/include/ddk/tdistat.h @@ -0,0 +1,83 @@ +/* + * tdistat.h + * + * TDI status codes + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __TDISTAT_H +#define __TDISTAT_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define TDI_SUCCESS STATUS_SUCCESS +#define TDI_NO_RESOURCES STATUS_INSUFFICIENT_RESOURCES +#define TDI_ADDR_IN_USE STATUS_ADDRESS_ALREADY_EXISTS +#define TDI_BAD_ADDR STATUS_INVALID_ADDRESS_COMPONENT +#define TDI_NO_FREE_ADDR STATUS_TOO_MANY_ADDRESSES +#define TDI_ADDR_INVALID STATUS_INVALID_ADDRESS +#define TDI_ADDR_DELETED STATUS_ADDRESS_CLOSED +#define TDI_BUFFER_OVERFLOW STATUS_BUFFER_OVERFLOW +#define TDI_BAD_EVENT_TYPE STATUS_INVALID_PARAMETER +#define TDI_BAD_OPTION STATUS_INVALID_PARAMETER +#define TDI_CONN_REFUSED STATUS_CONNECTION_REFUSED +#define TDI_INVALID_CONNECTION STATUS_CONNECTION_INVALID +#define TDI_ALREADY_ASSOCIATED STATUS_ADDRESS_ALREADY_ASSOCIATED +#define TDI_NOT_ASSOCIATED STATUS_ADDRESS_NOT_ASSOCIATED +#define TDI_CONNECTION_ACTIVE STATUS_CONNECTION_ACTIVE +#define TDI_CONNECTION_ABORTED STATUS_CONNECTION_ABORTED +#define TDI_CONNECTION_RESET STATUS_CONNECTION_RESET +#define TDI_TIMED_OUT STATUS_IO_TIMEOUT +#define TDI_GRACEFUL_DISC STATUS_GRACEFUL_DISCONNECT +#define TDI_NOT_ACCEPTED STATUS_DATA_NOT_ACCEPTED +#define TDI_MORE_PROCESSING STATUS_MORE_PROCESSING_REQUIRED +#define TDI_INVALID_STATE STATUS_INVALID_DEVICE_STATE +#define TDI_INVALID_PARAMETER STATUS_INVALID_PARAMETER +#define TDI_DEST_NET_UNREACH STATUS_NETWORK_UNREACHABLE +#define TDI_DEST_HOST_UNREACH STATUS_HOST_UNREACHABLE +#define TDI_DEST_UNREACHABLE TDI_DEST_HOST_UNREACH +#define TDI_DEST_PROT_UNREACH STATUS_PROTOCOL_UNREACHABLE +#define TDI_DEST_PORT_UNREACH STATUS_PORT_UNREACHABLE +#define TDI_INVALID_QUERY STATUS_INVALID_DEVICE_REQUEST +#define TDI_REQ_ABORTED STATUS_REQUEST_ABORTED +#define TDI_BUFFER_TOO_SMALL STATUS_BUFFER_TOO_SMALL +#define TDI_CANCELLED STATUS_CANCELLED +#define TDI_BUFFER_TOO_BIG STATUS_INVALID_BUFFER_SIZE +#define TDI_INVALID_REQUEST STATUS_INVALID_DEVICE_REQUEST +#define TDI_PENDING STATUS_PENDING +#define TDI_ITEM_NOT_FOUND STATUS_OBJECT_NAME_NOT_FOUND + +#define TDI_STATUS_BAD_VERSION 0xC0010004L +#define TDI_STATUS_BAD_CHARACTERISTICS 0xC0010005L + +#define TDI_OPTION_EOL 0 + +#define TDI_ADDRESS_OPTION_REUSE 1 +#define TDI_ADDRESS_OPTION_DHCP 2 + +#ifdef __cplusplus +} +#endif + +#endif /* __TDISTAT_H */ diff --git a/reactos/include/ddk/tvout.h b/reactos/include/ddk/tvout.h new file mode 100644 index 00000000000..d7a73d01b07 --- /dev/null +++ b/reactos/include/ddk/tvout.h @@ -0,0 +1,114 @@ +/* + * tvout.h + * + * Definitions for TV-out support + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __TVOUT_H +#define __TVOUT_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* VIDEOPARAMETERS.dwCommand constants */ +#define VP_COMMAND_GET 0x00000001 +#define VP_COMMAND_SET 0x00000002 + +/* VIDEOPARAMETERS.dwFlags constants */ +#define VP_FLAGS_TV_MODE 0x00000001 +#define VP_FLAGS_TV_STANDARD 0x00000002 +#define VP_FLAGS_FLICKER 0x00000004 +#define VP_FLAGS_OVERSCAN 0x00000008 +#define VP_FLAGS_MAX_UNSCALED 0x00000010 +#define VP_FLAGS_POSITION 0x00000020 +#define VP_FLAGS_BRIGHTNESS 0x00000040 +#define VP_FLAGS_CONTRAST 0x00000080 +#define VP_FLAGS_COPYPROTECT 0x00000100 + +/* VIDEOPARAMETERS.dwMode constants */ +#define VP_MODE_WIN_GRAPHICS 0x00000001 +#define VP_MODE_TV_PLAYBACK 0x00000002 + +/* VIDEOPARAMETERS.dwTVStandard/dwAvailableTVStandard constants */ +#define VP_TV_STANDARD_NTSC_M 0x00000001 +#define VP_TV_STANDARD_NTSC_M_J 0x00000002 +#define VP_TV_STANDARD_PAL_B 0x00000004 +#define VP_TV_STANDARD_PAL_D 0x00000008 +#define VP_TV_STANDARD_PAL_H 0x00000010 +#define VP_TV_STANDARD_PAL_I 0x00000020 +#define VP_TV_STANDARD_PAL_M 0x00000040 +#define VP_TV_STANDARD_PAL_N 0x00000080 +#define VP_TV_STANDARD_SECAM_B 0x00000100 +#define VP_TV_STANDARD_SECAM_D 0x00000200 +#define VP_TV_STANDARD_SECAM_G 0x00000400 +#define VP_TV_STANDARD_SECAM_H 0x00000800 +#define VP_TV_STANDARD_SECAM_K 0x00001000 +#define VP_TV_STANDARD_SECAM_K1 0x00002000 +#define VP_TV_STANDARD_SECAM_L 0x00004000 +#define VP_TV_STANDARD_WIN_VGA 0x00008000 +#define VP_TV_STANDARD_NTSC_433 0x00010000 +#define VP_TV_STANDARD_PAL_G 0x00020000 +#define VP_TV_STANDARD_PAL_60 0x00040000 +#define VP_TV_STANDARD_SECAM_L1 0x00080000 + +/* VIDEOPARAMETERS.dwMode constants */ +#define VP_CP_TYPE_APS_TRIGGER 0x00000001 +#define VP_CP_TYPE_MACROVISION 0x00000002 + +/* VIDEOPARAMETERS.dwCPCommand constants */ +#define VP_CP_CMD_ACTIVATE 0x00000001 +#define VP_CP_CMD_DEACTIVATE 0x00000002 +#define VP_CP_CMD_CHANGE 0x00000004 + +typedef struct _VIDEOPARAMETERS { + GUID Guid; + DWORD dwOffset; + DWORD dwCommand; + DWORD dwFlags; + DWORD dwMode; + DWORD dwTVStandard; + DWORD dwAvailableModes; + DWORD dwAvailableTVStandard; + DWORD dwFlickerFilter; + DWORD dwOverScanX; + DWORD dwOverScanY; + DWORD dwMaxUnscaledX; + DWORD dwMaxUnscaledY; + DWORD dwPositionX; + DWORD dwPositionY; + DWORD dwBrightness; + DWORD dwContrast; + DWORD dwCPType; + DWORD dwCPCommand; + DWORD dwCPStandard; + DWORD dwCPKey; + BYTE bCP_APSTriggerBits; + BYTE bOEMCopyProtection[256]; +} VIDEOPARAMETERS, *PVIDEOPARAMETERS, FAR *LPVIDEOPARAMETERS; + +#ifdef __cplusplus +} +#endif + +#endif /* __TVOUT_H */ diff --git a/reactos/include/ddk/upssvc.h b/reactos/include/ddk/upssvc.h new file mode 100644 index 00000000000..ca11f31bf04 --- /dev/null +++ b/reactos/include/ddk/upssvc.h @@ -0,0 +1,92 @@ +/* + * upssvc.h + * + * UPS service interface + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __UPSSVC_H +#define __UPSSVC_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(_APCUPS_) + #define UPSAPI DECLSPEC_EXPORT +#else + #define UPSAPI DECLSPEC_IMPORT +#endif + + +#define UPS_ONLINE 1 +#define UPS_ONBATTERY 2 +#define UPS_LOWBATTERY 4 +#define UPS_NOCOMM 8 +#define UPS_CRITICAL 16 + +UPSAPI +VOID +DDKAPI +UPSCancelWait(VOID); + +UPSAPI +DWORD +DDKAPI +UPSGetState(VOID); + +#define UPS_INITUNKNOWNERROR 0 +#define UPS_INITOK 1 +#define UPS_INITNOSUCHDRIVER 2 +#define UPS_INITBADINTERFACE 3 +#define UPS_INITREGISTRYERROR 4 +#define UPS_INITCOMMOPENERROR 5 +#define UPS_INITCOMMSETUPERROR 6 + +UPSAPI +DWORD +DDKAPI +UPSInit(VOID); + +UPSAPI +VOID +DDKAPI +UPSStop(VOID); + +UPSAPI +VOID +DDKAPI +UPSTurnOff( + IN DWORD aTurnOffDelay); + +UPSAPI +VOID +DDKAPI +UPSWaitForStateChange( + IN DWORD aCurrentState, + IN DWORD anInterval); + +#ifdef __cplusplus +} +#endif + +#endif /* __UPSSVC_H */ diff --git a/reactos/include/ddk/usb.h b/reactos/include/ddk/usb.h new file mode 100644 index 00000000000..1a0a0d8af81 --- /dev/null +++ b/reactos/include/ddk/usb.h @@ -0,0 +1,470 @@ +/* + * usb.h + * + * USB support. + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __USB_H +#define __USB_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __USBDI_H +#error usbdi.h cannot be included with usb.h +#else + +#include "usb100.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef LONG USBD_STATUS; +typedef PVOID USBD_PIPE_HANDLE; +typedef PVOID USBD_CONFIGURATION_HANDLE; +typedef PVOID USBD_INTERFACE_HANDLE; + +#define USBD_STATUS_SUCCESS ((USBD_STATUS)0x00000000L) +#define USBD_STATUS_PENDING ((USBD_STATUS)0x40000000L) +#define USBD_STATUS_CRC ((USBD_STATUS)0xC0000001L) +#define USBD_STATUS_BTSTUFF ((USBD_STATUS)0xC0000002L) +#define USBD_STATUS_DATA_TOGGLE_MISMATCH ((USBD_STATUS)0xC0000003L) +#define USBD_STATUS_STALL_PID ((USBD_STATUS)0xC0000004L) +#define USBD_STATUS_DEV_NOT_RESPONDING ((USBD_STATUS)0xC0000005L) +#define USBD_STATUS_PID_CHECK_FAILURE ((USBD_STATUS)0xC0000006L) +#define USBD_STATUS_UNEXPECTED_PID ((USBD_STATUS)0xC0000007L) +#define USBD_STATUS_DATA_OVERRUN ((USBD_STATUS)0xC0000008L) +#define USBD_STATUS_DATA_UNDERRUN ((USBD_STATUS)0xC0000009L) +#define USBD_STATUS_RESERVED1 ((USBD_STATUS)0xC000000AL) +#define USBD_STATUS_RESERVED2 ((USBD_STATUS)0xC000000BL) +#define USBD_STATUS_BUFFER_OVERRUN ((USBD_STATUS)0xC000000CL) +#define USBD_STATUS_BUFFER_UNDERRUN ((USBD_STATUS)0xC000000DL) +#define USBD_STATUS_NOT_ACCESSED ((USBD_STATUS)0xC000000FL) +#define USBD_STATUS_FIFO ((USBD_STATUS)0xC0000010L) +#define USBD_STATUS_XACT_ERROR ((USBD_STATUS)0xC0000011L) +#define USBD_STATUS_BABBLE_DETECTED ((USBD_STATUS)0xC0000012L) +#define USBD_STATUS_DATA_BUFFER_ERROR ((USBD_STATUS)0xC0000013L) +#define USBD_STATUS_ENDPOINT_HALTED ((USBD_STATUS)0xC0000030L) +#define USBD_STATUS_INVALID_URB_FUNCTION ((USBD_STATUS)0x80000200L) +#define USBD_STATUS_INVALID_PARAMETER ((USBD_STATUS)0x80000300L) +#define USBD_STATUS_ERROR_BUSY ((USBD_STATUS)0x80000400L) +#define USBD_STATUS_INVALID_PIPE_HANDLE ((USBD_STATUS)0x80000600L) +#define USBD_STATUS_NO_BANDWIDTH ((USBD_STATUS)0x80000700L) +#define USBD_STATUS_INTERNAL_HC_ERROR ((USBD_STATUS)0x80000800L) +#define USBD_STATUS_ERROR_SHORT_TRANSFER ((USBD_STATUS)0x80000900L) +#define USBD_STATUS_BAD_START_FRAME ((USBD_STATUS)0xC0000A00L) +#define USBD_STATUS_ISOCH_REQUEST_FAILED ((USBD_STATUS)0xC0000B00L) +#define USBD_STATUS_FRAME_CONTROL_OWNED ((USBD_STATUS)0xC0000C00L) +#define USBD_STATUS_FRAME_CONTROL_NOT_OWNED \ + ((USBD_STATUS)0xC0000D00L) +#define USBD_STATUS_NOT_SUPPORTED ((USBD_STATUS)0xC0000E00L) +#define USBD_STATUS_INAVLID_CONFIGURATION_DESCRIPTOR \ + ((USBD_STATUS)0xC0000F00L) +#define USBD_STATUS_INSUFFICIENT_RESOURCES \ + ((USBD_STATUS)0xC0001000L) +#define USBD_STATUS_SET_CONFIG_FAILED ((USBD_STATUS)0xC0002000L) +#define USBD_STATUS_BUFFER_TOO_SMALL ((USBD_STATUS)0xC0003000L) +#define USBD_STATUS_INTERFACE_NOT_FOUND ((USBD_STATUS)0xC0004000L) +#define USBD_STATUS_INAVLID_PIPE_FLAGS ((USBD_STATUS)0xC0005000L) +#define USBD_STATUS_TIMEOUT ((USBD_STATUS)0xC0006000L) +#define USBD_STATUS_DEVICE_GONE ((USBD_STATUS)0xC0007000L) +#define USBD_STATUS_STATUS_NOT_MAPPED ((USBD_STATUS)0xC0008000L) +#define USBD_STATUS_CANCELED ((USBD_STATUS)0xC0010000L) +#define USBD_STATUS_ISO_NOT_ACCESSED_BY_HW \ + ((USBD_STATUS)0xC0020000L) +#define USBD_STATUS_ISO_TD_ERROR ((USBD_STATUS)0xC0030000L) +#define USBD_STATUS_ISO_NA_LATE_USBPORT ((USBD_STATUS)0xC0040000L) +#define USBD_STATUS_ISO_NOT_ACCESSED_LATE ((USBD_STATUS)0xC0050000L) + +#define USBD_SUCCESS(Status) ((USBD_STATUS)(Status) >= 0) +#define USBD_PENDING(Status) ((ULONG)(Status) >> 30 == 1) +#define USBD_ERROR(Status) ((USBD_STATUS)(Status) < 0) + +/* URB TransferFlags constants */ +#define USBD_TRANSFER_DIRECTION(x) ((x) & USBD_TRANSFER_DIRECTION_IN) +#define USBD_TRANSFER_DIRECTION_OUT 0 +#define USBD_TRANSFER_DIRECTION_BIT 0 +#define USBD_TRANSFER_DIRECTION_IN (1 << USBD_TRANSFER_DIRECTION_BIT) +#define USBD_SHORT_TRANSFER_OK_BIT 1 +#define USBD_SHORT_TRANSFER_OK (1 << USBD_SHORT_TRANSFER_OK_BIT) +#define USBD_START_ISO_TRANSFER_ASAP_BIT 2 +#define USBD_START_ISO_TRANSFER_ASAP (1 << USBD_START_ISO_TRANSFER_ASAP_BIT) +#define USBD_DEFAULT_PIPE_TRANSFER_BIT 3 +#define USBD_DEFAULT_PIPE_TRANSFER (1 << USBD_DEFAULT_PIPE_TRANSFER_BIT) + +#define USBD_TRANSFER_DIRECTION_FLAG(flags) ((flags) & USBD_TRANSFER_DIRECTION) + +#define VALID_TRANSFER_FLAGS_MASK \ + (USBD_SHORT_TRANSFER_OK | \ + USBD_TRANSFER_DIRECTION | \ + USBD_START_ISO_TRANSFER_ASAP | \ + USBD_DEFAULT_PIPE_TRANSFER) + +#define USB_DEFAULT_DEVICE_ADDRESS 0 +#define USB_DEFAULT_ENDPOINT_ADDRESS 0 +#define USB_DEFAULT_MAX_PACKET 64 +#define USBD_ISO_START_FRAME_RANGE 1024 +#define USBD_DEFAULT_MAXIMUM_TRANSFER_SIZE 0xFFFFFFFF + +typedef enum _USB_CONTROLLER_FLAVOR { + USB_HcGeneric = 0, + OHCI_Generic = 100, + OHCI_Hydra, + OHCI_NEC, + UHCI_Generic = 200, + UHCI_Piix4, + UHCI_Piix3, + UHCI_Ich2_1, + UHCI_Ich2_2, + UHCI_Ich1, + UHCI_VIA = 250, + EHCI_Generic = 1000, + EHCI_NEC = 2000, + EHCI_Lucent = 3000 +} USB_CONTROLLER_FLAVOR; + +struct _URB_HEADER { + USHORT Length; + USHORT Function; + USBD_STATUS Status; + PVOID UsbdDeviceHandle; + ULONG UsbdFlags; +}; + +typedef struct _USBD_VERSION_INFORMATION { + ULONG USBDI_Version; + ULONG Supported_USB_Version; +} USBD_VERSION_INFORMATION, *PUSBD_VERSION_INFORMATION; + +struct _URB_HCD_AREA { + PVOID Reserved8[8]; +}; + +struct _URB_BULK_OR_INTERRUPT_TRANSFER { + struct _URB_HEADER Hdr; + USBD_PIPE_HANDLE PipeHandle; + ULONG TransferFlags; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; +}; + +struct _URB_CONTROL_DESCRIPTOR_REQUEST { + struct _URB_HEADER Hdr; + PVOID Reserved; + ULONG Reserved0; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + USHORT Reserved1; + UCHAR Index; + UCHAR DescriptorType; + USHORT LanguageId; + USHORT Reserved2; +}; + +struct _URB_CONTROL_FEATURE_REQUEST { + struct _URB_HEADER Hdr; + PVOID Reserved; + ULONG Reserved2; + ULONG Reserved3; + PVOID Reserved4; + PMDL Reserved5; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + USHORT Reserved0; + USHORT FeatureSelector; + USHORT Index; + USHORT Reserved1; +}; + +struct _URB_CONTROL_GET_CONFIGURATION_REQUEST { + struct _URB_HEADER Hdr; + PVOID Reserved; + ULONG Reserved0; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + UCHAR Reserved1[8]; +}; + +struct _URB_CONTROL_GET_INTERFACE_REQUEST { + struct _URB_HEADER Hdr; + PVOID Reserved; + ULONG Reserved0; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + UCHAR Reserved1[4]; + USHORT Interface; + USHORT Reserved2; +}; + +struct _URB_CONTROL_GET_STATUS_REQUEST { + struct _URB_HEADER Hdr; + PVOID Reserved; + ULONG Reserved0; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + UCHAR Reserved1[4]; + USHORT Index; + USHORT Reserved2; +}; + +struct _URB_CONTROL_TRANSFER { + struct _URB_HEADER Hdr; + USBD_PIPE_HANDLE PipeHandle; + ULONG TransferFlags; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + UCHAR SetupPacket[8]; +}; + +struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST { + struct _URB_HEADER Hdr; + PVOID Reserved; + ULONG TransferFlags; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + UCHAR RequestTypeReservedBits; + UCHAR Request; + USHORT Value; + USHORT Index; + USHORT Reserved1; +}; + +struct _URB_FRAME_LENGTH_CONTROL { + struct _URB_HEADER Hdr; +}; + +struct _URB_GET_CURRENT_FRAME_NUMBER { + struct _URB_HEADER Hdr; + ULONG FrameNumber; +}; + +struct _URB_GET_FRAME_LENGTH { + struct _URB_HEADER Hdr; + ULONG FrameLength; + ULONG FrameNumber; +}; + +typedef struct _USBD_ISO_PACKET_DESCRIPTOR { + ULONG Offset; + ULONG Length; + USBD_STATUS Status; +} USBD_ISO_PACKET_DESCRIPTOR, *PUSBD_ISO_PACKET_DESCRIPTOR; + +struct _URB_ISOCH_TRANSFER { + struct _URB_HEADER Hdr; + USBD_PIPE_HANDLE PipeHandle; + ULONG TransferFlags; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + ULONG StartFrame; + ULONG NumberOfPackets; + ULONG ErrorCount; + USBD_ISO_PACKET_DESCRIPTOR IsoPacket[1]; +}; + +typedef enum _USBD_PIPE_TYPE { + UsbdPipeTypeControl, + UsbdPipeTypeIsochronous, + UsbdPipeTypeBulk, + UsbdPipeTypeInterrupt +} USBD_PIPE_TYPE; + +typedef struct _USBD_PIPE_INFORMATION { + USHORT MaximumPacketSize; + UCHAR EndpointAddress; + UCHAR Interval; + USBD_PIPE_TYPE PipeType; + USBD_PIPE_HANDLE PipeHandle; + ULONG MaximumTransferSize; + ULONG PipeFlags; +} USBD_PIPE_INFORMATION, *PUSBD_PIPE_INFORMATION ; + +#define USBD_PIPE_DIRECTION_IN(pipeInformation) \ + ((pipeInformation)->EndpointAddress & USB_ENDPOINT_DIRECTION_MASK) + +typedef struct _USBD_INTERFACE_INFORMATION { + USHORT Length; + UCHAR InterfaceNumber; + UCHAR AlternateSetting; + UCHAR Class; + UCHAR SubClass; + UCHAR Protocol; + UCHAR Reserved; + USBD_INTERFACE_HANDLE InterfaceHandle; + ULONG NumberOfPipes; + USBD_PIPE_INFORMATION Pipes[1]; +} USBD_INTERFACE_INFORMATION, *PUSBD_INTERFACE_INFORMATION; + +struct _URB_SELECT_INTERFACE { + struct _URB_HEADER Hdr; + USBD_CONFIGURATION_HANDLE ConfigurationHandle; + USBD_INTERFACE_INFORMATION Interface; +}; + +struct _URB_SELECT_CONFIGURATION { + struct _URB_HEADER Hdr; + PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor; + USBD_CONFIGURATION_HANDLE ConfigurationHandle; + USBD_INTERFACE_INFORMATION Interface; +}; + +struct _URB_PIPE_REQUEST { + struct _URB_HEADER Hdr; + USBD_PIPE_HANDLE PipeHandle; + ULONG Reserved; +}; + +struct _URB_SET_FRAME_LENGTH { + struct _URB_HEADER Hdr; + LONG FrameLengthDelta; +}; + +typedef struct _URB { + _ANONYMOUS_UNION union { + struct _URB_HEADER UrbHeader; + struct _URB_SELECT_INTERFACE UrbSelectInterface; + struct _URB_SELECT_CONFIGURATION UrbSelectConfiguration; + struct _URB_PIPE_REQUEST UrbPipeRequest; + struct _URB_FRAME_LENGTH_CONTROL UrbFrameLengthControl; + struct _URB_GET_FRAME_LENGTH UrbGetFrameLength; + struct _URB_SET_FRAME_LENGTH UrbSetFrameLength; + struct _URB_GET_CURRENT_FRAME_NUMBER UrbGetCurrentFrameNumber; + struct _URB_CONTROL_TRANSFER UrbControlTransfer; + struct _URB_BULK_OR_INTERRUPT_TRANSFER UrbBulkOrInterruptTransfer; + struct _URB_ISOCH_TRANSFER UrbIsochronousTransfer; + struct _URB_CONTROL_DESCRIPTOR_REQUEST UrbControlDescriptorRequest; + struct _URB_CONTROL_GET_STATUS_REQUEST UrbControlGetStatusRequest; + struct _URB_CONTROL_FEATURE_REQUEST UrbControlFeatureRequest; + struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST UrbControlVendorClassRequest; + struct _URB_CONTROL_GET_INTERFACE_REQUEST UrbControlGetInterfaceRequest; + struct _URB_CONTROL_GET_CONFIGURATION_REQUEST UrbControlGetConfigurationRequest; + } DUMMYUNIONNAME; +} URB, *PURB; + +#define URB_FROM_IRP(Irp) ((IoGetCurrentIrpStackLocation(Irp))->Parameters.Others.Argument1) + +#define URB_FUNCTION_SELECT_CONFIGURATION 0x0000 +#define URB_FUNCTION_SELECT_INTERFACE 0x0001 +#define URB_FUNCTION_ABORT_PIPE 0x0002 +#define URB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL 0x0003 +#define URB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL 0x0004 +#define URB_FUNCTION_GET_FRAME_LENGTH 0x0005 +#define URB_FUNCTION_SET_FRAME_LENGTH 0x0006 +#define URB_FUNCTION_GET_CURRENT_FRAME_NUMBER 0x0007 +#define URB_FUNCTION_CONTROL_TRANSFER 0x0008 +#define URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER 0x0009 +#define URB_FUNCTION_ISOCH_TRANSFER 0x000A +#define URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE 0x000B +#define URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE 0x000C +#define URB_FUNCTION_SET_FEATURE_TO_DEVICE 0x000D +#define URB_FUNCTION_SET_FEATURE_TO_INTERFACE 0x000E +#define URB_FUNCTION_SET_FEATURE_TO_ENDPOINT 0x000F +#define URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE 0x0010 +#define URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE 0x0011 +#define URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT 0x0012 +#define URB_FUNCTION_GET_STATUS_FROM_DEVICE 0x0013 +#define URB_FUNCTION_GET_STATUS_FROM_INTERFACE 0x0014 +#define URB_FUNCTION_GET_STATUS_FROM_ENDPOINT 0x0015 +#define URB_FUNCTION_RESERVED_0X0016 0x0016 +#define URB_FUNCTION_VENDOR_DEVICE 0x0017 +#define URB_FUNCTION_VENDOR_INTERFACE 0x0018 +#define URB_FUNCTION_VENDOR_ENDPOINT 0x0019 +#define URB_FUNCTION_CLASS_DEVICE 0x001A +#define URB_FUNCTION_CLASS_INTERFACE 0x001B +#define URB_FUNCTION_CLASS_ENDPOINT 0x001C +#define URB_FUNCTION_RESERVE_0X001D 0x001D +#define URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL 0x001E +#define URB_FUNCTION_CLASS_OTHER 0x001F +#define URB_FUNCTION_VENDOR_OTHER 0x0020 +#define URB_FUNCTION_GET_STATUS_FROM_OTHER 0x0021 +#define URB_FUNCTION_CLEAR_FEATURE_TO_OTHER 0x0022 +#define URB_FUNCTION_SET_FEATURE_TO_OTHER 0x0023 +#define URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT 0x0024 +#define URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT 0x0025 +#define URB_FUNCTION_GET_CONFIGURATION 0x0026 +#define URB_FUNCTION_GET_INTERFACE 0x0027 +#define URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE 0x0028 +#define URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE 0x0029 +#define URB_FUNCTION_GET_MS_FEATURE_DESCRIPTOR 0x002A +#define URB_FUNCTION_RESERVE_0X002B 0x002B +#define URB_FUNCTION_RESERVE_0X002C 0x002C +#define URB_FUNCTION_RESERVE_0X002D 0x002D +#define URB_FUNCTION_RESERVE_0X002E 0x002E +#define URB_FUNCTION_RESERVE_0X002F 0x002F +#define URB_FUNCTION_SYNC_RESET_PIPE 0x0030 +#define URB_FUNCTION_SYNC_CLEAR_STALL 0x0031 + +#define USBD_PF_CHANGE_MAX_PACKET 0x00000001 +#define USBD_PF_SHORT_PACKET_OPT 0x00000002 +#define USBD_PF_ENABLE_RT_THREAD_ACCESS 0x00000004 +#define USBD_PF_MAP_ADD_TRANSFERS 0x00000008 + +#define USBD_PF_VALID_MASK (USBD_PF_CHANGE_MAX_PACKET | \ + USBD_PF_SHORT_PACKET_OPT | \ + USBD_PF_ENABLE_RT_THREAD_ACCESS | \ + USBD_PF_MAP_ADD_TRANSFERS) + +#define OS_STRING_DESCRIPTOR_INDEX 0xEE + +#define MS_GENRE_DESCRIPTOR_INDEX 0x0001 +#define MS_POWER_DESCRIPTOR_INDEX 0x0002 + +#define MS_OS_STRING_SIGNATURE L"MSFT100" + +typedef struct _OS_STRING { + UCHAR bLength; + UCHAR bDescriptorType; + WCHAR MicrosoftString[7]; + UCHAR bVendorCode; + UCHAR bPad; +} OS_STRING, *POS_STRING; + +#ifdef __cplusplus +} +#endif + +#endif /* defined __USBDI_H */ + +#endif /* __USB_H */ diff --git a/reactos/include/ddk/usb100.h b/reactos/include/ddk/usb100.h new file mode 100644 index 00000000000..ceaf6d589f7 --- /dev/null +++ b/reactos/include/ddk/usb100.h @@ -0,0 +1,235 @@ +/* + * usb100.h + * + * USB 1.0 support + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __USB100_H +#define __USB100_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define MAXIMUM_USB_STRING_LENGTH 255 + +#define USB_DEVICE_CLASS_RESERVED 0x00 +#define USB_DEVICE_CLASS_AUDIO 0x01 +#define USB_DEVICE_CLASS_COMMUNICATIONS 0x02 +#define USB_DEVICE_CLASS_HUMAN_INTERFACE 0x03 +#define USB_DEVICE_CLASS_MONITOR 0x04 +#define USB_DEVICE_CLASS_PHYSICAL_INTERFACE 0x05 +#define USB_DEVICE_CLASS_POWER 0x06 +#define USB_DEVICE_CLASS_PRINTER 0x07 +#define USB_DEVICE_CLASS_STORAGE 0x08 +#define USB_DEVICE_CLASS_HUB 0x09 +#define USB_DEVICE_CLASS_VENDOR_SPECIFIC 0xFF + +#define USB_RESERVED_DESCRIPTOR_TYPE 0x06 +#define USB_CONFIG_POWER_DESCRIPTOR_TYPE 0x07 +#define USB_INTERFACE_POWER_DESCRIPTOR_TYPE 0x08 + +#define USB_REQUEST_GET_STATUS 0x00 +#define USB_REQUEST_CLEAR_FEATURE 0x01 +#define USB_REQUEST_SET_FEATURE 0x03 +#define USB_REQUEST_SET_ADDRESS 0x05 +#define USB_REQUEST_GET_DESCRIPTOR 0x06 +#define USB_REQUEST_SET_DESCRIPTOR 0x07 +#define USB_REQUEST_GET_CONFIGURATION 0x08 +#define USB_REQUEST_SET_CONFIGURATION 0x09 +#define USB_REQUEST_GET_INTERFACE 0x0A +#define USB_REQUEST_SET_INTERFACE 0x0B +#define USB_REQUEST_SYNC_FRAME 0x0C + +#define USB_GETSTATUS_SELF_POWERED 0x01 +#define USB_GETSTATUS_REMOTE_WAKEUP_ENABLED 0x02 + +#define BMREQUEST_HOST_TO_DEVICE 0 +#define BMREQUEST_DEVICE_TO_HOST 1 + +#define BMREQUEST_STANDARD 0 +#define BMREQUEST_CLASS 1 +#define BMREQUEST_VENDOR 2 + +#define BMREQUEST_TO_DEVICE 0 +#define BMREQUEST_TO_INTERFACE 1 +#define BMREQUEST_TO_ENDPOINT 2 +#define BMREQUEST_TO_OTHER 3 + +/* USB_COMMON_DESCRIPTOR.bDescriptorType constants */ +#define USB_DEVICE_DESCRIPTOR_TYPE 0x01 +#define USB_CONFIGURATION_DESCRIPTOR_TYPE 0x02 +#define USB_STRING_DESCRIPTOR_TYPE 0x03 +#define USB_INTERFACE_DESCRIPTOR_TYPE 0x04 +#define USB_ENDPOINT_DESCRIPTOR_TYPE 0x05 + +typedef struct _USB_COMMON_DESCRIPTOR { + UCHAR bLength; + UCHAR bDescriptorType; +} USB_COMMON_DESCRIPTOR, *PUSB_COMMON_DESCRIPTOR; + +#define USB_DESCRIPTOR_MAKE_TYPE_AND_INDEX(d, i) ((USHORT)((USHORT)d << 8 | i)) + +/* USB_CONFIGURATION_DESCRIPTOR.bmAttributes constants */ +#define USB_CONFIG_POWERED_MASK 0xc0 +#define USB_CONFIG_BUS_POWERED 0x80 +#define USB_CONFIG_SELF_POWERED 0x40 +#define USB_CONFIG_REMOTE_WAKEUP 0x20 + +#include +typedef struct _USB_CONFIGURATION_DESCRIPTOR { + UCHAR bLength; + UCHAR bDescriptorType; + USHORT wTotalLength; + UCHAR bNumInterfaces; + UCHAR bConfigurationValue; + UCHAR iConfiguration; + UCHAR bmAttributes; + UCHAR MaxPower; +} USB_CONFIGURATION_DESCRIPTOR, *PUSB_CONFIGURATION_DESCRIPTOR; +#include + +typedef struct _USB_DEVICE_DESCRIPTOR { + UCHAR bLength; + UCHAR bDescriptorType; + USHORT bcdUSB; + UCHAR bDeviceClass; + UCHAR bDeviceSubClass; + UCHAR bDeviceProtocol; + UCHAR bMaxPacketSize0; + USHORT idVendor; + USHORT idProduct; + USHORT bcdDevice; + UCHAR iManufacturer; + UCHAR iProduct; + UCHAR iSerialNumber; + UCHAR bNumConfigurations; +} USB_DEVICE_DESCRIPTOR, *PUSB_DEVICE_DESCRIPTOR; + +#define USB_ENDPOINT_DIRECTION_MASK 0x80 + +#define USB_ENDPOINT_DIRECTION_OUT(x) (!((x) & USB_ENDPOINT_DIRECTION_MASK)) +#define USB_ENDPOINT_DIRECTION_IN(x) ((x) & USB_ENDPOINT_DIRECTION_MASK) + +/* USB_ENDPOINT_DESCRIPTOR.bmAttributes constants */ +#define USB_ENDPOINT_TYPE_MASK 0x03 +#define USB_ENDPOINT_TYPE_CONTROL 0x00 +#define USB_ENDPOINT_TYPE_ISOCHRONOUS 0x01 +#define USB_ENDPOINT_TYPE_BULK 0x02 +#define USB_ENDPOINT_TYPE_INTERRUPT 0x03 + +#include +typedef struct _USB_ENDPOINT_DESCRIPTOR { + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bEndpointAddress; + UCHAR bmAttributes; + USHORT wMaxPacketSize; + UCHAR bInterval; +} USB_ENDPOINT_DESCRIPTOR, *PUSB_ENDPOINT_DESCRIPTOR; +#include + +#define USB_FEATURE_ENDPOINT_STALL 0x0000 +#define USB_FEATURE_REMOTE_WAKEUP 0x0001 + +typedef struct _USB_INTERFACE_DESCRIPTOR { + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bInterfaceNumber; + UCHAR bAlternateSetting; + UCHAR bNumEndpoints; + UCHAR bInterfaceClass; + UCHAR bInterfaceSubClass; + UCHAR bInterfaceProtocol; + UCHAR iInterface; +} USB_INTERFACE_DESCRIPTOR, *PUSB_INTERFACE_DESCRIPTOR; + +typedef struct _USB_STRING_DESCRIPTOR { + UCHAR bLength; + UCHAR bDescriptorType; + WCHAR bString[1]; +} USB_STRING_DESCRIPTOR, *PUSB_STRING_DESCRIPTOR; + +#include +typedef struct _USB_HUB_DESCRIPTOR { + UCHAR bDescriptorLength; + UCHAR bDescriptorType; + UCHAR bNumberOfPorts; + USHORT wHubCharacteristics; + UCHAR bPowerOnToPowerGood; + UCHAR bHubControlCurrent; + UCHAR bRemoveAndPowerMask[64]; +} USB_HUB_DESCRIPTOR, *PUSB_HUB_DESCRIPTOR; +#include + +#define USB_SUPPORT_D0_COMMAND 0x01 +#define USB_SUPPORT_D1_COMMAND 0x02 +#define USB_SUPPORT_D2_COMMAND 0x04 +#define USB_SUPPORT_D3_COMMAND 0x08 + +#define USB_SUPPORT_D1_WAKEUP 0x10 +#define USB_SUPPORT_D2_WAKEUP 0x20 + +typedef struct _USB_CONFIGURATION_POWER_DESCRIPTOR { + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR SelfPowerConsumedD0[3]; + UCHAR bPowerSummaryId; + UCHAR bBusPowerSavingD1; + UCHAR bSelfPowerSavingD1; + UCHAR bBusPowerSavingD2; + UCHAR bSelfPowerSavingD2; + UCHAR bBusPowerSavingD3; + UCHAR bSelfPowerSavingD3; + USHORT TransitionTimeFromD1; + USHORT TransitionTimeFromD2; + USHORT TransitionTimeFromD3; +} USB_CONFIGURATION_POWER_DESCRIPTOR, *PUSB_CONFIGURATION_POWER_DESCRIPTOR; + +#define USB_FEATURE_INTERFACE_POWER_D0 0x0002 +#define USB_FEATURE_INTERFACE_POWER_D1 0x0003 +#define USB_FEATURE_INTERFACE_POWER_D2 0x0004 +#define USB_FEATURE_INTERFACE_POWER_D3 0x0005 + +#include +typedef struct _USB_INTERFACE_POWER_DESCRIPTOR { + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bmCapabilitiesFlags; + UCHAR bBusPowerSavingD1; + UCHAR bSelfPowerSavingD1; + UCHAR bBusPowerSavingD2; + UCHAR bSelfPowerSavingD2; + UCHAR bBusPowerSavingD3; + UCHAR bSelfPowerSavingD3; + USHORT TransitionTimeFromD1; + USHORT TransitionTimeFromD2; + USHORT TransitionTimeFromD3; +} USB_INTERFACE_POWER_DESCRIPTOR, *PUSB_INTERFACE_POWER_DESCRIPTOR; +#include + +#ifdef __cplusplus +} +#endif + +#endif /* __USB100_H */ diff --git a/reactos/include/ddk/usbcamdi.h b/reactos/include/ddk/usbcamdi.h new file mode 100644 index 00000000000..7c9bf0196d5 --- /dev/null +++ b/reactos/include/ddk/usbcamdi.h @@ -0,0 +1,402 @@ +/* + * usbcamdi.h + * + * USB Camera driver interface. + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __USBCAMDI_H +#define __USBCAMDI_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#if !defined(__USB_H) && !defined(__USBDI_H) +#error include usb.h or usbdi.h before usbcamdi.h +#else + +#ifdef __cplusplus +extern "C" { +#endif + +#pragma pack(push,4) + +#if defined(_BATTERYCLASS_) + #define USBCAMAPI DECLSPEC_EXPORT +#else + #define USBCAMAPI DECLSPEC_IMPORT +#endif + + +/* FIXME: Unknown definition */ +typedef PVOID PHW_STREAM_REQUEST_BLOCK; + +DEFINE_GUID(GUID_USBCAMD_INTERFACE, + 0x2bcb75c0, 0xb27f, 0x11d1, 0xba, 0x41, 0x0, 0xa0, 0xc9, 0xd, 0x2b, 0x5); + +#define USBCAMD_PROCESSPACKETEX_DropFrame 0x0002 +#define USBCAMD_PROCESSPACKETEX_NextFrameIsStill 0x0004 +#define USBCAMD_PROCESSPACKETEX_CurrentFrameIsStill 0x0008 + +#define USBCAMD_DATA_PIPE 0x0001 +#define USBCAMD_MULTIPLEX_PIPE 0x0002 +#define USBCAMD_SYNC_PIPE 0x0004 +#define USBCAMD_DONT_CARE_PIPE 0x0008 + +#define USBCAMD_VIDEO_STREAM 0x1 +#define USBCAMD_STILL_STREAM 0x2 +#define USBCAMD_VIDEO_STILL_STREAM (USBCAMD_VIDEO_STREAM | USBCAMD_STILL_STREAM) + +#define USBCAMD_STOP_STREAM 0x00000001 +#define USBCAMD_START_STREAM 0x00000000 + +typedef struct _pipe_config_descriptor { + CHAR StreamAssociation; + UCHAR PipeConfigFlags; +} USBCAMD_Pipe_Config_Descriptor, *PUSBCAMD_Pipe_Config_Descriptor; + +typedef enum { + USBCAMD_CamControlFlag_NoVideoRawProcessing = 1, + USBCAMD_CamControlFlag_NoStillRawProcessing = 2, + USBCAMD_CamControlFlag_AssociatedFormat = 4, + USBCAMD_CamControlFlag_EnableDeviceEvents = 8 +} USBCAMD_CamControlFlags; + +typedef NTSTATUS DDKAPI +(*PCAM_ALLOCATE_BW_ROUTINE)( + PDEVICE_OBJECT BusDeviceObject, + PVOID DeviceContext, + PULONG RawFrameLength, + PVOID Format); + +typedef NTSTATUS DDKAPI +(*PCAM_ALLOCATE_BW_ROUTINE_EX)( + PDEVICE_OBJECT BusDeviceObject, + PVOID DeviceContext, + PULONG RawFrameLength, + PVOID Format, + ULONG StreamNumber); + +typedef NTSTATUS DDKAPI +(*PCAM_CONFIGURE_ROUTINE)( + PDEVICE_OBJECT BusDeviceObject, + PVOID DeviceContext, + PUSBD_INTERFACE_INFORMATION Interface, + PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, + PLONG DataPipeIndex, + PLONG SyncPipeIndex); + +typedef NTSTATUS DDKAPI +(*PCAM_CONFIGURE_ROUTINE_EX)( + PDEVICE_OBJECT BusDeviceObject, + PVOID DeviceContext, + PUSBD_INTERFACE_INFORMATION Interface, + PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, + ULONG PipeConfigListSize, + PUSBCAMD_Pipe_Config_Descriptor PipeConfig, + PUSB_DEVICE_DESCRIPTOR DeviceDescriptor); + +typedef NTSTATUS DDKAPI +(*PCAM_FREE_BW_ROUTINE)( + PDEVICE_OBJECT BusDeviceObject, + PVOID DeviceContext); + +typedef NTSTATUS DDKAPI +(*PCAM_FREE_BW_ROUTINE_EX)( + PDEVICE_OBJECT BusDeviceObject, + PVOID DeviceContext, + ULONG StreamNumber); + +typedef NTSTATUS DDKAPI +(*PCAM_INITIALIZE_ROUTINE)( + PDEVICE_OBJECT BusDeviceObject, + PVOID DeviceContext); + +typedef VOID DDKAPI +(*PCAM_NEW_FRAME_ROUTINE)( + PVOID DeviceContext, + PVOID FrameContext); + +typedef VOID DDKAPI +(*PCAM_NEW_FRAME_ROUTINE_EX)( + PVOID DeviceContext, + PVOID FrameContext, + ULONG StreamNumber, + PULONG FrameLength); + +typedef NTSTATUS DDKAPI +(*PCAM_PROCESS_RAW_FRAME_ROUTINE)( + PDEVICE_OBJECT BusDeviceObject, + PVOID DeviceContext, + PVOID FrameContext, + PVOID FrameBuffer, + ULONG FrameLength, + PVOID RawFrameBuffer, + ULONG RawFrameLength, + ULONG NumberOfPackets, + PULONG BytesReturned); + +typedef NTSTATUS DDKAPI +(*PCAM_PROCESS_RAW_FRAME_ROUTINE_EX)( + PDEVICE_OBJECT BusDeviceObject, + PVOID DeviceContext, + PVOID FrameContext, + PVOID FrameBuffer, + ULONG FrameLength, + PVOID RawFrameBuffer, + ULONG RawFrameLength, + ULONG NumberOfPackets, + PULONG BytesReturned, + ULONG ActualRawFrameLength, + ULONG StreamNumber); + +typedef ULONG DDKAPI +(*PCAM_PROCESS_PACKET_ROUTINE)( + PDEVICE_OBJECT BusDeviceObject, + PVOID DeviceContext, + PVOID CurrentFrameContext, + PUSBD_ISO_PACKET_DESCRIPTOR SyncPacket, + PVOID SyncBuffer, + PUSBD_ISO_PACKET_DESCRIPTOR DataPacket, + PVOID DataBuffer, + PBOOLEAN FrameComplete, + PBOOLEAN NextFrameIsStill); + +typedef ULONG DDKAPI +(*PCAM_PROCESS_PACKET_ROUTINE_EX)( + PDEVICE_OBJECT BusDeviceObject, + PVOID DeviceContext, + PVOID CurrentFrameContext, + PUSBD_ISO_PACKET_DESCRIPTOR SyncPacket, + PVOID SyncBuffer, + PUSBD_ISO_PACKET_DESCRIPTOR DataPacket, + PVOID DataBuffer, + PBOOLEAN FrameComplete, + PULONG PacketFlag, + PULONG ValidDataOffset); + +typedef NTSTATUS DDKAPI +(*PCAM_STATE_ROUTINE)( + PDEVICE_OBJECT BusDeviceObject, + PVOID DeviceContext); + +typedef NTSTATUS DDKAPI +(*PCAM_START_CAPTURE_ROUTINE)( + PDEVICE_OBJECT BusDeviceObject, + PVOID DeviceContext); + +typedef NTSTATUS DDKAPI +(*PCAM_START_CAPTURE_ROUTINE_EX)( + PDEVICE_OBJECT BusDeviceObject, + PVOID DeviceContext, + ULONG StreamNumber); + +typedef NTSTATUS DDKAPI +(*PCAM_STOP_CAPTURE_ROUTINE)( + PDEVICE_OBJECT BusDeviceObject, + PVOID DeviceContext); + +typedef NTSTATUS DDKAPI +(*PCAM_STOP_CAPTURE_ROUTINE_EX)( + PDEVICE_OBJECT BusDeviceObject, + PVOID DeviceContext, + ULONG StreamNumber); + +typedef struct _USBCAMD_DEVICE_DATA { + ULONG Sig; + PCAM_INITIALIZE_ROUTINE CamInitialize; + PCAM_INITIALIZE_ROUTINE CamUnInitialize; + PCAM_PROCESS_PACKET_ROUTINE CamProcessUSBPacket; + PCAM_NEW_FRAME_ROUTINE CamNewVideoFrame; + PCAM_PROCESS_RAW_FRAME_ROUTINE CamProcessRawVideoFrame; + PCAM_START_CAPTURE_ROUTINE CamStartCapture; + PCAM_STOP_CAPTURE_ROUTINE CamStopCapture; + PCAM_CONFIGURE_ROUTINE CamConfigure; + PCAM_STATE_ROUTINE CamSaveState; + PCAM_STATE_ROUTINE CamRestoreState; + PCAM_ALLOCATE_BW_ROUTINE CamAllocateBandwidth; + PCAM_FREE_BW_ROUTINE CamFreeBandwidth; +} USBCAMD_DEVICE_DATA, *PUSBCAMD_DEVICE_DATA; + +typedef struct _USBCAMD_DEVICE_DATA2 { + ULONG Sig; + PCAM_INITIALIZE_ROUTINE CamInitialize; + PCAM_INITIALIZE_ROUTINE CamUnInitialize; + PCAM_PROCESS_PACKET_ROUTINE_EX CamProcessUSBPacketEx; + PCAM_NEW_FRAME_ROUTINE_EX CamNewVideoFrameEx; + PCAM_PROCESS_RAW_FRAME_ROUTINE_EX CamProcessRawVideoFrameEx; + PCAM_START_CAPTURE_ROUTINE_EX CamStartCaptureEx; + PCAM_STOP_CAPTURE_ROUTINE_EX CamStopCaptureEx; + PCAM_CONFIGURE_ROUTINE_EX CamConfigureEx; + PCAM_STATE_ROUTINE CamSaveState; + PCAM_STATE_ROUTINE CamRestoreState; + PCAM_ALLOCATE_BW_ROUTINE_EX CamAllocateBandwidthEx; + PCAM_FREE_BW_ROUTINE_EX CamFreeBandwidthEx; +} USBCAMD_DEVICE_DATA2, *PUSBCAMD_DEVICE_DATA2; + +USBCAMAPI +ULONG +DDKAPI +USBCAMD_InitializeNewInterface( + IN PVOID DeviceContext, + IN PVOID DeviceData, + IN ULONG Version, + IN ULONG CamControlFlag); + +typedef VOID DDKAPI +(*PCOMMAND_COMPLETE_FUNCTION)( + PVOID DeviceContext, + PVOID CommandContext, + NTSTATUS NtStatus); + +typedef NTSTATUS DDKAPI +(*PFNUSBCAMD_BulkReadWrite)( + IN PVOID DeviceContext, + IN USHORT PipeIndex, + IN PVOID Buffer, + IN ULONG BufferLength, + IN PCOMMAND_COMPLETE_FUNCTION CommandComplete, + IN PVOID CommandContext); + +typedef NTSTATUS DDKAPI +(*PFNUSBCAMD_SetIsoPipeState)( + IN PVOID DeviceContext, + IN ULONG PipeStateFlags); + +typedef NTSTATUS DDKAPI +(*PFNUSBCAMD_CancelBulkReadWrite)( + IN PVOID DeviceContext, + IN ULONG PipeIndex); + +typedef NTSTATUS DDKAPI +(*PFNUSBCAMD_SetVideoFormat)( + IN PVOID DeviceContext, + IN PHW_STREAM_REQUEST_BLOCK pSrb); + +typedef NTSTATUS DDKAPI +(*PFNUSBCAMD_WaitOnDeviceEvent)( + IN PVOID DeviceContext, + IN ULONG PipeIndex, + IN PVOID Buffer, + IN ULONG BufferLength, + IN PCOMMAND_COMPLETE_FUNCTION EventComplete, + IN PVOID EventContext, + IN BOOLEAN LoopBack); + +USBCAMAPI +PVOID +DDKAPI +USBCAMD_AdapterReceivePacket( + IN PHW_STREAM_REQUEST_BLOCK Srb, + IN PUSBCAMD_DEVICE_DATA DeviceData, + IN PDEVICE_OBJECT *DeviceObject, + IN BOOLEAN NeedsCompletion); + +USBCAMAPI +NTSTATUS +DDKAPI +USBCAMD_ControlVendorCommand( + IN PVOID DeviceContext, + IN UCHAR Request, + IN USHORT Value, + IN USHORT Index, + IN PVOID Buffer, + IN OUT PULONG BufferLength, + IN BOOLEAN GetData, + IN PCOMMAND_COMPLETE_FUNCTION CommandComplete, + IN PVOID CommandContext); + +typedef VOID DDKAPI +(*PADAPTER_RECEIVE_PACKET_ROUTINE)( + IN PHW_STREAM_REQUEST_BLOCK Srb); + +USBCAMAPI +ULONG +DDKAPI +USBCAMD_DriverEntry( + PVOID Context1, + PVOID Context2, + ULONG DeviceContextSize, + ULONG FrameContextSize, + PADAPTER_RECEIVE_PACKET_ROUTINE ReceivePacket); + +USBCAMAPI +NTSTATUS +DDKAPI +USBCAMD_GetRegistryKeyValue( + IN HANDLE Handle, + IN PWCHAR KeyNameString, + IN ULONG KeyNameStringLength, + IN PVOID Data, + IN ULONG DataLength); + +USBCAMAPI +NTSTATUS +DDKAPI +USBCAMD_SelectAlternateInterface( + IN PVOID DeviceContext, + IN OUT PUSBD_INTERFACE_INFORMATION RequestInterface); + +#define USBCAMD_VERSION_200 0x200 + +typedef struct _USBCAMD_INTERFACE { + INTERFACE Interface; + PFNUSBCAMD_WaitOnDeviceEvent USBCAMD_WaitOnDeviceEvent; + PFNUSBCAMD_BulkReadWrite USBCAMD_BulkReadWrite; + PFNUSBCAMD_SetVideoFormat USBCAMD_SetVideoFormat; + PFNUSBCAMD_SetIsoPipeState USBCAMD_SetIsoPipeState; + PFNUSBCAMD_CancelBulkReadWrite USBCAMD_CancelBulkReadWrite; +} USBCAMD_INTERFACE, *PUSBCAMD_INTERFACE; + +typedef VOID DDKAPI +(*PSTREAM_RECEIVE_PACKET)( + IN PVOID Srb, + IN PVOID DeviceContext, + IN PBOOLEAN Completed); + +#if defined(DEBUG_LOG) + +USBCAMAPI +VOID +DDKAPI +USBCAMD_Debug_LogEntry( + IN CHAR *Name, + IN ULONG Info1, + IN ULONG Info2, + IN ULONG Info3); + +#define ILOGENTRY(sig, info1, info2, info3) \ + USBCAMD_Debug_LogEntry(sig, (ULONG)info1, (ULONG)info2, (ULONG)info3) + +#else + +#define ILOGENTRY(sig, info1, info2, info3) + +#endif /* DEBUG_LOG */ + +#pragma pack(pop) + +#ifdef __cplusplus +} +#endif + +#endif /* !defined(__USB_H) && !defined(__USBDI_H) */ + + +#endif /* __USBCAMDI_H */ diff --git a/reactos/include/ddk/usbdi.h b/reactos/include/ddk/usbdi.h new file mode 100644 index 00000000000..2ea8ba907ef --- /dev/null +++ b/reactos/include/ddk/usbdi.h @@ -0,0 +1,406 @@ +/* + * usbdi.h + * + * USBD and USB device driver definitions + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __USBDI_H +#define __USBDI_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __USB_H +#error usb.h cannot be included with usbdi.h +#else + +#include "usbioctl.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define USBDI_VERSION 0x300 + +#define USB_DEFAULT_DEVICE_ADDRESS 0 +#define USB_DEFAULT_ENDPOINT_ADDRESS 0 +#define USB_DEFAULT_MAX_PACKET 64 + +#define URB_FROM_IRP(Irp) ((IoGetCurrentIrpStackLocation(Irp))->Parameters.Others.Argument1) + +#define URB_FUNCTION_SELECT_CONFIGURATION 0x0000 +#define URB_FUNCTION_SELECT_INTERFACE 0x0001 +#define URB_FUNCTION_ABORT_PIPE 0x0002 +#define URB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL 0x0003 +#define URB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL 0x0004 +#define URB_FUNCTION_GET_FRAME_LENGTH 0x0005 +#define URB_FUNCTION_SET_FRAME_LENGTH 0x0006 +#define URB_FUNCTION_GET_CURRENT_FRAME_NUMBER 0x0007 +#define URB_FUNCTION_CONTROL_TRANSFER 0x0008 +#define URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER 0x0009 +#define URB_FUNCTION_ISOCH_TRANSFER 0x000A +#define URB_FUNCTION_RESET_PIPE 0x001E +#define URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE 0x000B +#define URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT 0x0024 +#define URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE 0x0028 +#define URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE 0x000C +#define URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT 0x0025 +#define URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE 0x0029 +#define URB_FUNCTION_SET_FEATURE_TO_DEVICE 0x000D +#define URB_FUNCTION_SET_FEATURE_TO_INTERFACE 0x000E +#define URB_FUNCTION_SET_FEATURE_TO_ENDPOINT 0x000F +#define URB_FUNCTION_SET_FEATURE_TO_OTHER 0x0023 +#define URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE 0x0010 +#define URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE 0x0011 +#define URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT 0x0012 +#define URB_FUNCTION_CLEAR_FEATURE_TO_OTHER 0x0022 +#define URB_FUNCTION_GET_STATUS_FROM_DEVICE 0x0013 +#define URB_FUNCTION_GET_STATUS_FROM_INTERFACE 0x0014 +#define URB_FUNCTION_GET_STATUS_FROM_ENDPOINT 0x0015 +#define URB_FUNCTION_GET_STATUS_FROM_OTHER 0x0021 +#define URB_FUNCTION_RESERVED0 0x0016 +#define URB_FUNCTION_VENDOR_DEVICE 0x0017 +#define URB_FUNCTION_VENDOR_INTERFACE 0x0018 +#define URB_FUNCTION_VENDOR_ENDPOINT 0x0019 +#define URB_FUNCTION_VENDOR_OTHER 0x0020 +#define URB_FUNCTION_CLASS_DEVICE 0x001A +#define URB_FUNCTION_CLASS_INTERFACE 0x001B +#define URB_FUNCTION_CLASS_ENDPOINT 0x001C +#define URB_FUNCTION_CLASS_OTHER 0x001F +#define URB_FUNCTION_RESERVED 0x001D +#define URB_FUNCTION_GET_CONFIGURATION 0x0026 +#define URB_FUNCTION_GET_INTERFACE 0x0027 +#define URB_FUNCTION_LAST 0x0029 + +typedef LONG USBD_STATUS; +typedef PVOID USBD_PIPE_HANDLE; +typedef PVOID USBD_CONFIGURATION_HANDLE; +typedef PVOID USBD_INTERFACE_HANDLE; + +#define USBD_ERROR(Status) ((USBD_STATUS)(Status) < 0) +#define USBD_HALTED(Status) ((ULONG)(Status) >> 30 == 3) +#define USBD_PENDING(Status) ((ULONG)(Status) >> 30 == 1) +#define USBD_STATUS(Status) ((ULONG)(Status) & 0x0FFFFFFFL) +#define USBD_SUCCESS(Status) ((USBD_STATUS)(Status) >= 0) + +#define USBD_STATUS_SUCCESS ((USBD_STATUS)0x00000000L) +#define USBD_STATUS_PENDING ((USBD_STATUS)0x40000000L) +#define USBD_STATUS_HALTED ((USBD_STATUS)0xC0000000L) +#define USBD_STATUS_ERROR ((USBD_STATUS)0x80000000L) +#define USBD_STATUS_NO_MEMORY ((USBD_STATUS)0x80000100L) +#define USBD_STATUS_INVALID_URB_FUNCTION ((USBD_STATUS)0x80000200L) +#define USBD_STATUS_INVALID_PARAMETER ((USBD_STATUS)0x80000300L) +#define USBD_STATUS_ERROR_BUSY ((USBD_STATUS)0x80000400L) +#define USBD_STATUS_REQUEST_FAILED ((USBD_STATUS)0x80000500L) +#define USBD_STATUS_INVALID_PIPE_HANDLE ((USBD_STATUS)0x80000600L) +#define USBD_STATUS_NO_BANDWIDTH ((USBD_STATUS)0x80000700L) +#define USBD_STATUS_INTERNAL_HC_ERROR ((USBD_STATUS)0x80000800L) +#define USBD_STATUS_ERROR_SHORT_TRANSFER ((USBD_STATUS)0x80000900L) +#define USBD_STATUS_CRC ((USBD_STATUS)0xC0000001L) +#define USBD_STATUS_BTSTUFF ((USBD_STATUS)0xC0000002L) +#define USBD_STATUS_DATA_TOGGLE_MISMATCH ((USBD_STATUS)0xC0000003L) +#define USBD_STATUS_STALL_PID ((USBD_STATUS)0xC0000004L) +#define USBD_STATUS_DEV_NOT_RESPONDING ((USBD_STATUS)0xC0000005L) +#define USBD_STATUS_PID_CHECK_FAILURE ((USBD_STATUS)0xC0000006L) +#define USBD_STATUS_UNEXPECTED_PID ((USBD_STATUS)0xC0000007L) +#define USBD_STATUS_DATA_OVERRUN ((USBD_STATUS)0xC0000008L) +#define USBD_STATUS_DATA_UNDERRUN ((USBD_STATUS)0xC0000009L) +#define USBD_STATUS_RESERVED1 ((USBD_STATUS)0xC000000AL) +#define USBD_STATUS_RESERVED2 ((USBD_STATUS)0xC000000BL) +#define USBD_STATUS_BUFFER_OVERRUN ((USBD_STATUS)0xC000000CL) +#define USBD_STATUS_BUFFER_UNDERRUN ((USBD_STATUS)0xC000000DL) +#define USBD_STATUS_NOT_ACCESSED ((USBD_STATUS)0xC000000FL) +#define USBD_STATUS_FIFO ((USBD_STATUS)0xC0000010L) +#define USBD_STATUS_ENDPOINT_HALTED ((USBD_STATUS)0xC0000030L) +#define USBD_STATUS_BAD_START_FRAME ((USBD_STATUS)0xC0000A00L) +#define USBD_STATUS_ISOCH_REQUEST_FAILED ((USBD_STATUS)0xC0000B00L) +#define USBD_STATUS_FRAME_CONTROL_OWNED ((USBD_STATUS)0xC0000C00L) +#define USBD_STATUS_FRAME_CONTROL_NOT_OWNED \ + ((USBD_STATUS)0xC0000D00L) +#define USBD_STATUS_INAVLID_CONFIGURATION_DESCRIPTOR \ + ((USBD_STATUS)0xC0000F00L) +#define USBD_STATUS_CANCELING ((USBD_STATUS)0x00020000L) + +#define USBD_PIPE_DIRECTION_IN(pipeInformation) \ + ((pipeInformation)->EndpointAddress & USB_ENDPOINT_DIRECTION_MASK) + +struct _URB_HEADER { + USHORT Length; + USHORT Function; + USBD_STATUS Status; + PVOID UsbdDeviceHandle; + ULONG UsbdFlags; +}; + +struct _URB_HCD_AREA { + PVOID HcdEndpoint; + PIRP HcdIrp; + LIST_ENTRY HcdListEntry; + LIST_ENTRY HcdListEntry2; + PVOID HcdCurrentIoFlushPointer; + PVOID HcdExtension; +}; + +struct _URB_BULK_OR_INTERRUPT_TRANSFER { + struct _URB_HEADER Hdr; + USBD_PIPE_HANDLE PipeHandle; + ULONG TransferFlags; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; +}; + +struct _URB_CONTROL_DESCRIPTOR_REQUEST { + struct _URB_HEADER Hdr; + PVOID Reserved; + ULONG Reserved0; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + USHORT Reserved1; + UCHAR Index; + UCHAR DescriptorType; + USHORT LanguageId; + USHORT Reserved2; +}; + +struct _URB_CONTROL_FEATURE_REQUEST { + struct _URB_HEADER Hdr; + PVOID Reserved; + ULONG Reserved2; + ULONG Reserved3; + PVOID Reserved4; + PMDL Reserved5; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + USHORT Reserved0; + USHORT FeatureSelector; + USHORT Index; + USHORT Reserved1; +}; + +struct _URB_CONTROL_GET_CONFIGURATION_REQUEST { + struct _URB_HEADER Hdr; + PVOID Reserved; + ULONG Reserved0; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + UCHAR Reserved1[8]; +}; + +struct _URB_CONTROL_GET_INTERFACE_REQUEST { + struct _URB_HEADER Hdr; + PVOID Reserved; + ULONG Reserved0; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + UCHAR Reserved1[4]; + USHORT Interface; + USHORT Reserved2; +}; + +struct _URB_CONTROL_GET_STATUS_REQUEST { + struct _URB_HEADER Hdr; + PVOID Reserved; + ULONG Reserved0; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + UCHAR Reserved1[4]; + USHORT Index; + USHORT Reserved2; +}; + +struct _URB_CONTROL_TRANSFER { + struct _URB_HEADER Hdr; + USBD_PIPE_HANDLE PipeHandle; + ULONG TransferFlags; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + UCHAR SetupPacket[8]; +}; + +struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST { + struct _URB_HEADER Hdr; + PVOID Reserved; + ULONG TransferFlags; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + UCHAR RequestTypeReservedBits; + UCHAR Request; + USHORT Value; + USHORT Index; + USHORT Reserved1; +}; + +struct _URB_FRAME_LENGTH_CONTROL { + struct _URB_HEADER Hdr; +}; + +struct _URB_GET_CURRENT_FRAME_NUMBER { + struct _URB_HEADER Hdr; + ULONG FrameNumber; +}; + +struct _URB_GET_FRAME_LENGTH { + struct _URB_HEADER Hdr; + ULONG FrameLength; + ULONG FrameNumber; +}; + +typedef struct _USBD_ISO_PACKET_DESCRIPTOR { + ULONG Offset; + ULONG Length; + USBD_STATUS Status; +} USBD_ISO_PACKET_DESCRIPTOR, *PUSBD_ISO_PACKET_DESCRIPTOR; + +struct _URB_ISOCH_TRANSFER { + struct _URB_HEADER Hdr; + USBD_PIPE_HANDLE PipeHandle; + ULONG TransferFlags; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + ULONG StartFrame; + ULONG NumberOfPackets; + ULONG ErrorCount; + USBD_ISO_PACKET_DESCRIPTOR IsoPacket[1]; +}; + +struct _URB_PIPE_REQUEST { + struct _URB_HEADER Hdr; + USBD_PIPE_HANDLE PipeHandle; + ULONG Reserved; +}; + +struct _URB_SET_FRAME_LENGTH { + struct _URB_HEADER Hdr; + LONG FrameLengthDelta; +}; + +typedef struct _USBD_DEVICE_INFORMATION { + ULONG OffsetNext; + PVOID UsbdDeviceHandle; + USB_DEVICE_DESCRIPTOR DeviceDescriptor; +} USBD_DEVICE_INFORMATION, *PUSBD_DEVICE_INFORMATION; + +typedef enum _USBD_PIPE_TYPE { + UsbdPipeTypeControl, + UsbdPipeTypeIsochronous, + UsbdPipeTypeBulk, + UsbdPipeTypeInterrupt +} USBD_PIPE_TYPE; + +/* USBD_PIPE_INFORMATION.PipeFlags constants */ +#define USBD_PF_CHANGE_MAX_PACKET 0x00000001 +#define USBD_PF_DOUBLE_BUFFER 0x00000002 +#define USBD_PF_ENABLE_RT_THREAD_ACCESS 0x00000004 +#define USBD_PF_MAP_ADD_TRANSFERS 0x00000008 + +typedef struct _USBD_PIPE_INFORMATION { + USHORT MaximumPacketSize; + UCHAR EndpointAddress; + UCHAR Interval; + USBD_PIPE_TYPE PipeType; + USBD_PIPE_HANDLE PipeHandle; + ULONG MaximumTransferSize; + ULONG PipeFlags; +} USBD_PIPE_INFORMATION, *PUSBD_PIPE_INFORMATION; + +typedef struct _USBD_INTERFACE_INFORMATION { + USHORT Length; + UCHAR InterfaceNumber; + UCHAR AlternateSetting; + UCHAR Class; + UCHAR SubClass; + UCHAR Protocol; + UCHAR Reserved; + USBD_INTERFACE_HANDLE InterfaceHandle; + ULONG NumberOfPipes; + USBD_PIPE_INFORMATION Pipes[1]; +} USBD_INTERFACE_INFORMATION, *PUSBD_INTERFACE_INFORMATION; + +struct _URB_SELECT_CONFIGURATION { + struct _URB_HEADER Hdr; + PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor; + USBD_CONFIGURATION_HANDLE ConfigurationHandle; + USBD_INTERFACE_INFORMATION Interface; +}; + +struct _URB_SELECT_INTERFACE { + struct _URB_HEADER Hdr; + USBD_CONFIGURATION_HANDLE ConfigurationHandle; + USBD_INTERFACE_INFORMATION Interface; +}; + +typedef struct _USBD_VERSION_INFORMATION { + ULONG USBDI_Version; + ULONG Supported_USB_Version; +} USBD_VERSION_INFORMATION, *PUSBD_VERSION_INFORMATION; + +typedef struct _URB { + union { + struct _URB_HEADER UrbHeader; + struct _URB_SELECT_INTERFACE UrbSelectInterface; + struct _URB_SELECT_CONFIGURATION UrbSelectConfiguration; + struct _URB_PIPE_REQUEST UrbPipeRequest; + struct _URB_FRAME_LENGTH_CONTROL UrbFrameLengthControl; + struct _URB_GET_FRAME_LENGTH UrbGetFrameLength; + struct _URB_SET_FRAME_LENGTH UrbSetFrameLength; + struct _URB_GET_CURRENT_FRAME_NUMBER UrbGetCurrentFrameNumber; + struct _URB_CONTROL_TRANSFER UrbControlTransfer; + struct _URB_BULK_OR_INTERRUPT_TRANSFER UrbBulkOrInterruptTransfer; + struct _URB_ISOCH_TRANSFER UrbIsochronousTransfer; + struct _URB_CONTROL_DESCRIPTOR_REQUEST UrbControlDescriptorRequest; + struct _URB_CONTROL_GET_STATUS_REQUEST UrbControlGetStatusRequest; + struct _URB_CONTROL_FEATURE_REQUEST UrbControlFeatureRequest; + struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST UrbControlVendorClassRequest; + struct _URB_CONTROL_GET_INTERFACE_REQUEST UrbControlGetInterfaceRequest; + struct _URB_CONTROL_GET_CONFIGURATION_REQUEST UrbControlGetConfigurationRequest; + }; +} URB, *PURB; + +#ifdef __cplusplus +} +#endif + +#endif /* defined __USB_H */ + +#endif /* __USBDI_H */ diff --git a/reactos/include/ddk/usbioctl.h b/reactos/include/ddk/usbioctl.h new file mode 100644 index 00000000000..e6473f35e6d --- /dev/null +++ b/reactos/include/ddk/usbioctl.h @@ -0,0 +1,352 @@ +/* + * usbioctl.h + * + * USB IOCTL interface. + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __USBIOCTL_H +#define __USBIOCTL_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include "usb100.h" +#include "usbiodef.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define USBD_PORT_ENABLED 1 +#define USBD_PORT_CONNECTED 2 + +#define IOCTL_INTERNAL_USB_CYCLE_PORT \ + CTL_CODE(FILE_DEVICE_USB, USB_CYCLE_PORT, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_USB_ENABLE_PORT \ + CTL_CODE(FILE_DEVICE_USB, USB_ENABLE_PORT, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_USB_GET_BUS_INFO \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_BUS_INFO, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_USB_GET_BUSGUID_INFO \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_BUSGUID_INFO, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_USB_GET_CONTROLLER_NAME \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_CONTROLLER_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_DEVICE_HANDLE, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_USB_GET_HUB_COUNT \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_HUB_COUNT, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_USB_GET_HUB_NAME \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_HUB_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_PARENT_HUB_INFO, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_USB_GET_PORT_STATUS \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_PORT_STATUS, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_USB_RESET_PORT \ + CTL_CODE(FILE_DEVICE_USB, USB_RESET_PORT, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_ROOTHUB_PDO, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION \ + CTL_CODE(FILE_DEVICE_USB, USB_IDLE_NOTIFICATION, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_USB_SUBMIT_URB \ + CTL_CODE(FILE_DEVICE_USB, USB_SUBMIT_URB, METHOD_NEITHER, FILE_ANY_ACCESS) + + +#define IOCTL_USB_DIAG_IGNORE_HUBS_ON \ + CTL_CODE(FILE_DEVICE_USB, USB_DIAG_IGNORE_HUBS_ON, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_DIAG_IGNORE_HUBS_OFF \ + CTL_CODE(FILE_DEVICE_USB, USB_DIAG_IGNORE_HUBS_OFF, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_DIAGNOSTIC_MODE_OFF \ + CTL_CODE(FILE_DEVICE_USB, HCD_DIAGNOSTIC_MODE_OFF, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_DIAGNOSTIC_MODE_ON \ + CTL_CODE(FILE_DEVICE_USB, HCD_DIAGNOSTIC_MODE_ON, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_GET_HUB_CAPABILITIES \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_HUB_CAPABILITIES, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_GET_ROOT_HUB_NAME \ + CTL_CODE(FILE_DEVICE_USB, HCD_GET_ROOT_HUB_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_GET_HCD_DRIVERKEY_NAME \ + CTL_CODE(FILE_DEVICE_USB, HCD_GET_DRIVERKEY_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_GET_NODE_INFORMATION \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_INFORMATION, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_GET_NODE_CONNECTION_INFORMATION \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_INFORMATION, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_GET_NODE_CONNECTION_ATTRIBUTES \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_ATTRIBUTES, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_GET_NODE_CONNECTION_NAME \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_GET_NODE_CONNECTION_DRIVERKEY_NAME \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_DRIVERKEY_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_HCD_DISABLE_PORT \ + CTL_CODE(FILE_DEVICE_USB, HCD_DISABLE_PORT, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_HCD_ENABLE_PORT \ + CTL_CODE(FILE_DEVICE_USB, HCD_ENABLE_PORT, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_HCD_GET_STATS_1 \ + CTL_CODE(FILE_DEVICE_USB, HCD_GET_STATS_1, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_HCD_GET_STATS_2 \ + CTL_CODE(FILE_DEVICE_USB, HCD_GET_STATS_2, METHOD_BUFFERED, FILE_ANY_ACCESS) + + +typedef struct _USB_HUB_CAPABILITIES { + ULONG HubIs2xCapable : 1; +} USB_HUB_CAPABILITIES, *PUSB_HUB_CAPABILITIES; + +typedef enum _USB_CONNECTION_STATUS { + NoDeviceConnected, + DeviceConnected, + DeviceFailedEnumeration, + DeviceGeneralFailure, + DeviceCausedOvercurrent, + DeviceNotEnoughPower, + DeviceNotEnoughBandwidth, + DeviceHubNestedTooDeeply, + DeviceInLegacyHub +} USB_CONNECTION_STATUS, *PUSB_CONNECTION_STATUS; + +#include + +typedef struct _USB_DESCRIPTOR_REQUEST { + ULONG ConnectionIndex; + struct { + UCHAR bmRequest; + UCHAR bRequest; + USHORT wValue; + USHORT wIndex; + USHORT wLength; + } SetupPacket; + UCHAR Data[0]; +} USB_DESCRIPTOR_REQUEST, *PUSB_DESCRIPTOR_REQUEST; + +typedef struct _USB_HCD_DRIVERKEY_NAME { + ULONG ActualLength; + WCHAR DriverKeyName[1]; +} USB_HCD_DRIVERKEY_NAME, *PUSB_HCD_DRIVERKEY_NAME; + +typedef struct _HCD_ISO_STAT_COUNTERS { + USHORT LateUrbs; + USHORT DoubleBufferedPackets; + USHORT TransfersCF_5ms; + USHORT TransfersCF_2ms; + USHORT TransfersCF_1ms; + USHORT MaxInterruptLatency; + USHORT BadStartFrame; + USHORT StaleUrbs; + USHORT IsoPacketNotAccesed; + USHORT IsoPacketHWError; + USHORT SmallestUrbPacketCount; + USHORT LargestUrbPacketCount; + USHORT IsoCRC_Error; + USHORT IsoOVERRUN_Error; + USHORT IsoINTERNAL_Error; + USHORT IsoUNKNOWN_Error; + ULONG IsoBytesTransferred; + USHORT LateMissedCount; + USHORT HWIsoMissedCount; + ULONG Reserved7[8]; +} HCD_ISO_STAT_COUNTERS, *PHCD_ISO_STAT_COUNTERS; + +typedef struct _HCD_STAT_COUNTERS { + ULONG BytesTransferred; + USHORT IsoMissedCount; + USHORT DataOverrunErrorCount; + USHORT CrcErrorCount; + USHORT ScheduleOverrunCount; + USHORT TimeoutErrorCount; + USHORT InternalHcErrorCount; + USHORT BufferOverrunErrorCount; + USHORT SWErrorCount; + USHORT StallPidCount; + USHORT PortDisableCount; +} HCD_STAT_COUNTERS, *PHCD_STAT_COUNTERS; + +typedef struct _HCD_STAT_INFORMATION_1 { + ULONG Reserved1; + ULONG Reserved2; + ULONG ResetCounters; + LARGE_INTEGER TimeRead; + HCD_STAT_COUNTERS Counters; +} HCD_STAT_INFORMATION_1, *PHCD_STAT_INFORMATION_1; + +typedef struct _HCD_STAT_INFORMATION_2 { + ULONG Reserved1; + ULONG Reserved2; + ULONG ResetCounters; + LARGE_INTEGER TimeRead; + LONG LockedMemoryUsed; + HCD_STAT_COUNTERS Counters; + HCD_ISO_STAT_COUNTERS IsoCounters; +} HCD_STAT_INFORMATION_2, *PHCD_STAT_INFORMATION_2; + +typedef struct _USB_HUB_INFORMATION { + USB_HUB_DESCRIPTOR HubDescriptor; + BOOLEAN HubIsBusPowered; +} USB_HUB_INFORMATION, *PUSB_HUB_INFORMATION; + +typedef struct _USB_HUB_NAME { + ULONG ActualLength; + WCHAR HubName[1]; +} USB_HUB_NAME, *PUSB_HUB_NAME; + +typedef enum _USB_HUB_NODE { + UsbHub, + UsbMIParent +} USB_HUB_NODE; + +typedef VOID STDCALL +(*USB_IDLE_CALLBACK)( + PVOID Context); + +typedef struct _USB_IDLE_CALLBACK_INFO { + USB_IDLE_CALLBACK IdleCallback; + PVOID IdleContext; +} USB_IDLE_CALLBACK_INFO, *PUSB_IDLE_CALLBACK_INFO; + +typedef struct _USB_NODE_CONNECTION_ATTRIBUTES { + ULONG ConnectionIndex; + USB_CONNECTION_STATUS ConnectionStatus; + ULONG PortAttributes; +} USB_NODE_CONNECTION_ATTRIBUTES, *PUSB_NODE_CONNECTION_ATTRIBUTES; + +typedef struct _USB_NODE_CONNECTION_DRIVERKEY_NAME { + ULONG ConnectionIndex; + ULONG ActualLength; + WCHAR DriverKeyName[1]; +} USB_NODE_CONNECTION_DRIVERKEY_NAME, *PUSB_NODE_CONNECTION_DRIVERKEY_NAME; + +typedef struct _USB_PIPE_INFO { + USB_ENDPOINT_DESCRIPTOR EndpointDescriptor; + ULONG ScheduleOffset; +} USB_PIPE_INFO, *PUSB_PIPE_INFO; + +typedef struct _USB_NODE_CONNECTION_INFORMATION { + ULONG ConnectionIndex; + USB_DEVICE_DESCRIPTOR DeviceDescriptor; + UCHAR CurrentConfigurationValue; + BOOLEAN LowSpeed; + BOOLEAN DeviceIsHub; + USHORT DeviceAddress; + ULONG NumberOfOpenPipes; + USB_CONNECTION_STATUS ConnectionStatus; + USB_PIPE_INFO PipeList[0]; +} USB_NODE_CONNECTION_INFORMATION, *PUSB_NODE_CONNECTION_INFORMATION; + +typedef struct _USB_NODE_CONNECTION_NAME { + ULONG ConnectionIndex; + ULONG ActualLength; + WCHAR NodeName[1]; +} USB_NODE_CONNECTION_NAME, *PUSB_NODE_CONNECTION_NAME; + +typedef struct _USB_MI_PARENT_INFORMATION { + ULONG NumberOfInterfaces; +} USB_MI_PARENT_INFORMATION, *PUSB_MI_PARENT_INFORMATION; + +typedef struct _USB_NODE_INFORMATION { + USB_HUB_NODE NodeType; + union { + USB_HUB_INFORMATION HubInformation; + USB_MI_PARENT_INFORMATION MiParentInformation; + } u; +} USB_NODE_INFORMATION, *PUSB_NODE_INFORMATION; + +#define WMI_USB_DRIVER_INFORMATION 0 +#define WMI_USB_DRIVER_NOTIFICATION 1 +#define WMI_USB_POWER_DEVICE_ENABLE 2 + +typedef enum _USB_NOTIFICATION_TYPE { + EnumerationFailure = 0, + InsufficentBandwidth, + InsufficentPower, + OverCurrent, + ResetOvercurrent, + AcquireBusInfo, + AcquireHubName, + AcquireControllerName, + HubOvercurrent, + HubPowerChange, + HubNestedTooDeeply, + ModernDeviceInLegacyHub +} USB_NOTIFICATION_TYPE; + +typedef struct _USB_ACQUIRE_INFO { + USB_NOTIFICATION_TYPE NotificationType; + ULONG TotalSize; + WCHAR Buffer[1]; +} USB_ACQUIRE_INFO, *PUSB_ACQUIRE_INFO; + +typedef struct _USB_NOTIFICATION { + USB_NOTIFICATION_TYPE NotificationType; +} USB_NOTIFICATION, *PUSB_NOTIFICATION; + +typedef struct _USB_BUS_NOTIFICATION { + USB_NOTIFICATION_TYPE NotificationType; + ULONG TotalBandwidth; + ULONG ConsumedBandwidth; + ULONG ControllerNameLength; +} USB_BUS_NOTIFICATION, *PUSB_BUS_NOTIFICATION; + +typedef struct _USB_CONNECTION_NOTIFICATION { + USB_NOTIFICATION_TYPE NotificationType; + ULONG ConnectionNumber; + ULONG RequestedBandwidth; + ULONG EnumerationFailReason; + ULONG PowerRequested; + ULONG HubNameLength; +} USB_CONNECTION_NOTIFICATION, *PUSB_CONNECTION_NOTIFICATION; + +typedef struct _USB_ROOT_HUB_NAME { + ULONG ActualLength; + WCHAR RootHubName[1]; +} USB_ROOT_HUB_NAME, *PUSB_ROOT_HUB_NAME; + +#include + +#ifdef __cplusplus +} +#endif + +#endif /* __USBIOCTL_H */ diff --git a/reactos/include/ddk/usbiodef.h b/reactos/include/ddk/usbiodef.h new file mode 100644 index 00000000000..d98556527fd --- /dev/null +++ b/reactos/include/ddk/usbiodef.h @@ -0,0 +1,104 @@ +/* + * usbiodef.h + * + * USB IOCTL definitions + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __USBIODEF_H +#define __USBIODEF_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +DEFINE_GUID(GUID_DEVINTERFACE_USB_HUB, \ + 0xf18a0e88, 0xc30c, 0x11d0, 0x88, 0x15, 0x00, 0xa0, 0xc9, 0x06, 0xbe, 0xd8); + +DEFINE_GUID(GUID_DEVINTERFACE_USB_DEVICE, + 0xA5DCBF10L, 0x6530, 0x11D2, 0x90, 0x1F, 0x00, 0xC0, 0x4F, 0xB9, 0x51, 0xED); + +DEFINE_GUID(GUID_DEVINTERFACE_USB_HOST_CONTROLLER, + 0x3abf6f2d, 0x71c4, 0x462a, 0x8a, 0x92, 0x1e, 0x68, 0x61, 0xe6, 0xaf, 0x27); + +DEFINE_GUID(GUID_USB_WMI_STD_DATA, + 0x4E623B20L, 0xCB14, 0x11D1, 0xB3, 0x31, 0x00, 0xA0, 0xC9, 0x59, 0xBB, 0xD2); + +DEFINE_GUID(GUID_USB_WMI_STD_NOTIFICATION, + 0x4E623B20L, 0xCB14, 0x11D1, 0xB3, 0x31, 0x00, 0xA0, 0xC9, 0x59, 0xBB, 0xD2); + +#define GUID_CLASS_USBHUB GUID_DEVINTERFACE_USB_HUB +#define GUID_CLASS_USB_DEVICE GUID_DEVINTERFACE_USB_DEVICE +#define GUID_CLASS_USB_HOST_CONTROLLER GUID_DEVINTERFACE_USB_HOST_CONTROLLER + +#define USB_SUBMIT_URB 0 +#define USB_RESET_PORT 1 +#define USB_GET_ROOTHUB_PDO 3 +#define USB_GET_PORT_STATUS 4 +#define USB_ENABLE_PORT 5 +#define USB_GET_HUB_COUNT 6 +#define USB_CYCLE_PORT 7 +#define USB_GET_HUB_NAME 8 +#define USB_IDLE_NOTIFICATION 9 +#define USB_GET_BUS_INFO 264 +#define USB_GET_CONTROLLER_NAME 265 +#define USB_GET_BUSGUID_INFO 266 +#define USB_GET_PARENT_HUB_INFO 267 +#define USB_GET_DEVICE_HANDLE 268 + +#define HCD_GET_STATS_1 255 +#define HCD_DIAGNOSTIC_MODE_ON 256 +#define HCD_DIAGNOSTIC_MODE_OFF 257 +#define HCD_GET_ROOT_HUB_NAME 258 +#define HCD_GET_DRIVERKEY_NAME 265 +#define HCD_GET_STATS_2 266 +#define HCD_DISABLE_PORT 268 +#define HCD_ENABLE_PORT 269 +#define HCD_USER_REQUEST 270 + +#define USB_GET_NODE_INFORMATION 258 +#define USB_GET_NODE_CONNECTION_INFORMATION 259 +#define USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION 260 +#define USB_GET_NODE_CONNECTION_NAME 261 +#define USB_DIAG_IGNORE_HUBS_ON 262 +#define USB_DIAG_IGNORE_HUBS_OFF 263 +#define USB_GET_NODE_CONNECTION_DRIVERKEY_NAME 264 +#define USB_GET_HUB_CAPABILITIES 271 +#define USB_GET_NODE_CONNECTION_ATTRIBUTES 272 + +#define FILE_DEVICE_USB FILE_DEVICE_UNKNOWN + +#define USB_CTL(id) CTL_CODE(FILE_DEVICE_USB, \ + (id), \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define USB_KERNEL_CTL(id) CTL_CODE(FILE_DEVICE_USB, \ + (id), \ + METHOD_NEITHER, \ + FILE_ANY_ACCESS) + +#ifdef __cplusplus +} +#endif + +#endif /* __USBIODEF_H */ diff --git a/reactos/include/ddk/usbscan.h b/reactos/include/ddk/usbscan.h new file mode 100644 index 00000000000..73a1c784438 --- /dev/null +++ b/reactos/include/ddk/usbscan.h @@ -0,0 +1,156 @@ +/* + * usbscan.h + * + * USB scanner definitions + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __USBSCAN_H +#define __USBSCAN_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define FILE_DEVICE_USB_SCAN 0x8000 +#define IOCTL_INDEX 0x0800 + +#define IOCTL_CANCEL_IO \ + CTL_CODE(FILE_DEVICE_USB_SCAN, IOCTL_INDEX + 1, METHOD_BUFFERED,FILE_ANY_ACCESS) + +#define IOCTL_GET_VERSION \ + CTL_CODE(FILE_DEVICE_USB_SCAN, IOCTL_INDEX + 0, METHOD_BUFFERED,FILE_ANY_ACCESS) + +#define IOCTL_GET_CHANNEL_ALIGN_RQST \ + CTL_CODE(FILE_DEVICE_USB_SCAN, IOCTL_INDEX + 5, METHOD_BUFFERED,FILE_ANY_ACCESS) + +#define IOCTL_GET_DEVICE_DESCRIPTOR \ + CTL_CODE(FILE_DEVICE_USB_SCAN, IOCTL_INDEX + 6, METHOD_BUFFERED,FILE_ANY_ACCESS) + +#define IOCTL_GET_PIPE_CONFIGURATION \ + CTL_CODE(FILE_DEVICE_USB_SCAN, IOCTL_INDEX + 10,METHOD_BUFFERED,FILE_ANY_ACCESS) + +#define IOCTL_GET_USB_DESCRIPTOR \ + CTL_CODE(FILE_DEVICE_USB_SCAN, IOCTL_INDEX + 8, METHOD_BUFFERED,FILE_ANY_ACCESS) + +#define IOCTL_READ_REGISTERS \ + CTL_CODE(FILE_DEVICE_USB_SCAN, IOCTL_INDEX + 3, METHOD_BUFFERED,FILE_ANY_ACCESS) + +#define IOCTL_RESET_PIPE \ + CTL_CODE(FILE_DEVICE_USB_SCAN, IOCTL_INDEX + 7, METHOD_BUFFERED,FILE_ANY_ACCESS) + +#define IOCTL_SEND_USB_REQUEST \ + CTL_CODE(FILE_DEVICE_USB_SCAN, IOCTL_INDEX + 9, METHOD_BUFFERED,FILE_ANY_ACCESS) + +#define IOCTL_SET_TIMEOUT \ + CTL_CODE(FILE_DEVICE_USB_SCAN, IOCTL_INDEX + 11,METHOD_BUFFERED,FILE_ANY_ACCESS) + +#define IOCTL_WAIT_ON_DEVICE_EVENT \ + CTL_CODE(FILE_DEVICE_USB_SCAN, IOCTL_INDEX + 2, METHOD_BUFFERED,FILE_ANY_ACCESS) + +#define IOCTL_WRITE_REGISTERS \ + CTL_CODE(FILE_DEVICE_USB_SCAN, IOCTL_INDEX + 4, METHOD_BUFFERED, FILE_ANY_ACCESS) + + +#define MAX_NUM_PIPES 8 + +#define BULKIN_FLAG 0x80 + +typedef struct _CHANNEL_INFO { + OUT ULONG EventChannelSize; + OUT ULONG uReadDataAlignment; + OUT ULONG uWriteDataAlignment; +}CHANNEL_INFO, *PCHANNEL_INFO; + +typedef struct _DEVICE_DESCRIPTOR { + OUT USHORT usVendorId; + OUT USHORT usProductId; + OUT USHORT usBcdDevice; + OUT USHORT usLanguageId; +} DEVICE_DESCRIPTOR, *PDEVICE_DESCRIPTOR; + +typedef struct _DRV_VERSION { + OUT ULONG major; + OUT ULONG minor; + OUT ULONG internal; +} DRV_VERSION, *PDRV_VERSION; + +typedef struct _IO_BLOCK { + IN ULONG uOffset; + IN ULONG uLength; + IN OUT PUCHAR pbyData; + IN ULONG uIndex; +} IO_BLOCK, *PIO_BLOCK; + +typedef struct _IO_BLOCK_EX { + IN ULONG uOffset; + IN ULONG uLength; + IN OUT PUCHAR pbyData; + IN ULONG uIndex; + IN UCHAR bRequest; + IN UCHAR bmRequestType; + IN UCHAR fTransferDirectionIn; +} IO_BLOCK_EX, *PIO_BLOCK_EX; + +typedef struct _USBSCAN_GET_DESCRIPTOR { + IN UCHAR DescriptorType; + IN UCHAR Index; + IN USHORT LanguageId; +} USBSCAN_GET_DESCRIPTOR, *PUSBSCAN_GET_DESCRIPTOR; + +typedef enum _RAW_PIPE_TYPE { + USBSCAN_PIPE_CONTROL, + USBSCAN_PIPE_ISOCHRONOUS, + USBSCAN_PIPE_BULK, + USBSCAN_PIPE_INTERRUPT +} RAW_PIPE_TYPE; + +typedef struct _USBSCAN_PIPE_INFORMATION { + USHORT MaximumPacketSize; + UCHAR EndpointAddress; + UCHAR Interval; + RAW_PIPE_TYPE PipeType; +} USBSCAN_PIPE_INFORMATION, *PUSBSCAN_PIPE_INFORMATION; + +typedef struct _USBSCAN_PIPE_CONFIGURATION { + OUT ULONG NumberOfPipes; + OUT USBSCAN_PIPE_INFORMATION PipeInfo[MAX_NUM_PIPES]; +} USBSCAN_PIPE_CONFIGURATION, *PUSBSCAN_PIPE_CONFIGURATION; + +typedef struct _USBSCAN_TIMEOUT { + IN ULONG TimeoutRead; + IN ULONG TimeoutWrite; + IN ULONG TimeoutEvent; +} USBSCAN_TIMEOUT, *PUSBSCAN_TIMEOUT; + +typedef enum _PIPE_TYPE { + EVENT_PIPE, + READ_DATA_PIPE, + WRITE_DATA_PIPE, + ALL_PIPE +} PIPE_TYPE; + +#ifdef __cplusplus +} +#endif + +#endif /* __USBSCAN_H */ diff --git a/reactos/include/ddk/usbuser.h b/reactos/include/ddk/usbuser.h new file mode 100644 index 00000000000..921de3e87c0 --- /dev/null +++ b/reactos/include/ddk/usbuser.h @@ -0,0 +1,327 @@ +/* + * usbuser.h + * + * USB user mode IOCTL interface + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __USBUSER_H +#define __USBUSER_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include "usb.h" +#include "usbiodef.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#define USBUSER_VERSION 0x0004 + +#define IOCTL_USB_USER_REQUEST USB_CTL(HCD_USER_REQUEST) + +#ifndef IOCTL_USB_DIAGNOSTIC_MODE_ON +#define IOCTL_USB_DIAGNOSTIC_MODE_ON USB_CTL(HCD_DIAGNOSTIC_MODE_ON) +#endif +#ifndef IOCTL_USB_DIAGNOSTIC_MODE_OFF +#define IOCTL_USB_DIAGNOSTIC_MODE_OFF USB_CTL(HCD_DIAGNOSTIC_MODE_OFF) +#endif + +#ifndef IOCTL_USB_GET_ROOT_HUB_NAME +#define IOCTL_USB_GET_ROOT_HUB_NAME USB_CTL(HCD_GET_ROOT_HUB_NAME) +#endif +#ifndef IOCTL_GET_HCD_DRIVERKEY_NAME +#define IOCTL_GET_HCD_DRIVERKEY_NAME USB_CTL(HCD_GET_DRIVERKEY_NAME) +#endif + +typedef enum _USB_USER_ERROR_CODE { + UsbUserSuccess = 0, + UsbUserNotSupported, + UsbUserInvalidRequestCode, + UsbUserFeatureDisabled, + UsbUserInvalidHeaderParameter, + UsbUserInvalidParameter, + UsbUserMiniportError, + UsbUserBufferTooSmall, + UsbUserErrorNotMapped, + UsbUserDeviceNotStarted, + UsbUserNoDeviceConnected +} USB_USER_ERROR_CODE; + +#define USBUSER_GET_CONTROLLER_INFO_0 0x00000001 +#define USBUSER_GET_CONTROLLER_DRIVER_KEY 0x00000002 +#define USBUSER_PASS_THRU 0x00000003 +#define USBUSER_GET_POWER_STATE_MAP 0x00000004 +#define USBUSER_GET_BANDWIDTH_INFORMATION 0x00000005 +#define USBUSER_GET_BUS_STATISTICS_0 0x00000006 +#define USBUSER_GET_ROOTHUB_SYMBOLIC_NAME 0x00000007 +#define USBUSER_GET_USB_DRIVER_VERSION 0x00000008 +#define USBUSER_GET_USB2_HW_VERSION 0x00000009 +#define USBUSER_OP_SEND_ONE_PACKET 0x10000001 +#define USBUSER_OP_RAW_RESET_PORT 0x20000001 +#define USBUSER_OP_OPEN_RAW_DEVICE 0x20000002 +#define USBUSER_OP_CLOSE_RAW_DEVICE 0x20000003 +#define USBUSER_OP_SEND_RAW_COMMAND 0x20000004 +#define USBUSER_INVALID_REQUEST 0xFFFFFFF0 +#define USBUSER_OP_MASK_DEVONLY_API 0x10000000 +#define USBUSER_OP_MASK_HCTEST_API 0x20000000 + +#define USB_PACKETFLAG_LOW_SPEED 0x00000001 +#define USB_PACKETFLAG_FULL_SPEED 0x00000002 +#define USB_PACKETFLAG_HIGH_SPEED 0x00000004 +#define USB_PACKETFLAG_ASYNC_IN 0x00000008 +#define USB_PACKETFLAG_ASYNC_OUT 0x00000010 +#define USB_PACKETFLAG_ISO_IN 0x00000020 +#define USB_PACKETFLAG_ISO_OUT 0x00000040 +#define USB_PACKETFLAG_SETUP 0x00000080 +#define USB_PACKETFLAG_TOGGLE0 0x00000100 +#define USB_PACKETFLAG_TOGGLE1 0x00000200 + +typedef struct _PACKET_PARAMETERS { + UCHAR DeviceAddress; + UCHAR EndpointAddress; + USHORT MaximumPacketSize; + ULONG Timeout; + ULONG Flags; + ULONG DataLength; + USHORT HubDeviceAddress; + USHORT PortTTNumber; + UCHAR ErrorCount; + UCHAR Pad[3]; + USBD_STATUS UsbdStatusCode; + UCHAR Data[4]; +} PACKET_PARAMETERS, *PPACKET_PARAMETERS; + +typedef struct _RAW_RESET_PORT_PARAMETERS { + USHORT PortNumber; + USHORT PortStatus; +} RAW_RESET_PORT_PARAMETERS, *PRAW_RESET_PORT_PARAMETERS; + +typedef struct _USB_BANDWIDTH_INFO { + ULONG DeviceCount; + ULONG TotalBusBandwidth; + ULONG Total32secBandwidth; + ULONG AllocedBulkAndControl; + ULONG AllocedIso; + ULONG AllocedInterrupt_1ms; + ULONG AllocedInterrupt_2ms; + ULONG AllocedInterrupt_4ms; + ULONG AllocedInterrupt_8ms; + ULONG AllocedInterrupt_16ms; + ULONG AllocedInterrupt_32ms; +} USB_BANDWIDTH_INFO, *PUSB_BANDWIDTH_INFO; + +typedef struct _USBUSER_REQUEST_HEADER { + ULONG UsbUserRequest; + USB_USER_ERROR_CODE UsbUserStatusCode; + ULONG RequestBufferLength; + ULONG ActualBufferLength; +} USBUSER_REQUEST_HEADER, *PUSBUSER_REQUEST_HEADER; + +typedef struct _USBUSER_BANDWIDTH_INFO_REQUEST { + USBUSER_REQUEST_HEADER Header; + USB_BANDWIDTH_INFO BandwidthInformation; +} USBUSER_BANDWIDTH_INFO_REQUEST, *PUSBUSER_BANDWIDTH_INFO_REQUEST; + +typedef struct _USB_BUS_STATISTICS_0 { + ULONG DeviceCount; + LARGE_INTEGER CurrentSystemTime; + ULONG CurrentUsbFrame; + ULONG BulkBytes; + ULONG IsoBytes; + ULONG InterruptBytes; + ULONG ControlDataBytes; + ULONG PciInterruptCount; + ULONG HardResetCount; + ULONG WorkerSignalCount; + ULONG CommonBufferBytes; + ULONG WorkerIdleTimeMs; + BOOLEAN RootHubEnabled; + UCHAR RootHubDevicePowerState; + UCHAR Unused; + UCHAR NameIndex; +} USB_BUS_STATISTICS_0, *PUSB_BUS_STATISTICS_0; + +typedef struct _USBUSER_BUS_STATISTICS_0_REQUEST { + USBUSER_REQUEST_HEADER Header; + USB_BUS_STATISTICS_0 BusStatistics0; +} USBUSER_BUS_STATISTICS_0_REQUEST, *PUSBUSER_BUS_STATISTICS_0_REQUEST; + +/* USB_CONTROLLER_INFO_0.HcFeatureFlags constants */ +#define USB_HC_FEATURE_FLAG_PORT_POWER_SWITCHING 0x00000001 +#define USB_HC_FEATURE_FLAG_SEL_SUSPEND 0x00000002 +#define USB_HC_FEATURE_LEGACY_BIOS 0x00000004 + +typedef struct _USB_CLOSE_RAW_DEVICE_PARAMETERS { + ULONG xxx; +} USB_CLOSE_RAW_DEVICE_PARAMETERS , *PUSB_CLOSE_RAW_DEVICE_PARAMETERS; + +typedef struct _USBUSER_CLOSE_RAW_DEVICE { + USBUSER_REQUEST_HEADER Header; + USB_CLOSE_RAW_DEVICE_PARAMETERS Parameters; +} USBUSER_CLOSE_RAW_DEVICE, *PUSBUSER_CLOSE_RAW_DEVICE; + +typedef struct _USB_CONTROLLER_INFO_0 { + ULONG PciVendorId; + ULONG PciDeviceId; + ULONG PciRevision; + ULONG NumberOfRootPorts; + USB_CONTROLLER_FLAVOR ControllerFlavor; + ULONG HcFeatureFlags; +} USB_CONTROLLER_INFO_0 , *PUSB_CONTROLLER_INFO_0; + +typedef struct _USBUSER_CONTROLLER_INFO_0 { + USBUSER_REQUEST_HEADER Header; + USB_CONTROLLER_INFO_0 Info0; +} USBUSER_CONTROLLER_INFO_0, *PUSBUSER_CONTROLLER_INFO_0; + +typedef struct _USB_DRIVER_VERSION_PARAMETERS { + ULONG DriverTrackingCode; + ULONG USBDI_Version; + ULONG USBUSER_Version; + BOOLEAN CheckedPortDriver; + BOOLEAN CheckedMiniportDriver; + USHORT USB_Version; +} USB_DRIVER_VERSION_PARAMETERS , *PUSB_DRIVER_VERSION_PARAMETERS; + +typedef struct _USBUSER_GET_DRIVER_VERSION { + USBUSER_REQUEST_HEADER Header; + USB_DRIVER_VERSION_PARAMETERS Parameters; +} USBUSER_GET_DRIVER_VERSION, *PUSBUSER_GET_DRIVER_VERSION; + +typedef struct _USB_OPEN_RAW_DEVICE_PARAMETERS { + USHORT PortStatus; + USHORT MaxPacketEp0; +} USB_OPEN_RAW_DEVICE_PARAMETERS , *PUSB_OPEN_RAW_DEVICE_PARAMETERS; + +typedef struct _USBUSER_OPEN_RAW_DEVICE { + USBUSER_REQUEST_HEADER Header; + USB_OPEN_RAW_DEVICE_PARAMETERS Parameters; +} USBUSER_OPEN_RAW_DEVICE, *PUSBUSER_OPEN_RAW_DEVICE; + +typedef enum _WDMUSB_POWER_STATE { + WdmUsbPowerNotMapped = 0, + WdmUsbPowerSystemUnspecified = 100, + WdmUsbPowerSystemWorking, + WdmUsbPowerSystemSleeping1, + WdmUsbPowerSystemSleeping2, + WdmUsbPowerSystemSleeping3, + WdmUsbPowerSystemHibernate, + WdmUsbPowerSystemShutdown, + WdmUsbPowerDeviceUnspecified = 200, + WdmUsbPowerDeviceD0, + WdmUsbPowerDeviceD1, + WdmUsbPowerDeviceD2, + WdmUsbPowerDeviceD3 +} WDMUSB_POWER_STATE; + +typedef struct _USB_POWER_INFO { + WDMUSB_POWER_STATE SystemState; + WDMUSB_POWER_STATE HcDevicePowerState; + WDMUSB_POWER_STATE HcDeviceWake; + WDMUSB_POWER_STATE HcSystemWake; + WDMUSB_POWER_STATE RhDevicePowerState; + WDMUSB_POWER_STATE RhDeviceWake; + WDMUSB_POWER_STATE RhSystemWake; + WDMUSB_POWER_STATE LastSystemSleepState; + BOOLEAN CanWakeup; + BOOLEAN IsPowered; +} USB_POWER_INFO, *PUSB_POWER_INFO; + +typedef struct _USBUSER_POWER_INFO_REQUEST { + USBUSER_REQUEST_HEADER Header; + USB_POWER_INFO PowerInformation; +} USBUSER_POWER_INFO_REQUEST, *PUSBUSER_POWER_INFO_REQUEST; + +typedef struct _USB_UNICODE_NAME { + ULONG Length; + WCHAR String[1]; +} USB_UNICODE_NAME, *PUSB_UNICODE_NAME; + +typedef struct _USBUSER_CONTROLLER_UNICODE_NAME { + USBUSER_REQUEST_HEADER Header; + USB_UNICODE_NAME UnicodeName; +} USBUSER_CONTROLLER_UNICODE_NAME, *PUSBUSER_CONTROLLER_UNICODE_NAME; + +typedef struct _USB_PASS_THRU_PARAMETERS { + GUID FunctionGUID; + ULONG ParameterLength; + UCHAR Parameters[4]; +} USB_PASS_THRU_PARAMETERS, *PUSB_PASS_THRU_PARAMETERS; + +typedef struct _USBUSER_PASS_THRU_REQUEST { + USBUSER_REQUEST_HEADER Header; + USB_PASS_THRU_PARAMETERS PassThru; +} USBUSER_PASS_THRU_REQUEST, *PUSBUSER_PASS_THRU_REQUEST; + +typedef struct _USBUSER_RAW_RESET_ROOT_PORT { + USBUSER_REQUEST_HEADER Header; + RAW_RESET_PORT_PARAMETERS Parameters; +} USBUSER_RAW_RESET_ROOT_PORT, *PUSBUSER_RAW_RESET_ROOT_PORT; + +typedef struct _USBUSER_SEND_ONE_PACKET { + USBUSER_REQUEST_HEADER Header; + PACKET_PARAMETERS PacketParameters; +} USBUSER_SEND_ONE_PACKET, *PUSBUSER_SEND_ONE_PACKET; + +typedef struct _USB_SEND_RAW_COMMAND_PARAMETERS { + UCHAR Usb_bmRequest; + UCHAR Usb_bRequest; + USHORT Usb_wVlaue; + USHORT Usb_wIndex; + USHORT Usb_wLength; + USHORT DeviceAddress; + USHORT MaximumPacketSize; + ULONG Timeout; + ULONG DataLength; + USBD_STATUS UsbdStatusCode; + UCHAR Data[4]; +} USB_SEND_RAW_COMMAND_PARAMETERS, *PUSB_SEND_RAW_COMMAND_PARAMETERS; + +typedef struct _USBUSER_SEND_RAW_COMMAND { + USBUSER_REQUEST_HEADER Header; + USB_SEND_RAW_COMMAND_PARAMETERS Parameters; +} USBUSER_SEND_RAW_COMMAND, *PUSBUSER_SEND_RAW_COMMAND; + +/* USB_USB2HW_VERSION_PARAMETERS.Usb2HwRevision constants */ +#define USB2HW_UNKNOWN 0x00 +#define USB2HW_A0 0xA0 +#define USB2HW_A1 0xA1 +#define USB2HW_B0 0xB0 + +typedef struct _USB_USB2HW_VERSION_PARAMETERS { + UCHAR Usb2HwRevision; +} USB_USB2HW_VERSION_PARAMETERS, *PUSB_USB2HW_VERSION_PARAMETERS; + +typedef struct _USBUSER_GET_USB2HW_VERSION { + USBUSER_REQUEST_HEADER Header; + USB_USB2HW_VERSION_PARAMETERS Parameters; +} USBUSER_GET_USB2HW_VERSION, *PUSBUSER_GET_USB2HW_VERSION; + +#include + +#ifdef __cplusplus +} +#endif + +#endif /* __USBUSER_H */ diff --git a/reactos/include/ddk/video.h b/reactos/include/ddk/video.h new file mode 100644 index 00000000000..186eb916b60 --- /dev/null +++ b/reactos/include/ddk/video.h @@ -0,0 +1,1562 @@ +/* + * video.h + * + * Video port and miniport driver interface + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __VIDEO_H +#define __VIDEO_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __WINDDI_H +#error winddi.h cannot be included with video.h +#else + +#if defined(_VIDEOPORT_) + #define VPAPI DECLSPEC_EXPORT +#else + #define VPAPI DECLSPEC_IMPORT +#endif + +#include "videoagp.h" +#include "ntddvdeo.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef LONG VP_STATUS; +typedef VP_STATUS *PVP_STATUS; +typedef struct __DMA_PARAMETERS * PDMA; +typedef struct _VIDEO_PORT_EVENT *PEVENT; +typedef struct _VIDEO_PORT_SPIN_LOCK *PSPIN_LOCK; +typedef struct __VP_DMA_ADAPTER *PVP_DMA_ADAPTER; + +#define DISPLAY_ADAPTER_HW_ID 0xFFFFFFFF + +#define EVENT_TYPE_MASK 1 +#define SYNCHRONIZATION_EVENT 0 +#define NOTIFICATION_EVENT 1 + +#define INITIAL_EVENT_STATE_MASK 2 +#define INITIAL_EVENT_NOT_SIGNALED 0 +#define INITIAL_EVENT_SIGNALED 2 + +typedef enum VIDEO_DEBUG_LEVEL { + Error = 0, + Warn, + Trace, + Info +} VIDEO_DEBUG_LEVEL, *PVIDEO_DEBUG_LEVEL; + +typedef enum { + VideoPortUnlockAfterDma = 1, + VideoPortKeepPagesLocked, + VideoPortDmaInitOnly +} DMA_FLAGS; + +typedef enum _HW_DMA_RETURN { + DmaAsyncReturn, + DmaSyncReturn +} HW_DMA_RETURN, *PHW_DMA_RETURN; + +typedef HW_DMA_RETURN +(*PVIDEO_HW_START_DMA)( + PVOID HwDeviceExtension, + PDMA pDma); + + +#ifdef DBG + +#define PAGED_CODE() \ + if (VideoPortGetCurrentIrql() > 1 /* APC_LEVEL */) \ + { \ + VideoPortDebugPrint(Error, "Video: Pageable code called at IRQL %d\n", VideoPortGetCurrentIrql() ); \ + ASSERT(FALSE); \ + } + +#else + +#define PAGED_CODE() + +#endif + +typedef struct _VIDEO_HARDWARE_CONFIGURATION_DATA { + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + USHORT Version; + USHORT Revision; + USHORT Irql; + USHORT Vector; + ULONG ControlBase; + ULONG ControlSize; + ULONG CursorBase; + ULONG CursorSize; + ULONG FrameBase; + ULONG FrameSize; +} VIDEO_HARDWARE_CONFIGURATION_DATA, *PVIDEO_HARDWARE_CONFIGURATION_DATA; + +#define SIZE_OF_NT4_VIDEO_PORT_CONFIG_INFO 0x42 +#define SIZE_OF_NT4_VIDEO_HW_INITIALIZATION_DATA 0x28 +#define SIZE_OF_W2K_VIDEO_HW_INITIALIZATION_DATA 0x50 + +typedef enum _VIDEO_DEVICE_DATA_TYPE { + VpMachineData = 0, + VpCmosData, + VpBusData, + VpControllerData, + VpMonitorData +} VIDEO_DEVICE_DATA_TYPE, *PVIDEO_DEVICE_DATA_TYPE; + + + +/* Video miniport driver functions */ + +typedef struct _VP_SCATTER_GATHER_ELEMENT { + PHYSICAL_ADDRESS Address; + ULONG Length; + ULONG_PTR Reserved; +} VP_SCATTER_GATHER_ELEMENT, *PVP_SCATTER_GATHER_ELEMENT; + +typedef struct _VP_SCATTER_GATHER_LIST { + ULONG NumberOfElements; + ULONG_PTR Reserved; + VP_SCATTER_GATHER_ELEMENT Elements[0]; +} VP_SCATTER_GATHER_LIST, *PVP_SCATTER_GATHER_LIST; + +typedef VOID DDKAPI +(*PEXECUTE_DMA)( + IN PVOID HwDeviceExtension, + IN PVP_DMA_ADAPTER VpDmaAdapter, + IN PVP_SCATTER_GATHER_LIST SGList, + IN PVOID Context); + +typedef PVOID DDKAPI +(*PVIDEO_PORT_GET_PROC_ADDRESS)( + IN PVOID HwDeviceExtension, + IN PUCHAR FunctionName); + +typedef struct _VIDEO_PORT_CONFIG_INFO { + ULONG Length; + ULONG SystemIoBusNumber; + INTERFACE_TYPE AdapterInterfaceType; + ULONG BusInterruptLevel; + ULONG BusInterruptVector; + KINTERRUPT_MODE InterruptMode; + ULONG NumEmulatorAccessEntries; + PEMULATOR_ACCESS_ENTRY EmulatorAccessEntries; + ULONG_PTR EmulatorAccessEntriesContext; + PHYSICAL_ADDRESS VdmPhysicalVideoMemoryAddress; + ULONG VdmPhysicalVideoMemoryLength; + ULONG HardwareStateSize; + ULONG DmaChannel; + ULONG DmaPort; + UCHAR DmaShareable; + UCHAR InterruptShareable; + BOOLEAN Master; + DMA_WIDTH DmaWidth; + DMA_SPEED DmaSpeed; + BOOLEAN bMapBuffers; + BOOLEAN NeedPhysicalAddresses; + BOOLEAN DemandMode; + ULONG MaximumTransferLength; + ULONG NumberOfPhysicalBreaks; + BOOLEAN ScatterGather; + ULONG MaximumScatterGatherChunkSize; + PVIDEO_PORT_GET_PROC_ADDRESS VideoPortGetProcAddress; + PWSTR DriverRegistryPath; + ULONGLONG SystemMemorySize; +} VIDEO_PORT_CONFIG_INFO, *PVIDEO_PORT_CONFIG_INFO; + +typedef VP_STATUS DDKAPI +(*PVIDEO_HW_FIND_ADAPTER)( + IN PVOID HwDeviceExtension, + IN PVOID HwContext, + IN PWSTR ArgumentString, + IN OUT PVIDEO_PORT_CONFIG_INFO ConfigInfo, + OUT PUCHAR Again); + +typedef VP_STATUS DDKAPI +(*PVIDEO_HW_POWER_GET)( + IN PVOID HwDeviceExtension, + IN ULONG HwId, + IN OUT PVIDEO_POWER_MANAGEMENT VideoPowerControl); + +/* PVIDEO_HW_GET_CHILD_DESCRIPTOR return values */ +#define VIDEO_ENUM_MORE_DEVICES ERROR_CONTINUE +#define VIDEO_ENUM_NO_MORE_DEVICES ERROR_NO_MORE_DEVICES +#define VIDEO_ENUM_INVALID_DEVICE ERROR_INVALID_NAME + +/* PVIDEO_HW_GET_CHILD_DESCRIPTOR.ChildEnumInfo constants */ +typedef struct _VIDEO_CHILD_ENUM_INFO { + ULONG Size; + ULONG ChildDescriptorSize; + ULONG ChildIndex; + ULONG ACPIHwId; + PVOID ChildHwDeviceExtension; +} VIDEO_CHILD_ENUM_INFO, *PVIDEO_CHILD_ENUM_INFO; + +/* PVIDEO_HW_GET_CHILD_DESCRIPTOR.VideoChildType constants */ +typedef enum _VIDEO_CHILD_TYPE { + Monitor = 1, + NonPrimaryChip, + VideoChip, + Other +} VIDEO_CHILD_TYPE, *PVIDEO_CHILD_TYPE; + +typedef VP_STATUS +(DDKAPI *PVIDEO_HW_GET_CHILD_DESCRIPTOR)( + IN PVOID HwDeviceExtension, + IN PVIDEO_CHILD_ENUM_INFO ChildEnumInfo, + OUT PVIDEO_CHILD_TYPE VideoChildType, + OUT PUCHAR pChildDescriptor, + OUT PULONG UId, + OUT PULONG pUnused); + +typedef BOOLEAN +(DDKAPI *PVIDEO_HW_INITIALIZE)( + IN PVOID HwDeviceExtension); + +typedef BOOLEAN +(DDKAPI *PVIDEO_HW_INTERRUPT)( + IN PVOID HwDeviceExtension); + +/* VIDEO_ACCESS_RANGE.RangePassive */ +#define VIDEO_RANGE_PASSIVE_DECODE 1 +#define VIDEO_RANGE_10_BIT_DECODE 2 + +#ifndef VIDEO_ACCESS_RANGE_DEFINED /* also in miniport.h */ +#define VIDEO_ACCESS_RANGE_DEFINED +typedef struct _VIDEO_ACCESS_RANGE { + PHYSICAL_ADDRESS RangeStart; + ULONG RangeLength; + UCHAR RangeInIoSpace; + UCHAR RangeVisible; + UCHAR RangeShareable; + UCHAR RangePassive; +} VIDEO_ACCESS_RANGE, *PVIDEO_ACCESS_RANGE; +#endif + +typedef VOID DDKAPI +(*PVIDEO_HW_LEGACYRESOURCES)( + IN ULONG VendorId, + IN ULONG DeviceId, + IN OUT PVIDEO_ACCESS_RANGE *LegacyResourceList, + IN OUT PULONG LegacyResourceCount); + +typedef VP_STATUS DDKAPI +(*PMINIPORT_QUERY_DEVICE_ROUTINE)( + IN PVOID HwDeviceExtension, + IN PVOID Context, + IN VIDEO_DEVICE_DATA_TYPE DeviceDataType, + IN PVOID Identifier, + IN ULONG IdentifierLength, + IN PVOID ConfigurationData, + IN ULONG ConfigurationDataLength, + IN OUT PVOID ComponentInformation, + IN ULONG ComponentInformationLength); + +typedef struct _QUERY_INTERFACE { + CONST GUID *InterfaceType; + USHORT Size; + USHORT Version; + PINTERFACE Interface; + PVOID InterfaceSpecificData; +} QUERY_INTERFACE, *PQUERY_INTERFACE; + +typedef VP_STATUS +(DDKAPI *PVIDEO_HW_QUERY_INTERFACE)( + IN PVOID HwDeviceExtension, + IN OUT PQUERY_INTERFACE QueryInterface); + +typedef VP_STATUS +(DDKAPI *PMINIPORT_GET_REGISTRY_ROUTINE)( + IN PVOID HwDeviceExtension, + IN PVOID Context, + IN OUT PWSTR ValueName, + IN OUT PVOID ValueData, + IN ULONG ValueLength); + +typedef BOOLEAN +(DDKAPI *PVIDEO_HW_RESET_HW)( + IN PVOID HwDeviceExtension, + IN ULONG Columns, + IN ULONG Rows); + +typedef VP_STATUS +(DDKAPI *PVIDEO_HW_POWER_SET)( + IN PVOID HwDeviceExtension, + IN ULONG HwId, + IN PVIDEO_POWER_MANAGEMENT VideoPowerControl); + +typedef struct _STATUS_BLOCK { + _ANONYMOUS_UNION union { + VP_STATUS Status; + PVOID Pointer; + } DUMMYUNIONNAME; + ULONG_PTR Information; +} STATUS_BLOCK, *PSTATUS_BLOCK; + +typedef struct _VIDEO_REQUEST_PACKET { + ULONG IoControlCode; + PSTATUS_BLOCK StatusBlock; + PVOID InputBuffer; + ULONG InputBufferLength; + PVOID OutputBuffer; + ULONG OutputBufferLength; +} VIDEO_REQUEST_PACKET, *PVIDEO_REQUEST_PACKET; + +typedef BOOLEAN +(DDKAPI *PVIDEO_HW_START_IO)( + IN PVOID HwDeviceExtension, + IN PVIDEO_REQUEST_PACKET RequestPacket); + +typedef BOOLEAN +(DDKAPI *PMINIPORT_SYNCHRONIZE_ROUTINE)( + IN PVOID Context); + +typedef VOID +(DDKAPI *PVIDEO_HW_TIMER)( + IN PVOID HwDeviceExtension); + +typedef VOID +(DDKAPI *PMINIPORT_DPC_ROUTINE)( + IN PVOID HwDeviceExtension, + IN PVOID Context); + +typedef VP_STATUS +(DDKAPI *PDRIVER_IO_PORT_UCHAR)( + IN ULONG_PTR Context, + IN ULONG Port, + IN UCHAR AccessMode, + IN PUCHAR Data); + +typedef VP_STATUS +(DDKAPI *PDRIVER_IO_PORT_UCHAR_STRING)( + IN ULONG_PTR Context, + IN ULONG Port, + IN UCHAR AccessMode, + IN PUCHAR Data, + IN ULONG DataLength); + +typedef VP_STATUS +(DDKAPI *PDRIVER_IO_PORT_ULONG)( + IN ULONG_PTR Context, + IN ULONG Port, + IN UCHAR AccessMode, + IN PULONG Data); + +typedef VP_STATUS +(DDKAPI *PDRIVER_IO_PORT_ULONG_STRING)( + IN ULONG_PTR Context, + IN ULONG Port, + IN UCHAR AccessMode, + IN PULONG Data, + IN ULONG DataLength); + +typedef VP_STATUS +(DDKAPI *PDRIVER_IO_PORT_USHORT)( + IN ULONG_PTR Context, + IN ULONG Port, + IN UCHAR AccessMode, + IN PUSHORT Data); + +typedef VP_STATUS +(DDKAPI *PDRIVER_IO_PORT_USHORT_STRING)( + IN ULONG_PTR Context, + IN ULONG Port, + IN UCHAR AccessMode, + IN PUSHORT Data, + IN ULONG DataLength); + + + +typedef struct _INT10_BIOS_ARGUMENTS { + ULONG Eax; + ULONG Ebx; + ULONG Ecx; + ULONG Edx; + ULONG Esi; + ULONG Edi; + ULONG Ebp; + USHORT SegDs; + USHORT SegEs; +} INT10_BIOS_ARGUMENTS, *PINT10_BIOS_ARGUMENTS; + +typedef struct _VIDEO_CHILD_STATE { + ULONG Id; + ULONG State; +} VIDEO_CHILD_STATE, *PVIDEO_CHILD_STATE; + +typedef struct _VIDEO_CHILD_STATE_CONFIGURATION { + ULONG Count; + VIDEO_CHILD_STATE ChildStateArray[ANYSIZE_ARRAY]; +} VIDEO_CHILD_STATE_CONFIGURATION, *PVIDEO_CHILD_STATE_CONFIGURATION; + +typedef struct _VIDEO_HW_INITIALIZATION_DATA { + ULONG HwInitDataSize; + INTERFACE_TYPE AdapterInterfaceType; + PVIDEO_HW_FIND_ADAPTER HwFindAdapter; + PVIDEO_HW_INITIALIZE HwInitialize; + PVIDEO_HW_INTERRUPT HwInterrupt; + PVIDEO_HW_START_IO HwStartIO; + ULONG HwDeviceExtensionSize; + ULONG StartingDeviceNumber; + PVIDEO_HW_RESET_HW HwResetHw; + PVIDEO_HW_TIMER HwTimer; + PVIDEO_HW_START_DMA HwStartDma; + PVIDEO_HW_POWER_SET HwSetPowerState; + PVIDEO_HW_POWER_GET HwGetPowerState; + PVIDEO_HW_GET_CHILD_DESCRIPTOR HwGetVideoChildDescriptor; + PVIDEO_HW_QUERY_INTERFACE HwQueryInterface; + ULONG HwChildDeviceExtensionSize; + PVIDEO_ACCESS_RANGE HwLegacyResourceList; + ULONG HwLegacyResourceCount; + PVIDEO_HW_LEGACYRESOURCES HwGetLegacyResources; + BOOLEAN AllowEarlyEnumeration; + ULONG Reserved; +} VIDEO_HW_INITIALIZATION_DATA, *PVIDEO_HW_INITIALIZATION_DATA; + +/* VIDEO_PORT_AGP_INTERFACE.Version contants */ +#define VIDEO_PORT_AGP_INTERFACE_VERSION_1 1 + +typedef struct _VIDEO_PORT_AGP_INTERFACE { + SHORT Size; + SHORT Version; + PVOID Context; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; + PAGP_RESERVE_PHYSICAL AgpReservePhysical; + PAGP_RELEASE_PHYSICAL AgpReleasePhysical; + PAGP_COMMIT_PHYSICAL AgpCommitPhysical; + PAGP_FREE_PHYSICAL AgpFreePhysical; + PAGP_RESERVE_VIRTUAL AgpReserveVirtual; + PAGP_RELEASE_VIRTUAL AgpReleaseVirtual; + PAGP_COMMIT_VIRTUAL AgpCommitVirtual; + PAGP_FREE_VIRTUAL AgpFreeVirtual; + ULONGLONG AgpAllocationLimit; +} VIDEO_PORT_AGP_INTERFACE, *PVIDEO_PORT_AGP_INTERFACE; + +/* VIDEO_PORT_AGP_INTERFACE_2.Version constants */ +#define VIDEO_PORT_AGP_INTERFACE_VERSION_2 2 + +typedef struct _VIDEO_PORT_AGP_INTERFACE_2 { + IN USHORT Size; + IN USHORT Version; + OUT PVOID Context; + OUT PINTERFACE_REFERENCE InterfaceReference; + OUT PINTERFACE_DEREFERENCE InterfaceDereference; + OUT PAGP_RESERVE_PHYSICAL AgpReservePhysical; + OUT PAGP_RELEASE_PHYSICAL AgpReleasePhysical; + OUT PAGP_COMMIT_PHYSICAL AgpCommitPhysical; + OUT PAGP_FREE_PHYSICAL AgpFreePhysical; + OUT PAGP_RESERVE_VIRTUAL AgpReserveVirtual; + OUT PAGP_RELEASE_VIRTUAL AgpReleaseVirtual; + OUT PAGP_COMMIT_VIRTUAL AgpCommitVirtual; + OUT PAGP_FREE_VIRTUAL AgpFreeVirtual; + OUT ULONGLONG AgpAllocationLimit; + OUT PAGP_SET_RATE AgpSetRate; +} VIDEO_PORT_AGP_INTERFACE_2, *PVIDEO_PORT_AGP_INTERFACE_2; + +#define VIDEO_PORT_I2C_INTERFACE_VERSION_1 1 + +typedef VOID +(DDKAPI *PVIDEO_WRITE_CLOCK_LINE)( + PVOID HwDeviceExtension, + UCHAR Data); + +typedef VOID +(DDKAPI *PVIDEO_WRITE_DATA_LINE)( + PVOID HwDeviceExtension, + UCHAR Data); + +typedef BOOLEAN +(DDKAPI *PVIDEO_READ_CLOCK_LINE)( + PVOID HwDeviceExtension); + +typedef BOOLEAN +(DDKAPI *PVIDEO_READ_DATA_LINE)( + PVOID HwDeviceExtension); + +typedef struct _I2C_CALLBACKS +{ + IN PVIDEO_WRITE_CLOCK_LINE WriteClockLine; + IN PVIDEO_WRITE_DATA_LINE WriteDataLine; + IN PVIDEO_READ_CLOCK_LINE ReadClockLine; + IN PVIDEO_READ_DATA_LINE ReadDataLine; +} I2C_CALLBACKS, *PI2C_CALLBACKS; + +typedef BOOLEAN +(DDKAPI *PI2C_START)( + IN PVOID HwDeviceExtension, + IN PI2C_CALLBACKS I2CCallbacks); + +typedef BOOLEAN +(DDKAPI *PI2C_STOP)( + IN PVOID HwDeviceExtension, + IN PI2C_CALLBACKS I2CCallbacks); + +typedef BOOLEAN +(DDKAPI *PI2C_WRITE)( + IN PVOID HwDeviceExtension, + IN PI2C_CALLBACKS I2CCallbacks, + IN PUCHAR Buffer, + IN ULONG Length); + +typedef BOOLEAN +(DDKAPI *PI2C_READ)( + IN PVOID HwDeviceExtension, + IN PI2C_CALLBACKS I2CCallbacks, + OUT PUCHAR Buffer, + IN ULONG Length); + +typedef struct _VIDEO_PORT_I2C_INTERFACE { + USHORT Size; + USHORT Version; + PVOID Context; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; + PI2C_START I2CStart; + PI2C_STOP I2CStop; + PI2C_WRITE I2CWrite; + PI2C_READ I2CRead; +} VIDEO_PORT_I2C_INTERFACE, *PVIDEO_PORT_I2C_INTERFACE; + +/* VIDEO_PORT_INT10_INTERFACE.Version constants */ +#define VIDEO_PORT_INT10_INTERFACE_VERSION_1 1 + +typedef VP_STATUS +(DDKAPI *PINT10_ALLOCATE_BUFFER)( + IN PVOID Context, + OUT PUSHORT Seg, + OUT PUSHORT Off, + IN OUT PULONG Length); + +typedef VP_STATUS +(DDKAPI *PINT10_CALL_BIOS)( + IN PVOID Context, + IN OUT PINT10_BIOS_ARGUMENTS BiosArguments); + +typedef VP_STATUS +(DDKAPI *PINT10_FREE_BUFFER)( + IN PVOID Context, + IN USHORT Seg, + IN USHORT Off); + +typedef VP_STATUS +(DDKAPI *PINT10_READ_MEMORY)( + IN PVOID Context, + IN USHORT Seg, + IN USHORT Off, + OUT PVOID Buffer, + IN ULONG Length); + +typedef VP_STATUS +(DDKAPI *PINT10_WRITE_MEMORY)( + IN PVOID Context, + IN USHORT Seg, + IN USHORT Off, + IN PVOID Buffer, + IN ULONG Length); + +typedef struct _VIDEO_PORT_INT10_INTERFACE { + IN USHORT Size; + IN USHORT Version; + OUT PVOID Context; + OUT PINTERFACE_REFERENCE InterfaceReference; + OUT PINTERFACE_DEREFERENCE InterfaceDereference; + OUT PINT10_ALLOCATE_BUFFER Int10AllocateBuffer; + OUT PINT10_FREE_BUFFER Int10FreeBuffer; + OUT PINT10_READ_MEMORY Int10ReadMemory; + OUT PINT10_WRITE_MEMORY Int10WriteMemory; + OUT PINT10_CALL_BIOS Int10CallBios; +} VIDEO_PORT_INT10_INTERFACE, *PVIDEO_PORT_INT10_INTERFACE; + +/* Flags for VideoPortGetDeviceBase and VideoPortMapMemory */ +#define VIDEO_MEMORY_SPACE_MEMORY 0x00 +#define VIDEO_MEMORY_SPACE_IO 0x01 +#define VIDEO_MEMORY_SPACE_USER_MODE 0x02 +#define VIDEO_MEMORY_SPACE_DENSE 0x04 +#define VIDEO_MEMORY_SPACE_P6CACHE 0x08 + +typedef struct _VIDEO_X86_BIOS_ARGUMENTS { + ULONG Eax; + ULONG Ebx; + ULONG Ecx; + ULONG Edx; + ULONG Esi; + ULONG Edi; + ULONG Ebp; +} VIDEO_X86_BIOS_ARGUMENTS, *PVIDEO_X86_BIOS_ARGUMENTS; + +typedef struct _VP_DEVICE_DESCRIPTION { + BOOLEAN ScatterGather; + BOOLEAN Dma32BitAddresses; + BOOLEAN Dma64BitAddresses; + ULONG MaximumLength; +} VP_DEVICE_DESCRIPTION, *PVP_DEVICE_DESCRIPTION; + +typedef struct _VPOSVERSIONINFO { + IN ULONG Size; + OUT ULONG MajorVersion; + OUT ULONG MinorVersion; + OUT ULONG BuildNumber; + OUT USHORT ServicePackMajor; + OUT USHORT ServicePackMinor; +} VPOSVERSIONINFO, *PVPOSVERSIONINFO; + + + +/* Video port functions for miniports */ + +VPAPI +VOID +DDKAPI +VideoDebugPrint( + IN ULONG DebugPrintLevel, + IN PCHAR DebugMessage, + IN ...); + +VPAPI +VOID +DDKAPI +VideoPortAcquireDeviceLock( + IN PVOID HwDeviceExtension); + +VPAPI +VOID +DDKAPI +VideoPortAcquireSpinLock( + IN PVOID HwDeviceExtension, + IN PSPIN_LOCK SpinLock, + OUT PUCHAR OldIrql); + +VPAPI +VOID +DDKAPI +VideoPortAcquireSpinLockAtDpcLevel( + IN PVOID HwDeviceExtension, + IN PSPIN_LOCK SpinLock); + +VPAPI +VP_STATUS +DDKAPI +VideoPortAllocateBuffer( + IN PVOID HwDeviceExtension, + IN ULONG Size, + OUT PVOID *Buffer); + +VPAPI +PVOID +DDKAPI +VideoPortAllocateCommonBuffer( + IN PVOID HwDeviceExtension, + IN PVP_DMA_ADAPTER VpDmaAdapter, + IN ULONG DesiredLength, + OUT PPHYSICAL_ADDRESS LogicalAddress, + IN BOOLEAN CacheEnabled, + PVOID Reserved); + +VPAPI +PVOID +DDKAPI +VideoPortAllocateContiguousMemory( + IN PVOID HwDeviceExtension, + IN ULONG NumberOfBytes, + IN PHYSICAL_ADDRESS HighestAcceptableAddress); + +/* VideoPortAllocatePool.PoolType constants */ +typedef enum _VP_POOL_TYPE { + VpNonPagedPool = 0, + VpPagedPool, + VpNonPagedPoolCacheAligned = 4, + VpPagedPoolCacheAligned +} VP_POOL_TYPE, *PVP_POOL_TYPE; + +VPAPI +PVOID +DDKAPI +VideoPortAllocatePool( + IN PVOID HwDeviceExtension, + IN VP_POOL_TYPE PoolType, + IN SIZE_T NumberOfBytes, + IN ULONG Tag); + +VPAPI +PDMA +DDKAPI +VideoPortAssociateEventsWithDmaHandle( + IN PVOID HwDeviceExtension, + IN OUT PVIDEO_REQUEST_PACKET pVrp, + IN PVOID MappedUserEvent, + IN PVOID DisplayDriverEvent); + +/* VideoPortCheckForDeviceExistence.Flags constants */ +#define CDE_USE_SUBSYSTEM_IDS 0x00000001 +#define CDE_USE_REVISION 0x00000002 + +VPAPI +BOOLEAN +DDKAPI +VideoPortCheckForDeviceExistence( + IN PVOID HwDeviceExtension, + IN USHORT VendorId, + IN USHORT DeviceId, + IN UCHAR RevisionId, + IN USHORT SubVendorId, + IN USHORT SubSystemId, + IN ULONG Flags); + +VPAPI +VOID +DDKAPI +VideoPortClearEvent( + IN PVOID HwDeviceExtension, + IN PEVENT pEvent); + +VPAPI +ULONG +DDKAPI +VideoPortCompareMemory( + IN PVOID Source1, + IN PVOID Source2, + IN ULONG Length); + +VPAPI +VP_STATUS +DDKAPI +VideoPortCompleteDma( + IN PVOID HwDeviceExtension, + IN PVP_DMA_ADAPTER VpDmaAdapter, + IN PVP_SCATTER_GATHER_LIST VpScatterGather, + IN BOOLEAN WriteToDevice); + +VPAPI +VP_STATUS +DDKAPI +VideoPortCreateEvent( + IN PVOID HwDeviceExtension, + IN ULONG EventFlag, + IN PVOID Unused, + OUT PEVENT *ppEvent); + +VPAPI +VP_STATUS +DDKAPI +VideoPortCreateSecondaryDisplay( + IN PVOID HwDeviceExtension, + IN OUT PVOID *SecondaryDeviceExtension, + IN ULONG ulFlag); + +VPAPI +VP_STATUS +DDKAPI +VideoPortCreateSpinLock( + IN PVOID HwDeviceExtension, + OUT PSPIN_LOCK *SpinLock); + +typedef struct _DDC_CONTROL { + IN ULONG Size; + IN I2C_CALLBACKS I2CCallbacks; + IN UCHAR EdidSegment; +} DDC_CONTROL, *PDDC_CONTROL; + +VPAPI +BOOLEAN +DDKAPI +VideoPortDDCMonitorHelper( + IN PVOID HwDeviceExtension, + IN PVOID DDCControl, + IN OUT PUCHAR EdidBuffer, + IN ULONG EdidBufferSize); + +VPAPI +VOID +DDKCDECLAPI +VideoPortDebugPrint( + IN VIDEO_DEBUG_LEVEL DebugPrintLevel, + IN PCHAR DebugMessage, + IN ...); + +VPAPI +VP_STATUS +DDKAPI +VideoPortDeleteEvent( + IN PVOID HwDeviceExtension, + IN PEVENT pEvent); + +VPAPI +VP_STATUS +DDKAPI +VideoPortDeleteSpinLock( + IN PVOID HwDeviceExtension, + IN PSPIN_LOCK SpinLock); + +VPAPI +VP_STATUS +DDKAPI +VideoPortDisableInterrupt( + IN PVOID HwDeviceExtension); + +VPAPI +PDMA +DDKAPI +VideoPortDoDma( + IN PVOID HwDeviceExtension, + IN PDMA pDma, + IN DMA_FLAGS DmaFlags); + +VPAPI +VP_STATUS +DDKAPI +VideoPortEnableInterrupt( + IN PVOID HwDeviceExtension); + +VPAPI +VP_STATUS +DDKAPI +VideoPortEnumerateChildren( + IN PVOID HwDeviceExtension, + IN PVOID Reserved); + +VPAPI +VOID +DDKAPI +VideoPortFreeCommonBuffer( + IN PVOID HwDeviceExtension, + IN ULONG Length, + IN PVOID VirtualAddress, + IN PHYSICAL_ADDRESS LogicalAddress, + IN BOOLEAN CacheEnabled); + +VPAPI +VOID +DDKAPI +VideoPortFreeDeviceBase( + IN PVOID HwDeviceExtension, + IN PVOID MappedAddress); + +VPAPI +VOID +DDKAPI +VideoPortFreePool( + IN PVOID HwDeviceExtension, + IN PVOID Ptr); + +VPAPI +VP_STATUS +DDKAPI +VideoPortGetAccessRanges( + IN PVOID HwDeviceExtension, + IN ULONG NumRequestedResources, + IN PIO_RESOURCE_DESCRIPTOR RequestedResources OPTIONAL, + IN ULONG NumAccessRanges, + OUT PVIDEO_ACCESS_RANGE AccessRanges, + IN PVOID VendorId, + IN PVOID DeviceId, + OUT PULONG Slot); + +VPAPI +PVOID +DDKAPI +VideoPortGetAssociatedDeviceExtension( + IN PVOID DeviceObject); + +VPAPI +ULONG +DDKAPI +VideoPortGetAssociatedDeviceID( + IN PVOID DeviceObject); + +VPAPI +ULONG +DDKAPI +VideoPortGetBusData( + IN PVOID HwDeviceExtension, + IN BUS_DATA_TYPE BusDataType, + IN ULONG SlotNumber, + IN OUT PVOID Buffer, + IN ULONG Offset, + IN ULONG Length); + +VPAPI +ULONG +DDKAPI +VideoPortGetBytesUsed( + IN PVOID HwDeviceExtension, + IN PDMA pDma); + +VPAPI +PVOID +DDKAPI +VideoPortGetCommonBuffer( + IN PVOID HwDeviceExtension, + IN ULONG DesiredLength, + IN ULONG Alignment, + OUT PPHYSICAL_ADDRESS LogicalAddress, + OUT PULONG pActualLength, + IN BOOLEAN CacheEnabled); + +VPAPI +UCHAR +DDKAPI +VideoPortGetCurrentIrql( + VOID); + +VPAPI +PVOID +DDKAPI +VideoPortGetDeviceBase( + IN PVOID HwDeviceExtension, + IN PHYSICAL_ADDRESS IoAddress, + IN ULONG NumberOfUchars, + IN UCHAR InIoSpace); + +VPAPI +VP_STATUS +DDKAPI +VideoPortGetDeviceData( + IN PVOID HwDeviceExtension, + IN VIDEO_DEVICE_DATA_TYPE DeviceDataType, + IN PMINIPORT_QUERY_DEVICE_ROUTINE CallbackRoutine, + IN PVOID Context); + +VPAPI +PVP_DMA_ADAPTER +DDKAPI +VideoPortGetDmaAdapter( + IN PVOID HwDeviceExtension, + IN PVP_DEVICE_DESCRIPTION VpDeviceDescription); + +VPAPI +PVOID +DDKAPI +VideoPortGetDmaContext( + IN PVOID HwDeviceExtension, + IN PDMA pDma); + +VPAPI +PVOID +DDKAPI +VideoPortGetMdl( + IN PVOID HwDeviceExtension, + IN PDMA pDma); + +VPAPI +VP_STATUS +DDKAPI +VideoPortGetRegistryParameters( + IN PVOID HwDeviceExtension, + IN PWSTR ParameterName, + IN UCHAR IsParameterFileName, + IN PMINIPORT_GET_REGISTRY_ROUTINE CallbackRoutine, + IN PVOID Context); + +VPAPI +PVOID +DDKAPI +VideoPortGetRomImage( + IN PVOID HwDeviceExtension, + IN PVOID Unused1, + IN ULONG Unused2, + IN ULONG Length); + +VPAPI +VP_STATUS +DDKAPI +VideoPortGetVersion( + IN PVOID HwDeviceExtension, + IN OUT PVPOSVERSIONINFO pVpOsVersionInfo); + +VPAPI +VP_STATUS +DDKAPI +VideoPortGetVgaStatus( + IN PVOID HwDeviceExtension, + OUT PULONG VgaStatus); + +VPAPI +ULONG +DDKAPI +VideoPortInitialize( + IN PVOID Argument1, + IN PVOID Argument2, + IN PVIDEO_HW_INITIALIZATION_DATA HwInitializationData, + IN PVOID HwContext); + +VPAPI +VP_STATUS +DDKAPI +VideoPortInt10( + IN PVOID HwDeviceExtension, + IN PVIDEO_X86_BIOS_ARGUMENTS BiosArguments); + +VPAPI +LONG +DDKFASTAPI +VideoPortInterlockedDecrement( + IN PLONG Addend); + +VPAPI +LONG +DDKFASTAPI +VideoPortInterlockedExchange( + IN OUT PLONG Target, + IN LONG Value); + +VPAPI +LONG +DDKFASTAPI +VideoPortInterlockedIncrement( + IN PLONG Addend); + +typedef enum _VP_LOCK_OPERATION { + VpReadAccess = 0, + VpWriteAccess, + VpModifyAccess +} VP_LOCK_OPERATION; + +VPAPI +PVOID +DDKAPI +VideoPortLockBuffer( + IN PVOID HwDeviceExtension, + IN PVOID BaseAddress, + IN ULONG Length, + IN VP_LOCK_OPERATION Operation); + +VPAPI +BOOLEAN +DDKAPI +VideoPortLockPages( + IN PVOID HwDeviceExtension, + IN OUT PVIDEO_REQUEST_PACKET pVrp, + IN OUT PEVENT pUEvent, + IN PEVENT pDisplayEvent, + IN DMA_FLAGS DmaFlags); + +VPAPI +VOID +DDKAPI +VideoPortLogError( + IN PVOID HwDeviceExtension, + IN PVIDEO_REQUEST_PACKET Vrp OPTIONAL, + IN VP_STATUS ErrorCode, + IN ULONG UniqueId); + +VPAPI +VP_STATUS +DDKAPI +VideoPortMapBankedMemory( + IN PVOID HwDeviceExtension, + IN PHYSICAL_ADDRESS PhysicalAddress, + IN OUT PULONG Length, + PULONG InIoSpace, + PVOID *VirtualAddress, + ULONG BankLength, + UCHAR ReadWriteBank, + PBANKED_SECTION_ROUTINE BankRoutine, + PVOID Context); + +VPAPI +PDMA +DDKAPI +VideoPortMapDmaMemory( + IN PVOID HwDeviceExtension, + IN PVIDEO_REQUEST_PACKET pVrp, + IN PHYSICAL_ADDRESS BoardAddress, + IN PULONG Length, + IN PULONG InIoSpace, + IN PVOID MappedUserEvent, + IN PVOID DisplayDriverEvent, + IN OUT PVOID *VirtualAddress); + +VPAPI +VP_STATUS +DDKAPI +VideoPortMapMemory( + IN PVOID HwDeviceExtension, + IN PHYSICAL_ADDRESS PhysicalAddress, + IN OUT PULONG Length, + IN PULONG InIoSpace, + IN OUT PVOID *VirtualAddress); + +VPAPI +VOID +DDKAPI +VideoPortMoveMemory( + IN PVOID Destination, + IN PVOID Source, + IN ULONG Length); + +VPAPI +VOID +DDKAPI +VideoPortPutDmaAdapter( + IN PVOID HwDeviceExtension, + IN PVP_DMA_ADAPTER VpDmaAdapter); + +VPAPI +LONGLONG +DDKAPI +VideoPortQueryPerformanceCounter( + IN PVOID HwDeviceExtension, + OUT PLONGLONG PerformanceFrequency OPTIONAL); + +/* VideoPortQueryServices.ServicesType constants */ +typedef enum _VIDEO_PORT_SERVICES { + VideoPortServicesAGP = 1, + VideoPortServicesI2C, + VideoPortServicesHeadless, + VideoPortServicesInt10 +} VIDEO_PORT_SERVICES; + +VPAPI +VP_STATUS +DDKAPI +VideoPortQueryServices( + IN PVOID HwDeviceExtension, + IN VIDEO_PORT_SERVICES ServicesType, + IN OUT PINTERFACE Interface); + +VPAPI +VOID +DDKAPI +VideoPortQuerySystemTime( + OUT PLARGE_INTEGER CurrentTime); + +VPAPI +BOOLEAN +DDKAPI +VideoPortQueueDpc( + IN PVOID HwDeviceExtension, + IN PMINIPORT_DPC_ROUTINE CallbackRoutine, + IN PVOID Context); + +VPAPI +VOID +DDKAPI +VideoPortReadPortBufferUchar( + IN PUCHAR Port, + OUT PUCHAR Buffer, + IN ULONG Count); + +VPAPI +VOID +DDKAPI +VideoPortReadPortBufferUlong( + IN PULONG Port, + OUT PULONG Buffer, + IN ULONG Count); + +VPAPI +VOID +DDKAPI +VideoPortReadPortBufferUshort( + IN PUSHORT Port, + OUT PUSHORT Buffer, + IN ULONG Count); + +VPAPI +UCHAR +DDKAPI +VideoPortReadPortUchar( + IN PUCHAR Port); + +VPAPI +ULONG +DDKAPI +VideoPortReadPortUlong( + IN PULONG Port); + +VPAPI +USHORT +DDKAPI +VideoPortReadPortUshort( + IN PUSHORT Port); + +VPAPI +VOID +DDKAPI +VideoPortReadRegisterBufferUchar( + IN PUCHAR Register, + OUT PUCHAR Buffer, + IN ULONG Count); + +VPAPI +VOID +DDKAPI +VideoPortReadRegisterBufferUlong( + IN PULONG Register, + OUT PULONG Buffer, + IN ULONG Count); + +VPAPI +VOID +DDKAPI +VideoPortReadRegisterBufferUshort( + IN PUSHORT Register, + OUT PUSHORT Buffer, + IN ULONG Count); + +VPAPI +UCHAR +DDKAPI +VideoPortReadRegisterUchar( + IN PUCHAR Register); + +VPAPI +ULONG +DDKAPI +VideoPortReadRegisterUlong( + IN PULONG Register); + +VPAPI +USHORT +DDKAPI +VideoPortReadRegisterUshort( + IN PUSHORT Register); + +VPAPI +LONG +DDKAPI +VideoPortReadStateEvent( + IN PVOID HwDeviceExtension, + IN PEVENT pEvent); + +VPAPI +VOID +DDKAPI +VideoPortReleaseBuffer( + IN PVOID HwDeviceExtension, + IN PVOID Buffer); + +VPAPI +VOID +DDKAPI +VideoPortReleaseCommonBuffer( + IN PVOID HwDeviceExtension, + IN PVP_DMA_ADAPTER VpDmaAdapter, + IN ULONG Length, + IN PHYSICAL_ADDRESS LogicalAddress, + IN PVOID VirtualAddress, + IN BOOLEAN CacheEnabled); + +VPAPI +VOID +DDKAPI +VideoPortReleaseDeviceLock( + IN PVOID HwDeviceExtension); + +VPAPI +VOID +DDKAPI +VideoPortReleaseSpinLock( + IN PVOID HwDeviceExtension, + IN PSPIN_LOCK SpinLock, + IN UCHAR NewIrql); + +VPAPI +VOID +DDKAPI +VideoPortReleaseSpinLockFromDpcLevel( + IN PVOID HwDeviceExtension, + IN PSPIN_LOCK SpinLock); + +VPAPI +BOOLEAN +DDKAPI +VideoPortScanRom( + PVOID HwDeviceExtension, + PUCHAR RomBase, + ULONG RomLength, + PUCHAR String); + +VPAPI +ULONG +DDKAPI +VideoPortSetBusData( + IN PVOID HwDeviceExtension, + IN BUS_DATA_TYPE BusDataType, + IN ULONG SlotNumber, + IN PVOID Buffer, + IN ULONG Offset, + IN ULONG Length); + +VPAPI +VOID +DDKAPI +VideoPortSetBytesUsed( + IN PVOID HwDeviceExtension, + IN OUT PDMA pDma, + IN ULONG BytesUsed); + +VPAPI +VOID +DDKAPI +VideoPortSetDmaContext( + IN PVOID HwDeviceExtension, + OUT PDMA pDma, + IN PVOID InstanceContext); + +VPAPI +LONG +DDKAPI +VideoPortSetEvent( + IN PVOID HwDeviceExtension, + IN PEVENT pEvent); + +VPAPI +VP_STATUS +DDKAPI +VideoPortSetRegistryParameters( + IN PVOID HwDeviceExtension, + IN PWSTR ValueName, + IN PVOID ValueData, + IN ULONG ValueLength); + +VPAPI +VP_STATUS +DDKAPI +VideoPortSetTrappedEmulatorPorts( + IN PVOID HwDeviceExtension, + IN ULONG NumAccessRanges, + IN PVIDEO_ACCESS_RANGE AccessRange); + +VPAPI +BOOLEAN +DDKAPI +VideoPortSignalDmaComplete( + IN PVOID HwDeviceExtension, + IN PVOID pDmaHandle); + +VPAPI +VOID +DDKAPI +VideoPortStallExecution( + IN ULONG Microseconds); + +VPAPI +VP_STATUS +DDKAPI +VideoPortStartDma( + IN PVOID HwDeviceExtension, + IN PVP_DMA_ADAPTER VpDmaAdapter, + IN PVOID Mdl, + IN ULONG Offset, + IN OUT PULONG pLength, + IN PEXECUTE_DMA ExecuteDmaRoutine, + IN PVOID Context, + IN BOOLEAN WriteToDevice); + +VPAPI +VOID +DDKAPI +VideoPortStartTimer( + IN PVOID HwDeviceExtension); + +VPAPI +VOID +DDKAPI +VideoPortStopTimer( + IN PVOID HwDeviceExtension); + +/* VideoPortSynchronizeExecution.Priority constants */ +typedef enum VIDEO_SYNCHRONIZE_PRIORITY { + VpLowPriority = 0, + VpMediumPriority, + VpHighPriority +} VIDEO_SYNCHRONIZE_PRIORITY, *PVIDEO_SYNCHRONIZE_PRIORITY; + +VPAPI +BOOLEAN +DDKAPI +VideoPortSynchronizeExecution( + IN PVOID HwDeviceExtension, + IN VIDEO_SYNCHRONIZE_PRIORITY Priority, + IN PMINIPORT_SYNCHRONIZE_ROUTINE SynchronizeRoutine, + IN PVOID Context); + +VPAPI +VOID +DDKAPI +VideoPortUnLockBuffer( + IN PVOID HwDeviceExtension, + IN PVOID Mdl); + +VPAPI +BOOLEAN +DDKAPI +VideoPortUnlockPages( + IN PVOID hwDeviceExtension, + IN OUT PDMA pDma); + +VPAPI +BOOLEAN +DDKAPI +VideoPortUnmapDmaMemory( + IN PVOID HwDeviceExtension, + IN PVOID VirtualAddress, + IN HANDLE ProcessHandle, + IN PDMA BoardMemoryHandle); + +VPAPI +VP_STATUS +DDKAPI +VideoPortUnmapMemory( + IN PVOID HwDeviceExtension, + IN OUT PVOID VirtualAddress, + IN HANDLE ProcessHandle); + +VPAPI +VP_STATUS +DDKAPI +VideoPortVerifyAccessRanges( + IN PVOID HwDeviceExtension, + IN ULONG NumAccessRanges, + IN PVIDEO_ACCESS_RANGE AccessRanges); + +VPAPI +VP_STATUS +DDKAPI +VideoPortWaitForSingleObject( + IN PVOID HwDeviceExtension, + IN PVOID Object, + IN PLARGE_INTEGER Timeout OPTIONAL); + +VPAPI +VOID +DDKAPI +VideoPortWritePortBufferUchar( + IN PUCHAR Port, + IN PUCHAR Buffer, + IN ULONG Count); + +VPAPI +VOID +DDKAPI +VideoPortWritePortBufferUlong( + IN PULONG Port, + IN PULONG Buffer, + IN ULONG Count); + +VPAPI +VOID +DDKAPI +VideoPortWritePortBufferUshort( + IN PUSHORT Port, + IN PUSHORT Buffer, + IN ULONG Count); + +VPAPI +VOID +DDKAPI +VideoPortWritePortUchar( + IN PUCHAR Port, + IN UCHAR Value); + +VPAPI +VOID +DDKAPI +VideoPortWritePortUlong( + IN PULONG Port, + IN ULONG Value); + +VPAPI +VOID +DDKAPI +VideoPortWritePortUshort( + IN PUSHORT Port, + IN USHORT Value); + +VPAPI +VOID +DDKAPI +VideoPortWriteRegisterBufferUchar( + IN PUCHAR Register, + IN PUCHAR Buffer, + IN ULONG Count); + +VPAPI +VOID +DDKAPI +VideoPortWriteRegisterBufferUlong( + IN PULONG Register, + IN PULONG Buffer, + IN ULONG Count); + +VPAPI +VOID +DDKAPI +VideoPortWriteRegisterBufferUshort( + IN PUSHORT Register, + IN PUSHORT Buffer, + IN ULONG Count); + +VPAPI +VOID +DDKAPI +VideoPortWriteRegisterUchar( + IN PUCHAR Register, + IN UCHAR Value); + +VPAPI +VOID +DDKAPI +VideoPortWriteRegisterUlong( + IN PULONG Register, + IN ULONG Value); + +VPAPI +VOID +DDKAPI +VideoPortWriteRegisterUshort( + IN PUSHORT Register, + IN USHORT Value); + +VPAPI +VOID +DDKAPI +VideoPortZeroDeviceMemory( + IN PVOID Destination, + IN ULONG Length); + +VPAPI +VOID +DDKAPI +VideoPortZeroMemory( + IN PVOID Destination, + IN ULONG Length); + +#ifdef DBG +#define VideoDebugPrint(x) VideoPortDebugPrint x +#else +#define VideoDebugPrint(x) +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* defined __WINDDI_H */ + +#endif /* __VIDEO_H */ diff --git a/reactos/include/ddk/videoagp.h b/reactos/include/ddk/videoagp.h new file mode 100644 index 00000000000..078a9e7f089 --- /dev/null +++ b/reactos/include/ddk/videoagp.h @@ -0,0 +1,127 @@ +/* + * videoagp.h + * + * Video miniport AGP interface + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __VIDEOAGP_H +#define __VIDEOAGP_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include "video.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define VIDEO_AGP_RATE_1X 0x00000001 +#define VIDEO_AGP_RATE_2X 0x00000002 +#define VIDEO_AGP_RATE_4X 0x00000004 +#define VIDEO_AGP_RATE_8X 0x00000008 + +typedef enum _VIDEO_PORT_CACHE_TYPE { + VpNonCached = 0, + VpWriteCombined, + VpCached +} VIDEO_PORT_CACHE_TYPE; + +typedef BOOLEAN +(DDKAPI *PAGP_COMMIT_PHYSICAL)( + IN PVOID HwDeviceExtension, + IN PVOID PhysicalReserveContext, + IN ULONG Pages, + IN ULONG Offset); + +typedef PVOID +(DDKAPI *PAGP_COMMIT_VIRTUAL)( + IN PVOID HwDeviceExtension, + IN PVOID VirtualReserveContext, + IN ULONG Pages, + IN ULONG Offset); + +typedef VOID +(DDKAPI *PAGP_FREE_PHYSICAL)( + IN PVOID HwDeviceExtension, + IN PVOID PhysicalReserveContext, + IN ULONG Pages, + IN ULONG Offset); + +typedef VOID +(DDKAPI *PAGP_FREE_VIRTUAL)( + IN PVOID HwDeviceExtension, + IN PVOID VirtualReserveContext, + IN ULONG Pages, + IN ULONG Offset); + +typedef VOID +(DDKAPI *PAGP_RELEASE_PHYSICAL)( + IN PVOID HwDeviceExtension, + IN PVOID PhysicalReserveContext); + +typedef VOID +(DDKAPI *PAGP_RELEASE_VIRTUAL)( + IN PVOID HwDeviceExtension, + IN PVOID VirtualReserveContext); + +typedef PHYSICAL_ADDRESS +(DDKAPI *PAGP_RESERVE_PHYSICAL)( + IN PVOID HwDeviceExtension, + IN ULONG Pages, + IN VIDEO_PORT_CACHE_TYPE Caching, + OUT PVOID *PhysicalReserveContext); + +typedef PVOID +(DDKAPI *PAGP_RESERVE_VIRTUAL)( + IN PVOID HwDeviceExtension, + IN HANDLE ProcessHandle, + IN PVOID PhysicalReserveContext, + OUT PVOID *VirtualReserveContext); + +typedef BOOLEAN +(DDKAPI *PAGP_SET_RATE)( + IN PVOID HwDeviceExtension, + IN ULONG AgpRate); + +typedef struct _VIDEO_PORT_AGP_SERVICES { + PAGP_RESERVE_PHYSICAL AgpReservePhysical; + PAGP_RELEASE_PHYSICAL AgpReleasePhysical; + PAGP_COMMIT_PHYSICAL AgpCommitPhysical; + PAGP_FREE_PHYSICAL AgpFreePhysical; + PAGP_RESERVE_VIRTUAL AgpReserveVirtual; + PAGP_RELEASE_VIRTUAL AgpReleaseVirtual; + PAGP_COMMIT_VIRTUAL AgpCommitVirtual; + PAGP_FREE_VIRTUAL AgpFreeVirtual; + ULONGLONG AllocationLimit; +} VIDEO_PORT_AGP_SERVICES, *PVIDEO_PORT_AGP_SERVICES; + +VPAPI +BOOLEAN +DDKAPI +VideoPortGetAgpServices( + IN PVOID HwDeviceExtension, + IN PVIDEO_PORT_AGP_SERVICES AgpServices); + +#ifdef __cplusplus +} +#endif + +#endif /* __VIDEOAGP_H */ diff --git a/reactos/include/ddk/wdmguid.h b/reactos/include/ddk/wdmguid.h new file mode 100644 index 00000000000..dadbddb7dcb --- /dev/null +++ b/reactos/include/ddk/wdmguid.h @@ -0,0 +1,118 @@ +/* + * wdmguid.h + * + * GUID definitions for PnP device classes and device events. + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Filip Navara . + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __WDMGUID_H +#define __WDMGUID_H + +DEFINE_GUID(GUID_HWPROFILE_QUERY_CHANGE, + 0xcb3a4001, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f); +DEFINE_GUID(GUID_HWPROFILE_CHANGE_CANCELLED, + 0xcb3a4002, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f); +DEFINE_GUID(GUID_HWPROFILE_CHANGE_COMPLETE, + 0xcb3a4003, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f); +DEFINE_GUID(GUID_DEVICE_INTERFACE_ARRIVAL, + 0xcb3a4004, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f); +DEFINE_GUID(GUID_DEVICE_INTERFACE_REMOVAL, + 0xcb3a4005, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f); +DEFINE_GUID(GUID_TARGET_DEVICE_QUERY_REMOVE, + 0xcb3a4006, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f); +DEFINE_GUID(GUID_TARGET_DEVICE_REMOVE_CANCELLED, + 0xcb3a4007, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f); +DEFINE_GUID(GUID_TARGET_DEVICE_REMOVE_COMPLETE, + 0xcb3a4008, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f); +DEFINE_GUID(GUID_PNP_CUSTOM_NOTIFICATION, + 0xaca73f8e, 0x8d23, 0x11d1, 0xac, 0x7d, 0x00, 0x00, 0xf8, 0x75, 0x71, 0xd0); +DEFINE_GUID(GUID_PNP_POWER_NOTIFICATION, + 0xc2cf0660, 0xeb7a, 0x11d1, 0xbd, 0x7f, 0x00, 0x00, 0xf8, 0x75, 0x71, 0xd0); + +DEFINE_GUID(GUID_BUS_INTERFACE_STANDARD, + 0x496b8280, 0x6f25, 0x11d0, 0xbe, 0xaf, 0x08, 0x00, 0x2b, 0xe2, 0x09, 0x2f); +DEFINE_GUID(GUID_PCI_BUS_INTERFACE_STANDARD, + 0x496b8281, 0x6f25, 0x11d0, 0xbe, 0xaf, 0x08, 0x00, 0x2b, 0xe2, 0x09, 0x2f); +DEFINE_GUID(GUID_AGP_TARGET_BUS_INTERFACE_STANDARD, + 0xb15cfce8, 0x06d1, 0x4d37, 0x9d, 0x4c, 0xbe, 0xdd, 0xe0, 0xc2, 0xa6, 0xff); +DEFINE_GUID(GUID_ARBITER_INTERFACE_STANDARD, + 0xe644f185, 0x8c0e, 0x11d0, 0xbe, 0xcf, 0x08, 0x00, 0x2b, 0xe2, 0x09, 0x2f); +DEFINE_GUID(GUID_TRANSLATOR_INTERFACE_STANDARD, + 0x6c154a92, 0xaacf, 0x11d0, 0x8d, 0x2a, 0x00, 0xa0, 0xc9, 0x06, 0xb2, 0x44); +DEFINE_GUID(GUID_ACPI_INTERFACE_STANDARD, + 0xb091a08a, 0xba97, 0x11d0, 0xbd, 0x14, 0x00, 0xaa, 0x00, 0xb7, 0xb3, 0x2a); +DEFINE_GUID(GUID_INT_ROUTE_INTERFACE_STANDARD, + 0x70941bf4, 0x0073, 0x11d1, 0xa0, 0x9e, 0x00, 0xc0, 0x4f, 0xc3, 0x40, 0xb1); +DEFINE_GUID(GUID_PCMCIA_BUS_INTERFACE_STANDARD, + 0x76173af0, 0xc504, 0x11d1, 0x94, 0x7f, 0x00, 0xc0, 0x4f, 0xb9, 0x60, 0xee); +DEFINE_GUID(GUID_ACPI_REGS_INTERFACE_STANDARD, + 0x06141966, 0x7245, 0x6369, 0x46, 0x2e, 0x4e, 0x65, 0x6c, 0x73, 0x6f, 0x6e); +DEFINE_GUID(GUID_LEGACY_DEVICE_DETECTION_STANDARD, + 0x50feb0de, 0x596a, 0x11d2, 0xa5, 0xb8, 0x00, 0x00, 0xf8, 0x1a, 0x46, 0x19); +DEFINE_GUID(GUID_PCI_DEVICE_PRESENT_INTERFACE, + 0xd1b82c26, 0xbf49, 0x45ef, 0xb2, 0x16, 0x71, 0xcb, 0xd7, 0x88, 0x9b, 0x57); +DEFINE_GUID(GUID_MF_ENUMERATION_INTERFACE, + 0xaeb895f0, 0x5586, 0x11d1, 0x8d, 0x84, 0x00, 0xa0, 0xc9, 0x06, 0xb2, 0x44); +DEFINE_GUID(GUID_ACPI_CMOS_INTERFACE_STANDARD, + 0x3a8d0384, 0x6505, 0x40ca, 0xbc, 0x39, 0x56, 0xc1, 0x5f, 0x8c, 0x5f, 0xed); +DEFINE_GUID(GUID_ACPI_PORT_RANGES_INTERFACE_STANDARD, + 0xf14f609b, 0xcbbd, 0x4957, 0xa6, 0x74, 0xbc, 0x00, 0x21, 0x3f, 0x1c, 0x97); +DEFINE_GUID(GUID_PNP_LOCATION_INTERFACE, + 0x70211b0e, 0x0afb, 0x47db, 0xaf, 0xc1, 0x41, 0x0b, 0xf8, 0x42, 0x49, 0x7a); + +DEFINE_GUID(GUID_BUS_TYPE_INTERNAL, + 0x1530ea73, 0x086b, 0x11d1, 0xa0, 0x9f, 0x00, 0xc0, 0x4f, 0xc3, 0x40, 0xb1); +DEFINE_GUID(GUID_BUS_TYPE_PCMCIA, + 0x09343630, 0xaf9f, 0x11d0, 0x92, 0xE9, 0x00, 0x00, 0xf8, 0x1e, 0x1b, 0x30); +DEFINE_GUID(GUID_BUS_TYPE_PCI, + 0xc8ebdfb0, 0xb510, 0x11d0, 0x80, 0xe5, 0x00, 0xa0, 0xc9, 0x25, 0x42, 0xe3); +DEFINE_GUID(GUID_BUS_TYPE_ISAPNP, + 0xe676f854, 0xd87d, 0x11d0, 0x92, 0xb2, 0x00, 0xa0, 0xc9, 0x05, 0x5f, 0xc5); +DEFINE_GUID(GUID_BUS_TYPE_EISA, + 0xddc35509, 0xf3fc, 0x11d0, 0xa5, 0x37, 0x00, 0x00, 0xf8, 0x75, 0x3e, 0xd1); +DEFINE_GUID(GUID_BUS_TYPE_MCA, + 0x1c75997a, 0xdc33, 0x11d0, 0x92, 0xb2, 0x00, 0xa0, 0xc9, 0x05, 0x5f, 0xc5); +DEFINE_GUID(GUID_BUS_TYPE_LPTENUM, + 0xc4ca1000, 0x2ddc, 0x11d5, 0xa1, 0x7a, 0x00, 0xc0, 0x4f, 0x60, 0x52, 0x4d); +DEFINE_GUID(GUID_BUS_TYPE_USBPRINT, + 0x441ee000, 0x4342, 0x11d5, 0xa1, 0x84, 0x00, 0xc0, 0x4f, 0x60, 0x52, 0x4d); +DEFINE_GUID(GUID_BUS_TYPE_DOT4PRT, + 0x441ee001, 0x4342, 0x11d5, 0xa1, 0x84, 0x00, 0xc0, 0x4f, 0x60, 0x52, 0x4d); +DEFINE_GUID(GUID_BUS_TYPE_SERENUM, + 0x77114a87, 0x8944, 0x11d1, 0xbd, 0x90, 0x00, 0xa0, 0xc9, 0x06, 0xbe, 0x2d); +DEFINE_GUID(GUID_BUS_TYPE_USB, + 0x9d7debbc, 0xc85d, 0x11d1, 0x9e, 0xb4, 0x00, 0x60, 0x08, 0xc3, 0xa1, 0x9a); +DEFINE_GUID(GUID_BUS_TYPE_1394, + 0xf74e73eb, 0x9ac5, 0x45eb, 0xbe, 0x4d, 0x77, 0x2c, 0xc7, 0x1d, 0xdf, 0xb3); +DEFINE_GUID(GUID_BUS_TYPE_HID, + 0xeeaf37d0, 0x1963, 0x47c4, 0xaa, 0x48, 0x72, 0x47, 0x6d, 0xb7, 0xcf, 0x49); +DEFINE_GUID(GUID_BUS_TYPE_AVC, + 0xc06ff265, 0xae09, 0x48f0, 0x81, 0x2c, 0x16, 0x75, 0x3d, 0x7c, 0xba, 0x83); +DEFINE_GUID(GUID_BUS_TYPE_IRDA, + 0x7ae17dc1, 0xc944, 0x44d6, 0x88, 0x1f, 0x4c, 0x2e, 0x61, 0x05, 0x3b, 0xc1); +DEFINE_GUID(GUID_BUS_TYPE_SD, + 0xe700cc04, 0x4036, 0x4e89, 0x95, 0x79, 0x89, 0xeb, 0xf4, 0x5f, 0x00, 0xcd); + +DEFINE_GUID(GUID_POWER_DEVICE_ENABLE, + 0x827c0a6fL, 0xfeb0, 0x11d0, 0xbd, 0x26, 0x00, 0xaa, 0x00, 0xb7, 0xb3, 0x2a); +DEFINE_GUID(GUID_POWER_DEVICE_TIMEOUTS, + 0xa45da735L, 0xfeb0, 0x11d0, 0xbd, 0x26, 0x00, 0xaa, 0x00, 0xb7, 0xb3, 0x2a); +DEFINE_GUID(GUID_POWER_DEVICE_WAKE_ENABLE, + 0xa9546a82L, 0xfeb0, 0x11d0, 0xbd, 0x26, 0x00, 0xaa, 0x00, 0xb7, 0xb3, 0x2a); + +#endif /* __WDMGUID_H */ diff --git a/reactos/include/ddk/win2k.h b/reactos/include/ddk/win2k.h new file mode 100644 index 00000000000..4e36debc89d --- /dev/null +++ b/reactos/include/ddk/win2k.h @@ -0,0 +1,104 @@ +/* + * win2k.h + * + * Definitions only used in Windows 2000 and earlier versions + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __WIN2K_H +#define __WIN2K_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#pragma pack(push,4) + +typedef enum _BUS_DATA_TYPE { + ConfigurationSpaceUndefined = -1, + Cmos, + EisaConfiguration, + Pos, + CbusConfiguration, + PCIConfiguration, + VMEConfiguration, + NuBusConfiguration, + PCMCIAConfiguration, + MPIConfiguration, + MPSAConfiguration, + PNPISAConfiguration, + SgiInternalConfiguration, + MaximumBusDataType +} BUS_DATA_TYPE, *PBUS_DATA_TYPE; + +#pragma pack(pop) + +NTOSAPI +VOID +DDKAPI +ExReleaseResourceForThreadLite( + IN PERESOURCE Resource, + IN ERESOURCE_THREAD ResourceThreadId); + +NTOSAPI +NTSTATUS +DDKFASTAPI +IoReadPartitionTable( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG SectorSize, + IN BOOLEAN ReturnRecognizedPartitions, + OUT struct _DRIVE_LAYOUT_INFORMATION **PartitionBuffer); + +NTOSAPI +NTSTATUS +DDKFASTAPI +IoSetPartitionInformation( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG SectorSize, + IN ULONG PartitionNumber, + IN ULONG PartitionType); + +NTOSAPI +NTSTATUS +DDKFASTAPI +IoWritePartitionTable( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG SectorSize, + IN ULONG SectorsPerTrack, + IN ULONG NumberOfHeads, + IN struct _DRIVE_LAYOUT_INFORMATION *PartitionBuffer); + +/* + * PVOID MmGetSystemAddressForMdl( + * IN PMDL Mdl); + */ +#define MmGetSystemAddressForMdl(Mdl) \ + (((Mdl)->MdlFlags & (MDL_MAPPED_TO_SYSTEM_VA | \ + MDL_SOURCE_IS_NONPAGED_POOL)) ? \ + ((Mdl)->MappedSystemVa) : \ + (MmMapLockedPages((Mdl), KernelMode))) + +#ifdef __cplusplus +} +#endif + +#endif /* __WIN2K_H */ diff --git a/reactos/include/ddk/winddi.h b/reactos/include/ddk/winddi.h new file mode 100644 index 00000000000..a8f4dba40ae --- /dev/null +++ b/reactos/include/ddk/winddi.h @@ -0,0 +1,4111 @@ +/* + * winddi.h + * + * GDI device driver interface + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __WINDDI_H +#define __WINDDI_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __VIDEO_H +#error video.h cannot be included with winddi.h +#else + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef DECL_IMPORT +#define DECL_IMPORT __attribute__((dllimport)) +#endif + +#if defined(_WIN32K_) +#define WIN32KAPI DECL_EXPORT +#else +#define WIN32KAPI DECL_IMPORT +#endif + +#define DDI_DRIVER_VERSION_NT4 0x00020000 +#define DDI_DRIVER_VERSION_SP3 0x00020003 +#define DDI_DRIVER_VERSION_NT5 0x00030000 +#define DDI_DRIVER_VERSION_NT5_01 0x00030100 + +#define GDI_DRIVER_VERSION 0x4000 + +#ifdef _X86_ + +typedef DWORD FLOATL; + +#else /* !_X86_ */ + +typedef FLOAT FLOATL; + +#endif + +typedef SHORT FWORD; +typedef LONG LDECI4; +typedef ULONG IDENT; + +typedef ULONG_PTR HFF; +typedef ULONG_PTR HFC; + +typedef LONG PTRDIFF; +typedef PTRDIFF *PPTRDIFF; +typedef LONG FIX; +typedef FIX *PFIX; +typedef ULONG ROP4; +typedef ULONG MIX; +typedef ULONG HGLYPH; +typedef HGLYPH *PHGLYPH; + +typedef LONG_PTR (APIENTRY *PFN)(); + +DECLARE_HANDLE(HBM); +DECLARE_HANDLE(HDEV); +DECLARE_HANDLE(HSURF); +DECLARE_HANDLE(DHSURF); +DECLARE_HANDLE(DHPDEV); +DECLARE_HANDLE(HDRVOBJ); + +typedef struct _ENG_EVENT *PEVENT; + +#define OPENGL_CMD 4352 +#define OPENGL_GETINFO 4353 +#define WNDOBJ_SETUP 4354 + +#define FD_ERROR 0xFFFFFFFF +#define DDI_ERROR 0xFFFFFFFF + +#define HFF_INVALID ((HFF) 0) +#define HFC_INVALID ((HFC) 0) +#define HGLYPH_INVALID ((HGLYPH) -1) + +#define FP_ALTERNATEMODE 1 +#define FP_WINDINGMODE 2 + +#define DN_ACCELERATION_LEVEL 1 +#define DN_DEVICE_ORIGIN 2 +#define DN_SLEEP_MODE 3 +#define DN_DRAWING_BEGIN 4 + +#define DCR_SOLID 0 +#define DCR_DRIVER 1 +#define DCR_HALFTONE 2 + +#define GX_IDENTITY 0 +#define GX_OFFSET 1 +#define GX_SCALE 2 +#define GX_GENERAL 3 + +typedef struct _POINTE { + FLOATL x; + FLOATL y; +} POINTE, *PPOINTE; + +typedef union _FLOAT_LONG { + FLOATL e; + LONG l; +} FLOAT_LONG, *PFLOAT_LONG; + +typedef struct _POINTFIX { + FIX x; + FIX y; +} POINTFIX, *PPOINTFIX; + +typedef struct _RECTFX { + FIX xLeft; + FIX yTop; + FIX xRight; + FIX yBottom; +} RECTFX, *PRECTFX; + +typedef struct _POINTQF { + LARGE_INTEGER x; + LARGE_INTEGER y; +} POINTQF, *PPOINTQF; + + +typedef struct _BLENDOBJ { + BLENDFUNCTION BlendFunction; +} BLENDOBJ,*PBLENDOBJ; + +/* BRUSHOBJ.flColorType */ +#define BR_DEVICE_ICM 0x01 +#define BR_HOST_ICM 0x02 +#define BR_CMYKCOLOR 0x04 +#define BR_ORIGCOLOR 0x08 + +typedef struct _BRUSHOBJ { + ULONG iSolidColor; + PVOID pvRbrush; + FLONG flColorType; +} BRUSHOBJ; + +typedef struct _CIECHROMA { + LDECI4 x; + LDECI4 y; + LDECI4 Y; +} CIECHROMA; + +typedef struct _RUN { + LONG iStart; + LONG iStop; +} RUN, *PRUN; + +typedef struct _CLIPLINE { + POINTFIX ptfxA; + POINTFIX ptfxB; + LONG lStyleState; + ULONG c; + RUN arun[1]; +} CLIPLINE, *PCLIPLINE; + +/* CLIPOBJ.iDComplexity constants */ +#define DC_TRIVIAL 0 +#define DC_RECT 1 +#define DC_COMPLEX 3 + +/* CLIPOBJ.iFComplexity constants */ +#define FC_RECT 1 +#define FC_RECT4 2 +#define FC_COMPLEX 3 + +/* CLIPOBJ.iMode constants */ +#define TC_RECTANGLES 0 +#define TC_PATHOBJ 2 + +/* CLIPOBJ.fjOptions constants */ +#define OC_BANK_CLIP 1 + +typedef struct _CLIPOBJ { + ULONG iUniq; + RECTL rclBounds; + BYTE iDComplexity; + BYTE iFComplexity; + BYTE iMode; + BYTE fjOptions; +} CLIPOBJ; + +typedef struct _COLORINFO { + CIECHROMA Red; + CIECHROMA Green; + CIECHROMA Blue; + CIECHROMA Cyan; + CIECHROMA Magenta; + CIECHROMA Yellow; + CIECHROMA AlignmentWhite; + LDECI4 RedGamma; + LDECI4 GreenGamma; + LDECI4 BlueGamma; + LDECI4 MagentaInCyanDye; + LDECI4 YellowInCyanDye; + LDECI4 CyanInMagentaDye; + LDECI4 YellowInMagentaDye; + LDECI4 CyanInYellowDye; + LDECI4 MagentaInYellowDye; +} COLORINFO, *PCOLORINFO; + +/* DEVHTADJDATA.DeviceFlags constants */ +#define DEVHTADJF_COLOR_DEVICE 0x00000001 +#define DEVHTADJF_ADDITIVE_DEVICE 0x00000002 + +typedef struct _DEVHTINFO { + DWORD HTFlags; + DWORD HTPatternSize; + DWORD DevPelsDPI; + COLORINFO ColorInfo; +} DEVHTINFO, *PDEVHTINFO; + +typedef struct _DEVHTADJDATA { + DWORD DeviceFlags; + DWORD DeviceXDPI; + DWORD DeviceYDPI; + PDEVHTINFO pDefHTInfo; + PDEVHTINFO pAdjHTInfo; +} DEVHTADJDATA, *PDEVHTADJDATA; + +/* DEVINFO.flGraphicsCaps flags */ +#define GCAPS_BEZIERS 0x00000001 +#define GCAPS_GEOMETRICWIDE 0x00000002 +#define GCAPS_ALTERNATEFILL 0x00000004 +#define GCAPS_WINDINGFILL 0x00000008 +#define GCAPS_HALFTONE 0x00000010 +#define GCAPS_COLOR_DITHER 0x00000020 +#define GCAPS_HORIZSTRIKE 0x00000040 +#define GCAPS_VERTSTRIKE 0x00000080 +#define GCAPS_OPAQUERECT 0x00000100 +#define GCAPS_VECTORFONT 0x00000200 +#define GCAPS_MONO_DITHER 0x00000400 +#define GCAPS_ASYNCCHANGE 0x00000800 +#define GCAPS_ASYNCMOVE 0x00001000 +#define GCAPS_DONTJOURNAL 0x00002000 +#define GCAPS_DIRECTDRAW 0x00004000 +#define GCAPS_ARBRUSHOPAQUE 0x00008000 +#define GCAPS_PANNING 0x00010000 +#define GCAPS_HIGHRESTEXT 0x00040000 +#define GCAPS_PALMANAGED 0x00080000 +#define GCAPS_DITHERONREALIZE 0x00200000 +#define GCAPS_NO64BITMEMACCESS 0x00400000 +#define GCAPS_FORCEDITHER 0x00800000 +#define GCAPS_GRAY16 0x01000000 +#define GCAPS_ICM 0x02000000 +#define GCAPS_CMYKCOLOR 0x04000000 +#define GCAPS_LAYERED 0x08000000 +#define GCAPS_ARBRUSHTEXT 0x10000000 +#define GCAPS_SCREENPRECISION 0x20000000 +#define GCAPS_FONT_RASTERIZER 0x40000000 +#define GCAPS_NUP 0x80000000 + +/* DEVINFO.iDitherFormat constants */ +#define BMF_1BPP 1L +#define BMF_4BPP 2L +#define BMF_8BPP 3L +#define BMF_16BPP 4L +#define BMF_24BPP 5L +#define BMF_32BPP 6L +#define BMF_4RLE 7L +#define BMF_8RLE 8L +#define BMF_JPEG 9L +#define BMF_PNG 10L + +/* DEVINFO.flGraphicsCaps2 flags */ +#define GCAPS2_JPEGSRC 0x00000001 +#define GCAPS2_xxxx 0x00000002 +#define GCAPS2_PNGSRC 0x00000008 +#define GCAPS2_CHANGEGAMMARAMP 0x00000010 +#define GCAPS2_ALPHACURSOR 0x00000020 +#define GCAPS2_SYNCFLUSH 0x00000040 +#define GCAPS2_SYNCTIMER 0x00000080 +#define GCAPS2_ICD_MULTIMON 0x00000100 +#define GCAPS2_MOUSETRAILS 0x00000200 +#define GCAPS2_RESERVED1 0x00000400 + +typedef struct _DEVINFO { + FLONG flGraphicsCaps; + LOGFONTW lfDefaultFont; + LOGFONTW lfAnsiVarFont; + LOGFONTW lfAnsiFixFont; + ULONG cFonts; + ULONG iDitherFormat; + USHORT cxDither; + USHORT cyDither; + HPALETTE hpalDefault; + FLONG flGraphicsCaps2; +} DEVINFO, *PDEVINFO; + +typedef struct _DRIVEROBJ *PDRIVEROBJ; + +typedef BOOL +(APIENTRY CALLBACK *FREEOBJPROC)( + IN PDRIVEROBJ pDriverObj); + +typedef struct _DRIVEROBJ { + PVOID pvObj; + FREEOBJPROC pFreeProc; + HDEV hdev; + DHPDEV dhpdev; +} DRIVEROBJ; + +/* DRVFN.iFunc constants */ +#define INDEX_DrvEnablePDEV 0L +#define INDEX_DrvCompletePDEV 1L +#define INDEX_DrvDisablePDEV 2L +#define INDEX_DrvEnableSurface 3L +#define INDEX_DrvDisableSurface 4L +#define INDEX_DrvAssertMode 5L +#define INDEX_DrvOffset 6L +#define INDEX_DrvResetPDEV 7L +#define INDEX_DrvDisableDriver 8L +#define INDEX_DrvCreateDeviceBitmap 10L +#define INDEX_DrvDeleteDeviceBitmap 11L +#define INDEX_DrvRealizeBrush 12L +#define INDEX_DrvDitherColor 13L +#define INDEX_DrvStrokePath 14L +#define INDEX_DrvFillPath 15L +#define INDEX_DrvStrokeAndFillPath 16L +#define INDEX_DrvPaint 17L +#define INDEX_DrvBitBlt 18L +#define INDEX_DrvCopyBits 19L +#define INDEX_DrvStretchBlt 20L +#define INDEX_DrvSetPalette 22L +#define INDEX_DrvTextOut 23L +#define INDEX_DrvEscape 24L +#define INDEX_DrvDrawEscape 25L +#define INDEX_DrvQueryFont 26L +#define INDEX_DrvQueryFontTree 27L +#define INDEX_DrvQueryFontData 28L +#define INDEX_DrvSetPointerShape 29L +#define INDEX_DrvMovePointer 30L +#define INDEX_DrvLineTo 31L +#define INDEX_DrvSendPage 32L +#define INDEX_DrvStartPage 33L +#define INDEX_DrvEndDoc 34L +#define INDEX_DrvStartDoc 35L +#define INDEX_DrvGetGlyphMode 37L +#define INDEX_DrvSynchronize 38L +#define INDEX_DrvSaveScreenBits 40L +#define INDEX_DrvGetModes 41L +#define INDEX_DrvFree 42L +#define INDEX_DrvDestroyFont 43L +#define INDEX_DrvQueryFontCaps 44L +#define INDEX_DrvLoadFontFile 45L +#define INDEX_DrvUnloadFontFile 46L +#define INDEX_DrvFontManagement 47L +#define INDEX_DrvQueryTrueTypeTable 48L +#define INDEX_DrvQueryTrueTypeOutline 49L +#define INDEX_DrvGetTrueTypeFile 50L +#define INDEX_DrvQueryFontFile 51L +#define INDEX_DrvMovePanning 52L +#define INDEX_DrvQueryAdvanceWidths 53L +#define INDEX_DrvSetPixelFormat 54L +#define INDEX_DrvDescribePixelFormat 55L +#define INDEX_DrvSwapBuffers 56L +#define INDEX_DrvStartBanding 57L +#define INDEX_DrvNextBand 58L +#define INDEX_DrvGetDirectDrawInfo 59L +#define INDEX_DrvEnableDirectDraw 60L +#define INDEX_DrvDisableDirectDraw 61L +#define INDEX_DrvQuerySpoolType 62L +#define INDEX_DrvIcmCreateColorTransform 64L +#define INDEX_DrvIcmDeleteColorTransform 65L +#define INDEX_DrvIcmCheckBitmapBits 66L +#define INDEX_DrvIcmSetDeviceGammaRamp 67L +#define INDEX_DrvGradientFill 68L +#define INDEX_DrvStretchBltROP 69L +#define INDEX_DrvPlgBlt 70L +#define INDEX_DrvAlphaBlend 71L +#define INDEX_DrvSynthesizeFont 72L +#define INDEX_DrvGetSynthesizedFontFiles 73L +#define INDEX_DrvTransparentBlt 74L +#define INDEX_DrvQueryPerBandInfo 75L +#define INDEX_DrvQueryDeviceSupport 76L +#define INDEX_DrvReserved1 77L +#define INDEX_DrvReserved2 78L +#define INDEX_DrvReserved3 79L +#define INDEX_DrvReserved4 80L +#define INDEX_DrvReserved5 81L +#define INDEX_DrvReserved6 82L +#define INDEX_DrvReserved7 83L +#define INDEX_DrvReserved8 84L +#define INDEX_DrvDeriveSurface 85L +#define INDEX_DrvQueryGlyphAttrs 86L +#define INDEX_DrvNotify 87L +#define INDEX_DrvSynchronizeSurface 88L +#define INDEX_DrvResetDevice 89L +#define INDEX_DrvReserved9 90L +#define INDEX_DrvReserved10 91L +#define INDEX_DrvReserved11 92L +#define INDEX_LAST 93L + +typedef struct _DRVFN { + ULONG iFunc; + PFN pfn; +} DRVFN, *PDRVFN; + +/* DRVENABLEDATA.iDriverVersion constants */ +#define DDI_DRIVER_VERSION_NT4 0x00020000 +#define DDI_DRIVER_VERSION_SP3 0x00020003 +#define DDI_DRIVER_VERSION_NT5 0x00030000 +#define DDI_DRIVER_VERSION_NT5_01 0x00030100 + +typedef struct _DRVENABLEDATA { + ULONG iDriverVersion; + ULONG c; + DRVFN *pdrvfn; +} DRVENABLEDATA, *PDRVENABLEDATA; + +DECLARE_HANDLE(HSEMAPHORE); + +typedef struct { + DWORD nSize; + HDC hdc; + PBYTE pvEMF; + PBYTE pvCurrentRecord; +} EMFINFO, *PEMFINFO; + +typedef struct _ENGSAFESEMAPHORE { + HSEMAPHORE hsem; + LONG lCount; +} ENGSAFESEMAPHORE; + +typedef struct _ENG_TIME_FIELDS { + USHORT usYear; + USHORT usMonth; + USHORT usDay; + USHORT usHour; + USHORT usMinute; + USHORT usSecond; + USHORT usMilliseconds; + USHORT usWeekday; +} ENG_TIME_FIELDS, *PENG_TIME_FIELDS; + +typedef struct _ENUMRECTS { + ULONG c; + RECTL arcl[1]; +} ENUMRECTS; + +typedef struct _FD_XFORM { + FLOATL eXX; + FLOATL eXY; + FLOATL eYX; + FLOATL eYY; +} FD_XFORM, *PFD_XFORM; + +/* FD_DEVICEMETRICS.flRealizedType constants */ +#define FDM_TYPE_BM_SIDE_CONST 0x00000001 +#define FDM_TYPE_MAXEXT_EQUAL_BM_SIDE 0x00000002 +#define FDM_TYPE_CHAR_INC_EQUAL_BM_BASE 0x00000004 +#define FDM_TYPE_ZERO_BEARINGS 0x00000008 +#define FDM_TYPE_CONST_BEARINGS 0x00000010 + +typedef struct _FD_DEVICEMETRICS { + FLONG flRealizedType; + POINTE pteBase; + POINTE pteSide; + LONG lD; + FIX fxMaxAscender; + FIX fxMaxDescender; + POINTL ptlUnderline1; + POINTL ptlStrikeout; + POINTL ptlULThickness; + POINTL ptlSOThickness; + ULONG cxMax; + ULONG cyMax; + ULONG cjGlyphMax; + FD_XFORM fdxQuantized; + LONG lNonLinearExtLeading; + LONG lNonLinearIntLeading; + LONG lNonLinearMaxCharWidth; + LONG lNonLinearAvgCharWidth; + LONG lMinA; + LONG lMinC; + LONG lMinD; + LONG alReserved[1]; +} FD_DEVICEMETRICS, *PFD_DEVICEMETRICS; + +/* FD_GLYPHATTR.iMode constants */ +#define FO_ATTR_MODE_ROTATE 1 + +typedef struct _FD_GLYPHATTR { + ULONG cjThis; + ULONG cGlyphs; + ULONG iMode; + BYTE aGlyphAttr[1]; +} FD_GLYPHATTR, *PFD_GLYPHATTR; + +/* FD_GLYPHSET.flAccel */ +#define GS_UNICODE_HANDLES 0x00000001 +#define GS_8BIT_HANDLES 0x00000002 +#define GS_16BIT_HANDLES 0x00000004 + +typedef struct _WCRUN { + WCHAR wcLow; + USHORT cGlyphs; + HGLYPH *phg; +} WCRUN, *PWCRUN; + +typedef struct _FD_GLYPHSET { + ULONG cjThis; + FLONG flAccel; + ULONG cGlyphsSupported; + ULONG cRuns; + WCRUN awcrun[1]; +} FD_GLYPHSET, *PFD_GLYPHSET; + +typedef struct _FD_KERNINGPAIR { + WCHAR wcFirst; + WCHAR wcSecond; + FWORD fwdKern; +} FD_KERNINGPAIR; + +typedef struct _FLOATOBJ +{ + ULONG ul1; + ULONG ul2; +} FLOATOBJ, *PFLOATOBJ; + +typedef struct _FLOATOBJ_XFORM { + FLOATOBJ eM11; + FLOATOBJ eM12; + FLOATOBJ eM21; + FLOATOBJ eM22; + FLOATOBJ eDx; + FLOATOBJ eDy; +} FLOATOBJ_XFORM, *PFLOATOBJ_XFORM, FAR *LPFLOATOBJ_XFORM; + +/* FONTDIFF.fsSelection */ +#define FM_SEL_ITALIC 0x0001 +#define FM_SEL_UNDERSCORE 0x0002 +#define FM_SEL_NEGATIVE 0x0004 +#define FM_SEL_OUTLINED 0x0008 +#define FM_SEL_STRIKEOUT 0x0010 +#define FM_SEL_BOLD 0x0020 +#define FM_SEL_REGULAR 0x0040 + +typedef struct _FONTDIFF { + BYTE jReserved1; + BYTE jReserved2; + BYTE jReserved3; + BYTE bWeight; + USHORT usWinWeight; + FSHORT fsSelection; + FWORD fwdAveCharWidth; + FWORD fwdMaxCharInc; + POINTL ptlCaret; +} FONTDIFF; + +typedef struct _FONTSIM { + PTRDIFF dpBold; + PTRDIFF dpItalic; + PTRDIFF dpBoldItalic; +} FONTSIM; + +/* FONTINFO.flCaps constants */ +#define FO_DEVICE_FONT 1L +#define FO_OUTLINE_CAPABLE 2L + +typedef struct _FONTINFO { + ULONG cjThis; + FLONG flCaps; + ULONG cGlyphsSupported; + ULONG cjMaxGlyph1; + ULONG cjMaxGlyph4; + ULONG cjMaxGlyph8; + ULONG cjMaxGlyph32; +} FONTINFO, *PFONTINFO; + +/* FONTOBJ.flFontType constants */ +#define FO_TYPE_RASTER RASTER_FONTTYPE +#define FO_TYPE_DEVICE DEVICE_FONTTYPE +#define FO_TYPE_TRUETYPE TRUETYPE_FONTTYPE +#define FO_TYPE_OPENTYPE OPENTYPE_FONTTYPE + +#define FO_SIM_BOLD 0x00002000 +#define FO_SIM_ITALIC 0x00004000 +#define FO_EM_HEIGHT 0x00008000 +#define FO_GRAY16 0x00010000 +#define FO_NOGRAY16 0x00020000 +#define FO_NOHINTS 0x00040000 +#define FO_NO_CHOICE 0x00080000 +#define FO_CFF 0x00100000 +#define FO_POSTSCRIPT 0x00200000 +#define FO_MULTIPLEMASTER 0x00400000 +#define FO_VERT_FACE 0x00800000 +#define FO_DBCS_FONT 0X01000000 +#define FO_NOCLEARTYPE 0x02000000 +#define FO_CLEARTYPE_X 0x10000000 +#define FO_CLEARTYPE_Y 0x20000000 + +typedef struct _FONTOBJ { + ULONG iUniq; + ULONG iFace; + ULONG cxMax; + FLONG flFontType; + ULONG_PTR iTTUniq; + ULONG_PTR iFile; + SIZE sizLogResPpi; + ULONG ulStyleSize; + PVOID pvConsumer; + PVOID pvProducer; +} FONTOBJ; + +typedef struct _GAMMARAMP { + WORD Red[256]; + WORD Green[256]; + WORD Blue[256]; +} GAMMARAMP, *PGAMMARAMP; + +/* GDIINFO.ulPrimaryOrder constants */ +#define PRIMARY_ORDER_ABC 0 +#define PRIMARY_ORDER_ACB 1 +#define PRIMARY_ORDER_BAC 2 +#define PRIMARY_ORDER_BCA 3 +#define PRIMARY_ORDER_CBA 4 +#define PRIMARY_ORDER_CAB 5 + +/* GDIINFO.ulHTPatternSize constants */ +#define HT_PATSIZE_2x2 0 +#define HT_PATSIZE_2x2_M 1 +#define HT_PATSIZE_4x4 2 +#define HT_PATSIZE_4x4_M 3 +#define HT_PATSIZE_6x6 4 +#define HT_PATSIZE_6x6_M 5 +#define HT_PATSIZE_8x8 6 +#define HT_PATSIZE_8x8_M 7 +#define HT_PATSIZE_10x10 8 +#define HT_PATSIZE_10x10_M 9 +#define HT_PATSIZE_12x12 10 +#define HT_PATSIZE_12x12_M 11 +#define HT_PATSIZE_14x14 12 +#define HT_PATSIZE_14x14_M 13 +#define HT_PATSIZE_16x16 14 +#define HT_PATSIZE_16x16_M 15 +#define HT_PATSIZE_SUPERCELL 16 +#define HT_PATSIZE_SUPERCELL_M 17 +#define HT_PATSIZE_USER 18 +#define HT_PATSIZE_MAX_INDEX HT_PATSIZE_USER +#define HT_PATSIZE_DEFAULT HT_PATSIZE_SUPERCELL_M +#define HT_USERPAT_CX_MIN 4 +#define HT_USERPAT_CX_MAX 256 +#define HT_USERPAT_CY_MIN 4 +#define HT_USERPAT_CY_MAX 256 + +/* GDIINFO.ulHTOutputFormat constants */ +#define HT_FORMAT_1BPP 0 +#define HT_FORMAT_4BPP 2 +#define HT_FORMAT_4BPP_IRGB 3 +#define HT_FORMAT_8BPP 4 +#define HT_FORMAT_16BPP 5 +#define HT_FORMAT_24BPP 6 +#define HT_FORMAT_32BPP 7 + +/* GDIINFO.flHTFlags */ +#define HT_FLAG_SQUARE_DEVICE_PEL 0x00000001 +#define HT_FLAG_HAS_BLACK_DYE 0x00000002 +#define HT_FLAG_ADDITIVE_PRIMS 0x00000004 +#define HT_FLAG_USE_8BPP_BITMASK 0x00000008 +#define HT_FLAG_INK_HIGH_ABSORPTION 0x00000010 +#define HT_FLAG_INK_ABSORPTION_INDICES 0x00000060 +#define HT_FLAG_DO_DEVCLR_XFORM 0x00000080 +#define HT_FLAG_OUTPUT_CMY 0x00000100 +#define HT_FLAG_PRINT_DRAFT_MODE 0x00000200 +#define HT_FLAG_INVERT_8BPP_BITMASK_IDX 0x00000400 +#define HT_FLAG_8BPP_CMY332_MASK 0xFF000000 + +#define MAKE_CMYMASK_BYTE(c,m,y) ((BYTE)(((BYTE)(c) & 0x07) << 5) \ + |(BYTE)(((BYTE)(m) & 0x07) << 2) \ + |(BYTE)((BYTE)(y) & 0x03)) + +#define MAKE_CMY332_MASK(c,m,y) ((DWORD)(((DWORD)(c) & 0x07) << 29)\ + |(DWORD)(((DWORD)(m) & 0x07) << 26)\ + |(DWORD)(((DWORD)(y) & 0x03) << 24)) + +/* GDIINFO.flHTFlags constants */ +#define HT_FLAG_INK_ABSORPTION_IDX0 0x00000000 +#define HT_FLAG_INK_ABSORPTION_IDX1 0x00000020 +#define HT_FLAG_INK_ABSORPTION_IDX2 0x00000040 +#define HT_FLAG_INK_ABSORPTION_IDX3 0x00000060 + +#define HT_FLAG_HIGHEST_INK_ABSORPTION (HT_FLAG_INK_HIGH_ABSORPTION \ + |HT_FLAG_INK_ABSORPTION_IDX3) +#define HT_FLAG_HIGHER_INK_ABSORPTION (HT_FLAG_INK_HIGH_ABSORPTION \ + |HT_FLAG_INK_ABSORPTION_IDX2) +#define HT_FLAG_HIGH_INK_ABSORPTION (HT_FLAG_INK_HIGH_ABSORPTION \ + |HT_FLAG_INK_ABSORPTION_IDX1) +#define HT_FLAG_NORMAL_INK_ABSORPTION HT_FLAG_INK_ABSORPTION_IDX0 +#define HT_FLAG_LOW_INK_ABSORPTION HT_FLAG_INK_ABSORPTION_IDX1 +#define HT_FLAG_LOWER_INK_ABSORPTION HT_FLAG_INK_ABSORPTION_IDX2 +#define HT_FLAG_LOWEST_INK_ABSORPTION HT_FLAG_INK_ABSORPTION_IDX3 + +#define HT_BITMASKPALRGB (DWORD)'0BGR' +#define HT_SET_BITMASKPAL2RGB(pPal) (*((LPDWORD)(pPal)) = HT_BITMASKPALRGB) +#define HT_IS_BITMASKPALRGB(pPal) (*((LPDWORD)(pPal)) == (DWORD)0) + +/* GDIINFO.ulPhysicalPixelCharacteristics constants */ +#define PPC_DEFAULT 0x0 +#define PPC_UNDEFINED 0x1 +#define PPC_RGB_ORDER_VERTICAL_STRIPES 0x2 +#define PPC_BGR_ORDER_VERTICAL_STRIPES 0x3 +#define PPC_RGB_ORDER_HORIZONTAL_STRIPES 0x4 +#define PPC_BGR_ORDER_HORIZONTAL_STRIPES 0x5 + +#define PPG_DEFAULT 0 +#define PPG_SRGB 1 + +typedef struct _GDIINFO { + ULONG ulVersion; + ULONG ulTechnology; + ULONG ulHorzSize; + ULONG ulVertSize; + ULONG ulHorzRes; + ULONG ulVertRes; + ULONG cBitsPixel; + ULONG cPlanes; + ULONG ulNumColors; + ULONG flRaster; + ULONG ulLogPixelsX; + ULONG ulLogPixelsY; + ULONG flTextCaps; + ULONG ulDACRed; + ULONG ulDACGreen; + ULONG ulDACBlue; + ULONG ulAspectX; + ULONG ulAspectY; + ULONG ulAspectXY; + LONG xStyleStep; + LONG yStyleStep; + LONG denStyleStep; + POINTL ptlPhysOffset; + SIZEL szlPhysSize; + ULONG ulNumPalReg; + COLORINFO ciDevice; + ULONG ulDevicePelsDPI; + ULONG ulPrimaryOrder; + ULONG ulHTPatternSize; + ULONG ulHTOutputFormat; + ULONG flHTFlags; + ULONG ulVRefresh; + ULONG ulBltAlignment; + ULONG ulPanningHorzRes; + ULONG ulPanningVertRes; + ULONG xPanningAlignment; + ULONG yPanningAlignment; + ULONG cxHTPat; + ULONG cyHTPat; + LPBYTE pHTPatA; + LPBYTE pHTPatB; + LPBYTE pHTPatC; + ULONG flShadeBlend; + ULONG ulPhysicalPixelCharacteristics; + ULONG ulPhysicalPixelGamma; +} GDIINFO, *PGDIINFO; + +/* PATHDATA.flags constants */ +#define PD_BEGINSUBPATH 0x00000001 +#define PD_ENDSUBPATH 0x00000002 +#define PD_RESETSTYLE 0x00000004 +#define PD_CLOSEFIGURE 0x00000008 +#define PD_BEZIERS 0x00000010 +#define PD_ALL (PD_BEGINSUBPATH \ + |PD_ENDSUBPATH \ + |PD_RESETSTYLE \ + |PD_CLOSEFIGURE \ + PD_BEZIERS) + +typedef struct _PATHDATA { + FLONG flags; + ULONG count; + POINTFIX *glypptfx; +} PATHDATA, *PPATHDATA; + +/* PATHOBJ.fl constants */ +#define PO_BEZIERS 0x00000001 +#define PO_ELLIPSE 0x00000002 +#define PO_ALL_INTEGERS 0x00000004 +#define PO_ENUM_AS_INTEGERS 0x00000008 + +typedef struct _PATHOBJ { + FLONG fl; + ULONG cCurves; +} PATHOBJ; + +typedef struct _GLYPHBITS { + POINTL ptlOrigin; + SIZEL sizlBitmap; + BYTE aj[1]; +} GLYPHBITS; + +typedef union _GLYPHDEF { + GLYPHBITS *pgb; + PATHOBJ *ppo; +} GLYPHDEF; + +typedef struct _GLYPHPOS { + HGLYPH hg; + GLYPHDEF *pgdf; + POINTL ptl; +} GLYPHPOS, *PGLYPHPOS; + +typedef struct _GLYPHDATA { + GLYPHDEF gdf; + HGLYPH hg; + FIX fxD; + FIX fxA; + FIX fxAB; + FIX fxInkTop; + FIX fxInkBottom; + RECTL rclInk; + POINTQF ptqD; +} GLYPHDATA; + +typedef struct _IFIEXTRA { + ULONG ulIdentifier; + PTRDIFF dpFontSig; + ULONG cig; + PTRDIFF dpDesignVector; + PTRDIFF dpAxesInfoW; + ULONG aulReserved[1]; +} IFIEXTRA, *PIFIEXTRA; + +/* IFIMETRICS constants */ + +#define FM_VERSION_NUMBER 0x0 + +/* IFIMETRICS.fsType constants */ +#define FM_TYPE_LICENSED 0x2 +#define FM_READONLY_EMBED 0x4 +#define FM_EDITABLE_EMBED 0x8 +#define FM_NO_EMBEDDING FM_TYPE_LICENSED + +/* IFIMETRICS.flInfo constants */ +#define FM_INFO_TECH_TRUETYPE 0x00000001 +#define FM_INFO_TECH_BITMAP 0x00000002 +#define FM_INFO_TECH_STROKE 0x00000004 +#define FM_INFO_TECH_OUTLINE_NOT_TRUETYPE 0x00000008 +#define FM_INFO_ARB_XFORMS 0x00000010 +#define FM_INFO_1BPP 0x00000020 +#define FM_INFO_4BPP 0x00000040 +#define FM_INFO_8BPP 0x00000080 +#define FM_INFO_16BPP 0x00000100 +#define FM_INFO_24BPP 0x00000200 +#define FM_INFO_32BPP 0x00000400 +#define FM_INFO_INTEGER_WIDTH 0x00000800 +#define FM_INFO_CONSTANT_WIDTH 0x00001000 +#define FM_INFO_NOT_CONTIGUOUS 0x00002000 +#define FM_INFO_TECH_MM 0x00004000 +#define FM_INFO_RETURNS_OUTLINES 0x00008000 +#define FM_INFO_RETURNS_STROKES 0x00010000 +#define FM_INFO_RETURNS_BITMAPS 0x00020000 +#define FM_INFO_DSIG 0x00040000 +#define FM_INFO_RIGHT_HANDED 0x00080000 +#define FM_INFO_INTEGRAL_SCALING 0x00100000 +#define FM_INFO_90DEGREE_ROTATIONS 0x00200000 +#define FM_INFO_OPTICALLY_FIXED_PITCH 0x00400000 +#define FM_INFO_DO_NOT_ENUMERATE 0x00800000 +#define FM_INFO_ISOTROPIC_SCALING_ONLY 0x01000000 +#define FM_INFO_ANISOTROPIC_SCALING_ONLY 0x02000000 +#define FM_INFO_TECH_CFF 0x04000000 +#define FM_INFO_FAMILY_EQUIV 0x08000000 +#define FM_INFO_DBCS_FIXED_PITCH 0x10000000 +#define FM_INFO_NONNEGATIVE_AC 0x20000000 +#define FM_INFO_IGNORE_TC_RA_ABLE 0x40000000 +#define FM_INFO_TECH_TYPE1 0x80000000 + +#define MAXCHARSETS 16 + +/* IFIMETRICS.ulPanoseCulture constants */ +#define FM_PANOSE_CULTURE_LATIN 0x0 + +typedef struct _IFIMETRICS { + ULONG cjThis; + ULONG cjIfiExtra; + PTRDIFF dpwszFamilyName; + PTRDIFF dpwszStyleName; + PTRDIFF dpwszFaceName; + PTRDIFF dpwszUniqueName; + PTRDIFF dpFontSim; + LONG lEmbedId; + LONG lItalicAngle; + LONG lCharBias; + PTRDIFF dpCharSets; + BYTE jWinCharSet; + BYTE jWinPitchAndFamily; + USHORT usWinWeight; + ULONG flInfo; + USHORT fsSelection; + USHORT fsType; + FWORD fwdUnitsPerEm; + FWORD fwdLowestPPEm; + FWORD fwdWinAscender; + FWORD fwdWinDescender; + FWORD fwdMacAscender; + FWORD fwdMacDescender; + FWORD fwdMacLineGap; + FWORD fwdTypoAscender; + FWORD fwdTypoDescender; + FWORD fwdTypoLineGap; + FWORD fwdAveCharWidth; + FWORD fwdMaxCharInc; + FWORD fwdCapHeight; + FWORD fwdXHeight; + FWORD fwdSubscriptXSize; + FWORD fwdSubscriptYSize; + FWORD fwdSubscriptXOffset; + FWORD fwdSubscriptYOffset; + FWORD fwdSuperscriptXSize; + FWORD fwdSuperscriptYSize; + FWORD fwdSuperscriptXOffset; + FWORD fwdSuperscriptYOffset; + FWORD fwdUnderscoreSize; + FWORD fwdUnderscorePosition; + FWORD fwdStrikeoutSize; + FWORD fwdStrikeoutPosition; + BYTE chFirstChar; + BYTE chLastChar; + BYTE chDefaultChar; + BYTE chBreakChar; + WCHAR wcFirstChar; + WCHAR wcLastChar; + WCHAR wcDefaultChar; + WCHAR wcBreakChar; + POINTL ptlBaseline; + POINTL ptlAspect; + POINTL ptlCaret; + RECTL rclFontBox; + BYTE achVendId[4]; + ULONG cKerningPairs; + ULONG ulPanoseCulture; + PANOSE panose; +#if defined(_WIN64) + PVOID Align; +#endif +} IFIMETRICS, *PIFIMETRICS; + +/* LINEATTRS.fl */ +#define LA_GEOMETRIC 0x00000001 +#define LA_ALTERNATE 0x00000002 +#define LA_STARTGAP 0x00000004 +#define LA_STYLED 0x00000008 + +/* LINEATTRS.iJoin */ +#define JOIN_ROUND 0L +#define JOIN_BEVEL 1L +#define JOIN_MITER 2L + +/* LINEATTRS.iEndCap */ +#define ENDCAP_ROUND 0L +#define ENDCAP_SQUARE 1L +#define ENDCAP_BUTT 2L + +typedef struct _LINEATTRS { + FLONG fl; + ULONG iJoin; + ULONG iEndCap; + FLOAT_LONG elWidth; + FLOATL eMiterLimit; + ULONG cstyle; + PFLOAT_LONG pstyle; + FLOAT_LONG elStyleState; +} LINEATTRS, *PLINEATTRS; + +typedef struct _PALOBJ { + ULONG ulReserved; +} PALOBJ; + +typedef struct _PERBANDINFO { + BOOL bRepeatThisBand; + SIZEL szlBand; + ULONG ulHorzRes; + ULONG ulVertRes; +} PERBANDINFO, *PPERBANDINFO; + +/* STROBJ.flAccel constants */ +#define SO_FLAG_DEFAULT_PLACEMENT 0x00000001 +#define SO_HORIZONTAL 0x00000002 +#define SO_VERTICAL 0x00000004 +#define SO_REVERSED 0x00000008 +#define SO_ZERO_BEARINGS 0x00000010 +#define SO_CHAR_INC_EQUAL_BM_BASE 0x00000020 +#define SO_MAXEXT_EQUAL_BM_SIDE 0x00000040 +#define SO_DO_NOT_SUBSTITUTE_DEVICE_FONT 0x00000080 +#define SO_GLYPHINDEX_TEXTOUT 0x00000100 +#define SO_ESC_NOT_ORIENT 0x00000200 +#define SO_DXDY 0x00000400 +#define SO_CHARACTER_EXTRA 0x00000800 +#define SO_BREAK_EXTRA 0x00001000 + +typedef struct _STROBJ { + ULONG cGlyphs; + FLONG flAccel; + ULONG ulCharInc; + RECTL rclBkGround; + GLYPHPOS *pgp; + LPWSTR pwszOrg; +} STROBJ; + + + +/* SURFOBJ.iType constants */ +#define STYPE_BITMAP 0L +#define STYPE_DEVICE 1L +#define STYPE_DEVBITMAP 3L + +/* SURFOBJ.fjBitmap constants */ +#define BMF_TOPDOWN 0x0001 +#define BMF_NOZEROINIT 0x0002 +#define BMF_DONTCACHE 0x0004 +#define BMF_USERMEM 0x0008 +#define BMF_KMSECTION 0x0010 +#define BMF_NOTSYSMEM 0x0020 +#define BMF_WINDOW_BLT 0x0040 +#define BMF_UMPDMEM 0x0080 +#define BMF_RESERVED 0xFF00 + +typedef struct _SURFOBJ { + DHSURF dhsurf; + HSURF hsurf; + DHPDEV dhpdev; + HDEV hdev; + SIZEL sizlBitmap; + ULONG cjBits; + PVOID pvBits; + PVOID pvScan0; + LONG lDelta; + ULONG iUniq; + ULONG iBitmapFormat; + USHORT iType; + USHORT fjBitmap; +} SURFOBJ; + +typedef struct _TYPE1_FONT { + HANDLE hPFM; + HANDLE hPFB; + ULONG ulIdentifier; +} TYPE1_FONT; + +typedef struct _WNDOBJ { + CLIPOBJ coClient; + PVOID pvConsumer; + RECTL rclClient; + SURFOBJ *psoOwner; +} WNDOBJ, *PWNDOBJ; + +typedef struct _XFORML { + FLOATL eM11; + FLOATL eM12; + FLOATL eM21; + FLOATL eM22; + FLOATL eDx; + FLOATL eDy; +} XFORML, *PXFORML; + +typedef struct _XFORMOBJ { + ULONG ulReserved; +} XFORMOBJ; + +/* XLATEOBJ.flXlate constants */ +#define XO_TRIVIAL 0x00000001 +#define XO_TABLE 0x00000002 +#define XO_TO_MONO 0x00000004 +#define XO_FROM_CMYK 0x00000008 +#define XO_DEVICE_ICM 0x00000010 +#define XO_HOST_ICM 0x00000020 + +typedef struct _XLATEOBJ { + ULONG iUniq; + FLONG flXlate; + USHORT iSrcType; + USHORT iDstType; + ULONG cEntries; + ULONG *pulXlate; +} XLATEOBJ; + +typedef VOID (APIENTRY CALLBACK *WNDOBJCHANGEPROC)( + IN WNDOBJ *pwo, + IN FLONG fl); + + +WIN32KAPI +HANDLE +APIENTRY +BRUSHOBJ_hGetColorTransform( + IN BRUSHOBJ *pbo); + +WIN32KAPI +PVOID +APIENTRY +BRUSHOBJ_pvAllocRbrush( + IN BRUSHOBJ *pbo, + IN ULONG cj); + +WIN32KAPI +PVOID +APIENTRY +BRUSHOBJ_pvGetRbrush( + IN BRUSHOBJ *pbo); + +WIN32KAPI +ULONG +APIENTRY +BRUSHOBJ_ulGetBrushColor( + IN BRUSHOBJ *pbo); + +WIN32KAPI +BOOL +APIENTRY +CLIPOBJ_bEnum( + IN CLIPOBJ *pco, + IN ULONG cj, + OUT ULONG *pv); + +/* CLIPOBJ_cEnumStart.iType constants */ +#define CT_RECTANGLES 0L + +/* CLIPOBJ_cEnumStart.iDirection constants */ +#define CD_RIGHTDOWN 0x00000000 +#define CD_LEFTDOWN 0x00000001 +#define CD_LEFTWARDS 0x00000001 +#define CD_RIGHTUP 0x00000002 +#define CD_UPWARDS 0x00000002 +#define CD_LEFTUP 0x00000003 +#define CD_ANY 0x00000004 + +WIN32KAPI +ULONG +APIENTRY +CLIPOBJ_cEnumStart( + IN CLIPOBJ *pco, + IN BOOL bAll, + IN ULONG iType, + IN ULONG iDirection, + IN ULONG cLimit); + +WIN32KAPI +PATHOBJ* +APIENTRY +CLIPOBJ_ppoGetPath( + IN CLIPOBJ *pco); + +WIN32KAPI +VOID +APIENTRY +EngAcquireSemaphore( + IN HSEMAPHORE hsem); + +#define FL_ZERO_MEMORY 0x00000001 +#define FL_NONPAGED_MEMORY 0x00000002 + +WIN32KAPI +PVOID +APIENTRY +EngAllocMem( + IN ULONG Flags, + IN ULONG MemSize, + IN ULONG Tag); + +WIN32KAPI +PVOID +APIENTRY +EngAllocPrivateUserMem( + IN PDD_SURFACE_LOCAL psl, + IN SIZE_T cj, + IN ULONG tag); + +WIN32KAPI +PVOID +APIENTRY +EngAllocUserMem( + IN SIZE_T cj, + IN ULONG tag); + +WIN32KAPI +BOOL +APIENTRY +EngAlphaBlend( + IN SURFOBJ *psoDest, + IN SURFOBJ *psoSrc, + IN CLIPOBJ *pco, + IN XLATEOBJ *pxlo, + IN RECTL *prclDest, + IN RECTL *prclSrc, + IN BLENDOBJ *pBlendObj); + +/* EngAssociateSurface.flHooks constants */ +#define HOOK_BITBLT 0x00000001 +#define HOOK_STRETCHBLT 0x00000002 +#define HOOK_PLGBLT 0x00000004 +#define HOOK_TEXTOUT 0x00000008 +#define HOOK_PAINT 0x00000010 +#define HOOK_STROKEPATH 0x00000020 +#define HOOK_FILLPATH 0x00000040 +#define HOOK_STROKEANDFILLPATH 0x00000080 +#define HOOK_LINETO 0x00000100 +#define HOOK_COPYBITS 0x00000400 +#define HOOK_MOVEPANNING 0x00000800 +#define HOOK_SYNCHRONIZE 0x00001000 +#define HOOK_STRETCHBLTROP 0x00002000 +#define HOOK_SYNCHRONIZEACCESS 0x00004000 +#define HOOK_TRANSPARENTBLT 0x00008000 +#define HOOK_ALPHABLEND 0x00010000 +#define HOOK_GRADIENTFILL 0x00020000 +#define HOOK_FLAGS 0x0003b5ff + +WIN32KAPI +BOOL +APIENTRY +EngAssociateSurface( + IN HSURF hsurf, + IN HDEV hdev, + IN FLONG flHooks); + +WIN32KAPI +BOOL +APIENTRY +EngBitBlt( + IN SURFOBJ *psoTrg, + IN SURFOBJ *psoSrc, + IN SURFOBJ *psoMask, + IN CLIPOBJ *pco, + IN XLATEOBJ *pxlo, + IN RECTL *prclTrg, + IN POINTL *pptlSrc, + IN POINTL *pptlMask, + IN BRUSHOBJ *pbo, + IN POINTL *pptlBrush, + IN ROP4 rop4); + +WIN32KAPI +BOOL +APIENTRY +EngCheckAbort( + IN SURFOBJ *pso); + +WIN32KAPI +VOID +APIENTRY +EngClearEvent( + IN PEVENT pEvent); + +WIN32KAPI +FD_GLYPHSET* +APIENTRY +EngComputeGlyphSet( + IN INT nCodePage, + IN INT nFirstChar, + IN INT cChars); + +/* EngControlSprites.fl constants */ +#define ECS_TEARDOWN 0x00000001 +#define ECS_REDRAW 0x00000002 + +WIN32KAPI +BOOL +APIENTRY +EngControlSprites( + IN WNDOBJ *pwo, + IN FLONG fl); + +WIN32KAPI +BOOL +APIENTRY +EngCopyBits( + OUT SURFOBJ *psoDest, + IN SURFOBJ *psoSrc, + IN CLIPOBJ *pco, + IN XLATEOBJ *pxlo, + IN RECTL *prclDest, + IN POINTL *pptlSrc); + +WIN32KAPI +HBITMAP +APIENTRY +EngCreateBitmap( + IN SIZEL sizl, + IN LONG lWidth, + IN ULONG iFormat, + IN FLONG fl, + IN PVOID pvBits); + +WIN32KAPI +CLIPOBJ* +APIENTRY +EngCreateClip( + VOID); + +WIN32KAPI +HBITMAP +APIENTRY +EngCreateDeviceBitmap( + IN DHSURF dhsurf, + IN SIZEL sizl, + IN ULONG iFormatCompat); + +WIN32KAPI +HSURF +APIENTRY +EngCreateDeviceSurface( + DHSURF dhsurf, + SIZEL sizl, + ULONG iFormatCompat); + +#if 0 +WIN32KAPI +HDRVOBJ +APIENTRY +EngCreateDriverObj( + PVOID pvObj, + FREEOBJPROC pFreeObjProc, + HDEV hdev); +#endif + +WIN32KAPI +BOOL +APIENTRY +EngCreateEvent( + OUT PEVENT *ppEvent); + +/* EngCreatePalette.iMode constants */ +#define PAL_INDEXED 0x00000001 +#define PAL_BITFIELDS 0x00000002 +#define PAL_RGB 0x00000004 +#define PAL_BGR 0x00000008 +#define PAL_CMYK 0x00000010 + +WIN32KAPI +HPALETTE +APIENTRY +EngCreatePalette( + IN ULONG iMode, + IN ULONG cColors, + IN ULONG *pulColors, + IN FLONG flRed, + IN FLONG flGreen, + IN FLONG flBlue); + +WIN32KAPI +PATHOBJ* +APIENTRY +EngCreatePath( + VOID); + +WIN32KAPI +HSEMAPHORE +APIENTRY +EngCreateSemaphore( + VOID); + +/* EngCreateWnd.fl constants */ +#define WO_RGN_CLIENT_DELTA 0x00000001 +#define WO_RGN_CLIENT 0x00000002 +#define WO_RGN_SURFACE_DELTA 0x00000004 +#define WO_RGN_SURFACE 0x00000008 +#define WO_RGN_UPDATE_ALL 0x00000010 +#define WO_RGN_WINDOW 0x00000020 +#define WO_DRAW_NOTIFY 0x00000040 +#define WO_SPRITE_NOTIFY 0x00000080 +#define WO_RGN_DESKTOP_COORD 0x00000100 + +WIN32KAPI +WNDOBJ* +APIENTRY +EngCreateWnd( + SURFOBJ *pso, + HWND hwnd, + WNDOBJCHANGEPROC pfn, + FLONG fl, + int iPixelFormat); + +WIN32KAPI +VOID +APIENTRY +EngDebugBreak( + VOID); + +WIN32KAPI +VOID +APIENTRY +EngDebugPrint( + IN PCHAR StandardPrefix, + IN PCHAR DebugMessage, + IN va_list ap); + +WIN32KAPI +VOID +APIENTRY +EngDeleteClip( + IN CLIPOBJ *pco); + +WIN32KAPI +BOOL +APIENTRY +EngDeleteDriverObj( + IN HDRVOBJ hdo, + IN BOOL bCallBack, + IN BOOL bLocked); + +WIN32KAPI +BOOL +APIENTRY +EngDeleteEvent( + IN PEVENT pEvent); + +WIN32KAPI +BOOL +APIENTRY +EngDeleteFile( + IN LPWSTR pwszFileName); + +WIN32KAPI +BOOL +APIENTRY +EngDeletePalette( + IN HPALETTE hpal); + +WIN32KAPI +VOID +APIENTRY +EngDeletePath( + IN PATHOBJ *ppo); + +WIN32KAPI +VOID +APIENTRY +EngDeleteSafeSemaphore( + IN OUT ENGSAFESEMAPHORE *pssem); + +WIN32KAPI +VOID +APIENTRY +EngDeleteSemaphore( + IN OUT HSEMAPHORE hsem); + +WIN32KAPI +BOOL +APIENTRY +EngDeleteSurface( + IN HSURF hsurf); + +WIN32KAPI +VOID +APIENTRY +EngDeleteWnd( + IN WNDOBJ *pwo); + +WIN32KAPI +DWORD +APIENTRY +EngDeviceIoControl( + IN HANDLE hDevice, + IN DWORD dwIoControlCode, + IN LPVOID lpInBuffer, + IN DWORD nInBufferSize, + IN OUT LPVOID lpOutBuffer, + IN DWORD nOutBufferSize, + OUT LPDWORD lpBytesReturned); + +WIN32KAPI +ULONG +APIENTRY +EngDitherColor( + IN HDEV hdev, + IN ULONG iMode, + IN ULONG rgb, + OUT ULONG *pul); + +WIN32KAPI +BOOL +APIENTRY +EngEnumForms( + IN HANDLE hPrinter, + IN DWORD Level, + OUT LPBYTE pForm, + IN DWORD cbBuf, + OUT LPDWORD pcbNeeded, + OUT LPDWORD pcReturned); + +WIN32KAPI +BOOL +APIENTRY +EngEraseSurface( + IN SURFOBJ *pso, + IN RECTL *prcl, + IN ULONG iColor); + +WIN32KAPI +BOOL +APIENTRY +EngFillPath( + IN SURFOBJ *pso, + IN PATHOBJ *ppo, + IN CLIPOBJ *pco, + IN BRUSHOBJ *pbo, + IN POINTL *pptlBrushOrg, + IN MIX mix, + IN FLONG flOptions); + +WIN32KAPI +PVOID +APIENTRY +EngFindImageProcAddress( + IN HANDLE hModule, + IN LPSTR lpProcName); + +WIN32KAPI +PVOID +APIENTRY +EngFindResource( + IN HANDLE h, + IN int iName, + IN int iType, + OUT PULONG pulSize); + +WIN32KAPI +PVOID +APIENTRY +EngFntCacheAlloc( + IN ULONG FastCheckSum, + IN ULONG ulSize); + +/* EngFntCacheFault.iFaultMode constants */ +#define ENG_FNT_CACHE_READ_FAULT 0x00000001 +#define ENG_FNT_CACHE_WRITE_FAULT 0x00000002 + +WIN32KAPI +VOID +APIENTRY +EngFntCacheFault( + IN ULONG ulFastCheckSum, + IN ULONG iFaultMode); + +WIN32KAPI +PVOID +APIENTRY +EngFntCacheLookUp( + IN ULONG FastCheckSum, + OUT ULONG *pulSize); + +WIN32KAPI +VOID +APIENTRY +EngFreeMem( + IN PVOID Mem); + +WIN32KAPI +VOID +APIENTRY +EngFreeModule( + IN HANDLE h); + +WIN32KAPI +VOID +APIENTRY +EngFreePrivateUserMem( + IN PDD_SURFACE_LOCAL psl, + IN PVOID pv); + +WIN32KAPI +VOID +APIENTRY +EngFreeUserMem( + IN PVOID pv); + +WIN32KAPI +VOID +APIENTRY +EngGetCurrentCodePage( + OUT PUSHORT OemCodePage, + OUT PUSHORT AnsiCodePage); + +WIN32KAPI +HANDLE +APIENTRY +EngGetCurrentProcessId( + VOID); + +WIN32KAPI +HANDLE +APIENTRY +EngGetCurrentThreadId( + VOID); + +WIN32KAPI +LPWSTR +APIENTRY +EngGetDriverName( + IN HDEV hdev); + +WIN32KAPI +BOOL +APIENTRY +EngGetFileChangeTime( + IN HANDLE h, + OUT LARGE_INTEGER *pChangeTime); + +WIN32KAPI +BOOL +APIENTRY +EngGetFilePath( + IN HANDLE h, + OUT WCHAR (*pDest)[MAX_PATH+1]); + +WIN32KAPI +BOOL +APIENTRY +EngGetForm( + IN HANDLE hPrinter, + IN LPWSTR pFormName, + IN DWORD Level, + OUT LPBYTE pForm, + IN DWORD cbBuf, + OUT LPDWORD pcbNeeded); + +WIN32KAPI +ULONG +APIENTRY +EngGetLastError( + VOID); + +WIN32KAPI +BOOL +APIENTRY +EngGetPrinter( + IN HANDLE hPrinter, + IN DWORD dwLevel, + OUT LPBYTE pPrinter, + IN DWORD cbBuf, + OUT LPDWORD pcbNeeded); + +WIN32KAPI +DWORD +APIENTRY +EngGetPrinterData( + IN HANDLE hPrinter, + IN LPWSTR pValueName, + OUT LPDWORD pType, + OUT LPBYTE pData, + IN DWORD nSize, + OUT LPDWORD pcbNeeded); + +WIN32KAPI +LPWSTR +APIENTRY +EngGetPrinterDataFileName( + IN HDEV hdev); + +WIN32KAPI +BOOL +APIENTRY +EngGetPrinterDriver( + IN HANDLE hPrinter, + IN LPWSTR pEnvironment, + IN DWORD dwLevel, + OUT BYTE *lpbDrvInfo, + IN DWORD cbBuf, + OUT DWORD *pcbNeeded); + +WIN32KAPI +HANDLE +APIENTRY +EngGetProcessHandle( + VOID); + +WIN32KAPI +BOOL +APIENTRY +EngGetType1FontList( + IN HDEV hdev, + OUT TYPE1_FONT *pType1Buffer, + IN ULONG cjType1Buffer, + OUT PULONG pulLocalFonts, + OUT PULONG pulRemoteFonts, + OUT LARGE_INTEGER *pLastModified); + +WIN32KAPI +BOOL +APIENTRY +EngGradientFill( + IN SURFOBJ *psoDest, + IN CLIPOBJ *pco, + IN XLATEOBJ *pxlo, + IN TRIVERTEX *pVertex, + IN ULONG nVertex, + IN PVOID pMesh, + IN ULONG nMesh, + IN RECTL *prclExtents, + IN POINTL *pptlDitherOrg, + IN ULONG ulMode); + +/* EngHangNotification return values */ +#define EHN_RESTORED 0x00000000 +#define EHN_ERROR 0x00000001 + +WIN32KAPI +ULONG +APIENTRY +EngHangNotification( + IN HDEV hDev, + IN PVOID Reserved); + +WIN32KAPI +BOOL +APIENTRY +EngInitializeSafeSemaphore( + OUT ENGSAFESEMAPHORE *pssem); + +WIN32KAPI +BOOL +APIENTRY +EngIsSemaphoreOwned( + IN HSEMAPHORE hsem); + +WIN32KAPI +BOOL +APIENTRY +EngIsSemaphoreOwnedByCurrentThread( + IN HSEMAPHORE hsem); + +WIN32KAPI +BOOL +APIENTRY +EngLineTo( + SURFOBJ *pso, + CLIPOBJ *pco, + BRUSHOBJ *pbo, + LONG x1, + LONG y1, + LONG x2, + LONG y2, + RECTL *prclBounds, + MIX mix); + +WIN32KAPI +HANDLE +APIENTRY +EngLoadImage( + IN LPWSTR pwszDriver); + +WIN32KAPI +HANDLE +APIENTRY +EngLoadModule( + IN LPWSTR pwsz); + +WIN32KAPI +HANDLE +APIENTRY +EngLoadModuleForWrite( + IN LPWSTR pwsz, + IN ULONG cjSizeOfModule); + +WIN32KAPI +PDD_SURFACE_LOCAL +APIENTRY +EngLockDirectDrawSurface( + IN HANDLE hSurface); + +WIN32KAPI +DRIVEROBJ* +APIENTRY +EngLockDriverObj( + IN HDRVOBJ hdo); + +WIN32KAPI +SURFOBJ* +APIENTRY +EngLockSurface( + IN HSURF hsurf); + +WIN32KAPI +BOOL +APIENTRY +EngLpkInstalled( + VOID); + +WIN32KAPI +PEVENT +APIENTRY +EngMapEvent( + IN HDEV hDev, + IN HANDLE hUserObject, + IN PVOID Reserved1, + IN PVOID Reserved2, + IN PVOID Reserved3); + +WIN32KAPI +PVOID +APIENTRY +EngMapFile( + IN LPWSTR pwsz, + IN ULONG cjSize, + OUT ULONG_PTR *piFile); + +WIN32KAPI +BOOL +APIENTRY +EngMapFontFile( + ULONG_PTR iFile, + PULONG *ppjBuf, + ULONG *pcjBuf); + +WIN32KAPI +BOOL +APIENTRY +EngMapFontFileFD( + IN ULONG_PTR iFile, + OUT PULONG *ppjBuf, + OUT ULONG *pcjBuf); + +WIN32KAPI +PVOID +APIENTRY +EngMapModule( + IN HANDLE h, + OUT PULONG pSize); + +WIN32KAPI +BOOL +APIENTRY +EngMarkBandingSurface( + IN HSURF hsurf); + +/* EngModifySurface.flSurface constants */ +#define MS_NOTSYSTEMMEMORY 0x00000001 +#define MS_SHAREDACCESS 0x00000002 + +WIN32KAPI +BOOL +APIENTRY +EngModifySurface( + IN HSURF hsurf, + IN HDEV hdev, + IN FLONG flHooks, + IN FLONG flSurface, + IN DHSURF dhsurf, + IN VOID *pvScan0, + IN LONG lDelta, + IN VOID *pvReserved); + +WIN32KAPI +VOID +APIENTRY +EngMovePointer( + IN SURFOBJ *pso, + IN LONG x, + IN LONG y, + IN RECTL *prcl); + +WIN32KAPI +int +APIENTRY +EngMulDiv( + IN int a, + IN int b, + IN int c); + +WIN32KAPI +VOID +APIENTRY +EngMultiByteToUnicodeN( + OUT LPWSTR UnicodeString, + IN ULONG MaxBytesInUnicodeString, + OUT PULONG BytesInUnicodeString, + IN PCHAR MultiByteString, + IN ULONG BytesInMultiByteString); + +WIN32KAPI +INT +APIENTRY +EngMultiByteToWideChar( + IN UINT CodePage, + OUT LPWSTR WideCharString, + IN INT BytesInWideCharString, + IN LPSTR MultiByteString, + IN INT BytesInMultiByteString); + +WIN32KAPI +BOOL +APIENTRY +EngPaint( + IN SURFOBJ *pso, + IN CLIPOBJ *pco, + IN BRUSHOBJ *pbo, + IN POINTL *pptlBrushOrg, + IN MIX mix); + +WIN32KAPI +BOOL +APIENTRY +EngPlgBlt( + IN SURFOBJ *psoTrg, + IN SURFOBJ *psoSrc, + IN SURFOBJ *psoMsk, + IN CLIPOBJ *pco, + IN XLATEOBJ *pxlo, + IN COLORADJUSTMENT *pca, + IN POINTL *pptlBrushOrg, + IN POINTFIX *pptfx, + IN RECTL *prcl, + IN POINTL *pptl, + IN ULONG iMode); + +WIN32KAPI +VOID +APIENTRY +EngProbeForRead( + IN PVOID Address, + IN ULONG Length, + IN ULONG Alignment); + +WIN32KAPI +VOID +APIENTRY +EngProbeForReadAndWrite( + IN PVOID Address, + IN ULONG Length, + IN ULONG Alignment); + +typedef enum _ENG_DEVICE_ATTRIBUTE { + QDA_RESERVED = 0, + QDA_ACCELERATION_LEVEL +} ENG_DEVICE_ATTRIBUTE; + +WIN32KAPI +BOOL +APIENTRY +EngQueryDeviceAttribute( + IN HDEV hdev, + IN ENG_DEVICE_ATTRIBUTE devAttr, + IN VOID *pvIn, + IN ULONG ulInSize, + OUT VOID *pvOut, + OUT ULONG ulOutSize); + +WIN32KAPI +LARGE_INTEGER +APIENTRY +EngQueryFileTimeStamp( + IN LPWSTR pwsz); + +WIN32KAPI +VOID +APIENTRY +EngQueryLocalTime( + OUT PENG_TIME_FIELDS ptf); + +WIN32KAPI +ULONG +APIENTRY +EngQueryPalette( + IN HPALETTE hPal, + OUT ULONG *piMode, + IN ULONG cColors, + OUT ULONG *pulColors); + +WIN32KAPI +VOID +APIENTRY +EngQueryPerformanceCounter( + OUT LONGLONG *pPerformanceCount); + +WIN32KAPI +VOID +APIENTRY +EngQueryPerformanceFrequency( + OUT LONGLONG *pFrequency); + +typedef enum _ENG_SYSTEM_ATTRIBUTE { + EngProcessorFeature = 1, + EngNumberOfProcessors, + EngOptimumAvailableUserMemory, + EngOptimumAvailableSystemMemory, +} ENG_SYSTEM_ATTRIBUTE; + +#define QSA_MMX 0x00000100 +#define QSA_SSE 0x00002000 +#define QSA_3DNOW 0x00004000 + +WIN32KAPI +BOOL +APIENTRY +EngQuerySystemAttribute( + IN ENG_SYSTEM_ATTRIBUTE CapNum, + OUT PDWORD pCapability); + +WIN32KAPI +LONG +APIENTRY +EngReadStateEvent( + IN PEVENT pEvent); + +WIN32KAPI +VOID +APIENTRY +EngReleaseSemaphore( + IN HSEMAPHORE hsem); + +WIN32KAPI +BOOL +APIENTRY +EngRestoreFloatingPointState( + IN VOID *pBuffer); + +WIN32KAPI +ULONG +APIENTRY +EngSaveFloatingPointState( + OUT VOID *pBuffer, + IN ULONG cjBufferSize); + +WIN32KAPI +HANDLE +APIENTRY +EngSecureMem( + IN PVOID Address, + IN ULONG Length); + +WIN32KAPI +LONG +APIENTRY +EngSetEvent( + IN PEVENT pEvent); + +WIN32KAPI +VOID +APIENTRY +EngSetLastError( + IN ULONG iError); + +WIN32KAPI +ULONG +APIENTRY +EngSetPointerShape( + IN SURFOBJ *pso, + IN SURFOBJ *psoMask, + IN SURFOBJ *psoColor, + IN XLATEOBJ *pxlo, + IN LONG xHot, + IN LONG yHot, + IN LONG x, + IN LONG y, + IN RECTL *prcl, + IN FLONG fl); + +WIN32KAPI +BOOL +APIENTRY +EngSetPointerTag( + IN HDEV hdev, + IN SURFOBJ *psoMask, + IN SURFOBJ *psoColor, + IN XLATEOBJ *pxlo, + IN FLONG fl); + +WIN32KAPI +DWORD +APIENTRY +EngSetPrinterData( + IN HANDLE hPrinter, + IN LPWSTR pType, + IN DWORD dwType, + IN LPBYTE lpbPrinterData, + IN DWORD cjPrinterData); + +typedef int (CDECL *SORTCOMP)(const void *pv1, const void *pv2); + +WIN32KAPI +VOID +APIENTRY +EngSort( + IN OUT PBYTE pjBuf, + IN ULONG c, + IN ULONG cjElem, + IN SORTCOMP pfnComp); + +WIN32KAPI +BOOL +APIENTRY +EngStretchBlt( + IN SURFOBJ *psoDest, + IN SURFOBJ *psoSrc, + IN SURFOBJ *psoMask, + IN CLIPOBJ *pco, + IN XLATEOBJ *pxlo, + IN COLORADJUSTMENT *pca, + IN POINTL *pptlHTOrg, + IN RECTL *prclDest, + IN RECTL *prclSrc, + IN POINTL *pptlMask, + IN ULONG iMode); + +WIN32KAPI +BOOL +APIENTRY +EngStretchBltROP( + IN SURFOBJ *psoDest, + IN SURFOBJ *psoSrc, + IN SURFOBJ *psoMask, + IN CLIPOBJ *pco, + IN XLATEOBJ *pxlo, + IN COLORADJUSTMENT *pca, + IN POINTL *pptlHTOrg, + IN RECTL *prclDest, + IN RECTL *prclSrc, + IN POINTL *pptlMask, + IN ULONG iMode, + IN BRUSHOBJ *pbo, + IN DWORD rop4); + +WIN32KAPI +BOOL +APIENTRY +EngStrokeAndFillPath( + IN SURFOBJ *pso, + IN PATHOBJ *ppo, + IN CLIPOBJ *pco, + IN XFORMOBJ *pxo, + IN BRUSHOBJ *pboStroke, + IN LINEATTRS *plineattrs, + IN BRUSHOBJ *pboFill, + IN POINTL *pptlBrushOrg, + IN MIX mixFill, + IN FLONG flOptions); + +WIN32KAPI +BOOL +APIENTRY +EngStrokePath( + IN SURFOBJ *pso, + IN PATHOBJ *ppo, + IN CLIPOBJ *pco, + IN XFORMOBJ *pxo, + IN BRUSHOBJ *pbo, + IN POINTL *pptlBrushOrg, + IN LINEATTRS *plineattrs, + IN MIX mix); + +WIN32KAPI +BOOL +APIENTRY +EngTextOut( + IN SURFOBJ *pso, + IN STROBJ *pstro, + IN FONTOBJ *pfo, + IN CLIPOBJ *pco, + IN RECTL *prclExtra, + IN RECTL *prclOpaque, + IN BRUSHOBJ *pboFore, + IN BRUSHOBJ *pboOpaque, + IN POINTL *pptlOrg, + IN MIX mix); + +WIN32KAPI +BOOL +APIENTRY +EngTransparentBlt( + IN SURFOBJ *psoDst, + IN SURFOBJ *psoSrc, + IN CLIPOBJ *pco, + IN XLATEOBJ *pxlo, + IN RECTL *prclDst, + IN RECTL *prclSrc, + IN ULONG iTransColor, + IN ULONG ulReserved); + +WIN32KAPI +VOID +APIENTRY +EngUnicodeToMultiByteN( + OUT PCHAR MultiByteString, + IN ULONG MaxBytesInMultiByteString, + OUT PULONG BytesInMultiByteString, + IN PWSTR UnicodeString, + IN ULONG BytesInUnicodeString); + +WIN32KAPI +VOID +APIENTRY +EngUnloadImage( + IN HANDLE hModule); + +WIN32KAPI +BOOL +APIENTRY +EngUnlockDirectDrawSurface( + IN PDD_SURFACE_LOCAL pSurface); + +WIN32KAPI +BOOL +APIENTRY +EngUnlockDriverObj( + IN HDRVOBJ hdo); + +WIN32KAPI +VOID +APIENTRY +EngUnlockSurface( + IN SURFOBJ *pso); + +WIN32KAPI +BOOL +APIENTRY +EngUnmapEvent( + IN PEVENT pEvent); + +WIN32KAPI +BOOL +APIENTRY +EngUnmapFile( + IN ULONG_PTR iFile); + +WIN32KAPI +VOID +APIENTRY +EngUnmapFontFile( + ULONG_PTR iFile); + +WIN32KAPI +VOID +APIENTRY +EngUnmapFontFileFD( + IN ULONG_PTR iFile); + +WIN32KAPI +VOID +APIENTRY +EngUnsecureMem( + IN HANDLE hSecure); + +WIN32KAPI +BOOL +APIENTRY +EngWaitForSingleObject( + IN PEVENT pEvent, + IN PLARGE_INTEGER pTimeOut); + +WIN32KAPI +INT +APIENTRY +EngWideCharToMultiByte( + IN UINT CodePage, + IN LPWSTR WideCharString, + IN INT BytesInWideCharString, + OUT LPSTR MultiByteString, + IN INT BytesInMultiByteString); + +WIN32KAPI +BOOL +APIENTRY +EngWritePrinter( + IN HANDLE hPrinter, + IN LPVOID pBuf, + IN DWORD cbBuf, + OUT LPDWORD pcWritten); + +WIN32KAPI +VOID +APIENTRY +FLOATOBJ_Add( + IN OUT PFLOATOBJ pf, + IN PFLOATOBJ pf1); + +WIN32KAPI +VOID +APIENTRY +FLOATOBJ_AddFloat( + IN OUT PFLOATOBJ pf, + IN FLOATL f); + +WIN32KAPI +VOID +APIENTRY +FLOATOBJ_AddLong( + IN OUT PFLOATOBJ pf, + IN LONG l); + +WIN32KAPI +VOID +APIENTRY +FLOATOBJ_Div( + IN OUT PFLOATOBJ pf, + IN PFLOATOBJ pf1); + +WIN32KAPI +VOID +APIENTRY +FLOATOBJ_DivFloat( + IN OUT PFLOATOBJ pf, + IN FLOATL f); + +WIN32KAPI +VOID +APIENTRY +FLOATOBJ_DivLong( + IN OUT PFLOATOBJ pf, + IN LONG l); + +WIN32KAPI +BOOL +APIENTRY +FLOATOBJ_Equal( + IN PFLOATOBJ pf, + IN PFLOATOBJ pf1); + +WIN32KAPI +BOOL +APIENTRY +FLOATOBJ_EqualLong( + IN PFLOATOBJ pf, + IN LONG l); + +WIN32KAPI +LONG +APIENTRY +FLOATOBJ_GetFloat( + IN PFLOATOBJ pf); + +WIN32KAPI +LONG +APIENTRY +FLOATOBJ_GetLong( + IN PFLOATOBJ pf); + +WIN32KAPI +BOOL +APIENTRY +FLOATOBJ_GreaterThan( + IN PFLOATOBJ pf, + IN PFLOATOBJ pf1); + +WIN32KAPI +BOOL +APIENTRY +FLOATOBJ_GreaterThanLong( + IN PFLOATOBJ pf, + IN LONG l); + +WIN32KAPI +BOOL +APIENTRY +FLOATOBJ_LessThan( + IN PFLOATOBJ pf, + IN PFLOATOBJ pf1); + +WIN32KAPI +BOOL +APIENTRY +FLOATOBJ_LessThanLong( + IN PFLOATOBJ pf, + IN LONG l); + +WIN32KAPI +VOID +APIENTRY +FLOATOBJ_Mul( + IN OUT PFLOATOBJ pf, + IN PFLOATOBJ pf1); + +WIN32KAPI +VOID +APIENTRY +FLOATOBJ_MulFloat( + IN OUT PFLOATOBJ pf, + IN FLOATL f); + +WIN32KAPI +VOID +APIENTRY +FLOATOBJ_MulLong( + IN OUT PFLOATOBJ pf, + IN LONG l); + +WIN32KAPI +VOID +APIENTRY +FLOATOBJ_Neg( + IN OUT PFLOATOBJ pf); + +WIN32KAPI +VOID +APIENTRY +FLOATOBJ_SetFloat( + OUT PFLOATOBJ pf, + IN FLOATL f); + +WIN32KAPI +VOID +APIENTRY +FLOATOBJ_SetLong( + OUT PFLOATOBJ pf, + IN LONG l); + +WIN32KAPI +VOID +APIENTRY +FLOATOBJ_Sub( + IN OUT PFLOATOBJ pf, + IN PFLOATOBJ pf1); + +WIN32KAPI +VOID +APIENTRY +FLOATOBJ_SubFloat( + IN OUT PFLOATOBJ pf, + IN FLOATL f); + +WIN32KAPI +VOID +APIENTRY +FLOATOBJ_SubLong( + IN OUT PFLOATOBJ pf, + IN LONG l); + +WIN32KAPI +ULONG +APIENTRY +FONTOBJ_cGetAllGlyphHandles( + IN FONTOBJ *pfo, + OUT HGLYPH *phg); + +WIN32KAPI +ULONG +APIENTRY +FONTOBJ_cGetGlyphs( + IN FONTOBJ *pfo, + IN ULONG iMode, + IN ULONG cGlyph, + IN HGLYPH *phg, + OUT PVOID *ppvGlyph); + +WIN32KAPI +FD_GLYPHSET* +APIENTRY +FONTOBJ_pfdg( + IN FONTOBJ *pfo); + +WIN32KAPI +IFIMETRICS* +APIENTRY +FONTOBJ_pifi( + IN FONTOBJ *pfo); + +WIN32KAPI +PBYTE +APIENTRY +FONTOBJ_pjOpenTypeTablePointer( + IN FONTOBJ *pfo, + IN ULONG ulTag, + OUT ULONG *pcjTable); + +WIN32KAPI +PFD_GLYPHATTR +APIENTRY +FONTOBJ_pQueryGlyphAttrs( + IN FONTOBJ *pfo, + IN ULONG iMode); + +WIN32KAPI +PVOID +APIENTRY +FONTOBJ_pvTrueTypeFontFile( + IN FONTOBJ *pfo, + OUT ULONG *pcjFile); + +WIN32KAPI +LPWSTR +APIENTRY +FONTOBJ_pwszFontFilePaths( + IN FONTOBJ *pfo, + OUT ULONG *pcwc); + +WIN32KAPI +XFORMOBJ* +APIENTRY +FONTOBJ_pxoGetXform( + IN FONTOBJ *pfo); + +WIN32KAPI +VOID +APIENTRY +FONTOBJ_vGetInfo( + IN FONTOBJ *pfo, + IN ULONG cjSize, + OUT FONTINFO *pfi); + +WIN32KAPI +FLATPTR +APIENTRY +HeapVidMemAllocAligned( + IN LPVIDMEM lpVidMem, + IN DWORD dwWidth, + IN DWORD dwHeight, + IN LPSURFACEALIGNMENT lpAlignment, + OUT LPLONG lpNewPitch); + +WIN32KAPI +LONG +APIENTRY +HT_ComputeRGBGammaTable( + IN USHORT GammaTableEntries, + IN USHORT GammaTableType, + IN USHORT RedGamma, + IN USHORT GreenGamma, + IN USHORT BlueGamma, + OUT LPBYTE pGammaTable); + +WIN32KAPI +LONG +APIENTRY +HT_Get8BPPFormatPalette( + OUT LPPALETTEENTRY pPaletteEntry, + IN USHORT RedGamma, + IN USHORT GreenGamma, + IN USHORT BlueGamma); + +WIN32KAPI +LONG +APIENTRY +HT_Get8BPPMaskPalette( + IN OUT LPPALETTEENTRY pPaletteEntry, + IN BOOL Use8BPPMaskPal, + IN BYTE CMYMask, + IN USHORT RedGamma, + IN USHORT GreenGamma, + IN USHORT BlueGamma); + +WIN32KAPI +LONG +APIENTRY +HTUI_DeviceColorAdjustment( + IN LPSTR pDeviceName, + OUT PDEVHTADJDATA pDevHTAdjData); + +WIN32KAPI +ULONG +APIENTRY +PALOBJ_cGetColors( + IN PALOBJ *ppalo, + IN ULONG iStart, + IN ULONG cColors, + OUT ULONG *pulColors); + +WIN32KAPI +BOOL +APIENTRY +PATHOBJ_bCloseFigure( + IN PATHOBJ *ppo); + +WIN32KAPI +BOOL +APIENTRY +PATHOBJ_bEnum( + IN PATHOBJ *ppo, + OUT PATHDATA *ppd); + +WIN32KAPI +BOOL +APIENTRY +PATHOBJ_bEnumClipLines( + IN PATHOBJ *ppo, + IN ULONG cb, + OUT CLIPLINE *pcl); + +WIN32KAPI +BOOL +APIENTRY +PATHOBJ_bMoveTo( + IN PATHOBJ *ppo, + IN POINTFIX ptfx); + +WIN32KAPI +BOOL +APIENTRY +PATHOBJ_bPolyBezierTo( + IN PATHOBJ *ppo, + IN POINTFIX *pptfx, + IN ULONG cptfx); + +WIN32KAPI +BOOL +APIENTRY +PATHOBJ_bPolyLineTo( + IN PATHOBJ *ppo, + IN POINTFIX *pptfx, + IN ULONG cptfx); + +WIN32KAPI +VOID +APIENTRY +PATHOBJ_vEnumStart( + IN PATHOBJ *ppo); + +WIN32KAPI +VOID +APIENTRY +PATHOBJ_vEnumStartClipLines( + IN PATHOBJ *ppo, + IN CLIPOBJ *pco, + IN SURFOBJ *pso, + IN LINEATTRS *pla); + +WIN32KAPI +VOID +APIENTRY +PATHOBJ_vGetBounds( + IN PATHOBJ *ppo, + OUT PRECTFX prectfx); + +WIN32KAPI +BOOL +APIENTRY +STROBJ_bEnum( + IN STROBJ *pstro, + OUT ULONG *pc, + OUT PGLYPHPOS *ppgpos); + +WIN32KAPI +BOOL +APIENTRY +STROBJ_bEnumPositionsOnly( + IN STROBJ *pstro, + OUT ULONG *pc, + OUT PGLYPHPOS *ppgpos); + +WIN32KAPI +BOOL +APIENTRY +STROBJ_bGetAdvanceWidths( + IN STROBJ *pso, + IN ULONG iFirst, + IN ULONG c, + OUT POINTQF *pptqD); + +WIN32KAPI +DWORD +APIENTRY +STROBJ_dwGetCodePage( + IN STROBJ *pstro); + +WIN32KAPI +FIX +APIENTRY +STROBJ_fxBreakExtra( + IN STROBJ *pstro); + +WIN32KAPI +FIX +APIENTRY +STROBJ_fxCharacterExtra( + IN STROBJ *pstro); + +WIN32KAPI +VOID +APIENTRY +STROBJ_vEnumStart( + IN STROBJ *pstro); + +WIN32KAPI +VOID +APIENTRY +VidMemFree( + IN LPVMEMHEAP pvmh, + IN FLATPTR ptr); + +WIN32KAPI +BOOL +APIENTRY +WNDOBJ_bEnum( + IN WNDOBJ *pwo, + IN ULONG cj, + OUT ULONG *pul); + +WIN32KAPI +ULONG +APIENTRY +WNDOBJ_cEnumStart( + IN WNDOBJ *pwo, + IN ULONG iType, + IN ULONG iDirection, + IN ULONG cLimit); + +WIN32KAPI +VOID +APIENTRY +WNDOBJ_vSetConsumer( + IN WNDOBJ *pwo, + IN PVOID pvConsumer); + +/* XFORMOBJ_bApplyXform.iMode constants */ +#define XF_LTOL 0L +#define XF_INV_LTOL 1L +#define XF_LTOFX 2L +#define XF_INV_FXTOL 3L + +WIN32KAPI +BOOL +APIENTRY +XFORMOBJ_bApplyXform( + IN XFORMOBJ *pxo, + IN ULONG iMode, + IN ULONG cPoints, + IN PVOID pvIn, + OUT PVOID pvOut); + +WIN32KAPI +ULONG +APIENTRY +XFORMOBJ_iGetFloatObjXform( + IN XFORMOBJ *pxo, + OUT FLOATOBJ_XFORM *pxfo); + +WIN32KAPI +ULONG +APIENTRY +XFORMOBJ_iGetXform( + IN XFORMOBJ *pxo, + OUT XFORML *pxform); + +/* XLATEOBJ_cGetPalette.iPal constants */ +#define XO_SRCPALETTE 1 +#define XO_DESTPALETTE 2 +#define XO_DESTDCPALETTE 3 +#define XO_SRCBITFIELDS 4 +#define XO_DESTBITFIELDS 5 + +WIN32KAPI +ULONG +APIENTRY +XLATEOBJ_cGetPalette( + IN XLATEOBJ *pxlo, + IN ULONG iPal, + IN ULONG cPal, + OUT ULONG *pPal); + +WIN32KAPI +HANDLE +APIENTRY +XLATEOBJ_hGetColorTransform( + IN XLATEOBJ *pxlo); + +WIN32KAPI +ULONG +APIENTRY +XLATEOBJ_iXlate( + IN XLATEOBJ *pxlo, + IN ULONG iColor); + +WIN32KAPI +ULONG* +APIENTRY +XLATEOBJ_piVector( + IN XLATEOBJ *pxlo); + + + +/* Graphics Driver Functions */ + +BOOL +APIENTRY +DrvAlphaBlend( + IN SURFOBJ *psoDest, + IN SURFOBJ *psoSrc, + IN CLIPOBJ *pco, + IN XLATEOBJ *pxlo, + IN RECTL *prclDest, + IN RECTL *prclSrc, + IN BLENDOBJ *pBlendObj); + +BOOL +APIENTRY +DrvAssertMode( + IN DHPDEV dhpdev, + IN BOOL bEnable); + +BOOL +APIENTRY +DrvBitBlt( + IN SURFOBJ *psoTrg, + IN SURFOBJ *psoSrc, + IN SURFOBJ *psoMask, + IN CLIPOBJ *pco, + IN XLATEOBJ *pxlo, + IN RECTL *prclTrg, + IN POINTL *pptlSrc, + IN POINTL *pptlMask, + IN BRUSHOBJ *pbo, + IN POINTL *pptlBrush, + IN ROP4 rop4); + +VOID +APIENTRY +DrvCompletePDEV( + IN DHPDEV dhpdev, + IN HDEV hdev); + +BOOL +APIENTRY +DrvCopyBits( + IN SURFOBJ *psoDest, + IN SURFOBJ *psoSrc, + IN CLIPOBJ *pco, + IN XLATEOBJ *pxlo, + IN RECTL *prclDest, + IN POINTL *pptlSrc); + +HBITMAP +APIENTRY +DrvCreateDeviceBitmap( + IN DHPDEV dhpdev, + IN SIZEL sizl, + IN ULONG iFormat); + +VOID +APIENTRY +DrvDeleteDeviceBitmap( + IN DHSURF dhsurf); + +HBITMAP +APIENTRY +DrvDeriveSurface( + DD_DIRECTDRAW_GLOBAL *pDirectDraw, + DD_SURFACE_LOCAL *pSurface); + +LONG +APIENTRY +DrvDescribePixelFormat( + IN DHPDEV dhpdev, + IN LONG iPixelFormat, + IN ULONG cjpfd, + OUT PIXELFORMATDESCRIPTOR *ppfd); + +VOID +APIENTRY +DrvDestroyFont( + IN FONTOBJ *pfo); + +VOID +APIENTRY +DrvDisableDriver( + VOID); + +VOID +APIENTRY +DrvDisablePDEV( + IN DHPDEV dhpdev); + +VOID +APIENTRY +DrvDisableSurface( + IN DHPDEV dhpdev); + +#define DM_DEFAULT 0x00000001 +#define DM_MONOCHROME 0x00000002 + +ULONG +APIENTRY +DrvDitherColor( + IN DHPDEV dhpdev, + IN ULONG iMode, + IN ULONG rgb, + OUT ULONG *pul); + +ULONG +APIENTRY +DrvDrawEscape( + IN SURFOBJ *pso, + IN ULONG iEsc, + IN CLIPOBJ *pco, + IN RECTL *prcl, + IN ULONG cjIn, + IN PVOID pvIn); + +BOOL +APIENTRY +DrvEnableDriver( + IN ULONG iEngineVersion, + IN ULONG cj, + OUT DRVENABLEDATA *pded); + +DHPDEV +APIENTRY +DrvEnablePDEV( + IN DEVMODEW *pdm, + IN LPWSTR pwszLogAddress, + IN ULONG cPat, + OUT HSURF *phsurfPatterns, + IN ULONG cjCaps, + OUT ULONG *pdevcaps, + IN ULONG cjDevInfo, + OUT DEVINFO *pdi, + IN HDEV hdev, + IN LPWSTR pwszDeviceName, + IN HANDLE hDriver); + +HSURF +APIENTRY +DrvEnableSurface( + IN DHPDEV dhpdev); + +/* DrvEndDoc.fl constants */ +#define ED_ABORTDOC 0x00000001 + +BOOL +APIENTRY +DrvEndDoc( + IN SURFOBJ *pso, + IN FLONG fl); + +ULONG +APIENTRY +DrvEscape( + IN SURFOBJ *pso, + IN ULONG iEsc, + IN ULONG cjIn, + IN PVOID pvIn, + IN ULONG cjOut, + OUT PVOID pvOut); + +BOOL +APIENTRY +DrvFillPath( + IN SURFOBJ *pso, + IN PATHOBJ *ppo, + IN CLIPOBJ *pco, + IN BRUSHOBJ *pbo, + IN POINTL *pptlBrushOrg, + IN MIX mix, + IN FLONG flOptions); + +ULONG +APIENTRY +DrvFontManagement( + IN SURFOBJ *pso, + IN FONTOBJ *pfo, + IN ULONG iMode, + IN ULONG cjIn, + IN PVOID pvIn, + IN ULONG cjOut, + OUT PVOID pvOut); + +VOID +APIENTRY +DrvFree( + IN PVOID pv, + IN ULONG_PTR id); + +/* DrvGetGlyphMode return values */ +#define FO_HGLYPHS 0L +#define FO_GLYPHBITS 1L +#define FO_PATHOBJ 2L + +ULONG +APIENTRY +DrvGetGlyphMode( + IN DHPDEV dhpdev, + IN FONTOBJ *pfo); + +ULONG +APIENTRY +DrvGetModes( + IN HANDLE hDriver, + IN ULONG cjSize, + OUT DEVMODEW *pdm); + +PVOID +APIENTRY +DrvGetTrueTypeFile( + IN ULONG_PTR iFile, + IN ULONG *pcj); + +BOOL +APIENTRY +DrvGradientFill( + IN SURFOBJ *psoDest, + IN CLIPOBJ *pco, + IN XLATEOBJ *pxlo, + IN TRIVERTEX *pVertex, + IN ULONG nVertex, + IN PVOID pMesh, + IN ULONG nMesh, + IN RECTL *prclExtents, + IN POINTL *pptlDitherOrg, + IN ULONG ulMode); + +BOOL +APIENTRY +DrvIcmCheckBitmapBits( + IN DHPDEV dhpdev, + IN HANDLE hColorTransform, + IN SURFOBJ *pso, + OUT PBYTE paResults); + +HANDLE +APIENTRY +DrvIcmCreateColorTransform( + IN DHPDEV dhpdev, + IN LPLOGCOLORSPACEW pLogColorSpace, + IN PVOID pvSourceProfile, + IN ULONG cjSourceProfile, + IN PVOID pvDestProfile, + IN ULONG cjDestProfile, + IN PVOID pvTargetProfile, + IN ULONG cjTargetProfile, + IN DWORD dwReserved); + +BOOL +APIENTRY +DrvIcmDeleteColorTransform( + IN DHPDEV dhpdev, + IN HANDLE hcmXform); + +/* DrvIcmSetDeviceGammaRamp.iFormat constants */ +#define IGRF_RGB_256BYTES 0x00000000 +#define IGRF_RGB_256WORDS 0x00000001 + +BOOL +APIENTRY +DrvIcmSetDeviceGammaRamp( + IN DHPDEV dhpdev, + IN ULONG iFormat, + IN LPVOID lpRamp); + +BOOL +APIENTRY +DrvLineTo( + SURFOBJ *pso, + CLIPOBJ *pco, + BRUSHOBJ *pbo, + LONG x1, + LONG y1, + LONG x2, + LONG y2, + RECTL *prclBounds, + MIX mix); + +ULONG_PTR +APIENTRY +DrvLoadFontFile( + ULONG cFiles, + ULONG_PTR *piFile, + PVOID *ppvView, + ULONG *pcjView, + DESIGNVECTOR *pdv, + ULONG ulLangID, + ULONG ulFastCheckSum); + +VOID +APIENTRY +DrvMovePointer( + IN SURFOBJ *pso, + IN LONG x, + IN LONG y, + IN RECTL *prcl); + +BOOL +APIENTRY +DrvNextBand( + IN SURFOBJ *pso, + IN POINTL *pptl); + +VOID +APIENTRY +DrvNotify( + IN SURFOBJ *pso, + IN ULONG iType, + IN PVOID pvData); + +BOOL +APIENTRY +DrvOffset( + IN SURFOBJ *pso, + IN LONG x, + IN LONG y, + IN FLONG flReserved); + +BOOL +APIENTRY +DrvPaint( + IN SURFOBJ *pso, + IN CLIPOBJ *pco, + IN BRUSHOBJ *pbo, + IN POINTL *pptlBrushOrg, + IN MIX mix); + +BOOL +APIENTRY +DrvPlgBlt( + IN SURFOBJ *psoTrg, + IN SURFOBJ *psoSrc, + IN SURFOBJ *psoMsk, + IN CLIPOBJ *pco, + IN XLATEOBJ *pxlo, + IN COLORADJUSTMENT *pca, + IN POINTL *pptlBrushOrg, + IN POINTFIX *pptfx, + IN RECTL *prcl, + IN POINTL *pptl, + IN ULONG iMode); + +/* DrvQueryAdvanceWidths.iMode constants */ +#define QAW_GETWIDTHS 0 +#define QAW_GETEASYWIDTHS 1 + +BOOL +APIENTRY +DrvQueryAdvanceWidths( + IN DHPDEV dhpdev, + IN FONTOBJ *pfo, + IN ULONG iMode, + IN HGLYPH *phg, + OUT PVOID pvWidths, + IN ULONG cGlyphs); + +/* DrvQueryDeviceSupport.iType constants */ +#define QDS_CHECKJPEGFORMAT 0x00000000 +#define QDS_CHECKPNGFORMAT 0x00000001 + +BOOL +APIENTRY +DrvQueryDeviceSupport( + SURFOBJ *pso, + XLATEOBJ *pxlo, + XFORMOBJ *pxo, + ULONG iType, + ULONG cjIn, + PVOID pvIn, + ULONG cjOut, + PVOID pvOut); + +/* DrvQueryDriverInfo.dwMode constants */ +#define DRVQUERY_USERMODE 0x00000001 + +BOOL +APIENTRY +DrvQueryDriverInfo( + DWORD dwMode, + PVOID pBuffer, + DWORD cbBuf, + PDWORD pcbNeeded); + +PIFIMETRICS +APIENTRY +DrvQueryFont( + IN DHPDEV dhpdev, + IN ULONG_PTR iFile, + IN ULONG iFace, + IN ULONG_PTR *pid); + +/* DrvQueryFontCaps.pulCaps constants */ +#define QC_OUTLINES 0x00000001 +#define QC_1BIT 0x00000002 +#define QC_4BIT 0x00000004 + +#define QC_FONTDRIVERCAPS (QC_OUTLINES | QC_1BIT | QC_4BIT) + +LONG +APIENTRY +DrvQueryFontCaps( + IN ULONG culCaps, + OUT ULONG *pulCaps); + +/* DrvQueryFontData.iMode constants */ +#define QFD_GLYPHANDBITMAP 1L +#define QFD_GLYPHANDOUTLINE 2L +#define QFD_MAXEXTENTS 3L +#define QFD_TT_GLYPHANDBITMAP 4L +#define QFD_TT_GRAY1_BITMAP 5L +#define QFD_TT_GRAY2_BITMAP 6L +#define QFD_TT_GRAY4_BITMAP 8L +#define QFD_TT_GRAY8_BITMAP 9L + +#define QFD_TT_MONO_BITMAP QFD_TT_GRAY1_BITMAP + +LONG +APIENTRY +DrvQueryFontData( + IN DHPDEV dhpdev, + IN FONTOBJ *pfo, + IN ULONG iMode, + IN HGLYPH hg, + IN OUT GLYPHDATA *pgd, + IN OUT PVOID pv, + IN ULONG cjSize); + +/* DrvQueryFontFile.ulMode constants */ +#define QFF_DESCRIPTION 0x00000001 +#define QFF_NUMFACES 0x00000002 + +LONG +APIENTRY +DrvQueryFontFile( + IN ULONG_PTR iFile, + IN ULONG ulMode, + IN ULONG cjBuf, + IN ULONG *pulBuf); + +/* DrvQueryFontTree.iMode constants */ +#define QFT_UNICODE 0L +#define QFT_LIGATURES 1L +#define QFT_KERNPAIRS 2L +#define QFT_GLYPHSET 3L + +PVOID +APIENTRY +DrvQueryFontTree( + IN DHPDEV dhpdev, + IN ULONG_PTR iFile, + IN ULONG iFace, + IN ULONG iMode, + IN ULONG_PTR *pid); + +PFD_GLYPHATTR +APIENTRY +DrvQueryGlyphAttrs( + IN FONTOBJ *pfo, + IN ULONG iMode); + +ULONG +APIENTRY +DrvQueryPerBandInfo( + IN SURFOBJ *pso, + IN OUT PERBANDINFO *pbi); + +/* DrvQueryTrueTypeOutline.bMetricsOnly constants */ +#define TTO_METRICS_ONLY 0x00000001 +#define TTO_QUBICS 0x00000002 +#define TTO_UNHINTED 0x00000004 + +LONG +APIENTRY +DrvQueryTrueTypeOutline( + IN DHPDEV dhpdev, + IN FONTOBJ *pfo, + IN HGLYPH hglyph, + IN BOOL bMetricsOnly, + IN GLYPHDATA *pgldt, + IN ULONG cjBuf, + OUT TTPOLYGONHEADER *ppoly); + +LONG +APIENTRY +DrvQueryTrueTypeTable( + IN ULONG_PTR iFile, + IN ULONG ulFont, + IN ULONG ulTag, + IN PTRDIFF dpStart, + IN ULONG cjBuf, + OUT BYTE *pjBuf, + OUT PBYTE *ppjTable, + OUT ULONG *pcjTable); + +/* DrvRealizeBrush.iHatch constants */ +#define RB_DITHERCOLOR 0x80000000L + +#define HS_DDI_MAX 6 + +BOOL +APIENTRY +DrvRealizeBrush( + IN BRUSHOBJ *pbo, + IN SURFOBJ *psoTarget, + IN SURFOBJ *psoPattern, + IN SURFOBJ *psoMask, + IN XLATEOBJ *pxlo, + IN ULONG iHatch); + +/* DrvResetDevice return values */ +#define DRD_SUCCESS 0 +#define DRD_ERROR 1 + +ULONG +APIENTRY +DrvResetDevice( + IN DHPDEV dhpdev, + IN PVOID Reserved); + +BOOL +APIENTRY +DrvResetPDEV( + DHPDEV dhpdevOld, + DHPDEV dhpdevNew); + +/* DrvSaveScreenBits.iMode constants */ +#define SS_SAVE 0x00000000 +#define SS_RESTORE 0x00000001 +#define SS_FREE 0x00000002 + +ULONG_PTR +APIENTRY +DrvSaveScreenBits( + IN SURFOBJ *pso, + IN ULONG iMode, + IN ULONG_PTR ident, + IN RECTL *prcl); + +BOOL +APIENTRY +DrvSendPage( + IN SURFOBJ *pso); + +BOOL +APIENTRY +DrvSetPalette( + IN DHPDEV dhpdev, + IN PALOBJ *ppalo, + IN FLONG fl, + IN ULONG iStart, + IN ULONG cColors); + +BOOL +APIENTRY +DrvSetPixelFormat( + IN SURFOBJ *pso, + IN LONG iPixelFormat, + IN HWND hwnd); + +/* DrvSetPointerShape return values */ +#define SPS_ERROR 0x00000000 +#define SPS_DECLINE 0x00000001 +#define SPS_ACCEPT_NOEXCLUDE 0x00000002 +#define SPS_ACCEPT_EXCLUDE 0x00000003 +#define SPS_ACCEPT_SYNCHRONOUS 0x00000004 + +/* DrvSetPointerShape.fl constants */ +#define SPS_CHANGE 0x00000001L +#define SPS_ASYNCCHANGE 0x00000002L +#define SPS_ANIMATESTART 0x00000004L +#define SPS_ANIMATEUPDATE 0x00000008L +#define SPS_ALPHA 0x00000010L +#define SPS_LENGTHMASK 0x00000F00L +#define SPS_FREQMASK 0x000FF000L + +ULONG +APIENTRY +DrvSetPointerShape( + IN SURFOBJ *pso, + IN SURFOBJ *psoMask, + IN SURFOBJ *psoColor, + IN XLATEOBJ *pxlo, + IN LONG xHot, + IN LONG yHot, + IN LONG x, + IN LONG y, + IN RECTL *prcl, + IN FLONG fl); + +BOOL +APIENTRY +DrvStartBanding( + IN SURFOBJ *pso, + IN POINTL *pptl); + +BOOL +APIENTRY +DrvStartDoc( + IN SURFOBJ *pso, + IN LPWSTR pwszDocName, + IN DWORD dwJobId); + +BOOL +APIENTRY +DrvStartPage( + IN SURFOBJ *pso); + +BOOL +APIENTRY +DrvStretchBlt( + IN SURFOBJ *psoDest, + IN SURFOBJ *psoSrc, + IN SURFOBJ *psoMask, + IN CLIPOBJ *pco, + IN XLATEOBJ *pxlo, + IN COLORADJUSTMENT *pca, + IN POINTL *pptlHTOrg, + IN RECTL *prclDest, + IN RECTL *prclSrc, + IN POINTL *pptlMask, + IN ULONG iMode); + +BOOL +APIENTRY +DrvStretchBltROP( + IN SURFOBJ *psoDest, + IN SURFOBJ *psoSrc, + IN SURFOBJ *psoMask, + IN CLIPOBJ *pco, + IN XLATEOBJ *pxlo, + IN COLORADJUSTMENT *pca, + IN POINTL *pptlHTOrg, + IN RECTL *prclDest, + IN RECTL *prclSrc, + IN POINTL *pptlMask, + IN ULONG iMode, + IN BRUSHOBJ *pbo, + IN DWORD rop4); + +BOOL +APIENTRY +DrvStrokeAndFillPath( + IN SURFOBJ *pso, + IN PATHOBJ *ppo, + IN CLIPOBJ *pco, + IN XFORMOBJ *pxo, + IN BRUSHOBJ *pboStroke, + IN LINEATTRS *plineattrs, + IN BRUSHOBJ *pboFill, + IN POINTL *pptlBrushOrg, + IN MIX mixFill, + IN FLONG flOptions); + +BOOL +APIENTRY +DrvStrokePath( + IN SURFOBJ *pso, + IN PATHOBJ *ppo, + IN CLIPOBJ *pco, + IN XFORMOBJ *pxo, + IN BRUSHOBJ *pbo, + IN POINTL *pptlBrushOrg, + IN LINEATTRS *plineattrs, + IN MIX mix); + +BOOL +APIENTRY +DrvSwapBuffers( + IN SURFOBJ *pso, + IN WNDOBJ *pwo); + +VOID +APIENTRY +DrvSynchronize( + IN DHPDEV dhpdev, + IN RECTL *prcl); + +/* DrvSynchronizeSurface.fl constants */ +#define DSS_TIMER_EVENT 0x00000001 +#define DSS_FLUSH_EVENT 0x00000002 + +VOID +APIENTRY +DrvSynchronizeSurface( + IN SURFOBJ *pso, + IN RECTL *prcl, + IN FLONG fl); + +BOOL +APIENTRY +DrvTextOut( + IN SURFOBJ *pso, + IN STROBJ *pstro, + IN FONTOBJ *pfo, + IN CLIPOBJ *pco, + IN RECTL *prclExtra, + IN RECTL *prclOpaque, + IN BRUSHOBJ *pboFore, + IN BRUSHOBJ *pboOpaque, + IN POINTL *pptlOrg, + IN MIX mix); + +BOOL +APIENTRY +DrvTransparentBlt( + IN SURFOBJ *psoDst, + IN SURFOBJ *psoSrc, + IN CLIPOBJ *pco, + IN XLATEOBJ *pxlo, + IN RECTL *prclDst, + IN RECTL *prclSrc, + IN ULONG iTransColor, + IN ULONG ulReserved); + +BOOL +APIENTRY +DrvUnloadFontFile( + IN ULONG_PTR iFile); + +/* WNDOBJCHANGEPROC.fl constants */ +#define WOC_RGN_CLIENT_DELTA 0x00000001 +#define WOC_RGN_CLIENT 0x00000002 +#define WOC_RGN_SURFACE_DELTA 0x00000004 +#define WOC_RGN_SURFACE 0x00000008 +#define WOC_CHANGED 0x00000010 +#define WOC_DELETE 0x00000020 +#define WOC_DRAWN 0x00000040 +#define WOC_SPRITE_OVERLAP 0x00000080 +#define WOC_SPRITE_NO_OVERLAP 0x00000100 + +typedef VOID +(APIENTRY CALLBACK * WNDOBJCHANGEPROC)( + WNDOBJ *pwo, + FLONG fl); + + +typedef BOOL +(APIENTRY *PFN_DrvAlphaBlend)( + IN SURFOBJ *psoDest, + IN SURFOBJ *psoSrc, + IN CLIPOBJ *pco, + IN XLATEOBJ *pxlo, + IN RECTL *prclDest, + IN RECTL *prclSrc, + IN BLENDOBJ *pBlendObj); + +typedef BOOL +(APIENTRY *PFN_DrvAssertMode)( + IN DHPDEV dhpdev, + IN BOOL bEnable); + +typedef BOOL +(APIENTRY *PFN_DrvBitBlt)( + IN SURFOBJ *psoTrg, + IN SURFOBJ *psoSrc, + IN SURFOBJ *psoMask, + IN CLIPOBJ *pco, + IN XLATEOBJ *pxlo, + IN RECTL *prclTrg, + IN POINTL *pptlSrc, + IN POINTL *pptlMask, + IN BRUSHOBJ *pbo, + IN POINTL *pptlBrush, + IN ROP4 rop4); + +typedef VOID +(APIENTRY *PFN_DrvCompletePDEV)( + IN DHPDEV dhpdev, + IN HDEV hdev); + +typedef BOOL +(APIENTRY *PFN_DrvCopyBits)( + IN SURFOBJ *psoDest, + IN SURFOBJ *psoSrc, + IN CLIPOBJ *pco, + IN XLATEOBJ *pxlo, + IN RECTL *prclDest, + IN POINTL *pptlSrc); + +typedef HBITMAP +(APIENTRY *PFN_DrvCreateDeviceBitmap)( + IN DHPDEV dhpdev, + IN SIZEL sizl, + IN ULONG iFormat); + +typedef VOID +(APIENTRY *PFN_DrvDeleteDeviceBitmap)( + IN DHSURF dhsurf); + +typedef HBITMAP +(APIENTRY *PFN_DrvDeriveSurface)( + DD_DIRECTDRAW_GLOBAL *pDirectDraw, + DD_SURFACE_LOCAL *pSurface); + +typedef LONG +(APIENTRY *PFN_DrvDescribePixelFormat)( + IN DHPDEV dhpdev, + IN LONG iPixelFormat, + IN ULONG cjpfd, + OUT PIXELFORMATDESCRIPTOR *ppfd); + +typedef VOID +(APIENTRY *PFN_DrvDestroyFont)( + IN FONTOBJ *pfo); + +typedef VOID +(APIENTRY *PFN_DrvDisableDriver)( + VOID); + +typedef VOID +(APIENTRY *PFN_DrvDisablePDEV)( + IN DHPDEV dhpdev); + +typedef VOID +(APIENTRY *PFN_DrvDisableSurface)( + IN DHPDEV dhpdev); + +typedef ULONG +(APIENTRY *PFN_DrvDitherColor)( + IN DHPDEV dhpdev, + IN ULONG iMode, + IN ULONG rgb, + OUT ULONG *pul); + +typedef ULONG +(APIENTRY *PFN_DrvDrawEscape)( + IN SURFOBJ *pso, + IN ULONG iEsc, + IN CLIPOBJ *pco, + IN RECTL *prcl, + IN ULONG cjIn, + IN PVOID pvIn); + +typedef BOOL +(APIENTRY *PFN_DrvEnableDriver)( + IN ULONG iEngineVersion, + IN ULONG cj, + OUT DRVENABLEDATA *pded); +#if 0 +typedef DHPDEV +(APIENTRY *PFN_DrvEnablePDEV)( + IN DEVMODEW *pdm, + IN LPWSTR pwszLogAddress, + IN ULONG cPat, + OUT HSURF *phsurfPatterns, + IN ULONG cjCaps, + OUT ULONG *pdevcaps, + IN ULONG cjDevInfo, + OUT DEVINFO *pdi, + IN HDEV hdev, + IN LPWSTR pwszDeviceName, + IN HANDLE hDriver); +#endif +typedef HSURF +(APIENTRY *PFN_DrvEnableSurface)( + IN DHPDEV dhpdev); + +typedef BOOL +(APIENTRY *PFN_DrvEndDoc)( + IN SURFOBJ *pso, + IN FLONG fl); + +typedef ULONG +(APIENTRY *PFN_DrvEscape)( + IN SURFOBJ *pso, + IN ULONG iEsc, + IN ULONG cjIn, + IN PVOID pvIn, + IN ULONG cjOut, + OUT PVOID pvOut); + +typedef BOOL +(APIENTRY *PFN_DrvFillPath)( + IN SURFOBJ *pso, + IN PATHOBJ *ppo, + IN CLIPOBJ *pco, + IN BRUSHOBJ *pbo, + IN POINTL *pptlBrushOrg, + IN MIX mix, + IN FLONG flOptions); + +typedef ULONG +(APIENTRY *PFN_DrvFontManagement)( + IN SURFOBJ *pso, + IN FONTOBJ *pfo, + IN ULONG iMode, + IN ULONG cjIn, + IN PVOID pvIn, + IN ULONG cjOut, + OUT PVOID pvOut); + +typedef VOID +(APIENTRY *PFN_DrvFree)( + IN PVOID pv, + IN ULONG_PTR id); + +typedef ULONG +(APIENTRY *PFN_DrvGetGlyphMode)( + IN DHPDEV dhpdev, + IN FONTOBJ *pfo); + +typedef ULONG +(APIENTRY *PFN_DrvGetModes)( + IN HANDLE hDriver, + IN ULONG cjSize, + OUT DEVMODEW *pdm); + +typedef PVOID +(APIENTRY *PFN_DrvGetTrueTypeFile)( + IN ULONG_PTR iFile, + IN ULONG *pcj); + +typedef BOOL +(APIENTRY *PFN_DrvGradientFill)( + IN SURFOBJ *psoDest, + IN CLIPOBJ *pco, + IN XLATEOBJ *pxlo, + IN TRIVERTEX *pVertex, + IN ULONG nVertex, + IN PVOID pMesh, + IN ULONG nMesh, + IN RECTL *prclExtents, + IN POINTL *pptlDitherOrg, + IN ULONG ulMode); + +typedef BOOL +(APIENTRY *PFN_DrvIcmCheckBitmapBits)( + IN DHPDEV dhpdev, + IN HANDLE hColorTransform, + IN SURFOBJ *pso, + OUT PBYTE paResults); + +typedef HANDLE +(APIENTRY *PFN_DrvIcmCreateColorTransform)( + IN DHPDEV dhpdev, + IN LPLOGCOLORSPACEW pLogColorSpace, + IN PVOID pvSourceProfile, + IN ULONG cjSourceProfile, + IN PVOID pvDestProfile, + IN ULONG cjDestProfile, + IN PVOID pvTargetProfile, + IN ULONG cjTargetProfile, + IN DWORD dwReserved); + +typedef BOOL +(APIENTRY *PFN_DrvIcmDeleteColorTransform)( + IN DHPDEV dhpdev, + IN HANDLE hcmXform); + +typedef BOOL +(APIENTRY *PFN_DrvIcmSetDeviceGammaRamp)( + IN DHPDEV dhpdev, + IN ULONG iFormat, + IN LPVOID lpRamp); + +typedef BOOL +(APIENTRY *PFN_DrvLineTo)( + SURFOBJ *pso, + CLIPOBJ *pco, + BRUSHOBJ *pbo, + LONG x1, + LONG y1, + LONG x2, + LONG y2, + RECTL *prclBounds, + MIX mix); + +typedef ULONG_PTR +(APIENTRY *PFN_DrvLoadFontFile)( + ULONG cFiles, + ULONG_PTR *piFile, + PVOID *ppvView, + ULONG *pcjView, + DESIGNVECTOR *pdv, + ULONG ulLangID, + ULONG ulFastCheckSum); + +typedef VOID +(APIENTRY *PFN_DrvMovePointer)( + IN SURFOBJ *pso, + IN LONG x, + IN LONG y, + IN RECTL *prcl); + +typedef BOOL +(APIENTRY *PFN_DrvNextBand)( + IN SURFOBJ *pso, + IN POINTL *pptl); + +typedef VOID +(APIENTRY *PFN_DrvNotify)( + IN SURFOBJ *pso, + IN ULONG iType, + IN PVOID pvData); + +typedef BOOL +(APIENTRY *PFN_DrvOffset)( + IN SURFOBJ *pso, + IN LONG x, + IN LONG y, + IN FLONG flReserved); + +typedef BOOL +(APIENTRY *PFN_DrvPaint)( + IN SURFOBJ *pso, + IN CLIPOBJ *pco, + IN BRUSHOBJ *pbo, + IN POINTL *pptlBrushOrg, + IN MIX mix); + +typedef BOOL +(APIENTRY *PFN_DrvPlgBlt)( + IN SURFOBJ *psoTrg, + IN SURFOBJ *psoSrc, + IN SURFOBJ *psoMsk, + IN CLIPOBJ *pco, + IN XLATEOBJ *pxlo, + IN COLORADJUSTMENT *pca, + IN POINTL *pptlBrushOrg, + IN POINTFIX *pptfx, + IN RECTL *prcl, + IN POINTL *pptl, + IN ULONG iMode); + +typedef BOOL +(APIENTRY *PFN_DrvQueryAdvanceWidths)( + IN DHPDEV dhpdev, + IN FONTOBJ *pfo, + IN ULONG iMode, + IN HGLYPH *phg, + OUT PVOID pvWidths, + IN ULONG cGlyphs); + +typedef BOOL +(APIENTRY *PFN_DrvQueryDeviceSupport)( + SURFOBJ *pso, + XLATEOBJ *pxlo, + XFORMOBJ *pxo, + ULONG iType, + ULONG cjIn, + PVOID pvIn, + ULONG cjOut, + PVOID pvOut); + +typedef BOOL +(APIENTRY *PFN_DrvQueryDriverInfo)( + DWORD dwMode, + PVOID pBuffer, + DWORD cbBuf, + PDWORD pcbNeeded); + +typedef PIFIMETRICS +(APIENTRY *PFN_DrvQueryFont)( + IN DHPDEV dhpdev, + IN ULONG_PTR iFile, + IN ULONG iFace, + IN ULONG_PTR *pid); + +typedef LONG +(APIENTRY *PFN_DrvQueryFontCaps)( + IN ULONG culCaps, + OUT ULONG *pulCaps); + +typedef LONG +(APIENTRY *PFN_DrvQueryFontData)( + IN DHPDEV dhpdev, + IN FONTOBJ *pfo, + IN ULONG iMode, + IN HGLYPH hg, + IN OUT GLYPHDATA *pgd, + IN OUT PVOID pv, + IN ULONG cjSize); + +typedef LONG +(APIENTRY *PFN_DrvQueryFontFile)( + IN ULONG_PTR iFile, + IN ULONG ulMode, + IN ULONG cjBuf, + IN ULONG *pulBuf); + +typedef PVOID +(APIENTRY *PFN_DrvQueryFontTree)( + IN DHPDEV dhpdev, + IN ULONG_PTR iFile, + IN ULONG iFace, + IN ULONG iMode, + IN ULONG_PTR *pid); + +typedef PFD_GLYPHATTR +(APIENTRY *PFN_DrvQueryGlyphAttrs)( + IN FONTOBJ *pfo, + IN ULONG iMode); + +typedef ULONG +(APIENTRY *PFN_DrvQueryPerBandInfo)( + IN SURFOBJ *pso, + IN OUT PERBANDINFO *pbi); + +typedef LONG +(APIENTRY *PFN_DrvQueryTrueTypeOutline)( + IN DHPDEV dhpdev, + IN FONTOBJ *pfo, + IN HGLYPH hglyph, + IN BOOL bMetricsOnly, + IN GLYPHDATA *pgldt, + IN ULONG cjBuf, + OUT TTPOLYGONHEADER *ppoly); + +typedef LONG +(APIENTRY *PFN_DrvQueryTrueTypeTable)( + IN ULONG_PTR iFile, + IN ULONG ulFont, + IN ULONG ulTag, + IN PTRDIFF dpStart, + IN ULONG cjBuf, + OUT BYTE *pjBuf, + OUT PBYTE *ppjTable, + OUT ULONG *pcjTable); + +typedef BOOL +(APIENTRY *PFN_DrvRealizeBrush)( + IN BRUSHOBJ *pbo, + IN SURFOBJ *psoTarget, + IN SURFOBJ *psoPattern, + IN SURFOBJ *psoMask, + IN XLATEOBJ *pxlo, + IN ULONG iHatch); + +typedef ULONG +(APIENTRY *PFN_DrvResetDevice)( + IN DHPDEV dhpdev, + IN PVOID Reserved); + +typedef BOOL +(APIENTRY *PFN_DrvResetPDEV)( + DHPDEV dhpdevOld, + DHPDEV dhpdevNew); + +typedef ULONG_PTR +(APIENTRY *PFN_DrvSaveScreenBits)( + IN SURFOBJ *pso, + IN ULONG iMode, + IN ULONG_PTR ident, + IN RECTL *prcl); + +typedef BOOL +(APIENTRY *PFN_DrvSendPage)( + IN SURFOBJ *pso); + +typedef BOOL +(APIENTRY *PFN_DrvSetPalette)( + IN DHPDEV dhpdev, + IN PALOBJ *ppalo, + IN FLONG fl, + IN ULONG iStart, + IN ULONG cColors); + +typedef BOOL +(APIENTRY *PFN_DrvSetPixelFormat)( + IN SURFOBJ *pso, + IN LONG iPixelFormat, + IN HWND hwnd); + +typedef ULONG +(APIENTRY *PFN_DrvSetPointerShape)( + IN SURFOBJ *pso, + IN SURFOBJ *psoMask, + IN SURFOBJ *psoColor, + IN XLATEOBJ *pxlo, + IN LONG xHot, + IN LONG yHot, + IN LONG x, + IN LONG y, + IN RECTL *prcl, + IN FLONG fl); + +typedef BOOL +(APIENTRY *PFN_DrvStartBanding)( + IN SURFOBJ *pso, + IN POINTL *pptl); + +typedef BOOL +(APIENTRY *PFN_DrvStartDoc)( + IN SURFOBJ *pso, + IN LPWSTR pwszDocName, + IN DWORD dwJobId); + +typedef BOOL +(APIENTRY *PFN_DrvStartPage)( + IN SURFOBJ *pso); + +typedef BOOL +(APIENTRY *PFN_DrvStretchBlt)( + IN SURFOBJ *psoDest, + IN SURFOBJ *psoSrc, + IN SURFOBJ *psoMask, + IN CLIPOBJ *pco, + IN XLATEOBJ *pxlo, + IN COLORADJUSTMENT *pca, + IN POINTL *pptlHTOrg, + IN RECTL *prclDest, + IN RECTL *prclSrc, + IN POINTL *pptlMask, + IN ULONG iMode); + +typedef BOOL +(APIENTRY *PFN_DrvStretchBltROP)( + IN SURFOBJ *psoDest, + IN SURFOBJ *psoSrc, + IN SURFOBJ *psoMask, + IN CLIPOBJ *pco, + IN XLATEOBJ *pxlo, + IN COLORADJUSTMENT *pca, + IN POINTL *pptlHTOrg, + IN RECTL *prclDest, + IN RECTL *prclSrc, + IN POINTL *pptlMask, + IN ULONG iMode, + IN BRUSHOBJ *pbo, + IN DWORD rop4); + +typedef BOOL +(APIENTRY *PFN_DrvStrokeAndFillPath)( + IN SURFOBJ *pso, + IN PATHOBJ *ppo, + IN CLIPOBJ *pco, + IN XFORMOBJ *pxo, + IN BRUSHOBJ *pboStroke, + IN LINEATTRS *plineattrs, + IN BRUSHOBJ *pboFill, + IN POINTL *pptlBrushOrg, + IN MIX mixFill, + IN FLONG flOptions); + +typedef BOOL +(APIENTRY *PFN_DrvStrokePath)( + IN SURFOBJ *pso, + IN PATHOBJ *ppo, + IN CLIPOBJ *pco, + IN XFORMOBJ *pxo, + IN BRUSHOBJ *pbo, + IN POINTL *pptlBrushOrg, + IN LINEATTRS *plineattrs, + IN MIX mix); + +typedef BOOL +(APIENTRY *PFN_DrvSwapBuffers)( + IN SURFOBJ *pso, + IN WNDOBJ *pwo); + +typedef VOID +(APIENTRY *PFN_DrvSynchronize)( + IN DHPDEV dhpdev, + IN RECTL *prcl); + +typedef VOID +(APIENTRY *PFN_DrvSynchronizeSurface)( + IN SURFOBJ *pso, + IN RECTL *prcl, + IN FLONG fl); + +typedef BOOL +(APIENTRY *PFN_DrvTextOut)( + IN SURFOBJ *pso, + IN STROBJ *pstro, + IN FONTOBJ *pfo, + IN CLIPOBJ *pco, + IN RECTL *prclExtra, + IN RECTL *prclOpaque, + IN BRUSHOBJ *pboFore, + IN BRUSHOBJ *pboOpaque, + IN POINTL *pptlOrg, + IN MIX mix); + +typedef BOOL +(APIENTRY *PFN_DrvTransparentBlt)( + IN SURFOBJ *psoDst, + IN SURFOBJ *psoSrc, + IN CLIPOBJ *pco, + IN XLATEOBJ *pxlo, + IN RECTL *prclDst, + IN RECTL *prclSrc, + IN ULONG iTransColor, + IN ULONG ulReserved); + +typedef BOOL +(APIENTRY *PFN_DrvUnloadFontFile)( + IN ULONG_PTR iFile); + + +WIN32KAPI +VOID +APIENTRY +DrvDisableDirectDraw( + IN DHPDEV dhpdev); + +WIN32KAPI +BOOL +APIENTRY +DrvEnableDirectDraw( + IN DHPDEV dhpdev, + OUT DD_CALLBACKS *pCallBacks, + OUT DD_SURFACECALLBACKS *pSurfaceCallBacks, + OUT DD_PALETTECALLBACKS *pPaletteCallBacks); + +WIN32KAPI +BOOL +APIENTRY +DrvGetDirectDrawInfo( + IN DHPDEV dhpdev, + OUT DD_HALINFO *pHalInfo, + OUT DWORD *pdwNumHeaps, + OUT VIDEOMEMORY *pvmList, + OUT DWORD *pdwNumFourCCCodes, + OUT DWORD *pdwFourCC); + +#ifdef __cplusplus +} +#endif + +#endif /* defined __VIDEO_H */ + +#endif /* __WINDDI_H */ diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h new file mode 100644 index 00000000000..d04e31f48fa --- /dev/null +++ b/reactos/include/ddk/winddk.h @@ -0,0 +1,10302 @@ +/* + * winddk.h + * + * Windows Device Driver Kit + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __WINDDK_H +#define __WINDDK_H + +#if __GNUC__ >= 3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Definitions specific to this Device Driver Kit +*/ +#define DDKAPI __stdcall +#define DDKFASTAPI __fastcall +#define FASTCALL __fastcall +#define DDKCDECLAPI __cdecl + +/* FIXME: REMOVE THIS UNCOMPATIBLE CRUFT!!! */ +#if defined(_NTOSKRNL_) +#ifndef NTOSAPI +#define NTOSAPI DECL_EXPORT +#endif +#define DECLARE_INTERNAL_OBJECT(x) typedef struct _##x; typedef struct _##x *P##x; +#define DECLARE_INTERNAL_OBJECT2(x,y) typedef struct _##x; typedef struct _##x *P##y; +#else +#ifndef NTOSAPI +#define NTOSAPI DECL_IMPORT +#endif +#define DECLARE_INTERNAL_OBJECT(x) struct _##x; typedef struct _##x *P##x; +#define DECLARE_INTERNAL_OBJECT2(x,y) struct _##x; typedef struct _##x *P##y; +#endif + +#if defined(_NTHAL_) +#ifndef NTHALAPI +#define NTHALAPI DECL_EXPORT +#endif +#else +#ifndef NTHALAPI +#define NTHALAPI DECL_IMPORT +#endif +#endif + +/* Pseudo modifiers for parameters */ +#define IN +#define OUT +#define OPTIONAL +#define UNALLIGNED + +#define CONST const +#define VOLATILE volatile + +#define RESTRICTED_POINTER +#define POINTER_ALIGNMENT +#define DECLSPEC_ADDRSAFE + +#ifdef NONAMELESSUNION +# define _DDK_DUMMYUNION_MEMBER(name) DUMMYUNIONNAME.name +# define _DDK_DUMMYUNION_N_MEMBER(n, name) DUMMYUNIONNAME##n.name +#else +# define _DDK_DUMMYUNION_MEMBER(name) name +# define _DDK_DUMMYUNION_N_MEMBER(n, name) name +#endif + +#if !defined(_NTSYSTEM_) +#define NTSYSAPI DECLSPEC_IMPORT +#define NTSYSCALLAPI DECLSPEC_IMPORT +#else +#define NTSYSAPI +#if defined(_NTDLLBUILD_) +#define NTSYSCALLAPI +#else +#define NTSYSCALLAPI DECLSPEC_ADDRSAFE +#endif +#endif + +/* + * Alignment Macros + */ +#define ALIGN_DOWN(s, t) \ + ((ULONG)(s) & ~(sizeof(t) - 1)) + +#define ALIGN_UP(s, t) \ + (ALIGN_DOWN(((ULONG)(s) + sizeof(t) - 1), t)) + +#define ALIGN_DOWN_POINTER(p, t) \ + ((PVOID)((ULONG_PTR)(p) & ~((ULONG_PTR)sizeof(t) - 1))) + +#define ALIGN_UP_POINTER(p, t) \ + (ALIGN_DOWN_POINTER(((ULONG_PTR)(p) + sizeof(t) - 1), t)) + +/* +** Forward declarations +*/ + +struct _IRP; +struct _MDL; +struct _KAPC; +struct _KDPC; +struct _KPCR; +struct _KPRCB; +struct _KTSS; +struct _FILE_OBJECT; +struct _DMA_ADAPTER; +struct _DEVICE_OBJECT; +struct _DRIVER_OBJECT; +struct _IO_STATUS_BLOCK; +struct _DEVICE_DESCRIPTION; +struct _SCATTER_GATHER_LIST; +struct _DRIVE_LAYOUT_INFORMATION; +struct _DRIVE_LAYOUT_INFORMATION_EX; + +typedef PVOID PSECURITY_DESCRIPTOR; +typedef ULONG SECURITY_INFORMATION, *PSECURITY_INFORMATION; +typedef PVOID PSID; + +DECLARE_INTERNAL_OBJECT(ADAPTER_OBJECT) +DECLARE_INTERNAL_OBJECT(DMA_ADAPTER) +DECLARE_INTERNAL_OBJECT(IO_STATUS_BLOCK) + +#if 1 +/* FIXME: Unknown definitions */ +struct _SET_PARTITION_INFORMATION_EX; +typedef ULONG WAIT_TYPE; +#define WaitAll 0 +#define WaitAny 1 +typedef HANDLE TRACEHANDLE; +typedef PVOID PWMILIB_CONTEXT; +typedef PVOID PSYSCTL_IRP_DISPOSITION; +typedef ULONG LOGICAL; +#endif + +/* +** Routines specific to this DDK +*/ +#define NtCurrentThread() ( (HANDLE)(LONG_PTR) -2 ) + +/* +** Simple structures +*/ + +typedef LONG KPRIORITY; +typedef UCHAR KIRQL, *PKIRQL; +typedef ULONG_PTR KSPIN_LOCK, *PKSPIN_LOCK; +typedef UCHAR KPROCESSOR_MODE; + +typedef enum _MODE { + KernelMode, + UserMode, + MaximumMode +} MODE; + +typedef struct _QUAD +{ + union + { + LONGLONG UseThisFieldToCopy; + float DoNotUseThisField; + }; +} QUAD, *PQUAD; + +/* Structures not exposed to drivers */ +typedef struct _IO_TIMER *PIO_TIMER; +typedef struct _KPROCESS *PKPROCESS; +typedef struct _EPROCESS *PEPROCESS; +typedef struct _ETHREAD *PETHREAD; +typedef struct _KINTERRUPT *PKINTERRUPT; +typedef struct _OBJECT_TYPE *POBJECT_TYPE; +typedef struct _KTHREAD *PKTHREAD, *PRKTHREAD; +typedef struct _COMPRESSED_DATA_INFO *PCOMPRESSED_DATA_INFO; +typedef struct _HAL_DISPATCH_TABLE *PHAL_DISPATCH_TABLE; +typedef struct _HAL_PRIVATE_DISPATCH_TABLE *PHAL_PRIVATE_DISPATCH_TABLE; +typedef struct _DEVICE_HANDLER_OBJECT *PDEVICE_HANDLER_OBJECT; +typedef struct _BUS_HANDLER *PBUS_HANDLER; +typedef struct _PEB *PPEB; +typedef struct _ADAPTER_OBJECT *PADAPTER_OBJECT; + +/* Constants */ +#define NtCurrentProcess() ( (HANDLE)(LONG_PTR) -1 ) +#define ZwCurrentProcess() NtCurrentProcess() +#define NtCurrentThread() ( (HANDLE)(LONG_PTR) -2 ) +#define ZwCurrentThread() NtCurrentThread() + +#define KERNEL_STACK_SIZE 12288 +#define KERNEL_LARGE_STACK_SIZE 61440 + + +#define DPFLTR_ERROR_LEVEL 0 +#define DPFLTR_WARNING_LEVEL 1 +#define DPFLTR_TRACE_LEVEL 2 +#define DPFLTR_INFO_LEVEL 3 +#define DPFLTR_MASK 0x80000000 + +#define MAXIMUM_PROCESSORS 32 + +#define MAXIMUM_WAIT_OBJECTS 64 + +#define EX_RUNDOWN_ACTIVE 0x1 +#define EX_RUNDOWN_COUNT_SHIFT 0x1 +#define EX_RUNDOWN_COUNT_INC (1 << EX_RUNDOWN_COUNT_SHIFT) + +#define METHOD_BUFFERED 0 +#define METHOD_IN_DIRECT 1 +#define METHOD_OUT_DIRECT 2 +#define METHOD_NEITHER 3 + +#define LOW_PRIORITY 0 +#define LOW_REALTIME_PRIORITY 16 +#define HIGH_PRIORITY 31 +#define MAXIMUM_PRIORITY 32 + +#define FILE_SUPERSEDED 0x00000000 +#define FILE_OPENED 0x00000001 +#define FILE_CREATED 0x00000002 +#define FILE_OVERWRITTEN 0x00000003 +#define FILE_EXISTS 0x00000004 +#define FILE_DOES_NOT_EXIST 0x00000005 + +#define FILE_USE_FILE_POINTER_POSITION 0xfffffffe +#define FILE_WRITE_TO_END_OF_FILE 0xffffffff + +/* also in winnt.h */ +#define FILE_LIST_DIRECTORY 0x00000001 +#define FILE_READ_DATA 0x00000001 +#define FILE_ADD_FILE 0x00000002 +#define FILE_WRITE_DATA 0x00000002 +#define FILE_ADD_SUBDIRECTORY 0x00000004 +#define FILE_APPEND_DATA 0x00000004 +#define FILE_CREATE_PIPE_INSTANCE 0x00000004 +#define FILE_READ_EA 0x00000008 +#define FILE_WRITE_EA 0x00000010 +#define FILE_EXECUTE 0x00000020 +#define FILE_TRAVERSE 0x00000020 +#define FILE_DELETE_CHILD 0x00000040 +#define FILE_READ_ATTRIBUTES 0x00000080 +#define FILE_WRITE_ATTRIBUTES 0x00000100 + +#define FILE_SHARE_READ 0x00000001 +#define FILE_SHARE_WRITE 0x00000002 +#define FILE_SHARE_DELETE 0x00000004 +#define FILE_SHARE_VALID_FLAGS 0x00000007 + +#define FILE_ATTRIBUTE_READONLY 0x00000001 +#define FILE_ATTRIBUTE_HIDDEN 0x00000002 +#define FILE_ATTRIBUTE_SYSTEM 0x00000004 +#define FILE_ATTRIBUTE_DIRECTORY 0x00000010 +#define FILE_ATTRIBUTE_ARCHIVE 0x00000020 +#define FILE_ATTRIBUTE_DEVICE 0x00000040 +#define FILE_ATTRIBUTE_NORMAL 0x00000080 +#define FILE_ATTRIBUTE_TEMPORARY 0x00000100 +#define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200 +#define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400 +#define FILE_ATTRIBUTE_COMPRESSED 0x00000800 +#define FILE_ATTRIBUTE_OFFLINE 0x00001000 +#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000 +#define FILE_ATTRIBUTE_ENCRYPTED 0x00004000 + +#define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7 +#define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7 + +#define FILE_COPY_STRUCTURED_STORAGE 0x00000041 +#define FILE_STRUCTURED_STORAGE 0x00000441 + +#define FILE_VALID_OPTION_FLAGS 0x00ffffff +#define FILE_VALID_PIPE_OPTION_FLAGS 0x00000032 +#define FILE_VALID_MAILSLOT_OPTION_FLAGS 0x00000032 +#define FILE_VALID_SET_FLAGS 0x00000036 + +#define FILE_SUPERSEDE 0x00000000 +#define FILE_OPEN 0x00000001 +#define FILE_CREATE 0x00000002 +#define FILE_OPEN_IF 0x00000003 +#define FILE_OVERWRITE 0x00000004 +#define FILE_OVERWRITE_IF 0x00000005 +#define FILE_MAXIMUM_DISPOSITION 0x00000005 + +#define FILE_DIRECTORY_FILE 0x00000001 +#define FILE_WRITE_THROUGH 0x00000002 +#define FILE_SEQUENTIAL_ONLY 0x00000004 +#define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008 +#define FILE_SYNCHRONOUS_IO_ALERT 0x00000010 +#define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020 +#define FILE_NON_DIRECTORY_FILE 0x00000040 +#define FILE_CREATE_TREE_CONNECTION 0x00000080 +#define FILE_COMPLETE_IF_OPLOCKED 0x00000100 +#define FILE_NO_EA_KNOWLEDGE 0x00000200 +#define FILE_OPEN_FOR_RECOVERY 0x00000400 +#define FILE_RANDOM_ACCESS 0x00000800 +#define FILE_DELETE_ON_CLOSE 0x00001000 +#define FILE_OPEN_BY_FILE_ID 0x00002000 +#define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000 +#define FILE_NO_COMPRESSION 0x00008000 +#define FILE_RESERVE_OPFILTER 0x00100000 +#define FILE_OPEN_REPARSE_POINT 0x00200000 +#define FILE_OPEN_NO_RECALL 0x00400000 +#define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000 + +#define FILE_ANY_ACCESS 0x00000000 +#define FILE_SPECIAL_ACCESS FILE_ANY_ACCESS +#define FILE_READ_ACCESS 0x00000001 +#define FILE_WRITE_ACCESS 0x00000002 + +#define FILE_ALL_ACCESS \ + (STANDARD_RIGHTS_REQUIRED | \ + SYNCHRONIZE | \ + 0x1FF) + +#define FILE_GENERIC_EXECUTE \ + (STANDARD_RIGHTS_EXECUTE | \ + FILE_READ_ATTRIBUTES | \ + FILE_EXECUTE | \ + SYNCHRONIZE) + +#define FILE_GENERIC_READ \ + (STANDARD_RIGHTS_READ | \ + FILE_READ_DATA | \ + FILE_READ_ATTRIBUTES | \ + FILE_READ_EA | \ + SYNCHRONIZE) + +#define FILE_GENERIC_WRITE \ + (STANDARD_RIGHTS_WRITE | \ + FILE_WRITE_DATA | \ + FILE_WRITE_ATTRIBUTES | \ + FILE_WRITE_EA | \ + FILE_APPEND_DATA | \ + SYNCHRONIZE) +/* end winnt.h */ + +#define OBJECT_TYPE_CREATE (0x0001) +#define OBJECT_TYPE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1) + +#define DIRECTORY_QUERY (0x0001) +#define DIRECTORY_TRAVERSE (0x0002) +#define DIRECTORY_CREATE_OBJECT (0x0004) +#define DIRECTORY_CREATE_SUBDIRECTORY (0x0008) +#define DIRECTORY_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0xF) + +#define EVENT_QUERY_STATE (0x0001) +#define EVENT_MODIFY_STATE (0x0002) +#define EVENT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3) + +#define SEMAPHORE_QUERY_STATE (0x0001) +#define SEMAPHORE_MODIFY_STATE (0x0002) +#define SEMAPHORE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3) + +#define THREAD_ALERT (0x0004) + +#define FM_LOCK_BIT (0x1) +#define FM_LOCK_BIT_V (0x0) +#define FM_LOCK_WAITER_WOKEN (0x2) +#define FM_LOCK_WAITER_INC (0x4) + +/* Exported object types */ +extern NTOSAPI POBJECT_TYPE ExDesktopObjectType; +extern NTOSAPI POBJECT_TYPE ExEventObjectType; +extern NTOSAPI POBJECT_TYPE ExSemaphoreObjectType; +extern NTOSAPI POBJECT_TYPE ExWindowStationObjectType; +extern NTOSAPI ULONG IoDeviceHandlerObjectSize; +extern NTOSAPI POBJECT_TYPE IoDeviceHandlerObjectType; +extern NTOSAPI POBJECT_TYPE IoDeviceObjectType; +extern NTOSAPI POBJECT_TYPE IoDriverObjectType; +extern NTOSAPI POBJECT_TYPE IoFileObjectType; +extern NTOSAPI POBJECT_TYPE PsThreadType; +extern NTOSAPI POBJECT_TYPE LpcPortObjectType; +extern NTOSAPI POBJECT_TYPE MmSectionObjectType; +extern NTOSAPI POBJECT_TYPE SeTokenObjectType; + +extern NTOSAPI CCHAR KeNumberProcessors; + +#define PROCESSOR_FEATURE_MAX 64 +#define MAX_WOW64_SHARED_ENTRIES 16 + +typedef enum _ALTERNATIVE_ARCHITECTURE_TYPE +{ + StandardDesign, + NEC98x86, + EndAlternatives +} ALTERNATIVE_ARCHITECTURE_TYPE; + +typedef struct _KSYSTEM_TIME +{ + ULONG LowPart; + LONG High1Time; + LONG High2Time; +} KSYSTEM_TIME, *PKSYSTEM_TIME; + +typedef struct _KUSER_SHARED_DATA +{ + ULONG TickCountLowDeprecated; + ULONG TickCountMultiplier; + volatile KSYSTEM_TIME InterruptTime; + volatile KSYSTEM_TIME SystemTime; + volatile KSYSTEM_TIME TimeZoneBias; + USHORT ImageNumberLow; + USHORT ImageNumberHigh; + WCHAR NtSystemRoot[260]; + ULONG MaxStackTraceDepth; + ULONG CryptoExponent; + ULONG TimeZoneId; + ULONG LargePageMinimum; + ULONG Reserved2[7]; + NT_PRODUCT_TYPE NtProductType; + BOOLEAN ProductTypeIsValid; + ULONG NtMajorVersion; + ULONG NtMinorVersion; + BOOLEAN ProcessorFeatures[PROCESSOR_FEATURE_MAX]; + ULONG Reserved1; + ULONG Reserved3; + volatile ULONG TimeSlip; + ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture; + LARGE_INTEGER SystemExpirationDate; + ULONG SuiteMask; + BOOLEAN KdDebuggerEnabled; + volatile ULONG ActiveConsoleId; + volatile ULONG DismountCount; + ULONG ComPlusPackage; + ULONG LastSystemRITEventTickCount; + ULONG NumberOfPhysicalPages; + BOOLEAN SafeBootMode; + ULONG TraceLogging; + ULONG Fill0; + ULONGLONG TestRetInstruction; + ULONG SystemCall; + ULONG SystemCallReturn; + ULONGLONG SystemCallPad[3]; + union { + volatile KSYSTEM_TIME TickCount; + volatile ULONG64 TickCountQuad; + }; + ULONG Cookie; + LONGLONG ConsoleSessionForegroundProcessId; + ULONG Wow64SharedInformation[MAX_WOW64_SHARED_ENTRIES]; + ULONG UserModeGlobalLogging; +} KUSER_SHARED_DATA, *PKUSER_SHARED_DATA; + +/* +** IRP function codes +*/ + +#define IRP_MJ_CREATE 0x00 +#define IRP_MJ_CREATE_NAMED_PIPE 0x01 +#define IRP_MJ_CLOSE 0x02 +#define IRP_MJ_READ 0x03 +#define IRP_MJ_WRITE 0x04 +#define IRP_MJ_QUERY_INFORMATION 0x05 +#define IRP_MJ_SET_INFORMATION 0x06 +#define IRP_MJ_QUERY_EA 0x07 +#define IRP_MJ_SET_EA 0x08 +#define IRP_MJ_FLUSH_BUFFERS 0x09 +#define IRP_MJ_QUERY_VOLUME_INFORMATION 0x0a +#define IRP_MJ_SET_VOLUME_INFORMATION 0x0b +#define IRP_MJ_DIRECTORY_CONTROL 0x0c +#define IRP_MJ_FILE_SYSTEM_CONTROL 0x0d +#define IRP_MJ_DEVICE_CONTROL 0x0e +#define IRP_MJ_INTERNAL_DEVICE_CONTROL 0x0f +#define IRP_MJ_SCSI 0x0f +#define IRP_MJ_SHUTDOWN 0x10 +#define IRP_MJ_LOCK_CONTROL 0x11 +#define IRP_MJ_CLEANUP 0x12 +#define IRP_MJ_CREATE_MAILSLOT 0x13 +#define IRP_MJ_QUERY_SECURITY 0x14 +#define IRP_MJ_SET_SECURITY 0x15 +#define IRP_MJ_POWER 0x16 +#define IRP_MJ_SYSTEM_CONTROL 0x17 +#define IRP_MJ_DEVICE_CHANGE 0x18 +#define IRP_MJ_QUERY_QUOTA 0x19 +#define IRP_MJ_SET_QUOTA 0x1a +#define IRP_MJ_PNP 0x1b +#define IRP_MJ_PNP_POWER 0x1b +#define IRP_MJ_MAXIMUM_FUNCTION 0x1b + +#define IRP_MN_QUERY_DIRECTORY 0x01 +#define IRP_MN_NOTIFY_CHANGE_DIRECTORY 0x02 + +#define IRP_MN_USER_FS_REQUEST 0x00 +#define IRP_MN_MOUNT_VOLUME 0x01 +#define IRP_MN_VERIFY_VOLUME 0x02 +#define IRP_MN_LOAD_FILE_SYSTEM 0x03 +#define IRP_MN_TRACK_LINK 0x04 +#define IRP_MN_KERNEL_CALL 0x04 + +#define IRP_MN_LOCK 0x01 +#define IRP_MN_UNLOCK_SINGLE 0x02 +#define IRP_MN_UNLOCK_ALL 0x03 +#define IRP_MN_UNLOCK_ALL_BY_KEY 0x04 + +#define IRP_MN_NORMAL 0x00 +#define IRP_MN_DPC 0x01 +#define IRP_MN_MDL 0x02 +#define IRP_MN_COMPLETE 0x04 +#define IRP_MN_COMPRESSED 0x08 + +#define IRP_MN_MDL_DPC (IRP_MN_MDL | IRP_MN_DPC) +#define IRP_MN_COMPLETE_MDL (IRP_MN_COMPLETE | IRP_MN_MDL) +#define IRP_MN_COMPLETE_MDL_DPC (IRP_MN_COMPLETE_MDL | IRP_MN_DPC) + +#define IRP_MN_SCSI_CLASS 0x01 + +#define IRP_MN_START_DEVICE 0x00 +#define IRP_MN_QUERY_REMOVE_DEVICE 0x01 +#define IRP_MN_REMOVE_DEVICE 0x02 +#define IRP_MN_CANCEL_REMOVE_DEVICE 0x03 +#define IRP_MN_STOP_DEVICE 0x04 +#define IRP_MN_QUERY_STOP_DEVICE 0x05 +#define IRP_MN_CANCEL_STOP_DEVICE 0x06 + +#define IRP_MN_QUERY_DEVICE_RELATIONS 0x07 +#define IRP_MN_QUERY_INTERFACE 0x08 +#define IRP_MN_QUERY_CAPABILITIES 0x09 +#define IRP_MN_QUERY_RESOURCES 0x0A +#define IRP_MN_QUERY_RESOURCE_REQUIREMENTS 0x0B +#define IRP_MN_QUERY_DEVICE_TEXT 0x0C +#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS 0x0D + +#define IRP_MN_READ_CONFIG 0x0F +#define IRP_MN_WRITE_CONFIG 0x10 +#define IRP_MN_EJECT 0x11 +#define IRP_MN_SET_LOCK 0x12 +#define IRP_MN_QUERY_ID 0x13 +#define IRP_MN_QUERY_PNP_DEVICE_STATE 0x14 +#define IRP_MN_QUERY_BUS_INFORMATION 0x15 +#define IRP_MN_DEVICE_USAGE_NOTIFICATION 0x16 +#define IRP_MN_SURPRISE_REMOVAL 0x17 +#define IRP_MN_QUERY_LEGACY_BUS_INFORMATION 0x18 + +#define IRP_MN_WAIT_WAKE 0x00 +#define IRP_MN_POWER_SEQUENCE 0x01 +#define IRP_MN_SET_POWER 0x02 +#define IRP_MN_QUERY_POWER 0x03 + +#define IRP_MN_QUERY_ALL_DATA 0x00 +#define IRP_MN_QUERY_SINGLE_INSTANCE 0x01 +#define IRP_MN_CHANGE_SINGLE_INSTANCE 0x02 +#define IRP_MN_CHANGE_SINGLE_ITEM 0x03 +#define IRP_MN_ENABLE_EVENTS 0x04 +#define IRP_MN_DISABLE_EVENTS 0x05 +#define IRP_MN_ENABLE_COLLECTION 0x06 +#define IRP_MN_DISABLE_COLLECTION 0x07 +#define IRP_MN_REGINFO 0x08 +#define IRP_MN_EXECUTE_METHOD 0x09 + +#define IRP_MN_REGINFO_EX 0x0b + +typedef enum _IO_ALLOCATION_ACTION { + KeepObject = 1, + DeallocateObject, + DeallocateObjectKeepRegisters +} IO_ALLOCATION_ACTION, *PIO_ALLOCATION_ACTION; + +typedef IO_ALLOCATION_ACTION +(DDKAPI *PDRIVER_CONTROL)( + IN struct _DEVICE_OBJECT *DeviceObject, + IN struct _IRP *Irp, + IN PVOID MapRegisterBase, + IN PVOID Context); + +typedef EXCEPTION_DISPOSITION +(DDKAPI *PEXCEPTION_ROUTINE)( + IN struct _EXCEPTION_RECORD *ExceptionRecord, + IN PVOID EstablisherFrame, + IN OUT struct _CONTEXT *ContextRecord, + IN OUT PVOID DispatcherContext); + +typedef VOID +(DDKAPI *PDRIVER_LIST_CONTROL)( + IN struct _DEVICE_OBJECT *DeviceObject, + IN struct _IRP *Irp, + IN struct _SCATTER_GATHER_LIST *ScatterGather, + IN PVOID Context); + +typedef NTSTATUS +(DDKAPI *PDRIVER_ADD_DEVICE)( + IN struct _DRIVER_OBJECT *DriverObject, + IN struct _DEVICE_OBJECT *PhysicalDeviceObject); + +typedef NTSTATUS +(DDKAPI *PIO_COMPLETION_ROUTINE)( + IN struct _DEVICE_OBJECT *DeviceObject, + IN struct _IRP *Irp, + IN PVOID Context); + +typedef VOID +(DDKAPI *PDRIVER_CANCEL)( + IN struct _DEVICE_OBJECT *DeviceObject, + IN struct _IRP *Irp); + +typedef VOID +(DDKAPI *PKDEFERRED_ROUTINE)( + IN struct _KDPC *Dpc, + IN PVOID DeferredContext, + IN PVOID SystemArgument1, + IN PVOID SystemArgument2); + +typedef NTSTATUS +(DDKAPI *PDRIVER_DISPATCH)( + IN struct _DEVICE_OBJECT *DeviceObject, + IN struct _IRP *Irp); + +typedef VOID +(DDKAPI *PIO_DPC_ROUTINE)( + IN struct _KDPC *Dpc, + IN struct _DEVICE_OBJECT *DeviceObject, + IN struct _IRP *Irp, + IN PVOID Context); + +typedef NTSTATUS +(DDKAPI *PMM_DLL_INITIALIZE)( + IN PUNICODE_STRING RegistryPath); + +typedef NTSTATUS +(DDKAPI *PMM_DLL_UNLOAD)( + VOID); + +typedef NTSTATUS +(DDKAPI *PDRIVER_ENTRY)( + IN struct _DRIVER_OBJECT *DriverObject, + IN PUNICODE_STRING RegistryPath); + +typedef NTSTATUS +(DDKAPI *PDRIVER_INITIALIZE)( + IN struct _DRIVER_OBJECT *DriverObject, + IN PUNICODE_STRING RegistryPath); + +typedef BOOLEAN +(DDKAPI *PKSERVICE_ROUTINE)( + IN struct _KINTERRUPT *Interrupt, + IN PVOID ServiceContext); + +typedef VOID +(DDKAPI *PIO_TIMER_ROUTINE)( + IN struct _DEVICE_OBJECT *DeviceObject, + IN PVOID Context); + +typedef VOID +(DDKAPI *PDRIVER_REINITIALIZE)( + IN struct _DRIVER_OBJECT *DriverObject, + IN PVOID Context, + IN ULONG Count); + +typedef VOID +(DDKAPI *PDRIVER_STARTIO)( + IN struct _DEVICE_OBJECT *DeviceObject, + IN struct _IRP *Irp); + +typedef BOOLEAN +(DDKAPI *PKSYNCHRONIZE_ROUTINE)( + IN PVOID SynchronizeContext); + +typedef VOID +(DDKAPI *PDRIVER_UNLOAD)( + IN struct _DRIVER_OBJECT *DriverObject); + + + +/* +** Plug and Play structures +*/ + +typedef VOID +(DDKAPI *PINTERFACE_REFERENCE)( + PVOID Context); + +typedef VOID +(DDKAPI *PINTERFACE_DEREFERENCE)( + PVOID Context); + +typedef BOOLEAN +(DDKAPI *PTRANSLATE_BUS_ADDRESS)( + IN PVOID Context, + IN PHYSICAL_ADDRESS BusAddress, + IN ULONG Length, + IN OUT PULONG AddressSpace, + OUT PPHYSICAL_ADDRESS TranslatedAddress); + +typedef struct _DMA_ADAPTER* +(DDKAPI *PGET_DMA_ADAPTER)( + IN PVOID Context, + IN struct _DEVICE_DESCRIPTION *DeviceDescriptor, + OUT PULONG NumberOfMapRegisters); + +typedef ULONG +(DDKAPI *PGET_SET_DEVICE_DATA)( + IN PVOID Context, + IN ULONG DataType, + IN PVOID Buffer, + IN ULONG Offset, + IN ULONG Length); + +/* PCI_DEVICE_PRESENCE_PARAMETERS.Flags */ +#define PCI_USE_SUBSYSTEM_IDS 0x00000001 +#define PCI_USE_REVISION 0x00000002 +#define PCI_USE_VENDEV_IDS 0x00000004 +#define PCI_USE_CLASS_SUBCLASS 0x00000008 +#define PCI_USE_PROGIF 0x00000010 +#define PCI_USE_LOCAL_BUS 0x00000020 +#define PCI_USE_LOCAL_DEVICE 0x00000040 + +typedef struct _PCI_DEVICE_PRESENCE_PARAMETERS { + ULONG Size; + ULONG Flags; + USHORT VendorID; + USHORT DeviceID; + UCHAR RevisionID; + USHORT SubVendorID; + USHORT SubSystemID; + UCHAR BaseClass; + UCHAR SubClass; + UCHAR ProgIf; +} PCI_DEVICE_PRESENCE_PARAMETERS, *PPCI_DEVICE_PRESENCE_PARAMETERS; + +typedef BOOLEAN +(DDKAPI *PPCI_IS_DEVICE_PRESENT)( + IN USHORT VendorID, + IN USHORT DeviceID, + IN UCHAR RevisionID, + IN USHORT SubVendorID, + IN USHORT SubSystemID, + IN ULONG Flags); + +typedef BOOLEAN +(DDKAPI *PPCI_IS_DEVICE_PRESENT_EX)( + IN PVOID Context, + IN PPCI_DEVICE_PRESENCE_PARAMETERS Parameters); + +typedef union _POWER_STATE { + SYSTEM_POWER_STATE SystemState; + DEVICE_POWER_STATE DeviceState; +} POWER_STATE, *PPOWER_STATE; + +typedef enum _POWER_STATE_TYPE { + SystemPowerState, + DevicePowerState +} POWER_STATE_TYPE, *PPOWER_STATE_TYPE; + +typedef struct _BUS_INTERFACE_STANDARD { + USHORT Size; + USHORT Version; + PVOID Context; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; + PTRANSLATE_BUS_ADDRESS TranslateBusAddress; + PGET_DMA_ADAPTER GetDmaAdapter; + PGET_SET_DEVICE_DATA SetBusData; + PGET_SET_DEVICE_DATA GetBusData; +} BUS_INTERFACE_STANDARD, *PBUS_INTERFACE_STANDARD; + +typedef struct _PCI_DEVICE_PRESENT_INTERFACE { + USHORT Size; + USHORT Version; + PVOID Context; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; + PPCI_IS_DEVICE_PRESENT IsDevicePresent; + PPCI_IS_DEVICE_PRESENT_EX IsDevicePresentEx; +} PCI_DEVICE_PRESENT_INTERFACE, *PPCI_DEVICE_PRESENT_INTERFACE; + +typedef struct _DEVICE_CAPABILITIES { + USHORT Size; + USHORT Version; + ULONG DeviceD1 : 1; + ULONG DeviceD2 : 1; + ULONG LockSupported : 1; + ULONG EjectSupported : 1; + ULONG Removable : 1; + ULONG DockDevice : 1; + ULONG UniqueID : 1; + ULONG SilentInstall : 1; + ULONG RawDeviceOK : 1; + ULONG SurpriseRemovalOK : 1; + ULONG WakeFromD0 : 1; + ULONG WakeFromD1 : 1; + ULONG WakeFromD2 : 1; + ULONG WakeFromD3 : 1; + ULONG HardwareDisabled : 1; + ULONG NonDynamic : 1; + ULONG WarmEjectSupported : 1; + ULONG NoDisplayInUI : 1; + ULONG Reserved : 14; + ULONG Address; + ULONG UINumber; + DEVICE_POWER_STATE DeviceState[PowerSystemMaximum]; + SYSTEM_POWER_STATE SystemWake; + DEVICE_POWER_STATE DeviceWake; + ULONG D1Latency; + ULONG D2Latency; + ULONG D3Latency; +} DEVICE_CAPABILITIES, *PDEVICE_CAPABILITIES; + +typedef struct _DEVICE_INTERFACE_CHANGE_NOTIFICATION { + USHORT Version; + USHORT Size; + GUID Event; + GUID InterfaceClassGuid; + PUNICODE_STRING SymbolicLinkName; +} DEVICE_INTERFACE_CHANGE_NOTIFICATION, *PDEVICE_INTERFACE_CHANGE_NOTIFICATION; + +typedef struct _HWPROFILE_CHANGE_NOTIFICATION { + USHORT Version; + USHORT Size; + GUID Event; +} HWPROFILE_CHANGE_NOTIFICATION, *PHWPROFILE_CHANGE_NOTIFICATION; + +#undef INTERFACE + +typedef struct _INTERFACE { + USHORT Size; + USHORT Version; + PVOID Context; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; +} INTERFACE, *PINTERFACE; + +typedef struct _PLUGPLAY_NOTIFICATION_HEADER { + USHORT Version; + USHORT Size; + GUID Event; +} PLUGPLAY_NOTIFICATION_HEADER, *PPLUGPLAY_NOTIFICATION_HEADER; + +typedef ULONG PNP_DEVICE_STATE, *PPNP_DEVICE_STATE; + +/* PNP_DEVICE_STATE */ + +#define PNP_DEVICE_DISABLED 0x00000001 +#define PNP_DEVICE_DONT_DISPLAY_IN_UI 0x00000002 +#define PNP_DEVICE_FAILED 0x00000004 +#define PNP_DEVICE_REMOVED 0x00000008 +#define PNP_DEVICE_RESOURCE_REQUIREMENTS_CHANGED 0x00000010 +#define PNP_DEVICE_NOT_DISABLEABLE 0x00000020 + +typedef struct _TARGET_DEVICE_CUSTOM_NOTIFICATION { + USHORT Version; + USHORT Size; + GUID Event; + struct _FILE_OBJECT *FileObject; + LONG NameBufferOffset; + UCHAR CustomDataBuffer[1]; +} TARGET_DEVICE_CUSTOM_NOTIFICATION, *PTARGET_DEVICE_CUSTOM_NOTIFICATION; + +typedef struct _TARGET_DEVICE_REMOVAL_NOTIFICATION { + USHORT Version; + USHORT Size; + GUID Event; + struct _FILE_OBJECT *FileObject; +} TARGET_DEVICE_REMOVAL_NOTIFICATION, *PTARGET_DEVICE_REMOVAL_NOTIFICATION; + +typedef enum _BUS_QUERY_ID_TYPE { + BusQueryDeviceID, + BusQueryHardwareIDs, + BusQueryCompatibleIDs, + BusQueryInstanceID, + BusQueryDeviceSerialNumber +} BUS_QUERY_ID_TYPE, *PBUS_QUERY_ID_TYPE; + +typedef enum _DEVICE_TEXT_TYPE { + DeviceTextDescription, + DeviceTextLocationInformation +} DEVICE_TEXT_TYPE, *PDEVICE_TEXT_TYPE; + +typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE { + DeviceUsageTypeUndefined, + DeviceUsageTypePaging, + DeviceUsageTypeHibernation, + DeviceUsageTypeDumpFile +} DEVICE_USAGE_NOTIFICATION_TYPE; + +typedef struct _POWER_SEQUENCE { + ULONG SequenceD1; + ULONG SequenceD2; + ULONG SequenceD3; +} POWER_SEQUENCE, *PPOWER_SEQUENCE; + +typedef enum { + DevicePropertyDeviceDescription, + DevicePropertyHardwareID, + DevicePropertyCompatibleIDs, + DevicePropertyBootConfiguration, + DevicePropertyBootConfigurationTranslated, + DevicePropertyClassName, + DevicePropertyClassGuid, + DevicePropertyDriverKeyName, + DevicePropertyManufacturer, + DevicePropertyFriendlyName, + DevicePropertyLocationInformation, + DevicePropertyPhysicalDeviceObjectName, + DevicePropertyBusTypeGuid, + DevicePropertyLegacyBusType, + DevicePropertyBusNumber, + DevicePropertyEnumeratorName, + DevicePropertyAddress, + DevicePropertyUINumber, + DevicePropertyInstallState, + DevicePropertyRemovalPolicy +} DEVICE_REGISTRY_PROPERTY; + +typedef enum _IO_NOTIFICATION_EVENT_CATEGORY { + EventCategoryReserved, + EventCategoryHardwareProfileChange, + EventCategoryDeviceInterfaceChange, + EventCategoryTargetDeviceChange +} IO_NOTIFICATION_EVENT_CATEGORY; + +#define PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_INTERFACES 0x00000001 + +typedef NTSTATUS +(DDKAPI *PDRIVER_NOTIFICATION_CALLBACK_ROUTINE)( + IN PVOID NotificationStructure, + IN PVOID Context); + +typedef VOID +(DDKAPI *PDEVICE_CHANGE_COMPLETE_CALLBACK)( + IN PVOID Context); + + +/* +** System structures +*/ + +#define SYMBOLIC_LINK_QUERY 0x0001 +#define SYMBOLIC_LINK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1) + +/* also in winnt,h */ +#define DUPLICATE_CLOSE_SOURCE 0x00000001 +#define DUPLICATE_SAME_ACCESS 0x00000002 +#define DUPLICATE_SAME_ATTRIBUTES 0x00000004 +/* end winnt.h */ + +typedef struct _OBJECT_NAME_INFORMATION { + UNICODE_STRING Name; +} OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION; + +typedef VOID +(DDKAPI *PIO_APC_ROUTINE)( + IN PVOID ApcContext, + IN PIO_STATUS_BLOCK IoStatusBlock, + IN ULONG Reserved); + +typedef struct _IO_STATUS_BLOCK { + _ANONYMOUS_UNION union { + NTSTATUS Status; + PVOID Pointer; + } DUMMYUNIONNAME; + ULONG_PTR Information; +} IO_STATUS_BLOCK; + +typedef VOID +(DDKAPI *PKNORMAL_ROUTINE)( + IN PVOID NormalContext, + IN PVOID SystemArgument1, + IN PVOID SystemArgument2); + +typedef VOID +(DDKAPI *PKKERNEL_ROUTINE)( + IN struct _KAPC *Apc, + IN OUT PKNORMAL_ROUTINE *NormalRoutine, + IN OUT PVOID *NormalContext, + IN OUT PVOID *SystemArgument1, + IN OUT PVOID *SystemArgument2); + +typedef VOID +(DDKAPI *PKRUNDOWN_ROUTINE)( + IN struct _KAPC *Apc); + +typedef BOOLEAN +(DDKAPI *PKTRANSFER_ROUTINE)( + VOID); + +typedef struct _KAPC +{ + UCHAR Type; + UCHAR SpareByte0; + UCHAR Size; + UCHAR SpareByte1; + ULONG SpareLong0; + struct _KTHREAD *Thread; + LIST_ENTRY ApcListEntry; + PKKERNEL_ROUTINE KernelRoutine; + PKRUNDOWN_ROUTINE RundownRoutine; + PKNORMAL_ROUTINE NormalRoutine; + PVOID NormalContext; + PVOID SystemArgument1; + PVOID SystemArgument2; + CCHAR ApcStateIndex; + KPROCESSOR_MODE ApcMode; + BOOLEAN Inserted; +} KAPC, *PKAPC, *RESTRICTED_POINTER PRKAPC; + +typedef struct _KDEVICE_QUEUE { + CSHORT Type; + CSHORT Size; + LIST_ENTRY DeviceListHead; + KSPIN_LOCK Lock; + BOOLEAN Busy; +} KDEVICE_QUEUE, *PKDEVICE_QUEUE, *RESTRICTED_POINTER PRKDEVICE_QUEUE; + +typedef struct _KDEVICE_QUEUE_ENTRY { + LIST_ENTRY DeviceListEntry; + ULONG SortKey; + BOOLEAN Inserted; +} KDEVICE_QUEUE_ENTRY, *PKDEVICE_QUEUE_ENTRY, +*RESTRICTED_POINTER PRKDEVICE_QUEUE_ENTRY; + +#define LOCK_QUEUE_WAIT 1 +#define LOCK_QUEUE_OWNER 2 + +typedef enum _KSPIN_LOCK_QUEUE_NUMBER { + LockQueueDispatcherLock, + LockQueueContextSwapLock, + LockQueuePfnLock, + LockQueueSystemSpaceLock, + LockQueueVacbLock, + LockQueueMasterLock, + LockQueueNonPagedPoolLock, + LockQueueIoCancelLock, + LockQueueWorkQueueLock, + LockQueueIoVpbLock, + LockQueueIoDatabaseLock, + LockQueueIoCompletionLock, + LockQueueNtfsStructLock, + LockQueueAfdWorkQueueLock, + LockQueueBcbLock, + LockQueueMaximumLock +} KSPIN_LOCK_QUEUE_NUMBER, *PKSPIN_LOCK_QUEUE_NUMBER; + +typedef struct _KSPIN_LOCK_QUEUE { + struct _KSPIN_LOCK_QUEUE *VOLATILE Next; + PKSPIN_LOCK VOLATILE Lock; +} KSPIN_LOCK_QUEUE, *PKSPIN_LOCK_QUEUE; + +typedef struct _KLOCK_QUEUE_HANDLE { + KSPIN_LOCK_QUEUE LockQueue; + KIRQL OldIrql; +} KLOCK_QUEUE_HANDLE, *PKLOCK_QUEUE_HANDLE; + +typedef struct _KDPC { + CSHORT Type; + UCHAR Number; + UCHAR Importance; + LIST_ENTRY DpcListEntry; + PKDEFERRED_ROUTINE DeferredRoutine; + PVOID DeferredContext; + PVOID SystemArgument1; + PVOID SystemArgument2; + PVOID DpcData; +} KDPC, *PKDPC, *RESTRICTED_POINTER PRKDPC; + +typedef struct _WAIT_CONTEXT_BLOCK { + KDEVICE_QUEUE_ENTRY WaitQueueEntry; + PDRIVER_CONTROL DeviceRoutine; + PVOID DeviceContext; + ULONG NumberOfMapRegisters; + PVOID DeviceObject; + PVOID CurrentIrp; + PKDPC BufferChainingDpc; +} WAIT_CONTEXT_BLOCK, *PWAIT_CONTEXT_BLOCK; + +typedef struct _DISPATCHER_HEADER +{ + union + { + struct + { + UCHAR Type; + union + { + UCHAR Absolute; + UCHAR NpxIrql; + }; + union + { + UCHAR Size; + UCHAR Hand; + }; + union + { + UCHAR Inserted; + BOOLEAN DebugActive; + }; + }; + volatile LONG Lock; + }; + LONG SignalState; + LIST_ENTRY WaitListHead; +} DISPATCHER_HEADER, *PDISPATCHER_HEADER; + +typedef struct _KEVENT { + DISPATCHER_HEADER Header; +} KEVENT, *PKEVENT, *RESTRICTED_POINTER PRKEVENT; + +typedef struct _KSEMAPHORE { + DISPATCHER_HEADER Header; + LONG Limit; +} KSEMAPHORE, *PKSEMAPHORE, *RESTRICTED_POINTER PRKSEMAPHORE; + +typedef struct _FAST_MUTEX +{ + LONG Count; + PKTHREAD Owner; + ULONG Contention; + KEVENT Gate; + ULONG OldIrql; +} FAST_MUTEX, *PFAST_MUTEX; + +typedef struct _EX_RUNDOWN_REF +{ + union + { + ULONG_PTR Count; + PVOID Ptr; + }; +} EX_RUNDOWN_REF, *PEX_RUNDOWN_REF; + +typedef struct _KGATE +{ + DISPATCHER_HEADER Header; +} KGATE, *PKGATE, *RESTRICTED_POINTER PRKGATE; + +typedef struct _KGUARDED_MUTEX +{ + LONG Count; + struct _KTHREAD* Owner; + ULONG Contention; + KGATE Gate; + union { + struct { + SHORT KernelApcDisable; + SHORT SpecialApcDisable; + }; + ULONG CombinedApcDisable; + }; +} KGUARDED_MUTEX, *PKGUARDED_MUTEX, *RESTRICTED_POINTER PRKGUARDED_MUTEX; + +typedef struct _KTIMER { + DISPATCHER_HEADER Header; + ULARGE_INTEGER DueTime; + LIST_ENTRY TimerListEntry; + struct _KDPC *Dpc; + LONG Period; +} KTIMER, *PKTIMER, *RESTRICTED_POINTER PRKTIMER; + +typedef struct _KMUTANT { + DISPATCHER_HEADER Header; + LIST_ENTRY MutantListEntry; + struct _KTHREAD *RESTRICTED_POINTER OwnerThread; + BOOLEAN Abandoned; + UCHAR ApcDisable; +} KMUTANT, *PKMUTANT, *RESTRICTED_POINTER PRKMUTANT, KMUTEX, *PKMUTEX, *RESTRICTED_POINTER PRKMUTEX; + +typedef enum _TIMER_TYPE { + NotificationTimer, + SynchronizationTimer +} TIMER_TYPE; + +#define EVENT_INCREMENT 1 +#define IO_NO_INCREMENT 0 +#define IO_CD_ROM_INCREMENT 1 +#define IO_DISK_INCREMENT 1 +#define IO_KEYBOARD_INCREMENT 6 +#define IO_MAILSLOT_INCREMENT 2 +#define IO_MOUSE_INCREMENT 6 +#define IO_NAMED_PIPE_INCREMENT 2 +#define IO_NETWORK_INCREMENT 2 +#define IO_PARALLEL_INCREMENT 1 +#define IO_SERIAL_INCREMENT 2 +#define IO_SOUND_INCREMENT 8 +#define IO_VIDEO_INCREMENT 1 +#define SEMAPHORE_INCREMENT 1 + +typedef struct _IRP { + CSHORT Type; + USHORT Size; + struct _MDL *MdlAddress; + ULONG Flags; + union { + struct _IRP *MasterIrp; + LONG IrpCount; + PVOID SystemBuffer; + } AssociatedIrp; + LIST_ENTRY ThreadListEntry; + IO_STATUS_BLOCK IoStatus; + KPROCESSOR_MODE RequestorMode; + BOOLEAN PendingReturned; + CHAR StackCount; + CHAR CurrentLocation; + BOOLEAN Cancel; + KIRQL CancelIrql; + CCHAR ApcEnvironment; + UCHAR AllocationFlags; + PIO_STATUS_BLOCK UserIosb; + PKEVENT UserEvent; + union { + struct { + PIO_APC_ROUTINE UserApcRoutine; + PVOID UserApcContext; + } AsynchronousParameters; + LARGE_INTEGER AllocationSize; + } Overlay; + PDRIVER_CANCEL CancelRoutine; + PVOID UserBuffer; + union { + struct { + _ANONYMOUS_UNION union { + KDEVICE_QUEUE_ENTRY DeviceQueueEntry; + _ANONYMOUS_STRUCT struct { + PVOID DriverContext[4]; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + PETHREAD Thread; + PCHAR AuxiliaryBuffer; + _ANONYMOUS_STRUCT struct { + LIST_ENTRY ListEntry; + _ANONYMOUS_UNION union { + struct _IO_STACK_LOCATION *CurrentStackLocation; + ULONG PacketType; + } DUMMYUNIONNAME; + } DUMMYSTRUCTNAME; + struct _FILE_OBJECT *OriginalFileObject; + } Overlay; + KAPC Apc; + PVOID CompletionKey; + } Tail; +} IRP; +typedef struct _IRP *PIRP; + +/* IRP.Flags */ + +#define SL_FORCE_ACCESS_CHECK 0x01 +#define SL_OPEN_PAGING_FILE 0x02 +#define SL_OPEN_TARGET_DIRECTORY 0x04 +#define SL_CASE_SENSITIVE 0x80 + +#define SL_KEY_SPECIFIED 0x01 +#define SL_OVERRIDE_VERIFY_VOLUME 0x02 +#define SL_WRITE_THROUGH 0x04 +#define SL_FT_SEQUENTIAL_WRITE 0x08 + +#define SL_FAIL_IMMEDIATELY 0x01 +#define SL_EXCLUSIVE_LOCK 0x02 + +#define SL_RESTART_SCAN 0x01 +#define SL_RETURN_SINGLE_ENTRY 0x02 +#define SL_INDEX_SPECIFIED 0x04 + +#define SL_WATCH_TREE 0x01 + +#define SL_ALLOW_RAW_MOUNT 0x01 + +#define CTL_CODE(DeviceType, Function, Method, Access)( \ + ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method)) + +#define DEVICE_TYPE_FROM_CTL_CODE(ctl) (((ULONG) (ctl & 0xffff0000)) >> 16) + +enum +{ + IRP_NOCACHE = 0x1, + IRP_PAGING_IO = 0x2, + IRP_MOUNT_COMPLETION = 0x2, + IRP_SYNCHRONOUS_API = 0x4, + IRP_ASSOCIATED_IRP = 0x8, + IRP_BUFFERED_IO = 0x10, + IRP_DEALLOCATE_BUFFER = 0x20, + IRP_INPUT_OPERATION = 0x40, + IRP_SYNCHRONOUS_PAGING_IO = 0x40, + IRP_CREATE_OPERATION = 0x80, + IRP_READ_OPERATION = 0x100, + IRP_WRITE_OPERATION = 0x200, + IRP_CLOSE_OPERATION = 0x400, + IRP_DEFER_IO_COMPLETION = 0x800, + IRP_OB_QUERY_NAME = 0x1000, + IRP_HOLD_DEVICE_QUEUE = 0x2000, + IRP_RETRY_IO_COMPLETION = 0x4000 +}; + +#define IRP_QUOTA_CHARGED 0x01 +#define IRP_ALLOCATED_MUST_SUCCEED 0x02 +#define IRP_ALLOCATED_FIXED_SIZE 0x04 +#define IRP_LOOKASIDE_ALLOCATION 0x08 + +typedef struct _BOOTDISK_INFORMATION { + LONGLONG BootPartitionOffset; + LONGLONG SystemPartitionOffset; + ULONG BootDeviceSignature; + ULONG SystemDeviceSignature; +} BOOTDISK_INFORMATION, *PBOOTDISK_INFORMATION; + +typedef struct _BOOTDISK_INFORMATION_EX { + LONGLONG BootPartitionOffset; + LONGLONG SystemPartitionOffset; + ULONG BootDeviceSignature; + ULONG SystemDeviceSignature; + GUID BootDeviceGuid; + GUID SystemDeviceGuid; + BOOLEAN BootDeviceIsGpt; + BOOLEAN SystemDeviceIsGpt; +} BOOTDISK_INFORMATION_EX, *PBOOTDISK_INFORMATION_EX; + +typedef struct _EISA_MEMORY_TYPE { + UCHAR ReadWrite : 1; + UCHAR Cached : 1; + UCHAR Reserved0 : 1; + UCHAR Type : 2; + UCHAR Shared : 1; + UCHAR Reserved1 : 1; + UCHAR MoreEntries : 1; +} EISA_MEMORY_TYPE, *PEISA_MEMORY_TYPE; + +#include +typedef struct _EISA_MEMORY_CONFIGURATION { + EISA_MEMORY_TYPE ConfigurationByte; + UCHAR DataSize; + USHORT AddressLowWord; + UCHAR AddressHighByte; + USHORT MemorySize; +} EISA_MEMORY_CONFIGURATION, *PEISA_MEMORY_CONFIGURATION; +#include + +typedef struct _EISA_IRQ_DESCRIPTOR { + UCHAR Interrupt : 4; + UCHAR Reserved : 1; + UCHAR LevelTriggered : 1; + UCHAR Shared : 1; + UCHAR MoreEntries : 1; +} EISA_IRQ_DESCRIPTOR, *PEISA_IRQ_DESCRIPTOR; + +typedef struct _EISA_IRQ_CONFIGURATION { + EISA_IRQ_DESCRIPTOR ConfigurationByte; + UCHAR Reserved; +} EISA_IRQ_CONFIGURATION, *PEISA_IRQ_CONFIGURATION; + +typedef struct _DMA_CONFIGURATION_BYTE0 { + UCHAR Channel : 3; + UCHAR Reserved : 3; + UCHAR Shared : 1; + UCHAR MoreEntries : 1; +} DMA_CONFIGURATION_BYTE0; + +typedef struct _DMA_CONFIGURATION_BYTE1 { + UCHAR Reserved0 : 2; + UCHAR TransferSize : 2; + UCHAR Timing : 2; + UCHAR Reserved1 : 2; +} DMA_CONFIGURATION_BYTE1; + +typedef struct _EISA_DMA_CONFIGURATION { + DMA_CONFIGURATION_BYTE0 ConfigurationByte0; + DMA_CONFIGURATION_BYTE1 ConfigurationByte1; +} EISA_DMA_CONFIGURATION, *PEISA_DMA_CONFIGURATION; + +#include +typedef struct _EISA_PORT_DESCRIPTOR { + UCHAR NumberPorts : 5; + UCHAR Reserved : 1; + UCHAR Shared : 1; + UCHAR MoreEntries : 1; +} EISA_PORT_DESCRIPTOR, *PEISA_PORT_DESCRIPTOR; + +typedef struct _EISA_PORT_CONFIGURATION { + EISA_PORT_DESCRIPTOR Configuration; + USHORT PortAddress; +} EISA_PORT_CONFIGURATION, *PEISA_PORT_CONFIGURATION; +#include + +typedef struct _CM_EISA_FUNCTION_INFORMATION { + ULONG CompressedId; + UCHAR IdSlotFlags1; + UCHAR IdSlotFlags2; + UCHAR MinorRevision; + UCHAR MajorRevision; + UCHAR Selections[26]; + UCHAR FunctionFlags; + UCHAR TypeString[80]; + EISA_MEMORY_CONFIGURATION EisaMemory[9]; + EISA_IRQ_CONFIGURATION EisaIrq[7]; + EISA_DMA_CONFIGURATION EisaDma[4]; + EISA_PORT_CONFIGURATION EisaPort[20]; + UCHAR InitializationData[60]; +} CM_EISA_FUNCTION_INFORMATION, *PCM_EISA_FUNCTION_INFORMATION; + +/* CM_EISA_FUNCTION_INFORMATION.FunctionFlags */ + +#define EISA_FUNCTION_ENABLED 0x80 +#define EISA_FREE_FORM_DATA 0x40 +#define EISA_HAS_PORT_INIT_ENTRY 0x20 +#define EISA_HAS_PORT_RANGE 0x10 +#define EISA_HAS_DMA_ENTRY 0x08 +#define EISA_HAS_IRQ_ENTRY 0x04 +#define EISA_HAS_MEMORY_ENTRY 0x02 +#define EISA_HAS_TYPE_ENTRY 0x01 +#define EISA_HAS_INFORMATION \ + (EISA_HAS_PORT_RANGE + EISA_HAS_DMA_ENTRY + EISA_HAS_IRQ_ENTRY \ + + EISA_HAS_MEMORY_ENTRY + EISA_HAS_TYPE_ENTRY) + +typedef struct _CM_EISA_SLOT_INFORMATION { + UCHAR ReturnCode; + UCHAR ReturnFlags; + UCHAR MajorRevision; + UCHAR MinorRevision; + USHORT Checksum; + UCHAR NumberFunctions; + UCHAR FunctionInformation; + ULONG CompressedId; +} CM_EISA_SLOT_INFORMATION, *PCM_EISA_SLOT_INFORMATION; + +/* CM_EISA_SLOT_INFORMATION.ReturnCode */ + +#define EISA_INVALID_SLOT 0x80 +#define EISA_INVALID_FUNCTION 0x81 +#define EISA_INVALID_CONFIGURATION 0x82 +#define EISA_EMPTY_SLOT 0x83 +#define EISA_INVALID_BIOS_CALL 0x86 + +typedef struct _CM_FLOPPY_DEVICE_DATA { + USHORT Version; + USHORT Revision; + CHAR Size[8]; + ULONG MaxDensity; + ULONG MountDensity; + UCHAR StepRateHeadUnloadTime; + UCHAR HeadLoadTime; + UCHAR MotorOffTime; + UCHAR SectorLengthCode; + UCHAR SectorPerTrack; + UCHAR ReadWriteGapLength; + UCHAR DataTransferLength; + UCHAR FormatGapLength; + UCHAR FormatFillCharacter; + UCHAR HeadSettleTime; + UCHAR MotorSettleTime; + UCHAR MaximumTrackValue; + UCHAR DataTransferRate; +} CM_FLOPPY_DEVICE_DATA, *PCM_FLOPPY_DEVICE_DATA; + +typedef enum _INTERFACE_TYPE { + InterfaceTypeUndefined = -1, + Internal, + Isa, + Eisa, + MicroChannel, + TurboChannel, + PCIBus, + VMEBus, + NuBus, + PCMCIABus, + CBus, + MPIBus, + MPSABus, + ProcessorInternal, + InternalPowerBus, + PNPISABus, + PNPBus, + MaximumInterfaceType +} INTERFACE_TYPE, *PINTERFACE_TYPE; + +typedef struct _PNP_BUS_INFORMATION { + GUID BusTypeGuid; + INTERFACE_TYPE LegacyBusType; + ULONG BusNumber; +} PNP_BUS_INFORMATION, *PPNP_BUS_INFORMATION; + +#include +typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR { + UCHAR Type; + UCHAR ShareDisposition; + USHORT Flags; + union { + struct { + PHYSICAL_ADDRESS Start; + ULONG Length; + } Generic; + struct { + PHYSICAL_ADDRESS Start; + ULONG Length; + } Port; + struct { + ULONG Level; + ULONG Vector; + ULONG Affinity; + } Interrupt; + struct { + PHYSICAL_ADDRESS Start; + ULONG Length; + } Memory; + struct { + ULONG Channel; + ULONG Port; + ULONG Reserved1; + } Dma; + struct { + ULONG Data[3]; + } DevicePrivate; + struct { + ULONG Start; + ULONG Length; + ULONG Reserved; + } BusNumber; + struct { + ULONG DataSize; + ULONG Reserved1; + ULONG Reserved2; + } DeviceSpecificData; + } u; +} CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR; + +/* CM_PARTIAL_RESOURCE_DESCRIPTOR.Type */ + +#define CmResourceTypeNull 0 +#define CmResourceTypePort 1 +#define CmResourceTypeInterrupt 2 +#define CmResourceTypeMemory 3 +#define CmResourceTypeDma 4 +#define CmResourceTypeDeviceSpecific 5 +#define CmResourceTypeBusNumber 6 +#define CmResourceTypeMaximum 7 +#define CmResourceTypeNonArbitrated 128 +#define CmResourceTypeConfigData 128 +#define CmResourceTypeDevicePrivate 129 +#define CmResourceTypePcCardConfig 130 +#define CmResourceTypeMfCardConfig 131 + +/* CM_PARTIAL_RESOURCE_DESCRIPTOR.ShareDisposition */ + +typedef enum _CM_SHARE_DISPOSITION { + CmResourceShareUndetermined, + CmResourceShareDeviceExclusive, + CmResourceShareDriverExclusive, + CmResourceShareShared +} CM_SHARE_DISPOSITION; + +/* CM_PARTIAL_RESOURCE_DESCRIPTOR.Flags if Type = CmResourceTypePort */ + +#define CM_RESOURCE_PORT_MEMORY 0x0000 +#define CM_RESOURCE_PORT_IO 0x0001 +#define CM_RESOURCE_PORT_10_BIT_DECODE 0x0004 +#define CM_RESOURCE_PORT_12_BIT_DECODE 0x0008 +#define CM_RESOURCE_PORT_16_BIT_DECODE 0x0010 +#define CM_RESOURCE_PORT_POSITIVE_DECODE 0x0020 +#define CM_RESOURCE_PORT_PASSIVE_DECODE 0x0040 +#define CM_RESOURCE_PORT_WINDOW_DECODE 0x0080 + +/* CM_PARTIAL_RESOURCE_DESCRIPTOR.Flags if Type = CmResourceTypeInterrupt */ + +#define CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE 0x0000 +#define CM_RESOURCE_INTERRUPT_LATCHED 0x0001 + +/* CM_PARTIAL_RESOURCE_DESCRIPTOR.Flags if Type = CmResourceTypeMemory */ + +#define CM_RESOURCE_MEMORY_READ_WRITE 0x0000 +#define CM_RESOURCE_MEMORY_READ_ONLY 0x0001 +#define CM_RESOURCE_MEMORY_WRITE_ONLY 0x0002 +#define CM_RESOURCE_MEMORY_PREFETCHABLE 0x0004 +#define CM_RESOURCE_MEMORY_COMBINEDWRITE 0x0008 +#define CM_RESOURCE_MEMORY_24 0x0010 +#define CM_RESOURCE_MEMORY_CACHEABLE 0x0020 + +/* CM_PARTIAL_RESOURCE_DESCRIPTOR.Flags if Type = CmResourceTypeDma */ + +#define CM_RESOURCE_DMA_8 0x0000 +#define CM_RESOURCE_DMA_16 0x0001 +#define CM_RESOURCE_DMA_32 0x0002 +#define CM_RESOURCE_DMA_8_AND_16 0x0004 +#define CM_RESOURCE_DMA_BUS_MASTER 0x0008 +#define CM_RESOURCE_DMA_TYPE_A 0x0010 +#define CM_RESOURCE_DMA_TYPE_B 0x0020 +#define CM_RESOURCE_DMA_TYPE_F 0x0040 + +typedef struct _CM_PARTIAL_RESOURCE_LIST { + USHORT Version; + USHORT Revision; + ULONG Count; + CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]; +} CM_PARTIAL_RESOURCE_LIST, *PCM_PARTIAL_RESOURCE_LIST; + +typedef struct _CM_FULL_RESOURCE_DESCRIPTOR { + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + CM_PARTIAL_RESOURCE_LIST PartialResourceList; +} CM_FULL_RESOURCE_DESCRIPTOR, *PCM_FULL_RESOURCE_DESCRIPTOR; + +typedef struct _CM_RESOURCE_LIST { + ULONG Count; + CM_FULL_RESOURCE_DESCRIPTOR List[1]; +} CM_RESOURCE_LIST, *PCM_RESOURCE_LIST; + +typedef struct _CM_INT13_DRIVE_PARAMETER { + USHORT DriveSelect; + ULONG MaxCylinders; + USHORT SectorsPerTrack; + USHORT MaxHeads; + USHORT NumberDrives; +} CM_INT13_DRIVE_PARAMETER, *PCM_INT13_DRIVE_PARAMETER; +#include + +typedef struct _CM_KEYBOARD_DEVICE_DATA { + USHORT Version; + USHORT Revision; + UCHAR Type; + UCHAR Subtype; + USHORT KeyboardFlags; +} CM_KEYBOARD_DEVICE_DATA, *PCM_KEYBOARD_DEVICE_DATA; + +#define KEYBOARD_INSERT_ON 0x08 +#define KEYBOARD_CAPS_LOCK_ON 0x04 +#define KEYBOARD_NUM_LOCK_ON 0x02 +#define KEYBOARD_SCROLL_LOCK_ON 0x01 +#define KEYBOARD_ALT_KEY_DOWN 0x80 +#define KEYBOARD_CTRL_KEY_DOWN 0x40 +#define KEYBOARD_LEFT_SHIFT_DOWN 0x20 +#define KEYBOARD_RIGHT_SHIFT_DOWN 0x10 + +typedef struct _CM_MCA_POS_DATA { + USHORT AdapterId; + UCHAR PosData1; + UCHAR PosData2; + UCHAR PosData3; + UCHAR PosData4; +} CM_MCA_POS_DATA, *PCM_MCA_POS_DATA; + +typedef struct CM_Power_Data_s { + ULONG PD_Size; + DEVICE_POWER_STATE PD_MostRecentPowerState; + ULONG PD_Capabilities; + ULONG PD_D1Latency; + ULONG PD_D2Latency; + ULONG PD_D3Latency; + DEVICE_POWER_STATE PD_PowerStateMapping[PowerSystemMaximum]; +} CM_POWER_DATA, *PCM_POWER_DATA; + +#define PDCAP_D0_SUPPORTED 0x00000001 +#define PDCAP_D1_SUPPORTED 0x00000002 +#define PDCAP_D2_SUPPORTED 0x00000004 +#define PDCAP_D3_SUPPORTED 0x00000008 +#define PDCAP_WAKE_FROM_D0_SUPPORTED 0x00000010 +#define PDCAP_WAKE_FROM_D1_SUPPORTED 0x00000020 +#define PDCAP_WAKE_FROM_D2_SUPPORTED 0x00000040 +#define PDCAP_WAKE_FROM_D3_SUPPORTED 0x00000080 +#define PDCAP_WARM_EJECT_SUPPORTED 0x00000100 + +typedef struct _CM_SCSI_DEVICE_DATA { + USHORT Version; + USHORT Revision; + UCHAR HostIdentifier; +} CM_SCSI_DEVICE_DATA, *PCM_SCSI_DEVICE_DATA; + +typedef struct _CM_SERIAL_DEVICE_DATA { + USHORT Version; + USHORT Revision; + ULONG BaudClock; +} CM_SERIAL_DEVICE_DATA, *PCM_SERIAL_DEVICE_DATA; + +typedef struct _VM_COUNTERS +{ + SIZE_T PeakVirtualSize; + SIZE_T VirtualSize; + ULONG PageFaultCount; + SIZE_T PeakWorkingSetSize; + SIZE_T WorkingSetSize; + SIZE_T QuotaPeakPagedPoolUsage; + SIZE_T QuotaPagedPoolUsage; + SIZE_T QuotaPeakNonPagedPoolUsage; + SIZE_T QuotaNonPagedPoolUsage; + SIZE_T PagefileUsage; + SIZE_T PeakPagefileUsage; +} VM_COUNTERS, *PVM_COUNTERS; + +typedef struct _VM_COUNTERS_EX +{ + SIZE_T PeakVirtualSize; + SIZE_T VirtualSize; + ULONG PageFaultCount; + SIZE_T PeakWorkingSetSize; + SIZE_T WorkingSetSize; + SIZE_T QuotaPeakPagedPoolUsage; + SIZE_T QuotaPagedPoolUsage; + SIZE_T QuotaPeakNonPagedPoolUsage; + SIZE_T QuotaNonPagedPoolUsage; + SIZE_T PagefileUsage; + SIZE_T PeakPagefileUsage; + SIZE_T PrivateUsage; +} VM_COUNTERS_EX, *PVM_COUNTERS_EX; + +typedef struct _POOLED_USAGE_AND_LIMITS +{ + SIZE_T PeakPagedPoolUsage; + SIZE_T PagedPoolUsage; + SIZE_T PagedPoolLimit; + SIZE_T PeakNonPagedPoolUsage; + SIZE_T NonPagedPoolUsage; + SIZE_T NonPagedPoolLimit; + SIZE_T PeakPagefileUsage; + SIZE_T PagefileUsage; + SIZE_T PagefileLimit; +} POOLED_USAGE_AND_LIMITS, *PPOOLED_USAGE_AND_LIMITS; + +/* IO_RESOURCE_DESCRIPTOR.Option */ + +#define IO_RESOURCE_PREFERRED 0x01 +#define IO_RESOURCE_DEFAULT 0x02 +#define IO_RESOURCE_ALTERNATIVE 0x08 + +typedef struct _IO_RESOURCE_DESCRIPTOR { + UCHAR Option; + UCHAR Type; + UCHAR ShareDisposition; + UCHAR Spare1; + USHORT Flags; + USHORT Spare2; + union { + struct { + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; + } Port; + struct { + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; + } Memory; + struct { + ULONG MinimumVector; + ULONG MaximumVector; + } Interrupt; + struct { + ULONG MinimumChannel; + ULONG MaximumChannel; + } Dma; + struct { + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; + } Generic; + struct { + ULONG Data[3]; + } DevicePrivate; + struct { + ULONG Length; + ULONG MinBusNumber; + ULONG MaxBusNumber; + ULONG Reserved; + } BusNumber; + struct { + ULONG Priority; + ULONG Reserved1; + ULONG Reserved2; + } ConfigData; + } u; +} IO_RESOURCE_DESCRIPTOR, *PIO_RESOURCE_DESCRIPTOR; + +typedef struct _IO_RESOURCE_LIST { + USHORT Version; + USHORT Revision; + ULONG Count; + IO_RESOURCE_DESCRIPTOR Descriptors[1]; +} IO_RESOURCE_LIST, *PIO_RESOURCE_LIST; + +typedef struct _IO_RESOURCE_REQUIREMENTS_LIST { + ULONG ListSize; + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + ULONG SlotNumber; + ULONG Reserved[3]; + ULONG AlternativeLists; + IO_RESOURCE_LIST List[1]; +} IO_RESOURCE_REQUIREMENTS_LIST, *PIO_RESOURCE_REQUIREMENTS_LIST; + +typedef struct _IO_ERROR_LOG_PACKET { + UCHAR MajorFunctionCode; + UCHAR RetryCount; + USHORT DumpDataSize; + USHORT NumberOfStrings; + USHORT StringOffset; + USHORT EventCategory; + NTSTATUS ErrorCode; + ULONG UniqueErrorValue; + NTSTATUS FinalStatus; + ULONG SequenceNumber; + ULONG IoControlCode; + LARGE_INTEGER DeviceOffset; + ULONG DumpData[1]; +} IO_ERROR_LOG_PACKET, *PIO_ERROR_LOG_PACKET; + +typedef struct _IO_ERROR_LOG_MESSAGE { + USHORT Type; + USHORT Size; + USHORT DriverNameLength; + LARGE_INTEGER TimeStamp; + ULONG DriverNameOffset; + IO_ERROR_LOG_PACKET EntryData; +} IO_ERROR_LOG_MESSAGE, *PIO_ERROR_LOG_MESSAGE; + +#define ERROR_LOG_LIMIT_SIZE 240 +#define IO_ERROR_LOG_MESSAGE_HEADER_LENGTH (sizeof(IO_ERROR_LOG_MESSAGE) - \ + sizeof(IO_ERROR_LOG_PACKET) + \ + (sizeof(WCHAR) * 40)) + +typedef struct _CONTROLLER_OBJECT { + CSHORT Type; + CSHORT Size; + PVOID ControllerExtension; + KDEVICE_QUEUE DeviceWaitQueue; + ULONG Spare1; + LARGE_INTEGER Spare2; +} CONTROLLER_OBJECT, *PCONTROLLER_OBJECT; + +typedef enum _DMA_WIDTH { + Width8Bits, + Width16Bits, + Width32Bits, + MaximumDmaWidth +} DMA_WIDTH, *PDMA_WIDTH; + +typedef enum _DMA_SPEED { + Compatible, + TypeA, + TypeB, + TypeC, + TypeF, + MaximumDmaSpeed +} DMA_SPEED, *PDMA_SPEED; + +/* DEVICE_DESCRIPTION.Version */ + +#define DEVICE_DESCRIPTION_VERSION 0x0000 +#define DEVICE_DESCRIPTION_VERSION1 0x0001 +#define DEVICE_DESCRIPTION_VERSION2 0x0002 + +typedef struct _DEVICE_DESCRIPTION { + ULONG Version; + BOOLEAN Master; + BOOLEAN ScatterGather; + BOOLEAN DemandMode; + BOOLEAN AutoInitialize; + BOOLEAN Dma32BitAddresses; + BOOLEAN IgnoreCount; + BOOLEAN Reserved1; + BOOLEAN Dma64BitAddresses; + ULONG BusNumber; + ULONG DmaChannel; + INTERFACE_TYPE InterfaceType; + DMA_WIDTH DmaWidth; + DMA_SPEED DmaSpeed; + ULONG MaximumLength; + ULONG DmaPort; +} DEVICE_DESCRIPTION, *PDEVICE_DESCRIPTION; + +/* VPB.Flags */ +#define VPB_MOUNTED 0x0001 +#define VPB_LOCKED 0x0002 +#define VPB_PERSISTENT 0x0004 +#define VPB_REMOVE_PENDING 0x0008 +#define VPB_RAW_MOUNT 0x0010 + +#define MAXIMUM_VOLUME_LABEL_LENGTH (32 * sizeof(WCHAR)) + +typedef struct _VPB { + CSHORT Type; + CSHORT Size; + USHORT Flags; + USHORT VolumeLabelLength; + struct _DEVICE_OBJECT *DeviceObject; + struct _DEVICE_OBJECT *RealDevice; + ULONG SerialNumber; + ULONG ReferenceCount; + WCHAR VolumeLabel[MAXIMUM_VOLUME_LABEL_LENGTH / sizeof(WCHAR)]; +} VPB, *PVPB; + +/* DEVICE_OBJECT.Flags */ + +#define DO_VERIFY_VOLUME 0x00000002 +#define DO_BUFFERED_IO 0x00000004 +#define DO_EXCLUSIVE 0x00000008 +#define DO_DIRECT_IO 0x00000010 +#define DO_MAP_IO_BUFFER 0x00000020 +#define DO_DEVICE_HAS_NAME 0x00000040 +#define DO_DEVICE_INITIALIZING 0x00000080 +#define DO_SYSTEM_BOOT_PARTITION 0x00000100 +#define DO_LONG_TERM_REQUESTS 0x00000200 +#define DO_NEVER_LAST_DEVICE 0x00000400 +#define DO_SHUTDOWN_REGISTERED 0x00000800 +#define DO_BUS_ENUMERATED_DEVICE 0x00001000 +#define DO_POWER_PAGABLE 0x00002000 +#define DO_POWER_INRUSH 0x00004000 +#define DO_LOW_PRIORITY_FILESYSTEM 0x00010000 + +/* DEVICE_OBJECT.Characteristics */ + +#define FILE_REMOVABLE_MEDIA 0x00000001 +#define FILE_READ_ONLY_DEVICE 0x00000002 +#define FILE_FLOPPY_DISKETTE 0x00000004 +#define FILE_WRITE_ONCE_MEDIA 0x00000008 +#define FILE_REMOTE_DEVICE 0x00000010 +#define FILE_DEVICE_IS_MOUNTED 0x00000020 +#define FILE_VIRTUAL_VOLUME 0x00000040 +#define FILE_AUTOGENERATED_DEVICE_NAME 0x00000080 +#define FILE_DEVICE_SECURE_OPEN 0x00000100 + +/* DEVICE_OBJECT.AlignmentRequirement */ + +#define FILE_BYTE_ALIGNMENT 0x00000000 +#define FILE_WORD_ALIGNMENT 0x00000001 +#define FILE_LONG_ALIGNMENT 0x00000003 +#define FILE_QUAD_ALIGNMENT 0x00000007 +#define FILE_OCTA_ALIGNMENT 0x0000000f +#define FILE_32_BYTE_ALIGNMENT 0x0000001f +#define FILE_64_BYTE_ALIGNMENT 0x0000003f +#define FILE_128_BYTE_ALIGNMENT 0x0000007f +#define FILE_256_BYTE_ALIGNMENT 0x000000ff +#define FILE_512_BYTE_ALIGNMENT 0x000001ff + +/* DEVICE_OBJECT.DeviceType */ + +#define DEVICE_TYPE ULONG + +#define FILE_DEVICE_BEEP 0x00000001 +#define FILE_DEVICE_CD_ROM 0x00000002 +#define FILE_DEVICE_CD_ROM_FILE_SYSTEM 0x00000003 +#define FILE_DEVICE_CONTROLLER 0x00000004 +#define FILE_DEVICE_DATALINK 0x00000005 +#define FILE_DEVICE_DFS 0x00000006 +#define FILE_DEVICE_DISK 0x00000007 +#define FILE_DEVICE_DISK_FILE_SYSTEM 0x00000008 +#define FILE_DEVICE_FILE_SYSTEM 0x00000009 +#define FILE_DEVICE_INPORT_PORT 0x0000000a +#define FILE_DEVICE_KEYBOARD 0x0000000b +#define FILE_DEVICE_MAILSLOT 0x0000000c +#define FILE_DEVICE_MIDI_IN 0x0000000d +#define FILE_DEVICE_MIDI_OUT 0x0000000e +#define FILE_DEVICE_MOUSE 0x0000000f +#define FILE_DEVICE_MULTI_UNC_PROVIDER 0x00000010 +#define FILE_DEVICE_NAMED_PIPE 0x00000011 +#define FILE_DEVICE_NETWORK 0x00000012 +#define FILE_DEVICE_NETWORK_BROWSER 0x00000013 +#define FILE_DEVICE_NETWORK_FILE_SYSTEM 0x00000014 +#define FILE_DEVICE_NULL 0x00000015 +#define FILE_DEVICE_PARALLEL_PORT 0x00000016 +#define FILE_DEVICE_PHYSICAL_NETCARD 0x00000017 +#define FILE_DEVICE_PRINTER 0x00000018 +#define FILE_DEVICE_SCANNER 0x00000019 +#define FILE_DEVICE_SERIAL_MOUSE_PORT 0x0000001a +#define FILE_DEVICE_SERIAL_PORT 0x0000001b +#define FILE_DEVICE_SCREEN 0x0000001c +#define FILE_DEVICE_SOUND 0x0000001d +#define FILE_DEVICE_STREAMS 0x0000001e +#define FILE_DEVICE_TAPE 0x0000001f +#define FILE_DEVICE_TAPE_FILE_SYSTEM 0x00000020 +#define FILE_DEVICE_TRANSPORT 0x00000021 +#define FILE_DEVICE_UNKNOWN 0x00000022 +#define FILE_DEVICE_VIDEO 0x00000023 +#define FILE_DEVICE_VIRTUAL_DISK 0x00000024 +#define FILE_DEVICE_WAVE_IN 0x00000025 +#define FILE_DEVICE_WAVE_OUT 0x00000026 +#define FILE_DEVICE_8042_PORT 0x00000027 +#define FILE_DEVICE_NETWORK_REDIRECTOR 0x00000028 +#define FILE_DEVICE_BATTERY 0x00000029 +#define FILE_DEVICE_BUS_EXTENDER 0x0000002a +#define FILE_DEVICE_MODEM 0x0000002b +#define FILE_DEVICE_VDM 0x0000002c +#define FILE_DEVICE_MASS_STORAGE 0x0000002d +#define FILE_DEVICE_SMB 0x0000002e +#define FILE_DEVICE_KS 0x0000002f +#define FILE_DEVICE_CHANGER 0x00000030 +#define FILE_DEVICE_SMARTCARD 0x00000031 +#define FILE_DEVICE_ACPI 0x00000032 +#define FILE_DEVICE_DVD 0x00000033 +#define FILE_DEVICE_FULLSCREEN_VIDEO 0x00000034 +#define FILE_DEVICE_DFS_FILE_SYSTEM 0x00000035 +#define FILE_DEVICE_DFS_VOLUME 0x00000036 +#define FILE_DEVICE_SERENUM 0x00000037 +#define FILE_DEVICE_TERMSRV 0x00000038 +#define FILE_DEVICE_KSEC 0x00000039 +#define FILE_DEVICE_FIPS 0x0000003a + +typedef struct _DEVICE_OBJECT { + CSHORT Type; + USHORT Size; + LONG ReferenceCount; + struct _DRIVER_OBJECT *DriverObject; + struct _DEVICE_OBJECT *NextDevice; + struct _DEVICE_OBJECT *AttachedDevice; + struct _IRP *CurrentIrp; + PIO_TIMER Timer; + ULONG Flags; + ULONG Characteristics; + PVPB Vpb; + PVOID DeviceExtension; + DEVICE_TYPE DeviceType; + CCHAR StackSize; + union { + LIST_ENTRY ListEntry; + WAIT_CONTEXT_BLOCK Wcb; + } Queue; + ULONG AlignmentRequirement; + KDEVICE_QUEUE DeviceQueue; + KDPC Dpc; + ULONG ActiveThreadCount; + PSECURITY_DESCRIPTOR SecurityDescriptor; + KEVENT DeviceLock; + USHORT SectorSize; + USHORT Spare1; + struct _DEVOBJ_EXTENSION *DeviceObjectExtension; + PVOID Reserved; +} DEVICE_OBJECT, *PDEVICE_OBJECT; + +typedef enum _DEVICE_RELATION_TYPE { + BusRelations, + EjectionRelations, + PowerRelations, + RemovalRelations, + TargetDeviceRelation, + SingleBusRelations +} DEVICE_RELATION_TYPE, *PDEVICE_RELATION_TYPE; + +typedef struct _DEVICE_RELATIONS { + ULONG Count; + PDEVICE_OBJECT Objects[1]; +} DEVICE_RELATIONS, *PDEVICE_RELATIONS; + +typedef struct _SCATTER_GATHER_ELEMENT { + PHYSICAL_ADDRESS Address; + ULONG Length; + ULONG_PTR Reserved; +} SCATTER_GATHER_ELEMENT, *PSCATTER_GATHER_ELEMENT; + +typedef struct _SCATTER_GATHER_LIST { + ULONG NumberOfElements; + ULONG_PTR Reserved; + SCATTER_GATHER_ELEMENT Elements[0]; +} SCATTER_GATHER_LIST, *PSCATTER_GATHER_LIST; + +typedef struct _MDL { + struct _MDL *Next; + CSHORT Size; + CSHORT MdlFlags; + struct _EPROCESS *Process; + PVOID MappedSystemVa; + PVOID StartVa; + ULONG ByteCount; + ULONG ByteOffset; +} MDL, *PMDL; + +#define MDL_MAPPED_TO_SYSTEM_VA 0x0001 +#define MDL_PAGES_LOCKED 0x0002 +#define MDL_SOURCE_IS_NONPAGED_POOL 0x0004 +#define MDL_ALLOCATED_FIXED_SIZE 0x0008 +#define MDL_PARTIAL 0x0010 +#define MDL_PARTIAL_HAS_BEEN_MAPPED 0x0020 +#define MDL_IO_PAGE_READ 0x0040 +#define MDL_WRITE_OPERATION 0x0080 +#define MDL_PARENT_MAPPED_SYSTEM_VA 0x0100 +#define MDL_FREE_EXTRA_PTES 0x0200 +#define MDL_IO_SPACE 0x0800 +#define MDL_NETWORK_HEADER 0x1000 +#define MDL_MAPPING_CAN_FAIL 0x2000 +#define MDL_ALLOCATED_MUST_SUCCEED 0x4000 + +#define MDL_MAPPING_FLAGS ( \ + MDL_MAPPED_TO_SYSTEM_VA | \ + MDL_PAGES_LOCKED | \ + MDL_SOURCE_IS_NONPAGED_POOL | \ + MDL_PARTIAL_HAS_BEEN_MAPPED | \ + MDL_PARENT_MAPPED_SYSTEM_VA | \ + MDL_SYSTEM_VA | \ + MDL_IO_SPACE) + +typedef VOID +(DDKAPI *PPUT_DMA_ADAPTER)( + IN PDMA_ADAPTER DmaAdapter); + +typedef PVOID +(DDKAPI *PALLOCATE_COMMON_BUFFER)( + IN PDMA_ADAPTER DmaAdapter, + IN ULONG Length, + OUT PPHYSICAL_ADDRESS LogicalAddress, + IN BOOLEAN CacheEnabled); + +typedef VOID +(DDKAPI *PFREE_COMMON_BUFFER)( + IN PDMA_ADAPTER DmaAdapter, + IN ULONG Length, + IN PHYSICAL_ADDRESS LogicalAddress, + IN PVOID VirtualAddress, + IN BOOLEAN CacheEnabled); + +typedef NTSTATUS +(DDKAPI *PALLOCATE_ADAPTER_CHANNEL)( + IN PDMA_ADAPTER DmaAdapter, + IN PDEVICE_OBJECT DeviceObject, + IN ULONG NumberOfMapRegisters, + IN PDRIVER_CONTROL ExecutionRoutine, + IN PVOID Context); + +typedef BOOLEAN +(DDKAPI *PFLUSH_ADAPTER_BUFFERS)( + IN PDMA_ADAPTER DmaAdapter, + IN PMDL Mdl, + IN PVOID MapRegisterBase, + IN PVOID CurrentVa, + IN ULONG Length, + IN BOOLEAN WriteToDevice); + +typedef VOID +(DDKAPI *PFREE_ADAPTER_CHANNEL)( + IN PDMA_ADAPTER DmaAdapter); + +typedef VOID +(DDKAPI *PFREE_MAP_REGISTERS)( + IN PDMA_ADAPTER DmaAdapter, + PVOID MapRegisterBase, + ULONG NumberOfMapRegisters); + +typedef PHYSICAL_ADDRESS +(DDKAPI *PMAP_TRANSFER)( + IN PDMA_ADAPTER DmaAdapter, + IN PMDL Mdl, + IN PVOID MapRegisterBase, + IN PVOID CurrentVa, + IN OUT PULONG Length, + IN BOOLEAN WriteToDevice); + +typedef ULONG +(DDKAPI *PGET_DMA_ALIGNMENT)( + IN PDMA_ADAPTER DmaAdapter); + +typedef ULONG +(DDKAPI *PREAD_DMA_COUNTER)( + IN PDMA_ADAPTER DmaAdapter); + +typedef NTSTATUS +(DDKAPI *PGET_SCATTER_GATHER_LIST)( + IN PDMA_ADAPTER DmaAdapter, + IN PDEVICE_OBJECT DeviceObject, + IN PMDL Mdl, + IN PVOID CurrentVa, + IN ULONG Length, + IN PDRIVER_LIST_CONTROL ExecutionRoutine, + IN PVOID Context, + IN BOOLEAN WriteToDevice); + +typedef VOID +(DDKAPI *PPUT_SCATTER_GATHER_LIST)( + IN PDMA_ADAPTER DmaAdapter, + IN PSCATTER_GATHER_LIST ScatterGather, + IN BOOLEAN WriteToDevice); + +typedef NTSTATUS +(DDKAPI *PCALCULATE_SCATTER_GATHER_LIST_SIZE)( + IN PDMA_ADAPTER DmaAdapter, + IN PMDL Mdl OPTIONAL, + IN PVOID CurrentVa, + IN ULONG Length, + OUT PULONG ScatterGatherListSize, + OUT PULONG pNumberOfMapRegisters OPTIONAL); + +typedef NTSTATUS +(DDKAPI *PBUILD_SCATTER_GATHER_LIST)( + IN PDMA_ADAPTER DmaAdapter, + IN PDEVICE_OBJECT DeviceObject, + IN PMDL Mdl, + IN PVOID CurrentVa, + IN ULONG Length, + IN PDRIVER_LIST_CONTROL ExecutionRoutine, + IN PVOID Context, + IN BOOLEAN WriteToDevice, + IN PVOID ScatterGatherBuffer, + IN ULONG ScatterGatherLength); + +typedef NTSTATUS +(DDKAPI *PBUILD_MDL_FROM_SCATTER_GATHER_LIST)( + IN PDMA_ADAPTER DmaAdapter, + IN PSCATTER_GATHER_LIST ScatterGather, + IN PMDL OriginalMdl, + OUT PMDL *TargetMdl); + +typedef struct _DMA_OPERATIONS { + ULONG Size; + PPUT_DMA_ADAPTER PutDmaAdapter; + PALLOCATE_COMMON_BUFFER AllocateCommonBuffer; + PFREE_COMMON_BUFFER FreeCommonBuffer; + PALLOCATE_ADAPTER_CHANNEL AllocateAdapterChannel; + PFLUSH_ADAPTER_BUFFERS FlushAdapterBuffers; + PFREE_ADAPTER_CHANNEL FreeAdapterChannel; + PFREE_MAP_REGISTERS FreeMapRegisters; + PMAP_TRANSFER MapTransfer; + PGET_DMA_ALIGNMENT GetDmaAlignment; + PREAD_DMA_COUNTER ReadDmaCounter; + PGET_SCATTER_GATHER_LIST GetScatterGatherList; + PPUT_SCATTER_GATHER_LIST PutScatterGatherList; + PCALCULATE_SCATTER_GATHER_LIST_SIZE CalculateScatterGatherList; + PBUILD_SCATTER_GATHER_LIST BuildScatterGatherList; + PBUILD_MDL_FROM_SCATTER_GATHER_LIST BuildMdlFromScatterGatherList; +} DMA_OPERATIONS, *PDMA_OPERATIONS; + +typedef struct _DMA_ADAPTER { + USHORT Version; + USHORT Size; + PDMA_OPERATIONS DmaOperations; +} DMA_ADAPTER; + + +typedef enum _ARBITER_REQUEST_SOURCE { + ArbiterRequestUndefined = -1, + ArbiterRequestLegacyReported, + ArbiterRequestHalReported, + ArbiterRequestLegacyAssigned, + ArbiterRequestPnpDetected, + ArbiterRequestPnpEnumerated +} ARBITER_REQUEST_SOURCE; + +typedef enum _ARBITER_RESULT { + ArbiterResultUndefined = -1, + ArbiterResultSuccess, + ArbiterResultExternalConflict, + ArbiterResultNullRequest +} ARBITER_RESULT; + +typedef enum _ARBITER_ACTION { + ArbiterActionTestAllocation, + ArbiterActionRetestAllocation, + ArbiterActionCommitAllocation, + ArbiterActionRollbackAllocation, + ArbiterActionQueryAllocatedResources, + ArbiterActionWriteReservedResources, + ArbiterActionQueryConflict, + ArbiterActionQueryArbitrate, + ArbiterActionAddReserved, + ArbiterActionBootAllocation +} ARBITER_ACTION, *PARBITER_ACTION; + +typedef struct _ARBITER_CONFLICT_INFO { + PDEVICE_OBJECT OwningObject; + ULONGLONG Start; + ULONGLONG End; +} ARBITER_CONFLICT_INFO, *PARBITER_CONFLICT_INFO; + +typedef struct _ARBITER_PARAMETERS { + union { + struct { + IN OUT PLIST_ENTRY ArbitrationList; + IN ULONG AllocateFromCount; + IN PCM_PARTIAL_RESOURCE_DESCRIPTOR AllocateFrom; + } TestAllocation; + + struct { + IN OUT PLIST_ENTRY ArbitrationList; + IN ULONG AllocateFromCount; + IN PCM_PARTIAL_RESOURCE_DESCRIPTOR AllocateFrom; + } RetestAllocation; + + struct { + IN OUT PLIST_ENTRY ArbitrationList; + } BootAllocation; + + struct { + OUT PCM_PARTIAL_RESOURCE_LIST *AllocatedResources; + } QueryAllocatedResources; + + struct { + IN PDEVICE_OBJECT PhysicalDeviceObject; + IN PIO_RESOURCE_DESCRIPTOR ConflictingResource; + OUT PULONG ConflictCount; + OUT PARBITER_CONFLICT_INFO *Conflicts; + } QueryConflict; + + struct { + IN PLIST_ENTRY ArbitrationList; + } QueryArbitrate; + + struct { + IN PDEVICE_OBJECT ReserveDevice; + } AddReserved; + } Parameters; +} ARBITER_PARAMETERS, *PARBITER_PARAMETERS; + +#define ARBITER_FLAG_BOOT_CONFIG 0x00000001 + +typedef struct _ARBITER_LIST_ENTRY { + LIST_ENTRY ListEntry; + ULONG AlternativeCount; + PIO_RESOURCE_DESCRIPTOR Alternatives; + PDEVICE_OBJECT PhysicalDeviceObject; + ARBITER_REQUEST_SOURCE RequestSource; + ULONG Flags; + LONG_PTR WorkSpace; + INTERFACE_TYPE InterfaceType; + ULONG SlotNumber; + ULONG BusNumber; + PCM_PARTIAL_RESOURCE_DESCRIPTOR Assignment; + PIO_RESOURCE_DESCRIPTOR SelectedAlternative; + ARBITER_RESULT Result; +} ARBITER_LIST_ENTRY, *PARBITER_LIST_ENTRY; + +typedef NTSTATUS +(DDKAPI *PARBITER_HANDLER)( + IN PVOID Context, + IN ARBITER_ACTION Action, + IN OUT PARBITER_PARAMETERS Parameters); + +#define ARBITER_PARTIAL 0x00000001 + +typedef struct _ARBITER_INTERFACE { + USHORT Size; + USHORT Version; + PVOID Context; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; + PARBITER_HANDLER ArbiterHandler; + ULONG Flags; +} ARBITER_INTERFACE, *PARBITER_INTERFACE; + +typedef enum _HAL_QUERY_INFORMATION_CLASS { + HalInstalledBusInformation, + HalProfileSourceInformation, + HalInformationClassUnused1, + HalPowerInformation, + HalProcessorSpeedInformation, + HalCallbackInformation, + HalMapRegisterInformation, + HalMcaLogInformation, + HalFrameBufferCachingInformation, + HalDisplayBiosInformation, + HalProcessorFeatureInformation, + HalNumaTopologyInterface, + HalErrorInformation, + HalCmcLogInformation, + HalCpeLogInformation, + HalQueryMcaInterface, + HalQueryAMLIIllegalIOPortAddresses, + HalQueryMaxHotPlugMemoryAddress, + HalPartitionIpiInterface, + HalPlatformInformation, + HalQueryProfileSourceList +} HAL_QUERY_INFORMATION_CLASS, *PHAL_QUERY_INFORMATION_CLASS; + +typedef enum _HAL_SET_INFORMATION_CLASS { + HalProfileSourceInterval, + HalProfileSourceInterruptHandler, + HalMcaRegisterDriver, + HalKernelErrorHandler, + HalCmcRegisterDriver, + HalCpeRegisterDriver, + HalMcaLog, + HalCmcLog, + HalCpeLog, + HalGenerateCmcInterrupt +} HAL_SET_INFORMATION_CLASS, *PHAL_SET_INFORMATION_CLASS; + +/* Function Type Defintions for Dispatch Functions */ + +typedef VOID +(DDKAPI *PDEVICE_CONTROL_COMPLETION)( + IN struct _DEVICE_CONTROL_CONTEXT *ControlContext); + +typedef struct _DEVICE_CONTROL_CONTEXT { + NTSTATUS Status; + PDEVICE_HANDLER_OBJECT DeviceHandler; + PDEVICE_OBJECT DeviceObject; + ULONG ControlCode; + PVOID Buffer; + PULONG BufferLength; + PVOID Context; +} DEVICE_CONTROL_CONTEXT, *PDEVICE_CONTROL_CONTEXT; + +typedef struct _PM_DISPATCH_TABLE { + ULONG Signature; + ULONG Version; + PVOID Function[1]; +} PM_DISPATCH_TABLE, *PPM_DISPATCH_TABLE; + +typedef enum _RESOURCE_TRANSLATION_DIRECTION { + TranslateChildToParent, + TranslateParentToChild +} RESOURCE_TRANSLATION_DIRECTION; + +typedef NTSTATUS +(DDKAPI *PTRANSLATE_RESOURCE_HANDLER)( + IN PVOID Context, + IN PCM_PARTIAL_RESOURCE_DESCRIPTOR Source, + IN RESOURCE_TRANSLATION_DIRECTION Direction, + IN ULONG AlternativesCount, + IN IO_RESOURCE_DESCRIPTOR Alternatives[], + IN PDEVICE_OBJECT PhysicalDeviceObject, + OUT PCM_PARTIAL_RESOURCE_DESCRIPTOR Target); + +typedef NTSTATUS +(DDKAPI *PTRANSLATE_RESOURCE_REQUIREMENTS_HANDLER)( + IN PVOID Context, + IN PIO_RESOURCE_DESCRIPTOR Source, + IN PDEVICE_OBJECT PhysicalDeviceObject, + OUT PULONG TargetCount, + OUT PIO_RESOURCE_DESCRIPTOR *Target); + +typedef struct _TRANSLATOR_INTERFACE { + USHORT Size; + USHORT Version; + PVOID Context; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; + PTRANSLATE_RESOURCE_HANDLER TranslateResources; + PTRANSLATE_RESOURCE_REQUIREMENTS_HANDLER TranslateResourceRequirements; +} TRANSLATOR_INTERFACE, *PTRANSLATOR_INTERFACE; + +typedef NTSTATUS +(DDKAPI *pHalDeviceControl)( + IN PDEVICE_HANDLER_OBJECT DeviceHandler, + IN PDEVICE_OBJECT DeviceObject, + IN ULONG ControlCode, + IN OUT PVOID Buffer OPTIONAL, + IN OUT PULONG BufferLength OPTIONAL, + IN PVOID Context, + IN PDEVICE_CONTROL_COMPLETION CompletionRoutine); + +typedef VOID +(DDKFASTAPI *pHalExamineMBR)( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG SectorSize, + IN ULONG MBRTypeIdentifier, + OUT PVOID *Buffer); + +typedef VOID +(DDKFASTAPI *pHalIoAssignDriveLetters)( + IN struct _LOADER_PARAMETER_BLOCK *LoaderBlock, + IN PSTRING NtDeviceName, + OUT PUCHAR NtSystemPath, + OUT PSTRING NtSystemPathString); + +typedef NTSTATUS +(DDKFASTAPI *pHalIoReadPartitionTable)( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG SectorSize, + IN BOOLEAN ReturnRecognizedPartitions, + OUT struct _DRIVE_LAYOUT_INFORMATION **PartitionBuffer); + +typedef NTSTATUS +(DDKFASTAPI *pHalIoSetPartitionInformation)( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG SectorSize, + IN ULONG PartitionNumber, + IN ULONG PartitionType); + +typedef NTSTATUS +(DDKFASTAPI *pHalIoWritePartitionTable)( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG SectorSize, + IN ULONG SectorsPerTrack, + IN ULONG NumberOfHeads, + IN struct _DRIVE_LAYOUT_INFORMATION *PartitionBuffer); + +typedef PBUS_HANDLER +(DDKFASTAPI *pHalHandlerForBus)( + IN INTERFACE_TYPE InterfaceType, + IN ULONG BusNumber); + +typedef VOID +(DDKFASTAPI *pHalReferenceBusHandler)( + IN PBUS_HANDLER BusHandler); + +typedef NTSTATUS +(DDKAPI *pHalQuerySystemInformation)( + IN HAL_QUERY_INFORMATION_CLASS InformationClass, + IN ULONG BufferSize, + IN OUT PVOID Buffer, + OUT PULONG ReturnedLength); + +typedef NTSTATUS +(DDKAPI *pHalSetSystemInformation)( + IN HAL_SET_INFORMATION_CLASS InformationClass, + IN ULONG BufferSize, + IN PVOID Buffer); + +typedef NTSTATUS +(DDKAPI *pHalQueryBusSlots)( + IN PBUS_HANDLER BusHandler, + IN ULONG BufferSize, + OUT PULONG SlotNumbers, + OUT PULONG ReturnedLength); + +typedef NTSTATUS +(DDKAPI *pHalInitPnpDriver)( + VOID); + +typedef NTSTATUS +(DDKAPI *pHalInitPowerManagement)( + IN PPM_DISPATCH_TABLE PmDriverDispatchTable, + OUT PPM_DISPATCH_TABLE *PmHalDispatchTable); + +typedef struct _DMA_ADAPTER* +(DDKAPI *pHalGetDmaAdapter)( + IN PVOID Context, + IN struct _DEVICE_DESCRIPTION *DeviceDescriptor, + OUT PULONG NumberOfMapRegisters); + +typedef NTSTATUS +(DDKAPI *pHalGetInterruptTranslator)( + IN INTERFACE_TYPE ParentInterfaceType, + IN ULONG ParentBusNumber, + IN INTERFACE_TYPE BridgeInterfaceType, + IN USHORT Size, + IN USHORT Version, + OUT PTRANSLATOR_INTERFACE Translator, + OUT PULONG BridgeBusNumber); + +typedef NTSTATUS +(DDKAPI *pHalStartMirroring)( + VOID); + +typedef NTSTATUS +(DDKAPI *pHalEndMirroring)( + IN ULONG PassNumber); + +typedef NTSTATUS +(DDKAPI *pHalMirrorPhysicalMemory)( + IN PHYSICAL_ADDRESS PhysicalAddress, + IN LARGE_INTEGER NumberOfBytes); + +typedef NTSTATUS +(DDKAPI *pHalMirrorVerify)( + IN PHYSICAL_ADDRESS PhysicalAddress, + IN LARGE_INTEGER NumberOfBytes); + +typedef VOID +(DDKAPI *pHalEndOfBoot)( + VOID); + +typedef BOOLEAN +(DDKAPI *PHAL_RESET_DISPLAY_PARAMETERS)( + ULONG Columns, ULONG Rows); + +typedef struct { + ULONG Version; + pHalQuerySystemInformation HalQuerySystemInformation; + pHalSetSystemInformation HalSetSystemInformation; + pHalQueryBusSlots HalQueryBusSlots; + ULONG Spare1; + pHalExamineMBR HalExamineMBR; + pHalIoAssignDriveLetters HalIoAssignDriveLetters; + pHalIoReadPartitionTable HalIoReadPartitionTable; + pHalIoSetPartitionInformation HalIoSetPartitionInformation; + pHalIoWritePartitionTable HalIoWritePartitionTable; + pHalHandlerForBus HalReferenceHandlerForBus; + pHalReferenceBusHandler HalReferenceBusHandler; + pHalReferenceBusHandler HalDereferenceBusHandler; + pHalInitPnpDriver HalInitPnpDriver; + pHalInitPowerManagement HalInitPowerManagement; + pHalGetDmaAdapter HalGetDmaAdapter; + pHalGetInterruptTranslator HalGetInterruptTranslator; + pHalStartMirroring HalStartMirroring; + pHalEndMirroring HalEndMirroring; + pHalMirrorPhysicalMemory HalMirrorPhysicalMemory; + pHalEndOfBoot HalEndOfBoot; + pHalMirrorVerify HalMirrorVerify; +} HAL_DISPATCH, *PHAL_DISPATCH; + +#if defined(_NTDRIVER_) || defined(_NTDDK_) || defined(_NTHAL_) +extern DECL_IMPORT PHAL_DISPATCH HalDispatchTable; +#define HALDISPATCH ((PHAL_DISPATCH)&HalDispatchTable) +#else +extern DECL_EXPORT HAL_DISPATCH HalDispatchTable; +#define HALDISPATCH (&HalDispatchTable) +#endif + +#define HAL_DISPATCH_VERSION 3 +#define HalDispatchTableVersion HALDISPATCH->Version +#define HalQuerySystemInformation HALDISPATCH->HalQuerySystemInformation +#define HalSetSystemInformation HALDISPATCH->HalSetSystemInformation +#define HalQueryBusSlots HALDISPATCH->HalQueryBusSlots +#define HalDeviceControl HALDISPATCH->HalDeviceControl +#define HalIoAssignDriveLetters HALDISPATCH->HalIoAssignDriveLetters +#define HalIoReadPartitionTable HALDISPATCH->HalIoReadPartitionTable +#define HalIoSetPartitionInformation HALDISPATCH->HalIoSetPartitionInformation +#define HalIoWritePartitionTable HALDISPATCH->HalIoWritePartitionTable +#define HalReferenceHandlerForBus HALDISPATCH->HalReferenceHandlerForBus +#define HalReferenceBusHandler HALDISPATCH->HalReferenceBusHandler +#define HalDereferenceBusHandler HALDISPATCH->HalDereferenceBusHandler +#define HalInitPnpDriver HALDISPATCH->HalInitPnpDriver +#define HalInitPowerManagement HALDISPATCH->HalInitPowerManagement +#define HalGetDmaAdapter HALDISPATCH->HalGetDmaAdapter +#define HalGetInterruptTranslator HALDISPATCH->HalGetInterruptTranslator +#define HalStartMirroring HALDISPATCH->HalStartMirroring +#define HalEndMirroring HALDISPATCH->HalEndMirroring +#define HalMirrorPhysicalMemory HALDISPATCH->HalMirrorPhysicalMemory +#define HalEndOfBoot HALDISPATCH->HalEndOfBoot +#define HalMirrorVerify HALDISPATCH->HalMirrorVerify + +typedef enum _FILE_INFORMATION_CLASS { + FileDirectoryInformation = 1, + FileFullDirectoryInformation, + FileBothDirectoryInformation, + FileBasicInformation, + FileStandardInformation, + FileInternalInformation, + FileEaInformation, + FileAccessInformation, + FileNameInformation, + FileRenameInformation, + FileLinkInformation, + FileNamesInformation, + FileDispositionInformation, + FilePositionInformation, + FileFullEaInformation, + FileModeInformation, + FileAlignmentInformation, + FileAllInformation, + FileAllocationInformation, + FileEndOfFileInformation, + FileAlternateNameInformation, + FileStreamInformation, + FilePipeInformation, + FilePipeLocalInformation, + FilePipeRemoteInformation, + FileMailslotQueryInformation, + FileMailslotSetInformation, + FileCompressionInformation, + FileObjectIdInformation, + FileCompletionInformation, + FileMoveClusterInformation, + FileQuotaInformation, + FileReparsePointInformation, + FileNetworkOpenInformation, + FileAttributeTagInformation, + FileTrackingInformation, + FileIdBothDirectoryInformation, + FileIdFullDirectoryInformation, + FileValidDataLengthInformation, + FileShortNameInformation, + FileMaximumInformation +} FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS; + +typedef struct _FILE_POSITION_INFORMATION { + LARGE_INTEGER CurrentByteOffset; +} FILE_POSITION_INFORMATION, *PFILE_POSITION_INFORMATION; + +typedef struct _FILE_ALIGNMENT_INFORMATION { + ULONG AlignmentRequirement; +} FILE_ALIGNMENT_INFORMATION, *PFILE_ALIGNMENT_INFORMATION; + +typedef struct _FILE_NAME_INFORMATION { + ULONG FileNameLength; + WCHAR FileName[1]; +} FILE_NAME_INFORMATION, *PFILE_NAME_INFORMATION; + +#include +typedef struct _FILE_BASIC_INFORMATION { + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + ULONG FileAttributes; +} FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION; +#include + +typedef struct _FILE_STANDARD_INFORMATION { + LARGE_INTEGER AllocationSize; + LARGE_INTEGER EndOfFile; + ULONG NumberOfLinks; + BOOLEAN DeletePending; + BOOLEAN Directory; +} FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION; + +typedef struct _FILE_NETWORK_OPEN_INFORMATION { + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + LARGE_INTEGER AllocationSize; + LARGE_INTEGER EndOfFile; + ULONG FileAttributes; +} FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION; + +typedef struct _FILE_ATTRIBUTE_TAG_INFORMATION { + ULONG FileAttributes; + ULONG ReparseTag; +} FILE_ATTRIBUTE_TAG_INFORMATION, *PFILE_ATTRIBUTE_TAG_INFORMATION; + +typedef struct _FILE_DISPOSITION_INFORMATION { + BOOLEAN DeleteFile; +} FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION; + +typedef struct _FILE_END_OF_FILE_INFORMATION { + LARGE_INTEGER EndOfFile; +} FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION; + +typedef struct _FILE_VALID_DATA_LENGTH_INFORMATION { + LARGE_INTEGER ValidDataLength; +} FILE_VALID_DATA_LENGTH_INFORMATION, *PFILE_VALID_DATA_LENGTH_INFORMATION; + +typedef enum _FSINFOCLASS { + FileFsVolumeInformation = 1, + FileFsLabelInformation, + FileFsSizeInformation, + FileFsDeviceInformation, + FileFsAttributeInformation, + FileFsControlInformation, + FileFsFullSizeInformation, + FileFsObjectIdInformation, + FileFsDriverPathInformation, + FileFsMaximumInformation +} FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS; + +typedef struct _FILE_FS_DEVICE_INFORMATION { + DEVICE_TYPE DeviceType; + ULONG Characteristics; +} FILE_FS_DEVICE_INFORMATION, *PFILE_FS_DEVICE_INFORMATION; + +typedef struct _FILE_FULL_EA_INFORMATION { + ULONG NextEntryOffset; + UCHAR Flags; + UCHAR EaNameLength; + USHORT EaValueLength; + CHAR EaName[1]; +} FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION; + +typedef ULONG_PTR ERESOURCE_THREAD; +typedef ERESOURCE_THREAD *PERESOURCE_THREAD; + +typedef struct _OWNER_ENTRY { + ERESOURCE_THREAD OwnerThread; + _ANONYMOUS_UNION union { + LONG OwnerCount; + ULONG TableSize; + } DUMMYUNIONNAME; +} OWNER_ENTRY, *POWNER_ENTRY; + +/* ERESOURCE.Flag */ + +#define ResourceNeverExclusive 0x0010 +#define ResourceReleaseByOtherThread 0x0020 +#define ResourceOwnedExclusive 0x0080 + +#define RESOURCE_HASH_TABLE_SIZE 64 + +typedef struct _ERESOURCE { + LIST_ENTRY SystemResourcesList; + POWNER_ENTRY OwnerTable; + SHORT ActiveCount; + USHORT Flag; + PKSEMAPHORE SharedWaiters; + PKEVENT ExclusiveWaiters; + OWNER_ENTRY OwnerThreads[2]; + ULONG ContentionCount; + USHORT NumberOfSharedWaiters; + USHORT NumberOfExclusiveWaiters; + _ANONYMOUS_UNION union { + PVOID Address; + ULONG_PTR CreatorBackTraceIndex; + } DUMMYUNIONNAME; + KSPIN_LOCK SpinLock; +} ERESOURCE, *PERESOURCE; + +typedef struct _DEVOBJ_EXTENSION +{ + CSHORT Type; + USHORT Size; + PDEVICE_OBJECT DeviceObject; +} DEVOBJ_EXTENSION, *PDEVOBJ_EXTENSION; + +typedef struct _DRIVER_EXTENSION { + struct _DRIVER_OBJECT *DriverObject; + PDRIVER_ADD_DEVICE AddDevice; + ULONG Count; + UNICODE_STRING ServiceKeyName; +} DRIVER_EXTENSION, *PDRIVER_EXTENSION; + +typedef BOOLEAN +(DDKAPI *PFAST_IO_CHECK_IF_POSSIBLE)( + IN struct _FILE_OBJECT *FileObject, + IN PLARGE_INTEGER FileOffset, + IN ULONG Length, + IN BOOLEAN Wait, + IN ULONG LockKey, + IN BOOLEAN CheckForReadOperation, + OUT PIO_STATUS_BLOCK IoStatus, + IN struct _DEVICE_OBJECT *DeviceObject); + +typedef BOOLEAN +(DDKAPI *PFAST_IO_READ)( + IN struct _FILE_OBJECT *FileObject, + IN PLARGE_INTEGER FileOffset, + IN ULONG Length, + IN BOOLEAN Wait, + IN ULONG LockKey, + OUT PVOID Buffer, + OUT PIO_STATUS_BLOCK IoStatus, + IN struct _DEVICE_OBJECT *DeviceObject); + +typedef BOOLEAN +(DDKAPI *PFAST_IO_WRITE)( + IN struct _FILE_OBJECT *FileObject, + IN PLARGE_INTEGER FileOffset, + IN ULONG Length, + IN BOOLEAN Wait, + IN ULONG LockKey, + IN PVOID Buffer, + OUT PIO_STATUS_BLOCK IoStatus, + IN struct _DEVICE_OBJECT *DeviceObject); + +typedef BOOLEAN +(DDKAPI *PFAST_IO_QUERY_BASIC_INFO)( + IN struct _FILE_OBJECT *FileObject, + IN BOOLEAN Wait, + OUT PFILE_BASIC_INFORMATION Buffer, + OUT PIO_STATUS_BLOCK IoStatus, + IN struct _DEVICE_OBJECT *DeviceObject); + +typedef BOOLEAN +(DDKAPI *PFAST_IO_QUERY_STANDARD_INFO)( + IN struct _FILE_OBJECT *FileObject, + IN BOOLEAN Wait, + OUT PFILE_STANDARD_INFORMATION Buffer, + OUT PIO_STATUS_BLOCK IoStatus, + IN struct _DEVICE_OBJECT *DeviceObject); + +typedef BOOLEAN +(DDKAPI *PFAST_IO_LOCK)( + IN struct _FILE_OBJECT *FileObject, + IN PLARGE_INTEGER FileOffset, + IN PLARGE_INTEGER Length, + PEPROCESS ProcessId, + ULONG Key, + BOOLEAN FailImmediately, + BOOLEAN ExclusiveLock, + OUT PIO_STATUS_BLOCK IoStatus, + IN struct _DEVICE_OBJECT *DeviceObject); + +typedef BOOLEAN +(DDKAPI *PFAST_IO_UNLOCK_SINGLE)( + IN struct _FILE_OBJECT *FileObject, + IN PLARGE_INTEGER FileOffset, + IN PLARGE_INTEGER Length, + PEPROCESS ProcessId, + ULONG Key, + OUT PIO_STATUS_BLOCK IoStatus, + IN struct _DEVICE_OBJECT *DeviceObject); + +typedef BOOLEAN +(DDKAPI *PFAST_IO_UNLOCK_ALL)( + IN struct _FILE_OBJECT *FileObject, + PEPROCESS ProcessId, + OUT PIO_STATUS_BLOCK IoStatus, + IN struct _DEVICE_OBJECT *DeviceObject); + +typedef BOOLEAN +(DDKAPI *PFAST_IO_UNLOCK_ALL_BY_KEY)( + IN struct _FILE_OBJECT *FileObject, + PEPROCESS ProcessId, + ULONG Key, + OUT PIO_STATUS_BLOCK IoStatus, + IN struct _DEVICE_OBJECT *DeviceObject); + +typedef BOOLEAN +(DDKAPI *PFAST_IO_DEVICE_CONTROL)( + IN struct _FILE_OBJECT *FileObject, + IN BOOLEAN Wait, + IN PVOID InputBuffer OPTIONAL, + IN ULONG InputBufferLength, + OUT PVOID OutputBuffer OPTIONAL, + IN ULONG OutputBufferLength, + IN ULONG IoControlCode, + OUT PIO_STATUS_BLOCK IoStatus, + IN struct _DEVICE_OBJECT *DeviceObject); + +typedef VOID +(DDKAPI *PFAST_IO_ACQUIRE_FILE)( + IN struct _FILE_OBJECT *FileObject); + +typedef VOID +(DDKAPI *PFAST_IO_RELEASE_FILE)( + IN struct _FILE_OBJECT *FileObject); + +typedef VOID +(DDKAPI *PFAST_IO_DETACH_DEVICE)( + IN struct _DEVICE_OBJECT *SourceDevice, + IN struct _DEVICE_OBJECT *TargetDevice); + +typedef BOOLEAN +(DDKAPI *PFAST_IO_QUERY_NETWORK_OPEN_INFO)( + IN struct _FILE_OBJECT *FileObject, + IN BOOLEAN Wait, + OUT struct _FILE_NETWORK_OPEN_INFORMATION *Buffer, + OUT struct _IO_STATUS_BLOCK *IoStatus, + IN struct _DEVICE_OBJECT *DeviceObject); + +typedef NTSTATUS +(DDKAPI *PFAST_IO_ACQUIRE_FOR_MOD_WRITE)( + IN struct _FILE_OBJECT *FileObject, + IN PLARGE_INTEGER EndingOffset, + OUT struct _ERESOURCE **ResourceToRelease, + IN struct _DEVICE_OBJECT *DeviceObject); + +typedef BOOLEAN +(DDKAPI *PFAST_IO_MDL_READ)( + IN struct _FILE_OBJECT *FileObject, + IN PLARGE_INTEGER FileOffset, + IN ULONG Length, + IN ULONG LockKey, + OUT PMDL *MdlChain, + OUT PIO_STATUS_BLOCK IoStatus, + IN struct _DEVICE_OBJECT *DeviceObject); + +typedef BOOLEAN +(DDKAPI *PFAST_IO_MDL_READ_COMPLETE)( + IN struct _FILE_OBJECT *FileObject, + IN PMDL MdlChain, + IN struct _DEVICE_OBJECT *DeviceObject); + +typedef BOOLEAN +(DDKAPI *PFAST_IO_PREPARE_MDL_WRITE)( + IN struct _FILE_OBJECT *FileObject, + IN PLARGE_INTEGER FileOffset, + IN ULONG Length, + IN ULONG LockKey, + OUT PMDL *MdlChain, + OUT PIO_STATUS_BLOCK IoStatus, + IN struct _DEVICE_OBJECT *DeviceObject); + +typedef BOOLEAN +(DDKAPI *PFAST_IO_MDL_WRITE_COMPLETE)( + IN struct _FILE_OBJECT *FileObject, + IN PLARGE_INTEGER FileOffset, + IN PMDL MdlChain, + IN struct _DEVICE_OBJECT *DeviceObject); + +typedef BOOLEAN +(DDKAPI *PFAST_IO_READ_COMPRESSED)( + IN struct _FILE_OBJECT *FileObject, + IN PLARGE_INTEGER FileOffset, + IN ULONG Length, + IN ULONG LockKey, + OUT PVOID Buffer, + OUT PMDL *MdlChain, + OUT PIO_STATUS_BLOCK IoStatus, + OUT struct _COMPRESSED_DATA_INFO *CompressedDataInfo, + IN ULONG CompressedDataInfoLength, + IN struct _DEVICE_OBJECT *DeviceObject); + +typedef BOOLEAN +(DDKAPI *PFAST_IO_WRITE_COMPRESSED)( + IN struct _FILE_OBJECT *FileObject, + IN PLARGE_INTEGER FileOffset, + IN ULONG Length, + IN ULONG LockKey, + IN PVOID Buffer, + OUT PMDL *MdlChain, + OUT PIO_STATUS_BLOCK IoStatus, + IN struct _COMPRESSED_DATA_INFO *CompressedDataInfo, + IN ULONG CompressedDataInfoLength, + IN struct _DEVICE_OBJECT *DeviceObject); + +typedef BOOLEAN +(DDKAPI *PFAST_IO_MDL_READ_COMPLETE_COMPRESSED)( + IN struct _FILE_OBJECT *FileObject, + IN PMDL MdlChain, + IN struct _DEVICE_OBJECT *DeviceObject); + +typedef BOOLEAN +(DDKAPI *PFAST_IO_MDL_WRITE_COMPLETE_COMPRESSED)( + IN struct _FILE_OBJECT *FileObject, + IN PLARGE_INTEGER FileOffset, + IN PMDL MdlChain, + IN struct _DEVICE_OBJECT *DeviceObject); + +typedef BOOLEAN +(DDKAPI *PFAST_IO_QUERY_OPEN)( + IN struct _IRP *Irp, + OUT PFILE_NETWORK_OPEN_INFORMATION NetworkInformation, + IN struct _DEVICE_OBJECT *DeviceObject); + +typedef NTSTATUS +(DDKAPI *PFAST_IO_RELEASE_FOR_MOD_WRITE)( + IN struct _FILE_OBJECT *FileObject, + IN struct _ERESOURCE *ResourceToRelease, + IN struct _DEVICE_OBJECT *DeviceObject); + +typedef NTSTATUS +(DDKAPI *PFAST_IO_ACQUIRE_FOR_CCFLUSH)( + IN struct _FILE_OBJECT *FileObject, + IN struct _DEVICE_OBJECT *DeviceObject); + +typedef NTSTATUS +(DDKAPI *PFAST_IO_RELEASE_FOR_CCFLUSH) ( + IN struct _FILE_OBJECT *FileObject, + IN struct _DEVICE_OBJECT *DeviceObject); + +typedef struct _FAST_IO_DISPATCH { + ULONG SizeOfFastIoDispatch; + PFAST_IO_CHECK_IF_POSSIBLE FastIoCheckIfPossible; + PFAST_IO_READ FastIoRead; + PFAST_IO_WRITE FastIoWrite; + PFAST_IO_QUERY_BASIC_INFO FastIoQueryBasicInfo; + PFAST_IO_QUERY_STANDARD_INFO FastIoQueryStandardInfo; + PFAST_IO_LOCK FastIoLock; + PFAST_IO_UNLOCK_SINGLE FastIoUnlockSingle; + PFAST_IO_UNLOCK_ALL FastIoUnlockAll; + PFAST_IO_UNLOCK_ALL_BY_KEY FastIoUnlockAllByKey; + PFAST_IO_DEVICE_CONTROL FastIoDeviceControl; + PFAST_IO_ACQUIRE_FILE AcquireFileForNtCreateSection; + PFAST_IO_RELEASE_FILE ReleaseFileForNtCreateSection; + PFAST_IO_DETACH_DEVICE FastIoDetachDevice; + PFAST_IO_QUERY_NETWORK_OPEN_INFO FastIoQueryNetworkOpenInfo; + PFAST_IO_ACQUIRE_FOR_MOD_WRITE AcquireForModWrite; + PFAST_IO_MDL_READ MdlRead; + PFAST_IO_MDL_READ_COMPLETE MdlReadComplete; + PFAST_IO_PREPARE_MDL_WRITE PrepareMdlWrite; + PFAST_IO_MDL_WRITE_COMPLETE MdlWriteComplete; + PFAST_IO_READ_COMPRESSED FastIoReadCompressed; + PFAST_IO_WRITE_COMPRESSED FastIoWriteCompressed; + PFAST_IO_MDL_READ_COMPLETE_COMPRESSED MdlReadCompleteCompressed; + PFAST_IO_MDL_WRITE_COMPLETE_COMPRESSED MdlWriteCompleteCompressed; + PFAST_IO_QUERY_OPEN FastIoQueryOpen; + PFAST_IO_RELEASE_FOR_MOD_WRITE ReleaseForModWrite; + PFAST_IO_ACQUIRE_FOR_CCFLUSH AcquireForCcFlush; + PFAST_IO_RELEASE_FOR_CCFLUSH ReleaseForCcFlush; +} FAST_IO_DISPATCH, *PFAST_IO_DISPATCH; + +#define DRVO_UNLOAD_INVOKED 0x00000001 +#define DRVO_LEGACY_DRIVER 0x00000002 +#define DRVO_BUILTIN_DRIVER 0x00000004 +#define DRVO_REINIT_REGISTERED 0x00000008 +#define DRVO_INITIALIZED 0x00000010 +#define DRVO_BOOTREINIT_REGISTERED 0x00000020 +#define DRVO_LEGACY_RESOURCES 0x00000040 + +typedef struct _DRIVER_OBJECT { + CSHORT Type; + CSHORT Size; + PDEVICE_OBJECT DeviceObject; + ULONG Flags; + PVOID DriverStart; + ULONG DriverSize; + PVOID DriverSection; + PDRIVER_EXTENSION DriverExtension; + UNICODE_STRING DriverName; + PUNICODE_STRING HardwareDatabase; + PFAST_IO_DISPATCH FastIoDispatch; + PDRIVER_INITIALIZE DriverInit; + PDRIVER_STARTIO DriverStartIo; + PDRIVER_UNLOAD DriverUnload; + PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION + 1]; +} DRIVER_OBJECT; +typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT; + +typedef struct _SECTION_OBJECT_POINTERS { + PVOID DataSectionObject; + PVOID SharedCacheMap; + PVOID ImageSectionObject; +} SECTION_OBJECT_POINTERS, *PSECTION_OBJECT_POINTERS; + +typedef struct _IO_COMPLETION_CONTEXT { + PVOID Port; + PVOID Key; +} IO_COMPLETION_CONTEXT, *PIO_COMPLETION_CONTEXT; + +/* FILE_OBJECT.Flags */ + +#define FO_FILE_OPEN 0x00000001 +#define FO_SYNCHRONOUS_IO 0x00000002 +#define FO_ALERTABLE_IO 0x00000004 +#define FO_NO_INTERMEDIATE_BUFFERING 0x00000008 +#define FO_WRITE_THROUGH 0x00000010 +#define FO_SEQUENTIAL_ONLY 0x00000020 +#define FO_CACHE_SUPPORTED 0x00000040 +#define FO_NAMED_PIPE 0x00000080 +#define FO_STREAM_FILE 0x00000100 +#define FO_MAILSLOT 0x00000200 +#define FO_GENERATE_AUDIT_ON_CLOSE 0x00000400 +#define FO_DIRECT_DEVICE_OPEN 0x00000800 +#define FO_FILE_MODIFIED 0x00001000 +#define FO_FILE_SIZE_CHANGED 0x00002000 +#define FO_CLEANUP_COMPLETE 0x00004000 +#define FO_TEMPORARY_FILE 0x00008000 +#define FO_DELETE_ON_CLOSE 0x00010000 +#define FO_OPENED_CASE_SENSITIVE 0x00020000 +#define FO_HANDLE_CREATED 0x00040000 +#define FO_FILE_FAST_IO_READ 0x00080000 +#define FO_RANDOM_ACCESS 0x00100000 +#define FO_FILE_OPEN_CANCELLED 0x00200000 +#define FO_VOLUME_OPEN 0x00400000 +#define FO_FILE_OBJECT_HAS_EXTENSION 0x00800000 +#define FO_REMOTE_ORIGIN 0x01000000 + +typedef struct _FILE_OBJECT { + CSHORT Type; + CSHORT Size; + PDEVICE_OBJECT DeviceObject; + PVPB Vpb; + PVOID FsContext; + PVOID FsContext2; + PSECTION_OBJECT_POINTERS SectionObjectPointer; + PVOID PrivateCacheMap; + NTSTATUS FinalStatus; + struct _FILE_OBJECT *RelatedFileObject; + BOOLEAN LockOperation; + BOOLEAN DeletePending; + BOOLEAN ReadAccess; + BOOLEAN WriteAccess; + BOOLEAN DeleteAccess; + BOOLEAN SharedRead; + BOOLEAN SharedWrite; + BOOLEAN SharedDelete; + ULONG Flags; + UNICODE_STRING FileName; + LARGE_INTEGER CurrentByteOffset; + ULONG Waiters; + ULONG Busy; + PVOID LastLock; + KEVENT Lock; + KEVENT Event; + PIO_COMPLETION_CONTEXT CompletionContext; +} FILE_OBJECT; +typedef struct _FILE_OBJECT *PFILE_OBJECT; + +typedef enum _SECURITY_OPERATION_CODE { + SetSecurityDescriptor, + QuerySecurityDescriptor, + DeleteSecurityDescriptor, + AssignSecurityDescriptor +} SECURITY_OPERATION_CODE, *PSECURITY_OPERATION_CODE; + +#define INITIAL_PRIVILEGE_COUNT 3 + +typedef struct _INITIAL_PRIVILEGE_SET { + ULONG PrivilegeCount; + ULONG Control; + LUID_AND_ATTRIBUTES Privilege[INITIAL_PRIVILEGE_COUNT]; +} INITIAL_PRIVILEGE_SET, * PINITIAL_PRIVILEGE_SET; + +#define SE_MIN_WELL_KNOWN_PRIVILEGE 2 +#define SE_CREATE_TOKEN_PRIVILEGE 2 +#define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE 3 +#define SE_LOCK_MEMORY_PRIVILEGE 4 +#define SE_INCREASE_QUOTA_PRIVILEGE 5 +#define SE_UNSOLICITED_INPUT_PRIVILEGE 6 +#define SE_MACHINE_ACCOUNT_PRIVILEGE 6 +#define SE_TCB_PRIVILEGE 7 +#define SE_SECURITY_PRIVILEGE 8 +#define SE_TAKE_OWNERSHIP_PRIVILEGE 9 +#define SE_LOAD_DRIVER_PRIVILEGE 10 +#define SE_SYSTEM_PROFILE_PRIVILEGE 11 +#define SE_SYSTEMTIME_PRIVILEGE 12 +#define SE_PROF_SINGLE_PROCESS_PRIVILEGE 13 +#define SE_INC_BASE_PRIORITY_PRIVILEGE 14 +#define SE_CREATE_PAGEFILE_PRIVILEGE 15 +#define SE_CREATE_PERMANENT_PRIVILEGE 16 +#define SE_BACKUP_PRIVILEGE 17 +#define SE_RESTORE_PRIVILEGE 18 +#define SE_SHUTDOWN_PRIVILEGE 19 +#define SE_DEBUG_PRIVILEGE 20 +#define SE_AUDIT_PRIVILEGE 21 +#define SE_SYSTEM_ENVIRONMENT_PRIVILEGE 22 +#define SE_CHANGE_NOTIFY_PRIVILEGE 23 +#define SE_REMOTE_SHUTDOWN_PRIVILEGE 24 +#define SE_UNDOCK_PRIVILEGE 25 +#define SE_SYNC_AGENT_PRIVILEGE 26 +#define SE_ENABLE_DELEGATION_PRIVILEGE 27 +#define SE_MANAGE_VOLUME_PRIVILEGE 28 +#define SE_IMPERSONATE_PRIVILEGE 29 +#define SE_CREATE_GLOBAL_PRIVILEGE 30 +#define SE_MAX_WELL_KNOWN_PRIVILEGE SE_CREATE_GLOBAL_PRIVILEGE + +typedef struct _SECURITY_SUBJECT_CONTEXT { + PACCESS_TOKEN ClientToken; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; + PACCESS_TOKEN PrimaryToken; + PVOID ProcessAuditId; +} SECURITY_SUBJECT_CONTEXT, *PSECURITY_SUBJECT_CONTEXT; + +#include +typedef struct _ACCESS_STATE { + LUID OperationID; + BOOLEAN SecurityEvaluated; + BOOLEAN GenerateAudit; + BOOLEAN GenerateOnClose; + BOOLEAN PrivilegesAllocated; + ULONG Flags; + ACCESS_MASK RemainingDesiredAccess; + ACCESS_MASK PreviouslyGrantedAccess; + ACCESS_MASK OriginalDesiredAccess; + SECURITY_SUBJECT_CONTEXT SubjectSecurityContext; + PSECURITY_DESCRIPTOR SecurityDescriptor; + PVOID AuxData; + union { + INITIAL_PRIVILEGE_SET InitialPrivilegeSet; + PRIVILEGE_SET PrivilegeSet; + } Privileges; + + BOOLEAN AuditPrivileges; + UNICODE_STRING ObjectName; + UNICODE_STRING ObjectTypeName; +} ACCESS_STATE, *PACCESS_STATE; +#include + +typedef struct _IO_SECURITY_CONTEXT { + PSECURITY_QUALITY_OF_SERVICE SecurityQos; + PACCESS_STATE AccessState; + ACCESS_MASK DesiredAccess; + ULONG FullCreateOptions; +} IO_SECURITY_CONTEXT, *PIO_SECURITY_CONTEXT; + +#define IO_TYPE_ADAPTER 1 +#define IO_TYPE_CONTROLLER 2 +#define IO_TYPE_DEVICE 3 +#define IO_TYPE_DRIVER 4 +#define IO_TYPE_FILE 5 +#define IO_TYPE_IRP 6 +#define IO_TYPE_MASTER_ADAPTER 7 +#define IO_TYPE_OPEN_PACKET 8 +#define IO_TYPE_TIMER 9 +#define IO_TYPE_VPB 10 +#define IO_TYPE_ERROR_LOG 11 +#define IO_TYPE_ERROR_MESSAGE 12 +#define IO_TYPE_DEVICE_OBJECT_EXTENSION 13 + +#define IO_TYPE_CSQ_IRP_CONTEXT 1 +#define IO_TYPE_CSQ 2 + +struct _IO_CSQ; + +typedef struct _IO_CSQ_IRP_CONTEXT { + ULONG Type; + struct _IRP *Irp; + struct _IO_CSQ *Csq; +} IO_CSQ_IRP_CONTEXT, *PIO_CSQ_IRP_CONTEXT; + +typedef VOID +(DDKAPI *PIO_CSQ_INSERT_IRP)( + IN struct _IO_CSQ *Csq, + IN PIRP Irp); + +typedef VOID +(DDKAPI *PIO_CSQ_REMOVE_IRP)( + IN struct _IO_CSQ *Csq, + IN PIRP Irp); + +typedef PIRP +(DDKAPI *PIO_CSQ_PEEK_NEXT_IRP)( + IN struct _IO_CSQ *Csq, + IN PIRP Irp, + IN PVOID PeekContext); + +typedef VOID +(DDKAPI *PIO_CSQ_ACQUIRE_LOCK)( + IN struct _IO_CSQ *Csq, + OUT PKIRQL Irql); + +typedef VOID +(DDKAPI *PIO_CSQ_RELEASE_LOCK)( + IN struct _IO_CSQ *Csq, + IN KIRQL Irql); + +typedef VOID +(DDKAPI *PIO_CSQ_COMPLETE_CANCELED_IRP)( + IN struct _IO_CSQ *Csq, + IN PIRP Irp); + +typedef struct _IO_CSQ { + ULONG Type; + PIO_CSQ_INSERT_IRP CsqInsertIrp; + PIO_CSQ_REMOVE_IRP CsqRemoveIrp; + PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp; + PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock; + PIO_CSQ_RELEASE_LOCK CsqReleaseLock; + PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp; + PVOID ReservePointer; +} IO_CSQ, *PIO_CSQ; + +#if !defined(_ALPHA_) +#include +#endif +typedef struct _IO_STACK_LOCATION { + UCHAR MajorFunction; + UCHAR MinorFunction; + UCHAR Flags; + UCHAR Control; + union { + struct { + PIO_SECURITY_CONTEXT SecurityContext; + ULONG Options; + USHORT POINTER_ALIGNMENT FileAttributes; + USHORT ShareAccess; + ULONG POINTER_ALIGNMENT EaLength; + } Create; + struct { + ULONG Length; + ULONG POINTER_ALIGNMENT Key; + LARGE_INTEGER ByteOffset; + } Read; + struct { + ULONG Length; + ULONG POINTER_ALIGNMENT Key; + LARGE_INTEGER ByteOffset; + } Write; + struct { + ULONG Length; + PUNICODE_STRING FileName; + FILE_INFORMATION_CLASS FileInformationClass; + ULONG FileIndex; + } QueryDirectory; + struct { + ULONG Length; + ULONG CompletionFilter; + } NotifyDirectory; + struct { + ULONG Length; + FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass; + } QueryFile; + struct { + ULONG Length; + FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass; + PFILE_OBJECT FileObject; + _ANONYMOUS_UNION union { + _ANONYMOUS_STRUCT struct { + BOOLEAN ReplaceIfExists; + BOOLEAN AdvanceOnly; + } DUMMYSTRUCTNAME; + ULONG ClusterCount; + HANDLE DeleteHandle; + } DUMMYUNIONNAME; + } SetFile; + struct { + ULONG Length; + PVOID EaList; + ULONG EaListLength; + ULONG EaIndex; + } QueryEa; + struct { + ULONG Length; + } SetEa; + struct { + ULONG Length; + FS_INFORMATION_CLASS POINTER_ALIGNMENT FsInformationClass; + } QueryVolume; + struct { + ULONG Length; + FS_INFORMATION_CLASS FsInformationClass; + } SetVolume; + struct { + ULONG OutputBufferLength; + ULONG InputBufferLength; + ULONG FsControlCode; + PVOID Type3InputBuffer; + } FileSystemControl; + struct { + PLARGE_INTEGER Length; + ULONG Key; + LARGE_INTEGER ByteOffset; + } LockControl; + struct { + ULONG OutputBufferLength; + ULONG POINTER_ALIGNMENT InputBufferLength; + ULONG POINTER_ALIGNMENT IoControlCode; + PVOID Type3InputBuffer; + } DeviceIoControl; + struct { + SECURITY_INFORMATION SecurityInformation; + ULONG POINTER_ALIGNMENT Length; + } QuerySecurity; + struct { + SECURITY_INFORMATION SecurityInformation; + PSECURITY_DESCRIPTOR SecurityDescriptor; + } SetSecurity; + struct { + PVPB Vpb; + PDEVICE_OBJECT DeviceObject; + } MountVolume; + struct { + PVPB Vpb; + PDEVICE_OBJECT DeviceObject; + } VerifyVolume; + struct { + struct _SCSI_REQUEST_BLOCK *Srb; + } Scsi; + struct { + ULONG Length; + PSID StartSid; + struct _FILE_GET_QUOTA_INFORMATION *SidList; + ULONG SidListLength; + } QueryQuota; + struct { + ULONG Length; + } SetQuota; + struct { + DEVICE_RELATION_TYPE Type; + } QueryDeviceRelations; + struct { + CONST GUID *InterfaceType; + USHORT Size; + USHORT Version; + PINTERFACE Interface; + PVOID InterfaceSpecificData; + } QueryInterface; + struct { + PDEVICE_CAPABILITIES Capabilities; + } DeviceCapabilities; + struct { + PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList; + } FilterResourceRequirements; + struct { + ULONG WhichSpace; + PVOID Buffer; + ULONG Offset; + ULONG POINTER_ALIGNMENT Length; + } ReadWriteConfig; + struct { + BOOLEAN Lock; + } SetLock; + struct { + BUS_QUERY_ID_TYPE IdType; + } QueryId; + struct { + DEVICE_TEXT_TYPE DeviceTextType; + LCID POINTER_ALIGNMENT LocaleId; + } QueryDeviceText; + struct { + BOOLEAN InPath; + BOOLEAN Reserved[3]; + DEVICE_USAGE_NOTIFICATION_TYPE POINTER_ALIGNMENT Type; + } UsageNotification; + struct { + SYSTEM_POWER_STATE PowerState; + } WaitWake; + struct { + PPOWER_SEQUENCE PowerSequence; + } PowerSequence; + struct { + ULONG SystemContext; + POWER_STATE_TYPE POINTER_ALIGNMENT Type; + POWER_STATE POINTER_ALIGNMENT State; + POWER_ACTION POINTER_ALIGNMENT ShutdownType; + } Power; + struct { + PCM_RESOURCE_LIST AllocatedResources; + PCM_RESOURCE_LIST AllocatedResourcesTranslated; + } StartDevice; + struct { + ULONG_PTR ProviderId; + PVOID DataPath; + ULONG BufferSize; + PVOID Buffer; + } WMI; + struct { + PVOID Argument1; + PVOID Argument2; + PVOID Argument3; + PVOID Argument4; + } Others; + } Parameters; + PDEVICE_OBJECT DeviceObject; + PFILE_OBJECT FileObject; + PIO_COMPLETION_ROUTINE CompletionRoutine; + PVOID Context; +} IO_STACK_LOCATION, *PIO_STACK_LOCATION; +#if !defined(_ALPHA_) +#include +#endif + +/* IO_STACK_LOCATION.Control */ + +#define SL_PENDING_RETURNED 0x01 +#define SL_INVOKE_ON_CANCEL 0x20 +#define SL_INVOKE_ON_SUCCESS 0x40 +#define SL_INVOKE_ON_ERROR 0x80 + +/* IO_STACK_LOCATION.Parameters.ReadWriteControl.WhichSpace */ + +#define PCI_WHICHSPACE_CONFIG 0x0 +#define PCI_WHICHSPACE_ROM 0x52696350 /* 'PciR' */ + +typedef enum _KEY_INFORMATION_CLASS { + KeyBasicInformation, + KeyNodeInformation, + KeyFullInformation, + KeyNameInformation, + KeyCachedInformation, + KeyFlagsInformation +} KEY_INFORMATION_CLASS; + +typedef struct _KEY_BASIC_INFORMATION { + LARGE_INTEGER LastWriteTime; + ULONG TitleIndex; + ULONG NameLength; + WCHAR Name[1]; +} KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION; + +typedef struct _KEY_FULL_INFORMATION { + LARGE_INTEGER LastWriteTime; + ULONG TitleIndex; + ULONG ClassOffset; + ULONG ClassLength; + ULONG SubKeys; + ULONG MaxNameLen; + ULONG MaxClassLen; + ULONG Values; + ULONG MaxValueNameLen; + ULONG MaxValueDataLen; + WCHAR Class[1]; +} KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION; + +typedef struct _KEY_NODE_INFORMATION { + LARGE_INTEGER LastWriteTime; + ULONG TitleIndex; + ULONG ClassOffset; + ULONG ClassLength; + ULONG NameLength; + WCHAR Name[1]; +} KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION; + +typedef struct _KEY_VALUE_BASIC_INFORMATION { + ULONG TitleIndex; + ULONG Type; + ULONG NameLength; + WCHAR Name[1]; +} KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION; + +typedef struct _KEY_VALUE_FULL_INFORMATION { + ULONG TitleIndex; + ULONG Type; + ULONG DataOffset; + ULONG DataLength; + ULONG NameLength; + WCHAR Name[1]; +} KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION; + +typedef struct _KEY_VALUE_PARTIAL_INFORMATION { + ULONG TitleIndex; + ULONG Type; + ULONG DataLength; + UCHAR Data[1]; +} KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION; + +typedef struct _KEY_VALUE_PARTIAL_INFORMATION_ALIGN64 { + ULONG Type; + ULONG DataLength; + UCHAR Data[1]; +} KEY_VALUE_PARTIAL_INFORMATION_ALIGN64, *PKEY_VALUE_PARTIAL_INFORMATION_ALIGN64; + +typedef struct _KEY_VALUE_ENTRY { + PUNICODE_STRING ValueName; + ULONG DataLength; + ULONG DataOffset; + ULONG Type; +} KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY; + +typedef enum _KEY_VALUE_INFORMATION_CLASS { + KeyValueBasicInformation, + KeyValueFullInformation, + KeyValuePartialInformation, + KeyValueFullInformationAlign64, + KeyValuePartialInformationAlign64 +} KEY_VALUE_INFORMATION_CLASS; + +typedef struct _KEY_WRITE_TIME_INFORMATION { + LARGE_INTEGER LastWriteTime; +} KEY_WRITE_TIME_INFORMATION, *PKEY_WRITE_TIME_INFORMATION; + +typedef struct _KEY_USER_FLAGS_INFORMATION { + ULONG UserFlags; +} KEY_USER_FLAGS_INFORMATION, *PKEY_USER_FLAGS_INFORMATION; + +typedef enum _KEY_SET_INFORMATION_CLASS { + KeyWriteTimeInformation, + KeyUserFlagsInformation, + MaxKeySetInfoClass +} KEY_SET_INFORMATION_CLASS; + +#define REG_CREATED_NEW_KEY 0x00000001L +#define REG_OPENED_EXISTING_KEY 0x00000002L + + +/* KEY_VALUE_Xxx.Type */ + +#define REG_NONE 0 +#define REG_SZ 1 +#define REG_EXPAND_SZ 2 +#define REG_BINARY 3 +#define REG_DWORD 4 +#define REG_DWORD_LITTLE_ENDIAN 4 +#define REG_DWORD_BIG_ENDIAN 5 +#define REG_LINK 6 +#define REG_MULTI_SZ 7 +#define REG_RESOURCE_LIST 8 +#define REG_FULL_RESOURCE_DESCRIPTOR 9 +#define REG_RESOURCE_REQUIREMENTS_LIST 10 +#define REG_QWORD 11 +#define REG_QWORD_LITTLE_ENDIAN 11 + +#define PCI_TYPE0_ADDRESSES 6 +#define PCI_TYPE1_ADDRESSES 2 +#define PCI_TYPE2_ADDRESSES 5 + +typedef struct _PCI_COMMON_CONFIG { + USHORT VendorID; + USHORT DeviceID; + USHORT Command; + USHORT Status; + UCHAR RevisionID; + UCHAR ProgIf; + UCHAR SubClass; + UCHAR BaseClass; + UCHAR CacheLineSize; + UCHAR LatencyTimer; + UCHAR HeaderType; + UCHAR BIST; + union { + struct _PCI_HEADER_TYPE_0 { + ULONG BaseAddresses[PCI_TYPE0_ADDRESSES]; + ULONG CIS; + USHORT SubVendorID; + USHORT SubSystemID; + ULONG ROMBaseAddress; + UCHAR CapabilitiesPtr; + UCHAR Reserved1[3]; + ULONG Reserved2; + UCHAR InterruptLine; + UCHAR InterruptPin; + UCHAR MinimumGrant; + UCHAR MaximumLatency; + } type0; + struct _PCI_HEADER_TYPE_1 { + ULONG BaseAddresses[PCI_TYPE1_ADDRESSES]; + UCHAR PrimaryBus; + UCHAR SecondaryBus; + UCHAR SubordinateBus; + UCHAR SecondaryLatency; + UCHAR IOBase; + UCHAR IOLimit; + USHORT SecondaryStatus; + USHORT MemoryBase; + USHORT MemoryLimit; + USHORT PrefetchBase; + USHORT PrefetchLimit; + ULONG PrefetchBaseUpper32; + ULONG PrefetchLimitUpper32; + USHORT IOBaseUpper16; + USHORT IOLimitUpper16; + UCHAR CapabilitiesPtr; + UCHAR Reserved1[3]; + ULONG ROMBaseAddress; + UCHAR InterruptLine; + UCHAR InterruptPin; + USHORT BridgeControl; + } type1; + struct _PCI_HEADER_TYPE_2 { + ULONG SocketRegistersBaseAddress; + UCHAR CapabilitiesPtr; + UCHAR Reserved; + USHORT SecondaryStatus; + UCHAR PrimaryBus; + UCHAR SecondaryBus; + UCHAR SubordinateBus; + UCHAR SecondaryLatency; + struct { + ULONG Base; + ULONG Limit; + } Range[PCI_TYPE2_ADDRESSES - 1]; + UCHAR InterruptLine; + UCHAR InterruptPin; + USHORT BridgeControl; + } type2; + } u; + UCHAR DeviceSpecific[192]; +} PCI_COMMON_CONFIG, *PPCI_COMMON_CONFIG; + +/* PCI_COMMON_CONFIG.Command */ + +#define PCI_ENABLE_IO_SPACE 0x0001 +#define PCI_ENABLE_MEMORY_SPACE 0x0002 +#define PCI_ENABLE_BUS_MASTER 0x0004 +#define PCI_ENABLE_SPECIAL_CYCLES 0x0008 +#define PCI_ENABLE_WRITE_AND_INVALIDATE 0x0010 +#define PCI_ENABLE_VGA_COMPATIBLE_PALETTE 0x0020 +#define PCI_ENABLE_PARITY 0x0040 +#define PCI_ENABLE_WAIT_CYCLE 0x0080 +#define PCI_ENABLE_SERR 0x0100 +#define PCI_ENABLE_FAST_BACK_TO_BACK 0x0200 + +/* PCI_COMMON_CONFIG.Status */ + +#define PCI_STATUS_CAPABILITIES_LIST 0x0010 +#define PCI_STATUS_66MHZ_CAPABLE 0x0020 +#define PCI_STATUS_UDF_SUPPORTED 0x0040 +#define PCI_STATUS_FAST_BACK_TO_BACK 0x0080 +#define PCI_STATUS_DATA_PARITY_DETECTED 0x0100 +#define PCI_STATUS_DEVSEL 0x0600 +#define PCI_STATUS_SIGNALED_TARGET_ABORT 0x0800 +#define PCI_STATUS_RECEIVED_TARGET_ABORT 0x1000 +#define PCI_STATUS_RECEIVED_MASTER_ABORT 0x2000 +#define PCI_STATUS_SIGNALED_SYSTEM_ERROR 0x4000 +#define PCI_STATUS_DETECTED_PARITY_ERROR 0x8000 + +/* PCI_COMMON_CONFIG.HeaderType */ + +#define PCI_MULTIFUNCTION 0x80 +#define PCI_DEVICE_TYPE 0x00 +#define PCI_BRIDGE_TYPE 0x01 +#define PCI_CARDBUS_BRIDGE_TYPE 0x02 + +#define PCI_CONFIGURATION_TYPE(PciData) \ + (((PPCI_COMMON_CONFIG) (PciData))->HeaderType & ~PCI_MULTIFUNCTION) + +#define PCI_MULTIFUNCTION_DEVICE(PciData) \ + ((((PPCI_COMMON_CONFIG) (PciData))->HeaderType & PCI_MULTIFUNCTION) != 0) + +/* PCI device classes */ + +#define PCI_CLASS_PRE_20 0x00 +#define PCI_CLASS_MASS_STORAGE_CTLR 0x01 +#define PCI_CLASS_NETWORK_CTLR 0x02 +#define PCI_CLASS_DISPLAY_CTLR 0x03 +#define PCI_CLASS_MULTIMEDIA_DEV 0x04 +#define PCI_CLASS_MEMORY_CTLR 0x05 +#define PCI_CLASS_BRIDGE_DEV 0x06 +#define PCI_CLASS_SIMPLE_COMMS_CTLR 0x07 +#define PCI_CLASS_BASE_SYSTEM_DEV 0x08 +#define PCI_CLASS_INPUT_DEV 0x09 +#define PCI_CLASS_DOCKING_STATION 0x0a +#define PCI_CLASS_PROCESSOR 0x0b +#define PCI_CLASS_SERIAL_BUS_CTLR 0x0c + +/* PCI device subclasses for class 0 */ + +#define PCI_SUBCLASS_PRE_20_NON_VGA 0x00 +#define PCI_SUBCLASS_PRE_20_VGA 0x01 + +/* PCI device subclasses for class 1 (mass storage controllers)*/ + +#define PCI_SUBCLASS_MSC_SCSI_BUS_CTLR 0x00 +#define PCI_SUBCLASS_MSC_IDE_CTLR 0x01 +#define PCI_SUBCLASS_MSC_FLOPPY_CTLR 0x02 +#define PCI_SUBCLASS_MSC_IPI_CTLR 0x03 +#define PCI_SUBCLASS_MSC_RAID_CTLR 0x04 +#define PCI_SUBCLASS_MSC_OTHER 0x80 + +/* PCI device subclasses for class 2 (network controllers)*/ + +#define PCI_SUBCLASS_NET_ETHERNET_CTLR 0x00 +#define PCI_SUBCLASS_NET_TOKEN_RING_CTLR 0x01 +#define PCI_SUBCLASS_NET_FDDI_CTLR 0x02 +#define PCI_SUBCLASS_NET_ATM_CTLR 0x03 +#define PCI_SUBCLASS_NET_OTHER 0x80 + +/* PCI device subclasses for class 3 (display controllers)*/ + +#define PCI_SUBCLASS_VID_VGA_CTLR 0x00 +#define PCI_SUBCLASS_VID_XGA_CTLR 0x01 +#define PCI_SUBLCASS_VID_3D_CTLR 0x02 +#define PCI_SUBCLASS_VID_OTHER 0x80 + +/* PCI device subclasses for class 4 (multimedia device)*/ + +#define PCI_SUBCLASS_MM_VIDEO_DEV 0x00 +#define PCI_SUBCLASS_MM_AUDIO_DEV 0x01 +#define PCI_SUBCLASS_MM_TELEPHONY_DEV 0x02 +#define PCI_SUBCLASS_MM_OTHER 0x80 + +/* PCI device subclasses for class 5 (memory controller)*/ + +#define PCI_SUBCLASS_MEM_RAM 0x00 +#define PCI_SUBCLASS_MEM_FLASH 0x01 +#define PCI_SUBCLASS_MEM_OTHER 0x80 + +/* PCI device subclasses for class 6 (bridge device)*/ + +#define PCI_SUBCLASS_BR_HOST 0x00 +#define PCI_SUBCLASS_BR_ISA 0x01 +#define PCI_SUBCLASS_BR_EISA 0x02 +#define PCI_SUBCLASS_BR_MCA 0x03 +#define PCI_SUBCLASS_BR_PCI_TO_PCI 0x04 +#define PCI_SUBCLASS_BR_PCMCIA 0x05 +#define PCI_SUBCLASS_BR_NUBUS 0x06 +#define PCI_SUBCLASS_BR_CARDBUS 0x07 +#define PCI_SUBCLASS_BR_OTHER 0x80 + +/* PCI device subclasses for class C (serial bus controller)*/ + +#define PCI_SUBCLASS_SB_IEEE1394 0x00 +#define PCI_SUBCLASS_SB_ACCESS 0x01 +#define PCI_SUBCLASS_SB_SSA 0x02 +#define PCI_SUBCLASS_SB_USB 0x03 +#define PCI_SUBCLASS_SB_FIBRE_CHANNEL 0x04 + +#define PCI_MAX_DEVICES 32 +#define PCI_MAX_FUNCTION 8 +#define PCI_MAX_BRIDGE_NUMBER 0xFF +#define PCI_INVALID_VENDORID 0xFFFF +#define PCI_COMMON_HDR_LENGTH (FIELD_OFFSET(PCI_COMMON_CONFIG, DeviceSpecific)) + +#define PCI_ADDRESS_IO_SPACE 0x01 +#define PCI_ADDRESS_MEMORY_TYPE_MASK 0x06 +#define PCI_ADDRESS_MEMORY_PREFETCHABLE 0x08 +#define PCI_ADDRESS_IO_ADDRESS_MASK 0xfffffffc +#define PCI_ADDRESS_MEMORY_ADDRESS_MASK 0xfffffff0 +#define PCI_ADDRESS_ROM_ADDRESS_MASK 0xfffff800 + +#define PCI_TYPE_32BIT 0 +#define PCI_TYPE_20BIT 2 +#define PCI_TYPE_64BIT 4 + +typedef struct _PCI_SLOT_NUMBER { + union { + struct { + ULONG DeviceNumber : 5; + ULONG FunctionNumber : 3; + ULONG Reserved : 24; + } bits; + ULONG AsULONG; + } u; +} PCI_SLOT_NUMBER, *PPCI_SLOT_NUMBER; + +typedef enum _POOL_TYPE { + NonPagedPool, + PagedPool, + NonPagedPoolMustSucceed, + DontUseThisType, + NonPagedPoolCacheAligned, + PagedPoolCacheAligned, + NonPagedPoolCacheAlignedMustS, + MaxPoolType, + NonPagedPoolSession = 32, + PagedPoolSession, + NonPagedPoolMustSucceedSession, + DontUseThisTypeSession, + NonPagedPoolCacheAlignedSession, + PagedPoolCacheAlignedSession, + NonPagedPoolCacheAlignedMustSSession +} POOL_TYPE; + +typedef enum _EX_POOL_PRIORITY { + LowPoolPriority, + LowPoolPrioritySpecialPoolOverrun = 8, + LowPoolPrioritySpecialPoolUnderrun = 9, + NormalPoolPriority = 16, + NormalPoolPrioritySpecialPoolOverrun = 24, + NormalPoolPrioritySpecialPoolUnderrun = 25, + HighPoolPriority = 32, + HighPoolPrioritySpecialPoolOverrun = 40, + HighPoolPrioritySpecialPoolUnderrun = 41 +} EX_POOL_PRIORITY; + +/* PRIVILEGE_SET.Control */ + +#define PRIVILEGE_SET_ALL_NECESSARY 1 + +typedef struct _RTL_OSVERSIONINFOW { + ULONG dwOSVersionInfoSize; + ULONG dwMajorVersion; + ULONG dwMinorVersion; + ULONG dwBuildNumber; + ULONG dwPlatformId; + WCHAR szCSDVersion[128]; +} RTL_OSVERSIONINFOW, *PRTL_OSVERSIONINFOW; + +typedef struct _RTL_OSVERSIONINFOEXW { + ULONG dwOSVersionInfoSize; + ULONG dwMajorVersion; + ULONG dwMinorVersion; + ULONG dwBuildNumber; + ULONG dwPlatformId; + WCHAR szCSDVersion[128]; + USHORT wServicePackMajor; + USHORT wServicePackMinor; + USHORT wSuiteMask; + UCHAR wProductType; + UCHAR wReserved; +} RTL_OSVERSIONINFOEXW, *PRTL_OSVERSIONINFOEXW; + +NTOSAPI +ULONGLONG +DDKAPI +VerSetConditionMask( + IN ULONGLONG ConditionMask, + IN ULONG TypeMask, + IN UCHAR Condition); + +#define VER_SET_CONDITION(ConditionMask, TypeBitMask, ComparisonType) \ + ((ConditionMask) = VerSetConditionMask((ConditionMask), \ + (TypeBitMask), (ComparisonType))) + +/* RtlVerifyVersionInfo() TypeMask */ + +#define VER_MINORVERSION 0x0000001 +#define VER_MAJORVERSION 0x0000002 +#define VER_BUILDNUMBER 0x0000004 +#define VER_PLATFORMID 0x0000008 +#define VER_SERVICEPACKMINOR 0x0000010 +#define VER_SERVICEPACKMAJOR 0x0000020 +#define VER_SUITENAME 0x0000040 +#define VER_PRODUCT_TYPE 0x0000080 + +/* RtlVerifyVersionInfo() ComparisonType */ + +#define VER_EQUAL 1 +#define VER_GREATER 2 +#define VER_GREATER_EQUAL 3 +#define VER_LESS 4 +#define VER_LESS_EQUAL 5 +#define VER_AND 6 +#define VER_OR 7 + +#define VER_CONDITION_MASK 7 +#define VER_NUM_BITS_PER_CONDITION_MASK 3 + +typedef struct _RTL_BITMAP { + ULONG SizeOfBitMap; + PULONG Buffer; +} RTL_BITMAP, *PRTL_BITMAP; + +typedef struct _RTL_BITMAP_RUN { + ULONG StartingIndex; + ULONG NumberOfBits; +} RTL_BITMAP_RUN, *PRTL_BITMAP_RUN; + +typedef struct _RTL_RANGE_LIST +{ + LIST_ENTRY ListHead; + ULONG Flags; /* RTL_RANGE_LIST_... flags */ + ULONG Count; + ULONG Stamp; +} RTL_RANGE_LIST, *PRTL_RANGE_LIST; + +typedef struct _RTL_RANGE +{ + ULONGLONG Start; + ULONGLONG End; + PVOID UserData; + PVOID Owner; + UCHAR Attributes; + UCHAR Flags; /* RTL_RANGE_... flags */ +} RTL_RANGE, *PRTL_RANGE; + +typedef struct _RANGE_LIST_ITERATOR +{ + PLIST_ENTRY RangeListHead; + PLIST_ENTRY MergedHead; + PVOID Current; + ULONG Stamp; +} RTL_RANGE_LIST_ITERATOR, *PRTL_RANGE_LIST_ITERATOR; + +typedef BOOLEAN +(NTAPI *PRTL_CONFLICT_RANGE_CALLBACK) ( + PVOID Context, + struct _RTL_RANGE *Range +); + +typedef NTSTATUS +(DDKAPI *PRTL_QUERY_REGISTRY_ROUTINE)( + IN PWSTR ValueName, + IN ULONG ValueType, + IN PVOID ValueData, + IN ULONG ValueLength, + IN PVOID Context, + IN PVOID EntryContext); + +#define RTL_REGISTRY_ABSOLUTE 0 +#define RTL_REGISTRY_SERVICES 1 +#define RTL_REGISTRY_CONTROL 2 +#define RTL_REGISTRY_WINDOWS_NT 3 +#define RTL_REGISTRY_DEVICEMAP 4 +#define RTL_REGISTRY_USER 5 +#define RTL_REGISTRY_HANDLE 0x40000000 +#define RTL_REGISTRY_OPTIONAL 0x80000000 + +/* RTL_QUERY_REGISTRY_TABLE.Flags */ +#define RTL_QUERY_REGISTRY_SUBKEY 0x00000001 +#define RTL_QUERY_REGISTRY_TOPKEY 0x00000002 +#define RTL_QUERY_REGISTRY_REQUIRED 0x00000004 +#define RTL_QUERY_REGISTRY_NOVALUE 0x00000008 +#define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010 +#define RTL_QUERY_REGISTRY_DIRECT 0x00000020 +#define RTL_QUERY_REGISTRY_DELETE 0x00000040 + +typedef struct _RTL_QUERY_REGISTRY_TABLE { + PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine; + ULONG Flags; + PWSTR Name; + PVOID EntryContext; + ULONG DefaultType; + PVOID DefaultData; + ULONG DefaultLength; +} RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE; + +typedef struct _TIME_FIELDS { + CSHORT Year; + CSHORT Month; + CSHORT Day; + CSHORT Hour; + CSHORT Minute; + CSHORT Second; + CSHORT Milliseconds; + CSHORT Weekday; +} TIME_FIELDS, *PTIME_FIELDS; + +typedef PVOID +(DDKAPI *PALLOCATE_FUNCTION)( + IN POOL_TYPE PoolType, + IN SIZE_T NumberOfBytes, + IN ULONG Tag); + +typedef VOID +(DDKAPI *PFREE_FUNCTION)( + IN PVOID Buffer); + +typedef struct _GENERAL_LOOKASIDE { + SLIST_HEADER ListHead; + USHORT Depth; + USHORT MaximumDepth; + ULONG TotalAllocates; + union { + ULONG AllocateMisses; + ULONG AllocateHits; + }; + ULONG TotalFrees; + union { + ULONG FreeMisses; + ULONG FreeHits; + }; + POOL_TYPE Type; + ULONG Tag; + ULONG Size; + PALLOCATE_FUNCTION Allocate; + PFREE_FUNCTION Free; + LIST_ENTRY ListEntry; + ULONG LastTotalAllocates; + union { + ULONG LastAllocateMisses; + ULONG LastAllocateHits; + }; + ULONG Future[2]; +} GENERAL_LOOKASIDE, *PGENERAL_LOOKASIDE; + +typedef struct _NPAGED_LOOKASIDE_LIST { + GENERAL_LOOKASIDE L; + KSPIN_LOCK Obsoleted; +} NPAGED_LOOKASIDE_LIST, *PNPAGED_LOOKASIDE_LIST; + +typedef struct _PAGED_LOOKASIDE_LIST { + GENERAL_LOOKASIDE L; + FAST_MUTEX Obsoleted; +} PAGED_LOOKASIDE_LIST, *PPAGED_LOOKASIDE_LIST; + +typedef struct _CALLBACK_OBJECT *PCALLBACK_OBJECT; + +typedef VOID +(DDKAPI *PCALLBACK_FUNCTION)( + IN PVOID CallbackContext, + IN PVOID Argument1, + IN PVOID Argument2); + +typedef enum _EVENT_TYPE { + NotificationEvent, + SynchronizationEvent +} EVENT_TYPE; + +typedef enum _KWAIT_REASON { + Executive, + FreePage, + PageIn, + PoolAllocation, + DelayExecution, + Suspended, + UserRequest, + WrExecutive, + WrFreePage, + WrPageIn, + WrPoolAllocation, + WrDelayExecution, + WrSuspended, + WrUserRequest, + WrEventPair, + WrQueue, + WrLpcReceive, + WrLpcReply, + WrVirtualMemory, + WrPageOut, + WrRendezvous, + Spare2, + WrGuardedMutex, + Spare4, + Spare5, + Spare6, + WrKernel, + WrResource, + WrPushLock, + WrMutex, + WrQuantumEnd, + WrDispatchInt, + WrPreempted, + WrYieldExecution, + MaximumWaitReason +} KWAIT_REASON; + +typedef struct _KWAIT_BLOCK { + LIST_ENTRY WaitListEntry; + struct _KTHREAD * RESTRICTED_POINTER Thread; + PVOID Object; + struct _KWAIT_BLOCK * RESTRICTED_POINTER NextWaitBlock; + USHORT WaitKey; + UCHAR WaitType; + UCHAR SpareByte; +} KWAIT_BLOCK, *PKWAIT_BLOCK, *RESTRICTED_POINTER PRKWAIT_BLOCK; + +typedef struct _IO_REMOVE_LOCK_TRACKING_BLOCK * PIO_REMOVE_LOCK_TRACKING_BLOCK; + +typedef struct _IO_REMOVE_LOCK_COMMON_BLOCK { + BOOLEAN Removed; + BOOLEAN Reserved[3]; + LONG IoCount; + KEVENT RemoveEvent; +} IO_REMOVE_LOCK_COMMON_BLOCK; + +typedef struct _IO_REMOVE_LOCK_DBG_BLOCK { + LONG Signature; + LONG HighWatermark; + LONGLONG MaxLockedTicks; + LONG AllocateTag; + LIST_ENTRY LockList; + KSPIN_LOCK Spin; + LONG LowMemoryCount; + ULONG Reserved1[4]; + PVOID Reserved2; + PIO_REMOVE_LOCK_TRACKING_BLOCK Blocks; +} IO_REMOVE_LOCK_DBG_BLOCK; + +typedef struct _IO_REMOVE_LOCK { + IO_REMOVE_LOCK_COMMON_BLOCK Common; +#ifdef DBG + IO_REMOVE_LOCK_DBG_BLOCK Dbg; +#endif +} IO_REMOVE_LOCK, *PIO_REMOVE_LOCK; + +typedef struct _IO_WORKITEM *PIO_WORKITEM; + +typedef VOID +(DDKAPI *PIO_WORKITEM_ROUTINE)( + IN PDEVICE_OBJECT DeviceObject, + IN PVOID Context); + +typedef struct _SHARE_ACCESS { + ULONG OpenCount; + ULONG Readers; + ULONG Writers; + ULONG Deleters; + ULONG SharedRead; + ULONG SharedWrite; + ULONG SharedDelete; +} SHARE_ACCESS, *PSHARE_ACCESS; + +typedef enum _KINTERRUPT_MODE { + LevelSensitive, + Latched +} KINTERRUPT_MODE; + +#define THREAD_WAIT_OBJECTS 3 + +typedef VOID +(DDKAPI *PKINTERRUPT_ROUTINE)( + VOID); + +typedef enum _KPROFILE_SOURCE { + ProfileTime, + ProfileAlignmentFixup, + ProfileTotalIssues, + ProfilePipelineDry, + ProfileLoadInstructions, + ProfilePipelineFrozen, + ProfileBranchInstructions, + ProfileTotalNonissues, + ProfileDcacheMisses, + ProfileIcacheMisses, + ProfileCacheMisses, + ProfileBranchMispredictions, + ProfileStoreInstructions, + ProfileFpInstructions, + ProfileIntegerInstructions, + Profile2Issue, + Profile3Issue, + Profile4Issue, + ProfileSpecialInstructions, + ProfileTotalCycles, + ProfileIcacheIssues, + ProfileDcacheAccesses, + ProfileMemoryBarrierCycles, + ProfileLoadLinkedIssues, + ProfileMaximum +} KPROFILE_SOURCE; + +typedef enum _CREATE_FILE_TYPE { + CreateFileTypeNone, + CreateFileTypeNamedPipe, + CreateFileTypeMailslot +} CREATE_FILE_TYPE; + +typedef struct _CONFIGURATION_INFORMATION { + ULONG DiskCount; + ULONG FloppyCount; + ULONG CdRomCount; + ULONG TapeCount; + ULONG ScsiPortCount; + ULONG SerialCount; + ULONG ParallelCount; + BOOLEAN AtDiskPrimaryAddressClaimed; + BOOLEAN AtDiskSecondaryAddressClaimed; + ULONG Version; + ULONG MediumChangerCount; +} CONFIGURATION_INFORMATION, *PCONFIGURATION_INFORMATION; + +typedef enum _CONFIGURATION_TYPE { + ArcSystem, + CentralProcessor, + FloatingPointProcessor, + PrimaryIcache, + PrimaryDcache, + SecondaryIcache, + SecondaryDcache, + SecondaryCache, + EisaAdapter, + TcAdapter, + ScsiAdapter, + DtiAdapter, + MultiFunctionAdapter, + DiskController, + TapeController, + CdromController, + WormController, + SerialController, + NetworkController, + DisplayController, + ParallelController, + PointerController, + KeyboardController, + AudioController, + OtherController, + DiskPeripheral, + FloppyDiskPeripheral, + TapePeripheral, + ModemPeripheral, + MonitorPeripheral, + PrinterPeripheral, + PointerPeripheral, + KeyboardPeripheral, + TerminalPeripheral, + OtherPeripheral, + LinePeripheral, + NetworkPeripheral, + SystemMemory, + DockingInformation, + RealModeIrqRoutingTable, + MaximumType +} CONFIGURATION_TYPE, *PCONFIGURATION_TYPE; + +#define IO_FORCE_ACCESS_CHECK 0x001 +#define IO_NO_PARAMETER_CHECKING 0x100 + +typedef NTSTATUS +(DDKAPI *PIO_QUERY_DEVICE_ROUTINE)( + IN PVOID Context, + IN PUNICODE_STRING PathName, + IN INTERFACE_TYPE BusType, + IN ULONG BusNumber, + IN PKEY_VALUE_FULL_INFORMATION *BusInformation, + IN CONFIGURATION_TYPE ControllerType, + IN ULONG ControllerNumber, + IN PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + IN CONFIGURATION_TYPE PeripheralType, + IN ULONG PeripheralNumber, + IN PKEY_VALUE_FULL_INFORMATION *PeripheralInformation); + +typedef enum _IO_QUERY_DEVICE_DATA_FORMAT { + IoQueryDeviceIdentifier = 0, + IoQueryDeviceConfigurationData, + IoQueryDeviceComponentInformation, + IoQueryDeviceMaxData +} IO_QUERY_DEVICE_DATA_FORMAT, *PIO_QUERY_DEVICE_DATA_FORMAT; + +typedef enum _WORK_QUEUE_TYPE { + CriticalWorkQueue, + DelayedWorkQueue, + HyperCriticalWorkQueue, + MaximumWorkQueue +} WORK_QUEUE_TYPE; + +typedef VOID +(DDKAPI *PWORKER_THREAD_ROUTINE)( + IN PVOID Parameter); + +typedef struct _WORK_QUEUE_ITEM { + LIST_ENTRY List; + PWORKER_THREAD_ROUTINE WorkerRoutine; + PVOID Parameter; +} WORK_QUEUE_ITEM, *PWORK_QUEUE_ITEM; + +typedef enum _KBUGCHECK_CALLBACK_REASON { + KbCallbackInvalid, + KbCallbackReserved1, + KbCallbackSecondaryDumpData, + KbCallbackDumpIo, +} KBUGCHECK_CALLBACK_REASON; + +typedef VOID +(DDKAPI *PKBUGCHECK_REASON_CALLBACK_ROUTINE)( + IN KBUGCHECK_CALLBACK_REASON Reason, + IN struct _KBUGCHECK_REASON_CALLBACK_RECORD *Record, + IN OUT PVOID ReasonSpecificData, + IN ULONG ReasonSpecificDataLength); + +typedef struct _KBUGCHECK_REASON_CALLBACK_RECORD { + LIST_ENTRY Entry; + PKBUGCHECK_REASON_CALLBACK_ROUTINE CallbackRoutine; + PUCHAR Component; + ULONG_PTR Checksum; + KBUGCHECK_CALLBACK_REASON Reason; + UCHAR State; +} KBUGCHECK_REASON_CALLBACK_RECORD, *PKBUGCHECK_REASON_CALLBACK_RECORD; + +typedef enum _KBUGCHECK_BUFFER_DUMP_STATE { + BufferEmpty, + BufferInserted, + BufferStarted, + BufferFinished, + BufferIncomplete +} KBUGCHECK_BUFFER_DUMP_STATE; + +typedef VOID +(DDKAPI *PKBUGCHECK_CALLBACK_ROUTINE)( + IN PVOID Buffer, + IN ULONG Length); + +typedef struct _KBUGCHECK_CALLBACK_RECORD { + LIST_ENTRY Entry; + PKBUGCHECK_CALLBACK_ROUTINE CallbackRoutine; + PVOID Buffer; + ULONG Length; + PUCHAR Component; + ULONG_PTR Checksum; + UCHAR State; +} KBUGCHECK_CALLBACK_RECORD, *PKBUGCHECK_CALLBACK_RECORD; + +/* + * VOID + * KeInitializeCallbackRecord( + * IN PKBUGCHECK_CALLBACK_RECORD CallbackRecord) + */ +#define KeInitializeCallbackRecord(CallbackRecord) \ + CallbackRecord->State = BufferEmpty; + +typedef enum _KDPC_IMPORTANCE { + LowImportance, + MediumImportance, + HighImportance +} KDPC_IMPORTANCE; + +typedef enum _MEMORY_CACHING_TYPE_ORIG { + MmFrameBufferCached = 2 +} MEMORY_CACHING_TYPE_ORIG; + +typedef enum _MEMORY_CACHING_TYPE { + MmNonCached = FALSE, + MmCached = TRUE, + MmWriteCombined = MmFrameBufferCached, + MmHardwareCoherentCached, + MmNonCachedUnordered, + MmUSWCCached, + MmMaximumCacheType +} MEMORY_CACHING_TYPE; + +typedef enum _MM_PAGE_PRIORITY { + LowPagePriority, + NormalPagePriority = 16, + HighPagePriority = 32 +} MM_PAGE_PRIORITY; + +typedef enum _LOCK_OPERATION { + IoReadAccess, + IoWriteAccess, + IoModifyAccess +} LOCK_OPERATION; + +typedef enum _MM_SYSTEM_SIZE { + MmSmallSystem, + MmMediumSystem, + MmLargeSystem +} MM_SYSTEM_SIZE; + +typedef struct _OBJECT_HANDLE_INFORMATION { + ULONG HandleAttributes; + ACCESS_MASK GrantedAccess; +} OBJECT_HANDLE_INFORMATION, *POBJECT_HANDLE_INFORMATION; + +typedef struct _CLIENT_ID { + HANDLE UniqueProcess; + HANDLE UniqueThread; +} CLIENT_ID, *PCLIENT_ID; + +typedef VOID +(DDKAPI *PKSTART_ROUTINE)( + IN PVOID StartContext); + +typedef VOID +(DDKAPI *PCREATE_PROCESS_NOTIFY_ROUTINE)( + IN HANDLE ParentId, + IN HANDLE ProcessId, + IN BOOLEAN Create); + +typedef VOID +(DDKAPI *PCREATE_THREAD_NOTIFY_ROUTINE)( + IN HANDLE ProcessId, + IN HANDLE ThreadId, + IN BOOLEAN Create); + +typedef struct _IMAGE_INFO { + _ANONYMOUS_UNION union { + ULONG Properties; + _ANONYMOUS_STRUCT struct { + ULONG ImageAddressingMode : 8; + ULONG SystemModeImage : 1; + ULONG ImageMappedToAllPids : 1; + ULONG Reserved : 22; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + PVOID ImageBase; + ULONG ImageSelector; + SIZE_T ImageSize; + ULONG ImageSectionNumber; +} IMAGE_INFO, *PIMAGE_INFO; + +#define IMAGE_ADDRESSING_MODE_32BIT 3 + +typedef VOID +(DDKAPI *PLOAD_IMAGE_NOTIFY_ROUTINE)( + IN PUNICODE_STRING FullImageName, + IN HANDLE ProcessId, + IN PIMAGE_INFO ImageInfo); + +typedef enum _PROCESSINFOCLASS { + ProcessBasicInformation, + ProcessQuotaLimits, + ProcessIoCounters, + ProcessVmCounters, + ProcessTimes, + ProcessBasePriority, + ProcessRaisePriority, + ProcessDebugPort, + ProcessExceptionPort, + ProcessAccessToken, + ProcessLdtInformation, + ProcessLdtSize, + ProcessDefaultHardErrorMode, + ProcessIoPortHandlers, + ProcessPooledUsageAndLimits, + ProcessWorkingSetWatch, + ProcessUserModeIOPL, + ProcessEnableAlignmentFaultFixup, + ProcessPriorityClass, + ProcessWx86Information, + ProcessHandleCount, + ProcessAffinityMask, + ProcessPriorityBoost, + ProcessDeviceMap, + ProcessSessionInformation, + ProcessForegroundInformation, + ProcessWow64Information, + ProcessImageFileName, + ProcessLUIDDeviceMapsEnabled, + ProcessBreakOnTermination, + ProcessDebugObjectHandle, + ProcessDebugFlags, + ProcessHandleTracing, + ProcessIoPriority, + ProcessExecuteFlags, + ProcessTlsInformation, + ProcessCookie, + ProcessImageInformation, + ProcessCycleTime, + ProcessPagePriority, + ProcessInstrumentationCallback, + MaxProcessInfoClass +} PROCESSINFOCLASS; + +typedef enum _THREADINFOCLASS { + ThreadBasicInformation, + ThreadTimes, + ThreadPriority, + ThreadBasePriority, + ThreadAffinityMask, + ThreadImpersonationToken, + ThreadDescriptorTableEntry, + ThreadEnableAlignmentFaultFixup, + ThreadEventPair_Reusable, + ThreadQuerySetWin32StartAddress, + ThreadZeroTlsCell, + ThreadPerformanceCount, + ThreadAmILastThread, + ThreadIdealProcessor, + ThreadPriorityBoost, + ThreadSetTlsArrayAddress, + ThreadIsIoPending, + ThreadHideFromDebugger, + ThreadBreakOnTermination, + ThreadSwitchLegacyState, + ThreadIsTerminated, + ThreadLastSystemCall, + ThreadIoPriority, + ThreadCycleTime, + ThreadPagePriority, + ThreadActualBasePriority, + MaxThreadInfoClass +} THREADINFOCLASS; + +typedef struct _PROCESS_BASIC_INFORMATION +{ + NTSTATUS ExitStatus; + PPEB PebBaseAddress; + ULONG_PTR AffinityMask; + KPRIORITY BasePriority; + ULONG_PTR UniqueProcessId; + ULONG_PTR InheritedFromUniqueProcessId; +} PROCESS_BASIC_INFORMATION,*PPROCESS_BASIC_INFORMATION; + +typedef struct _PROCESS_WS_WATCH_INFORMATION +{ + PVOID FaultingPc; + PVOID FaultingVa; +} PROCESS_WS_WATCH_INFORMATION, *PPROCESS_WS_WATCH_INFORMATION; + +typedef struct _PROCESS_DEVICEMAP_INFORMATION +{ + union + { + struct + { + HANDLE DirectoryHandle; + } Set; + struct + { + ULONG DriveMap; + UCHAR DriveType[32]; + } Query; + }; +} PROCESS_DEVICEMAP_INFORMATION, *PPROCESS_DEVICEMAP_INFORMATION; + +typedef struct _KERNEL_USER_TIMES +{ + LARGE_INTEGER CreateTime; + LARGE_INTEGER ExitTime; + LARGE_INTEGER KernelTime; + LARGE_INTEGER UserTime; +} KERNEL_USER_TIMES, *PKERNEL_USER_TIMES; + +typedef struct _PROCESS_ACCESS_TOKEN +{ + HANDLE Token; + HANDLE Thread; +} PROCESS_ACCESS_TOKEN, *PPROCESS_ACCESS_TOKEN; + +typedef struct _PROCESS_SESSION_INFORMATION +{ + ULONG SessionId; +} PROCESS_SESSION_INFORMATION, *PPROCESS_SESSION_INFORMATION; + +#define ES_SYSTEM_REQUIRED 0x00000001 +#define ES_DISPLAY_REQUIRED 0x00000002 +#define ES_USER_PRESENT 0x00000004 +#define ES_CONTINUOUS 0x80000000 + +typedef ULONG EXECUTION_STATE; + +typedef VOID +(DDKAPI *PREQUEST_POWER_COMPLETE)( + IN PDEVICE_OBJECT DeviceObject, + IN UCHAR MinorFunction, + IN POWER_STATE PowerState, + IN PVOID Context, + IN PIO_STATUS_BLOCK IoStatus); + +typedef enum _TRACE_INFORMATION_CLASS { + TraceIdClass, + TraceHandleClass, + TraceEnableFlagsClass, + TraceEnableLevelClass, + GlobalLoggerHandleClass, + EventLoggerHandleClass, + AllLoggerHandlesClass, + TraceHandleByNameClass +} TRACE_INFORMATION_CLASS; + +typedef enum _REG_NOTIFY_CLASS +{ + RegNtDeleteKey, + RegNtPreDeleteKey = RegNtDeleteKey, + RegNtSetValueKey, + RegNtPreSetValueKey = RegNtSetValueKey, + RegNtDeleteValueKey, + RegNtPreDeleteValueKey = RegNtDeleteValueKey, + RegNtSetInformationKey, + RegNtPreSetInformationKey = RegNtSetInformationKey, + RegNtRenameKey, + RegNtPreRenameKey = RegNtRenameKey, + RegNtEnumerateKey, + RegNtPreEnumerateKey = RegNtEnumerateKey, + RegNtEnumerateValueKey, + RegNtPreEnumerateValueKey = RegNtEnumerateValueKey, + RegNtQueryKey, + RegNtPreQueryKey = RegNtQueryKey, + RegNtQueryValueKey, + RegNtPreQueryValueKey = RegNtQueryValueKey, + RegNtQueryMultipleValueKey, + RegNtPreQueryMultipleValueKey = RegNtQueryMultipleValueKey, + RegNtPreCreateKey, + RegNtPostCreateKey, + RegNtPreOpenKey, + RegNtPostOpenKey, + RegNtKeyHandleClose, + RegNtPreKeyHandleClose = RegNtKeyHandleClose, + RegNtPostDeleteKey, + RegNtPostSetValueKey, + RegNtPostDeleteValueKey, + RegNtPostSetInformationKey, + RegNtPostRenameKey, + RegNtPostEnumerateKey, + RegNtPostEnumerateValueKey, + RegNtPostQueryKey, + RegNtPostQueryValueKey, + RegNtPostQueryMultipleValueKey, + RegNtPostKeyHandleClose, + RegNtPreCreateKeyEx, + RegNtPostCreateKeyEx, + RegNtPreOpenKeyEx, + RegNtPostOpenKeyEx +} REG_NOTIFY_CLASS, *PREG_NOTIFY_CLASS; + +typedef NTSTATUS +(DDKAPI *PEX_CALLBACK_FUNCTION)( + IN PVOID CallbackContext, + IN REG_NOTIFY_CLASS Argument1, + IN PVOID Argument2); + +typedef struct _REG_DELETE_KEY_INFORMATION +{ + PVOID Object; +} REG_DELETE_KEY_INFORMATION, *PREG_DELETE_KEY_INFORMATION; + +typedef struct _REG_SET_VALUE_KEY_INFORMATION +{ + PVOID Object; + PUNICODE_STRING ValueName; + ULONG TitleIndex; + ULONG Type; + PVOID Data; + ULONG DataSize; +} REG_SET_VALUE_KEY_INFORMATION, *PREG_SET_VALUE_KEY_INFORMATION; + +typedef struct _REG_DELETE_VALUE_KEY_INFORMATION +{ + PVOID Object; + PUNICODE_STRING ValueName; +} REG_DELETE_VALUE_KEY_INFORMATION, *PREG_DELETE_VALUE_KEY_INFORMATION; + +typedef struct _REG_SET_INFORMATION_KEY_INFORMATION +{ + PVOID Object; + KEY_SET_INFORMATION_CLASS KeySetInformationClass; + PVOID KeySetInformation; + ULONG KeySetInformationLength; +} REG_SET_INFORMATION_KEY_INFORMATION, *PREG_SET_INFORMATION_KEY_INFORMATION; + +typedef struct _REG_ENUMERATE_KEY_INFORMATION +{ + PVOID Object; + ULONG Index; + KEY_INFORMATION_CLASS KeyInformationClass; + PVOID KeyInformation; + ULONG Length; + PULONG ResultLength; +} REG_ENUMERATE_KEY_INFORMATION, *PREG_ENUMERATE_KEY_INFORMATION; + +typedef struct _REG_ENUMERATE_VALUE_KEY_INFORMATION +{ + PVOID Object; + ULONG Index; + KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass; + PVOID KeyValueInformation; + ULONG Length; + PULONG ResultLength; +} REG_ENUMERATE_VALUE_KEY_INFORMATION, *PREG_ENUMERATE_VALUE_KEY_INFORMATION; + +typedef struct _REG_QUERY_KEY_INFORMATION +{ + PVOID Object; + KEY_INFORMATION_CLASS KeyInformationClass; + PVOID KeyInformation; + ULONG Length; + PULONG ResultLength; +} REG_QUERY_KEY_INFORMATION, *PREG_QUERY_KEY_INFORMATION; + +typedef struct _REG_QUERY_VALUE_KEY_INFORMATION +{ + PVOID Object; + PUNICODE_STRING ValueName; + KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass; + PVOID KeyValueInformation; + ULONG Length; + PULONG ResultLength; +} REG_QUERY_VALUE_KEY_INFORMATION, *PREG_QUERY_VALUE_KEY_INFORMATION; + +typedef struct _REG_QUERY_MULTIPLE_VALUE_KEY_INFORMATION +{ + PVOID Object; + PKEY_VALUE_ENTRY ValueEntries; + ULONG EntryCount; + PVOID ValueBuffer; + PULONG BufferLength; + PULONG RequiredBufferLength; +} REG_QUERY_MULTIPLE_VALUE_KEY_INFORMATION, *PREG_QUERY_MULTIPLE_VALUE_KEY_INFORMATION; + +typedef struct _REG_PRE_CREATE_KEY_INFORMATION +{ + PUNICODE_STRING CompleteName; +} REG_PRE_CREATE_KEY_INFORMATION, *PREG_PRE_CREATE_KEY_INFORMATION; + +typedef struct _REG_POST_CREATE_KEY_INFORMATION +{ + PUNICODE_STRING CompleteName; + PVOID Object; + NTSTATUS Status; +} REG_POST_CREATE_KEY_INFORMATION, *PREG_POST_CREATE_KEY_INFORMATION; + +typedef struct _REG_PRE_OPEN_KEY_INFORMATION +{ + PUNICODE_STRING CompleteName; +} REG_PRE_OPEN_KEY_INFORMATION, *PREG_PRE_OPEN_KEY_INFORMATION; + +typedef struct _REG_POST_OPEN_KEY_INFORMATION +{ + PUNICODE_STRING CompleteName; + PVOID Object; + NTSTATUS Status; +} REG_POST_OPEN_KEY_INFORMATION, *PREG_POST_OPEN_KEY_INFORMATION; + +typedef struct _REG_POST_OPERATION_INFORMATION +{ + PVOID Object; + NTSTATUS Status; +} REG_POST_OPERATION_INFORMATION,*PREG_POST_OPERATION_INFORMATION; + +/* +** Storage structures +*/ +typedef enum _PARTITION_STYLE { + PARTITION_STYLE_MBR, + PARTITION_STYLE_GPT +} PARTITION_STYLE; + +typedef struct _CREATE_DISK_MBR { + ULONG Signature; +} CREATE_DISK_MBR, *PCREATE_DISK_MBR; + +typedef struct _CREATE_DISK_GPT { + GUID DiskId; + ULONG MaxPartitionCount; +} CREATE_DISK_GPT, *PCREATE_DISK_GPT; + +typedef struct _CREATE_DISK { + PARTITION_STYLE PartitionStyle; + _ANONYMOUS_UNION union { + CREATE_DISK_MBR Mbr; + CREATE_DISK_GPT Gpt; + } DUMMYUNIONNAME; +} CREATE_DISK, *PCREATE_DISK; + +typedef struct _DISK_SIGNATURE { + ULONG PartitionStyle; + _ANONYMOUS_UNION union { + struct { + ULONG Signature; + ULONG CheckSum; + } Mbr; + struct { + GUID DiskId; + } Gpt; + } DUMMYUNIONNAME; +} DISK_SIGNATURE, *PDISK_SIGNATURE; + +typedef VOID +(DDKFASTAPI*PTIME_UPDATE_NOTIFY_ROUTINE)( + IN HANDLE ThreadId, + IN KPROCESSOR_MODE Mode); + +#define DBG_STATUS_CONTROL_C 1 +#define DBG_STATUS_SYSRQ 2 +#define DBG_STATUS_BUGCHECK_FIRST 3 +#define DBG_STATUS_BUGCHECK_SECOND 4 +#define DBG_STATUS_FATAL 5 +#define DBG_STATUS_DEBUG_CONTROL 6 +#define DBG_STATUS_WORKER 7 + +typedef struct _PHYSICAL_MEMORY_RANGE { + PHYSICAL_ADDRESS BaseAddress; + LARGE_INTEGER NumberOfBytes; +} PHYSICAL_MEMORY_RANGE, *PPHYSICAL_MEMORY_RANGE; + +typedef ULONG_PTR +(*PDRIVER_VERIFIER_THUNK_ROUTINE)( + IN PVOID Context); + +typedef struct _DRIVER_VERIFIER_THUNK_PAIRS { + PDRIVER_VERIFIER_THUNK_ROUTINE PristineRoutine; + PDRIVER_VERIFIER_THUNK_ROUTINE NewRoutine; +} DRIVER_VERIFIER_THUNK_PAIRS, *PDRIVER_VERIFIER_THUNK_PAIRS; + +#define DRIVER_VERIFIER_SPECIAL_POOLING 0x0001 +#define DRIVER_VERIFIER_FORCE_IRQL_CHECKING 0x0002 +#define DRIVER_VERIFIER_INJECT_ALLOCATION_FAILURES 0x0004 +#define DRIVER_VERIFIER_TRACK_POOL_ALLOCATIONS 0x0008 +#define DRIVER_VERIFIER_IO_CHECKING 0x0010 + +#define HASH_STRING_ALGORITHM_DEFAULT 0 +#define HASH_STRING_ALGORITHM_X65599 1 +#define HASH_STRING_ALGORITHM_INVALID 0xffffffff + +typedef enum _SUITE_TYPE { + SmallBusiness, + Enterprise, + BackOffice, + CommunicationServer, + TerminalServer, + SmallBusinessRestricted, + EmbeddedNT, + DataCenter, + SingleUserTS, + Personal, + Blade, + MaxSuiteType +} SUITE_TYPE; + +typedef VOID +(DDKAPI *PTIMER_APC_ROUTINE)( + IN PVOID TimerContext, + IN ULONG TimerLowValue, + IN LONG TimerHighValue); + + + +/* +** WMI structures +*/ + +typedef VOID +(DDKAPI *WMI_NOTIFICATION_CALLBACK)( + PVOID Wnode, + PVOID Context); + + +/* +** Architecture specific structures +*/ + +#ifdef _X86_ + +typedef ULONG PFN_NUMBER, *PPFN_NUMBER; + +#define PASSIVE_LEVEL 0 +#define LOW_LEVEL 0 +#define APC_LEVEL 1 +#define DISPATCH_LEVEL 2 +#define PROFILE_LEVEL 27 +#define CLOCK1_LEVEL 28 +#define CLOCK2_LEVEL 28 +#define IPI_LEVEL 29 +#define SYNCH_LEVEL (IPI_LEVEL-1) +#define POWER_LEVEL 30 +#define HIGH_LEVEL 31 + +typedef struct _KPCR_TIB { + PVOID ExceptionList; /* 00 */ + PVOID StackBase; /* 04 */ + PVOID StackLimit; /* 08 */ + PVOID SubSystemTib; /* 0C */ + _ANONYMOUS_UNION union { + PVOID FiberData; /* 10 */ + DWORD Version; /* 10 */ + } DUMMYUNIONNAME; + PVOID ArbitraryUserPointer; /* 14 */ + struct _KPCR_TIB *Self; /* 18 */ +} KPCR_TIB, *PKPCR_TIB; /* 1C */ + +#define PCR_MINOR_VERSION 1 +#define PCR_MAJOR_VERSION 1 + +typedef struct _KPCR { + KPCR_TIB Tib; /* 00 */ + struct _KPCR *Self; /* 1C */ + struct _KPRCB *Prcb; /* 20 */ + KIRQL Irql; /* 24 */ + ULONG IRR; /* 28 */ + ULONG IrrActive; /* 2C */ + ULONG IDR; /* 30 */ + PVOID KdVersionBlock; /* 34 */ + PUSHORT IDT; /* 38 */ + PUSHORT GDT; /* 3C */ + struct _KTSS *TSS; /* 40 */ + USHORT MajorVersion; /* 44 */ + USHORT MinorVersion; /* 46 */ + KAFFINITY SetMember; /* 48 */ + ULONG StallScaleFactor; /* 4C */ + UCHAR SpareUnused; /* 50 */ + UCHAR Number; /* 51 */ +} KPCR, *PKPCR; /* 54 */ + +typedef struct _KFLOATING_SAVE { + ULONG ControlWord; + ULONG StatusWord; + ULONG ErrorOffset; + ULONG ErrorSelector; + ULONG DataOffset; + ULONG DataSelector; + ULONG Cr0NpxState; + ULONG Spare1; +} KFLOATING_SAVE, *PKFLOATING_SAVE; + +#define PAGE_SIZE 0x1000 +#define PAGE_SHIFT 12L + +extern NTOSAPI PVOID MmHighestUserAddress; +extern NTOSAPI PVOID MmSystemRangeStart; +extern NTOSAPI ULONG_PTR MmUserProbeAddress; + +#define MM_HIGHEST_USER_ADDRESS MmHighestUserAddress +#define MM_SYSTEM_RANGE_START MmSystemRangeStart +#define MM_USER_PROBE_ADDRESS MmUserProbeAddress +#define MM_LOWEST_USER_ADDRESS (PVOID)0x10000 +#define MM_LOWEST_SYSTEM_ADDRESS (PVOID)0xC0C00000 + +#define KI_USER_SHARED_DATA 0xffdf0000 +#define SharedUserData ((KUSER_SHARED_DATA * CONST) KI_USER_SHARED_DATA) + +#define EFLAG_SIGN 0x8000 +#define EFLAG_ZERO 0x4000 +#define EFLAG_SELECT (EFLAG_SIGN | EFLAG_ZERO) + +#define RESULT_NEGATIVE ((EFLAG_SIGN & ~EFLAG_ZERO) & EFLAG_SELECT) +#define RESULT_ZERO ((~EFLAG_SIGN & EFLAG_ZERO) & EFLAG_SELECT) +#define RESULT_POSITIVE ((~EFLAG_SIGN & ~EFLAG_ZERO) & EFLAG_SELECT) + +typedef enum _INTERLOCKED_RESULT { + ResultNegative = RESULT_NEGATIVE, + ResultZero = RESULT_ZERO, + ResultPositive = RESULT_POSITIVE +} INTERLOCKED_RESULT; + +NTHALAPI +KIRQL +DDKAPI +KeGetCurrentIrql( + VOID); + +static __inline +ULONG +DDKAPI +KeGetCurrentProcessorNumber(VOID) +{ +#if defined(__GNUC__) + ULONG ret; + __asm__ __volatile__ ( + "movl %%fs:%c1, %0\n" + : "=r" (ret) + : "i" (FIELD_OFFSET(KPCR, Number)) + ); + return ret; +#elif defined(_MSC_VER) +#if _MSC_FULL_VER >= 13012035 + return (ULONG)__readfsbyte(FIELD_OFFSET(KPCR, Number)); +#else + __asm { movzx eax, _PCR KPCR.Number } +#endif +#else +#error Unknown compiler +#endif +} + +#if !defined(__INTERLOCKED_DECLARED) +#define __INTERLOCKED_DECLARED + +NTOSAPI +LONG +DDKFASTAPI +InterlockedIncrement( + IN PLONG VOLATILE Addend); + +NTOSAPI +LONG +DDKFASTAPI +InterlockedDecrement( + IN PLONG VOLATILE Addend); + +NTOSAPI +LONG +DDKFASTAPI +InterlockedCompareExchange( + IN OUT PLONG VOLATILE Destination, + IN LONG Exchange, + IN LONG Comparand); + +NTOSAPI +LONG +DDKFASTAPI +InterlockedExchange( + IN OUT PLONG VOLATILE Target, + IN LONG Value); + +NTOSAPI +LONG +DDKFASTAPI +InterlockedExchangeAdd( + IN OUT PLONG VOLATILE Addend, + IN LONG Value); + +/* + * PVOID + * InterlockedExchangePointer( + * IN OUT PVOID VOLATILE *Target, + * IN PVOID Value) + */ +#define InterlockedExchangePointer(Target, Value) \ + ((PVOID) InterlockedExchange((PLONG) Target, (LONG) Value)) + +/* + * PVOID + * InterlockedCompareExchangePointer( + * IN OUT PVOID *Destination, + * IN PVOID Exchange, + * IN PVOID Comparand) + */ +#define InterlockedCompareExchangePointer(Destination, Exchange, Comparand) \ + ((PVOID) InterlockedCompareExchange((PLONG) Destination, (LONG) Exchange, (LONG) Comparand)) + +#endif /* !__INTERLOCKED_DECLARED */ + +NTOSAPI +VOID +DDKFASTAPI +KefAcquireSpinLockAtDpcLevel( + IN PKSPIN_LOCK SpinLock); + +NTOSAPI +VOID +DDKFASTAPI +KefReleaseSpinLockFromDpcLevel( + IN PKSPIN_LOCK SpinLock); + +NTHALAPI +KIRQL +DDKFASTAPI +KfAcquireSpinLock( + IN PKSPIN_LOCK SpinLock); + +NTHALAPI +VOID +DDKFASTAPI +KfReleaseSpinLock( + IN PKSPIN_LOCK SpinLock, + IN KIRQL NewIrql); + +#define KeAcquireSpinLockAtDpcLevel(SpinLock) KefAcquireSpinLockAtDpcLevel(SpinLock) +#define KeReleaseSpinLockFromDpcLevel(SpinLock) KefReleaseSpinLockFromDpcLevel(SpinLock) +#define KeAcquireSpinLock(a,b) *(b) = KfAcquireSpinLock(a) +#define KeReleaseSpinLock(a,b) KfReleaseSpinLock(a,b) + +#define RtlCopyMemoryNonTemporal RtlCopyMemory + +#define KeGetDcacheFillSize() 1L + +#endif /* _X86_ */ + + + +/* +** Utillity functions +*/ + +#define ARGUMENT_PRESENT(ArgumentPointer) \ + ((BOOLEAN) ((PVOID)ArgumentPointer != (PVOID)NULL)) + +/* + * ULONG + * BYTE_OFFSET( + * IN PVOID Va) + */ +#define BYTE_OFFSET(Va) \ + ((ULONG) ((ULONG_PTR) (Va) & (PAGE_SIZE - 1))) + +/* + * ULONG + * BYTES_TO_PAGES( + * IN ULONG Size) + */ +#define BYTES_TO_PAGES(Size) \ + ((ULONG) ((ULONG_PTR) (Size) >> PAGE_SHIFT) + (((ULONG) (Size) & (PAGE_SIZE - 1)) != 0)) + +/* + * PCHAR + * CONTAINING_RECORD( + * IN PCHAR Address, + * IN TYPE Type, + * IN PCHAR Field); + */ +#ifndef CONTAINING_RECORD +#define CONTAINING_RECORD(address, type, field) \ + ((type *)(((ULONG_PTR)address) - (ULONG_PTR)(&(((type *)0)->field)))) +#endif + +/* LONG + * FIELD_OFFSET( + * IN TYPE Type, + * IN PCHAR Field); + */ +#ifndef FIELD_OFFSET +#define FIELD_OFFSET(Type, Field) \ + ((LONG) (&(((Type *) 0)->Field))) +#endif + +/* + * PVOID + * PAGE_ALIGN( + * IN PVOID Va) + */ +#define PAGE_ALIGN(Va) \ + ((PVOID) ((ULONG_PTR)(Va) & ~(PAGE_SIZE - 1))) + +/* + * ULONG_PTR + * ROUND_TO_PAGES( + * IN ULONG_PTR Size) + */ +#define ROUND_TO_PAGES(Size) \ + ((ULONG_PTR) (((ULONG_PTR) Size + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))) + +NTOSAPI +VOID +DDKAPI +RtlAssert( + IN PVOID FailedAssertion, + IN PVOID FileName, + IN ULONG LineNumber, + IN PCHAR Message); + +#ifdef DBG + +#define ASSERT(exp) \ + (VOID)((!(exp)) ? \ + RtlAssert( #exp, __FILE__, __LINE__, NULL ), FALSE : TRUE) + +#define ASSERTMSG(msg, exp) \ + (VOID)((!(exp)) ? \ + RtlAssert( #exp, __FILE__, __LINE__, msg ), FALSE : TRUE) + +#define RTL_SOFT_ASSERT(exp) \ + (VOID)((!(_exp)) ? \ + DbgPrint("%s(%d): Soft assertion failed\n Expression: %s\n", __FILE__, __LINE__, #exp), FALSE : TRUE) + +#define RTL_SOFT_ASSERTMSG(msg, exp) \ + (VOID)((!(exp)) ? \ + DbgPrint("%s(%d): Soft assertion failed\n Expression: %s\n Message: %s\n", __FILE__, __LINE__, #exp, (msg)), FALSE : TRUE) + +#define RTL_VERIFY(exp) ASSERT(exp) +#define RTL_VERIFYMSG(msg, exp) ASSERT(msg, exp) + +#define RTL_SOFT_VERIFY(exp) RTL_SOFT_ASSERT(exp) +#define RTL_SOFT_VERIFYMSG(msg, exp) RTL_SOFT_ASSERTMSG(msg, exp) + +#else /* !DBG */ + +#define ASSERT(exp) ((VOID) 0) +#define ASSERTMSG(msg, exp) ((VOID) 0) + +#define RTL_SOFT_ASSERT(exp) ((VOID) 0) +#define RTL_SOFT_ASSERTMSG(msg, exp) ((VOID) 0) + +#define RTL_VERIFY(exp) ((exp) ? TRUE : FALSE) +#define RTL_VERIFYMSG(msg, exp) ((exp) ? TRUE : FALSE) + +#define RTL_SOFT_VERIFY(exp) ((exp) ? TRUE : FALSE) +#define RTL_SOFT_VERIFYMSG(msg, exp) ((exp) ? TRUE : FALSE) + +#endif /* DBG */ + +/* HACK HACK HACK - GCC (or perhaps LD) is messing this up */ +#if defined(_NTSYSTEM_) || defined(__GNUC__) +#define NLS_MB_CODE_PAGE_TAG NlsMbCodePageTag +#define NLS_MB_OEM_CODE_PAGE_TAG NlsMbOemCodePageTag +#else +#define NLS_MB_CODE_PAGE_TAG (*NlsMbCodePageTag) +#define NLS_MB_OEM_CODE_PAGE_TAG (*NlsMbOemCodePageTag) +#endif /* _NT_SYSTEM */ + +extern BOOLEAN NTSYSAPI NLS_MB_CODE_PAGE_TAG; +extern BOOLEAN NTSYSAPI NLS_MB_OEM_CODE_PAGE_TAG; + +/* +** Driver support routines +*/ + +/** Runtime library routines **/ + +static __inline VOID +InitializeListHead( + IN PLIST_ENTRY ListHead) +{ + ListHead->Flink = ListHead->Blink = ListHead; +} + +static __inline VOID +InsertHeadList( + IN PLIST_ENTRY ListHead, + IN PLIST_ENTRY Entry) +{ + PLIST_ENTRY OldFlink; + OldFlink = ListHead->Flink; + Entry->Flink = OldFlink; + Entry->Blink = ListHead; + OldFlink->Blink = Entry; + ListHead->Flink = Entry; +} + +static __inline VOID +InsertTailList( + IN PLIST_ENTRY ListHead, + IN PLIST_ENTRY Entry) +{ + PLIST_ENTRY OldBlink; + OldBlink = ListHead->Blink; + Entry->Flink = ListHead; + Entry->Blink = OldBlink; + OldBlink->Flink = Entry; + ListHead->Blink = Entry; +} + +/* + * BOOLEAN + * IsListEmpty( + * IN PLIST_ENTRY ListHead) + */ +#define IsListEmpty(_ListHead) \ + ((_ListHead)->Flink == (_ListHead)) + +/* + * PSINGLE_LIST_ENTRY + * PopEntryList( + * IN PSINGLE_LIST_ENTRY ListHead) + */ +#define PopEntryList(ListHead) \ + (ListHead)->Next; \ + { \ + PSINGLE_LIST_ENTRY _FirstEntry; \ + _FirstEntry = (ListHead)->Next; \ + if (_FirstEntry != NULL) \ + (ListHead)->Next = _FirstEntry->Next; \ + } + +/* + * VOID + * PushEntryList( + * IN PSINGLE_LIST_ENTRY ListHead, + * IN PSINGLE_LIST_ENTRY Entry) + */ +#define PushEntryList(_ListHead, _Entry) \ + (_Entry)->Next = (_ListHead)->Next; \ + (_ListHead)->Next = (_Entry); \ + +static __inline BOOLEAN +RemoveEntryList( + IN PLIST_ENTRY Entry) +{ + PLIST_ENTRY OldFlink; + PLIST_ENTRY OldBlink; + + OldFlink = Entry->Flink; + OldBlink = Entry->Blink; + OldFlink->Blink = OldBlink; + OldBlink->Flink = OldFlink; + return (OldFlink == OldBlink); +} + +static __inline PLIST_ENTRY +RemoveHeadList( + IN PLIST_ENTRY ListHead) +{ + PLIST_ENTRY Flink; + PLIST_ENTRY Entry; + + Entry = ListHead->Flink; + Flink = Entry->Flink; + ListHead->Flink = Flink; + Flink->Blink = ListHead; + return Entry; +} + +static __inline PLIST_ENTRY +RemoveTailList( + IN PLIST_ENTRY ListHead) +{ + PLIST_ENTRY Blink; + PLIST_ENTRY Entry; + + Entry = ListHead->Blink; + Blink = Entry->Blink; + ListHead->Blink = Blink; + Blink->Flink = ListHead; + return Entry; +} + +#if !defined(_WINBASE_H) || _WIN32_WINNT < 0x0501 + +NTOSAPI +PSLIST_ENTRY +DDKFASTAPI +InterlockedPopEntrySList( + IN PSLIST_HEADER ListHead); + +NTOSAPI +PSLIST_ENTRY +DDKFASTAPI +InterlockedPushEntrySList( + IN PSLIST_HEADER ListHead, + IN PSLIST_ENTRY ListEntry); + +#endif + +/* + * USHORT + * QueryDepthSList( + * IN PSLIST_HEADER SListHead) + */ +#define QueryDepthSList(_SListHead) \ + ((USHORT) ((_SListHead)->Alignment & 0xffff)) + +#define InterlockedFlushSList(ListHead) ExInterlockedFlushSList(ListHead) + +NTOSAPI +ULONG +DDKAPI +RtlxAnsiStringToUnicodeSize( + IN PCANSI_STRING AnsiString); + +#define RtlAnsiStringToUnicodeSize(STRING) ( \ + NLS_MB_CODE_PAGE_TAG ? \ + RtlxAnsiStringToUnicodeSize(STRING) : \ + ((STRING)->Length + sizeof(ANSI_NULL)) * sizeof(WCHAR) \ +) + +NTOSAPI +NTSTATUS +DDKAPI +RtlAnsiStringToUnicodeString( + IN OUT PUNICODE_STRING DestinationString, + IN PANSI_STRING SourceString, + IN BOOLEAN AllocateDestinationString); + +NTOSAPI +NTSTATUS +DDKAPI +RtlAppendUnicodeStringToString( + IN OUT PUNICODE_STRING Destination, + IN PCUNICODE_STRING Source); + +NTOSAPI +NTSTATUS +DDKAPI +RtlAppendUnicodeToString( + IN OUT PUNICODE_STRING Destination, + IN PCWSTR Source); + +NTOSAPI +BOOLEAN +DDKAPI +RtlAreBitsClear( + IN PRTL_BITMAP BitMapHeader, + IN ULONG StartingIndex, + IN ULONG Length); + +NTOSAPI +BOOLEAN +DDKAPI +RtlAreBitsSet( + IN PRTL_BITMAP BitMapHeader, + IN ULONG StartingIndex, + IN ULONG Length); + +NTOSAPI +NTSTATUS +DDKAPI +RtlCharToInteger( + IN PCSZ String, + IN ULONG Base OPTIONAL, + IN OUT PULONG Value); + +NTOSAPI +ULONG +DDKAPI +RtlCheckBit( + IN PRTL_BITMAP BitMapHeader, + IN ULONG BitPosition); + +NTOSAPI +NTSTATUS +DDKAPI +RtlCheckRegistryKey( + IN ULONG RelativeTo, + IN PWSTR Path); + +NTOSAPI +VOID +DDKAPI +RtlClearAllBits( + IN PRTL_BITMAP BitMapHeader); + +NTOSAPI +VOID +DDKAPI +RtlClearBit( + PRTL_BITMAP BitMapHeader, + ULONG BitNumber); + +NTOSAPI +VOID +DDKAPI +RtlClearBits( + IN PRTL_BITMAP BitMapHeader, + IN ULONG StartingIndex, + IN ULONG NumberToClear); + +NTOSAPI +SIZE_T +DDKAPI +RtlCompareMemory( + IN CONST VOID *Source1, + IN CONST VOID *Source2, + IN SIZE_T Length); + +NTOSAPI +LONG +DDKAPI +RtlCompareString( + IN PSTRING String1, + IN PSTRING String2, + BOOLEAN CaseInSensitive); + +NTOSAPI +LONG +DDKAPI +RtlCompareUnicodeString( + IN PCUNICODE_STRING String1, + IN PCUNICODE_STRING String2, + IN BOOLEAN CaseInSensitive); + +static __inline +LARGE_INTEGER +NTAPI_INLINE +RtlConvertLongToLargeInteger(LONG SignedInteger) +{ + LARGE_INTEGER Result; + + Result.QuadPart = SignedInteger; + return Result; +} + +NTOSAPI +LUID +DDKAPI +RtlConvertLongToLuid( + IN LONG Long); + +NTOSAPI +LARGE_INTEGER +DDKAPI +RtlConvertUlongToLargeInteger( + IN ULONG UnsignedInteger); + +NTOSAPI +LUID +DDKAPI +RtlConvertUlongToLuid( + ULONG Ulong); + +/* + * VOID + * RtlCopyMemory( + * IN VOID UNALIGNED *Destination, + * IN CONST VOID UNALIGNED *Source, + * IN SIZE_T Length) + */ +#ifndef RtlCopyMemory +#define RtlCopyMemory(Destination, Source, Length) \ + memcpy(Destination, Source, Length) +#endif + +#ifndef RtlCopyBytes +#define RtlCopyBytes RtlCopyMemory +#endif + +NTOSAPI +VOID +DDKAPI +RtlCopyMemory32( + IN VOID UNALIGNED *Destination, + IN CONST VOID UNALIGNED *Source, + IN ULONG Length); + +NTOSAPI +VOID +DDKAPI +RtlCopyString( + IN OUT PSTRING DestinationString, + IN PSTRING SourceString OPTIONAL); + +NTOSAPI +VOID +DDKAPI +RtlCopyUnicodeString( + IN OUT PUNICODE_STRING DestinationString, + IN PCUNICODE_STRING SourceString); + +NTOSAPI +NTSTATUS +DDKAPI +RtlCreateRegistryKey( + IN ULONG RelativeTo, + IN PWSTR Path); + +NTOSAPI +NTSTATUS +DDKAPI +RtlCreateSecurityDescriptor( + IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor, + IN ULONG Revision); + +NTOSAPI +NTSTATUS +DDKAPI +RtlDeleteRegistryValue( + IN ULONG RelativeTo, + IN PCWSTR Path, + IN PCWSTR ValueName); + +/* + * BOOLEAN + * RtlEqualLuid( + * IN PLUID Luid1, + * IN PLUID Luid2) + */ +#define RtlEqualLuid(Luid1, \ + Luid2) \ + (((Luid1)->LowPart == (Luid2)->LowPart) && ((Luid1)->HighPart == (Luid2)->HighPart)) + +/* + * ULONG + * RtlEqualMemory( + * IN VOID UNALIGNED *Destination, + * IN CONST VOID UNALIGNED *Source, + * IN SIZE_T Length) + */ +#define RtlEqualMemory(Destination, Source, Length) (!memcmp(Destination, Source, Length)) + +NTOSAPI +BOOLEAN +DDKAPI +RtlEqualString( + IN PSTRING String1, + IN PSTRING String2, + IN BOOLEAN CaseInSensitive); + +NTOSAPI +BOOLEAN +DDKAPI +RtlEqualUnicodeString( + IN CONST UNICODE_STRING *String1, + IN CONST UNICODE_STRING *String2, + IN BOOLEAN CaseInSensitive); + +/* + * VOID + * RtlFillMemory( + * IN VOID UNALIGNED *Destination, + * IN SIZE_T Length, + * IN UCHAR Fill) + */ +#ifndef RtlFillMemory +#define RtlFillMemory(Destination, Length, Fill) \ + memset(Destination, Fill, Length) +#endif + +#ifndef RtlFillBytes +#define RtlFillBytes RtlFillMemory +#endif + +NTOSAPI +ULONG +DDKAPI +RtlFindClearBits( + IN PRTL_BITMAP BitMapHeader, + IN ULONG NumberToFind, + IN ULONG HintIndex); + +NTOSAPI +ULONG +DDKAPI +RtlFindClearBitsAndSet( + IN PRTL_BITMAP BitMapHeader, + IN ULONG NumberToFind, + IN ULONG HintIndex); + +NTOSAPI +ULONG +DDKAPI +RtlFindClearRuns( + IN PRTL_BITMAP BitMapHeader, + OUT PRTL_BITMAP_RUN RunArray, + IN ULONG SizeOfRunArray, + IN BOOLEAN LocateLongestRuns); + +NTOSAPI +ULONG +DDKAPI +RtlFindFirstRunClear( + IN PRTL_BITMAP BitMapHeader, + OUT PULONG StartingIndex); + +NTOSAPI +ULONG +DDKAPI +RtlFindLastBackwardRunClear( + IN PRTL_BITMAP BitMapHeader, + IN ULONG FromIndex, + OUT PULONG StartingRunIndex); + +NTOSAPI +CCHAR +DDKAPI +RtlFindLeastSignificantBit( + IN ULONGLONG Set); + +NTOSAPI +ULONG +DDKAPI +RtlFindLongestRunClear( + IN PRTL_BITMAP BitMapHeader, + OUT PULONG StartingIndex); + +NTOSAPI +CCHAR +DDKAPI +RtlFindMostSignificantBit( + IN ULONGLONG Set); + +NTOSAPI +ULONG +DDKAPI +RtlFindNextForwardRunClear( + IN PRTL_BITMAP BitMapHeader, + IN ULONG FromIndex, + OUT PULONG StartingRunIndex); + +NTOSAPI +ULONG +DDKAPI +RtlFindSetBits( + IN PRTL_BITMAP BitMapHeader, + IN ULONG NumberToFind, + IN ULONG HintIndex); + +NTOSAPI +ULONG +DDKAPI +RtlFindSetBitsAndClear( + IN PRTL_BITMAP BitMapHeader, + IN ULONG NumberToFind, + IN ULONG HintIndex); + +NTOSAPI +VOID +DDKAPI +RtlFreeAnsiString( + IN PANSI_STRING AnsiString); + +NTOSAPI +VOID +DDKAPI +RtlFreeUnicodeString( + IN PUNICODE_STRING UnicodeString); + +NTOSAPI +VOID +DDKAPI +RtlGetCallersAddress( + OUT PVOID *CallersAddress, + OUT PVOID *CallersCaller); + +NTOSAPI +NTSTATUS +DDKAPI +RtlGetVersion( + IN OUT PRTL_OSVERSIONINFOW lpVersionInformation); + +NTOSAPI +NTSTATUS +DDKAPI +RtlGUIDFromString( + IN PUNICODE_STRING GuidString, + OUT GUID *Guid); + +NTOSAPI +NTSTATUS +DDKAPI +RtlHashUnicodeString( + IN CONST UNICODE_STRING *String, + IN BOOLEAN CaseInSensitive, + IN ULONG HashAlgorithm, + OUT PULONG HashValue); + +NTOSAPI +VOID +DDKAPI +RtlInitAnsiString( + IN OUT PANSI_STRING DestinationString, + IN PCSZ SourceString); + +NTOSAPI +VOID +DDKAPI +RtlInitializeBitMap( + IN PRTL_BITMAP BitMapHeader, + IN PULONG BitMapBuffer, + IN ULONG SizeOfBitMap); + +NTOSAPI +VOID +DDKAPI +RtlInitString( + IN OUT PSTRING DestinationString, + IN PCSZ SourceString); + +NTOSAPI +VOID +DDKAPI +RtlInitUnicodeString( + IN OUT PUNICODE_STRING DestinationString, + IN PCWSTR SourceString); + +NTOSAPI +NTSTATUS +DDKAPI +RtlInt64ToUnicodeString( + IN ULONGLONG Value, + IN ULONG Base OPTIONAL, + IN OUT PUNICODE_STRING String); + +NTOSAPI +NTSTATUS +DDKAPI +RtlIntegerToUnicodeString( + IN ULONG Value, + IN ULONG Base OPTIONAL, + IN OUT PUNICODE_STRING String); + +NTOSAPI +NTSTATUS +DDKAPI +RtlIntPtrToUnicodeString( + PLONG Value, + ULONG Base OPTIONAL, + PUNICODE_STRING String); + +/* + * BOOLEAN + * RtlIsZeroLuid( + * IN PLUID L1) + */ +#define RtlIsZeroLuid(_L1) \ + ((BOOLEAN) ((!(_L1)->LowPart) && (!(_L1)->HighPart))) + +NTOSAPI +ULONG +DDKAPI +RtlLengthSecurityDescriptor( + IN PSECURITY_DESCRIPTOR SecurityDescriptor); + +NTOSAPI +VOID +DDKAPI +RtlMapGenericMask( + IN OUT PACCESS_MASK AccessMask, + IN PGENERIC_MAPPING GenericMapping); + +/* + * VOID + * RtlMoveMemory( + * IN VOID UNALIGNED *Destination, + * IN CONST VOID UNALIGNED *Source, + * IN SIZE_T Length) + */ +#define RtlMoveMemory memmove + +NTOSAPI +ULONG +DDKAPI +RtlNumberOfClearBits( + IN PRTL_BITMAP BitMapHeader); + +NTOSAPI +ULONG +DDKAPI +RtlNumberOfSetBits( + IN PRTL_BITMAP BitMapHeader); + +NTOSAPI +VOID +DDKFASTAPI +RtlPrefetchMemoryNonTemporal( + IN PVOID Source, + IN SIZE_T Length); + +NTOSAPI +BOOLEAN +DDKAPI +RtlPrefixUnicodeString( + IN PCUNICODE_STRING String1, + IN PCUNICODE_STRING String2, + IN BOOLEAN CaseInSensitive); + +NTOSAPI +NTSTATUS +DDKAPI +RtlQueryRegistryValues( + IN ULONG RelativeTo, + IN PCWSTR Path, + IN PRTL_QUERY_REGISTRY_TABLE QueryTable, + IN PVOID Context, + IN PVOID Environment OPTIONAL); + + +#define LONG_SIZE (sizeof(LONG)) +#define LONG_MASK (LONG_SIZE - 1) + +/* + * VOID + * RtlRetrieveUlong ( + * PULONG DestinationAddress, + * PULONG SourceAddress + * ); + */ +#define RtlRetrieveUlong(DestAddress,SrcAddress) \ + if ((ULONG_PTR)(SrcAddress) & LONG_MASK) \ + { \ + ((PUCHAR)(DestAddress))[0]=((PUCHAR)(SrcAddress))[0]; \ + ((PUCHAR)(DestAddress))[1]=((PUCHAR)(SrcAddress))[1]; \ + ((PUCHAR)(DestAddress))[2]=((PUCHAR)(SrcAddress))[2]; \ + ((PUCHAR)(DestAddress))[3]=((PUCHAR)(SrcAddress))[3]; \ + } \ + else \ + { \ + *((PULONG)(DestAddress))=*((PULONG)(SrcAddress)); \ + } + +NTOSAPI +VOID +DDKAPI +RtlRetrieveUshort( + IN OUT PUSHORT DestinationAddress, + IN PUSHORT SourceAddress); + +NTOSAPI +VOID +DDKAPI +RtlSetAllBits( + IN PRTL_BITMAP BitMapHeader); + +NTOSAPI +VOID +DDKAPI +RtlSetBit( + PRTL_BITMAP BitMapHeader, + ULONG BitNumber); + +NTOSAPI +VOID +DDKAPI +RtlSetBits( + IN PRTL_BITMAP BitMapHeader, + IN ULONG StartingIndex, + IN ULONG NumberToSet); + +NTOSAPI +NTSTATUS +DDKAPI +RtlSetDaclSecurityDescriptor( + IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor, + IN BOOLEAN DaclPresent, + IN PACL Dacl OPTIONAL, + IN BOOLEAN DaclDefaulted OPTIONAL); + +NTOSAPI +VOID +DDKAPI +RtlStoreUlong( + IN PULONG Address, + IN ULONG Value); + +NTOSAPI +VOID +DDKAPI +RtlStoreUlonglong( + IN OUT PULONGLONG Address, + ULONGLONG Value); + +NTOSAPI +VOID +DDKAPI +RtlStoreUlongPtr( + IN OUT PULONG_PTR Address, + IN ULONG_PTR Value); + +NTOSAPI +VOID +DDKAPI +RtlStoreUshort( + IN PUSHORT Address, + IN USHORT Value); + +NTOSAPI +NTSTATUS +DDKAPI +RtlStringFromGUID( + IN REFGUID Guid, + OUT PUNICODE_STRING GuidString); + +NTOSAPI +BOOLEAN +DDKAPI +RtlTestBit( + IN PRTL_BITMAP BitMapHeader, + IN ULONG BitNumber); + +NTOSAPI +BOOLEAN +DDKAPI +RtlTimeFieldsToTime( + IN PTIME_FIELDS TimeFields, + IN PLARGE_INTEGER Time); + +NTOSAPI +VOID +DDKAPI +RtlTimeToTimeFields( + IN PLARGE_INTEGER Time, + IN PTIME_FIELDS TimeFields); + +NTOSAPI +ULONG +DDKFASTAPI +RtlUlongByteSwap( + IN ULONG Source); + +NTOSAPI +ULONGLONG +DDKFASTAPI +RtlUlonglongByteSwap( + IN ULONGLONG Source); + +#define RtlUnicodeStringToAnsiSize(STRING) ( \ + NLS_MB_CODE_PAGE_TAG ? \ + RtlxUnicodeStringToAnsiSize(STRING) : \ + ((STRING)->Length + sizeof(UNICODE_NULL)) / sizeof(WCHAR) \ +) + +NTOSAPI +NTSTATUS +DDKAPI +RtlUnicodeStringToAnsiString( + IN OUT PANSI_STRING DestinationString, + IN PCUNICODE_STRING SourceString, + IN BOOLEAN AllocateDestinationString); + +NTOSAPI +NTSTATUS +DDKAPI +RtlUnicodeStringToInteger( + IN PCUNICODE_STRING String, + IN ULONG Base OPTIONAL, + OUT PULONG Value); + +NTOSAPI +WCHAR +DDKAPI +RtlUpcaseUnicodeChar( + IN WCHAR SourceCharacter); + +NTOSAPI +NTSTATUS +DDKAPI +RtlUpcaseUnicodeString( + IN OUT PUNICODE_STRING DestinationString OPTIONAL, + IN PCUNICODE_STRING SourceString, + IN BOOLEAN AllocateDestinationString); + +NTOSAPI +CHAR +DDKAPI +RtlUpperChar( + IN CHAR Character); + +NTOSAPI +VOID +DDKAPI +RtlUpperString( + IN OUT PSTRING DestinationString, + IN PSTRING SourceString); + +NTOSAPI +USHORT +DDKFASTAPI +RtlUshortByteSwap( + IN USHORT Source); + +NTOSAPI +BOOLEAN +DDKAPI +RtlValidRelativeSecurityDescriptor( + IN PSECURITY_DESCRIPTOR SecurityDescriptorInput, + IN ULONG SecurityDescriptorLength, + IN SECURITY_INFORMATION RequiredInformation); + +NTOSAPI +BOOLEAN +DDKAPI +RtlValidSecurityDescriptor( + IN PSECURITY_DESCRIPTOR SecurityDescriptor); + +NTOSAPI +NTSTATUS +DDKAPI +RtlVerifyVersionInfo( + IN PRTL_OSVERSIONINFOEXW VersionInfo, + IN ULONG TypeMask, + IN ULONGLONG ConditionMask); + +NTOSAPI +NTSTATUS +DDKAPI +RtlVolumeDeviceToDosName( + IN PVOID VolumeDeviceObject, + OUT PUNICODE_STRING DosName); + +NTOSAPI +ULONG +DDKAPI +RtlWalkFrameChain( + OUT PVOID *Callers, + IN ULONG Count, + IN ULONG Flags); + +NTOSAPI +NTSTATUS +DDKAPI +RtlWriteRegistryValue( + IN ULONG RelativeTo, + IN PCWSTR Path, + IN PCWSTR ValueName, + IN ULONG ValueType, + IN PVOID ValueData, + IN ULONG ValueLength); + +NTOSAPI +ULONG +DDKAPI +RtlxUnicodeStringToAnsiSize( + IN PCUNICODE_STRING UnicodeString); + +/* + * VOID + * RtlZeroMemory( + * IN VOID UNALIGNED *Destination, + * IN SIZE_T Length) + */ +#ifndef RtlZeroMemory +#define RtlZeroMemory(Destination, Length) \ + memset(Destination, 0, Length) +#endif + +#ifndef RtlZeroBytes +#define RtlZeroBytes RtlZeroMemory +#endif + + +/* Guarded Mutex routines */ + +VOID +FASTCALL +KeAcquireGuardedMutex( + PKGUARDED_MUTEX GuardedMutex +); + +VOID +FASTCALL +KeAcquireGuardedMutexUnsafe( + PKGUARDED_MUTEX GuardedMutex +); + +VOID +STDCALL +KeEnterGuardedRegion(VOID); + +VOID +STDCALL +KeLeaveGuardedRegion(VOID); + +VOID +FASTCALL +KeInitializeGuardedMutex( + PKGUARDED_MUTEX GuardedMutex +); + +VOID +FASTCALL +KeReleaseGuardedMutexUnsafe( + PKGUARDED_MUTEX GuardedMutex +); + +VOID +FASTCALL +KeReleaseGuardedMutex( + PKGUARDED_MUTEX GuardedMutex +); + +BOOL +FASTCALL +KeTryToAcquireGuardedMutex( + PKGUARDED_MUTEX GuardedMutex +); + +/* Fast Mutex */ +#define ExInitializeFastMutex(_FastMutex) \ +{ \ + (_FastMutex)->Count = FM_LOCK_BIT; \ + (_FastMutex)->Owner = NULL; \ + (_FastMutex)->Contention = 0; \ + KeInitializeEvent(&(_FastMutex)->Gate, SynchronizationEvent, FALSE); \ +} + +NTOSAPI +VOID +FASTCALL +ExAcquireFastMutexUnsafe(IN OUT PFAST_MUTEX FastMutex); + +NTOSAPI +VOID +FASTCALL +ExReleaseFastMutexUnsafe(IN OUT PFAST_MUTEX FastMutex); + +#if defined(_NTHAL_) && defined(_X86_) +NTOSAPI +VOID +FASTCALL +ExiAcquireFastMutex(IN OUT PFAST_MUTEX FastMutex); + +NTOSAPI +VOID +FASTCALL +ExiReleaseFastMutex(IN OUT PFAST_MUTEX FastMutex); + +NTOSAPI +BOOLEAN +FASTCALL +ExiTryToAcquireFastMutex(IN OUT PFAST_MUTEX FastMutex); + +#define ExAcquireFastMutex(FastMutex) ExiAcquireFastMutex(FastMutex) +#define ExReleaseFastMutex(FastMutex) ExiReleaseFastMutex(FastMutex) +#define ExTryToAcquireFastMutex(FastMutex) ExiTryToAcquireFastMutex(FastMutex) + +#else + +NTOSAPI +VOID +FASTCALL +ExAcquireFastMutex(IN OUT PFAST_MUTEX FastMutex); + +NTOSAPI +VOID +FASTCALL +ExReleaseFastMutex(IN OUT PFAST_MUTEX FastMutex); + +NTOSAPI +BOOLEAN +FASTCALL +ExTryToAcquireFastMutex(IN OUT PFAST_MUTEX FastMutex); +#endif + +/** Executive support routines **/ + +NTOSAPI +BOOLEAN +DDKAPI +ExAcquireResourceExclusiveLite( + IN PERESOURCE Resource, + IN BOOLEAN Wait); + +NTOSAPI +BOOLEAN +DDKAPI +ExAcquireResourceSharedLite( + IN PERESOURCE Resource, + IN BOOLEAN Wait); + +NTOSAPI +BOOLEAN +DDKAPI +ExAcquireSharedStarveExclusive( + IN PERESOURCE Resource, + IN BOOLEAN Wait); + +NTOSAPI +BOOLEAN +DDKAPI +ExAcquireSharedWaitForExclusive( + IN PERESOURCE Resource, + IN BOOLEAN Wait); + +static __inline PVOID +ExAllocateFromNPagedLookasideList( + IN PNPAGED_LOOKASIDE_LIST Lookaside) +{ + PVOID Entry; + + Lookaside->L.TotalAllocates++; + Entry = InterlockedPopEntrySList(&Lookaside->L.ListHead); + if (Entry == NULL) { + Lookaside->L.AllocateMisses++; + Entry = (Lookaside->L.Allocate)(Lookaside->L.Type, Lookaside->L.Size, Lookaside->L.Tag); + } + return Entry; +} + +static __inline PVOID +ExAllocateFromPagedLookasideList( + IN PPAGED_LOOKASIDE_LIST Lookaside) +{ + PVOID Entry; + + Lookaside->L.TotalAllocates++; + Entry = InterlockedPopEntrySList(&Lookaside->L.ListHead); + if (Entry == NULL) { + Lookaside->L.AllocateMisses++; + Entry = (Lookaside->L.Allocate)(Lookaside->L.Type, Lookaside->L.Size, Lookaside->L.Tag); + } + return Entry; +} + +NTOSAPI +PVOID +DDKAPI +ExAllocatePoolWithQuotaTag( + IN POOL_TYPE PoolType, + IN SIZE_T NumberOfBytes, + IN ULONG Tag); + +NTOSAPI +PVOID +DDKAPI +ExAllocatePoolWithTag( + IN POOL_TYPE PoolType, + IN SIZE_T NumberOfBytes, + IN ULONG Tag); + +#ifdef POOL_TAGGING + +#define ExAllocatePoolWithQuota(p,n) ExAllocatePoolWithQuotaTag(p,n,' kdD') +#define ExAllocatePool(p,n) ExAllocatePoolWithTag(p,n,' kdD') + +#else /* !POOL_TAGGING */ + +NTOSAPI +PVOID +DDKAPI +ExAllocatePool( + IN POOL_TYPE PoolType, + IN SIZE_T NumberOfBytes); + +NTOSAPI +PVOID +DDKAPI +ExAllocatePoolWithQuota( + IN POOL_TYPE PoolType, + IN SIZE_T NumberOfBytes); + +#endif /* POOL_TAGGING */ + +NTOSAPI +PVOID +DDKAPI +ExAllocatePoolWithTagPriority( + IN POOL_TYPE PoolType, + IN SIZE_T NumberOfBytes, + IN ULONG Tag, + IN EX_POOL_PRIORITY Priority); + +NTOSAPI +VOID +DDKAPI +ExConvertExclusiveToSharedLite( + IN PERESOURCE Resource); + +NTOSAPI +NTSTATUS +DDKAPI +ExCreateCallback( + OUT PCALLBACK_OBJECT *CallbackObject, + IN POBJECT_ATTRIBUTES ObjectAttributes, + IN BOOLEAN Create, + IN BOOLEAN AllowMultipleCallbacks); + +NTOSAPI +VOID +DDKAPI +ExDeleteNPagedLookasideList( + IN PNPAGED_LOOKASIDE_LIST Lookaside); + +NTOSAPI +VOID +DDKAPI +ExDeletePagedLookasideList( + IN PPAGED_LOOKASIDE_LIST Lookaside); + +NTOSAPI +NTSTATUS +DDKAPI +ExDeleteResourceLite( + IN PERESOURCE Resource); + +NTOSAPI +VOID +DDKAPI +ExFreePool( + IN PVOID P); + +#define PROTECTED_POOL 0x80000000 + +#ifdef POOL_TAGGING +#define ExFreePool(P) ExFreePoolWithTag(P, 0) +#endif + +NTOSAPI +VOID +DDKAPI +ExFreePoolWithTag( + IN PVOID P, + IN ULONG Tag); + +#define ExQueryDepthSList(ListHead) QueryDepthSList(ListHead) + +static __inline VOID +ExFreeToNPagedLookasideList( + IN PNPAGED_LOOKASIDE_LIST Lookaside, + IN PVOID Entry) +{ + Lookaside->L.TotalFrees++; + if (ExQueryDepthSList(&Lookaside->L.ListHead) >= Lookaside->L.Depth) { + Lookaside->L.FreeMisses++; + (Lookaside->L.Free)(Entry); + } else { + InterlockedPushEntrySList(&Lookaside->L.ListHead, (PSLIST_ENTRY)Entry); + } +} + +static __inline VOID +ExFreeToPagedLookasideList( + IN PPAGED_LOOKASIDE_LIST Lookaside, + IN PVOID Entry) +{ + Lookaside->L.TotalFrees++; + if (ExQueryDepthSList(&Lookaside->L.ListHead) >= Lookaside->L.Depth) { + Lookaside->L.FreeMisses++; + (Lookaside->L.Free)(Entry); + } else { + InterlockedPushEntrySList(&Lookaside->L.ListHead, (PSLIST_ENTRY)Entry); + } +} + +/* + * ERESOURCE_THREAD + * ExGetCurrentResourceThread( + * VOID); + */ +#define ExGetCurrentResourceThread() ((ERESOURCE_THREAD) PsGetCurrentThread()) + +NTOSAPI +ULONG +DDKAPI +ExGetExclusiveWaiterCount( + IN PERESOURCE Resource); + +NTOSAPI +KPROCESSOR_MODE +DDKAPI +ExGetPreviousMode( + VOID); + +NTOSAPI +ULONG +DDKAPI +ExGetSharedWaiterCount( + IN PERESOURCE Resource); + +NTOSAPI +VOID +DDKAPI +KeInitializeEvent( + IN PRKEVENT Event, + IN EVENT_TYPE Type, + IN BOOLEAN State); + +NTOSAPI +VOID +DDKAPI +ExInitializeNPagedLookasideList( + IN PNPAGED_LOOKASIDE_LIST Lookaside, + IN PALLOCATE_FUNCTION Allocate OPTIONAL, + IN PFREE_FUNCTION Free OPTIONAL, + IN ULONG Flags, + IN SIZE_T Size, + IN ULONG Tag, + IN USHORT Depth); + +NTOSAPI +VOID +DDKAPI +ExInitializePagedLookasideList( + IN PPAGED_LOOKASIDE_LIST Lookaside, + IN PALLOCATE_FUNCTION Allocate OPTIONAL, + IN PFREE_FUNCTION Free OPTIONAL, + IN ULONG Flags, + IN SIZE_T Size, + IN ULONG Tag, + IN USHORT Depth); + +NTOSAPI +NTSTATUS +DDKAPI +ExInitializeResourceLite( + IN PERESOURCE Resource); + +/* + * VOID + * InitializeSListHead( + * IN PSLIST_HEADER SListHead) + */ +#define InitializeSListHead(_SListHead) \ + (_SListHead)->Alignment = 0 + +#define ExInitializeSListHead InitializeSListHead + +NTOSAPI +LARGE_INTEGER +DDKAPI +ExInterlockedAddLargeInteger( + IN PLARGE_INTEGER Addend, + IN LARGE_INTEGER Increment, + IN PKSPIN_LOCK Lock); + +NTOSAPI +VOID +DDKFASTAPI +ExInterlockedAddLargeStatistic( + IN PLARGE_INTEGER Addend, + IN ULONG Increment); + +NTOSAPI +ULONG +DDKAPI +ExInterlockedAddUlong( + IN PULONG Addend, + IN ULONG Increment, + PKSPIN_LOCK Lock); + +NTOSAPI +LONGLONG +DDKFASTAPI +ExInterlockedCompareExchange64( + IN OUT PLONGLONG Destination, + IN PLONGLONG Exchange, + IN PLONGLONG Comparand, + IN PKSPIN_LOCK Lock); + +NTOSAPI +LONGLONG +DDKFASTAPI +ExfInterlockedCompareExchange64( + IN OUT LONGLONG volatile *Destination, + IN PLONGLONG Exchange, + IN PLONGLONG Comperand); + +NTOSAPI +PSINGLE_LIST_ENTRY +DDKFASTAPI +ExInterlockedFlushSList( + IN PSLIST_HEADER ListHead); + +NTOSAPI +PLIST_ENTRY +DDKAPI +ExInterlockedInsertHeadList( + IN PLIST_ENTRY ListHead, + IN PLIST_ENTRY ListEntry, + IN PKSPIN_LOCK Lock); + +NTOSAPI +PLIST_ENTRY +DDKAPI +ExInterlockedInsertTailList( + IN PLIST_ENTRY ListHead, + IN PLIST_ENTRY ListEntry, + IN PKSPIN_LOCK Lock); + +NTOSAPI +PSINGLE_LIST_ENTRY +DDKAPI +ExInterlockedPopEntryList( + IN PSINGLE_LIST_ENTRY ListHead, + IN PKSPIN_LOCK Lock); + +/* + * PSINGLE_LIST_ENTRY + * ExInterlockedPopEntrySList( + * IN PSLIST_HEADER ListHead, + * IN PKSPIN_LOCK Lock) + */ +#define ExInterlockedPopEntrySList(_ListHead, \ + _Lock) \ + InterlockedPopEntrySList(_ListHead) + +NTOSAPI +PSINGLE_LIST_ENTRY +DDKAPI +ExInterlockedPushEntryList( + IN PSINGLE_LIST_ENTRY ListHead, + IN PSINGLE_LIST_ENTRY ListEntry, + IN PKSPIN_LOCK Lock); + +/* + * PSINGLE_LIST_ENTRY FASTCALL + * ExInterlockedPushEntrySList( + * IN PSLIST_HEADER ListHead, + * IN PSINGLE_LIST_ENTRY ListEntry, + * IN PKSPIN_LOCK Lock) + */ +#define ExInterlockedPushEntrySList(_ListHead, \ + _ListEntry, \ + _Lock) \ + InterlockedPushEntrySList(_ListHead, _ListEntry) + +NTOSAPI +PLIST_ENTRY +DDKAPI +ExInterlockedRemoveHeadList( + IN PLIST_ENTRY ListHead, + IN PKSPIN_LOCK Lock); + +NTOSAPI +BOOLEAN +DDKAPI +ExIsProcessorFeaturePresent( + IN ULONG ProcessorFeature); + +NTOSAPI +BOOLEAN +DDKAPI +ExIsResourceAcquiredExclusiveLite( + IN PERESOURCE Resource); + +NTOSAPI +USHORT +DDKAPI +ExIsResourceAcquiredLite( + IN PERESOURCE Resource); + +NTOSAPI +ULONG +DDKAPI +ExIsResourceAcquiredSharedLite( + IN PERESOURCE Resource); + +NTOSAPI +VOID +DDKAPI +ExLocalTimeToSystemTime( + IN PLARGE_INTEGER LocalTime, + OUT PLARGE_INTEGER SystemTime); + +NTOSAPI +VOID +DDKAPI +ExNotifyCallback( + IN PCALLBACK_OBJECT CallbackObject, + IN PVOID Argument1, + IN PVOID Argument2); + +NTOSAPI +VOID +DDKAPI +ExRaiseAccessViolation( + VOID); + +NTOSAPI +VOID +DDKAPI +ExRaiseDatatypeMisalignment( + VOID); + +NTOSAPI +VOID +DDKAPI +ExRaiseStatus( + IN NTSTATUS Status); + +NTOSAPI +PVOID +DDKAPI +ExRegisterCallback( + IN PCALLBACK_OBJECT CallbackObject, + IN PCALLBACK_FUNCTION CallbackFunction, + IN PVOID CallbackContext); + +NTOSAPI +NTSTATUS +DDKAPI +ExReinitializeResourceLite( + IN PERESOURCE Resource); + +NTOSAPI +VOID +DDKAPI +ExReleaseResourceForThreadLite( + IN PERESOURCE Resource, + IN ERESOURCE_THREAD ResourceThreadId); + +NTOSAPI +VOID +DDKFASTAPI +ExReleaseResourceLite( + IN PERESOURCE Resource); + +NTOSAPI +VOID +DDKAPI +ExSetResourceOwnerPointer( + IN PERESOURCE Resource, + IN PVOID OwnerPointer); + +NTOSAPI +ULONG +DDKAPI +ExSetTimerResolution( + IN ULONG DesiredTime, + IN BOOLEAN SetResolution); + +NTOSAPI +VOID +DDKAPI +ExSystemTimeToLocalTime( + IN PLARGE_INTEGER SystemTime, + OUT PLARGE_INTEGER LocalTime); + +NTOSAPI +BOOLEAN +DDKAPI +ExTryToAcquireResourceExclusiveLite( + IN PERESOURCE Resource); + +NTOSAPI +VOID +DDKAPI +ExUnregisterCallback( + IN PVOID CbRegistration); + +NTOSAPI +NTSTATUS +DDKAPI +ExUuidCreate( + OUT UUID *Uuid); + +NTOSAPI +BOOLEAN +DDKAPI +ExVerifySuite( + IN SUITE_TYPE SuiteType); + +#ifdef DBG + +#define PAGED_CODE() { \ + if (KeGetCurrentIrql() > APC_LEVEL) { \ + KdPrint( ("NTDDK: Pageable code called at IRQL > APC_LEVEL (%d)\n", KeGetCurrentIrql() )); \ + ASSERT(FALSE); \ + } \ +} + +#else + +#define PAGED_CODE() + +#endif + +NTOSAPI +VOID +DDKAPI +ProbeForRead( + IN CONST VOID *Address, + IN ULONG Length, + IN ULONG Alignment); + +NTOSAPI +VOID +DDKAPI +ProbeForWrite( + IN PVOID Address, + IN ULONG Length, + IN ULONG Alignment); + + + +/** Configuration manager routines **/ + +NTOSAPI +NTSTATUS +DDKAPI +CmRegisterCallback( + IN PEX_CALLBACK_FUNCTION Function, + IN PVOID Context, + IN OUT PLARGE_INTEGER Cookie); + +NTOSAPI +NTSTATUS +DDKAPI +CmUnRegisterCallback( + IN LARGE_INTEGER Cookie); + + + +/** Filesystem runtime library routines **/ + +NTOSAPI +BOOLEAN +DDKAPI +FsRtlIsTotalDeviceFailure( + IN NTSTATUS Status); + + + +/** Hardware abstraction layer routines **/ + +NTHALAPI +BOOLEAN +DDKAPI +HalMakeBeep( + IN ULONG Frequency); + +NTOSAPI +VOID +DDKFASTAPI +HalExamineMBR( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG SectorSize, + IN ULONG MBRTypeIdentifier, + OUT PVOID *Buffer); + +VOID +NTAPI +HalPutDmaAdapter( + PADAPTER_OBJECT AdapterObject +); + +NTSTATUS +NTAPI +IoAllocateAdapterChannel( + IN PADAPTER_OBJECT AdapterObject, + IN PDEVICE_OBJECT DeviceObject, + IN ULONG NumberOfMapRegisters, + IN PDRIVER_CONTROL ExecutionRoutine, + IN PVOID Context +); + +NTHALAPI +VOID +DDKAPI +READ_PORT_BUFFER_UCHAR( + IN PUCHAR Port, + IN PUCHAR Buffer, + IN ULONG Count); + +NTHALAPI +VOID +DDKAPI +READ_PORT_BUFFER_ULONG( + IN PULONG Port, + IN PULONG Buffer, + IN ULONG Count); + +NTHALAPI +VOID +DDKAPI +READ_PORT_BUFFER_USHORT( + IN PUSHORT Port, + IN PUSHORT Buffer, + IN ULONG Count); + +NTHALAPI +UCHAR +DDKAPI +READ_PORT_UCHAR( + IN PUCHAR Port); + +NTHALAPI +ULONG +DDKAPI +READ_PORT_ULONG( + IN PULONG Port); + +NTHALAPI +USHORT +DDKAPI +READ_PORT_USHORT( + IN PUSHORT Port); + +NTOSAPI +VOID +DDKAPI +READ_REGISTER_BUFFER_UCHAR( + IN PUCHAR Register, + IN PUCHAR Buffer, + IN ULONG Count); + +NTOSAPI +VOID +DDKAPI +READ_REGISTER_BUFFER_ULONG( + IN PULONG Register, + IN PULONG Buffer, + IN ULONG Count); + +NTOSAPI +VOID +DDKAPI +READ_REGISTER_BUFFER_USHORT( + IN PUSHORT Register, + IN PUSHORT Buffer, + IN ULONG Count); + +NTOSAPI +UCHAR +DDKAPI +READ_REGISTER_UCHAR( + IN PUCHAR Register); + +NTOSAPI +ULONG +DDKAPI +READ_REGISTER_ULONG( + IN PULONG Register); + +NTOSAPI +USHORT +DDKAPI +READ_REGISTER_USHORT( + IN PUSHORT Register); + +NTHALAPI +VOID +DDKAPI +WRITE_PORT_BUFFER_UCHAR( + IN PUCHAR Port, + IN PUCHAR Buffer, + IN ULONG Count); + +NTHALAPI +VOID +DDKAPI +WRITE_PORT_BUFFER_ULONG( + IN PULONG Port, + IN PULONG Buffer, + IN ULONG Count); + +NTHALAPI +VOID +DDKAPI +WRITE_PORT_BUFFER_USHORT( + IN PUSHORT Port, + IN PUSHORT Buffer, + IN ULONG Count); + +NTHALAPI +VOID +DDKAPI +WRITE_PORT_UCHAR( + IN PUCHAR Port, + IN UCHAR Value); + +NTHALAPI +VOID +DDKAPI +WRITE_PORT_ULONG( + IN PULONG Port, + IN ULONG Value); + +NTHALAPI +VOID +DDKAPI +WRITE_PORT_USHORT( + IN PUSHORT Port, + IN USHORT Value); + +NTOSAPI +VOID +DDKAPI +WRITE_REGISTER_BUFFER_UCHAR( + IN PUCHAR Register, + IN PUCHAR Buffer, + IN ULONG Count); + +NTOSAPI +VOID +DDKAPI +WRITE_REGISTER_BUFFER_ULONG( + IN PULONG Register, + IN PULONG Buffer, + IN ULONG Count); + +NTOSAPI +VOID +DDKAPI +WRITE_REGISTER_BUFFER_USHORT( + IN PUSHORT Register, + IN PUSHORT Buffer, + IN ULONG Count); + +NTOSAPI +VOID +DDKAPI +WRITE_REGISTER_UCHAR( + IN PUCHAR Register, + IN UCHAR Value); + +NTOSAPI +VOID +DDKAPI +WRITE_REGISTER_ULONG( + IN PULONG Register, + IN ULONG Value); + +NTOSAPI +VOID +DDKAPI +WRITE_REGISTER_USHORT( + IN PUSHORT Register, + IN USHORT Value); + +/** I/O manager routines **/ + +NTOSAPI +VOID +DDKAPI +IoAcquireCancelSpinLock( + OUT PKIRQL Irql); + +NTOSAPI +NTSTATUS +DDKAPI +IoAcquireRemoveLockEx( + IN PIO_REMOVE_LOCK RemoveLock, + IN OPTIONAL PVOID Tag OPTIONAL, + IN PCSTR File, + IN ULONG Line, + IN ULONG RemlockSize); + +/* + * NTSTATUS + * IoAcquireRemoveLock( + * IN PIO_REMOVE_LOCK RemoveLock, + * IN OPTIONAL PVOID Tag) + */ +#define IoAcquireRemoveLock(_RemoveLock, \ + _Tag) \ + IoAcquireRemoveLockEx(_RemoveLock, _Tag, __FILE__, __LINE__, sizeof(IO_REMOVE_LOCK)) + +/* + * VOID + * IoAdjustPagingPathCount( + * IN PLONG Count, + * IN BOOLEAN Increment) + */ +#define IoAdjustPagingPathCount(_Count, \ + _Increment) \ +{ \ + if (_Increment) \ + { \ + InterlockedIncrement(_Count); \ + } \ + else \ + { \ + InterlockedDecrement(_Count); \ + } \ +} + +NTOSAPI +VOID +DDKAPI +IoAllocateController( + IN PCONTROLLER_OBJECT ControllerObject, + IN PDEVICE_OBJECT DeviceObject, + IN PDRIVER_CONTROL ExecutionRoutine, + IN PVOID Context); + +NTOSAPI +NTSTATUS +DDKAPI +IoAllocateDriverObjectExtension( + IN PDRIVER_OBJECT DriverObject, + IN PVOID ClientIdentificationAddress, + IN ULONG DriverObjectExtensionSize, + OUT PVOID *DriverObjectExtension); + +NTOSAPI +PVOID +DDKAPI +IoAllocateErrorLogEntry( + IN PVOID IoObject, + IN UCHAR EntrySize); + +NTOSAPI +PIRP +DDKAPI +IoAllocateIrp( + IN CCHAR StackSize, + IN BOOLEAN ChargeQuota); + +NTOSAPI +PMDL +DDKAPI +IoAllocateMdl( + IN PVOID VirtualAddress, + IN ULONG Length, + IN BOOLEAN SecondaryBuffer, + IN BOOLEAN ChargeQuota, + IN OUT PIRP Irp OPTIONAL); + +NTOSAPI +PIO_WORKITEM +DDKAPI +IoAllocateWorkItem( + IN PDEVICE_OBJECT DeviceObject); + +/* + * VOID IoAssignArcName( + * IN PUNICODE_STRING ArcName, + * IN PUNICODE_STRING DeviceName); + */ +#define IoAssignArcName(_ArcName, _DeviceName) ( \ + IoCreateSymbolicLink((_ArcName), (_DeviceName))) + +NTOSAPI +NTSTATUS +DDKAPI +IoAttachDevice( + IN PDEVICE_OBJECT SourceDevice, + IN PUNICODE_STRING TargetDevice, + OUT PDEVICE_OBJECT *AttachedDevice); + +NTOSAPI +PDEVICE_OBJECT +DDKAPI +IoAttachDeviceToDeviceStack( + IN PDEVICE_OBJECT SourceDevice, + IN PDEVICE_OBJECT TargetDevice); + +NTOSAPI +PIRP +DDKAPI +IoBuildAsynchronousFsdRequest( + IN ULONG MajorFunction, + IN PDEVICE_OBJECT DeviceObject, + IN OUT PVOID Buffer OPTIONAL, + IN ULONG Length OPTIONAL, + IN PLARGE_INTEGER StartingOffset OPTIONAL, + IN PIO_STATUS_BLOCK IoStatusBlock OPTIONAL); + +NTOSAPI +PIRP +DDKAPI +IoBuildDeviceIoControlRequest( + IN ULONG IoControlCode, + IN PDEVICE_OBJECT DeviceObject, + IN PVOID InputBuffer OPTIONAL, + IN ULONG InputBufferLength, + OUT PVOID OutputBuffer OPTIONAL, + IN ULONG OutputBufferLength, + IN BOOLEAN InternalDeviceIoControl, + IN PKEVENT Event, + OUT PIO_STATUS_BLOCK IoStatusBlock); + +NTOSAPI +VOID +DDKAPI +IoBuildPartialMdl( + IN PMDL SourceMdl, + IN OUT PMDL TargetMdl, + IN PVOID VirtualAddress, + IN ULONG Length); + +NTOSAPI +PIRP +DDKAPI +IoBuildSynchronousFsdRequest( + IN ULONG MajorFunction, + IN PDEVICE_OBJECT DeviceObject, + IN OUT PVOID Buffer OPTIONAL, + IN ULONG Length OPTIONAL, + IN PLARGE_INTEGER StartingOffset OPTIONAL, + IN PKEVENT Event, + OUT PIO_STATUS_BLOCK IoStatusBlock); + +NTOSAPI +NTSTATUS +DDKFASTAPI +IofCallDriver( + IN PDEVICE_OBJECT DeviceObject, + IN OUT PIRP Irp); + +/* + * NTSTATUS + * IoCallDriver( + * IN PDEVICE_OBJECT DeviceObject, + * IN OUT PIRP Irp) + */ +#define IoCallDriver IofCallDriver + +NTOSAPI +VOID +DDKAPI +IoCancelFileOpen( + IN PDEVICE_OBJECT DeviceObject, + IN PFILE_OBJECT FileObject); + +NTOSAPI +BOOLEAN +DDKAPI +IoCancelIrp( + IN PIRP Irp); + +NTOSAPI +NTSTATUS +DDKAPI +IoCheckShareAccess( + IN ACCESS_MASK DesiredAccess, + IN ULONG DesiredShareAccess, + IN OUT PFILE_OBJECT FileObject, + IN OUT PSHARE_ACCESS ShareAccess, + IN BOOLEAN Update); + +NTOSAPI +VOID +DDKFASTAPI +IofCompleteRequest( + IN PIRP Irp, + IN CCHAR PriorityBoost); + +/* + * VOID + * IoCompleteRequest( + * IN PIRP Irp, + * IN CCHAR PriorityBoost) + */ +#define IoCompleteRequest IofCompleteRequest + +NTOSAPI +NTSTATUS +DDKAPI +IoConnectInterrupt( + OUT PKINTERRUPT *InterruptObject, + IN PKSERVICE_ROUTINE ServiceRoutine, + IN PVOID ServiceContext, + IN PKSPIN_LOCK SpinLock OPTIONAL, + IN ULONG Vector, + IN KIRQL Irql, + IN KIRQL SynchronizeIrql, + IN KINTERRUPT_MODE InterruptMode, + IN BOOLEAN ShareVector, + IN KAFFINITY ProcessorEnableMask, + IN BOOLEAN FloatingSave); + +/* + * PIO_STACK_LOCATION + * IoGetCurrentIrpStackLocation( + * IN PIRP Irp) + */ +#define IoGetCurrentIrpStackLocation(_Irp) \ + ((_Irp)->Tail.Overlay.CurrentStackLocation) + +/* + * PIO_STACK_LOCATION + * IoGetNextIrpStackLocation( + * IN PIRP Irp) + */ +#define IoGetNextIrpStackLocation(_Irp) \ + ((_Irp)->Tail.Overlay.CurrentStackLocation - 1) + +/* + * VOID + * IoCopyCurrentIrpStackLocationToNext( + * IN PIRP Irp) + */ +#define IoCopyCurrentIrpStackLocationToNext(_Irp) \ +{ \ + PIO_STACK_LOCATION _IrpSp; \ + PIO_STACK_LOCATION _NextIrpSp; \ + _IrpSp = IoGetCurrentIrpStackLocation(_Irp); \ + _NextIrpSp = IoGetNextIrpStackLocation(_Irp); \ + RtlCopyMemory(_NextIrpSp, _IrpSp, \ + FIELD_OFFSET(IO_STACK_LOCATION, CompletionRoutine)); \ + _NextIrpSp->Control = 0; \ +} + +NTOSAPI +PCONTROLLER_OBJECT +DDKAPI +IoCreateController( + IN ULONG Size); + +NTOSAPI +NTSTATUS +DDKAPI +IoCreateDevice( + IN PDRIVER_OBJECT DriverObject, + IN ULONG DeviceExtensionSize, + IN PUNICODE_STRING DeviceName OPTIONAL, + IN DEVICE_TYPE DeviceType, + IN ULONG DeviceCharacteristics, + IN BOOLEAN Exclusive, + OUT PDEVICE_OBJECT *DeviceObject); + +NTOSAPI +NTSTATUS +DDKAPI +IoCreateDisk( + IN PDEVICE_OBJECT DeviceObject, + IN PCREATE_DISK Disk); + +NTOSAPI +NTSTATUS +DDKAPI +IoCreateFile( + OUT PHANDLE FileHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN PLARGE_INTEGER AllocationSize OPTIONAL, + IN ULONG FileAttributes, + IN ULONG ShareAccess, + IN ULONG Disposition, + IN ULONG CreateOptions, + IN PVOID EaBuffer OPTIONAL, + IN ULONG EaLength, + IN CREATE_FILE_TYPE CreateFileType, + IN PVOID ExtraCreateParameters OPTIONAL, + IN ULONG Options); + +NTOSAPI +PKEVENT +DDKAPI +IoCreateNotificationEvent( + IN PUNICODE_STRING EventName, + OUT PHANDLE EventHandle); + +NTOSAPI +NTSTATUS +DDKAPI +IoCreateSymbolicLink( + IN PUNICODE_STRING SymbolicLinkName, + IN PUNICODE_STRING DeviceName); + +NTOSAPI +PKEVENT +DDKAPI +IoCreateSynchronizationEvent( + IN PUNICODE_STRING EventName, + OUT PHANDLE EventHandle); + +NTOSAPI +NTSTATUS +DDKAPI +IoCreateUnprotectedSymbolicLink( + IN PUNICODE_STRING SymbolicLinkName, + IN PUNICODE_STRING DeviceName); + +NTOSAPI +NTSTATUS +DDKAPI +IoCsqInitialize( + PIO_CSQ Csq, + IN PIO_CSQ_INSERT_IRP CsqInsertIrp, + IN PIO_CSQ_REMOVE_IRP CsqRemoveIrp, + IN PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp, + IN PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock, + IN PIO_CSQ_RELEASE_LOCK CsqReleaseLock, + IN PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp); + +NTOSAPI +VOID +DDKAPI +IoCsqInsertIrp( + IN PIO_CSQ Csq, + IN PIRP Irp, + IN PIO_CSQ_IRP_CONTEXT Context); + +NTOSAPI +PIRP +DDKAPI +IoCsqRemoveIrp( + IN PIO_CSQ Csq, + IN PIO_CSQ_IRP_CONTEXT Context); + +NTOSAPI +PIRP +DDKAPI +IoCsqRemoveNextIrp( + IN PIO_CSQ Csq, + IN PVOID PeekContext); + +NTOSAPI +VOID +DDKAPI +IoDeleteController( + IN PCONTROLLER_OBJECT ControllerObject); + +NTOSAPI +VOID +DDKAPI +IoDeleteDevice( + IN PDEVICE_OBJECT DeviceObject); + +NTOSAPI +NTSTATUS +DDKAPI +IoDeleteSymbolicLink( + IN PUNICODE_STRING SymbolicLinkName); + +/* + * VOID + * IoDeassignArcName( + * IN PUNICODE_STRING ArcName) + */ +#define IoDeassignArcName IoDeleteSymbolicLink + +NTOSAPI +VOID +DDKAPI +IoDetachDevice( + IN OUT PDEVICE_OBJECT TargetDevice); + +NTOSAPI +VOID +DDKAPI +IoDisconnectInterrupt( + IN PKINTERRUPT InterruptObject); + +NTOSAPI +BOOLEAN +DDKAPI +IoForwardIrpSynchronously( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp); + +#define IoForwardAndCatchIrp IoForwardIrpSynchronously + +NTOSAPI +VOID +DDKAPI +IoFreeController( + IN PCONTROLLER_OBJECT ControllerObject); + +NTOSAPI +VOID +DDKAPI +IoFreeErrorLogEntry( + PVOID ElEntry); + +NTOSAPI +VOID +DDKAPI +IoFreeIrp( + IN PIRP Irp); + +NTOSAPI +VOID +DDKAPI +IoFreeMdl( + IN PMDL Mdl); + +NTOSAPI +VOID +DDKAPI +IoFreeWorkItem( + IN PIO_WORKITEM pIOWorkItem); + +NTOSAPI +PDEVICE_OBJECT +DDKAPI +IoGetAttachedDevice( + IN PDEVICE_OBJECT DeviceObject); + +NTOSAPI +PDEVICE_OBJECT +DDKAPI +IoGetAttachedDeviceReference( + IN PDEVICE_OBJECT DeviceObject); + +NTOSAPI +NTSTATUS +DDKAPI +IoGetBootDiskInformation( + IN OUT PBOOTDISK_INFORMATION BootDiskInformation, + IN ULONG Size); + +NTOSAPI +PCONFIGURATION_INFORMATION +DDKAPI +IoGetConfigurationInformation( + VOID); + +NTOSAPI +PEPROCESS +DDKAPI +IoGetCurrentProcess( + VOID); + +NTOSAPI +NTSTATUS +DDKAPI +IoGetDeviceInterfaceAlias( + IN PUNICODE_STRING SymbolicLinkName, + IN CONST GUID *AliasInterfaceClassGuid, + OUT PUNICODE_STRING AliasSymbolicLinkName); + +#define DEVICE_INTERFACE_INCLUDE_NONACTIVE 0x00000001 + +NTOSAPI +NTSTATUS +DDKAPI +IoGetDeviceInterfaces( + IN CONST GUID *InterfaceClassGuid, + IN PDEVICE_OBJECT PhysicalDeviceObject OPTIONAL, + IN ULONG Flags, + OUT PWSTR *SymbolicLinkList); + +NTOSAPI +NTSTATUS +DDKAPI +IoGetDeviceObjectPointer( + IN PUNICODE_STRING ObjectName, + IN ACCESS_MASK DesiredAccess, + OUT PFILE_OBJECT *FileObject, + OUT PDEVICE_OBJECT *DeviceObject); + +NTOSAPI +NTSTATUS +DDKAPI +IoGetDeviceProperty( + IN PDEVICE_OBJECT DeviceObject, + IN DEVICE_REGISTRY_PROPERTY DeviceProperty, + IN ULONG BufferLength, + OUT PVOID PropertyBuffer, + OUT PULONG ResultLength); + +NTOSAPI +PDEVICE_OBJECT +DDKAPI +IoGetDeviceToVerify( + IN PETHREAD Thread); + +NTOSAPI +PDMA_ADAPTER +DDKAPI +IoGetDmaAdapter( + IN PDEVICE_OBJECT PhysicalDeviceObject, + IN PDEVICE_DESCRIPTION DeviceDescription, + IN OUT PULONG NumberOfMapRegisters); + +NTOSAPI +PVOID +DDKAPI +IoGetDriverObjectExtension( + IN PDRIVER_OBJECT DriverObject, + IN PVOID ClientIdentificationAddress); + +NTOSAPI +PGENERIC_MAPPING +DDKAPI +IoGetFileObjectGenericMapping( + VOID); + +/* + * ULONG + * IoGetFunctionCodeFromCtlCode( + * IN ULONG ControlCode) + */ +#define IoGetFunctionCodeFromCtlCode(_ControlCode) \ + (((_ControlCode) >> 2) & 0x00000FFF) + +NTOSAPI +PVOID +DDKAPI +IoGetInitialStack( + VOID); + +NTOSAPI +PDEVICE_OBJECT +DDKAPI +IoGetRelatedDeviceObject( + IN PFILE_OBJECT FileObject); + +NTOSAPI +ULONG +DDKAPI +IoGetRemainingStackSize( + VOID); + +NTOSAPI +VOID +DDKAPI +IoGetStackLimits( + OUT PULONG_PTR LowLimit, + OUT PULONG_PTR HighLimit); + +NTOSAPI +VOID +DDKAPI +KeInitializeDpc( + IN PRKDPC Dpc, + IN PKDEFERRED_ROUTINE DeferredRoutine, + IN PVOID DeferredContext); + +/* + * VOID + * IoInitializeDpcRequest( + * IN PDEVICE_OBJECT DeviceObject, + * IN PIO_DPC_ROUTINE DpcRoutine) + */ +#define IoInitializeDpcRequest(_DeviceObject, \ + _DpcRoutine) \ + KeInitializeDpc(&(_DeviceObject)->Dpc, \ + (PKDEFERRED_ROUTINE) (_DpcRoutine), \ + _DeviceObject) + +NTOSAPI +VOID +DDKAPI +IoInitializeIrp( + IN OUT PIRP Irp, + IN USHORT PacketSize, + IN CCHAR StackSize); + +NTOSAPI +VOID +DDKAPI +IoInitializeRemoveLockEx( + IN PIO_REMOVE_LOCK Lock, + IN ULONG AllocateTag, + IN ULONG MaxLockedMinutes, + IN ULONG HighWatermark, + IN ULONG RemlockSize); + +/* VOID + * IoInitializeRemoveLock( + * IN PIO_REMOVE_LOCK Lock, + * IN ULONG AllocateTag, + * IN ULONG MaxLockedMinutes, + * IN ULONG HighWatermark) + */ +#define IoInitializeRemoveLock( \ + Lock, AllocateTag, MaxLockedMinutes, HighWatermark) \ + IoInitializeRemoveLockEx(Lock, AllocateTag, MaxLockedMinutes, \ + HighWatermark, sizeof(IO_REMOVE_LOCK)) + +NTOSAPI +NTSTATUS +DDKAPI +IoInitializeTimer( + IN PDEVICE_OBJECT DeviceObject, + IN PIO_TIMER_ROUTINE TimerRoutine, + IN PVOID Context); + +NTOSAPI +VOID +DDKAPI +IoInvalidateDeviceRelations( + IN PDEVICE_OBJECT DeviceObject, + IN DEVICE_RELATION_TYPE Type); + +NTOSAPI +VOID +DDKAPI +IoInvalidateDeviceState( + IN PDEVICE_OBJECT PhysicalDeviceObject); + +NTOSAPI +BOOLEAN +DDKAPI +IoIs32bitProcess( + IN PIRP Irp OPTIONAL); + +/* + * BOOLEAN + * IoIsErrorUserInduced( + * IN NTSTATUS Status); + */ +#define IoIsErrorUserInduced(Status) \ + ((BOOLEAN)(((Status) == STATUS_DEVICE_NOT_READY) || \ + ((Status) == STATUS_IO_TIMEOUT) || \ + ((Status) == STATUS_MEDIA_WRITE_PROTECTED) || \ + ((Status) == STATUS_NO_MEDIA_IN_DEVICE) || \ + ((Status) == STATUS_VERIFY_REQUIRED) || \ + ((Status) == STATUS_UNRECOGNIZED_MEDIA) || \ + ((Status) == STATUS_WRONG_VOLUME))) + +NTOSAPI +BOOLEAN +DDKAPI +IoIsWdmVersionAvailable( + IN UCHAR MajorVersion, + IN UCHAR MinorVersion); + +NTOSAPI +PIRP +DDKAPI +IoMakeAssociatedIrp( + IN PIRP Irp, + IN CCHAR StackSize); + +/* + * VOID + * IoMarkIrpPending( + * IN OUT PIRP Irp) + */ +#define IoMarkIrpPending(_Irp) \ + (IoGetCurrentIrpStackLocation(_Irp)->Control |= SL_PENDING_RETURNED) + +NTOSAPI +NTSTATUS +DDKAPI +IoOpenDeviceInterfaceRegistryKey( + IN PUNICODE_STRING SymbolicLinkName, + IN ACCESS_MASK DesiredAccess, + OUT PHANDLE DeviceInterfaceKey); + +#define PLUGPLAY_REGKEY_DEVICE 1 +#define PLUGPLAY_REGKEY_DRIVER 2 +#define PLUGPLAY_REGKEY_CURRENT_HWPROFILE 4 + +NTOSAPI +NTSTATUS +DDKAPI +IoOpenDeviceRegistryKey( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG DevInstKeyType, + IN ACCESS_MASK DesiredAccess, + OUT PHANDLE DevInstRegKey); + +NTOSAPI +NTSTATUS +DDKAPI +IoQueryDeviceDescription( + IN PINTERFACE_TYPE BusType OPTIONAL, + IN PULONG BusNumber OPTIONAL, + IN PCONFIGURATION_TYPE ControllerType OPTIONAL, + IN PULONG ControllerNumber OPTIONAL, + IN PCONFIGURATION_TYPE PeripheralType OPTIONAL, + IN PULONG PeripheralNumber OPTIONAL, + IN PIO_QUERY_DEVICE_ROUTINE CalloutRoutine, + IN PVOID Context); + +NTOSAPI +VOID +DDKAPI +IoQueueWorkItem( + IN PIO_WORKITEM pIOWorkItem, + IN PIO_WORKITEM_ROUTINE Routine, + IN WORK_QUEUE_TYPE QueueType, + IN PVOID Context); + +NTOSAPI +VOID +DDKAPI +IoRaiseHardError( + IN PIRP Irp, + IN PVPB Vpb OPTIONAL, + IN PDEVICE_OBJECT RealDeviceObject); + +NTOSAPI +BOOLEAN +DDKAPI +IoRaiseInformationalHardError( + IN NTSTATUS ErrorStatus, + IN PUNICODE_STRING String OPTIONAL, + IN PKTHREAD Thread OPTIONAL); + +NTOSAPI +NTSTATUS +DDKAPI +IoReadDiskSignature( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG BytesPerSector, + OUT PDISK_SIGNATURE Signature); + +NTOSAPI +NTSTATUS +DDKAPI +IoReadPartitionTableEx( + IN PDEVICE_OBJECT DeviceObject, + IN struct _DRIVE_LAYOUT_INFORMATION_EX **PartitionBuffer); + +NTOSAPI +VOID +DDKAPI +IoRegisterBootDriverReinitialization( + IN PDRIVER_OBJECT DriverObject, + IN PDRIVER_REINITIALIZE DriverReinitializationRoutine, + IN PVOID Context); + +NTOSAPI +VOID +DDKAPI +IoRegisterBootDriverReinitialization( + IN PDRIVER_OBJECT DriverObject, + IN PDRIVER_REINITIALIZE DriverReinitializationRoutine, + IN PVOID Context); + +NTOSAPI +NTSTATUS +DDKAPI +IoRegisterDeviceInterface( + IN PDEVICE_OBJECT PhysicalDeviceObject, + IN CONST GUID *InterfaceClassGuid, + IN PUNICODE_STRING ReferenceString OPTIONAL, + OUT PUNICODE_STRING SymbolicLinkName); + +NTOSAPI +VOID +DDKAPI +IoRegisterDriverReinitialization( + IN PDRIVER_OBJECT DriverObject, + IN PDRIVER_REINITIALIZE DriverReinitializationRoutine, + IN PVOID Context); + +NTOSAPI +NTSTATUS +DDKAPI +IoRegisterPlugPlayNotification( + IN IO_NOTIFICATION_EVENT_CATEGORY EventCategory, + IN ULONG EventCategoryFlags, + IN PVOID EventCategoryData OPTIONAL, + IN PDRIVER_OBJECT DriverObject, + IN PDRIVER_NOTIFICATION_CALLBACK_ROUTINE CallbackRoutine, + IN PVOID Context, + OUT PVOID *NotificationEntry); + +NTOSAPI +NTSTATUS +DDKAPI +IoRegisterShutdownNotification( + IN PDEVICE_OBJECT DeviceObject); + +NTOSAPI +VOID +DDKAPI +IoReleaseCancelSpinLock( + IN KIRQL Irql); + +NTOSAPI +VOID +DDKAPI +IoReleaseRemoveLockAndWaitEx( + IN PIO_REMOVE_LOCK RemoveLock, + IN PVOID Tag, + IN ULONG RemlockSize); + +NTOSAPI +VOID +DDKAPI +IoReleaseRemoveLockEx( + IN PIO_REMOVE_LOCK RemoveLock, + IN PVOID Tag, + IN ULONG RemlockSize); + +/* + * VOID + * IoReleaseRemoveLock( + * IN PIO_REMOVE_LOCK RemoveLock, + * IN PVOID Tag) + */ +#define IoReleaseRemoveLock(_RemoveLock, \ + _Tag) \ + IoReleaseRemoveLockEx(_RemoveLock, _Tag, sizeof(IO_REMOVE_LOCK)) + +/* + * VOID + * IoReleaseRemoveLockAndWait( + * IN PIO_REMOVE_LOCK RemoveLock, + * IN PVOID Tag) + */ +#define IoReleaseRemoveLockAndWait(_RemoveLock, \ + _Tag) \ + IoReleaseRemoveLockAndWaitEx(_RemoveLock, _Tag, sizeof(IO_REMOVE_LOCK)) + +NTOSAPI +VOID +DDKAPI +IoRemoveShareAccess( + IN PFILE_OBJECT FileObject, + IN OUT PSHARE_ACCESS ShareAccess); + +NTOSAPI +NTSTATUS +DDKAPI +IoReportDetectedDevice( + IN PDRIVER_OBJECT DriverObject, + IN INTERFACE_TYPE LegacyBusType, + IN ULONG BusNumber, + IN ULONG SlotNumber, + IN PCM_RESOURCE_LIST ResourceList, + IN PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirements OPTIONAL, + IN BOOLEAN ResourceAssigned, + IN OUT PDEVICE_OBJECT *DeviceObject); + +NTOSAPI +NTSTATUS +DDKAPI +IoReportResourceForDetection( + IN PDRIVER_OBJECT DriverObject, + IN PCM_RESOURCE_LIST DriverList OPTIONAL, + IN ULONG DriverListSize OPTIONAL, + IN PDEVICE_OBJECT DeviceObject OPTIONAL, + IN PCM_RESOURCE_LIST DeviceList OPTIONAL, + IN ULONG DeviceListSize OPTIONAL, + OUT PBOOLEAN ConflictDetected); + +NTOSAPI +NTSTATUS +DDKAPI +IoReportResourceUsage( + IN PUNICODE_STRING DriverClassName OPTIONAL, + IN PDRIVER_OBJECT DriverObject, + IN PCM_RESOURCE_LIST DriverList OPTIONAL, + IN ULONG DriverListSize OPTIONAL, + IN PDEVICE_OBJECT DeviceObject, + IN PCM_RESOURCE_LIST DeviceList OPTIONAL, + IN ULONG DeviceListSize OPTIONAL, + IN BOOLEAN OverrideConflict, + OUT PBOOLEAN ConflictDetected); + +NTOSAPI +NTSTATUS +DDKAPI +IoReportTargetDeviceChange( + IN PDEVICE_OBJECT PhysicalDeviceObject, + IN PVOID NotificationStructure); + +NTOSAPI +NTSTATUS +DDKAPI +IoReportTargetDeviceChangeAsynchronous( + IN PDEVICE_OBJECT PhysicalDeviceObject, + IN PVOID NotificationStructure, + IN PDEVICE_CHANGE_COMPLETE_CALLBACK Callback OPTIONAL, + IN PVOID Context OPTIONAL); + +NTOSAPI +VOID +DDKAPI +IoRequestDeviceEject( + IN PDEVICE_OBJECT PhysicalDeviceObject); + +/* + * VOID + * IoRequestDpc( + * IN PDEVICE_OBJECT DeviceObject, + * IN PIRP Irp, + * IN PVOID Context); + */ +#define IoRequestDpc(DeviceObject, Irp, Context)( \ + KeInsertQueueDpc(&(DeviceObject)->Dpc, (Irp), (Context))) + +NTOSAPI +VOID +DDKAPI +IoReuseIrp( + IN OUT PIRP Irp, + IN NTSTATUS Status); + +/* + * PDRIVER_CANCEL + * IoSetCancelRoutine( + * IN PIRP Irp, + * IN PDRIVER_CANCEL CancelRoutine) + */ +#define IoSetCancelRoutine(_Irp, \ + _CancelRoutine) \ + ((PDRIVER_CANCEL) InterlockedExchangePointer( \ + (PVOID *) &(_Irp)->CancelRoutine, (PVOID) (_CancelRoutine))) + +/* + * VOID + * IoSetCompletionRoutine( + * IN PIRP Irp, + * IN PIO_COMPLETION_ROUTINE CompletionRoutine, + * IN PVOID Context, + * IN BOOLEAN InvokeOnSuccess, + * IN BOOLEAN InvokeOnError, + * IN BOOLEAN InvokeOnCancel) + */ +#define IoSetCompletionRoutine(_Irp, \ + _CompletionRoutine, \ + _Context, \ + _InvokeOnSuccess, \ + _InvokeOnError, \ + _InvokeOnCancel) \ +{ \ + PIO_STACK_LOCATION _IrpSp; \ + ASSERT(_InvokeOnSuccess || _InvokeOnError || _InvokeOnCancel ? \ + _CompletionRoutine != NULL : TRUE); \ + _IrpSp = IoGetNextIrpStackLocation(_Irp); \ + _IrpSp->CompletionRoutine = (PIO_COMPLETION_ROUTINE)(_CompletionRoutine); \ + _IrpSp->Context = (_Context); \ + _IrpSp->Control = 0; \ + if (_InvokeOnSuccess) _IrpSp->Control = SL_INVOKE_ON_SUCCESS; \ + if (_InvokeOnError) _IrpSp->Control |= SL_INVOKE_ON_ERROR; \ + if (_InvokeOnCancel) _IrpSp->Control |= SL_INVOKE_ON_CANCEL; \ +} + +NTOSAPI +NTSTATUS +DDKAPI +IoSetCompletionRoutineEx( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp, + IN PIO_COMPLETION_ROUTINE CompletionRoutine, + IN PVOID Context, + IN BOOLEAN InvokeOnSuccess, + IN BOOLEAN InvokeOnError, + IN BOOLEAN InvokeOnCancel); + +NTOSAPI +NTSTATUS +DDKAPI +IoSetDeviceInterfaceState( + IN PUNICODE_STRING SymbolicLinkName, + IN BOOLEAN Enable); + +NTOSAPI +VOID +DDKAPI +IoSetHardErrorOrVerifyDevice( + IN PIRP Irp, + IN PDEVICE_OBJECT DeviceObject); + +/* + * VOID + * IoSetNextIrpStackLocation( + * IN OUT PIRP Irp) + */ +#define IoSetNextIrpStackLocation(_Irp) \ +{ \ + (_Irp)->CurrentLocation--; \ + (_Irp)->Tail.Overlay.CurrentStackLocation--; \ +} + +NTOSAPI +NTSTATUS +DDKAPI +IoSetPartitionInformationEx( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG PartitionNumber, + IN struct _SET_PARTITION_INFORMATION_EX *PartitionInfo); + +NTOSAPI +VOID +DDKAPI +IoSetShareAccess( + IN ACCESS_MASK DesiredAccess, + IN ULONG DesiredShareAccess, + IN OUT PFILE_OBJECT FileObject, + OUT PSHARE_ACCESS ShareAccess); + +NTOSAPI +VOID +DDKAPI +IoSetStartIoAttributes( + IN PDEVICE_OBJECT DeviceObject, + IN BOOLEAN DeferredStartIo, + IN BOOLEAN NonCancelable); + +NTOSAPI +NTSTATUS +DDKAPI +IoSetSystemPartition( + IN PUNICODE_STRING VolumeNameString); + +NTOSAPI +BOOLEAN +DDKAPI +IoSetThreadHardErrorMode( + IN BOOLEAN EnableHardErrors); + +/* + * USHORT + * IoSizeOfIrp( + * IN CCHAR StackSize) + */ +#define IoSizeOfIrp(_StackSize) \ + ((USHORT) (sizeof(IRP) + ((_StackSize) * (sizeof(IO_STACK_LOCATION))))) + +/* + * VOID + * IoSkipCurrentIrpStackLocation( + * IN PIRP Irp) + */ +#define IoSkipCurrentIrpStackLocation(_Irp) \ +{ \ + (_Irp)->CurrentLocation++; \ + (_Irp)->Tail.Overlay.CurrentStackLocation++; \ +} + +NTOSAPI +VOID +DDKAPI +IoStartNextPacket( + IN PDEVICE_OBJECT DeviceObject, + IN BOOLEAN Cancelable); + +NTOSAPI +VOID +DDKAPI +IoStartNextPacketByKey( + IN PDEVICE_OBJECT DeviceObject, + IN BOOLEAN Cancelable, + IN ULONG Key); + +NTOSAPI +VOID +DDKAPI +IoStartPacket( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp, + IN PULONG Key OPTIONAL, + IN PDRIVER_CANCEL CancelFunction OPTIONAL); + +NTOSAPI +VOID +DDKAPI +IoStartTimer( + IN PDEVICE_OBJECT DeviceObject); + +NTOSAPI +VOID +DDKAPI +IoStopTimer( + IN PDEVICE_OBJECT DeviceObject); + +NTOSAPI +NTSTATUS +DDKAPI +IoUnregisterPlugPlayNotification( + IN PVOID NotificationEntry); + +NTOSAPI +VOID +DDKAPI +IoUnregisterShutdownNotification( + IN PDEVICE_OBJECT DeviceObject); + +NTOSAPI +VOID +DDKAPI +IoUpdateShareAccess( + IN PFILE_OBJECT FileObject, + IN OUT PSHARE_ACCESS ShareAccess); + +NTOSAPI +NTSTATUS +DDKAPI +IoVerifyPartitionTable( + IN PDEVICE_OBJECT DeviceObject, + IN BOOLEAN FixErrors); + +NTOSAPI +NTSTATUS +DDKAPI +IoVolumeDeviceToDosName( + IN PVOID VolumeDeviceObject, + OUT PUNICODE_STRING DosName); + +NTOSAPI +NTSTATUS +DDKAPI +IoWMIAllocateInstanceIds( + IN GUID *Guid, + IN ULONG InstanceCount, + OUT ULONG *FirstInstanceId); + +NTOSAPI +ULONG +DDKAPI +IoWMIDeviceObjectToProviderId( + IN PDEVICE_OBJECT DeviceObject); + +NTOSAPI +NTSTATUS +DDKAPI +IoWMIDeviceObjectToInstanceName( + IN PVOID DataBlockObject, + IN PDEVICE_OBJECT DeviceObject, + OUT PUNICODE_STRING InstanceName); + +NTOSAPI +NTSTATUS +DDKAPI +IoWMIExecuteMethod( + IN PVOID DataBlockObject, + IN PUNICODE_STRING InstanceName, + IN ULONG MethodId, + IN ULONG InBufferSize, + IN OUT PULONG OutBufferSize, + IN OUT PUCHAR InOutBuffer); + +NTOSAPI +NTSTATUS +DDKAPI +IoWMIHandleToInstanceName( + IN PVOID DataBlockObject, + IN HANDLE FileHandle, + OUT PUNICODE_STRING InstanceName); + +NTOSAPI +NTSTATUS +DDKAPI +IoWMIOpenBlock( + IN GUID *DataBlockGuid, + IN ULONG DesiredAccess, + OUT PVOID *DataBlockObject); + +NTOSAPI +NTSTATUS +DDKAPI +IoWMIQueryAllData( + IN PVOID DataBlockObject, + IN OUT ULONG *InOutBufferSize, + OUT PVOID OutBuffer); + +NTOSAPI +NTSTATUS +DDKAPI +IoWMIQueryAllDataMultiple( + IN PVOID *DataBlockObjectList, + IN ULONG ObjectCount, + IN OUT ULONG *InOutBufferSize, + OUT PVOID OutBuffer); + +NTOSAPI +NTSTATUS +DDKAPI +IoWMIQuerySingleInstance( + IN PVOID DataBlockObject, + IN PUNICODE_STRING InstanceName, + IN OUT ULONG *InOutBufferSize, + OUT PVOID OutBuffer); + +NTOSAPI +NTSTATUS +DDKAPI +IoWMIQuerySingleInstanceMultiple( + IN PVOID *DataBlockObjectList, + IN PUNICODE_STRING InstanceNames, + IN ULONG ObjectCount, + IN OUT ULONG *InOutBufferSize, + OUT PVOID OutBuffer); + +NTOSAPI +NTSTATUS +DDKAPI +IoWMIRegistrationControl( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG Action); + +NTOSAPI +NTSTATUS +DDKAPI +IoWMISetNotificationCallback( + IN PVOID Object, + IN WMI_NOTIFICATION_CALLBACK Callback, + IN PVOID Context); + +NTOSAPI +NTSTATUS +DDKAPI +IoWMISetSingleInstance( + IN PVOID DataBlockObject, + IN PUNICODE_STRING InstanceName, + IN ULONG Version, + IN ULONG ValueBufferSize, + IN PVOID ValueBuffer); + +NTOSAPI +NTSTATUS +DDKAPI +IoWMISetSingleItem( + IN PVOID DataBlockObject, + IN PUNICODE_STRING InstanceName, + IN ULONG DataItemId, + IN ULONG Version, + IN ULONG ValueBufferSize, + IN PVOID ValueBuffer); + +NTOSAPI +NTSTATUS +DDKAPI +IoWMISuggestInstanceName( + IN PDEVICE_OBJECT PhysicalDeviceObject OPTIONAL, + IN PUNICODE_STRING SymbolicLinkName OPTIONAL, + IN BOOLEAN CombineNames, + OUT PUNICODE_STRING SuggestedInstanceName); + +NTOSAPI +NTSTATUS +DDKAPI +IoWMIWriteEvent( + IN PVOID WnodeEventItem); + +NTOSAPI +VOID +DDKAPI +IoWriteErrorLogEntry( + IN PVOID ElEntry); + +NTOSAPI +NTSTATUS +DDKAPI +IoWritePartitionTableEx( + IN PDEVICE_OBJECT DeviceObject, + IN struct _DRIVE_LAYOUT_INFORMATION_EX *PartitionBuffer); + + + +/** Kernel routines **/ + +NTHALAPI +VOID +DDKFASTAPI +KeAcquireInStackQueuedSpinLock( + IN PKSPIN_LOCK SpinLock, + IN PKLOCK_QUEUE_HANDLE LockHandle); + +NTOSAPI +VOID +DDKFASTAPI +KeAcquireInStackQueuedSpinLockAtDpcLevel( + IN PKSPIN_LOCK SpinLock, + IN PKLOCK_QUEUE_HANDLE LockHandle); + +NTOSAPI +KIRQL +DDKAPI +KeAcquireInterruptSpinLock( + IN PKINTERRUPT Interrupt); + +NTOSAPI +BOOLEAN +DDKAPI +KeAreApcsDisabled( + VOID); + +NTOSAPI +VOID +DDKAPI +KeBugCheck( + IN ULONG BugCheckCode); + +NTOSAPI +VOID +DDKAPI +KeBugCheckEx( + IN ULONG BugCheckCode, + IN ULONG_PTR BugCheckParameter1, + IN ULONG_PTR BugCheckParameter2, + IN ULONG_PTR BugCheckParameter3, + IN ULONG_PTR BugCheckParameter4); + +NTOSAPI +BOOLEAN +DDKAPI +KeCancelTimer( + IN PKTIMER Timer); + +NTOSAPI +VOID +DDKAPI +KeClearEvent( + IN PRKEVENT Event); + +NTOSAPI +NTSTATUS +DDKAPI +KeDelayExecutionThread( + IN KPROCESSOR_MODE WaitMode, + IN BOOLEAN Alertable, + IN PLARGE_INTEGER Interval); + +NTOSAPI +BOOLEAN +DDKAPI +KeDeregisterBugCheckCallback( + IN PKBUGCHECK_CALLBACK_RECORD CallbackRecord); + +NTOSAPI +VOID +DDKAPI +KeEnterCriticalRegion( + VOID); + +/* + * VOID + * KeFlushIoBuffers( + * IN PMDL Mdl, + * IN BOOLEAN ReadOperation, + * IN BOOLEAN DmaOperation) + */ +#define KeFlushIoBuffers(_Mdl, _ReadOperation, _DmaOperation) + +NTHALAPI +VOID +DDKAPI +KeFlushWriteBuffer(VOID); + +NTOSAPI +PRKTHREAD +DDKAPI +KeGetCurrentThread( + VOID); + +NTOSAPI +KPROCESSOR_MODE +DDKAPI +KeGetPreviousMode( + VOID); + +NTOSAPI +ULONG +DDKAPI +KeGetRecommendedSharedDataAlignment( + VOID); + +NTOSAPI +VOID +DDKAPI +KeInitializeDeviceQueue( + IN PKDEVICE_QUEUE DeviceQueue); + +NTOSAPI +VOID +DDKAPI +KeInitializeMutex( + IN PRKMUTEX Mutex, + IN ULONG Level); + +NTOSAPI +VOID +DDKAPI +KeInitializeSemaphore( + IN PRKSEMAPHORE Semaphore, + IN LONG Count, + IN LONG Limit); + +NTOSAPI +VOID +DDKAPI +KeInitializeSpinLock( + IN PKSPIN_LOCK SpinLock); + +NTOSAPI +VOID +DDKAPI +KeInitializeTimer( + IN PKTIMER Timer); + +NTOSAPI +VOID +DDKAPI +KeInitializeTimerEx( + IN PKTIMER Timer, + IN TIMER_TYPE Type); + +NTOSAPI +BOOLEAN +DDKAPI +KeInsertByKeyDeviceQueue( + IN PKDEVICE_QUEUE DeviceQueue, + IN PKDEVICE_QUEUE_ENTRY DeviceQueueEntry, + IN ULONG SortKey); + +NTOSAPI +BOOLEAN +DDKAPI +KeInsertDeviceQueue( + IN PKDEVICE_QUEUE DeviceQueue, + IN PKDEVICE_QUEUE_ENTRY DeviceQueueEntry); + +NTOSAPI +BOOLEAN +DDKAPI +KeInsertQueueDpc( + IN PRKDPC Dpc, + IN PVOID SystemArgument1, + IN PVOID SystemArgument2); + +NTOSAPI +VOID +DDKAPI +KeLeaveCriticalRegion( + VOID); + +#ifdef _X86_ + +static __inline +VOID +KeMemoryBarrier( + VOID) +{ + volatile LONG Barrier; +#if defined(__GNUC__) + __asm__ __volatile__ ("xchg %%eax, %0" : : "m" (Barrier) : "%eax"); +#elif defined(_MSC_VER) + __asm xchg [Barrier], eax +#endif +} + +#endif + +NTOSAPI +LONG +DDKAPI +KePulseEvent( + IN PRKEVENT Event, + IN KPRIORITY Increment, + IN BOOLEAN Wait); + +NTOSAPI +ULONGLONG +DDKAPI +KeQueryInterruptTime( + VOID); + +NTHALAPI +LARGE_INTEGER +DDKAPI +KeQueryPerformanceCounter( + OUT PLARGE_INTEGER PerformanceFrequency OPTIONAL); + +NTOSAPI +KPRIORITY +DDKAPI +KeQueryPriorityThread( + IN PRKTHREAD Thread); + +NTOSAPI +VOID +DDKAPI +KeQuerySystemTime( + OUT PLARGE_INTEGER CurrentTime); + +NTOSAPI +VOID +DDKAPI +KeQueryTickCount( + OUT PLARGE_INTEGER TickCount); + +NTOSAPI +ULONG +DDKAPI +KeQueryTimeIncrement( + VOID); + +NTOSAPI +LONG +DDKAPI +KeReadStateEvent( + IN PRKEVENT Event); + +NTOSAPI +LONG +DDKAPI +KeReadStateMutex( + IN PRKMUTEX Mutex); + + +NTOSAPI +LONG +DDKAPI +KeReadStateSemaphore( + IN PRKSEMAPHORE Semaphore); + +NTOSAPI +BOOLEAN +DDKAPI +KeReadStateTimer( + IN PKTIMER Timer); + +NTOSAPI +BOOLEAN +DDKAPI +KeRegisterBugCheckCallback( + IN PKBUGCHECK_CALLBACK_RECORD CallbackRecord, + IN PKBUGCHECK_CALLBACK_ROUTINE CallbackRoutine, + IN PVOID Buffer, + IN ULONG Length, + IN PUCHAR Component); + +NTHALAPI +VOID +DDKFASTAPI +KeReleaseInStackQueuedSpinLock( + IN PKLOCK_QUEUE_HANDLE LockHandle); + +NTOSAPI +VOID +DDKFASTAPI +KeReleaseInStackQueuedSpinLockFromDpcLevel( + IN PKLOCK_QUEUE_HANDLE LockHandle); + +NTOSAPI +VOID +DDKAPI +KeReleaseInterruptSpinLock( + IN PKINTERRUPT Interrupt, + IN KIRQL OldIrql); + +NTOSAPI +LONG +DDKAPI +KeReleaseMutex( + IN PRKMUTEX Mutex, + IN BOOLEAN Wait); + +NTOSAPI +LONG +DDKAPI +KeReleaseSemaphore( + IN PRKSEMAPHORE Semaphore, + IN KPRIORITY Increment, + IN LONG Adjustment, + IN BOOLEAN Wait); + +NTOSAPI +PKDEVICE_QUEUE_ENTRY +DDKAPI +KeRemoveByKeyDeviceQueue( + IN PKDEVICE_QUEUE DeviceQueue, + IN ULONG SortKey); + +NTOSAPI +PKDEVICE_QUEUE_ENTRY +DDKAPI +KeRemoveDeviceQueue( + IN PKDEVICE_QUEUE DeviceQueue); + +NTOSAPI +BOOLEAN +DDKAPI +KeRemoveEntryDeviceQueue( + IN PKDEVICE_QUEUE DeviceQueue, + IN PKDEVICE_QUEUE_ENTRY DeviceQueueEntry); + +NTOSAPI +BOOLEAN +DDKAPI +KeRemoveQueueDpc( + IN PRKDPC Dpc); + +NTOSAPI +LONG +DDKAPI +KeResetEvent( + IN PRKEVENT Event); + +NTOSAPI +NTSTATUS +DDKAPI +KeRestoreFloatingPointState( + IN PKFLOATING_SAVE FloatSave); + +NTOSAPI +VOID +DDKAPI +KeRevertToUserAffinityThread(VOID); + +NTOSAPI +NTSTATUS +DDKAPI +KeSaveFloatingPointState( + OUT PKFLOATING_SAVE FloatSave); + +NTOSAPI +LONG +DDKAPI +KeSetBasePriorityThread( + IN PRKTHREAD Thread, + IN LONG Increment); + +NTOSAPI +LONG +DDKAPI +KeSetEvent( + IN PRKEVENT Event, + IN KPRIORITY Increment, + IN BOOLEAN Wait); + +NTOSAPI +VOID +DDKAPI +KeSetImportanceDpc( + IN PRKDPC Dpc, + IN KDPC_IMPORTANCE Importance); + +NTOSAPI +KPRIORITY +DDKAPI +KeSetPriorityThread( + IN PKTHREAD Thread, + IN KPRIORITY Priority); + +NTOSAPI +VOID +DDKAPI +KeSetSystemAffinityThread( + IN KAFFINITY Affinity); + +NTOSAPI +VOID +DDKAPI +KeSetTargetProcessorDpc( + IN PRKDPC Dpc, + IN CCHAR Number); + +NTOSAPI +BOOLEAN +DDKAPI +KeSetTimer( + IN PKTIMER Timer, + IN LARGE_INTEGER DueTime, + IN PKDPC Dpc OPTIONAL); + +NTOSAPI +BOOLEAN +DDKAPI +KeSetTimerEx( + IN PKTIMER Timer, + IN LARGE_INTEGER DueTime, + IN LONG Period OPTIONAL, + IN PKDPC Dpc OPTIONAL); + +NTOSAPI +VOID +DDKFASTAPI +KeSetTimeUpdateNotifyRoutine( + IN PTIME_UPDATE_NOTIFY_ROUTINE NotifyRoutine); + +NTHALAPI +VOID +DDKAPI +KeStallExecutionProcessor( + IN ULONG MicroSeconds); + +NTOSAPI +BOOLEAN +DDKAPI +KeSynchronizeExecution( + IN PKINTERRUPT Interrupt, + IN PKSYNCHRONIZE_ROUTINE SynchronizeRoutine, + IN PVOID SynchronizeContext); + +NTOSAPI +NTSTATUS +DDKAPI +KeWaitForMultipleObjects( + IN ULONG Count, + IN PVOID Object[], + IN WAIT_TYPE WaitType, + IN KWAIT_REASON WaitReason, + IN KPROCESSOR_MODE WaitMode, + IN BOOLEAN Alertable, + IN PLARGE_INTEGER Timeout OPTIONAL, + IN PKWAIT_BLOCK WaitBlockArray OPTIONAL); + +NTOSAPI +NTSTATUS +DDKAPI +KeWaitForMutexObject( + IN PRKMUTEX Mutex, + IN KWAIT_REASON WaitReason, + IN KPROCESSOR_MODE WaitMode, + IN BOOLEAN Alertable, + IN PLARGE_INTEGER Timeout OPTIONAL); + +NTOSAPI +NTSTATUS +DDKAPI +KeWaitForSingleObject( + IN PVOID Object, + IN KWAIT_REASON WaitReason, + IN KPROCESSOR_MODE WaitMode, + IN BOOLEAN Alertable, + IN PLARGE_INTEGER Timeout OPTIONAL); + +#if defined(_X86_) + +NTHALAPI +VOID +FASTCALL +KfLowerIrql( + IN KIRQL NewIrql); + +NTHALAPI +KIRQL +FASTCALL +KfRaiseIrql( + IN KIRQL NewIrql); + +NTHALAPI +KIRQL +DDKAPI +KeRaiseIrqlToDpcLevel( + VOID); + +NTHALAPI +KIRQL +DDKAPI +KeRaiseIrqlToSynchLevel( + VOID); + +#define KeLowerIrql(a) KfLowerIrql(a) +#define KeRaiseIrql(a,b) *(b) = KfRaiseIrql(a) + +#else + +NTOSAPI +VOID +DDKAPI +KeLowerIrql( + IN KIRQL NewIrql); + +NTOSAPI +KIRQL +DDKAPI +KeRaiseIrql( + IN KIRQL NewIrql); + +NTOSAPI +KIRQL +DDKAPI +KeRaiseIrqlToDpcLevel( + VOID); + +#endif + +/** Memory manager routines **/ + +NTOSAPI +NTSTATUS +DDKAPI +MmAdvanceMdl( + IN PMDL Mdl, + IN ULONG NumberOfBytes); + +NTOSAPI +PVOID +DDKAPI +MmAllocateContiguousMemory( + IN ULONG NumberOfBytes, + IN PHYSICAL_ADDRESS HighestAcceptableAddress); + +NTOSAPI +PVOID +DDKAPI +MmAllocateContiguousMemorySpecifyCache( + IN SIZE_T NumberOfBytes, + IN PHYSICAL_ADDRESS LowestAcceptableAddress, + IN PHYSICAL_ADDRESS HighestAcceptableAddress, + IN PHYSICAL_ADDRESS BoundaryAddressMultiple OPTIONAL, + IN MEMORY_CACHING_TYPE CacheType); + +NTOSAPI +PVOID +DDKAPI +MmAllocateMappingAddress( + IN SIZE_T NumberOfBytes, + IN ULONG PoolTag); + +NTOSAPI +PVOID +DDKAPI +MmAllocateNonCachedMemory( + IN ULONG NumberOfBytes); + +NTOSAPI +PMDL +DDKAPI +MmAllocatePagesForMdl( + IN PHYSICAL_ADDRESS LowAddress, + IN PHYSICAL_ADDRESS HighAddress, + IN PHYSICAL_ADDRESS SkipBytes, + IN SIZE_T TotalBytes); + +NTOSAPI +VOID +DDKAPI +MmBuildMdlForNonPagedPool( + IN OUT PMDL MemoryDescriptorList); + +NTOSAPI +NTSTATUS +DDKAPI +MmCreateSection( + OUT PVOID *SectionObject, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, + IN PLARGE_INTEGER MaximumSize, + IN ULONG SectionPageProtection, + IN ULONG AllocationAttributes, + IN HANDLE FileHandle OPTIONAL, + IN PFILE_OBJECT File OPTIONAL); + +typedef enum _MMFLUSH_TYPE { + MmFlushForDelete, + MmFlushForWrite +} MMFLUSH_TYPE; + +NTOSAPI +BOOLEAN +DDKAPI +MmFlushImageSection( + IN PSECTION_OBJECT_POINTERS SectionObjectPointer, + IN MMFLUSH_TYPE FlushType); + +NTOSAPI +VOID +DDKAPI +MmFreeContiguousMemory( + IN PVOID BaseAddress); + +NTOSAPI +VOID +DDKAPI +MmFreeContiguousMemorySpecifyCache( + IN PVOID BaseAddress, + IN SIZE_T NumberOfBytes, + IN MEMORY_CACHING_TYPE CacheType); + +NTOSAPI +VOID +DDKAPI +MmFreeMappingAddress( + IN PVOID BaseAddress, + IN ULONG PoolTag); + +NTOSAPI +VOID +DDKAPI +MmFreeNonCachedMemory( + IN PVOID BaseAddress, + IN SIZE_T NumberOfBytes); + +NTOSAPI +VOID +DDKAPI +MmFreePagesFromMdl( + IN PMDL MemoryDescriptorList); + +/* + * ULONG + * MmGetMdlByteCount( + * IN PMDL Mdl) + */ +#define MmGetMdlByteCount(_Mdl) \ + ((_Mdl)->ByteCount) + +/* + * ULONG + * MmGetMdlByteOffset( + * IN PMDL Mdl) + */ +#define MmGetMdlByteOffset(_Mdl) \ + ((_Mdl)->ByteOffset) + +/* + * PPFN_NUMBER + * MmGetMdlPfnArray( + * IN PMDL Mdl) + */ +#define MmGetMdlPfnArray(_Mdl) \ + ((PPFN_NUMBER) ((_Mdl) + 1)) + +/* + * PVOID + * MmGetMdlVirtualAddress( + * IN PMDL Mdl) + */ +#define MmGetMdlVirtualAddress(_Mdl) \ + ((PVOID) ((PCHAR) ((_Mdl)->StartVa) + (_Mdl)->ByteOffset)) + +NTOSAPI +PHYSICAL_ADDRESS +DDKAPI +MmGetPhysicalAddress( + IN PVOID BaseAddress); + +NTOSAPI +PPHYSICAL_MEMORY_RANGE +DDKAPI +MmGetPhysicalMemoryRanges( + VOID); + +NTOSAPI +PVOID +DDKAPI +MmGetVirtualForPhysical( + IN PHYSICAL_ADDRESS PhysicalAddress); + +NTOSAPI +PVOID +DDKAPI +MmMapLockedPagesSpecifyCache( + IN PMDL MemoryDescriptorList, + IN KPROCESSOR_MODE AccessMode, + IN MEMORY_CACHING_TYPE CacheType, + IN PVOID BaseAddress, + IN ULONG BugCheckOnFailure, + IN MM_PAGE_PRIORITY Priority); + +NTOSAPI +PVOID +DDKAPI +MmMapLockedPagesWithReservedMapping( + IN PVOID MappingAddress, + IN ULONG PoolTag, + IN PMDL MemoryDescriptorList, + IN MEMORY_CACHING_TYPE CacheType); + +NTOSAPI +NTSTATUS +DDKAPI +MmMapUserAddressesToPage( + IN PVOID BaseAddress, + IN SIZE_T NumberOfBytes, + IN PVOID PageAddress); + +NTOSAPI +PVOID +DDKAPI +MmMapVideoDisplay( + IN PHYSICAL_ADDRESS PhysicalAddress, + IN SIZE_T NumberOfBytes, + IN MEMORY_CACHING_TYPE CacheType); + +NTOSAPI +NTSTATUS +DDKAPI +MmMapViewInSessionSpace( + IN PVOID Section, + OUT PVOID *MappedBase, + IN OUT PSIZE_T ViewSize); + +NTOSAPI +NTSTATUS +DDKAPI +MmMapViewInSystemSpace( + IN PVOID Section, + OUT PVOID *MappedBase, + IN PSIZE_T ViewSize); + +NTOSAPI +NTSTATUS +DDKAPI +MmMarkPhysicalMemoryAsBad( + IN PPHYSICAL_ADDRESS StartAddress, + IN OUT PLARGE_INTEGER NumberOfBytes); + +NTOSAPI +NTSTATUS +DDKAPI +MmMarkPhysicalMemoryAsGood( + IN PPHYSICAL_ADDRESS StartAddress, + IN OUT PLARGE_INTEGER NumberOfBytes); + +/* + * PVOID + * MmGetSystemAddressForMdlSafe( + * IN PMDL Mdl, + * IN MM_PAGE_PRIORITY Priority) + */ +#define MmGetSystemAddressForMdlSafe(_Mdl, _Priority) \ + ((_Mdl)->MdlFlags & (MDL_MAPPED_TO_SYSTEM_VA \ + | MDL_SOURCE_IS_NONPAGED_POOL)) ? \ + (_Mdl)->MappedSystemVa : \ + (PVOID) MmMapLockedPagesSpecifyCache((_Mdl), \ + KernelMode, MmCached, NULL, FALSE, _Priority) + +NTOSAPI +PVOID +DDKAPI +MmGetSystemRoutineAddress( + IN PUNICODE_STRING SystemRoutineName); + +/* + * ULONG + * ADDRESS_AND_SIZE_TO_SPAN_PAGES( + * IN PVOID Va, + * IN ULONG Size) + */ +#define ADDRESS_AND_SIZE_TO_SPAN_PAGES(_Va, \ + _Size) \ + ((ULONG) ((((ULONG_PTR) (_Va) & (PAGE_SIZE - 1)) \ + + (_Size) + (PAGE_SIZE - 1)) >> PAGE_SHIFT)) + +/* + * VOID + * MmInitializeMdl( + * IN PMDL MemoryDescriptorList, + * IN PVOID BaseVa, + * IN SIZE_T Length) + */ +#define MmInitializeMdl(_MemoryDescriptorList, \ + _BaseVa, \ + _Length) \ +{ \ + (_MemoryDescriptorList)->Next = (PMDL) NULL; \ + (_MemoryDescriptorList)->Size = (CSHORT) (sizeof(MDL) + \ + (sizeof(PFN_NUMBER) * ADDRESS_AND_SIZE_TO_SPAN_PAGES(_BaseVa, _Length))); \ + (_MemoryDescriptorList)->MdlFlags = 0; \ + (_MemoryDescriptorList)->StartVa = (PVOID) PAGE_ALIGN(_BaseVa); \ + (_MemoryDescriptorList)->ByteOffset = BYTE_OFFSET(_BaseVa); \ + (_MemoryDescriptorList)->ByteCount = (ULONG) _Length; \ +} + +NTOSAPI +BOOLEAN +DDKAPI +MmIsAddressValid( + IN PVOID VirtualAddress); + +NTOSAPI +LOGICAL +DDKAPI +MmIsDriverVerifying( + IN PDRIVER_OBJECT DriverObject); + +NTOSAPI +BOOLEAN +DDKAPI +MmIsThisAnNtAsSystem( + VOID); + +NTOSAPI +NTSTATUS +DDKAPI +MmIsVerifierEnabled( + OUT PULONG VerifierFlags); + +NTOSAPI +PVOID +DDKAPI +MmLockPagableDataSection( + IN PVOID AddressWithinSection); + +NTOSAPI +PVOID +DDKAPI +MmLockPagableImageSection( + IN PVOID AddressWithinSection); + +/* + * PVOID + * MmLockPagableCodeSection( + * IN PVOID AddressWithinSection) + */ +#define MmLockPagableCodeSection MmLockPagableDataSection + +NTOSAPI +VOID +DDKAPI +MmLockPagableSectionByHandle( + IN PVOID ImageSectionHandle); + +NTOSAPI +PVOID +DDKAPI +MmMapIoSpace( + IN PHYSICAL_ADDRESS PhysicalAddress, + IN ULONG NumberOfBytes, + IN MEMORY_CACHING_TYPE CacheEnable); + +NTOSAPI +PVOID +DDKAPI +MmMapLockedPages( + IN PMDL MemoryDescriptorList, + IN KPROCESSOR_MODE AccessMode); + +NTOSAPI +VOID +DDKAPI +MmPageEntireDriver( + IN PVOID AddressWithinSection); + +NTOSAPI +VOID +DDKAPI +MmProbeAndLockProcessPages( + IN OUT PMDL MemoryDescriptorList, + IN PEPROCESS Process, + IN KPROCESSOR_MODE AccessMode, + IN LOCK_OPERATION Operation); + +NTOSAPI +NTSTATUS +DDKAPI +MmProtectMdlSystemAddress( + IN PMDL MemoryDescriptorList, + IN ULONG NewProtect); + +NTOSAPI +VOID +DDKAPI +MmUnmapLockedPages( + IN PVOID BaseAddress, + IN PMDL MemoryDescriptorList); + +NTOSAPI +NTSTATUS +DDKAPI +MmUnmapViewInSessionSpace( + IN PVOID MappedBase); + +NTOSAPI +NTSTATUS +DDKAPI +MmUnmapViewInSystemSpace( + IN PVOID MappedBase); + +NTOSAPI +VOID +DDKAPI +MmUnsecureVirtualMemory( + IN HANDLE SecureHandle); + +/* + * VOID + * MmPrepareMdlForReuse( + * IN PMDL Mdl) + */ +#define MmPrepareMdlForReuse(_Mdl) \ +{ \ + if (((_Mdl)->MdlFlags & MDL_PARTIAL_HAS_BEEN_MAPPED) != 0) { \ + ASSERT(((_Mdl)->MdlFlags & MDL_PARTIAL) != 0); \ + MmUnmapLockedPages((_Mdl)->MappedSystemVa, (_Mdl)); \ + } else if (((_Mdl)->MdlFlags & MDL_PARTIAL) == 0) { \ + ASSERT(((_Mdl)->MdlFlags & MDL_MAPPED_TO_SYSTEM_VA) == 0); \ + } \ +} + +NTOSAPI +VOID +DDKAPI +MmProbeAndLockPages( + IN OUT PMDL MemoryDescriptorList, + IN KPROCESSOR_MODE AccessMode, + IN LOCK_OPERATION Operation); + +NTOSAPI +MM_SYSTEM_SIZE +DDKAPI +MmQuerySystemSize( + VOID); + +NTOSAPI +NTSTATUS +DDKAPI +MmRemovePhysicalMemory( + IN PPHYSICAL_ADDRESS StartAddress, + IN OUT PLARGE_INTEGER NumberOfBytes); + +NTOSAPI +VOID +DDKAPI +MmResetDriverPaging( + IN PVOID AddressWithinSection); + +NTOSAPI +HANDLE +DDKAPI +MmSecureVirtualMemory( + IN PVOID Address, + IN SIZE_T Size, + IN ULONG ProbeMode); + +NTOSAPI +ULONG +DDKAPI +MmSizeOfMdl( + IN PVOID Base, + IN SIZE_T Length); + +NTOSAPI +VOID +DDKAPI +MmUnlockPagableImageSection( + IN PVOID ImageSectionHandle); + +NTOSAPI +VOID +DDKAPI +MmUnlockPages( + IN PMDL MemoryDescriptorList); + +NTOSAPI +VOID +DDKAPI +MmUnmapIoSpace( + IN PVOID BaseAddress, + IN SIZE_T NumberOfBytes); + +NTOSAPI +VOID +DDKAPI +MmUnmapReservedMapping( + IN PVOID BaseAddress, + IN ULONG PoolTag, + IN PMDL MemoryDescriptorList); + +NTOSAPI +VOID +DDKAPI +MmUnmapVideoDisplay( + IN PVOID BaseAddress, + IN SIZE_T NumberOfBytes); + + + +/** Object manager routines **/ + +NTOSAPI +NTSTATUS +DDKAPI +ObAssignSecurity( + IN PACCESS_STATE AccessState, + IN PSECURITY_DESCRIPTOR SecurityDescriptor, + IN PVOID Object, + IN POBJECT_TYPE Type); + +NTOSAPI +VOID +DDKAPI +ObDereferenceSecurityDescriptor( + PSECURITY_DESCRIPTOR SecurityDescriptor, + ULONG Count); + +NTOSAPI +VOID +DDKFASTAPI +ObfDereferenceObject( + IN PVOID Object); + +/* + * VOID + * ObDereferenceObject( + * IN PVOID Object) + */ +#define ObDereferenceObject ObfDereferenceObject + +NTOSAPI +NTSTATUS +DDKAPI +ObGetObjectSecurity( + IN PVOID Object, + OUT PSECURITY_DESCRIPTOR *SecurityDescriptor, + OUT PBOOLEAN MemoryAllocated); + +NTOSAPI +NTSTATUS +DDKAPI +ObInsertObject( + IN PVOID Object, + IN PACCESS_STATE PassedAccessState OPTIONAL, + IN ACCESS_MASK DesiredAccess, + IN ULONG AdditionalReferences, + OUT PVOID* ReferencedObject OPTIONAL, + OUT PHANDLE Handle); + +NTOSAPI +VOID +DDKFASTAPI +ObfReferenceObject( + IN PVOID Object); + +NTOSAPI +NTSTATUS +DDKAPI +ObLogSecurityDescriptor( + IN PSECURITY_DESCRIPTOR InputSecurityDescriptor, + OUT PSECURITY_DESCRIPTOR *OutputSecurityDescriptor, + IN ULONG RefBias); +/* + * VOID + * ObReferenceObject( + * IN PVOID Object) + */ +#define ObReferenceObject ObfReferenceObject + +NTOSAPI +VOID +DDKAPI +ObMakeTemporaryObject( + IN PVOID Object); + +NTOSAPI +NTSTATUS +DDKAPI +ObOpenObjectByName( + IN POBJECT_ATTRIBUTES ObjectAttributes, + IN POBJECT_TYPE ObjectType, + IN OUT PVOID ParseContext OPTIONAL, + IN KPROCESSOR_MODE AccessMode, + IN ACCESS_MASK DesiredAccess, + IN PACCESS_STATE PassedAccessState, + OUT PHANDLE Handle); + +NTOSAPI +NTSTATUS +DDKAPI +ObOpenObjectByPointer( + IN PVOID Object, + IN ULONG HandleAttributes, + IN PACCESS_STATE PassedAccessState OPTIONAL, + IN ACCESS_MASK DesiredAccess OPTIONAL, + IN POBJECT_TYPE ObjectType OPTIONAL, + IN KPROCESSOR_MODE AccessMode, + OUT PHANDLE Handle); + +NTOSAPI +NTSTATUS +DDKAPI +ObQueryObjectAuditingByHandle( + IN HANDLE Handle, + OUT PBOOLEAN GenerateOnClose); + +NTOSAPI +NTSTATUS +DDKAPI +ObReferenceObjectByHandle( + IN HANDLE Handle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_TYPE ObjectType OPTIONAL, + IN KPROCESSOR_MODE AccessMode, + OUT PVOID *Object, + OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL); + +NTOSAPI +NTSTATUS +DDKAPI +ObReferenceObjectByName( + IN PUNICODE_STRING ObjectPath, + IN ULONG Attributes, + IN PACCESS_STATE PassedAccessState OPTIONAL, + IN ACCESS_MASK DesiredAccess OPTIONAL, + IN POBJECT_TYPE ObjectType, + IN KPROCESSOR_MODE AccessMode, + IN OUT PVOID ParseContext OPTIONAL, + OUT PVOID *Object); + +NTOSAPI +NTSTATUS +DDKAPI +ObReferenceObjectByPointer( + IN PVOID Object, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_TYPE ObjectType, + IN KPROCESSOR_MODE AccessMode); + +NTOSAPI +VOID +DDKAPI +ObReferenceSecurityDescriptor( + IN PSECURITY_DESCRIPTOR SecurityDescriptor, + IN ULONG Count); + +NTOSAPI +VOID +DDKAPI +ObReleaseObjectSecurity( + IN PSECURITY_DESCRIPTOR SecurityDescriptor, + IN BOOLEAN MemoryAllocated); + + + +/** Process manager routines **/ + +NTOSAPI +NTSTATUS +DDKAPI +PsCreateSystemProcess( + IN PHANDLE ProcessHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes); + +NTOSAPI +NTSTATUS +DDKAPI +PsCreateSystemThread( + OUT PHANDLE ThreadHandle, + IN ULONG DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, + IN HANDLE ProcessHandle OPTIONAL, + OUT PCLIENT_ID ClientId OPTIONAL, + IN PKSTART_ROUTINE StartRoutine, + IN PVOID StartContext); + +/* + * PEPROCESS + * PsGetCurrentProcess(VOID) + */ +#define PsGetCurrentProcess IoGetCurrentProcess + +NTOSAPI +HANDLE +DDKAPI +PsGetCurrentProcessId( + VOID); + +/* + * PETHREAD + * PsGetCurrentThread(VOID) + */ +#define PsGetCurrentThread() \ + ((PETHREAD) KeGetCurrentThread()) + +NTOSAPI +HANDLE +DDKAPI +PsGetCurrentThreadId( + VOID); + +NTOSAPI +BOOLEAN +DDKAPI +PsGetVersion( + PULONG MajorVersion OPTIONAL, + PULONG MinorVersion OPTIONAL, + PULONG BuildNumber OPTIONAL, + PUNICODE_STRING CSDVersion OPTIONAL); + +NTOSAPI +NTSTATUS +DDKAPI +PsRemoveCreateThreadNotifyRoutine( + IN PCREATE_THREAD_NOTIFY_ROUTINE NotifyRoutine); + +NTOSAPI +NTSTATUS +DDKAPI +PsRemoveLoadImageNotifyRoutine( + IN PLOAD_IMAGE_NOTIFY_ROUTINE NotifyRoutine); + +NTOSAPI +NTSTATUS +DDKAPI +PsSetCreateProcessNotifyRoutine( + IN PCREATE_PROCESS_NOTIFY_ROUTINE NotifyRoutine, + IN BOOLEAN Remove); + +NTOSAPI +NTSTATUS +DDKAPI +PsSetCreateThreadNotifyRoutine( + IN PCREATE_THREAD_NOTIFY_ROUTINE NotifyRoutine); + +NTOSAPI +NTSTATUS +DDKAPI +PsSetLoadImageNotifyRoutine( + IN PLOAD_IMAGE_NOTIFY_ROUTINE NotifyRoutine); + +NTOSAPI +NTSTATUS +DDKAPI +PsTerminateSystemThread( + IN NTSTATUS ExitStatus); + + + +/** Security reference monitor routines **/ + +NTOSAPI +BOOLEAN +DDKAPI +SeAccessCheck( + IN PSECURITY_DESCRIPTOR SecurityDescriptor, + IN PSECURITY_SUBJECT_CONTEXT SubjectSecurityContext, + IN BOOLEAN SubjectContextLocked, + IN ACCESS_MASK DesiredAccess, + IN ACCESS_MASK PreviouslyGrantedAccess, + OUT PPRIVILEGE_SET *Privileges OPTIONAL, + IN PGENERIC_MAPPING GenericMapping, + IN KPROCESSOR_MODE AccessMode, + OUT PACCESS_MASK GrantedAccess, + OUT PNTSTATUS AccessStatus); + +NTOSAPI +NTSTATUS +DDKAPI +SeAssignSecurity( + IN PSECURITY_DESCRIPTOR ParentDescriptor OPTIONAL, + IN PSECURITY_DESCRIPTOR ExplicitDescriptor OPTIONAL, + OUT PSECURITY_DESCRIPTOR *NewDescriptor, + IN BOOLEAN IsDirectoryObject, + IN PSECURITY_SUBJECT_CONTEXT SubjectContext, + IN PGENERIC_MAPPING GenericMapping, + IN POOL_TYPE PoolType); + +NTOSAPI +NTSTATUS +DDKAPI +SeAssignSecurityEx( + IN PSECURITY_DESCRIPTOR ParentDescriptor OPTIONAL, + IN PSECURITY_DESCRIPTOR ExplicitDescriptor OPTIONAL, + OUT PSECURITY_DESCRIPTOR *NewDescriptor, + IN GUID *ObjectType OPTIONAL, + IN BOOLEAN IsDirectoryObject, + IN ULONG AutoInheritFlags, + IN PSECURITY_SUBJECT_CONTEXT SubjectContext, + IN PGENERIC_MAPPING GenericMapping, + IN POOL_TYPE PoolType); + +NTOSAPI +NTSTATUS +DDKAPI +SeDeassignSecurity( + IN OUT PSECURITY_DESCRIPTOR *SecurityDescriptor); + +NTOSAPI +BOOLEAN +DDKAPI +SeSinglePrivilegeCheck( + LUID PrivilegeValue, + KPROCESSOR_MODE PreviousMode); + +NTOSAPI +BOOLEAN +DDKAPI +SeValidSecurityDescriptor( + IN ULONG Length, + IN PSECURITY_DESCRIPTOR SecurityDescriptor); + + + +/** NtXxx routines **/ + +NTOSAPI +NTSTATUS +DDKAPI +NtOpenProcess( + OUT PHANDLE ProcessHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes, + IN PCLIENT_ID ClientId OPTIONAL); + +NTOSAPI +NTSTATUS +DDKAPI +NtQueryInformationProcess( + IN HANDLE ProcessHandle, + IN PROCESSINFOCLASS ProcessInformationClass, + OUT PVOID ProcessInformation, + IN ULONG ProcessInformationLength, + OUT PULONG ReturnLength OPTIONAL); + + + +/** NtXxx and ZwXxx routines **/ + +NTOSAPI +NTSTATUS +DDKAPI +ZwCancelTimer( + IN HANDLE TimerHandle, + OUT PBOOLEAN CurrentState OPTIONAL); + +NTOSAPI +NTSTATUS +DDKAPI +NtClose( + IN HANDLE Handle); + +NTOSAPI +NTSTATUS +DDKAPI +ZwClose( + IN HANDLE Handle); + +NTOSAPI +NTSTATUS +DDKAPI +ZwCreateDirectoryObject( + OUT PHANDLE DirectoryHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes); + +NTOSAPI +NTSTATUS +DDKAPI +NtCreateEvent( + OUT PHANDLE EventHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, + IN EVENT_TYPE EventType, + IN BOOLEAN InitialState); + +NTOSAPI +NTSTATUS +DDKAPI +ZwCreateEvent( + OUT PHANDLE EventHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, + IN EVENT_TYPE EventType, + IN BOOLEAN InitialState); + +NTOSAPI +NTSTATUS +DDKAPI +ZwCreateFile( + OUT PHANDLE FileHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN PLARGE_INTEGER AllocationSize OPTIONAL, + IN ULONG FileAttributes, + IN ULONG ShareAccess, + IN ULONG CreateDisposition, + IN ULONG CreateOptions, + IN PVOID EaBuffer OPTIONAL, + IN ULONG EaLength); + +NTOSAPI +NTSTATUS +DDKAPI +ZwCreateKey( + OUT PHANDLE KeyHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes, + IN ULONG TitleIndex, + IN PUNICODE_STRING Class OPTIONAL, + IN ULONG CreateOptions, + OUT PULONG Disposition OPTIONAL); + +NTOSAPI +NTSTATUS +DDKAPI +ZwCreateTimer( + OUT PHANDLE TimerHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, + IN TIMER_TYPE TimerType); + +NTOSAPI +NTSTATUS +DDKAPI +ZwDeleteKey( + IN HANDLE KeyHandle); + +NTOSAPI +NTSTATUS +DDKAPI +ZwDeleteValueKey( + IN HANDLE KeyHandle, + IN PUNICODE_STRING ValueName); + +NTOSAPI +NTSTATUS +DDKAPI +NtDeviceIoControlFile( + IN HANDLE DeviceHandle, + IN HANDLE Event OPTIONAL, + IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL, + IN PVOID UserApcContext OPTIONAL, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN ULONG IoControlCode, + IN PVOID InputBuffer, + IN ULONG InputBufferSize, + OUT PVOID OutputBuffer, + IN ULONG OutputBufferSize); + +NTOSAPI +NTSTATUS +DDKAPI +ZwDeviceIoControlFile( + IN HANDLE DeviceHandle, + IN HANDLE Event OPTIONAL, + IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL, + IN PVOID UserApcContext OPTIONAL, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN ULONG IoControlCode, + IN PVOID InputBuffer, + IN ULONG InputBufferSize, + OUT PVOID OutputBuffer, + IN ULONG OutputBufferSize); + +NTOSAPI +NTSTATUS +DDKAPI +ZwEnumerateKey( + IN HANDLE KeyHandle, + IN ULONG Index, + IN KEY_INFORMATION_CLASS KeyInformationClass, + OUT PVOID KeyInformation, + IN ULONG Length, + OUT PULONG ResultLength); + +NTOSAPI +NTSTATUS +DDKAPI +ZwEnumerateValueKey( + IN HANDLE KeyHandle, + IN ULONG Index, + IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, + OUT PVOID KeyValueInformation, + IN ULONG Length, + OUT PULONG ResultLength); + +NTOSAPI +NTSTATUS +DDKAPI +ZwFlushKey( + IN HANDLE KeyHandle); + +NTOSAPI +NTSTATUS +DDKAPI +ZwMakeTemporaryObject( + IN HANDLE Handle); + +NTOSAPI +NTSTATUS +DDKAPI +NtMapViewOfSection( + IN HANDLE SectionHandle, + IN HANDLE ProcessHandle, + IN OUT PVOID *BaseAddress, + IN ULONG ZeroBits, + IN ULONG CommitSize, + IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, + IN OUT PSIZE_T ViewSize, + IN SECTION_INHERIT InheritDisposition, + IN ULONG AllocationType, + IN ULONG Protect); + +NTOSAPI +NTSTATUS +DDKAPI +ZwMapViewOfSection( + IN HANDLE SectionHandle, + IN HANDLE ProcessHandle, + IN OUT PVOID *BaseAddress, + IN ULONG ZeroBits, + IN ULONG CommitSize, + IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, + IN OUT PSIZE_T ViewSize, + IN SECTION_INHERIT InheritDisposition, + IN ULONG AllocationType, + IN ULONG Protect); + +NTOSAPI +NTSTATUS +DDKAPI +NtOpenFile( + OUT PHANDLE FileHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN ULONG ShareAccess, + IN ULONG OpenOptions); + +NTOSAPI +NTSTATUS +DDKAPI +ZwOpenFile( + OUT PHANDLE FileHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN ULONG ShareAccess, + IN ULONG OpenOptions); + +NTOSAPI +NTSTATUS +DDKAPI +ZwOpenKey( + OUT PHANDLE KeyHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes); + +NTOSAPI +NTSTATUS +DDKAPI +ZwOpenSection( + OUT PHANDLE SectionHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes); + +NTOSAPI +NTSTATUS +DDKAPI +ZwOpenSymbolicLinkObject( + OUT PHANDLE LinkHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes); + +NTOSAPI +NTSTATUS +DDKAPI +ZwOpenTimer( + OUT PHANDLE TimerHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes); + +NTOSAPI +NTSTATUS +DDKAPI +ZwQueryInformationFile( + IN HANDLE FileHandle, + OUT PIO_STATUS_BLOCK IoStatusBlock, + OUT PVOID FileInformation, + IN ULONG Length, + IN FILE_INFORMATION_CLASS FileInformationClass); + +NTOSAPI +NTSTATUS +DDKAPI +ZwQueryKey( + IN HANDLE KeyHandle, + IN KEY_INFORMATION_CLASS KeyInformationClass, + OUT PVOID KeyInformation, + IN ULONG Length, + OUT PULONG ResultLength); + +NTOSAPI +NTSTATUS +DDKAPI +ZwQuerySymbolicLinkObject( + IN HANDLE LinkHandle, + IN OUT PUNICODE_STRING LinkTarget, + OUT PULONG ReturnedLength OPTIONAL); + +NTOSAPI +NTSTATUS +DDKAPI +ZwQueryValueKey( + IN HANDLE KeyHandle, + IN PUNICODE_STRING ValueName, + IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, + OUT PVOID KeyValueInformation, + IN ULONG Length, + OUT PULONG ResultLength); + +NTOSAPI +NTSTATUS +DDKAPI +NtReadFile( + IN HANDLE FileHandle, + IN HANDLE Event OPTIONAL, + IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, + IN PVOID ApcContext OPTIONAL, + OUT PIO_STATUS_BLOCK IoStatusBlock, + OUT PVOID Buffer, + IN ULONG Length, + IN PLARGE_INTEGER ByteOffset OPTIONAL, + IN PULONG Key OPTIONAL); + +NTOSAPI +NTSTATUS +DDKAPI +ZwReadFile( + IN HANDLE FileHandle, + IN HANDLE Event OPTIONAL, + IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, + IN PVOID ApcContext OPTIONAL, + OUT PIO_STATUS_BLOCK IoStatusBlock, + OUT PVOID Buffer, + IN ULONG Length, + IN PLARGE_INTEGER ByteOffset OPTIONAL, + IN PULONG Key OPTIONAL); + +NTOSAPI +NTSTATUS +DDKAPI +NtSetEvent( + IN HANDLE EventHandle, + OUT PLONG PreviousState OPTIONAL); + +NTOSAPI +NTSTATUS +DDKAPI +ZwSetEvent( + IN HANDLE EventHandle, + OUT PLONG PreviousState OPTIONAL); + +NTOSAPI +NTSTATUS +DDKAPI +ZwSetInformationFile( + IN HANDLE FileHandle, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN PVOID FileInformation, + IN ULONG Length, + IN FILE_INFORMATION_CLASS FileInformationClass); + +NTOSAPI +NTSTATUS +DDKAPI +ZwSetInformationThread( + IN HANDLE ThreadHandle, + IN THREADINFOCLASS ThreadInformationClass, + IN PVOID ThreadInformation, + IN ULONG ThreadInformationLength); + +NTOSAPI +NTSTATUS +DDKAPI +ZwSetTimer( + IN HANDLE TimerHandle, + IN PLARGE_INTEGER DueTime, + IN PTIMER_APC_ROUTINE TimerApcRoutine OPTIONAL, + IN PVOID TimerContext OPTIONAL, + IN BOOLEAN WakeTimer, + IN LONG Period OPTIONAL, + OUT PBOOLEAN PreviousState OPTIONAL); + +NTOSAPI +NTSTATUS +DDKAPI +ZwSetValueKey( + IN HANDLE KeyHandle, + IN PUNICODE_STRING ValueName, + IN ULONG TitleIndex OPTIONAL, + IN ULONG Type, + IN PVOID Data, + IN ULONG DataSize); + +/* [Nt|Zw]MapViewOfSection.InheritDisposition constants */ +#define AT_EXTENDABLE_FILE 0x00002000 +#define SEC_NO_CHANGE 0x00400000 +#define AT_RESERVED 0x20000000 +#define AT_ROUND_TO_PAGE 0x40000000 + +NTOSAPI +NTSTATUS +DDKAPI +NtUnmapViewOfSection( + IN HANDLE ProcessHandle, + IN PVOID BaseAddress); + +NTOSAPI +NTSTATUS +DDKAPI +ZwUnmapViewOfSection( + IN HANDLE ProcessHandle, + IN PVOID BaseAddress); + +NTOSAPI +NTSTATUS +DDKAPI +NtWaitForSingleObject( + IN HANDLE ObjectHandle, + IN BOOLEAN Alertable, + IN PLARGE_INTEGER TimeOut OPTIONAL); + +NTOSAPI +NTSTATUS +DDKAPI +ZwWaitForSingleObject( + IN HANDLE ObjectHandle, + IN BOOLEAN Alertable, + IN PLARGE_INTEGER TimeOut OPTIONAL); + +NTOSAPI +NTSTATUS +DDKAPI +NtWriteFile( + IN HANDLE FileHandle, + IN HANDLE Event OPTIONAL, + IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, + IN PVOID ApcContext OPTIONAL, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN PVOID Buffer, + IN ULONG Length, + IN PLARGE_INTEGER ByteOffset OPTIONAL, + IN PULONG Key OPTIONAL); + +NTOSAPI +NTSTATUS +DDKAPI +ZwWriteFile( + IN HANDLE FileHandle, + IN HANDLE Event OPTIONAL, + IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, + IN PVOID ApcContext OPTIONAL, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN PVOID Buffer, + IN ULONG Length, + IN PLARGE_INTEGER ByteOffset OPTIONAL, + IN PULONG Key OPTIONAL); + + + +/** Power management support routines **/ + +NTOSAPI +NTSTATUS +DDKAPI +PoCallDriver( + IN PDEVICE_OBJECT DeviceObject, + IN OUT PIRP Irp); + +NTOSAPI +PULONG +DDKAPI +PoRegisterDeviceForIdleDetection( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG ConservationIdleTime, + IN ULONG PerformanceIdleTime, + IN DEVICE_POWER_STATE State); + +NTOSAPI +PVOID +DDKAPI +PoRegisterSystemState( + IN PVOID StateHandle, + IN EXECUTION_STATE Flags); + +NTOSAPI +NTSTATUS +DDKAPI +PoRequestPowerIrp( + IN PDEVICE_OBJECT DeviceObject, + IN UCHAR MinorFunction, + IN POWER_STATE PowerState, + IN PREQUEST_POWER_COMPLETE CompletionFunction, + IN PVOID Context, + OUT PIRP *Irp OPTIONAL); + +NTOSAPI +NTSTATUS +DDKAPI +PoRequestShutdownEvent( + OUT PVOID *Event); + +NTOSAPI +VOID +DDKAPI +PoSetDeviceBusy( + PULONG IdlePointer); + +NTOSAPI +POWER_STATE +DDKAPI +PoSetPowerState( + IN PDEVICE_OBJECT DeviceObject, + IN POWER_STATE_TYPE Type, + IN POWER_STATE State); + +NTOSAPI +VOID +DDKAPI +PoSetSystemState( + IN EXECUTION_STATE Flags); + +NTOSAPI +VOID +DDKAPI +PoStartNextPowerIrp( + IN PIRP Irp); + +NTOSAPI +VOID +DDKAPI +PoUnregisterSystemState( + IN PVOID StateHandle); + + + +/** WMI library support routines **/ + +NTOSAPI +NTSTATUS +DDKAPI +WmiCompleteRequest( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp, + IN NTSTATUS Status, + IN ULONG BufferUsed, + IN CCHAR PriorityBoost); + +NTOSAPI +NTSTATUS +DDKAPI +WmiFireEvent( + IN PDEVICE_OBJECT DeviceObject, + IN LPGUID Guid, + IN ULONG InstanceIndex, + IN ULONG EventDataSize, + IN PVOID EventData); + +NTOSAPI +NTSTATUS +DDKAPI +WmiQueryTraceInformation( + IN TRACE_INFORMATION_CLASS TraceInformationClass, + OUT PVOID TraceInformation, + IN ULONG TraceInformationLength, + OUT PULONG RequiredLength OPTIONAL, + IN PVOID Buffer OPTIONAL); + +NTOSAPI +NTSTATUS +DDKAPI +WmiSystemControl( + IN PWMILIB_CONTEXT WmiLibInfo, + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp, + OUT PSYSCTL_IRP_DISPOSITION IrpDisposition); + +NTOSAPI +NTSTATUS +DDKCDECLAPI +WmiTraceMessage( + IN TRACEHANDLE LoggerHandle, + IN ULONG MessageFlags, + IN LPGUID MessageGuid, + IN USHORT MessageNumber, + IN ...); + +#if 0 +/* FIXME: Get va_list from where? */ +NTOSAPI +NTSTATUS +DDKCDECLAPI +WmiTraceMessageVa( + IN TRACEHANDLE LoggerHandle, + IN ULONG MessageFlags, + IN LPGUID MessageGuid, + IN USHORT MessageNumber, + IN va_list MessageArgList); +#endif + + +/** Kernel debugger routines **/ + +NTOSAPI +VOID +DDKAPI +KdDisableDebugger( + VOID); + +NTOSAPI +VOID +DDKAPI +KdEnableDebugger( + VOID); + +NTOSAPI +VOID +DDKAPI +DbgBreakPoint( + VOID); + +NTOSAPI +VOID +DDKAPI +DbgBreakPointWithStatus( + IN ULONG Status); + +NTOSAPI +ULONG +DDKCDECLAPI +DbgPrint( + IN PCH Format, + IN ...); + +NTOSAPI +ULONG +DDKCDECLAPI +DbgPrintEx( + IN ULONG ComponentId, + IN ULONG Level, + IN PCH Format, + IN ...); + +NTOSAPI +ULONG +DDKCDECLAPI +DbgPrintReturnControlC( + IN PCH Format, + IN ...); + +NTOSAPI +BOOLEAN +DDKAPI +DbgQueryDebugFilterState( + IN ULONG ComponentId, + IN ULONG Level); + +NTOSAPI +NTSTATUS +DDKAPI +DbgSetDebugFilterState( + IN ULONG ComponentId, + IN ULONG Level, + IN BOOLEAN State); + +#ifdef DBG + +#define KdPrint(_x_) DbgPrint _x_ +#define KdPrintEx(_x_) DbgPrintEx _x_ +#define KdBreakPoint() DbgBreakPoint() +#define KdBreakPointWithStatus(s) DbgBreakPointWithStatus(s) + +#else /* !DBG */ + +#define KdPrint(_x_) +#define KdPrintEx(_x_) +#define KdBreakPoint() +#define KdBreakPointWithStatus(s) + +#endif /* !DBG */ + +#if defined(_NTDDK_) || defined(_NTHAL_) || defined(_WDMDDK_) || defined(_NTOSP_) + +extern NTOSAPI PBOOLEAN KdDebuggerNotPresent; +extern NTOSAPI PBOOLEAN KdDebuggerEnabled; +#define KD_DEBUGGER_ENABLED *KdDebuggerEnabled +#define KD_DEBUGGER_NOT_PRESENT *KdDebuggerNotPresent + +#else + +extern BOOLEAN KdDebuggerNotPresent; +extern BOOLEAN KdDebuggerEnabled; +#define KD_DEBUGGER_ENABLED KdDebuggerEnabled +#define KD_DEBUGGER_NOT_PRESENT KdDebuggerNotPresent + +#endif + +/* Available as intrinsics on MSVC */ +static __inline void _disable(void) {__asm__("cli\n\t");} +static __inline void _enable(void) {__asm__("sti\n\t");} + +#ifdef __cplusplus +} +#endif + +#endif /* __WINDDK_H */ diff --git a/reactos/include/ddk/winnt4.h b/reactos/include/ddk/winnt4.h new file mode 100644 index 00000000000..798da3ff5a1 --- /dev/null +++ b/reactos/include/ddk/winnt4.h @@ -0,0 +1,619 @@ +/* + * winnt4.h + * + * Definitions only used in Windows NT 4.0 and earlier versions + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __WINNT4_H +#define __WINNT4_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _ZONE_SEGMENT_HEADER { + SINGLE_LIST_ENTRY SegmentList; + PVOID Reserved; +} ZONE_SEGMENT_HEADER, *PZONE_SEGMENT_HEADER; + +typedef struct _ZONE_HEADER { + SINGLE_LIST_ENTRY FreeList; + SINGLE_LIST_ENTRY SegmentList; + ULONG BlockSize; + ULONG TotalSegmentSize; +} ZONE_HEADER, *PZONE_HEADER; + +static __inline PVOID +ExAllocateFromZone( + IN PZONE_HEADER Zone) +{ + if (Zone->FreeList.Next) + Zone->FreeList.Next = Zone->FreeList.Next->Next; + return (PVOID) Zone->FreeList.Next; +} + +NTOSAPI +NTSTATUS +DDKAPI +ExExtendZone( + IN PZONE_HEADER Zone, + IN PVOID Segment, + IN ULONG SegmentSize); + +static __inline PVOID +ExFreeToZone( + IN PZONE_HEADER Zone, + IN PVOID Block) +{ + ((PSINGLE_LIST_ENTRY) Block)->Next = Zone->FreeList.Next; + Zone->FreeList.Next = ((PSINGLE_LIST_ENTRY) Block); + return ((PSINGLE_LIST_ENTRY) Block)->Next; +} + +NTOSAPI +NTSTATUS +DDKAPI +ExInitializeZone( + IN PZONE_HEADER Zone, + IN ULONG BlockSize, + IN PVOID InitialSegment, + IN ULONG InitialSegmentSize); + +/* + * PVOID + * ExInterlockedAllocateFromZone( + * IN PZONE_HEADER Zone, + * IN PKSPIN_LOCK Lock) + */ +#define ExInterlockedAllocateFromZone(Zone, \ + Lock) \ + ((PVOID) ExInterlockedPopEntryList(&Zone->FreeList, Lock)) + +NTOSAPI +NTSTATUS +DDKAPI +ExInterlockedExtendZone( + IN PZONE_HEADER Zone, + IN PVOID Segment, + IN ULONG SegmentSize, + IN PKSPIN_LOCK Lock); + +NTOSAPI +PVOID +DDKAPI +ExInterlockedFreeToZone( + IN PZONE_HEADER Zone, + IN PVOID Block, + IN PKSPIN_LOCK Lock); + +/* + * VOID + * ExInitializeWorkItem( + * IN PWORK_QUEUE_ITEM Item, + * IN PWORKER_THREAD_ROUTINE Routine, + * IN PVOID Context) + */ +#define ExInitializeWorkItem(Item, \ + Routine, \ + Context) \ +{ \ + (Item)->WorkerRoutine = Routine; \ + (Item)->Parameter = Context; \ + (Item)->List.Flink = NULL; \ +} + +/* + * BOOLEAN + * ExIsFullZone( + * IN PZONE_HEADER Zone) + */ +#define ExIsFullZone(Zone) \ + ((Zone)->FreeList.Next == (PSINGLE_LIST_ENTRY) NULL) + +NTOSAPI +VOID +DDKAPI +ExQueueWorkItem( + IN PWORK_QUEUE_ITEM WorkItem, + IN WORK_QUEUE_TYPE QueueType); + +NTOSAPI +BOOLEAN +DDKAPI +ExIsObjectInFirstZoneSegment( + IN PZONE_HEADER Zone, + IN PVOID Object); + +NTOSAPI +VOID +DDKAPI +ExReleaseResource( + IN PERESOURCE Resource); + +#define ExAcquireResourceExclusive ExAcquireResourceExclusiveLite +#define ExAcquireResourceShared ExAcquireResourceSharedLite +#define ExConvertExclusiveToShared ExConvertExclusiveToSharedLite +#define ExDeleteResource ExDeleteResourceLite +#define ExInitializeResource ExInitializeResourceLite +#define ExIsResourceAcquiredExclusive ExIsResourceAcquiredExclusiveLite +#define ExIsResourceAcquiredShared ExIsResourceAcquiredSharedLite +#define ExIsResourceAcquired ExIsResourceAcquiredSharedLite +#define ExReleaseResourceForThread ExReleaseResourceForThreadLite + +NTOSAPI +INTERLOCKED_RESULT +DDKAPI +ExInterlockedDecrementLong( + IN PLONG Addend, + IN PKSPIN_LOCK Lock); + +NTOSAPI +ULONG +DDKAPI +ExInterlockedExchangeUlong( + IN PULONG Target, + IN ULONG Value, + IN PKSPIN_LOCK Lock); + +NTOSAPI +INTERLOCKED_RESULT +DDKAPI +ExInterlockedIncrementLong( + IN PLONG Addend, + IN PKSPIN_LOCK Lock); + +NTHALAPI +VOID +DDKAPI +HalAcquireDisplayOwnership( + IN PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters); + +NTHALAPI +NTSTATUS +DDKAPI +HalAllocateAdapterChannel( + IN PADAPTER_OBJECT AdapterObject, + IN PWAIT_CONTEXT_BLOCK Wcb, + IN ULONG NumberOfMapRegisters, + IN PDRIVER_CONTROL ExecutionRoutine); + +NTHALAPI +PVOID +DDKAPI +HalAllocateCommonBuffer( + IN PADAPTER_OBJECT AdapterObject, + IN ULONG Length, + OUT PPHYSICAL_ADDRESS LogicalAddress, + IN BOOLEAN CacheEnabled); + +NTHALAPI +NTSTATUS +DDKAPI +HalAssignSlotResources( + IN PUNICODE_STRING RegistryPath, + IN PUNICODE_STRING DriverClassName, + IN PDRIVER_OBJECT DriverObject, + IN PDEVICE_OBJECT DeviceObject, + IN INTERFACE_TYPE BusType, + IN ULONG BusNumber, + IN ULONG SlotNumber, + IN OUT PCM_RESOURCE_LIST *AllocatedResources); + +NTHALAPI +VOID +DDKAPI +HalFreeCommonBuffer( + IN PADAPTER_OBJECT AdapterObject, + IN ULONG Length, + IN PHYSICAL_ADDRESS LogicalAddress, + IN PVOID VirtualAddress, + IN BOOLEAN CacheEnabled); + +NTHALAPI +PADAPTER_OBJECT +DDKAPI +HalGetAdapter( + IN PDEVICE_DESCRIPTION DeviceDescription, + IN OUT PULONG NumberOfMapRegisters); + +NTHALAPI +ULONG +DDKAPI +HalGetBusData( + IN BUS_DATA_TYPE BusDataType, + IN ULONG BusNumber, + IN ULONG SlotNumber, + IN PVOID Buffer, + IN ULONG Length); + +NTHALAPI +ULONG +DDKAPI +HalGetBusDataByOffset( + IN BUS_DATA_TYPE BusDataType, + IN ULONG BusNumber, + IN ULONG SlotNumber, + IN PVOID Buffer, + IN ULONG Offset, + IN ULONG Length); + +NTHALAPI +ULONG +DDKAPI +HalGetDmaAlignmentRequirement( + VOID); + +NTHALAPI +ULONG +DDKAPI +HalGetInterruptVector( + IN INTERFACE_TYPE InterfaceType, + IN ULONG BusNumber, + IN ULONG BusInterruptLevel, + IN ULONG BusInterruptVector, + OUT PKIRQL Irql, + OUT PKAFFINITY Affinity); + +NTHALAPI +ULONG +DDKAPI +HalReadDmaCounter( + IN PADAPTER_OBJECT AdapterObject); + +NTHALAPI +ULONG +DDKAPI +HalSetBusData( + IN BUS_DATA_TYPE BusDataType, + IN ULONG BusNumber, + IN ULONG SlotNumber, + IN PVOID Buffer, + IN ULONG Length); + +NTHALAPI +ULONG +DDKAPI +HalSetBusDataByOffset( + IN BUS_DATA_TYPE BusDataType, + IN ULONG BusNumber, + IN ULONG SlotNumber, + IN PVOID Buffer, + IN ULONG Offset, + IN ULONG Length); + +NTHALAPI +BOOLEAN +DDKAPI +HalTranslateBusAddress( + IN INTERFACE_TYPE InterfaceType, + IN ULONG BusNumber, + IN PHYSICAL_ADDRESS BusAddress, + IN OUT PULONG AddressSpace, + OUT PPHYSICAL_ADDRESS TranslatedAddress); + +NTOSAPI +NTSTATUS +DDKAPI +IoAllocateAdapterChannel( + IN PADAPTER_OBJECT AdapterObject, + IN PDEVICE_OBJECT DeviceObject, + IN ULONG NumberOfMapRegisters, + IN PDRIVER_CONTROL ExecutionRoutine, + IN PVOID Context); + +NTOSAPI +NTSTATUS +DDKAPI +IoAssignResources( + IN PUNICODE_STRING RegistryPath, + IN PUNICODE_STRING DriverClassName OPTIONAL, + IN PDRIVER_OBJECT DriverObject, + IN PDEVICE_OBJECT DeviceObject OPTIONAL, + IN PIO_RESOURCE_REQUIREMENTS_LIST RequestedResources, + IN OUT PCM_RESOURCE_LIST *AllocatedResources); + +NTOSAPI +NTSTATUS +DDKAPI +IoAttachDeviceByPointer( + IN PDEVICE_OBJECT SourceDevice, + IN PDEVICE_OBJECT TargetDevice); + +NTHALAPI +BOOLEAN +DDKAPI +IoFlushAdapterBuffers( + IN PADAPTER_OBJECT AdapterObject, + IN PMDL Mdl, + IN PVOID MapRegisterBase, + IN PVOID CurrentVa, + IN ULONG Length, + IN BOOLEAN WriteToDevice); + +NTHALAPI +VOID +DDKAPI +IoFreeAdapterChannel( + IN PADAPTER_OBJECT AdapterObject); + +NTHALAPI +VOID +DDKAPI +IoFreeMapRegisters( + IN PADAPTER_OBJECT AdapterObject, + IN PVOID MapRegisterBase, + IN ULONG NumberOfMapRegisters); + +NTHALAPI +PHYSICAL_ADDRESS +DDKAPI +IoMapTransfer( + IN PADAPTER_OBJECT AdapterObject, + IN PMDL Mdl, + IN PVOID MapRegisterBase, + IN PVOID CurrentVa, + IN OUT PULONG Length, + IN BOOLEAN WriteToDevice); + +NTOSAPI +PMDL +DDKAPI +MmCreateMdl( + IN PMDL MemoryDescriptorList OPTIONAL, + IN PVOID Base, + IN SIZE_T Length); + +NTOSAPI +BOOLEAN +DDKAPI +MmIsNonPagedSystemAddressValid( + IN PVOID VirtualAddress); + +NTOSAPI +LARGE_INTEGER +DDKAPI +RtlEnlargedIntegerMultiply( + IN LONG Multiplicand, + IN LONG Multiplier); + +NTOSAPI +ULONG +DDKAPI +RtlEnlargedUnsignedDivide( + IN ULARGE_INTEGER Dividend, + IN ULONG Divisor, + IN OUT PULONG Remainder); + +NTOSAPI +LARGE_INTEGER +DDKAPI +RtlEnlargedUnsignedMultiply( + IN ULONG Multiplicand, + IN ULONG Multiplier); + +NTOSAPI +LARGE_INTEGER +DDKAPI +RtlExtendedIntegerMultiply( + IN LARGE_INTEGER Multiplicand, + IN LONG Multiplier); + +NTOSAPI +LARGE_INTEGER +DDKAPI +RtlExtendedLargeIntegerDivide( + IN LARGE_INTEGER Dividend, + IN ULONG Divisor, + IN OUT PULONG Remainder); + +NTOSAPI +LARGE_INTEGER +DDKAPI +RtlExtendedMagicDivide( + IN LARGE_INTEGER Dividend, + IN LARGE_INTEGER MagicDivisor, + IN CCHAR ShiftCount); + +NTOSAPI +LARGE_INTEGER +DDKAPI +RtlLargeIntegerAdd( + IN LARGE_INTEGER Addend1, + IN LARGE_INTEGER Addend2); + +NTOSAPI +VOID +DDKAPI +RtlLargeIntegerAnd( + IN OUT LARGE_INTEGER Result, + IN LARGE_INTEGER Source, + IN LARGE_INTEGER Mask); + +NTOSAPI +LARGE_INTEGER +DDKAPI +RtlLargeIntegerArithmeticShift( + IN LARGE_INTEGER LargeInteger, + IN CCHAR ShiftCount); + +NTOSAPI +LARGE_INTEGER +DDKAPI +RtlLargeIntegerDivide( + IN LARGE_INTEGER Dividend, + IN LARGE_INTEGER Divisor, + IN OUT PLARGE_INTEGER Remainder); + +NTOSAPI +BOOLEAN +DDKAPI +RtlLargeIntegerEqualTo( + IN LARGE_INTEGER Operand1, + IN LARGE_INTEGER Operand2); + +NTOSAPI +BOOLEAN +DDKAPI +RtlLargeIntegerEqualToZero( + IN LARGE_INTEGER Operand); + +NTOSAPI +BOOLEAN +DDKAPI +RtlLargeIntegerGreaterOrEqualToZero( + IN LARGE_INTEGER Operand); + +NTOSAPI +BOOLEAN +DDKAPI +RtlLargeIntegerGreaterThan( + IN LARGE_INTEGER Operand1, + IN LARGE_INTEGER Operand2); + +NTOSAPI +BOOLEAN +DDKAPI +RtlLargeIntegerGreaterThanOrEqualTo( + IN LARGE_INTEGER Operand1, + IN LARGE_INTEGER Operand2); + +NTOSAPI +BOOLEAN +DDKAPI +RtlLargeIntegerGreaterThanZero( + IN LARGE_INTEGER Operand); + +NTOSAPI +BOOLEAN +DDKAPI +RtlLargeIntegerLessOrEqualToZero( + IN LARGE_INTEGER Operand); + +NTOSAPI +BOOLEAN +DDKAPI +RtlLargeIntegerLessThan( + IN LARGE_INTEGER Operand1, + IN LARGE_INTEGER Operand2); + +NTOSAPI +BOOLEAN +DDKAPI +RtlLargeIntegerLessThanOrEqualTo( + IN LARGE_INTEGER Operand1, + IN LARGE_INTEGER Operand2); + +NTOSAPI +BOOLEAN +DDKAPI +RtlLargeIntegerLessThanZero( + IN LARGE_INTEGER Operand); + +NTOSAPI +LARGE_INTEGER +DDKAPI +RtlLargeIntegerNegate( + IN LARGE_INTEGER Subtrahend); + +NTOSAPI +BOOLEAN +DDKAPI +RtlLargeIntegerNotEqualTo( + IN LARGE_INTEGER Operand1, + IN LARGE_INTEGER Operand2); + +NTOSAPI +BOOLEAN +DDKAPI +RtlLargeIntegerNotEqualToZero( + IN LARGE_INTEGER Operand); + +NTOSAPI +LARGE_INTEGER +DDKAPI +RtlLargeIntegerShiftLeft( + IN LARGE_INTEGER LargeInteger, + IN CCHAR ShiftCount); + +NTOSAPI +LARGE_INTEGER +DDKAPI +RtlLargeIntegerShiftRight( + IN LARGE_INTEGER LargeInteger, + IN CCHAR ShiftCount); + +NTOSAPI +LARGE_INTEGER +DDKAPI +RtlLargeIntegerSubtract( + IN LARGE_INTEGER Minuend, + IN LARGE_INTEGER Subtrahend); + + +/* + * ULONG + * COMPUTE_PAGES_SPANNED( + * IN PVOID Va, + * IN ULONG Size) + */ +#define COMPUTE_PAGES_SPANNED(Va, \ + Size) \ + (ADDRESS_AND_SIZE_TO_SPAN_PAGES(Va, Size)) + + +/* +** Architecture specific structures +*/ + +#ifdef _X86_ + +NTOSAPI +INTERLOCKED_RESULT +DDKFASTAPI +Exfi386InterlockedIncrementLong( + IN PLONG Addend); + +NTOSAPI +INTERLOCKED_RESULT +DDKFASTAPI +Exfi386InterlockedDecrementLong( + IN PLONG Addend); + +NTOSAPI +ULONG +DDKFASTAPI +Exfi386InterlockedExchangeUlong( + IN PULONG Target, + IN ULONG Value); + +#define ExInterlockedIncrementLong(Addend,Lock) Exfi386InterlockedIncrementLong(Addend) +#define ExInterlockedDecrementLong(Addend,Lock) Exfi386InterlockedDecrementLong(Addend) +#define ExInterlockedExchangeUlong(Target, Value, Lock) Exfi386InterlockedExchangeUlong(Target, Value) + +#endif /* _X86_ */ + +#ifdef __cplusplus +} +#endif + +#endif /* __WINNT4_H */ diff --git a/reactos/include/ddk/winxp.h b/reactos/include/ddk/winxp.h new file mode 100644 index 00000000000..28e34a89ce4 --- /dev/null +++ b/reactos/include/ddk/winxp.h @@ -0,0 +1,38 @@ +/* + * winxp.h + * + * Definitions only used in Windows XP and earlier versions + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __WINXP_H +#define __WINXP_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __WINXP_H */ diff --git a/reactos/include/ddk/ws2san.h b/reactos/include/ddk/ws2san.h new file mode 100644 index 00000000000..0512cc3e294 --- /dev/null +++ b/reactos/include/ddk/ws2san.h @@ -0,0 +1,246 @@ +/* + * ws2san.h + * + * WinSock Direct (SAN) support + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __WS2SAN_H +#define __WS2SAN_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define WSPAPI STDCALL + +/* FIXME: Unknown definitions */ +typedef PVOID LPWSPDATA; +typedef PDWORD LPWSATHREADID; +typedef PVOID LPWSPPROC_TABLE; +typedef struct _WSPUPCALLTABLEEX WSPUPCALLTABLEEX; +typedef WSPUPCALLTABLEEX *LPWSPUPCALLTABLEEX; + +#define SO_MAX_RDMA_SIZE 0x700D +#define SO_RDMA_THRESHOLD_SIZE 0x700E + +#define WSAID_REGISTERMEMORY \ + {0xC0B422F5, 0xF58C, 0x11d1, {0xAD, 0x6C, 0x00, 0xC0, 0x4F, 0xA3, 0x4A, 0x2D}} + +#define WSAID_DEREGISTERMEMORY \ + {0xC0B422F6, 0xF58C, 0x11d1, {0xAD, 0x6C, 0x00, 0xC0, 0x4F, 0xA3, 0x4A, 0x2D}} + +#define WSAID_REGISTERRDMAMEMORY \ + {0xC0B422F7, 0xF58C, 0x11d1, {0xAD, 0x6C, 0x00, 0xC0, 0x4F, 0xA3, 0x4A, 0x2D}} + +#define WSAID_DEREGISTERRDMAMEMORY \ + {0xC0B422F8, 0xF58C, 0x11d1, {0xAD, 0x6C, 0x00, 0xC0, 0x4F, 0xA3, 0x4A, 0x2D}} + +#define WSAID_RDMAWRITE \ + {0xC0B422F9, 0xF58C, 0x11d1, {0xAD, 0x6C, 0x00, 0xC0, 0x4F, 0xA3, 0x4A, 0x2D}} + +#define WSAID_RDMAREAD \ + {0xC0B422FA, 0xF58C, 0x11d1, {0xAD, 0x6C, 0x00, 0xC0, 0x4F, 0xA3, 0x4A, 0x2D}} + +#define WSAID_MEMORYREGISTRATIONCACHECALLBACK \ + {0xE5DA4AF8, 0xD824, 0x48CD, {0xA7, 0x99, 0x63, 0x37, 0xA9, 0x8E, 0xD2, 0xAF}} + +typedef struct _WSABUFEX { + u_long len; + char FAR *buf; + HANDLE handle; +} WSABUFEX, FAR * LPWSABUFEX; + +#if 0 +typedef struct _WSPUPCALLTABLEEX { + LPWPUCLOSEEVENT lpWPUCloseEvent; + LPWPUCLOSESOCKETHANDLE lpWPUCloseSocketHandle; + LPWPUCREATEEVENT lpWPUCreateEvent; + LPWPUCREATESOCKETHANDLE lpWPUCreateSocketHandle; + LPWPUFDISSET lpWPUFDIsSet; + LPWPUGETPROVIDERPATH lpWPUGetProviderPath; + LPWPUMODIFYIFSHANDLE lpWPUModifyIFSHandle; + LPWPUPOSTMESSAGE lpWPUPostMessage; + LPWPUQUERYBLOCKINGCALLBACK lpWPUQueryBlockingCallback; + LPWPUQUERYSOCKETHANDLECONTEXT lpWPUQuerySocketHandleContext; + LPWPUQUEUEAPC lpWPUQueueApc; + LPWPURESETEVENT lpWPUResetEvent; + LPWPUSETEVENT lpWPUSetEvent; + LPWPUOPENCURRENTTHREAD lpWPUOpenCurrentThread; + LPWPUCLOSETHREAD lpWPUCloseThread; + LPWPUCOMPLETEOVERLAPPEDREQUEST lpWPUCompleteOverlappedRequest; +} WSPUPCALLTABLEEX, FAR * LPWSPUPCALLTABLEEX; +#endif + +int WSPAPI +WSPStartupEx( + IN WORD wVersionRequested, + OUT LPWSPDATA lpWSPData, + IN LPWSAPROTOCOL_INFOW lpProtocolInfo, + IN LPWSPUPCALLTABLEEX lpUpcallTable, + OUT LPWSPPROC_TABLE lpProcTable); + +typedef int WSPAPI +(*LPWSPSTARTUPEX)( + IN WORD wVersionRequested, + OUT LPWSPDATA lpWSPData, + IN LPWSAPROTOCOL_INFOW lpProtocolInfo, + IN LPWSPUPCALLTABLEEX lpUpcallTable, + OUT LPWSPPROC_TABLE lpProcTable); + +#define MEM_READ 1 +#define MEM_WRITE 2 +#define MEM_READWRITE 3 + +int WSPAPI +WSPDeregisterMemory( + IN SOCKET s, + IN HANDLE Handle, + OUT LPINT lpErrno); + +typedef int WSPAPI +(*LPFN_WSPDEREGISTERMEMORY)( + IN SOCKET s, + IN HANDLE Handle, + OUT LPINT lpErrno); + +int WSPAPI +WSPDeregisterRdmaMemory( + IN SOCKET s, + IN LPVOID lpRdmaBufferDescriptor, + IN DWORD dwDescriptorLength, + OUT LPINT lpErrno); + +typedef int WSPAPI +(*LPFN_WSPDEREGISTERRDMAMEMORY)( + IN SOCKET s, + IN LPVOID lpRdmaBufferDescriptor, + IN DWORD dwDescriptorLength, + OUT LPINT lpErrno); + +int WSPAPI +WSPMemoryRegistrationCacheCallback( + IN PVOID lpvAddress, + IN SIZE_T Size, + OUT LPINT lpErrno); + +typedef int WSPAPI +(*LPFN_WSPMEMORYREGISTRATIONCACHECALLBACK)( + IN PVOID lpvAddress, + IN SIZE_T Size, + OUT LPINT lpErrno); + +int WSPAPI +WSPRdmaRead( + IN SOCKET s, + IN LPWSABUFEX lpBuffers, + IN DWORD dwBufferCount, + IN LPVOID lpTargetBufferDescriptor, + IN DWORD dwTargetDescriptorLength, + IN DWORD dwTargetBufferOffset, + OUT LPDWORD lpdwNumberOfBytesRead, + IN DWORD dwFlags, + IN LPWSAOVERLAPPED lpOverlapped, + IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, + IN LPWSATHREADID lpThreadId, + OUT LPINT lpErrno); + +typedef int WSPAPI +(*LPFN_WSPRDMAREAD)( + IN SOCKET s, + IN LPWSABUFEX lpBuffers, + IN DWORD dwBufferCount, + IN LPVOID lpTargetBufferDescriptor, + IN DWORD dwTargetDescriptorLength, + IN DWORD dwTargetBufferOffset, + OUT LPDWORD lpdwNumberOfBytesRead, + IN DWORD dwFlags, + IN LPWSAOVERLAPPED lpOverlapped, + IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, + IN LPWSATHREADID lpThreadId, + OUT LPINT lpErrno); + +int WSPAPI +WSPRdmaWrite( + IN SOCKET s, + IN LPWSABUFEX lpBuffers, + IN DWORD dwBufferCount, + IN LPVOID lpTargetBufferDescriptor, + IN DWORD dwTargetDescriptorLength, + IN DWORD dwTargetBufferOffset, + OUT LPDWORD lpdwNumberOfBytesWritten, + IN DWORD dwFlags, + IN LPWSAOVERLAPPED lpOverlapped, + IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, + IN LPWSATHREADID lpThreadId, + OUT LPINT lpErrno); + +typedef int WSPAPI +(*LPFN_WSPRDMAWRITE)( + IN SOCKET s, + IN LPWSABUFEX lpBuffers, + IN DWORD dwBufferCount, + IN LPVOID lpTargetBufferDescriptor, + IN DWORD dwTargetDescriptorLength, + IN DWORD dwTargetBufferOffset, + OUT LPDWORD lpdwNumberOfBytesWritten, + IN DWORD dwFlags, + IN LPWSAOVERLAPPED lpOverlapped, + IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, + IN LPWSATHREADID lpThreadId, + OUT LPINT lpErrno); + +HANDLE WSPAPI +WSPRegisterMemory( + IN SOCKET s, + IN PVOID lpBuffer, + IN DWORD dwBufferLength, + IN DWORD dwFlags, + OUT LPINT lpErrno); + +int WSPAPI +WSPRegisterRdmaMemory( + IN SOCKET s, + IN PVOID lpBuffer, + IN DWORD dwBufferLength, + IN DWORD dwFlags, + OUT LPVOID lpRdmaBufferDescriptor, + IN OUT LPDWORD lpdwDescriptorLength, + OUT LPINT lpErrno); + +typedef int WSPAPI +(*LPFN_WSPREGISTERRDMAMEMORY)( + IN SOCKET s, + IN PVOID lpBuffer, + IN DWORD dwBufferLength, + IN DWORD dwFlags, + OUT LPVOID lpRdmaBufferDescriptor, + IN OUT LPDWORD lpdwDescriptorLength, + OUT LPINT lpErrno); + +#ifdef __cplusplus +} +#endif + +#endif /* __WS2SAN_H */ diff --git a/reactos/include/ddk/xfilter.h b/reactos/include/ddk/xfilter.h new file mode 100644 index 00000000000..2f322f0d05f --- /dev/null +++ b/reactos/include/ddk/xfilter.h @@ -0,0 +1,236 @@ +/* + * xfilter.h + * + * Address filtering for NDIS MACs + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Casper S. Hornstrup + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef _X_FILTER_DEFS_ +#define _X_FILTER_DEFS_ + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define ETH_LENGTH_OF_ADDRESS 6 + +#define ETH_IS_BROADCAST(Address) \ + ((((PUCHAR)(Address))[0] == ((UCHAR)0xff)) && (((PUCHAR)(Address))[1] == ((UCHAR)0xff))) + +#define ETH_IS_MULTICAST(Address) \ + (BOOLEAN)(((PUCHAR)(Address))[0] & ((UCHAR)0x01)) + +#define ETH_COMPARE_NETWORK_ADDRESSES(_A, _B, _Result) \ +{ \ + if (*(ULONG UNALIGNED *)&(_A)[2] > *(ULONG UNALIGNED *)&(_B)[2]) \ + { \ + *(_Result) = 1; \ + } \ + else if (*(ULONG UNALIGNED *)&(_A)[2] < *(ULONG UNALIGNED *)&(_B)[2]) \ + { \ + *(_Result) = (UINT)-1; \ + } \ + else if (*(USHORT UNALIGNED *)(_A) > *(USHORT UNALIGNED *)(_B)) \ + { \ + *(_Result) = 1; \ + } \ + else if (*(USHORT UNALIGNED *)(_A) < *(USHORT UNALIGNED *)(_B)) \ + { \ + *(_Result) = (UINT)-1; \ + } \ + else \ + { \ + *(_Result) = 0; \ + } \ +} + +#define ETH_COMPARE_NETWORK_ADDRESSES_EQ(_A,_B, _Result) \ +{ \ + if ((*(ULONG UNALIGNED *)&(_A)[2] == *(ULONG UNALIGNED *)&(_B)[2]) && \ + (*(USHORT UNALIGNED *)(_A) == *(USHORT UNALIGNED *)(_B))) \ + { \ + *(_Result) = 0; \ + } \ + else \ + { \ + *(_Result) = 1; \ + } \ +} + +#define ETH_COPY_NETWORK_ADDRESS(_D, _S) \ +{ \ + *((ULONG UNALIGNED *)(_D)) = *((ULONG UNALIGNED *)(_S)); \ + *((USHORT UNALIGNED *)((UCHAR *)(_D) + 4)) = *((USHORT UNALIGNED *)((UCHAR *)(_S) + 4)); \ +} + +#define FDDI_LENGTH_OF_LONG_ADDRESS 6 +#define FDDI_LENGTH_OF_SHORT_ADDRESS 2 + +#define FDDI_IS_BROADCAST(Address, AddressLength, Result) \ + *Result = ((*(PUCHAR)(Address) == (UCHAR)0xFF) && \ + (*((PUCHAR)(Address) + 1) == (UCHAR)0xFF)) + +#define FDDI_IS_MULTICAST(Address, AddressLength, Result) \ + *Result = (BOOLEAN)(*(UCHAR *)(Address) & (UCHAR)0x01) + +#define FDDI_IS_SMT(FcByte, Result) \ +{ \ + *Result = ((FcByte & ((UCHAR)0xf0)) == 0x40); \ +} + + +#define FDDI_COMPARE_NETWORK_ADDRESSES(_A, _B, _Length, _Result) \ +{ \ + if (*(USHORT UNALIGNED *)(_A) > *(USHORT UNALIGNED *)(_B)) \ + { \ + *(_Result) = 1; \ + } \ + else if (*(USHORT UNALIGNED *)(_A) < *(USHORT UNALIGNED *)(_B)) \ + { \ + *(_Result) = (UINT)-1; \ + } \ + else if (_Length == 2) \ + { \ + *(_Result) = 0; \ + } \ + else if (*(ULONG UNALIGNED *)((PUCHAR)(_A) + 2) > *(ULONG UNALIGNED *)((PUCHAR)(_B) + 2)) \ + { \ + *(_Result) = 1; \ + } \ + else if (*(ULONG UNALIGNED *)((PUCHAR)(_A) + 2) < *(ULONG UNALIGNED *)((PUCHAR)(_B) + 2)) \ + { \ + *(_Result) = (UINT)-1; \ + } \ + else \ + { \ + *(_Result) = 0; \ + } \ +} + +#define FDDI_COMPARE_NETWORK_ADDRESSES_EQ(_A, _B, _Length, _Result) \ +{ \ + if ((*(USHORT UNALIGNED *)(_A) == *(USHORT UNALIGNED *)(_B)) && \ + (((_Length) == 2) || \ + (*(ULONG UNALIGNED *)((PUCHAR)(_A) + 2) == *(ULONG UNALIGNED *)((PUCHAR)(_B) + 2)))) \ + { \ + *(_Result) = 0; \ + } \ + else \ + { \ + *(_Result) = 1; \ + } \ +} + +#define FDDI_COPY_NETWORK_ADDRESS(D, S, AddressLength) \ +{ \ + PCHAR _D = (D); \ + PCHAR _S = (S); \ + UINT _C = (AddressLength); \ + for ( ; _C > 0 ; _D++, _S++, _C--) \ + { \ + *_D = *_S; \ + } \ +} + +#define TR_LENGTH_OF_FUNCTIONAL 4 +#define TR_LENGTH_OF_ADDRESS 6 + +typedef ULONG TR_FUNCTIONAL_ADDRESS; +typedef ULONG TR_GROUP_ADDRESS; + +#define TR_IS_NOT_DIRECTED(_Address, _Result) \ +{ \ + *(_Result) = (BOOLEAN)((_Address)[0] & 0x80); \ +} + +#define TR_IS_FUNCTIONAL(_Address, _Result) \ +{ \ + *(_Result) = (BOOLEAN)(((_Address)[0] & 0x80) && !((_Address)[2] & 0x80)); \ +} + +#define TR_IS_GROUP(_Address, _Result) \ +{ \ + *(_Result) = (BOOLEAN)((_Address)[0] & (_Address)[2] & 0x80); \ +} + +#define TR_IS_SOURCE_ROUTING(_Address, _Result) \ +{ \ + *(_Result) = (BOOLEAN)((_Address)[0] & 0x80); \ +} + +#define TR_IS_MAC_FRAME(_PacketHeader) ((((PUCHAR)_PacketHeader)[1] & 0xFC) == 0) + +#define TR_IS_BROADCAST(_Address, _Result) \ +{ \ + *(_Result) = (BOOLEAN)(((*(UNALIGNED USHORT *)&(_Address)[0] == 0xFFFF) || \ + (*(UNALIGNED USHORT *)&(_Address)[0] == 0x00C0)) && \ + (*(UNALIGNED ULONG *)&(_Address)[2] == 0xFFFFFFFF)); \ +} + +#define TR_COMPARE_NETWORK_ADDRESSES(_A, _B, _Result) \ +{ \ + if (*(ULONG UNALIGNED *)&(_A)[2] > *(ULONG UNALIGNED *)&(_B)[2]) \ + { \ + *(_Result) = 1; \ + } \ + else if (*(ULONG UNALIGNED *)&(_A)[2] < *(ULONG UNALIGNED *)&(_B)[2]) \ + { \ + *(_Result) = (UINT)-1; \ + } \ + else if (*(USHORT UNALIGNED *)(_A) > *(USHORT UNALIGNED *)(_B)) \ + { \ + *(_Result) = 1; \ + } \ + else if (*(USHORT UNALIGNED *)(_A) < *(USHORT UNALIGNED *)(_B)) \ + { \ + *(_Result) = (UINT)-1; \ + } \ + else \ + { \ + *(_Result) = 0; \ + } \ +} + +#define TR_COPY_NETWORK_ADDRESS(_D, _S) \ +{ \ + *((ULONG UNALIGNED *)(_D)) = *((ULONG UNALIGNED *)(_S)); \ + *((USHORT UNALIGNED *)((UCHAR *)(_D)+4)) = *((USHORT UNALIGNED *)((UCHAR *)(_S) + 4)); \ +} + +#define TR_COMPARE_NETWORK_ADDRESSES_EQ(_A, _B, _Result) \ +{ \ + if ((*(ULONG UNALIGNED *)&(_A)[2] == *(ULONG UNALIGNED *)&(_B)[2]) && \ + (*(USHORT UNALIGNED *)&(_A)[0] == *(USHORT UNALIGNED *)&(_B)[0])) \ + { \ + *(_Result) = 0; \ + } \ + else \ + { \ + *(_Result) = 1; \ + } \ +} + +#ifdef __cplusplus +} +#endif + +#endif /* _X_FILTER_DEFS_ */