Author: akhaldi
Date: Thu Apr 25 23:04:00 2013
New Revision: 58855
URL: http://svn.reactos.org/svn/reactos?rev=58855&view=rev
Log:
[SHELL32]
* Sync SH{Register,Revoke}DragDrop with Wine 1.5.26.
Modified:
trunk/reactos/dll/win32/shell32/shellord.cpp
Modified: trunk/reactos/dll/win32/shell32/shellord.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shellord…
==============================================================================
--- trunk/reactos/dll/…
[View More]win32/shell32/shellord.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shellord.cpp [iso-8859-1] Thu Apr 25 23:04:00 2013
@@ -405,13 +405,14 @@
}
/*************************************************************************
- * SHRegisterDragDrop [SHELL32.86]
+ * SHRegisterDragDrop [SHELL32.86]
*
* Probably equivalent to RegisterDragDrop but under Windows 95 it could use the
* shell32 built-in "mini-COM" without the need to load ole32.dll - see SHLoadOLE
* for details. Under Windows 98 this function initializes the true OLE when called
* the first time, on XP always returns E_OUTOFMEMORY and it got removed from Vista.
*
+ * We follow Windows 98 behaviour.
*
* NOTES
* exported by ordinal
@@ -420,20 +421,34 @@
* RegisterDragDrop, SHLoadOLE
*/
HRESULT WINAPI SHRegisterDragDrop(
- HWND hWnd,
- LPDROPTARGET pDropTarget)
-{
- FIXME("(%p,%p):stub.\n", hWnd, pDropTarget);
- return RegisterDragDrop(hWnd, pDropTarget);
-}
-
-/*************************************************************************
- * SHRevokeDragDrop [SHELL32.87]
- *
- * Probably equivalent to RevokeDragDrop but under Windows 9x it could use the
+ HWND hWnd,
+ LPDROPTARGET pDropTarget)
+{
+ static BOOL ole_initialized = FALSE;
+ HRESULT hr;
+
+ TRACE("(%p,%p)\n", hWnd, pDropTarget);
+
+ if (!ole_initialized)
+ {
+ hr = OleInitialize(NULL);
+ if (FAILED(hr))
+ return hr;
+ ole_initialized = TRUE;
+ }
+ return RegisterDragDrop(hWnd, pDropTarget);
+}
+
+/*************************************************************************
+ * SHRevokeDragDrop [SHELL32.87]
+ *
+ * Probably equivalent to RevokeDragDrop but under Windows 95 it could use the
* shell32 built-in "mini-COM" without the need to load ole32.dll - see SHLoadOLE
* for details. Function removed from Windows Vista.
*
+ * We call ole32 RevokeDragDrop which seems to work even if OleInitialize was
+ * not called.
+ *
* NOTES
* exported by ordinal
*
@@ -442,7 +457,7 @@
*/
HRESULT WINAPI SHRevokeDragDrop(HWND hWnd)
{
- FIXME("(%p):stub.\n",hWnd);
+ TRACE("(%p)\n", hWnd);
return RevokeDragDrop(hWnd);
}
[View Less]
Author: fireball
Date: Thu Apr 25 14:15:10 2013
New Revision: 58850
URL: http://svn.reactos.org/svn/reactos?rev=58850&view=rev
Log:
[RTL]
- Apply similar fixes as in 58848 to RtlGetElementGenericTable (no need to make too fancy predecrements if they work incorrectly in this case when do/while loops were unnecessary at all).
Modified:
trunk/reactos/lib/rtl/generictable.c
Modified: trunk/reactos/lib/rtl/generictable.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/…
[View More]generictable.c?rev…
==============================================================================
--- trunk/reactos/lib/rtl/generictable.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/generictable.c [iso-8859-1] Thu Apr 25 14:15:10 2013
@@ -451,21 +451,23 @@
{
/* Do the search backwards, since this takes less iterations */
DeltaDown = OrderedElement - NextI;
- do
+ while (DeltaDown)
{
/* Get next node */
OrderedNode = OrderedNode->Blink;
- } while (--DeltaDown);
+ DeltaDown--;
+ }
}
else
{
/* Follow the list directly instead */
OrderedNode = &Table->InsertOrderList;
- do
+ while (NextI)
{
/* Get next node */
OrderedNode = OrderedNode->Flink;
- } while (--NextI);
+ NextI--;
+ }
}
}
else
@@ -478,21 +480,23 @@
if (DeltaUp <= DeltaDown)
{
/* Do the search forwards, since this takes less iterations */
- do
+ while (DeltaUp)
{
/* Get next node */
OrderedNode = OrderedNode->Blink;
- } while (--DeltaUp);
+ DeltaUp--;
+ }
}
else
{
/* Do the search downwards, since this takes less iterations */
OrderedNode = &Table->InsertOrderList;
- do
+ while (DeltaDown)
{
/* Get next node */
OrderedNode = OrderedNode->Blink;
- } while (--DeltaDown);
+ DeltaDown--;
+ }
}
}
[View Less]
Author: fireball
Date: Wed Apr 24 22:56:43 2013
New Revision: 58848
URL: http://svn.reactos.org/svn/reactos?rev=58848&view=rev
Log:
[RTL]
- Do not set result variable NodeOrParent in RtlpFindGenericTableNodeOrParent in case the generic table is empty, just returning TableEmptyTree is enough.
- Fix improper enumeration of generic tables nodes. The way they were done previously clearly shows that noone was actually testing these APIs and a simple mistake (do/while instead of while loop) led …
[View More]to a NULL pointer access. Thanks to Pierre for developing MCB tests which revealed this problem.
Rephrasing Vladimir Lenin: "Test, test and again test!"
Modified:
trunk/reactos/lib/rtl/generictable.c
Modified: trunk/reactos/lib/rtl/generictable.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/generictable.c?rev…
==============================================================================
--- trunk/reactos/lib/rtl/generictable.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/generictable.c [iso-8859-1] Wed Apr 24 22:56:43 2013
@@ -34,7 +34,6 @@
/* Quick check to see if the table is empty */
if (RtlIsGenericTableEmpty(Table))
{
- *NodeOrParent = NULL;
return TableEmptyTree;
}
@@ -338,11 +337,11 @@
{
/* Then find the leftmost element */
FoundNode = Table->TableRoot;
- do
+ while(RtlLeftChild(FoundNode))
{
/* Get the left child */
FoundNode = RtlLeftChild(FoundNode);
- } while(RtlLeftChild(FoundNode));
+ }
/* Splay it */
_Analysis_assume_(FoundNode != NULL);
@@ -377,11 +376,11 @@
{
/* Then find the leftmost element */
FoundNode = Table->TableRoot;
- do
+ while(RtlLeftChild(FoundNode))
{
/* Get the left child */
FoundNode = RtlLeftChild(FoundNode);
- } while(RtlLeftChild(FoundNode));
+ }
/* Splay it */
*RestartKey = FoundNode;
[View Less]