Changeset 313 in Main for trunk/Server/module.c


Ignore:
Timestamp:
Oct 14, 2024, 8:22:06 AM (5 weeks ago)
Author:
Nishi
Message:

dll does not work somehow

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Server/module.c

    r312 r313  
    3030#ifdef __OS2__
    3131#define INCL_DOSMODULEMGR
     32#define INCL_DOSERRORS
    3233#include <os2.h>
    3334#else
     
    4344        void* lib;
    4445        char tmp[512];
    45         unsigned long l;
     46#ifdef __OS2__
     47        HMODULE mod;
     48#endif
    4649        chdir(config.server_root);
    4750#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
    4851#ifdef __OS2__
    49         lib = NULL;
    50         l = (unsigned long)lib;
    51         DosLoadModule(tmp, 512, path, &l);
     52        if(DosLoadModule(tmp, 512, path, &mod) != NO_ERROR){
     53                return NULL;
     54        }
     55        lib = (void*)mod;
    5256#else
    5357        lib = LoadLibraryA(path);
     
    6872#ifdef __OS2__
    6973        void* ret;
    70         DosQueryProcAddr((unsigned long)mod, 0, sym, (PFN*)&ret);
     74        APIRET rc;
     75        if((rc = DosQueryProcAddr((HMODULE)mod, 0, sym, (PFN*)&ret)) != NO_ERROR){
     76                cm_log("Module", "OS/2 error %d", (int)rc);
     77                return NULL;
     78        }
    7179        return ret;
    7280#else
     
    8189        tw_mod_init_t mod_init = (tw_mod_init_t)tw_module_symbol(mod, "mod_init");
    8290        if(mod_init == NULL) {
    83                 cm_log("Module", "Could not init a module");
     91                cm_log("Module", "Could not find a init call");
    8492                return 1;
    8593        } else {
Note: See TracChangeset for help on using the changeset viewer.