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

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? testdevice.cpp

?? 一個(gè)典型的USB驅(qū)動(dòng)開發(fā)
?? CPP
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
//
//	Return Value:
//		NTSTATUS - Status code indicating success or failure
//
//	Comments:
//		This routine implements the OnDevicePowerUp function.
//		This function was called by the framework from the completion
//		routine of the IRP_MJ_POWER dispatch handler in KPnpDevice.
//		The bus driver has completed the IRP and this driver can now
//		access the hardware device.  
//		This routine runs at dispatch level.
//	

NTSTATUS TestDevice::OnDevicePowerUp(KIrp I)
{
	NTSTATUS status = STATUS_SUCCESS;

	t << "Entering TestDevice::OnDevicePowerUp\n";

// TODO:	Service the device.
//			Restore any context to the hardware device that
//			was saved during the handling of a power down request.
//			See the OnDeviceSleep function.
//			Do NOT complete this IRP.
//
	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);
}

////////////////////////////////////////////////////////////////////////
//  TestDevice::OnDeviceSleep
//
//	Routine Description:
//		Handler for IRP_MJ_POWER with minor function IRP_MN_SET_POWER
//		for a request to go to a low power state from a high power state
//
//	Parameters:
//		I - IRP containing POWER request
//
//	Return Value:
//		NTSTATUS - Status code indicating success or failure
//
//	Comments:
//		This routine implements the OnDeviceSleep function.
//		This function was called by the framework from the IRP_MJ_POWER 
//		dispatch handler in KPnpDevice prior to forwarding to the PDO.
//		The hardware has yet to be powered down and this driver can now
//		access the hardware device.  
//		This routine runs at passive level.
//	

NTSTATUS TestDevice::OnDeviceSleep(KIrp I)
{
	NTSTATUS status = STATUS_SUCCESS;

	t << "Entering TestDevice::OnDeviceSleep\n";

// TODO:	Service the device.
//			Save any context to the hardware device that will be required 
//			during a power up request. See the OnDevicePowerUp function.
//			Do NOT complete this IRP.  The base class handles forwarding
//			this IRP to the PDO.
//
	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);
}

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

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

	t << "Entering TestDevice::Create, " << I << EOL;

// 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);

	t << "TestDevice::Create Status " << (ULONG)status << EOL;

	return status;
}

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

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

	t << "Entering TestDevice::Close, " << I << EOL;

// 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);

	t << "TestDevice::Close Status " << (ULONG)status << EOL;

    return status;
}

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

NTSTATUS TestDevice::CleanUp(KIrp I)
{
	t << "Entering CleanUp, " << I << EOL;

// TODO:	Insert your code to respond to the CLEANUP message.
	return I.PnpComplete(this, STATUS_SUCCESS);
}


////////////////////////////////////////////////////////////////////////
//  TestDevice::Read
//
//	Routine Description:
//		Handler for IRP_MJ_READ
//
//	Parameters:
//		I			Current IRP
//
//	Return Value:
//		NTSTATUS	Result code
//
//	Comments:
//		This routine handles read requests.
//
//		The KPnpDevice class handles restricting IRP flow
//		if the device is stopping or being removed.
//

NTSTATUS TestDevice::Read(KIrp I) 
{
	t << "Entering TestDevice::Read, " << I << EOL;
// TODO:	Check the incoming request.  Replace "FALSE" in the following
//			line with a check that returns TRUE if the request is not valid.

    if (FALSE)		// If (Request is invalid)
	{
		// Invalid parameter in the Read request
		I.Information() = 0;
		return I.PnpComplete(this, STATUS_INVALID_PARAMETER);
	}

	// Always ok to read 0 elements.
	if (I.ReadSize() == 0)
	{
		I.Information() = 0;
		return I.PnpComplete(this, STATUS_SUCCESS);
	}
	NTSTATUS status		= STATUS_SUCCESS;

	KMemory Mem(I.Mdl());						// Declare a memory object
	// Use the memory object to create a pointer to the caller's buffer
	PUCHAR	pBuffer		= (PUCHAR) Mem.VirtualAddress();

	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;

	return I.PnpComplete(this, status);
}


////////////////////////////////////////////////////////////////////////
//  TestDevice::Write
//
//	Routine Description:
//		Handler for IRP_MJ_WRITE
//
//	Parameters:
//		I - Current IRP
//
//	Return Value:
//		NTSTATUS - Result code
//
//	Comments:
//		This routine handles write requests.
//
//		The KPnpDevice class handles restricting IRP flow
//		if the device is stopping or being removed.
//

