18#define DEFAULT_REMOVAL_LOCK_TIMEOUT 20
20#define MOV_DW_SWP(a,b) \
23 *(unsigned short *)&(a) = _byteswap_ushort(*(unsigned short *)&(b)); \
27#define MOV_DD_SWP(a,b) \
29 PFOUR_BYTE _from_, _to_; \
30 _from_ = ((PFOUR_BYTE)&(b)); \
31 _to_ = ((PFOUR_BYTE)&(a)); \
32 __asm mov ebx,_from_ \
54 " atactl -<switches> c|s<controller id>:b<bus id>:d<device id>[:l<lun>]\n"
56 " l (L)ist devices on SCSI and ATA controllers bus(es)\n"
57 " Note: ATA Pri/Sec controller are usually represented\n"
58 " as Scsi0/Scsi1 under NT-family OSes\n"
59 " x show e(X)tended info\n"
60 " a show (A)dapter info\n"
61 " s (S)can for new devices on ATA/SATA bus(es) (experimental)\n"
62 " S (S)can for new devices on ATA/SATA bus(es) (experimental)\n"
63 " device, hidden with 'H' can be redetected\n"
64 " h (H)ide device on ATA/SATA bus for removal (experimental)\n"
65 " device can be redetected\n"
66 " H (H)ide device on ATA/SATA bus (experimental)\n"
67 " device can not be redetected until 'h' or 'S' is issued\n"
68 " m [MODE] set i/o (M)ode for device or revert to default\n"
69 " available MODEs are PIO, PIO0-PIO5, DMA, WDMA0-WDMA2,\n"
70 " UDMA33/44/66/100/133, UDMA0-UDMA5\n"
71 " d [XXX] lock ATA/SATA bus for device removal for XXX seconds or\n"
72 " for %d seconds if no lock timeout specified.\n"
73 " can be used with -h, -m or standalone.\n"
74 " D [XXX] disable device (turn into sleep mode) and lock ATA/SATA bus \n"
75 " for device removal for XXX seconds or\n"
76 " for %d seconds if no lock timeout specified.\n"
77 " can be used with -h, -m or standalone.\n"
78 " pX change power state to X, where X is\n"
79 " 0 - active, 1 - idle, 2 - standby, 3 - sleep\n"
81 " ba (A)ssign (B)ad-block list\n"
82 " bl get assigned (B)ad-block (L)ist\n"
83 " br (R)eset assigned (B)ad-block list\n"
84 " f specify (F)ile for bad-block list\n"
85 " n XXX block (n)ubmering radix. XXX can be hex or dec\n"
89 " will list all scsi buses and all connected devices\n"
90 " atactl -m udma0 s2:b1:d1\n"
91 " will switch device at Scsi2, bus 1, taget_id 1 to UDMA0 mode\n"
92 " atactl -h -d 30 c1:b0:d0:l0 \n"
93 " will hide Master (d0:l0) device on secondary (c1:b0) IDE channel\n"
94 " and lock i/o on this channel for 30 seconds to ensure safety\n"
97 "Device address format:\n"
99 "s<controller id> number of controller in system. Is assigned during hardware\n"
100 " detection. Usually s0/s1 are ATA Pri/Sec.\n"
101 " Note, due do NT internal design ATA controllers are represented\n"
102 " as SCSI controllers.\n"
103 "b<bus id> For ATA controllers it is channel number.\n"
104 " Note, usually onboard controller is represented as 2 legacy\n"
105 " ISA-compatible single-channel controllers (Scsi9/Scsi1). Additional\n"
106 " ATA, ATA-RAID and some specific onboard controllers are represented\n"
107 " as multichannel controllers.\n"
108 "d<device id> For ATA controllers d0 is Master, d1 is Slave.\n"
109 "l<lun> Not used in ATA controller drivers, alway 0\n"
111 "Bad-block list format:\n"
114 "; Still one comment\n"
115 "hex: switch to hexadecimal mode\n"
116 "<Bad Area 1 Start LBA, e.g. FD50> <Block count 1, e.g. 60>\n"
117 "<Bad Area 2 Start LBA> <Block count 2>\n"
119 "dec: switch to decimal mode\n"
120 "<Bad Area N Start LBA, e.g. 16384> <Block count N, e.g. 48>\n"
130#define CMD_ATA_LIST 0x01
131#define CMD_ATA_FIND 0x02
132#define CMD_ATA_HIDE 0x03
133#define CMD_ATA_MODE 0x04
134#define CMD_ATA_RESET 0x05
135#define CMD_ATA_BBLK 0x06
136#define CMD_ATA_POWER 0x07
249 ULONG inBufferLength,
251 ULONG outBufferLength,
257 ULONG data_len =
max(inBufferLength, outBufferLength);
263 len = data_len +
sizeof(AtaCtl->
hdr);
284 if(outBufferLength) {
292 if(inBuffer && inBufferLength) {
296 memcpy(&AtaCtl->
addr, inBuffer, inBufferLength);
436#define check_atamode_str(str, mode) \
437 (!_stricmp(str, "UDMA" #mode) || \
438 !_stricmp(str, "UDMA-" #mode) || \
439 !_stricmp(str, "ATA-" #mode) || \
440 !_stricmp(str, "ATA#" #mode))
482 if(mode < 0 || mode > 7)
492 if(mode < 0 || mode > 2)
502 if(mode < 0 || mode > 2)
515 if(mode < 0 || mode > 5)
641 dev_id &= 0x00ffffff;
643 if(dev_id == 0x007f7f7f) {
660 printf(
"Can't get device info\n");
707 if(l_dev_id == dev_id || dev_id == -1) {
717 if(inquiryData->
Lun) {
731 addr.PortNumber = -1;
738 &IoMode,
sizeof(IoMode),
780 printf(
" b%lu:d%d%s %24.24s %4.4s ",
812 printf(
" %.12s ", mode_str);
823 switch(
ident->DeviceType) {
825 if(
ident->Removable) {
836 BlockMode_valid =
FALSE;
839 printf(
" Optical Drive ");
840 BlockMode_valid =
FALSE;
846 max_lba =
ident->UserAddressableSectors;
847 if(
ident->FeaturesSupport.Address48) {
848 max_lba =
ident->UserAddressableSectors48;
853 chs[0] =
ident->NumberOfCylinders;
854 chs[1] =
ident->NumberOfHeads;
855 chs[2] =
ident->SectorsPerTrack;
861 printf(
" %.12s\n", mode_str);
863 for (
j = 0;
j < 40;
j += 2) {
866 printf(
" Mod: %40.40s\n", SerNum);
867 for (
j = 0;
j < 8;
j += 2) {
870 printf(
" Rev: %8.8s\n", SerNum);
871 for (
j = 0;
j < 20;
j += 2) {
874 printf(
" S/N: %20.20s\n", SerNum);
876 if(BlockMode_valid) {
877 if(
ident->MaximumBlockTransfer) {
878 printf(
" Multi-block mode: %u block%s\n",
ident->MaximumBlockTransfer,
ident->MaximumBlockTransfer == 1 ?
"" :
"s");
880 printf(
" Multi-block mode: N/A\n");
884 printf(
" C/H/S: %u/%u/%u \n", chs[0], chs[1], chs[2]);
885 printf(
" LBA: %I64u \n", max_lba);
889 if(max_lba < 2*1024*1024) {
892 if(max_lba < (
ULONG)2*1024*1024*1024) {
893 printf(
" Size: %lu.%lu (%lu) Gb\n", (
ULONG)(max_lba/2048/1024),
894 (
ULONG)(((max_lba/2048)%1024)/10),
895 (
ULONG)(max_lba*512/1000/1000/1000)
898 printf(
" Size: %lu.%lu (%lu) Tb\n", (
ULONG)(max_lba/2048/1024/1024),
899 (
ULONG)((max_lba/2048/1024)%1024)/10,
900 (
ULONG)(max_lba*512/1000/1000/1000)
907 printf(
" !!! Assigned bad-block list !!!\n");
939 printf(
" Optical Drive ");
963 printf(
" No device(s) found.\n");
991 addr.PortNumber = bus_id;
1016 printf(
"Can't get adapter info\n");
1020 printf(
" PCI Bus/Dev/Func: %lu/%lu/%lu%s\n",
1023 printf(
" VendorId/DevId/Rev: %#04x/%#04x/%#02x\n",
1074 for(bus_id=0;
TRUE; bus_id++) {
1118 addr.PortNumber = bus_id;
1130 &IoMode,
sizeof(IoMode),
1134 printf(
"Can't apply specified transfer mode\n");
1163 addr.PortNumber = bus_id;
1168 if(
addr.TargetId == 0x7f &&
addr.Lun == 0x7f) {
1171 printf(
"Resetting channel...\n");
1173 printf(
"Resetting device...\n");
1182 printf(
"Reset failed\n");
1184 printf(
"Channel reset done\n");
1195 int persistent_hide,
1222 addr.PortNumber = bus_id;
1230 printf(
"Deleting device.\n");
1232 printf(
"ATTENTION: you have %d seconds to disconnect cable\n",
lock);
1240 printf(
"Delete failed\n");
1242 printf(
"Device is detached\n");
1274 if((
UCHAR)(dev_id) != 0xff &&
1275 (
UCHAR)(dev_id >> 8) != 0xff) {
1278 addr.PortNumber = bus_id;
1286 printf(
"Scanning bus for new devices.\n");
1288 printf(
"You have %d seconds to connect device.\n",
lock);
1356 char DevSerial[128];
1366 char* bblist =
NULL;
1375 printf(
"\nERROR: Target device/bus ID must be specified\n\n");
1379 if(((dev_id >> 16) & 0xff) == 0xff) {
1380 printf(
"\nERROR: Target device bus number (channel) must be specified with b:<bus id>\n\n");
1384 if(((dev_id >> 8) & 0xff) == 0xff) {
1385 printf(
"\nERROR: Target device ID must be specified with d:<device id>\n\n");
1393 printf(
"Controller number must be specified\n");
1395 printf(
"Can't open Controller %d\n", bus_id);
1420 printf(
"Can't open registry key:\n HKLM\\SYSTEM\\CurrentControlSet\\Services\\UniATA\\Parameters\\BadBlocks\n");
1426 printf(
"Can't delete registry value:\n %s\n", DevSerial);
1430 addr.PortNumber = bus_id;
1441 printf(
"Bad block list shall be cleared after reboot.\n");
1443 printf(
"Bad block list cleared\n");
1454 while(
_fgets(BB_Msg,
sizeof(BB_Msg), hf)) {
1456 BB_Msg[
sizeof(BB_Msg)-1] = 0;
1458 while((
a = BB_Msg[
k])) {
1459 if(
a ==
' ' ||
a ==
'\t' ||
a ==
'\r') {
1465 if(!
a ||
a ==
';' ||
a ==
'#') {
1468 if(!
strncmp(BB_Msg+
k,
"hex:", 4)) {
1472 if(!
strncmp(BB_Msg+
k,
"dec:", 4)) {
1477 while((
a = BB_Msg[
k])) {
1478 if(
a ==
' ' ||
a ==
'\t' ||
a ==
'\r') {
1482 if(
a ==
';' ||
a ==
'#') {
1485 if(
a >=
'0' &&
a <=
'9') {
1488 if(
radix == 16 && ((
a >=
'A' &&
a <=
'F') || (
a >=
'a' &&
a <=
'f'))) {
1492 printf(
"Illegal character '%1.1s' in line %d:\n%s\n", BB_Msg+
k-1,
j, BB_Msg);
1501 b =
sscanf(BB_Msg+
k,
"%I64u\t%I64u", &tmp_bb_lba, &tmp_bb_len);
1503 b =
sscanf(BB_Msg+
k,
"%I64x\t%I64x", &tmp_bb_lba, &tmp_bb_len);
1510 printf(
"Can't parse line %d:\n%s\n",
j, BB_Msg);
1515 printf(
"BlockCount evaluated to 0 in line %d:\n%s\n",
j, BB_Msg);
1518 if(tmp_bb_lba < 0) {
1520 printf(
"Start LBA evaluated to negative in line %d:\n%s\n",
j, BB_Msg);
1523 if(tmp_bb_len < 0) {
1525 printf(
"BlockCount evaluated to negative in line %d:\n%s\n",
j, BB_Msg);
1530 (
pData[(
i-1)*2+1] == tmp_bb_lba)) {
1531 pData[(
i-1)*2+1]+=tmp_bb_len;
1534 pData[
i*2+1]=tmp_bb_lba+tmp_bb_len;
1541 printf(
"Can't set registry value:\n %s\n", DevSerial);
1556 printf(
"Bad block list shall be applied after reboot\n");
1561 printf(
"No bad block list assigned\n");
1565 printf(
"Can't get registry value:\n %s\n", DevSerial);
1577 printf(
"Can't get registry value:\n %s\n", DevSerial);
1581 for (
j = 0;
j < 20;
j += 2) {
1584 b =
sprintf(BB_Msg,
"#model: %20.20s\n", tmp);
1586 for (
j = 0;
j < 4;
j += 2) {
1589 b =
sprintf(BB_Msg,
"#rev: %4.4s\n", tmp);
1591 for (
j = 0;
j < 20;
j += 2) {
1594 b =
sprintf(BB_Msg,
"#s/n: %20.20s\n", tmp);
1596 b =
sprintf(BB_Msg,
"#%s\n", DevSerial);
1598 b =
sprintf(BB_Msg,
"#Starting LBA\tNum. of Blocks\n");
1603 b =
sprintf(BB_Msg,
"Starting LBA\tNum. of Blocks (HEX)\n");
1608 tmp_bb_lba = ((
LONGLONG*)bblist)[
i*2+0];
1609 tmp_bb_len = ((
LONGLONG*)bblist)[
i*2+1] - tmp_bb_lba;
1610 b =
sprintf(BB_Msg,
"%I64u\t%I64u\n", tmp_bb_lba, tmp_bb_len);
1654 addr.PortNumber = bus_id;
1659 memset(&cdb, 0,
sizeof(cdb));
1665 printf(
"Changing power state to ...\n");
1669 &senseData, &returned);
1679 if(
a >=
'0' &&
a <=
'9')
1698 int b_dev=-1, d_dev=-1, l_dev=0;
1701 int persistent_hide=0;
1704 printf(
"Console ATA control utility for Windows NT3.51/NT4/2000/XP/2003\n"
1705 "Version 0." UNIATA_VER_STR ", Copyright (c) Alexander A. Telyatnikov, 2003-2012\n"
1706 "Home site: http://alter.org.ua\n");
1711 if((
a =
argv[
i][0]) !=
'-') {
1741 while(
argv[
i] && (
a =
argv[
i][
j]) && (
a !=
' ') && (
a !=
'\t')) {
1756 persistent_hide = 1;
1765 persistent_hide = 1;
1851 if(power_mode && !
cmd) {
1911 if((d_dev == -1) && (b_dev != -1)) {
1916 if((d_dev != -1) && (b_dev != -1)) {
1917 dev_id = (b_dev << 16) | (d_dev << 8) | l_dev;
1932 ata_hide(bus_id, dev_id,
lock, persistent_hide, power_mode);
int strcmp(const char *String1, const char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
BOOLEAN ata_scan(int bus_id, int dev_id, int lock, int unhide)
void ata_mode_to_str(char *str, int mode)
CHAR * _fgets(CHAR *string, int count, HANDLE stream)
#define DEFAULT_REMOVAL_LOCK_TIMEOUT
int ata_check_controller(HANDLE h, PIO_SCSI_CAPABILITIES capabilities)
BOOLEAN ata_list(int bus_id, int dev_id)
BOOLEAN ata_power_mode(int bus_id, int dev_id, int power_mode)
BOOLEAN ata_hide(int bus_id, int dev_id, int lock, int persistent_hide, int power_mode)
int ata_send_ioctl(HANDLE h, PSCSI_ADDRESS addr, PCCH Signature, ULONG Ioctl, PVOID inBuffer, ULONG inBufferLength, PVOID outBuffer, ULONG outBufferLength, PULONG returned)
#define check_atamode_str(str, mode)
BOOLEAN ata_bblk(int bus_id, int dev_id, int list_bb)
BOOLEAN ata_reset(int bus_id, int dev_id)
ULONG EncodeVendorStr(OUT char *Buffer, IN PUCHAR Str, IN ULONG Length, IN ULONG Xorer)
int ata_send_scsi(HANDLE h, PSCSI_ADDRESS addr, PCDB cdb, UCHAR cdbLength, PVOID Buffer, ULONG BufferLength, BOOLEAN DataIn, PSENSE_DATA senseData, PULONG returned)
UCHAR g_inquiry_buffer[2048]
BOOLEAN ata_adapter_info(int bus_id, int print_info)
int ata_check_unit(HANDLE h, int dev_id)
PADAPTERINFO g_AdapterInfo
void ata_close_dev(HANDLE h)
HANDLE ata_open_dev(char *Name)
BOOLEAN ata_mode(int bus_id, int dev_id, int mode)
HKEY ata_get_bblist_regh(IN PIDENTIFY_DATA ident, OUT char *DevSerial, BOOLEAN read_only)
int ata_num_to_x_dev(char a)
HANDLE ata_open_file(char *Name, BOOLEAN create)
int ata_str_to_mode(char *str)
IO_SCSI_CAPABILITIES g_capabilities
struct _SENDCMDOUTPARAMS * PSENDCMDOUTPARAMS
struct _SENDCMDOUTPARAMS SENDCMDOUTPARAMS
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
#define RegCloseKey(hKey)
#define COMMUNICATION_DEVICE
struct _INQUIRYDATA * PINQUIRYDATA
#define WRITE_ONCE_READ_MULTIPLE_DEVICE
#define DIRECT_ACCESS_DEVICE
#define READ_ONLY_DIRECT_ACCESS_DEVICE
#define IOCTL_SCSI_MINIPORT_IDENTIFY
#define SEQUENTIAL_ACCESS_DEVICE
#define SCSIOP_START_STOP_UNIT
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
#define ReadFile(a, b, c, d, e)
#define FILE_ATTRIBUTE_NORMAL
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
static const WCHAR Signature[]
#define StartStop_Power_NoChg
#define StartStop_Power_Sleep
#define StartStop_Power_Idle
#define StartStop_Power_Standby
static unsigned char buff[32768]
_Must_inspect_result_ __in WDFIOTARGET __in_opt WDFREQUEST __in ULONG Ioctl
GLuint GLuint GLsizei count
GLsizei const GLvoid * pointer
GLboolean GLboolean GLboolean b
GLenum const GLvoid * addr
GLuint GLint GLboolean GLint GLenum access
GLboolean GLboolean GLboolean GLboolean a
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
struct _IDENTIFY_DATA * PIDENTIFY_DATA
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
#define memcpy(s1, s2, n)
#define sprintf(buf, format,...)
static const struct access_res create[16]
const char * dev_name(int device)
_In_ ULONG _In_ ULONG _In_ ULONG Length
static BOOL read_bytes(parse_buffer *buf, LPVOID data, DWORD size)
#define IOCTL_SCSI_PASS_THROUGH
#define IOCTL_SCSI_GET_CAPABILITIES
#define IOCTL_SCSI_MINIPORT
struct _SCSI_INQUIRY_DATA * PSCSI_INQUIRY_DATA
#define SCSI_IOCTL_DATA_IN
#define IOCTL_SCSI_RESCAN_BUS
struct _SRB_IO_CONTROL SRB_IO_CONTROL
#define IOCTL_SCSI_GET_INQUIRY_DATA
#define SCSI_IOCTL_DATA_OUT
struct _SCSI_PASS_THROUGH SCSI_PASS_THROUGH
struct _SCSI_ADAPTER_BUS_INFO * PSCSI_ADAPTER_BUS_INFO
#define offsetof(TYPE, MEMBER)
_Check_return_ _CRTIMP int __cdecl _memicmp(_In_reads_bytes_opt_(_Size) const void *_Buf1, _In_reads_bytes_opt_(_Size) const void *_Buf2, _In_ size_t _Size)
PFIXED_SENSE_DATA outBuffer
BOOLEAN ChanHeaderLengthValid
ULONG OrigAdapterInterfaceType
ULONG AdapterInterfaceType
ULONG WaitForPhysicalLink
USHORT FirmwareRevision[4]
UCHAR ProductRevisionLevel[4]
struct _PCI_SLOT_NUMBER::@4068::@4069 bits
union _PCI_SLOT_NUMBER::@4068 u
ULONG NextInquiryDataOffset
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
struct _ADAPTERINFO ADAPTERINFO
#define IOCTL_SCSI_MINIPORT_UNIATA_SET_MAX_MODE
#define UNIATA_REMOVE_FLAGS_HIDE
#define UNIATA_ADD_FLAGS_UNHIDE
#define IOCTL_SCSI_MINIPORT_UNIATA_DELETE_DEVICE
#define IOCTL_SCSI_MINIPORT_UNIATA_FIND_DEVICES
#define IOCTL_SCSI_MINIPORT_UNIATA_RESETBB
#define IOCTL_SCSI_MINIPORT_UNIATA_GET_MODE
struct _UNIATA_CTL * PUNIATA_CTL
#define IOCTL_SCSI_MINIPORT_UNIATA_RESET_DEVICE
#define UNIATA_COMM_PORT_VENDOR_STR
struct _CHANINFO * PCHANINFO
struct _SCSI_PASS_THROUGH_WITH_BUFFERS * PSCSI_PASS_THROUGH_WITH_BUFFERS
struct _ADAPTERINFO * PADAPTERINFO
#define IOCTL_SCSI_MINIPORT_UNIATA_ADAPTER_INFO
#define ATAPI_TYPE_DIRECT
__inline LONG ata_cur_mode_from_ident(PIDENTIFY_DATA ident, BOOLEAN Active)
#define IDENT_MODE_ACTIVE
#define ATAPI_TYPE_OPTICAL
struct _CDB::_START_STOP START_STOP
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
#define STD_OUTPUT_HANDLE
DWORD WINAPI GetLastError(void)
#define INVALID_FILE_SIZE
_In_ ULONG _In_ ULONG_PTR ident
#define HKEY_LOCAL_MACHINE
size_t const unsigned const radix