mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 12:49:45 +00:00
ntoskrnl.exe: Implemented a number of memory allocation functions.
This commit is contained in:
parent
8530cb0aec
commit
982d6ccbe4
@ -214,6 +214,84 @@ void WINAPI IofCompleteRequest( IRP *irp, UCHAR priority_boost )
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* ExAllocatePool (NTOSKRNL.EXE.@)
|
||||
*/
|
||||
PVOID WINAPI ExAllocatePool( POOL_TYPE type, SIZE_T size )
|
||||
{
|
||||
return ExAllocatePoolWithTag( type, size, 0 );
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* ExAllocatePoolWithQuota (NTOSKRNL.EXE.@)
|
||||
*/
|
||||
PVOID WINAPI ExAllocatePoolWithQuota( POOL_TYPE type, SIZE_T size )
|
||||
{
|
||||
return ExAllocatePoolWithTag( type, size, 0 );
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* ExAllocatePoolWithTag (NTOSKRNL.EXE.@)
|
||||
*/
|
||||
PVOID WINAPI ExAllocatePoolWithTag( POOL_TYPE type, SIZE_T size, ULONG tag )
|
||||
{
|
||||
/* FIXME: handle page alignment constraints */
|
||||
void *ret = HeapAlloc( GetProcessHeap(), 0, size );
|
||||
TRACE( "%lu pool %u -> %p\n", size, type, ret );
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* ExAllocatePoolWithQuotaTag (NTOSKRNL.EXE.@)
|
||||
*/
|
||||
PVOID WINAPI ExAllocatePoolWithQuotaTag( POOL_TYPE type, SIZE_T size, ULONG tag )
|
||||
{
|
||||
return ExAllocatePoolWithTag( type, size, tag );
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* ExFreePool (NTOSKRNL.EXE.@)
|
||||
*/
|
||||
void WINAPI ExFreePool( void *ptr )
|
||||
{
|
||||
ExFreePoolWithTag( ptr, 0 );
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* ExFreePoolWithTag (NTOSKRNL.EXE.@)
|
||||
*/
|
||||
void WINAPI ExFreePoolWithTag( void *ptr, ULONG tag )
|
||||
{
|
||||
TRACE( "%p\n", ptr );
|
||||
HeapFree( GetProcessHeap(), 0, ptr );
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* MmAllocateNonCachedMemory (NTOSKRNL.EXE.@)
|
||||
*/
|
||||
LPVOID WINAPI MmAllocateNonCachedMemory( SIZE_T size )
|
||||
{
|
||||
TRACE( "%lu\n", size );
|
||||
return VirtualAlloc( NULL, size, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE|PAGE_NOCACHE );
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* MmFreeNonCachedMemory (NTOSKRNL.EXE.@)
|
||||
*/
|
||||
void WINAPI MmFreeNonCachedMemory( void *addr, SIZE_T size )
|
||||
{
|
||||
TRACE( "%p %lu\n", addr, size );
|
||||
VirtualFree( addr, 0, MEM_RELEASE );
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************
|
||||
* DllMain
|
||||
*/
|
||||
|
@ -116,10 +116,10 @@
|
||||
@ stub ExAcquireSharedStarveExclusive
|
||||
@ stub ExAcquireSharedWaitForExclusive
|
||||
@ stub ExAllocateFromPagedLookasideList
|
||||
@ stub ExAllocatePool
|
||||
@ stub ExAllocatePoolWithQuota
|
||||
@ stub ExAllocatePoolWithQuotaTag
|
||||
@ stub ExAllocatePoolWithTag
|
||||
@ stdcall ExAllocatePool(long long)
|
||||
@ stdcall ExAllocatePoolWithQuota(long long)
|
||||
@ stdcall ExAllocatePoolWithQuotaTag(long long long)
|
||||
@ stdcall ExAllocatePoolWithTag(long long long)
|
||||
@ stub ExAllocatePoolWithTagPriority
|
||||
@ stub ExConvertExclusiveToSharedLite
|
||||
@ stub ExCreateCallback
|
||||
@ -131,8 +131,8 @@
|
||||
@ stub ExEnumHandleTable
|
||||
@ stub ExEventObjectType
|
||||
@ stub ExExtendZone
|
||||
@ stub ExFreePool
|
||||
@ stub ExFreePoolWithTag
|
||||
@ stdcall ExFreePool(ptr)
|
||||
@ stdcall ExFreePoolWithTag(ptr long)
|
||||
@ stub ExFreeToPagedLookasideList
|
||||
@ stub ExGetCurrentProcessorCounts
|
||||
@ stub ExGetCurrentProcessorCpuUsage
|
||||
@ -658,7 +658,7 @@
|
||||
@ stub MmAllocateContiguousMemory
|
||||
@ stub MmAllocateContiguousMemorySpecifyCache
|
||||
@ stub MmAllocateMappingAddress
|
||||
@ stub MmAllocateNonCachedMemory
|
||||
@ stdcall MmAllocateNonCachedMemory(long)
|
||||
@ stub MmAllocatePagesForMdl
|
||||
@ stub MmBuildMdlForNonPagedPool
|
||||
@ stub MmCanFileBeTruncated
|
||||
@ -671,7 +671,7 @@
|
||||
@ stub MmFreeContiguousMemory
|
||||
@ stub MmFreeContiguousMemorySpecifyCache
|
||||
@ stub MmFreeMappingAddress
|
||||
@ stub MmFreeNonCachedMemory
|
||||
@ stdcall MmFreeNonCachedMemory(ptr long)
|
||||
@ stub MmFreePagesFromMdl
|
||||
@ stub MmGetPhysicalAddress
|
||||
@ stub MmGetPhysicalMemoryRanges
|
||||
|
@ -865,6 +865,7 @@ PVOID WINAPI ExAllocatePoolWithQuota(POOL_TYPE,SIZE_T);
|
||||
PVOID WINAPI ExAllocatePoolWithTag(POOL_TYPE,SIZE_T,ULONG);
|
||||
PVOID WINAPI ExAllocatePoolWithQuotaTag(POOL_TYPE,SIZE_T,ULONG);
|
||||
void WINAPI ExFreePool(PVOID);
|
||||
void WINAPI ExFreePoolWithTag(PVOID,ULONG);
|
||||
|
||||
NTSTATUS WINAPI IoCreateDevice(DRIVER_OBJECT*,ULONG,UNICODE_STRING*,DEVICE_TYPE,ULONG,BOOLEAN,DEVICE_OBJECT**);
|
||||
NTSTATUS WINAPI IoCreateSymbolicLink(UNICODE_STRING*,UNICODE_STRING*);
|
||||
@ -874,6 +875,9 @@ PEPROCESS WINAPI IoGetCurrentProcess(void);
|
||||
|
||||
PKTHREAD WINAPI KeGetCurrentThread(void);
|
||||
|
||||
LPVOID WINAPI MmAllocateNonCachedMemory(SIZE_T);
|
||||
void WINAPI MmFreeNonCachedMemory(PVOID,SIZE_T);
|
||||
|
||||
#define PsGetCurrentProcess() IoGetCurrentProcess()
|
||||
#define PsGetCurrentThread() ((PETHREAD)KeGetCurrentThread())
|
||||
HANDLE WINAPI PsGetCurrentProcessId(void);
|
||||
|
Loading…
Reference in New Issue
Block a user