Author: fireball
Date: Mon Oct 25 20:50:45 2010
New Revision: 49277
URL: http://svn.reactos.org/svn/reactos?rev=49277&view=rev
Log:
[NTOS/MM]
- Handle various special cases in NtQueryVirtualMemory (e.g. querying illegal virtual addresses, shared memory area, etc). Example of an app doing this - OllyDbg.
Modified:
trunk/reactos/ntoskrnl/mm/ARM3/virtual.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/virtual.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/virtual.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/virtual.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/virtual.c [iso-8859-1] Mon Oct 25 20:50:45 2010
@@ -2329,9 +2329,34 @@
if ((BaseAddress > MM_HIGHEST_VAD_ADDRESS) ||
(PAGE_ALIGN(BaseAddress) == (PVOID)USER_SHARED_DATA))
{
- /* FIXME: We should return some bogus info structure */
- UNIMPLEMENTED;
- while (TRUE);
+ Address = PAGE_ALIGN(BaseAddress);
+
+ /* Make up an info structure describing this range */
+ MemoryInfo.BaseAddress = Address;
+ MemoryInfo.AllocationProtect = PAGE_READONLY;
+ MemoryInfo.Type = MEM_PRIVATE;
+
+ /* Special case for shared data */
+ if (Address == (PVOID)USER_SHARED_DATA)
+ {
+ MemoryInfo.AllocationBase = (PVOID)USER_SHARED_DATA;
+ MemoryInfo.State = MEM_COMMIT;
+ MemoryInfo.Protect = PAGE_READONLY;
+ MemoryInfo.RegionSize = PAGE_SIZE;
+ }
+ else
+ {
+ MemoryInfo.AllocationBase = (PCHAR)MM_HIGHEST_VAD_ADDRESS + 1;
+ MemoryInfo.State = MEM_RESERVE;
+ MemoryInfo.Protect = PAGE_NOACCESS;
+ MemoryInfo.RegionSize = (ULONG_PTR)MemoryInfo.AllocationBase - (ULONG_PTR)Address;
+ }
+
+ /* Return the data (FIXME: Use SEH) */
+ *(PMEMORY_BASIC_INFORMATION)MemoryInformation = MemoryInfo;
+ if (ReturnLength) *ReturnLength = sizeof(MEMORY_BASIC_INFORMATION);
+
+ return STATUS_SUCCESS;
}
/* Check if this is for a local or remote process */
@@ -2395,9 +2420,26 @@
/* Calculate region size */
if (Vad)
{
- /* We don't handle this yet */
- UNIMPLEMENTED;
- while (TRUE);
+ if (Vad->StartingVpn >= BaseVpn)
+ {
+ /* Region size is the free space till the start of that VAD */
+ MemoryInfo.RegionSize = (ULONG_PTR)(Vad->StartingVpn << PAGE_SHIFT) - (ULONG_PTR)Address;
+ }
+ else
+ {
+ /* Get the next VAD */
+ Vad = (PMMVAD)MiGetNextNode((PMMADDRESS_NODE)Vad);
+ if (Vad)
+ {
+ /* Region size is the free space till the start of that VAD */
+ MemoryInfo.RegionSize = (ULONG_PTR)(Vad->StartingVpn << PAGE_SHIFT) - (ULONG_PTR)Address;
+ }
+ else
+ {
+ /* Maximum possible region size with that base address */
+ MemoryInfo.RegionSize = (PCHAR)MM_HIGHEST_VAD_ADDRESS + 1 - (PCHAR)Address;
+ }
+ }
}
else
{
Author: fireball
Date: Mon Oct 25 16:35:17 2010
New Revision: 49274
URL: http://svn.reactos.org/svn/reactos?rev=49274&view=rev
Log:
- Delete msvc6 branch. There are better ways of building ReactOS with MSVC being explored now.
Removed:
branches/msvc6/
Author: jimtabor
Date: Mon Oct 25 02:51:09 2010
New Revision: 49270
URL: http://svn.reactos.org/svn/reactos?rev=49270&view=rev
Log:
[Win32k]
- Do not override WH_JOURNALPLAYBACK results if zero.
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/hook.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/hook.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/hook.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/hook.c [iso-8859-1] Mon Oct 25 02:51:09 2010
@@ -582,7 +582,11 @@
break;
}
break;
-
+/*
+ Note WH_JOURNALPLAYBACK,
+ "To have the system wait before processing the message, the return value
+ must be the amount of time, in clock ticks, that the system should wait."
+ */
case WH_JOURNALPLAYBACK:
case WH_JOURNALRECORD:
{
@@ -660,8 +664,6 @@
DPRINT1("Unsupported HOOK Id -> %d\n",Hook->HookId);
break;
}
- if (Hook->HookId == WH_JOURNALPLAYBACK && lResult == 0)
- lResult = -1;
return lResult;
}
@@ -1005,8 +1007,6 @@
DPRINT("Ret: Global HookId %d Result 0x%x\n", HookId,Result);
}
Exit:
- if (HookId == WH_JOURNALPLAYBACK && Result == 0)
- Result = -1;
return Result;
}