[MPlayer-dev-eng] [PATCH] Win32 loader support for OS/2

KO Myung-Hun komh at chollian.net
Wed Feb 10 10:54:49 CET 2010


Hi/2.

Reimar Döffinger wrote:
> On Tue, Feb 09, 2010 at 11:12:06PM +0900, KO Myung-Hun wrote:
>>>> +#ifdef DEBUG_QTX_API
>>>> +    printf("addr = %p, cb = %d, fl = %08X : ", p, cb, fl);
>>>> +    if(fl&   0x10)
>>>> +        printf("COMMIT ");
>>>> +    if(fl&   0x2000 )
>>>> +        printf("SHARED ");
>>>> +    if(fl&   0x4000)
>>>> +        printf("FREE ");
>>>> +    if(fl&   0x10000)
>>>> +        printf("BASE ");
>>>> +    if(fl&   0x01)
>>>> +        printf("READ ");
>>>> +    if(fl&   0x02)
>>>> +        printf("WRITE ");
>>>> +    if(fl&   0x04)
>>>> +        printf("EXEC ");
>>>> +    if(fl&   0x08)
>>>> +        printf("GUARD ");
>>>> +    printf("\n");
>>>> +#endif
>>>
>>> is that necessary?
>>>
>>
>> Of course for debugging.
>
> Let me rephrase that: Why would we need OS/2 specific debugging code in SVN?
> Does anyone intend to improve QTX support, let alone on OS/2?
>

Hmm... If so, should not OS/2 specific codes be debugged ?
And improving QTX support and OS/2 debugging are not relevant.

>>>> +    // Occasionally, ptr with 'EXEC' attr is passed.
>>>> +    // On OS/2, however, malloc() never set 'EXEC' attr.
>>>> +    // So ptr with 'EXEC' attr is invalid.
>>>> +    if(fl&   0x04)
>>>> +        return 1;
>>>
>>> If it's "EXEC" the pointer is not invalid, it does not point
>>> to heap memory though.
>>> So is_allocated_ptr or is_head_ptr or something like that would
>>> be a better name for the function I think.
>>>
>>
>> However the output is 'WARNING! Invalid Ptr handle!'.
>
> Invalid as argument for that function I guess.
>

If so, I think, is_invalid_ptr_handle() would be better.

>>>> @@ -758,6 +802,7 @@
>>>>     int plen=-1;
>>>>     // find the code:
>>>>
>>>> +#ifndef __OS2__
>>>>     dptr=0x62b67ae0;dptr+=2*((reg->eax>>16)&255);
>>>>   //  printf("FUNC: flag=%d ptr=%p\n",dptr[0],dptr[1]);
>>>>     if(dptr[0]&255){
>>>> @@ -792,6 +837,7 @@
>>>>   	  pwrapper=dptr[1];
>>>>         }
>>>>     }
>>>> +#endif
>>>
>>> That whole point is under
>>> DEBUG_QTX_API, which is disabled by default, so IMO don't disable parts
>>> of it doubly - someone who actually needs the debug code can get it
>>> to compile at least as fast as figure out why half of the output is
>>> missing on OS/2 only.
>>>
>>
>> Unforunately it does not work on OS/2. it causes MPlayer crashed.
>
> Maybe, the question is more why it's important to have DEBUG_QTX_API
> working on OS/2.
> Since that is not enabled by default, I'd say it should at least be a
> separate patch, since it's not necessary for simply making the loader
> work on OS/2, only to make the debug stuff work.
>

Ok, in a separate patch.

>> And I don't understand how hard-coded address value, 0x62b67ae0, can
>> be used.
>
> Because the QTX code is always loaded at the same address (or at least should be).

At least, it is wrong on OS/2.

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.0
Under OS/2 Warp 4 for Korean with FixPak #15
On Intel Core2Duo T5500 1.66 GHz with 1 GB RAM

Korean OS/2 User Community : http://www.ecomstation.co.kr

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: loader.diff
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20100210/5924915e/attachment.txt>


More information about the MPlayer-dev-eng mailing list