Removed remaining kernel imports from ip lib.
[reactos.git] / reactos / drivers / net / tcpip / tcpip / mockpool.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
11 #include "precomp.h"
12
13 PVOID PoolAllocateBuffer(
14 ULONG Size)
15 /*
16 * FUNCTION: Returns a buffer from the free buffer pool
17 * RETURNS:
18 * Pointer to buffer, NULL if there was not enough
19 * free resources
20 */
21 {
22 PVOID Buffer;
23
24 /* FIXME: Get buffer from a free buffer pool with enough room */
25
26 Buffer = malloc(Size);
27
28 TI_DbgPrint(DEBUG_MEMORY, ("Allocated (%i) bytes at (0x%X).\n", Size, Buffer));
29
30 return Buffer;
31 }
32
33
34 VOID PoolFreeBuffer(
35 PVOID Buffer)
36 /*
37 * FUNCTION: Returns a buffer to the free buffer pool
38 * ARGUMENTS:
39 * Buffer = Buffer to return to free buffer pool
40 */
41 {
42 /* FIXME: Put buffer in free buffer pool */
43
44 TI_DbgPrint(DEBUG_MEMORY, ("Freeing buffer at (0x%X).\n", Buffer));
45
46 free(Buffer);
47 }
48
49 PVOID TcpipAllocateFromNPagedLookasideList( PNPAGED_LOOKASIDE_LIST List ) {
50 return PoolAllocateBuffer( List->Size );
51 }
52
53 VOID TcpipFreeToNPagedLookasideList( PNPAGED_LOOKASIDE_LIST List,
54 PVOID Thing ) {
55 PoolFreeBuffer( Thing );
56 }
57
58 /* EOF */