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
September 2015
----- 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
17 participants
535 discussions
Start a n
N
ew thread
[pschweitzer] 69230: [MOUNTMGR] MountMgrVolumeMountPointCreated() returns success if databases are already performing a sync
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Mon Sep 14 21:52:16 2015 New Revision: 69230 URL:
http://svn.reactos.org/svn/reactos?rev=69230&view=rev
Log: [MOUNTMGR] MountMgrVolumeMountPointCreated() returns success if databases are already performing a sync Modified: trunk/reactos/drivers/filters/mountmgr/device.c Modified: trunk/reactos/drivers/filters/mountmgr/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filters/mountmgr/d…
============================================================================== --- trunk/reactos/drivers/filters/mountmgr/device.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filters/mountmgr/device.c [iso-8859-1] Mon Sep 14 21:52:16 2015 @@ -1725,7 +1725,7 @@ FreePool(LinkTarget.Buffer); FreePool(SourceDeviceName.Buffer); FreePool(SourceSymbolicName.Buffer); - return STATUS_PENDING; + return STATUS_STATUS; } else if (!NT_SUCCESS(Status)) {
9 years, 3 months
1
0
0
0
[tfaber] 69229: [SHELL32] - Arch, don't leave unused variables CORE-9867
by tfaber@svn.reactos.org
Author: tfaber Date: Mon Sep 14 19:20:55 2015 New Revision: 69229 URL:
http://svn.reactos.org/svn/reactos?rev=69229&view=rev
Log: [SHELL32] - Arch, don't leave unused variables CORE-9867 Modified: trunk/reactos/include/reactos/shellutils.h Modified: trunk/reactos/include/reactos/shellutils.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/shellutils…
============================================================================== --- trunk/reactos/include/reactos/shellutils.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/shellutils.h [iso-8859-1] Mon Sep 14 19:20:55 2015 @@ -68,10 +68,9 @@ } static void Term() { - ULONG ref; if (s_pInstance) { - ref = s_pInstance->Release(); + s_pInstance->Release(); s_pInstance = NULL; } }
9 years, 3 months
1
0
0
0
[tfaber] 69228: [SHELL32] - Stop asserting 'ref == 0' in CComCreatorCentralInstance::Term. It's caught enough reference leaks and is mostly just annoying now. CORE-9867 #resolve
by tfaber@svn.reactos.org
Author: tfaber Date: Mon Sep 14 19:14:48 2015 New Revision: 69228 URL:
http://svn.reactos.org/svn/reactos?rev=69228&view=rev
Log: [SHELL32] - Stop asserting 'ref == 0' in CComCreatorCentralInstance::Term. It's caught enough reference leaks and is mostly just annoying now. CORE-9867 #resolve Modified: trunk/reactos/include/reactos/shellutils.h Modified: trunk/reactos/include/reactos/shellutils.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/shellutils…
============================================================================== --- trunk/reactos/include/reactos/shellutils.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/shellutils.h [iso-8859-1] Mon Sep 14 19:14:48 2015 @@ -72,9 +72,6 @@ if (s_pInstance) { ref = s_pInstance->Release(); -#ifdef ASSERT - ASSERT(ref == 0); -#endif s_pInstance = NULL; } }
9 years, 3 months
1
0
0
0
[tfaber] 69227: [NTOS:PNP] - Fix memory leak in IopDetectResourceConflict. While we're at it use pool tagging, kernel handles and avoid INVALID_HANDLE_VALUE.
by tfaber@svn.reactos.org
Author: tfaber Date: Mon Sep 14 18:58:58 2015 New Revision: 69227 URL:
http://svn.reactos.org/svn/reactos?rev=69227&view=rev
Log: [NTOS:PNP] - Fix memory leak in IopDetectResourceConflict. While we're at it use pool tagging, kernel handles and avoid INVALID_HANDLE_VALUE. Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpres.c Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpres.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpres.…
============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnpres.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpres.c [iso-8859-1] Mon Sep 14 18:58:58 2015 @@ -1204,7 +1204,7 @@ { OBJECT_ATTRIBUTES ObjectAttributes; UNICODE_STRING KeyName; - HANDLE ResourceMapKey = INVALID_HANDLE_VALUE, ChildKey2 = INVALID_HANDLE_VALUE, ChildKey3 = INVALID_HANDLE_VALUE; + HANDLE ResourceMapKey = NULL, ChildKey2 = NULL, ChildKey3 = NULL; ULONG KeyInformationLength, RequiredLength, KeyValueInformationLength, KeyNameInformationLength; PKEY_BASIC_INFORMATION KeyInformation; PKEY_VALUE_PARTIAL_INFORMATION KeyValueInformation; @@ -1213,7 +1213,11 @@ NTSTATUS Status; RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\HARDWARE\\RESOURCEMAP"); - InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE, 0, NULL); + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, + NULL, + NULL); Status = ZwOpenKey(&ResourceMapKey, KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE, &ObjectAttributes); if (!NT_SUCCESS(Status)) { @@ -1234,7 +1238,9 @@ else if (Status == STATUS_BUFFER_OVERFLOW || Status == STATUS_BUFFER_TOO_SMALL) { KeyInformationLength = RequiredLength; - KeyInformation = ExAllocatePool(PagedPool, KeyInformationLength); + KeyInformation = ExAllocatePoolWithTag(PagedPool, + KeyInformationLength, + TAG_IO); if (!KeyInformation) { Status = STATUS_INSUFFICIENT_RESOURCES; @@ -1252,17 +1258,22 @@ goto cleanup; ChildKeyIndex1++; if (!NT_SUCCESS(Status)) + { + ExFreePoolWithTag(KeyInformation, TAG_IO); goto cleanup; + } KeyName.Buffer = KeyInformation->Name; KeyName.MaximumLength = KeyName.Length = (USHORT)KeyInformation->NameLength; InitializeObjectAttributes(&ObjectAttributes, &KeyName, - OBJ_CASE_INSENSITIVE, + OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, ResourceMapKey, NULL); - Status = ZwOpenKey(&ChildKey2, KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE, &ObjectAttributes); - ExFreePool(KeyInformation); + Status = ZwOpenKey(&ChildKey2, + KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE, + &ObjectAttributes); + ExFreePoolWithTag(KeyInformation, TAG_IO); if (!NT_SUCCESS(Status)) goto cleanup; @@ -1279,7 +1290,9 @@ else if (Status == STATUS_BUFFER_TOO_SMALL) { KeyInformationLength = RequiredLength; - KeyInformation = ExAllocatePool(PagedPool, KeyInformationLength); + KeyInformation = ExAllocatePoolWithTag(PagedPool, + KeyInformationLength, + TAG_IO); if (!KeyInformation) { Status = STATUS_INSUFFICIENT_RESOURCES; @@ -1297,17 +1310,20 @@ goto cleanup; ChildKeyIndex2++; if (!NT_SUCCESS(Status)) + { + ExFreePoolWithTag(KeyInformation, TAG_IO); goto cleanup; + } KeyName.Buffer = KeyInformation->Name; KeyName.MaximumLength = KeyName.Length = (USHORT)KeyInformation->NameLength; InitializeObjectAttributes(&ObjectAttributes, &KeyName, - OBJ_CASE_INSENSITIVE, + OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, ChildKey2, NULL); Status = ZwOpenKey(&ChildKey3, KEY_QUERY_VALUE, &ObjectAttributes); - ExFreePool(KeyInformation); + ExFreePoolWithTag(KeyInformation, TAG_IO); if (!NT_SUCCESS(Status)) goto cleanup; @@ -1324,7 +1340,9 @@ else if (Status == STATUS_BUFFER_TOO_SMALL) { KeyValueInformationLength = RequiredLength; - KeyValueInformation = ExAllocatePool(PagedPool, KeyValueInformationLength); + KeyValueInformation = ExAllocatePoolWithTag(PagedPool, + KeyValueInformationLength, + TAG_IO); if (!KeyValueInformation) { Status = STATUS_INSUFFICIENT_RESOURCES; @@ -1341,7 +1359,10 @@ else goto cleanup; if (!NT_SUCCESS(Status)) + { + ExFreePoolWithTag(KeyValueInformation, TAG_IO); goto cleanup; + } Status = ZwEnumerateValueKey(ChildKey3, ChildKeyIndex3, @@ -1352,7 +1373,9 @@ if (Status == STATUS_BUFFER_TOO_SMALL) { KeyNameInformationLength = RequiredLength; - KeyNameInformation = ExAllocatePool(PagedPool, KeyNameInformationLength + sizeof(WCHAR)); + KeyNameInformation = ExAllocatePoolWithTag(PagedPool, + KeyNameInformationLength + sizeof(WCHAR), + TAG_IO); if (!KeyNameInformation) { Status = STATUS_INSUFFICIENT_RESOURCES; @@ -1368,45 +1391,47 @@ } else goto cleanup; - ChildKeyIndex3++; - if (!NT_SUCCESS(Status)) + { + ExFreePoolWithTag(KeyNameInformation, TAG_IO); goto cleanup; + } KeyNameInformation->Name[KeyNameInformation->NameLength / sizeof(WCHAR)] = UNICODE_NULL; /* Skip translated entries */ if (wcsstr(KeyNameInformation->Name, L".Translated")) { - ExFreePool(KeyNameInformation); + ExFreePoolWithTag(KeyNameInformation, TAG_IO); + ExFreePoolWithTag(KeyValueInformation, TAG_IO); continue; } - ExFreePool(KeyNameInformation); + ExFreePoolWithTag(KeyNameInformation, TAG_IO); if (IopCheckForResourceConflict(ResourceList, (PCM_RESOURCE_LIST)KeyValueInformation->Data, Silent, ConflictingDescriptor)) { - ExFreePool(KeyValueInformation); + ExFreePoolWithTag(KeyValueInformation, TAG_IO); Status = STATUS_CONFLICTING_ADDRESSES; goto cleanup; } - ExFreePool(KeyValueInformation); + ExFreePoolWithTag(KeyValueInformation, TAG_IO); } } } cleanup: - if (ResourceMapKey != INVALID_HANDLE_VALUE) - ZwClose(ResourceMapKey); - if (ChildKey2 != INVALID_HANDLE_VALUE) - ZwClose(ChildKey2); - if (ChildKey3 != INVALID_HANDLE_VALUE) - ZwClose(ChildKey3); + if (ResourceMapKey != NULL) + ObCloseHandle(ResourceMapKey, KernelMode); + if (ChildKey2 != NULL) + ObCloseHandle(ChildKey2, KernelMode); + if (ChildKey3 != NULL) + ObCloseHandle(ChildKey3, KernelMode); if (Status == STATUS_NO_MORE_ENTRIES) Status = STATUS_SUCCESS;
9 years, 3 months
1
0
0
0
[rnaumann] 69226: [USETUP] Addendum to r69121 CORE-10058
by rnaumann@svn.reactos.org
Author: rnaumann Date: Mon Sep 14 10:40:44 2015 New Revision: 69226 URL:
http://svn.reactos.org/svn/reactos?rev=69226&view=rev
Log: [USETUP] Addendum to r69121 CORE-10058 Modified: trunk/reactos/base/setup/usetup/lang/ru-RU.h Modified: trunk/reactos/base/setup/usetup/lang/ru-RU.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/ru-…
============================================================================== --- trunk/reactos/base/setup/usetup/lang/ru-RU.h [iso-8859-1] (original) +++ trunk/reactos/base/setup/usetup/lang/ru-RU.h [iso-8859-1] Mon Sep 14 10:40:44 2015 @@ -802,7 +802,7 @@ { 8, 19, - "\x07 Press L to create a logical partition.", + "\x07 ¦¬¨â¥ L ¤«ï ᮧ¤ ¨ï «®£¨ç¥áª®£® à §¤¥« .", TEXT_STYLE_NORMAL }, { @@ -830,7 +830,7 @@ { 4, 3, - " ReactOS " KERNEL_VERSION_STR " Setup ", + " áâ ®¢ª ReactOS " KERNEL_VERSION_STR, TEXT_STYLE_UNDERLINE }, { @@ -908,7 +908,7 @@ { 0, 0, - "ENTER=Continue ESC=Cancel", + "ENTER=த®«¦¨âì ESC=⬥ ", TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { @@ -976,13 +976,13 @@ { 6, 14, - "â®¡ë ¨§¬¥¨âì ¢ë¡à ãî ¤¨à¥ªâ®à¨î, ¦¬¨â¥ BACKSPACE ¨ 㤠«¨â¥ ᨬ¢®«ë,", + "â®¡ë ¨§¬¥¨âì ¢ë¡à ãî ¤¨à¥ªâ®à¨î, ¦¬¨â¥ BACKSPACE ¤«ï 㤠«¥¨ï", TEXT_STYLE_NORMAL }, { 6, 15, - " § ⥬ ¡¥à¨â¥ ®¢®¥ ¨¬ï ¤¨à¥ªâ®à¨¨ ¤«ï ãáâ ®¢ª¨ ReactOS.", + "ᨬ¢®«®¢, § ⥬ ¡¥à¨â¥ ®¢®¥ ¨¬ï ¤¨à¥ªâ®à¨¨ ¤«ï ãáâ ®¢ª¨ ReactOS.", TEXT_STYLE_NORMAL }, { @@ -1560,42 +1560,42 @@ }, { //ERROR_UPDATE_GEOID, - "Setup could not set the geo id.\n" + "¥ 㤠«®áì ãáâ ®¢¨âì geo id.\n" "ENTER = ¥à¥§ £à㧪 " }, { //ERROR_DIRECTORY_NAME, - "Invalid directory name.\n" + "¥¢¥à®¥ §¢ ¨¥ ¤¨à¥ªâ®à¨¨.\n" "\n" - " * Press any key to continue." + " * ¦¬¨â¥ «î¡ãî ª« ¢¨èã ¤«ï ¯à®¤®«¦¥¨ï." }, { //ERROR_INSUFFICIENT_PARTITION_SIZE, - "The selected partition is not large enough to install ReactOS.\n" - "The install partition must have a size of at least %lu MB.\n" + "ë¡à ë© à §¤¥« ᫨誮¬ ¬ « ¤«ï ãáâ ®¢ª¨ ReactOS.\n" + "áâ ®¢®çë© à §¤¥« ¤®«¦¥ ¨¬¥âì ¯® ªà ©¥© ¬¥à¥ %lu MB ¯à®áâà á⢠.\n" "\n" " * ¦¬¨â¥ «î¡ãî ª« ¢¨èã ¤«ï ¯à®¤®«¦¥¨ï.", NULL }, { //ERROR_PARTITION_TABLE_FULL, - "You can not create a new primary or extended partition in the\n" - "partition table of this disk because the partition table is full.\n" + "ë ¥ ¬®¦¥â¥ ᮧ¤ âì ¯¥à¢¨çë© ¨«¨ à áè¨à¥ë© à §¤¥« ¢ â ¡«¨æ¥\n" + "à §¤¥«®¢ ¤¨áª , ¯®â®¬ã çâ® ® § ¯®«¥ .\n" "\n" " * ¦¬¨â¥ «î¡ãî ª« ¢¨èã ¤«ï ¯à®¤®«¦¥¨ï." }, { //ERROR_ONLY_ONE_EXTENDED, - "You can not create more than one extended partition per disk.\n" + "ë ¥ ¬®¦¥â¥ ᮧ¤ âì ¡®«ìè¥ ®¤®£® à áè¨à¥®£® à §¤¥« ¤¨áª.\n" "\n" " * ¦¬¨â¥ «î¡ãî ª« ¢¨èã ¤«ï ¯à®¤®«¦¥¨ï." }, { //ERROR_FORMATTING_PARTITION, - "Setup is unable to format the partition:\n" + "¥ 㤠«®áì ä®à¬ â¨à®¢ âì à §¤¥«:\n" " %S\n" "\n" - "ENTER = Reboot computer" + "ENTER = ¥à¥§ £à㧪 " }, { NULL, @@ -1737,9 +1737,9 @@ {STRING_NONFORMATTEDPART, "ë ¢ë¡à «¨ ãáâ ®¢ªã ReactOS ®¢ë© ¥®âä®à¬ â¨à®¢ ë© à §¤¥«."}, {STRING_NONFORMATTEDSYSTEMPART, - "The system partition is not formatted yet."}, + "¨áâ¥¬ë© à §¤¥« ¥ ®âä®à¬ â¨à®¢ ."}, {STRING_NONFORMATTEDOTHERPART, - "The new partition is not formatted yet."}, + "®¢ë© à §¤¥« ¥ ®âä®à¬ â¨à®¢ ."}, {STRING_INSTALLONPART, "ReactOS ãáâ ¢«¨¢ ¥âáï à §¤¥«:"}, {STRING_CHECKINGPART,
9 years, 3 months
1
0
0
0
[akhaldi] 69225: [UNIATA] Get back a ros diff spotted by Thomas and use our debug checks in some more places. CORE-10185
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Sep 14 10:33:09 2015 New Revision: 69225 URL:
http://svn.reactos.org/svn/reactos?rev=69225&view=rev
Log: [UNIATA] Get back a ros diff spotted by Thomas and use our debug checks in some more places. CORE-10185 Modified: trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp trunk/reactos/drivers/storage/ide/uniata/id_sata.cpp trunk/reactos/drivers/storage/ide/uniata/id_sata.h Modified: trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
============================================================================== --- trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp [iso-8859-1] Mon Sep 14 10:33:09 2015 @@ -8035,7 +8035,11 @@ } else { RtlZeroMemory(modeData, sizeof(MODE_POWER_CONDITION_PAGE)); modeData->PageCode = MODE_PAGE_POWER_CONDITION; +#ifdef __REACTOS__ + modeData->PageLength = sizeof(MODE_POWER_CONDITION_PAGE)-sizeof(MODE_PARAMETER_HEADER); +#else modeData->PageLength = sizeof(MODE_PAGE_POWER_CONDITION)-sizeof(MODE_PARAMETER_HEADER); +#endif modeData->Byte3.Fields.Idle = LunExt->PowerState <= StartStop_Power_Idle; modeData->Byte3.Fields.Standby = LunExt->PowerState == StartStop_Power_Standby; Srb->DataTransferLength = sizeof(MODE_POWER_CONDITION_PAGE); Modified: trunk/reactos/drivers/storage/ide/uniata/id_sata.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
============================================================================== --- trunk/reactos/drivers/storage/ide/uniata/id_sata.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/ide/uniata/id_sata.cpp [iso-8859-1] Mon Sep 14 10:33:09 2015 @@ -2313,13 +2313,13 @@ KdPrint2((" Incomplete command, CI %#x, ACT %#x\n", CI, ACT)); KdPrint2((" FIS status %#x, error %#x\n", RCV_FIS[2], RCV_FIS[3])); -#if DBG +#ifdef _DEBUG UniataDumpAhciPortRegs(chan); #endif if(!UniataAhciAbortOperation(chan)) { KdPrint2((" Abort failed, need RESET\n")); } -#if DBG +#ifdef _DEBUG UniataDumpAhciPortRegs(chan); #endif chan->AhciPrevCI = CI & ~((ULONG)1 << tag); Modified: trunk/reactos/drivers/storage/ide/uniata/id_sata.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
============================================================================== --- trunk/reactos/drivers/storage/ide/uniata/id_sata.h [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/ide/uniata/id_sata.h [iso-8859-1] Mon Sep 14 10:33:09 2015 @@ -123,7 +123,7 @@ IN PVOID HwDeviceExtension ); -#if DBG +#ifdef _DEBUG VOID NTAPI UniataDumpAhciPortRegs(
9 years, 3 months
1
0
0
0
[akhaldi] 69224: [UNIATA] Sync to 0.45h1. CORE-10185
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Sep 14 10:24:48 2015 New Revision: 69224 URL:
http://svn.reactos.org/svn/reactos?rev=69224&view=rev
Log: [UNIATA] Sync to 0.45h1. CORE-10185 Modified: trunk/reactos/drivers/storage/ide/uniata/atapi.h trunk/reactos/drivers/storage/ide/uniata/bm_devs.h trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp trunk/reactos/drivers/storage/ide/uniata/id_dma.cpp trunk/reactos/drivers/storage/ide/uniata/id_init.cpp trunk/reactos/drivers/storage/ide/uniata/id_probe.cpp trunk/reactos/drivers/storage/ide/uniata/id_sata.cpp trunk/reactos/drivers/storage/ide/uniata/uniata_ver.h Modified: trunk/reactos/drivers/storage/ide/uniata/atapi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
============================================================================== --- trunk/reactos/drivers/storage/ide/uniata/atapi.h [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/ide/uniata/atapi.h [iso-8859-1] Mon Sep 14 10:24:48 2015 @@ -437,6 +437,7 @@ #define IDE_DRIVE_2 0x10 #define IDE_DRIVE_SELECT_1 (IDE_DRIVE_SELECT | IDE_DRIVE_1) #define IDE_DRIVE_SELECT_2 (IDE_DRIVE_SELECT | IDE_DRIVE_2) +#define IDE_DRIVE_MASK (IDE_DRIVE_SELECT_1 | IDE_DRIVE_SELECT_2) #define IDE_USE_LBA 0x40 Modified: trunk/reactos/drivers/storage/ide/uniata/bm_devs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
============================================================================== --- trunk/reactos/drivers/storage/ide/uniata/bm_devs.h [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/ide/uniata/bm_devs.h [iso-8859-1] Mon Sep 14 10:24:48 2015 @@ -696,6 +696,11 @@ #define VIAPRQ 0x8000 #define VIASATA 0x10000 +#define CYRIX_OLD 0 +#define CYRIX_3x 1 +#define CYRIX_NEW 2 +#define CYRIX_35 3 + #define ITE_33 0 #define ITE_133 1 #define ITE_133_NEW 2 @@ -734,6 +739,7 @@ PCI_DEV_HW_SPEC_BM( 7411, 1022, 0x00, ATA_UDMA5, "AMD 766" , 0 | AMDBUG ), PCI_DEV_HW_SPEC_BM( 7441, 1022, 0x00, ATA_UDMA5, "AMD 768" , 0 ), PCI_DEV_HW_SPEC_BM( 7469, 1022, 0x00, ATA_UDMA6, "AMD 8111" , 0 ), + PCI_DEV_HW_SPEC_BM( 208F, 1022, 0x00, ATA_UDMA4, "AMD CS5535" , CYRIX_35 ), PCI_DEV_HW_SPEC_BM( 209a, 1022, 0x00, ATA_UDMA5, "AMD CS5536" , 0 ), PCI_DEV_HW_SPEC_BM( 4349, 1002, 0x00, ATA_UDMA5, "ATI IXP200" , 0 ), @@ -1041,6 +1047,7 @@ PCI_DEV_HW_SPEC_BM( 0d8f, 10de, 0x00, ATA_SA300, "nVidia nForce MCP89 AB", UNIATA_SATA | UNIATA_AHCI ), PCI_DEV_HW_SPEC_BM( 0502, 100b, 0x00, ATA_UDMA2, "National Geode SC1100", 0 ), + PCI_DEV_HW_SPEC_BM( 002d, 100b, 0x00, ATA_UDMA4, "National Geode CS5535", CYRIX_35 ), PCI_DEV_HW_SPEC_BM( 4d33, 105a, 0x00, ATA_UDMA2, "Promise PDC20246" , PROLD | 0x00 ), PCI_DEV_HW_SPEC_BM( 4d38, 105a, 0x00, ATA_UDMA4, "Promise PDC20262" , PRNEW | 0x00 ), @@ -1204,7 +1211,9 @@ */ PCI_DEV_HW_SPEC_BM( 0001, 16ca, 0x00, ATA_WDMA2, "Cenatek Rocket Drive",0 ), - PCI_DEV_HW_SPEC_BM( 0102, 1078, 0x00, ATA_UDMA2, "Cyrix 5530" , 0 ), + PCI_DEV_HW_SPEC_BM( 0000, 1078, 0x00, ATA_WDMA2, "Cyrix 5510" , CYRIX_OLD ), + PCI_DEV_HW_SPEC_BM( 0002, 1078, 0x00, ATA_WDMA2, "Cyrix 5520" , CYRIX_OLD ), + PCI_DEV_HW_SPEC_BM( 0102, 1078, 0x00, ATA_UDMA2, "Cyrix 5530" , CYRIX_3x ), PCI_DEV_HW_SPEC_BM( 1000, 1042, 0x00, ATA_PIO4, "RZ 100x" , 0 ), PCI_DEV_HW_SPEC_BM( 1001, 1042, 0x00, ATA_PIO4, "RZ 100x" , 0 ), Modified: trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
============================================================================== --- trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp [iso-8859-1] Mon Sep 14 10:24:48 2015 @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2002-2014 Alexandr A. Telyatnikov (Alter) +Copyright (c) 2002-2015 Alexandr A. Telyatnikov (Alter) Module Name: id_ata.cpp @@ -498,6 +498,7 @@ if (statusByte & IDE_STATUS_DRQ) { // Suck out any remaining bytes and throw away. AtapiReadPort2(chan, IDX_IO1_i_Data); + UniataNanoSleep(PIO0_TIMING); } else { break; } @@ -507,6 +508,50 @@ } return statusByte; } // AtapiSuckPort2() + +ULONG +DDKFASTAPI +AtapiSuckPortBuffer2( + IN PHW_CHANNEL chan, + IN PUSHORT Buffer, + IN ULONG Count + ) +{ + UCHAR statusByte; + ULONG i; + USHORT data; + BOOLEAN retry = FALSE; + + // Assume, proper drive is already seleted + WaitOnBusyLong(chan); + for (i = 0; i < Count; i++) { + + GetStatus(chan, statusByte); + if (statusByte & IDE_STATUS_DRQ) { + // Suck out any remaining bytes and throw away. + data = AtapiReadPort2(chan, IDX_IO1_i_Data); + (*Buffer) = data; + Count--; + Buffer++; + UniataNanoSleep(PIO0_TIMING); + retry = FALSE; + } else { + if(i<Count && !retry) { + KdPrint2((PRINT_PREFIX " wait...\n")); + WaitForDrq(chan); + retry = TRUE; + } + break; + } + } + if(i) { + KdPrint2((PRINT_PREFIX "AtapiSuckPortBuffer2: %#x words\n", i )); + if(i==Count) { + AtapiSuckPort2(chan); + } + } + return i; +} // AtapiSuckPortBuffer2() UCHAR DDKFASTAPI @@ -1253,7 +1298,7 @@ #endif //UNIATA_CORE -#if DBG +#ifdef _DEBUG VOID NTAPI UniataDumpATARegs( @@ -1383,7 +1428,7 @@ if(use_ahci) { statusByte = WaitOnBusyLong(chan); -#if DBG +#ifdef _DEBUG if(!chan->AhciInternalAtaReq) { KdPrint2((PRINT_PREFIX "!AhciInternalAtaReq\n")); } @@ -1594,11 +1639,24 @@ if (atapiDev || !(LunExt->DeviceFlags & DFLAGS_DWORDIO_ENABLED) /*!deviceExtension->DWordIO*/) { KdPrint2((PRINT_PREFIX " use 16bit IO\n")); - +#ifdef _DEBUG + if(atapiDev) { + j = (AtapiReadPort1(chan, IDX_ATAPI_IO1_i_InterruptReason) & ATAPI_IR_Mask); + KdPrint3((PRINT_PREFIX "IssueIdentify: iReason %x\n", j)); + + j = + AtapiReadPort1(chan, IDX_ATAPI_IO1_i_ByteCountLow); + + j |= + (USHORT)AtapiReadPort1(chan, IDX_ATAPI_IO1_i_ByteCountHigh) << 8; + KdPrint3((PRINT_PREFIX "IssueIdentify: wCount %x\n", j)); + + } +#endif //DBG // ATI/SII chipsets with memory-mapped IO hangs when // I call ReadBuffer(), probably due to PCI burst/prefetch enabled // Unfortunately, I don't know yet how to workaround it except - // spacifying manual delay in the way you see below. + // specifying manual delay in the way you see below. ReadBuffer(chan, (PUSHORT)&deviceExtension->FullIdentifyData, 256, PIO0_TIMING); // Work around for some IDE and one model Atapi that will present more than @@ -2003,10 +2061,12 @@ LunExt->RwSwitchMCost = REORDER_MCOST_SWITCH_RW_CD; LunExt->SeekBackMCost = REORDER_MCOST_SEEK_BACK_CD; statusByte = WaitForDrq(chan); + } else { KdPrint2((PRINT_PREFIX "IssueIdentify: ATAPI drive type %#x.\n", LunExt->IdentifyData.DeviceType)); } + KdPrint2((PRINT_PREFIX "IssueIdentify: AtapiCmdSize %#x\n", deviceExtension->FullIdentifyData.AtapiCmdSize)); } else { KdPrint2((PRINT_PREFIX "IssueIdentify: hard drive.\n")); } @@ -2142,7 +2202,7 @@ //ULONG RevID = deviceExtension->RevID; ULONG ChipFlags = deviceExtension->HwFlags & CHIPFLAG_MASK; //UCHAR tmp8; - UCHAR tmp16; + USHORT tmp16; KdPrint2((PRINT_PREFIX "AtapiResetController: Reset IDE %#x/%#x @ %#x\n", VendorID, DeviceID, slotNumber)); KdPrint2((PRINT_PREFIX "simplexOnly %d\n", deviceExtension->simplexOnly)); @@ -2171,6 +2231,19 @@ PATA_REQ AtaReq = (PATA_REQ)(CurSrb->SrbExtension); KdPrint2((PRINT_PREFIX "AtapiResetController: pending SRB %#x, chan %#x\n", CurSrb, chan)); + if(CurSrb->Cdb[0] == SCSIOP_MECHANISM_STATUS) { + PHW_LU_EXTENSION LunExt; + KdPrint2((PRINT_PREFIX " was MechStatus\n")); + + i = GET_CDEV(CurSrb); + KdPrint2((PRINT_PREFIX " Lun %x\n", i)); + LunExt = chan->lun[i]; + + if(!(LunExt->DeviceFlags & DFLAGS_CHANGER_INITED)) { + LunExt->DeviceFlags |= DFLAGS_CHANGER_INITED; + KdPrint2((PRINT_PREFIX " set DFLAGS_CHANGER_INITED\n")); + } + } // Check and see if we are processing an internal srb if (AtaReq->OriginalSrb) { KdPrint2((PRINT_PREFIX " restore original SRB %#x\n", AtaReq->OriginalSrb)); @@ -2324,9 +2397,40 @@ break; } case ATA_SIS_ID: case ATA_NVIDIA_ID: { + ULONG offs; + ULONG Channel = deviceExtension->Channel + j; KdPrint2((PRINT_PREFIX " SIS/nVidia\n")); - if(!(ChipFlags & UNIATA_SATA)) + if(!(ChipFlags & UNIATA_SATA)) { goto default_reset; + } + offs = (ChipFlags & NV4OFF) ? 0x0440 : 0x0010; + + KdPrint2((PRINT_PREFIX " disable Phy intr, offs %#x, c %u\n", offs, Channel)); + /* disable device and PHY state change interrupts */ + if(ChipFlags & NVQ) { + KdPrint2((PRINT_PREFIX " NVQ, 32bits reg\n")); + AtapiWritePortEx4(NULL, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressSATA_0),offs+4, + AtapiReadPortEx4(NULL, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressSATA_0),offs+4) & ((~(ULONG)0x0000000d) << (!Channel*16)) ); + } else { + AtapiWritePortEx1(NULL, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressSATA_0),offs+1, + AtapiReadPortEx1(NULL, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressSATA_0),offs+1) & ((~(UCHAR)0x0d) << (!Channel*4)) ); + } + tmp16 = UniataSataPhyEnable(HwDeviceExtension, j, 0/* dev0*/, UNIATA_SATA_RESET_ENABLE); + + KdPrint2((PRINT_PREFIX " enable Phy intr, offs %#x\n", offs)); + /* enable device and PHY state change interrupts */ + if(ChipFlags & NVQ) { + AtapiWritePortEx4(NULL, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressSATA_0),offs+4, + AtapiReadPortEx4(NULL, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressSATA_0),offs+4) | (((ULONG)0x0000000d) << (!Channel*16)) ); + } else { + AtapiWritePortEx1(NULL, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressSATA_0),offs+1, + AtapiReadPortEx1(NULL, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressSATA_0),offs+1) | (((UCHAR)0x0d) << (!Channel*4)) ); + } + + KdPrint2((PRINT_PREFIX " dev status %#x\n", tmp16)); + if(tmp16 != IDE_STATUS_WRONG) { + goto default_reset; + } break; } case ATA_SILICON_IMAGE_ID: { ULONG offset; @@ -2458,6 +2562,22 @@ GetStatus(chan, statusByte); + if(statusByte != IDE_STATUS_SUCCESS) { + ULONG k; + k = UniataAnybodyHome(deviceExtension, j, i); + if(k == ATA_AT_HOME_HDD) { + // device reset in progress, perform additional wait + KdPrint2((PRINT_PREFIX " long reset, wait up to 4.5 s\n")); + k = 30 * 1000; + while ((AtapiReadPort1(chan, IDX_IO1_i_Status) & IDE_STATUS_BUSY) && + k--) + { + AtapiStallExecution(150); + } + KdPrint2((PRINT_PREFIX " exit after %u loops\n", k)); + GetStatus(chan, statusByte); + } + } if(statusByte == IDE_STATUS_SUCCESS) { IssueIdentify(HwDeviceExtension, @@ -4261,7 +4381,7 @@ pr_status = AtapiReadPortEx1(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressSATA_0),offs); AtapiWritePortEx1(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressSATA_0),offs, (0x0f << shift)); } - KdPrint2((PRINT_PREFIX " pr_status %x\n", pr_status)); + KdPrint2((PRINT_PREFIX " pr_status %x, shift %x\n", pr_status, shift)); /* check for and handle connect events */ if(((pr_status & (0x0cUL << shift)) == (0x04UL << shift)) ) { @@ -5094,6 +5214,15 @@ interruptReason = (AtapiReadPort1(chan, IDX_ATAPI_IO1_i_InterruptReason) & ATAPI_IR_Mask); KdPrint3((PRINT_PREFIX "AtapiInterrupt: ATAPI Error, int reason %x\n", interruptReason)); + if(UniataIsSATARangeAvailable(deviceExtension, lChannel)) { + if(deviceExtension->HwFlags & UNIATA_AHCI) { + // Do nothing here + } else + if(deviceExtension->HwFlags & UNIATA_SATA) { + UniataSataClearErr(HwDeviceExtension, lChannel, UNIATA_SATA_IGNORE_CONNECT, 0); + } + } + if(DmaTransfer && (chan->lun[DeviceNumber]->TransferMode > ATA_UDMA2) && ((error >> 4) == SCSI_SENSE_HARDWARE_ERROR)) { if(AtaReq->retry < MAX_RETRIES) { @@ -5356,24 +5485,24 @@ // Ensure that this is a write command. if (srb->SrbFlags & SRB_FLAGS_DATA_OUT) { - KdPrint2((PRINT_PREFIX - "AtapiInterrupt: Write interrupt\n")); - - statusByte = WaitOnBusy(chan); - - if (atapiDev || !(LunExt->DeviceFlags & DFLAGS_DWORDIO_ENABLED) /*!deviceExtension->DWordIO*/) { - - WriteBuffer(chan, - AtaReq->DataBuffer, - wordCount, - UniataGetPioTiming(LunExt)); - } else { - - WriteBuffer2(chan, - (PULONG)(AtaReq->DataBuffer), - wordCount / 2, - UniataGetPioTiming(LunExt)); - } + KdPrint2((PRINT_PREFIX + "AtapiInterrupt: Write interrupt\n")); + + statusByte = WaitOnBusy(chan); + + if (atapiDev || !(LunExt->DeviceFlags & DFLAGS_DWORDIO_ENABLED) /*!deviceExtension->DWordIO*/) { + + WriteBuffer(chan, + AtaReq->DataBuffer, + wordCount, + UniataGetPioTiming(LunExt)); + } else { + + WriteBuffer2(chan, + (PULONG)(AtaReq->DataBuffer), + wordCount / 2, + UniataGetPioTiming(LunExt)); + } } else { KdPrint3((PRINT_PREFIX @@ -5381,8 +5510,43 @@ interruptReason, srb)); + if(!wordCount && atapiDev && + !(statusByte & (IDE_STATUS_ERROR | IDE_STATUS_BUSY)) && + (statusByte & IDE_STATUS_DRQ)) { + // this can be late Packet interrupt after packet sending + KdPrint2((PRINT_PREFIX " unreliable wordCount ?\n")); + + wordCount = AtapiSuckPortBuffer2(chan, + AtaReq->DataBuffer, + AtaReq->WordsLeft); + KdPrint2((PRINT_PREFIX " transferred %#x\n", wordCount)); + GetBaseStatus(chan, statusByte); + KdPrint2((PRINT_PREFIX " status %#x, statusByte\n")); + if(wordCount) { + interruptReason = ATAPI_IR_IO_toHost; +#ifdef _DEBUG + UniataDumpATARegs(chan); +#endif + } + if(wordCount && AtaReq->WordsLeft) { + goto continue_atapi_pio_read; + } + } // Fail this request. status = SRB_STATUS_ERROR; + if(!wordCount && atapiDev && (srb->Cdb[0] != SCSIOP_REQUEST_SENSE)) { + // some devices feel bad after incorrect commands and may need reset + KdPrint2((PRINT_PREFIX + "AtapiInterrupt: Try ATAPI reset\n")); + + AtapiDisableInterrupts(deviceExtension, lChannel); + AtapiSoftReset(chan, DeviceNumber); + AtapiEnableInterrupts(deviceExtension, lChannel); + status = SRB_STATUS_BUS_RESET; + AtaReq->ReqState = REQ_STATE_TRANSFER_COMPLETE; + +// goto IntrPrepareResetController; + } goto CompleteRequest; } // Advance data buffer pointer and bytes left. @@ -5516,7 +5680,7 @@ status = SRB_STATUS_ERROR; goto CompleteRequest; } - +continue_atapi_pio_read: // Advance data buffer pointer and bytes left. AtaReq->DataBuffer += wordCount; AtaReq->WordsLeft -= wordCount; @@ -7554,7 +7718,13 @@ CHECK_INTR_IDLE); AtaReq->ReqState = REQ_STATE_ATAPI_EXPECTING_DATA_INTR; + // clear interrupt GetBaseStatus(chan, statusByte); + +#ifdef _DEBUG + statusByte = (AtapiReadPort1(chan, IDX_ATAPI_IO1_i_InterruptReason) & ATAPI_IR_Mask); + KdPrint3((PRINT_PREFIX "AtapiSendCommand: iReason %x\n", statusByte)); +#endif //DBG if(g_opt_AtapiSendDisableIntr) { AtapiEnableInterrupts(deviceExtension, lChannel); @@ -7865,7 +8035,7 @@ } else { RtlZeroMemory(modeData, sizeof(MODE_POWER_CONDITION_PAGE)); modeData->PageCode = MODE_PAGE_POWER_CONDITION; - modeData->PageLength = sizeof(MODE_POWER_CONDITION_PAGE)-sizeof(MODE_PARAMETER_HEADER); + modeData->PageLength = sizeof(MODE_PAGE_POWER_CONDITION)-sizeof(MODE_PARAMETER_HEADER); modeData->Byte3.Fields.Idle = LunExt->PowerState <= StartStop_Power_Idle; modeData->Byte3.Fields.Standby = LunExt->PowerState == StartStop_Power_Standby; Srb->DataTransferLength = sizeof(MODE_POWER_CONDITION_PAGE); @@ -10038,7 +10208,7 @@ return status; } #endif // USE_REACTOS_DDK - KdPrint(("UniATA Init: OS ver %x.%x (%d), %d CPU(s)\n", MajorVersion, MinorVersion, BuildNumber, KeNumberProcessors)); + KdPrint(("UniATA Init: OS ver %x.%x (%d), %d CPU(s)\n", MajorVersion, MinorVersion, BuildNumber, *KeNumberProcessors)); KeQuerySystemTime(&t0); do { @@ -10145,7 +10315,7 @@ g_opt_WaitDrqDelay = 100; g_opt_WaitBusyLongCount = 20000; g_opt_MaxIsrWait = 200; - g_opt_AtapiSendDisableIntr = 0; + g_opt_AtapiSendDisableIntr = FALSE; g_opt_AtapiDmaRawRead = FALSE; break; } @@ -10165,8 +10335,8 @@ g_opt_WaitDrqDelay = AtapiRegCheckDevValue(NULL, CHAN_NOT_SPECIFIED, DEVNUM_NOT_SPECIFIED, L"WaitDrqDelay", g_opt_WaitDrqDelay); // 10 vs 100 g_opt_WaitBusyLongCount = AtapiRegCheckDevValue(NULL, CHAN_NOT_SPECIFIED, DEVNUM_NOT_SPECIFIED, L"WaitBusyLongCount", g_opt_WaitBusyLongCount); // 2000 vs 20000 g_opt_WaitBusyLongDelay = AtapiRegCheckDevValue(NULL, CHAN_NOT_SPECIFIED, DEVNUM_NOT_SPECIFIED, L"WaitBusyLongDelay", g_opt_WaitBusyLongDelay); // 250 vs 250 - g_opt_AtapiSendDisableIntr = (BOOLEAN)AtapiRegCheckDevValue(NULL, CHAN_NOT_SPECIFIED, DEVNUM_NOT_SPECIFIED, L"AtapiSendDisableIntr", g_opt_AtapiSendDisableIntr); // 1 vs 0 - g_opt_AtapiDmaRawRead = (BOOLEAN)AtapiRegCheckDevValue(NULL, CHAN_NOT_SPECIFIED, DEVNUM_NOT_SPECIFIED, L"AtapiDmaRawRead", g_opt_AtapiDmaRawRead); // 1 vs 0 + g_opt_AtapiSendDisableIntr = (BOOLEAN)AtapiRegCheckDevValue(NULL, CHAN_NOT_SPECIFIED, DEVNUM_NOT_SPECIFIED, L"AtapiSendDisableIntr", g_opt_AtapiSendDisableIntr) ? TRUE : FALSE; // 1 vs 0 + g_opt_AtapiDmaRawRead = (BOOLEAN)AtapiRegCheckDevValue(NULL, CHAN_NOT_SPECIFIED, DEVNUM_NOT_SPECIFIED, L"AtapiDmaRawRead", g_opt_AtapiDmaRawRead) ? TRUE : FALSE; // 1 vs 0 g_opt_MaxIsrWait = AtapiRegCheckDevValue(NULL, CHAN_NOT_SPECIFIED, DEVNUM_NOT_SPECIFIED, L"MaxIsrWait", g_opt_MaxIsrWait); // 40 vs xxx } Modified: trunk/reactos/drivers/storage/ide/uniata/id_dma.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
============================================================================== --- trunk/reactos/drivers/storage/ide/uniata/id_dma.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/ide/uniata/id_dma.cpp [iso-8859-1] Mon Sep 14 10:24:48 2015 @@ -1013,6 +1013,7 @@ /****************/ KdPrint2((PRINT_PREFIX "SATA Generic\n")); + if((udmamode >= 5) || (ChipFlags & UNIATA_AHCI) || ((udmamode >= 0) && (chan->MaxTransferMode >= ATA_SA150))) { /* some drives report UDMA6, some UDMA5 */ /* ATAPI may not have SataCapabilities set in IDENTIFY DATA */ @@ -1235,29 +1236,85 @@ /*********/ /* Cyrix */ /*********/ - ULONG cyr_piotiming[] = - { 0x00009172, 0x00012171, 0x00020080, 0x00032010, 0x00040010 }; - ULONG cyr_wdmatiming[] = { 0x00077771, 0x00012121, 0x00002020 }; - ULONG cyr_udmatiming[] = { 0x00921250, 0x00911140, 0x00911030 }; - ULONG mode_reg = 0x24+(dev << 3); - +dma_cs55xx: if(apiomode >= 4) apiomode = 4; - for(i=udmamode; i>=0; i--) { - if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_UDMA0 + i)) { - AtapiWritePortEx4(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0), mode_reg, cyr_udmatiming[udmamode]); - return; - } - } - for(i=wdmamode; i>=0; i--) { - if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_WDMA0 + i)) { - AtapiWritePortEx4(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0), mode_reg, cyr_wdmatiming[wdmamode]); - return; - } - } - if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode)) { - AtapiWritePortEx4(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0), mode_reg, cyr_piotiming[apiomode]); - return; + + if(ChipType == CYRIX_3x) { + ULONG cyr_piotiming[] = + { 0x00009172, 0x00012171, 0x00020080, 0x00032010, 0x00040010 }; + ULONG cyr_wdmatiming[] = { 0x00077771, 0x00012121, 0x00002020 }; + ULONG cyr_udmatiming[] = { 0x00921250, 0x00911140, 0x00911030 }; + ULONG mode_reg = 0x24+(dev << 3); + + for(i=udmamode; i>=0; i--) { + if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_UDMA0 + i)) { + AtapiWritePortEx4(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0), mode_reg, cyr_udmatiming[udmamode]); + return; + } + } + for(i=wdmamode; i>=0; i--) { + if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_WDMA0 + i)) { + AtapiWritePortEx4(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0), mode_reg, cyr_wdmatiming[wdmamode]); + return; + } + } + if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode)) { + AtapiWritePortEx4(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0), mode_reg, cyr_piotiming[apiomode]); + return; + } + } else + if(ChipType == CYRIX_OLD) { + UCHAR cyr_piotiming_old[] = + { 11, 6, 3, 2, 1 }; + UCHAR timing; + + for(i=wdmamode; i>=0; i--) { + if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_WDMA0 + i)) { + return; + } + } + if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode)) { + timing = (6-apiomode) | (cyr_piotiming_old[i]); + /* Channel command timing */ + SetPciConfig1(0x62+Channel, timing); + /* Read command timing */ + SetPciConfig1(0x64+Channel*4+dev, timing); + /* Write command timing */ + SetPciConfig1(0x66+Channel*4+dev, timing); + return; + } + } else + if(ChipType == CYRIX_35) { +/* + USHORT c35_pio_timings[5] = { + 0xF7F4, 0xF173, 0x8141, 0x5131, 0x1131 + }; + USHORT c35_pio_cmd_timings[5] = { + 0xF7F4, 0x53F3, 0x13F1, 0x5131, 0x1131 + }; + ULONG c35_udma_timings[5] = { + 0x7F7436A1, 0x7F733481, 0x7F723261, 0x7F713161, 0x7F703061 + }; + ULONG c35_mwdma_timings[3] = { + 0x7F0FFFF3, 0x7F035352, 0x7F024241 + }; + ULONG mode_reg = 0x24+(dev << 3); +*/ + /* No MSR support yet, do not touch any regs */ + for(i=udmamode; i>=0; i--) { + if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_UDMA0 + i)) { + return; + } + } + for(i=wdmamode; i>=0; i--) { + if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_WDMA0 + i)) { + return; + } + } + if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode)) { + return; + } } return; @@ -1266,33 +1323,37 @@ /************/ /* National */ /************/ - ULONG nat_piotiming[] = - { 0x9172d132, 0x21717121, 0x00803020, 0x20102010, 0x00100010, - 0x00803020, 0x20102010, 0x00100010, - 0x00100010, 0x00100010, 0x00100010 }; - ULONG nat_dmatiming[] = { 0x80077771, 0x80012121, 0x80002020 }; - ULONG nat_udmatiming[] = { 0x80921250, 0x80911140, 0x80911030 }; - - if(apiomode >= 4) - apiomode = 4; - for(i=udmamode; i>=0; i--) { - if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_UDMA0 + i)) { - SetPciConfig4(0x44 + (dev * 8), nat_udmatiming[i]); - SetPciConfig4(0x40 + (dev * 8), nat_piotiming[i+8]); - return; - } - } - for(i=wdmamode; i>=0; i--) { - if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_WDMA0 + i)) { - SetPciConfig4(0x44 + (dev * 8), nat_dmatiming[i]); - SetPciConfig4(0x40 + (dev * 8), nat_piotiming[i+5]); - return; - } - } - if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode)) { - ChangePciConfig4(0x44 + (dev * 8), a | 0x80000000); - SetPciConfig4(0x40 + (dev * 8), nat_piotiming[apiomode]); - return; + if(!ChipType) { + ULONG nat_piotiming[] = + { 0x9172d132, 0x21717121, 0x00803020, 0x20102010, 0x00100010, + 0x00803020, 0x20102010, 0x00100010, + 0x00100010, 0x00100010, 0x00100010 }; + ULONG nat_dmatiming[] = { 0x80077771, 0x80012121, 0x80002020 }; + ULONG nat_udmatiming[] = { 0x80921250, 0x80911140, 0x80911030 }; + + if(apiomode >= 4) + apiomode = 4; + for(i=udmamode; i>=0; i--) { + if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_UDMA0 + i)) { + SetPciConfig4(0x44 + (dev * 8), nat_udmatiming[i]); + SetPciConfig4(0x40 + (dev * 8), nat_piotiming[i+8]); + return; + } + } + for(i=wdmamode; i>=0; i--) { + if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_WDMA0 + i)) { + SetPciConfig4(0x44 + (dev * 8), nat_dmatiming[i]); + SetPciConfig4(0x40 + (dev * 8), nat_piotiming[i+5]); + return; + } + } + if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode)) { + ChangePciConfig4(0x44 + (dev * 8), a | 0x80000000); + SetPciConfig4(0x40 + (dev * 8), nat_piotiming[apiomode]); + return; + } + } else { + goto dma_cs55xx; } /* Use GENERIC PIO */ break; } Modified: trunk/reactos/drivers/storage/ide/uniata/id_init.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
============================================================================== --- trunk/reactos/drivers/storage/ide/uniata/id_init.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/ide/uniata/id_init.cpp [iso-8859-1] Mon Sep 14 10:24:48 2015 @@ -286,6 +286,21 @@ } deviceExtension->NumberChannels = 1; KdPrint2((PRINT_PREFIX "New JMicron PATA 1 chan\n")); + } + break; + case ATA_CYRIX_ID: + if(ChipType == CYRIX_OLD) { + UCHAR tmp8; + ULONG slotNumber; + slotNumber = deviceExtension->slotNumber; + KdPrint2((PRINT_PREFIX "Cyrix slot %#x\n", slotNumber)); + GetPciConfig1(0x60, tmp8); + if(tmp8 & (1 << BMList[deviceExtension->DevIndex].channel)) { + KdPrint2((PRINT_PREFIX "Old Cyrix chan %d ok\n", BMList[deviceExtension->DevIndex].channel)); + } else { + KdPrint2((PRINT_PREFIX "Old Cyrix no chan %d\n", BMList[deviceExtension->DevIndex].channel)); + return FALSE; + } } break; } // end switch(VendorID) @@ -2094,6 +2109,8 @@ KdPrint2((PRINT_PREFIX "Intel SATA\n")); if(ChipFlags & UNIATA_AHCI) { KdPrint2((PRINT_PREFIX "Do nothing for AHCI\n")); + /* enable PCI interrupt */ + ChangePciConfig2(offsetof(PCI_COMMON_CONFIG, Command), (a & ~0x0400)); break; } if(c == CHAN_NOT_SPECIFIED) { @@ -2643,6 +2660,19 @@ if(ChipType == ITE_133_NEW) { } break; + case ATA_CYRIX_ID: + KdPrint2((PRINT_PREFIX "Cyrix\n")); + if(ChipType == CYRIX_OLD) { + if(c == CHAN_NOT_SPECIFIED) { + GetPciConfig1(0x60, tmp8); + if(!(tmp8 & 0x40)) { + KdPrint2((PRINT_PREFIX "Enable DMA\n")); + tmp8 |= 0x40; + SetPciConfig1(0x60, tmp8); + } + } + } + break; default: if(c != CHAN_NOT_SPECIFIED) { // We don't know how to check for 80-pin cable on unknown controllers. Modified: trunk/reactos/drivers/storage/ide/uniata/id_probe.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
============================================================================== --- trunk/reactos/drivers/storage/ide/uniata/id_probe.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/ide/uniata/id_probe.cpp [iso-8859-1] Mon Sep 14 10:24:48 2015 @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2002-2012 Alexandr A. Telyatnikov (Alter) +Copyright (c) 2002-2015 Alexandr A. Telyatnikov (Alter) Module Name: id_probe.cpp @@ -53,6 +53,10 @@ ULONG MCACount = 0; BOOLEAN FirstMasterOk = FALSE; +// This is our own resource check, +// ReactOS allows to allocate same I/O range for both PCI and ISA controllers +BOOLEAN AtdiskPrimaryClaimed = FALSE; +BOOLEAN AtdiskSecondaryClaimed = FALSE; #ifndef UNIATA_CORE @@ -1638,7 +1642,7 @@ chan->RegTranslation[IDX_SATA_IO].MemIo ? "mem" : "io")); if(!(deviceExtension->HwFlags & UNIATA_AHCI)) { -#if DBG +#ifdef _DEBUG UniataDumpATARegs(chan); #endif @@ -1721,6 +1725,7 @@ KdPrint2((PRINT_PREFIX "claim Compatible controller\n")); if (channel == 0) { KdPrint2((PRINT_PREFIX "claim Primary\n")); + AtdiskPrimaryClaimed = ConfigInfo->AtdiskPrimaryClaimed = TRUE; chan->PrimaryAddress = TRUE; @@ -1729,9 +1734,23 @@ } else if (channel == 1) { KdPrint2((PRINT_PREFIX "claim Secondary\n")); + AtdiskSecondaryClaimed = ConfigInfo->AtdiskSecondaryClaimed = TRUE; FirstMasterOk = TRUE; + } + } else { + if(chan->RegTranslation[IDX_IO1].Addr == IO_WD1 && + !chan->RegTranslation[IDX_IO1].MemIo) { + KdPrint2((PRINT_PREFIX "claim Primary (PCI over ISA range)\n")); + AtdiskPrimaryClaimed = + ConfigInfo->AtdiskPrimaryClaimed = TRUE; + } + if(chan->RegTranslation[IDX_IO1].Addr == IO_WD2 && + !chan->RegTranslation[IDX_IO1].MemIo) { + KdPrint2((PRINT_PREFIX "claim Secondary (PCI over ISA range)\n")); + AtdiskSecondaryClaimed = + ConfigInfo->AtdiskSecondaryClaimed = TRUE; } } @@ -2250,12 +2269,12 @@ } // check if Primary/Secondary Master IDE claimed if((ioSpace == (PUCHAR)IO_WD1) && - (ConfigInfo->AtdiskPrimaryClaimed)) { + (ConfigInfo->AtdiskPrimaryClaimed || AtdiskPrimaryClaimed)) { KdPrint2((PRINT_PREFIX "AtapiFindController: AtdiskPrimaryClaimed\n")); goto not_found; } else if((ioSpace == (PUCHAR)IO_WD2) && - (ConfigInfo->AtdiskSecondaryClaimed)) { + (ConfigInfo->AtdiskSecondaryClaimed || AtdiskSecondaryClaimed)) { KdPrint2((PRINT_PREFIX "AtapiFindController: AtdiskSecondaryClaimed\n")); goto not_found; } @@ -2287,7 +2306,7 @@ UniataInitMapBase(chan, BaseIoAddress1, BaseIoAddress2); UniataInitMapBM(deviceExtension, 0, FALSE); -#if DBG +#ifdef _DEBUG UniataDumpATARegs(chan); #endif @@ -2697,6 +2716,7 @@ UCHAR statusByte; ULONG RetVal=0; ULONG waitCount = 10000; + ULONG at_home = 0; KdPrint2((PRINT_PREFIX "CheckDevice: Device %#x\n", deviceNumber)); @@ -2705,7 +2725,7 @@ return 0; } if(deviceExtension->HwFlags & UNIATA_AHCI) { - if(!UniataAnybodyHome(HwDeviceExtension, lChannel, deviceNumber)) { + if(!(at_home = UniataAnybodyHome(HwDeviceExtension, lChannel, deviceNumber))) { return 0; } } @@ -2713,6 +2733,20 @@ if(ResetDev) { LunExt->PowerState = 0; + } + + if((deviceExtension->HwFlags & UNIATA_SATA) && + !UniataIsSATARangeAvailable(deviceExtension, lChannel) && + deviceNumber) { + KdPrint2((PRINT_PREFIX " SATA w/o i/o registers, check slave presence\n")); + SelectDrive(chan, deviceNumber & 0x01); + statusByte = AtapiReadPort1(chan, IDX_ATAPI_IO1_i_DriveSelect); + KdPrint2((PRINT_PREFIX " DriveSelect: %#x\n", statusByte)); + if((statusByte & IDE_DRIVE_MASK) != IDE_DRIVE_SELECT_2) { + KdPrint2((PRINT_PREFIX "CheckDevice: (no dev)\n")); + UniataForgetDevice(LunExt); + return 0; + } } if(ResetDev && (deviceExtension->HwFlags & UNIATA_AHCI)) { @@ -2729,7 +2763,7 @@ // Reset device AtapiSoftReset(chan, deviceNumber); - if(!UniataAnybodyHome(HwDeviceExtension, lChannel, deviceNumber)) { + if(!(at_home = UniataAnybodyHome(HwDeviceExtension, lChannel, deviceNumber))) { //KdPrint2((PRINT_PREFIX "CheckDevice: nobody at home 1\n")); return 0; } @@ -2787,7 +2821,7 @@ // Select the device. SelectDrive(chan, deviceNumber); - if(!UniataAnybodyHome(HwDeviceExtension, lChannel, deviceNumber)) { + if(!(at_home = UniataAnybodyHome(HwDeviceExtension, lChannel, deviceNumber))) { //KdPrint2((PRINT_PREFIX "CheckDevice: nobody at home 2\n")); return 0; } @@ -2842,7 +2876,7 @@ // ATAPI signature found. // Issue the ATAPI identify command if this // is not for the crash dump utility. - +try_atapi: if (!deviceExtension->DriverMustPoll) { // Issue ATAPI packet identify command. @@ -2872,7 +2906,7 @@ } } else { - +forget_device: // Indicate no working device. KdPrint2((PRINT_PREFIX "CheckDevice: Device %#x not responding\n", deviceNumber)); @@ -2906,6 +2940,16 @@ RetVal = DFLAGS_DEVICE_PRESENT; LunExt->DeviceFlags |= DFLAGS_DEVICE_PRESENT; LunExt->DeviceFlags &= ~DFLAGS_ATAPI_DEVICE; + } else { + // This can be ATAPI on broken hardware + GetBaseStatus(chan, statusByte); + if(!at_home && UniataAnybodyHome(HwDeviceExtension, lChannel, deviceNumber)) { + KdPrint2((PRINT_PREFIX "CheckDevice: nobody at home post IDE\n")); + goto forget_device; + } + KdPrint2((PRINT_PREFIX "CheckDevice: try ATAPI %#x, status %#x\n", + deviceNumber, statusByte)); + goto try_atapi; } GetBaseStatus(chan, statusByte); } Modified: trunk/reactos/drivers/storage/ide/uniata/id_sata.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
============================================================================== --- trunk/reactos/drivers/storage/ide/uniata/id_sata.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/ide/uniata/id_sata.cpp [iso-8859-1] Mon Sep 14 10:24:48 2015 @@ -728,12 +728,20 @@ } /* re-enable AHCI mode */ + /* Linux: Some controllers need AHCI_EN to be written multiple times. + * Try a few times before giving up. + */ GHC = UniataAhciReadHostPort4(deviceExtension, IDX_AHCI_GHC); - if(!(GHC & AHCI_GHC_AE)) { - KdPrint2((PRINT_PREFIX " re-enable AHCI mode, GHC %#x\n", GHC)); - UniataAhciWriteHostPort4(deviceExtension, IDX_AHCI_GHC, - GHC | AHCI_GHC_AE); - GHC = UniataAhciReadHostPort4(deviceExtension, IDX_AHCI_GHC); + for(i=0; i<5; i++) { + if(!(GHC & AHCI_GHC_AE)) { + KdPrint2((PRINT_PREFIX " re-enable AHCI mode, GHC %#x\n", GHC)); + UniataAhciWriteHostPort4(deviceExtension, IDX_AHCI_GHC, + GHC | AHCI_GHC_AE); + AtapiStallExecution(1000); + GHC = UniataAhciReadHostPort4(deviceExtension, IDX_AHCI_GHC); + } else { + break; + } } KdPrint2((PRINT_PREFIX " AHCI GHC %#x\n", GHC)); if(!(GHC & AHCI_GHC_AE)) { @@ -1980,6 +1988,7 @@ CMD = UniataAhciReadChannelPort4(chan, IDX_AHCI_P_CMD); KdPrint2((" CMD %#x\n", CMD)); UniataAhciWriteChannelPort4(chan, IDX_AHCI_P_CMD, CMD | ATA_AHCI_P_CMD_FRE); + UniataAhciReadChannelPort4(chan, IDX_AHCI_P_CMD); /* flush */ return; } // end UniataAhciStartFR() @@ -2039,6 +2048,7 @@ CMD | ATA_AHCI_P_CMD_ST | ((chan->ChannelCtrlFlags & CTRFLAGS_AHCI_PM) ? ATA_AHCI_P_CMD_PMA : 0)); + UniataAhciReadChannelPort4(chan, IDX_AHCI_P_CMD); /* flush */ return; } // end UniataAhciStart() @@ -2187,15 +2197,24 @@ if(CMD0 != CMD) { KdPrint2((" send CMD %#x, entries %#x\n", CMD, AHCI_CL->prd_length)); UniataAhciWriteChannelPort4(chan, IDX_AHCI_P_CMD, CMD); + UniataAhciReadChannelPort4(chan, IDX_AHCI_P_CMD); /* flush */ } /* issue command to controller */ //UniataAhciWriteChannelPort4(chan, IDX_AHCI_P_ACT, 0x01 << tag); + KdPrint2((" Set CI\n")); UniataAhciWriteChannelPort4(chan, IDX_AHCI_P_CI, 0x01 << tag); chan->AhciPrevCI |= 0x01 << tag; + KdPrint2((" Send CMD START\n")); + UniataAhciWriteChannelPort4(chan, IDX_AHCI_P_CMD, + CMD | + ATA_AHCI_P_CMD_ST | + ((chan->ChannelCtrlFlags & CTRFLAGS_AHCI_PM) ? ATA_AHCI_P_CMD_PMA : 0)); + UniataAhciReadChannelPort4(chan, IDX_AHCI_P_CMD); /* flush */ + if(!ATAPI_DEVICE(chan, DeviceNumber)) { - // TODO: check if we send ATA_RESET and wait for ready of so. + // TODO: check if we send ATAPI_RESET and wait for ready of so. if(AtaReq->ahci.ahci_cmd_ptr->cfis[2] == IDE_COMMAND_ATAPI_RESET) { ULONG TFD; ULONG i; @@ -2365,6 +2384,7 @@ (((chan->ChannelCtrlFlags & CTRFLAGS_AHCI_PM)) ? ATA_AHCI_P_CMD_ALPE : 0) | (((chan->ChannelCtrlFlags & CTRFLAGS_AHCI_PM2)) ? ATA_AHCI_P_CMD_ASP : 0 )) ); + UniataAhciReadChannelPort4(chan, IDX_AHCI_P_CMD); /* flush */ #ifdef DBG //UniataDumpAhciPortRegs(chan); @@ -2399,6 +2419,7 @@ UniataAhciStop(chan); UniataAhciStopFR(chan); UniataAhciWriteChannelPort4(chan, IDX_AHCI_P_CMD, 0); + UniataAhciReadChannelPort4(chan, IDX_AHCI_P_CMD); /* flush */ /* Allow everything including partial and slumber modes. */ UniataSataWritePort4(chan, IDX_SATA_SControl, 0, 0); Modified: trunk/reactos/drivers/storage/ide/uniata/uniata_ver.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
============================================================================== --- trunk/reactos/drivers/storage/ide/uniata/uniata_ver.h [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/ide/uniata/uniata_ver.h [iso-8859-1] Mon Sep 14 10:24:48 2015 @@ -1,10 +1,10 @@ -#define UNIATA_VER_STR "45e" -#define UNIATA_VER_DOT 0.45.5.0 +#define UNIATA_VER_STR "45h1" +#define UNIATA_VER_DOT 0.45.8.1 #define UNIATA_VER_MJ 0 #define UNIATA_VER_MN 45 -#define UNIATA_VER_SUB_MJ 5 -#define UNIATA_VER_SUB_MN 0 -#define UNIATA_VER_DOT_COMMA 0,45,5,0 -#define UNIATA_VER_DOT_STR "0.45.5.0" -#define UNIATA_VER_YEAR 2014 -#define UNIATA_VER_YEAR_STR "2014" +#define UNIATA_VER_SUB_MJ 8 +#define UNIATA_VER_SUB_MN 1 +#define UNIATA_VER_DOT_COMMA 0,45,8,1 +#define UNIATA_VER_DOT_STR "0.45.8.1" +#define UNIATA_VER_YEAR 2015 +#define UNIATA_VER_YEAR_STR "2015"
9 years, 3 months
1
0
0
0
[akhaldi] 69223: [ACLEDIT] Order the exports, add missing one and make sure the list matches our target (Windows Server 2003 Sp2). By Radek Liška, confirmed and slightly changed by me. CORE-8174
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Sep 14 09:51:11 2015 New Revision: 69223 URL:
http://svn.reactos.org/svn/reactos?rev=69223&view=rev
Log: [ACLEDIT] Order the exports, add missing one and make sure the list matches our target (Windows Server 2003 Sp2). By Radek Liška, confirmed and slightly changed by me. CORE-8174 Modified: trunk/reactos/dll/win32/acledit/acledit.spec Modified: trunk/reactos/dll/win32/acledit/acledit.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/acledit/acledit.…
============================================================================== --- trunk/reactos/dll/win32/acledit/acledit.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/acledit/acledit.spec [iso-8859-1] Mon Sep 14 09:51:11 2015 @@ -1,7 +1,8 @@ -@ stdcall EditAuditInfo(long) -@ stdcall EditOwnerInfo(long) -@ stdcall EditPermissionInfo(long) -@ stdcall FMExtensionProcW(ptr long long) -@ stdcall SedDiscretionaryAclEditor(ptr ptr wstr ptr ptr wstr ptr ptr ptr long long ptr long) -@ stdcall SedSystemAclEditor(ptr ptr wstr ptr ptr wstr ptr ptr ptr long ptr long) -@ stdcall SedTakeOwnership(ptr ptr wstr wstr wstr long ptr ptr ptr long long ptr ptr long) +1 stdcall EditAuditInfo(long) +2 stdcall EditOwnerInfo(long) +3 stdcall EditPermissionInfo(long) +4 stdcall DllMain(long long ptr) +5 stdcall FMExtensionProcW(ptr long long) +6 stdcall SedDiscretionaryAclEditor(ptr ptr wstr ptr ptr wstr ptr ptr ptr long long ptr long) +7 stdcall SedSystemAclEditor(ptr ptr wstr ptr ptr wstr ptr ptr ptr long ptr long) +8 stdcall SedTakeOwnership(ptr ptr wstr wstr wstr long ptr ptr ptr long long ptr ptr long)
9 years, 3 months
1
0
0
0
[akhaldi] 69222: [NOTEPAD] Calculate the border around the printing area based on the margins the user has selected in the page setup dialog, instead of using a fixed size one. Brought to you by Ri...
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Sep 14 09:32:57 2015 New Revision: 69222 URL:
http://svn.reactos.org/svn/reactos?rev=69222&view=rev
Log: [NOTEPAD] Calculate the border around the printing area based on the margins the user has selected in the page setup dialog, instead of using a fixed size one. Brought to you by Ricardo Hanke with minor changes by me. CORE-10184 Modified: trunk/reactos/base/applications/notepad/dialog.c trunk/reactos/base/applications/notepad/main.h trunk/reactos/base/applications/notepad/settings.c Modified: trunk/reactos/base/applications/notepad/dialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/notepad/…
============================================================================== --- trunk/reactos/base/applications/notepad/dialog.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/notepad/dialog.c [iso-8859-1] Mon Sep 14 09:32:57 2015 @@ -225,6 +225,31 @@ } } +static RECT +GetPrintingRect(HDC hdc, RECT margins) +{ + int iLogPixelsX, iLogPixelsY; + int iHorzRes, iVertRes; + int iPhysPageX, iPhysPageY, iPhysPageW, iPhysPageH; + RECT rcPrintRect; + + iPhysPageX = GetDeviceCaps(hdc, PHYSICALOFFSETX); + iPhysPageY = GetDeviceCaps(hdc, PHYSICALOFFSETY); + iPhysPageW = GetDeviceCaps(hdc, PHYSICALWIDTH); + iPhysPageH = GetDeviceCaps(hdc, PHYSICALHEIGHT); + iLogPixelsX = GetDeviceCaps(hdc, LOGPIXELSX); + iLogPixelsY = GetDeviceCaps(hdc, LOGPIXELSY); + iHorzRes = GetDeviceCaps(hdc, HORZRES); + iVertRes = GetDeviceCaps(hdc, VERTRES); + + rcPrintRect.left = (margins.left * iLogPixelsX / 2540) - iPhysPageX; + rcPrintRect.top = (margins.top * iLogPixelsY / 2540) - iPhysPageY; + rcPrintRect.right = iHorzRes - (((margins.left * iLogPixelsX / 2540) - iPhysPageX) + ((margins.right * iLogPixelsX / 2540) - (iPhysPageW - iPhysPageX - iHorzRes))); + rcPrintRect.bottom = iVertRes - (((margins.top * iLogPixelsY / 2540) - iPhysPageY) + ((margins.bottom * iLogPixelsY / 2540) - (iPhysPageH - iPhysPageY - iVertRes))); + + return rcPrintRect; +} + static BOOL DoSaveFile(VOID) { BOOL bRet = TRUE; @@ -518,7 +543,7 @@ TEXTMETRIC tm; PRINTDLG printer; SIZE szMetric; - int cWidthPels, cHeightPels, border; + int border; int xLeft, yTop, pagecount, dopage, copycount; unsigned int i; LOGFONT hdrFont; @@ -526,6 +551,7 @@ DWORD size; LPTSTR pTemp; static const TCHAR times_new_roman[] = _T("Times New Roman"); + RECT rcPrintRect; /* Get a small font and print some header info on each page */ ZeroMemory(&hdrFont, sizeof(hdrFont)); @@ -591,9 +617,6 @@ return; } - /* Get the page dimensions in pixels. */ - cWidthPels = GetDeviceCaps(printer.hDC, HORZRES); - cHeightPels = GetDeviceCaps(printer.hDC, VERTRES); /* Get the file text */ if (printer.Flags & PD_SELECTION) @@ -623,13 +646,16 @@ size = GetWindowText(Globals.hEdit, pTemp, size); } + /* Get the current printing area */ + rcPrintRect = GetPrintingRect(printer.hDC, Globals.lMargins); + /* Ensure that each logical unit maps to one pixel */ SetMapMode(printer.hDC, MM_TEXT); /* Needed to get the correct height of a text line */ GetTextMetrics(printer.hDC, &tm); - border = 150; + border = 15; for (copycount=1; copycount <= printer.nCopies; copycount++) { i = 0; pagecount = 1; @@ -667,8 +693,11 @@ AlertPrintError(); return; } + + SetViewportOrgEx(printer.hDC, rcPrintRect.left, rcPrintRect.top, NULL); + /* Write a rectangle and header at the top of each page */ - Rectangle(printer.hDC, border, border, cWidthPels-border, border + tm.tmHeight * 2); + Rectangle(printer.hDC, border, border, rcPrintRect.right - border, border + tm.tmHeight * 2); /* I don't know what's up with this TextOut command. This comes out kind of mangled. */ @@ -680,7 +709,7 @@ } /* The starting point for the main text */ - xLeft = border * 2; + xLeft = 0; yTop = border + tm.tmHeight * 4; SelectObject(printer.hDC, old_font); @@ -689,7 +718,7 @@ * text one character at a time. */ do { if (pTemp[i] == '\n') { - xLeft = border * 2; + xLeft = 0; yTop += tm.tmHeight; } else if (pTemp[i] != '\r') { @@ -701,13 +730,13 @@ xLeft += szMetric.cx; /* Insert a line break if the current line does not fit into the printing area */ - if (xLeft > (cWidthPels - border * 2)) + if (xLeft > rcPrintRect.right) { - xLeft = border * 2; + xLeft = 0; yTop = yTop + tm.tmHeight; } } - } while (i++ < size && yTop < (cHeightPels - border * 2)); + } while (i++ < size && yTop < rcPrintRect.bottom); if (dopage) EndPage(printer.hDC); @@ -1184,10 +1213,7 @@ page.hwndOwner = Globals.hMainWnd; page.Flags = PSD_ENABLEPAGESETUPTEMPLATE | PSD_ENABLEPAGESETUPHOOK | PSD_MARGINS; page.hInstance = Globals.hInstance; - page.rtMargin.left = Globals.lMarginLeft; - page.rtMargin.top = Globals.lMarginTop; - page.rtMargin.right = Globals.lMarginRight; - page.rtMargin.bottom = Globals.lMarginBottom; + page.rtMargin = Globals.lMargins; page.hDevMode = Globals.hDevMode; page.hDevNames = Globals.hDevNames; page.lpPageSetupTemplateName = MAKEINTRESOURCE(DIALOG_PAGESETUP); @@ -1197,10 +1223,7 @@ Globals.hDevMode = page.hDevMode; Globals.hDevNames = page.hDevNames; - Globals.lMarginLeft = page.rtMargin.left; - Globals.lMarginTop = page.rtMargin.top; - Globals.lMarginRight = page.rtMargin.right; - Globals.lMarginBottom = page.rtMargin.bottom; + Globals.lMargins = page.rtMargin; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Modified: trunk/reactos/base/applications/notepad/main.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/notepad/…
============================================================================== --- trunk/reactos/base/applications/notepad/main.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/notepad/main.h [iso-8859-1] Mon Sep 14 09:32:57 2015 @@ -73,10 +73,7 @@ TCHAR szFileName[MAX_PATH]; TCHAR szFileTitle[MAX_PATH]; TCHAR szFilter[2 * MAX_STRING_LEN + 100]; - LONG lMarginTop; - LONG lMarginBottom; - LONG lMarginLeft; - LONG lMarginRight; + RECT lMargins; TCHAR szHeader[MAX_PATH]; TCHAR szFooter[MAX_PATH]; TCHAR szStatusBarLineCol[MAX_PATH]; Modified: trunk/reactos/base/applications/notepad/settings.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/notepad/…
============================================================================== --- trunk/reactos/base/applications/notepad/settings.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/notepad/settings.c [iso-8859-1] Mon Sep 14 09:32:57 2015 @@ -144,10 +144,10 @@ QueryBool(hKey, _T("fStatusBar"), &Globals.bShowStatusBar); QueryString(hKey, _T("szHeader"), Globals.szHeader, ARRAY_SIZE(Globals.szHeader)); QueryString(hKey, _T("szTrailer"), Globals.szFooter, ARRAY_SIZE(Globals.szFooter)); - QueryDword(hKey, _T("iMarginLeft"), (DWORD*)&Globals.lMarginLeft); - QueryDword(hKey, _T("iMarginTop"), (DWORD*)&Globals.lMarginTop); - QueryDword(hKey, _T("iMarginRight"), (DWORD*)&Globals.lMarginRight); - QueryDword(hKey, _T("iMarginBottom"), (DWORD*)&Globals.lMarginBottom); + QueryDword(hKey, _T("iMarginLeft"), (DWORD*)&Globals.lMargins.left); + QueryDword(hKey, _T("iMarginTop"), (DWORD*)&Globals.lMargins.top); + QueryDword(hKey, _T("iMarginRight"), (DWORD*)&Globals.lMargins.right); + QueryDword(hKey, _T("iMarginBottom"), (DWORD*)&Globals.lMargins.bottom); QueryDword(hKey, _T("iWindowPosX"), (DWORD*)&Globals.main_rect.left); QueryDword(hKey, _T("iWindowPosY"), (DWORD*)&Globals.main_rect.top); @@ -239,10 +239,10 @@ SaveDword(hKey, _T("fStatusBar"), Globals.bShowStatusBar ? 1 : 0); SaveString(hKey, _T("szHeader"), Globals.szHeader); SaveString(hKey, _T("szTrailer"), Globals.szFooter); - SaveDword(hKey, _T("iMarginLeft"), Globals.lMarginLeft); - SaveDword(hKey, _T("iMarginTop"), Globals.lMarginTop); - SaveDword(hKey, _T("iMarginRight"), Globals.lMarginRight); - SaveDword(hKey, _T("iMarginBottom"), Globals.lMarginBottom); + SaveDword(hKey, _T("iMarginLeft"), Globals.lMargins.left); + SaveDword(hKey, _T("iMarginTop"), Globals.lMargins.top); + SaveDword(hKey, _T("iMarginRight"), Globals.lMargins.right); + SaveDword(hKey, _T("iMarginBottom"), Globals.lMargins.bottom); SaveDword(hKey, _T("iWindowPosX"), Globals.main_rect.left); SaveDword(hKey, _T("iWindowPosY"), Globals.main_rect.top); SaveDword(hKey, _T("iWindowPosDX"), Globals.main_rect.right - Globals.main_rect.left);
9 years, 3 months
1
0
0
0
[pschweitzer] 69221: [MOUNTMGR] Implement the IOCTL IOCTL_MOUNTMGR_VOLUME_MOUNT_POINT_CREATED: - Implement WriteRemoteDatabaseEntry() - Implement MountMgrVolumeMountPointCreated()
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Sep 13 22:52:07 2015 New Revision: 69221 URL:
http://svn.reactos.org/svn/reactos?rev=69221&view=rev
Log: [MOUNTMGR] Implement the IOCTL IOCTL_MOUNTMGR_VOLUME_MOUNT_POINT_CREATED: - Implement WriteRemoteDatabaseEntry() - Implement MountMgrVolumeMountPointCreated() Modified: trunk/reactos/drivers/filters/mountmgr/database.c trunk/reactos/drivers/filters/mountmgr/device.c trunk/reactos/drivers/filters/mountmgr/mntmgr.h trunk/reactos/drivers/filters/mountmgr/mountmgr.c Modified: trunk/reactos/drivers/filters/mountmgr/database.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filters/mountmgr/d…
============================================================================== --- trunk/reactos/drivers/filters/mountmgr/database.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filters/mountmgr/database.c [iso-8859-1] Sun Sep 13 22:52:07 2015 @@ -192,6 +192,39 @@ } return Entry; +} + +/* + * @implemented + */ +NTSTATUS +WriteRemoteDatabaseEntry(IN HANDLE Database, + IN LONG Offset, + IN PDATABASE_ENTRY Entry) +{ + NTSTATUS Status; + LARGE_INTEGER ByteOffset; + IO_STATUS_BLOCK IoStatusBlock; + + ByteOffset.QuadPart = Offset; + Status = ZwWriteFile(Database, + NULL, + NULL, + NULL, + &IoStatusBlock, + Entry, + Entry->EntrySize, + &ByteOffset, + NULL); + if (NT_SUCCESS(Status)) + { + if (IoStatusBlock.Information < Entry->EntrySize) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + } + } + + return Status; } /* Modified: trunk/reactos/drivers/filters/mountmgr/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filters/mountmgr/d…
============================================================================== --- trunk/reactos/drivers/filters/mountmgr/device.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filters/mountmgr/device.c [iso-8859-1] Sun Sep 13 22:52:07 2015 @@ -1688,15 +1688,242 @@ return Status; } +/* + * @implemented + */ NTSTATUS MountMgrVolumeMountPointCreated(IN PDEVICE_EXTENSION DeviceExtension, IN PIRP Irp, IN NTSTATUS LockStatus) { - UNREFERENCED_PARAMETER(DeviceExtension); - UNREFERENCED_PARAMETER(Irp); - UNREFERENCED_PARAMETER(LockStatus); - return STATUS_NOT_IMPLEMENTED; + LONG Offset; + BOOLEAN Found; + NTSTATUS Status; + HANDLE RemoteDatabase; + PMOUNTDEV_UNIQUE_ID UniqueId; + PDATABASE_ENTRY DatabaseEntry; + PASSOCIATED_DEVICE_ENTRY AssociatedEntry; + PDEVICE_INFORMATION DeviceInformation, TargetDeviceInformation; + UNICODE_STRING LinkTarget, SourceDeviceName, SourceSymbolicName, TargetVolumeName, VolumeName, DbName; + + /* Initialize string */ + LinkTarget.Length = 0; + LinkTarget.MaximumLength = 0xC8; + LinkTarget.Buffer = AllocatePool(LinkTarget.MaximumLength); + if (LinkTarget.Buffer == NULL) + { + return STATUS_INSUFFICIENT_RESOURCES; + } + + /* If the mount point was created, then, it changed! + * Also use it to query some information + */ + Status = MountMgrVolumeMountPointChanged(DeviceExtension, Irp, LockStatus, &SourceDeviceName, &SourceSymbolicName, &TargetVolumeName); + /* Pending means DB are under synchronization, bail out */ + if (Status == STATUS_PENDING) + { + FreePool(LinkTarget.Buffer); + FreePool(SourceDeviceName.Buffer); + FreePool(SourceSymbolicName.Buffer); + return STATUS_PENDING; + } + else if (!NT_SUCCESS(Status)) + { + FreePool(LinkTarget.Buffer); + return Status; + } + + /* Query the device information */ + Status = FindDeviceInfo(DeviceExtension, &SourceDeviceName, FALSE, &DeviceInformation); + if (!NT_SUCCESS(Status)) + { + /* If it failed, first try to get volume name */ + Status = QueryVolumeName(0, NULL, &SourceDeviceName, &LinkTarget, &VolumeName); + if (!NT_SUCCESS(Status)) + { + /* Then, try to read the symlink */ + Status = MountMgrQuerySymbolicLink(&SourceDeviceName, &LinkTarget); + if (!NT_SUCCESS(Status)) + { + FreePool(LinkTarget.Buffer); + FreePool(SourceDeviceName.Buffer); + FreePool(SourceSymbolicName.Buffer); + return Status; + } + } + else + { + FreePool(VolumeName.Buffer); + } + + FreePool(SourceDeviceName.Buffer); + + SourceDeviceName.Length = LinkTarget.Length; + SourceDeviceName.MaximumLength = LinkTarget.MaximumLength; + SourceDeviceName.Buffer = LinkTarget.Buffer; + + /* Now that we have the correct source, reattempt to query information */ + Status = FindDeviceInfo(DeviceExtension, &SourceDeviceName, FALSE, &DeviceInformation); + if (!NT_SUCCESS(Status)) + { + FreePool(SourceDeviceName.Buffer); + FreePool(SourceSymbolicName.Buffer); + return Status; + } + } + + FreePool(SourceDeviceName.Buffer); + + /* Get information about target device */ + Status = FindDeviceInfo(DeviceExtension, &TargetVolumeName, FALSE, &TargetDeviceInformation); + if (!NT_SUCCESS(Status)) + { + FreePool(SourceSymbolicName.Buffer); + return Status; + } + + /* Notify if not disabled */ + if (!TargetDeviceInformation->SkipNotifications) + { + PostOnlineNotification(DeviceExtension, &TargetDeviceInformation->SymbolicName); + } + + /* Open the remote database */ + RemoteDatabase = OpenRemoteDatabase(DeviceInformation, TRUE); + if (RemoteDatabase == 0) + { + FreePool(SourceSymbolicName.Buffer); + return STATUS_INSUFFICIENT_RESOURCES; + } + + /* Browse all the entries */ + Offset = 0; + Found = FALSE; + for (;;) + { + DatabaseEntry = GetRemoteDatabaseEntry(RemoteDatabase, Offset); + if (DatabaseEntry == NULL) + { + break; + } + + /* Try to find ourselves */ + DbName.MaximumLength = DatabaseEntry->SymbolicNameLength; + DbName.Length = DbName.MaximumLength; + DbName.Buffer = (PWSTR)((ULONG_PTR)DatabaseEntry + DatabaseEntry->SymbolicNameOffset); + if (RtlEqualUnicodeString(&TargetVolumeName, &DbName, TRUE)) + { + ++DatabaseEntry->DatabaseOffset; + Status = WriteRemoteDatabaseEntry(RemoteDatabase, Offset, DatabaseEntry); + FreePool(DatabaseEntry); + Found = TRUE; + break; + } + + Offset += DatabaseEntry->EntrySize; + FreePool(DatabaseEntry); + } + + /* We couldn't find ourselves, we'll have to add ourselves */ + if (!Found) + { + ULONG EntrySize; + PUNIQUE_ID_REPLICATE UniqueIdReplicate; + + /* Query the device unique ID */ + Status = QueryDeviceInformation(&TargetVolumeName, NULL, &UniqueId, NULL, NULL, NULL, NULL, NULL); + if (!NT_SUCCESS(Status)) + { + FreePool(SourceSymbolicName.Buffer); + CloseRemoteDatabase(RemoteDatabase); + return Status; + } + + /* Allocate a database entry */ + EntrySize = UniqueId->UniqueIdLength + TargetVolumeName.Length + sizeof(DATABASE_ENTRY); + DatabaseEntry = AllocatePool(EntrySize); + if (DatabaseEntry == NULL) + { + FreePool(UniqueId); + FreePool(SourceSymbolicName.Buffer); + CloseRemoteDatabase(RemoteDatabase); + return STATUS_INSUFFICIENT_RESOURCES; + } + + /* Fill it in */ + DatabaseEntry->EntrySize = EntrySize; + DatabaseEntry->DatabaseOffset = 1; + DatabaseEntry->SymbolicNameOffset = sizeof(DATABASE_ENTRY); + DatabaseEntry->SymbolicNameLength = TargetVolumeName.Length; + DatabaseEntry->UniqueIdOffset = TargetVolumeName.Length + sizeof(DATABASE_ENTRY); + DatabaseEntry->UniqueIdLength = UniqueId->UniqueIdLength; + RtlCopyMemory((PVOID)((ULONG_PTR)DatabaseEntry + sizeof(DATABASE_ENTRY)), TargetVolumeName.Buffer, DatabaseEntry->SymbolicNameLength); + RtlCopyMemory((PVOID)((ULONG_PTR)DatabaseEntry + DatabaseEntry->UniqueIdOffset), UniqueId->UniqueId, UniqueId->UniqueIdLength); + + /* And write it down */ + Status = AddRemoteDatabaseEntry(RemoteDatabase, DatabaseEntry); + FreePool(DatabaseEntry); + if (!NT_SUCCESS(Status)) + { + FreePool(UniqueId); + FreePool(SourceSymbolicName.Buffer); + CloseRemoteDatabase(RemoteDatabase); + return Status; + } + + /* And now, allocate an Unique ID item */ + UniqueIdReplicate = AllocatePool(sizeof(UNIQUE_ID_REPLICATE)); + if (UniqueIdReplicate == NULL) + { + FreePool(UniqueId); + FreePool(SourceSymbolicName.Buffer); + CloseRemoteDatabase(RemoteDatabase); + return Status; + } + + /* To associate it with the device */ + UniqueIdReplicate->UniqueId = UniqueId; + InsertTailList(&DeviceInformation->ReplicatedUniqueIdsListHead, &UniqueIdReplicate->ReplicatedUniqueIdsListEntry); + } + + /* We're done with the remote database */ + CloseRemoteDatabase(RemoteDatabase); + + /* Check we were find writing the entry */ + if (!NT_SUCCESS(Status)) + { + FreePool(SourceSymbolicName.Buffer); + return Status; + } + + /* This is the end, allocate an associated entry */ + AssociatedEntry = AllocatePool(sizeof(ASSOCIATED_DEVICE_ENTRY)); + if (AssociatedEntry == NULL) + { + FreePool(SourceSymbolicName.Buffer); + return STATUS_INSUFFICIENT_RESOURCES; + } + + /* Initialize its source name string */ + AssociatedEntry->String.Length = SourceSymbolicName.Length; + AssociatedEntry->String.MaximumLength = AssociatedEntry->String.Length + sizeof(UNICODE_NULL); + AssociatedEntry->String.Buffer = AllocatePool(AssociatedEntry->String.MaximumLength); + if (AssociatedEntry->String.Buffer == NULL) + { + FreePool(AssociatedEntry); + FreePool(SourceSymbolicName.Buffer); + return STATUS_INSUFFICIENT_RESOURCES; + } + + /* Copy data & insert in list */ + RtlCopyMemory(AssociatedEntry->String.Buffer, SourceSymbolicName.Buffer, SourceSymbolicName.Length); + AssociatedEntry->String.Buffer[SourceSymbolicName.Length / sizeof(WCHAR)] = UNICODE_NULL; + AssociatedEntry->DeviceInformation = DeviceInformation; + InsertTailList(&TargetDeviceInformation->AssociatedDevicesHead, &AssociatedEntry->AssociatedDevicesEntry); + + /* We're done! */ + FreePool(SourceSymbolicName.Buffer); + return STATUS_SUCCESS; } NTSTATUS Modified: trunk/reactos/drivers/filters/mountmgr/mntmgr.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filters/mountmgr/m…
============================================================================== --- trunk/reactos/drivers/filters/mountmgr/mntmgr.h [iso-8859-1] (original) +++ trunk/reactos/drivers/filters/mountmgr/mntmgr.h [iso-8859-1] Sun Sep 13 22:52:07 2015 @@ -298,6 +298,36 @@ OUT PUNICODE_STRING VolumeName ); +HANDLE +OpenRemoteDatabase( + IN PDEVICE_INFORMATION DeviceInformation, + IN BOOLEAN MigrateDatabase +); + +PDATABASE_ENTRY +GetRemoteDatabaseEntry( + IN HANDLE Database, + IN LONG StartingOffset +); + +NTSTATUS +WriteRemoteDatabaseEntry( + IN HANDLE Database, + IN LONG Offset, + IN PDATABASE_ENTRY Entry +); + +NTSTATUS +CloseRemoteDatabase( + IN HANDLE Database +); + +NTSTATUS +AddRemoteDatabaseEntry( + IN HANDLE Database, + IN PDATABASE_ENTRY Entry +); + /* device.c */ DRIVER_DISPATCH MountMgrDeviceControl; @@ -458,4 +488,10 @@ IN BOOLEAN MarkOffline ); +NTSTATUS +MountMgrQuerySymbolicLink( + IN PUNICODE_STRING SymbolicName, + IN OUT PUNICODE_STRING LinkTarget +); + #endif /* _MNTMGR_H_ */ Modified: trunk/reactos/drivers/filters/mountmgr/mountmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filters/mountmgr/m…
============================================================================== --- trunk/reactos/drivers/filters/mountmgr/mountmgr.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filters/mountmgr/mountmgr.c [iso-8859-1] Sun Sep 13 22:52:07 2015 @@ -48,7 +48,6 @@ * - MountMgrQueryDosVolumePaths * - MountMgrQueryVolumePaths * - MountMgrValidateBackPointer - * - MountMgrVolumeMountPointCreated * - MountMgrVolumeMountPointDeleted * - ReconcileThisDatabaseWithMasterWorker */
9 years, 3 months
1
0
0
0
← Newer
1
...
17
18
19
20
21
22
23
...
54
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
Results per page:
10
25
50
100
200