NTSTATUS TestDevice::Write(KIrp I) 
{
	t << "Entering TestDevice::Write, " << I << EOL;
// TODO:	Check the incoming request.  Replace "FALSE" in the following
//			line with a check that returns TRUE if the request is not valid.
    if (FALSE)
	{
		// Invalid parameter in the Write request
		I.Information() = 0;
		return I.PnpComplete(this, STATUS_INVALID_PARAMETER);
	}

	// Always ok to write 0 elements.
	if (I.WriteSize() == 0)
	{
		I.Information() = 0;
		return I.PnpComplete(this, STATUS_SUCCESS);
	}
	NTSTATUS status		= STATUS_SUCCESS;

	KMemory Mem(I.Mdl());						// Declare a memory object
	// Use the memory object to create a pointer to the caller's buffer
	PUCHAR	pBuffer		= (PUCHAR) Mem.VirtualAddress();

	ULONG   dwTotalSize = I.WriteSize(CURRENT);
	ULONG   dwBytesSent = 0;

// TODO:	If the write 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 device cannot accept all of the data yet, initiate a 
//			request to the physical device here, and defer the Information,
//			Status, and NextIrp handling until the hardware indicates that
//			the write is complete.  Typically, this might be handled in a
//			DPC that is called after the hardware finishes transferring
//			the data.

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

	I.Information() = dwBytesSent;

	return I.PnpComplete(this, status);
}

////////////////////////////////////////////////////////////////////////
//  TestDevice::DeviceControl
//
//	Routine Description:
//		Handler for IRP_MJ_DEVICE_CONTROL
//
//	Parameters:
//		I - Current IRP
// 
//	Return Value:
//		None
//
//	Comments:
//		This routine is the first handler for Device Control requests.
//		The KPnpDevice class handles restricting IRP flow
//		if the device is stopping or being removed.
//

NTSTATUS TestDevice::DeviceControl(KIrp I) 
{
	NTSTATUS status;

	t << "Entering TestDevice::Device Control, " << I << EOL;
	switch (I.IoctlCode())
	{
		case D12_DRIVER_READ:
			status = D12_DRIVER_READ_Handler(I);
			break;

		case D12_DRIVER_WRITE:
			status = D12_DRIVER_WRITE_Handler(I);
			break;

		case D12_DRIVER_BULK_IN:
			status = D12_DRIVER_BULK_IN_Handler(I);
			break;

		case D12_DRIVER_BULK_OUT:
			status = D12_DRIVER_BULK_OUT_Handler(I);
			break;

		default:
			// Unrecognized IOCTL request
			status = STATUS_INVALID_PARAMETER;
			break;
	}

	// If the IRP's IOCTL handler deferred processing using some driver
	// specific scheme, the status variable is set to STATUS_PENDING.
	// In this case we simply return that status, and the IRP will be
	// completed later.  Otherwise, complete the IRP using the status
	// returned by the IOCTL handler.
	if (status == STATUS_PENDING)
	{
		return status;
	}
	else
	{
		return I.PnpComplete(this, status);
	}
}

