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

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

?? power.cpp

?? 基于USB接口的GPS驅動程序
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
		case SubPowerDownComplete:
			{					// SubPowerDownComplete
			if (status == -1)
				status = STATUS_SUCCESS; // don't actually care, since called from PoCompletionRoutine

			if (NT_SUCCESS(ctx->status))
				{
				SETSTATE(SysPowerDownPending);
				action = ForwardMainIrp;
				}
			else
				action = CompleteMainIrp; // D-state IRP failed, so fail S-state IRP too
			
			continue;
			}					// SubPowerDownComplete

		///////////////////////////////////////////////////////////////////////
		// DevPowerUpComplete is the action for a MainIrpComplete event in the
		// DevPowerUpPending state. This should be called from MainCompletionRoutine
		// when a device power-up IRP finishes in the lower layers.

		case DevPowerUpComplete:
			{					// DevPowerUpComplete

			// If this IRP failed, or if we're just dealing with a query, we're done.

			if (!NT_SUCCESS(ctx->status) || stack->MinorFunction != IRP_MN_SET_POWER)
				{
				action = CompleteMainIrp;
				continue;
				}

			status = STATUS_MORE_PROCESSING_REQUIRED; // defer completion of the main IRP while we restore context

			ctx->oldpower = pdx->devpower;
			pdx->devpower = stack->Parameters.Power.State.DeviceState;
			
			// TODO Replace the "if (FALSE)" statement block immediately below with code
			// to initiate an asynchronous process to restore device context information
			// that was saved when power was lost. ctx->oldpower is the previous power
			// state, and pdx->devpower is the new power state. When this process finishes,
			// call SendAsyncNotification with "ctx" as the argument

			if (FALSE)
				{				// restore context
				SETSTATE(ContextRestorePending);
				// right here is where you start restoring context data
				break;
				}				// restore context

			action = ContextRestoreComplete;
			continue;
			}					// DevPowerUpComplete

		///////////////////////////////////////////////////////////////////////
		// ContextRestoreComplete is the last action for a device set power up
		// operation. It's ordinarily reached when GenericSaveRestoreComplete
		// signals a MainIrpComplete event from the ContextRestorePending state.
		// It can also be reached directly from DevPowerUpComplete when there is
		// no context restore function.

		case ContextRestoreComplete:
			{					// ContextRestoreComplete
			if (event == AsyncNotify)
				status = STATUS_SUCCESS; // doesn't actually matter
			action = CompleteMainIrp;

			// If the device IRP failed, just go ahead and let it complete. If we've
			// successfully resumed to a sleeping state (> D0), skip restarting the
			// substantive IRP queue and complete the IRP as well.

			if (!NT_SUCCESS(ctx->status) || pdx->devpower != PowerDeviceD0)
				continue;

			ASSERT(stack->MinorFunction == IRP_MN_SET_POWER); // query should have gone directly to CompleteMainIrp from DevPowerUpComplete

			continue;
			}					// ContextRestoreComplete

		///////////////////////////////////////////////////////////////////////
		// SaveContext initiates a context save operation if necessary. This will
		// be the second action for a new device set-power IRP.

		case SaveContext:
			{					// SaveContext
			ASSERT(stack->MinorFunction == IRP_MN_SET_POWER);
			DEVICE_POWER_STATE devpower = stack->Parameters.Power.State.DeviceState;

			// TODO Replace the following block of code with code that initiates
			// an asynchronous process to save an relevant device context. When
			// that process finishes, call SendAsyncNotification with "ctx" as
			// the argument.

			if (FALSE && devpower > pdx->devpower)
				{				// save context
				SETSTATE(ContextSavePending);
				// put code here to start saving context
				break;
				}				// save context

			action = ContextSaveComplete;
			continue;
			}					// SaveContext

		///////////////////////////////////////////////////////////////////////
		// ContextSaveComplete is the action for an AsyncNotify event in the
		// ContextSavePending state. It should be entered from GenericSaveRestoreComplete,
		// which in turn should have been called by the client driver when its
		// context save operation finished. It can also be entered directly from
		// SaveContext when there is no context save routine.

		case ContextSaveComplete:
			{					// ContextSaveComplete
			if (event == AsyncNotify)
				status = STATUS_SUCCESS;	// doesn't actually matter in this case

			SETSTATE(DevPowerDownPending);
			action = ForwardMainIrp;

			ASSERT(stack);
			DEVICE_POWER_STATE devpower = stack->Parameters.Power.State.DeviceState;
			if (devpower <= pdx->devpower)
				continue;		// no actual change in device power

			ASSERT(stack->MinorFunction == IRP_MN_SET_POWER);

			pdx->devpower = devpower;

			continue;
			}					// ContextSaveComplete

		///////////////////////////////////////////////////////////////////////
		// DevQueryUpComplete is the action for a MainIrpComplete event in the
		// DevQueryUpPending state. This should be called by MainCompletionRoutine
		// when a device query-power-up IRP completes. We don't expect to ever get this
		// kind of a query, by the way, but we should handle it nontheless.

		case DevQueryUpComplete:
			{					// DevQueryUpComplete
			if (NT_SUCCESS(ctx->status))
				{				// ask client if change okay

				// TODO replace the FALSE immediately below with some non-blocking test
				// to see if it's okay to restore power. It would be very unusual to
				// say "no". In making the test, pdx->devpower is the current power
				// state and stack->Parameters.Power.State.DeviceState is the
				// proposed new state.

				if (FALSE)
					ctx->status = STATUS_UNSUCCESSFUL; // fail the query
				}				// ask client if change okay

			action = CompleteMainIrp;
			continue;
			}					// DevQueryUpComplete

		///////////////////////////////////////////////////////////////////////
		// DevQueryDown is the second action (after TriageNewIrp) for a device
		// query-power that specifies less than or equal to the current device
		// power state.

		case DevQueryDown:
			{					// DevQueryDown
			DEVICE_POWER_STATE devpower = stack->Parameters.Power.State.DeviceState;

			// TODO replace the FALSE immediately below with some non-blocking test
			// to see if it's okay to remove power. In making the test, pdx->devpower
			// is the current power state and devpower is the proposed new state.

			if (devpower > pdx->devpower && FALSE)
				{				// fail the query
				ctx->status = STATUS_UNSUCCESSFUL;
				action = DevQueryDownComplete;
				continue;
				}				// fail the query

			SETSTATE(DevQueryDownPending);
			action = ForwardMainIrp;
			continue;
			}					// DevQueryDown

		///////////////////////////////////////////////////////////////////////
		// DevQueryDownComplete is the action for a MainIrpComplete event in the
		// DevQueryDownPending state. It can be reached from MainCompletionRoutine
		// or directly from DevQueryDown.

		case DevQueryDownComplete:
			{					// DevQueryDownComplete

			action = CompleteMainIrp;
			continue;
			}					// DevQueryDownComplete

		///////////////////////////////////////////////////////////////////////
		// InvalidAction is the action for any unexpected event. It should never occur.

		case InvalidAction:
		default:
			ASSERT(FALSE);
			status = STATUS_UNSUCCESSFUL;
			break;
			}					// perform next action

		break;					// for cases that "break" from the switch
		}						// handle this event

	// Check to make sure the state got changed before we exit
		
	ASSERT(nextstate != originalstate);

	// Check to make sure a valid status will be returned

	ASSERT(status != -1);

	return status;
	}							// HandlePowerEvent

