As I read win2k DDK document, NDIS_WAN_LINE_UP structure has some usefull information
for my dirver. The structure is define as :
typedef struct _NDIS_WAN_LINE_UP {
IN ULONG LinkSpeed;
IN ULONG MaximumTotalSize;
IN NDIS_WAN_QUALITY Quality;
IN USHORT SendWindow;
IN UCHAR RemoteAddress[6];
IN OUT UCHAR LocalAddress[6];
IN ULONG ProtocolBufferLength;
IN PUCHAR ProtocolBuffer;
IN USHORT ProtocolType;
IN OUT NDIS_STRING DeviceName;
} NDIS_WAN_LINE_UP, *PNDIS_WAN_LINE_UP;
DDK said that ProtocolBuffer contains protocol-specific information supplied
by a higher-level component that makes connections through NDISWAN to
the appropriate protocol(s). For example, this buffer would contain an IP address
if the target protocol is IP . And I debug my driver, I found that ProtocolBufferLength always equals
to 28 bytes. How can I get IP address from ProtocolBuffer?
Thanks.
VOID
PtStatus(
IN NDIS_HANDLE ProtocolBindingContext,
IN NDIS_STATUS GeneralStatus,
IN PVOID StatusBuffer,
IN UINT StatusBufferSize
)
{
PADAPT pAdapt =(PADAPT)ProtocolBindingContext;
PNDIS_WAN_LINE_UP waninfo;
char temp[100];
//
// If we get a status indication before our miniport is initialized, ignore it
// If the SampleIM is not ON, we do not pass on the status indication
//
if(pAdapt->MiniportHandle != NULL &&
pAdapt->MPDeviceState == NdisDeviceStateD0 &&
pAdapt->PTDeviceState == NdisDeviceStateD0 )
{
NdisMIndicateStatus(pAdapt->MiniportHandle,
GeneralStatus,
StatusBuffer,
StatusBufferSize);
if (GeneralStatus == NDIS_STATUS_WAN_LINE_UP)
{
waninfo = (PNDIS_WAN_LINE_UP)StatusBuffer;
}
}
}
return;
}
yours brucie
brucie@263.net
(???r??z{e?˛???m?m?{]z???&j)@u?Ӣ?칻?&ޱ??i?Z?G?j)m?W???u?칻-E?"?Ǧm??(Z?X???,??&