mirror of
https://github.com/reactos/reactos.git
synced 2025-01-03 21:09:19 +00:00
[CDFS]
Rely on RTL when possible. Spotted by Thomas. svn path=/trunk/; revision=62799
This commit is contained in:
parent
4684054570
commit
ad56db3061
2 changed files with 5 additions and 9 deletions
|
@ -215,15 +215,14 @@ CdfsFindFile(PDEVICE_EXTENSION DeviceExt,
|
|||
{
|
||||
/* it's root : complete essentials fields then return ok */
|
||||
RtlZeroMemory(Fcb, sizeof(FCB));
|
||||
RtlInitEmptyUnicodeString(&Fcb->PathName, Fcb->PathNameBuffer, sizeof(Fcb->PathNameBuffer));
|
||||
|
||||
Fcb->PathNameBuffer[0] = '\\';
|
||||
Fcb->PathName.Length = sizeof(WCHAR);
|
||||
Fcb->ObjectName = &Fcb->PathNameBuffer[1];
|
||||
Fcb->Entry.ExtentLocationL = DeviceExt->CdInfo.RootStart;
|
||||
Fcb->Entry.DataLengthL = DeviceExt->CdInfo.RootSize;
|
||||
Fcb->Entry.FileFlags = 0x02; //FILE_ATTRIBUTE_DIRECTORY;
|
||||
Fcb->PathName.Length = sizeof(WCHAR);
|
||||
Fcb->PathName.MaximumLength = sizeof(Fcb->PathNameBuffer);
|
||||
Fcb->PathName.Buffer = Fcb->PathNameBuffer;
|
||||
|
||||
if (pDirIndex)
|
||||
*pDirIndex = 0;
|
||||
|
@ -308,9 +307,8 @@ CdfsFindFile(PDEVICE_EXTENSION DeviceExt,
|
|||
{
|
||||
if (Parent->PathName.Buffer[0])
|
||||
{
|
||||
RtlCopyUnicodeString(&Fcb->PathName, &Parent->PathName);
|
||||
len = Parent->PathName.Length / sizeof(WCHAR);
|
||||
memcpy(Fcb->PathName.Buffer, Parent->PathName.Buffer, Parent->PathName.Length);
|
||||
Fcb->PathName.Length = Parent->PathName.Length;
|
||||
Fcb->ObjectName=&Fcb->PathName.Buffer[len];
|
||||
if (len != 1 || Fcb->PathName.Buffer[0] != '\\')
|
||||
{
|
||||
|
@ -576,8 +574,7 @@ CdfsQueryDirectory(PDEVICE_OBJECT DeviceObject,
|
|||
DeviceExtension = DeviceObject->DeviceExtension;
|
||||
Stack = IoGetCurrentIrpStackLocation(Irp);
|
||||
FileObject = Stack->FileObject;
|
||||
TempFcb.PathName.Buffer = TempFcb.PathNameBuffer;
|
||||
TempFcb.PathName.MaximumLength = sizeof(TempFcb.PathNameBuffer);
|
||||
RtlInitEmptyUnicodeString(&TempFcb.PathName, TempFcb.PathNameBuffer, sizeof(TempFcb.PathNameBuffer));
|
||||
|
||||
Ccb = (PCCB)FileObject->FsContext2;
|
||||
Fcb = (PFCB)FileObject->FsContext;
|
||||
|
|
|
@ -73,8 +73,7 @@ CdfsCreateFCB(PCWSTR FileName)
|
|||
if(!Fcb) return NULL;
|
||||
|
||||
RtlZeroMemory(Fcb, sizeof(FCB));
|
||||
Fcb->PathName.Buffer = Fcb->PathNameBuffer;
|
||||
Fcb->PathName.MaximumLength = sizeof(Fcb->PathNameBuffer);
|
||||
RtlInitEmptyUnicodeString(&Fcb->PathName, Fcb->PathNameBuffer, sizeof(Fcb->PathNameBuffer));
|
||||
|
||||
if (FileName)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue