-NtfsOpenFile() - Replace an ExFreePool() with ExFreePoolWithTag().
-NtfsCreateFile() - Fix broken cast with BooleanFlagOn() macro.
-NtfsAddFilenameToDirectory() - Remove an extra cast. Return an error if we fail to allocate I30IndexRoot.
-NtfsGetNextPathElement(), NtfsWSubString(), NtfsGetFCBForFile() - Use PCWSTR in place of const PWCHAR or PWCHAR where it makes sense.
svn path=/branches/GSoC_2016/NTFS/; revision=75281
DPRINT("Could not make a new FCB, status: %x\n", Status);
if (AbsFileName)
- ExFreePool(AbsFileName);
+ ExFreePoolWithTag(AbsFileName, TAG_NTFS);
return Status;
}
// Create the file record on disk
Status = NtfsCreateFileRecord(DeviceExt,
FileObject,
- (Stack->Flags & SL_CASE_SENSITIVE),
+ BooleanFlagOn(Stack->Flags, SL_CASE_SENSITIVE),
BooleanFlagOn(IrpContext->Flags,IRPCONTEXT_CANWAIT));
if (!NT_SUCCESS(Status))
{
// Allocate memory for the index root data
I30IndexRootLength = AttributeDataLength(&IndexRootContext->Record);
- I30IndexRoot = (PINDEX_ROOT_ATTRIBUTE)ExAllocatePoolWithTag(NonPagedPool, I30IndexRootLength, TAG_NTFS);
+ I30IndexRoot = ExAllocatePoolWithTag(NonPagedPool, I30IndexRootLength, TAG_NTFS);
if (!I30IndexRoot)
{
DPRINT1("ERROR: Couldn't allocate memory for index root attribute!\n");
ReleaseAttributeContext(IndexRootContext);
ExFreePoolWithTag(ParentFileRecord, TAG_NTFS);
+ return STATUS_INSUFFICIENT_RESOURCES;
}
// Read the Index Root
/* FUNCTIONS ****************************************************************/
static
-PWCHAR
-NtfsGetNextPathElement(PWCHAR FileName)
+PCWSTR
+NtfsGetNextPathElement(PCWSTR FileName)
{
if (*FileName == L'\0')
{
static
VOID
NtfsWSubString(PWCHAR pTarget,
- const PWCHAR pSource,
+ PCWSTR pSource,
size_t pLength)
{
wcsncpy(pTarget, pSource, pLength);
NtfsGetFCBForFile(PNTFS_VCB Vcb,
PNTFS_FCB *pParentFCB,
PNTFS_FCB *pFCB,
- const PWSTR pFileName,
+ PCWSTR pFileName,
BOOLEAN CaseSensitive)
{
NTSTATUS Status;
WCHAR pathName [MAX_PATH];
WCHAR elementName [MAX_PATH];
- PWCHAR currentElement;
+ PCWSTR currentElement;
PNTFS_FCB FCB;
PNTFS_FCB parentFCB;
NtfsGetFCBForFile(PNTFS_VCB Vcb,
PNTFS_FCB *pParentFCB,
PNTFS_FCB *pFCB,
- const PWSTR pFileName,
+ PCWSTR pFileName,
BOOLEAN CaseSensitive);
NTSTATUS