[svn] GpgEX - r4 - trunk/src

svn author marcus cvs at cvs.gnupg.org
Tue Aug 28 14:00:58 CEST 2007


Author: marcus
Date: 2007-08-28 14:00:29 +0200 (Tue, 28 Aug 2007)
New Revision: 4

Modified:
   trunk/src/ChangeLog
   trunk/src/gpgex-class.h
   trunk/src/main.cc
Log:
2007-08-28  Marcus Brinkmann  <marcus at g10code.de>

	* main.cc (DllMain): Change return type to "STADPI" to get an
	extern "C" declaration.
	(_gpgex_debug): Remove lazy initialization cruft.  DllMain is
	called now, and initialization works properly.


Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2007-08-27 23:43:19 UTC (rev 3)
+++ trunk/src/ChangeLog	2007-08-28 12:00:29 UTC (rev 4)
@@ -1,5 +1,10 @@
 2007-08-28  Marcus Brinkmann  <marcus at g10code.de>
 
+	* main.cc (DllMain): Change return type to "STADPI" to get an
+	extern "C" declaration.
+	(_gpgex_debug): Remove lazy initialization cruft.  DllMain is
+	called now, and initialization works properly.
+
 	* Makefile.am (gpgex_LDADD): Add -lole32.
 	* gpgex.def: Rename functions to not carry the @NR thingie.
 	* main.h: Many TRACE macros added.

Modified: trunk/src/gpgex-class.h
===================================================================
--- trunk/src/gpgex-class.h	2007-08-27 23:43:19 UTC (rev 3)
+++ trunk/src/gpgex-class.h	2007-08-28 12:00:29 UTC (rev 4)
@@ -19,7 +19,7 @@
    02110-1301, USA.  */
 
 #ifndef GPGEX_CLASS_H
-#define GPGEX_CLASS_H
+#define GPGEX_CLASS_H	1
 
 #include <windows.h>
 

Modified: trunk/src/main.cc
===================================================================
--- trunk/src/main.cc	2007-08-27 23:43:19 UTC (rev 3)
+++ trunk/src/main.cc	2007-08-28 12:00:29 UTC (rev 4)
@@ -130,7 +130,7 @@
 {
   char *filename;
 
-  /* FIXME: Sanity check due to DllMain not running.  */
+  /* Sanity check.  */
   if (debug_file)
     return;
 
@@ -153,7 +153,10 @@
 debug_deinit (void)
 {
   if (debug_file)
-    fclose (debug_file);
+    {
+      fclose (debug_file);
+      debug_file = NULL;
+    }
 }
 
 
@@ -166,11 +169,6 @@
 
   saved_errno = errno;
 
-#if 1
-  /* FIXME: WTF.  */
-  debug_init ();
-#endif
-
   if (! (debug_flags & flags))
     return;
       
@@ -183,26 +181,14 @@
   LeaveCriticalSection (&debug_lock);
   fflush (debug_file);
 
-#if 1
-  /* FIXME */
-  fclose (debug_file);
-  debug_file = NULL;
-#endif
-
   errno = saved_errno;
 }
 
 
 /* Entry point called by DLL loader.  */
-int WINAPI
+STDAPI
 DllMain (HINSTANCE hinst, DWORD reason, LPVOID reserved)
 {
-  /* FIXME: It seems this is never called!!!  */
-#if 0
-  TRACE2 (DEBUG_INIT, "DllMain", hinst,
-	  "reason=%i, reserved=%p", reason, reserved);
-#endif
-
   if (reason == DLL_PROCESS_ATTACH)
     {
       gpgex_server::instance = hinst;




More information about the Gnupg-commits mailing list