* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id$
- *
+/*
* PROJECT: ReactOS kernel
* FILE: drivers/fs/vfat/create.c
* PURPOSE: VFAT Filesystem
USHORT Length;
CHAR cString[12];
- RtlCopyMemory(cString, pEntry->Filename, 11);
+ RtlCopyMemory(cString, pEntry->ShortName, 11);
cString[11] = 0;
if (cString[0] == 0x05)
{
vfatReleaseFCB (DeviceExt, ParentFcb);
if (NT_SUCCESS (Status))
{
- vfatAttachFCBToFileObject (DeviceExt, pFcb, FileObject);
+ Status = vfatAttachFCBToFileObject (DeviceExt, pFcb, FileObject);
+ if ( !NT_SUCCESS(Status) )
+ {
+ vfatReleaseFCB (DeviceExt, pFcb);
+ return Status;
+ }
Irp->IoStatus.Information = FILE_CREATED;
pFcb = FileObject->FsContext;
- if (pFcb->OpenHandleCount != 0)
+ if (pFcb->OpenHandleCount != 0 &&
+ !(*pFcb->Attributes & FILE_ATTRIBUTE_DIRECTORY))
{
Status = IoCheckShareAccess(Stack->Parameters.Create.SecurityContext->DesiredAccess,
Stack->Parameters.Create.ShareAccess,
/* Supersede the file */
if (RequestedDisposition == FILE_SUPERSEDE)
{
- LARGE_INTEGER AllocationSize;
- AllocationSize.QuadPart = 0LL;
+ AllocationSize.QuadPart = 0;
VfatSetAllocationSizeInformation(FileObject, pFcb, DeviceExt, &AllocationSize);
Irp->IoStatus.Information = FILE_SUPERSEDED;
}
}
}
- if (pFcb->OpenHandleCount == 0)
+ if (pFcb->OpenHandleCount == 0 &&
+ !(*pFcb->Attributes & FILE_ATTRIBUTE_DIRECTORY))
{
IoSetShareAccess(Stack->Parameters.Create.SecurityContext->DesiredAccess,
Stack->Parameters.Create.ShareAccess,