Remove some instances of `%S` and `%ls` (#78894)
authorAaron Robinson <arobins@microsoft.com>
Tue, 3 Jan 2023 23:24:32 +0000 (15:24 -0800)
committerGitHub <noreply@github.com>
Tue, 3 Jan 2023 23:24:32 +0000 (15:24 -0800)
* Remove unused NativeImagePerfMap

* Allocate enough for UTF8 conversion

* Missed VariantAsString API.
Change local `sFlags` to generic `szTempBuf`

* Remove all "entry point" logging for metadata APIs.

45 files changed:
src/coreclr/debug/ee/controller.cpp
src/coreclr/debug/ee/debugger.cpp
src/coreclr/debug/ee/functioninfo.cpp
src/coreclr/inc/ceesectionstring.h
src/coreclr/inc/clrconfigvalues.h
src/coreclr/jit/importervectorization.cpp
src/coreclr/md/ceefilegen/ceesectionstring.cpp
src/coreclr/md/compiler/assemblymd.cpp
src/coreclr/md/compiler/assemblymd_emit.cpp
src/coreclr/md/compiler/custattr_emit.cpp
src/coreclr/md/compiler/custattr_import.cpp
src/coreclr/md/compiler/disp.cpp
src/coreclr/md/compiler/emit.cpp
src/coreclr/md/compiler/helper.cpp
src/coreclr/md/compiler/import.cpp
src/coreclr/md/compiler/regmeta.cpp
src/coreclr/md/compiler/regmeta_compilersupport.cpp
src/coreclr/md/compiler/regmeta_emit.cpp
src/coreclr/md/compiler/regmeta_import.cpp
src/coreclr/md/compiler/regmeta_vm.cpp
src/coreclr/md/enc/liteweightstgdbrw.cpp
src/coreclr/md/enc/mdinternalrw.cpp
src/coreclr/md/enc/metamodelrw.cpp
src/coreclr/md/runtime/mdinternalro.cpp
src/coreclr/tools/metainfo/mdinfo.cpp
src/coreclr/tools/metainfo/mdinfo.h
src/coreclr/vm/appdomain.cpp
src/coreclr/vm/assembly.hpp
src/coreclr/vm/ceeload.cpp
src/coreclr/vm/ceeload.h
src/coreclr/vm/clsload.cpp
src/coreclr/vm/comcallablewrapper.cpp
src/coreclr/vm/domainassembly.cpp
src/coreclr/vm/domainassembly.h
src/coreclr/vm/excep.cpp
src/coreclr/vm/methodtablebuilder.cpp
src/coreclr/vm/nativeimage.cpp
src/coreclr/vm/peassembly.cpp
src/coreclr/vm/peassembly.h
src/coreclr/vm/peassembly.inl
src/coreclr/vm/pendingload.h
src/coreclr/vm/perfmap.cpp
src/coreclr/vm/perfmap.h
src/coreclr/vm/stringliteralmap.cpp
src/coreclr/vm/syncblk.cpp

index 7400ad4..5c648ca 100644 (file)
@@ -2168,7 +2168,7 @@ void DebuggerController::RemovePatchesFromModule(Module *pModule, AppDomain *pAp
     }
     CONTRACTL_END;
 
-    LOG((LF_CORDB, LL_INFO100000, "DPT::CPFM mod:0x%p (%S)\n",
+    LOG((LF_CORDB, LL_INFO100000, "DPT::CPFM mod:0x%p (%s)\n",
         pModule, pModule->GetDebugName()));
 
     // First find all patches of interest
@@ -7398,14 +7398,14 @@ void DebuggerStepper::TriggerMethodEnter(Thread * thread,
             "See http://team/sites/clrdev/Devdocs/StubManagers.rtf for more information on StubManagers.\n"
             "Stepper this=0x%p, startMethod='%s::%s'\n"
             "---------------------------------\n"
-            "Stub manager log:\n%S"
+            "Stub manager log:\n%s"
             "\n"
             "The thread is now in managed method '%s::%s'.\n"
             "---------------------------------\n",
             this,
             ((m_StepInStartMethod == NULL) ? "unknown" : m_StepInStartMethod->m_pszDebugClassName),
             ((m_StepInStartMethod == NULL) ? "unknown" : m_StepInStartMethod->m_pszDebugMethodName),
-            sLog.GetUnicode(),
+            sLog.GetUTF8(),
             pDesc->m_pszDebugClassName, pDesc->m_pszDebugMethodName
             ));
     }
@@ -8707,8 +8707,8 @@ DebuggerEnCBreakpoint::DebuggerEnCBreakpoint(SIZE_T offset,
     _ASSERTE( jitInfo != NULL );
     // Add and activate the specified patch
     AddBindAndActivateNativeManagedPatch(jitInfo->m_nativeCodeVersion.GetMethodDesc(), jitInfo, offset, LEAF_MOST_FRAME, pAppDomain);
-    LOG((LF_ENC,LL_INFO1000, "DEnCBPDEnCBP::adding %S patch!\n",
-        fTriggerType == REMAP_PENDING ? W("remap pending") : W("remap complete")));
+    LOG((LF_ENC,LL_INFO1000, "DEnCBPDEnCBP::adding %s patch!\n",
+        fTriggerType == REMAP_PENDING ? "remap pending" : "remap complete"));
 }
 
 
@@ -8749,9 +8749,9 @@ TP_RESULT DebuggerEnCBreakpoint::TriggerPatch(DebuggerControllerPatch *patch,
     _ASSERTE(map == MAPPING_EXACT);
 
     LOG((LF_ENC, LL_ALWAYS,
-         "DEnCBP::TP: triggered E&C %S breakpoint: tid=0x%x, module=0x%08x, "
+         "DEnCBP::TP: triggered E&C %s breakpoint: tid=0x%x, module=0x%08x, "
          "method def=0x%08x, version=%d, native offset=0x%x, IL offset=0x%x\n this=0x%x\n",
-         m_fTriggerType == REMAP_PENDING ? W("ResumePending") : W("ResumeComplete"),
+         m_fTriggerType == REMAP_PENDING ? "ResumePending" : "ResumeComplete",
          thread, module, md, m_jitInfo->m_encVersion, offset, currentIP, this));
 
     // If this is a REMAP_COMPLETE patch, then dispatch the RemapComplete callback
index e5b8fde..be97839 100644 (file)
@@ -9335,7 +9335,7 @@ void Debugger::LoadAssembly(DomainAssembly * pDomainAssembly)
     if (CORDBUnrecoverableError(this))
         return;
 
-    LOG((LF_CORDB, LL_INFO100, "D::LA: Load Assembly Asy:0x%p AD:0x%p which:%ls\n",
+    LOG((LF_CORDB, LL_INFO100, "D::LA: Load Assembly Asy:0x%p AD:0x%p which:%s\n",
         pDomainAssembly, pDomainAssembly->GetAppDomain(), pDomainAssembly->GetAssembly()->GetDebugName() ));
 
     if (!CORDebuggerAttached())
@@ -9391,7 +9391,7 @@ void Debugger::UnloadAssembly(DomainAssembly * pDomainAssembly)
     if (CORDBUnrecoverableError(this))
         return;
 
-    LOG((LF_CORDB, LL_INFO100, "D::UA: Unload Assembly Asy:0x%p AD:0x%p which:%ls\n",
+    LOG((LF_CORDB, LL_INFO100, "D::UA: Unload Assembly Asy:0x%p AD:0x%p which:%s\n",
          pDomainAssembly, pDomainAssembly->GetAppDomain(), pDomainAssembly->GetAssembly()->GetDebugName() ));
 
     Thread *thread = g_pEEInterface->GetThread();
@@ -9676,7 +9676,7 @@ void Debugger::UnloadModule(Module* pRuntimeModule,
 
 
 
-    LOG((LF_CORDB, LL_INFO100, "D::UM: unload module Mod:%#08x AD:%#08x runtimeMod:%#08x modName:%ls\n",
+    LOG((LF_CORDB, LL_INFO100, "D::UM: unload module Mod:%#08x AD:%#08x runtimeMod:%#08x modName:%s\n",
          LookupOrCreateModule(pRuntimeModule, pAppDomain), pAppDomain, pRuntimeModule, pRuntimeModule->GetDebugName()));
 
 
@@ -9689,7 +9689,7 @@ void Debugger::UnloadModule(Module* pRuntimeModule,
         DebuggerModule* module = LookupOrCreateModule(pRuntimeModule, pAppDomain);
         if (module == NULL)
         {
-            LOG((LF_CORDB, LL_INFO100, "D::UM: module already unloaded AD:%#08x runtimeMod:%#08x modName:%ls\n",
+            LOG((LF_CORDB, LL_INFO100, "D::UM: module already unloaded AD:%#08x runtimeMod:%#08x modName:%s\n",
                  pAppDomain, pRuntimeModule, pRuntimeModule->GetDebugName()));
             goto LExit;
         }
@@ -9776,7 +9776,7 @@ void Debugger::DestructModule(Module *pModule)
     }
     CONTRACTL_END;
 
-    LOG((LF_CORDB, LL_INFO100, "D::DM: destruct module runtimeMod:%#08x modName:%ls\n",
+    LOG((LF_CORDB, LL_INFO100, "D::DM: destruct module runtimeMod:%#08x modName:%s\n",
          pModule, pModule->GetDebugName()));
 
     // @@@
@@ -10002,7 +10002,7 @@ BOOL  Debugger::LoadClass(TypeHandle th,
     // handle this in SendSystemClassLoadUnloadEvent below by looping through all AppDomains and dispatching
     // events for each that contain this assembly.
 
-    LOG((LF_CORDB, LL_INFO10000, "D::LC: load class Tok:%#08x Mod:%#08x AD:%#08x classMod:%#08x modName:%ls\n",
+    LOG((LF_CORDB, LL_INFO10000, "D::LC: load class Tok:%#08x Mod:%#08x AD:%#08x classMod:%#08x modName:%s\n",
          classMetadataToken, (pAppDomain == NULL) ? NULL : LookupOrCreateModule(classModule, pAppDomain),
          pAppDomain, classModule, classModule->GetDebugName()));
 
@@ -10057,7 +10057,7 @@ void Debugger::UnloadClass(mdTypeDef classMetadataToken,
         return;
     }
 
-    LOG((LF_CORDB, LL_INFO10000, "D::UC: unload class Tok:0x%08x Mod:%#08x AD:%#08x runtimeMod:%#08x modName:%ls\n",
+    LOG((LF_CORDB, LL_INFO10000, "D::UC: unload class Tok:0x%08x Mod:%#08x AD:%#08x runtimeMod:%#08x modName:%s\n",
          classMetadataToken, LookupOrCreateModule(classModule, pAppDomain), pAppDomain, classModule, classModule->GetDebugName()));
 
     Assembly *pAssembly = classModule->GetClassLoader()->GetAssembly();
@@ -14653,10 +14653,6 @@ HRESULT Debugger::UpdateAppDomainEntryInIPC(AppDomain *pAppDomain)
     szName = pADInfo->m_pAppDomain->GetFriendlyNameForDebugger();
     pADInfo->SetName(szName);
 
-    LOG((LF_CORDB, LL_INFO100,
-         "D::UADEIIPC: New name:%ls (AD:0x%x)\n", pADInfo->m_szAppDomainName,
-         pAppDomain));
-
 ErrExit:
     // UnLock the list
     m_pAppDomainCB->Unlock();
index 54c31f5..cf94eab 100644 (file)
@@ -2266,7 +2266,7 @@ void DebuggerMethodInfoTable::ClearMethodsOfModule(Module *pModule)
 
     _ASSERTE(g_pDebugger->HasDebuggerDataLock());
 
-    LOG((LF_CORDB, LL_INFO1000000, "CMOM:mod:0x%x (%S)\n", pModule
+    LOG((LF_CORDB, LL_INFO1000000, "CMOM:mod:0x%x (%s)\n", pModule
         ,pModule->GetDebugName()));
 
     HASHFIND info;
index ed1d41d..2738043 100644 (file)
@@ -39,10 +39,6 @@ class CeeSectionString : public CeeSection {
        StringTableEntry *findStringInsert(
                                StringTableEntry *&entry, _In_z_ LPWSTR targetValue, ULONG hashId);
        void deleteEntries(StringTableEntry *e);
-#ifdef RDATA_STATS
-       int dumpEntries(StringTableEntry *e);
-       void dumpTable();
-#endif
 
   public:
        ~CeeSectionString();
index dd764d7..c177b76 100644 (file)
@@ -486,7 +486,6 @@ RETAIL_CONFIG_DWORD_INFO(EXTERNAL_PerfMapEnabled, W("PerfMapEnabled"), 0, "This
 RETAIL_CONFIG_STRING_INFO(EXTERNAL_PerfMapJitDumpPath, W("PerfMapJitDumpPath"), "Specifies a path to write the perf jitdump file. Defaults to GetTempPathA()")
 RETAIL_CONFIG_DWORD_INFO(EXTERNAL_PerfMapIgnoreSignal, W("PerfMapIgnoreSignal"), 0, "When perf map is enabled, this option will configure the specified signal to be accepted and ignored as a marker in the perf logs.  It is disabled by default")
 RETAIL_CONFIG_DWORD_INFO(EXTERNAL_PerfMapShowOptimizationTiers, W("PerfMapShowOptimizationTiers"), 1, "Shows optimization tiers in the perf map for methods, as part of the symbol name. Useful for seeing separate stack frames for different optimization tiers of each method.")
-RETAIL_CONFIG_STRING_INFO(EXTERNAL_NativeImagePerfMapFormat, W("NativeImagePerfMapFormat"), "Specifies the format of native image perfmap files generated by crossgen.  Valid options are RVA or OFFSET.")
 #endif
 
 RETAIL_CONFIG_STRING_INFO(EXTERNAL_StartupDelayMS, W("StartupDelayMS"), "")
index 3057c78..dc8c685 100644 (file)
@@ -845,7 +845,7 @@ GenTree* Compiler::impSpanEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO*
     {
         // check for fake "" first
         cnsLength = 0;
-        JITDUMP("Trying to unroll MemoryExtensions.Equals|SequenceEqual|StartsWith(op1, \"\")...\n", str)
+        JITDUMP("Trying to unroll MemoryExtensions.Equals|SequenceEqual|StartsWith(op1, \"\")...\n")
     }
     else
     {
index 8c640a4..5ae878a 100644 (file)
@@ -28,37 +28,8 @@ void CeeSectionString::deleteEntries(StringTableEntry *e)
     delete e;
 }
 
-#ifdef RDATA_STATS
-int CeeSectionString::dumpEntries(StringTableEntry *e)
-{
-    if (!e)
-        return 0;
-    else {
-        printf("    HashId: %d, value: %S\n", e->m_hashId, computOffset(e->m_offset));
-        return dumpEntries(e->m_next) + 1;
-    }
-}
-
-void CeeSectionString::dumpTable()
-{
-    int sum = 0, count = 0;
-    for (int i=0; i < MaxRealEntries; i++) {
-        if (stringTable[i]) {
-            printf("Bucket %d\n", i);
-            printf("Total size: %d\n\n",
-                    count = dumpEntries(stringTable[i]));
-            sum += count;
-        }
-    }
-    printf("Total number strings: %d\n\n", sum);
-}
-#endif
-
 CeeSectionString::~CeeSectionString()
 {
-#ifdef RDATA_STATS
-    dumpTable();
-#endif
     for (int i=0; i < MaxRealEntries; i++)
         deleteEntries(stringTable[i]);
 }
index a22d5cc..bbd916b 100644 (file)
@@ -38,10 +38,6 @@ STDMETHODIMP RegMeta::GetAssemblyProps(       // S_OK or error.
     AssemblyRec *pRecord;
     CMiniMdRW   *pMiniMd = &(m_pStgdb->m_MiniMd);
 
-    LOG((LOGMD, "RegMeta::GetAssemblyProps(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        mda, ppbPublicKey, pcbPublicKey, pulHashAlgId, szName, cchName, pchName, pMetaData,
-        pdwAssemblyFlags));
-
     LOCKREAD();
 
     _ASSERTE(TypeFromToken(mda) == mdtAssembly && RidFromToken(mda));
@@ -102,10 +98,6 @@ STDMETHODIMP RegMeta::GetAssemblyRefProps(    // S_OK or error.
     AssemblyRefRec  *pRecord;
     CMiniMdRW   *pMiniMd = &(m_pStgdb->m_MiniMd);
 
-    LOG((LOGMD, "RegMeta::GetAssemblyRefProps(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        mdar, ppbPublicKeyOrToken, pcbPublicKeyOrToken, szName, cchName,
-        pchName, pMetaData, ppbHashValue, pdwAssemblyRefFlags));
-
     LOCKREAD();
 
     _ASSERTE(TypeFromToken(mdar) == mdtAssemblyRef && RidFromToken(mdar));
@@ -156,9 +148,6 @@ STDMETHODIMP RegMeta::GetFileProps(     // S_OK or error.
     FileRec   *pRecord;
     CMiniMdRW *pMiniMd = &(m_pStgdb->m_MiniMd);
 
-    LOG((LOGMD, "RegMeta::GetFileProps(%#08x, %#08x, %#08x, %#08x, %#08x, %#08x, %#08x)\n",
-        mdf, szName, cchName, pchName, ppbHashValue, pcbHashValue, pdwFileFlags));
-
     LOCKREAD();
 
     _ASSERTE(TypeFromToken(mdf) == mdtFile && RidFromToken(mdf));
@@ -198,10 +187,6 @@ STDMETHODIMP RegMeta::GetExportedTypeProps(   // S_OK or error.
     CMiniMdRW   *pMiniMd = &(m_pStgdb->m_MiniMd);
     int         bTruncation=0;          // Was there name truncation?
 
-    LOG((LOGMD, "RegMeta::GetExportedTypeProps(%#08x, %#08x, %#08x, %#08x, %#08x, %#08x, %#08x)\n",
-        mdct, szName, cchName, pchName,
-        ptkImplementation, ptkTypeDef, pdwExportedTypeFlags));
-
     LOCKREAD();
 
     _ASSERTE(TypeFromToken(mdct) == mdtExportedType && RidFromToken(mdct));
@@ -269,12 +254,6 @@ STDMETHODIMP RegMeta::GetManifestResourceProps(   // S_OK or error.
     ManifestResourceRec *pRecord;
     CMiniMdRW   *pMiniMd = &(m_pStgdb->m_MiniMd);
 
-    LOG((LOGMD, "RegMeta::GetManifestResourceProps("
-        "%#08x, %#08x, %#08x, %#08x, %#08x, %#08x, %#08x)\n",
-        mdmr, szName, cchName, pchName,
-        ptkImplementation, pdwOffset,
-        pdwResourceFlags));
-
     LOCKREAD();
 
     _ASSERTE(TypeFromToken(mdmr) == mdtManifestResource && RidFromToken(mdmr));
@@ -308,9 +287,6 @@ STDMETHODIMP RegMeta::EnumAssemblyRefs(       // S_OK or error
     HENUMInternal       **ppmdEnum = reinterpret_cast<HENUMInternal **> (phEnum);
     HENUMInternal       *pEnum;
 
-    LOG((LOGMD, "MD RegMeta::EnumAssemblyRefs(%#08x, %#08x, %#08x, %#08x)\n",
-        phEnum, rAssemblyRefs, cMax, pcTokens));
-
     LOCKREAD();
 
     if (*ppmdEnum == 0)
@@ -353,8 +329,6 @@ STDMETHODIMP RegMeta::EnumFiles(              // S_OK or error
     HENUMInternal       **ppmdEnum = reinterpret_cast<HENUMInternal **> (phEnum);
     HENUMInternal       *pEnum;
 
-    LOG((LOGMD, "MD RegMeta::EnumFiles(%#08x, %#08x, %#08x, %#08x)\n",
-        phEnum, rFiles, cMax, pcTokens));
     LOCKREAD();
 
     if (*ppmdEnum == 0)
@@ -397,9 +371,6 @@ STDMETHODIMP RegMeta::EnumExportedTypes(           // S_OK or error
     HENUMInternal       **ppmdEnum = reinterpret_cast<HENUMInternal **> (phEnum);
     HENUMInternal       *pEnum = NULL;
 
-    LOG((LOGMD, "MD RegMeta::EnumExportedTypes(%#08x, %#08x, %#08x, %#08x)\n",
-        phEnum, rExportedTypes, cMax, pcTokens));
-
     LOCKREAD();
 
     if (*ppmdEnum == 0)
@@ -464,9 +435,6 @@ STDMETHODIMP RegMeta::EnumManifestResources(  // S_OK or error
     HENUMInternal       **ppmdEnum = reinterpret_cast<HENUMInternal **> (phEnum);
     HENUMInternal       *pEnum;
 
-    LOG((LOGMD, "MD RegMeta::EnumManifestResources(%#08x, %#08x, %#08x, %#08x)\n",
-        phEnum, rManifestResources, cMax, pcTokens));
-
     LOCKREAD();
 
     if (*ppmdEnum == 0)
@@ -504,7 +472,6 @@ STDMETHODIMP RegMeta::GetAssemblyFromScope(   // S_OK or error
     HRESULT     hr = NOERROR;
     CMiniMdRW   *pMiniMd = NULL;
 
-    LOG((LOGMD, "MD RegMeta::GetAssemblyFromScope(%#08x)\n", ptkAssembly));
     LOCKREAD();
     _ASSERTE(ptkAssembly);
 
@@ -534,12 +501,8 @@ STDMETHODIMP RegMeta::FindExportedTypeByName( // S_OK or error
     CMiniMdRW   *pMiniMd = NULL;
     LPSTR       szNameUTF8 = NULL;
 
-    LOG((LOGMD, "MD RegMeta::FindExportedTypeByName(%S, %#08x, %#08x)\n",
-        MDSTR(szName), tkEnclosingType, ptkExportedType));
-
     LOCKREAD();
 
-
     // Validate name for prefix.
     if (!szName)
         IfFailGo(E_INVALIDARG);
@@ -574,12 +537,8 @@ STDMETHODIMP RegMeta::FindManifestResourceByName( // S_OK or error
     LPCUTF8     szNameTmp = NULL;
     CMiniMdRW   *pMiniMd = NULL;
 
-    LOG((LOGMD, "MD RegMeta::FindManifestResourceByName(%S, %#08x)\n",
-        MDSTR(szName), ptkManifestResource));
-
     LOCKREAD();
 
-
     // Validate name for prefix.
     if (!szName)
         IfFailGo(E_INVALIDARG);
@@ -624,11 +583,6 @@ STDMETHODIMP RegMeta::FindAssembliesByName( // S_OK or error
         ULONG    *pcAssemblies)       // [OUT] The number of assemblies returned.
 {
 #ifdef FEATURE_METADATA_IN_VM
-    LOG((LOGMD, "RegMeta::FindAssembliesByName(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        szAppBase, szPrivateBin, szAssemblyName, ppIUnk, cMax, pcAssemblies));
-
-    // No need to lock this function. It is going through fusion to find the matching Assemblies by name
-
     return COR_E_NOTSUPPORTED;
 #else //!FEATURE_METADATA_IN_VM
     // Calls to fusion are not supported outside VM
index 84d5f28..476e113 100644 (file)
@@ -41,10 +41,6 @@ STDMETHODIMP RegMeta::DefineAssembly(         // S_OK or error.
     if (szName == NULL || pMetaData == NULL || pma == NULL)
         return E_INVALIDARG;
 
-    LOG((LOGMD, "RegMeta::DefineAssembly(0x%08x, 0x%08x, 0x%08x, %S, 0x%08x, 0x%08x, 0x%08x)\n",
-        pbPublicKey, cbPublicKey, ulHashAlgId, MDSTR(szName), pMetaData,
-        dwAssemblyFlags, pma));
-
     LOCKWRITE();
 
     _ASSERTE(szName && pMetaData && pma);
@@ -115,10 +111,6 @@ STDMETHODIMP RegMeta::DefineAssemblyRef(      // S_OK or error.
     if (szName == NULL || pmar == NULL || pMetaData == NULL)
         return E_INVALIDARG;
 
-    LOG((LOGMD, "RegMeta::DefineAssemblyRef(0x%08x, 0x%08x, %S, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        pbPublicKeyOrToken, cbPublicKeyOrToken, MDSTR(szName), pMetaData, pbHashValue,
-        cbHashValue, dwAssemblyRefFlags, pmar));
-
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -195,9 +187,6 @@ STDMETHODIMP RegMeta::DefineFile(             // S_OK or error.
     FileRec     *pRecord = NULL;
     RID         iRecord;
 
-    LOG((LOGMD, "RegMeta::DefineFile(%S, %#08x, %#08x, %#08x, %#08x)\n",
-        MDSTR(szName), pbHashValue, cbHashValue, dwFileFlags, pmf));
-
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -264,10 +253,6 @@ STDMETHODIMP RegMeta::DefineExportedType(     // S_OK or error.
     LPCSTR      szTypeNameUTF8;
     LPCSTR      szTypeNamespaceUTF8;
 
-    LOG((LOGMD, "RegMeta::DefineExportedType(%S, %#08x, %08x, %#08x, %#08x)\n",
-        MDSTR(szName), tkImplementation, tkTypeDef,
-         dwExportedTypeFlags, pmct));
-
     LOCKWRITE();
 
     // Validate name for prefix.
@@ -354,9 +339,6 @@ STDMETHODIMP RegMeta::DefineManifestResource( // S_OK or error.
     ManifestResourceRec *pRecord = NULL;
     RID       iRecord;
 
-    LOG((LOGMD, "RegMeta::DefineManifestResource(%S, %#08x, %#08x, %#08x, %#08x)\n",
-        MDSTR(szName), tkImplementation, dwOffset, dwResourceFlags, pmmr));
-
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -427,9 +409,6 @@ STDMETHODIMP RegMeta::SetAssemblyProps(       // S_OK or error.
 
     _ASSERTE(TypeFromToken(ma) == mdtAssembly && RidFromToken(ma));
 
-    LOG((LOGMD, "RegMeta::SetAssemblyProps(%#08x, %#08x, %#08x, %#08x %S, %#08x, %#08x)\n",
-        ma, pbPublicKey, cbPublicKey, ulHashAlgId, MDSTR(szName), pMetaData, dwAssemblyFlags));
-
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -457,10 +436,6 @@ STDMETHODIMP RegMeta::SetAssemblyRefProps(    // S_OK or error.
 
     _ASSERTE(TypeFromToken(ar) == mdtAssemblyRef && RidFromToken(ar));
 
-    LOG((LOGMD, "RegMeta::SetAssemblyRefProps(0x%08x, 0x%08x, 0x%08x, %S, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        ar, pbPublicKeyOrToken, cbPublicKeyOrToken, MDSTR(szName), pMetaData, pbHashValue, cbHashValue,
-        dwAssemblyRefFlags));
-
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -492,8 +467,6 @@ STDMETHODIMP RegMeta::SetFileProps(           // S_OK or error.
 
     _ASSERTE(TypeFromToken(file) == mdtFile && RidFromToken(file));
 
-    LOG((LOGMD, "RegMeta::SetFileProps(%#08x, %#08x, %#08x, %#08x)\n",
-        file, pbHashValue, cbHashValue, dwFileFlags));
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -515,9 +488,6 @@ STDMETHODIMP RegMeta::SetExportedTypeProps(        // S_OK or error.
 {
     HRESULT     hr = S_OK;
 
-    LOG((LOGMD, "RegMeta::SetExportedTypeProps(%#08x, %#08x, %#08x, %#08x)\n",
-        ct, tkImplementation, tkTypeDef, dwExportedTypeFlags));
-
     LOCKWRITE();
 
     IfFailGo( _SetExportedTypeProps( ct, tkImplementation, tkTypeDef, dwExportedTypeFlags) );
@@ -537,10 +507,6 @@ STDMETHODIMP RegMeta::SetManifestResourceProps(// S_OK or error.
 {
     HRESULT     hr = S_OK;
 
-    LOG((LOGMD, "RegMeta::SetManifestResourceProps(%#08x, %#08x, %#08x, %#08x)\n",
-        mr, tkImplementation, dwOffset,
-        dwResourceFlags));
-
     _ASSERTE(TypeFromToken(tkImplementation) == mdtFile ||
               TypeFromToken(tkImplementation) == mdtAssemblyRef ||
               tkImplementation == mdTokenNil);
index f0510eb..ba6b47c 100644 (file)
@@ -707,8 +707,6 @@ STDMETHODIMP RegMeta::DefineCustomAttribute(
     CMiniMdRW   *pMiniMd = &m_pStgdb->m_MiniMd;
     int         ixKnown;                // Index of known custom attribute.
 
-    LOG((LOGMD, "RegMeta::DefineCustomAttribute(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", tkOwner, tkCtor,
-            pCustomAttribute, cbCustomAttribute, pcv));
     LOCKWRITE();
 
     _ASSERTE(TypeFromToken(tkCtor) == mdtMethodDef || TypeFromToken(tkCtor) == mdtMemberRef);
index 3f57c67..0363f6b 100644 (file)
@@ -71,8 +71,6 @@ STDMETHODIMP RegMeta::EnumCustomAttributes(
     CustomAttributeRec  *pRec;
     ULONG           index;
 
-    LOG((LOGMD, "RegMeta::EnumCustomAttributes(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-            phEnum, tk, tkType, rCustomAttributes, cMax, pcCustomAttributes));
     LOCKREAD();
 
     if ( *ppmdEnum == 0 )
index eccf3c9..4f88a64 100644 (file)
@@ -140,7 +140,6 @@ HRESULT Disp::OpenScope(                // Return code.
     IUnknown    **ppIUnk)               // [out] Return interface on success.
 {
     HRESULT     hr;
-    LOG((LF_METADATA, LL_INFO10, "Disp::OpenScope(%S, 0x%08x, 0x%08x, 0x%08x)\n", MDSTR(szFileName), dwOpenFlags, riid, ppIUnk));
 
     IMDCommon *pMDCommon = NULL;
 
@@ -205,7 +204,6 @@ Disp::OpenRawScope(
             else
             {
                 pMeta->Release(); // Give back refcount from QI
-                LOG((LOGMD, "{%08x} Found in cache '%S'\n", pMeta, MDSTR(szFileName)));
             }
 
             goto ErrExit;
@@ -239,8 +237,6 @@ Disp::OpenRawScope(
     //  the "other" copy will be released.
     IfFailGo(pMeta->AddToCache());
 
-    LOG((LOGMD, "{%08x} Successfully opened '%S'\n", pMeta, MDSTR(szFileName)));
-
 #if defined(_DEBUG)
     if (CLRConfig::GetConfigValue(CLRConfig::INTERNAL_MD_RegMetaDump))
     {
index 6d04be9..bdfa534 100644 (file)
@@ -44,9 +44,6 @@ STDMETHODIMP RegMeta::DefineMethod(           // S_OK or error.
     LPUTF8      szNameUtf8;
     UTF8STR(szName, szNameUtf8);
 
-    LOG((LOGMD, "MD: RegMeta::DefineMethod(0x%08x, %S, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        td, MDSTR(szName), dwMethodFlags, pvSigBlob, cbSigBlob, ulCodeRVA, dwImplFlags, pmd));
-
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -149,8 +146,6 @@ STDMETHODIMP RegMeta::DefineMethodImpl(       // S_OK or error.
     MethodImplRec   *pMethodImplRec = NULL;
     RID             iMethodImplRec;
 
-    LOG((LOGMD, "MD RegMeta::DefineMethodImpl(0x%08x, 0x%08x, 0x%08x)\n",
-        td, tkBody, tkDecl));
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -207,8 +202,6 @@ STDMETHODIMP RegMeta::SetMethodImplFlags(     // [IN] S_OK or error.
 
     MethodRec   *pMethodRec;
 
-    LOG((LOGMD, "MD RegMeta::SetMethodImplFlags(0x%08x, 0x%08x)\n",
-        md, dwImplFlags));
     LOCKWRITE();
 
     _ASSERTE(TypeFromToken(md) == mdtMethodDef && dwImplFlags != UINT32_MAX);
@@ -241,8 +234,6 @@ STDMETHODIMP RegMeta::SetFieldRVA(            // [IN] S_OK or error.
     RID             iFieldRVA;
     FieldRec        *pFieldRec;
 
-    LOG((LOGMD, "MD RegMeta::SetFieldRVA(0x%08x, 0x%08x)\n",
-        fd, ulRVA));
     LOCKWRITE();
 
     _ASSERTE(TypeFromToken(fd) == mdtFieldDef);
@@ -368,8 +359,6 @@ STDMETHODIMP RegMeta::DefineTypeRefByName(    // S_OK or error.
 #else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
     HRESULT hr = S_OK;
 
-    LOG((LOGMD, "MD RegMeta::DefineTypeRefByName(0x%08x, %S, 0x%08x)\n",
-        tkResolutionScope, MDSTR(szName), ptr));
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -411,11 +400,6 @@ STDMETHODIMP RegMeta::DefineImportType(       // S_OK or error.
     IMetaModelCommon *pAssemImportMetaModelCommon;
     IMetaModelCommon *pImport2MetaModelCommon;
 
-    LOG((LOGMD, "MD RegMeta::DefineImportType(0x%08x, 0x%08x, 0x%08x, 0x%08x, "
-                "0x%08x, 0x%08x, 0x%08x)\n",
-                pAssemImport, pbHashValue, cbHashValue,
-                pImport, tdImport, pAssemEmit, ptr));
-
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -477,8 +461,6 @@ STDMETHODIMP RegMeta::DefineMemberRef(        // S_OK or error
     LPUTF8          szNameUtf8;
     UTF8STR(szName, szNameUtf8);
 
-    LOG((LOGMD, "MD RegMeta::DefineMemberRef(0x%08x, %S, 0x%08x, 0x%08x, 0x%08x)\n",
-        tkImport, MDSTR(szName), pvSigBlob, cbSigBlob, pmr));
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -561,12 +543,6 @@ STDMETHODIMP RegMeta::DefineImportMember(     // S_OK or error.
 #else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
     HRESULT hr = S_OK;
 
-    LOG((LOGMD, "MD RegMeta::DefineImportMember("
-        "0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x,"
-        " 0x%08x, 0x%08x, 0x%08x)\n",
-        pAssemImport, pbHashValue, cbHashValue, pImport, mbMember,
-        pAssemEmit, tkImport, pmr));
-
     // No need to lock this function. All the functions that it calls are public APIs.
 
     _ASSERTE(pImport && pmr);
@@ -673,8 +649,6 @@ STDMETHODIMP RegMeta::DefineEvent(
 #else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
     HRESULT hr = S_OK;
 
-    LOG((LOGMD, "MD RegMeta::DefineEvent(0x%08x, %S, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        td, szEvent, dwEventFlags, tkEventType, mdAddOn, mdRemoveOn, mdFire, rmdOtherMethods, pmdEvent));
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -717,8 +691,6 @@ STDMETHODIMP RegMeta::SetClassLayout(
 
     int         index = 0;              // Loop control.
 
-    LOG((LOGMD, "MD RegMeta::SetClassLayout(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        td, dwPackSize, rFieldOffsets, ulClassSize));
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -853,7 +825,6 @@ STDMETHODIMP RegMeta::DeleteClassLayout(
     RID         ridCur;
     ULONG       index;
 
-    LOG((LOGMD, "MD RegMeta::DeleteClassLayout(0x%08x)\n", td));
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -919,8 +890,6 @@ STDMETHODIMP RegMeta::SetFieldMarshal(
 #else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
     HRESULT hr = S_OK;
 
-    LOG((LOGMD, "MD RegMeta::SetFieldMarshal(0x%08x, 0x%08x, 0x%08x)\n",
-        tk, pvNativeType, cbNativeType));
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -1000,7 +969,6 @@ STDMETHODIMP RegMeta::DeleteFieldMarshal(
     FieldMarshalRec *pFieldMarshRec;
     RID         iFieldMarshRec;
 
-    LOG((LOGMD, "MD RegMeta::DeleteFieldMarshal(0x%08x)\n", tk));
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -1062,8 +1030,6 @@ STDMETHODIMP RegMeta::DefinePermissionSet(
 #ifdef FEATURE_METADATA_EMIT_ALL
     HRESULT hr = S_OK;
 
-    LOG((LOGMD, "MD RegMeta::DefinePermissionSet(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        tk, dwAction, pvPermission, cbPermission, ppm));
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -1169,9 +1135,6 @@ STDMETHODIMP RegMeta::SetRVA(                 // [IN] S_OK or error.
 #else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
     HRESULT hr = S_OK;
 
-    LOG((LOGMD, "MD RegMeta::SetRVA(0x%08x, 0x%08x)\n",
-        md, ulRVA));
-
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -1197,9 +1160,6 @@ STDMETHODIMP RegMeta::GetTokenFromSig(        // [IN] S_OK or error.
 #else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
     HRESULT hr = S_OK;
 
-    LOG((LOGMD, "MD RegMeta::GetTokenFromSig(0x%08x, 0x%08x, 0x%08x)\n",
-        pvSig, cbSig, pmsig));
-
     LOCKWRITE();
 
     _ASSERTE(pmsig);
@@ -1224,7 +1184,6 @@ STDMETHODIMP RegMeta::DefineModuleRef(        // S_OK or error.
 #else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
     HRESULT hr = S_OK;
 
-    LOG((LOGMD, "MD RegMeta::DefineModuleRef(%S, 0x%08x)\n", MDSTR(szName), pmur));
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -1302,8 +1261,6 @@ STDMETHODIMP RegMeta::SetParent(                      // S_OK or error.
 
     MemberRefRec *pMemberRef;
 
-    LOG((LOGMD, "MD RegMeta::SetParent(0x%08x, 0x%08x)\n",
-        mr, tk));
     LOCKWRITE();
 
     _ASSERTE(TypeFromToken(mr) == mdtMemberRef);
@@ -1344,8 +1301,6 @@ STDMETHODIMP RegMeta::GetTokenFromTypeSpec(   // [IN] S_OK or error.
     TypeSpecRec *pTypeSpecRec;
     RID         iRec;
 
-    LOG((LOGMD, "MD RegMeta::GetTokenFromTypeSpec(0x%08x, 0x%08x, 0x%08x)\n",
-        pvSig, cbSig, ptypespec));
     LOCKWRITE();
 
     _ASSERTE(ptypespec);
@@ -1407,10 +1362,6 @@ STDMETHODIMP RegMeta::DefineUserString(       // S_OK or error.
     ULONG       ulMemSize;              // Size of memory taken by the string passed in.
     PBYTE       pb;                     // Pointer into memory allocated by qb.
 
-
-
-    LOG((LOGMD, "MD RegMeta::DefineUserString(0x%08x, 0x%08x, 0x%08x)\n",
-        szString, cchString, pstk));
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -1458,7 +1409,6 @@ STDMETHODIMP RegMeta::DeleteToken(
 #ifdef FEATURE_METADATA_EMIT_ALL
     HRESULT hr = NOERROR;
 
-    LOG((LOGMD, "MD RegMeta::DeleteToken(0x%08x)\n", tkObj));
     LOCKWRITE();
 
     if (!IsValidToken(tkObj))
@@ -1637,8 +1587,6 @@ STDMETHODIMP RegMeta::SetTypeDefProps(        // S_OK or error.
 #else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
     HRESULT hr = S_OK;
 
-    LOG((LOGMD, "RegMeta::SetTypeDefProps(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-            td, dwTypeDefFlags, tkExtends, rtkImplements));
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -1667,9 +1615,6 @@ STDMETHODIMP RegMeta::DefineNestedType(       // S_OK or error.
 #else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
     HRESULT hr = S_OK;
 
-    LOG((LOGMD, "RegMeta::DefineNestedType(%S, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-            MDSTR(szTypeDef), dwTypeDefFlags, tkExtends,
-            rtkImplements, tdEncloser, ptd));
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -1705,8 +1650,6 @@ STDMETHODIMP RegMeta::DefineGenericParam(   // S_OK or error.
     mdToken     tkRet = mdGenericParamNil;
     mdToken tkOwnerType = TypeFromToken(tkOwner);
 
-    LOG((LOGMD, "RegMeta::DefineGenericParam(0x%08x, %d, 0x%08x, %S, 0x%08x, 0x%08x, 0x%08x)\n",
-         tkOwner, ulParamSeq, dwParamFlags, szName, reserved, rtkConstraints, pgp));
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -1794,9 +1737,6 @@ STDMETHODIMP RegMeta::SetGenericParamProps(      // S_OK or error.
 #else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
     HRESULT hr = S_OK;
 
-    LOG((LOGMD, "RegMeta::SetGenericParamProps(0x%08x, 0x%08x, %S, 0x%08x, 0x%08x, 0x%08x)\n",
-         gp, dwParamFlags,szName,reserved,rtkConstraints));
-
     if (reserved != 0)
         IfFailGo(META_E_BAD_INPUT_PARAMETER);
 
@@ -1906,8 +1846,6 @@ STDMETHODIMP RegMeta::GetReferencedTypeSysTables(   // S_OK or error.
 #else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
     HRESULT hr = S_OK;
 
-    LOG((LOGMD, "RegMeta::GetReferencedTypeSysTables()\n"));
-
     ULONG64 refTablesBitVector = 0;
     ULONG count = 0;
     ULONG* ptr = NULL;
@@ -1957,8 +1895,6 @@ STDMETHODIMP RegMeta::DefinePdbStream(      // S_OK or error.
 #else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
     HRESULT hr = S_OK;
 
-    LOG((LOGMD, "RegMeta::DefinePdbStream()\n"));
-
     IfFailGo(m_pStgdb->m_pPdbHeap->SetData(pdbStream));
 
 ErrExit:
@@ -1992,7 +1928,6 @@ STDMETHODIMP RegMeta::DefineDocument(       // S_OK or error.
     UINT32* partsIndexesPtr = NULL;
     char* stringToken = NULL;
 
-    LOG((LOGMD, "RegMeta::DefineDocument(%s)\n", docName));
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -2081,8 +2016,6 @@ STDMETHODIMP RegMeta::DefineSequencePoints(     // S_OK or error.
 #else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
     HRESULT hr = S_OK;
 
-    LOG((LOGMD, "RegMeta::DefineSequencePoints()\n"));
-
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -2118,8 +2051,6 @@ STDMETHODIMP RegMeta::DefineLocalScope(     // S_OK or error.
 #else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
     HRESULT hr = S_OK;
 
-    LOG((LOGMD, "RegMeta::DefineLocalScope()\n"));
-
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -2156,8 +2087,6 @@ STDMETHODIMP RegMeta::DefineLocalVariable(      // S_OK or error.
 #else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
     HRESULT hr = S_OK;
 
-    LOG((LOGMD, "RegMeta::DefineLocalVariable(%s)\n", name));
-
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -2195,8 +2124,6 @@ STDMETHODIMP RegMeta::DefineMethodSpec( // S_OK or error
     MethodSpecRec   *pRecord = 0;       // The MethodSpec record.
     RID             iRecord;            // RID of new MethodSpec record.
 
-    LOG((LOGMD, "MD RegMeta::DefineMethodSpec(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        tkImport, pvSigBlob, cbSigBlob, pmi));
     LOCKWRITE();
 
     // See if this version of the metadata can do Generics
@@ -2275,8 +2202,6 @@ STDMETHODIMP RegMeta::SetMethodProps(         // S_OK or error.
 #else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
     HRESULT hr = S_OK;
 
-    LOG((LOGMD, "RegMeta::SetMethodProps(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-            md, dwMethodFlags, ulCodeRVA, dwImplFlags));
     LOCKWRITE();
 
     if (dwMethodFlags != UINT32_MAX)
@@ -2310,8 +2235,6 @@ STDMETHODIMP RegMeta::SetEventProps(    // S_OK or error.
 #else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
     HRESULT hr = S_OK;
 
-    LOG((LOGMD, "MD RegMeta::SetEventProps(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-         ev, dwEventFlags, tkEventType, mdAddOn, mdRemoveOn, mdFire, rmdOtherMethods));
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -2340,8 +2263,6 @@ STDMETHODIMP RegMeta::SetPermissionSetProps(  // S_OK or error.
     USHORT      sAction = static_cast<USHORT>(dwAction);    // Corresponding DeclSec field is a USHORT.
     mdPermission tkPerm;
 
-    LOG((LOGMD, "MD RegMeta::SetPermissionSetProps(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        tk, dwAction, pvPermission, cbPermission, ppm));
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -2378,8 +2299,6 @@ STDMETHODIMP RegMeta::DefinePinvokeMap(       // Return code.
 #else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
     HRESULT hr = S_OK;
 
-    LOG((LOGMD, "MD RegMeta::DefinePinvokeMap(0x%08x, 0x%08x, %S, 0x%08x)\n",
-        tk, dwMappingFlags, MDSTR(szImportName), mrImportDLL));
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -2500,8 +2419,6 @@ STDMETHODIMP RegMeta::SetPinvokeMap(          // Return code.
     ImplMapRec  *pRecord;
     RID         iRecord;
 
-    LOG((LOGMD, "MD RegMeta::SetPinvokeMap(0x%08x, 0x%08x, %S, 0x%08x)\n",
-        tk, dwMappingFlags, MDSTR(szImportName), mrImportDLL));
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -2545,7 +2462,6 @@ STDMETHODIMP RegMeta::DeletePinvokeMap(       // Return code.
     ImplMapRec  *pRecord;
     RID         iRecord;
 
-    LOG((LOGMD, "MD RegMeta::DeletePinvokeMap(0x%08x)\n", tk));
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -2618,9 +2534,6 @@ HRESULT RegMeta::DefineField(           // S_OK or error.
     LPUTF8      szNameUtf8;
     UTF8STR(szName, szNameUtf8);
 
-    LOG((LOGMD, "MD: RegMeta::DefineField(0x%08x, %S, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        td, MDSTR(szName), dwFieldFlags, pvSigBlob, cbSigBlob, dwCPlusTypeFlag, pValue, cchValue, pmd));
-
     LOCKWRITE();
 
     _ASSERTE(pmd);
@@ -2739,10 +2652,6 @@ HRESULT RegMeta::DefineProperty(
     LPUTF8      szUTF8Property;
     UTF8STR(szProperty, szUTF8Property);
 
-    LOG((LOGMD, "MD RegMeta::DefineProperty(0x%08x, %S, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        td, szProperty, dwPropFlags, pvSig, cbSig, dwCPlusTypeFlag, pValue, cchValue, mdSetter, mdGetter,
-        rmdOtherMethods, pmdProp));
-
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -2842,8 +2751,6 @@ HRESULT RegMeta::DefineParam(
     RID         iRecord;
     ParamRec    *pRecord = 0;
 
-    LOG((LOGMD, "MD RegMeta::DefineParam(0x%08x, 0x%08x, %S, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        md, ulParamSeq, MDSTR(szName), dwParamFlags, dwCPlusTypeFlag, pValue, cchValue, ppd));
     LOCKWRITE();
 
     _ASSERTE(TypeFromToken(md) == mdtMethodDef && md != mdMethodDefNil &&
@@ -2913,8 +2820,6 @@ HRESULT RegMeta::SetFieldProps(           // S_OK or error.
 #else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
     HRESULT hr = S_OK;
 
-    LOG((LOGMD, "MD: RegMeta::SetFieldProps(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        fd, dwFieldFlags, dwCPlusTypeFlag, pValue, cchValue));
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -2952,9 +2857,6 @@ HRESULT RegMeta::SetPropertyProps(      // S_OK or error.
 #else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
     HRESULT hr = S_OK;
 
-    LOG((LOGMD, "MD RegMeta::SetPropertyProps(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        pr, dwPropFlags, dwCPlusTypeFlag, pValue, cchValue, mdSetter, mdGetter,
-        rmdOtherMethods));
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -2983,8 +2885,6 @@ HRESULT RegMeta::SetParamProps(         // Return code.
 #else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
     HRESULT hr = S_OK;
 
-    LOG((LOGMD, "MD RegMeta::SetParamProps(0x%08x, %S, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        pd, MDSTR(szName), dwParamFlags, dwCPlusTypeFlag, pValue, cchValue));
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
index 06da321..9556428 100644 (file)
@@ -219,8 +219,6 @@ STDMETHODIMP RegMeta::DefineEventHelper(    // Return hresult.
     mdEvent     *pmdEvent)              // [OUT] output event token
 {
     HRESULT     hr = S_OK;
-    LOG((LOGMD, "MD RegMeta::DefineEventHelper(0x%08x, %S, 0x%08x, 0x%08x, 0x%08x)\n",
-        td, szEvent, dwEventFlags, tkEventType, pmdEvent));
 
     LOCKWRITE();
 
@@ -251,9 +249,6 @@ STDMETHODIMP RegMeta::AddDeclarativeSecurityHelper(
     short           sAction = static_cast<short>(dwAction);
     mdPermission    tkPerm  = mdTokenNil;
 
-    LOG((LOGMD, "MD RegMeta::AddDeclarativeSecurityHelper(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        tk, dwAction, pValue, cbValue, pmdPermission));
-
     LOCKWRITE();
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
 
index 51f8e42..9c7d4c5 100644 (file)
@@ -43,9 +43,6 @@ STDMETHODIMP RegMeta::EnumMembers(            // S_OK, S_FALSE, or error.
     TypeDefRec      *pRec;
     HENUMInternal   *pEnum = NULL;
 
-    LOG((LOGMD, "MD RegMeta::EnumMembers(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        phEnum, cl, rMembers, cMax, pcTokens));
-
     LOCKREAD();
 
     if ( *ppmdEnum == 0 )
@@ -129,9 +126,6 @@ STDMETHODIMP RegMeta::EnumMembersWithName(    // S_OK, S_FALSE, or error.
     UTF8STR(szName, szNameUtf8);
     LPCUTF8             szNameUtf8Tmp;
 
-    LOG((LOGMD, "MD RegMeta::EnumMembersWithName(0x%08x, 0x%08x, %S, 0x%08x, 0x%08x, 0x%08x)\n",
-        phEnum, cl, MDSTR(szName), rMembers, cMax, pcTokens));
-
     LOCKREAD();
 
     if ( *ppmdEnum == 0 )
@@ -236,9 +230,6 @@ STDMETHODIMP RegMeta::EnumMethods(
     TypeDefRec          *pRec;
     HENUMInternal       *pEnum = NULL;
 
-    LOG((LOGMD, "MD RegMeta::EnumMethods(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        phEnum, td, rMethods, cMax, pcTokens));
-
     LOCKREAD();
 
     if ( *ppmdEnum == 0 )
@@ -333,9 +324,6 @@ STDMETHODIMP RegMeta::EnumMethodsWithName(    // S_OK, S_FALSE, or error.
     UTF8STR(szName, szNameUtf8);
     LPCUTF8             szNameUtf8Tmp;
 
-    LOG((LOGMD, "MD RegMeta::EnumMethodsWithName(0x%08x, 0x%08x, %S, 0x%08x, 0x%08x, 0x%08x)\n",
-        phEnum, cl, MDSTR(szName), rMethods, cMax, pcTokens));
-
     LOCKREAD();
 
     if ( *ppmdEnum == 0 )
@@ -422,9 +410,6 @@ RegMeta::EnumFields(
     TypeDefRec     *pRec;
     HENUMInternal  *pEnum = NULL;
 
-    LOG((LOGMD, "MD RegMeta::EnumFields(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        phEnum, td, rFields, cMax, pcTokens));
-
     LOCKREAD();
 
     if (*ppmdEnum == NULL)
@@ -518,11 +503,6 @@ STDMETHODIMP RegMeta::EnumFieldsWithName(     // S_OK, S_FALSE, or error.
     UTF8STR(szName, szNameUtf8);
     LPCUTF8             szNameUtf8Tmp;
 
-    LOG((LOGMD, "MD RegMeta::EnumFields(0x%08x, 0x%08x, %S, 0x%08x, 0x%08x, 0x%08x)\n",
-        phEnum, cl, MDSTR(szName), rFields, cMax, pcTokens));
-
-
-
     LOCKREAD();
 
     if ( *ppmdEnum == 0 )
@@ -606,11 +586,8 @@ STDMETHODIMP RegMeta::EnumParams(             // S_OK, S_FALSE, or error.
     MethodRec           *pRec;
     HENUMInternal       *pEnum = NULL;
 
-    LOG((LOGMD, "MD RegMeta::EnumParams(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        phEnum, mb, rParams, cMax, pcTokens));
     LOCKREAD();
 
-
     if ( *ppmdEnum == 0 )
     {
         // instantiating a new ENUM
@@ -673,11 +650,6 @@ STDMETHODIMP RegMeta::EnumMemberRefs(         // S_OK, S_FALSE, or error.
     MemberRefRec        *pRec;
     HENUMInternal       *pEnum = NULL;
 
-    LOG((LOGMD, "MD RegMeta::EnumMemberRefs(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        phEnum, tkParent, rMemberRefs, cMax, pcTokens));
-
-
-
     LOCKREAD();
 
     if ( *ppmdEnum == 0 )
@@ -742,9 +714,6 @@ STDMETHODIMP RegMeta::EnumMethodImpls(        // S_OK, S_FALSE, or error
     HENUMInternal       *pEnum = NULL;
     HENUMInternal hEnum;
 
-    LOG((LOGMD, "MD RegMeta::EnumMethodImpls(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        phEnum, td, rMethodBody, rMethodDecl, cMax, pcTokens));
-
     LOCKREAD();
 
     HENUMInternal::ZeroEnum(&hEnum);
@@ -817,9 +786,6 @@ STDMETHODIMP RegMeta::EnumPermissionSets(     // S_OK, S_FALSE, or error.
     mdToken             typ = TypeFromToken(tk);
     mdToken             tkParent;
 
-    LOG((LOGMD, "MD RegMeta::EnumPermissionSets(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        phEnum, tk, dwActions, rPermission, cMax, pcTokens));
-
     LOCKREAD();
 
     if ( *ppmdEnum == 0 )
@@ -919,10 +885,6 @@ STDMETHODIMP RegMeta::FindMember(
 {
     HRESULT             hr = NOERROR;
 
-    LOG((LOGMD, "MD RegMeta::FindMember(0x%08x, %S, 0x%08x, 0x%08x, 0x%08x)\n",
-        td, MDSTR(szName), pvSigBlob, cbSigBlob, pmb));
-
-
     // Don't lock this function. All of the functions that it calls are public APIs. keep it that way.
 
     // try to match with method first of all
@@ -965,9 +927,6 @@ STDMETHODIMP RegMeta::FindMethod(
     LPUTF8              szNameUtf8;
     UTF8STR(szName, szNameUtf8);
 
-    LOG((LOGMD, "MD RegMeta::FindMethod(0x%08x, %S, 0x%08x, 0x%08x, 0x%08x)\n",
-        td, MDSTR(szName), pvSigBlob, cbSigBlob, pmb));
-
     LOCKREAD();
 
     if (szName == NULL)
@@ -1004,9 +963,6 @@ RegMeta::FindField(
 
     CMiniMdRW *pMiniMd = &(m_pStgdb->m_MiniMd);
 
-    LOG((LOGMD, "MD RegMeta::FindField(0x%08x, %S, 0x%08x, 0x%08x, 0x%08x)\n",
-        td, MDSTR(szName), pvSigBlob, cbSigBlob, pmb));
-
     LOCKREAD();
 
     if (szName == NULL)
@@ -1047,9 +1003,6 @@ STDMETHODIMP RegMeta::FindMemberRef(
     LPUTF8              szNameUtf8;
     UTF8STR(szName, szNameUtf8);
 
-    LOG((LOGMD, "MD RegMeta::FindMemberRef(0x%08x, %S, 0x%08x, 0x%08x, 0x%08x)\n",
-        tkPar, MDSTR(szName), pvSigBlob, cbSigBlob, pmr));
-
     // <TODO>@todo: Can this causing building hash table? If so, should this consider the write lock?</TODO>
     LOCKREAD();
 
@@ -1089,12 +1042,6 @@ STDMETHODIMP RegMeta::GetMethodProps(
     MethodRec           *pMethodRec;
     CMiniMdRW           *pMiniMd = &(m_pStgdb->m_MiniMd);
 
-    LOG((LOGMD, "MD RegMeta::GetMethodProps(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        mb, pClass, szMethod, cchMethod, pchMethod, pdwAttr, ppvSigBlob, pcbSigBlob,
-        pulCodeRVA, pdwImplFlags));
-
-
-
     LOCKREAD();
 
     _ASSERTE(TypeFromToken(mb) == mdtMethodDef);
@@ -1164,11 +1111,6 @@ STDMETHODIMP RegMeta::GetMemberRefProps(      // S_OK or error.
     CMiniMdRW       *pMiniMd = &(m_pStgdb->m_MiniMd);
     MemberRefRec    *pMemberRefRec;
 
-    LOG((LOGMD, "MD RegMeta::GetMemberRefProps(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        mr, ptk, szMember, cchMember, pchMember, ppvSigBlob, pbSig));
-
-
-
     LOCKREAD();
 
     _ASSERTE(TypeFromToken(mr) == mdtMemberRef);
@@ -1225,9 +1167,6 @@ STDMETHODIMP RegMeta::EnumProperties(         // S_OK, S_FALSE, or error.
     RID                 ridMax = 0;
     HENUMInternal       *pEnum = NULL;
 
-    LOG((LOGMD, "MD RegMeta::EnumProperties(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        phEnum, td, rProperties, cMax, pcProperties));
-
     LOCKREAD();
 
     if (IsNilToken(td))
@@ -1329,14 +1268,10 @@ STDMETHODIMP RegMeta::EnumEvents(              // S_OK, S_FALSE, or error.
     RID             ridMax = 0;
     HENUMInternal   *pEnum = NULL;
 
-    LOG((LOGMD, "MD RegMeta::EnumEvents(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        phEnum, td, rEvents,  cMax, pcEvents));
-
     LOCKREAD();
 
     _ASSERTE(TypeFromToken(td) == mdtTypeDef);
 
-
     if ( *ppmdEnum == 0 )
     {
         // instantiating a new ENUM
@@ -1431,10 +1366,6 @@ STDMETHODIMP RegMeta::GetEventProps(          // S_OK, S_FALSE, or error.
     EventRec        *pRec;
     HENUMInternal   hEnum;
 
-    LOG((LOGMD, "MD RegMeta::GetEventProps(0x%08x, 0x%08x, %S, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        ev, pClass, MDSTR(szEvent), cchEvent, pchEvent, pdwEventFlags, ptkEventType,
-        pmdAddOn, pmdRemoveOn, pmdFire, rmdOtherMethod, cMax, pcOtherMethod));
-
     LOCKREAD();
 
     _ASSERTE(TypeFromToken(ev) == mdtEvent);
@@ -1533,12 +1464,8 @@ STDMETHODIMP RegMeta::EnumMethodSemantics(    // S_OK, S_FALSE, or error.
     HENUMInternal       *pEnum = NULL;
     MethodSemanticsRec  *pRec;
 
-    LOG((LOGMD, "MD RegMeta::EnumMethodSemantics(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        phEnum, mb, rEventProp, cMax, pcEventProp));
-
     LOCKREAD();
 
-
     if ( *ppmdEnum == 0 )
     {
         // instantiating a new ENUM
@@ -1591,11 +1518,6 @@ STDMETHODIMP RegMeta::GetMethodSemantics(     // S_OK, S_FALSE, or error.
     ULONG               ridCur;
     HENUMInternal       hEnum;
 
-    LOG((LOGMD, "MD RegMeta::GetMethodSemantics(0x%08x, 0x%08x, 0x%08x)\n",
-        mb, tkEventProp, pdwSemanticsFlags));
-
-
-
     LOCKREAD();
 
     _ASSERTE(TypeFromToken(mb) == mdtMethodDef);
@@ -1647,9 +1569,6 @@ STDMETHODIMP RegMeta::GetClassLayout(
 
     _ASSERTE(TypeFromToken(td) == mdtTypeDef);
 
-    LOG((LOGMD, "MD RegMeta::GetClassLayout(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        td, pdwPackSize, rFieldOffset, cMax, pcFieldOffset, pulClassSize));
-
     LOCKREAD();
 
     IfFailGo(pMiniMd->FindClassLayoutHelper(td, &ridClassLayout));
@@ -1751,12 +1670,8 @@ STDMETHODIMP RegMeta::GetFieldMarshal(
     RID             rid;
     FieldMarshalRec *pFieldMarshalRec;
 
-
     _ASSERTE(ppvNativeType != NULL && pcbNativeType != NULL);
 
-    LOG((LOGMD, "MD RegMeta::GetFieldMarshal(0x%08x, 0x%08x, 0x%08x)\n",
-        tk, ppvNativeType, pcbNativeType));
-
     LOCKREAD();
 
     _ASSERTE(TypeFromToken(tk) == mdtParamDef || TypeFromToken(tk) == mdtFieldDef);
@@ -1791,9 +1706,6 @@ RegMeta::GetRVA(
 
     CMiniMdRW *pMiniMd = &(m_pStgdb->m_MiniMd);
 
-    LOG((LOGMD, "MD RegMeta::GetRVA(0x%08x, 0x%08x, 0x%08x)\n",
-        tk, pulCodeRVA, pdwImplFlags));
-
     LOCKREAD();
 
     if (TypeFromToken(tk) == mdtMethodDef)
@@ -1865,9 +1777,6 @@ STDMETHODIMP RegMeta::GetPermissionSetProps(
 {
     HRESULT             hr = S_OK;
 
-    LOG((LOGMD, "MD RegMeta::GetPermissionSetProps(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        pm, pdwAction, ppvPermission, pcbPermission));
-
     CMiniMdRW           *pMiniMd = NULL;
     DeclSecurityRec     *pRecord = NULL;
 
@@ -1916,11 +1825,6 @@ STDMETHODIMP RegMeta::GetSigFromToken(        // S_OK or error.
     CMiniMdRW       *pMiniMd = &(m_pStgdb->m_MiniMd);
     StandAloneSigRec *pRec;
 
-    LOG((LOGMD, "MD RegMeta::GetSigFromToken(0x%08x, 0x%08x, 0x%08x)\n",
-        mdSig, ppvSig, pcbSig));
-
-
-
     LOCKREAD();
 
     _ASSERTE(TypeFromToken(mdSig) == mdtSignature);
@@ -1948,8 +1852,6 @@ STDMETHODIMP RegMeta::GetModuleRefProps(      // S_OK or error.
     CMiniMdRW       *pMiniMd = &(m_pStgdb->m_MiniMd);
     ModuleRefRec    *pModuleRefRec;
 
-    LOG((LOGMD, "MD RegMeta::GetModuleRefProps(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        mur, szName, cchName, pchName));
     LOCKREAD();
 
     IfFailGo(pMiniMd->GetModuleRefRecord(RidFromToken(mur), &pModuleRefRec));
@@ -1982,9 +1884,6 @@ STDMETHODIMP RegMeta::EnumModuleRefs(         // S_OK or error.
     HENUMInternal **ppmdEnum = reinterpret_cast<HENUMInternal **> (phEnum);
     HENUMInternal  *pEnum;
 
-    LOG((LOGMD, "MD RegMeta::EnumModuleRefs(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        phEnum, rModuleRefs, cMax, pcModuleRefs));
-
     LOCKREAD();
 
     if (*ppmdEnum == NULL)
@@ -2030,11 +1929,6 @@ STDMETHODIMP RegMeta::GetTypeSpecFromToken(   // S_OK or error.
     CMiniMdRW           *pMiniMd = &(m_pStgdb->m_MiniMd);
     TypeSpecRec *pRec = NULL;
 
-    LOG((LOGMD, "MD RegMeta::GetTypeSpecFromToken(0x%08x, 0x%08x, 0x%08x)\n",
-        typespec, ppvSig, pcbSig));
-
-
-
     LOCKREAD();
 
     _ASSERTE(TypeFromToken(typespec) == mdtTypeSpec);
@@ -2070,9 +1964,6 @@ STDMETHODIMP RegMeta::GetNameFromToken(       // S_OK or error.
 
     CMiniMdRW   *pMiniMd = &(m_pStgdb->m_MiniMd);
 
-    LOG((LOGMD, "MD RegMeta::GetNameFromToken(0x%08x, 0x%08x)\n",
-        tk, pszUtf8NamePtr));
-
     LOCKREAD();
 
     _ASSERTE(pszUtf8NamePtr);
@@ -2121,10 +2012,6 @@ STDMETHODIMP RegMeta::EnumUnresolvedMethods(  // S_OK or error.
     HENUMInternal *  pEnum = NULL; // Enum we're working with.
     CMiniMdRW *      pMiniMd = &(m_pStgdb->m_MiniMd);
 
-    LOG((LOGMD, "MD RegMeta::EnumUnresolvedMethods(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        phEnum, rMethods, cMax, pcTokens));
-
-
     // take the write lock. Because we should have not have two EnumUnresolvedMethods being called at the
     // same time. Ref to Def map may be calculated incorrectly.
     LOCKWRITE();
@@ -2252,9 +2139,6 @@ STDMETHODIMP RegMeta::GetUserString(          // S_OK or error.
     ULONG   cchStringSize_Dummy;
     MetaData::DataBlob userString;
 
-    LOG((LOGMD, "MD RegMeta::GetUserString(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        stk, wszString, cchStringSize, pcchStringSize));
-
     LOCKREAD();
 
     // Get the string data.
@@ -2320,9 +2204,6 @@ STDMETHODIMP RegMeta::GetPinvokeMap(          // S_OK or error.
     ImplMapRec * pRecord;
     uint32_t     iRecord;
 
-    LOG((LOGMD, "MD RegMeta::GetPinvokeMap(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        tk, pdwMappingFlags, szImportName, cchImportName, pchImportName, pmrImportDLL));
-
     LOCKREAD();
 
     _ASSERTE(TypeFromToken(tk) == mdtFieldDef ||
@@ -2361,9 +2242,6 @@ STDMETHODIMP RegMeta::EnumSignatures(         // S_OK or error.
     HENUMInternal **ppsigEnum = reinterpret_cast<HENUMInternal **> (phEnum);
     HENUMInternal  *pEnum;
 
-    LOG((LOGMD, "MD RegMeta::EnumSignatures(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        phEnum, rSignatures, cmax, pcSignatures));
-
     LOCKREAD();
 
     if (*ppsigEnum == NULL)
@@ -2410,9 +2288,6 @@ STDMETHODIMP RegMeta::EnumTypeSpecs(          // S_OK or error.
     HENUMInternal   **ppEnum = reinterpret_cast<HENUMInternal **> (phEnum);
     HENUMInternal   *pEnum;
 
-    LOG((LOGMD, "MD RegMeta::EnumTypeSpecs(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        phEnum, rTypeSpecs, cmax, pcTypeSpecs));
-
     LOCKREAD();
 
     if (*ppEnum == NULL)
@@ -2459,9 +2334,6 @@ STDMETHODIMP RegMeta::EnumUserStrings(        // S_OK or error.
     HENUMInternal **ppEnum = reinterpret_cast<HENUMInternal **> (phEnum);
     HENUMInternal  *pEnum = NULL;
 
-    LOG((LOGMD, "MD RegMeta::EnumUserStrings(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        phEnum, rStrings, cmax, pcStrings));
-
     LOCKREAD();
 
     if (*ppEnum == NULL)
@@ -2528,9 +2400,6 @@ STDMETHODIMP RegMeta::GetParamForMethodIndex( // S_OK or error.
 {
     HRESULT     hr = S_OK;
 
-    LOG((LOGMD, "MD RegMeta::GetParamForMethodIndex(0x%08x, 0x%08x, 0x%08x)\n",
-        md, ulParamSeq, ppd));
-
     LOCKREAD();
 
     _ASSERTE((TypeFromToken(md) == mdtMethodDef) && (ulParamSeq != UINT32_MAX) && (ppd != NULL));
@@ -2560,10 +2429,6 @@ HRESULT RegMeta::GetMemberProps(
 {
     HRESULT         hr = NOERROR;
 
-    LOG((LOGMD, "MD RegMeta::GetMemberProps(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        mb, pClass, szMember, cchMember, pchMember, pdwAttr, ppvSigBlob, pcbSigBlob,
-        pulCodeRVA, pdwImplFlags, pdwCPlusTypeFlag, ppValue, pchValue));
-
     _ASSERTE(TypeFromToken(mb) == mdtMethodDef || TypeFromToken(mb) == mdtFieldDef);
 
     // No need to lock this function. It is calling public APIs. Keep it that way.
@@ -2624,10 +2489,6 @@ HRESULT RegMeta::GetFieldProps(
     FieldRec        *pFieldRec;
     CMiniMdRW       *pMiniMd = &(m_pStgdb->m_MiniMd);
 
-    LOG((LOGMD, "MD RegMeta::GetFieldProps(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        fd, pClass, szField, cchField, pchField, pdwAttr, ppvSigBlob, pcbSigBlob, pdwCPlusTypeFlag,
-        ppValue, pchValue));
-
     LOCKREAD();
 
     _ASSERTE(TypeFromToken(fd) == mdtFieldDef);
@@ -2736,15 +2597,6 @@ HRESULT RegMeta::GetPropertyProps(      // S_OK, S_FALSE, or error.
     PropertyRec     *pRec;
     HENUMInternal   hEnum;
 
-    LOG((LOGMD, "MD RegMeta::GetPropertyProps(0x%08x, 0x%08x, %S, 0x%08x, 0x%08x, "
-                "0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, "
-                "0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, "
-                "0x%08x)\n",
-                prop, pClass, MDSTR(szProperty),  cchProperty, pchProperty,
-                pdwPropFlags, ppvSig, pbSig, pdwCPlusTypeFlag, ppDefaultValue,
-                pchDefaultValue, pmdSetter, pmdGetter, rmdOtherMethod, cMax,
-                pcOtherMethod));
-
     LOCKREAD();
 
     _ASSERTE(TypeFromToken(prop) == mdtProperty);
@@ -2892,9 +2744,6 @@ HRESULT RegMeta::GetParamProps(         // S_OK or error.
     ParamRec        *pParamRec;
     CMiniMdRW       *pMiniMd = &(m_pStgdb->m_MiniMd);
 
-    LOG((LOGMD, "MD RegMeta::GetParamProps(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        pd, pmd, pulSequence, szName, cchName, pchName, pdwAttr, pdwCPlusTypeFlag, ppValue, pchValue));
-
     LOCKREAD();
 
     _ASSERTE(TypeFromToken(pd) == mdtParamDef);
@@ -2978,10 +2827,6 @@ HRESULT RegMeta::GetGenericParamProps(        // S_OK or error.
     CMiniMdRW       *pMiniMd = NULL;
     RID             ridRD = RidFromToken(rd);
 
-
-    LOG((LOGMD, "MD RegMeta::GetGenericParamProps(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        rd, pulSequence, pdwAttr, ptOwner, reserved, szName, cchName, pchName));
-
     LOCKREAD();
 
     pMiniMd = &(m_pStgdb->m_MiniMd);
@@ -3026,9 +2871,6 @@ HRESULT RegMeta::GetGenericParamConstraintProps(      // S_OK or error.
     CMiniMdRW       *pMiniMd = NULL;
     RID             ridRD = RidFromToken(rd);
 
-    LOG((LOGMD, "MD RegMeta::GetGenericParamConstraintProps(0x%08x, 0x%08x, 0x%08x)\n",
-        rd, ptGenericParam, ptkConstraintType));
-
     LOCKREAD();
 
     pMiniMd = &(m_pStgdb->m_MiniMd);
@@ -3068,8 +2910,6 @@ HRESULT RegMeta::GetMethodSpecProps(         // S_OK or error.
     MethodSpecRec  *pMethodSpecRec;
     CMiniMdRW       *pMiniMd = NULL;
 
-    LOG((LOGMD, "MD RegMeta::GetMethodSpecProps(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        mi, tkParent, ppvSigBlob, pcbSigBlob));
     LOCKREAD();
 
     pMiniMd = &(m_pStgdb->m_MiniMd);
@@ -3113,8 +2953,6 @@ HRESULT RegMeta::GetPEKind(             // S_OK or error.
     HRESULT     hr = NOERROR;
     MAPPINGTYPE mt = MTYPE_NOMAPPING;
 
-    LOG((LOGMD, "MD RegMeta::GetPEKind(0x%08x, 0x%08x)\n",pdwPEKind,pdwMachine));
-
     LOCKREAD();
 
     if (m_pStgdb->m_pStgIO != NULL)
@@ -3143,8 +2981,6 @@ HRESULT RegMeta::GetVersionString(    // S_OK or error.
     DWORD       cch;                    // Length of WideChar string.
     LPCSTR      pVer;                   // Pointer to version string.
 
-    LOG((LOGMD, "MD RegMeta::GetVersionString(0x%08x, 0x%08x, 0x%08x)\n",pwzBuf,cchBufSize,pchBufSize));
-
     LOCKREAD();
 
     if (m_pStgdb->m_pvMd != NULL)
@@ -3192,10 +3028,6 @@ HRESULT RegMeta::GetNestedClassProps(   // S_OK or error.
     uint32_t        iRecord;
     CMiniMdRW       *pMiniMd = &(m_pStgdb->m_MiniMd);
 
-
-    LOG((LOGMD, "MD RegMeta::GetNestedClassProps(0x%08x, 0x%08x)\n",
-        tdNestedClass, ptdEnclosingClass));
-
     LOCKREAD();
 
     // If not a typedef -- return error.
index 969eb98..85130f4 100644 (file)
@@ -31,7 +31,7 @@
 #define DEFINE_CUSTOM_DUPCHECK      2
 #define SET_CUSTOM                  3
 
-#if defined(_DEBUG) && defined(_TRACE_REMAPS)
+#if defined(_DEBUG)
 #define LOGGING
 #endif
 #include <log.h>
index 87a9127..60bedca 100644 (file)
@@ -28,7 +28,7 @@
 #define DEFINE_CUSTOM_DUPCHECK      2
 #define SET_CUSTOM                  3
 
-#if defined(_DEBUG) && defined(_TRACE_REMAPS)
+#if defined(_DEBUG)
 #define LOGGING
 #endif
 #include <log.h>
index 7f161c9..dff2a32 100644 (file)
@@ -31,7 +31,7 @@
 #define DEFINE_CUSTOM_DUPCHECK      2
 #define SET_CUSTOM                  3
 
-#if defined(_DEBUG) && defined(_TRACE_REMAPS)
+#if defined(_DEBUG)
 #define LOGGING
 #endif
 #include <log.h>
@@ -52,9 +52,6 @@ STDMETHODIMP RegMeta::SetModuleProps(   // S_OK or error.
 
     ModuleRec   *pModule;               // The module record to modify.
 
-    LOG((LOGMD, "RegMeta::SetModuleProps(%S)\n", MDSTR(szName)));
-
-
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -84,7 +81,6 @@ STDMETHODIMP RegMeta::Save(                     // S_OK or error.
 {
     HRESULT     hr=S_OK;
 
-    LOG((LOGMD, "RegMeta::Save(%S, 0x%08x)\n", MDSTR(szFile), dwSaveFlags));
     LOCKWRITE();
 
     // Check reserved param..
@@ -121,8 +117,6 @@ STDMETHODIMP RegMeta::SaveToStream(     // S_OK or error.
 
     LOCKWRITE();
 
-    LOG((LOGMD, "RegMeta::SaveToStream(0x%08x, 0x%08x)\n", pIStream, dwSaveFlags));
-
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
 
     hr = _SaveToStream(pIStream, dwSaveFlags);
@@ -174,9 +168,6 @@ STDMETHODIMP RegMeta::SaveToMemory(           // S_OK or error.
 
     IStream     *pStream = 0;           // Working pointer for save.
 
-    LOG((LOGMD, "MD RegMeta::SaveToMemory(0x%08x, 0x%08x)\n",
-        pbData, cbData));
-
 #ifdef _DEBUG
     ULONG       cbActual;               // Size of the real data.
     IfFailGo(GetSaveSize(cssAccurate, &cbActual));
@@ -209,7 +200,6 @@ STDMETHODIMP RegMeta::GetSaveSize(      // S_OK or error.
 
     FilterTable *ft = NULL;
 
-    LOG((LOGMD, "RegMeta::GetSaveSize(0x%08x, 0x%08x)\n", fSave, pdwSaveSize));
     LOCKWRITE();
 
     ft = m_pStgdb->m_MiniMd.GetFilterTable();
@@ -276,8 +266,6 @@ HRESULT RegMeta::UnmarkAll()
     mdToken         tkParent;
     int             iStart, iEnd;
 
-    LOG((LOGMD, "RegMeta::UnmarkAll\n"));
-
     LOCKWRITE();
 
 #if 0
@@ -430,7 +418,6 @@ STDMETHODIMP RegMeta::MarkToken(        // Return code.
 {
     HRESULT     hr = NOERROR;
 
-    // LOG((LOGMD, "RegMeta::MarkToken(0x%08x)\n", tk));
     LOCKWRITE();
 
     if (m_pStgdb->m_MiniMd.GetFilterTable() == NULL || m_pFilterManager == NULL)
@@ -522,7 +509,6 @@ HRESULT RegMeta::IsTokenMarked(
 
     FilterTable *pFilter = NULL;
 
-    LOG((LOGMD, "RegMeta::IsTokenMarked(0x%08x)\n", tk));
     LOCKREAD();
 
     pFilter = m_pStgdb->m_MiniMd.GetFilterTable();
@@ -599,9 +585,6 @@ STDMETHODIMP RegMeta::DefineTypeDef(                // S_OK or error.
 {
     HRESULT     hr = S_OK;              // A result.
 
-    LOG((LOGMD, "RegMeta::DefineTypeDef(%S, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-            MDSTR(szTypeDef), dwTypeDefFlags, tkExtends,
-            rtkImplements, ptd));
     LOCKWRITE();
 
     IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
@@ -625,7 +608,6 @@ STDMETHODIMP RegMeta::SetHandler(       // S_OK.
 
     IMapToken *pIMap = NULL;
 
-    LOG((LOGMD, "RegMeta::SetHandler(0x%08x)\n", pUnk));
     LOCKWRITE();
 
     m_pHandler = pUnk;
@@ -854,10 +836,8 @@ HRESULT RegMeta::RefToDefOptimization()
             hr = ImportHelper::FindMember(pMiniMd, tkParent, szName, pvSig, cbSig, &mfdef);
             if (hr != S_OK)
             {
-    #if _TRACE_REMAPS
-            // Log the failure.
-            LOG((LF_METADATA, LL_INFO10, "Member %S//%S.%S not found\n", szNamespace, szTDName, rcMRName));
-    #endif
+                // Log the failure.
+                LOG((LF_METADATA, LL_INFO10, "Member %s (0x%p, %u) not found on 0x%x\n", szName, pvSig, cbSig, tkParent));
                 continue;
             }
 
index fad0d94..86a3b38 100644 (file)
@@ -31,7 +31,7 @@
 #define DEFINE_CUSTOM_DUPCHECK      2
 #define SET_CUSTOM                  3
 
-#if defined(_DEBUG) && defined(_TRACE_REMAPS)
+#if defined(_DEBUG)
 #define LOGGING
 #endif
 #include <log.h>
@@ -66,8 +66,6 @@ ErrExit:
 void STDMETHODCALLTYPE RegMeta::CloseEnum(
     HCORENUM        hEnum)          // The enumerator.
 {
-    LOG((LOGMD, "RegMeta::CloseEnum(0x%08x)\n", hEnum));
-
     // No need to lock this function.
     HENUMInternal   *pmdEnum = reinterpret_cast<HENUMInternal *> (hEnum);
 
@@ -89,8 +87,6 @@ HRESULT CountEnum(
 
     // No need to lock this function.
 
-    LOG((LOGMD, "RegMeta::CountEnum(0x%08x, 0x%08x)\n", hEnum, pulCount));
-
     _ASSERTE( pulCount );
 
     if (pmdEnum == NULL)
@@ -130,8 +126,6 @@ STDMETHODIMP RegMeta::ResetEnum(
 
     // No need to lock this function.
 
-    LOG((LOGMD, "RegMeta::ResetEnum(0x%08x, 0x%08x)\n", hEnum, ulPos));
-
     if (pmdEnum != NULL)
         pmdEnum->u.m_ulCur = pmdEnum->u.m_ulStart + ulPos;
 
@@ -152,11 +146,8 @@ STDMETHODIMP RegMeta::EnumTypeDefs(
     HENUMInternal   **ppmdEnum = reinterpret_cast<HENUMInternal **> (phEnum);
     HENUMInternal   *pEnum = NULL;
 
-    LOG((LOGMD, "RegMeta::EnumTypeDefs(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-            phEnum, rTypeDefs, cMax, pcTypeDefs));
     LOCKREAD();
 
-
     if ( *ppmdEnum == 0 )
     {
         // instantiating a new ENUM
@@ -225,8 +216,6 @@ STDMETHODIMP RegMeta::EnumInterfaceImpls(
     InterfaceImplRec    *pRec;
     RID                 index;
 
-    LOG((LOGMD, "RegMeta::EnumInterfaceImpls(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-            phEnum, td, rImpls, cMax, pcImpls));
     LOCKREAD();
 
     _ASSERTE(TypeFromToken(td) == mdtTypeDef);
@@ -289,9 +278,6 @@ STDMETHODIMP RegMeta::EnumGenericParams(HCORENUM *phEnum, mdToken tkOwner,
     RID                 index;
     CMiniMdRW           *pMiniMd = NULL;
 
-
-    LOG((LOGMD, "RegMeta::EnumGenericParams(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-            phEnum, tkOwner, rTokens, cMaxTokens, pcTokens));
     LOCKREAD();
 
     pMiniMd = &(m_pStgdb->m_MiniMd);
@@ -380,8 +366,6 @@ STDMETHODIMP RegMeta::EnumMethodSpecs(
     RID                 index;
     CMiniMdRW       *pMiniMd = NULL;
 
-    LOG((LOGMD, "RegMeta::EnumMethodSpecs(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-            phEnum, tkOwner, rTokens, cMaxTokens, pcTokens));
     LOCKREAD();
 
     pMiniMd = &(m_pStgdb->m_MiniMd);
@@ -478,8 +462,6 @@ STDMETHODIMP RegMeta::EnumGenericParamConstraints(
     RID                 index;
     CMiniMdRW       *pMiniMd = NULL;
 
-    LOG((LOGMD, "RegMeta::EnumGenericParamConstraints(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-            phEnum, tkOwner, rTokens, cMaxTokens, pcTokens));
     LOCKREAD();
 
     pMiniMd = &(m_pStgdb->m_MiniMd);
@@ -558,8 +540,6 @@ STDMETHODIMP RegMeta::EnumTypeRefs(
     ULONG           cTotal;
     HENUMInternal   *pEnum = *ppmdEnum;
 
-    LOG((LOGMD, "RegMeta::EnumTypeRefs(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-            phEnum, rTypeRefs, cMax, pcTypeRefs));
     LOCKREAD();
 
     if ( pEnum == 0 )
@@ -593,11 +573,8 @@ STDMETHODIMP RegMeta::FindTypeDefByName(// S_OK or error.
 {
     HRESULT     hr = S_OK;
 
-    LOG((LOGMD, "{%08x} RegMeta::FindTypeDefByName(%S, 0x%08x, 0x%08x)\n",
-            this, MDSTR(wzTypeDef), tkEnclosingClass, ptd));
     LOCKREAD();
 
-
     if (wzTypeDef == NULL)
         IfFailGo(E_INVALIDARG);
     PREFIX_ASSUME(wzTypeDef != NULL);
@@ -638,9 +615,6 @@ STDMETHODIMP RegMeta::GetScopeProps(
     CMiniMdRW   *pMiniMd = &(m_pStgdb->m_MiniMd);
     ModuleRec   *pModuleRec;
 
-
-    LOG((LOGMD, "RegMeta::GetScopeProps(%S, 0x%08x, 0x%08x, 0x%08x)\n",
-            MDSTR(szName), cchName, pchName, pmvid));
     LOCKREAD();
 
     // there is only one module record
@@ -663,8 +637,6 @@ ErrExit:
 STDMETHODIMP RegMeta::GetModuleFromScope(// S_OK.
     mdModule    *pmd)                   // [OUT] Put mdModule token here.
 {
-    LOG((LOGMD, "RegMeta::GetModuleFromScope(0x%08x)\n", pmd));
-
     _ASSERTE(pmd);
 
     // No need to lock this function.
@@ -686,8 +658,6 @@ HRESULT RegMeta::IsGlobal(              // S_OK ir error.
     CMiniMdRW   *pMiniMd = &(m_pStgdb->m_MiniMd);
     mdToken     tkParent;               // Parent of field or method.
 
-    LOG((LOGMD, "RegMeta::GetTokenForGlobalType(0x%08x, %08x)\n", tk, pbGlobal));
-
     // No need to lock this function.
 
     if (!IsValidToken(tk))
@@ -746,9 +716,6 @@ RegMeta::GetTypeDefProps(
     TypeDefRec *pTypeDefRec;
     BOOL        fTruncation = FALSE;    // Was there name truncation?
 
-    LOG((LOGMD, "{%08x} RegMeta::GetTypeDefProps(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-            this, td, szTypeDef, cchTypeDef, pchTypeDef,
-            pdwTypeDefFlags, ptkExtends));
     LOCKREAD();
 
     if (TypeFromToken(td) != mdtTypeDef)
@@ -843,8 +810,6 @@ STDMETHODIMP RegMeta::GetInterfaceImplProps(        // S_OK or error.
     CMiniMdRW       *pMiniMd = NULL;
     InterfaceImplRec *pIIRec = NULL;
 
-    LOG((LOGMD, "RegMeta::GetInterfaceImplProps(0x%08x, 0x%08x, 0x%08x)\n",
-            iiImpl, pClass, ptkIface));
     LOCKREAD();
 
     _ASSERTE(TypeFromToken(iiImpl) == mdtInterfaceImpl);
@@ -882,9 +847,6 @@ RegMeta::GetTypeRefProps(
     TypeRefRec *pTypeRefRec;
     BOOL        fTruncation = FALSE;    // Was there name truncation?
 
-    LOG((LOGMD, "RegMeta::GetTypeRefProps(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        tr, ptkResolutionScope, szTypeRef, cchTypeRef, pchTypeRef));
-
     LOCKREAD();
 
     if (TypeFromToken(tr) != mdtTypeRef)
@@ -972,8 +934,6 @@ STDMETHODIMP RegMeta::FindTypeRef(      // S_OK or error.
 
     _ASSERTE(wzTypeName && ptk);
 
-    LOG((LOGMD, "RegMeta::FindTypeRef(0x%8x, %ls, 0x%08x)\n",
-            tkResolutionScope, MDSTR(wzTypeName), ptk));
     LOCKREAD();
 
     // Convert the  name to UTF8.
index 66a5522..0a1ea82 100644 (file)
@@ -30,7 +30,7 @@
 #define DEFINE_CUSTOM_DUPCHECK      2
 #define SET_CUSTOM                  3
 
-#if defined(_DEBUG) && defined(_TRACE_REMAPS)
+#if defined(_DEBUG)
 #define LOGGING
 #endif
 #include <log.h>
@@ -160,9 +160,6 @@ RegMeta::ResolveTypeRef(
     WCHAR        wzNameSpace[_MAX_PATH];
     CMiniMdRW *  pMiniMd = NULL;
 
-    LOG((LOGMD, "{%08x} RegMeta::ResolveTypeRef(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        this, tr, riid, ppIScope, ptd));
-
     LOCKREAD();
 
     pMiniMd = &(m_pStgdb->m_MiniMd);
index 64ded0d..c4da18d 100644 (file)
@@ -650,10 +650,6 @@ CLiteWeightStgdbRW::GetPoolSaveSize(
         // Ask the storage system to add stream fixed overhead.
         IfFailGo(TiggerStorage::GetStreamSaveSize(szHeap, cbSize, &cbSize));
 
-        // Log the size info.
-        LOG((LF_METADATA, LL_INFO10, "Metadata: GetSaveSize for %ls: %d data, %d total.\n",
-            szHeap, cbStream, cbSize));
-
         // Give the size of the pool to the caller's total.
         *pcbSaveSize = cbSize;
     }
@@ -693,10 +689,6 @@ HRESULT CLiteWeightStgdbRW::GetTablesSaveSize(
     // Ask the storage system to add stream fixed overhead.
     IfFailGo(TiggerStorage::GetStreamSaveSize(szName, cbSize, &cbSize));
 
-    // Log the size info.
-    LOG((LF_METADATA, LL_INFO10, "Metadata: GetSaveSize for %ls: %d data, %d total.\n",
-        szName, cbStream, cbSize));
-
     // Give the size of the pool to the caller's total.
     *pcbSaveSize = cbHotSize + cbSize;
 
index f933730..487d256 100644 (file)
@@ -466,7 +466,7 @@ ULONG MDInternalRW::Release()
     cRef = InterlockedDecrement(&m_cRefs);
     if (cRef == 0)
     {
-        LOG((LOGMD, "MDInternalRW(0x%08x)::destruction\n", this));
+        LOG((LOGMD, "MDInternalRW(0x%p)::destruction\n", this));
         delete this;
     }
     return cRef;
index 184dec6..ff01a4d 100644 (file)
@@ -2056,7 +2056,7 @@ CMiniMdRW::GetFullSaveSize(
     cbTotal += cbAlign;
     m_cbSaveSize = cbTotal;
 
-    LOG((LOGMD, "CMiniMdRW::GetFullSaveSize: Total size = %d\n", cbTotal));
+    LOG((LOGMD, "CMiniMdRW::GetFullSaveSize: Total size = %u\n", cbTotal));
 
     *pcbSaveSize = cbTotal;
 
@@ -2984,7 +2984,7 @@ CMiniMdRW::PreSaveEnc()
                 // If we found the token, don't keep the record.
                 if (pul != 0)
                 {
-                    LOG((LOGMD, "PreSave ENCLog skipping duplicate token %d", pFrom->GetToken()));
+                    LOG((LOGMD, "PreSave ENCLog skipping duplicate token 0x%x", pFrom->GetToken()));
                     continue;
                 }
                 // First time token was seen, so keep track of it.
index d015e83..96d7255 100644 (file)
@@ -1675,9 +1675,6 @@ HRESULT MDInternalRO::GetMethodSpecProps(         // S_OK or error.
     HRESULT         hr = NOERROR;
     MethodSpecRec  *pMethodSpecRec;
 
-    LOG((LOGMD, "MD RegMeta::GetMethodSpecProps(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
-        mi, tkParent, ppvSigBlob, pcbSigBlob));
-
     _ASSERTE(TypeFromToken(mi) == mdtMethodSpec);
 
     IfFailRet(m_LiteWeightStgdb.m_MiniMd.GetMethodSpecRecord(RidFromToken(mi), &pMethodSpecRec));
index 9f3e16f..c109788 100644 (file)
@@ -22,7 +22,7 @@
 #define ENUM_BUFFER_SIZE 10
 #define TAB_SIZE 8
 
-#define ISFLAG(p,x) if (Is##p##x(flags)) strcat_s(sFlags,STRING_BUFFER_LEN, "["#x "] ");
+#define ISFLAG(p,x) if (Is##p##x(flags)) strcat_s(szTempBuf,STRING_BUFFER_LEN, "["#x "] ");
 
 extern HRESULT  _FillVariant(
     BYTE        bCPlusTypeFlag,
@@ -189,6 +189,16 @@ const char *g_szNativeType[] =
     "NATIVE_TYPE_ERROR", //        = 0x2d, // VT_HRESULT when exporting to a typelib.
 };
 
+// Maximum value needed to convert a UTF16 codepoint to a UTF8 codepoint.
+#define MAX_UTF8_CVT 3
+
+static const char* ConvertToUtf8(LPCWSTR name, _Out_writes_(bufLen) char* buffer, ULONG bufLen)
+{
+    int res = WszWideCharToMultiByte(CP_UTF8, 0, name, -1, buffer, bufLen, NULL, NULL);
+    if (res == 0)
+        buffer[bufLen] = '\0';
+    return buffer;
+}
 
 size_t g_cbCoffNames = 0;
 
@@ -492,15 +502,16 @@ void MDInfo::DisplayScopeInfo()
     mdModule mdm;
     GUID mvid;
     WCHAR scopeName[STRING_BUFFER_LEN];
-    WCHAR guidString[STRING_BUFFER_LEN];
+    char scopeNameUtf8[ARRAY_SIZE(scopeName) * MAX_UTF8_CVT];
+    char guidString[STRING_BUFFER_LEN];
 
     hr = m_pImport->GetScopeProps( scopeName, STRING_BUFFER_LEN, 0, &mvid);
     if (FAILED(hr)) Error("GetScopeProps failed.", hr);
 
-    VWriteLine("ScopeName : %ls",scopeName);
+    VWriteLine("ScopeName : %s",ConvertToUtf8(scopeName, scopeNameUtf8, ARRAY_SIZE(scopeNameUtf8)));
 
     if (!(m_DumpFilter & MDInfo::dumpNoLogo))
-        VWriteLine("MVID      : %ls",GUIDAsString(mvid, guidString, STRING_BUFFER_LEN));
+        VWriteLine("MVID      : %s",GUIDAsString(mvid, guidString, STRING_BUFFER_LEN));
 
     hr = m_pImport->GetModuleFromScope(&mdm);
     if (FAILED(hr)) Error("GetModuleFromScope failed.", hr);
@@ -561,18 +572,17 @@ const char *MDInfo::TokenTypeName(mdToken inToken)
 // Prints out name of the given memberref
 //
 
-LPCWSTR MDInfo::MemberRefName(mdMemberRef inMemRef, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen)
+LPCSTR MDInfo::MemberRefName(mdMemberRef inMemRef, _Out_writes_(bufLen) LPSTR buffer, ULONG bufLen)
 {
     HRESULT hr;
 
-
-    hr = m_pImport->GetMemberRefProps( inMemRef, NULL, buffer, bufLen,
+    WCHAR tempBuf[STRING_BUFFER_LEN];
+    hr = m_pImport->GetMemberRefProps( inMemRef, NULL, tempBuf, ARRAY_SIZE(tempBuf),
                                     NULL, NULL, NULL);
     if (FAILED(hr)) Error("GetMemberRefProps failed.", hr);
 
-    return buffer;
-} // LPCWSTR MDInfo::MemberRefName()
-
+    return ConvertToUtf8(tempBuf, buffer, bufLen);
+} // LPCSTR MDInfo::MemberRefName()
 
 // Prints out information about the given memberref
 //
@@ -581,6 +591,7 @@ void MDInfo::DisplayMemberRefInfo(mdMemberRef inMemRef, const char *preFix)
 {
     HRESULT hr;
     WCHAR memRefName[STRING_BUFFER_LEN];
+    char memRefNameUtf8[ARRAY_SIZE(memRefName) * MAX_UTF8_CVT];
     ULONG nameLen;
     mdToken token;
     PCCOR_SIGNATURE pbSigBlob;
@@ -592,7 +603,7 @@ void MDInfo::DisplayMemberRefInfo(mdMemberRef inMemRef, const char *preFix)
                                     &nameLen, &pbSigBlob, &ulSigBlob);
     if (FAILED(hr)) Error("GetMemberRefProps failed.", hr);
 
-    VWriteLine("%s\t\tMember: (%8.8x) %ls: ", preFix, inMemRef, memRefName);
+    VWriteLine("%s\t\tMember: (%8.8x) %s: ", preFix, inMemRef, ConvertToUtf8(memRefName, memRefNameUtf8, ARRAY_SIZE(memRefNameUtf8)));
 
     if (ulSigBlob)
         DisplaySignature(pbSigBlob, ulSigBlob, preFix);
@@ -768,6 +779,7 @@ void MDInfo::DisplayModuleRefInfo(mdModuleRef inModuleRef)
 {
     HRESULT hr;
     WCHAR moduleRefName[STRING_BUFFER_LEN];
+    char moduleRefNameUtf8[ARRAY_SIZE(moduleRefName) * MAX_UTF8_CVT];
     ULONG nameLen;
 
 
@@ -775,7 +787,7 @@ void MDInfo::DisplayModuleRefInfo(mdModuleRef inModuleRef)
                                     &nameLen);
     if (FAILED(hr)) Error("GetModuleRefProps failed.", hr);
 
-    VWriteLine("\t\tModuleRef: (%8.8x) %ls: ", inModuleRef, moduleRefName);
+    VWriteLine("\t\tModuleRef: (%8.8x) %s: ", inModuleRef, ConvertToUtf8(moduleRefName, moduleRefNameUtf8, ARRAY_SIZE(moduleRefNameUtf8)));
     DisplayCustomAttributes(inModuleRef, "\t\t");
 } // void MDInfo::DisplayModuleRefInfo()
 
@@ -829,17 +841,17 @@ void MDInfo::DisplaySignatureInfo(mdSignature inSignature)
 // member in wide characters
 //
 
-LPCWSTR MDInfo::MemberName(mdToken inToken, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen)
+LPCSTR MDInfo::MemberName(mdToken inToken, _Out_writes_(bufLen) LPSTR buffer, ULONG bufLen)
 {
     HRESULT hr;
 
-
-    hr = m_pImport->GetMemberProps( inToken, NULL, buffer, bufLen,
+    WCHAR tempBuf[STRING_BUFFER_LEN];
+    hr = m_pImport->GetMemberProps( inToken, NULL, tempBuf, ARRAY_SIZE(tempBuf),
                             NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
     if (FAILED(hr)) Error("GetMemberProps failed.", hr);
 
-    return (buffer);
-} // LPCWSTR MDInfo::MemberName()
+    return ConvertToUtf8(tempBuf, buffer, bufLen);
+} // LPCSTR MDInfo::MemberName()
 
 
 // displays information for the given method
@@ -850,6 +862,7 @@ void MDInfo::DisplayMethodInfo(mdMethodDef inMethod, DWORD *pflags)
     HRESULT hr;
     mdTypeDef memTypeDef;
     WCHAR memberName[STRING_BUFFER_LEN];
+    char memberNameUtf8[ARRAY_SIZE(memberName) * MAX_UTF8_CVT];
     ULONG nameLen;
     DWORD flags;
     PCCOR_SIGNATURE pbSigBlob;
@@ -864,11 +877,11 @@ void MDInfo::DisplayMethodInfo(mdMethodDef inMethod, DWORD *pflags)
     if (pflags)
         *pflags = flags;
 
-    VWriteLine("\t\tMethodName: %ls (%8.8X)", memberName, inMethod);
+    VWriteLine("\t\tMethodName: %s (%8.8X)", ConvertToUtf8(memberName, memberNameUtf8, ARRAY_SIZE(memberNameUtf8)), inMethod);
 
-    char sFlags[STRING_BUFFER_LEN];
+    char szTempBuf[STRING_BUFFER_LEN];
 
-    sFlags[0] = 0;
+    szTempBuf[0] = 0;
     ISFLAG(Md, Public);
     ISFLAG(Md, Private);
     ISFLAG(Md, Family);
@@ -887,22 +900,22 @@ void MDInfo::DisplayMethodInfo(mdMethodDef inMethod, DWORD *pflags)
     ISFLAG(Md, RTSpecialName);
     ISFLAG(Md, PinvokeImpl);
     ISFLAG(Md, UnmanagedExport);
-    if (!*sFlags)
-        strcpy_s(sFlags, STRING_BUFFER_LEN, "[none]");
+    if (!*szTempBuf)
+        strcpy_s(szTempBuf, STRING_BUFFER_LEN, "[none]");
 
     bool result = (((flags) & mdRTSpecialName) && !wcscmp((memberName), W(".ctor")));
-    if (result) strcat_s(sFlags, STRING_BUFFER_LEN, "[.ctor] ");
+    if (result) strcat_s(szTempBuf, STRING_BUFFER_LEN, "[.ctor] ");
     result = (((flags) & mdRTSpecialName) && !wcscmp((memberName), W(".cctor")));
-    if (result) strcat_s(sFlags,STRING_BUFFER_LEN, "[.cctor] ");
+    if (result) strcat_s(szTempBuf,STRING_BUFFER_LEN, "[.cctor] ");
     // "Reserved" flags
     ISFLAG(Md, HasSecurity);
     ISFLAG(Md, RequireSecObject);
 
-    VWriteLine("\t\tFlags     : %s (%08x)", sFlags, flags);
+    VWriteLine("\t\tFlags     : %s (%08x)", szTempBuf, flags);
     VWriteLine("\t\tRVA       : 0x%08x", ulCodeRVA);
 
     flags = ulImplFlags;
-    sFlags[0] = 0;
+    szTempBuf[0] = 0;
     ISFLAG(Mi, Native);
     ISFLAG(Mi, IL);
     ISFLAG(Mi, OPTIL);
@@ -914,10 +927,10 @@ void MDInfo::DisplayMethodInfo(mdMethodDef inMethod, DWORD *pflags)
     ISFLAG(Mi, InternalCall);
     ISFLAG(Mi, Synchronized);
     ISFLAG(Mi, NoInlining);
-    if (!*sFlags)
-        strcpy_s(sFlags, STRING_BUFFER_LEN, "[none]");
+    if (!*szTempBuf)
+        strcpy_s(szTempBuf, STRING_BUFFER_LEN, "[none]");
 
-    VWriteLine("\t\tImplFlags : %s (%08x)", sFlags, flags);
+    VWriteLine("\t\tImplFlags : %s (%08x)", szTempBuf, flags);
 
     if (ulSigBlob)
         DisplaySignature(pbSigBlob, ulSigBlob, "");
@@ -936,6 +949,7 @@ void MDInfo::DisplayFieldInfo(mdFieldDef inField, DWORD *pdwFlags)
     HRESULT hr;
     mdTypeDef memTypeDef;
     WCHAR memberName[STRING_BUFFER_LEN];
+    char memberNameUtf8[ARRAY_SIZE(memberName) * MAX_UTF8_CVT];
     ULONG nameLen;
     DWORD flags;
     PCCOR_SIGNATURE pbSigBlob;
@@ -960,9 +974,9 @@ void MDInfo::DisplayFieldInfo(mdFieldDef inField, DWORD *pdwFlags)
     _FillVariant((BYTE)dwCPlusTypeFlag, pValue, cbValue, &defaultValue);
 #endif
 
-    char sFlags[STRING_BUFFER_LEN];
+    char szTempBuf[STRING_BUFFER_LEN];
 
-    sFlags[0] = 0;
+    szTempBuf[0] = 0;
     ISFLAG(Fd, Public);
     ISFLAG(Fd, Private);
     ISFLAG(Fd, Family);
@@ -979,14 +993,14 @@ void MDInfo::DisplayFieldInfo(mdFieldDef inField, DWORD *pdwFlags)
     ISFLAG(Fd, PinvokeImpl);
     // "Reserved" flags
     ISFLAG(Fd, HasDefault);
-    if (!*sFlags)
-        strcpy_s(sFlags, STRING_BUFFER_LEN, "[none]");
+    if (!*szTempBuf)
+        strcpy_s(szTempBuf, STRING_BUFFER_LEN, "[none]");
 
-    VWriteLine("\t\tField Name: %ls (%8.8X)", memberName, inField);
-    VWriteLine("\t\tFlags     : %s (%08x)", sFlags, flags);
+    VWriteLine("\t\tField Name: %s (%8.8X)", ConvertToUtf8(memberName, memberNameUtf8, ARRAY_SIZE(memberNameUtf8)), inField);
+    VWriteLine("\t\tFlags     : %s (%08x)", szTempBuf, flags);
 #ifdef FEATURE_COMINTEROP
     if (IsFdHasDefault(flags))
-        VWriteLine("\tDefltValue: (%s) %ls", g_szMapElementType[dwCPlusTypeFlag], VariantAsString(&defaultValue));
+        VWriteLine("\tDefltValue: (%s) %s", g_szMapElementType[dwCPlusTypeFlag], VariantAsString(&defaultValue, szTempBuf, ARRAY_SIZE(szTempBuf)));
 #endif
     if (!ulSigBlob) // Signature size should be non-zero for fields
         VWriteLine("\t\tERROR: no valid signature ");
@@ -1165,6 +1179,7 @@ void MDInfo::DisplayParamInfo(mdParamDef inParamDef)
     mdMethodDef md;
     ULONG num;
     WCHAR paramName[STRING_BUFFER_LEN];
+    char paramNameUtf8[ARRAY_SIZE(paramName) * MAX_UTF8_CVT];
     ULONG nameLen;
     DWORD flags;
     VARIANT defValue;
@@ -1183,21 +1198,22 @@ void MDInfo::DisplayParamInfo(mdParamDef inParamDef)
     _FillVariant((BYTE)dwCPlusFlags, pValue, cbValue, &defValue);
 #endif
 
-    char sFlags[STRING_BUFFER_LEN];
-    sFlags[0] = 0;
+    char szTempBuf[STRING_BUFFER_LEN];
+    szTempBuf[0] = 0;
     ISFLAG(Pd, In);
     ISFLAG(Pd, Out);
     ISFLAG(Pd, Optional);
     // "Reserved" flags.
     ISFLAG(Pd, HasDefault);
     ISFLAG(Pd, HasFieldMarshal);
-    if (!*sFlags)
-        strcpy_s(sFlags,STRING_BUFFER_LEN, "[none]");
+    if (!*szTempBuf)
+        strcpy_s(szTempBuf,STRING_BUFFER_LEN, "[none]");
 
-    VWrite("\t\t\t(%ld) ParamToken : (%08x) Name : %ls flags: %s (%08x)", num, inParamDef, paramName, sFlags, flags);
+    VWrite("\t\t\t(%ld) ParamToken : (%08x) Name : %s flags: %s (%08x)",
+        num, inParamDef, ConvertToUtf8(paramName, paramNameUtf8, ARRAY_SIZE(paramNameUtf8)), szTempBuf, flags);
 #ifdef FEATURE_COMINTEROP
     if (IsPdHasDefault(flags))
-        VWriteLine(" Default: (%s) %ls", g_szMapElementType[dwCPlusFlags], VariantAsString(&defValue));
+        VWriteLine(" Default: (%s) %s", g_szMapElementType[dwCPlusFlags], VariantAsString(&defValue, szTempBuf, ARRAY_SIZE(szTempBuf)));
     else
 #endif
         VWriteLine("");
@@ -1271,6 +1287,7 @@ void MDInfo::DisplayGenericParamInfo(mdGenericParam tkParam, const char *prefix)
 {
     ULONG ulSeq;
     WCHAR paramName[STRING_BUFFER_LEN];
+    char paramNameUtf8[ARRAY_SIZE(paramName) * MAX_UTF8_CVT];
     ULONG nameLen;
     DWORD flags;
     mdToken tkOwner;
@@ -1285,7 +1302,8 @@ void MDInfo::DisplayGenericParamInfo(mdGenericParam tkParam, const char *prefix)
     HRESULT hr = m_pImport->GetGenericParamProps(tkParam, &ulSeq, &flags, &tkOwner, NULL, paramName, ARRAY_SIZE(paramName), &nameLen);
     if (FAILED(hr)) Error("GetGenericParamProps failed.", hr);
 
-    VWriteLine("%s\t(%ld) GenericParamToken : (%08x) Name : %ls flags: %08x Owner: %08x", prefix, ulSeq, tkParam, paramName, flags, tkOwner);
+    VWriteLine("%s\t(%ld) GenericParamToken : (%08x) Name : %s flags: %08x Owner: %08x",
+        prefix, ulSeq, tkParam, ConvertToUtf8(paramName, paramNameUtf8, ARRAY_SIZE(paramNameUtf8)), flags, tkOwner);
 
     // Any constraints for the GenericParam
     while (SUCCEEDED(hr = m_pImport->EnumGenericParamConstraints(&constraintEnum, tkParam,
@@ -1314,24 +1332,10 @@ void MDInfo::DisplayGenericParamInfo(mdGenericParam tkParam, const char *prefix)
     DisplayCustomAttributes(tkParam, newprefix);
 }
 
-LPCWSTR MDInfo::TokenName(mdToken inToken, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen)
-{
-    LPCUTF8     pName;                  // Token name in UTF8.
-
-    if (IsNilToken(inToken))
-        return W("");
-
-    m_pImport->GetNameFromToken(inToken, &pName);
-
-    WszMultiByteToWideChar(CP_UTF8,0, pName,-1, buffer,bufLen);
-
-    return buffer;
-} // LPCWSTR MDInfo::TokenName()
-
 // prints out name of typeref or typedef
 //
 
-LPCWSTR MDInfo::TypeDeforRefName(mdToken inToken, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen)
+LPCSTR MDInfo::TypeDeforRefName(mdToken inToken, _Out_writes_(bufLen) LPSTR buffer, ULONG bufLen)
 {
     if (RidFromToken(inToken))
     {
@@ -1340,15 +1344,15 @@ LPCWSTR MDInfo::TypeDeforRefName(mdToken inToken, _Out_writes_(bufLen) LPWSTR bu
         else if (TypeFromToken(inToken) == mdtTypeRef)
             return (TypeRefName((mdTypeRef) inToken, buffer, bufLen));
         else if (TypeFromToken(inToken) == mdtTypeSpec)
-            return W("[TypeSpec]");
+            return "[TypeSpec]";
         else
-            return W("[InvalidReference]");
+            return "[InvalidReference]";
     }
     else
-        return W("");
-} // LPCWSTR MDInfo::TypeDeforRefName()
+        return "";
+} // LPCSTR MDInfo::TypeDeforRefName()
 
-LPCWSTR MDInfo::MemberDeforRefName(mdToken inToken, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen)
+LPCSTR MDInfo::MemberDeforRefName(mdToken inToken, _Out_writes_(bufLen) LPSTR buffer, ULONG bufLen)
 {
     if (RidFromToken(inToken))
     {
@@ -1357,35 +1361,39 @@ LPCWSTR MDInfo::MemberDeforRefName(mdToken inToken, _Out_writes_(bufLen) LPWSTR
         else if (TypeFromToken(inToken) == mdtMemberRef)
             return (MemberRefName((mdMemberRef) inToken, buffer, bufLen));
         else
-            return W("[InvalidReference]");
+            return "[InvalidReference]";
     }
     else
-        return W("");
-} // LPCWSTR MDInfo::MemberDeforRefName()
+        return "";
+} // LPCSTR MDInfo::MemberDeforRefName()
 
 // prints out only the name of the given typedef
 //
 //
-
-LPCWSTR MDInfo::TypeDefName(mdTypeDef inTypeDef, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen)
+LPCSTR MDInfo::TypeDefName(mdTypeDef inTypeDef, _Out_writes_(bufLen) LPSTR buffer, ULONG bufLen)
 {
     HRESULT hr;
 
+    WCHAR tempBuf[STRING_BUFFER_LEN];
     hr = m_pImport->GetTypeDefProps(
                             // [IN] The import scope.
         inTypeDef,              // [IN] TypeDef token for inquiry.
-        buffer,                 // [OUT] Put name here.
-        bufLen,                 // [IN] size of name buffer in wide chars.
+        tempBuf,                // [OUT] Put name here.
+        ARRAY_SIZE(tempBuf),    // [IN] size of name buffer in wide chars.
         NULL,                   // [OUT] put size of name (wide chars) here.
         NULL,                   // [OUT] Put flags here.
         NULL);                  // [OUT] Put base class TypeDef/TypeRef here.
     if (FAILED(hr))
     {
-        wcscpy_s(buffer, bufLen, W("[Invalid TypeDef]"));
+        strcpy_s(buffer, bufLen, "[Invalid TypeDef]");
+    }
+    else
+    {
+        (void)ConvertToUtf8(tempBuf, buffer, bufLen);
     }
 
     return buffer;
-} // LPCWSTR MDInfo::TypeDefName()
+} // LPCSTR MDInfo::TypeDefName()
 
 // prints out all the properties of a given typedef
 //
@@ -1394,6 +1402,7 @@ void MDInfo::DisplayTypeDefProps(mdTypeDef inTypeDef)
 {
     HRESULT hr;
     WCHAR typeDefName[STRING_BUFFER_LEN];
+    char typeDefNameUtf8[ARRAY_SIZE(typeDefName) * MAX_UTF8_CVT];
     ULONG nameLen;
     DWORD flags;
     mdToken extends;
@@ -1409,12 +1418,11 @@ void MDInfo::DisplayTypeDefProps(mdTypeDef inTypeDef)
         &extends);              // [OUT] Put base class TypeDef/TypeRef here.
     if (FAILED(hr)) Error("GetTypeDefProps failed.", hr);
 
-    char sFlags[STRING_BUFFER_LEN];
-    WCHAR szTempBuf[STRING_BUFFER_LEN];
+    char szTempBuf[STRING_BUFFER_LEN];
 
-    VWriteLine("\tTypDefName: %ls  (%8.8X)",typeDefName,inTypeDef);
-    VWriteLine("\tFlags     : %s (%08x)",ClassFlags(flags, sFlags), flags);
-    VWriteLine("\tExtends   : %8.8X [%s] %ls",extends,TokenTypeName(extends),
+    VWriteLine("\tTypDefName: %s  (%8.8X)",ConvertToUtf8(typeDefName, typeDefNameUtf8, ARRAY_SIZE(typeDefNameUtf8)),inTypeDef);
+    VWriteLine("\tFlags     : %s (%08x)",ClassFlags(flags, szTempBuf), flags);
+    VWriteLine("\tExtends   : %8.8X [%s] %s",extends,TokenTypeName(extends),
                                  TypeDeforRefName(extends, szTempBuf, ARRAY_SIZE(szTempBuf)));
 
     hr = m_pImport->GetClassLayout(inTypeDef, &dwPacking, 0,0,0, &dwSize);
@@ -1428,7 +1436,7 @@ void MDInfo::DisplayTypeDefProps(mdTypeDef inTypeDef)
         hr = m_pImport->GetNestedClassProps(inTypeDef, &tkEnclosingClass);
         if (hr == S_OK)
         {
-            VWriteLine("\tEnclosingClass : %ls (%8.8X)", TypeDeforRefName(tkEnclosingClass,
+            VWriteLine("\tEnclosingClass : %s (%8.8X)", TypeDeforRefName(tkEnclosingClass,
                                             szTempBuf, ARRAY_SIZE(szTempBuf)), tkEnclosingClass);
         }
         else if (hr == CLDB_E_RECORD_NOTFOUND)
@@ -1441,23 +1449,28 @@ void MDInfo::DisplayTypeDefProps(mdTypeDef inTypeDef)
 //  Prints out the name of the given TypeRef
 //
 
-LPCWSTR MDInfo::TypeRefName(mdTypeRef tr, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen)
+LPCSTR MDInfo::TypeRefName(mdTypeRef tr, _Out_writes_(bufLen) LPSTR buffer, ULONG bufLen)
 {
     HRESULT hr;
 
+    WCHAR tempBuf[STRING_BUFFER_LEN];
     hr = m_pImport->GetTypeRefProps(
         tr,                 // The class ref token.
         NULL,               // Resolution scope.
-        buffer,             // Put the name here.
-        bufLen,             // Size of the name buffer, wide chars.
+        tempBuf,            // Put the name here.
+        ARRAY_SIZE(tempBuf), // Size of the name buffer, wide chars.
         NULL);              // Put actual size of name here.
     if (FAILED(hr))
     {
-        wcscpy_s(buffer, bufLen, W("[Invalid TypeRef]"));
+        strcpy_s(buffer, bufLen, "[Invalid TypeRef]");
+    }
+    else
+    {
+        (void)ConvertToUtf8(tempBuf, buffer, bufLen);
     }
 
-    return (buffer);
-} // LPCWSTR MDInfo::TypeRefName()
+    return buffer;
+} // LPCSTR MDInfo::TypeRefName()
 
 // Prints out all the info of the given TypeRef
 //
@@ -1467,20 +1480,21 @@ void MDInfo::DisplayTypeRefInfo(mdTypeRef tr)
     HRESULT hr;
     mdToken tkResolutionScope;
     WCHAR typeRefName[STRING_BUFFER_LEN];
+    char typeRefNameUtf8[ARRAY_SIZE(typeRefName) * MAX_UTF8_CVT];
     ULONG nameLen;
 
     hr = m_pImport->GetTypeRefProps(
         tr,                 // The class ref token.
         &tkResolutionScope, // ResolutionScope.
         typeRefName,        // Put the name here.
-        STRING_BUFFER_LEN,  // Size of the name buffer, wide chars.
+        ARRAY_SIZE(typeRefName),  // Size of the name buffer, wide chars.
         &nameLen);          // Put actual size of name here.
 
     if (FAILED(hr)) Error("GetTypeRefProps failed.", hr);
 
     VWriteLine("Token:             0x%08x", tr);
     VWriteLine("ResolutionScope:   0x%08x", tkResolutionScope);
-    VWriteLine("TypeRefName:       %ls",typeRefName);
+    VWriteLine("TypeRefName:       %s", ConvertToUtf8(typeRefName, typeRefNameUtf8, ARRAY_SIZE(typeRefNameUtf8)));
 
     DisplayCustomAttributes(tr, "\t");
 } // void MDInfo::DisplayTypeRefInfo()
@@ -1545,9 +1559,9 @@ void MDInfo::DisplayMethodSpecInfo(mdMethodSpec ms, const char *preFix)
 // associated with the class.
 //
 
-char *MDInfo::ClassFlags(DWORD flags, _Out_writes_(STRING_BUFFER_LEN) char *sFlags)
+char *MDInfo::ClassFlags(DWORD flags, _Out_writes_(STRING_BUFFER_LEN) char *szTempBuf)
 {
-    sFlags[0] = 0;
+    szTempBuf[0] = 0;
     ISFLAG(Td, NotPublic);
     ISFLAG(Td, Public);
     ISFLAG(Td, NestedPublic);
@@ -1575,10 +1589,10 @@ char *MDInfo::ClassFlags(DWORD flags, _Out_writes_(STRING_BUFFER_LEN) char *sFla
     ISFLAG(Td, RTSpecialName);
     ISFLAG(Td, HasSecurity);
     ISFLAG(Td, WindowsRuntime);
-    if (!*sFlags)
-        strcpy_s(sFlags, STRING_BUFFER_LEN, "[none]");
+    if (!*szTempBuf)
+        strcpy_s(szTempBuf, STRING_BUFFER_LEN, "[none]");
 
-    return sFlags;
+    return szTempBuf;
 } // char *MDInfo::ClassFlags()
 
 // prints out all info on the given typeDef, including all information that
@@ -1652,13 +1666,13 @@ void MDInfo::DisplayInterfaceImplInfo(mdInterfaceImpl inImpl)
     mdToken token;
     HRESULT hr;
 
-    WCHAR szTempBuf[STRING_BUFFER_LEN];
+    char szTempBuf[STRING_BUFFER_LEN];
 
     hr = m_pImport->GetInterfaceImplProps( inImpl, &typeDef, &token);
     if (FAILED(hr)) Error("GetInterfaceImplProps failed.", hr);
 
-    VWriteLine("\t\tClass     : %ls",TypeDeforRefName(typeDef, szTempBuf, ARRAY_SIZE(szTempBuf)));
-    VWriteLine("\t\tToken     : %8.8X [%s] %ls",token,TokenTypeName(token), TypeDeforRefName(token, szTempBuf, ARRAY_SIZE(szTempBuf)));
+    VWriteLine("\t\tClass     : %s",TypeDeforRefName(typeDef, szTempBuf, ARRAY_SIZE(szTempBuf)));
+    VWriteLine("\t\tToken     : %8.8X [%s] %s",token,TokenTypeName(token), TypeDeforRefName(token, szTempBuf, ARRAY_SIZE(szTempBuf)));
 
     DisplayCustomAttributes(inImpl, "\t\t");
 } // void MDInfo::DisplayInterfaceImplInfo()
@@ -1671,6 +1685,7 @@ void MDInfo::DisplayPropertyInfo(mdProperty inProp)
     HRESULT     hr;
     mdTypeDef   typeDef;
     WCHAR       propName[STRING_BUFFER_LEN];
+    char        propNameUtf8[ARRAY_SIZE(propName) * MAX_UTF8_CVT];
     DWORD       flags;
 #ifdef FEATURE_COMINTEROP
     VARIANT     defaultValue;
@@ -1713,36 +1728,34 @@ void MDInfo::DisplayPropertyInfo(mdProperty inProp)
 
     if (FAILED(hr)) Error("GetPropertyProps failed.", hr);
 
-    VWriteLine("\t\tProp.Name : %ls (%8.8X)",propName,inProp);
+    VWriteLine("\t\tProp.Name : %s (%8.8X)",ConvertToUtf8(propName, propNameUtf8, ARRAY_SIZE(propNameUtf8)),inProp);
 
-    char sFlags[STRING_BUFFER_LEN];
+    char szTempBuf[STRING_BUFFER_LEN];
 
-    sFlags[0] = 0;
+    szTempBuf[0] = 0;
     ISFLAG(Pr, SpecialName);
     ISFLAG(Pr, RTSpecialName);
     ISFLAG(Pr, HasDefault);
-    if (!*sFlags)
-        strcpy_s(sFlags, STRING_BUFFER_LEN, "[none]");
+    if (!*szTempBuf)
+        strcpy_s(szTempBuf, STRING_BUFFER_LEN, "[none]");
 
-    VWriteLine("\t\tFlags     : %s (%08x)", sFlags, flags);
+    VWriteLine("\t\tFlags     : %s (%08x)", szTempBuf, flags);
 
     if (ulSigBlob)
         DisplaySignature(pbSigBlob, ulSigBlob, "");
     else
         VWriteLine("\t\tERROR: no valid signature ");
 
-    WCHAR szTempBuf[STRING_BUFFER_LEN];
-
 #ifdef FEATURE_COMINTEROP
     _FillVariant((BYTE)dwCPlusTypeFlag, pValue, cbValue, &defaultValue);
-    VWriteLine("\t\tDefltValue: %ls",VariantAsString(&defaultValue));
+    VWriteLine("\t\tDefltValue: %s",VariantAsString(&defaultValue, szTempBuf, ARRAY_SIZE(szTempBuf)));
 #endif
 
-    VWriteLine("\t\tSetter    : (%08x) %ls",setter,MemberDeforRefName(setter, szTempBuf, ARRAY_SIZE(szTempBuf)));
-    VWriteLine("\t\tGetter    : (%08x) %ls",getter,MemberDeforRefName(getter, szTempBuf, ARRAY_SIZE(szTempBuf)));
+    VWriteLine("\t\tSetter    : (%08x) %s",setter,MemberDeforRefName(setter, szTempBuf, ARRAY_SIZE(szTempBuf)));
+    VWriteLine("\t\tGetter    : (%08x) %s",getter,MemberDeforRefName(getter, szTempBuf, ARRAY_SIZE(szTempBuf)));
 
     // do something with others?
-    VWriteLine("\t\t%ld Others",others);
+    VWriteLine("\t\t%u Others",others);
     DisplayCustomAttributes(inProp, "\t\t");
 
 #ifdef FEATURE_COMINTEROP
@@ -1785,6 +1798,7 @@ void MDInfo::DisplayEventInfo(mdEvent inEvent)
     HRESULT hr;
     mdTypeDef typeDef;
     WCHAR eventName[STRING_BUFFER_LEN];
+    char eventNameUtf8[ARRAY_SIZE(eventName) * MAX_UTF8_CVT];
     DWORD flags;
     mdToken eventType;
     mdMethodDef addOn, removeOn, fire, otherMethod[ENUM_BUFFER_SIZE];
@@ -1812,24 +1826,21 @@ void MDInfo::DisplayEventInfo(mdEvent inEvent)
         &totalOther);           // [OUT] total number of other method of this event
     if (FAILED(hr)) Error("GetEventProps failed.", hr);
 
-    VWriteLine("\t\tName      : %ls (%8.8X)",eventName,inEvent);
+    VWriteLine("\t\tName      : %s (%8.8X)",ConvertToUtf8(eventName, eventNameUtf8, ARRAY_SIZE(eventNameUtf8)),inEvent);
 
-    char sFlags[STRING_BUFFER_LEN];
+    char szTempBuf[STRING_BUFFER_LEN];
 
-    sFlags[0] = 0;
+    szTempBuf[0] = 0;
     ISFLAG(Ev, SpecialName);
     ISFLAG(Ev, RTSpecialName);
-    if (!*sFlags)
-        strcpy_s(sFlags, STRING_BUFFER_LEN, "[none]");
-
-    VWriteLine("\t\tFlags     : %s (%08x)", sFlags, flags);
-
-    WCHAR szTempBuf[STRING_BUFFER_LEN];
+    if (!*szTempBuf)
+        strcpy_s(szTempBuf, STRING_BUFFER_LEN, "[none]");
 
+    VWriteLine("\t\tFlags     : %s (%08x)", szTempBuf, flags);
     VWriteLine("\t\tEventType : %8.8X [%s]",eventType,TokenTypeName(eventType));
-    VWriteLine("\t\tAddOnMethd: (%08x) %ls",addOn,MemberDeforRefName(addOn, szTempBuf, ARRAY_SIZE(szTempBuf)));
-    VWriteLine("\t\tRmvOnMethd: (%08x) %ls",removeOn,MemberDeforRefName(removeOn, szTempBuf, ARRAY_SIZE(szTempBuf)));
-    VWriteLine("\t\tFireMethod: (%08x) %ls",fire,MemberDeforRefName(fire, szTempBuf, ARRAY_SIZE(szTempBuf)));
+    VWriteLine("\t\tAddOnMethd: (%08x) %s",addOn,MemberDeforRefName(addOn, szTempBuf, ARRAY_SIZE(szTempBuf)));
+    VWriteLine("\t\tRmvOnMethd: (%08x) %s",removeOn,MemberDeforRefName(removeOn, szTempBuf, ARRAY_SIZE(szTempBuf)));
+    VWriteLine("\t\tFireMethod: (%08x) %s",fire,MemberDeforRefName(fire, szTempBuf, ARRAY_SIZE(szTempBuf)));
 
     VWriteLine("\t\t%ld OtherMethods",totalOther);
 
@@ -1882,6 +1893,7 @@ void MDInfo::DisplayCustomAttributeInfo(mdCustomAttribute inValue, const char *p
     ULONG       cbSig=0;                // Size of the signature.
     BOOL        bCoffSymbol = false;    // true for coff symbol CA's.
     WCHAR       rcName[MAX_CLASS_NAME]; // Name of the type.
+    char        rcNameUtf8[ARRAY_SIZE(rcName) * MAX_UTF8_CVT]; // Name of the type.
 
     hr = m_pImport->GetCustomAttributeProps( // S_OK or error.
         inValue,                    // The attribute.
@@ -1894,54 +1906,60 @@ void MDInfo::DisplayCustomAttributeInfo(mdCustomAttribute inValue, const char *p
     VWriteLine("%s\tCustomAttribute Type: %08x", preFix, tkType);
 
     // Get the name of the memberref or methoddef.
-        tk = tkType;
-        rcName[0] = L'\0';
-        // Get the member name, and the parent token.
-        switch (TypeFromToken(tk))
-        {
-        case mdtMemberRef:
-            hr = m_pImport->GetNameFromToken(tk, &pMethName);
-            if (FAILED(hr)) Error("GetNameFromToken failed.", hr);
-            hr = m_pImport->GetMemberRefProps( tk, &tk, 0, 0, 0, &pSig, &cbSig);
-            if (FAILED(hr)) Error("GetMemberRefProps failed.", hr);
-            break;
-        case mdtMethodDef:
-            hr = m_pImport->GetNameFromToken(tk, &pMethName);
-            if (FAILED(hr)) Error("GetNameFromToken failed.", hr);
-            hr = m_pImport->GetMethodProps(tk, &tk, 0, 0, 0, 0, &pSig, &cbSig, 0, 0);
-            if (FAILED(hr)) Error("GetMethodProps failed.", hr);
-            break;
-        } // switch
+    tk = tkType;
+    rcName[0] = W('\0');
+    rcNameUtf8[0] = '\0';
+    // Get the member name, and the parent token.
+    switch (TypeFromToken(tk))
+    {
+    case mdtMemberRef:
+        hr = m_pImport->GetNameFromToken(tk, &pMethName);
+        if (FAILED(hr)) Error("GetNameFromToken failed.", hr);
+        hr = m_pImport->GetMemberRefProps( tk, &tk, 0, 0, 0, &pSig, &cbSig);
+        if (FAILED(hr)) Error("GetMemberRefProps failed.", hr);
+        break;
+    case mdtMethodDef:
+        hr = m_pImport->GetNameFromToken(tk, &pMethName);
+        if (FAILED(hr)) Error("GetNameFromToken failed.", hr);
+        hr = m_pImport->GetMethodProps(tk, &tk, 0, 0, 0, 0, &pSig, &cbSig, 0, 0);
+        if (FAILED(hr)) Error("GetMethodProps failed.", hr);
+        break;
+    } // switch
 
-        // Get the type name.
-        switch (TypeFromToken(tk))
-        {
-        case mdtTypeDef:
-            hr = m_pImport->GetTypeDefProps(tk, rcName,MAX_CLASS_NAME,0, 0,0);
-            if (FAILED(hr)) Error("GetTypeDefProps failed.", hr);
-            break;
-        case mdtTypeRef:
-            hr = m_pImport->GetTypeRefProps(tk, 0, rcName,MAX_CLASS_NAME,0);
-            if (FAILED(hr)) Error("GetTypeRefProps failed.", hr);
-            break;
-        } // switch
+    // Get the type name.
+    switch (TypeFromToken(tk))
+    {
+    case mdtTypeDef:
+        hr = m_pImport->GetTypeDefProps(tk, rcName,MAX_CLASS_NAME,0, 0,0);
+        if (FAILED(hr)) Error("GetTypeDefProps failed.", hr);
+        break;
+    case mdtTypeRef:
+        hr = m_pImport->GetTypeRefProps(tk, 0, rcName,MAX_CLASS_NAME,0);
+        if (FAILED(hr)) Error("GetTypeRefProps failed.", hr);
+        break;
+    } // switch
 
 
-        if (pSig && pMethName)
+    if (pSig && pMethName)
+    {
+        int iLen= 1 + (ULONG32)strlen(pMethName);
+        LPWSTR pwzName = (LPWSTR)(new WCHAR[iLen]);
+        if(pwzName)
         {
-            int iLen;
-            LPWSTR pwzName = (LPWSTR)(new WCHAR[iLen= 1+(ULONG32)strlen(pMethName)]);
-            if(pwzName)
-            {
-                WszMultiByteToWideChar(CP_UTF8,0, pMethName,-1, pwzName,iLen);
-                PrettyPrintSigLegacy(pSig, cbSig, pwzName, &qSigName, m_pImport);
-                delete [] pwzName;
-            }
+            WszMultiByteToWideChar(CP_UTF8,0, pMethName,-1, pwzName,iLen);
+            PrettyPrintSigLegacy(pSig, cbSig, pwzName, &qSigName, m_pImport);
+            delete [] pwzName;
         }
+    }
 
-    VWrite("%s\tCustomAttributeName: %ls", preFix, rcName);
+    VWrite("%s\tCustomAttributeName: %s", preFix, ConvertToUtf8(rcName, rcNameUtf8, ARRAY_SIZE(rcNameUtf8)));
     if (pSig && pMethName)
-        VWrite(" :: %S", (LPWSTR)qSigName.Ptr());
+    {
+        int iLen = 1 + (ULONG32)qSigName.Size();
+        LPSTR pzSig = (LPSTR)(new char[iLen]);
+        VWrite(" :: %s", ConvertToUtf8((LPWSTR)qSigName.Ptr(), pzSig, iLen));
+        delete [] pzSig;
+    }
 
     // Keep track of coff overhead.
     if (!wcscmp(W("__DecoratedName"), rcName))
@@ -2041,7 +2059,7 @@ void MDInfo::DisplayCustomAttributeInfo(mdCustomAttribute inValue, const char *p
                 case ELEMENT_TYPE_U8:
                     CA.GetU8(&u8);
                     uI64 = u8;
-                    VWrite("%#I64x", uI64);
+                    VWrite("0x%llx", uI64);
                     break;
                 case ELEMENT_TYPE_R4:
                     dblVal = CA.GetR4();
@@ -2171,44 +2189,38 @@ void MDInfo::DisplayPermissionInfo(mdPermission inPermission, const char *preFix
 
 // simply prints out the given GUID in standard form
 
-LPWSTR MDInfo::GUIDAsString(GUID inGuid, _Out_writes_(bufLen) LPWSTR guidString, ULONG bufLen)
+LPCSTR MDInfo::GUIDAsString(GUID inGuid, _Out_writes_(bufLen) LPSTR guidString, ULONG bufLen)
 {
-    GuidToLPWSTR(inGuid, guidString, bufLen);
+    GuidToLPSTR(inGuid, guidString, bufLen);
     return guidString;
-} // LPWSTR MDInfo::GUIDAsString()
+} // LPCSTR MDInfo::GUIDAsString()
 
 #ifdef FEATURE_COMINTEROP
-LPCWSTR MDInfo::VariantAsString(VARIANT *pVariant)
+LPCSTR MDInfo::VariantAsString(VARIANT *pVariant, _Out_writes_(bufLen) LPSTR buffer, ULONG bufLen)
 {
     HRESULT hr = S_OK;
     if (V_VT(pVariant) == VT_UNKNOWN)
     {
         _ASSERTE(V_UNKNOWN(pVariant) == NULL);
-        return W("<NULL>");
+        return "<NULL>";
     }
     else if (SUCCEEDED(hr = ::VariantChangeType(pVariant, pVariant, 0, VT_BSTR)))
-        return V_BSTR(pVariant);
+    {
+        return ConvertToUtf8(V_BSTR(pVariant), buffer, bufLen);
+    }
     else if (hr == DISP_E_BADVARTYPE && V_VT(pVariant) == VT_I8)
     {
-        // allocate the bstr.
-        char    szStr[32];
-        WCHAR   wszStr[32];
         // Set variant type to bstr.
         V_VT(pVariant) = VT_BSTR;
-        // Create the ansi string.
-        sprintf_s(szStr, 32, "%lld", V_CY(pVariant).int64);
-        // Convert to unicode.
-        WszMultiByteToWideChar(CP_ACP, 0, szStr, -1, wszStr, 32);
-        // convert to bstr and set variant value.
-        V_BSTR(pVariant) = ::SysAllocString(wszStr);
-        if (V_BSTR(pVariant) == NULL)
-            Error("SysAllocString() failed.", E_OUTOFMEMORY);
-        return V_BSTR(pVariant);
+        sprintf_s(buffer, bufLen, "%lld", V_CY(pVariant).int64);
+        return buffer;
     }
     else
-        return W("ERROR");
+    {
+        return "ERROR";
+    }
 
-} // LPWSTR MDInfo::VariantAsString()
+} // LPSTR MDInfo::VariantAsString()
 #endif
 
 bool TrySigUncompress(PCCOR_SIGNATURE pData,              // [IN] compressed data
@@ -2477,9 +2489,10 @@ void MDInfo::DisplayPinvokeInfo(mdToken inToken)
     HRESULT hr = NOERROR;
     DWORD flags;
     WCHAR rcImport[512];
+    char rcImportUtf8[ARRAY_SIZE(rcImport) * MAX_UTF8_CVT];
     mdModuleRef tkModuleRef;
 
-    char sFlags[STRING_BUFFER_LEN];
+    char szTempBuf[STRING_BUFFER_LEN];
 
     hr = m_pImport->GetPinvokeMap(inToken, &flags, rcImport,
                                   ARRAY_SIZE(rcImport), 0, &tkModuleRef);
@@ -2491,10 +2504,10 @@ void MDInfo::DisplayPinvokeInfo(mdToken inToken)
     }
 
     WriteLine("\t\tPinvoke Map Data:");
-    VWriteLine("\t\tEntry point:      %S", rcImport);
+    VWriteLine("\t\tEntry point:      %s", ConvertToUtf8(rcImport, rcImportUtf8, ARRAY_SIZE(rcImportUtf8)));
     VWriteLine("\t\tModule ref:       %08x", tkModuleRef);
 
-    sFlags[0] = 0;
+    szTempBuf[0] = 0;
     ISFLAG(Pm, NoMangle);
     ISFLAG(Pm, CharSetNotSpec);
     ISFLAG(Pm, CharSetAnsi);
@@ -2513,10 +2526,10 @@ void MDInfo::DisplayPinvokeInfo(mdToken inToken)
     ISFLAG(Pm, ThrowOnUnmappableCharEnabled);
     ISFLAG(Pm, ThrowOnUnmappableCharDisabled);
     ISFLAG(Pm, ThrowOnUnmappableCharUseAssem);
-    if (!*sFlags)
-        strcpy_s(sFlags, STRING_BUFFER_LEN, "[none]");
+    if (!*szTempBuf)
+        strcpy_s(szTempBuf, STRING_BUFFER_LEN, "[none]");
 
-    VWriteLine("\t\tMapping flags:    %s (%08x)", sFlags, flags);
+    VWriteLine("\t\tMapping flags:    %s (%08x)", szTempBuf, flags);
 }   // void MDInfo::DisplayPinvokeInfo()
 
 
@@ -2742,7 +2755,7 @@ HRESULT MDInfo::GetOneElementType(PCCOR_SIGNATURE pbSigBlob, ULONG ulSigBlob, UL
         // get the name of type ref. Don't care if truncated
         if (TypeFromToken(tk) == mdtTypeDef || TypeFromToken(tk) == mdtTypeRef)
         {
-            sprintf_s(m_tempFormatBuffer, STRING_BUFFER_LEN, " %ls",TypeDeforRefName(tk, m_szTempBuf, ARRAY_SIZE(m_szTempBuf)));
+            sprintf_s(m_tempFormatBuffer, STRING_BUFFER_LEN, " %s",TypeDeforRefName(tk, m_szTempBuf, ARRAY_SIZE(m_szTempBuf)));
             IfFailGo(AddToSigBuffer(m_tempFormatBuffer));
         }
         else
@@ -2942,11 +2955,13 @@ void MDInfo::DisplayCorNativeLink(COR_NATIVE_LINK *pCorNLnk, const char *preFix)
 
     // Print the entry point.
     WCHAR memRefName[STRING_BUFFER_LEN];
+    char memRefNameUtf8[ARRAY_SIZE(memRefName) * MAX_UTF8_CVT];
     HRESULT hr;
     hr = m_pImport->GetMemberRefProps( pCorNLnk->m_entryPoint, NULL, memRefName,
                                     STRING_BUFFER_LEN, NULL, NULL, NULL);
     if (FAILED(hr)) Error("GetMemberRefProps failed.", hr);
-    VWriteLine("%s\tEntry Point : %ls (0x%08x)", preFix, memRefName, pCorNLnk->m_entryPoint);
+    VWriteLine("%s\tEntry Point : %s (0x%08x)",
+        preFix, ConvertToUtf8(memRefName, memRefNameUtf8, ARRAY_SIZE(memRefNameUtf8)), pCorNLnk->m_entryPoint);
 } // void MDInfo::DisplayCorNativeLink()
 
 // Fills given varaint with value given in pValue and of type in bCPlusTypeFlag
@@ -3067,6 +3082,7 @@ void MDInfo::DisplayAssemblyInfo()
     ULONG           cbPublicKey;
     ULONG           ulHashAlgId;
     WCHAR           szName[STRING_BUFFER_LEN];
+    char            szNameUtf8[ARRAY_SIZE(szName) * MAX_UTF8_CVT];
     ASSEMBLYMETADATA MetaData;
     DWORD           dwFlags;
 
@@ -3103,7 +3119,7 @@ void MDInfo::DisplayAssemblyInfo()
     WriteLine("Assembly");
     WriteLine("-------------------------------------------------------");
     VWriteLine("\tToken: 0x%08x", mda);
-    VWriteLine("\tName : %ls", szName);
+    VWriteLine("\tName : %s", ConvertToUtf8(szName, szNameUtf8, ARRAY_SIZE(szNameUtf8)));
     DumpHex("\tPublic Key    ", pbPublicKey, cbPublicKey, false, 24);
     VWriteLine("\tHash Algorithm : 0x%08x", ulHashAlgId);
     DisplayASSEMBLYMETADATA(&MetaData);
@@ -3111,18 +3127,18 @@ void MDInfo::DisplayAssemblyInfo()
     if(MetaData.rProcessor) delete [] MetaData.rProcessor;
     if(MetaData.rOS) delete [] MetaData.rOS;
 
-    char sFlags[STRING_BUFFER_LEN];
+    char szTempBuf[STRING_BUFFER_LEN];
     DWORD flags = dwFlags;
 
-    sFlags[0] = 0;
+    szTempBuf[0] = 0;
     ISFLAG(Af, PublicKey);
     ISFLAG(Af, Retargetable);
     ISFLAG(AfContentType_, WindowsRuntime);
 
-    if (!*sFlags)
-        strcpy_s(sFlags, STRING_BUFFER_LEN, "[none]");
+    if (!*szTempBuf)
+        strcpy_s(szTempBuf, STRING_BUFFER_LEN, "[none]");
 
-    VWriteLine("\tFlags : %s (%08x)", sFlags, dwFlags);
+    VWriteLine("\tFlags : %s (%08x)", szTempBuf, dwFlags);
     DisplayCustomAttributes(mda, "\t");
     DisplayPermissions(mda, "\t");
     WriteLine("");
@@ -3157,6 +3173,7 @@ void MDInfo::DisplayAssemblyRefInfo(mdAssemblyRef inAssemblyRef)
     const BYTE      *pbPublicKeyOrToken;
     ULONG           cbPublicKeyOrToken;
     WCHAR           szName[STRING_BUFFER_LEN];
+    char            szNameUtf8[ARRAY_SIZE(szName) * MAX_UTF8_CVT];
     ASSEMBLYMETADATA MetaData;
     const BYTE      *pbHashValue;
     ULONG           cbHashValue;
@@ -3191,17 +3208,17 @@ void MDInfo::DisplayAssemblyRefInfo(mdAssemblyRef inAssemblyRef)
     if (FAILED(hr)) Error("GetAssemblyRefProps() failed.", hr);
 
     DumpHex("\tPublic Key or Token", pbPublicKeyOrToken, cbPublicKeyOrToken, false, 24);
-    VWriteLine("\tName: %ls", szName);
+    VWriteLine("\tName: %s", ConvertToUtf8(szName, szNameUtf8, ARRAY_SIZE(szNameUtf8)));
     DisplayASSEMBLYMETADATA(&MetaData);
     if(MetaData.szLocale) delete [] MetaData.szLocale;
     if(MetaData.rProcessor) delete [] MetaData.rProcessor;
     if(MetaData.rOS) delete [] MetaData.rOS;
     DumpHex("\tHashValue Blob", pbHashValue, cbHashValue, false, 24);
 
-    char sFlags[STRING_BUFFER_LEN];
+    char szTempBuf[STRING_BUFFER_LEN];
     DWORD flags = dwFlags;
 
-    sFlags[0] = 0;
+    szTempBuf[0] = 0;
     ISFLAG(Af, PublicKey);
     ISFLAG(Af, Retargetable);
     ISFLAG(AfContentType_, WindowsRuntime);
@@ -3211,10 +3228,10 @@ void MDInfo::DisplayAssemblyRefInfo(mdAssemblyRef inAssemblyRef)
     ISFLAG(Af, Library);
     ISFLAG(Af, Platform);
 #endif
-    if (!*sFlags)
-        strcpy_s(sFlags, STRING_BUFFER_LEN, "[none]");
+    if (!*szTempBuf)
+        strcpy_s(szTempBuf, STRING_BUFFER_LEN, "[none]");
 
-    VWriteLine("\tFlags: %s (%08x)", sFlags, dwFlags);
+    VWriteLine("\tFlags: %s (%08x)", szTempBuf, dwFlags);
     DisplayCustomAttributes(inAssemblyRef, "\t");
     WriteLine("");
 }   // void MDInfo::DisplayAssemblyRefInfo()
@@ -3246,6 +3263,7 @@ void MDInfo::DisplayFileInfo(mdFile inFile)
 {
     HRESULT         hr;
     WCHAR           szName[STRING_BUFFER_LEN];
+    char            szNameUtf8[ARRAY_SIZE(szName) * MAX_UTF8_CVT];
     const BYTE      *pbHashValue;
     ULONG           cbHashValue;
     DWORD           dwFlags;
@@ -3257,19 +3275,19 @@ void MDInfo::DisplayFileInfo(mdFile inFile)
                                          (const void **)&pbHashValue, &cbHashValue,
                                          &dwFlags);
     if (FAILED(hr)) Error("GetFileProps() failed.", hr);
-    VWriteLine("\tName : %ls", szName);
+    VWriteLine("\tName : %s", ConvertToUtf8(szName, szNameUtf8, ARRAY_SIZE(szNameUtf8)));
     DumpHex("\tHashValue Blob ", pbHashValue, cbHashValue, false, 24);
 
-    char sFlags[STRING_BUFFER_LEN];
+    char szTempBuf[STRING_BUFFER_LEN];
     DWORD flags = dwFlags;
 
-    sFlags[0] = 0;
+    szTempBuf[0] = 0;
     ISFLAG(Ff, ContainsMetaData);
     ISFLAG(Ff, ContainsNoMetaData);
-    if (!*sFlags)
-        strcpy_s(sFlags, STRING_BUFFER_LEN, "[none]");
+    if (!*szTempBuf)
+        strcpy_s(szTempBuf, STRING_BUFFER_LEN, "[none]");
 
-    VWriteLine("\tFlags : %s (%08x)", sFlags, dwFlags);
+    VWriteLine("\tFlags : %s (%08x)", szTempBuf, dwFlags);
     DisplayCustomAttributes(inFile, "\t");
     WriteLine("");
 
@@ -3302,10 +3320,11 @@ void MDInfo::DisplayExportedTypeInfo(mdExportedType inExportedType)
 {
     HRESULT         hr;
     WCHAR           szName[STRING_BUFFER_LEN];
+    char            szNameUtf8[ARRAY_SIZE(szName) * MAX_UTF8_CVT];
     mdToken         tkImplementation;
     mdTypeDef       tkTypeDef;
     DWORD           dwFlags;
-    char            sFlags[STRING_BUFFER_LEN];
+    char            szTempBuf[STRING_BUFFER_LEN];
 
     VWriteLine("\tToken: 0x%08x", inExportedType);
 
@@ -3315,10 +3334,10 @@ void MDInfo::DisplayExportedTypeInfo(mdExportedType inExportedType)
                                             &tkTypeDef,
                                             &dwFlags);
     if (FAILED(hr)) Error("GetExportedTypeProps() failed.", hr);
-    VWriteLine("\tName: %ls", szName);
+    VWriteLine("\tName: %s", ConvertToUtf8(szName, szNameUtf8, ARRAY_SIZE(szNameUtf8)));
     VWriteLine("\tImplementation token: 0x%08x", tkImplementation);
     VWriteLine("\tTypeDef token: 0x%08x", tkTypeDef);
-    VWriteLine("\tFlags     : %s (%08x)",ClassFlags(dwFlags, sFlags), dwFlags);
+    VWriteLine("\tFlags     : %s (%08x)",ClassFlags(dwFlags, szTempBuf), dwFlags);
     DisplayCustomAttributes(inExportedType, "\t");
     WriteLine("");
 }   // void MDInfo::DisplayExportedTypeInfo()
@@ -3350,6 +3369,7 @@ void MDInfo::DisplayManifestResourceInfo(mdManifestResource inManifestResource)
 {
     HRESULT         hr;
     WCHAR           szName[STRING_BUFFER_LEN];
+    char            szNameUtf8[ARRAY_SIZE(szName) * MAX_UTF8_CVT];
     mdToken         tkImplementation;
     DWORD           dwOffset;
     DWORD           dwFlags;
@@ -3362,20 +3382,20 @@ void MDInfo::DisplayManifestResourceInfo(mdManifestResource inManifestResource)
                                                      &dwOffset,
                                                      &dwFlags);
     if (FAILED(hr)) Error("GetManifestResourceProps() failed.", hr);
-    VWriteLine("Name: %ls", szName);
+    VWriteLine("Name: %s", ConvertToUtf8(szName, szNameUtf8, ARRAY_SIZE(szNameUtf8)));
     VWriteLine("Implementation token: 0x%08x", tkImplementation);
     VWriteLine("Offset: 0x%08x", dwOffset);
 
-    char sFlags[STRING_BUFFER_LEN];
+    char szTempBuf[STRING_BUFFER_LEN];
     DWORD flags = dwFlags;
 
-    sFlags[0] = 0;
+    szTempBuf[0] = 0;
     ISFLAG(Mr, Public);
     ISFLAG(Mr, Private);
-    if (!*sFlags)
-        strcpy_s(sFlags, STRING_BUFFER_LEN, "[none]");
+    if (!*szTempBuf)
+        strcpy_s(szTempBuf, STRING_BUFFER_LEN, "[none]");
 
-    VWriteLine("\tFlags: %s (%08x)", sFlags, dwFlags);
+    VWriteLine("\tFlags: %s (%08x)", szTempBuf, dwFlags);
     DisplayCustomAttributes(inManifestResource, "\t");
     WriteLine("");
 }   // void MDInfo::DisplayManifestResourceInfo()
@@ -3384,12 +3404,13 @@ void MDInfo::DisplayASSEMBLYMETADATA(ASSEMBLYMETADATA *pMetaData)
 {
     ULONG           i;
 
+    char            szLocaleUtf8[STRING_BUFFER_LEN];
     VWriteLine("\tVersion: %d.%d.%d.%d", pMetaData->usMajorVersion, pMetaData->usMinorVersion, pMetaData->usBuildNumber, pMetaData->usRevisionNumber);
     VWriteLine("\tMajor Version: 0x%08x", pMetaData->usMajorVersion);
     VWriteLine("\tMinor Version: 0x%08x", pMetaData->usMinorVersion);
     VWriteLine("\tBuild Number: 0x%08x", pMetaData->usBuildNumber);
     VWriteLine("\tRevision Number: 0x%08x", pMetaData->usRevisionNumber);
-    VWriteLine("\tLocale: %ls", pMetaData->cbLocale ? pMetaData->szLocale : W("<null>"));
+    VWriteLine("\tLocale: %s", pMetaData->cbLocale ? ConvertToUtf8(pMetaData->szLocale, szLocaleUtf8, ARRAY_SIZE(szLocaleUtf8)) : "<null>");
     for (i = 0; i < pMetaData->ulProcessor; i++)
         VWriteLine("\tProcessor #%ld: 0x%08x", i+1, pMetaData->rProcessor[i]);
     for (i = 0; i < pMetaData->ulOS; i++)
index ff60b31..bcbf3ab 100644 (file)
@@ -44,8 +44,9 @@ public:
 
     void DisplayMD(void);
 
+private:
 #ifdef FEATURE_COMINTEROP
-    LPCWSTR VariantAsString(VARIANT *pVariant);
+    LPCSTR VariantAsString(VARIANT *pVariant, _Out_writes_(bufLen) LPSTR buffer, ULONG bufLen);
 #endif
 
     void DisplayVersionInfo(void);
@@ -67,18 +68,16 @@ public:
     void DisplaySignatures(void);
     void DisplaySignatureInfo(mdSignature inSignature);
 
-    LPCWSTR TokenName(mdToken inToken, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen);
-
-    LPCWSTR TypeDeforRefName(mdToken inToken, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen);
-    LPCWSTR TypeDefName(mdTypeDef inTypeDef, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen);
-    LPCWSTR TypeRefName(mdTypeRef tr, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen);
+    LPCSTR TypeDeforRefName(mdToken inToken, _Out_writes_(bufLen) LPSTR buffer, ULONG bufLen);
+    LPCSTR TypeDefName(mdTypeDef inTypeDef, _Out_writes_(bufLen) LPSTR buffer, ULONG bufLen);
+    LPCSTR TypeRefName(mdTypeRef tr, _Out_writes_(bufLen) LPSTR buffer, ULONG bufLen);
 
-    LPCWSTR MemberDeforRefName(mdToken inToken, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen);
-    LPCWSTR MemberRefName(mdToken inMemRef, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen);
-    LPCWSTR MemberName(mdToken inMember, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen);
+    LPCSTR MemberDeforRefName(mdToken inToken, _Out_writes_(bufLen) LPSTR buffer, ULONG bufLen);
+    LPCSTR MemberRefName(mdToken inMemRef, _Out_writes_(bufLen) LPSTR buffer, ULONG bufLen);
+    LPCSTR MemberName(mdToken inMember, _Out_writes_(bufLen) LPSTR buffer, ULONG bufLen);
 
-    LPCWSTR MethodName(mdMethodDef inToken, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen);
-    LPCWSTR FieldName(mdFieldDef inToken, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen);
+    LPCSTR MethodName(mdMethodDef inToken, _Out_writes_(bufLen) LPSTR buffer, ULONG bufLen);
+    LPCSTR FieldName(mdFieldDef inToken, _Out_writes_(bufLen) LPSTR buffer, ULONG bufLen);
 
     char *ClassFlags(DWORD flags, _Out_writes_(STRING_BUFFER_LEN) char *sFlags);
 
@@ -96,7 +95,7 @@ public:
     void DisplayInterfaceImpls(mdTypeDef inTypeDef);
     void DisplayInterfaceImplInfo(mdInterfaceImpl inImpl);
 
-    LPWSTR GUIDAsString(GUID inGuid, _Out_writes_(bufLen) LPWSTR guidString, ULONG bufLen);
+    LPCSTR GUIDAsString(GUID inGuid, _Out_writes_(bufLen) LPSTR guidString, ULONG bufLen);
 
     const char *TokenTypeName(mdToken inToken);
 
@@ -164,6 +163,7 @@ public:
     ULONG DumpRawColStats(ULONG ixTbl, ULONG ixCol, ULONG cRows);
     const char *DumpRawNameOfType(ULONG ulType);
 
+public:
     static void Error(const char *szError, HRESULT hr = S_OK);
 private:
     void Init(strPassBackFn inPBFn, DUMP_FILTER DumpFilter); // Common initialization code.
@@ -192,7 +192,7 @@ private:
 
     // temporary buffer for TypeDef or TypeRef name. Consume immediately
     // because other functions may overwrite it.
-    WCHAR           m_szTempBuf[STRING_BUFFER_LEN];
+    char           m_szTempBuf[STRING_BUFFER_LEN];
 
     // temporary buffer for formatted string. Consume immediately before any function calls.
     char            m_tempFormatBuffer[STRING_BUFFER_LEN];
index 51677bc..790952f 100644 (file)
@@ -3964,8 +3964,7 @@ void AppDomain::NotifyDebuggerUnload()
     if (!IsDebuggerAttached())
         return;
 
-    LOG((LF_CORDB, LL_INFO10, "AD::NDD domain %#08x %ls\n",
-         this, GetFriendlyNameForLogging()));
+    LOG((LF_CORDB, LL_INFO10, "AD::NDD domain %#08x\n", this));
 
     LOG((LF_CORDB, LL_INFO100, "AD::NDD: Interating domain bound assemblies\n"));
     AssemblyIterator i = IterateAssembliesEx((AssemblyIterationFlags)(kIncludeLoaded |  kIncludeLoading  | kIncludeExecution));
index de99463..1359b17 100644 (file)
@@ -130,7 +130,7 @@ public:
     PTR_LoaderAllocator GetLoaderAllocator() { LIMITED_METHOD_DAC_CONTRACT; return m_pLoaderAllocator; }
 
 #ifdef LOGGING
-    LPCWSTR GetDebugName()
+    LPCUTF8 GetDebugName()
     {
         WRAPPER_NO_CONTRACT;
         return GetPEAssembly()->GetDebugName();
index 4ad463c..6091f9c 100644 (file)
@@ -506,7 +506,7 @@ void Module::Initialize(AllocMemTracker *pamTracker, LPCWSTR szName)
     }
 #endif // defined (PROFILING_SUPPORTED) &&!defined(DACCESS_COMPILE)
 
-    LOG((LF_CLASSLOADER, LL_INFO10, "Loaded pModule: \"%ws\".\n", GetDebugName()));
+    LOG((LF_CLASSLOADER, LL_INFO10, "Loaded pModule: \"%s\".\n", GetDebugName()));
 }
 
 #endif // DACCESS_COMPILE
@@ -1772,7 +1772,7 @@ void Module::SetDomainAssembly(DomainAssembly *pDomainAssembly)
 
         SIZE_T size = GetDomainLocalModuleSize();
 
-        LOG((LF_CLASSLOADER, LL_INFO10, "STATICS: Allocating %i bytes for precomputed statics in module %S in LoaderAllocator %p\n",
+        LOG((LF_CLASSLOADER, LL_INFO10, "STATICS: Allocating %zi bytes for precomputed statics in module %s in LoaderAllocator %p\n",
             size, this->GetDebugName(), pLoaderAllocator));
 
         // We guarantee alignment for 64-bit regular statics on 32-bit platforms even without FEATURE_64BIT_ALIGNMENT for performance reasons.
@@ -2389,12 +2389,12 @@ ISymUnmanagedReader *Module::GetISymUnmanagedReader(void)
         if (SUCCEEDED(hr))
         {
             m_pISymUnmanagedReader = pReader.Extract();
-            LOG((LF_CORDB, LL_INFO10, "M::GISUR: Loaded symbols for module %S\n", GetDebugName()));
+            LOG((LF_CORDB, LL_INFO10, "M::GISUR: Loaded symbols for module %s\n", GetDebugName()));
         }
         else
         {
             // We failed to create the reader, don't try again next time
-            LOG((LF_CORDB, LL_INFO10, "M::GISUR: Failed to load symbols for module %S\n", GetDebugName()));
+            LOG((LF_CORDB, LL_INFO10, "M::GISUR: Failed to load symbols for module %s\n", GetDebugName()));
             _ASSERTE( m_pISymUnmanagedReader == k_pInvalidSymReader );
         }
 
@@ -2464,7 +2464,7 @@ void Module::SetSymbolBytes(LPCBYTE pbSyms, DWORD cbSyms)
     _ASSERTE( m_pISymUnmanagedReader == NULL );
 
 #ifdef LOGGING
-    LPCWSTR pName = NULL;
+    LPCUTF8 pName = NULL;
     pName = GetDebugName();
 #endif // LOGGING
 
index 6f950c5..f1cf900 100644 (file)
@@ -1499,7 +1499,7 @@ public:
     const SString &GetPath() { WRAPPER_NO_CONTRACT; return m_pPEAssembly->GetPath(); }
 
 #ifdef LOGGING
-    LPCWSTR GetDebugName() { WRAPPER_NO_CONTRACT; return m_pPEAssembly->GetDebugName(); }
+    LPCUTF8 GetDebugName() { WRAPPER_NO_CONTRACT; return m_pPEAssembly->GetDebugName(); }
 #endif
 
     PEImageLayout * GetReadyToRunImage();
index 4bca61b..3dd797e 100644 (file)
@@ -375,7 +375,7 @@ TypeHandle ClassLoader::LoadTypeHandleThrowIfFailed(NameHandle* pName, ClassLoad
                 StackSString codeBase;
                 GetAssembly()->GetCodeBase(codeBase);
 
-                LOG((LF_CLASSLOADER, LL_INFO10, "Failed to find class \"%s\" in the manifest for assembly \"%ws\"\n", szName, (LPCWSTR)codeBase));
+                LOG((LF_CLASSLOADER, LL_INFO10, "Failed to find class \"%s\" in the manifest for assembly \"%s\"\n", szName, codeBase.GetUTF8()));
             }
 #endif
 
@@ -1302,7 +1302,7 @@ BOOL ClassLoader::FindClassModuleThrowing(
         LPCUTF8 szName = pName->GetName();
         if (szName == NULL)
             szName = "<UNKNOWN>";
-        LOG((LF_CLASSLOADER, LL_INFO10, "Failed to find type \"%s\", assembly \"%ws\" in hash table. Incomplete = %d\n",
+        LOG((LF_CLASSLOADER, LL_INFO10, "Failed to find type \"%s\", assembly \"%s\" in hash table. Incomplete = %d\n",
             szName, GetAssembly()->GetDebugName(), incomplete));
 #endif
         return FALSE;
@@ -2866,7 +2866,7 @@ TypeHandle ClassLoader::DoIncrementalLoad(TypeKey *pTypeKey, TypeHandle typeHnd,
     {
         SString name;
         TypeString::AppendTypeKeyDebug(name, pTypeKey);
-        LOG((LF_CLASSLOADER, LL_INFO10000, "PHASEDLOAD: About to do incremental load of type %S (%p) from level %s\n", name.GetUnicode(), typeHnd.AsPtr(), classLoadLevelName[currentLevel]));
+        LOG((LF_CLASSLOADER, LL_INFO10000, "PHASEDLOAD: About to do incremental load of type %s (%p) from level %s\n", name.GetUTF8(), typeHnd.AsPtr(), classLoadLevelName[currentLevel]));
     }
 #endif
 
@@ -3261,7 +3261,7 @@ TypeHandle ClassLoader::LoadTypeHandleForTypeKey(TypeKey *pTypeKey,
     {
         SString name;
         TypeString::AppendTypeKeyDebug(name, pTypeKey);
-        LOG((LF_CLASSLOADER, LL_INFO10000, "PHASEDLOAD: LoadTypeHandleForTypeKey for type %S to level %s\n", name.GetUnicode(), classLoadLevelName[targetLevel]));
+        LOG((LF_CLASSLOADER, LL_INFO10000, "PHASEDLOAD: LoadTypeHandleForTypeKey for type %s to level %s\n", name.GetUTF8(), classLoadLevelName[targetLevel]));
         CrstHolder unresolvedClassLockHolder(&m_UnresolvedClassLock);
         m_pUnresolvedClassHash->Dump();
     }
index 11fb385..8bad035 100644 (file)
@@ -4702,8 +4702,8 @@ ComCallWrapperTemplate* ComCallWrapperTemplate::CreateTemplate(TypeHandle thClas
             GuidToLPSTR(IClassXIID, rIID);
             SString ssName;
             thClass.GetName(ssName);
-            LOG((LF_CORPROF, LL_INFO100, "COMClassicVTableCreated Class:%ls, IID:%s, vTbl:%#08x\n",
-                 ssName.GetUnicode(), rIID, pComVtable));
+            LOG((LF_CORPROF, LL_INFO100, "COMClassicVTableCreated Class:%s, IID:%s, vTbl:%#08x\n",
+                 ssName.GetUTF8(), rIID, pComVtable));
 #else
             LOG((LF_CORPROF, LL_INFO100, "COMClassicVTableCreated TypeHandle:%#x, IID:{%08x-...}, vTbl:%#08x\n",
                  thClass.AsPtr(), IClassXIID.Data1, pComVtable));
index 6e86d9c..52a9b5b 100644 (file)
@@ -903,7 +903,7 @@ void DomainAssembly::SetupDebuggingConfig(void)
 
     SetDebuggerInfoBits((DebuggerAssemblyControlFlags)dacfFlags);
 
-    LOG((LF_CORDB, LL_INFO10, "Assembly %S: bits=0x%x\n", GetDebugName(), GetDebuggerInfoBits()));
+    LOG((LF_CORDB, LL_INFO10, "Assembly %s: bits=0x%x\n", GetDebugName(), GetDebuggerInfoBits()));
 #endif // DEBUGGING_SUPPORTED
 }
 
@@ -981,7 +981,7 @@ HRESULT DomainAssembly::GetDebuggingCustomAttributes(DWORD *pdwFlags)
                     *pdwFlags &= (~DACF_ALLOW_JIT_OPTS);
                 }
 
-                LOG((LF_CORDB, LL_INFO10, "Assembly %S: has %s=%d,%d bits = 0x%x\n", GetDebugName(),
+                LOG((LF_CORDB, LL_INFO10, "Assembly %s: has %s=%d,%d bits = 0x%x\n", GetDebugName(),
                      DEBUGGABLE_ATTRIBUTE_TYPE_NAME,
                      blob[2], blob[3], *pdwFlags));
             }
index 7adb9f5..e9b198f 100644 (file)
@@ -148,7 +148,7 @@ public:
     }
 
 #ifdef LOGGING
-    LPCWSTR GetDebugName()
+    LPCUTF8 GetDebugName()
     {
         WRAPPER_NO_CONTRACT;
         return GetPEAssembly()->GetDebugName();
index efa7f78..23ec5ca 100644 (file)
@@ -4040,11 +4040,12 @@ BuildCreateDumpCommandLine(
         }
     }
 
-    commandLine.AppendASCII(DumpGeneratorName);
+    commandLine.AppendUTF8(DumpGeneratorName);
 
     if (dumpName != nullptr)
     {
-        commandLine.AppendPrintf(" --name %S", dumpName);
+        commandLine.AppendUTF8(" --name ");
+        commandLine.Append(dumpName);
     }
 
     const char* dumpTypeOption = nullptr;
index 3e02cb0..d77b5c5 100644 (file)
@@ -1355,7 +1355,7 @@ MethodTableBuilder::BuildMethodTableThrowing(
         pszDebugName = (LPCUTF8)name;
     }
 
-    LOG((LF_CLASSLOADER, LL_INFO1000, "Loading class \"%s%s%s\" from module \"%ws\" in domain 0x%p %s\n",
+    LOG((LF_CLASSLOADER, LL_INFO1000, "Loading class \"%s%s%s\" from module \"%s\" in domain 0x%p %s\n",
         *pszDebugNamespace ? pszDebugNamespace : "",
         *pszDebugNamespace ? NAMESPACE_SEPARATOR_STR : "",
         debugName.GetUTF8(),
index 0844ca5..9eb0277 100644 (file)
@@ -212,10 +212,13 @@ NativeImage *NativeImage::Open(
         if (peLoadedImage.IsNull())
         {
             // Failed to locate the native composite R2R image
-            LOG((LF_LOADER, LL_ALWAYS, "LOADER: failed to load native image '%s' for component assembly '%s' using search paths: '%S'\n",
+#ifdef LOGGING
+            SString searchPaths(searchPathsConfig != nullptr ? searchPathsConfig : W("<use DOTNET_NativeImageSearchPaths to set>"));
+            LOG((LF_LOADER, LL_ALWAYS, "LOADER: failed to load native image '%s' for component assembly '%s' using search paths: '%s'\n",
                 nativeImageFileName,
                 path.GetUTF8(),
-                searchPathsConfig != nullptr ? searchPathsConfig : W("<use COMPlus_NativeImageSearchPaths to set>")));
+                searchPaths.GetUTF8()));
+#endif // LOGGING
             RaiseFailFastException(nullptr, nullptr, 0);
         }
     }
index ba60a8e..c7c618b 100644 (file)
@@ -668,9 +668,9 @@ PEAssembly::PEAssembly(
     }
     CONTRACTL_END;
 
-#if _DEBUG
+#ifdef LOGGING
     m_pDebugName = NULL;
-#endif
+#endif // LOGGING
     m_PEImage = NULL;
     m_MDImportIsRW_Debugger_Use_Only = FALSE;
     m_pMDImport = NULL;
@@ -731,11 +731,10 @@ PEAssembly::PEAssembly(
         m_pHostAssembly = pBindResultInfo;
     }
 
-#if _DEBUG
+#ifdef LOGGING
     GetPathOrCodeBase(m_debugName);
-    m_debugName.Normalize();
-    m_pDebugName = m_debugName;
-#endif
+    m_pDebugName = m_debugName.GetUTF8();
+#endif // LOGGING
 }
 #endif // !DACCESS_COMPILE
 
@@ -1023,10 +1022,10 @@ void PEAssembly::EnumMemoryRegions(CLRDataEnumMemoryFlags flags)
     DAC_ENUM_DTHIS();
     EMEM_OUT(("MEM: %p PEAssembly\n", dac_cast<TADDR>(this)));
 
-#ifdef _DEBUG
+#ifdef LOGGING
     // Not a big deal if it's NULL or fails.
     m_debugName.EnumMemoryRegions(flags);
-#endif
+#endif // LOGGING
 
     if (m_PEImage.IsValid())
     {
index 7034ceb..5df296c 100644 (file)
@@ -136,8 +136,8 @@ public:
 
 #ifdef LOGGING
     // This is useful for log messages
-    LPCWSTR GetDebugName();
-#endif
+    LPCUTF8 GetDebugName();
+#endif // LOGGING
 
     // ------------------------------------------------------------
     // Checks
@@ -391,10 +391,10 @@ private:
  // Instance fields
  // ------------------------------------------------------------
 
-#ifdef _DEBUG
-    LPCWSTR                 m_pDebugName;
+#ifdef LOGGING
+    LPCUTF8                 m_pDebugName;
     SString                 m_debugName;
-#endif
+#endif // LOGGING
 
     // IL image, NULL if dynamic
     PTR_PEImage              m_PEImage;
index 1dcc64e..73d0a16 100644 (file)
@@ -221,7 +221,7 @@ inline const SString &PEAssembly::GetModuleFileNameHint()
 #endif // DACCESS_COMPILE
 
 #ifdef LOGGING
-inline LPCWSTR PEAssembly::GetDebugName()
+inline LPCUTF8 PEAssembly::GetDebugName()
 {
     CONTRACTL
     {
@@ -232,14 +232,9 @@ inline LPCWSTR PEAssembly::GetDebugName()
         CANNOT_TAKE_LOCK;
     }
     CONTRACTL_END;
-
-#ifdef _DEBUG
     return m_pDebugName;
-#else
-    return GetPath();
-#endif
 }
-#endif
+#endif // LOGGING
 
 // ------------------------------------------------------------
 // Classification
index 2094d76..c9619c0 100644 (file)
@@ -44,7 +44,7 @@ public:
         {
             SString name;
             TypeString::AppendTypeKeyDebug(name, &m_typeKey);
-            LOG((LF_CLASSLOADER, LL_INFO10000, "PHASEDLOAD: Creating loading entry for type %S\n", name.GetUnicode()));
+            LOG((LF_CLASSLOADER, LL_INFO10000, "PHASEDLOAD: Creating loading entry for type %s\n", name.GetUTF8()));
         }
 #endif
 
index b68cffa..fd06824 100644 (file)
@@ -99,7 +99,8 @@ PerfMap::PerfMap(int pid)
     }
 
     SString path;
-    path.Printf("%Sperf-%d.map", &tempPath, pid);
+    path.Append(tempPath);
+    path.AppendPrintf("perf-%d.map", pid);
 
     // Open the map file for writing.
     OpenFile(path);
@@ -373,94 +374,4 @@ void PerfMap::GetNativeImageSignature(PEAssembly * pPEAssembly, CHAR * pszSig, u
         pszSig[0] = '\0';
     }
 }
-
-// Create a new native image perf map.
-NativeImagePerfMap::NativeImagePerfMap(Assembly * pAssembly, BSTR pDestPath)
-  : PerfMap()
-{
-    STANDARD_VM_CONTRACT;
-
-    // Generate perfmap path.
-
-    // Get the assembly simple name.
-    LPCUTF8 lpcSimpleName = pAssembly->GetSimpleName();
-
-    // Get the native image signature (GUID).
-    // Used to ensure that we match symbols to the correct NGEN image.
-    CHAR szSignature[GUID_STR_BUFFER_LEN];
-    GetNativeImageSignature(pAssembly->GetPEAssembly(), szSignature, ARRAY_SIZE(szSignature));
-
-    // Build the path to the perfmap file, which consists of <inputpath><imagesimplename>.ni.<signature>.map.
-    // Example: /tmp/System.Private.CoreLib.ni.{GUID}.map
-    SString sDestPerfMapPath;
-    sDestPerfMapPath.Printf("%S%s.ni.%s.map", pDestPath, lpcSimpleName, szSignature);
-
-    // Open the perf map file.
-    OpenFile(sDestPerfMapPath);
-
-    // Determine whether to emit RVAs or file offsets based on the specified configuration.
-    m_EmitRVAs = true;
-    CLRConfigStringHolder wszFormat(CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_NativeImagePerfMapFormat));
-    if(wszFormat != NULL && (wcsncmp(wszFormat, strOFFSET, wcslen(strOFFSET)) == 0))
-    {
-        m_EmitRVAs = false;
-    }
-}
-
-// Log data to the perfmap for the specified module.
-void NativeImagePerfMap::LogDataForModule(Module * pModule)
-{
-    STANDARD_VM_CONTRACT;
-
-    PEImageLayout * pLoadedLayout = pModule->GetPEAssembly()->GetLoadedLayout();
-    _ASSERTE(pLoadedLayout != nullptr);
-
-    ReadyToRunInfo::MethodIterator mi(pModule->GetReadyToRunInfo());
-    while (mi.Next())
-    {
-        MethodDesc* hotDesc = mi.GetMethodDesc();
-
-        LogPreCompiledMethod(hotDesc, mi.GetMethodStartAddress(), pLoadedLayout, "ReadyToRun");
-    }
-}
-
-// Log a pre-compiled method to the perfmap.
-void NativeImagePerfMap::LogPreCompiledMethod(MethodDesc * pMethod, PCODE pCode, PEImageLayout *pLoadedLayout, const char *optimizationTier)
-{
-    STANDARD_VM_CONTRACT;
-
-    _ASSERTE(pLoadedLayout != nullptr);
-    SIZE_T baseAddr = (SIZE_T)pLoadedLayout->GetBase();
-
-    // Get information about the NGEN'd method code.
-    EECodeInfo codeInfo(pCode);
-    _ASSERTE(codeInfo.IsValid());
-
-    IJitManager::MethodRegionInfo methodRegionInfo;
-    codeInfo.GetMethodRegionInfo(&methodRegionInfo);
-
-    // NGEN can split code between hot and cold sections which are separate in memory.
-    // Emit an entry for each section if it is used.
-    PCODE addr;
-    if (methodRegionInfo.hotSize > 0)
-    {
-        addr = (PCODE)methodRegionInfo.hotStartAddress - baseAddr;
-        if (!m_EmitRVAs)
-        {
-            addr = pLoadedLayout->RvaToOffset(addr);
-        }
-        LogMethod(pMethod, addr, methodRegionInfo.hotSize, optimizationTier);
-    }
-
-    if (methodRegionInfo.coldSize > 0)
-    {
-        addr = (PCODE)methodRegionInfo.coldStartAddress - baseAddr;
-        if (!m_EmitRVAs)
-        {
-            addr = pLoadedLayout->RvaToOffset(addr);
-        }
-        LogMethod(pMethod, addr, methodRegionInfo.coldSize, optimizationTier);
-    }
-}
-
 #endif // FEATURE_PERFMAP && !DACCESS_COMPILE
index b045683..c8556b7 100644 (file)
@@ -81,25 +81,4 @@ public:
     // Close the map and flush any remaining data.
     static void Destroy();
 };
-
-// Generates a perfmap file for a native image by running crossgen.
-class NativeImagePerfMap : PerfMap
-{
-private:
-    const WCHAR *strOFFSET = W("OFFSET");
-
-    // Specify the address format since it's now possible for 'perf script' to output file offsets or RVAs.
-    bool m_EmitRVAs;
-
-    // Log a pre-compiled method to the map.
-    void LogPreCompiledMethod(MethodDesc * pMethod, PCODE pCode, PEImageLayout *pLoadedLayout, const char *optimizationTier);
-
-public:
-    // Construct a new map for a native image.
-    NativeImagePerfMap(Assembly * pAssembly, BSTR pDestPath);
-
-    // Log method information for each module.
-    void LogDataForModule(Module * pModule);
-};
-
 #endif // PERFPID_H
index 6425c14..29d4572 100644 (file)
@@ -441,12 +441,18 @@ static void LogStringLiteral(_In_z_ const char* action, EEStringData *pStringDat
     STATIC_CONTRACT_GC_NOTRIGGER;
     STATIC_CONTRACT_FORBID_FAULT;
 
-    int length = pStringData->GetCharCount();
-    length = min(length, 100);
+    ULONG length = pStringData->GetCharCount();
+    length = min(length, 128);
     WCHAR *szString = (WCHAR *)_alloca((length + 1) * sizeof(WCHAR));
     memcpyNoGCRefs((void*)szString, (void*)pStringData->GetStringBuffer(), length * sizeof(WCHAR));
     szString[length] = '\0';
-    LOG((LF_APPDOMAIN, LL_INFO10000, "String literal \"%S\" %s to Global map, size %d bytes\n", szString, action, pStringData->GetCharCount()));
+
+    LPCUTF8 strUtf8 = "<Failed to convert to UTF8>";
+    MAKE_UTF8PTR_FROMWIDE_NOTHROW(cvtStr, szString);
+    if (cvtStr != NULL)
+        strUtf8 = cvtStr;
+
+    LOG((LF_APPDOMAIN, LL_INFO10000, "String literal \"%s\" %s to Global map, %u characters\n", strUtf8, action, length));
 }
 #endif
 
index 1048f51..46765ba 100644 (file)
@@ -1449,7 +1449,7 @@ void DumpSyncBlockCache()
 
     SyncBlockCache *pCache = SyncBlockCache::GetSyncBlockCache();
 
-    LogSpewAlways("Dumping SyncBlockCache size %d\n", pCache->m_FreeSyncTableIndex);
+    LogSpewAlways("Dumping SyncBlockCache size %u\n", pCache->m_FreeSyncTableIndex);
 
     static int dumpSBStyle = -1;
     if (dumpSBStyle == -1)
@@ -1457,14 +1457,12 @@ void DumpSyncBlockCache()
     if (dumpSBStyle == 0)
         return;
 
-    BOOL isString = FALSE;
     DWORD objectCount = 0;
     DWORD slotCount = 0;
 
     for (DWORD nb = 1; nb < pCache->m_FreeSyncTableIndex; nb++)
     {
-        isString = FALSE;
-        char buffer[1024], buffer2[1024];
+        char buffer[1024];
         LPCUTF8 descrip = "null";
         SyncTableEntry *pEntry = &SyncTableEntry::GetSyncTableEntry()[nb];
         Object *oref = (Object *) pEntry->m_Object;
@@ -1484,27 +1482,15 @@ void DumpSyncBlockCache()
                 {
                     LPCUTF8 descrip;
                     Object *oref;
-                    char *buffer2;
-                    UINT cch2;
-                    BOOL isString;
                 } param;
                 param.descrip = descrip;
                 param.oref = oref;
-                param.buffer2 = buffer2;
-                param.cch2 = ARRAY_SIZE(buffer2);
-                param.isString = isString;
 
                 PAL_TRY(Param *, pParam, &param)
                 {
                     pParam->descrip = pParam->oref->GetMethodTable()->GetDebugClassName();
                     if (strlen(pParam->descrip) == 0)
                         pParam->descrip = "<INVALID>";
-                    else if (pParam->oref->GetMethodTable() == g_pStringClass)
-                    {
-                        sprintf_s(pParam->buffer2, pParam->cch2, "%s (%S)", pParam->descrip, ObjectToSTRINGREF((StringObject*)pParam->oref)->GetBuffer());
-                        pParam->descrip = pParam->buffer2;
-                        pParam->isString = TRUE;
-                    }
                 }
                 PAL_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
                     param.descrip = "<INVALID>";
@@ -1512,14 +1498,13 @@ void DumpSyncBlockCache()
                 PAL_ENDTRY
 
                 descrip = param.descrip;
-                isString = param.isString;
             }
             sprintf_s(buffer, ARRAY_SIZE(buffer), "%s", descrip);
             descrip = buffer;
         }
         if (dumpSBStyle < 2)
-            LogSpewAlways("[%4.4d]: %8.8x %s\n", nb, oref, descrip);
-        else if (dumpSBStyle == 2 && ! isString)
+            LogSpewAlways("[%4.4d]: %zx %s\n", nb, oref, descrip);
+        else if (dumpSBStyle == 2)
             LogSpewAlways("[%4.4d]: %s\n", nb, descrip);
     }
     LogSpewAlways("Done dumping SyncBlockCache used slots: %d, objects: %d\n", slotCount, objectCount);