/[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 18 by twoaday, Thu Apr 13 07:41:30 2006 UTC revision 19 by twoaday, Sun Jun 4 10:12:47 2006 UTC
# Line 41  static HWND oe_hwnd = NULL; Line 41  static HWND oe_hwnd = NULL;
41    
42  /* We need a shared section to define variables which  /* We need a shared section to define variables which
43     will keep their values in all address spaces. */     will keep their values in all address spaces. */
44  #ifdef __GNUC__  #ifndef __GNUC__
45  #define ATTR_SEC __attribute__((section (".SHARDAT"), shared))  #pragma  data_seg(".SHARDAT")
 #else  
 #define ATTR_SEC  
 #pragma data_seg(".SHARDAT")  
46  #endif  #endif
47  static int gpgoe_active_modes ATTR_SEC = 0;  /* Supported GPGOE feature modes. */
48    int gpgoe_active_modes ATTR_SEC = 0;
49    
50    char gpgoe_pass_cache[HASH_BUCKETS][256];
51  #ifndef __GNUC__  #ifndef __GNUC__
52  #pragma data_seg()  #pragma data_seg()
53  #endif  #endif
 #undef ATTR_SEC  
   
   
 /* Supported plug-in modes. */  
 enum gpgoe_mode_t {  
     GPGOE_MODE_NORMAL     = 0,  
     GPGOE_MODE_PLAINREPLY = 1      /* decrypt mails before a reply. */  
 };  
54    
55    
56  /* Main DLL entry point. */  /* Main DLL entry point. */
# Line 147  ctb_proc (int code, WPARAM wparam, LPARA Line 139  ctb_proc (int code, WPARAM wparam, LPARA
139          }          }
140          break;          break;
141    
 #if 0  
142      case HCBT_ACTIVATE:      case HCBT_ACTIVATE:
143          if (plugin_active != NULL &&  #if 0
144            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 159  ctb_proc (int code, WPARAM wparam, LPARA Line 151  ctb_proc (int code, WPARAM wparam, LPARA
151              of_proc_old = (WNDPROC)GetWindowLong (hwnd, GWL_WNDPROC);              of_proc_old = (WNDPROC)GetWindowLong (hwnd, GWL_WNDPROC);
152              SetWindowLong (hwnd, GWL_WNDPROC, (LONG)(WNDPROC)of_proc);              SetWindowLong (hwnd, GWL_WNDPROC, (LONG)(WNDPROC)of_proc);
153          }          }
154    #endif
155          break;          break;
 #endif    
156      }        }  
157      return CallNextHookEx (ctb_hook, code, wparam, lparam);      return CallNextHookEx (ctb_hook, code, wparam, lparam);
158  }  }
# Line 172  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 187  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 195  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    
# Line 212  gpgoe_get_active_modes (void) Line 210  gpgoe_get_active_modes (void)
210  {  {
211      return gpgoe_active_modes;      return gpgoe_active_modes;
212  }  }
   

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26