- Merge aicom-network-fixes up to r36740
[reactos.git] / reactos / drivers / network / ndis / ndis / object.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS NDIS library
4 * FILE: object.c
5 * PURPOSE: Implements the NDIS 6.0 object interface
6 * PROGRAMMERS: Cameron Gutman (aicommander@gmail.com)
7 */
8
9 #include "ndissys.h"
10
11 PNDIS_GENERIC_OBJECT
12 EXPORT
13 NdisAllocateGenericObject(
14 IN PDRIVER_OBJECT DriverObject OPTIONAL,
15 IN ULONG Tag,
16 IN USHORT Size)
17 {
18 PNDIS_GENERIC_OBJECT Object;
19
20 Object = ExAllocatePoolWithTag(NonPagedPool, sizeof(NDIS_GENERIC_OBJECT) + Size, Tag);
21 if (!Object) return NULL;
22
23 RtlZeroMemory(Object, sizeof(NDIS_GENERIC_OBJECT) + Size);
24
25 Object->DriverObject = DriverObject;
26 Object->Header.Type = NDIS_OBJECT_TYPE_GENERIC_OBJECT;
27 Object->Header.Revision = NDIS_GENERIC_OBJECT_REVISION_1;
28 Object->Header.Size = sizeof(NDIS_GENERIC_OBJECT);
29
30 return Object;
31 }
32
33 VOID
34 EXPORT
35 NdisFreeGenericObject(
36 IN PNDIS_GENERIC_OBJECT NdisGenericObject)
37 {
38 ExFreePool(NdisGenericObject);
39 }
40