From 931b38ecf13970bc99c1ba4fa02892f820df690f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 23 Jun 2026 20:46:57 +0000 Subject: [PATCH] Remove dead fIs80Plus param from IMDInternalImport::GetUserString Co-authored-by: AaronRobinsonMSFT <30635565+AaronRobinsonMSFT@users.noreply.github.com> --- src/coreclr/ildasm/dis.cpp | 2 +- src/coreclr/inc/metadata.h | 1 - src/coreclr/md/enc/mdinternalrw.cpp | 15 --------------- src/coreclr/md/inc/mdinternalrw.h | 1 - src/coreclr/md/runtime/mdinternalro.cpp | 15 --------------- src/coreclr/md/runtime/mdinternalro.h | 1 - src/coreclr/vm/ceeload.cpp | 3 +-- src/coreclr/vm/jitinterface.cpp | 2 +- src/coreclr/vm/managedmdimport.cpp | 3 +-- .../vm/readytorunstandalonemethodmetadata.cpp | 2 +- 10 files changed, 5 insertions(+), 40 deletions(-) diff --git a/src/coreclr/ildasm/dis.cpp b/src/coreclr/ildasm/dis.cpp index 8a70fc714433c2..2176d3f0154bba 100644 --- a/src/coreclr/ildasm/dis.cpp +++ b/src/coreclr/ildasm/dis.cpp @@ -2530,7 +2530,7 @@ void PrettyPrintToken(__inout __nullterminated char* szString, mdToken tk, IMDIn ULONG cbString = 0; if (pImport->IsValidToken(tk)) { - if (FAILED(pImport->GetUserString(tk, &cbString, NULL, &pszString))) + if (FAILED(pImport->GetUserString(tk, &cbString, &pszString))) { pszString = NULL; } diff --git a/src/coreclr/inc/metadata.h b/src/coreclr/inc/metadata.h index 4fe9f5dd231c67..28703d99f0d292 100644 --- a/src/coreclr/inc/metadata.h +++ b/src/coreclr/inc/metadata.h @@ -818,7 +818,6 @@ DECLARE_INTERFACE_(IMDInternalImport, IUnknown) STDMETHOD(GetUserString)( mdString stk, // [IN] the string token. ULONG *pchString, // [OUT] count of characters in the string. - BOOL *pbIs80Plus, // [OUT] specifies where there are extended characters >= 0x80. LPCWSTR *pwszUserString) PURE; //***************************************************************************** diff --git a/src/coreclr/md/enc/mdinternalrw.cpp b/src/coreclr/md/enc/mdinternalrw.cpp index 5b0b01aab0c525..00ff80614892fa 100644 --- a/src/coreclr/md/enc/mdinternalrw.cpp +++ b/src/coreclr/md/enc/mdinternalrw.cpp @@ -3481,7 +3481,6 @@ HRESULT MDInternalRW::GetUserString( // Offset into the string blob heap. mdString stk, // [IN] the string token. ULONG *pcchStringSize, // [OUT] count of characters in the string. - BOOL *pfIs80Plus, // [OUT] specifies where there are extended characters >= 0x80. LPCWSTR *pwszUserString) { HRESULT hr; @@ -3489,10 +3488,6 @@ MDInternalRW::GetUserString( // Offset into the string blob heap. // no need to lock this function. - if (pfIs80Plus != NULL) - { - *pfIs80Plus = FALSE; - } *pwszUserString = NULL; *pcchStringSize = 0; @@ -3510,16 +3505,6 @@ MDInternalRW::GetUserString( // Offset into the string blob heap. return S_OK; } - if (pfIs80Plus != NULL) - { - if (userString.GetSize() % sizeof(WCHAR) == 0) - { - *pfIs80Plus = TRUE; // no indicator, presume the worst - } - // Return the user string terminator (contains value fIs80Plus) - *pfIs80Plus = *(reinterpret_cast(wszTmp + *pcchStringSize)); - } - *pwszUserString = wszTmp; return S_OK; } // MDInternalRW::GetUserString diff --git a/src/coreclr/md/inc/mdinternalrw.h b/src/coreclr/md/inc/mdinternalrw.h index dd55ac20abb48d..6385372d6da85a 100644 --- a/src/coreclr/md/inc/mdinternalrw.h +++ b/src/coreclr/md/inc/mdinternalrw.h @@ -585,7 +585,6 @@ class MDInternalRW : public IMDInternalImportENC, public IMDCommon STDMETHODIMP GetUserString( mdString stk, // [IN] the string token. ULONG *pchString, // [OUT] count of characters in the string. - BOOL *pbIs80Plus, // [OUT] specifies where there are extended characters >= 0x80. LPCWSTR *pwszUserString); //***************************************************************************** diff --git a/src/coreclr/md/runtime/mdinternalro.cpp b/src/coreclr/md/runtime/mdinternalro.cpp index b4ce60510cd715..3d9a388b321aa0 100644 --- a/src/coreclr/md/runtime/mdinternalro.cpp +++ b/src/coreclr/md/runtime/mdinternalro.cpp @@ -2656,16 +2656,11 @@ HRESULT MDInternalRO::GetUserString( // Offset into the string blob heap. mdString stk, // [IN] the string token. ULONG *pcchStringSize, // [OUT] count of characters in the string. - BOOL *pfIs80Plus, // [OUT] specifies where there are extended characters >= 0x80. LPCWSTR *pwszUserString) { HRESULT hr; LPWSTR wszTmp; - if (pfIs80Plus != NULL) - { - *pfIs80Plus = FALSE; - } *pwszUserString = NULL; *pcchStringSize = 0; @@ -2683,16 +2678,6 @@ MDInternalRO::GetUserString( // Offset into the string blob heap. return S_OK; } - if (pfIs80Plus != NULL) - { - if (userString.GetSize() % sizeof(WCHAR) == 0) - { - *pfIs80Plus = TRUE; // no indicator, presume the worst - } - // Return the user string terminator (contains value fIs80Plus) - *pfIs80Plus = *(reinterpret_cast(wszTmp + *pcchStringSize)); - } - *pwszUserString = wszTmp; return S_OK; } // MDInternalRO::GetUserString diff --git a/src/coreclr/md/runtime/mdinternalro.h b/src/coreclr/md/runtime/mdinternalro.h index 8ea00e1b908192..5f7f8e9e01a7d6 100644 --- a/src/coreclr/md/runtime/mdinternalro.h +++ b/src/coreclr/md/runtime/mdinternalro.h @@ -576,7 +576,6 @@ class MDInternalRO : public IMDInternalImport, IMDCommon STDMETHODIMP GetUserString( mdString stk, // [IN] the string token. ULONG *pchString, // [OUT] count of characters in the string. - BOOL *pbIs80Plus, // [OUT] specifies where there are extended characters >= 0x80. LPCWSTR *pwszUserString); //***************************************************************************** diff --git a/src/coreclr/vm/ceeload.cpp b/src/coreclr/vm/ceeload.cpp index c4d9ae09851f62..76655714601019 100644 --- a/src/coreclr/vm/ceeload.cpp +++ b/src/coreclr/vm/ceeload.cpp @@ -2222,10 +2222,9 @@ void ModuleBase::InitializeStringData(DWORD token, EEStringData *pstrData, CQuic } CONTRACTL_END; - BOOL fIs80Plus; DWORD dwCharCount; LPCWSTR pString; - if (FAILED(GetMDImport()->GetUserString(token, &dwCharCount, &fIs80Plus, &pString)) || + if (FAILED(GetMDImport()->GetUserString(token, &dwCharCount, &pString)) || (pString == NULL)) { THROW_BAD_FORMAT(BFA_BAD_STRING_TOKEN_RANGE, this); diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp index 485a0c336156d8..1cb80773f3148a 100644 --- a/src/coreclr/vm/jitinterface.cpp +++ b/src/coreclr/vm/jitinterface.cpp @@ -629,7 +629,7 @@ int CEEInfo::getStringLiteral ( { ULONG dwCharCount; LPCWSTR pString; - if (!FAILED((module)->GetMDImport()->GetUserString(metaTOK, &dwCharCount, NULL, &pString))) + if (!FAILED((module)->GetMDImport()->GetUserString(metaTOK, &dwCharCount, &pString))) { _ASSERTE(dwCharCount >= 0 && dwCharCount <= INT_MAX); int length = (int)dwCharCount; diff --git a/src/coreclr/vm/managedmdimport.cpp b/src/coreclr/vm/managedmdimport.cpp index f94949201c4e18..e5cc552f27997f 100644 --- a/src/coreclr/vm/managedmdimport.cpp +++ b/src/coreclr/vm/managedmdimport.cpp @@ -208,8 +208,7 @@ FCIMPL4(HRESULT, MetaDataImport::GetUserString, IMDInternalImport* pScope, mdTok { FCALL_CONTRACT; - BOOL bHasExtendedChars; - return pScope->GetUserString(tk, pCount, &bHasExtendedChars, pszName); + return pScope->GetUserString(tk, pCount, pszName); } FCIMPLEND diff --git a/src/coreclr/vm/readytorunstandalonemethodmetadata.cpp b/src/coreclr/vm/readytorunstandalonemethodmetadata.cpp index 30802a7076915a..7daef864c1ea83 100644 --- a/src/coreclr/vm/readytorunstandalonemethodmetadata.cpp +++ b/src/coreclr/vm/readytorunstandalonemethodmetadata.cpp @@ -259,7 +259,7 @@ class ReadyToRunStandaloneMethodMetadataHelper newTokenType = mdtString; LPCWSTR wszUserString; DWORD cchString; - IfFailThrow(pMDImport->GetUserString(inputToken, &cchString, NULL, &wszUserString)); + IfFailThrow(pMDImport->GetUserString(inputToken, &cchString, &wszUserString)); blob.AppendData(cchString); blob.AppendBlob((void * const)wszUserString, sizeof(WCHAR) * cchString); // TODO: consider encoding via wtf-8, or possibly utf-8