Author: fireball
Date: Tue Nov 24 23:56:43 2009
New Revision: 44285
URL: http://svn.reactos.org/svn/reactos?rev=44285&view=rev
Log:
[ntoskrnl/cm]
- CmpSelectLeaf fixes: looking into an incorrect cell, returning wrong cell, slightly simplify code and add more comments for clarity. Thanks to Michael Martin for spotting these bugs.
Modified:
trunk/reactos/ntoskrnl/config/cmindex.c
Modified: trunk/reactos/ntoskrnl/config/cmindex.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmindex.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmindex.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmindex.c [iso-8859-1] Tue Nov 24 23:56:43 2009
@@ -1344,6 +1344,8 @@
*RootCell = &IndexKey->List[SubKeyIndex];
return LeafCell;
}
+
+ /* It didn't fit, so proceed to splitting */
}
else
{
@@ -1380,22 +1382,22 @@
/* Check if it's above */
if (Result >= 0)
{
- /* Get the first cell in the index */
- LeafCell = IndexKey->List[0];
+ /* Get the cell in the index */
+ LeafCell = IndexKey->List[SubKeyIndex];
LeafKey = (PCM_KEY_INDEX)HvGetCell(Hive, LeafCell);
/* Return an error in case of problems */
if (!LeafKey) return HCELL_NIL;
- /* Check if it fits into this leaf and break */
+ /* Check if it fits into this leaf */
if (LeafKey->Count < CmpMaxIndexPerHblock)
{
/* Fill in the result and return the cell */
- *RootCell = &IndexKey->List[SubKeyIndex + 1];
+ *RootCell = &IndexKey->List[SubKeyIndex];
return LeafCell;
}
- /* No, it doesn't fit, check the other leaf */
+ /* No, it doesn't fit, check the next adjacent leaf */
if (SubKeyIndex < (IndexKey->Count - 1))
{
/* Yes, there is space */
@@ -1413,6 +1415,8 @@
return LeafCell;
}
}
+
+ /* It didn't fit, so proceed to splitting */
}
else
{
@@ -1429,11 +1433,8 @@
/* Check if it fits and break */
if (LeafKey->Count < CmpMaxIndexPerHblock)
{
- /* Decrement the subkey index */
- SubKeyIndex--;
-
/* Fill in the result and return the cell */
- *RootCell = &IndexKey->List[SubKeyIndex];
+ *RootCell = &IndexKey->List[SubKeyIndex - 1];
return LeafCell;
}
}
Author: gschneider
Date: Tue Nov 24 21:36:53 2009
New Revision: 44282
URL: http://svn.reactos.org/svn/reactos?rev=44282&view=rev
Log:
[rosautotest]: Find the last underscore instead of the first one when building a module name, hurray for twain_32_winetest and ws2_32_winetest
See issue #4929 for more details.
Modified:
trunk/rostests/rosautotest/CWineTest.cpp
Modified: trunk/rostests/rosautotest/CWineTest.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/rosautotest/CWineTest.cpp…
==============================================================================
--- trunk/rostests/rosautotest/CWineTest.cpp [iso-8859-1] (original)
+++ trunk/rostests/rosautotest/CWineTest.cpp [iso-8859-1] Tue Nov 24 21:36:53 2009
@@ -227,7 +227,7 @@
TestInfo->CommandLine += AsciiToUnicode(m_CurrentTest);
/* Store the Module name */
- UnderscorePosition = m_CurrentFile.find('_');
+ UnderscorePosition = m_CurrentFile.find_last_of('_');
if(UnderscorePosition == m_CurrentFile.npos)
{