ReactOS 0.4.16-dev-340-g0540c21
object.c
Go to the documentation of this file.
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
11PNDIS_GENERIC_OBJECT
15 IN ULONG Tag,
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
33VOID
36 IN PNDIS_GENERIC_OBJECT NdisGenericObject)
37{
38 ExFreePool(NdisGenericObject);
39}
#define NULL
Definition: types.h:112
VOID EXPORT NdisFreeGenericObject(IN PNDIS_GENERIC_OBJECT NdisGenericObject)
Definition: object.c:35
PNDIS_GENERIC_OBJECT EXPORT NdisAllocateGenericObject(IN PDRIVER_OBJECT DriverObject OPTIONAL, IN ULONG Tag, IN USHORT Size)
Definition: object.c:13
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define NonPagedPool
Definition: env_spec_w32.h:307
unsigned short USHORT
Definition: pedump.c:61
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
CSHORT Type
Definition: iotypes.h:2275
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4065
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213