How can I call a dll "inside" another process?

Nomad nomad*** at ***freemail.absa.co.za
Sat Feb 15 18:30:44 CET 2003


On Tue, 11 Feb 2003 22:03:03 -0800, Dennis Lee Bieber
<wlfraed at ix.netcom.com> wrote:

>Nomad fed this fish to the penguins on Tuesday 11 February 2003 01:58 
>am:
>
>
>> OK, this is the picture.  I have a mailserver running, and the
>> mailserver has loaded a "plugin" DLL that I've written to wrap certain
>> API calls that the DLL, as an inprocess module, has access to.  These
>> API calls are not exposed to the world at large, hence the need for my
>> wrapper.
>> 
>> So, I thought that I'd try to just export the wrapper functions and
>> call them easily from python using ctypes.  Of course the trouble here
>> is that ctypes is loading a fresh instance of the DLL, and not
>> interfacing within the mail server's process.
>>
>        Isn't that the definition of "inprocess"? That it is loaded as part of 
>the process specific memory space?

Yeah, the trouble is that I want to cross the process boundary.  Mike
Fletcher kindly nudged my newbie memory onto the fact that that's what
IPC is all about, and gave me a list of possible options, namely
either Corba, COM, RPC, XMLRPC and SOAP, or manually dealing with such
things as named pipes, memory-mapped files, or shared memory.

As much as I would eventually like to get the hang of the lower level
stuff like shared memory, named pipes (and I think mailslots also)
aren't fully useable from Win9x, so they're out.  Although I can see
where memory-mapped files are useful, I don't see how I could call
'remote' functions using them, so they're probably out too.

SOAP and XML-RPC, while interesting for other jobs, don't seem to be
the best fit for local jobs.

So I'm left with COM and RPC, neither of which I've tinkered with in
C/C++, and although I've used COM from Python (and other languages
that I won't mention here), I don't know how I'd set up PRC from
within Python.

Does anyone know of any nice tuts for both Python and C/C++ based RPC
implementation.  I've looked through MSDN, but they keep going on
about MIDL, and I'd rather use something like Mingw -- AFAIK doesn't
have MIDL.

Basically, all I need initially is to call a couple of "remote"
functions and get back the results -- nothing too complex.  I just
need a little guidance to boot me off in the right direction ;-)

TIA for any URLs and pointers.


-- 
Nomad

Wondering of the vast emptyness of the 'net
in search of something cool.




More information about the Python-list mailing list