mirror of
https://github.com/reactos/reactos.git
synced 2025-03-10 18:24:02 +00:00
NTOSKRNL.FsRtlAllocate functions.
svn path=/trunk/; revision=1023
This commit is contained in:
parent
76f55a8a93
commit
395fb3c86f
12 changed files with 338 additions and 48 deletions
|
@ -3,12 +3,30 @@
|
|||
|
||||
/* EXECUTIVE ROUTINES ******************************************************/
|
||||
|
||||
VOID ExReleaseResourceLite(PERESOURCE Resource);
|
||||
VOID ExAcquireFastMutex (PFAST_MUTEX FastMutex);
|
||||
VOID ExAcquireFastMutexUnsafe (PFAST_MUTEX FastMutex);
|
||||
BOOLEAN ExAcquireResourceExclusive (PERESOURCE Resource, BOOLEAN Wait);
|
||||
BOOLEAN ExAcquireResourceExclusiveLite (PERESOURCE Resource, BOOLEAN Wait);
|
||||
BOOLEAN ExAcquireResourceSharedLite (
|
||||
VOID
|
||||
ExReleaseResourceLite (
|
||||
PERESOURCE Resource
|
||||
);
|
||||
VOID
|
||||
ExAcquireFastMutex (
|
||||
PFAST_MUTEX FastMutex
|
||||
);
|
||||
VOID
|
||||
ExAcquireFastMutexUnsafe (
|
||||
PFAST_MUTEX FastMutex
|
||||
);
|
||||
BOOLEAN
|
||||
ExAcquireResourceExclusive (
|
||||
PERESOURCE Resource,
|
||||
BOOLEAN Wait
|
||||
);
|
||||
BOOLEAN
|
||||
ExAcquireResourceExclusiveLite (
|
||||
PERESOURCE Resource,
|
||||
BOOLEAN Wait
|
||||
);
|
||||
BOOLEAN
|
||||
ExAcquireResourceSharedLite (
|
||||
PERESOURCE Resource,
|
||||
BOOLEAN Wait
|
||||
);
|
||||
|
@ -34,37 +52,40 @@ PVOID
|
|||
ExAllocateFromZone (
|
||||
PZONE_HEADER Zone
|
||||
);
|
||||
|
||||
/*
|
||||
* FUNCTION: Allocates memory from the nonpaged pool
|
||||
* ARGUMENTS:
|
||||
* size = minimum size of the block to be allocated
|
||||
* NumberOfBytes = minimum size of the block to be allocated
|
||||
* PoolType = the type of memory to use for the block (ignored)
|
||||
* RETURNS:
|
||||
* the address of the block if it succeeds
|
||||
*/
|
||||
PVOID
|
||||
STDCALL
|
||||
ExAllocatePool (
|
||||
POOL_TYPE PoolType,
|
||||
ULONG size
|
||||
IN POOL_TYPE PoolType,
|
||||
IN ULONG NumberOfBytes
|
||||
);
|
||||
|
||||
PVOID
|
||||
STDCALL
|
||||
ExAllocatePoolWithQuota (
|
||||
POOL_TYPE PoolType,
|
||||
ULONG NumberOfBytes
|
||||
IN POOL_TYPE PoolType,
|
||||
IN ULONG NumberOfBytes
|
||||
);
|
||||
PVOID
|
||||
STDCALL
|
||||
ExAllocatePoolWithQuotaTag (
|
||||
POOL_TYPE PoolType,
|
||||
ULONG NumberOfBytes,
|
||||
ULONG Tag
|
||||
IN POOL_TYPE PoolType,
|
||||
IN ULONG NumberOfBytes,
|
||||
IN ULONG Tag
|
||||
);
|
||||
PVOID
|
||||
STDCALL
|
||||
ExAllocatePoolWithTag (
|
||||
POOL_TYPE PoolType,
|
||||
ULONG NumberOfBytes,
|
||||
ULONG Tag
|
||||
IN POOL_TYPE PoolType,
|
||||
IN ULONG NumberOfBytes,
|
||||
IN ULONG Tag
|
||||
);
|
||||
VOID
|
||||
ExConvertExclusiveToSharedLite (
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef __INCLUDE_DDK_FSFUNCS_H
|
||||
#define __INCLUDE_DDK_FSFUNCS_H
|
||||
/* $Id: fsfuncs.h,v 1.6 2000/02/26 16:21:34 ea Exp $ */
|
||||
/* $Id: fsfuncs.h,v 1.7 2000/03/01 22:52:25 ea Exp $ */
|
||||
VOID
|
||||
STDCALL
|
||||
FsRtlAddLargeMcbEntry (
|
||||
|
@ -20,6 +20,32 @@ FsRtlAddMcbEntry (
|
|||
DWORD Unknown2,
|
||||
DWORD Unknown3
|
||||
);
|
||||
PVOID
|
||||
STDCALL
|
||||
FsRtlAllocatePool (
|
||||
IN POOL_TYPE PoolType,
|
||||
IN ULONG NumberOfBytes
|
||||
);
|
||||
PVOID
|
||||
STDCALL
|
||||
FsRtlAllocatePoolWithQuota (
|
||||
IN POOL_TYPE PoolType,
|
||||
IN ULONG NumberOfBytes
|
||||
);
|
||||
PVOID
|
||||
STDCALL
|
||||
FsRtlAllocatePoolWithQuotaTag (
|
||||
IN POOL_TYPE PoolType,
|
||||
IN ULONG NumberOfBytes,
|
||||
IN ULONG Tag
|
||||
);
|
||||
PVOID
|
||||
STDCALL
|
||||
FsRtlAllocatePoolWithTag (
|
||||
IN POOL_TYPE PoolType,
|
||||
IN ULONG NumberOfBytes,
|
||||
IN ULONG Tag
|
||||
);
|
||||
DWORD
|
||||
STDCALL
|
||||
FsRtlAllocateResource (
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/*
|
||||
/* $Id: ntddk.h,v 1.13 2000/03/01 22:52:25 ea Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: include/ddk/ntddk.h
|
||||
|
|
8
reactos/include/internal/ifs.h
Normal file
8
reactos/include/internal/ifs.h
Normal file
|
@ -0,0 +1,8 @@
|
|||
#ifndef __INCLUDE_INTERNAL_IFS_H
|
||||
#define __INCLUDE_INTERNAL_IFS_H
|
||||
/* $Id: ifs.h,v 1.1 2000/03/01 22:52:27 ea Exp $ */
|
||||
|
||||
/* Look for "FSrt" in mem view */
|
||||
#define IFS_POOL_TAG 0x74725346
|
||||
|
||||
#endif
|
|
@ -3,10 +3,20 @@
|
|||
|
||||
#include <internal/linkage.h>
|
||||
|
||||
PVOID ExAllocateNonPagedPoolWithTag(ULONG type,
|
||||
PVOID
|
||||
__stdcall
|
||||
ExAllocateNonPagedPoolWithTag (
|
||||
POOL_TYPE type,
|
||||
ULONG size,
|
||||
ULONG Tag,
|
||||
PVOID Caller);
|
||||
PVOID ExAllocatePagedPoolWithTag(POOL_TYPE Type, ULONG size, ULONG Tag);
|
||||
PVOID Caller
|
||||
);
|
||||
PVOID
|
||||
__stdcall
|
||||
ExAllocatePagedPoolWithTag (
|
||||
POOL_TYPE Type,
|
||||
ULONG size,
|
||||
ULONG Tag
|
||||
);
|
||||
|
||||
#endif /* __INTERNAL_POOL_H */
|
||||
|
|
151
reactos/ntoskrnl/fs/pool.c
Normal file
151
reactos/ntoskrnl/fs/pool.c
Normal file
|
@ -0,0 +1,151 @@
|
|||
/* $Id: pool.c,v 1.1 2000/03/01 22:52:27 ea Exp $
|
||||
*
|
||||
* reactos/ntoskrnl/fs/pool.c
|
||||
*
|
||||
*/
|
||||
#include <ntos.h>
|
||||
#include <ddk/fsfuncs.h>
|
||||
#include <internal/ifs.h>
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* NAME EXPORTED
|
||||
* FsRtlAllocatePool@8
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* ARGUMENTS
|
||||
*
|
||||
* RETURN VALUE
|
||||
*
|
||||
* NOTE
|
||||
* IFS_POOL_TAG is "FSrt" in mem view.
|
||||
*
|
||||
*/
|
||||
PVOID
|
||||
STDCALL
|
||||
FsRtlAllocatePool (
|
||||
IN POOL_TYPE PoolType,
|
||||
IN ULONG NumberOfBytes
|
||||
)
|
||||
{
|
||||
PVOID Address;
|
||||
|
||||
Address = ExAllocatePoolWithTag (
|
||||
PoolType,
|
||||
NumberOfBytes,
|
||||
IFS_POOL_TAG
|
||||
);
|
||||
if (NULL == Address)
|
||||
{
|
||||
ExRaiseStatus (STATUS_INSUFFICIENT_RESOURCES);
|
||||
}
|
||||
return Address;
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* NAME EXPORTED
|
||||
* FsRtlAllocatePoolWithQuota@8
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* ARGUMENTS
|
||||
*
|
||||
* RETURN VALUE
|
||||
*
|
||||
* NOTE
|
||||
* IFS_POOL_TAG is "FSrt" in mem view.
|
||||
*/
|
||||
PVOID
|
||||
STDCALL
|
||||
FsRtlAllocatePoolWithQuota (
|
||||
IN POOL_TYPE PoolType,
|
||||
IN ULONG NumberOfBytes
|
||||
)
|
||||
{
|
||||
PVOID Address;
|
||||
|
||||
Address = ExAllocatePoolWithQuotaTag (
|
||||
PoolType,
|
||||
NumberOfBytes,
|
||||
IFS_POOL_TAG
|
||||
);
|
||||
if (NULL == Address)
|
||||
{
|
||||
ExRaiseStatus (STATUS_INSUFFICIENT_RESOURCES);
|
||||
}
|
||||
return Address;
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* NAME EXPORTED
|
||||
* FsRtlAllocatePoolWithQuotaTag@12
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* ARGUMENTS
|
||||
*
|
||||
* RETURN VALUE
|
||||
*
|
||||
*/
|
||||
PVOID
|
||||
STDCALL
|
||||
FsRtlAllocatePoolWithQuotaTag (
|
||||
IN POOL_TYPE PoolType,
|
||||
IN ULONG NumberOfBytes,
|
||||
IN ULONG Tag
|
||||
)
|
||||
{
|
||||
PVOID Address;
|
||||
|
||||
Address = ExAllocatePoolWithQuotaTag (
|
||||
PoolType,
|
||||
NumberOfBytes,
|
||||
Tag
|
||||
);
|
||||
if (NULL == Address)
|
||||
{
|
||||
ExRaiseStatus (STATUS_INSUFFICIENT_RESOURCES);
|
||||
}
|
||||
return Address;
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* NAME EXPORTED
|
||||
* FsRtlAllocatePoolWithTag@12
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* ARGUMENTS
|
||||
*
|
||||
* RETURN VALUE
|
||||
*
|
||||
*/
|
||||
PVOID
|
||||
STDCALL
|
||||
FsRtlAllocatePoolWithTag (
|
||||
IN POOL_TYPE PoolType,
|
||||
IN ULONG NumberOfBytes,
|
||||
IN ULONG Tag
|
||||
)
|
||||
{
|
||||
PVOID Address;
|
||||
|
||||
Address = ExAllocatePoolWithTag (
|
||||
PoolType,
|
||||
NumberOfBytes,
|
||||
Tag
|
||||
);
|
||||
if (NULL == Address)
|
||||
{
|
||||
ExRaiseStatus (STATUS_INSUFFICIENT_RESOURCES);
|
||||
}
|
||||
return Address;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* EOF */
|
|
@ -1,4 +1,4 @@
|
|||
# $Id: makefile_rex,v 1.54 2000/02/26 16:22:27 ea Exp $
|
||||
# $Id: makefile_rex,v 1.55 2000/03/01 22:52:27 ea Exp $
|
||||
#
|
||||
# ReactOS Operating System
|
||||
#
|
||||
|
@ -57,7 +57,7 @@ EX_OBJECTS = ex/work.o ex/fmutex.o ex/resource.o ex/time.o ex/interlck.o \
|
|||
ex/stamp.o ex/init.o
|
||||
|
||||
FS_OBJECTS = fs/dbcsname.o fs/name.o fs/mcb.o fs/unc.o fs/util.o \
|
||||
fs/filelock.o
|
||||
fs/filelock.o fs/pool.o
|
||||
|
||||
SE_OBJECTS = se/semgr.o se/acl.o se/sid.o se/sd.o se/token.o se/luid.o \
|
||||
se/priv.o
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/*
|
||||
/* $Id: npool.c,v 1.26 2000/03/01 22:52:28 ea Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: ntoskrnl/mm/pool.c
|
||||
|
@ -23,6 +24,7 @@
|
|||
#include <internal/mmhal.h>
|
||||
#include <internal/bitops.h>
|
||||
#include <internal/ntoskrnl.h>
|
||||
#include <internal/pool.h>
|
||||
|
||||
#define NDEBUG
|
||||
#include <internal/debug.h>
|
||||
|
@ -625,7 +627,7 @@ asmlinkage VOID ExFreePool(PVOID block)
|
|||
KeReleaseSpinLock(&MmNpoolLock, oldIrql);
|
||||
}
|
||||
|
||||
PVOID ExAllocateNonPagedPoolWithTag(ULONG type,
|
||||
PVOID STDCALL ExAllocateNonPagedPoolWithTag(ULONG type,
|
||||
ULONG size,
|
||||
ULONG Tag,
|
||||
PVOID Caller)
|
||||
|
@ -697,3 +699,5 @@ PVOID ExAllocateNonPagedPoolWithTag(ULONG type,
|
|||
return(block);
|
||||
}
|
||||
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/*
|
||||
/* $Id: pool.c,v 1.10 2000/03/01 22:52:28 ea Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: ntoskrnl/mm/pool.c
|
||||
|
@ -21,7 +22,9 @@
|
|||
|
||||
/* FUNCTIONS ***************************************************************/
|
||||
|
||||
PVOID ExAllocatePool(POOL_TYPE PoolType, ULONG NumberOfBytes)
|
||||
PVOID
|
||||
STDCALL
|
||||
ExAllocatePool (POOL_TYPE PoolType, ULONG NumberOfBytes)
|
||||
/*
|
||||
* FUNCTION: Allocates pool memory of a specified type and returns a pointer
|
||||
* to the allocated block. This routine is used for general purpose allocation
|
||||
|
@ -52,7 +55,10 @@ PVOID ExAllocatePool(POOL_TYPE PoolType, ULONG NumberOfBytes)
|
|||
return(Block);
|
||||
}
|
||||
|
||||
PVOID ExAllocatePoolWithTag(ULONG PoolType, ULONG NumberOfBytes, ULONG Tag)
|
||||
|
||||
PVOID
|
||||
STDCALL
|
||||
ExAllocatePoolWithTag (ULONG PoolType, ULONG NumberOfBytes, ULONG Tag)
|
||||
{
|
||||
PVOID Block;
|
||||
|
||||
|
@ -91,8 +97,34 @@ PVOID ExAllocatePoolWithTag(ULONG PoolType, ULONG NumberOfBytes, ULONG Tag)
|
|||
return(Block);
|
||||
}
|
||||
|
||||
PVOID ExAllocatePoolWithQuota(POOL_TYPE PoolType, ULONG NumberOfBytes)
|
||||
|
||||
PVOID
|
||||
STDCALL
|
||||
ExAllocatePoolWithQuota (POOL_TYPE PoolType, ULONG NumberOfBytes)
|
||||
{
|
||||
// return(ExAllocatePoolWithQuotaTag(PoolType,NumberOfBytes,TAG_NONE));
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
PVOID
|
||||
STDCALL
|
||||
ExAllocatePoolWithQuotaTag (
|
||||
IN POOL_TYPE PoolType,
|
||||
IN ULONG NumberOfBytes,
|
||||
IN ULONG Tag
|
||||
)
|
||||
{
|
||||
PVOID Address = NULL;
|
||||
|
||||
UNIMPLEMENTED; /* FIXME */
|
||||
|
||||
if (NULL == Address)
|
||||
{
|
||||
ExRaiseStatus (STATUS_INSUFFICIENT_RESOURCES);
|
||||
}
|
||||
return Address;
|
||||
}
|
||||
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/*
|
||||
/* $Id: ppool.c,v 1.2 2000/03/01 22:52:28 ea Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: ntoskrnl/mm/ppool.c
|
||||
|
@ -17,7 +18,35 @@
|
|||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
PVOID ExAllocatePagedPoolWithTag(ULONG type, ULONG size, ULONG Tag)
|
||||
|
||||
/**********************************************************************
|
||||
* NAME INTERNAL
|
||||
* ExAllocatePagedPoolWithTag@12
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* ARGUMENTS
|
||||
*
|
||||
* RETURN VALUE
|
||||
*/
|
||||
PVOID
|
||||
STDCALL
|
||||
ExAllocatePagedPoolWithTag (
|
||||
IN POOL_TYPE PoolType,
|
||||
IN ULONG NumberOfBytes,
|
||||
IN ULONG Tag
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
PVOID Address = NULL;
|
||||
|
||||
UNIMPLEMENTED; /* FIXME: */
|
||||
|
||||
if (NULL == Address)
|
||||
{
|
||||
ExRaiseStatus (STATUS_INSUFFICIENT_RESOURCES);
|
||||
}
|
||||
return Address;
|
||||
}
|
||||
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; $Id: ntoskrnl.def,v 1.47 2000/02/27 02:08:12 ekohl Exp $
|
||||
; $Id: ntoskrnl.def,v 1.48 2000/03/01 22:52:27 ea Exp $
|
||||
;
|
||||
; reactos/ntoskrnl/ntoskrnl.def
|
||||
;
|
||||
|
@ -19,10 +19,10 @@ ExAcquireSharedWaitForExclusive
|
|||
ExAllocateFromNPagedLookasideList
|
||||
ExAllocateFromPagedLookasideList
|
||||
ExAllocateFromZone
|
||||
ExAllocatePool
|
||||
ExAllocatePoolWithQuota
|
||||
;ExAllocatePoolWithQuotaTag
|
||||
ExAllocatePoolWithTag
|
||||
ExAllocatePool@8
|
||||
ExAllocatePoolWithQuota@8
|
||||
ExAllocatePoolWithQuotaTag@12
|
||||
ExAllocatePoolWithTag@12
|
||||
ExConvertExclusiveToSharedLite
|
||||
ExDeleteNPagedLookasideList
|
||||
ExDeletePagedLookasideList
|
||||
|
@ -77,6 +77,10 @@ ExSystemTimeToLocalTime
|
|||
ExTryToAcquireResourceExclusiveLite
|
||||
FsRtlAddLargeMcbEntry@28
|
||||
FsRtlAddMcbEntry@16
|
||||
FsRtlAllocatePool@8
|
||||
FsRtlAllocatePoolWithQuota@8
|
||||
FsRtlAllocatePoolWithQuotaTag@12
|
||||
FsRtlAllocatePoolWithTag@12
|
||||
FsRtlAllocateResource@0
|
||||
FsRtlAreNamesEqual@16
|
||||
FsRtlBalanceReads@4
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; $Id: ntoskrnl.edf,v 1.34 2000/02/27 02:08:12 ekohl Exp $
|
||||
; $Id: ntoskrnl.edf,v 1.35 2000/03/01 22:52:27 ea Exp $
|
||||
;
|
||||
; reactos/ntoskrnl/ntoskrnl.def
|
||||
;
|
||||
|
@ -19,10 +19,10 @@ ExAcquireSharedWaitForExclusive
|
|||
ExAllocateFromNPagedLookasideList
|
||||
ExAllocateFromPagedLookasideList
|
||||
ExAllocateFromZone
|
||||
ExAllocatePool
|
||||
ExAllocatePoolWithQuota
|
||||
;ExAllocatePoolWithQuotaTag
|
||||
ExAllocatePoolWithTag
|
||||
ExAllocatePool=ExAllocatePool@8
|
||||
ExAllocatePoolWithQuota=ExAllocatePoolWithQuota@8
|
||||
ExAllocatePoolWithQuotaTag=ExAllocatePoolWithQuotaTag@12
|
||||
ExAllocatePoolWithTag=ExAllocatePoolWithTag@12
|
||||
ExConvertExclusiveToSharedLite
|
||||
ExDeleteNPagedLookasideList
|
||||
ExDeletePagedLookasideList
|
||||
|
@ -77,6 +77,10 @@ ExSystemTimeToLocalTime
|
|||
ExTryToAcquireResourceExclusiveLite
|
||||
FsRtlAddLargeMcbEntry=FsRtlAddLargeMcbEntry@28
|
||||
FsRtlAddMcbEntry=FsRtlAddMcbEntry@16
|
||||
FsRtlAllocatePool=FsRtlAllocatePool@8
|
||||
FsRtlAllocatePoolWithQuota=FsRtlAllocatePoolWithQuota@8
|
||||
FsRtlAllocatePoolWithQuotaTag=FsRtlAllocatePoolWithQuotaTag@12
|
||||
FsRtlAllocatePoolWithTag=FsRtlAllocatePoolWithTag@12
|
||||
FsRtlAllocateResource=FsRtlAllocateResource@0
|
||||
FsRtlAreNamesEqual=FsRtlAreNamesEqual@16
|
||||
FsRtlBalanceReads=FsRtlBalanceReads@4
|
||||
|
|
Loading…
Reference in a new issue