阅读:2338回复:8
怎样加密读和写的数据?
在处理IRP_MJ_READ时进行解密,在处理IRP_MJ_WRITE时进行加密
因该怎么做? IRP_MJ_READ读数据时数据存在那个里面? Irp->AssociatedIrp.SystemBuffer Irp->MdlAddress Irp->UserBuffer 这3个地址我都试过,但是还是不行。 IRP_MJ_WRITE写数据时数据又是存在那个Buffer里面呢? |
|
最新喜欢:hnfudy |
沙发#
发布于:2003-02-28 15:05
如果是MDL方式,则需要用MmGetSystemAddressForMdl(Irp->MdlAddress)函数得到读缓冲的地址。
|
|
板凳#
发布于:2003-02-28 16:38
先好好看一下以前的贴子。
只要加解密NOCACHE IRP就可以,其它IRP不要管它。 |
|
地板#
发布于:2003-02-28 17:04
谢谢,我只处理IRP_MJ_READ和IRP_MJ_WRITE
但是它们的数据放在那里了呢? DDK上是这样写的: IRP_MJ_READ: Irp->MdlAddress Address of a memory descriptor list (MDL) describing the pages containing the data to be read. Irp->UserBuffer Pointer to a caller-supplied output buffer that receives the data that is read from the file. 到底那个是接受数据的缓冲区呢? IRP_MJ_WRITE: Irp->MdlAddress Address of a memory descriptor list (MDL) describing the pages to which the data is to be written. 我用这个好像不行,我换用 Irp->UserBuffer这个倒是行了 |
|
地下室#
发布于:2003-02-28 17:14
里面有3个缓冲区
Irp->MdlAddress Irp->AssociatedIrp.SystemBuffer Irp->UserBuffer 我现在就是不知道该用那个。 我一调用MmGetSystemAddressForMdlSafe(Irp->MdlAddress, NormalPagePriority)就产生异常 |
|
5楼#
发布于:2003-02-28 17:52
读和写的时候我都用的IRP->UserBuffer的时候就正常了,请问这是为什么?
|
|
6楼#
发布于:2003-03-02 11:20
你还不明白我的意思。
在IRP_MJ_READ中,有相当多这种IRP,但你只要判断这IRP是不是nocach IRP: if(Irp->Flags & IRP_NOCACHE) 是的话, 检查Irp->MdlAddress != NULL; 此时才加密。 其它IRP全放过passThrough. Irp->AssociatedIrp.SystemBuffer Irp->UserBuffer ------------ 以上两个,几呼还没遇到过。 |
|
7楼#
发布于:2003-03-02 11:21
说错了,是解密。
|
|
8楼#
发布于:2003-03-04 09:42
同意VcMfc的见解。
|
|