1*95e1ffb1Schristos /* $NetBSD: diskio.h,v 1.3 2005/12/11 12:17:30 christos Exp $ */ 29173eae7Such 39173eae7Such /*- 49173eae7Such * Copyright (c) 2000 Tomohide Saito. 59173eae7Such * All rights reserved. 69173eae7Such * 79173eae7Such * Redistribution and use in source and binary forms, with or without 89173eae7Such * modification, are permitted provided that the following conditions 99173eae7Such * are met: 109173eae7Such * 1. Redistributions of source code must retain the above copyright 119173eae7Such * notice, this list of conditions and the following disclaimer. 129173eae7Such * 2. Redistributions in binary form must reproduce the above copyright 139173eae7Such * notice, this list of conditions and the following disclaimer in the 149173eae7Such * documentation and/or other materials provided with the distribution. 159173eae7Such * 169173eae7Such * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 179173eae7Such * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 189173eae7Such * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 199173eae7Such * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 209173eae7Such * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 219173eae7Such * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 229173eae7Such * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 239173eae7Such * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 249173eae7Such * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 259173eae7Such * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 269173eae7Such * SUCH DAMAGE. 279173eae7Such * 289173eae7Such */ 299173eae7Such 309173eae7Such /* "fake" diskio.h */ 319173eae7Such 329173eae7Such #define DISK_IOCTL_GETINFO 1 339173eae7Such #define DISK_IOCTL_READ 2 349173eae7Such #define DISK_INFO_FLAG_MBR 0x00000001 359173eae7Such #define DISK_INFO_FLAG_CHS_UNCERTAIN 0x00000002 369173eae7Such #define DISK_INFO_FLAG_UNFORMATTED 0x00000004 379173eae7Such #define DISK_INFO_FLAG_PAGEABLE 0x00000008 389173eae7Such 399173eae7Such typedef struct { 409173eae7Such long pad1; 419173eae7Such DWORD di_bytes_per_sect;/* offset 4 */ 429173eae7Such DWORD di_cylinders; /* offset 8 */ 439173eae7Such DWORD di_heads; /* offset 12 */ 449173eae7Such DWORD di_sectors; /* offset 16 */ 459173eae7Such DWORD di_flags; /* offset 20 */ 469173eae7Such } DISK_INFO; /* sizeof(DISK_INFO) = 24 */ 479173eae7Such 489173eae7Such typedef struct _SG_REQ { 499173eae7Such DWORD sr_start; /* offset 0 */ 509173eae7Such DWORD sr_num_sec; /* offset 4 */ 519173eae7Such DWORD sr_num_sg; /* offset 8 */ 529173eae7Such DWORD sr_status; /* offset 12 */ 539173eae7Such DWORD (*sr_callback)(struct _SG_REQ *); /* offset 16 */ 549173eae7Such struct { /* offset 20 */ 559173eae7Such PUCHAR sb_buf; /* offset 0 */ 569173eae7Such DWORD sb_len; /* offset 4 */ 579173eae7Such } sr_sglist[1]; /* sizeof(sr_sglist[]) = 8 */ 589173eae7Such } SG_REQ; /* sizeof(SG_REQ) = 28 */ 59