On Tue, 13 Jun 2000, Bob Copeland wrote:
> Hi all,
> 
> I'm new to the list and somewhat new to wine, so I apologize in advance
> if this is too easy, offtopic, or whatever.  Despite much searching,
> I have not been able to find any information relevant to my problem.
> 
> I'm trying to build a shared library that loads a native Win32 DLL 
> using libwine.  I've built code that does the necessary calls to 
> LoadLibrary and such, but I always get a segfault whenever wine 
> accesses NtCurrentTeb().  The teb looks like a valid address but 
> none of the fields in the structure make any sense, so I'm wondering 
> if I'm missing some initialization step.  I've tried calling both 
> MAIN_WineInit and PROCESS_Init within my .so but these don't change
> anything.  I'm using the May 26 source release.
> 
> Has anyone done this before?  Is there any documentation on libwine 
> somewhere that might cover this? 

Depending on what you mean by "a shared library that loads a native Win32 DLL
using libwine", I have done this or something similar. I built a shared library
that loaded a DLL and exported the DLL functions so that they could be executed
from native C code outside of the shared library. I did this with a toy DLL
(Petzold's book EdrTest/EdrLib example Chap 21 in my version). I am currently
writing the HOWTO-winelib documentation (not in any source release but in
current cvs). I was planning to write the DLL section this weekend and include
a simple example of loading a DLL within a shared library. Can you wait that
long? I have to work at a real job during the week and do wine on weekends. I
would prefer not to give the EdrTest/EdrLib example over the web, since it
involves code under MS copyright (they have more lawyers than I have lawyers).
If you have a copy of Petzold, I can send you the other files and you can
probably figure the rest out.

When I got my DLL working, I did not get the same errors that you are getting.
Our minds must be orthogonal, we make completely different errors. :^)
I did not call MAIN_WineInit() or PROCESS_Init() in my shared library. The
initialization code was created by the spec file for the executable and the
spec file for the shared library.

Reply by private e-mail giving more details of what you are trying to do and I
may be able to help more (tomorrow).

-- 
Wilbur Dale
Lumin Software BV
Zandheuvel 52 B
4901 HW Oosterhout (NB)
The Netherlands

phone: +31-(0)162-47.88.42
fax:   +31-(0)162-43.31.52

Reply via email to