Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

mapmem.h

Go to the documentation of this file.
00001 /*++
00002 
00003 Copyright (c) 1993  Microsoft Corporation
00004 
00005 Module Name:
00006 
00007     mapmem.h
00008 
00009 Abstract:
00010 
00011 
00012 Environment:
00013 
00014     kernel & User mode
00015 
00016 Notes:
00017 
00018 
00019 Revision History:
00020         May 31, 1996 Will Shackleford added #include <windows.h> and <winioctl.h> the InterfaceType into
00021            this header file, and changed BusAddress from a PHYSICAL_ADDRESS to a
00022            LARGE_INTEGER to make this a proper self-sufficient header file. (Also
00023            added #ifndef MAPMEM_H to avoid multiple inclusion errors.)
00024 
00025 --*/
00026 
00027 #ifndef MAPMEM_H
00028 #define MAPMEM_H
00029 
00030 
00031 #if defined(WIN32) && !defined(USE_OLD_WINSOCK)
00032 /* Lame problem if windows.h is included before winsock2.h many redefined
00033  compiler errors result. */
00034 #include <winsock2.h>
00035 #endif
00036 
00037 #include <windows.h>            // LARGE_INTEGER, ULONG,
00038 #include <windef.h>
00039 #include <winioctl.h>           // CTL_CODE, METHOD_BUFFERED, FILE_ANY_ACCESS
00040 
00041 //
00042 // Define the various device type values.  Note that values used by Microsoft
00043 // Corporation are in the range 0-32767, and 32768-65535 are reserved for use
00044 // by customers.
00045 //
00046 
00047 #define FILE_DEVICE_MAPMEM  0x00008000
00048 
00049 
00050 
00051 //
00052 // Macro definition for defining IOCTL and FSCTL function control codes.  Note
00053 // that function codes 0-2047 are reserved for Microsoft Corporation, and
00054 // 2048-4095 are reserved for customers.
00055 //
00056 
00057 #define MAPMEM_IOCTL_INDEX  0x800
00058 
00059 
00060 //
00061 // Define our own private IOCTL
00062 //
00063 
00064 #define IOCTL_MAPMEM_MAP_USER_PHYSICAL_MEMORY   CTL_CODE(FILE_DEVICE_MAPMEM , \
00065                                                          MAPMEM_IOCTL_INDEX,  \
00066                                                          METHOD_BUFFERED,     \
00067                                                          FILE_ANY_ACCESS)
00068 
00069 #define IOCTL_MAPMEM_UNMAP_USER_PHYSICAL_MEMORY CTL_CODE(FILE_DEVICE_MAPMEM,  \
00070                                                          MAPMEM_IOCTL_INDEX+1,\
00071                                                          METHOD_BUFFERED,     \
00072                                                          FILE_ANY_ACCESS)
00073 
00074 
00075 
00076 
00077 //
00078 // Our user mode app will pass an initialized structure like this
00079 //     down to the kernel mode driver
00080 //
00081 typedef enum _INTERFACE_TYPE
00082 {
00083   Internal,
00084   Isa,
00085   Eisa,
00086   MicroChannel,
00087   TurboChannel,
00088   MaximumInterfaceType
00089 }
00090 INTERFACE_TYPE, *PINTERFACE_TYPE;
00091 
00092 
00093 typedef struct
00094 {
00095   INTERFACE_TYPE InterfaceType; // Isa, Eisa, etc....
00096   ULONG BusNumber;              // Bus number
00097   LARGE_INTEGER BusAddress;     // Bus-relative address
00098   ULONG AddressSpace;           // 0 is memory, 1 is I/O
00099   ULONG Length;                 // Length of section to map
00100 
00101 }
00102 PHYSICAL_MEMORY_INFO, *PPHYSICAL_MEMORY_INFO;
00103 
00104 
00105 #endif

Generated on Sun Dec 2 15:56:50 2001 for rcslib by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001