亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? isaintdevice.cpp

?? 數據采集卡(ISA)驅動程序源代碼
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
// ISAINTDevice.cpp
// Implementation of ISAINTDevice device class
//
// Generated by DriverWizard version DriverStudio 3.0.0 (Build 1126)
// Requires Compuware's DriverWorks classes
//

#pragma warning(disable:4065) // Allow switch statement with no cases
		  
#include <vdw.h>

#include "ISAINT.h"
#include "ISAINTDevice.h"
#include "..\ISAINTioctl.h"

#pragma hdrstop("ISAINT.pch")

////////////////////////////////////////////////////////////////////////
//  ISAINTDevice::ISAINTDevice
//
//	Routine Description:
//		This is the constructor for the Functional Device Object, or FDO.
//		It is derived from KPnpDevice, which builds in automatic
//	    dispatching of subfunctions of IRP_MJ_POWER and IRP_MJ_PNP to
//		virtual member functions.
//
//	Parameters:
//		Pdo - Physical Device Object - this is a pointer to a system
//			device object that represents the physical device.
//
//		Unit - Unit number. This is a number to append to the device's
//			base device name to form the Logical Device Object's name
//
//	Return Value:
//		None   
//
//	Comments:
//		The object being constructed contains a data member (m_Lower) of type
//		KPnpLowerDevice. By initializing it, the driver binds the FDO to the
//		PDO and creates an interface to the upper edge of the system class driver.
//
ISAINTDevice::ISAINTDevice(PDEVICE_OBJECT Pdo, ULONG Unit) :
	KPnpDevice(Pdo, NULL)
{

	// Check constructor status
    if ( ! NT_SUCCESS(m_ConstructorStatus) )
	{
	    return;
	}

	// Remember our unit number
	m_Unit = Unit;

	// Initialize the lower device
	m_Lower.Initialize(this, Pdo);

    // Inform the base class of the lower edge device object
	SetLowerDevice(&m_Lower);

	// Initialize the PnP Policy settings to the "standard" policy
	SetPnpPolicy();

// TODO:	Customize the PnP Policy for this device by setting
//			flags in m_Policies.

}


////////////////////////////////////////////////////////////////////////
//  ISAINTDevice::~ISAINTDevice
//
//	Routine Description:
//		This is the destructor for the Functional Device Object, or FDO.
//
//	Parameters:
//		None
//
//	Return Value:
//		None
//
//	Comments:
//		None
//

ISAINTDevice::~ISAINTDevice()
{
}



////////////////////////////////////////////////////////////////////////
//  ISAINTDevice::DefaultPnp
//
//	Routine Description:
//		Default handler for IRP_MJ_PNP
//
//	Parameters:
//		I - Current IRP
//
//	Return Value:
//		NTSTATUS - Result returned from lower device
//
//	Comments:
//		This routine just passes the IRP through to the lower device. It is 
//		the default handler for IRP_MJ_PNP. IRPs that correspond to
//		any virtual members of KpnpDevice that handle minor functions of
//		IRP_MJ_PNP and that are not overridden get passed to this routine.
//

NTSTATUS ISAINTDevice::DefaultPnp(KIrp I) 
{
	I.ForceReuseOfCurrentStackLocationInCalldown();
	return m_Lower.PnpCall(this, I);
}

////////////////////////////////////////////////////////////////////////
//  ISAINTDevice::DefaultPower
//
//	Routine Description:
//		Default handler for IRP_MJ_POWER 
//
//	Parameters:
//		I - Current IRP
//
//	Return Value:
//		NTSTATUS - Result returned from lower device
//
//	Comments:
//		This routine just passes the IRP through to the lower device. It is 
//		the default handler for IRP_MJ_POWER.
//

NTSTATUS ISAINTDevice::DefaultPower(KIrp I) 
{
	I.IndicatePowerIrpProcessed();
	I.CopyParametersDown();
	return m_Lower.PnpPowerCall(this, I);
}

