hey guys,
im trying to open a file with absolute name using IoCreateFile and im
getting STATUS_FILE_LOCK_CONFLICT as return of the IOcreateFile.
The absolute path name is created as
InitializeObjectAttributes(
&PreparedObjectAttributes,
&UnicodeFullPathNameToOpen, // eg ??\Z:\a.txt
(OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE), NULL,NULL);
i call iocreatefile with following parameters
IoCreateFile(
&ReturnedHadle, /*Returned Handle*/
FILE_READ_ATTRIBUTES, /*DesiredAccess*/
&PreparedObjectAttributes,/*ObjectAttributes prepared above */
IoStatusBlock, /*status block*/
NULL, /*AllocationSize*/
0, /*FileAttributes = 0 coz im opening a existing file*/
FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /*ShareAccess*/
FILE_OPEN, /*Disposition*/
FILE_NON_DIRECTORY_FILE, /*CreateOptions*/
NULL, /*EaBuffer*/
0, /*EaLength*/
CreateFileTypeNone, /*CreateFileType*/
NULL, /*ExtraCreateParameters*/
IO_NO_PARAMETER_CHECKING);/*Options*/
Observation:
-
i see this only on WINDOWS SERVER 2003 Enterprise ONLY and im running this
on a DUAL processor.
-
if i understand correctly isn’t it true that i should expect this error,
either in read or write operation where byte range locks are checked. In
that case why am i recieving a LOCK_CONFLICT in IocreateFile???
-
Is it something to do with the dual processor? because when i run on a
uniprocessor machine i dont get this error.
any pointers abt what could be happening would be of greate help and highly
appreciated.
Thanks,
Vikramaditya.
“Life is not measured by the number of breaths we take, but by the moments
that take our breath away”
Every time I have seen this in a create call it is because I was calling
IoCreateFile or ZwCreateFile from within the file system thread even though
it was not in an open. For example, I needed to do something on rename and
tried to open the file, but got this error. My workaround was to create a
new thread, have it do the work, and wait on an event in the main thread.
The file system had some kind of lock acquired already even though it was a
completely different file.
Thanks,
Rob
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-177443-
xxxxx@lists.osr.com] On Behalf Of Vikramaditya Gupta
Sent: Monday, June 07, 2004 1:53 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] STATUS_FILE_LOCK_CONFLICT in IoCreateFile on DUAL
processor
hey guys,
im trying to open a file with absolute name using IoCreateFile and im
getting STATUS_FILE_LOCK_CONFLICT as return of the IOcreateFile.
The absolute path name is created as
InitializeObjectAttributes(
&PreparedObjectAttributes,
&UnicodeFullPathNameToOpen, // eg ??\Z:\a.txt
(OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE), NULL,NULL);
i call iocreatefile with following parameters
IoCreateFile(
&ReturnedHadle, /*Returned Handle*/
FILE_READ_ATTRIBUTES, /*DesiredAccess*/
&PreparedObjectAttributes,/*ObjectAttributes prepared above */
IoStatusBlock, /*status block*/
NULL, /*AllocationSize*/
0, /*FileAttributes = 0 coz im opening
a
existing file*/
FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /*ShareAccess*/
FILE_OPEN, /*Disposition*/
FILE_NON_DIRECTORY_FILE, /*CreateOptions*/
NULL, /*EaBuffer*/
0, /*EaLength*/
CreateFileTypeNone, /*CreateFileType*/
NULL, /*ExtraCreateParameters*/
IO_NO_PARAMETER_CHECKING);/*Options*/
Observation:
-
i see this only on WINDOWS SERVER 2003 Enterprise ONLY and im running
this
on a DUAL processor.
-
if i understand correctly isn’t it true that i should expect this error,
either in read or write operation where byte range locks are checked. In
that case why am i recieving a LOCK_CONFLICT in IocreateFile???
-
Is it something to do with the dual processor? because when i run on a
uniprocessor machine i dont get this error.
any pointers abt what could be happening would be of greate help and
highly
appreciated.
Thanks,
Vikramaditya.
“Life is not measured by the number of breaths we take, but by the moments
that take our breath away”
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: xxxxx@cdp.com
To unsubscribe send a blank email to xxxxx@lists.osr.com