removed Nttd*
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1523
This commit is contained in:
parent
68c7731c91
commit
3724a83a39
6 changed files with 12 additions and 1610 deletions
|
@ -1,7 +1,7 @@
|
|||
AM_CPPFLAGS = -I$(top_srcdir)/include
|
||||
|
||||
noinst_LIBRARIES = libdos.a
|
||||
EXTRA_DIST = Ntddcdrm.h Ntddscsi.h Ntddstor.h scsidefs.h wnaspi32.h
|
||||
EXTRA_DIST = scsidefs.h wnaspi32.h
|
||||
libdos_a_SOURCES = dos.cpp dos_devices.cpp dos_execute.cpp dos_files.cpp dos_ioctl.cpp dos_memory.cpp \
|
||||
dos_misc.cpp dos_classes.cpp dos_programs.cpp dos_tables.cpp \
|
||||
drives.cpp drives.h drive_virtual.cpp drive_local.cpp drive_cache.cpp \
|
||||
|
|
|
@ -1,548 +0,0 @@
|
|||
/*++ BUILD Version: 0001 // Increment this if a change has global effects
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
Module Name:
|
||||
|
||||
ntddcdrm.h
|
||||
|
||||
Abstract:
|
||||
|
||||
This module contains structures and definitions
|
||||
associated with CDROM IOCTls.
|
||||
|
||||
Author:
|
||||
|
||||
Mike Glass
|
||||
|
||||
Revision History:
|
||||
|
||||
--*/
|
||||
|
||||
// begin_winioctl
|
||||
|
||||
#ifndef _NTDDCDRM_
|
||||
#define _NTDDCDRM_
|
||||
|
||||
#if _MSC_VER >= 1200
|
||||
#pragma warning(push)
|
||||
#endif
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// remove some level 4 warnings for this header file:
|
||||
#pragma warning(disable:4200) // array[0]
|
||||
#pragma warning(disable:4201) // nameless struct/unions
|
||||
#pragma warning(disable:4214) // bit fields other than int
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//
|
||||
// NtDeviceIoControlFile IoControlCode values for this device.
|
||||
//
|
||||
// Warning: Remember that the low two bits of the code specify how the
|
||||
// buffers are passed to the driver!
|
||||
//
|
||||
|
||||
#define IOCTL_CDROM_BASE FILE_DEVICE_CD_ROM
|
||||
|
||||
#define IOCTL_CDROM_UNLOAD_DRIVER CTL_CODE(IOCTL_CDROM_BASE, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||
|
||||
//
|
||||
// CDROM Audio Device Control Functions
|
||||
//
|
||||
|
||||
#define IOCTL_CDROM_READ_TOC CTL_CODE(IOCTL_CDROM_BASE, 0x0000, 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_STOP_AUDIO CTL_CODE(IOCTL_CDROM_BASE, 0x0002, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||
#define IOCTL_CDROM_PAUSE_AUDIO CTL_CODE(IOCTL_CDROM_BASE, 0x0003, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||
#define IOCTL_CDROM_RESUME_AUDIO CTL_CODE(IOCTL_CDROM_BASE, 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||
#define IOCTL_CDROM_GET_VOLUME CTL_CODE(IOCTL_CDROM_BASE, 0x0005, 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_SET_VOLUME CTL_CODE(IOCTL_CDROM_BASE, 0x000A, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||
#define IOCTL_CDROM_READ_Q_CHANNEL CTL_CODE(IOCTL_CDROM_BASE, 0x000B, 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_LAST_SESSION CTL_CODE(IOCTL_CDROM_BASE, 0x000E, 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_DISK_TYPE CTL_CODE(IOCTL_CDROM_BASE, 0x0010, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
|
||||
#define IOCTL_CDROM_GET_DRIVE_GEOMETRY CTL_CODE(IOCTL_CDROM_BASE, 0x0013, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||
#define IOCTL_CDROM_GET_DRIVE_GEOMETRY_EX CTL_CODE(IOCTL_CDROM_BASE, 0x0014, 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_GET_CONFIGURATION CTL_CODE(IOCTL_CDROM_BASE, 0x0016, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||
|
||||
// end_winioctl
|
||||
|
||||
//
|
||||
// The following device control codes are common for all class drivers. The
|
||||
// functions codes defined here must match all of the other class drivers.
|
||||
//
|
||||
// Warning: these codes will be replaced in the future with the IOCTL_STORAGE
|
||||
// codes included below
|
||||
//
|
||||
|
||||
#define IOCTL_CDROM_CHECK_VERIFY CTL_CODE(IOCTL_CDROM_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||
#define IOCTL_CDROM_MEDIA_REMOVAL CTL_CODE(IOCTL_CDROM_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||
#define IOCTL_CDROM_EJECT_MEDIA CTL_CODE(IOCTL_CDROM_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||
#define IOCTL_CDROM_LOAD_MEDIA CTL_CODE(IOCTL_CDROM_BASE, 0x0203, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||
#define IOCTL_CDROM_RESERVE CTL_CODE(IOCTL_CDROM_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||
#define IOCTL_CDROM_RELEASE CTL_CODE(IOCTL_CDROM_BASE, 0x0205, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||
#define IOCTL_CDROM_FIND_NEW_DEVICES CTL_CODE(IOCTL_CDROM_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||
|
||||
//
|
||||
// The following file contains the IOCTL_STORAGE class ioctl definitions
|
||||
//
|
||||
|
||||
#include "ntddstor.h"
|
||||
|
||||
// begin_winioctl
|
||||
|
||||
//
|
||||
// The following device control code is for the SIMBAD simulated bad
|
||||
// sector facility. See SIMBAD.H in this directory for related structures.
|
||||
//
|
||||
|
||||
#define IOCTL_CDROM_SIMBAD CTL_CODE(IOCTL_CDROM_BASE, 0x1003, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||
|
||||
//
|
||||
// Maximum CD Rom size
|
||||
//
|
||||
|
||||
#define MAXIMUM_NUMBER_TRACKS 100
|
||||
#define MAXIMUM_CDROM_SIZE 804
|
||||
#define MINIMUM_CDROM_READ_TOC_EX_SIZE 2 // two bytes min transferred
|
||||
|
||||
//
|
||||
// READ_TOC_EX structure
|
||||
//
|
||||
typedef struct _CDROM_READ_TOC_EX {
|
||||
UCHAR Format : 4;
|
||||
UCHAR Reserved1 : 3; // future expansion
|
||||
UCHAR Msf : 1;
|
||||
UCHAR SessionTrack;
|
||||
UCHAR Reserved2; // future expansion
|
||||
UCHAR Reserved3; // future expansion
|
||||
} CDROM_READ_TOC_EX, *PCDROM_READ_TOC_EX;
|
||||
|
||||
#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
|
||||
|
||||
//
|
||||
// CD ROM Table OF Contents (TOC)
|
||||
// Format 0 - Get table of contents
|
||||
//
|
||||
|
||||
typedef struct _TRACK_DATA {
|
||||
UCHAR Reserved;
|
||||
UCHAR Control : 4;
|
||||
UCHAR Adr : 4;
|
||||
UCHAR TrackNumber;
|
||||
UCHAR Reserved1;
|
||||
UCHAR Address[4];
|
||||
} TRACK_DATA, *PTRACK_DATA;
|
||||
|
||||
typedef struct _CDROM_TOC {
|
||||
|
||||
//
|
||||
// Header
|
||||
//
|
||||
|
||||
UCHAR Length[2]; // add two bytes for this field
|
||||
UCHAR FirstTrack;
|
||||
UCHAR LastTrack;
|
||||
|
||||
//
|
||||
// Track data
|
||||
//
|
||||
|
||||
TRACK_DATA TrackData[MAXIMUM_NUMBER_TRACKS];
|
||||
} CDROM_TOC, *PCDROM_TOC;
|
||||
|
||||
#define CDROM_TOC_SIZE sizeof(CDROM_TOC)
|
||||
|
||||
//
|
||||
// CD ROM Table OF Contents
|
||||
// Format 1 - Session Information
|
||||
//
|
||||
|
||||
typedef struct _CDROM_TOC_SESSION_DATA {
|
||||
|
||||
//
|
||||
// Header
|
||||
//
|
||||
|
||||
UCHAR Length[2]; // add two bytes for this field
|
||||
UCHAR FirstCompleteSession;
|
||||
UCHAR LastCompleteSession;
|
||||
|
||||
//
|
||||
// One track, representing the first track
|
||||
// of the last finished session
|
||||
//
|
||||
|
||||
TRACK_DATA TrackData[1];
|
||||
|
||||
} CDROM_TOC_SESSION_DATA, *PCDROM_TOC_SESSION_DATA;
|
||||
|
||||
|
||||
//
|
||||
// CD ROM Table OF Contents
|
||||
// Format 2 - Full TOC
|
||||
//
|
||||
|
||||
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 {
|
||||
|
||||
//
|
||||
// Header
|
||||
//
|
||||
|
||||
UCHAR Length[2]; // add two bytes for this field
|
||||
UCHAR FirstCompleteSession;
|
||||
UCHAR LastCompleteSession;
|
||||
|
||||
//
|
||||
// one to N descriptors included
|
||||
//
|
||||
|
||||
CDROM_TOC_FULL_TOC_DATA_BLOCK Descriptors[0];
|
||||
|
||||
} CDROM_TOC_FULL_TOC_DATA, *PCDROM_TOC_FULL_TOC_DATA;
|
||||
|
||||
//
|
||||
// CD ROM Table OF Contents
|
||||
// Format 3 - Program Memory Area
|
||||
//
|
||||
typedef struct _CDROM_TOC_PMA_DATA {
|
||||
|
||||
//
|
||||
// Header
|
||||
//
|
||||
|
||||
UCHAR Length[2]; // add two bytes for this field
|
||||
UCHAR Reserved1;
|
||||
UCHAR Reserved2;
|
||||
|
||||
//
|
||||
// one to N descriptors included
|
||||
//
|
||||
|
||||
CDROM_TOC_FULL_TOC_DATA_BLOCK Descriptors[0];
|
||||
|
||||
} CDROM_TOC_PMA_DATA, *PCDROM_TOC_PMA_DATA;
|
||||
|
||||
//
|
||||
// CD ROM Table OF Contents
|
||||
// Format 4 - Absolute Time In Pregroove
|
||||
//
|
||||
|
||||
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 DiscSubType : 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 {
|
||||
|
||||
//
|
||||
// Header
|
||||
//
|
||||
|
||||
UCHAR Length[2]; // add two bytes for this field
|
||||
UCHAR Reserved1;
|
||||
UCHAR Reserved2;
|
||||
|
||||
//
|
||||
// zero? to N descriptors included.
|
||||
//
|
||||
|
||||
CDROM_TOC_ATIP_DATA_BLOCK Descriptors[0];
|
||||
|
||||
} CDROM_TOC_ATIP_DATA, *PCDROM_TOC_ATIP_DATA;
|
||||
|
||||
//
|
||||
// CD ROM Table OF Contents
|
||||
// Format 5 - CD Text Info
|
||||
//
|
||||
typedef struct _CDROM_TOC_CD_TEXT_DATA_BLOCK {
|
||||
UCHAR PackType;
|
||||
UCHAR TrackNumber : 7;
|
||||
UCHAR ExtensionFlag : 1; // should be zero!
|
||||
UCHAR SequenceNumber;
|
||||
UCHAR CharacterPosition : 4;
|
||||
UCHAR BlockNumber : 3;
|
||||
UCHAR Unicode : 1;
|
||||
union {
|
||||
UCHAR Text[12];
|
||||
WCHAR WText[6];
|
||||
};
|
||||
UCHAR CRC[2];
|
||||
} CDROM_TOC_CD_TEXT_DATA_BLOCK, *PCDROM_TOC_CD_TEXT_DATA_BLOCK;
|
||||
|
||||
typedef struct _CDROM_TOC_CD_TEXT_DATA {
|
||||
|
||||
//
|
||||
// Header
|
||||
//
|
||||
|
||||
UCHAR Length[2]; // add two bytes for this field
|
||||
UCHAR Reserved1;
|
||||
UCHAR Reserved2;
|
||||
|
||||
//
|
||||
// the text info comes in discrete blocks of
|
||||
// a heavily-overloaded structure
|
||||
//
|
||||
|
||||
CDROM_TOC_CD_TEXT_DATA_BLOCK Descriptors[0];
|
||||
|
||||
} CDROM_TOC_CD_TEXT_DATA, *PCDROM_TOC_CD_TEXT_DATA;
|
||||
|
||||
//
|
||||
// These are the types used for PackType field in CDROM_TOC_CD_TEXT_DATA_BLOCK
|
||||
// and also for requesting specific info from IOCTL_CDROM_READ_CD_TEXT
|
||||
//
|
||||
#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
|
||||
// 0x8a - 0x8d are reserved....
|
||||
#define CDROM_CD_TEXT_PACK_UPC_EAN 0x8e
|
||||
#define CDROM_CD_TEXT_PACK_SIZE_INFO 0x8f
|
||||
|
||||
//
|
||||
// Play audio starting at MSF and ending at MSF
|
||||
//
|
||||
|
||||
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;
|
||||
|
||||
//
|
||||
// Seek to MSF
|
||||
//
|
||||
|
||||
typedef struct _CDROM_SEEK_AUDIO_MSF {
|
||||
UCHAR M;
|
||||
UCHAR S;
|
||||
UCHAR F;
|
||||
} CDROM_SEEK_AUDIO_MSF, *PCDROM_SEEK_AUDIO_MSF;
|
||||
|
||||
|
||||
//
|
||||
// Flags for the disk type
|
||||
//
|
||||
|
||||
typedef struct _CDROM_DISK_DATA {
|
||||
|
||||
ULONG DiskData;
|
||||
|
||||
} CDROM_DISK_DATA, *PCDROM_DISK_DATA;
|
||||
|
||||
#define CDROM_DISK_AUDIO_TRACK (0x00000001)
|
||||
#define CDROM_DISK_DATA_TRACK (0x00000002)
|
||||
|
||||
//
|
||||
// CD ROM Data Mode Codes, used with IOCTL_CDROM_READ_Q_CHANNEL
|
||||
//
|
||||
|
||||
#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;
|
||||
|
||||
|
||||
//
|
||||
// CD ROM Sub-Q Channel Data Format
|
||||
//
|
||||
|
||||
typedef struct _SUB_Q_HEADER {
|
||||
UCHAR Reserved;
|
||||
UCHAR AudioStatus;
|
||||
UCHAR DataLength[2];
|
||||
} SUB_Q_HEADER, *PSUB_Q_HEADER;
|
||||
|
||||
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 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 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;
|
||||
|
||||
//
|
||||
// Audio Status Codes
|
||||
//
|
||||
|
||||
#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
|
||||
|
||||
//
|
||||
// ADR Sub-channel Q Field
|
||||
//
|
||||
|
||||
#define ADR_NO_MODE_INFORMATION 0x0
|
||||
#define ADR_ENCODES_CURRENT_POSITION 0x1
|
||||
#define ADR_ENCODES_MEDIA_CATALOG 0x2
|
||||
#define ADR_ENCODES_ISRC 0x3
|
||||
|
||||
//
|
||||
// Sub-channel Q Control Bits
|
||||
//
|
||||
|
||||
#define AUDIO_WITH_PREEMPHASIS 0x1
|
||||
#define DIGITAL_COPY_PERMITTED 0x2
|
||||
#define AUDIO_DATA_TRACK 0x4
|
||||
#define TWO_FOUR_CHANNEL_AUDIO 0x8
|
||||
|
||||
//
|
||||
// Get Audio control parameters
|
||||
//
|
||||
|
||||
typedef struct _CDROM_AUDIO_CONTROL {
|
||||
UCHAR LbaFormat;
|
||||
USHORT LogicalBlocksPerSecond;
|
||||
} CDROM_AUDIO_CONTROL, *PCDROM_AUDIO_CONTROL;
|
||||
|
||||
//
|
||||
// Volume control - Volume takes a value between 1 and 0xFF.
|
||||
// SCSI-II CDROM audio suppports up to 4 audio ports with
|
||||
// Independent volume 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;
|
||||
|
||||
//
|
||||
// Passed to cdrom to describe the raw read, ie. Mode 2, Form 2, CDDA...
|
||||
//
|
||||
|
||||
typedef struct __RAW_READ_INFO {
|
||||
LARGE_INTEGER DiskOffset;
|
||||
ULONG SectorCount;
|
||||
TRACK_MODE_TYPE TrackMode;
|
||||
} RAW_READ_INFO, *PRAW_READ_INFO;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if _MSC_VER >= 1200
|
||||
#pragma warning(pop) // un-sets any local warning changes
|
||||
#else
|
||||
#pragma warning(default:4200) // array[0] is not a warning for this file
|
||||
#pragma warning(default:4201) // nameless struct/unions
|
||||
#pragma warning(default:4214) // bit fields other than int
|
||||
#endif
|
||||
|
||||
|
||||
#endif // _NTDDCDRM_
|
||||
|
||||
// end_winioctl
|
||||
|
||||
|
|
@ -1,313 +0,0 @@
|
|||
/*++ BUILD Version: 0001 // Increment this if a change has global effects
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
Module Name:
|
||||
|
||||
ntddscsi.h
|
||||
|
||||
Abstract:
|
||||
|
||||
This is the include file that defines all constants and types for
|
||||
accessing the SCSI port adapters.
|
||||
|
||||
Author:
|
||||
|
||||
Jeff Havens
|
||||
|
||||
Revision History:
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
//
|
||||
// Interface GUIDs
|
||||
//
|
||||
// need these GUIDs outside conditional includes so that user can
|
||||
// #include <ntddscsi.h> in precompiled header
|
||||
// #include <initguid.h> in a single source file
|
||||
// #include <ntddscsi.h> in that source file a second time to instantiate the GUIDs
|
||||
//
|
||||
#ifdef DEFINE_GUID
|
||||
//
|
||||
// Make sure FAR is defined...
|
||||
//
|
||||
#ifndef FAR
|
||||
#ifdef _WIN32
|
||||
#define FAR
|
||||
#else
|
||||
#define FAR _far
|
||||
#endif
|
||||
#endif
|
||||
|
||||
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);
|
||||
#endif
|
||||
|
||||
#ifndef _NTDDSCSIH_
|
||||
#define _NTDDSCSIH_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//
|
||||
// Device Name - this string is the name of the device. It is the name
|
||||
// that should be passed to NtOpenFile when accessing the device.
|
||||
//
|
||||
// Note: For devices that support multiple units, it should be suffixed
|
||||
// with the Ascii representation of the unit number.
|
||||
//
|
||||
|
||||
#define IOCTL_SCSI_BASE FILE_DEVICE_CONTROLLER
|
||||
|
||||
#define DD_SCSI_DEVICE_NAME "\\Device\\ScsiPort"
|
||||
|
||||
|
||||
//
|
||||
// NtDeviceIoControlFile IoControlCode values for this device.
|
||||
//
|
||||
// Warning: Remember that the low two bits of the code specify how the
|
||||
// buffers are passed to the driver!
|
||||
//
|
||||
|
||||
#define IOCTL_SCSI_PASS_THROUGH CTL_CODE(IOCTL_SCSI_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
||||
#define IOCTL_SCSI_MINIPORT CTL_CODE(IOCTL_SCSI_BASE, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_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_PASS_THROUGH_DIRECT CTL_CODE(IOCTL_SCSI_BASE, 0x0405, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
||||
#define IOCTL_SCSI_GET_ADDRESS CTL_CODE(IOCTL_SCSI_BASE, 0x0406, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_SCSI_RESCAN_BUS CTL_CODE(IOCTL_SCSI_BASE, 0x0407, 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_FREE_DUMP_POINTERS CTL_CODE(IOCTL_SCSI_BASE, 0x0409, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_IDE_PASS_THROUGH CTL_CODE(IOCTL_SCSI_BASE, 0x040a, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
||||
|
||||
//
|
||||
// Define the SCSI pass through structure.
|
||||
//
|
||||
|
||||
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 DataBufferOffset; //ULONG_PTR DataBufferOffset;
|
||||
ULONG SenseInfoOffset;
|
||||
UCHAR Cdb[16];
|
||||
}SCSI_PASS_THROUGH, *PSCSI_PASS_THROUGH;
|
||||
|
||||
//
|
||||
// Define the SCSI pass through direct structure.
|
||||
//
|
||||
|
||||
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;
|
||||
|
||||
|
||||
//
|
||||
// Define the SCSI pass through direct structure for Win64 (thunking).
|
||||
//
|
||||
#if defined(_WIN64)
|
||||
typedef struct _SCSI_PASS_THROUGH32 {
|
||||
USHORT Length;
|
||||
UCHAR ScsiStatus;
|
||||
UCHAR PathId;
|
||||
UCHAR TargetId;
|
||||
UCHAR Lun;
|
||||
UCHAR CdbLength;
|
||||
UCHAR SenseInfoLength;
|
||||
UCHAR DataIn;
|
||||
ULONG DataTransferLength;
|
||||
ULONG TimeOutValue;
|
||||
ULONG32 DataBufferOffset;
|
||||
ULONG SenseInfoOffset;
|
||||
UCHAR Cdb[16];
|
||||
}SCSI_PASS_THROUGH32, *PSCSI_PASS_THROUGH32;
|
||||
|
||||
//
|
||||
// Define the SCSI pass through direct structure.
|
||||
//
|
||||
|
||||
typedef struct _SCSI_PASS_THROUGH_DIRECT32 {
|
||||
USHORT Length;
|
||||
UCHAR ScsiStatus;
|
||||
UCHAR PathId;
|
||||
UCHAR TargetId;
|
||||
UCHAR Lun;
|
||||
UCHAR CdbLength;
|
||||
UCHAR SenseInfoLength;
|
||||
UCHAR DataIn;
|
||||
ULONG DataTransferLength;
|
||||
ULONG TimeOutValue;
|
||||
VOID * POINTER_32 DataBuffer;
|
||||
ULONG SenseInfoOffset;
|
||||
UCHAR Cdb[16];
|
||||
}SCSI_PASS_THROUGH_DIRECT32, *PSCSI_PASS_THROUGH_DIRECT32;
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// Define SCSI information.
|
||||
// Used with the IOCTL_SCSI_GET_INQUIRY_DATA IOCTL.
|
||||
//
|
||||
|
||||
typedef struct _SCSI_BUS_DATA {
|
||||
UCHAR NumberOfLogicalUnits;
|
||||
UCHAR InitiatorBusId;
|
||||
ULONG InquiryDataOffset;
|
||||
}SCSI_BUS_DATA, *PSCSI_BUS_DATA;
|
||||
|
||||
//
|
||||
// Define SCSI adapter bus information structure..
|
||||
// Used with the IOCTL_SCSI_GET_INQUIRY_DATA IOCTL.
|
||||
//
|
||||
|
||||
typedef struct _SCSI_ADAPTER_BUS_INFO {
|
||||
UCHAR NumberOfBuses;
|
||||
SCSI_BUS_DATA BusData[1];
|
||||
} SCSI_ADAPTER_BUS_INFO, *PSCSI_ADAPTER_BUS_INFO;
|
||||
|
||||
//
|
||||
// Define SCSI adapter bus information.
|
||||
// Used with the IOCTL_SCSI_GET_INQUIRY_DATA IOCTL.
|
||||
//
|
||||
|
||||
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 header for I/O control SRB.
|
||||
//
|
||||
|
||||
typedef struct _SRB_IO_CONTROL {
|
||||
ULONG HeaderLength;
|
||||
UCHAR Signature[8];
|
||||
ULONG Timeout;
|
||||
ULONG ControlCode;
|
||||
ULONG ReturnCode;
|
||||
ULONG Length;
|
||||
} SRB_IO_CONTROL, *PSRB_IO_CONTROL;
|
||||
|
||||
//
|
||||
// SCSI port driver capabilities structure.
|
||||
//
|
||||
|
||||
typedef struct _IO_SCSI_CAPABILITIES {
|
||||
|
||||
//
|
||||
// Length of this structure
|
||||
//
|
||||
|
||||
ULONG Length;
|
||||
|
||||
//
|
||||
// Maximum transfer size in single SRB
|
||||
//
|
||||
|
||||
ULONG MaximumTransferLength;
|
||||
|
||||
//
|
||||
// Maximum number of physical pages per data buffer
|
||||
//
|
||||
|
||||
ULONG MaximumPhysicalPages;
|
||||
|
||||
//
|
||||
// Async calls from port to class
|
||||
//
|
||||
|
||||
ULONG SupportedAsynchronousEvents;
|
||||
|
||||
//
|
||||
// Alignment mask for data transfers.
|
||||
//
|
||||
|
||||
ULONG AlignmentMask;
|
||||
|
||||
//
|
||||
// Supports tagged queuing
|
||||
//
|
||||
|
||||
BOOLEAN TaggedQueuing;
|
||||
|
||||
//
|
||||
// Host adapter scans down for bios devices.
|
||||
//
|
||||
|
||||
BOOLEAN AdapterScansDown;
|
||||
|
||||
//
|
||||
// The host adapter uses programmed I/O.
|
||||
//
|
||||
|
||||
BOOLEAN AdapterUsesPio;
|
||||
|
||||
} IO_SCSI_CAPABILITIES, *PIO_SCSI_CAPABILITIES;
|
||||
|
||||
typedef struct _SCSI_ADDRESS {
|
||||
ULONG Length;
|
||||
UCHAR PortNumber;
|
||||
UCHAR PathId;
|
||||
UCHAR TargetId;
|
||||
UCHAR Lun;
|
||||
}SCSI_ADDRESS, *PSCSI_ADDRESS;
|
||||
|
||||
//
|
||||
// Define structure for returning crash dump pointers.
|
||||
//
|
||||
|
||||
struct _ADAPTER_OBJECT;
|
||||
|
||||
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;
|
||||
|
||||
//
|
||||
// Define values for pass-through DataIn field.
|
||||
//
|
||||
|
||||
#define SCSI_IOCTL_DATA_OUT 0
|
||||
#define SCSI_IOCTL_DATA_IN 1
|
||||
#define SCSI_IOCTL_DATA_UNSPECIFIED 2
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,746 +0,0 @@
|
|||
/*++ BUILD Version: 0001 // Increment this if a change has global effects
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
Module Name:
|
||||
|
||||
ntddstor.h
|
||||
|
||||
Abstract:
|
||||
|
||||
This is the include file that defines all common constants and types
|
||||
accessing the storage class drivers
|
||||
|
||||
Author:
|
||||
|
||||
Peter Wieland 19-Jun-1996
|
||||
|
||||
Revision History:
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
//
|
||||
// Interface GUIDs
|
||||
//
|
||||
// need these GUIDs outside conditional includes so that user can
|
||||
// #include <ntddstor.h> in precompiled header
|
||||
// #include <initguid.h> in a single source file
|
||||
// #include <ntddstor.h> in that source file a second time to instantiate the GUIDs
|
||||
//
|
||||
#ifdef DEFINE_GUID
|
||||
//
|
||||
// Make sure FAR is defined...
|
||||
//
|
||||
#ifndef FAR
|
||||
#ifdef _WIN32
|
||||
#define FAR
|
||||
#else
|
||||
#define FAR _far
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// begin_wioctlguids
|
||||
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);
|
||||
// end_wioctlguids
|
||||
|
||||
// begin_wioctlobsoleteguids
|
||||
#define DiskClassGuid GUID_DEVINTERFACE_DISK
|
||||
#define CdRomClassGuid GUID_DEVINTERFACE_CDROM
|
||||
#define PartitionClassGuid GUID_DEVINTERFACE_PARTITION
|
||||
#define TapeClassGuid GUID_DEVINTERFACE_TAPE
|
||||
#define WriteOnceDiskClassGuid GUID_DEVINTERFACE_WRITEONCEDISK
|
||||
#define VolumeClassGuid GUID_DEVINTERFACE_VOLUME
|
||||
#define MediumChangerClassGuid GUID_DEVINTERFACE_MEDIUMCHANGER
|
||||
#define FloppyClassGuid GUID_DEVINTERFACE_FLOPPY
|
||||
#define CdChangerClassGuid GUID_DEVINTERFACE_CDCHANGER
|
||||
#define StoragePortClassGuid GUID_DEVINTERFACE_STORAGEPORT
|
||||
// end_wioctlobsoleteguids
|
||||
#endif
|
||||
|
||||
// begin_winioctl
|
||||
|
||||
#ifndef _NTDDSTOR_H_
|
||||
#define _NTDDSTOR_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//
|
||||
// IoControlCode values for storage devices
|
||||
//
|
||||
|
||||
#define IOCTL_STORAGE_BASE FILE_DEVICE_MASS_STORAGE
|
||||
|
||||
//
|
||||
// The following device control codes are common for all class drivers. They
|
||||
// should be used in place of the older IOCTL_DISK, IOCTL_CDROM and IOCTL_TAPE
|
||||
// common codes
|
||||
//
|
||||
|
||||
#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_MEDIA_REMOVAL CTL_CODE(IOCTL_STORAGE_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||
#define IOCTL_STORAGE_EJECT_MEDIA CTL_CODE(IOCTL_STORAGE_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_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_RESERVE CTL_CODE(IOCTL_STORAGE_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||
#define IOCTL_STORAGE_RELEASE CTL_CODE(IOCTL_STORAGE_BASE, 0x0205, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||
#define IOCTL_STORAGE_FIND_NEW_DEVICES CTL_CODE(IOCTL_STORAGE_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||
|
||||
#define IOCTL_STORAGE_EJECTION_CONTROL CTL_CODE(IOCTL_STORAGE_BASE, 0x0250, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_STORAGE_MCN_CONTROL CTL_CODE(IOCTL_STORAGE_BASE, 0x0251, 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_GET_MEDIA_SERIAL_NUMBER CTL_CODE(IOCTL_STORAGE_BASE, 0x0304, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_STORAGE_GET_HOTPLUG_INFO CTL_CODE(IOCTL_STORAGE_BASE, 0x0305, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_STORAGE_SET_HOTPLUG_INFO CTL_CODE(IOCTL_STORAGE_BASE, 0x0306, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
||||
|
||||
#define IOCTL_STORAGE_RESET_BUS CTL_CODE(IOCTL_STORAGE_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||
#define IOCTL_STORAGE_RESET_DEVICE CTL_CODE(IOCTL_STORAGE_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||
#define IOCTL_STORAGE_BREAK_RESERVATION CTL_CODE(IOCTL_STORAGE_BASE, 0x0405, 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_PREDICT_FAILURE CTL_CODE(IOCTL_STORAGE_BASE, 0x0440, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
|
||||
// end_winioctl
|
||||
|
||||
|
||||
#define IOCTL_STORAGE_QUERY_PROPERTY CTL_CODE(IOCTL_STORAGE_BASE, 0x0500, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
|
||||
|
||||
// begin_winioctl
|
||||
|
||||
//
|
||||
// These ioctl codes are obsolete. They are defined here to avoid resuing them
|
||||
// and to allow class drivers to respond to them more easily.
|
||||
//
|
||||
|
||||
#define OBSOLETE_IOCTL_STORAGE_RESET_BUS CTL_CODE(IOCTL_STORAGE_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
||||
#define OBSOLETE_IOCTL_STORAGE_RESET_DEVICE CTL_CODE(IOCTL_STORAGE_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
||||
|
||||
|
||||
//
|
||||
// IOCTL_STORAGE_GET_HOTPLUG_INFO
|
||||
//
|
||||
|
||||
typedef struct _STORAGE_HOTPLUG_INFO {
|
||||
ULONG Size; // version
|
||||
BOOLEAN MediaRemovable; // ie. zip, jaz, cdrom, mo, etc. vs hdd
|
||||
BOOLEAN MediaHotplug; // ie. does the device succeed a lock even though its not lockable media?
|
||||
BOOLEAN DeviceHotplug; // ie. 1394, USB, etc.
|
||||
BOOLEAN WriteCacheEnableOverride; // This field should not be relied upon because it is no longer used
|
||||
} STORAGE_HOTPLUG_INFO, *PSTORAGE_HOTPLUG_INFO;
|
||||
|
||||
//
|
||||
// IOCTL_STORAGE_GET_DEVICE_NUMBER
|
||||
//
|
||||
// input - none
|
||||
//
|
||||
// output - STORAGE_DEVICE_NUMBER structure
|
||||
// The values in the STORAGE_DEVICE_NUMBER structure are guaranteed
|
||||
// to remain unchanged until the system is rebooted. They are not
|
||||
// guaranteed to be persistant across boots.
|
||||
//
|
||||
|
||||
typedef struct _STORAGE_DEVICE_NUMBER {
|
||||
|
||||
//
|
||||
// The FILE_DEVICE_XXX type for this device.
|
||||
//
|
||||
|
||||
DEVICE_TYPE DeviceType;
|
||||
|
||||
//
|
||||
// The number of this device
|
||||
//
|
||||
|
||||
ULONG DeviceNumber;
|
||||
|
||||
//
|
||||
// If the device is partitionable, the partition number of the device.
|
||||
// Otherwise -1
|
||||
//
|
||||
|
||||
ULONG PartitionNumber;
|
||||
} STORAGE_DEVICE_NUMBER, *PSTORAGE_DEVICE_NUMBER;
|
||||
|
||||
//
|
||||
// Define the structures for scsi resets
|
||||
//
|
||||
|
||||
typedef struct _STORAGE_BUS_RESET_REQUEST {
|
||||
UCHAR PathId;
|
||||
} STORAGE_BUS_RESET_REQUEST, *PSTORAGE_BUS_RESET_REQUEST;
|
||||
|
||||
//
|
||||
// IOCTL_STORAGE_MEDIA_REMOVAL disables the mechanism
|
||||
// on a storage device that ejects media. This function
|
||||
// may or may not be supported on storage devices that
|
||||
// support removable media.
|
||||
//
|
||||
// TRUE means prevent media from being removed.
|
||||
// FALSE means allow media removal.
|
||||
//
|
||||
#if defined (_MSC_VER) /* MS Visual C++ */
|
||||
typedef struct _PREVENT_MEDIA_REMOVAL {
|
||||
BOOLEAN PreventMediaRemoval;
|
||||
} PREVENT_MEDIA_REMOVAL, *PPREVENT_MEDIA_REMOVAL;
|
||||
#endif
|
||||
|
||||
// begin_ntminitape
|
||||
|
||||
|
||||
typedef struct _TAPE_STATISTICS {
|
||||
ULONG Version;
|
||||
ULONG Flags;
|
||||
LARGE_INTEGER RecoveredWrites;
|
||||
LARGE_INTEGER UnrecoveredWrites;
|
||||
LARGE_INTEGER RecoveredReads;
|
||||
LARGE_INTEGER UnrecoveredReads;
|
||||
UCHAR CompressionRatioReads;
|
||||
UCHAR CompressionRatioWrites;
|
||||
} TAPE_STATISTICS, *PTAPE_STATISTICS;
|
||||
|
||||
#define RECOVERED_WRITES_VALID 0x00000001
|
||||
#define UNRECOVERED_WRITES_VALID 0x00000002
|
||||
#define RECOVERED_READS_VALID 0x00000004
|
||||
#define UNRECOVERED_READS_VALID 0x00000008
|
||||
#define WRITE_COMPRESSION_INFO_VALID 0x00000010
|
||||
#define READ_COMPRESSION_INFO_VALID 0x00000020
|
||||
|
||||
typedef struct _TAPE_GET_STATISTICS {
|
||||
ULONG Operation;
|
||||
} TAPE_GET_STATISTICS, *PTAPE_GET_STATISTICS;
|
||||
|
||||
#define TAPE_RETURN_STATISTICS 0L
|
||||
#define TAPE_RETURN_ENV_INFO 1L
|
||||
#define TAPE_RESET_STATISTICS 2L
|
||||
|
||||
//
|
||||
// IOCTL_STORAGE_GET_MEDIA_TYPES_EX will return an array of DEVICE_MEDIA_INFO
|
||||
// structures, one per supported type, embedded in the GET_MEDIA_TYPES struct.
|
||||
//
|
||||
|
||||
typedef enum _STORAGE_MEDIA_TYPE {
|
||||
//
|
||||
// Following are defined in ntdddisk.h in the MEDIA_TYPE enum
|
||||
//
|
||||
// Unknown, // Format is unknown
|
||||
// F5_1Pt2_512, // 5.25", 1.2MB, 512 bytes/sector
|
||||
// F3_1Pt44_512, // 3.5", 1.44MB, 512 bytes/sector
|
||||
// F3_2Pt88_512, // 3.5", 2.88MB, 512 bytes/sector
|
||||
// F3_20Pt8_512, // 3.5", 20.8MB, 512 bytes/sector
|
||||
// F3_720_512, // 3.5", 720KB, 512 bytes/sector
|
||||
// F5_360_512, // 5.25", 360KB, 512 bytes/sector
|
||||
// F5_320_512, // 5.25", 320KB, 512 bytes/sector
|
||||
// F5_320_1024, // 5.25", 320KB, 1024 bytes/sector
|
||||
// F5_180_512, // 5.25", 180KB, 512 bytes/sector
|
||||
// F5_160_512, // 5.25", 160KB, 512 bytes/sector
|
||||
// RemovableMedia, // Removable media other than floppy
|
||||
// FixedMedia, // Fixed hard disk media
|
||||
// F3_120M_512, // 3.5", 120M Floppy
|
||||
// F3_640_512, // 3.5" , 640KB, 512 bytes/sector
|
||||
// F5_640_512, // 5.25", 640KB, 512 bytes/sector
|
||||
// F5_720_512, // 5.25", 720KB, 512 bytes/sector
|
||||
// F3_1Pt2_512, // 3.5" , 1.2Mb, 512 bytes/sector
|
||||
// F3_1Pt23_1024, // 3.5" , 1.23Mb, 1024 bytes/sector
|
||||
// F5_1Pt23_1024, // 5.25", 1.23MB, 1024 bytes/sector
|
||||
// F3_128Mb_512, // 3.5" MO 128Mb 512 bytes/sector
|
||||
// F3_230Mb_512, // 3.5" MO 230Mb 512 bytes/sector
|
||||
// F8_256_128, // 8", 256KB, 128 bytes/sector
|
||||
// F3_200Mb_512, // 3.5", 200M Floppy (HiFD)
|
||||
//
|
||||
|
||||
DDS_4mm = 0x20, // Tape - DAT DDS1,2,... (all vendors)
|
||||
MiniQic, // Tape - miniQIC Tape
|
||||
Travan, // Tape - Travan TR-1,2,3,...
|
||||
QIC, // Tape - QIC
|
||||
MP_8mm, // Tape - 8mm Exabyte Metal Particle
|
||||
AME_8mm, // Tape - 8mm Exabyte Advanced Metal Evap
|
||||
AIT1_8mm, // Tape - 8mm Sony AIT
|
||||
DLT, // Tape - DLT Compact IIIxt, IV
|
||||
NCTP, // Tape - Philips NCTP
|
||||
IBM_3480, // Tape - IBM 3480
|
||||
IBM_3490E, // Tape - IBM 3490E
|
||||
IBM_Magstar_3590, // Tape - IBM Magstar 3590
|
||||
IBM_Magstar_MP, // Tape - IBM Magstar MP
|
||||
STK_DATA_D3, // Tape - STK Data D3
|
||||
SONY_DTF, // Tape - Sony DTF
|
||||
DV_6mm, // Tape - 6mm Digital Video
|
||||
DMI, // Tape - Exabyte DMI and compatibles
|
||||
SONY_D2, // Tape - Sony D2S and D2L
|
||||
CLEANER_CARTRIDGE, // Cleaner - All Drive types that support Drive Cleaners
|
||||
CD_ROM, // Opt_Disk - CD
|
||||
CD_R, // Opt_Disk - CD-Recordable (Write Once)
|
||||
CD_RW, // Opt_Disk - CD-Rewriteable
|
||||
DVD_ROM, // Opt_Disk - DVD-ROM
|
||||
DVD_R, // Opt_Disk - DVD-Recordable (Write Once)
|
||||
DVD_RW, // Opt_Disk - DVD-Rewriteable
|
||||
MO_3_RW, // Opt_Disk - 3.5" Rewriteable MO Disk
|
||||
MO_5_WO, // Opt_Disk - MO 5.25" Write Once
|
||||
MO_5_RW, // Opt_Disk - MO 5.25" Rewriteable (not LIMDOW)
|
||||
MO_5_LIMDOW, // Opt_Disk - MO 5.25" Rewriteable (LIMDOW)
|
||||
PC_5_WO, // Opt_Disk - Phase Change 5.25" Write Once Optical
|
||||
PC_5_RW, // Opt_Disk - Phase Change 5.25" Rewriteable
|
||||
PD_5_RW, // Opt_Disk - PhaseChange Dual Rewriteable
|
||||
ABL_5_WO, // Opt_Disk - Ablative 5.25" Write Once Optical
|
||||
PINNACLE_APEX_5_RW, // Opt_Disk - Pinnacle Apex 4.6GB Rewriteable Optical
|
||||
SONY_12_WO, // Opt_Disk - Sony 12" Write Once
|
||||
PHILIPS_12_WO, // Opt_Disk - Philips/LMS 12" Write Once
|
||||
HITACHI_12_WO, // Opt_Disk - Hitachi 12" Write Once
|
||||
CYGNET_12_WO, // Opt_Disk - Cygnet/ATG 12" Write Once
|
||||
KODAK_14_WO, // Opt_Disk - Kodak 14" Write Once
|
||||
MO_NFR_525, // Opt_Disk - Near Field Recording (Terastor)
|
||||
NIKON_12_RW, // Opt_Disk - Nikon 12" Rewriteable
|
||||
IOMEGA_ZIP, // Mag_Disk - Iomega Zip
|
||||
IOMEGA_JAZ, // Mag_Disk - Iomega Jaz
|
||||
SYQUEST_EZ135, // Mag_Disk - Syquest EZ135
|
||||
SYQUEST_EZFLYER, // Mag_Disk - Syquest EzFlyer
|
||||
SYQUEST_SYJET, // Mag_Disk - Syquest SyJet
|
||||
AVATAR_F2, // Mag_Disk - 2.5" Floppy
|
||||
MP2_8mm, // Tape - 8mm Hitachi
|
||||
DST_S, // Ampex DST Small Tapes
|
||||
DST_M, // Ampex DST Medium Tapes
|
||||
DST_L, // Ampex DST Large Tapes
|
||||
VXATape_1, // Ecrix 8mm Tape
|
||||
VXATape_2, // Ecrix 8mm Tape
|
||||
STK_9840, // STK 9840
|
||||
LTO_Ultrium, // IBM, HP, Seagate LTO Ultrium
|
||||
LTO_Accelis, // IBM, HP, Seagate LTO Accelis
|
||||
DVD_RAM, // Opt_Disk - DVD-RAM
|
||||
AIT_8mm, // AIT2 or higher
|
||||
ADR_1, // OnStream ADR Mediatypes
|
||||
ADR_2
|
||||
} STORAGE_MEDIA_TYPE, *PSTORAGE_MEDIA_TYPE;
|
||||
|
||||
#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
|
||||
|
||||
//
|
||||
// Define the different storage bus types
|
||||
// Bus types below 128 (0x80) are reserved for Microsoft use
|
||||
//
|
||||
|
||||
typedef enum _STORAGE_BUS_TYPE {
|
||||
BusTypeUnknown = 0x00,
|
||||
BusTypeScsi,
|
||||
BusTypeAtapi,
|
||||
BusTypeAta,
|
||||
BusType1394,
|
||||
BusTypeSsa,
|
||||
BusTypeFibre,
|
||||
BusTypeUsb,
|
||||
BusTypeRAID,
|
||||
BusTypeMaxReserved = 0x7F
|
||||
} STORAGE_BUS_TYPE, *PSTORAGE_BUS_TYPE;
|
||||
|
||||
typedef struct _DEVICE_MEDIA_INFO {
|
||||
union {
|
||||
struct {
|
||||
LARGE_INTEGER Cylinders;
|
||||
STORAGE_MEDIA_TYPE MediaType;
|
||||
ULONG TracksPerCylinder;
|
||||
ULONG SectorsPerTrack;
|
||||
ULONG BytesPerSector;
|
||||
ULONG NumberMediaSides;
|
||||
ULONG MediaCharacteristics; // Bitmask of MEDIA_XXX values.
|
||||
} DiskInfo;
|
||||
|
||||
struct {
|
||||
LARGE_INTEGER Cylinders;
|
||||
STORAGE_MEDIA_TYPE MediaType;
|
||||
ULONG TracksPerCylinder;
|
||||
ULONG SectorsPerTrack;
|
||||
ULONG BytesPerSector;
|
||||
ULONG NumberMediaSides;
|
||||
ULONG MediaCharacteristics; // Bitmask of MEDIA_XXX values.
|
||||
} RemovableDiskInfo;
|
||||
|
||||
struct {
|
||||
STORAGE_MEDIA_TYPE MediaType;
|
||||
ULONG MediaCharacteristics; // Bitmask of MEDIA_XXX values.
|
||||
ULONG CurrentBlockSize;
|
||||
STORAGE_BUS_TYPE BusType;
|
||||
|
||||
//
|
||||
// Bus specific information describing the medium supported.
|
||||
//
|
||||
|
||||
union {
|
||||
struct {
|
||||
UCHAR MediumType;
|
||||
UCHAR DensityCode;
|
||||
} ScsiInformation;
|
||||
} BusSpecificData;
|
||||
|
||||
} TapeInfo;
|
||||
} DeviceSpecific;
|
||||
} DEVICE_MEDIA_INFO, *PDEVICE_MEDIA_INFO;
|
||||
|
||||
typedef struct _GET_MEDIA_TYPES {
|
||||
ULONG DeviceType; // FILE_DEVICE_XXX values
|
||||
ULONG MediaInfoCount;
|
||||
DEVICE_MEDIA_INFO MediaInfo[1];
|
||||
} GET_MEDIA_TYPES, *PGET_MEDIA_TYPES;
|
||||
|
||||
|
||||
//
|
||||
// IOCTL_STORAGE_PREDICT_FAILURE
|
||||
//
|
||||
// input - none
|
||||
//
|
||||
// output - STORAGE_PREDICT_FAILURE structure
|
||||
// PredictFailure returns zero if no failure predicted and non zero
|
||||
// if a failure is predicted.
|
||||
//
|
||||
// VendorSpecific returns 512 bytes of vendor specific information
|
||||
// if a failure is predicted
|
||||
//
|
||||
typedef struct _STORAGE_PREDICT_FAILURE
|
||||
{
|
||||
ULONG PredictFailure;
|
||||
UCHAR VendorSpecific[512];
|
||||
} STORAGE_PREDICT_FAILURE, *PSTORAGE_PREDICT_FAILURE;
|
||||
|
||||
// end_ntminitape
|
||||
// end_winioctl
|
||||
|
||||
//
|
||||
// Property Query Structures
|
||||
//
|
||||
|
||||
//
|
||||
// IOCTL_STORAGE_QUERY_PROPERTY
|
||||
//
|
||||
// Input Buffer:
|
||||
// a STORAGE_PROPERTY_QUERY structure which describes what type of query
|
||||
// is being done, what property is being queried for, and any additional
|
||||
// parameters which a particular property query requires.
|
||||
//
|
||||
// Output Buffer:
|
||||
// Contains a buffer to place the results of the query into. Since all
|
||||
// property descriptors can be cast into a STORAGE_DESCRIPTOR_HEADER,
|
||||
// the IOCTL can be called once with a small buffer then again using
|
||||
// a buffer as large as the header reports is necessary.
|
||||
//
|
||||
|
||||
|
||||
//
|
||||
// Types of queries
|
||||
//
|
||||
|
||||
typedef enum _STORAGE_QUERY_TYPE {
|
||||
PropertyStandardQuery = 0, // Retrieves the descriptor
|
||||
PropertyExistsQuery, // Used to test whether the descriptor is supported
|
||||
PropertyMaskQuery, // Used to retrieve a mask of writeable fields in the descriptor
|
||||
PropertyQueryMaxDefined // use to validate the value
|
||||
} STORAGE_QUERY_TYPE, *PSTORAGE_QUERY_TYPE;
|
||||
|
||||
//
|
||||
// define some initial property id's
|
||||
//
|
||||
|
||||
typedef enum _STORAGE_PROPERTY_ID {
|
||||
StorageDeviceProperty = 0,
|
||||
StorageAdapterProperty,
|
||||
StorageDeviceIdProperty
|
||||
} STORAGE_PROPERTY_ID, *PSTORAGE_PROPERTY_ID;
|
||||
|
||||
//
|
||||
// Query structure - additional parameters for specific queries can follow
|
||||
// the header
|
||||
//
|
||||
|
||||
typedef struct _STORAGE_PROPERTY_QUERY {
|
||||
|
||||
//
|
||||
// ID of the property being retrieved
|
||||
//
|
||||
|
||||
STORAGE_PROPERTY_ID PropertyId;
|
||||
|
||||
//
|
||||
// Flags indicating the type of query being performed
|
||||
//
|
||||
|
||||
STORAGE_QUERY_TYPE QueryType;
|
||||
|
||||
//
|
||||
// Space for additional parameters if necessary
|
||||
//
|
||||
|
||||
UCHAR AdditionalParameters[1];
|
||||
|
||||
} STORAGE_PROPERTY_QUERY, *PSTORAGE_PROPERTY_QUERY;
|
||||
|
||||
//
|
||||
// Standard property descriptor header. All property pages should use this
|
||||
// as their first element or should contain these two elements
|
||||
//
|
||||
|
||||
typedef struct _STORAGE_DESCRIPTOR_HEADER {
|
||||
|
||||
ULONG Version;
|
||||
|
||||
ULONG Size;
|
||||
|
||||
} STORAGE_DESCRIPTOR_HEADER, *PSTORAGE_DESCRIPTOR_HEADER;
|
||||
|
||||
//
|
||||
// Device property descriptor - this is really just a rehash of the inquiry
|
||||
// data retrieved from a scsi device
|
||||
//
|
||||
// This may only be retrieved from a target device. Sending this to the bus
|
||||
// will result in an error
|
||||
//
|
||||
|
||||
typedef struct _STORAGE_DEVICE_DESCRIPTOR {
|
||||
|
||||
//
|
||||
// Sizeof(STORAGE_DEVICE_DESCRIPTOR)
|
||||
//
|
||||
|
||||
ULONG Version;
|
||||
|
||||
//
|
||||
// Total size of the descriptor, including the space for additional
|
||||
// data and id strings
|
||||
//
|
||||
|
||||
ULONG Size;
|
||||
|
||||
//
|
||||
// The SCSI-2 device type
|
||||
//
|
||||
|
||||
UCHAR DeviceType;
|
||||
|
||||
//
|
||||
// The SCSI-2 device type modifier (if any) - this may be zero
|
||||
//
|
||||
|
||||
UCHAR DeviceTypeModifier;
|
||||
|
||||
//
|
||||
// Flag indicating whether the device's media (if any) is removable. This
|
||||
// field should be ignored for media-less devices
|
||||
//
|
||||
|
||||
BOOLEAN RemovableMedia;
|
||||
|
||||
//
|
||||
// Flag indicating whether the device can support mulitple outstanding
|
||||
// commands. The actual synchronization in this case is the responsibility
|
||||
// of the port driver.
|
||||
//
|
||||
|
||||
BOOLEAN CommandQueueing;
|
||||
|
||||
//
|
||||
// Byte offset to the zero-terminated ascii string containing the device's
|
||||
// vendor id string. For devices with no such ID this will be zero
|
||||
//
|
||||
|
||||
ULONG VendorIdOffset;
|
||||
|
||||
//
|
||||
// Byte offset to the zero-terminated ascii string containing the device's
|
||||
// product id string. For devices with no such ID this will be zero
|
||||
//
|
||||
|
||||
ULONG ProductIdOffset;
|
||||
|
||||
//
|
||||
// Byte offset to the zero-terminated ascii string containing the device's
|
||||
// product revision string. For devices with no such string this will be
|
||||
// zero
|
||||
//
|
||||
|
||||
ULONG ProductRevisionOffset;
|
||||
|
||||
//
|
||||
// Byte offset to the zero-terminated ascii string containing the device's
|
||||
// serial number. For devices with no serial number this will be zero
|
||||
//
|
||||
|
||||
ULONG SerialNumberOffset;
|
||||
|
||||
//
|
||||
// Contains the bus type (as defined above) of the device. It should be
|
||||
// used to interpret the raw device properties at the end of this structure
|
||||
// (if any)
|
||||
//
|
||||
|
||||
STORAGE_BUS_TYPE BusType;
|
||||
|
||||
//
|
||||
// The number of bytes of bus-specific data which have been appended to
|
||||
// this descriptor
|
||||
//
|
||||
|
||||
ULONG RawPropertiesLength;
|
||||
|
||||
//
|
||||
// Place holder for the first byte of the bus specific property data
|
||||
//
|
||||
|
||||
UCHAR RawDeviceProperties[1];
|
||||
|
||||
} STORAGE_DEVICE_DESCRIPTOR, *PSTORAGE_DEVICE_DESCRIPTOR;
|
||||
|
||||
|
||||
//
|
||||
// Adapter properties
|
||||
//
|
||||
// This descriptor can be retrieved from a target device object of from the
|
||||
// device object for the bus. Retrieving from the target device object will
|
||||
// forward the request to the underlying bus
|
||||
//
|
||||
|
||||
typedef struct _STORAGE_ADAPTER_DESCRIPTOR {
|
||||
|
||||
ULONG Version;
|
||||
|
||||
ULONG Size;
|
||||
|
||||
ULONG MaximumTransferLength;
|
||||
|
||||
ULONG MaximumPhysicalPages;
|
||||
|
||||
ULONG AlignmentMask;
|
||||
|
||||
BOOLEAN AdapterUsesPio;
|
||||
|
||||
BOOLEAN AdapterScansDown;
|
||||
|
||||
BOOLEAN CommandQueueing;
|
||||
|
||||
BOOLEAN AcceleratedTransfer;
|
||||
|
||||
UCHAR BusType;
|
||||
|
||||
USHORT BusMajorVersion;
|
||||
|
||||
USHORT BusMinorVersion;
|
||||
|
||||
} STORAGE_ADAPTER_DESCRIPTOR, *PSTORAGE_ADAPTER_DESCRIPTOR;
|
||||
|
||||
//
|
||||
// Storage identification descriptor.
|
||||
// The definitions here are based on the SCSI/SBP vital product data
|
||||
// device identifier page.
|
||||
//
|
||||
|
||||
typedef enum _STORAGE_IDENTIFIER_CODE_SET {
|
||||
StorageIdCodeSetReserved = 0,
|
||||
StorageIdCodeSetBinary = 1,
|
||||
StorageIdCodeSetAscii = 2
|
||||
} STORAGE_IDENTIFIER_CODE_SET, *PSTORAGE_IDENTIFIER_CODE_SET;
|
||||
|
||||
typedef enum _STORAGE_IDENTIFIER_TYPE {
|
||||
StorageIdTypeVendorSpecific = 0,
|
||||
StorageIdTypeVendorId = 1,
|
||||
StorageIdTypeEUI64 = 2,
|
||||
StorageIdTypeFCPHName = 3,
|
||||
StorageIdTypePortRelative = 4
|
||||
} STORAGE_IDENTIFIER_TYPE, *PSTORAGE_IDENTIFIER_TYPE;
|
||||
|
||||
typedef enum _STORAGE_ASSOCIATION_TYPE {
|
||||
StorageIdAssocDevice = 0,
|
||||
StorageIdAssocPort = 1
|
||||
} STORAGE_ASSOCIATION_TYPE, *PSTORAGE_ASSOCIATION_TYPE;
|
||||
|
||||
typedef struct _STORAGE_IDENTIFIER {
|
||||
STORAGE_IDENTIFIER_CODE_SET CodeSet;
|
||||
STORAGE_IDENTIFIER_TYPE Type;
|
||||
USHORT IdentifierSize;
|
||||
USHORT NextOffset;
|
||||
|
||||
//
|
||||
// Add new fields here since existing code depends on
|
||||
// the above layout not changing.
|
||||
//
|
||||
|
||||
STORAGE_ASSOCIATION_TYPE Association;
|
||||
|
||||
//
|
||||
// The identifier is a variable length array of bytes.
|
||||
//
|
||||
|
||||
UCHAR Identifier[1];
|
||||
} STORAGE_IDENTIFIER, *PSTORAGE_IDENTIFIER;
|
||||
|
||||
typedef struct _STORAGE_DEVICE_ID_DESCRIPTOR {
|
||||
|
||||
ULONG Version;
|
||||
|
||||
ULONG Size;
|
||||
|
||||
//
|
||||
// The number of identifiers reported by the device.
|
||||
//
|
||||
|
||||
ULONG NumberOfIdentifiers;
|
||||
|
||||
//
|
||||
// The following field is actually a variable length array of identification
|
||||
// descriptors. Unfortunately there's no C notation for an array of
|
||||
// variable length structures so we're forced to just pretend.
|
||||
//
|
||||
|
||||
UCHAR Identifiers[1];
|
||||
} STORAGE_DEVICE_ID_DESCRIPTOR, *PSTORAGE_DEVICE_ID_DESCRIPTOR;
|
||||
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4200)
|
||||
typedef struct _STORAGE_MEDIA_SERIAL_NUMBER_DATA {
|
||||
|
||||
USHORT Reserved;
|
||||
|
||||
//
|
||||
// the SerialNumberLength will be set to zero
|
||||
// if the command is supported and the media
|
||||
// does not have a valid serial number.
|
||||
//
|
||||
|
||||
USHORT SerialNumberLength;
|
||||
|
||||
//
|
||||
// the following data is binary, and is not guaranteed
|
||||
// to be NULL terminated. this is an excercise for the
|
||||
// caller.
|
||||
//
|
||||
|
||||
UCHAR SerialNumber[0];
|
||||
|
||||
} STORAGE_MEDIA_SERIAL_NUMBER_DATA, *PSTORAGE_MEDIA_SERIAL_NUMBER_DATA;
|
||||
#pragma warning(push)
|
||||
|
||||
|
||||
// begin_winioctl
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _NTDDSTOR_H_
|
||||
// end_winioctl
|
||||
|
|
@ -16,12 +16,18 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: cdrom_aspi_win32.cpp,v 1.7 2004-01-02 14:38:30 qbix79 Exp $ */
|
||||
|
||||
#if defined (WIN32)
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#include "cdrom.h"
|
||||
#include "scsidefs.h" // Aspi stuff
|
||||
//Are actually system includes but leave for now
|
||||
#include "ntddcdrm.h"
|
||||
#include "ntddscsi.h"
|
||||
//#include "scsi.h" // Aspi stuff
|
||||
#include "scsidefs.h"
|
||||
#include "dosbox.h"
|
||||
|
||||
// *****************************************************************
|
||||
|
@ -716,4 +722,4 @@ bool CDROM_Interface_Aspi::ReadSectors(PhysPt buffer, bool raw, unsigned long se
|
|||
return (s.SRB_Status==SS_COMP);
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: cdrom_ioctl_win32.cpp,v 1.7 2004-01-02 14:38:30 qbix79 Exp $ */
|
||||
|
||||
#if defined (WIN32)
|
||||
|
||||
// *****************************************************************
|
||||
|
@ -25,6 +27,7 @@
|
|||
#include <windows.h>
|
||||
#include <winioctl.h> // Ioctl stuff
|
||||
#include <io.h>
|
||||
//Actually a system include but leave for now
|
||||
#include "ntddcdrm.h" // Ioctl stuff
|
||||
#include "cdrom.h"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue