ReactOS  0.4.15-dev-3182-g7b62228
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 }
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4061
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
#define NULL
Definition: types.h:112
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
CSHORT Type
Definition: iotypes.h:2275

◆ 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