Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
982d6ccb
Commit
982d6ccb
authored
May 16, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl.exe: Implemented a number of memory allocation functions.
parent
8530cb0a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
8 deletions
+90
-8
ntoskrnl.c
dlls/ntoskrnl.exe/ntoskrnl.c
+78
-0
ntoskrnl.exe.spec
dlls/ntoskrnl.exe/ntoskrnl.exe.spec
+8
-8
wdm.h
include/ddk/wdm.h
+4
-0
No files found.
dlls/ntoskrnl.exe/ntoskrnl.c
View file @
982d6ccb
...
...
@@ -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
*/
...
...
dlls/ntoskrnl.exe/ntoskrnl.exe.spec
View file @
982d6ccb
...
...
@@ -116,10 +116,10 @@
@ stub ExAcquireSharedStarveExclusive
@ stub ExAcquireSharedWaitForExclusive
@ stub ExAllocateFromPagedLookasideList
@ st
ub ExAllocatePool
@ st
ub ExAllocatePoolWithQuota
@ st
ub ExAllocatePoolWithQuotaTag
@ st
ub ExAllocatePoolWithTag
@ st
dcall ExAllocatePool(long long)
@ st
dcall ExAllocatePoolWithQuota(long long)
@ st
dcall ExAllocatePoolWithQuotaTag(long long long)
@ st
dcall ExAllocatePoolWithTag(long long long)
@ stub ExAllocatePoolWithTagPriority
@ stub ExConvertExclusiveToSharedLite
@ stub ExCreateCallback
...
...
@@ -131,8 +131,8 @@
@ stub ExEnumHandleTable
@ stub ExEventObjectType
@ stub ExExtendZone
@ st
ub ExFreePool
@ st
ub ExFreePoolWithTag
@ st
dcall ExFreePool(ptr)
@ st
dcall ExFreePoolWithTag(ptr long)
@ stub ExFreeToPagedLookasideList
@ stub ExGetCurrentProcessorCounts
@ stub ExGetCurrentProcessorCpuUsage
...
...
@@ -658,7 +658,7 @@
@ stub MmAllocateContiguousMemory
@ stub MmAllocateContiguousMemorySpecifyCache
@ stub MmAllocateMappingAddress
@ st
ub MmAllocateNonCachedMemory
@ st
dcall MmAllocateNonCachedMemory(long)
@ stub MmAllocatePagesForMdl
@ stub MmBuildMdlForNonPagedPool
@ stub MmCanFileBeTruncated
...
...
@@ -671,7 +671,7 @@
@ stub MmFreeContiguousMemory
@ stub MmFreeContiguousMemorySpecifyCache
@ stub MmFreeMappingAddress
@ st
ub MmFreeNonCachedMemory
@ st
dcall MmFreeNonCachedMemory(ptr long)
@ stub MmFreePagesFromMdl
@ stub MmGetPhysicalAddress
@ stub MmGetPhysicalMemoryRanges
...
...
include/ddk/wdm.h
View file @
982d6ccb
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment