F
Fedor Buyakov
hello all
i have a specific question according hiding unmanaged (native) types
in metadata for assemblies generated by c++ with managed extensions. i
understand what these types are nedeed in metadata for runtime but why
to do it public?
is code will run correctly if i make these types private for assembly?
there is no way to do so from IDE or by some compiler option but i can
edit assembly file directly in hex editor and change flag according
specified type.
all unmanaged types in metadata have flags 0x109, ie:
"public sealed class <UNMANAGED TYPE NAME> : System.ValueType".
if i replace bytes 09 01 for 10 01 for specified type's flag i will
have:
"private sealed class <UNMANAGED TYPE NAME> : System.ValueType".
hurrah! we have a hidden type but it's still present in the manifest
and i think this will no break runtime (my first experience shows what
all is ok).
this workaround will especially useful for component developers who
need to wrap some native (eg. win32api) code to .Net interface.
any comments?
i have a specific question according hiding unmanaged (native) types
in metadata for assemblies generated by c++ with managed extensions. i
understand what these types are nedeed in metadata for runtime but why
to do it public?
is code will run correctly if i make these types private for assembly?
there is no way to do so from IDE or by some compiler option but i can
edit assembly file directly in hex editor and change flag according
specified type.
all unmanaged types in metadata have flags 0x109, ie:
"public sealed class <UNMANAGED TYPE NAME> : System.ValueType".
if i replace bytes 09 01 for 10 01 for specified type's flag i will
have:
"private sealed class <UNMANAGED TYPE NAME> : System.ValueType".
hurrah! we have a hidden type but it's still present in the manifest
and i think this will no break runtime (my first experience shows what
all is ok).
this workaround will especially useful for component developers who
need to wrap some native (eg. win32api) code to .Net interface.
any comments?