It is perfectly legal (but I can't quote the part of the spec that states
it, although Lidin does) for a static method to be global--in this case, it
is actually scoped by the singleton "<Module>" type that all modules
implicitly have defined on their behalf by the runtime. So, if I understand
your question correctly, this isn't an invalid TypeRef at all.
Ted Neward
{.NET || Java} Course Author & Instructor, DevelopMentor
(http://www.develop.com)
http://www.javageeks.com/tneward
http://www.clrgeeks.com/tneward
----- Original Message -----
From: "Brent E. Rector" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 11, 2002 7:33 PM
Subject: [DOTNET] Partition II Metadata Spec question
> Using VS.NET, I created a MFC Application project. The *only* change I
> made was to switch on the /CLR command line option (which then forces
> you to turn a few others off). This produces a single module .EXE
> managed assembly containing with managed code and unmanaged data.
> PEVerify /MD states that the metadata is valid. The application even
> runs successfully. However, upon inspection, there appears to be an
> invalid TypeRef. ILDASM /ADV shows the following:
>
> TypeRef #17 (01000011)
> -------------------------------------------------------
> Token: 0x01000011
> ResolutionScope: 0x00000000
> TypeRefName: COccManager
>
> Note the nil resolution scope. However, there is no EXPORTEDTYPE table
> in this single-module assembly. The type CoccManager is also never
> defined in the assembly. In fact, this type seems to only be referenced
> once in the entire application. Here is the ILDASM for the reference. It
> is a global function method parameter:
>
> Method #154
> -------------------------------------------------------
> MethodName: AfxEnableControlContainer (0600009A)
> Flags : [Public] [Static] [ReuseSlot] [PinvokeImpl]
> [HasSecurity] (00006016)
> RVA : 0x000075ee
> ImplFlags : [Native] [Unmanaged] [PreserveSig]
> (00000085)
> CallCnvntn: [DEFAULT]
> ReturnType: CMOD_OPT
> System.Runtime.CompilerServices.CallConvCdecl Void
> 1 Arguments
> Argument #1: Ptr ValueClass COccManager
> CustomAttribute #1 (0c00007e)
> -------------------------------------------------------
> CustomAttribute Type: 0a00000b
> CustomAttributeName:
> System.Security.SuppressUnmanagedCodeSecurityAttribute :: instance void
> .ctor()
> Length: 4
> Value : 01 00 00 00
> > <
> ctor args: ()
>
> How the heck I am suppose to resolve this TypeRef? Thanks in advance for
> any clues?
>
>
> -- Brent Rector, .NET Wise Owl
> Demeanor for .NET - an obfuscation utility
> http://www.wiseowl.com/Products/Products.aspx
>
> You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
> subscribe to other DevelopMentor lists at http://discuss.develop.com.
>
You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.