////////////////////////////////////////////////////////////////////////////////
//  ISAINTDevice::SystemControl
//
//	Routine Description:
//		Default handler for IRP_MJ_SYSTEM_CONTROL
//
//	Parameters:
//		I - Current IRP
//
//	Return Value:
//		NTSTATUS - Result returned from lower device
//
//	Comments:
//		This routine just passes the IRP through to the next device since this driver
//		is not a WMI provider.
//

NTSTATUS ISAINTDevice::SystemControl(KIrp I) 
{
	I.ForceReuseOfCurrentStackLocationInCalldown();
	return m_Lower.PnpCall(this, I);
}


////////////////////////////////////////////////////////////////////////
//  ISAINTDevice::Invalidate
//
//	Routine Description:
//		Calls Invalidate methods for system resources
//
//	Parameters:
//		None
//
//	Return Value:
//		None
//
//	Comments:
//		This function is called from OnStopDevice, OnRemoveDevice and
//		OnStartDevice (in error conditions).  It calls the Invalidate
//		member funcitons for each resource to free the underlying system
//		resource if allocated.  It is safe to call Invalidate more than
//		once for a resource, or for an uninitialized resource.

VOID ISAINTDevice::Invalidate()
{



	// For each I/O port mapped region, release the underlying system resource.
	m_ISAControlPort.Invalidate();

	// For the interrupt, release the underlying system resource.
	m_Irq.Invalidate();
}


////////////////////////////////////////////////////////////////////////
//  ISAINTDevice::OnStartDevice
//
//	Routine Description:
//		Handler for IRP_MJ_PNP subfcn IRP_MN_START_DEVICE
//
//	Parameters:
//		I - Current IRP
//
//	Return Value:
//		NTSTATUS - Result code
//
//	Comments:
//		Initialize the physical device. Typically, the driver initializes
//		physical resources here.  Call I.AllocatedResources() for a list
//		of the raw resources that the system has assigned to the device,
//		or I.TranslatedResources() for the translated resource list.
//

NTSTATUS ISAINTDevice::OnStartDevice(KIrp I)
{
	NTSTATUS status = STATUS_SUCCESS;

	I.Information() = 0;

	// The default Pnp policy has already cleared the IRP with the lower device
	// Initialize the physical device object.

	// Get the list of raw resources from the IRP
	PCM_RESOURCE_LIST pResListRaw = I.AllocatedResources();
	// Get the list of translated resources from the IRP
	PCM_RESOURCE_LIST pResListTranslated = I.TranslatedResources();

	// For each I/O port mapped region, initialize the I/O port range using
	// the resources provided by NT. Once initialized, use member functions such as
	// inb/outb, or the array element operator to access the ports range.
	status = m_ISAControlPort.Initialize(
		pResListTranslated,
		pResListRaw,
		0
		);
	if (!NT_SUCCESS(status))
	{
		Invalidate();
		return status;		
	}

	// Initialize and connect the interrupt
	status = m_Irq.InitializeAndConnect(
		pResListTranslated, 
		LinkTo(Isr_Irq), 
		this
		);
	if (!NT_SUCCESS(status))
	{
		Invalidate();
		return status;		
	}

	// Setup the DPC to be used for interrupt processing
	m_DpcFor_Irq.Setup(LinkTo(DpcFor_Irq), this);

// TODO:	Add device-specific code to start your device.

    // The base class will handle completion

	return status;
}


////////////////////////////////////////////////////////////////////////
//  ISAINTDevice::OnStopDevice
//
//	Routine Description:
//		Handler for IRP_MJ_PNP subfcn IRP_MN_STOP_DEVICE
//
//	Parameters:
//		I - Current IRP
//
//	Return Value:
//		NTSTATUS - Result code
//
//	Comments:
//		The system calls this when the device is stopped.
//		The driver should release any hardware resources
//		in this routine.
//
//		The base class passes the irp to the lower device.
//

NTSTATUS ISAINTDevice::OnStopDevice(KIrp I)
{
	NTSTATUS status = STATUS_SUCCESS;

	// Device stopped, release the system resources.
	Invalidate();

// TODO:	Add device-specific code to stop your device   

	return status;
	
	// The following macro simply allows compilation at Warning Level 4
	// If you reference this parameter in the function simply remove the macro.
	UNREFERENCED_PARAMETER(I);
}