///////////////////////////////////////////////////////////////////////////////

NTSTATUS MainCompletionRoutine(PDEVICE_OBJECT junk, PIRP Irp, PPOWCONTEXT ctx)
	{							// MainCompletionRoutine
	ctx->status = Irp->IoStatus.Status;
	return HandlePowerEvent(ctx, MainIrpComplete);
	}							// MainCompletionRoutine

VOID PoCompletionRoutine(PDEVICE_OBJECT junk, UCHAR fcn, POWER_STATE state, PPOWCONTEXT ctx, PIO_STATUS_BLOCK pstatus)
	{							// PoCompletionRoutine
	ctx->status = pstatus->Status;
	HandlePowerEvent(ctx, AsyncNotify);
	}							// PoCompletionRoutine

VOID PassivePowerCall(PIRP Irp)
	{							// PassivePowerCall
	PoCallDriver(IoGetNextIrpStackLocation(Irp)->DeviceObject, Irp);
	}							// PassivePowerCall

NTSTATUS SafePoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp)
	{							// SafePoCallDriver

	// If running in Win2K, or if Win98 and already at PASSIVE_LEVEL, just call
	// PoCallDriver.

	if (!win98 || KeGetCurrentIrql() == PASSIVE_LEVEL)
		return PoCallDriver(DeviceObject, Irp);
	
	// Win98's PoCallDriver is the same as IoCallDriver, and it won't do anything to
	// present the IRP at passive level if we're currently above. Build a work queue
	// item in the DriverContext field of the IRP and queue the work item so we
	// can present the IRP properly. Boy, is this something we shouldn't have to
	// worry about!

	IoMarkIrpPending(Irp);		// be sure it's marked pending
	IoGetNextIrpStackLocation(Irp)->DeviceObject = DeviceObject; // so PassivePowerCall can find it

	PWORK_QUEUE_ITEM item = (PWORK_QUEUE_ITEM) Irp->Tail.Overlay.DriverContext;
	ExInitializeWorkItem(item, (PWORKER_THREAD_ROUTINE) PassivePowerCall, (PVOID) Irp);
	ExQueueWorkItem(item, DelayedWorkQueue);

	return STATUS_PENDING;
	}							// SafePoCallDriver

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲电影一区二区三区| 亚洲人成精品久久久久久| 日本韩国精品在线| 91在线你懂得| 91老师国产黑色丝袜在线| 99久久99久久久精品齐齐| 91美女在线看| 欧美性大战久久| 欧美日韩视频在线第一区| 666欧美在线视频| 日韩精品中文字幕在线一区| 欧美videossexotv100| 久久精品人人做| 亚洲风情在线资源站| 亚洲国产精品久久久久婷婷884 | 樱桃国产成人精品视频| 国产精品第五页| 亚洲综合激情另类小说区| 午夜久久久久久| 激情欧美一区二区| av亚洲精华国产精华| 91国在线观看| 久久久不卡影院| 日韩理论片网站| 日韩专区在线视频| 国产69精品久久777的优势| www.欧美精品一二区| 欧美在线视频不卡| 久久精品人人做人人爽人人| 亚洲美女在线一区| 麻豆高清免费国产一区| 国产91丝袜在线播放| 欧美在线不卡一区| 精品国产乱码久久久久久牛牛 | 久色婷婷小香蕉久久| 丰满放荡岳乱妇91ww| 精品视频资源站| 亚洲精品一区二区三区在线观看 | 国产精品一区三区| 在线观看国产日韩| 欧美韩国日本综合| 青青青伊人色综合久久| 色综合久久中文字幕综合网| 日韩一二三四区| 亚洲美女屁股眼交3| 国产一区二区剧情av在线| 欧美系列亚洲系列| 中文字幕巨乱亚洲| 韩国欧美国产1区| 欧美日韩国产小视频| 国产欧美一区二区精品秋霞影院 | 国产精品的网站| 精品一区二区三区在线视频| 欧亚一区二区三区| 国产精品色哟哟网站| 久久99久久99精品免视看婷婷| 欧美亚日韩国产aⅴ精品中极品| 久久精品视频免费| 国产综合色视频| 日韩欧美美女一区二区三区| 亚洲精品免费看| 91亚洲男人天堂| 亚洲国产精品二十页| 国产一区二区三区久久悠悠色av| 欧美日高清视频| 一区二区不卡在线视频 午夜欧美不卡在| 韩国av一区二区三区在线观看| 欧美高清dvd| 五月婷婷色综合| 欧美日本在线看| 日本不卡视频一二三区| 欧美日韩卡一卡二| 亚洲成人免费观看| 欧美性猛片xxxx免费看久爱| 夜夜嗨av一区二区三区| 色婷婷久久99综合精品jk白丝| 国产精品卡一卡二卡三| 国产激情一区二区三区桃花岛亚洲| 欧美大片顶级少妇| 国产一区二区精品久久91| 久久久精品天堂| a在线播放不卡| 一区二区高清在线| 3d动漫精品啪啪1区2区免费| 男人的天堂亚洲一区| 精品成人一区二区三区| 国产98色在线|日韩| 国产精品亲子伦对白| 成人高清视频在线观看| 一区二区三区丝袜| 欧美日产国产精品| 国产一区二区三区最好精华液| 国产夜色精品一区二区av| 成人亚洲精品久久久久软件| 日韩理论片在线| 69久久99精品久久久久婷婷 | 亚洲va国产va欧美va观看| 欧美精品在线视频| 久久se精品一区二区| 久久久三级国产网站| 99精品桃花视频在线观看| 亚洲成av人片| 国产亲近乱来精品视频| 色综合久久66| 麻豆传媒一区二区三区| 国产精品国产三级国产aⅴ原创| 欧美性大战xxxxx久久久| 久久99热狠狠色一区二区| 中文字幕在线观看一区| 欧美日韩三级视频| 国产91综合一区在线观看| 亚洲国产人成综合网站| 日韩精品一区二区三区中文不卡 | 狠狠色2019综合网| 亚洲激情第一区| 日韩精品一区二区三区四区视频| 97se狠狠狠综合亚洲狠狠| 久久99这里只有精品| 亚洲一区在线视频| 中文字幕一区二区三区蜜月| 欧美精品v国产精品v日韩精品 | 亚洲一区二区三区自拍| 久久综合五月天婷婷伊人| 在线免费观看日本欧美| 高清日韩电视剧大全免费| 青椒成人免费视频| 亚洲国产精品综合小说图片区| 国产日韩欧美精品综合| 91麻豆精品国产91久久久| 色综合夜色一区| 国产精品国产a| 日韩三级免费观看| 欧美亚洲自拍偷拍| 日本道免费精品一区二区三区| 国产成人久久精品77777最新版本| 日韩国产高清影视| 亚洲一区中文在线| 一区二区在线免费| 国产亚洲婷婷免费| 久久一留热品黄| 日韩一区二区在线看| 欧美日韩免费视频| 欧美日韩久久久| 色伊人久久综合中文字幕| av中文字幕亚洲| 成人午夜视频在线观看| 国产精品一品视频| 91国模大尺度私拍在线视频| 成人精品亚洲人成在线| 成人性生交大合| 成人免费毛片高清视频| 国产精品原创巨作av| 精品一区二区免费视频| 久久成人羞羞网站| 国产一区二区在线观看免费| 国产在线不卡一区| 国内精品久久久久影院一蜜桃| 男男视频亚洲欧美| 蜜臀av性久久久久蜜臀aⅴ | 精品国产sm最大网站| 欧美变态tickling挠脚心| 欧美一区二区三区爱爱| 日韩欧美激情在线| 精品欧美一区二区三区精品久久| 久久婷婷综合激情| 国产精品激情偷乱一区二区∴| 中文字幕一区二区三区四区| 亚洲精品亚洲人成人网在线播放| 一区二区不卡在线播放 | 香蕉成人伊视频在线观看| 亚洲成人资源网| 精品一区二区三区在线观看| 国产成人在线电影| 91色视频在线| 91精品国产品国语在线不卡| 欧美成人a在线| 亚洲成人激情自拍| 久久草av在线| 99久久99久久精品国产片果冻 | 日韩欧美在线一区二区三区| 久久综合久久综合九色| 国产精品不卡在线| 午夜日韩在线观看| 国产成人精品一区二| 欧美又粗又大又爽| 久久蜜桃一区二区| 亚洲一区精品在线| 国产激情精品久久久第一区二区| 日本电影欧美片| 久久久精品2019中文字幕之3| 综合激情成人伊人| 九九**精品视频免费播放| 色综合久久久久| 久久久一区二区三区| 一区二区三区成人| 成人一区二区三区视频| 欧美一区二区免费观在线| 17c精品麻豆一区二区免费| 久久精品国产久精国产爱| 91老司机福利 在线|