OSDN Git Service

2005-09-04 Perry
authorPerry Rapp <elsapo@users.sourceforge.net>
Sun, 4 Sep 2005 22:23:32 +0000 (22:23 +0000)
committerPerry Rapp <elsapo@users.sourceforge.net>
Sun, 4 Sep 2005 22:23:32 +0000 (22:23 +0000)
 Cosmetic: Perry adding comments about usage of dllpstub
 Src: dllpstub.cpp dllpstub.h markdown.h

Src/dllpstub.cpp
Src/dllpstub.h
Src/markdown.h
Src/readme.txt

index ba9ba5e..b8ade9f 100644 (file)
@@ -63,6 +63,9 @@ void DLLPSTUB::Throw(LPCSTR name, HMODULE handle, DWORD dwError, BOOL bFreeLibra
  */
 HMODULE DLLPSTUB::Load()
 {
+       // DLLPSTUB assumes that it is embedded in its owner
+       // followed by a char array of the DLL name to load
+       // so it access the char array via *(this + 1)
        LPCSTR *proxy = (LPCSTR *) (this + 1);
        HMODULE handle = NULL;
        if (LPCSTR name = *proxy)
@@ -72,6 +75,10 @@ HMODULE DLLPSTUB::Load()
                        handle = LoadLibraryA(name);
                        if (handle)
                        {
+                               // If any of the version members are non-zero
+                               // then we require that DLL export "DllGetVersion"
+                               // and report a version as least as high as our
+                               // version number members
                                if (dwMajorVersion || dwMinorVersion || dwBuildNumber)
                                {
                                        // Is the DLL up to date?
index 870c2eb..c04cf04 100644 (file)
 
 /**
  * @brief stub class to help implement DLL proxies
+ *
+ * A DLLPSTUB must be embedded in an object followed immediately by a 
+ * char array name of the DLL to load
+ * Eg
+ *  ...
+ *  DLLPSTUB stub;
+ *  char dllname[50];
+ *
+ * If dll is not found, DLLPSTUB::Load will throw an exception
+ * If any of dwMajorVersion, dwMinorVersion, dwBuildNumber are non-zero
+ * the DLLPSTUB::Load will throw an exception (CO_S_NOTALLINTERFACES) unless
+ * the dll exports DllGetVersion and reports a version at least as high as
+ * requested by these members
  */
 struct DLLPSTUB
 {
index ee02de2..a96342c 100644 (file)
@@ -27,7 +27,7 @@ struct ICONV
 extern struct ICONV::Proxy
 {
 //     ICONV dll proxy
-       DLLPSTUB stub;
+       DLLPSTUB stub; // DLLPSTUB must be followed by char array naming the DLL
        LPCSTR ICONV[&((ICONV*)0)->END - &((ICONV*)0)->BEGIN];
        HMODULE handle;
        struct ICONV *operator->()
index 5ab08f3..ef9c083 100644 (file)
@@ -1,3 +1,7 @@
+2005-09-04 Perry
+ Cosmetic: Perry adding comments about usage of dllpstub
+ Src: dllpstub.cpp dllpstub.h markdown.h
+
 2005-09-04 Kimmo
  PATCH: [ 1281059 ] Avoid uninitialised members in CLanguageSelect
   Submitted by Csaba Raduly