////////////////////////////////////////////////////////////////////////
//  ISAINTDevice::OnRemoveDevice
//
//	Routine Description:
//		Handler for IRP_MJ_PNP subfcn IRP_MN_REMOVE_DEVICE
//
//	Parameters:
//		I - Current IRP
//
//	Return Value:
//		NTSTATUS - Result code
//
//	Comments:
//		The system calls this when the device is removed.
//		Our PnP policy will take care of 
//			(1) giving the IRP to the lower device
//			(2) detaching the PDO
//			(3) deleting the device object
//

NTSTATUS ISAINTDevice::OnRemoveDevice(KIrp I)
{
	// Device removed, release the system resources.
	Invalidate();

// TODO:	Add device-specific code to remove your device   

	return STATUS_SUCCESS;

	// The following macro simply allows compilation at Warning Level 4
	// If you reference this parameter in the function simply remove the macro.
	UNREFERENCED_PARAMETER(I);
}

////////////////////////////////////////////////////////////////////////
//  ISAINTDevice::Create
//
//	Routine Description:
//		Handler for IRP_MJ_CREATE
//
//	Parameters:
//		I - Current IRP
//
//	Return Value:
//		NTSTATUS - Result code
//
//	Comments:
//

NTSTATUS ISAINTDevice::Create(KIrp I)
{
	NTSTATUS status;

// TODO: Add driver specific create handling code here

	// Generally a create IRP is targeted at our FDO, so we don't need
	// to pass it down to the PDO.  We have found for some devices, the
	// PDO is not expecting this Irp and returns an error code.
	// The default wizard code, therefore completes the Irp here using
	// PnpComplete().  The following commented code could be used instead
	// of PnpComplete() to pass the Irp to the PDO, which would complete it.
	//
//	I.ForceReuseOfCurrentStackLocationInCalldown();
//	status = m_Lower.PnpCall(this, I);

	status = I.PnpComplete(this, STATUS_SUCCESS, IO_NO_INCREMENT);

	return status;
}

////////////////////////////////////////////////////////////////////////
//  ISAINTDevice::Close
//
//	Routine Description:
//		Handler for IRP_MJ_CLOSE
//
//	Parameters:
//		I - Current IRP
//
//	Return Value:
//		NTSTATUS - Result code
//
//	Comments:
//

NTSTATUS ISAINTDevice::Close(KIrp I)
{
	NTSTATUS status;

// TODO: Add driver specific close handling code here

	// Generally a close IRP is targeted at our FDO, so we don't need
	// to pass it down to the PDO.  We have found for some devices, the
	// PDO is not expecting this Irp and returns an error code.
	// The default wizard code, therefore completes the Irp here using
	// PnpComplete().  The following commented code could be used instead
	// of PnpComplete() to pass the Irp to the PDO, which would complete it.
	//
//	I.ForceReuseOfCurrentStackLocationInCalldown();
//	status = m_Lower.PnpCall(this, I);

	status = I.PnpComplete(this, STATUS_SUCCESS, IO_NO_INCREMENT);

    return status;
}

////////////////////////////////////////////////////////////////////////
//  ISAINTDevice::Cleanup
//
//	Routine Description:
//		Handler for IRP_MJ_CLEANUP	
//
//	Parameters:
//		I - Current IRP
//
//	Return Value:
//		NTSTATUS - Result code
//
//	Comments:
//

NTSTATUS ISAINTDevice::CleanUp(KIrp I)
{
// TODO:	Insert your code to respond to the CLEANUP message.
//			This code cleans up the single Wizard created queue.  If you
//			have created additional queues,	or have any outstanding Irps
//			stored in some other fashion in your driver, you should clean
//			these up as well for the file object specified in the cleanup Irp.

	m_DriverManagedQueue.PnpCleanUp(this, I.FileObject());
	return I.PnpComplete(this, STATUS_SUCCESS);
}

