Go to the source code of this file.
|
UINT | Random (VOID) |
|
UINT | CopyBufferToBufferChain (PNDIS_BUFFER DstBuffer, UINT DstOffset, PCHAR SrcData, UINT Length) |
|
UINT | CopyBufferChainToBuffer (PCHAR DstData, PNDIS_BUFFER SrcBuffer, UINT SrcOffset, UINT Length) |
|
UINT | CopyPacketToBuffer (PCHAR DstData, PNDIS_PACKET SrcPacket, UINT SrcOffset, UINT Length) |
|
UINT | CopyPacketToBufferChain (PNDIS_BUFFER DstBuffer, UINT DstOffset, PNDIS_PACKET SrcPacket, UINT SrcOffset, UINT Length) |
|
VOID | FreeNdisPacketX (PNDIS_PACKET Packet, PCHAR File, UINT Line) |
|
PVOID | AdjustPacket (PNDIS_PACKET Packet, UINT Available, UINT Needed) |
|
UINT | ResizePacket (PNDIS_PACKET Packet, UINT Size) |
|
NDIS_STATUS | AllocatePacketWithBuffer (PNDIS_PACKET *NdisPacket, PCHAR Data, UINT Len) |
|
VOID | FreeNdisPacket (PNDIS_PACKET Packet) |
|
void | GetDataPtr (PNDIS_PACKET Packet, UINT Offset, PCHAR *DataOut, PUINT Size) |
|
◆ DISPLAY_IP_PACKET
◆ DISPLAY_TCP_PACKET
◆ AdjustPacket()
Definition at line 334 of file mockbuffer.c.
347{
350
352
353 Adjust = Available - Needed;
354
356
357
358
361 NdisBuffer->ByteOffset +=
Adjust;
362 NdisBuffer->ByteCount -=
Adjust;
363 }
364
365 return NdisBuffer->MappedSystemVa;
366}
#define TI_DbgPrint(_t_, _x_)
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
static __inline VOID NdisQueryPacket(IN PNDIS_PACKET Packet, OUT PUINT PhysicalBufferCount OPTIONAL, OUT PUINT BufferCount OPTIONAL, OUT PNDIS_BUFFER *FirstBuffer OPTIONAL, OUT PUINT TotalPacketLength OPTIONAL)
static LONGLONG Adjust(LONGLONG value, const LONGLONG *pModifier, DWORD dwFlags)
◆ AllocatePacketWithBuffer()
Definition at line 326 of file buffer.c.
327 {
332
335
337
342 }
343
349 }
350
353
355}
VOID EXPORT NdisAllocateBuffer(OUT PNDIS_STATUS Status, OUT PNDIS_BUFFER *Buffer, IN NDIS_HANDLE PoolHandle, IN PVOID VirtualAddress, IN UINT Length)
VOID EXPORT NdisAllocatePacket(OUT PNDIS_STATUS Status, OUT PNDIS_PACKET *Packet, IN NDIS_HANDLE PoolHandle)
#define ExAllocatePoolWithTag(hernya, size, tag)
NDIS_HANDLE GlobalBufferPool
NDIS_HANDLE GlobalPacketPool
#define FreeNdisPacket(x)
#define ExFreePoolWithTag(_P, _T)
#define NDIS_STATUS_SUCCESS
#define NdisChainBufferAtFront(Packet, Buffer)
#define NDIS_STATUS_RESOURCES
#define RtlCopyMemory(Destination, Source, Length)
◆ CopyBufferChainToBuffer()
Definition at line 113 of file buffer.c.
131{
134
136
137
138 if (
SkipToOffset(SrcBuffer, SrcOffset, &SrcData, &SrcSize) == -1)
139 return 0;
140
141
143 for (;;) {
145
147
151
154 break;
155
157 if (SrcSize == 0) {
158
159
161 if (!SrcBuffer)
162 break;
163
165 }
166 }
167
169}
FORCEINLINE ULONG SkipToOffset(IN PNDIS_BUFFER Buffer, IN UINT Offset, IN OUT PUCHAR *Data, IN OUT PUINT Size)
#define NdisGetNextBuffer(CurrentBuffer, NextBuffer)
_In_ UINT _In_ UINT _In_ PNDIS_PACKET _In_ UINT _Out_ PUINT BytesCopied
_In_ UINT _In_ UINT BytesToCopy
#define NdisQueryBuffer(_Buffer, _VirtualAddress, _Length)
_In_ ULONG _In_ ULONG _In_ ULONG Length
Referenced by CopyPacketToBuffer().
◆ CopyBufferToBufferChain()
Definition at line 56 of file buffer.c.
74{
77
79
80
81 if (
SkipToOffset(DstBuffer, DstOffset, &DstData, &DstSize) == -1)
82 return 0;
83
84
86 for (;;) {
88
92
95 break;
96
98 if (DstSize == 0) {
99
100
102 if (!DstBuffer)
103 break;
104
106 }
107 }
108
110}
◆ CopyPacketToBuffer()
Definition at line 172 of file buffer.c.
190{
195
197
199 &FirstBuffer,
201 &FirstLength,
203
205}
UINT CopyBufferChainToBuffer(PUCHAR DstData, PNDIS_BUFFER SrcBuffer, UINT SrcOffset, UINT Length)
VOID EXPORT NdisGetFirstBufferFromPacket(IN PNDIS_PACKET _Packet, OUT PNDIS_BUFFER *_FirstBuffer, OUT PVOID *_FirstBufferVA, OUT PUINT _FirstBufferLength, OUT PUINT _TotalBufferLength)
◆ CopyPacketToBufferChain()
Definition at line 208 of file buffer.c.
228{
231 UINT DstSize, SrcSize;
233
234 NDIS_DbgPrint(
MAX_TRACE, (
"DstBuffer (0x%X) DstOffset (0x%X) SrcPacket (0x%X) SrcOffset (0x%X) Length (%d)\n", DstBuffer, DstOffset, SrcPacket, SrcOffset,
Length));
235
236
238 if (
SkipToOffset(DstBuffer, DstOffset, &DstData, &DstSize) == 0xFFFFFFFF)
239 return 0;
240
242 if (
SkipToOffset(SrcBuffer, SrcOffset, &SrcData, &SrcSize) == 0xFFFFFFFF)
243 return 0;
244
245 for (Total = 0;;) {
246
249 else
253
255
259 break;
260
262 if (DstSize == 0) {
263
264
266 if (!DstBuffer)
267 break;
268
270 }
271
273 if (SrcSize == 0) {
274
275
277 if (!SrcBuffer)
278 break;
279
281 }
282 }
283
284 return Total;
285}
#define NDIS_DbgPrint(_t_, _x_)
◆ FreeNdisPacket()
Definition at line 358 of file buffer.c.
365{
367
369
370
375
382 }
383
384
386}
VOID EXPORT NdisFreePacket(IN PNDIS_PACKET Packet)
◆ FreeNdisPacketX()
Definition at line 117 of file routines.c.
126{
128
130
131
136
142 }
143
144
147}
#define LA_DbgPrint(_t_, _x_)
#define UntrackFL(x, y, z)
◆ GetDataPtr()
Definition at line 65 of file routines.c.
68 {
70
74}
__inline INT SkipToOffset(PNDIS_BUFFER Buffer, UINT Offset, PCHAR *Data, PUINT Size)
_In_ ULONG _In_ ULONG Offset
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
◆ Random()
◆ ResizePacket()
Definition at line 290 of file buffer.c.
301{
304
306
307 OldSize = NdisBuffer->ByteCount;
308
310 NdisBuffer->ByteCount =
Size;
311
312 return OldSize;
313}