ReactOS  0.4.14-dev-1007-g90d795b
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 }
smooth NULL
Definition: ftsmooth.c:416
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
static IUnknown Object
Definition: main.c:512
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
IN ULONG IN ULONG Tag
Definition: evtlib.h:159
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262

◆ 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