[Mono-dev] [PATCH] New managed code for unmanaged (Win32)resourcehandling (SRE, PEAPI, MCS)

Marek Safar marek.safar at seznam.cz
Wed Mar 8 16:45:43 EST 2006


Hello,
>> My concern was not about speed, but about reliability. I just don't
>> believe it is worthwhile
>> to utilize file system when it can be done in memory.
>> Are you sure that the filename will be unique even when you run several
>> instances of mcs simultaneously ?
>
> Now I understand that we did not understand each other previously 
> regarding
> this question.:) I was speaking about .res to resource table conversion
> while you were speaking about the resource file generated by mcs.
>
> Several moths ago I wanted to modify GetTempFileName to use a 16-bit 
> suffix
> to be fully MS.NET compatible but the result of the debate was to keep 
> the
> 32-bit one as Linux has a single temp directory while Windows has 
> per-user
> temp directories so a 16-bit suffix were possiblie insufficient while a
> 32-bit is likely to be enough. So I belive that mcs can obtain a 
> unique file
> name. If not I think it is GetTempFileName that should be modified.
>
> I prefer using temporary resource files because this way we don't need
> non-public Mono-only functionality in SRE as we can use the public
> DefineUnmanagedResource method. I think that it's reliable.
Fair enough.
>
>> Yes, you can place there any files which you require for your test case.
>> It's good practice to use same file name as is name of test file, just
>> add some prefix.
>
> OK. Is it OK if I upload some tests for these expected error codes to SVN
> before they are available in mcs?
It is not common practice but you can. However, don't forget to update 
know-issues- files.

>> You are saying that all these files are not used by corlib ?
>> ... (file names)
>
> Please have a look at the modified corlib.dll.sources, 
> PEAPI.dll.sources and
> mcs.exe.sources and you will see what files are needed by these 
> assemblies.
> There are no unnecessary classes included in any of these lists so you 
> can
> compare them.
>
> There are some basic, infrastructural classes like ResourceNode and
> ResourceStream that are common. PEAPI only uses .res to resource table
> conversion classes. mcs only uses .res generation classes with version 
> info
> and icon support. SRE is the most compilcated it can convert .res to
> resource table and generate version info resource but that version info
> resource is a bit different than the one that is generated by mcs. So SRE
> has no icon support that means that mcs uses about 7 files that are 
> not used
> by SRE. And of course a lot of files used by SRE are not required by mcs
> that are about 14 files.
I found that only 'DefaultResource' is used in mcs and all used 
properties are of simple types.
I know there are internal dependencies but I still think that the list 
can be reduced.

Marek



More information about the Mono-devel-list mailing list