:pserver:cvsanon@mok.lvcm.com:/CVS/ReactOS reactos
[reactos.git] / drivers / net / tcpip / tcpip / pool.c
1 /*
2  * COPYRIGHT:   See COPYING in the top level directory
3  * PROJECT:     ReactOS TCP/IP protocol driver
4  * FILE:        tcpip/pool.c
5  * PURPOSE:     Routines for controling pools
6  * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
7  * REVISIONS:
8  *   CSH 01/08-2000 Created
9  */
10 #include <tcpip.h>
11 #include <pool.h>
12
13
14 PVOID PoolAllocateBuffer(
15     ULONG Size)
16 /*
17  * FUNCTION: Returns a buffer from the free buffer pool
18  * RETURNS:
19  *     Pointer to buffer, NULL if there was not enough
20  *     free resources
21  */
22 {
23     PVOID Buffer;
24
25     /* FIXME: Get buffer from a free buffer pool with enough room */
26
27     Buffer = ExAllocatePool(NonPagedPool, Size);
28
29     TI_DbgPrint(DEBUG_MEMORY, ("Allocated (%i) bytes at (0x%X).\n", Size, Buffer));
30
31     return Buffer;
32 }
33
34
35 VOID PoolFreeBuffer(
36     PVOID Buffer)
37 /*
38  * FUNCTION: Returns a buffer to the free buffer pool
39  * ARGUMENTS:
40  *     Buffer = Buffer to return to free buffer pool
41  */
42 {
43     /* FIXME: Put buffer in free buffer pool */
44
45     TI_DbgPrint(DEBUG_MEMORY, ("Freeing buffer at (0x%X).\n", Buffer));
46
47     ExFreePool(Buffer);
48 }
49
50 /* EOF */