Changeset 33540 in vbox for trunk/src/VBox/HostDrivers/VBoxNetFlt/win
- Timestamp:
- Oct 28, 2010 9:27:05 AM (14 years ago)
- Location:
- trunk/src/VBox/HostDrivers/VBoxNetFlt/win
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/NetFltInstall.cpp
r28800 r33540 32 32 } 33 33 34 /** Wrapper aroun gGetfullPathNameW that will try an alternative INF location.34 /** Wrapper around GetfullPathNameW that will try an alternative INF location. 35 35 * 36 36 * The default location is the current directory. If not found there, the 37 * alternative locat oin is the executable directory. If not found there either,37 * alternative location is the executable directory. If not found there either, 38 38 * the first alternative is present to the caller. 39 39 */ -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFlt-win.c
r30007 r33540 41 41 42 42 /** 43 * represents the queue of jobs processed by the worker thre d43 * represents the queue of jobs processed by the worker thread 44 44 * 45 45 * we use the thread to process tasks which are required to be done at passive level … … 508 508 if (pMyPacket) 509 509 { 510 /* we have successful y initialized our packet, post it to the host or to the wire */510 /* we have successfully initialized our packet, post it to the host or to the wire */ 511 511 if(bSrcHost) 512 512 { … … 601 601 * Besides that the NDIS_PACKET contained in the queue could be either the one passed to us in our send/receive callback 602 602 * or the one created by us. The latter is possible in case our ProtocolReceive callback is called and we call NdisTransferData 603 * in this case we need to allocate the packet the data to be transfer ed to.603 * in this case we need to allocate the packet the data to be transferred to. 604 604 * If the enqueued packet is the one allocated by us the PACKET_MINE flag is set 605 605 * */ … … 1826 1826 1827 1827 /* 1828 * frees NDIS_PACKET crea ed with vboxNetFltWinNdisPacketFromSG1828 * frees NDIS_PACKET created with vboxNetFltWinNdisPacketFromSG 1829 1829 */ 1830 1830 DECLHIDDEN(void) vboxNetFltWinFreeSGNdisPacket(PNDIS_PACKET pPacket, bool bFreeMem) … … 2157 2157 int rc; 2158 2158 PVBOXNETFLTINS pInstance; 2159 USHORT cbAnsiName = pBindToMiniportName->Length;/* the leng htis is bytes ; *2 ;RtlUnicodeStringToAnsiSize(pBindToMiniportName)*/2159 USHORT cbAnsiName = pBindToMiniportName->Length;/* the length is is bytes ; *2 ;RtlUnicodeStringToAnsiSize(pBindToMiniportName)*/ 2160 2160 CREATE_INSTANCE_CONTEXT Context; 2161 2161 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; … … 2987 2987 } 2988 2988 2989 /* it's inter upted */2989 /* it's interrupted */ 2990 2990 rc = VERR_INTERRUPTED; 2991 2991 } … … 3111 3111 /* Assert(!pThis->fActive); */ 3112 3112 3113 /* parano ya to ensyre the instance is not removed while we're waiting on the mutex3113 /* paranoia to ensyre the instance is not removed while we're waiting on the mutex 3114 3114 * in case ndis does something unpredictable, e.g. calls our miniport halt independently 3115 3115 * from protocol unbind and concurrently with it*/ … … 3148 3148 Assert(vboxNetFltWinGetOpState(&pAdapt->PTState) == kVBoxNetDevOpState_Deinitialized); 3149 3149 #endif 3150 // /* parano ya */3150 // /* paranoia */ 3151 3151 // vboxNetFltWinSetOpState(&pAdapt->MPState, kVBoxNetDevOpState_Deinitialized); 3152 3152 //#ifndef VBOXNETADP … … 3317 3317 Assert(vboxNetFltWinGetOpState(&pAdapt->PTState) == kVBoxNetDevOpState_Initialized); 3318 3318 #endif 3319 // /* parano ya */3319 // /* paranoia */ 3320 3320 //// vboxNetFltWinSetAdaptState(&pAdapt->MPState, kVBoxNetDevOpState_Initialized); 3321 3321 //#ifndef VBOXNETADP … … 3364 3364 Assert(vboxNetFltWinGetOpState(&pAdapt->PTState) == kVBoxNetDevOpState_Deinitialized); 3365 3365 #endif 3366 // /* parano ya */3366 // /* paranoia */ 3367 3367 // vboxNetFltWinSetOpState(&pAdapt->MPState, kVBoxNetDevOpState_Deinitialized); 3368 3368 //#ifndef VBOXNETADP -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFlt-win.h
r30111 r33540 898 898 899 899 /* convenience method used which allocates and initializes the PINTNETSG containing one 900 * segment refer ing the buffer of size cbBufSize900 * segment referring the buffer of size cbBufSize 901 901 * the allocated PINTNETSG should be freed with the vboxNetFltWinMemFree. 902 902 * … … 1004 1004 1005 1005 /************************************************************** 1006 * utility metho fs for ndis packet creation/initialization *1006 * utility methods for ndis packet creation/initialization * 1007 1007 **************************************************************/ 1008 1008 -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFltCommon-win.h
r32338 r33540 1 1 /* $Id$ */ 2 2 /** @file 3 * VBoxNetFltCommon.h - Network Filter Driver (Host), Windows Specific Code. Common heade er with commonly used defines and decls3 * VBoxNetFltCommon.h - Network Filter Driver (Host), Windows Specific Code. Common header with commonly used defines and decls 4 4 */ 5 5 … … 182 182 * i.e. we could use it on our needs and should not return it 183 183 * we are enqueueing "our" packets on ProtocolReceive call-back when 184 * Ndis does not give us a receive acket (the driver below us has called NdisM..IndicateReceive)184 * Ndis does not give us a receive packet (the driver below us has called NdisM..IndicateReceive) 185 185 * this is supported for Ndis Packet only */ 186 186 #define PACKET_MINE 0x00000004 … … 212 212 /* 213 213 * we are using non-interlocked versions of LIST_ENTRY-related operations macros and synchronize 214 * access to the queue and its elements by a quiring/releasing a spinlock using Ndis[Acquire,Release]Spinlock214 * access to the queue and its elements by acquiring/releasing a spinlock using Ndis[Acquire,Release]Spinlock 215 215 * 216 216 * we are NOT using interlocked versions of insert/remove head/tail list functions because we need to iterate though … … 395 395 NDIS_HANDLE hSendBufferPoolHandle; 396 396 /** open/close adapter status. 397 * Since ndis adapter open and close requests may complete as synchronously,397 * Since ndis adapter open and close requests may complete asynchronously, 398 398 * we are using event mechanism to wait for open/close completion 399 399 * the status field is being set by the completion call-back */ … … 443 443 } SEND_RSVD, *PSEND_RSVD; 444 444 445 /** represents the data stored in the protocol re cerved field of ndis packet on NdisTransferData processing*/445 /** represents the data stored in the protocol reserved field of ndis packet on NdisTransferData processing*/ 446 446 typedef struct _TRANSFERDATA_RSVD 447 447 { -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFltMp-win.c
r29592 r33540 210 210 #ifdef VBOXNETFLT_WITH_IOCTL_SECURITY 211 211 /* NdisMRegisterDevice does not offers us the ability to set security attributes */ 212 /* need to do this "manual y" for the device to be accessible by the non-privileged users */212 /* need to do this "manually" for the device to be accessible by the non-privileged users */ 213 213 Status = vboxNetFltWinSetSecurity(&DeviceLinkUnicodeString); 214 214 Assert(Status == STATUS_SUCCESS); … … 347 347 348 348 Assert(vboxNetFltWinGetOpState(&pAdapt->MPState) == kVBoxNetDevOpState_Initializing); 349 /* the MP state should be already set to kVBoxNetDevOpState_Initializing, just a parano ya350 * in case NDIS for some reason calls us in some unregular way */349 /* the MP state should be already set to kVBoxNetDevOpState_Initializing, just a paranoia 350 * in case NDIS for some reason calls us in some irregular way */ 351 351 vboxNetFltWinSetOpState(&pAdapt->MPState, kVBoxNetDevOpState_Initializing); 352 352 … … 496 496 /* 497 497 * Set the flag that the miniport below is unbinding, so the request handlers will 498 * fail any request com ming later498 * fail any request coming later 499 499 */ 500 500 RTSpinlockAcquireNoInts(pNetFlt->hSpinlock, &Tmp); … … 1151 1151 1152 1152 /** 1153 * This routine does all the proc ssing for a request with a SetPower Oid1153 * This routine does all the processing for a request with a SetPower Oid 1154 1154 * The miniport shoud accept the Set Power and transition to the new state 1155 1155 * … … 1616 1616 case OID_GEN_MEDIA_IN_USE: 1617 1617 // 1618 // Specif iy a complete list of the media types that the NIC1618 // Specify a complete list of the media types that the NIC 1619 1619 // currently uses. 1620 1620 // … … 1650 1650 case OID_GEN_MAXIMUM_FRAME_SIZE: 1651 1651 // 1652 // Specif iy the maximum network packet size, in bytes, that the1652 // Specify the maximum network packet size, in bytes, that the 1653 1653 // NIC supports excluding the header. A NIC driver that emulates 1654 1654 // another medium type for binding to a transport must ensure that … … 1837 1837 case OID_GEN_CURRENT_PACKET_FILTER: 1838 1838 // 1839 // Specif iy the types of net packets such as directed, broadcast1839 // Specify the types of net packets such as directed, broadcast 1840 1840 // multicast, for which a protocol receives indications from a 1841 1841 // NIC driver. After NIC is initialized, a protocol driver … … 1895 1895 // Return the MAC address the NIC is currently programmed to 1896 1896 // use. Note that this address could be different from the 1897 // perman anent address as the user can override using1897 // permanent address as the user can override using 1898 1898 // registry. Read NdisReadNetworkAddress doc for more info. 1899 1899 // … … 2129 2129 2130 2130 // 2131 // Program the hardware to add sup ort for these muticast addresses2131 // Program the hardware to add support for these multicast addresses 2132 2132 // 2133 2133 -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFltPt-win.c
r32338 r33540 28 28 /** protocol handle */ 29 29 static NDIS_HANDLE g_hProtHandle = NULL; 30 /** medium array used while opening underlying adap rot30 /** medium array used while opening underlying adaptor 31 31 * we are actually binding to NdisMedium802_3 and NdisMediumWan 32 32 * as specified in VBoxNetFlt.inf: … … 161 161 * @param DeviceName - Device name to bind to. This is passed to NdisOpenAdapter. 162 162 * @param SystemSpecific1 - Can be passed to NdisOpenProtocolConfiguration to read per-binding information 163 * @para nSystemSpecific2 - Unused163 * @param SystemSpecific2 - Unused 164 164 * @return NDIS_STATUS_PENDING if this call is pended. In this case call NdisCompleteBindAdapter to complete. 165 165 * Anything else Completes this call synchronously */ … … 297 297 /* 298 298 * Set the flag that the miniport below is unbinding, so the request handlers will 299 * fail any request com ming later299 * fail any request coming later 300 300 */ 301 301 RTSpinlockAcquireNoInts(pNetFlt->hSpinlock, &Tmp); … … 513 513 if(pSynchRequest == NdisRequest) 514 514 { 515 /* as synchronous completion of our synchrequest */515 /* asynchronous completion of our sync request */ 516 516 517 517 /*1.set the status */ … … 789 789 #endif 790 790 { 791 /* if the ptk is zer ro - the ptk was originated by netFlt send/receive791 /* if the ptk is zero - the ptk was originated by netFlt send/receive 792 792 * need to free packet buffers */ 793 793 PVOID pBufToFree = SendRsvd->pBufToFree; … … 856 856 857 857 /* 858 * pAdapt->Rece viePacketCount must be less than MAX_RECEIVE_PACKET_ARRAY_SIZE because858 * pAdapt->ReceivePacketCount must be less than MAX_RECEIVE_PACKET_ARRAY_SIZE because 859 859 * the thread which held the pVElan->Lock before should already indicate the packet(s) 860 * up if pAdapt->Rece viePacketCount == MAX_RECEIVE_PACKET_ARRAY_SIZE.860 * up if pAdapt->ReceivePacketCount == MAX_RECEIVE_PACKET_ARRAY_SIZE. 861 861 */ 862 862 pAdapt->aReceivedPackets[pAdapt->cReceivedPacketCount] = Packet; … … 875 875 /* 876 876 * If our receive packet array is full, or the miniport below indicated the packets 877 * with resources, do the indicatin now.877 * with resources, do the indicating now. 878 878 */ 879 879 … … 905 905 { 906 906 /* the tcp stack can send ACK packets right in the context of its PtReceive for this packet, 907 * and tho ose (tcp-sent) packets can be looped back again.907 * and those (tcp-sent) packets can be looped back again. 908 908 * If this happens there is a possibility that new RX packets are received by us 909 909 * after we do this NdisMIndicateReceivePacket and before we do a new NdisMIndicateReceivePacket -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/WinNetConfig.cpp
r28800 r33540 1469 1469 * @param pencbp Binding path enumerator reference. 1470 1470 * @param ppncbp Address the Binding path reference to be stored to 1471 * @return S_OK on suc ess, otherwise an error code.1471 * @return S_OK on success, otherwise an error code. 1472 1472 */ 1473 1473 VBOXNETCFGWIN_DECL(HRESULT) … … 2591 2591 /* if the function failed and GetLastError() returned 2592 2592 * ERROR_NO_MORE_ITEMS, then we have reached the end of the 2593 * list. Othe wise there was something wrong with this2593 * list. Otherwise there was something wrong with this 2594 2594 * particular driver. */ 2595 2595 if (!ret)
Note:
See TracChangeset
for help on using the changeset viewer.