🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.web
Article #609

Problems with simple Apache module dll

#609
From: Matt Lowe
Date: Fri, 19 May 2006 15:17
68 lines
2360 bytes
I'm trying to build a simple test module for Apache 2.2 -- just a plain old 
dll, no WebBroker or WebSnap or any of that.

When I try to load the module, I get the following error:

"Can't Locate API module structure 'hello_module' in file 
C:/Apache/modules/HelloModule.dll"

So far as I can tell, everything is set up correctly to export hello_module. 
(When I build the dll, Depends shows that the symbol "_hello_module" is 
being exported.)

So is there a problem with this symbol name? Or is there something else I'm 
missing?

The code for the module looks like this:

--Unit1.cpp--
#include <windows.h>
#include "httpd.h"
#include "http_config.h"
#include "http_log.h"

#pragma argsused
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* 
lpReserved)
{
    return 1;
}

extern "C" {

static int  hello_handler(request_rec* r)
{
    ap_log_error(APLOG_MARK,APLOG_ERR,OK,NULL,"Testing hello handler");
    return OK;
}

static void  hello_hooks(apr_pool_t* pool)
{
    ap_hook_handler(hello_handler, NULL, NULL, APR_HOOK_MIDDLE);
}

module AP_MODULE_DECLARE_DATA hello_module =
{
    STANDARD20_MODULE_STUFF,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    hello_hooks
};

}

--

And the interesting part of my httpd.conf looks like this:

LoadModule hello_module modules/HelloModule.dll
<Location /helloc>
 SetHandler hello-handler
</Location>

-- 
Matt Lowe
Milsoft Utility Solutions 
Technical Details
Message-ID: <446de17a$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,bbf30dcf8482d832,start
X-Google-Attributes: gidfeeec,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Matt Lowe" <dontspammatt@milsoft.com>
Newsgroups: borland.public.cppbuilder.internet.web
Subject: Problems with simple Apache module dll
Date: Fri, 19 May 2006 10:17:02 -0500
Lines: 70
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 69.39.34.98
Message-ID: <446de17a$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1148051834 69.39.34.98 (19 May 2006 08:17:14 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail