1 |
/* GPGOE.c - GnuPG for Outlook Express |
/* GPGOE.c - GnuPG for Outlook Express |
2 |
* Copyright (C) 2001, 2002, 2003, 2006 Timo Schulz |
* Copyright (C) 2001, 2002, 2003, 2006, 2007 Timo Schulz |
3 |
* |
* |
4 |
* This file is part of GPGOE. |
* This file is part of GPGOE. |
5 |
* |
* |
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
* GNU General Public License for more details. |
* GNU General Public License for more details. |
|
* |
|
|
* You should have received a copy of the GNU Lesser General Public License |
|
|
* along with GPGOE; if not, write to the Free Software Foundation, |
|
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
15 |
*/ |
*/ |
16 |
|
|
17 |
#ifdef HAVE_CONFIG_H |
#ifdef HAVE_CONFIG_H |
43 |
/* Supported GPGOE feature modes. */ |
/* Supported GPGOE feature modes. */ |
44 |
int gpgoe_active_modes ATTR_SEC = 0; |
int gpgoe_active_modes ATTR_SEC = 0; |
45 |
|
|
46 |
|
/* FIXME: we currently limit the passphrase to 256 octets. */ |
47 |
char gpgoe_pass_cache[HASH_BUCKETS][256]; |
char gpgoe_pass_cache[HASH_BUCKETS][256]; |
48 |
#ifndef __GNUC__ |
#ifndef __GNUC__ |
49 |
#pragma data_seg() |
#pragma data_seg() |
74 |
} |
} |
75 |
|
|
76 |
|
|
77 |
|
#if 0 |
78 |
/* Quick and dirty check if the dialog is a common dialog |
/* Quick and dirty check if the dialog is a common dialog |
79 |
and the 'File {Open, Save}' style. */ |
and the 'File {Open, Save}' style. */ |
80 |
static int |
static int |
90 |
return -1; |
return -1; |
91 |
return 0; |
return 0; |
92 |
} |
} |
93 |
|
#endif |
94 |
|
|
95 |
|
|
96 |
/* CTB hook procedure. |
/* CTB hook procedure. |
108 |
hwnd = (HWND)wparam; |
hwnd = (HWND)wparam; |
109 |
switch (code) { |
switch (code) { |
110 |
case HCBT_CREATEWND: |
case HCBT_CREATEWND: |
111 |
GetClassName (hwnd, wclass, sizeof (wclass) - 1); |
GetClassName (hwnd, wclass, DIM (wclass) - 1); |
112 |
if (!strcmp (wclass, "ATH_Note")) { |
if (!strcmp (wclass, "ATH_Note")) { |
113 |
oe_proc_old = (WNDPROC) GetWindowLong (hwnd, GWL_WNDPROC); |
oe_proc_old = (WNDPROC) GetWindowLong (hwnd, GWL_WNDPROC); |
114 |
if (!oe_proc_old) |
if (!oe_proc_old) |
138 |
break; |
break; |
139 |
|
|
140 |
case HCBT_ACTIVATE: |
case HCBT_ACTIVATE: |
141 |
#if 0 |
#if 0 /* Disable the attachment related code for now. */ |
142 |
if (plugin_active != NULL && |
if (plugin_active != NULL && |
143 |
WaitForSingleObject (plugin_active, 0) == WAIT_OBJECT_0) { |
WaitForSingleObject (plugin_active, 0) == WAIT_OBJECT_0) { |
|
char wclass[200]; |
|
144 |
|
|
145 |
if (GetClassName (hwnd, wclass, sizeof (wclass)-1) <= 0 || |
if (GetClassName (hwnd, wclass, sizeof (wclass)-1) <= 0 || |
146 |
!strstr (wclass, "#32770") || !is_common_file_dlg (hwnd)) |
!strstr (wclass, "#32770") || !is_common_file_dlg (hwnd)) |