Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/coreclr/ildasm/dis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/inc/metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

//*****************************************************************************
Expand Down
15 changes: 0 additions & 15 deletions src/coreclr/md/enc/mdinternalrw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3481,18 +3481,13 @@ 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;
LPWSTR wszTmp;

// no need to lock this function.

if (pfIs80Plus != NULL)
{
*pfIs80Plus = FALSE;
}
*pwszUserString = NULL;
*pcchStringSize = 0;

Expand All @@ -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<PBYTE>(wszTmp + *pcchStringSize));
}

*pwszUserString = wszTmp;
return S_OK;
} // MDInternalRW::GetUserString
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/md/inc/mdinternalrw.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

//*****************************************************************************
Expand Down
15 changes: 0 additions & 15 deletions src/coreclr/md/runtime/mdinternalro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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<PBYTE>(wszTmp + *pcchStringSize));
}

*pwszUserString = wszTmp;
return S_OK;
} // MDInternalRO::GetUserString
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/md/runtime/mdinternalro.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

//*****************************************************************************
Expand Down
3 changes: 1 addition & 2 deletions src/coreclr/vm/ceeload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/jitinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions src/coreclr/vm/managedmdimport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/readytorunstandalonemethodmetadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading