|
|
1.1 root 1: /* Copyright (C) 2004 TrueCrypt Team, truecrypt.org
2: This product uses components written by Paul Le Roux <[email protected]> */
3:
4: #include "TCdefs.h"
5:
6: #pragma VxD_LOCKED_CODE_SEG
7: #pragma VxD_LOCKED_DATA_SEG
8:
9: #include "crypto.h"
10: #include "apidrvr.h"
11: #include "tc9x.h"
12: #include "queue.h"
13:
14: #include "ifshook.h"
15:
16: extern cryptvol *cryptvols[];
17:
18: PIOP queuedIOP = 0; /* Currently or to be processed iop ptr */
19:
20: void
21: DeQueueIOP (void)
22: {
23: PIOP iop;
24: PIOP iop2;
25: PDCB dcb;
26: cryptvol *cv;
27:
28: iop = queuedIOP;
29:
30: if (!queuedIOP)
31: return; /* may happen in terminate thread (that this
32: runs on...) */
33:
34: iop = queuedIOP;
35:
36: while (1)
37: {
38: dcb = (PDCB) iop->IOP_physical_dcb;
39: cv = (cryptvol *) dcb->DCB_Port_Specific;
40:
41: /* Note that in TC, it isn't necessary to clear IOR_next
42: Nothing further is called using this IOP */
43:
44: cryptproc (iop, cv);
45:
46: iop2 = (PIOP) iop->IOP_ior.IOR_next;
47: queuedIOP = iop2;
48:
49: ior.IOR_status = 0; /* IORS_CMD_IN_PROGRESS; */
50:
51: dcb->DCB_cmn.DCB_device_flags &= ~DCB_DEV_IO_ACTIVE;
52: DoCallBack (iop);
53:
54: if (!queuedIOP)
55: break;
56:
57: iop = queuedIOP;
58: }
59: }
60:
61: void
62: QueueMyIop (PIOP iop)
63: {
64: PIOP tempiop = queuedIOP;
65: PIOP nextiop = 0;
66:
67: iop->IOP_ior.IOR_next = 0; /* make sure */
68:
69: if (tempiop)
70: {
71: /* Add the current iop to the head of list */
72: while (nextiop = (PIOP) tempiop->IOP_ior.IOR_next)
73: tempiop = nextiop;
74: tempiop->IOP_ior.IOR_next = (unsigned long) iop;
75: }
76: else
77: {
78: /* No current iop's so wake the thread up */
79: queuedIOP = iop;
80: wakethread ();
81: }
82: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.