////////////////////////////////////////////////////////////////////////
//  ISAINTDevice::SerialRead
//	
//	Routine Description:
//		Handler for serialized READ
//
//	Parameters:
//		I - Current IRP
//
//	Return Value:
//		None
//
//	Comments:
//		This routine is called when the IRP is removed from the
//		STARTIO queue.  This guarantees that multiple requests are
//		never processed simultaneously.
//
//		This routine is called at dispatch level.
//

void ISAINTDevice::SerialRead(KIrp I)
{
	NTSTATUS status		= STATUS_SUCCESS;

	PUCHAR	pBuffer		= (PUCHAR) I.BufferedReadDest();

	ULONG   dwTotalSize = I.ReadSize(CURRENT);	// Requested read size
	ULONG   dwBytesRead = 0;					// Count of bytes read

// TODO:	If the read can be satisfied immediately, set the Information
//			and Status fields now, then call NextIrp to complete this IRP
//			and start processing the next IRP in the queue.

// TODO:	If the data is not yet available, initiate a request to the
//			physical device here, and defer the Information, Status,
//			and NextIrp handling until the hardware indicates that the
//			read is complete.  Typically, this might be handled in a
//			DPC that is called after the hardware finishes transferring
//			the data.

// TODO:	To satisfy the read now, transfer data from the device to
//			caller's buffer at "pBuffer".  Then, indicate how much data was
//			transferred:

	I.Information() = dwBytesRead;

	I.Status() = status;


	// PnpNextIrp completes this IRP and starts processing 
	// for the next IRP in the driver managed queue.
// TODO:	The Wizard creates a single queue for all Irps.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美一区二区三区久本道91 | 国产91露脸合集magnet| 波多野结衣视频一区| 欧美一区二区三区精品| 国产精品久线在线观看| 精品一区二区三区av| 欧洲一区二区三区在线| 国产精品色噜噜| 激情偷乱视频一区二区三区| 欧美日韩中文精品| 17c精品麻豆一区二区免费| 久久精品国产亚洲5555| 欧美三级在线看| 综合久久国产九一剧情麻豆| 国产精品亚洲а∨天堂免在线| 91精品在线观看入口| 亚洲色图欧洲色图| 成人国产一区二区三区精品| 国产偷国产偷亚洲高清人白洁 | 国产suv精品一区二区三区| 777午夜精品免费视频| 一区二区三区91| 色综合一区二区| 亚洲同性同志一二三专区| 高清不卡一二三区| 国产亚洲一二三区| 精品一区二区综合| 精品国产91乱码一区二区三区| 午夜精品久久久久影视| 91福利精品第一导航| 亚洲免费观看在线视频| eeuss鲁片一区二区三区| 中文在线一区二区| 成人av影院在线| 综合久久久久久| 色综合天天综合狠狠| 1024亚洲合集| 欧美日韩视频一区二区| 午夜不卡av在线| 宅男在线国产精品| 日本va欧美va欧美va精品| 日韩一级视频免费观看在线| 免费人成网站在线观看欧美高清| 欧美午夜电影网| 五月婷婷综合激情| 欧美sm美女调教| 国内精品久久久久影院一蜜桃| 久久久久久久久久电影| 成人精品免费网站| 亚洲精品一二三| 欧美日韩一区二区三区在线| 天堂va蜜桃一区二区三区| 日韩免费电影网站| 国产不卡视频一区| 亚洲一区在线观看网站| 欧美一区二区三级| 成人理论电影网| 亚洲va欧美va人人爽| 精品国产一区二区三区av性色| www.视频一区| 亚洲成人黄色影院| 欧美精品一区二区久久久| 99视频国产精品| 日韩国产在线一| 欧美经典三级视频一区二区三区| 91麻豆福利精品推荐| 欧美96一区二区免费视频| 中文字幕精品一区二区精品绿巨人| 欧洲生活片亚洲生活在线观看| 麻豆国产欧美日韩综合精品二区| 国产精品美女久久久久av爽李琼 | 成av人片一区二区| 午夜欧美在线一二页| 国产欧美久久久精品影院| 欧美日韩一区三区| 成人av综合一区| 另类专区欧美蜜桃臀第一页| 亚洲男人的天堂av| 久久久国产一区二区三区四区小说 | 91网址在线看| 美女任你摸久久| 亚洲影院理伦片| 国产精品久久久久久久蜜臀| 日韩一区二区三免费高清| 91视视频在线观看入口直接观看www| 久久成人综合网| 亚洲一区影音先锋| 亚洲视频网在线直播| 久久免费美女视频| 91精品国产色综合久久ai换脸 | 男人操女人的视频在线观看欧美| 国产精品毛片a∨一区二区三区| 正在播放亚洲一区| 欧美日韩免费不卡视频一区二区三区| 国产一区二区视频在线播放| 日韩国产欧美视频| 午夜av一区二区三区| 一区二区三区中文字幕在线观看| 国产情人综合久久777777| 精品久久久网站| 欧美一区二区三区不卡| 欧美日韩一级视频| 欧美系列一区二区| 日本韩国一区二区三区视频| 成人国产一区二区三区精品| 国产成人精品一区二区三区网站观看| 免费观看91视频大全| 亚洲成人激情自拍| 午夜日韩在线电影| 日韩精品国产精品| 免费成人在线视频观看| 秋霞影院一区二区| 久久精品国产999大香线蕉| 日本成人超碰在线观看| 免费看日韩精品| 蜜桃久久av一区| 免费高清视频精品| 国产在线播放一区| 成熟亚洲日本毛茸茸凸凹| 成人永久aaa| 99久久777色| 在线一区二区三区四区五区 | 成人免费av在线| 成人aaaa免费全部观看| 91理论电影在线观看| 欧美伊人久久久久久久久影院| 欧美亚洲一区二区三区四区| 欧美日韩免费视频| 日韩免费高清视频| 欧美国产激情二区三区| 亚洲视频一二区| 婷婷六月综合亚洲| 精品一区二区三区免费| 国产精品一二三四| 91视频一区二区三区| 欧美精选午夜久久久乱码6080| 欧美大片免费久久精品三p| 2020国产精品自拍| 亚洲图片你懂的| 七七婷婷婷婷精品国产| 国产·精品毛片| 欧美在线你懂的| 欧美成人精品福利| 亚洲欧美一区二区三区久本道91 | 岛国精品一区二区| 色综合久久中文综合久久97| 91精品国产欧美一区二区18| 久久久久久久久久久黄色| 亚洲免费观看高清完整版在线观看熊 | 亚洲欧美日韩精品久久久久| 亚洲成av人片一区二区梦乃| 久久成人麻豆午夜电影| 91啪九色porn原创视频在线观看| 欧美视频在线一区二区三区| 久久久久9999亚洲精品| 亚洲免费在线播放| 国产一区二区按摩在线观看| 在线观看精品一区| 日韩综合一区二区| 99综合影院在线| 日韩女优av电影| 亚洲人被黑人高潮完整版| 久久99国产精品久久| 色欧美乱欧美15图片| 久久久久久久久久久久电影| 午夜一区二区三区在线观看| 豆国产96在线|亚洲| 日韩一区二区三区av| 亚洲精品成人天堂一二三| 国产一区二区0| 欧美一区二区三区啪啪| 一区二区三区四区在线播放| 国产盗摄精品一区二区三区在线| 欧美日韩精品免费观看视频 | 水野朝阳av一区二区三区| 懂色一区二区三区免费观看| 91精品午夜视频| 亚洲自拍偷拍欧美| av中文字幕亚洲| 久久久www成人免费毛片麻豆| 日韩精品一区第一页| 在线看日韩精品电影| 国产精品美女www爽爽爽| 激情丁香综合五月| 欧美一区三区四区| 婷婷中文字幕一区三区| 欧洲精品在线观看| 亚洲乱码国产乱码精品精可以看| 国产成人小视频| 久久九九影视网| 国产一区在线看| 精品sm在线观看| 国内外精品视频| 2023国产精品| 国产成人精品免费视频网站| 26uuu国产电影一区二区| 久久99日本精品| 欧美成人video| 国产麻豆精品一区二区| 26uuu亚洲婷婷狠狠天堂|