LOCK and UNLOCK. Parameters

Hi,

Ref. –> I am Writing a File System Filter Driver for W2K. Here I have Added
my Header for Every File of My interest, Going For Creation. I have Taken
Care of File size and Offset in Most Of the Calls.
This is Working Fine with Some Editor Like WORDPAD

Problem. -> FastIO_LOCK operation get Repeated after Second Time application
opens the File. and then file get closed.
Which is not Normal Behavior. (WINWORD,EXCEL) (Memory Mapped file Not
Working Properly).

I need a guidance on following Topics.

  1. After Create Section Lock Operation is Comes in Picture. What are these
    Parameter in LOCK and UNLOCK.
    They are Some Big Numbers which I am not able to relate with my File size
    Data length.
  2. Is it a case I have to Increment and Decrement these Offset Parameter in
    Lock unlock, as I am doing in Read & Write
    ( Because of my Header Length).

Regards,
Utkarsh S. Dabhade

**************************************************
Disclaimer:

The contents of this E-mail (including the contents of the enclosure(s) or attachment(s) if any) are privileged and confidential material of MBT and should not be disclosed to, used by or copied in any manner by anyone other than the intended addressee(s). In case you are not the desired addressee, you should delete this message and/or re-direct it to the sender. The views expressed in this E-mail message (including the enclosure(s) or attachment(s) if any) are those of the individual sender, except where the sender expressly, and with authority, states them to be the views of MBT.

This e-mail message including attachment/(s), if any, is believed to be free of any virus. However, it is the responsibility of the recipient to ensure that it is virus free and MBT is not responsible for any loss or damage arising in any way from its use
**************************************************

You seem to assume that locking is only used to protect data within the
file; this is in fact NOT the case. Think of locking as being across
the addressable range of the file and if there is data it protects the
data.

For example, WORD shares access to the file but uses byte range locks on
non-existent regions in order to detect when the file is actually in use
(ever notice how Word seems to “know” when someone is already using the
file? That’s done by sharing access but using byte range locks.)

You might wish to limit your translation of addresses to values below
1EB or some very high limit like that (I suppose you could choose 1PB
but we’ll probably see people toying with files of that size within our
lifetimes). Then values above that limit are not adjusted (since the
other end of the size range - just below 16EB - seems to be the other
likely place to see huge address locks).

Please note this is only a suggestion; I haven’t actually DONE this
because I don’t believe that trying to adjust file sizes and offsets in
implementing data modification filters is really viable.

I hope this helps.

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Utkarsh DABHADE
Sent: Monday, June 06, 2005 9:30 AM
To: ntfsd redirect
Subject: [ntfsd] LOCK and UNLOCK. Parameters

Hi,

Ref. –> I am Writing a File System Filter Driver for W2K. Here I have
Added
my Header for Every File of My interest, Going For Creation. I have
Taken
Care of File size and Offset in Most Of the Calls.
This is Working Fine with Some Editor Like WORDPAD

Problem. -> FastIO_LOCK operation get Repeated after Second Time
application
opens the File. and then file get closed.
Which is not Normal Behavior. (WINWORD,EXCEL) (Memory Mapped file Not
Working Properly).

I need a guidance on following Topics.

  1. After Create Section Lock Operation is Comes in Picture. What are
    these
    Parameter in LOCK and UNLOCK.
    They are Some Big Numbers which I am not able to relate with my File
    size
    Data length.
  2. Is it a case I have to Increment and Decrement these Offset Parameter
    in
    Lock unlock, as I am doing in Read & Write
    ( Because of my Header Length).

Regards,
Utkarsh S. Dabhade

**************************************************
Disclaimer:

The contents of this E-mail (including the contents of the enclosure(s)
or attachment(s) if any) are privileged and confidential material of MBT
and should not be disclosed to, used by or copied in any manner by
anyone other than the intended addressee(s). In case you are not the
desired addressee, you should delete this message and/or re-direct it to
the sender. The views expressed in this E-mail message (including the
enclosure(s) or attachment(s) if any) are those of the individual
sender, except where the sender expressly, and with authority, states
them to be the views of MBT.

This e-mail message including attachment/(s), if any, is believed to be
free of any virus. However, it is the responsibility of the recipient to
ensure that it is virus free and MBT is not responsible for any loss or
damage arising in any way from its use

**************************************************


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com