This is the mail archive of the cygwin-developers mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: LoadLibrary error 487 (was Re: Please test latest developer snapshot)


On Sat, Feb 26, 2011 at 10:42:28PM +0100, Corinna Vinschen wrote:
>On Feb 26 21:26, Corinna Vinschen wrote:
>> On Feb 26 19:45, Corinna Vinschen wrote:
>> > On Feb 26 19:43, Corinna Vinschen wrote:
>> > > On Feb 26 13:23, Christopher Faylor wrote:
>> > > > The other thing we could do is add a flag to thd dll_info struct which says
>> > > > "Use DONT_RESOLVE_DLL_REFERENCES" either in the forkee or always depending
>> > > > on what works for winm.dll.
>> > > 
>> > > That's what I meant above.  It would require a new LoadDLLfuncEx4,
>> > > wouldn't it?  OTOH, LoadDLLfuncEx3 is only referred to via the
>> > > definition of LoadDLLfuncEx2, so it should be simple to redefine.
>> > 
>> > Btw., what is the "fn" argument to LoadDLLfuncEx3 good for?  Given that
>> > it's always 0 it seems pretty useless right now...
>> 
>> Erm... I don't know what fn is supposed to do, but right now it's
>> value is simply used for the error code.  In LoadDLLprime it's put
>> into the upper 8 bytes of the decoration:
>> 
>>   .long (" #n "+" #notimp ") | (((" #err ") & 0xff) <<16) | (((" #fn ") & 0xff) << 24)
>> 
>> And in noload it's simply returned together with the err value:
>> 
>>   [...]
>>   andl    $0xffff0000,%eax# upper word
>>   [...]
>>   pushl   %eax            # Save for later
>>   [...]
>>   popl    %eax            # Get back argument
>>   sarl    $16,%eax        # return value in high order word
>>   jmp     *%edx           # Return
>> 
>> My question is, shouldn't there be an additional
>> 
>>   andl    $0x000000ff,%eax
>> 
>> right before the jmp?  This would also allow to use the fn value
>> for the purpose discussed above.
>
>Here's my final patch, assuming I got that right with LoadDLLfuncEx3 and
>err and fn.  I'm using the fn parameter to LoadDLLfuncEx3 as an 8 bit
>flag value now.  std_dll_init checks if the lowest bit is set, and only
>then it calls LoadLibraryExW.  Is that ok?

I chose to do things a little differently.  I store the flag value once
per dll and got rid of the fn field entirely.  If I was a tad braver,
I'd clean up all of that bit shifting and just store the err and
decoration in separate locations using the appropriate pseudo-op.  Maybe
I'll do that for 1.7.9.

cgf


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]