本文整理汇总了C++中TI_DbgPrint函数的典型用法代码示例。如果您正苦于以下问题:C++ TI_DbgPrint函数的具体用法?C++ TI_DbgPrint怎么用?C++ TI_DbgPrint使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TI_DbgPrint函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FileOpenConnection
/*
* FUNCTION: Opens a connection file object
* ARGUMENTS:
* Request = Pointer to TDI request structure for this request
* ClientContext = Pointer to client context information
* RETURNS:
* Status of operation
*/
NTSTATUS FileOpenConnection(
PTDI_REQUEST Request,
PVOID ClientContext)
{
NTSTATUS Status;
PCONNECTION_ENDPOINT Connection;
TI_DbgPrint(MID_TRACE, ("Called.\n"));
Connection = TCPAllocateConnectionEndpoint( ClientContext );
if( !Connection ) return STATUS_NO_MEMORY;
Status = TCPSocket( Connection, AF_INET, SOCK_STREAM, IPPROTO_TCP );
if( !NT_SUCCESS(Status) ) {
DereferenceObject( Connection );
return Status;
}
/* Return connection endpoint file object */
Request->Handle.ConnectionContext = Connection;
TI_DbgPrint(MAX_TRACE, ("Leaving.\n"));
return STATUS_SUCCESS;
}
示例2: ICMPTransmit
VOID ICMPTransmit(
PIP_PACKET IPPacket,
PIP_TRANSMIT_COMPLETE Complete,
PVOID Context)
/*
* FUNCTION: Transmits an ICMP packet
* ARGUMENTS:
* NTE = Pointer to net table entry to use (NULL if don't care)
* IPPacket = Pointer to IP packet to transmit
*/
{
PNEIGHBOR_CACHE_ENTRY NCE;
TI_DbgPrint(DEBUG_ICMP, ("Called.\n"));
/* Calculate checksum of ICMP header and data */
((PICMP_HEADER)IPPacket->Data)->Checksum = (USHORT)
IPv4Checksum(IPPacket->Data, IPPacket->TotalSize - IPPacket->HeaderSize, 0);
/* Get a route to the destination address */
if ((NCE = RouteGetRouteToDestination(&IPPacket->DstAddr))) {
/* Send the packet */
IPSendDatagram(IPPacket, NCE);
} else {
/* No route to destination (or no free resources) */
TI_DbgPrint(DEBUG_ICMP, ("No route to destination address 0x%X.\n",
IPPacket->DstAddr.Address.IPv4Address));
IPPacket->Free(IPPacket);
}
}
示例3: InfoTdiSetRoute
TDI_STATUS InfoTdiSetRoute(PIP_INTERFACE IF, PVOID Buffer, UINT BufferSize)
{
IP_ADDRESS Address, Netmask, Router;
PIPROUTE_ENTRY Route = Buffer;
AddrInitIPv4( &Address, Route->Dest );
AddrInitIPv4( &Netmask, Route->Mask );
AddrInitIPv4( &Router, Route->Gw );
if (!Buffer || BufferSize < sizeof(IPROUTE_ENTRY))
return TDI_INVALID_PARAMETER;
if (IF == Loopback)
{
DbgPrint("Failing attempt to add route to loopback adapter\n");
return TDI_INVALID_PARAMETER;
}
if( Route->Type == IP_ROUTE_TYPE_ADD ) { /* Add the route */
TI_DbgPrint(DEBUG_INFO,("Adding route (%s)\n", A2S(&Address)));
if (!RouterCreateRoute( &Address, &Netmask, &Router,
IF, Route->Metric1))
return TDI_NO_RESOURCES;
return TDI_SUCCESS;
} else if( Route->Type == IP_ROUTE_TYPE_DEL ) {
TI_DbgPrint(DEBUG_INFO,("Removing route (%s)\n", A2S(&Address)));
if (NT_SUCCESS(RouterRemoveRoute( &Address, &Router )))
return TDI_SUCCESS;
else
return TDI_INVALID_PARAMETER;
}
return TDI_INVALID_REQUEST;
}
示例4: InfoTdiQueryGetATInfo
TDI_STATUS
InfoTdiQueryGetATInfo(
TDIEntityID ID,
PIP_INTERFACE Interface,
PNDIS_BUFFER Buffer,
PUINT BufferSize)
{
ULONG ATInfo[2];
TDI_STATUS Status;
TI_DbgPrint(DEBUG_INFO, ("Called.\n"));
if (!Interface)
return TDI_INVALID_PARAMETER;
if (*BufferSize < sizeof(ATInfo))
return STATUS_BUFFER_TOO_SMALL;
/* FIXME: I have no idea what the first field should contain... */
ATInfo[0] = 0;
ATInfo[1] = Interface->Index;
Status = InfoCopyOut((PCHAR)ATInfo,
sizeof(ATInfo),
Buffer,
BufferSize);
TI_DbgPrint(DEBUG_INFO, ("Returning %08x\n", Status));
return Status;
}
示例5: TI_DbgPrint
VOID FreeNdisPacket
( PNDIS_PACKET Packet )
/*
* FUNCTION: Frees an NDIS packet
* ARGUMENTS:
* Packet = Pointer to NDIS packet to be freed
*/
{
PNDIS_BUFFER Buffer, NextBuffer;
TI_DbgPrint(DEBUG_PBUFFER, ("Packet (0x%X)\n", Packet));
/* Free all the buffers in the packet first */
NdisQueryPacket(Packet, NULL, NULL, &Buffer, NULL);
for (; Buffer != NULL; Buffer = NextBuffer) {
PVOID Data;
UINT Length;
NdisGetNextBuffer(Buffer, &NextBuffer);
NdisQueryBuffer(Buffer, &Data, &Length);
TI_DbgPrint(DEBUG_PBUFFER, ("Freeing ndis buffer (0x%X)\n", Buffer));
NdisFreeBuffer(Buffer);
TI_DbgPrint(DEBUG_PBUFFER, ("Freeing exal buffer (0x%X)\n", Data));
ExFreePoolWithTag(Data, PACKET_BUFFER_TAG);
}
/* Finally free the NDIS packet discriptor */
NdisFreePacket(Packet);
}
示例6: DispDataRequestComplete
VOID DispDataRequestComplete(
PVOID Context,
NTSTATUS Status,
ULONG Count)
/*
* FUNCTION: Completes a send/receive IRP
* ARGUMENTS:
* Context = Pointer to context information (IRP)
* Status = Status of the request
* Count = Number of bytes sent or received
*/
{
PIRP Irp = Context;
TI_DbgPrint(DEBUG_IRP, ("Called for irp %x (%x, %d).\n",
Irp, Status, Count));
Irp->IoStatus.Status = Status;
Irp->IoStatus.Information = Count;
TI_DbgPrint(MID_TRACE, ("Irp->IoStatus.Status = %x\n",
Irp->IoStatus.Status));
TI_DbgPrint(MID_TRACE, ("Irp->IoStatus.Information = %d\n",
Irp->IoStatus.Information));
TI_DbgPrint(DEBUG_IRP, ("Completing IRP at (0x%X).\n", Irp));
IRPFinish(Irp, Status);
TI_DbgPrint(DEBUG_IRP, ("Done Completing IRP\n"));
}
示例7: CopyBufferChainToBuffer
UINT CopyBufferChainToBuffer(
PCHAR DstData,
PNDIS_BUFFER SrcBuffer,
UINT SrcOffset,
UINT Length)
/*
* FUNCTION: Copies data from an NDIS buffer chain to a buffer
* ARGUMENTS:
* DstData = Pointer to destination buffer
* SrcBuffer = Pointer to source NDIS buffer
* SrcOffset = Source start offset
* Length = Number of bytes to copy
* RETURNS:
* Number of bytes copied to destination buffer
* NOTES:
* The number of bytes copied may be limited by the source
* buffer size
*/
{
UINT BytesCopied, BytesToCopy, SrcSize;
PCHAR SrcData;
TI_DbgPrint(DEBUG_PBUFFER, ("DstData 0x%X SrcBuffer 0x%X SrcOffset 0x%X Length %d\n",DstData,SrcBuffer, SrcOffset, Length));
/* Skip SrcOffset bytes in the source buffer chain */
if (SkipToOffset(SrcBuffer, SrcOffset, &SrcData, &SrcSize) == -1)
return 0;
/* Start copying the data */
BytesCopied = 0;
for (;;) {
BytesToCopy = MIN(SrcSize, Length);
TI_DbgPrint(DEBUG_PBUFFER, ("Copying (%d) bytes from 0x%X to 0x%X\n", BytesToCopy, SrcData, DstData));
RtlCopyMemory((PVOID)DstData, (PVOID)SrcData, BytesToCopy);
BytesCopied += BytesToCopy;
DstData = (PCHAR)((ULONG_PTR)DstData + BytesToCopy);
Length -= BytesToCopy;
if (Length == 0)
break;
SrcSize -= BytesToCopy;
if (SrcSize == 0) {
/* No more bytes in source buffer. Proceed to
the next buffer in the source buffer chain */
NdisGetNextBuffer(SrcBuffer, &SrcBuffer);
if (!SrcBuffer)
break;
NdisQueryBuffer(SrcBuffer, (PVOID)&SrcData, &SrcSize);
}
}
return BytesCopied;
}
示例8: RouterRemoveRoute
NTSTATUS RouterRemoveRoute(PIP_ADDRESS Target, PIP_ADDRESS Router)
/*
* FUNCTION: Removes a route from the Forward Information Base (FIB)
* ARGUMENTS:
* Target: The machine or network targeted by the route
* Router: The router used to pass the packet to the destination
*
* Searches the FIB and removes a route matching the indicated parameters.
*/
{
KIRQL OldIrql;
PLIST_ENTRY CurrentEntry;
PLIST_ENTRY NextEntry;
PFIB_ENTRY Current;
BOOLEAN Found = FALSE;
PNEIGHBOR_CACHE_ENTRY NCE;
TI_DbgPrint(DEBUG_ROUTER, ("Called\n"));
TI_DbgPrint(DEBUG_ROUTER, ("Deleting Route From: %s\n", A2S(Router)));
TI_DbgPrint(DEBUG_ROUTER, (" To: %s\n", A2S(Target)));
TcpipAcquireSpinLock(&FIBLock, &OldIrql);
RouterDumpRoutes();
CurrentEntry = FIBListHead.Flink;
while (CurrentEntry != &FIBListHead) {
NextEntry = CurrentEntry->Flink;
Current = CONTAINING_RECORD(CurrentEntry, FIB_ENTRY, ListEntry);
NCE = Current->Router;
if( AddrIsEqual( &Current->NetworkAddress, Target ) &&
AddrIsEqual( &NCE->Address, Router ) ) {
Found = TRUE;
break;
}
Current = NULL;
CurrentEntry = NextEntry;
}
if( Found ) {
TI_DbgPrint(DEBUG_ROUTER, ("Deleting route\n"));
DestroyFIBE( Current );
}
RouterDumpRoutes();
TcpipReleaseSpinLock(&FIBLock, OldIrql);
TI_DbgPrint(DEBUG_ROUTER, ("Leaving\n"));
return Found ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL;
}
示例9: NBCompleteSend
VOID NBCompleteSend( PVOID Context,
PNDIS_PACKET NdisPacket,
NDIS_STATUS Status ) {
PNEIGHBOR_PACKET Packet = (PNEIGHBOR_PACKET)Context;
TI_DbgPrint(MID_TRACE, ("Called\n"));
ASSERT_KM_POINTER(Packet);
ASSERT_KM_POINTER(Packet->Complete);
Packet->Complete( Packet->Context, Packet->Packet, Status );
TI_DbgPrint(MID_TRACE, ("Completed\n"));
ExFreePoolWithTag( Packet, NEIGHBOR_PACKET_TAG );
TI_DbgPrint(MID_TRACE, ("Freed\n"));
}
示例10: TI_DbgPrint
NTSTATUS TCPReceiveData
( PCONNECTION_ENDPOINT Connection,
PNDIS_BUFFER Buffer,
ULONG ReceiveLength,
PULONG BytesReceived,
ULONG ReceiveFlags,
PTCP_COMPLETION_ROUTINE Complete,
PVOID Context )
{
PTDI_BUCKET Bucket;
PUCHAR DataBuffer;
UINT DataLen, Received;
NTSTATUS Status;
TI_DbgPrint(DEBUG_TCP,("[IP, TCPReceiveData] Called for %d bytes (on socket %x)\n",
ReceiveLength, Connection->SocketContext));
NdisQueryBuffer(Buffer, &DataBuffer, &DataLen);
Status = LibTCPGetDataFromConnectionQueue(Connection, DataBuffer, DataLen, &Received);
if (Status == STATUS_PENDING)
{
Bucket = ExAllocateFromNPagedLookasideList(&TdiBucketLookasideList);
if (!Bucket)
{
TI_DbgPrint(DEBUG_TCP,("[IP, TCPReceiveData] Failed to allocate bucket\n"));
return STATUS_NO_MEMORY;
}
Bucket->Request.RequestNotifyObject = Complete;
Bucket->Request.RequestContext = Context;
ExInterlockedInsertTailList( &Connection->ReceiveRequest, &Bucket->Entry, &Connection->Lock );
TI_DbgPrint(DEBUG_TCP,("[IP, TCPReceiveData] Queued read irp\n"));
TI_DbgPrint(DEBUG_TCP,("[IP, TCPReceiveData] Leaving. Status = STATUS_PENDING\n"));
(*BytesReceived) = 0;
}
else
{
(*BytesReceived) = Received;
}
return Status;
}
示例11: RouterAddRoute
PFIB_ENTRY RouterAddRoute(
PIP_ADDRESS NetworkAddress,
PIP_ADDRESS Netmask,
PNEIGHBOR_CACHE_ENTRY Router,
UINT Metric)
/*
* FUNCTION: Adds a route to the Forward Information Base (FIB)
* ARGUMENTS:
* NetworkAddress = Pointer to address of network
* Netmask = Pointer to netmask of network
* Router = Pointer to NCE of router to use
* Metric = Cost of this route
* RETURNS:
* Pointer to FIB entry if the route was added, NULL if not
* NOTES:
* The FIB entry references the NetworkAddress, Netmask and
* the NCE of the router. The caller is responsible for providing
* these references
*/
{
PFIB_ENTRY FIBE;
TI_DbgPrint(DEBUG_ROUTER, ("Called. NetworkAddress (0x%X) Netmask (0x%X) "
"Router (0x%X) Metric (%d).\n", NetworkAddress, Netmask, Router, Metric));
TI_DbgPrint(DEBUG_ROUTER, ("NetworkAddress (%s) Netmask (%s) Router (%s).\n",
A2S(NetworkAddress),
A2S(Netmask),
A2S(&Router->Address)));
FIBE = ExAllocatePoolWithTag(NonPagedPool, sizeof(FIB_ENTRY), FIB_TAG);
if (!FIBE) {
TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
return NULL;
}
RtlCopyMemory( &FIBE->NetworkAddress, NetworkAddress,
sizeof(FIBE->NetworkAddress) );
RtlCopyMemory( &FIBE->Netmask, Netmask,
sizeof(FIBE->Netmask) );
FIBE->Router = Router;
FIBE->Metric = Metric;
/* Add FIB to the forward information base */
TcpipInterlockedInsertTailList(&FIBListHead, &FIBE->ListEntry, &FIBLock);
return FIBE;
}
示例12: AdjustPacket
PVOID AdjustPacket(
PNDIS_PACKET Packet,
UINT Available,
UINT Needed)
/*
* FUNCTION: Adjusts the amount of unused space at the beginning of the packet
* ARGUMENTS:
* Packet = Pointer to packet
* Available = Number of bytes available at start of first buffer
* Needed = Number of bytes needed for the header
* RETURNS:
* Pointer to start of packet
*/
{
PNDIS_BUFFER NdisBuffer;
INT Adjust;
TI_DbgPrint(DEBUG_PBUFFER, ("Available = %d, Needed = %d.\n", Available, Needed));
Adjust = Available - Needed;
NdisQueryPacket(Packet, NULL, NULL, &NdisBuffer, NULL);
/* If Adjust is zero there is no need to adjust this packet as
there is no additional space at start the of first buffer */
if (Adjust != 0) {
NdisBuffer->MappedSystemVa = (PVOID) ((ULONG_PTR)(NdisBuffer->MappedSystemVa) + Adjust);
NdisBuffer->ByteOffset += Adjust;
NdisBuffer->ByteCount -= Adjust;
}
return NdisBuffer->MappedSystemVa;
}
示例13: NBFlushPacketQueue
/* Must be called with table lock acquired */
VOID NBFlushPacketQueue( PNEIGHBOR_CACHE_ENTRY NCE,
NTSTATUS ErrorCode ) {
PLIST_ENTRY PacketEntry;
PNEIGHBOR_PACKET Packet;
while( !IsListEmpty(&NCE->PacketQueue) ) {
PacketEntry = RemoveHeadList(&NCE->PacketQueue);
Packet = CONTAINING_RECORD
( PacketEntry, NEIGHBOR_PACKET, Next );
ASSERT_KM_POINTER(Packet);
TI_DbgPrint
(MID_TRACE,
("PacketEntry: %x, NdisPacket %x\n",
PacketEntry, Packet->Packet));
ASSERT_KM_POINTER(Packet->Complete);
Packet->Complete( Packet->Context,
Packet->Packet,
ErrorCode );
ExFreePoolWithTag( Packet, NEIGHBOR_PACKET_TAG );
}
}
示例14: NBResetNeighborTimeout
VOID
NBResetNeighborTimeout(PIP_ADDRESS Address)
{
KIRQL OldIrql;
UINT HashValue;
PNEIGHBOR_CACHE_ENTRY NCE;
TI_DbgPrint(DEBUG_NCACHE, ("Resetting NCE timout for 0x%s\n", A2S(Address)));
HashValue = *(PULONG)(&Address->Address);
HashValue ^= HashValue >> 16;
HashValue ^= HashValue >> 8;
HashValue ^= HashValue >> 4;
HashValue &= NB_HASHMASK;
TcpipAcquireSpinLock(&NeighborCache[HashValue].Lock, &OldIrql);
for (NCE = NeighborCache[HashValue].Cache;
NCE != NULL;
NCE = NCE->Next)
{
if (AddrIsEqual(Address, &NCE->Address))
{
NCE->EventCount = 0;
break;
}
}
TcpipReleaseSpinLock(&NeighborCache[HashValue].Lock, OldIrql);
}
示例15: NBSendPackets
VOID NBSendPackets( PNEIGHBOR_CACHE_ENTRY NCE ) {
PLIST_ENTRY PacketEntry;
PNEIGHBOR_PACKET Packet;
UINT HashValue;
ASSERT(!(NCE->State & NUD_INCOMPLETE));
HashValue = *(PULONG)(&NCE->Address.Address);
HashValue ^= HashValue >> 16;
HashValue ^= HashValue >> 8;
HashValue ^= HashValue >> 4;
HashValue &= NB_HASHMASK;
/* Send any waiting packets */
while ((PacketEntry = ExInterlockedRemoveHeadList(&NCE->PacketQueue,
&NeighborCache[HashValue].Lock)) != NULL)
{
Packet = CONTAINING_RECORD( PacketEntry, NEIGHBOR_PACKET, Next );
TI_DbgPrint
(MID_TRACE,
("PacketEntry: %x, NdisPacket %x\n",
PacketEntry, Packet->Packet));
PC(Packet->Packet)->DLComplete = NBCompleteSend;
PC(Packet->Packet)->Context = Packet;
NCE->Interface->Transmit
( NCE->Interface->Context,
Packet->Packet,
0,
NCE->LinkAddress,
LAN_PROTO_IPv4 );
}
}