Author: akhaldi
Date: Fri Jun 26 16:20:37 2015
New Revision: 68277
URL: http://svn.reactos.org/svn/reactos?rev=68277&view=rev
Log:
[DDK] Explicitly mark the function pointers as NTAPI. CORE-9882
Modified:
trunk/reactos/include/ddk/hdaudio.h
Modified: trunk/reactos/include/ddk/hdaudio.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/hdaudio.h?rev=…
==============================================================================
--- trunk/reactos/include/ddk/hdaudio.h [iso-8859-1] (original)
+++ trunk/reactos/include/ddk/hdaudio.h [iso-8859-1] Fri Jun 26 16:20:37 2015
@@ -100,9 +100,9 @@
RunState = 2
} HDAUDIO_STREAM_STATE, *PHDAUDIO_STREAM_STATE;
-typedef VOID (*PHDAUDIO_TRANSFER_COMPLETE_CALLBACK)(HDAUDIO_CODEC_TRANSFER *, PVOID);
-
-typedef VOID (*PHDAUDIO_UNSOLICITED_RESPONSE_CALLBACK)(HDAUDIO_CODEC_RESPONSE, PVOID);
+typedef VOID (NTAPI *PHDAUDIO_TRANSFER_COMPLETE_CALLBACK)(HDAUDIO_CODEC_TRANSFER *, PVOID);
+
+typedef VOID (NTAPI *PHDAUDIO_UNSOLICITED_RESPONSE_CALLBACK)(HDAUDIO_CODEC_RESPONSE, PVOID);
typedef struct _HDAUDIO_DEVICE_INFORMATION
{
@@ -121,20 +121,20 @@
} HDAUDIO_BUFFER_DESCRIPTOR, *PHDAUDIO_BUFFER_DESCRIPTOR;
-typedef NTSTATUS (*PTRANSFER_CODEC_VERBS) (IN PVOID _context, IN ULONG Count, IN OUT PHDAUDIO_CODEC_TRANSFER CodecTransfer, IN PHDAUDIO_TRANSFER_COMPLETE_CALLBACK Callback, IN PVOID Context);
-typedef NTSTATUS (*PALLOCATE_CAPTURE_DMA_ENGINE) (IN PVOID _context, IN UCHAR CodecAddress, IN PHDAUDIO_STREAM_FORMAT StreamFormat, OUT PHANDLE Handle, OUT PHDAUDIO_CONVERTER_FORMAT ConverterFormat);
-typedef NTSTATUS (*PALLOCATE_RENDER_DMA_ENGINE) (IN PVOID _context, IN PHDAUDIO_STREAM_FORMAT StreamFormat, IN BOOLEAN Stripe, OUT PHANDLE Handle, OUT PHDAUDIO_CONVERTER_FORMAT ConverterFormat);
-typedef NTSTATUS (*PCHANGE_BANDWIDTH_ALLOCATION) (IN PVOID _context, IN HANDLE Handle, IN PHDAUDIO_STREAM_FORMAT StreamFormat, OUT PHDAUDIO_CONVERTER_FORMAT ConverterFormat);
-typedef NTSTATUS (*PALLOCATE_DMA_BUFFER) (IN PVOID _context, IN HANDLE Handle, IN SIZE_T RequestedBufferSize, OUT PMDL *BufferMdl, OUT PSIZE_T AllocatedBufferSize, OUT PUCHAR StreamId, OUT PULONG FifoSize);
-typedef NTSTATUS (*PFREE_DMA_BUFFER) (IN PVOID _context, IN HANDLE Handle);
-typedef NTSTATUS (*PFREE_DMA_ENGINE) (IN PVOID _context, IN HANDLE Handle);
-typedef NTSTATUS (*PSET_DMA_ENGINE_STATE) (IN PVOID _context, IN HDAUDIO_STREAM_STATE StreamState, IN ULONG NumberOfHandles, IN PHANDLE Handles);
-typedef VOID (*PGET_WALL_CLOCK_REGISTER) (IN PVOID _context, OUT PULONG *Wallclock);
-typedef NTSTATUS (*PGET_LINK_POSITION_REGISTER) (IN PVOID _context, IN HANDLE Handle, OUT PULONG *Position);
-typedef NTSTATUS (*PREGISTER_EVENT_CALLBACK) (IN PVOID _context, IN PHDAUDIO_UNSOLICITED_RESPONSE_CALLBACK Routine, IN PVOID Context, OUT PUCHAR Tag);
-typedef NTSTATUS (*PUNREGISTER_EVENT_CALLBACK) (IN PVOID _context, IN UCHAR Tag);
-typedef NTSTATUS (*PGET_DEVICE_INFORMATION) (IN PVOID _context, IN OUT PHDAUDIO_DEVICE_INFORMATION DeviceInformation);
-typedef VOID (*PGET_RESOURCE_INFORMATION) (IN PVOID _context, OUT PUCHAR CodecAddress, OUT PUCHAR FunctionGroupStartNode);
+typedef NTSTATUS (NTAPI *PTRANSFER_CODEC_VERBS) (IN PVOID _context, IN ULONG Count, IN OUT PHDAUDIO_CODEC_TRANSFER CodecTransfer, IN PHDAUDIO_TRANSFER_COMPLETE_CALLBACK Callback, IN PVOID Context);
+typedef NTSTATUS (NTAPI *PALLOCATE_CAPTURE_DMA_ENGINE) (IN PVOID _context, IN UCHAR CodecAddress, IN PHDAUDIO_STREAM_FORMAT StreamFormat, OUT PHANDLE Handle, OUT PHDAUDIO_CONVERTER_FORMAT ConverterFormat);
+typedef NTSTATUS (NTAPI *PALLOCATE_RENDER_DMA_ENGINE) (IN PVOID _context, IN PHDAUDIO_STREAM_FORMAT StreamFormat, IN BOOLEAN Stripe, OUT PHANDLE Handle, OUT PHDAUDIO_CONVERTER_FORMAT ConverterFormat);
+typedef NTSTATUS (NTAPI *PCHANGE_BANDWIDTH_ALLOCATION) (IN PVOID _context, IN HANDLE Handle, IN PHDAUDIO_STREAM_FORMAT StreamFormat, OUT PHDAUDIO_CONVERTER_FORMAT ConverterFormat);
+typedef NTSTATUS (NTAPI *PALLOCATE_DMA_BUFFER) (IN PVOID _context, IN HANDLE Handle, IN SIZE_T RequestedBufferSize, OUT PMDL *BufferMdl, OUT PSIZE_T AllocatedBufferSize, OUT PUCHAR StreamId, OUT PULONG FifoSize);
+typedef NTSTATUS (NTAPI *PFREE_DMA_BUFFER) (IN PVOID _context, IN HANDLE Handle);
+typedef NTSTATUS (NTAPI *PFREE_DMA_ENGINE) (IN PVOID _context, IN HANDLE Handle);
+typedef NTSTATUS (NTAPI *PSET_DMA_ENGINE_STATE) (IN PVOID _context, IN HDAUDIO_STREAM_STATE StreamState, IN ULONG NumberOfHandles, IN PHANDLE Handles);
+typedef VOID (NTAPI *PGET_WALL_CLOCK_REGISTER) (IN PVOID _context, OUT PULONG *Wallclock);
+typedef NTSTATUS (NTAPI *PGET_LINK_POSITION_REGISTER) (IN PVOID _context, IN HANDLE Handle, OUT PULONG *Position);
+typedef NTSTATUS (NTAPI *PREGISTER_EVENT_CALLBACK) (IN PVOID _context, IN PHDAUDIO_UNSOLICITED_RESPONSE_CALLBACK Routine, IN PVOID Context, OUT PUCHAR Tag);
+typedef NTSTATUS (NTAPI *PUNREGISTER_EVENT_CALLBACK) (IN PVOID _context, IN UCHAR Tag);
+typedef NTSTATUS (NTAPI *PGET_DEVICE_INFORMATION) (IN PVOID _context, IN OUT PHDAUDIO_DEVICE_INFORMATION DeviceInformation);
+typedef VOID (NTAPI *PGET_RESOURCE_INFORMATION) (IN PVOID _context, OUT PUCHAR CodecAddress, OUT PUCHAR FunctionGroupStartNode);
typedef struct _HDAUDIO_BUS_INTERFACE
{
@@ -160,12 +160,12 @@
PGET_RESOURCE_INFORMATION GetResourceInformation;
} HDAUDIO_BUS_INTERFACE, *PHDAUDIO_BUS_INTERFACE;
-typedef void (*PHDAUDIO_BDL_ISR) (IN VOID *Context, IN ULONG InterruptBitMask);
-
-typedef NTSTATUS (*PALLOCATE_CONTIGUOUS_DMA_BUFFER) (IN PVOID _context, IN HANDLE Handle,
+typedef void (NTAPI *PHDAUDIO_BDL_ISR) (IN VOID *Context, IN ULONG InterruptBitMask);
+
+typedef NTSTATUS (NTAPI *PALLOCATE_CONTIGUOUS_DMA_BUFFER) (IN PVOID _context, IN HANDLE Handle,
ULONG RequestedBufferSize, OUT PVOID *DataBuffer, OUT PHDAUDIO_BUFFER_DESCRIPTOR *BdlBuffer);
-typedef NTSTATUS (*PFREE_CONTIGUOUS_DMA_BUFFER) (IN PVOID _context, IN HANDLE Handle);
-typedef NTSTATUS (*PSETUP_DMA_ENGINE_WITH_BDL) (IN PVOID _context, IN HANDLE Handle, IN ULONG BufferLength,
+typedef NTSTATUS (NTAPI *PFREE_CONTIGUOUS_DMA_BUFFER) (IN PVOID _context, IN HANDLE Handle);
+typedef NTSTATUS (NTAPI *PSETUP_DMA_ENGINE_WITH_BDL) (IN PVOID _context, IN HANDLE Handle, IN ULONG BufferLength,
IN ULONG Lvi, IN PHDAUDIO_BDL_ISR Isr, IN PVOID Context, OUT PUCHAR StreamId, OUT PULONG FifoSize);
typedef struct _HDAUDIO_BUS_INTERFACE_BDL
@@ -193,7 +193,7 @@
PGET_RESOURCE_INFORMATION GetResourceInformation;
} HDAUDIO_BUS_INTERFACE_BDL, *PHDAUDIO_BUS_INTERFACE_BDL;
-typedef NTSTATUS (*PALLOCATE_DMA_BUFFER_WITH_NOTIFICATION) (IN PVOID _context,
+typedef NTSTATUS (NTAPI *PALLOCATE_DMA_BUFFER_WITH_NOTIFICATION) (IN PVOID _context,
IN HANDLE Handle,
IN ULONG NotificationCount,
IN SIZE_T RequestedBufferSize,
@@ -203,16 +203,16 @@
OUT PUCHAR StreamId,
OUT PULONG FifoSize);
-typedef NTSTATUS (*PFREE_DMA_BUFFER_WITH_NOTIFICATION) (IN PVOID _context,
+typedef NTSTATUS (NTAPI *PFREE_DMA_BUFFER_WITH_NOTIFICATION) (IN PVOID _context,
IN HANDLE Handle,
IN PMDL BufferMdl,
IN SIZE_T BufferSize);
-typedef NTSTATUS (*PREGISTER_NOTIFICATION_EVENT) (IN PVOID _context,
+typedef NTSTATUS (NTAPI *PREGISTER_NOTIFICATION_EVENT) (IN PVOID _context,
IN HANDLE Handle,
IN PKEVENT NotificationEvent);
-typedef NTSTATUS (*PUNREGISTER_NOTIFICATION_EVENT) (IN PVOID _context,
+typedef NTSTATUS (NTAPI *PUNREGISTER_NOTIFICATION_EVENT) (IN PVOID _context,
IN HANDLE Handle,
IN PKEVENT NotificationEvent);
Author: tfaber
Date: Fri Jun 26 11:02:40 2015
New Revision: 68274
URL: http://svn.reactos.org/svn/reactos?rev=68274&view=rev
Log:
[NTOS:MM]
- Do not request a page in MiAllocatePagesForMdl if no pages are available. Fixes kmtest:MmMdl.
CORE-9879 #resolve
Modified:
trunk/reactos/ntoskrnl/mm/freelist.c
Modified: trunk/reactos/ntoskrnl/mm/freelist.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/freelist.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/freelist.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/freelist.c [iso-8859-1] Fri Jun 26 11:02:40 2015
@@ -232,7 +232,12 @@
/* Grab a page */
MI_SET_USAGE(MI_USAGE_MDL);
MI_SET_PROCESS2("Kernel");
- Page = MiRemoveAnyPage(0);
+
+ /* FIXME: This check should be smarter */
+ Page = 0;
+ if (MmAvailablePages != 0)
+ Page = MiRemoveAnyPage(0);
+
if (Page == 0)
{
/* This is not good... hopefully we have at least SOME pages */
Author: tfaber
Date: Fri Jun 26 10:40:49 2015
New Revision: 68273
URL: http://svn.reactos.org/svn/reactos?rev=68273&view=rev
Log:
[NTOS:MM]
- Mark the page as being on the standby list before dereferencing it in MmFreePagesFromMdl. Since the PFN is marked as deleted, MiDecrementReferenceCount will correctly insert it into the free list, but this is required to satisfy MiDecrementReferenceCount's sanity check.
CORE-9877 #resolve
Modified:
trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c [iso-8859-1] Fri Jun 26 10:40:49 2015
@@ -270,6 +270,7 @@
//
Pfn1->u3.e1.StartOfAllocation = 0;
Pfn1->u3.e1.EndOfAllocation = 0;
+ Pfn1->u3.e1.PageLocation = StandbyPageList;
Pfn1->u2.ShareCount = 0;
//