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.
NOTE: i see this only on WINDOWS SERVER 2003 Enterprise ONLY.
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 SHARE_CONFLICT in 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(
OUT PHANDLE FileHandle = Some poiter to HANDLE datatype,
IN ACCESS_MASK DesiredAccess = FILE_READ_ATTRIBUTES,
IN POBJECT_ATTRIBUTES ObjectAttributes = &PreparedObjectAttributes ,
//prepared above
OUT PIO_STATUS_BLOCK IoStatusBlock,
IN PLARGE_INTEGER AllocationSize = NULL,
IN ULONG FileAttributes = 0, //coz im opening a existing file
IN ULONG ShareAccess =
FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
IN ULONG Disposition = FILE_OPEN,
IN ULONG CreateOptions = FILE_NON_DIRECTORY_FILE,
IN PVOID EaBuffer = NULL,
IN ULONG EaLength = 0,
IN CREATE_FILE_TYPE CreateFileType = CreateFileTypeNone,
IN PVOID ExtraCreateParameters = NULL,
IN ULONG Options = IO_NO_PARAMETER_CHECKING
) ;
Regards,
Vikramaditya.
“Life is not measured by the number of breaths we take, but by the moments
that take our breath away”