////////////////////////////////////////////////////////////////////////
//  TestDevice::D12_DRIVER_READ_Handler
//
//	Routine Description:
//		Handler for IO Control Code D12_DRIVER_READ
//
//	Parameters:
//		I - IRP containing IOCTL request
//
//	Return Value:

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
懂色av一区二区三区蜜臀| 日韩视频在线永久播放| 国产成人亚洲综合a∨婷婷| 奇米精品一区二区三区四区| 亚洲国产精品一区二区www| 一区二区国产盗摄色噜噜| 亚洲中国最大av网站| 亚洲最大的成人av| 亚洲成av人片观看| 日韩国产精品久久久久久亚洲| 性久久久久久久| 奇米影视7777精品一区二区| 看电影不卡的网站| 国产精品资源在线观看| 成人黄色软件下载| 91免费小视频| 欧美喷潮久久久xxxxx| 日韩欧美国产电影| 精品国产污网站| 欧美国产日产图区| 自拍视频在线观看一区二区| 亚洲精品久久久蜜桃| 中文字幕欧美日韩一区| 欧美激情一区二区三区全黄| 久久精品视频免费观看| 国产欧美一区二区三区鸳鸯浴| 久久久精品天堂| 久久精品视频一区二区三区| 国产欧美精品一区二区三区四区| 久久久久99精品国产片| 中文字幕精品一区| 中文字幕日本不卡| 玉米视频成人免费看| 亚洲一区二区三区爽爽爽爽爽| 一区二区日韩av| 亚洲狠狠爱一区二区三区| 亚洲午夜国产一区99re久久| 日韩精品久久理论片| 美女视频黄久久| 国产精品一区二区三区网站| 成人免费电影视频| 色欧美片视频在线观看在线视频| 色婷婷综合久久久中文字幕| 欧美日韩国产高清一区| 欧美xxxx在线观看| 国产色婷婷亚洲99精品小说| 亚洲欧洲色图综合| 性久久久久久久久久久久| 日韩国产在线一| 美日韩一区二区| 国产suv精品一区二区三区| av亚洲产国偷v产偷v自拍| 欧美午夜影院一区| 欧美一区日本一区韩国一区| 久久美女艺术照精彩视频福利播放| 国产亚洲欧美激情| 亚洲免费电影在线| 秋霞成人午夜伦在线观看| 国产精品1024久久| 欧美曰成人黄网| 精品入口麻豆88视频| 中文字幕在线不卡一区| 水蜜桃久久夜色精品一区的特点| 国内精品久久久久影院薰衣草| 不卡影院免费观看| 欧美日韩国产精品自在自线| 精品成人在线观看| 亚洲一区二区三区四区在线| 国产在线精品免费av| 成人激情小说网站| 这里只有精品免费| 国产精品欧美经典| 日韩av成人高清| 丰满白嫩尤物一区二区| 欧美日韩国产综合一区二区| 久久综合五月天婷婷伊人| 亚洲免费在线看| 奇米色777欧美一区二区| 97精品视频在线观看自产线路二| 8v天堂国产在线一区二区| 国产精品久久久久久久久免费桃花| 午夜视频久久久久久| 成人福利在线看| 欧美成人午夜电影| 亚洲一区二区欧美激情| 国产suv精品一区二区三区| 91精品国产丝袜白色高跟鞋| 国产精品伦一区二区三级视频| 日韩成人伦理电影在线观看| 色综合久久88色综合天天 | 91福利国产精品| 国产午夜精品理论片a级大结局| 亚洲成年人影院| 99综合电影在线视频| 久久蜜桃av一区二区天堂| 丝袜亚洲精品中文字幕一区| 粉嫩一区二区三区在线看| 欧美精品一级二级| 最近日韩中文字幕| 国产成人精品影视| 日韩午夜三级在线| 天堂久久久久va久久久久| 一本色道综合亚洲| 欧美国产一区二区| 国产乱子轮精品视频| 日韩欧美另类在线| 日本中文在线一区| 欧美日韩在线播放三区四区| 亚洲三级在线观看| 成人教育av在线| 国产欧美日韩视频一区二区 | 成人午夜看片网址| 精品日产卡一卡二卡麻豆| 日本欧美久久久久免费播放网| 91黄色免费版| 亚洲色图第一区| 成人sese在线| 亚洲三级电影网站| 99久久精品久久久久久清纯| 国产精品乱人伦| 成人精品亚洲人成在线| 中文字幕精品—区二区四季| 国产在线视视频有精品| 久久香蕉国产线看观看99| 国产乱国产乱300精品| 2020国产精品久久精品美国| 国产原创一区二区三区| 久久久久久麻豆| 国产精品88av| 国产精品美女久久久久aⅴ国产馆| 丁香婷婷综合五月| 中文字幕中文在线不卡住| 成人av综合一区| 亚洲精品五月天| 欧美影视一区二区三区| 亚洲精品老司机| 日韩欧美电影一区| 久久国产精品色| 国产色婷婷亚洲99精品小说| 成人av免费在线| 亚洲一区在线观看网站| 欧美乱妇15p| 久久99精品久久久久久动态图 | 久久久久久久免费视频了| 国产精品中文字幕欧美| 国产精品久久久久aaaa| 一本大道久久a久久精二百| 亚洲一区二区三区美女| 欧美精品免费视频| 一区二区欧美精品| 91精品国产色综合久久ai换脸| 亚洲亚洲精品在线观看| 欧美精品久久99| 国产精品一区在线观看你懂的| 久久久久青草大香线综合精品| 成人激情午夜影院| 五月天亚洲婷婷| 欧美一区二区精品| 99久久久久久| 日本亚洲电影天堂| 国产精品女主播av| 欧美亚洲一区二区三区四区| 美女一区二区在线观看| 国产精品乱人伦一区二区| 欧美视频一区二区在线观看| 麻豆精品新av中文字幕| 亚洲欧洲精品成人久久奇米网| 欧美久久久一区| 成人一二三区视频| 亚洲成国产人片在线观看| 久久久久九九视频| 欧美综合视频在线观看| 国产乱码精品1区2区3区| 亚洲自拍欧美精品| 久久精品一区二区三区av| 一本一道波多野结衣一区二区| 国产精品一区二区在线看| 午夜久久久影院| 18涩涩午夜精品.www| 日韩精品中文字幕在线不卡尤物| 99国产精品国产精品久久| 精品一区二区三区在线播放视频 | 奇米在线7777在线精品| 中文字幕在线不卡国产视频| 日韩久久久精品| 欧美午夜在线观看| 成人精品电影在线观看| 美女视频黄免费的久久| 亚洲精品国产视频| 国产三级三级三级精品8ⅰ区| 欧洲精品视频在线观看| 色综合中文字幕| 国产成人免费在线观看不卡| 日韩精品视频网| 亚洲美女偷拍久久| 国产日韩欧美麻豆| 日韩欧美在线影院| 欧美丝袜丝交足nylons图片| av亚洲产国偷v产偷v自拍| 奇米精品一区二区三区在线观看 |