OSDN Git Service

Extend DMH services to delay-loaded DLL clients.
authorKeith Marshall <keithmarshall@users.sourceforge.net>
Wed, 8 May 2013 15:05:29 +0000 (16:05 +0100)
committerKeith Marshall <keithmarshall@users.sourceforge.net>
Wed, 8 May 2013 15:05:29 +0000 (16:05 +0100)
ChangeLog
src/dmhcore.cpp
src/dmhcore.h

index bdca0d6..6a3bac2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2013-05-08  Keith Marshall  <keithmarshall@users.sourceforge.net>
 
+       Extend DMH services to delay-loaded DLL clients.
+
+       * src/dmhcore.h (dmh_bind): New function; declare it.
+       * src/dmhcore.cpp (dmh_bind): Implement it; it provides an API through
+       which the setup tool makes its existing DMH services available to post
+       install hooks in mingw-get-0.dll, which cannot be loaded until after
+       the providing package has been downloaded and unpacked.
+
+2013-05-08  Keith Marshall  <keithmarshall@users.sourceforge.net>
+
        Avoid unnecessary command line globbing in GUI applications.
 
        * src/guimain.cpp src/guistub.cpp (_CRT_glob): Declare as extern "C";
index b3f73f4..f7706f6 100644 (file)
@@ -46,6 +46,16 @@ EXTERN_C void dmh_setpty( HWND );
  */
 static dmhTypeGeneric *dmh = NULL;
 
+EXTERN_C dmhTypeGeneric *dmh_bind( dmhTypeGeneric *dmh_preset )
+{
+  /* Initialisation hook; this is called by the setup tool, to
+   * bind its pre-assigned message handler to the corresponding
+   * service within a dynamically loaded DLL.
+   */
+  if( dmh == NULL ) dmh = dmh_preset;
+  return dmh;
+}
+
 /* Initialisation requires this constructor.
  */
 dmhTypeGeneric::dmhTypeGeneric( const char* name ):progname( name ){}
index 9b12f95..aea08e4 100644 (file)
@@ -5,7 +5,7 @@
  * $Id$
  *
  * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
- * Copyright (C) 2009, 2012, MinGW.org Project
+ * Copyright (C) 2009, 2012, 2013, MinGW.org Project
  *
  *
  * Declaration of the classes on which the implementation of the
@@ -29,6 +29,7 @@
 #define DMHCORE_H  1
 
 #include "dmh.h"
+#include <stdarg.h>
 
 class dmhTypeGeneric
 {
@@ -47,4 +48,6 @@ class dmhTypeGeneric
     static const char *notification_format;
 };
 
+EXTERN_C dmhTypeGeneric *dmh_bind( dmhTypeGeneric* );
+
 #endif /* DMHCORE_H: $RCSfile$: end of file */