Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing mscorlib.tlb file #16

Open
alesliehughes opened this issue Oct 29, 2013 · 9 comments
Open

Missing mscorlib.tlb file #16

alesliehughes opened this issue Oct 29, 2013 · 9 comments

Comments

@alesliehughes
Copy link

The file tlb needs to be created from mscorlib.dll. However there is currently no easy way to extract an TLB or IDL from it.

This is to support VS2008 express.

@madewokherd
Copy link
Owner

In theory, we should implement regasm and use that, since windows programs may also need this functionality.

@madewokherd
Copy link
Owner

Wine's oleview utility may also be useful for comparing our typelibs to those generated by native.

@madewokherd
Copy link
Owner

Sorry, what we actually want is tlbexp, not regasm.

@madewokherd
Copy link
Owner

OK, turns out there's a .NET API that looks the same as tlbexp: http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.itypelibconverter.convertassemblytotypelib%28v=vs.110%29.aspx

There's also a method in Marshal that gets a typeinfo from a Type: http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshal.getitypeinfofortype%28v=vs.110%29.aspx

I would guess that both tlbexp and the IDispatch methods of Mono's CCW's should be based on this stuff.

@madewokherd
Copy link
Owner

Note the conversion rules are documented here: http://msdn.microsoft.com/en-us/library/xk1120c3(v=vs.110).aspx

@madewokherd
Copy link
Owner

The immediate problem I'm running into is that I don't know exactly what they're hashing to generate the guids. For example, System.Object is this:

[
uuid(81C5FE01-027C-3E1C-98D5-DA9C9862AA21)
]
coclass Object {
[default] interface _Object;
};

The '3' in the third group of digits means it's an md5 hash of something (according to rfc1422), but every variation of 'System' and 'Object' I've come up with shows something different.

@alesliehughes
Copy link
Author

When creating a TLB from a .NET dll, I have observed the following.

When the TBL is created for the first time, new guids are created for each
class which don't have the [guid] attribute.

On subsequent rebuilds, assuming it can find the TLB file, the guids are
reused from the TBL file.
(Using VS)

@madewokherd
Copy link
Owner

According to the documentation, they should be consistent given the same dll, and in many cases even if the dll has been modified.

@madewokherd
Copy link
Owner

With madewokherd/mono@d5f338c this is likely tractable now. That only implemented GUID generation for interfaces, but the code for classes should be available as well. We also have dispatch interfaces, and we should make sure those match.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants