ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
January 2012
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
19 participants
559 discussions
Start a n
N
ew thread
[pschweitzer] 54807: [KERNEL32] Esthetical fixes.
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Mon Jan 2 10:02:50 2012 New Revision: 54807 URL:
http://svn.reactos.org/svn/reactos?rev=54807&view=rev
Log: [KERNEL32] Esthetical fixes. Modified: trunk/reactos/dll/win32/kernel32/client/file/dir.c Modified: trunk/reactos/dll/win32/kernel32/client/file/dir.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/dir.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/dir.c [iso-8859-1] Mon Jan 2 10:02:50 2012 @@ -150,7 +150,7 @@ if (Length == 0) { RtlReleaseRelativeName(&RelativeName); - RtlFreeHeap(GetProcessHeap(), 0, NtPathU.Buffer); + RtlFreeHeap(RtlGetProcessHeap(), 0, NtPathU.Buffer); SetLastError(ERROR_FILENAME_EXCED_RANGE); return FALSE; } @@ -201,7 +201,7 @@ 0); RtlReleaseRelativeName(&RelativeName); - RtlFreeHeap(GetProcessHeap(), 0, PathUBuffer); + RtlFreeHeap(RtlGetProcessHeap(), 0, PathUBuffer); if (NT_SUCCESS(Status)) { @@ -229,15 +229,16 @@ { DWORD Length; NTSTATUS Status; - ULONG EaLength = 0; PVOID EaBuffer = NULL; BOOL ReparsePoint = FALSE; IO_STATUS_BLOCK IoStatusBlock; FILE_EA_INFORMATION FileEaInfo; + ULONG EaLength = 0, StreamSize; OBJECT_ATTRIBUTES ObjectAttributes; FILE_BASIC_INFORMATION FileBasicInfo; PREPARSE_DATA_BUFFER ReparseDataBuffer; HANDLE TemplateHandle, DirectoryHandle; + PFILE_STREAM_INFORMATION FileStreamInfo; FILE_ATTRIBUTE_TAG_INFORMATION FileTagInfo; UNICODE_STRING NtPathU, NtTemplatePathU, NewDirectory; RTL_RELATIVE_NAME_U RelativeName, TemplateRelativeName; @@ -283,7 +284,7 @@ if (Status != STATUS_INVALID_PARAMETER) { RtlReleaseRelativeName(&TemplateRelativeName); - RtlFreeHeap(GetProcessHeap(), 0, TemplateBuffer); + RtlFreeHeap(RtlGetProcessHeap(), 0, TemplateBuffer); BaseSetLastNTError(Status); return FALSE; } @@ -300,7 +301,7 @@ if (!NT_SUCCESS(Status)) { RtlReleaseRelativeName(&TemplateRelativeName); - RtlFreeHeap(GetProcessHeap(), 0, TemplateBuffer); + RtlFreeHeap(RtlGetProcessHeap(), 0, TemplateBuffer); BaseSetLastNTError(Status); return FALSE; } @@ -315,7 +316,7 @@ if (!NT_SUCCESS(Status)) { RtlReleaseRelativeName(&TemplateRelativeName); - RtlFreeHeap(GetProcessHeap(), 0, TemplateBuffer); + RtlFreeHeap(RtlGetProcessHeap(), 0, TemplateBuffer); CloseHandle(TemplateHandle); BaseSetLastNTError(Status); return FALSE; @@ -334,7 +335,7 @@ if (!NT_SUCCESS(Status)) { RtlReleaseRelativeName(&TemplateRelativeName); - RtlFreeHeap(GetProcessHeap(), 0, TemplateBuffer); + RtlFreeHeap(RtlGetProcessHeap(), 0, TemplateBuffer); CloseHandle(TemplateHandle); BaseSetLastNTError(Status); return FALSE; @@ -352,7 +353,7 @@ if (!NT_SUCCESS(Status)) { RtlReleaseRelativeName(&TemplateRelativeName); - RtlFreeHeap(GetProcessHeap(), 0, TemplateBuffer); + RtlFreeHeap(RtlGetProcessHeap(), 0, TemplateBuffer); CloseHandle(TemplateHandle); BaseSetLastNTError(Status); return FALSE; @@ -374,7 +375,7 @@ if (!RtlDosPathNameToRelativeNtPathName_U(lpNewDirectory, &NtPathU, NULL, &RelativeName)) { RtlReleaseRelativeName(&TemplateRelativeName); - RtlFreeHeap(GetProcessHeap(), 0, TemplateBuffer); + RtlFreeHeap(RtlGetProcessHeap(), 0, TemplateBuffer); NtClose(TemplateHandle); SetLastError(ERROR_PATH_NOT_FOUND); return FALSE; @@ -390,15 +391,15 @@ { RtlReleaseRelativeName(&RelativeName); RtlReleaseRelativeName(&TemplateRelativeName); - RtlFreeHeap(GetProcessHeap(), 0, TemplateBuffer); - RtlFreeHeap(GetProcessHeap(), 0, PathUBuffer); + RtlFreeHeap(RtlGetProcessHeap(), 0, TemplateBuffer); + RtlFreeHeap(RtlGetProcessHeap(), 0, PathUBuffer); NtClose(TemplateHandle); SetLastError(ERROR_INVALID_NAME); return FALSE; } RtlReleaseRelativeName(&TemplateRelativeName); - RtlFreeHeap(GetProcessHeap(), 0, TemplateBuffer); + RtlFreeHeap(RtlGetProcessHeap(), 0, TemplateBuffer); /* Check if path length is < MAX_PATH (with space for file name). * If not, prefix is required. @@ -411,7 +412,7 @@ if (Length == 0) { RtlReleaseRelativeName(&RelativeName); - RtlFreeHeap(GetProcessHeap(), 0, PathUBuffer); + RtlFreeHeap(RtlGetProcessHeap(), 0, PathUBuffer); CloseHandle(TemplateHandle); SetLastError(ERROR_FILENAME_EXCED_RANGE); return FALSE; @@ -423,7 +424,7 @@ if (Length > MAX_PATH) { RtlReleaseRelativeName(&RelativeName); - RtlFreeHeap(GetProcessHeap(), 0, PathUBuffer); + RtlFreeHeap(RtlGetProcessHeap(), 0, PathUBuffer); CloseHandle(TemplateHandle); SetLastError(ERROR_FILENAME_EXCED_RANGE); return FALSE; @@ -451,7 +452,7 @@ if (!NT_SUCCESS(Status)) { RtlReleaseRelativeName(&RelativeName); - RtlFreeHeap(GetProcessHeap(), 0, PathUBuffer); + RtlFreeHeap(RtlGetProcessHeap(), 0, PathUBuffer); CloseHandle(TemplateHandle); BaseSetLastNTError(Status); return FALSE; @@ -467,7 +468,7 @@ if (!EaBuffer) { RtlReleaseRelativeName(&RelativeName); - RtlFreeHeap(GetProcessHeap(), 0, PathUBuffer); + RtlFreeHeap(RtlGetProcessHeap(), 0, PathUBuffer); CloseHandle(TemplateHandle); BaseSetLastNTError(STATUS_NO_MEMORY); return FALSE; @@ -485,7 +486,7 @@ TRUE); if (!NT_SUCCESS(Status)) { - RtlFreeHeap(GetProcessHeap(), 0, EaBuffer); + RtlFreeHeap(RtlGetProcessHeap(), 0, EaBuffer); IoStatusBlock.Information = 0; } @@ -548,10 +549,10 @@ else { RtlReleaseRelativeName(&RelativeName); - RtlFreeHeap(GetProcessHeap(), 0, PathUBuffer); + RtlFreeHeap(RtlGetProcessHeap(), 0, PathUBuffer); if (EaBuffer) { - RtlFreeHeap(GetProcessHeap(), 0, EaBuffer); + RtlFreeHeap(RtlGetProcessHeap(), 0, EaBuffer); } CloseHandle(TemplateHandle); BaseSetLastNTError(Status); @@ -561,7 +562,7 @@ } RtlReleaseRelativeName(&RelativeName); - RtlFreeHeap(GetProcessHeap(), 0, PathUBuffer); + RtlFreeHeap(RtlGetProcessHeap(), 0, PathUBuffer); if (EaBuffer) { RtlFreeHeap(RtlGetProcessHeap(), 0, EaBuffer); @@ -683,12 +684,10 @@ /* In case it's not a reparse point, handle streams on the file */ else { - PVOID StreamInfo; - ULONG StreamSize = 0x1000; - for (;;) - { - StreamInfo = RtlAllocateHeap(RtlGetProcessHeap(), 0, StreamSize); - if (!StreamInfo) + for (StreamSize = 0x1000; ; StreamSize = StreamSize * 2) + { + FileStreamInfo = RtlAllocateHeap(RtlGetProcessHeap(), 0, StreamSize); + if (!FileStreamInfo) { BaseMarkFileForDelete(DirectoryHandle, FileBasicInfo.FileAttributes); SetLastError(STATUS_NO_MEMORY); @@ -698,15 +697,16 @@ /* Query stream information */ Status = NtQueryInformationFile(TemplateHandle, &IoStatusBlock, - StreamInfo, + FileStreamInfo, StreamSize, FileStreamInformation); - if (!NT_SUCCESS(Status)) - { - RtlFreeHeap(RtlGetProcessHeap(), 0, StreamInfo); - StreamInfo = NULL; - StreamSize << 1; - } + if (NT_SUCCESS(Status)) + { + break; + } + + RtlFreeHeap(RtlGetProcessHeap(), 0, FileStreamInfo); + FileStreamInfo = NULL; /* If it failed, ensure that's not because of too small buffer */ if (Status != STATUS_BUFFER_OVERFLOW && @@ -718,9 +718,9 @@ if (!NT_SUCCESS(Status) || IoStatusBlock.Information == 0) { - if (StreamInfo) - { - RtlFreeHeap(RtlGetProcessHeap(), 0, StreamInfo); + if (FileStreamInfo) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, FileStreamInfo); } NtClose(TemplateHandle); @@ -731,7 +731,7 @@ #if 1 /* FIXME: TODO */ DPRINT1("Warning: streams copying is unimplemented!\n"); - RtlFreeHeap(RtlGetProcessHeap(), 0, StreamInfo); + RtlFreeHeap(RtlGetProcessHeap(), 0, FileStreamInfo); NtClose(TemplateHandle); NtClose(DirectoryHandle); #endif @@ -980,7 +980,7 @@ if (!NT_SUCCESS(Status)) { - BaseSetLastNTError (Status); + BaseSetLastNTError(Status); return FALSE; }
12 years, 11 months
1
0
0
0
[janderwald] 54806: [USB-BRINGUP] - Fake status success for unimplemented IRP_MN_REMOVE_DEVICE - Fix tons of bugs in the read report completion routine - Implement function to re-use a complete rep...
by janderwald@svn.reactos.org
Author: janderwald Date: Sun Jan 1 22:48:08 2012 New Revision: 54806 URL:
http://svn.reactos.org/svn/reactos?rev=54806&view=rev
Log: [USB-BRINGUP] - Fake status success for unimplemented IRP_MN_REMOVE_DEVICE - Fix tons of bugs in the read report completion routine - Implement function to re-use a complete report irp - Use correct device object when invoking the mini driver's dispatch routine in the read function - silence a few traces - Mouse now works with with ReactOS USB stack + ReactOS HID stack (TBD: implement hidparse.sys) Modified: branches/usb-bringup/drivers/hid/hidclass/hidclass.c branches/usb-bringup/drivers/hid/hidclass/pdo.c branches/usb-bringup/drivers/hid/hidclass/precomp.h branches/usb-bringup/drivers/hid/hidusb/hidusb.c branches/usb-bringup/drivers/hid/hidusb/hidusb.h branches/usb-bringup/drivers/hid/mouhid/mouhid.c Modified: branches/usb-bringup/drivers/hid/hidclass/hidclass.c URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/hid/hidclas…
============================================================================== --- branches/usb-bringup/drivers/hid/hidclass/hidclass.c [iso-8859-1] (original) +++ branches/usb-bringup/drivers/hid/hidclass/hidclass.c [iso-8859-1] Sun Jan 1 22:48:08 2012 @@ -140,7 +140,6 @@ // // only supported for PDO // - DPRINT1("[HIDCLASS] IRP_MJ_CREATE for FDO\n"); Irp->IoStatus.Status = STATUS_UNSUCCESSFUL; IoCompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_UNSUCCESSFUL; @@ -269,6 +268,31 @@ return STATUS_SUCCESS; } +PVOID +HidClass_GetSystemAddress( + IN PMDL ReportMDL) +{ + // + // sanity check + // + ASSERT(ReportMDL); + + if (ReportMDL->MdlFlags & (MDL_SOURCE_IS_NONPAGED_POOL | MDL_MAPPED_TO_SYSTEM_VA)) + { + // + // buffer is non paged pool + // + return ReportMDL->MappedSystemVa; + } + else + { + // + // map mdl + // + return MmMapLockedPages(ReportMDL, KernelMode); + } +} + NTSTATUS NTAPI HidClass_ReadCompleteIrp( @@ -278,19 +302,23 @@ { PHIDCLASS_IRP_CONTEXT IrpContext; KIRQL OldLevel; + PUCHAR Address; + ULONG Offset; + PHIDP_DEVICE_DESC DeviceDescription; + ULONG CollectionIndex; // // get irp context // IrpContext = (PHIDCLASS_IRP_CONTEXT)Ctx; - DPRINT1("HidClass_ReadCompleteIrp Irql %lu\n", KeGetCurrentIrql()); - DPRINT1("HidClass_ReadCompleteIrp Status %lx\n", Irp->IoStatus.Status); - DPRINT1("HidClass_ReadCompleteIrp Length %lu\n", Irp->IoStatus.Information); - DPRINT1("HidClass_ReadCompleteIrp Irp %p\n", Irp); - DPRINT1("HidClass_ReadCompleteIrp InputReportBuffer %p\n", IrpContext->InputReportBuffer); - DPRINT1("HidClass_ReadCompleteIrp InputReportBufferLength %li\n", IrpContext->InputReportBufferLength); - DPRINT1("HidClass_ReadCompleteIrp OriginalIrp %p\n", IrpContext->OriginalIrp); + DPRINT("HidClass_ReadCompleteIrp Irql %lu\n", KeGetCurrentIrql()); + DPRINT("HidClass_ReadCompleteIrp Status %lx\n", Irp->IoStatus.Status); + DPRINT("HidClass_ReadCompleteIrp Length %lu\n", Irp->IoStatus.Information); + DPRINT("HidClass_ReadCompleteIrp Irp %p\n", Irp); + DPRINT("HidClass_ReadCompleteIrp InputReportBuffer %p\n", IrpContext->InputReportBuffer); + DPRINT("HidClass_ReadCompleteIrp InputReportBufferLength %li\n", IrpContext->InputReportBufferLength); + DPRINT("HidClass_ReadCompleteIrp OriginalIrp %p\n", IrpContext->OriginalIrp); // // copy result @@ -298,9 +326,28 @@ if (Irp->IoStatus.Information) { // - // copy result - // - RtlCopyMemory(IrpContext->OriginalIrp->UserBuffer, IrpContext->InputReportBuffer, IrpContext->InputReportBufferLength); + // get address + // + Address = HidClass_GetSystemAddress(IrpContext->OriginalIrp->MdlAddress); + if (Address) + { + // + // reports may have a report id prepended + // + CollectionIndex = IrpContext->FileOp->DeviceExtension->CollectionIndex; + DeviceDescription = &IrpContext->FileOp->DeviceExtension->Common.DeviceDescription; + + // + // calculate offset + // + ASSERT(DeviceDescription->CollectionDesc[CollectionIndex].InputLength >= DeviceDescription->ReportIDs[CollectionIndex].InputLength); + Offset = DeviceDescription->CollectionDesc[CollectionIndex].InputLength - DeviceDescription->ReportIDs[CollectionIndex].InputLength; + + // + // copy result + // + RtlCopyMemory(&Address[Offset], IrpContext->InputReportBuffer, IrpContext->InputReportBufferLength); + } } // @@ -315,34 +362,79 @@ ExFreePool(IrpContext->InputReportBuffer); // + // remove us from pending list + // + KeAcquireSpinLock(&IrpContext->FileOp->Lock, &OldLevel); + + // + // remove from pending list + // + RemoveEntryList(&Irp->Tail.Overlay.ListEntry); + + // + // insert into completed list + // + InsertTailList(&IrpContext->FileOp->IrpCompletedListHead, &Irp->Tail.Overlay.ListEntry); + + // + // release lock + // + KeReleaseSpinLock(&IrpContext->FileOp->Lock, OldLevel); + + // // complete original request // IoCompleteRequest(IrpContext->OriginalIrp, IO_NO_INCREMENT); // - // remove us from pending list - // - KeAcquireSpinLock(&IrpContext->FileOp->Lock, &OldLevel); - - // - // remove from pending list - // - RemoveEntryList(&Irp->Tail.Overlay.ListEntry); + // free irp context + // + ExFreePool(IrpContext); + + // + // done + // + return STATUS_MORE_PROCESSING_REQUIRED; +} + +PIRP +HidClass_GetIrp( + IN PHIDCLASS_FILEOP_CONTEXT Context) +{ + KIRQL OldLevel; + PIRP Irp = NULL; + PLIST_ENTRY ListEntry; + + // + // acquire lock + // + KeAcquireSpinLock(&Context->Lock, &OldLevel); + + // + // is list empty? + // + if (!IsListEmpty(&Context->IrpCompletedListHead)) + { + // + // grab first entry + // + ListEntry = RemoveHeadList(&Context->IrpCompletedListHead); + + // + // get irp + // + Irp = (PIRP)CONTAINING_RECORD(ListEntry, IRP, Tail.Overlay.ListEntry); + } // // release lock // - KeReleaseSpinLock(&IrpContext->FileOp->Lock, OldLevel); - - // - // free irp context - // - ExFreePool(IrpContext); + KeReleaseSpinLock(&Context->Lock, OldLevel); // // done // - return STATUS_SUCCESS; + return Irp; } NTSTATUS @@ -358,17 +450,32 @@ PIRP Irp; PIO_STACK_LOCATION IoStack; PHIDCLASS_IRP_CONTEXT IrpContext; - - // - // build new irp - // - Irp = IoAllocateIrp(DeviceObject->StackSize, FALSE); + PHIDCLASS_PDO_DEVICE_EXTENSION PDODeviceExtension; + + // + // get an irp from fresh list + // + Irp = HidClass_GetIrp(Context); if (!Irp) { // - // no memory - // - return STATUS_INSUFFICIENT_RESOURCES; + // build new irp + // + Irp = IoAllocateIrp(DeviceObject->StackSize, FALSE); + if (!Irp) + { + // + // no memory + // + return STATUS_INSUFFICIENT_RESOURCES; + } + } + else + { + // + // re-use irp + // + IoReuseIrp(Irp, STATUS_SUCCESS); } // @@ -385,17 +492,31 @@ } // + // get device extension + // + PDODeviceExtension = (PHIDCLASS_PDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + ASSERT(PDODeviceExtension->Common.IsFDO == FALSE); + + // + // sanity checks + // + ASSERT(PDODeviceExtension->CollectionIndex < PDODeviceExtension->Common.DeviceDescription.CollectionDescLength); + ASSERT(PDODeviceExtension->CollectionIndex < PDODeviceExtension->Common.DeviceDescription.ReportIDsLength); + ASSERT(PDODeviceExtension->Common.DeviceDescription.ReportIDs[PDODeviceExtension->CollectionIndex].InputLength > 0); + ASSERT(PDODeviceExtension->Common.DeviceDescription.CollectionDesc[PDODeviceExtension->CollectionIndex].InputLength == BufferLength); + + // // init irp context // RtlZeroMemory(IrpContext, sizeof(HIDCLASS_IRP_CONTEXT)); - IrpContext->InputReportBufferLength = BufferLength; + IrpContext->InputReportBufferLength = PDODeviceExtension->Common.DeviceDescription.ReportIDs[PDODeviceExtension->CollectionIndex].InputLength; IrpContext->OriginalIrp = RequestIrp; IrpContext->FileOp = Context; // // allocate buffer // - IrpContext->InputReportBuffer = ExAllocatePool(NonPagedPool, BufferLength); + IrpContext->InputReportBuffer = ExAllocatePool(NonPagedPool, IrpContext->InputReportBufferLength); if (!IrpContext->InputReportBuffer) { // @@ -428,8 +549,6 @@ *OutIrp = Irp; *OutIrpContext = IrpContext; - DPRINT1("IRP %p Buffer %p\n", Irp, Irp->UserBuffer); - // // done // @@ -449,11 +568,18 @@ NTSTATUS Status; PIRP NewIrp; PHIDCLASS_IRP_CONTEXT NewIrpContext; + PHIDCLASS_COMMON_DEVICE_EXTENSION CommonDeviceExtension; // // get current stack location // IoStack = IoGetCurrentIrpStackLocation(Irp); + + // + // get device extension + // + CommonDeviceExtension = (PHIDCLASS_COMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + ASSERT(CommonDeviceExtension->IsFDO == FALSE); // // sanity check @@ -472,12 +598,10 @@ // ASSERT(Context->DeviceExtension->Common.DriverExtension->DevicesArePolled == FALSE); - DPRINT1("[HIDCLASS] IRP_MJ_READ\n"); - // // build irp request // - Status = HidClass_BuildIrp(DeviceObject, Irp, Context, IOCTL_HID_READ_REPORT, IoStack->Parameters.DeviceIoControl.OutputBufferLength, &NewIrp, &NewIrpContext); + Status = HidClass_BuildIrp(DeviceObject, Irp, Context, IOCTL_HID_READ_REPORT, IoStack->Parameters.Read.Length, &NewIrp, &NewIrpContext); if (!NT_SUCCESS(Status)) { // @@ -523,12 +647,12 @@ // lets dispatch the request // ASSERT(Context->DeviceExtension); - Status = Context->DeviceExtension->Common.DriverExtension->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL](DeviceObject, NewIrp); + Status = Context->DeviceExtension->Common.DriverExtension->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL](Context->DeviceExtension->FDODeviceObject, NewIrp); // // complete // - return Status; + return STATUS_PENDING; } NTSTATUS @@ -655,6 +779,8 @@ { UNIMPLEMENTED ASSERT(FALSE); + Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED; + IoCompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_NOT_IMPLEMENTED; } @@ -728,7 +854,7 @@ // // dispatch to lower device object // - return IoCallDriver(CommonDeviceExtension->HidDeviceExtension.NextDeviceObject, Irp); + return IoCallDriver(CommonDeviceExtension->HidDeviceExtension.NextDeviceObject, Irp); } @@ -744,7 +870,7 @@ // get current stack location // IoStack = IoGetCurrentIrpStackLocation(Irp); - DPRINT1("[HIDCLASS] Dispatch Major %x Minor %x\n", IoStack->MajorFunction, IoStack->MinorFunction); + DPRINT("[HIDCLASS] Dispatch Major %x Minor %x\n", IoStack->MajorFunction, IoStack->MinorFunction); // // dispatch request based on major function Modified: branches/usb-bringup/drivers/hid/hidclass/pdo.c URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/hid/hidclas…
============================================================================== --- branches/usb-bringup/drivers/hid/hidclass/pdo.c [iso-8859-1] (original) +++ branches/usb-bringup/drivers/hid/hidclass/pdo.c [iso-8859-1] Sun Jan 1 22:48:08 2012 @@ -453,7 +453,7 @@ // // do nothing // - Status = Irp->IoStatus.Status; + Status = STATUS_SUCCESS; //Irp->IoStatus.Status; break; } case IRP_MN_QUERY_INTERFACE: @@ -544,6 +544,7 @@ PDODeviceExtension->Common.HidDeviceExtension.NextDeviceObject = FDODeviceExtension->Common.HidDeviceExtension.NextDeviceObject; PDODeviceExtension->Common.HidDeviceExtension.PhysicalDeviceObject = FDODeviceExtension->Common.HidDeviceExtension.PhysicalDeviceObject; PDODeviceExtension->Common.IsFDO = FALSE; + PDODeviceExtension->FDODeviceObject = DeviceObject; PDODeviceExtension->Common.DriverExtension = FDODeviceExtension->Common.DriverExtension; RtlCopyMemory(&PDODeviceExtension->Common.Attributes, &FDODeviceExtension->Common.Attributes, sizeof(HID_DEVICE_ATTRIBUTES)); RtlCopyMemory(&PDODeviceExtension->Common.DeviceDescription, &FDODeviceExtension->Common.DeviceDescription, sizeof(HIDP_DEVICE_DESC)); Modified: branches/usb-bringup/drivers/hid/hidclass/precomp.h URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/hid/hidclas…
============================================================================== --- branches/usb-bringup/drivers/hid/hidclass/precomp.h [iso-8859-1] (original) +++ branches/usb-bringup/drivers/hid/hidclass/precomp.h [iso-8859-1] Sun Jan 1 22:48:08 2012 @@ -1,6 +1,7 @@ #pragma once #define _HIDPI_NO_FUNCTION_MACROS_ +#define NDEBUG #include <ntddk.h> #include <initguid.h> #include <hidport.h> @@ -47,7 +48,6 @@ // hid attributes // HID_DEVICE_ATTRIBUTES Attributes; - }HIDCLASS_COMMON_DEVICE_EXTENSION, *PHIDCLASS_COMMON_DEVICE_EXTENSION; @@ -101,6 +101,12 @@ // device interface // UNICODE_STRING DeviceInterface; + + // + // FDO device object + // + PDEVICE_OBJECT FDODeviceObject; + }HIDCLASS_PDO_DEVICE_EXTENSION, *PHIDCLASS_PDO_DEVICE_EXTENSION; typedef struct __HIDCLASS_FILEOP_CONTEXT__ Modified: branches/usb-bringup/drivers/hid/hidusb/hidusb.c URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/hid/hidusb/…
============================================================================== --- branches/usb-bringup/drivers/hid/hidusb/hidusb.c [iso-8859-1] (original) +++ branches/usb-bringup/drivers/hid/hidusb/hidusb.c [iso-8859-1] Sun Jan 1 22:48:08 2012 @@ -340,7 +340,7 @@ // get port status // Status = HidUsb_GetPortStatus(ResetContext->DeviceObject, &PortStatus); - DPRINT1("[HIDUSB] ResetWorkerRoutine GetPortStatus %x\n", Status); + DPRINT1("[HIDUSB] ResetWorkerRoutine GetPortStatus %x PortStatus %x\n", Status, PortStatus); if (NT_SUCCESS(Status)) { if (!(PortStatus & USB_PORT_STATUS_ENABLE)) @@ -393,7 +393,6 @@ // ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL); IoFreeWorkItem(ResetContext->WorkItem); - ResetContext->Irp->IoStatus.Status = STATUS_SUCCESS; IoCompleteRequest(ResetContext->Irp, IO_NO_INCREMENT); ExFreePool(ResetContext); } @@ -409,7 +408,6 @@ PHID_USB_DEVICE_EXTENSION HidDeviceExtension; PHID_DEVICE_EXTENSION DeviceExtension; PURB Urb; - PUCHAR Buffer; PHID_USB_RESET_CONTEXT ResetContext; // @@ -418,6 +416,16 @@ Urb = (PURB)Context; ASSERT(Urb); + DPRINT("[HIDUSB] HidUsb_ReadReportCompletion %p Status %x Urb Status %x\n", Irp, Irp->IoStatus, Urb->UrbHeader.Status); + + if (Irp->PendingReturned) + { + // + // mark irp pending + // + IoMarkIrpPending(Irp); + } + // // did the reading report succeed / cancelled // @@ -433,11 +441,6 @@ // ASSERT(Urb->UrbHeader.Status == USBD_STATUS_SUCCESS); - - Buffer = (PUCHAR)Urb->UrbBulkOrInterruptTransfer.TransferBuffer; - ASSERT(Urb->UrbBulkOrInterruptTransfer.TransferBufferLength == 4); - DPRINT("[HIDUSB] ReadCompletion Information %lu Buffer %x %x %x %x\n", Buffer[0] & 0xFF, Buffer[1] & 0xFF, Buffer[2] & 0xFF, Buffer[3] & 0xFF); - // // free the urb // @@ -446,7 +449,7 @@ // // finish completion // - return STATUS_SUCCESS; + return STATUS_CONTINUE_COMPLETION; } // @@ -502,7 +505,7 @@ // // complete request // - return STATUS_SUCCESS; + return STATUS_CONTINUE_COMPLETION; } @@ -558,6 +561,13 @@ // init urb // RtlZeroMemory(Urb, sizeof(struct _URB_BULK_OR_INTERRUPT_TRANSFER)); + + // + // sanity check + // + ASSERT(Irp->UserBuffer); + ASSERT(IoStack->Parameters.DeviceIoControl.OutputBufferLength); + ASSERT(PipeInformation->PipeHandle); // // build the urb @@ -572,6 +582,11 @@ NULL); // + // store configuration handle + // + Urb->UrbHeader.UsbdDeviceHandle = HidDeviceExtension->ConfigurationHandle; + + // // get next location to setup irp // IoStack = IoGetNextIrpStackLocation(Irp); @@ -580,8 +595,12 @@ // init irp for lower driver // IoStack->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL; + IoStack->Parameters.DeviceIoControl.IoControlCode = IOCTL_INTERNAL_USB_SUBMIT_URB; + IoStack->Parameters.DeviceIoControl.InputBufferLength = 0; + IoStack->Parameters.DeviceIoControl.OutputBufferLength = 0; + IoStack->Parameters.DeviceIoControl.Type3InputBuffer = NULL; IoStack->Parameters.Others.Argument1 = (PVOID)Urb; - IoStack->Parameters.DeviceIoControl.IoControlCode = IOCTL_INTERNAL_USB_SUBMIT_URB; + // // set completion routine @@ -762,7 +781,7 @@ } case IOCTL_HID_READ_REPORT: { - DPRINT1("[HIDUSB] IOCTL_HID_READ_REPORT\n"); + DPRINT("[HIDUSB] IOCTL_HID_READ_REPORT\n"); Status = HidUsb_ReadReport(DeviceObject, Irp); return Status; } @@ -949,6 +968,11 @@ // store urb // IoStack->Parameters.Others.Argument1 = (PVOID)Urb; + + // + // set completion routine + // + IoSetCompletionRoutine(Irp, Hid_PnpCompletion, (PVOID)&Event, TRUE, TRUE, TRUE); // // call driver @@ -1329,6 +1353,7 @@ // select configuration // Status = Hid_SelectConfiguration(DeviceObject); + ASSERT(Status == STATUS_SUCCESS); // // done Modified: branches/usb-bringup/drivers/hid/hidusb/hidusb.h URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/hid/hidusb/…
============================================================================== --- branches/usb-bringup/drivers/hid/hidusb/hidusb.h [iso-8859-1] (original) +++ branches/usb-bringup/drivers/hid/hidusb/hidusb.h [iso-8859-1] Sun Jan 1 22:48:08 2012 @@ -2,6 +2,7 @@ #define _HIDPI_ #define _HIDPI_NO_FUNCTION_MACROS_ +#define NDEBUG #include <ntddk.h> #include <hidport.h> #include <debug.h> Modified: branches/usb-bringup/drivers/hid/mouhid/mouhid.c URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/hid/mouhid/…
============================================================================== --- branches/usb-bringup/drivers/hid/mouhid/mouhid.c [iso-8859-1] (original) +++ branches/usb-bringup/drivers/hid/mouhid/mouhid.c [iso-8859-1] Sun Jan 1 22:48:08 2012 @@ -637,7 +637,7 @@ /* lets get the caps */ Status = HidP_GetCaps(PreparsedData, &Capabilities); - if (!NT_SUCCESS(Status)) + if (Status != HIDP_STATUS_SUCCESS) { /* failed to get capabilities */ DPRINT1("[MOUHID] failed to obtain caps with %x\n", Status); @@ -645,7 +645,7 @@ return Status; } - DPRINT1("[MOUHID] Usage %x UsagePage %x\n", Capabilities.Usage, Capabilities.UsagePage, Capabilities.InputReportByteLength); + DPRINT1("[MOUHID] Usage %x UsagePage %x InputReportLength %lu\n", Capabilities.Usage, Capabilities.UsagePage, Capabilities.InputReportByteLength); /* verify capabilities */ if (Capabilities.Usage != HID_USAGE_GENERIC_POINTER && Capabilities.Usage != HID_USAGE_GENERIC_MOUSE || Capabilities.UsagePage != HID_USAGE_PAGE_GENERIC)
12 years, 11 months
1
0
0
0
[cfinck] 54805: Graphical Happy New Year!
by cfinck@svn.reactos.org
Author: cfinck Date: Sun Jan 1 21:05:40 2012 New Revision: 54805 URL:
http://svn.reactos.org/svn/reactos?rev=54805&view=rev
Log: Graphical Happy New Year! Modified: trunk/reactos/ntoskrnl/inbv/logo/1.bmp Modified: trunk/reactos/ntoskrnl/inbv/logo/1.bmp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/inbv/logo/1.bmp?r…
============================================================================== Binary files - no diff available.
12 years, 11 months
1
0
0
0
[pschweitzer] 54804: [KERNEL32] Reimplement CreateDirectoryA, CreateDirectoryExA, CreateDirectoryW, CreateDirectoryExW, RemoveDirectoryA, RemoveDirectoryW. This reimplementation now matches the w2k...
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Jan 1 17:22:35 2012 New Revision: 54804 URL:
http://svn.reactos.org/svn/reactos?rev=54804&view=rev
Log: [KERNEL32] Reimplement CreateDirectoryA, CreateDirectoryExA, CreateDirectoryW, CreateDirectoryExW, RemoveDirectoryA, RemoveDirectoryW. This reimplementation now matches the w2k3 one, properly handles reparse points (especially mount points) and also brings several fixes. Modified: trunk/reactos/dll/win32/kernel32/client/file/dir.c Modified: trunk/reactos/dll/win32/kernel32/client/file/dir.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/dir.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/dir.c [iso-8859-1] Sun Jan 1 17:22:35 2012 @@ -2,15 +2,9 @@ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries - * FILE: lib/kernel32/file/dir.c + * FILE: lib/kernel32/client/file/dir.c * PURPOSE: Directory functions - * PROGRAMMER: Ariadne ( ariadne(a)xs4all.nl) - * UPDATE HISTORY: - * Created 01/11/98 - */ - -/* - * NOTES: Changed to using ZwCreateFile + * PROGRAMMER: Pierre Schweitzer (pierre(a)reactos.org) */ /* INCLUDES ******************************************************************/ @@ -18,7 +12,53 @@ #include <k32.h> #define NDEBUG #include <debug.h> -DEBUG_CHANNEL(kernel32file); + +/* Short File Name length in chars (8.3) */ +#define SFN_LENGTH 12 + +/* Match a volume name like: + * \\?\Volume{GUID} + */ +#define IS_VOLUME_NAME(s, l) \ + ((l == 96 || (l == 98 && s[48] == '\\')) && \ + s[0] == '\\'&& (s[1] == '?' || s[1] == '\\') && \ + s[2] == '?' && s[3] == '\\' && s[4] == 'V' && \ + s[5] == 'o' && s[6] == 'l' && s[7] == 'u' && \ + s[8] == 'm' && s[9] == 'e' && s[10] == '{' && \ + s[19] == '-' && s[24] == '-' && s[29] == '-' && \ + s[34] == '-' && s[47] == '}') + +/* FIXME - Get it out of here */ +typedef struct _REPARSE_DATA_BUFFER { + ULONG ReparseTag; + USHORT ReparseDataLength; + USHORT Reserved; + union { + struct { + USHORT SubstituteNameOffset; + USHORT SubstituteNameLength; + USHORT PrintNameOffset; + USHORT PrintNameLength; + ULONG Flags; + WCHAR PathBuffer[1]; + } SymbolicLinkReparseBuffer; + struct { + USHORT SubstituteNameOffset; + USHORT SubstituteNameLength; + USHORT PrintNameOffset; + USHORT PrintNameLength; + WCHAR PathBuffer[1]; + } MountPointReparseBuffer; + struct { + UCHAR DataBuffer[1]; + } GenericReparseBuffer; + }; +} REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER; + +typedef struct _FILE_ATTRIBUTE_TAG_INFORMATION { + ULONG FileAttributes; + ULONG ReparseTag; +} FILE_ATTRIBUTE_TAG_INFORMATION, *PFILE_ATTRIBUTE_TAG_INFORMATION; /* FUNCTIONS *****************************************************************/ @@ -27,559 +67,933 @@ */ BOOL WINAPI -CreateDirectoryA ( - LPCSTR lpPathName, - LPSECURITY_ATTRIBUTES lpSecurityAttributes - ) +CreateDirectoryA(IN LPCSTR lpPathName, + IN LPSECURITY_ATTRIBUTES lpSecurityAttributes) { - PWCHAR PathNameW; - - if (!(PathNameW = FilenameA2W(lpPathName, FALSE))) - return FALSE; - - return CreateDirectoryW (PathNameW, + PUNICODE_STRING PathNameW; + + PathNameW = Basep8BitStringToStaticUnicodeString(lpPathName); + if (!PathNameW) + { + return FALSE; + } + + return CreateDirectoryW(PathNameW->Buffer, lpSecurityAttributes); } - /* * @implemented */ BOOL WINAPI -CreateDirectoryExA ( - LPCSTR lpTemplateDirectory, - LPCSTR lpNewDirectory, - LPSECURITY_ATTRIBUTES lpSecurityAttributes) +CreateDirectoryExA(IN LPCSTR lpTemplateDirectory, + IN LPCSTR lpNewDirectory, + IN LPSECURITY_ATTRIBUTES lpSecurityAttributes) { - PWCHAR TemplateDirectoryW; - PWCHAR NewDirectoryW; - BOOL ret; - - if (!(TemplateDirectoryW = FilenameA2W(lpTemplateDirectory, TRUE))) - return FALSE; - - if (!(NewDirectoryW = FilenameA2W(lpNewDirectory, FALSE))) - { - RtlFreeHeap (RtlGetProcessHeap (), - 0, - TemplateDirectoryW); - return FALSE; - } - - ret = CreateDirectoryExW (TemplateDirectoryW, - NewDirectoryW, + PUNICODE_STRING TemplateDirectoryW; + UNICODE_STRING NewDirectoryW; + BOOL ret; + + TemplateDirectoryW = Basep8BitStringToStaticUnicodeString(lpTemplateDirectory); + if (!TemplateDirectoryW) + { + return FALSE; + } + + if (!Basep8BitStringToDynamicUnicodeString(&NewDirectoryW, lpNewDirectory)) + { + return FALSE; + } + + ret = CreateDirectoryExW(TemplateDirectoryW->Buffer, + NewDirectoryW.Buffer, lpSecurityAttributes); - RtlFreeHeap (RtlGetProcessHeap (), - 0, - TemplateDirectoryW); - - return ret; + RtlFreeUnicodeString(&NewDirectoryW); + + return ret; } - /* * @implemented */ BOOL WINAPI -CreateDirectoryW ( - LPCWSTR lpPathName, - LPSECURITY_ATTRIBUTES lpSecurityAttributes - ) +CreateDirectoryW(IN LPCWSTR lpPathName, + IN LPSECURITY_ATTRIBUTES lpSecurityAttributes) { - OBJECT_ATTRIBUTES ObjectAttributes; - IO_STATUS_BLOCK IoStatusBlock; - UNICODE_STRING NtPathU; - HANDLE DirectoryHandle = NULL; - NTSTATUS Status; - - TRACE ("lpPathName %S lpSecurityAttributes %p\n", - lpPathName, lpSecurityAttributes); - - if (!RtlDosPathNameToNtPathName_U (lpPathName, - &NtPathU, - NULL, - NULL)) - { - SetLastError(ERROR_PATH_NOT_FOUND); - return FALSE; - } - - InitializeObjectAttributes(&ObjectAttributes, - &NtPathU, - OBJ_CASE_INSENSITIVE, - NULL, - (lpSecurityAttributes ? lpSecurityAttributes->lpSecurityDescriptor : NULL)); - - Status = NtCreateFile (&DirectoryHandle, - FILE_LIST_DIRECTORY | SYNCHRONIZE, - &ObjectAttributes, - &IoStatusBlock, - NULL, - FILE_ATTRIBUTE_NORMAL, - FILE_SHARE_READ | FILE_SHARE_WRITE, - FILE_CREATE, - FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_FOR_BACKUP_INTENT, - NULL, - 0); - - RtlFreeHeap (RtlGetProcessHeap (), - 0, - NtPathU.Buffer); - - if (!NT_SUCCESS(Status)) - { - WARN("NtCreateFile failed with Status %lx\n", Status); - BaseSetLastNTError(Status); - return FALSE; - } - - NtClose (DirectoryHandle); - + DWORD Length; + NTSTATUS Status; + HANDLE DirectoryHandle; + UNICODE_STRING NtPathU; + PWSTR PathUBuffer, FilePart; + IO_STATUS_BLOCK IoStatusBlock; + RTL_RELATIVE_NAME_U RelativeName; + OBJECT_ATTRIBUTES ObjectAttributes; + + /* Get relative name */ + if (!RtlDosPathNameToRelativeNtPathName_U(lpPathName, &NtPathU, NULL, &RelativeName)) + { + SetLastError(ERROR_PATH_NOT_FOUND); + return FALSE; + } + + /* Check if path length is < MAX_PATH (with space for file name). + * If not, prefix is required. + */ + if (NtPathU.Length > (MAX_PATH - SFN_LENGTH) * sizeof(WCHAR) && lpPathName[0] != L'\\' && + lpPathName[1] != L'\\' && lpPathName[2] != L'?' && lpPathName[3] != L'\\') + { + /* Get file name position and full path length */ + Length = GetFullPathNameW(lpPathName, 0, NULL, &FilePart); + if (Length == 0) + { + RtlReleaseRelativeName(&RelativeName); + RtlFreeHeap(GetProcessHeap(), 0, NtPathU.Buffer); + SetLastError(ERROR_FILENAME_EXCED_RANGE); + return FALSE; + } + + /* Keep place for 8.3 file name */ + Length += SFN_LENGTH; + /* No prefix, so, must be smaller than MAX_PATH */ + if (Length > MAX_PATH) + { + RtlReleaseRelativeName(&RelativeName); + RtlFreeHeap(GetProcessHeap(), 0, NtPathU.Buffer); + SetLastError(ERROR_FILENAME_EXCED_RANGE); + return FALSE; + } + } + + /* Save buffer to allow later freeing */ + PathUBuffer = NtPathU.Buffer; + + /* If we have relative name (and root dir), use them instead */ + if (RelativeName.RelativeName.Length != 0) + { + NtPathU.Length = RelativeName.RelativeName.Length; + NtPathU.MaximumLength = RelativeName.RelativeName.MaximumLength; + NtPathU.Buffer = RelativeName.RelativeName.Buffer; + } + else + { + RelativeName.ContainingDirectory = NULL; + } + + InitializeObjectAttributes(&ObjectAttributes, + &NtPathU, + OBJ_CASE_INSENSITIVE, + RelativeName.ContainingDirectory, + (lpSecurityAttributes ? lpSecurityAttributes->lpSecurityDescriptor : NULL)); + + Status = NtCreateFile(&DirectoryHandle, + FILE_LIST_DIRECTORY | SYNCHRONIZE, + &ObjectAttributes, + &IoStatusBlock, + NULL, + FILE_ATTRIBUTE_NORMAL, + FILE_SHARE_READ | FILE_SHARE_WRITE, + FILE_CREATE, + FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_FOR_BACKUP_INTENT, + NULL, + 0); + + RtlReleaseRelativeName(&RelativeName); + RtlFreeHeap(GetProcessHeap(), 0, PathUBuffer); + + if (NT_SUCCESS(Status)) + { + NtClose(DirectoryHandle); return TRUE; + } + + if (RtlIsDosDeviceName_U(lpPathName)) + { + Status = STATUS_NOT_A_DIRECTORY; + } + + BaseSetLastNTError(Status); + return FALSE; } - /* * @implemented */ BOOL WINAPI -CreateDirectoryExW ( - LPCWSTR lpTemplateDirectory, - LPCWSTR lpNewDirectory, - LPSECURITY_ATTRIBUTES lpSecurityAttributes - ) +CreateDirectoryExW(IN LPCWSTR lpTemplateDirectory, + IN LPCWSTR lpNewDirectory, + IN LPSECURITY_ATTRIBUTES lpSecurityAttributes) { - OBJECT_ATTRIBUTES ObjectAttributes; - IO_STATUS_BLOCK IoStatusBlock; - UNICODE_STRING NtPathU, NtTemplatePathU; - HANDLE DirectoryHandle = NULL; - HANDLE TemplateHandle = NULL; - FILE_EA_INFORMATION EaInformation; - FILE_BASIC_INFORMATION FileBasicInfo; - NTSTATUS Status; - ULONG OpenOptions, CreateOptions; - ACCESS_MASK DesiredAccess; - BOOLEAN ReparsePoint = FALSE; - PVOID EaBuffer = NULL; - ULONG EaLength = 0; - - OpenOptions = FILE_DIRECTORY_FILE | FILE_OPEN_REPARSE_POINT | - FILE_OPEN_FOR_BACKUP_INTENT; - CreateOptions = FILE_DIRECTORY_FILE | FILE_OPEN_FOR_BACKUP_INTENT; - DesiredAccess = FILE_LIST_DIRECTORY | SYNCHRONIZE | FILE_WRITE_ATTRIBUTES | - FILE_READ_ATTRIBUTES; - - TRACE ("lpTemplateDirectory %ws lpNewDirectory %ws lpSecurityAttributes %p\n", - lpTemplateDirectory, lpNewDirectory, lpSecurityAttributes); - - /* - * Translate the template directory path - */ - - if (!RtlDosPathNameToNtPathName_U (lpTemplateDirectory, - &NtTemplatePathU, - NULL, - NULL)) - { - SetLastError(ERROR_PATH_NOT_FOUND); - return FALSE; - } - - InitializeObjectAttributes(&ObjectAttributes, - &NtTemplatePathU, - OBJ_CASE_INSENSITIVE, - NULL, - NULL); - - /* - * Open the template directory - */ - -OpenTemplateDir: - Status = NtOpenFile (&TemplateHandle, - FILE_LIST_DIRECTORY | FILE_READ_ATTRIBUTES | FILE_READ_EA, - &ObjectAttributes, - &IoStatusBlock, - FILE_SHARE_READ | FILE_SHARE_WRITE, - OpenOptions); + DWORD Length; + NTSTATUS Status; + ULONG EaLength = 0; + PVOID EaBuffer = NULL; + BOOL ReparsePoint = FALSE; + IO_STATUS_BLOCK IoStatusBlock; + FILE_EA_INFORMATION FileEaInfo; + OBJECT_ATTRIBUTES ObjectAttributes; + FILE_BASIC_INFORMATION FileBasicInfo; + PREPARSE_DATA_BUFFER ReparseDataBuffer; + HANDLE TemplateHandle, DirectoryHandle; + FILE_ATTRIBUTE_TAG_INFORMATION FileTagInfo; + UNICODE_STRING NtPathU, NtTemplatePathU, NewDirectory; + RTL_RELATIVE_NAME_U RelativeName, TemplateRelativeName; + PWSTR TemplateBuffer, PathUBuffer, FilePart, SubstituteName; + + /* Get relative name of the template */ + if (!RtlDosPathNameToRelativeNtPathName_U(lpTemplateDirectory, &NtTemplatePathU, NULL, &TemplateRelativeName)) + { + SetLastError(ERROR_PATH_NOT_FOUND); + return FALSE; + } + + /* Save buffer for further freeing */ + TemplateBuffer = NtTemplatePathU.Buffer; + + /* If we have relative name (and root dir), use them instead */ + if (TemplateRelativeName.RelativeName.Length != 0) + { + NtTemplatePathU.Length = TemplateRelativeName.RelativeName.Length; + NtTemplatePathU.MaximumLength = TemplateRelativeName.RelativeName.MaximumLength; + NtTemplatePathU.Buffer = TemplateRelativeName.RelativeName.Buffer; + } + else + { + TemplateRelativeName.ContainingDirectory = NULL; + } + + InitializeObjectAttributes(&ObjectAttributes, + &NtTemplatePathU, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + + /* Open template directory */ + Status = NtOpenFile(&TemplateHandle, + FILE_LIST_DIRECTORY | FILE_READ_ATTRIBUTES | FILE_READ_EA, + &ObjectAttributes, + &IoStatusBlock, + FILE_SHARE_READ | FILE_SHARE_WRITE, + FILE_DIRECTORY_FILE | FILE_OPEN_REPARSE_POINT | FILE_OPEN_FOR_BACKUP_INTENT); + if (!NT_SUCCESS(Status)) + { + if (Status != STATUS_INVALID_PARAMETER) + { + RtlReleaseRelativeName(&TemplateRelativeName); + RtlFreeHeap(GetProcessHeap(), 0, TemplateBuffer); + BaseSetLastNTError(Status); + return FALSE; + } + +OpenWithoutReparseSupport: + /* Opening failed due to lacking reparse points support in the FSD, try without */ + Status = NtOpenFile(&TemplateHandle, + FILE_LIST_DIRECTORY | FILE_READ_ATTRIBUTES | FILE_READ_EA, + &ObjectAttributes, + &IoStatusBlock, + FILE_SHARE_READ | FILE_SHARE_WRITE, + FILE_DIRECTORY_FILE | FILE_OPEN_FOR_BACKUP_INTENT); + if (!NT_SUCCESS(Status)) { - if (Status == STATUS_INVALID_PARAMETER && - (OpenOptions & FILE_OPEN_REPARSE_POINT)) - { - /* Some FSs (FAT) don't support reparse points, try opening - the directory without FILE_OPEN_REPARSE_POINT */ - OpenOptions &= ~FILE_OPEN_REPARSE_POINT; - - TRACE("Reparse points not supported, try with less options\n"); - - /* try again */ - goto OpenTemplateDir; - } - else - { - WARN("Failed to open the template directory: 0x%x\n", Status); - goto CleanupNoNtPath; - } - } - - /* - * Translate the new directory path and check if they're the same - */ - - if (!RtlDosPathNameToNtPathName_U (lpNewDirectory, - &NtPathU, - NULL, - NULL)) - { - Status = STATUS_OBJECT_PATH_NOT_FOUND; - goto CleanupNoNtPath; - } - - if (RtlEqualUnicodeString(&NtPathU, - &NtTemplatePathU, - TRUE)) - { - WARN("Both directory paths are the same!\n"); - Status = STATUS_OBJECT_NAME_INVALID; - goto Cleanup; - } - - InitializeObjectAttributes(&ObjectAttributes, - &NtPathU, - OBJ_CASE_INSENSITIVE, - NULL, - (lpSecurityAttributes ? lpSecurityAttributes->lpSecurityDescriptor : NULL)); - - /* - * Query the basic file attributes from the template directory - */ - - /* Make sure FILE_ATTRIBUTE_NORMAL is used in case the information - isn't set by the FS */ + RtlReleaseRelativeName(&TemplateRelativeName); + RtlFreeHeap(GetProcessHeap(), 0, TemplateBuffer); + BaseSetLastNTError(Status); + return FALSE; + } + + /* Request file attributes */ FileBasicInfo.FileAttributes = FILE_ATTRIBUTE_NORMAL; Status = NtQueryInformationFile(TemplateHandle, &IoStatusBlock, &FileBasicInfo, - sizeof(FILE_BASIC_INFORMATION), + sizeof(FileBasicInfo), FileBasicInformation); if (!NT_SUCCESS(Status)) { - WARN("Failed to query the basic directory attributes\n"); - goto Cleanup; - } - - /* clear the reparse point attribute if present. We're going to set the - reparse point later which will cause the attribute to be set */ + RtlReleaseRelativeName(&TemplateRelativeName); + RtlFreeHeap(GetProcessHeap(), 0, TemplateBuffer); + CloseHandle(TemplateHandle); + BaseSetLastNTError(Status); + return FALSE; + + } + } + else + { + /* Request file attributes */ + FileBasicInfo.FileAttributes = FILE_ATTRIBUTE_NORMAL; + Status = NtQueryInformationFile(TemplateHandle, + &IoStatusBlock, + &FileBasicInfo, + sizeof(FileBasicInfo), + FileBasicInformation); + if (!NT_SUCCESS(Status)) + { + RtlReleaseRelativeName(&TemplateRelativeName); + RtlFreeHeap(GetProcessHeap(), 0, TemplateBuffer); + CloseHandle(TemplateHandle); + BaseSetLastNTError(Status); + return FALSE; + + } + + /* If it is a reparse point, then get information about it */ if (FileBasicInfo.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) { - FileBasicInfo.FileAttributes &= ~FILE_ATTRIBUTE_REPARSE_POINT; - - /* writing the extended attributes requires the FILE_WRITE_DATA - access right */ - DesiredAccess |= FILE_WRITE_DATA; - - CreateOptions |= FILE_OPEN_REPARSE_POINT; + Status = NtQueryInformationFile(TemplateHandle, + &IoStatusBlock, + &FileTagInfo, + sizeof(FileTagInfo), + FileAttributeTagInformation); + if (!NT_SUCCESS(Status)) + { + RtlReleaseRelativeName(&TemplateRelativeName); + RtlFreeHeap(GetProcessHeap(), 0, TemplateBuffer); + CloseHandle(TemplateHandle); + BaseSetLastNTError(Status); + return FALSE; + } + + /* Only mount points are supported, retry without if anything different */ + if (FileTagInfo.ReparseTag != IO_REPARSE_TAG_MOUNT_POINT) + { + CloseHandle(TemplateHandle); + goto OpenWithoutReparseSupport; + } + + /* Mark we are playing with a reparse point */ ReparsePoint = TRUE; } - - /* - * Read the Extended Attributes if present - */ - - for (;;) - { - Status = NtQueryInformationFile(TemplateHandle, - &IoStatusBlock, - &EaInformation, - sizeof(FILE_EA_INFORMATION), - FileEaInformation); - if (NT_SUCCESS(Status) && (EaInformation.EaSize != 0)) - { - EaBuffer = RtlAllocateHeap(RtlGetProcessHeap(), - 0, - EaInformation.EaSize); - if (EaBuffer == NULL) - { - Status = STATUS_INSUFFICIENT_RESOURCES; - break; - } - + } + + /* Get relative name of the directory */ + if (!RtlDosPathNameToRelativeNtPathName_U(lpNewDirectory, &NtPathU, NULL, &RelativeName)) + { + RtlReleaseRelativeName(&TemplateRelativeName); + RtlFreeHeap(GetProcessHeap(), 0, TemplateBuffer); + NtClose(TemplateHandle); + SetLastError(ERROR_PATH_NOT_FOUND); + return FALSE; + } + + /* Save its buffer for further freeing */ + PathUBuffer = NtPathU.Buffer; + + /* Template & directory can't be the same */ + if (RtlEqualUnicodeString(&NtPathU, + &NtTemplatePathU, + TRUE)) + { + RtlReleaseRelativeName(&RelativeName); + RtlReleaseRelativeName(&TemplateRelativeName); + RtlFreeHeap(GetProcessHeap(), 0, TemplateBuffer); + RtlFreeHeap(GetProcessHeap(), 0, PathUBuffer); + NtClose(TemplateHandle); + SetLastError(ERROR_INVALID_NAME); + return FALSE; + } + + RtlReleaseRelativeName(&TemplateRelativeName); + RtlFreeHeap(GetProcessHeap(), 0, TemplateBuffer); + + /* Check if path length is < MAX_PATH (with space for file name). + * If not, prefix is required. + */ + if (NtPathU.Length > (MAX_PATH - SFN_LENGTH) * sizeof(WCHAR) && lpNewDirectory[0] != L'\\' && + lpNewDirectory[1] != L'\\' && lpNewDirectory[2] != L'?' && lpNewDirectory[3] != L'\\') + { + /* Get file name position and full path length */ + Length = GetFullPathNameW(lpNewDirectory, 0, NULL, &FilePart); + if (Length == 0) + { + RtlReleaseRelativeName(&RelativeName); + RtlFreeHeap(GetProcessHeap(), 0, PathUBuffer); + CloseHandle(TemplateHandle); + SetLastError(ERROR_FILENAME_EXCED_RANGE); + return FALSE; + } + + /* Keep place for 8.3 file name */ + Length += SFN_LENGTH; + /* No prefix, so, must be smaller than MAX_PATH */ + if (Length > MAX_PATH) + { + RtlReleaseRelativeName(&RelativeName); + RtlFreeHeap(GetProcessHeap(), 0, PathUBuffer); + CloseHandle(TemplateHandle); + SetLastError(ERROR_FILENAME_EXCED_RANGE); + return FALSE; + } + } + + /* If we have relative name (and root dir), use them instead */ + if (RelativeName.RelativeName.Length != 0) + { + NtPathU.Length = RelativeName.RelativeName.Length; + NtPathU.MaximumLength = RelativeName.RelativeName.MaximumLength; + NtPathU.Buffer = RelativeName.RelativeName.Buffer; + } + else + { + RelativeName.ContainingDirectory = NULL; + } + + /* Get extended attributes */ + Status = NtQueryInformationFile(TemplateHandle, + &IoStatusBlock, + &FileEaInfo, + sizeof(FileEaInfo), + FileEaInformation); + if (!NT_SUCCESS(Status)) + { + RtlReleaseRelativeName(&RelativeName); + RtlFreeHeap(GetProcessHeap(), 0, PathUBuffer); + CloseHandle(TemplateHandle); + BaseSetLastNTError(Status); + return FALSE; + } + + /* Start reading extended attributes */ + if (FileEaInfo.EaSize != 0) + { + for (EaLength = FileEaInfo.EaSize * 2; ; EaLength = EaLength * 2) + { + /* Allocate buffer for reading */ + EaBuffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, EaLength); + if (!EaBuffer) + { + RtlReleaseRelativeName(&RelativeName); + RtlFreeHeap(GetProcessHeap(), 0, PathUBuffer); + CloseHandle(TemplateHandle); + BaseSetLastNTError(STATUS_NO_MEMORY); + return FALSE; + } + + /* Query EAs */ Status = NtQueryEaFile(TemplateHandle, &IoStatusBlock, EaBuffer, - EaInformation.EaSize, + EaLength, FALSE, NULL, 0, NULL, TRUE); - - if (NT_SUCCESS(Status)) - { - /* we successfully read the extended attributes */ - EaLength = EaInformation.EaSize; - break; + if (!NT_SUCCESS(Status)) + { + RtlFreeHeap(GetProcessHeap(), 0, EaBuffer); + IoStatusBlock.Information = 0; + } + + /* If we don't fail because of too small buffer, stop here */ + if (Status != STATUS_BUFFER_OVERFLOW && + Status != STATUS_BUFFER_TOO_SMALL) + { + EaLength = IoStatusBlock.Information; + break; + } + } + } + + InitializeObjectAttributes(&ObjectAttributes, + &NtPathU, + OBJ_CASE_INSENSITIVE, + RelativeName.ContainingDirectory, + (lpSecurityAttributes ? lpSecurityAttributes->lpSecurityDescriptor : NULL)); + + /* Ensure attributes are valid */ + FileBasicInfo.FileAttributes &= FILE_ATTRIBUTE_VALID_FLAGS; + + /* Create the new directory */ + Status = NtCreateFile(&DirectoryHandle, + FILE_LIST_DIRECTORY | SYNCHRONIZE | FILE_WRITE_ATTRIBUTES | + FILE_READ_ATTRIBUTES | (FileBasicInfo.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT ? FILE_ADD_FILE : 0), + &ObjectAttributes, + &IoStatusBlock, + NULL, + FileBasicInfo.FileAttributes, + FILE_SHARE_READ | FILE_SHARE_WRITE, + FILE_CREATE, + FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT | + FILE_OPEN_FOR_BACKUP_INTENT | FILE_OPEN_REPARSE_POINT, + EaBuffer, + EaLength); + if (!NT_SUCCESS(Status)) + { + if (Status == STATUS_INVALID_PARAMETER || Status == STATUS_ACCESS_DENIED) + { + /* If creation failed, it might be because FSD doesn't support reparse points + * Retry without asking for such support in case template is not a reparse point + */ + if (!ReparsePoint) + { + Status = NtCreateFile(&DirectoryHandle, + FILE_LIST_DIRECTORY | SYNCHRONIZE | + FILE_WRITE_ATTRIBUTES | FILE_READ_ATTRIBUTES, + &ObjectAttributes, + &IoStatusBlock, + NULL, + FileBasicInfo.FileAttributes, + FILE_SHARE_READ | FILE_SHARE_WRITE, + FILE_CREATE, + FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT | + FILE_OPEN_FOR_BACKUP_INTENT, + EaBuffer, + EaLength); } else { - RtlFreeHeap(RtlGetProcessHeap(), - 0, - EaBuffer); - EaBuffer = NULL; - - if (Status != STATUS_BUFFER_TOO_SMALL) - { - /* unless we just allocated not enough memory, break the loop - and just continue without copying extended attributes */ - break; - } - } - } - else - { - if (Status == STATUS_EAS_NOT_SUPPORTED) - { - /* Extended attributes are not supported, so, this is OK */ - /* FIXME: Would deserve a deeper look, comparing with Windows */ - Status = STATUS_SUCCESS; - } - /* failure or no extended attributes present, break the loop */ - break; - } - } - - if (!NT_SUCCESS(Status)) - { - WARN("Querying the EA data failed: 0x%x\n", Status); - goto Cleanup; - } - - /* - * Create the new directory - */ - - Status = NtCreateFile (&DirectoryHandle, - DesiredAccess, - &ObjectAttributes, - &IoStatusBlock, - NULL, - FileBasicInfo.FileAttributes, - FILE_SHARE_READ | FILE_SHARE_WRITE, - FILE_CREATE, - CreateOptions, - EaBuffer, - EaLength); - if (!NT_SUCCESS(Status)) - { - if (ReparsePoint && - (Status == STATUS_INVALID_PARAMETER || Status == STATUS_ACCESS_DENIED)) - { - /* The FS doesn't seem to support reparse points... */ - WARN("Cannot copy the hardlink, destination doesn\'t support reparse points!\n"); - } - - goto Cleanup; - } - - if (ReparsePoint) - { - /* - * Copy the reparse point - */ - - PREPARSE_GUID_DATA_BUFFER ReparseDataBuffer = - (PREPARSE_GUID_DATA_BUFFER)RtlAllocateHeap(RtlGetProcessHeap(), - 0, - MAXIMUM_REPARSE_DATA_BUFFER_SIZE); - - if (ReparseDataBuffer == NULL) - { - Status = STATUS_INSUFFICIENT_RESOURCES; - goto Cleanup; - } - - /* query the size of the reparse data buffer structure */ - Status = NtFsControlFile(TemplateHandle, - NULL, - NULL, - NULL, - &IoStatusBlock, - FSCTL_GET_REPARSE_POINT, - NULL, - 0, - ReparseDataBuffer, - MAXIMUM_REPARSE_DATA_BUFFER_SIZE); - if (NT_SUCCESS(Status)) - { - /* write the reparse point */ - Status = NtFsControlFile(DirectoryHandle, - NULL, - NULL, - NULL, - &IoStatusBlock, - FSCTL_SET_REPARSE_POINT, - ReparseDataBuffer, - MAXIMUM_REPARSE_DATA_BUFFER_SIZE, - NULL, - 0); - } - - RtlFreeHeap(RtlGetProcessHeap(), - 0, - ReparseDataBuffer); - - if (!NT_SUCCESS(Status)) - { - /* fail, we were unable to read the reparse point data! */ - WARN("Querying or setting the reparse point failed: 0x%x\n", Status); - goto Cleanup; - } - } - else - { - /* - * Copy alternate file streams, if existing - */ - - /* FIXME - enumerate and copy the file streams */ - } - - /* - * We successfully created the directory and copied all information - * from the template directory - */ - Status = STATUS_SUCCESS; - -Cleanup: - RtlFreeHeap (RtlGetProcessHeap (), - 0, - NtPathU.Buffer); - -CleanupNoNtPath: - if (TemplateHandle != NULL) - { - NtClose(TemplateHandle); - } - - RtlFreeHeap (RtlGetProcessHeap (), - 0, - NtTemplatePathU.Buffer); - - /* free the he extended attributes buffer */ - if (EaBuffer != NULL) - { - RtlFreeHeap (RtlGetProcessHeap (), - 0, - EaBuffer); - } - - if (DirectoryHandle != NULL) - { - NtClose(DirectoryHandle); - } - - if (!NT_SUCCESS(Status)) - { + RtlReleaseRelativeName(&RelativeName); + RtlFreeHeap(GetProcessHeap(), 0, PathUBuffer); + if (EaBuffer) + { + RtlFreeHeap(GetProcessHeap(), 0, EaBuffer); + } + CloseHandle(TemplateHandle); BaseSetLastNTError(Status); return FALSE; - } - + } + } + } + + RtlReleaseRelativeName(&RelativeName); + RtlFreeHeap(GetProcessHeap(), 0, PathUBuffer); + if (EaBuffer) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, EaBuffer); + } + + if (!NT_SUCCESS(Status)) + { + NtClose(TemplateHandle); + if (RtlIsDosDeviceName_U(lpNewDirectory)) + { + Status = STATUS_NOT_A_DIRECTORY; + } + BaseSetLastNTError(Status); + return FALSE; + } + + /* If template is a reparse point, copy reparse data */ + if (ReparsePoint) + { + ReparseDataBuffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, + MAXIMUM_REPARSE_DATA_BUFFER_SIZE); + if (!ReparseDataBuffer) + { + NtClose(TemplateHandle); + NtClose(DirectoryHandle); + SetLastError(STATUS_NO_MEMORY); + return FALSE; + } + + /* First query data */ + Status = NtFsControlFile(TemplateHandle, + NULL, + NULL, + NULL, + &IoStatusBlock, + FSCTL_GET_REPARSE_POINT, + NULL, + 0, + ReparseDataBuffer, + MAXIMUM_REPARSE_DATA_BUFFER_SIZE); + if (!NT_SUCCESS(Status)) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, ReparseDataBuffer); + NtClose(TemplateHandle); + NtClose(DirectoryHandle); + SetLastError(Status); + return FALSE; + } + + /* Once again, ensure it is a mount point */ + if (ReparseDataBuffer->ReparseTag != IO_REPARSE_TAG_MOUNT_POINT) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, ReparseDataBuffer); + NtClose(TemplateHandle); + NtClose(DirectoryHandle); + SetLastError(STATUS_OBJECT_NAME_INVALID); + return FALSE; + } + + /* Get volume name */ + SubstituteName = (PWSTR)((ULONG_PTR)ReparseDataBuffer->MountPointReparseBuffer.PathBuffer + + ReparseDataBuffer->MountPointReparseBuffer.SubstituteNameOffset); + if (IS_VOLUME_NAME(SubstituteName, ReparseDataBuffer->MountPointReparseBuffer.SubstituteNameLength)) + { + /* Prepare to define a new mount point for that volume */ + RtlInitUnicodeString(&NewDirectory, lpNewDirectory); + NewDirectory.Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, NewDirectory.Length + 2 * sizeof(WCHAR)); + if (!NewDirectory.Buffer) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + RtlFreeHeap(RtlGetProcessHeap(), 0, ReparseDataBuffer); + NtClose(TemplateHandle); + NtClose(DirectoryHandle); + return FALSE; + } + + RtlCopyMemory(&NewDirectory.Buffer, lpNewDirectory, NewDirectory.Length); + if (NewDirectory.Buffer[NewDirectory.Length / sizeof(WCHAR)] != L'\\') + { + NewDirectory.Buffer[NewDirectory.Length / sizeof(WCHAR)] = L'\\'; + NewDirectory.Buffer[(NewDirectory.Length / sizeof(WCHAR)) + 1] = UNICODE_NULL; + } + + /* Define a new mount point for that volume */ + SetVolumeMountPointW(NewDirectory.Buffer, SubstituteName); + + RtlFreeHeap(RtlGetProcessHeap(), 0, NewDirectory.Buffer); + RtlFreeHeap(RtlGetProcessHeap(), 0, ReparseDataBuffer); + NtClose(TemplateHandle); + NtClose(DirectoryHandle); + return TRUE; + } + + /* Otherwise copy data raw */ + Status = NtFsControlFile(DirectoryHandle, + NULL, + NULL, + NULL, + &IoStatusBlock, + FSCTL_SET_REPARSE_POINT, + ReparseDataBuffer, + ReparseDataBuffer->ReparseDataLength + + FIELD_OFFSET(REPARSE_DATA_BUFFER, MountPointReparseBuffer.PathBuffer), + NULL, + 0); + + RtlFreeHeap(RtlGetProcessHeap(), 0, ReparseDataBuffer); + NtClose(TemplateHandle); + NtClose(DirectoryHandle); + + if (NT_SUCCESS(Status)) + { + return TRUE; + } + + BaseSetLastNTError(Status); + return FALSE; + } + /* In case it's not a reparse point, handle streams on the file */ + else + { + PVOID StreamInfo; + ULONG StreamSize = 0x1000; + for (;;) + { + StreamInfo = RtlAllocateHeap(RtlGetProcessHeap(), 0, StreamSize); + if (!StreamInfo) + { + BaseMarkFileForDelete(DirectoryHandle, FileBasicInfo.FileAttributes); + SetLastError(STATUS_NO_MEMORY); + break; + } + + /* Query stream information */ + Status = NtQueryInformationFile(TemplateHandle, + &IoStatusBlock, + StreamInfo, + StreamSize, + FileStreamInformation); + if (!NT_SUCCESS(Status)) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, StreamInfo); + StreamInfo = NULL; + StreamSize << 1; + } + + /* If it failed, ensure that's not because of too small buffer */ + if (Status != STATUS_BUFFER_OVERFLOW && + Status != STATUS_BUFFER_TOO_SMALL) + { + break; + } + } + + if (!NT_SUCCESS(Status) || IoStatusBlock.Information == 0) + { + if (StreamInfo) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, StreamInfo); + } + + NtClose(TemplateHandle); + NtClose(DirectoryHandle); + return TRUE; + } + +#if 1 + /* FIXME: TODO */ + DPRINT1("Warning: streams copying is unimplemented!\n"); + RtlFreeHeap(RtlGetProcessHeap(), 0, StreamInfo); + NtClose(TemplateHandle); + NtClose(DirectoryHandle); +#endif return TRUE; + } } - /* * @implemented */ BOOL WINAPI -RemoveDirectoryA ( - LPCSTR lpPathName - ) +RemoveDirectoryA(IN LPCSTR lpPathName) { - PWCHAR PathNameW; - - TRACE("RemoveDirectoryA(%s)\n",lpPathName); - - if (!(PathNameW = FilenameA2W(lpPathName, FALSE))) - return FALSE; - - return RemoveDirectoryW (PathNameW); + PUNICODE_STRING PathNameW; + + PathNameW = Basep8BitStringToStaticUnicodeString(lpPathName); + if (!PathNameW) + { + return FALSE; + } + + return RemoveDirectoryW(PathNameW->Buffer); } - /* * @implemented */ BOOL WINAPI -RemoveDirectoryW ( - LPCWSTR lpPathName - ) +RemoveDirectoryW(IN LPCWSTR lpPathName) { - FILE_DISPOSITION_INFORMATION FileDispInfo; - OBJECT_ATTRIBUTES ObjectAttributes; - IO_STATUS_BLOCK IoStatusBlock; - UNICODE_STRING NtPathU; - HANDLE DirectoryHandle = NULL; - NTSTATUS Status; - - TRACE("lpPathName %S\n", lpPathName); - - if (!RtlDosPathNameToNtPathName_U (lpPathName, - &NtPathU, - NULL, - NULL)) - { - SetLastError(ERROR_PATH_NOT_FOUND); - return FALSE; - } - - InitializeObjectAttributes(&ObjectAttributes, - &NtPathU, - OBJ_CASE_INSENSITIVE, - NULL, - NULL); - - TRACE("NtPathU '%S'\n", NtPathU.Buffer); - + NTSTATUS Status; + DWORD BytesReturned; + HANDLE DirectoryHandle; + IO_STATUS_BLOCK IoStatusBlock; + UNICODE_STRING NtPathU, PathName; + RTL_RELATIVE_NAME_U RelativeName; + PWSTR PathUBuffer, SubstituteName; + OBJECT_ATTRIBUTES ObjectAttributes; + PREPARSE_DATA_BUFFER ReparseDataBuffer; + FILE_DISPOSITION_INFORMATION FileDispInfo; + FILE_ATTRIBUTE_TAG_INFORMATION FileTagInfo; + + /* Get relative name */ + if (!RtlDosPathNameToRelativeNtPathName_U(lpPathName, &NtPathU, NULL, &RelativeName)) + { + SetLastError(ERROR_PATH_NOT_FOUND); + return FALSE; + } + + /* Save buffer to allow later freeing */ + PathUBuffer = NtPathU.Buffer; + + /* If we have relative name (and root dir), use them instead */ + if (RelativeName.RelativeName.Length != 0) + { + NtPathU.Length = RelativeName.RelativeName.Length; + NtPathU.MaximumLength = RelativeName.RelativeName.MaximumLength; + NtPathU.Buffer = RelativeName.RelativeName.Buffer; + } + else + { + RelativeName.ContainingDirectory = NULL; + } + + InitializeObjectAttributes(&ObjectAttributes, + &NtPathU, + OBJ_CASE_INSENSITIVE, + RelativeName.ContainingDirectory, + NULL); + + /* Try to open directory */ + Status = NtOpenFile(&DirectoryHandle, + DELETE | SYNCHRONIZE | FAILED_ACCESS_ACE_FLAG, + &ObjectAttributes, + &IoStatusBlock, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT | + FILE_OPEN_FOR_BACKUP_INTENT | FILE_OPEN_REPARSE_POINT); + if (!NT_SUCCESS(Status)) + { + /* We only accept failure for reparse points not being supported */ + if (Status != STATUS_INVALID_PARAMETER) + { + goto Cleanup; + } + + /* Try to open, with reparse points support */ Status = NtOpenFile(&DirectoryHandle, DELETE | SYNCHRONIZE, &ObjectAttributes, &IoStatusBlock, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, - FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT); - - RtlFreeUnicodeString(&NtPathU); - + FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT | + FILE_OPEN_FOR_BACKUP_INTENT); if (!NT_SUCCESS(Status)) { - WARN("Status 0x%08x\n", Status); - BaseSetLastNTError (Status); - return FALSE; - } - - FileDispInfo.DeleteFile = TRUE; - - Status = NtSetInformationFile (DirectoryHandle, - &IoStatusBlock, - &FileDispInfo, - sizeof(FILE_DISPOSITION_INFORMATION), - FileDispositionInformation); + goto Cleanup; + } + + /* Success, mark directory */ + goto MarkFileForDelete; + } + + /* Get information about file (and reparse point) */ + Status = NtQueryInformationFile(DirectoryHandle, + &IoStatusBlock, + &FileTagInfo, + sizeof(FileTagInfo), + FileAttributeTagInformation); + if (!NT_SUCCESS(Status)) + { + /* FSD might not support querying reparse points information */ + if (Status != STATUS_NOT_IMPLEMENTED && + Status != STATUS_INVALID_PARAMETER) + { + goto CleanupHandle; + } + + /* If that's the case, then just delete directory */ + goto MarkFileForDelete; + } + + /* If that's not a reparse point, nothing more to do than just delete */ + if (!(FileTagInfo.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)) + { + goto MarkFileForDelete; + } + + /* Check if that's a mount point */ + if (FileTagInfo.ReparseTag != IO_REPARSE_TAG_MOUNT_POINT) + { + /* It's not */ NtClose(DirectoryHandle); - if (!NT_SUCCESS(Status)) - { - BaseSetLastNTError (Status); - return FALSE; - } - - return TRUE; + /* So, try to reopen directory, ignoring mount point */ + Status = NtOpenFile(&DirectoryHandle, + DELETE | SYNCHRONIZE, + &ObjectAttributes, + &IoStatusBlock, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT | + FILE_OPEN_FOR_BACKUP_INTENT); + if (NT_SUCCESS(Status)) + { + /* It succeed, we can safely delete directory (and ignore reparse point) */ + goto MarkFileForDelete; + } + + /* If it failed, only allow case where IO mount point was ignored */ + if (Status != STATUS_IO_REPARSE_TAG_NOT_HANDLED) + { + goto Cleanup; + } + + /* Reopen with reparse point support */ + Status = NtOpenFile(&DirectoryHandle, + DELETE | SYNCHRONIZE, + &ObjectAttributes, + &IoStatusBlock, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT | + FILE_OPEN_FOR_BACKUP_INTENT | FILE_OPEN_REPARSE_POINT); + if (NT_SUCCESS(Status)) + { + /* And mark for delete */ + goto MarkFileForDelete; + } + + goto Cleanup; + } + + /* Here, we have a mount point, prepare to query information about it */ + ReparseDataBuffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, + MAXIMUM_REPARSE_DATA_BUFFER_SIZE); + if (!ReparseDataBuffer) + { + RtlReleaseRelativeName(&RelativeName); + RtlFreeHeap(RtlGetProcessHeap(), 0, PathUBuffer); + NtClose(DirectoryHandle); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } + + /* Query */ + if (!DeviceIoControl(DirectoryHandle, + FSCTL_GET_REPARSE_POINT, + NULL, 0, + ReparseDataBuffer, + MAXIMUM_REPARSE_DATA_BUFFER_SIZE, + &BytesReturned, + NULL)) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, ReparseDataBuffer); + goto MarkFileForDelete; + } + + /* Get volume name */ + SubstituteName = (PWSTR)((ULONG_PTR)ReparseDataBuffer->MountPointReparseBuffer.PathBuffer + + ReparseDataBuffer->MountPointReparseBuffer.SubstituteNameOffset); + if (!IS_VOLUME_NAME(SubstituteName, ReparseDataBuffer->MountPointReparseBuffer.SubstituteNameLength)) + { + /* This is not a volume, we can safely delete */ + RtlFreeHeap(RtlGetProcessHeap(), 0, ReparseDataBuffer); + goto MarkFileForDelete; + } + + /* Prepare to delete mount point */ + RtlInitUnicodeString(&PathName, lpPathName); + PathName.Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, PathName.Length + 2 * sizeof(WCHAR)); + if (!PathName.Buffer) + { + RtlReleaseRelativeName(&RelativeName); + RtlFreeHeap(RtlGetProcessHeap(), 0, ReparseDataBuffer); + NtClose(DirectoryHandle); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } + + RtlCopyMemory(&PathName.Buffer, lpPathName, PathName.Length); + if (PathName.Buffer[PathName.Length / sizeof(WCHAR)] != L'\\') + { + PathName.Buffer[PathName.Length / sizeof(WCHAR)] = L'\\'; + PathName.Buffer[(PathName.Length / sizeof(WCHAR)) + 1] = UNICODE_NULL; + } + + /* Delete mount point for that volume */ + DeleteVolumeMountPointW(PathName.Buffer); + RtlFreeHeap(RtlGetProcessHeap(), 0, PathName.Buffer); + RtlFreeHeap(RtlGetProcessHeap(), 0, ReparseDataBuffer); + + /* And mark directory for delete */ +MarkFileForDelete: + RtlReleaseRelativeName(&RelativeName); + RtlFreeHeap(RtlGetProcessHeap(), 0, PathUBuffer); + + /* Mark & set */ + FileDispInfo.DeleteFile = TRUE; + Status = NtSetInformationFile(DirectoryHandle, + &IoStatusBlock, + &FileDispInfo, + sizeof(FILE_DISPOSITION_INFORMATION), + FileDispositionInformation); + NtClose(DirectoryHandle); + + if (!NT_SUCCESS(Status)) + { + BaseSetLastNTError (Status); + return FALSE; + } + + return TRUE; + +CleanupHandle: + NtClose(DirectoryHandle); + +Cleanup: + RtlReleaseRelativeName(&RelativeName); + RtlFreeHeap(RtlGetProcessHeap(), 0, PathUBuffer); + BaseSetLastNTError(Status); + return FALSE; } /* EOF */
12 years, 11 months
1
0
0
0
[pschweitzer] 54803: [KERNEL32] Implement BaseMarkFileForDelete. This will be used later.
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Jan 1 17:19:31 2012 New Revision: 54803 URL:
http://svn.reactos.org/svn/reactos?rev=54803&view=rev
Log: [KERNEL32] Implement BaseMarkFileForDelete. This will be used later. Modified: trunk/reactos/dll/win32/kernel32/client/utils.c trunk/reactos/dll/win32/kernel32/include/kernel32.h Modified: trunk/reactos/dll/win32/kernel32/client/utils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/utils.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/utils.c [iso-8859-1] Sun Jan 1 17:19:31 2012 @@ -828,6 +828,51 @@ } /* + * @implemented + */ +VOID +WINAPI +BaseMarkFileForDelete(IN HANDLE FileHandle, + IN ULONG FileAttributes) +{ + IO_STATUS_BLOCK IoStatusBlock; + FILE_BASIC_INFORMATION FileBasicInfo; + FILE_DISPOSITION_INFORMATION FileDispositionInfo; + + /* If no attributes were given, get them */ + if (!FileAttributes) + { + FileBasicInfo.FileAttributes = 0; + NtQueryInformationFile(FileHandle, + &IoStatusBlock, + &FileBasicInfo, + sizeof(FileBasicInfo), + FileBasicInformation); + FileAttributes = FileBasicInfo.FileAttributes; + } + + /* If file is marked as RO, reset its attributes */ + if (FileAttributes & FILE_ATTRIBUTE_READONLY) + { + RtlZeroMemory(&FileBasicInfo, sizeof(FileBasicInfo)); + FileBasicInfo.FileAttributes = FILE_ATTRIBUTE_NORMAL; + NtSetInformationFile(FileHandle, + &IoStatusBlock, + &FileBasicInfo, + sizeof(FileBasicInfo), + FileBasicInformation); + } + + /* Finally, mark the file for deletion */ + FileDispositionInfo.DeleteFile = TRUE; + NtSetInformationFile(FileHandle, + &IoStatusBlock, + &FileDispositionInfo, + sizeof(FileDispositionInfo), + FileDispositionInformation); +} + +/* * @unimplemented */ BOOL Modified: trunk/reactos/dll/win32/kernel32/include/kernel32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/include…
============================================================================== --- trunk/reactos/dll/win32/kernel32/include/kernel32.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/include/kernel32.h [iso-8859-1] Sun Jan 1 17:19:31 2012 @@ -323,3 +323,7 @@ IN PVOID Context, OUT BOOLEAN *StopEnumeration); +VOID +WINAPI +BaseMarkFileForDelete(IN HANDLE FileHandle, + IN ULONG FileAttributes);
12 years, 11 months
1
0
0
0
[pschweitzer] 54802: [NTDLL] Export RtlReleaseRelativeName
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Jan 1 17:18:13 2012 New Revision: 54802 URL:
http://svn.reactos.org/svn/reactos?rev=54802&view=rev
Log: [NTDLL] Export RtlReleaseRelativeName Modified: trunk/reactos/dll/ntdll/def/ntdll.pspec trunk/reactos/dll/ntdll/def/ntdll.spec Modified: trunk/reactos/dll/ntdll/def/ntdll.pspec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/def/ntdll.pspec?…
============================================================================== --- trunk/reactos/dll/ntdll/def/ntdll.pspec [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/def/ntdll.pspec [iso-8859-1] Sun Jan 1 17:18:13 2012 @@ -850,6 +850,7 @@ //@ stdcall RtlReleaseMemoryStream @ stdcall RtlReleasePebLock() @ stdcall RtlReleasePrivilege(ptr) +@ stdcall RtlReleaseRelativeName(ptr) @ stdcall RtlReleaseResource(ptr) @ stdcall RtlReleaseSRWLockExclusive(ptr) @ stdcall RtlReleaseSRWLockShared(ptr) Modified: trunk/reactos/dll/ntdll/def/ntdll.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/def/ntdll.spec?r…
============================================================================== --- trunk/reactos/dll/ntdll/def/ntdll.spec [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/def/ntdll.spec [iso-8859-1] Sun Jan 1 17:18:13 2012 @@ -849,6 +849,7 @@ ;@ stdcall RtlReleaseMemoryStream @ stdcall RtlReleasePebLock() @ stdcall RtlReleasePrivilege(ptr) +@ stdcall RtlReleaseRelativeName(ptr) @ stdcall RtlReleaseResource(ptr) @ stdcall RtlReleaseSRWLockExclusive(ptr) @ stdcall RtlReleaseSRWLockShared(ptr)
12 years, 11 months
1
0
0
0
[pschweitzer] 54801: [NDK/RTL] Fix RtlIsDosDeviceName_U, RtlIsDosDeviceName_Ustr, RtlDosPathNameToRelativeNtPathName_U, RtlDosPathNameToRelativeNtPathName_U_WithStatus prototypes.
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Jan 1 17:17:07 2012 New Revision: 54801 URL:
http://svn.reactos.org/svn/reactos?rev=54801&view=rev
Log: [NDK/RTL] Fix RtlIsDosDeviceName_U, RtlIsDosDeviceName_Ustr, RtlDosPathNameToRelativeNtPathName_U, RtlDosPathNameToRelativeNtPathName_U_WithStatus prototypes. Modified: trunk/reactos/include/ndk/rtlfuncs.h trunk/reactos/lib/rtl/path.c Modified: trunk/reactos/include/ndk/rtlfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/rtlfuncs.h?rev…
============================================================================== --- trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] Sun Jan 1 17:17:07 2012 @@ -2508,6 +2508,16 @@ ); NTSYSAPI +BOOLEAN +NTAPI +RtlDosPathNameToRelativeNtPathName_U( + IN PCWSTR DosName, + OUT PUNICODE_STRING NtName, + OUT PCWSTR * PartName, + OUT PRTL_RELATIVE_NAME_U RelativeName +); + +NTSYSAPI NTSTATUS NTAPI RtlExpandEnvironmentStrings_U( @@ -2539,14 +2549,14 @@ ULONG NTAPI RtlIsDosDeviceName_U( - IN PWSTR Name + IN PCWSTR Name ); NTSYSAPI ULONG NTAPI RtlIsDosDeviceName_Ustr( - IN PUNICODE_STRING Name + IN PCUNICODE_STRING Name ); Modified: trunk/reactos/lib/rtl/path.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/path.c?rev=54801&r…
============================================================================== --- trunk/reactos/lib/rtl/path.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/path.c [iso-8859-1] Sun Jan 1 17:17:07 2012 @@ -43,7 +43,7 @@ ULONG NTAPI -RtlIsDosDeviceName_Ustr(IN PUNICODE_STRING PathString) +RtlIsDosDeviceName_Ustr(IN PCUNICODE_STRING PathString) { UNICODE_STRING PathCopy; PWCHAR Start, End; @@ -851,7 +851,7 @@ */ ULONG NTAPI -RtlIsDosDeviceName_U(IN PWSTR Path) +RtlIsDosDeviceName_U(IN PCWSTR Path) { UNICODE_STRING PathString; NTSTATUS Status; @@ -1418,7 +1418,7 @@ */ BOOLEAN NTAPI -RtlDosPathNameToRelativeNtPathName_U(IN PWSTR DosName, +RtlDosPathNameToRelativeNtPathName_U(IN PCWSTR DosName, OUT PUNICODE_STRING NtName, OUT PCWSTR *PartName, OUT PRTL_RELATIVE_NAME_U RelativeName) @@ -1437,7 +1437,7 @@ */ NTSTATUS NTAPI -RtlDosPathNameToRelativeNtPathName_U_WithStatus(IN PWSTR DosName, +RtlDosPathNameToRelativeNtPathName_U_WithStatus(IN PCWSTR DosName, OUT PUNICODE_STRING NtName, OUT PCWSTR *PartName, OUT PRTL_RELATIVE_NAME_U RelativeName)
12 years, 11 months
1
0
0
0
[pschweitzer] 54800: [FASTFAT] Revert r54788: it's not appropriate yet.
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Jan 1 17:15:25 2012 New Revision: 54800 URL:
http://svn.reactos.org/svn/reactos?rev=54800&view=rev
Log: [FASTFAT] Revert r54788: it's not appropriate yet. Modified: trunk/reactos/drivers/filesystems/fastfat/finfo.c Modified: trunk/reactos/drivers/filesystems/fastfat/finfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/finfo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/finfo.c [iso-8859-1] Sun Jan 1 17:15:25 2012 @@ -517,9 +517,8 @@ { /* FIXME */ DPRINT1("VFAT: FileEaInformation not implemented!\n"); - return STATUS_SUCCESS; - } - return STATUS_EAS_NOT_SUPPORTED; + } + return STATUS_SUCCESS; }
12 years, 11 months
1
0
0
0
[pschweitzer] 54799: [REACTOS] Temporarily hackfix r50254 (let's say for a year) Happy New Year everyone!
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Jan 1 13:30:40 2012 New Revision: 54799 URL:
http://svn.reactos.org/svn/reactos?rev=54799&view=rev
Log: [REACTOS] Temporarily hackfix r50254 (let's say for a year) Happy New Year everyone! Modified: trunk/reactos/include/reactos/version.cmake trunk/reactos/include/reactos/version.h Modified: trunk/reactos/include/reactos/version.cmake URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/version.cm…
============================================================================== --- trunk/reactos/include/reactos/version.cmake [iso-8859-1] (original) +++ trunk/reactos/include/reactos/version.cmake [iso-8859-1] Sun Jan 1 13:30:40 2012 @@ -32,7 +32,7 @@ set(KERNEL_VERSION_MAJOR "0") set(KERNEL_VERSION_MINOR "4") set(KERNEL_VERSION_PATCH_LEVEL "0") -set(COPYRIGHT_YEAR "2011") +set(COPYRIGHT_YEAR "2012") # KERNEL_VERSION_BUILD_TYPE is "SVN", "RC1", "RC2" or "" (for the release) set(KERNEL_VERSION_BUILD_TYPE "SVN") Modified: trunk/reactos/include/reactos/version.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/version.h?…
============================================================================== --- trunk/reactos/include/reactos/version.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/version.h [iso-8859-1] Sun Jan 1 13:30:40 2012 @@ -21,7 +21,7 @@ #define KERNEL_VERSION_MINOR 4 #define KERNEL_VERSION_PATCH_LEVEL 0 -#define COPYRIGHT_YEAR "2011" +#define COPYRIGHT_YEAR "2012" /* KERNEL_VERSION_BUILD_TYPE is L"SVN", L"RC1", L"RC2" or L"" (for the release) */ #define KERNEL_VERSION_BUILD_TYPE L"SVN"
12 years, 11 months
1
0
0
0
← Newer
1
...
53
54
55
56
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Results per page:
10
25
50
100
200