I want to Create file B and copy all contents from file A to file B when a
request for writing file A,
so in IRP_MJ_WRITE , i create file B by ZwCreateFile() , and construct a
synchronous irp request by IoBuildSynchronousFsdRequest(IRP_MJ_READ) for
getting data from file A, and then write all these data to file B with
ZwWriteFile(); BUT the problems is the following :
(1)when file A is small (nearly 4kB) , it works very well(file B can be
created ,and all data can be copied from file A to file B, and new data can
be writed into file A);
(2)when file A is large (aroud 2MB) , file B can be created ,and all data
can be copied from file A to file B,BUT, new data CANNOT write into file A ,
the error message is “process cannot access the file because another process
has locked a portion of the file” .