Author: dchapyshev
Date: Wed May 20 15:08:08 2009
New Revision: 41015
URL:
http://svn.reactos.org/svn/reactos?rev=41015&view=rev
Log:
- Add check of params for NtGetWriteWatch/NtResetWriteWatch (from Wine)
- Set Granularity to PAGE_SIZE
Fixes crash in kernel32 virtual test
Modified:
trunk/reactos/ntoskrnl/mm/mm.c
Modified: trunk/reactos/ntoskrnl/mm/mm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/mm.c?rev=41015…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/mm.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/mm.c [iso-8859-1] Wed May 20 15:08:08 2009
@@ -434,6 +434,9 @@
return (FALSE);
}
+/*
+ * @unimplemented
+ */
NTSTATUS
NTAPI
NtGetWriteWatch(IN HANDLE ProcessHandle,
@@ -444,16 +447,42 @@
OUT PULONG EntriesInUserAddressArray,
OUT PULONG Granularity)
{
+ if (!EntriesInUserAddressArray || !Granularity)
+ {
+ return STATUS_ACCESS_VIOLATION;
+ }
+
+ if (!*EntriesInUserAddressArray || !RegionSize)
+ {
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ if (!UserAddressArray)
+ {
+ return STATUS_ACCESS_VIOLATION;
+ }
+
+ /* HACK: Set granularity to PAGE_SIZE */
+ *Granularity = PAGE_SIZE;
+
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
}
+/*
+ * @unimplemented
+ */
NTSTATUS
NTAPI
NtResetWriteWatch(IN HANDLE ProcessHandle,
IN PVOID BaseAddress,
IN ULONG RegionSize)
{
+ if (!RegionSize)
+ {
+ return STATUS_INVALID_PARAMETER;
+ }
+
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
}