else
驱动小牛
驱动小牛
  • 注册日期2002-10-21
  • 最后登录2004-06-12
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:1348回复:0

9x下怎样用IOS_SendCommand直接读写物理磁盘?

楼主#
更多 发布于:2003-04-05 20:03
需要进行对物理磁盘的读写。

我模拟CIH的方法但是不行:
IOP        ioreq
PIOR ior = &ioreq->IOP_ior;
memset(&ioreq,0,2048);

ior->IOR_next           = 0;
ior->IOR_vol_designtr   = 0x80;
ior->IOR_func           = IOR_WRITE;
ior->IOR_flags          = IORF_VERSION_002|IORF_PHYS_CMD | IORF_HIGH_PRIORITY | IORF_SYNC_COMMAND;
ior->IOR_start_addr[0]  = 0;
ior->IOR_start_addr[1]  = 0;
ior->IOR_buffer_ptr   = 0xc0001000;
ior->IOR_xfer_count   = 1;

dprintf (\"Issue the IOS command\\n\");
IOS_SendCommand(ior, NULL);
但是没有任何反应

直接用下面的方法把CIH写磁盘的代码嵌入也不行:

_asm
{
push ebx
push ecx
push esi
push edi

xor ebx, ebx
mov bh, 80h
push ebx
sub esp, 2ch
push 0c0001000h
mov bh, 08h
push ebx
push ecx
push ecx
push ecx
push 40000501h
inc ecx
push ecx
push ecx

mov esi, esp
sub esp, 0ach
//VXDCall IOS_SendCommand
int 20h
//dd 00100004h ;
_emit 04h
_emit 00h
_emit 10h
_emit 00h

add esp,0ach
add esp,36
add esp,2ch

pop edi
pop esi
pop ecx
pop ebx
}
和上面的程序一样没有任何反应。

用System Programming for Windows 95 第16章的IOSCaller例子倒是可以对C:盘所在的物理磁盘进行读写,但是怎么怎么对第二块磁盘进行读写呢,如果第二块物理磁盘上面还没有进行分区和格式化怎么进行扇区级别的读写呢?


游客

返回顶部