ReactOS  0.4.15-dev-3173-g40ee59d
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 
11 PNDIS_GENERIC_OBJECT
12 EXPORT
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
36  IN PNDIS_GENERIC_OBJECT NdisGenericObject)
37 {
38  ExFreePool(NdisGenericObject);
39 }
#define IN
Definition: typedefs.h:39
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
VOID EXPORT NdisFreeGenericObject(IN PNDIS_GENERIC_OBJECT NdisGenericObject)
Definition: object.c:35
#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
unsigned short USHORT
Definition: pedump.c:61
PNDIS_GENERIC_OBJECT EXPORT NdisAllocateGenericObject(IN PDRIVER_OBJECT DriverObject OPTIONAL, IN ULONG Tag, IN USHORT Size)
Definition: object.c:13
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
CSHORT Type
Definition: iotypes.h:2275
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68