| /**************************************************************************** | |
| **************************************************************************** | |
| *** | |
| *** This header was generated from a Windows DDK header to make | |
| *** information necessary for userspace to call into the Windows | |
| *** kernel available to Dr. Memory. It contains only constants, | |
| *** structures, and macros generated from the original header, and | |
| *** thus, contains no copyrightable information. | |
| *** | |
| **************************************************************************** | |
| ****************************************************************************/ | |
| #ifndef _NTIFS_ | |
| #define _NTIFS_ | |
| /*************************************************************************** | |
| * from DDK/WDK ntifs.h | |
| */ | |
| // | |
| // Object Information Classes | |
| // | |
| typedef enum _OBJECT_INFORMATION_CLASS { | |
| ObjectBasicInformation = 0, | |
| ObjectTypeInformation = 2 | |
| } OBJECT_INFORMATION_CLASS; | |
| // | |
| // File Information | |
| // | |
| typedef struct _FILE_LINK_INFORMATION { | |
| BOOLEAN ReplaceIfExists; | |
| HANDLE RootDirectory; | |
| ULONG FileNameLength; | |
| WCHAR FileName[1]; | |
| } FILE_LINK_INFORMATION, *PFILE_LINK_INFORMATION; | |
| typedef struct _FILE_RENAME_INFORMATION { | |
| BOOLEAN ReplaceIfExists; | |
| HANDLE RootDirectory; | |
| ULONG FileNameLength; | |
| WCHAR FileName[1]; | |
| } FILE_RENAME_INFORMATION, *PFILE_RENAME_INFORMATION; | |
| // | |
| // Define the various device type values. Note that values used by Microsoft | |
| // Corporation are in the range 0-32767, and 32768-65535 are reserved for use | |
| // by customers. | |
| // | |
| #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 | |
| #define FILE_DEVICE_INFINIBAND 0x0000003B | |
| #define FILE_DEVICE_VMBUS 0x0000003E | |
| #define FILE_DEVICE_CRYPT_PROVIDER 0x0000003F | |
| #define FILE_DEVICE_WPD 0x00000040 | |
| #define FILE_DEVICE_BLUETOOTH 0x00000041 | |
| #define FILE_DEVICE_MT_COMPOSITE 0x00000042 | |
| #define FILE_DEVICE_MT_TRANSPORT 0x00000043 | |
| #define FILE_DEVICE_BIOMETRIC 0x00000044 | |
| #define FILE_DEVICE_PMI 0x00000045 | |
| // | |
| // Macro definition for defining IOCTL and FSCTL function control codes. Note | |
| // that function codes 0-2047 are reserved for Microsoft Corporation, and | |
| // 2048-4095 are reserved for customers. | |
| // | |
| #ifndef CTL_CODE | |
| #define CTL_CODE( DeviceType, Function, Method, Access ) ( \ | |
| ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \ | |
| ) | |
| #endif | |
| // | |
| // Macro to extract device type out of the device io control code | |
| // | |
| #ifndef DEVICE_TYPE_FROM_CTL_CODE | |
| #define DEVICE_TYPE_FROM_CTL_CODE(ctrlCode) (((ULONG)(ctrlCode & 0xffff0000)) >> 16) | |
| #endif | |
| // | |
| // Macro to extract buffering method out of the device io control code | |
| // | |
| #ifndef METHOD_FROM_CTL_CODE | |
| #define METHOD_FROM_CTL_CODE(ctrlCode) ((ULONG)(ctrlCode & 3)) | |
| #endif | |
| // | |
| // Named Pipe file control code and structure declarations | |
| // | |
| // | |
| // External named pipe file control operations | |
| // | |
| #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_GET_PIPE_ATTRIBUTE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 10, METHOD_BUFFERED, FILE_ANY_ACCESS) | |
| #define FSCTL_PIPE_SET_PIPE_ATTRIBUTE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 11, METHOD_BUFFERED, FILE_ANY_ACCESS) | |
| #define FSCTL_PIPE_GET_CONNECTION_ATTRIBUTE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 12, METHOD_BUFFERED, FILE_ANY_ACCESS) | |
| #define FSCTL_PIPE_SET_CONNECTION_ATTRIBUTE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 13, METHOD_BUFFERED, FILE_ANY_ACCESS) | |
| #define FSCTL_PIPE_GET_HANDLE_ATTRIBUTE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 14, METHOD_BUFFERED, FILE_ANY_ACCESS) | |
| #define FSCTL_PIPE_SET_HANDLE_ATTRIBUTE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 15, METHOD_BUFFERED, FILE_ANY_ACCESS) | |
| #define FSCTL_PIPE_FLUSH CTL_CODE(FILE_DEVICE_NAMED_PIPE, 16, METHOD_BUFFERED, FILE_WRITE_DATA) | |
| // | |
| // Internal named pipe file control operations | |
| // | |
| #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 entry types for query event information | |
| // | |
| #define FILE_PIPE_READ_DATA 0x00000000 | |
| #define FILE_PIPE_WRITE_SPACE 0x00000001 | |
| // | |
| // Named pipe file system control structure declarations | |
| // | |
| // Control structure for FSCTL_PIPE_ASSIGN_EVENT | |
| typedef struct _FILE_PIPE_ASSIGN_EVENT_BUFFER { | |
| HANDLE EventHandle; | |
| ULONG KeyValue; | |
| } FILE_PIPE_ASSIGN_EVENT_BUFFER, *PFILE_PIPE_ASSIGN_EVENT_BUFFER; | |
| // Control structure for FSCTL_PIPE_PEEK | |
| 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; | |
| // Control structure for FSCTL_PIPE_QUERY_EVENT | |
| typedef struct _FILE_PIPE_EVENT_BUFFER { | |
| ULONG NamedPipeState; | |
| ULONG EntryType; | |
| ULONG ByteCount; | |
| ULONG KeyValue; | |
| ULONG NumberRequests; | |
| } FILE_PIPE_EVENT_BUFFER, *PFILE_PIPE_EVENT_BUFFER; | |
| // Control structure for FSCTL_PIPE_WAIT | |
| 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; | |
| // Control structure for FSCTL_PIPE_SET_CLIENT_PROCESS and FSCTL_PIPE_QUERY_CLIENT_PROCESS | |
| typedef struct _FILE_PIPE_CLIENT_PROCESS_BUFFER { | |
| #if !defined(BUILD_WOW6432) | |
| PVOID ClientSession; | |
| PVOID ClientProcess; | |
| #else | |
| ULONGLONG ClientSession; | |
| ULONGLONG ClientProcess; | |
| #endif | |
| } FILE_PIPE_CLIENT_PROCESS_BUFFER, *PFILE_PIPE_CLIENT_PROCESS_BUFFER; | |
| // This is an extension to the client process info buffer containing the client | |
| // computer name | |
| #define FILE_PIPE_COMPUTER_NAME_LENGTH 15 | |
| typedef struct _FILE_PIPE_CLIENT_PROCESS_BUFFER_EX { | |
| #if !defined(BUILD_WOW6432) | |
| PVOID ClientSession; | |
| PVOID ClientProcess; | |
| #else | |
| ULONGLONG ClientSession; | |
| ULONGLONG ClientProcess; | |
| #endif | |
| USHORT ClientComputerNameLength; // in bytes | |
| WCHAR ClientComputerBuffer[FILE_PIPE_COMPUTER_NAME_LENGTH+1]; // terminated | |
| } FILE_PIPE_CLIENT_PROCESS_BUFFER_EX, *PFILE_PIPE_CLIENT_PROCESS_BUFFER_EX; | |
| #endif /* _NTIFS_ */ |