Hi Guys,
I’m working on the same task as you
are doing now. Now I have an advanced question
about the file header problem.
I wanna add a header to a txt file.
and implement the code to skip head.
but. I found when I open the txt file with
the UltraEdit. The header will lost.
I have found the reason. Because of the
the UltraEdit use RenameFile to make a backup
file. and recreate a new file for the original
file name. So the header lost. I hope to know
who has some good idea for the problem.
(I don’t think it is a good choice to deny the
file to rename.)
Any Q&A about the file header are appreciate.
Best Regards
Jansen Zhu.
Marik Miloslav дµÀ£º
>Hi Rob,
>my experience is that file header skiping alorithm working under WNT 4.0
>works under W2k too. But this algorithm doesn’t comprise only from some file
>offset and file length manipulation, it requires break up file object abov
>and below your filter (here must be two file obects - one represents file
>with header, one the same file without header). A file header stored at the
>begining of the file requires also special handling of PAGING I/O (if your
>file header is not page size long) .
>
>Majority of developers prefer to store file header (meta data) at the end of
>the file, but storing meta data at the begining of a the file is more funny.
>
>Best regards,
>
>mari
>
>
>-----Original Message-----
>From: Rob Linegar [mailto:xxxxx@des.co.uk]
>Sent: Monday, August 21, 2000 1:49 PM
>To: File Systems Developers
>Subject: [ntfsd] Problem skipping a header during reads under Windows 2000.
>
>
>Hi All,
>
>I’ve just encountered a problem with my fs filter which it seems only occurs
>under Windows 2000.
>We have a file with a header, currently this header is 41 bytes in size. The
>data after the 41 bytes is a copy of notepad.exe from Windows 98.
>
>When we receive an IRP_MJ_READ for the file that has the header we add the
>41 bytes offset to nextIrpStack->Parameters.Read.ByteOffset.QuadPart and set
>up
>a completion routine.
>
>The completion routine copies
>currentIrpStack->Parameters.Read.ByteOffset.QuadPart over
>currentIrpStack->FileObject->CurrentByteOffset.QuadPart then
>checks pIrp->IoStatus.Status. If successful
>currentIrpStack->FileObject->CurrentByteOffset.QuadPart is then increased by
>the amount read (pIrp->IoStatus.Information).
>
>We are trying to call CreateProcess to run the executable after the header,
>but even copying the file within explorer exhibits this problem.
>
>Under Windows NT 4 (sp6) this method “works perfectly” ™(c) etc.
>
>Under Windows 2000 something odd is happening…
>
>At pBuffer[