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/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);
}
Author: jgardou
Date: Thu Apr 25 21:29:59 2013
New Revision: 58852
URL: http://svn.reactos.org/svn/reactos?rev=58852&view=rev
Log:
[NTOSKRNL]
- Handle VME for the PUSHF and POPF instruction in virtual mode
- There is no reason to set interrupt flag when handling POPF
- Fix a typo in POPF case : mask out the right variable
See http://www.rcollins.org/articles/vme1/ for reference
Modified:
trunk/reactos/ntoskrnl/ke/i386/v86vdm.c
Modified: trunk/reactos/ntoskrnl/ke/i386/v86vdm.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/v86vdm.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/v86vdm.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/v86vdm.c [iso-8859-1] Thu Apr 25 21:29:59 2013
@@ -53,16 +53,22 @@
{
ULONG Esp, V86EFlags, TrapEFlags;
- /* Check for VME support */
- ASSERT(KeI386VirtualIntExtensions == FALSE);
-
/* Get current V8086 flags and mask out interrupt flag */
V86EFlags = *KiNtVdmState;
V86EFlags &= ~EFLAGS_INTERRUPT_MASK;
- /* Get trap frame EFLags and leave only align, nested task and interrupt */
+ /* Get trap frame EFLags */
TrapEFlags = TrapFrame->EFlags;
- V86EFlags &= (EFLAGS_ALIGN_CHECK | EFLAGS_NESTED_TASK | EFLAGS_INTERRUPT_MASK);
+ /* Check for VME support */
+ if(KeI386VirtualIntExtensions)
+ {
+ /* Copy the virtual interrupt flag to the interrupt flag */
+ TrapEFlags &= ~EFLAGS_INTERRUPT_MASK;
+ if(TrapEFlags & EFLAGS_VIF)
+ TrapEFlags |= EFLAGS_INTERRUPT_MASK;
+ }
+ /* Leave only align, nested task and interrupt */
+ TrapEFlags &= (EFLAGS_ALIGN_CHECK | EFLAGS_NESTED_TASK | EFLAGS_INTERRUPT_MASK);
/* Add in those flags if they exist, and add in the IOPL flag */
V86EFlags |= TrapEFlags;
@@ -133,10 +139,20 @@
TrapEFlags = TrapFrame->EFlags;
/* Check for VME support */
- ASSERT(KeI386VirtualIntExtensions == FALSE);
-
- /* Add V86 and Interrupt flag */
- V86EFlags |= EFLAGS_V86_MASK | EFLAGS_INTERRUPT_MASK;
+ if(KeI386VirtualIntExtensions)
+ {
+ /* Copy the IF flag into the VIF one */
+ V86EFlags &= ~EFLAGS_VIF;
+ if(V86EFlags & EFLAGS_INTERRUPT_MASK)
+ {
+ V86EFlags |= EFLAGS_VIF;
+ /* Don't set the interrupt flag */
+ V86EFlags &= ~EFLAGS_INTERRUPT_MASK;
+ }
+ }
+
+ /* Add V86 flag */
+ V86EFlags |= EFLAGS_V86_MASK;
/* Update EFlags in trap frame */
TrapFrame->EFlags = V86EFlags;
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/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--;
+ }
}
}
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 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;