1 |
werner |
37 |
/* wptCryptdisk.h |
2 |
|
|
* Copyright (C) 2004 Timo Schulz |
3 |
|
|
* |
4 |
|
|
* This file is part of WinPT. |
5 |
|
|
* |
6 |
|
|
* WinPT is free software; you can redistribute it and/or modify |
7 |
|
|
* it under the terms of the GNU General Public License as published by |
8 |
|
|
* the Free Software Foundation; either version 2 of the License, or |
9 |
|
|
* (at your option) any later version. |
10 |
|
|
* |
11 |
|
|
* WinPT is distributed in the hope that it will be useful, |
12 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
|
|
* GNU General Public License for more details. |
15 |
|
|
* |
16 |
|
|
* You should have received a copy of the GNU General Public License |
17 |
|
|
* along with WinPT; if not, write to the Free Software Foundation, |
18 |
|
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
19 |
|
|
*/ |
20 |
|
|
#ifndef WPT_CRYPTDISK_H |
21 |
|
|
#define WPT_CRYPTDISK_H |
22 |
|
|
|
23 |
|
|
#define FILE_DEVICE_FILE_DISK 0x8000 |
24 |
|
|
#define IOCTL_FILE_DISK_OPEN_FILE CTL_CODE(FILE_DEVICE_FILE_DISK, 0x800, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) |
25 |
|
|
#define IOCTL_FILE_DISK_CLOSE_FILE CTL_CODE(FILE_DEVICE_FILE_DISK, 0x801, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) |
26 |
|
|
#define IOCTL_FILE_DISK_QUERY_FILE CTL_CODE(FILE_DEVICE_FILE_DISK, 0x802, METHOD_BUFFERED, FILE_READ_ACCESS) |
27 |
|
|
|
28 |
|
|
#define DISK_DEFSIZE 32 /*MB*/ |
29 |
|
|
|
30 |
|
|
enum cmd_t { |
31 |
|
|
CMD_MOUNT =0, |
32 |
|
|
CMD_NEW =1, |
33 |
|
|
CMD_UMOUNT =2, |
34 |
|
|
CMD_UMOUNT2 =3, |
35 |
|
|
}; |
36 |
|
|
|
37 |
|
|
struct private_ofi_s { |
38 |
|
|
INT forced; |
39 |
|
|
INT cmd; |
40 |
|
|
INT devnum; |
41 |
|
|
CHAR drvlet; |
42 |
|
|
LARGE_INTEGER filesize; |
43 |
|
|
BOOLEAN readonly; |
44 |
|
|
USHORT flen; |
45 |
|
|
UCHAR fname[MAX_PATH+1]; |
46 |
|
|
}; |
47 |
|
|
|
48 |
|
|
typedef struct _OPEN_FILE_INFORMATION { |
49 |
|
|
LARGE_INTEGER FileSize; |
50 |
|
|
BOOLEAN ReadOnly; |
51 |
|
|
USHORT FileNameLength; |
52 |
|
|
UCHAR FileName[1]; |
53 |
|
|
} OPEN_FILE_INFORMATION, *POPEN_FILE_INFORMATION; |
54 |
|
|
|
55 |
|
|
struct mount_list_s { |
56 |
|
|
struct mount_list_s * next; |
57 |
|
|
char drive[8]; |
58 |
|
|
LARGE_INTEGER size; |
59 |
|
|
int rdonly; |
60 |
|
|
int devnum; |
61 |
|
|
int ttl; |
62 |
|
|
}; |
63 |
|
|
typedef struct mount_list_s * mount_list_t; |
64 |
|
|
|
65 |
|
|
|
66 |
|
|
/*-- wptCryptdisk.cpp --*/ |
67 |
|
|
int cryptdisk_unmount (char drivelet, int forced); |
68 |
|
|
int cryptdisk_available (void); |
69 |
|
|
void cryptdisk_cleanup (void); |
70 |
|
|
int cryptdisk_serv_run (void); |
71 |
|
|
BOOL CALLBACK cryptdisk_mount_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, |
72 |
|
|
LPARAM lparam); |
73 |
|
|
BOOL CALLBACK cryptdisk_umount_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, |
74 |
|
|
LPARAM lparam); |
75 |
|
|
BOOL CALLBACK cryptdisk_new_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, |
76 |
|
|
LPARAM lparam); |
77 |
|
|
|
78 |
twoaday |
73 |
#endif /* WPT_CRYPTDISK_H */ |