ReactOS  0.4.13-dev-698-g77671f0
mockpool.c
Go to the documentation of this file.
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 
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 
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 
50  return PoolAllocateBuffer( List->Size );
51 }
52 
54  PVOID Thing ) {
55  PoolFreeBuffer( Thing );
56 }
57 
58 /* EOF */
#define TI_DbgPrint(_t_, _x_)
Definition: debug.h:45
#define free
Definition: debug_ros.c:5
PVOID PoolAllocateBuffer(ULONG Size)
Definition: mockpool.c:13
struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST * PNPAGED_LOOKASIDE_LIST
#define DEBUG_MEMORY
Definition: debug.h:18
Definition: bufpool.h:45
VOID TcpipFreeToNPagedLookasideList(PNPAGED_LOOKASIDE_LIST List, PVOID Thing)
Definition: mockpool.c:53
LIST_ENTRY List
Definition: psmgr.c:57
VOID PoolFreeBuffer(PVOID Buffer)
Definition: mockpool.c:34
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
PVOID TcpipAllocateFromNPagedLookasideList(PNPAGED_LOOKASIDE_LIST List)
Definition: mockpool.c:49
unsigned int ULONG
Definition: retypes.h:1
#define malloc
Definition: debug_ros.c:4
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34