⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vdevadap.h

📁 驱动设计文档
💻 H
字号:
//////////////////////////////////////////////////////////////////////
// VdevAdap.h: interface for the VdevAdapter class.
//=============================================================================
//
// Compuware Corporation
// NuMega Lab
// 9 Townsend West
// Nashua, NH 03060  USA
//
// Copyright (c) 2001 Compuware Corporation. All Rights Reserved.
// Unpublished - rights reserved under the Copyright laws of the
// United States.
//
//=============================================================================
//
// Generated by DriverNetworks Wizard on Wednesday, July 19, 2000
//

#if !defined(AFX_VDEVADAP_H__8534F9A9_27F5_11D3_8F9E_00C04F7445B7__INCLUDED_)
#define AFX_VDEVADAP_H__8534F9A9_27F5_11D3_8F9E_00C04F7445B7__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include	<kndis.h>
#include	"Characteristics.h" 
	

#include <kndisvdw.h>	  // DriverWorks NDIS WDM	


// TODO:	Include your .h files as needed

///////////////////////////////////////////////////////////////////////
// VdevAdapter		
//
// This class defines member methods which are passed control on
// NDIS callbacks. 
//
// The instances of the class are created automatically
// by KNDIS framework. The class expose no public methods
// since its methods are called only from the "friendly"
// KNdisWrapper class.
//
class VdevAdapter : public KNdisMiniAdapter  
{
	SAFE_DESTRUCTORS
public:
	VdevAdapter();

protected:
	~VdevAdapter();

	NDIS_STATUS TransferData(
		OUT PNDIS_PACKET			Packet,
		OUT PUINT					BytesTransferred,
		IN  PVOID					Lookahead, /* MiniportReceiveContext */
		IN	UINT					ByteOffset,
		IN	UINT					BytesToTransfer);	

	// These methods MUST be implemented:
	NDIS_STATUS Initialize(IN OUT KNdisMedium& Medium, IN KNdisConfig& Config);
    VOID Halt(VOID);
    NDIS_STATUS Reset(OUT PBOOLEAN AddressingReset);

	// Optional handlers in accord with the content of Characteristics.h file.
	// The handlers are called from the following "friendly" class:
	friend class KNdisWrapper<VdevAdapter>;

	// sending packets
    NDIS_STATUS Send(IN	PNDIS_PACKET Packet, IN	UINT Flags);

	// checking for bad things
    BOOLEAN CheckForHang();
		
	// recliaming packets
	VOID ReturnPacket(IN PNDIS_PACKET Packet);

	// processing shutdown
	VOID Shutdown(VOID);

	// OID processing (via OID_MAP)
	NDIS_STATUS QueryInformation(
			IN	NDIS_OID				Oid,
			IN	PVOID					InformationBuffer,
			IN	ULONG					InformationBufferLength,
			OUT PULONG					BytesWritten,
			OUT PULONG					BytesNeeded
			);
	NDIS_STATUS SetInformation(
			IN	NDIS_OID				Oid,
			IN	PVOID					InformationBuffer,
			IN	ULONG					InformationBufferLength,
			OUT PULONG					BytesRead,
			OUT PULONG					BytesNeeded
			);

	// Standard OID hanlders. This should be included in every adapter class declaration.
	#include	<KNdisOidDefs.h>

	// A list of supported OIDs. 
	static NDIS_OID sm_OID_GEN_SUPPORTED_LIST[];


private:
	// Your custom data member go in here

	ETHERNET_ADDRESS	m_CurrentAddress;
	ETHERNET_ADDRESS	m_PermanentAddress;

	// NDIS_PACKET_TYPE_xxx bit set 
	ULONG			m_uPacketFilter;

	// NDIS_MAC_OPTION_xxx bit set
	ULONG			m_uMacOptions;
		
	// Queue of "pending" Tx packets. Serialized miniports might use
	// this queue to keep track of "pending" packets. Deserialized miniports 
	// have to maintain  an internal queue to cope with low resource situations
	// since NDIS doesn't take care of that in this case.
	KNdisPacketList	m_TxQueue;

	// Statistics. Included are the statistics defined by NDIS statistics OIDs

	KNdisStatsGen						m_GenStats;		// Mandatory GENeral stats
	// KNdisStatsGenEx					m_GenStats;		// Optional GENeral stats
	KNdisStatsEx<VDEV_MEDIUM_TYPE>	m_MediumStats;	// Medium-specific stats

	// Power Management State
#if KNDIS_PNP_AWARE
	KNdisPnpMode<VdevAdapter>		m_Power;
#endif

	// TODO: Add Low-level control for your "NIC"
	


	// i/o
	NDIS_HANDLE		m_DeviceHandle;
	PDEVICE_OBJECT  m_pDeviceObject;

	static NTSTATUS IoDispatch (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);

	static NTSTATUS IoRead (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);

	static NTSTATUS IoCreate (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);
	
	static NTSTATUS IoClose (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);

	static NTSTATUS IoCleanup(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);

	static NTSTATUS IoWrite(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);
};



#endif // !defined(AFX_VDEVADAP_H__8534F9A9_27F5_11D3_8F9E_00C04F7445B7__INCLUDED_)
 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -