|
|
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: typedef struct cryptvol
5: {
6: PDCB ldcb;
7: PDCB filehostdcb; /* File host device, or main dcb if partition */
8: int booted; /* 0,1,2,256 depending on boot and error
9: state of volume */
10: int drive; /* Dos drive number */
11: ULONG cryptsectorfirst; /* 0x00000000 or starting sector (partitions) */
12: ULONG cryptsectorlast; /* 0x7ffffff0 or last sector (partitions) */
13: PDCB physdevDCB;
14: int mountfilehandle; /* 0x00000000 for partitions */
15:
16: DDB addb; /* Calldown ddb ptr, used only by
17: IspInsertCalldown */
18: DCB logicaldcb;
19:
20: PCRYPTO_INFO cryptoInfo;/* Encryption specific data */
21:
22: int notifytime; /* Supports the PNP msg needed for Windows to 'see' a new drive */
23:
24: char mounted_file_name[512]; /* The mounted volume name, or
25: \Device\... for partitions */
26:
27: } cryptvol;
28:
29: typedef struct partitionrec
30: {
31: unsigned char boot;
32: unsigned char sh;
33: unsigned char ss;
34: unsigned char sc;
35: unsigned char system;
36: unsigned char eh;
37: unsigned char es;
38: unsigned char ec;
39: unsigned int StartSector;
40: unsigned int NumSectors;
41: } partitionrec;
42:
43: #define ior iop->IOP_ior
44:
45: #ifndef arraysize
46: #define arraysize(p) (sizeof(p)/sizeof((p)[0]))
47: #endif
48:
49: /* Everything below this line is automatically updated by the -mkproto-tool- */
50:
51: VOID OnAsyncRequest ( PAEP aep );
52: USHORT OnInitialize ( PAEP_bi_init aep );
53: USHORT OnUninitialize ( PAEP_bi_uninit aep );
54: USHORT OnBootComplete ( PAEP_boot_done aep );
55: USHORT OnConfigDcb ( PAEP_dcb_config aep );
56: USHORT OnUnconfigDcb ( PAEP_dcb_unconfig aep );
57: VOID OnRequest ( PIOP iop );
58: int cmpvend ( char *a , char *b , int len );
59: int CheckDcbAlready ( PDCB dcb );
60: void DoCallDown ( PIOP iop );
61: BOOL OnSysDynamicDeviceInit ( void );
62: BOOL OnSysDynamicDeviceExit ( void );
63: DWORD OnDeviceIoControl ( PDIOCPARAMETERS p );
64: BOOL Kill_Drive ( cryptvol *cv );
65: int closeCrDevice ( cryptvol *cv , int mode );
66: int installthread ( void *t );
67: void sectorcopy ( char *dest , char *source , int num );
68: void cryptproc ( PIOP iop , cryptvol *cv );
69: void DoCallBack ( PIOP iop );
70: VOID partfilerequest ( PIOP iop );
71: int Add_Drive ( PDCB dcb , cryptvol *cv , int prefdrive );
72: int trymountfile ( PDCB dcb , cryptvol *cv , MOUNT_STRUCT *mf );
73: void readnullfilesize ( int hand );
74: void mountdiskfileR0 ( MOUNT_STRUCT *mf );
75: void outblock ( PIOP iop , char *outbuffer , int sectorstart , int sectorcount , cryptvol *cv , char *workbuff );
76: void inblock ( PIOP iop , char *outbuffer , int sectorstart , int sectorcount , cryptvol *cv );
77: int doR0fileio ( int sector , int numsectors , char *buffer , cryptvol *cv , int iorop );
78: int MapDosError ( int error );
79: int dophysblock2 ( PIOP iop , int sector , int numsectors , char *buffr , cryptvol *cv , USHORT iorop );
80: int dophysblock ( PIOP iop , int sector , int numsectors , char *buffr , cryptvol *cv , USHORT iorop );
81: void readlogical ( PIOP iop , int temp_block , int num_sectors , char *buffer , cryptvol *cv );
82: void writelogical ( PIOP iop , int temp_block , int num_sectors , char *buffer , cryptvol *cv );
83: BOOL OnSystemExit ( void );
84: void Post_message ( char *msg , char *header );
85: void ProcessWinMessagesBlueScreen ( void );
86: USHORT OnHalfSec ( PAEP_boot_done aep );
87: void readallpartitions ( MOUNT_STRUCT *mf , BOOL bVerifyOnly );
88: int DiskRead ( PDCB mydcb , PIOP myiop , unsigned int sector , unsigned int numsectors , char *buffr , USHORT iorop );
89: void UsePartitionInfo ( PDCB dcb , PIOP myiop , char *diskbuffer , unsigned int relative , int recursed , int *partnum , MOUNT_STRUCT *mf , BOOL bVerifyOnly );
90: int tryvol ( PDCB dcb , PIOP myiop , partitionrec *pr , MOUNT_STRUCT *mf , cryptvol **pcv );
91: struct cryptvol *checkpartition ( PIOP iop , partitionrec *pr );
92: int cmppart ( PDCB dcb , unsigned int secstart , cryptvol *cv );
93: struct cryptvol *addcryptedpartition ( PIOP iop , char *peek );
94: int tryaddpart ( cryptvol *cv , unsigned int secstart , unsigned int seclast , PDCB device );
95: int unlockdrive ( cryptvol *cv );
96: int lockdrive ( PDCB mydcb , PIOP myiop , int lockmode );
97: int AppAccessBlockDevice ( unsigned int devicenum , unsigned int sectorstart , unsigned int sectorlen , char *buffer , int mode );
98: void drivearrived ( void );
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.