Don't crash on failing DRIVER_FindFromHDrvr

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Mon Sep 6 16:02:38 CDT 2004


>>>>> "Eric" == Eric Pouech <pouech-eric at wanadoo.fr> writes:

    >> Strange: we don't see the RtlHeapAllocate function. But then I
    >> remember that the application (_impact.exe from the Xilinx ISE suite)
    >> uses the shsmp library for memory allocation
    >> (http://www.microquill.com/smartheap/sh_tspec.htm).
    >> 
    >> So our HeapAlloc get patched by the Microquill code, but probably
    >> HeapValidate dose not get patched and things diverge.
    >> 
    >> Eric, can we do the memory validation perhaps in some other way then
    >> by HeapValidate ?
    Eric> several questions here: - if your theory (about missing
    Eric> HeapValidate func) is right: then I think that this memory manager
    Eric> is rather broken and should be fixed and not Wine - but on the
    Eric> other hand, how could you explain that it did work at some point
    Eric> (ie didn't crash) and did it afterwards ? This doesn't seem too
    Eric> logical to me. Perhaps the smartheap API interception mechanism
    Eric> isn't that stable on Wine.  IMO, you should start looking at the
    Eric> interception code and see if it puts something in place for
    Eric> HeapValidate, then we'll see what we could do (one quickie is to
    Eric> use RtlValidateHeap instead of HeapValidate, but that's *really*
    Eric> ugly).  A+

    Eric> - if your theory (about missing HeapValidate func) is right: 
    Eric>   then I think that this memory manager is rather broken and 
    Eric>   should be fixed and not Wine

We have to deal with a lot of brokenness...

I will try to get in contact with Microquill. But even if they fix it, it
will take some time until there fix propagates into those projects that use
this library and then there are all these old programs out in the wild. And
I think a some big project use this library..

And HeapValidate is not a much used function. For example in our wine tree
only uses winmm/driver.c and winmm/lolvldrv.c use HeapValidate outside the
heap handling itself.

An probably any user of the Microquill libray who had problems with
HeapValidate circumvented the problem in the meantime...

    Eric> - but on the other hand, how could you explain that it did 
    Eric>   work at some point (ie didn't crash) and did it afterwards ? 
    Eric>   This doesn't seem too logical to me. Perhaps the smartheap 
    Eric>   API interception mechanism isn't that stable on Wine.

Well, impact is the end of the tool chain. There were a lot of other
problems, so I didn't look at the impact problem. And it only happens with
wine running as win95/98. This is probably the reason why Xilinx ISE
requests win2k or winxp.

    Eric> IMO, you should start looking at the interception code and 
    Eric> see if it puts something in place for HeapValidate, then we'll 
    Eric> see what we could do (one quickie is to use RtlValidateHeap 
    Eric> instead of HeapValidate, but that's *really* ugly).

I tried the other way. Using RtlAllocateHeap also showed the problem. But
when I did a GetProcAddres on RtlAllocateHeap, things worked as expected
(the trace showed a RtlAllocateHeap and the following Heapvalidate reported
success).

Is using GetProcAddress on HeapAllocate an acceptable solution for that
problem? 

Bye
-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------



More information about the wine-devel mailing list