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
July 2014
----- 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
9 participants
111 discussions
Start a n
N
ew thread
[jgardou] 63701: [SETUPAPI_APITEST] - Try restoring UTF8 character which got lost in translation.
by jgardou@svn.reactos.org
Author: jgardou Date: Tue Jul 8 22:44:44 2014 New Revision: 63701 URL:
http://svn.reactos.org/svn/reactos?rev=63701&view=rev
Log: [SETUPAPI_APITEST] - Try restoring UTF8 character which got lost in translation. Modified: trunk/rostests/apitests/setupapi/devclass.c Modified: trunk/rostests/apitests/setupapi/devclass.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/setupapi/devclas…
============================================================================== --- trunk/rostests/apitests/setupapi/devclass.c [iso-8859-1] (original) +++ trunk/rostests/apitests/setupapi/devclass.c [iso-8859-1] Tue Jul 8 22:44:44 2014 @@ -1,7 +1,7 @@ /* * SetupAPI device class-related functions tests * - * Copyright 2006 Herv� Poussineau + * Copyright 2006 Hervé Poussineau * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public Licence as
10 years, 5 months
1
0
0
0
[jgardou] 63700: [NTOSKRNL] - Use ZwSetValueKey instead of NtSetValueKey - Properly probe and copy parameters when NtSetValueKey is called from UMode CORE-7738 #resolve #comment fixed in r63700
by jgardou@svn.reactos.org
Author: jgardou Date: Tue Jul 8 18:42:20 2014 New Revision: 63700 URL:
http://svn.reactos.org/svn/reactos?rev=63700&view=rev
Log: [NTOSKRNL] - Use ZwSetValueKey instead of NtSetValueKey - Properly probe and copy parameters when NtSetValueKey is called from UMode CORE-7738 #resolve #comment fixed in r63700 Modified: trunk/reactos/ntoskrnl/config/cmconfig.c trunk/reactos/ntoskrnl/config/cmsysini.c trunk/reactos/ntoskrnl/config/i386/cmhardwr.c trunk/reactos/ntoskrnl/config/ntapi.c trunk/reactos/ntoskrnl/config/powerpc/cmhardwr.c trunk/reactos/ntoskrnl/ex/init.c trunk/reactos/ntoskrnl/io/iomgr/bootlog.c Modified: trunk/reactos/ntoskrnl/config/cmconfig.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmconfig.c…
============================================================================== --- trunk/reactos/ntoskrnl/config/cmconfig.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/config/cmconfig.c [iso-8859-1] Tue Jul 8 18:42:20 2014 @@ -97,7 +97,7 @@ /* Setup the component information key */ RtlInitUnicodeString(&ValueName, L"Component Information"); - Status = NtSetValueKey(KeyHandle, + Status = ZwSetValueKey(KeyHandle, &ValueName, 0, REG_BINARY, @@ -124,7 +124,7 @@ if (NT_SUCCESS(Status)) { /* Save the identifier in the registry */ - Status = NtSetValueKey(KeyHandle, + Status = ZwSetValueKey(KeyHandle, &ValueName, 0, REG_SZ, @@ -178,7 +178,7 @@ CmpConfigurationData->BusNumber = BusNumber; /* Save the actual data */ - Status = NtSetValueKey(KeyHandle, + Status = ZwSetValueKey(KeyHandle, &ValueName, 0, REG_FULL_RESOURCE_DESCRIPTOR, Modified: trunk/reactos/ntoskrnl/config/cmsysini.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmsysini.c…
============================================================================== --- trunk/reactos/ntoskrnl/config/cmsysini.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/config/cmsysini.c [iso-8859-1] Tue Jul 8 18:42:20 2014 @@ -416,7 +416,7 @@ /* Key opened, now write to the key */ RtlInitUnicodeString(&KeyName, L"SystemStartOptions"); - Status = NtSetValueKey(KeyHandle, + Status = ZwSetValueKey(KeyHandle, &KeyName, 0, REG_SZ, @@ -427,7 +427,7 @@ /* Setup value name for system boot device in ARC format */ RtlInitUnicodeString(&KeyName, L"SystemBootDevice"); RtlCreateUnicodeStringFromAsciiz(&ValueName, LoaderBlock->ArcBootDeviceName); - Status = NtSetValueKey(KeyHandle, + Status = ZwSetValueKey(KeyHandle, &KeyName, 0, REG_SZ, @@ -474,7 +474,7 @@ OBJ_CASE_INSENSITIVE, NULL, NULL); - Status = NtOpenKey(&SelectHandle, KEY_READ, &ObjectAttributes); + Status = ZwOpenKey(&SelectHandle, KEY_READ, &ObjectAttributes); if (!NT_SUCCESS(Status)) { /* ReactOS Hack: Hard-code current to 001 for SetupLdr */ @@ -488,16 +488,17 @@ OBJ_CASE_INSENSITIVE, NULL, NULL); - Status = NtCreateKey(&KeyHandle, + Status = ZwCreateKey(&KeyHandle, KEY_ALL_ACCESS, &ObjectAttributes, 0, NULL, 0, &Disposition); - if (!NT_SUCCESS(Status)) return Status; - - /* Don't need the handle */ + if (!NT_SUCCESS(Status)) + return Status; + + /* We don't need the handle */ ZwClose(KeyHandle); /* Use hard-coded setting */ @@ -533,7 +534,7 @@ OBJ_CASE_INSENSITIVE, NULL, NULL); - Status = NtCreateKey(&KeyHandle, + Status = ZwCreateKey(&KeyHandle, KEY_CREATE_LINK, &ObjectAttributes, 0, @@ -557,7 +558,7 @@ Status = RtlAnsiStringToUnicodeString(&KeyName, &TempString, FALSE); /* Set the value */ - Status = NtSetValueKey(KeyHandle, + Status = ZwSetValueKey(KeyHandle, &CmSymbolicLinkValueName, 0, REG_LINK, @@ -572,7 +573,7 @@ KeyHandle, NULL); Status = NtOpenKey(&ConfigHandle, KEY_READ, &ObjectAttributes); - NtClose(KeyHandle); + ZwClose(KeyHandle); /* Check if we don't have one */ if (!NT_SUCCESS(Status)) @@ -689,7 +690,7 @@ ASSERT(STATUS_SUCCESS == Status); /* Set it */ - Status = NtSetValueKey(KeyHandle, + Status = ZwSetValueKey(KeyHandle, &CmSymbolicLinkValueName, 0, REG_LINK, @@ -2180,7 +2181,7 @@ RtlInitUnicodeString(&ValueData, Buffer); - NtSetValueKey(CurrentVersionKeyHandle, + ZwSetValueKey(CurrentVersionKeyHandle, &ValueName, 0, REG_SZ, Modified: trunk/reactos/ntoskrnl/config/i386/cmhardwr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/i386/cmhar…
============================================================================== --- trunk/reactos/ntoskrnl/config/i386/cmhardwr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/config/i386/cmhardwr.c [iso-8859-1] Tue Jul 8 18:42:20 2014 @@ -268,7 +268,7 @@ /* Set the value */ RtlInitUnicodeString(&ValueName, L"PhysicalAddressExtension"); - NtSetValueKey(KeyHandle, + ZwSetValueKey(KeyHandle, &ValueName, 0, REG_DWORD, @@ -463,7 +463,7 @@ /* Add it to the registry */ RtlInitUnicodeString(&ValueName, L"ProcessorNameString"); - Status = NtSetValueKey(KeyHandle, + Status = ZwSetValueKey(KeyHandle, &ValueName, 0, REG_SZ, @@ -486,7 +486,7 @@ /* Add it to the registry */ RtlInitUnicodeString(&ValueName, L"VendorIdentifier"); - Status = NtSetValueKey(KeyHandle, + Status = ZwSetValueKey(KeyHandle, &ValueName, 0, REG_SZ, @@ -502,7 +502,7 @@ { /* Add them to the registry */ RtlInitUnicodeString(&ValueName, L"FeatureSet"); - Status = NtSetValueKey(KeyHandle, + Status = ZwSetValueKey(KeyHandle, &ValueName, 0, REG_DWORD, @@ -515,7 +515,7 @@ { /* Add it to the registry */ RtlInitUnicodeString(&ValueName, L"~MHz"); - Status = NtSetValueKey(KeyHandle, + Status = ZwSetValueKey(KeyHandle, &ValueName, 0, REG_DWORD, @@ -528,7 +528,7 @@ { /* Add it to the registry */ RtlInitUnicodeString(&ValueName, L"Update Signature"); - Status = NtSetValueKey(KeyHandle, + Status = ZwSetValueKey(KeyHandle, &ValueName, 0, REG_BINARY, @@ -621,7 +621,7 @@ /* Write the date into the registry */ RtlInitUnicodeString(&ValueName, L"SystemBiosDate"); - Status = NtSetValueKey(SystemHandle, + Status = ZwSetValueKey(SystemHandle, &ValueName, 0, REG_SZ, @@ -643,7 +643,7 @@ if (NT_SUCCESS(Status)) { /* Save it to the registry */ - Status = NtSetValueKey(BiosHandle, + Status = ZwSetValueKey(BiosHandle, &ValueName, 0, REG_SZ, @@ -703,7 +703,7 @@ /* Write the BIOS Version to the registry */ RtlInitUnicodeString(&ValueName, L"SystemBiosVersion"); - Status = NtSetValueKey(SystemHandle, + Status = ZwSetValueKey(SystemHandle, &ValueName, 0, REG_MULTI_SZ, @@ -746,7 +746,7 @@ /* Write the date into the registry */ RtlInitUnicodeString(&ValueName, L"VideoBiosDate"); - Status = NtSetValueKey(SystemHandle, + Status = ZwSetValueKey(SystemHandle, &ValueName, 0, REG_SZ, @@ -801,7 +801,7 @@ /* Write the BIOS Version to the registry */ RtlInitUnicodeString(&ValueName, L"VideoBiosVersion"); - Status = NtSetValueKey(SystemHandle, + Status = ZwSetValueKey(SystemHandle, &ValueName, 0, REG_MULTI_SZ, Modified: trunk/reactos/ntoskrnl/config/ntapi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/ntapi.c?re…
============================================================================== --- trunk/reactos/ntoskrnl/config/ntapi.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/config/ntapi.c [iso-8859-1] Tue Jul 8 18:42:20 2014 @@ -33,7 +33,10 @@ CM_PARSE_CONTEXT ParseContext = {0}; HANDLE Handle; PAGED_CODE(); - DPRINT("NtCreateKey(OB name %wZ)\n", ObjectAttributes->ObjectName); + + DPRINT("NtCreateKey(Path: %wZ, Root %x, Access: %x, CreateOptions %x)\n", + ObjectAttributes->ObjectName, ObjectAttributes->RootDirectory, + DesiredAccess, CreateOptions); /* Check for user-mode caller */ if (PreviousMode != KernelMode) @@ -60,7 +63,8 @@ sizeof(OBJECT_ATTRIBUTES), sizeof(ULONG)); - if (Disposition) ProbeForWriteUlong(Disposition); + if (Disposition) + ProbeForWriteUlong(Disposition); } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { @@ -101,6 +105,8 @@ } _SEH2_END; + DPRINT("Returning handle %x, Status %x.\n", Handle, Status); + /* Return status */ return Status; } @@ -116,7 +122,8 @@ NTSTATUS Status; KPROCESSOR_MODE PreviousMode = ExGetPreviousMode(); PAGED_CODE(); - DPRINT("NtOpenKey(OB 0x%wZ)\n", ObjectAttributes->ObjectName); + DPRINT("NtOpenKey(Path: %wZ, Root %x, Access: %x)\n", + ObjectAttributes->ObjectName, ObjectAttributes->RootDirectory, DesiredAccess); /* Check for user-mode caller */ if (PreviousMode != KernelMode) @@ -166,6 +173,8 @@ _SEH2_END; } + DPRINT("Returning handle %x, Status %x.\n", Handle, Status); + /* Return status */ return Status; } @@ -301,6 +310,7 @@ /* Dereference and return status */ ObDereferenceObject(KeyObject); + DPRINT("Returning status %x.\n", Status); return Status; } @@ -604,14 +614,52 @@ IN PVOID Data, IN ULONG DataSize) { - NTSTATUS Status; - PCM_KEY_BODY KeyObject; + NTSTATUS Status = STATUS_SUCCESS; + PCM_KEY_BODY KeyObject = NULL; REG_SET_VALUE_KEY_INFORMATION SetValueKeyInfo; REG_POST_OPERATION_INFORMATION PostOperationInfo; - UNICODE_STRING ValueNameCopy = *ValueName; + UNICODE_STRING ValueNameCopy; + KPROCESSOR_MODE PreviousMode; + PAGED_CODE(); + + PreviousMode = ExGetPreviousMode(); + + if (Data && !DataSize) + return STATUS_INVALID_PARAMETER; + + /* Probe and copy the data */ + if ((PreviousMode != KernelMode) && Data) + { + PVOID DataCopy = ExAllocatePoolWithTag(PagedPool, DataSize, TAG_CM); + if (!DataCopy) + return STATUS_NO_MEMORY; + _SEH2_TRY + { + ProbeForRead(Data, DataSize, 1); + RtlCopyMemory(DataCopy, Data, DataSize); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + + if (!NT_SUCCESS(Status)) + { + ExFreePoolWithTag(DataCopy, TAG_CM); + return Status; + } + Data = DataCopy; + } + + /* Capture the string */ + Status = ProbeAndCaptureUnicodeString(&ValueNameCopy, PreviousMode, ValueName); + if (!NT_SUCCESS(Status)) + goto end; + DPRINT("NtSetValueKey() KH 0x%p, VN '%wZ', TI %x, T %lu, DS %lu\n", - KeyHandle, ValueName, TitleIndex, Type, DataSize); + KeyHandle, &ValueNameCopy, TitleIndex, Type, DataSize); /* Verify that the handle is valid and is a registry key */ Status = ObReferenceObjectByHandle(KeyHandle, @@ -620,7 +668,8 @@ ExGetPreviousMode(), (PVOID*)&KeyObject, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) + goto end; /* Make sure the name is aligned, not too long, and the data under 4GB */ if ( (ValueNameCopy.Length > 32767) || @@ -628,8 +677,8 @@ (DataSize > 0x80000000)) { /* Fail */ - ObDereferenceObject(KeyObject); - return STATUS_INVALID_PARAMETER; + Status = STATUS_INVALID_PARAMETER; + goto end; } /* Ignore any null characters at the end */ @@ -644,14 +693,14 @@ if (KeyObject->KeyControlBlock->ExtFlags & CM_KCB_READ_ONLY_KEY) { /* Fail */ - ObDereferenceObject(KeyObject); - return STATUS_ACCESS_DENIED; + Status = STATUS_ACCESS_DENIED; + goto end; } /* Setup callback */ PostOperationInfo.Object = (PVOID)KeyObject; SetValueKeyInfo.Object = (PVOID)KeyObject; - SetValueKeyInfo.ValueName = ValueName; + SetValueKeyInfo.ValueName = &ValueNameCopy; SetValueKeyInfo.TitleIndex = TitleIndex; SetValueKeyInfo.Type = Type; SetValueKeyInfo.Data = Data; @@ -673,8 +722,13 @@ PostOperationInfo.Status = Status; CmiCallRegisteredCallbacks(RegNtPostSetValueKey, &PostOperationInfo); +end: /* Dereference and return status */ - ObDereferenceObject(KeyObject); + if (KeyObject) + ObDereferenceObject(KeyObject); + ReleaseCapturedUnicodeString(&ValueNameCopy, PreviousMode); + if ((PreviousMode != KernelMode) && Data) + ExFreePoolWithTag(Data, TAG_CM); return Status; } Modified: trunk/reactos/ntoskrnl/config/powerpc/cmhardwr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/powerpc/cm…
============================================================================== --- trunk/reactos/ntoskrnl/config/powerpc/cmhardwr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/config/powerpc/cmhardwr.c [iso-8859-1] Tue Jul 8 18:42:20 2014 @@ -267,7 +267,7 @@ /* Set the value */ RtlInitUnicodeString(&ValueName, L"PhysicalAddressExtension"); - NtSetValueKey(KeyHandle, + ZwSetValueKey(KeyHandle, &ValueName, 0, REG_DWORD, @@ -465,7 +465,7 @@ /* Add it to the registry */ RtlInitUnicodeString(&ValueName, L"ProcessorNameString"); - Status = NtSetValueKey(KeyHandle, + Status = ZwSetValueKey(KeyHandle, &ValueName, 0, REG_SZ, @@ -488,7 +488,7 @@ /* Add it to the registry */ RtlInitUnicodeString(&ValueName, L"VendorIdentifier"); - Status = NtSetValueKey(KeyHandle, + Status = ZwSetValueKey(KeyHandle, &ValueName, 0, REG_SZ, @@ -504,7 +504,7 @@ { /* Add them to the registry */ RtlInitUnicodeString(&ValueName, L"FeatureSet"); - Status = NtSetValueKey(KeyHandle, + Status = ZwSetValueKey(KeyHandle, &ValueName, 0, REG_DWORD, @@ -517,7 +517,7 @@ { /* Add it to the registry */ RtlInitUnicodeString(&ValueName, L"~MHz"); - Status = NtSetValueKey(KeyHandle, + Status = ZwSetValueKey(KeyHandle, &ValueName, 0, REG_DWORD, @@ -530,7 +530,7 @@ { /* Add it to the registry */ RtlInitUnicodeString(&ValueName, L"Update Signature"); - Status = NtSetValueKey(KeyHandle, + Status = ZwSetValueKey(KeyHandle, &ValueName, 0, REG_BINARY, @@ -623,7 +623,7 @@ /* Write the date into the registry */ RtlInitUnicodeString(&ValueName, L"SystemBiosDate"); - Status = NtSetValueKey(SystemHandle, + Status = ZwSetValueKey(SystemHandle, &ValueName, 0, REG_SZ, @@ -645,7 +645,7 @@ if (NT_SUCCESS(Status)) { /* Save it to the registry */ - Status = NtSetValueKey(BiosHandle, + Status = ZwSetValueKey(BiosHandle, &ValueName, 0, REG_SZ, @@ -705,7 +705,7 @@ /* Write the BIOS Version to the registry */ RtlInitUnicodeString(&ValueName, L"SystemBiosVersion"); - Status = NtSetValueKey(SystemHandle, + Status = ZwSetValueKey(SystemHandle, &ValueName, 0, REG_MULTI_SZ, @@ -749,7 +749,7 @@ /* Write the date into the registry */ RtlInitUnicodeString(&ValueName, L"VideoBiosDate"); - Status = NtSetValueKey(SystemHandle, + Status = ZwSetValueKey(SystemHandle, &ValueName, 0, REG_SZ, @@ -804,7 +804,7 @@ /* Write the BIOS Version to the registry */ RtlInitUnicodeString(&ValueName, L"VideoBiosVersion"); - Status = NtSetValueKey(SystemHandle, + Status = ZwSetValueKey(SystemHandle, &ValueName, 0, REG_MULTI_SZ, Modified: trunk/reactos/ntoskrnl/ex/init.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/init.c?rev=637…
============================================================================== --- trunk/reactos/ntoskrnl/ex/init.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/init.c [iso-8859-1] Tue Jul 8 18:42:20 2014 @@ -1853,7 +1853,7 @@ { /* Write the safe boot type */ RtlInitUnicodeString(&KeyName, L"OptionValue"); - NtSetValueKey(OptionHandle, + ZwSetValueKey(OptionHandle, &KeyName, 0, REG_DWORD, @@ -1866,7 +1866,7 @@ /* Remember this for later */ Disposition = TRUE; RtlInitUnicodeString(&KeyName, L"UseAlternateShell"); - NtSetValueKey(OptionHandle, + ZwSetValueKey(OptionHandle, &KeyName, 0, REG_DWORD, Modified: trunk/reactos/ntoskrnl/io/iomgr/bootlog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/bootlog.…
============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/bootlog.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/iomgr/bootlog.c [iso-8859-1] Tue Jul 8 18:42:20 2014 @@ -135,7 +135,7 @@ if (!NT_SUCCESS(Status)) { - DPRINT1("NtSetValueKey() failed (Status %lx)\n", Status); + DPRINT1("ZwSetValueKey() failed (Status %lx)\n", Status); } else {
10 years, 5 months
1
0
0
0
[jgardou] 63699: [NTDLL_APITEST] - Add tests for NtDeleteKey
by jgardou@svn.reactos.org
Author: jgardou Date: Mon Jul 7 14:46:04 2014 New Revision: 63699 URL:
http://svn.reactos.org/svn/reactos?rev=63699&view=rev
Log: [NTDLL_APITEST] - Add tests for NtDeleteKey Added: trunk/rostests/apitests/ntdll/NtDeleteKey.c (with props) Modified: trunk/rostests/apitests/ntdll/CMakeLists.txt trunk/rostests/apitests/ntdll/testlist.c Modified: trunk/rostests/apitests/ntdll/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/CMakeLists…
============================================================================== --- trunk/rostests/apitests/ntdll/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/apitests/ntdll/CMakeLists.txt [iso-8859-1] Mon Jul 7 14:46:04 2014 @@ -5,6 +5,7 @@ NtContinue.c NtCreateFile.c NtCreateThread.c + NtDeleteKey.c NtFreeVirtualMemory.c NtMapViewOfSection.c NtMutant.c Added: trunk/rostests/apitests/ntdll/NtDeleteKey.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/NtDeleteKe…
============================================================================== --- trunk/rostests/apitests/ntdll/NtDeleteKey.c (added) +++ trunk/rostests/apitests/ntdll/NtDeleteKey.c [iso-8859-1] Mon Jul 7 14:46:04 2014 @@ -0,0 +1,96 @@ +/* + * PROJECT: ReactOS API Tests + * LICENSE: GPLv2+ - See COPYING in the top level directory + * PURPOSE: Test for NtDeleteKey + */ + +#include <apitest.h> + +#define WIN32_NO_STATUS +#include <ndk/rtlfuncs.h> +#include <ndk/cmfuncs.h> +#include <ndk/obfuncs.h> +#include <ndk/setypes.h> + +static +NTSTATUS +CreateRegistryKeyHandle(PHANDLE KeyHandle, + ACCESS_MASK AccessMask, + PWCHAR RegistryPath) +{ + UNICODE_STRING KeyName; + OBJECT_ATTRIBUTES Attributes; + + RtlInitUnicodeString(&KeyName, RegistryPath); + InitializeObjectAttributes(&Attributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + + return NtCreateKey(KeyHandle, AccessMask, &Attributes, 0, NULL, REG_OPTION_VOLATILE, 0); +} + +START_TEST(NtDeleteKey) +{ + NTSTATUS Status; + HANDLE ParentKey, ChildKey; + + /* Create a registry key */ + Status = CreateRegistryKeyHandle(&ParentKey, KEY_READ | DELETE, L"\\Registry\\Machine\\Software\\RosTests"); + ok_ntstatus(Status, STATUS_SUCCESS); + + /* Create a children registry key */ + Status = CreateRegistryKeyHandle(&ChildKey, KEY_READ | DELETE, L"\\Registry\\Machine\\Software\\RosTests\\Child"); + ok_ntstatus(Status, STATUS_SUCCESS); + + /* Try deleting the parent one */ + Status = NtDeleteKey(ParentKey); + ok_ntstatus(Status, STATUS_CANNOT_DELETE); + + /* See what happens with Child one */ + Status = NtDeleteKey(ChildKey); + ok_ntstatus(Status, STATUS_SUCCESS); + + /* Retry with parent one */ + Status = NtDeleteKey(ParentKey); + ok_ntstatus(Status, STATUS_SUCCESS); + + /* re-retry */ + Status = NtDeleteKey(ParentKey); + ok_ntstatus(Status, STATUS_SUCCESS); + + /* Close everything */ + NtClose(ChildKey); + NtClose(ParentKey); + + /* Same, but this time close the child handle before trying to delete the parent */ + /* Create a registry key */ + Status = CreateRegistryKeyHandle(&ParentKey, KEY_READ | DELETE, L"\\Registry\\Machine\\Software\\RosTests"); + ok_ntstatus(Status, STATUS_SUCCESS); + + /* Create a children registry key */ + Status = CreateRegistryKeyHandle(&ChildKey, KEY_READ, L"\\Registry\\Machine\\Software\\RosTests\\Child"); + ok_ntstatus(Status, STATUS_SUCCESS); + + /* Close the Child */ + NtClose(ChildKey); + + /* Try deleting the parent one */ + Status = NtDeleteKey(ParentKey); + ok_ntstatus(Status, STATUS_CANNOT_DELETE); + + /* See what happens with Child one */ + Status = CreateRegistryKeyHandle(&ChildKey, DELETE, L"\\Registry\\Machine\\Software\\RosTests\\Child"); + ok_ntstatus(Status, STATUS_SUCCESS); + Status = NtDeleteKey(ChildKey); + ok_ntstatus(Status, STATUS_SUCCESS); + + /* Retry with parent one */ + Status = NtDeleteKey(ParentKey); + ok_ntstatus(Status, STATUS_SUCCESS); + + /* Close everything */ + NtClose(ChildKey); + NtClose(ParentKey); +} Propchange: trunk/rostests/apitests/ntdll/NtDeleteKey.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/rostests/apitests/ntdll/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/testlist.c…
============================================================================== --- trunk/rostests/apitests/ntdll/testlist.c [iso-8859-1] (original) +++ trunk/rostests/apitests/ntdll/testlist.c [iso-8859-1] Mon Jul 7 14:46:04 2014 @@ -8,6 +8,7 @@ extern void func_NtContinue(void); extern void func_NtCreateFile(void); extern void func_NtCreateThread(void); +extern void func_NtDeleteKey(void); extern void func_NtFreeVirtualMemory(void); extern void func_NtMapViewOfSection(void); extern void func_NtMutant(void); @@ -38,6 +39,7 @@ { "NtContinue", func_NtContinue }, { "NtCreateFile", func_NtCreateFile }, { "NtCreateThread", func_NtCreateThread }, + { "NtDeleteKey", func_NtDeleteKey }, { "NtFreeVirtualMemory", func_NtFreeVirtualMemory }, { "NtMapViewOfSection", func_NtMapViewOfSection }, { "NtMutant", func_NtMutant },
10 years, 5 months
1
0
0
0
[spetreolle] 63698: [DBGPRINT] --winetest mode: Use --list to get the tests list. Dedicated to Christoph :)
by spetreolle@svn.reactos.org
Author: spetreolle Date: Sun Jul 6 18:09:58 2014 New Revision: 63698 URL:
http://svn.reactos.org/svn/reactos?rev=63698&view=rev
Log: [DBGPRINT] --winetest mode: Use --list to get the tests list. Dedicated to Christoph :) Modified: trunk/reactos/base/applications/cmdutils/dbgprint/dbgprint.c Modified: trunk/reactos/base/applications/cmdutils/dbgprint/dbgprint.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/dbgprint/dbgprint.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/dbgprint/dbgprint.c [iso-8859-1] Sun Jul 6 18:09:58 2014 @@ -43,7 +43,9 @@ FILE *pPipe2; /* get available tests */ - pPipe = _tpopen(argv[2], "r"); + strcpy(cmd, argv[2]); + strcat(cmd, " --list"); + pPipe = _tpopen(cmd, "r"); if (pPipe != NULL) { while(fgets(psBuffer, 128, pPipe))
10 years, 5 months
1
0
0
0
[spetreolle] 63697: [DBGPRINT] Convert TABs to spaces.
by spetreolle@svn.reactos.org
Author: spetreolle Date: Sun Jul 6 17:36:56 2014 New Revision: 63697 URL:
http://svn.reactos.org/svn/reactos?rev=63697&view=rev
Log: [DBGPRINT] Convert TABs to spaces. Modified: trunk/reactos/base/applications/cmdutils/dbgprint/dbgprint.c Modified: trunk/reactos/base/applications/cmdutils/dbgprint/dbgprint.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/dbgprint/dbgprint.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/dbgprint/dbgprint.c [iso-8859-1] Sun Jul 6 17:36:56 2014 @@ -16,109 +16,109 @@ int _tmain(int argc, TCHAR ** argv) { - TCHAR * buf; - int bufsize; - int i; - int offset; + TCHAR * buf; + int bufsize; + int i; + int offset; - bufsize = 0; - for(i = 1; i < argc; i++) - { - bufsize += _tcslen(argv[i]) + 1; - } + bufsize = 0; + for(i = 1; i < argc; i++) + { + bufsize += _tcslen(argv[i]) + 1; + } - if (!bufsize) - { - return -1; - } + if (!bufsize) + { + return -1; + } - if (_tcsstr(argv[1], "--winetest") && (argc == 3)) - { - char psBuffer[128]; - char psBuffer2[128]; - char *nlptr2; - char cmd[255]; - char test[300]; - FILE *pPipe; - FILE *pPipe2; + if (_tcsstr(argv[1], "--winetest") && (argc == 3)) + { + char psBuffer[128]; + char psBuffer2[128]; + char *nlptr2; + char cmd[255]; + char test[300]; + FILE *pPipe; + FILE *pPipe2; - /* get available tests */ - pPipe = _tpopen(argv[2], "r"); - if (pPipe != NULL) - { - while(fgets(psBuffer, 128, pPipe)) - { - if (psBuffer[0] == ' ') - { - strcpy(cmd, argv[2]); - strcat(cmd, " "); - strcat(cmd, psBuffer+4); - /* run the current test */ - strcpy(test, "\n\nRunning "); - strcat(test, cmd); - OutputDebugStringA(test); - pPipe2 = _popen(cmd, "r"); - if (pPipe2 != NULL) - { - while(fgets(psBuffer2, 128, pPipe2)) - { - nlptr2 = strchr(psBuffer2, '\n'); - if (nlptr2) - *nlptr2 = '\0'; - puts(psBuffer2); - OutputDebugStringA(psBuffer2); - } - _pclose(pPipe2); - } - } - } - _pclose(pPipe); - } - } - else if (_tcsstr(argv[1], "--process") && (argc == 3)) - { - char psBuffer[128]; - FILE *pPipe; + /* get available tests */ + pPipe = _tpopen(argv[2], "r"); + if (pPipe != NULL) + { + while(fgets(psBuffer, 128, pPipe)) + { + if (psBuffer[0] == ' ') + { + strcpy(cmd, argv[2]); + strcat(cmd, " "); + strcat(cmd, psBuffer+4); + /* run the current test */ + strcpy(test, "\n\nRunning "); + strcat(test, cmd); + OutputDebugStringA(test); + pPipe2 = _popen(cmd, "r"); + if (pPipe2 != NULL) + { + while(fgets(psBuffer2, 128, pPipe2)) + { + nlptr2 = strchr(psBuffer2, '\n'); + if (nlptr2) + *nlptr2 = '\0'; + puts(psBuffer2); + OutputDebugStringA(psBuffer2); + } + _pclose(pPipe2); + } + } + } + _pclose(pPipe); + } + } + else if (_tcsstr(argv[1], "--process") && (argc == 3)) + { + char psBuffer[128]; + FILE *pPipe; - pPipe = _tpopen(argv[2], "r"); - if (pPipe != NULL) - { - while(fgets(psBuffer, 128, pPipe)) - { - puts(psBuffer); - OutputDebugStringA(psBuffer); - } - _pclose(pPipe); - } - } - else - { - buf = HeapAlloc(GetProcessHeap(), 0, (bufsize+1) * sizeof(TCHAR)); - if (!buf) - { - return -1; - } + pPipe = _tpopen(argv[2], "r"); + if (pPipe != NULL) + { + while(fgets(psBuffer, 128, pPipe)) + { + puts(psBuffer); + OutputDebugStringA(psBuffer); + } + _pclose(pPipe); + } + } + else + { + buf = HeapAlloc(GetProcessHeap(), 0, (bufsize+1) * sizeof(TCHAR)); + if (!buf) + { + return -1; + } - offset = 0; - for(i = 1; i < argc; i++) - { - int length = _tcslen(argv[i]); - _tcsncpy(&buf[offset], argv[i], length); - offset += length; - if (i + 1 < argc) - { - buf[offset] = _T(' '); - } - else - { - buf[offset] = _T('\n'); - buf[offset+1] = _T('\0'); - } - offset++; - } - _putts(buf); - OutputDebugString(buf); - HeapFree(GetProcessHeap(), 0, buf); - } - return 0; + offset = 0; + for(i = 1; i < argc; i++) + { + int length = _tcslen(argv[i]); + _tcsncpy(&buf[offset], argv[i], length); + offset += length; + if (i + 1 < argc) + { + buf[offset] = _T(' '); + } + else + { + buf[offset] = _T('\n'); + buf[offset+1] = _T('\0'); + } + offset++; + } + _putts(buf); + OutputDebugString(buf); + HeapFree(GetProcessHeap(), 0, buf); + } + return 0; }
10 years, 5 months
1
0
0
0
[ekohl] 63696: [FMIFS] Add Format prototype.
by ekohl@svn.reactos.org
Author: ekohl Date: Sun Jul 6 16:13:49 2014 New Revision: 63696 URL:
http://svn.reactos.org/svn/reactos?rev=63696&view=rev
Log: [FMIFS] Add Format prototype. Modified: trunk/reactos/dll/win32/fmifs/fmifs.spec trunk/reactos/dll/win32/fmifs/format.c trunk/reactos/include/reactos/libs/fmifs/fmifs.h Modified: trunk/reactos/dll/win32/fmifs/fmifs.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/fmifs/fmifs.spec…
============================================================================== --- trunk/reactos/dll/win32/fmifs/fmifs.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/fmifs/fmifs.spec [iso-8859-1] Sun Jul 6 16:13:49 2014 @@ -4,7 +4,7 @@ @ stdcall DiskCopy() @ stdcall EnableVolumeCompression(wstr long) @ stdcall Extend() -@ stdcall Format() +@ stdcall Format(wstr ptr wstr wstr long ptr) @ stdcall FormatEx(wstr ptr wstr wstr long long ptr) @ stub FormatEx2 @ stdcall InitializeFmIfs(ptr long ptr) Modified: trunk/reactos/dll/win32/fmifs/format.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/fmifs/format.c?r…
============================================================================== --- trunk/reactos/dll/win32/fmifs/format.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/fmifs/format.c [iso-8859-1] Sun Jul 6 16:13:49 2014 @@ -14,9 +14,14 @@ #include <debug.h> /* FMIFS.6 */ -VOID -NTAPI -Format(VOID) +VOID NTAPI +Format( + IN PWCHAR DriveRoot, + IN FMIFS_MEDIA_FLAG MediaFlag, + IN PWCHAR Format, + IN PWCHAR Label, + IN BOOLEAN QuickFormat, + IN PFMIFSCALLBACK Callback) { } Modified: trunk/reactos/include/reactos/libs/fmifs/fmifs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/libs/fmifs…
============================================================================== --- trunk/reactos/include/reactos/libs/fmifs/fmifs.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/libs/fmifs/fmifs.h [iso-8859-1] Sun Jul 6 16:13:49 2014 @@ -133,6 +133,16 @@ /* Format command in FMIFS */ VOID NTAPI +Format( + IN PWCHAR DriveRoot, + IN FMIFS_MEDIA_FLAG MediaFlag, + IN PWCHAR Format, + IN PWCHAR Label, + IN BOOLEAN QuickFormat, + IN PFMIFSCALLBACK Callback); + +/* FormatEx command in FMIFS */ +VOID NTAPI FormatEx( IN PWCHAR DriveRoot, IN FMIFS_MEDIA_FLAG MediaFlag,
10 years, 5 months
1
0
0
0
[ekohl] 63695: [FORMAT] Rename variables in order to avoid conflicts with the FMIFS.Format function.
by ekohl@svn.reactos.org
Author: ekohl Date: Sun Jul 6 15:57:16 2014 New Revision: 63695 URL:
http://svn.reactos.org/svn/reactos?rev=63695&view=rev
Log: [FORMAT] Rename variables in order to avoid conflicts with the FMIFS.Format function. Modified: trunk/reactos/base/system/format/format.c Modified: trunk/reactos/base/system/format/format.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/format/format.…
============================================================================== --- trunk/reactos/base/system/format/format.c [iso-8859-1] (original) +++ trunk/reactos/base/system/format/format.c [iso-8859-1] Sun Jul 6 15:57:16 2014 @@ -24,7 +24,7 @@ BOOL GotALabel = FALSE; LPTSTR Label = _T(""); LPTSTR Drive = NULL; -LPTSTR Format = _T("FAT"); +LPTSTR FileSystem = _T("FAT"); TCHAR RootDirectory[MAX_PATH]; TCHAR LabelString[12]; @@ -113,7 +113,7 @@ if( !_tcsnicmp( &argv[i][1], _T("FS:"), 3 )) { if( gotFormat) return -1; - Format = &argv[i][4]; + FileSystem = &argv[i][4]; gotFormat = TRUE; @@ -332,7 +332,7 @@ DWORD flags, maxComponent; ULARGE_INTEGER freeBytesAvailableToCaller, totalNumberOfBytes, totalNumberOfFreeBytes; #ifndef UNICODE - WCHAR RootDirectoryW[MAX_PATH], FormatW[MAX_PATH], LabelW[MAX_PATH]; + WCHAR RootDirectoryW[MAX_PATH], FileSystemW[MAX_PATH], LabelW[MAX_PATH]; #endif TCHAR szMsg[RC_STRING_MAX_SIZE]; @@ -526,12 +526,12 @@ // #ifndef UNICODE MultiByteToWideChar(CP_ACP, 0, RootDirectory, -1, RootDirectoryW, MAX_PATH); - MultiByteToWideChar(CP_ACP, 0, Format, -1, FormatW, MAX_PATH); + MultiByteToWideChar(CP_ACP, 0, FileSystem, -1, FileSystemW, MAX_PATH); MultiByteToWideChar(CP_ACP, 0, Label, -1, LabelW, MAX_PATH); - FormatEx( RootDirectoryW, media, FormatW, LabelW, QuickFormat, + FormatEx( RootDirectoryW, media, FileSystemW, LabelW, QuickFormat, ClusterSize, FormatExCallback ); #else - FormatEx( RootDirectory, media, Format, Label, QuickFormat, + FormatEx( RootDirectory, media, FileSystem, Label, QuickFormat, ClusterSize, FormatExCallback ); #endif if( Error ) return -1;
10 years, 5 months
1
0
0
0
[ekohl] 63694: [FMIFS] Fix indentation and codig style. No code changes!
by ekohl@svn.reactos.org
Author: ekohl Date: Sun Jul 6 14:03:04 2014 New Revision: 63694 URL:
http://svn.reactos.org/svn/reactos?rev=63694&view=rev
Log: [FMIFS] Fix indentation and codig style. No code changes! Modified: trunk/reactos/dll/win32/fmifs/chkdsk.c trunk/reactos/dll/win32/fmifs/compress.c trunk/reactos/dll/win32/fmifs/diskcopy.c trunk/reactos/dll/win32/fmifs/format.c trunk/reactos/dll/win32/fmifs/init.c trunk/reactos/dll/win32/fmifs/media.c trunk/reactos/dll/win32/fmifs/precomp.h trunk/reactos/dll/win32/fmifs/query.c Modified: trunk/reactos/dll/win32/fmifs/chkdsk.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/fmifs/chkdsk.c?r…
============================================================================== --- trunk/reactos/dll/win32/fmifs/chkdsk.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/fmifs/chkdsk.c [iso-8859-1] Sun Jul 6 14:03:04 2014 @@ -10,25 +10,25 @@ #include "precomp.h" /* FMIFS.1 */ -VOID NTAPI +VOID +NTAPI Chkdsk( - IN PWCHAR DriveRoot, - IN PWCHAR Format, - IN BOOLEAN CorrectErrors, - IN BOOLEAN Verbose, - IN BOOLEAN CheckOnlyIfDirty, - IN BOOLEAN ScanDrive, - IN PVOID Unused2, - IN PVOID Unused3, - IN PFMIFSCALLBACK Callback) + IN PWCHAR DriveRoot, + IN PWCHAR Format, + IN BOOLEAN CorrectErrors, + IN BOOLEAN Verbose, + IN BOOLEAN CheckOnlyIfDirty, + IN BOOLEAN ScanDrive, + IN PVOID Unused2, + IN PVOID Unused3, + IN PFMIFSCALLBACK Callback) { - BOOLEAN Argument = FALSE; + BOOLEAN Argument = FALSE; - /* FAIL immediately */ - Callback( - DONE, /* Command */ - 0, /* DWORD Modifier */ - &Argument);/* Argument */ + /* FAIL immediately */ + Callback(DONE, /* Command */ + 0, /* DWORD Modifier */ + &Argument);/* Argument */ } /* EOF */ Modified: trunk/reactos/dll/win32/fmifs/compress.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/fmifs/compress.c…
============================================================================== --- trunk/reactos/dll/win32/fmifs/compress.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/fmifs/compress.c [iso-8859-1] Sun Jul 6 14:03:04 2014 @@ -12,40 +12,38 @@ /* * @implemented */ -BOOLEAN NTAPI +BOOLEAN +NTAPI EnableVolumeCompression( - IN PWCHAR DriveRoot, - IN USHORT Compression) + IN PWCHAR DriveRoot, + IN USHORT Compression) { - HANDLE hFile; - DWORD RetBytes; - BOOL Ret; + HANDLE hFile; + DWORD RetBytes; + BOOL Ret; - hFile = CreateFileW( - DriveRoot, - FILE_READ_DATA | FILE_WRITE_DATA, - FILE_SHARE_READ | FILE_SHARE_WRITE, - NULL, - OPEN_EXISTING, - FILE_FLAG_BACKUP_SEMANTICS, - NULL); + hFile = CreateFileW(DriveRoot, + FILE_READ_DATA | FILE_WRITE_DATA, + FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, + OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS, + NULL); + if (hFile == INVALID_HANDLE_VALUE) + return FALSE; - if (hFile == INVALID_HANDLE_VALUE) - return FALSE; + Ret = DeviceIoControl(hFile, + FSCTL_SET_COMPRESSION, + &Compression, + sizeof(USHORT), + NULL, + 0, + &RetBytes, + NULL); - Ret = DeviceIoControl( - hFile, - FSCTL_SET_COMPRESSION, - &Compression, - sizeof(USHORT), - NULL, - 0, - &RetBytes, - NULL); + CloseHandle(hFile); - CloseHandle(hFile); - - return (Ret != 0); + return (Ret != 0); } /* EOF */ Modified: trunk/reactos/dll/win32/fmifs/diskcopy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/fmifs/diskcopy.c…
============================================================================== --- trunk/reactos/dll/win32/fmifs/diskcopy.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/fmifs/diskcopy.c [iso-8859-1] Sun Jul 6 14:03:04 2014 @@ -10,7 +10,8 @@ #include "precomp.h" /* FMIFS.3 */ -VOID NTAPI +VOID +NTAPI DiskCopy(void) { } Modified: trunk/reactos/dll/win32/fmifs/format.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/fmifs/format.c?r…
============================================================================== --- trunk/reactos/dll/win32/fmifs/format.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/fmifs/format.c [iso-8859-1] Sun Jul 6 14:03:04 2014 @@ -14,69 +14,69 @@ #include <debug.h> /* FMIFS.6 */ -VOID NTAPI +VOID +NTAPI Format(VOID) { } /* FMIFS.7 */ -VOID NTAPI +VOID +NTAPI FormatEx( - IN PWCHAR DriveRoot, - IN FMIFS_MEDIA_FLAG MediaFlag, - IN PWCHAR Format, - IN PWCHAR Label, - IN BOOLEAN QuickFormat, - IN ULONG ClusterSize, - IN PFMIFSCALLBACK Callback) + IN PWCHAR DriveRoot, + IN FMIFS_MEDIA_FLAG MediaFlag, + IN PWCHAR Format, + IN PWCHAR Label, + IN BOOLEAN QuickFormat, + IN ULONG ClusterSize, + IN PFMIFSCALLBACK Callback) { - PIFS_PROVIDER Provider; - UNICODE_STRING usDriveRoot; - UNICODE_STRING usLabel; - BOOLEAN Argument = FALSE; - WCHAR VolumeName[MAX_PATH]; - //CURDIR CurDir; + PIFS_PROVIDER Provider; + UNICODE_STRING usDriveRoot; + UNICODE_STRING usLabel; + BOOLEAN Argument = FALSE; + WCHAR VolumeName[MAX_PATH]; + //CURDIR CurDir; - Provider = GetProvider(Format); - if (!Provider) - { - /* Unknown file system */ - Callback( - DONE, /* Command */ - 0, /* DWORD Modifier */ - &Argument); /* Argument */ - return; - } + Provider = GetProvider(Format); + if (!Provider) + { + /* Unknown file system */ + Callback(DONE, /* Command */ + 0, /* DWORD Modifier */ + &Argument); /* Argument */ + return; + } #if 1 - DPRINT1("Warning: use GetVolumeNameForVolumeMountPointW() instead!\n"); - swprintf(VolumeName, L"\\??\\%c:", towupper(DriveRoot[0])); - RtlCreateUnicodeString(&usDriveRoot, VolumeName); - /* Code disabled as long as our storage stack doesn't understand IOCTL_MOUNTDEV_QUERY_DEVICE_NAME */ + DPRINT1("Warning: use GetVolumeNameForVolumeMountPointW() instead!\n"); + swprintf(VolumeName, L"\\??\\%c:", towupper(DriveRoot[0])); + RtlCreateUnicodeString(&usDriveRoot, VolumeName); + /* Code disabled as long as our storage stack doesn't understand IOCTL_MOUNTDEV_QUERY_DEVICE_NAME */ #else - if (!GetVolumeNameForVolumeMountPointW(DriveRoot, VolumeName, MAX_PATH) - || !RtlDosPathNameToNtPathName_U(VolumeName, &usDriveRoot, NULL, &CurDir)) - { - /* Report an error. */ - Callback( - DONE, /* Command */ - 0, /* DWORD Modifier */ - &Argument); /* Argument */ - return; - } + if (!GetVolumeNameForVolumeMountPointW(DriveRoot, VolumeName, MAX_PATH) || + !RtlDosPathNameToNtPathName_U(VolumeName, &usDriveRoot, NULL, &CurDir)) + { + /* Report an error. */ + Callback(DONE, /* Command */ + 0, /* DWORD Modifier */ + &Argument); /* Argument */ + return; + } #endif - RtlInitUnicodeString(&usLabel, Label); + RtlInitUnicodeString(&usLabel, Label); - DPRINT("FormatEx - %S\n", Format); - Provider->FormatEx( - &usDriveRoot, - MediaFlag, - &usLabel, - QuickFormat, - ClusterSize, - Callback); - RtlFreeUnicodeString(&usDriveRoot); + DPRINT("FormatEx - %S\n", Format); + Provider->FormatEx(&usDriveRoot, + MediaFlag, + &usLabel, + QuickFormat, + ClusterSize, + Callback); + + RtlFreeUnicodeString(&usDriveRoot); } /* EOF */ Modified: trunk/reactos/dll/win32/fmifs/init.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/fmifs/init.c?rev…
============================================================================== --- trunk/reactos/dll/win32/fmifs/init.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/fmifs/init.c [iso-8859-1] Sun Jul 6 14:03:04 2014 @@ -19,167 +19,171 @@ PIFS_PROVIDER GetProvider( - IN PWCHAR FileSystem) + IN PWCHAR FileSystem) { - PLIST_ENTRY ListEntry; - PIFS_PROVIDER Provider; + PLIST_ENTRY ListEntry; + PIFS_PROVIDER Provider; - ListEntry = ProviderListHead.Flink; - while (ListEntry != &ProviderListHead) - { - Provider = CONTAINING_RECORD(ListEntry, IFS_PROVIDER, ListEntry); - if (_wcsicmp(Provider->Name, FileSystem) == 0) - return Provider; - ListEntry = ListEntry->Flink; - } + ListEntry = ProviderListHead.Flink; + while (ListEntry != &ProviderListHead) + { + Provider = CONTAINING_RECORD(ListEntry, IFS_PROVIDER, ListEntry); + if (_wcsicmp(Provider->Name, FileSystem) == 0) + return Provider; + ListEntry = ListEntry->Flink; + } - /* Provider not found */ - return NULL; + /* Provider not found */ + return NULL; } -static BOOLEAN + +static +BOOLEAN AddProvider( - IN PCUNICODE_STRING FileSystem, - IN PWCHAR DllFile) + IN PCUNICODE_STRING FileSystem, + IN PWCHAR DllFile) { - PIFS_PROVIDER Provider = NULL; - ULONG RequiredSize; - HMODULE hMod = NULL; - BOOLEAN ret = FALSE; + PIFS_PROVIDER Provider = NULL; + ULONG RequiredSize; + HMODULE hMod = NULL; + BOOLEAN ret = FALSE; - hMod = LoadLibraryW(DllFile); - if (!hMod) - goto cleanup; + hMod = LoadLibraryW(DllFile); + if (!hMod) + goto cleanup; - RequiredSize = FIELD_OFFSET(IFS_PROVIDER, Name) - + FileSystem->Length + sizeof(UNICODE_NULL); - Provider = (PIFS_PROVIDER)RtlAllocateHeap( - RtlGetProcessHeap(), - 0, - RequiredSize); - if (!Provider) - goto cleanup; - RtlZeroMemory(Provider, RequiredSize); + RequiredSize = FIELD_OFFSET(IFS_PROVIDER, Name) + + FileSystem->Length + sizeof(UNICODE_NULL); + Provider = (PIFS_PROVIDER)RtlAllocateHeap( + RtlGetProcessHeap(), + 0, + RequiredSize); + if (!Provider) + goto cleanup; + RtlZeroMemory(Provider, RequiredSize); - /* Get function pointers */ - Provider->ChkdskEx = (CHKDSKEX)GetProcAddress(hMod, "ChkdskEx"); - //Provider->Extend = (EXTEND)GetProcAddress(hMod, "Extend"); - Provider->FormatEx = (FORMATEX)GetProcAddress(hMod, "FormatEx"); + /* Get function pointers */ + Provider->ChkdskEx = (CHKDSKEX)GetProcAddress(hMod, "ChkdskEx"); + //Provider->Extend = (EXTEND)GetProcAddress(hMod, "Extend"); + Provider->FormatEx = (FORMATEX)GetProcAddress(hMod, "FormatEx"); - RtlCopyMemory(Provider->Name, FileSystem->Buffer, FileSystem->Length); + RtlCopyMemory(Provider->Name, FileSystem->Buffer, FileSystem->Length); - InsertTailList(&ProviderListHead, &Provider->ListEntry); - ret = TRUE; + InsertTailList(&ProviderListHead, &Provider->ListEntry); + ret = TRUE; cleanup: - if (!ret) - { - if (hMod) - FreeLibrary(hMod); - if (Provider) - RtlFreeHeap(RtlGetProcessHeap(), 0, Provider); - } - return ret; + if (!ret) + { + if (hMod) + FreeLibrary(hMod); + if (Provider) + RtlFreeHeap(RtlGetProcessHeap(), 0, Provider); + } + return ret; } -static BOOLEAN -InitializeFmIfsOnce(void) +static +BOOLEAN +InitializeFmIfsOnce(VOID) { - OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING RegistryPath - = RTL_CONSTANT_STRING(L"\\REGISTRY\\Machine\\SOFTWARE\\ReactOS\\ReactOS\\CurrentVersion\\IFS"); - HANDLE hKey = NULL; - PKEY_VALUE_FULL_INFORMATION Buffer; - ULONG BufferSize = sizeof(KEY_VALUE_FULL_INFORMATION) + MAX_PATH; - ULONG RequiredSize; - ULONG i = 0; - UNICODE_STRING Name; - UNICODE_STRING Data; - NTSTATUS Status; + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING RegistryPath + = RTL_CONSTANT_STRING(L"\\REGISTRY\\Machine\\SOFTWARE\\ReactOS\\ReactOS\\CurrentVersion\\IFS"); + HANDLE hKey = NULL; + PKEY_VALUE_FULL_INFORMATION Buffer; + ULONG BufferSize = sizeof(KEY_VALUE_FULL_INFORMATION) + MAX_PATH; + ULONG RequiredSize; + ULONG i = 0; + UNICODE_STRING Name; + UNICODE_STRING Data; + NTSTATUS Status; - InitializeListHead(&ProviderListHead); + InitializeListHead(&ProviderListHead); - /* Read IFS providers from HKLM\SOFTWARE\ReactOS\ReactOS\CurrentVersion\IFS */ - InitializeObjectAttributes(&ObjectAttributes, &RegistryPath, 0, NULL, NULL); - Status = NtOpenKey(&hKey, KEY_QUERY_VALUE, &ObjectAttributes); - if (Status == STATUS_OBJECT_NAME_NOT_FOUND) - return TRUE; - else if (!NT_SUCCESS(Status)) - return FALSE; + /* Read IFS providers from HKLM\SOFTWARE\ReactOS\ReactOS\CurrentVersion\IFS */ + InitializeObjectAttributes(&ObjectAttributes, &RegistryPath, 0, NULL, NULL); + Status = NtOpenKey(&hKey, KEY_QUERY_VALUE, &ObjectAttributes); + if (Status == STATUS_OBJECT_NAME_NOT_FOUND) + return TRUE; + else if (!NT_SUCCESS(Status)) + return FALSE; - Buffer = (PKEY_VALUE_FULL_INFORMATION)RtlAllocateHeap( - RtlGetProcessHeap(), - 0, - BufferSize); - if (!Buffer) - { - NtClose(hKey); - return FALSE; - } + Buffer = (PKEY_VALUE_FULL_INFORMATION)RtlAllocateHeap( + RtlGetProcessHeap(), + 0, + BufferSize); + if (!Buffer) + { + NtClose(hKey); + return FALSE; + } - while (TRUE) - { - Status = NtEnumerateValueKey( - hKey, - i++, - KeyValueFullInformation, - Buffer, - BufferSize, - &RequiredSize); - if (Status == STATUS_BUFFER_OVERFLOW) - continue; - else if (!NT_SUCCESS(Status)) - break; - else if (Buffer->Type != REG_SZ) - continue; + while (TRUE) + { + Status = NtEnumerateValueKey( + hKey, + i++, + KeyValueFullInformation, + Buffer, + BufferSize, + &RequiredSize); + if (Status == STATUS_BUFFER_OVERFLOW) + continue; + else if (!NT_SUCCESS(Status)) + break; + else if (Buffer->Type != REG_SZ) + continue; - Name.Length = Name.MaximumLength = Buffer->NameLength; - Name.Buffer = Buffer->Name; - Data.Length = Data.MaximumLength = Buffer->DataLength; - Data.Buffer = (PWCHAR)((ULONG_PTR)Buffer + Buffer->DataOffset); - if (Data.Length > sizeof(WCHAR) && Data.Buffer[Data.Length / sizeof(WCHAR) - 1] == UNICODE_NULL) - Data.Length -= sizeof(WCHAR); + Name.Length = Name.MaximumLength = Buffer->NameLength; + Name.Buffer = Buffer->Name; + Data.Length = Data.MaximumLength = Buffer->DataLength; + Data.Buffer = (PWCHAR)((ULONG_PTR)Buffer + Buffer->DataOffset); + if (Data.Length > sizeof(WCHAR) && Data.Buffer[Data.Length / sizeof(WCHAR) - 1] == UNICODE_NULL) + Data.Length -= sizeof(WCHAR); - AddProvider(&Name, Data.Buffer); - } + AddProvider(&Name, Data.Buffer); + } - NtClose(hKey); - RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer); - return TRUE; + NtClose(hKey); + RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer); + return TRUE; } /* FMIFS.8 */ -BOOLEAN NTAPI +BOOLEAN +NTAPI InitializeFmIfs( - IN PVOID hinstDll, - IN DWORD dwReason, - IN PVOID reserved) + IN PVOID hinstDll, + IN DWORD dwReason, + IN PVOID reserved) { - switch (dwReason) - { - case DLL_PROCESS_ATTACH: - if (FALSE == FmIfsInitialized) - { - if (FALSE == InitializeFmIfsOnce()) - { - return FALSE; - } + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + if (FmIfsInitialized == FALSE) + { + if (InitializeFmIfsOnce() == FALSE) + { + return FALSE; + } - FmIfsInitialized = TRUE; - } - break; + FmIfsInitialized = TRUE; + } + break; - case DLL_THREAD_ATTACH: - break; + case DLL_THREAD_ATTACH: + break; - case DLL_THREAD_DETACH: - break; + case DLL_THREAD_DETACH: + break; - case DLL_PROCESS_DETACH: - break; - } + case DLL_PROCESS_DETACH: + break; + } - return TRUE; + return TRUE; } /* EOF */ Modified: trunk/reactos/dll/win32/fmifs/media.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/fmifs/media.c?re…
============================================================================== --- trunk/reactos/dll/win32/fmifs/media.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/fmifs/media.c [iso-8859-1] Sun Jul 6 14:03:04 2014 @@ -10,14 +10,15 @@ #include "precomp.h" /* FMIFS.9 */ -BOOL NTAPI +BOOL +NTAPI QuerySupportedMedia( - IN PWCHAR DriveRoot, - OUT FMIFS_MEDIA_FLAG *CurrentMedia OPTIONAL, - IN ULONG Unknown3, - OUT PULONG Unknown4) + IN PWCHAR DriveRoot, + OUT FMIFS_MEDIA_FLAG *CurrentMedia OPTIONAL, + IN ULONG Unknown3, + OUT PULONG Unknown4) { - return FALSE; + return FALSE; } /* EOF */ Modified: trunk/reactos/dll/win32/fmifs/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/fmifs/precomp.h?…
============================================================================== --- trunk/reactos/dll/win32/fmifs/precomp.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/fmifs/precomp.h [iso-8859-1] Sun Jul 6 14:03:04 2014 @@ -32,18 +32,18 @@ typedef struct _IFS_PROVIDER { - LIST_ENTRY ListEntry; + LIST_ENTRY ListEntry; - CHKDSKEX ChkdskEx; - PVOID Extend; - FORMATEX FormatEx; + CHKDSKEX ChkdskEx; + PVOID Extend; + FORMATEX FormatEx; - WCHAR Name[1]; + WCHAR Name[1]; } IFS_PROVIDER, *PIFS_PROVIDER; /* init.c */ PIFS_PROVIDER GetProvider( - IN PWCHAR FileSytem); + IN PWCHAR FileSytem); #endif /* _FMIFS_PCH_ */ Modified: trunk/reactos/dll/win32/fmifs/query.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/fmifs/query.c?re…
============================================================================== --- trunk/reactos/dll/win32/fmifs/query.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/fmifs/query.c [iso-8859-1] Sun Jul 6 14:03:04 2014 @@ -9,36 +9,37 @@ #include "precomp.h" -BOOLEAN NTAPI +BOOLEAN +NTAPI QueryAvailableFileSystemFormat( - IN DWORD Index, - IN OUT PWCHAR FileSystem, /* FIXME: Probably one minimal size is mandatory, but which one? */ - OUT UCHAR* Major, - OUT UCHAR* Minor, - OUT BOOLEAN* LatestVersion) + IN DWORD Index, + IN OUT PWCHAR FileSystem, /* FIXME: Probably one minimal size is mandatory, but which one? */ + OUT UCHAR *Major, + OUT UCHAR *Minor, + OUT BOOLEAN *LatestVersion) { - PLIST_ENTRY ListEntry; - PIFS_PROVIDER Provider; + PLIST_ENTRY ListEntry; + PIFS_PROVIDER Provider; - if (!FileSystem || !Major ||!Minor ||!LatestVersion) - return FALSE; + if (!FileSystem || !Major ||!Minor ||!LatestVersion) + return FALSE; - ListEntry = ProviderListHead.Flink; - while (TRUE) - { - if (ListEntry == &ProviderListHead) - return FALSE; - if (Index == 0) - break; - ListEntry = ListEntry->Flink; - Index--; - } + ListEntry = ProviderListHead.Flink; + while (TRUE) + { + if (ListEntry == &ProviderListHead) + return FALSE; + if (Index == 0) + break; + ListEntry = ListEntry->Flink; + Index--; + } - Provider = CONTAINING_RECORD(ListEntry, IFS_PROVIDER, ListEntry); - wcscpy(FileSystem, Provider->Name); - *Major = 0; /* FIXME */ - *Minor = 0; /* FIXME */ - *LatestVersion = TRUE; /* FIXME */ + Provider = CONTAINING_RECORD(ListEntry, IFS_PROVIDER, ListEntry); + wcscpy(FileSystem, Provider->Name); + *Major = 0; /* FIXME */ + *Minor = 0; /* FIXME */ + *LatestVersion = TRUE; /* FIXME */ - return TRUE; + return TRUE; }
10 years, 5 months
1
0
0
0
[ekohl] 63693: [VFATLIB] Add full format (wipe) support to the fat32 code.
by ekohl@svn.reactos.org
Author: ekohl Date: Sun Jul 6 13:12:28 2014 New Revision: 63693 URL:
http://svn.reactos.org/svn/reactos?rev=63693&view=rev
Log: [VFATLIB] Add full format (wipe) support to the fat32 code. Modified: trunk/reactos/lib/fslib/vfatlib/fat32.c Modified: trunk/reactos/lib/fslib/vfatlib/fat32.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/vfatlib/fat32.c?…
============================================================================== --- trunk/reactos/lib/fslib/vfatlib/fat32.c [iso-8859-1] (original) +++ trunk/reactos/lib/fslib/vfatlib/fat32.c [iso-8859-1] Sun Jul 6 13:12:28 2014 @@ -339,6 +339,87 @@ UpdateProgress(Context, (ULONG)BootSector->SectorsPerCluster); + /* Free the buffer */ + RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer); + + return Status; +} + + +static +NTSTATUS +Fat32WipeSectors( + IN HANDLE FileHandle, + IN PFAT32_BOOT_SECTOR BootSector, + IN OUT PFORMAT_CONTEXT Context) +{ + IO_STATUS_BLOCK IoStatusBlock; + PUCHAR Buffer; + LARGE_INTEGER FileOffset; + ULONGLONG Sector; + ULONG Length; + NTSTATUS Status; + + /* Allocate buffer for the cluster */ + Buffer = (PUCHAR)RtlAllocateHeap(RtlGetProcessHeap(), + HEAP_ZERO_MEMORY, + BootSector->SectorsPerCluster * BootSector->BytesPerSector); + if (Buffer == NULL) + return STATUS_INSUFFICIENT_RESOURCES; + + Sector = 0; + Length = BootSector->SectorsPerCluster * BootSector->BytesPerSector; + + while (Sector + BootSector->SectorsPerCluster < BootSector->SectorsHuge) + { + FileOffset.QuadPart = Sector * BootSector->BytesPerSector; + + Status = NtWriteFile(FileHandle, + NULL, + NULL, + NULL, + &IoStatusBlock, + Buffer, + Length, + &FileOffset, + NULL); + if (!NT_SUCCESS(Status)) + { + DPRINT("NtWriteFile() failed (Status %lx)\n", Status); + goto done; + } + + UpdateProgress(Context, (ULONG)BootSector->SectorsPerCluster); + + Sector += BootSector->SectorsPerCluster; + } + + if (Sector + BootSector->SectorsPerCluster > BootSector->SectorsHuge) + { + DPRINT("Remaining sectors %lu\n", BootSector->SectorsHuge - Sector); + + FileOffset.QuadPart = Sector * BootSector->BytesPerSector; + Length = (BootSector->SectorsHuge - Sector) * BootSector->BytesPerSector; + + Status = NtWriteFile(FileHandle, + NULL, + NULL, + NULL, + &IoStatusBlock, + Buffer, + Length, + &FileOffset, + NULL); + if (!NT_SUCCESS(Status)) + { + DPRINT("NtWriteFile() failed (Status %lx)\n", Status); + goto done; + } + + UpdateProgress(Context, BootSector->SectorsHuge - Sector); + } + +done: /* Free the buffer */ RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer); @@ -407,7 +488,7 @@ BootSector.RootCluster = 2; BootSector.FSInfoSector = 1; BootSector.BootBackup = 6; - BootSector.Drive = DiskGeometry->MediaType == FixedMedia ? 0x80 : 0x00; + BootSector.Drive = (DiskGeometry->MediaType == FixedMedia) ? 0x80 : 0x00; BootSector.ExtBootSignature = 0x29; BootSector.VolumeID = CalcVolumeSerialNumber (); if ((Label == NULL) || (Label->Buffer == NULL)) @@ -436,6 +517,20 @@ Context->TotalSectorCount = 2 + (BootSector.FATSectors32 * BootSector.FATCount) + BootSector.SectorsPerCluster; + if (!QuickFormat) + { + Context->TotalSectorCount += BootSector.SectorsHuge; + + Status = Fat32WipeSectors(FileHandle, + &BootSector, + Context); + if (!NT_SUCCESS(Status)) + { + DPRINT("Fat32WipeSectors() failed with status 0x%.08x\n", Status); + return Status; + } + } + Status = Fat32WriteBootSector(FileHandle, &BootSector, Context); @@ -484,11 +579,6 @@ DPRINT("Fat32WriteRootDirectory() failed with status 0x%.08x\n", Status); } - if (!QuickFormat) - { - /* FIXME: Fill remaining sectors */ - } - return Status; }
10 years, 5 months
1
0
0
0
[ekohl] 63692: [USETUP] Swap quick and full format entries in the file system list, so that quick format will be the default.
by ekohl@svn.reactos.org
Author: ekohl Date: Sun Jul 6 12:33:11 2014 New Revision: 63692 URL:
http://svn.reactos.org/svn/reactos?rev=63692&view=rev
Log: [USETUP] Swap quick and full format entries in the file system list, so that quick format will be the default. Modified: trunk/reactos/base/setup/usetup/fslist.c Modified: trunk/reactos/base/setup/usetup/fslist.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/fslist.c…
============================================================================== --- trunk/reactos/base/setup/usetup/fslist.c [iso-8859-1] (original) +++ trunk/reactos/base/setup/usetup/fslist.c [iso-8859-1] Sun Jul 6 12:33:11 2014 @@ -48,7 +48,7 @@ Item->FileSystem = FileSystem; Item->FormatFunc = FormatFunc; Item->ChkdskFunc = ChkdskFunc; - Item->QuickFormat = FALSE; + Item->QuickFormat = TRUE; InsertTailList(&List->ListHead, &Item->ListEntry); if (!FormatFunc) @@ -61,7 +61,7 @@ Item->FileSystem = FileSystem; Item->FormatFunc = FormatFunc; Item->ChkdskFunc = ChkdskFunc; - Item->QuickFormat = TRUE; + Item->QuickFormat = FALSE; InsertTailList(&List->ListHead, &Item->ListEntry); }
10 years, 5 months
1
0
0
0
← Newer
1
...
7
8
9
10
11
12
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
Results per page:
10
25
50
100
200