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

📄 queue.c

📁 加密硬盘、分区、虚拟盘的程序源码
💻 C
字号:
/* Copyright (C) 2004 TrueCrypt Team, truecrypt.org
   This product uses components written by Paul Le Roux <pleroux@swprofessionals.com> */

#include "TCdefs.h"

#pragma VxD_LOCKED_CODE_SEG
#pragma VxD_LOCKED_DATA_SEG

#include "crypto.h"
#include "apidrvr.h"
#include "tc9x.h"
#include "queue.h"

#include "ifshook.h"

extern cryptvol *cryptvols[];

PIOP queuedIOP = 0;		/* Currently or to be processed iop ptr */

void
DeQueueIOP (void)
{
	PIOP iop;
	PIOP iop2;
	PDCB dcb;
	cryptvol *cv;

	iop = queuedIOP;

	if (!queuedIOP)
		return;		/* may happen in terminate thread (that this
				   runs on...) */

	iop = queuedIOP;

	while (1)
	{
		dcb = (PDCB) iop->IOP_physical_dcb;
		cv = (cryptvol *) dcb->DCB_Port_Specific;

		/* Note that in TC, it isn't necessary to clear IOR_next
		   Nothing further is called using this IOP */

		cryptproc (iop, cv);

		iop2 = (PIOP) iop->IOP_ior.IOR_next;
		queuedIOP = iop2;

		ior.IOR_status = 0;	/* IORS_CMD_IN_PROGRESS; 	 */

		dcb->DCB_cmn.DCB_device_flags &= ~DCB_DEV_IO_ACTIVE;
		DoCallBack (iop);

		if (!queuedIOP)
			break;

		iop = queuedIOP;
	}
}

void
QueueMyIop (PIOP iop)
{
	PIOP tempiop = queuedIOP;
	PIOP nextiop = 0;

	iop->IOP_ior.IOR_next = 0;	/* make sure */

	if (tempiop)
	{
		/* Add the current iop to the head of list */
		while (nextiop = (PIOP) tempiop->IOP_ior.IOR_next)
			tempiop = nextiop;
		tempiop->IOP_ior.IOR_next = (unsigned long) iop;
	}
	else
	{
		/* No current iop's so wake the thread up */
		queuedIOP = iop;
		wakethread ();
	}
}

⌨️ 快捷键说明

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