/[gpgoe]/trunk/src/GPGOE.c
ViewVC logotype

Diff of /trunk/src/GPGOE.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 16 by twoaday, Tue Apr 11 06:56:23 2006 UTC revision 19 by twoaday, Sun Jun 4 10:12:47 2006 UTC
# Line 39  static HHOOK ctb_hook = NULL; Line 39  static HHOOK ctb_hook = NULL;
39  /* Outlook Express window handle. */  /* Outlook Express window handle. */
40  static HWND oe_hwnd = NULL;  static HWND oe_hwnd = NULL;
41    
42    /* We need a shared section to define variables which
43       will keep their values in all address spaces. */
44    #ifndef __GNUC__
45    #pragma  data_seg(".SHARDAT")
46    #endif
47    /* Supported GPGOE feature modes. */
48    int gpgoe_active_modes ATTR_SEC = 0;
49    
50    char gpgoe_pass_cache[HASH_BUCKETS][256];
51    #ifndef __GNUC__
52    #pragma data_seg()
53    #endif
54    
55    
56  /* Main DLL entry point. */  /* Main DLL entry point. */
57  BOOL WINAPI  BOOL WINAPI
# Line 112  ctb_proc (int code, WPARAM wparam, LPARA Line 125  ctb_proc (int code, WPARAM wparam, LPARA
125                  oe_hwnd = hwnd;                  oe_hwnd = hwnd;
126          }          }
127    
128          if (!strcmp (wclass, "Outlook Express Browser Class")) {          if ((gpgoe_active_modes & GPGOE_MODE_PLAINREPLY) &&
129                !strcmp (wclass, "Outlook Express Browser Class")) {
130              oe_main_proc_old = (WNDPROC)GetWindowLong (hwnd, GWL_WNDPROC);              oe_main_proc_old = (WNDPROC)GetWindowLong (hwnd, GWL_WNDPROC);
131              if (!oe_main_proc_old)              if (!oe_main_proc_old)
132                  show_error (NULL, "GPGOE", MB_ICONERROR|MB_OK,                  show_error (NULL, "GPGOE", MB_ICONERROR|MB_OK,
# Line 127  ctb_proc (int code, WPARAM wparam, LPARA Line 141  ctb_proc (int code, WPARAM wparam, LPARA
141    
142      case HCBT_ACTIVATE:      case HCBT_ACTIVATE:
143  #if 0  #if 0
144          if (plugin_active != NULL &&          if (plugin_active != NULL &&
145              WaitForSingleObject (plugin_active, 0) == WAIT_OBJECT_0) {              WaitForSingleObject (plugin_active, 0) == WAIT_OBJECT_0) {
146              char wclass[200];              char wclass[200];
147    
# Line 150  ctb_proc (int code, WPARAM wparam, LPARA Line 164  ctb_proc (int code, WPARAM wparam, LPARA
164  int  int
165  gpgoe_initialize (void)  gpgoe_initialize (void)
166  {  {
167        reset_pass_cache ();
168      CreateMutex (NULL, TRUE, "gpgoe");      CreateMutex (NULL, TRUE, "gpgoe");
169      if (GetLastError () == ERROR_ALREADY_EXISTS)      if (GetLastError () == ERROR_ALREADY_EXISTS)
170          return 0;          return 0;
# Line 165  gpgoe_remove (void) Line 180  gpgoe_remove (void)
180  {  {
181      HANDLE hd;      HANDLE hd;
182      int rc;      int rc;
183        
184      hd = CreateMutex (NULL, TRUE, "gpgoe");      hd = CreateMutex (NULL, TRUE, "gpgoe");
185      if (GetLastError() == ERROR_ALREADY_EXISTS) {      if (GetLastError() == ERROR_ALREADY_EXISTS) {
186          oe_hwnd = NULL;          oe_hwnd = NULL;
# Line 173  gpgoe_remove (void) Line 188  gpgoe_remove (void)
188      }      }
189      SetWindowLong (oe_hwnd, GWL_WNDPROC, (LONG)(WNDPROC)oe_proc_old);      SetWindowLong (oe_hwnd, GWL_WNDPROC, (LONG)(WNDPROC)oe_proc_old);
190      rc = UnhookWindowsHookEx (ctb_hook);      rc = UnhookWindowsHookEx (ctb_hook);
191    
192        /* reset global variables. */
193        reset_pass_cache ();
194        gpgoe_active_modes = 0;
195    
196      return rc ? 0 : (int)GetLastError ();      return rc ? 0 : (int)GetLastError ();
197  }  }
198    
199    
200    /* Change the active plug-in modes, enable mode @mode. */
201    void
202    gpgoe_set_active_modes (int mode)
203    {
204        gpgoe_active_modes = mode;
205    }
206    
207    
208    int
209    gpgoe_get_active_modes (void)
210    {
211        return gpgoe_active_modes;
212    }

Legend:
Removed from v.16  
changed lines
  Added in v.19

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26