ReactOS 0.4.15-dev-7897-g78dc504
object.c File Reference
#include "ndissys.h"
Include dependency graph for object.c:

Go to the source code of this file.

Functions

PNDIS_GENERIC_OBJECT EXPORT NdisAllocateGenericObject (IN PDRIVER_OBJECT DriverObject OPTIONAL, IN ULONG Tag, IN USHORT Size)
 
VOID EXPORT NdisFreeGenericObject (IN PNDIS_GENERIC_OBJECT NdisGenericObject)
 

Function Documentation

◆ NdisAllocateGenericObject()

PNDIS_GENERIC_OBJECT EXPORT NdisAllocateGenericObject ( IN PDRIVER_OBJECT DriverObject  OPTIONAL,
IN ULONG  Tag,
IN USHORT  Size 
)

Definition at line 13 of file object.c.

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}
#define NULL
Definition: types.h:112
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define NonPagedPool
Definition: env_spec_w32.h:307
CSHORT Type
Definition: iotypes.h:2275
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
_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

◆ NdisFreeGenericObject()

VOID EXPORT NdisFreeGenericObject ( IN PNDIS_GENERIC_OBJECT  NdisGenericObject)

Definition at line 35 of file object.c.

37{
38 ExFreePool(NdisGenericObject);
39}
#define ExFreePool(addr)
Definition: env_spec_w32.h:352