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

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

?? power.cpp

?? 智能卡的讀寫程序
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
					ASSERT(ctx->status != STATUS_PENDING);
					Irp->IoStatus.Status = ctx->status;
					IoCompleteRequest(Irp, IO_NO_INCREMENT);
					
					if (status == -1)
						status = STATUS_SUCCESS;
					}

				// Release the remove lock to balance the extra acquisition in TriageNewIrp
				
				IoReleaseRemoveLock(&pdx->RemoveLock, Irp);
				}				// not previously completed
			
			action = DestroyContext;
			continue;
			}					// CompleteMainIrp

		///////////////////////////////////////////////////////////////////////
		// DestroyContext is the last action for an IRP.

		case DestroyContext:
			{					// DestroyContext
			SETSTATE(FinalState);
			ExFreePool(ctx);
			break;
			}					// DestroyContext

		///////////////////////////////////////////////////////////////////////
		// SubPowerUpComplete is the action for a AsyncNotify event in the
		// SubPowerUpPending state. This should be called from PoCompletionRoutine.
		// We can also get here from SendDeviceIrp to avoid the Win98 no-D-IRP bug,
		// in which case we don't want to alter "status" from its current value.

		case SubPowerUpComplete:
			{					// SubPowerUpComplete
			if (status == -1)
				status = STATUS_SUCCESS; // don't actually care, since called from PoCompletionRoutine
			action = CompleteMainIrp;
			continue;
			}					// SubPowerUpComplete

		///////////////////////////////////////////////////////////////////////
		// SubPowerDownComplete is the action for a AsyncNotify event in the
		// SubPowerDownPending state. This should be called from PoCompletionRoutine.
		// We can also get here from SendDeviceIrp to avoid the Win98 no-D-IRP bug,
		// in which case we don't want to alter "status" from its current value.

		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;

			KdPrint((DRIVERNAME " - Now in %s\n", devstate[pdx->devpower]));
			
			// 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;

			KdPrint((DRIVERNAME " - Now in %s\n", devstate[pdx->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

			// The Windows 98 version of the USB hub driver incorrectly fails
			// device queries

			if (ctx->status == STATUS_INVALID_PARAMETER)
				ctx->status = STATUS_SUCCESS;

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

	POWTRACE((DRIVERNAME " - %d.%d returning %X, state is %s\n", ctxid, eventid, status, powstatenames[nextstate]));


	return status;
	}							// HandlePowerEvent

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

#pragma LOCKEDCODE

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

	// Note: The ExXxxWorkItem functions are deprecated for Win2K and WinXp but
	// okay for win98. This code only executes in Win98, so these should be okay

	#pragma warning(disable:4995)
	#pragma warning(disable:4996)
	C_ASSERT(sizeof(Irp->Tail.Overlay.DriverContext) >= sizeof(WORK_QUEUE_ITEM));

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

	#pragma warning(default:4995)
	#pragma warning(default:4996)

	return STATUS_PENDING;
	}							// SafePoCallDriver

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧洲一区二区三区免费视频| 国产日韩v精品一区二区| 精品卡一卡二卡三卡四在线| 亚洲欧美中日韩| 免费在线观看日韩欧美| 91丨国产丨九色丨pron| 精品国一区二区三区| 亚洲午夜av在线| 成人一级黄色片| 久久美女高清视频| 精品综合免费视频观看| 欧美人伦禁忌dvd放荡欲情| 亚洲欧美日韩国产综合在线| 国产美女视频一区| 精品国产伦一区二区三区免费| 亚洲精品视频观看| 东方aⅴ免费观看久久av| 久久日一线二线三线suv| 午夜免费久久看| 色婷婷精品久久二区二区蜜臀av| 国产亚洲视频系列| 狠狠色综合日日| 欧美成人一区二区三区在线观看| 婷婷国产v国产偷v亚洲高清| 91成人看片片| 亚洲一区二区三区视频在线播放| 99国产精品久| 18涩涩午夜精品.www| av在线这里只有精品| 国产精品美女久久久久aⅴ国产馆| 韩国毛片一区二区三区| 久久亚洲一区二区三区四区| 国产一区二区网址| 国产亚洲欧美一区在线观看| 国产suv一区二区三区88区| 久久久久国产成人精品亚洲午夜| 国产一区二区三区四区五区美女| 2022国产精品视频| 国产成人精品影视| 欧美韩日一区二区三区| 成人av午夜电影| 亚洲欧美自拍偷拍色图| 欧美午夜电影网| 蜜臀av性久久久久蜜臀av麻豆| 欧美电影在哪看比较好| 久久精品国产亚洲5555| 国产亚洲欧美日韩在线一区| 成人av午夜影院| 亚洲va欧美va天堂v国产综合| 91麻豆精品国产| 狠狠色丁香婷综合久久| 中文字幕av一区二区三区高| 91免费观看视频在线| 亚洲一区中文在线| 日韩手机在线导航| 高清av一区二区| 亚洲一级二级在线| 欧美精品一区二区不卡| 成人视屏免费看| 图片区小说区区亚洲影院| 久久综合九色综合欧美亚洲| 成人av在线一区二区三区| 亚洲国产成人91porn| 日韩精品一区二区三区视频在线观看| 国产成人av电影在线| 尤物在线观看一区| 日韩精品专区在线影院重磅| a4yy欧美一区二区三区| 五月天一区二区| 国产精品亲子乱子伦xxxx裸| 欧美三级韩国三级日本一级| 国产一区二区三区免费| 一二三区精品视频| 国产午夜精品一区二区| 欧美日韩综合在线| 国产一区二区三区日韩| 亚洲超丰满肉感bbw| 国产精品久久久久影视| 欧美一三区三区四区免费在线看| 成人一级片网址| 寂寞少妇一区二区三区| 亚洲观看高清完整版在线观看| 久久婷婷国产综合国色天香| 欧美精品1区2区3区| 99久久99久久精品国产片果冻 | ...中文天堂在线一区| 日韩一级黄色片| 91影院在线免费观看| 极品少妇一区二区三区精品视频| 亚洲自拍偷拍欧美| 国产欧美精品一区aⅴ影院| 日韩午夜激情av| 欧美色成人综合| 色综合天天天天做夜夜夜夜做| 国内精品久久久久影院一蜜桃| 香蕉久久一区二区不卡无毒影院| 亚洲色图欧美激情| 中文字幕av在线一区二区三区| 欧美xxxx老人做受| 日韩三级视频在线观看| 欧美精品高清视频| 欧美日精品一区视频| 91久久一区二区| 97se亚洲国产综合自在线观| 国产精品伊人色| 国产精品1024| 顶级嫩模精品视频在线看| 国产99久久久国产精品免费看| 久草在线在线精品观看| 另类的小说在线视频另类成人小视频在线 | 这里只有精品99re| 8x福利精品第一导航| 欧美色精品天天在线观看视频| 色噜噜夜夜夜综合网| 在线精品观看国产| 欧美精品色综合| 欧美一级片免费看| 欧美精品一区二区三区很污很色的 | 欧美激情一区在线观看| 国产精品水嫩水嫩| 亚洲图片激情小说| 夜夜嗨av一区二区三区中文字幕 | 国产精品你懂的在线欣赏| 国产日韩精品一区二区三区| 欧美激情一区二区三区不卡| 国产欧美精品一区| 亚洲视频精选在线| 五月天欧美精品| 极品美女销魂一区二区三区| 国产精品一区一区| 91麻豆精品秘密| 欧美自拍丝袜亚洲| 日韩午夜在线播放| 久久综合久久99| 亚洲人成网站色在线观看| 午夜电影一区二区| 国产一区视频在线看| 91视频免费看| 91精品国产一区二区三区| 国产婷婷色一区二区三区四区 | 亚洲视频网在线直播| 亚洲成在线观看| 久久国产人妖系列| voyeur盗摄精品| 91精品一区二区三区在线观看| 久久综合色播五月| 一区二区三区美女| 精品亚洲国内自在自线福利| 成人高清视频在线观看| 欧美日韩国产高清一区二区 | 日韩色视频在线观看| 久久精品日韩一区二区三区| 一区二区三区四区不卡在线| 麻豆精品蜜桃视频网站| 97se狠狠狠综合亚洲狠狠| 91精品国产综合久久福利软件| 亚洲国产精品成人久久综合一区| 亚洲一级不卡视频| 国产精品99久久久久久似苏梦涵| 91蝌蚪porny九色| 久久综合色一综合色88| 亚洲国产中文字幕在线视频综合| 国产精品一区在线观看乱码| 欧美男男青年gay1069videost| 久久久久99精品一区| 亚洲成人免费看| 97成人超碰视| 亚洲国产精品精华液2区45| 午夜久久久久久久久久一区二区| 不卡一区二区三区四区| 欧美本精品男人aⅴ天堂| 亚洲国产精品久久久久秋霞影院| 成人av在线一区二区三区| 精品国产乱码久久久久久老虎| 一二三区精品视频| 99久久99久久精品国产片果冻| 久久综合久久综合九色| 秋霞国产午夜精品免费视频| 欧美视频日韩视频在线观看| 国产精品久久久久久久久免费丝袜 | 成人动漫一区二区在线| 日韩情涩欧美日韩视频| 性做久久久久久久免费看| 在线观看视频一区| 亚洲天堂免费看| 99久久综合国产精品| 国产精品欧美一区二区三区| 国产福利视频一区二区三区| 欧美mv日韩mv国产网站| 免费成人在线观看视频| 3atv一区二区三区| 三级一区在线视频先锋 | 久久精品无码一区二区三区| 免费的成人av| 欧美本精品男人aⅴ天堂| 九九精品视频在线看| 欧美精品一区二区三区高清aⅴ| 日韩激情一二三区| 日韩免费成人网| 国内精品国产成人国产三级粉色|