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/debug/di/hash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ void CordbHashTableEnum::BuildOrThrow(
CordbBase * pOwnerObj,
NeuterList * pOwnerList,
CordbHashTable *pTable,
const _GUID &id,
const GUID &id,
RSInitHolder<CordbHashTableEnum> * pHolder)
{
CordbHashTableEnum * pEnum = new CordbHashTableEnum(pOwnerObj, pOwnerList, pTable, id);
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/debug/di/rspriv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1837,14 +1837,14 @@ public ICorDebugAssemblyEnum
CordbBase * pOwnerObj,
NeuterList * pOwnerList,
CordbHashTable *table,
const _GUID &id);
const GUID &id);

public:
static void BuildOrThrow(
CordbBase * pOwnerObj,
NeuterList * pOwnerList,
CordbHashTable *table,
const _GUID &id,
const GUID &id,
RSInitHolder<CordbHashTableEnum> * pHolder);

CordbHashTableEnum(CordbHashTableEnum *cloneSrc);
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/debug/inc/dbgtransportsession.h
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ class DbgTransportSession
// Struct defining the format of the data block sent with a SessionRequest.
struct SessionRequestData
{
minipal_guid_t m_sSessionID; // Unique session ID. Treated as byte blob so no endian-ness
GUID m_sSessionID; // Unique session ID. Treated as byte blob so no endian-ness
};

// Struct used to track a message that is being (or will soon be) sent but has not yet been acknowledged.
Expand Down Expand Up @@ -676,7 +676,7 @@ class DbgTransportSession
// Session ID randomly allocated by the right side and sent over in the SessionRequest message. This
// serves to disambiguate a re-send of the SessionRequest due to a network error versus a SessionRequest
// from a different debugger.
minipal_guid_t m_sSessionID;
GUID m_sSessionID;

// Lock used to synchronize sending messages and updating the session state. This ensures message bytes
// don't become interleaved on the transport connection, the send queue is updated consistently across
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/ilasm/portable_pdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ HRESULT PortablePdbWriter::Init(IMetaDataDispenserEx2* mdDispenser)
time_t now;
time(&now);
m_pdbStream.id.pdbTimeStamp = (ULONG)now;
if (!minipal_guid_v4_create(reinterpret_cast<minipal_guid_t*>(&m_pdbStream.id.pdbGuid)))
if (!minipal_guid_v4_create(&m_pdbStream.id.pdbGuid))
{
hr = E_FAIL;
goto exit;
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/ildasm/dasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5157,10 +5157,10 @@ void DumpCodeManager(IMAGE_COR20_HEADER *CORHeader, void* GUICookie)
ULONG iCount = VAL32(CORHeader->CodeManagerTable.Size) / sizeof(GUID);
for (ULONG i=0; i<iCount; i++)
{
CHAR rcguid[GUID_STR_BUFFER_LEN];
CHAR rcguid[MINIPAL_GUID_BUFFER_LEN];
GUID Guid = *pcm;
SwapGuid(&Guid);
GuidToLPSTR(Guid, rcguid);
minipal_guid_as_string(Guid, rcguid, MINIPAL_GUID_BUFFER_LEN);
sprintf_s(szString,SZSTRING_SIZE,"// [0x%08x] %s", i, rcguid);
printLine(GUICookie,szStr);
pcm++;
Expand Down
8 changes: 4 additions & 4 deletions src/coreclr/ildasm/dis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ BOOL SourceLinesHelper(void *GUICookie, LineCodeDescr* pLCD, _Out_writes_(nSize)

PAL_TRY(Param *, pParam, &param) {
GUID guidLang={0},guidLangVendor={0},guidDoc={0};
CHAR zLang[GUID_STR_BUFFER_LEN],zVendor[GUID_STR_BUFFER_LEN],zDoc[GUID_STR_BUFFER_LEN];
CHAR zLang[MINIPAL_GUID_BUFFER_LEN],zVendor[MINIPAL_GUID_BUFFER_LEN],zDoc[MINIPAL_GUID_BUFFER_LEN];
ULONG32 k;
if(pParam->pLCD->FileToken != ulWasFileToken)
{
Expand All @@ -830,9 +830,9 @@ BOOL SourceLinesHelper(void *GUICookie, LineCodeDescr* pLCD, _Out_writes_(nSize)
||memcmp(&guidLangVendor,&guidWasLangVendor,sizeof(GUID))
||memcmp(&guidDoc,&guidWasDoc,sizeof(GUID)))
{
GuidToLPSTR(guidLang,zLang);
GuidToLPSTR(guidLangVendor,zVendor);
GuidToLPSTR(guidDoc,zDoc);
minipal_guid_as_string(guidLang, zLang, MINIPAL_GUID_BUFFER_LEN);
minipal_guid_as_string(guidLangVendor, zVendor, MINIPAL_GUID_BUFFER_LEN);
minipal_guid_as_string(guidDoc, zDoc, MINIPAL_GUID_BUFFER_LEN);
sprintf_s(szString,SZSTRING_SIZE,"%s%s '%s', '%s', '%s'", g_szAsmCodeIndent,KEYWORD(".language"),
zLang,zVendor,zDoc);
printLine(pParam->GUICookie,szString);
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/ildasm/dman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void DumpScope(void* GUICookie)
mdModule mdm;
GUID mvid;
WCHAR scopeName[1024];
CHAR guidString[GUID_STR_BUFFER_LEN];
CHAR guidString[MINIPAL_GUID_BUFFER_LEN];
memset(scopeName,0,1024*sizeof(WCHAR));
if(SUCCEEDED(g_pPubImport->GetScopeProps( scopeName, 1024, NULL, &mvid))&& scopeName[0])
{
Expand All @@ -133,7 +133,7 @@ void DumpScope(void* GUICookie)
VDELETE(sz);
}
printLine(GUICookie,szString);
GuidToLPSTR(mvid, guidString);
minipal_guid_as_string(mvid, guidString, MINIPAL_GUID_BUFFER_LEN);
sprintf_s(szString,SZSTRING_SIZE,COMMENT("%s// MVID: %s"),g_szAsmCodeIndent,guidString);

printLine(GUICookie,szString);
Expand Down
20 changes: 5 additions & 15 deletions src/coreclr/inc/jiteeversionguid.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,10 @@
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//

#ifndef GUID_DEFINED
typedef struct _GUID {
uint32_t Data1; // NOTE: diff from Win32, for LP64
uint16_t Data2;
uint16_t Data3;
uint8_t Data4[ 8 ];
} GUID;
typedef const GUID *LPCGUID;
#define GUID_DEFINED
#endif // !GUID_DEFINED
#ifndef JIT_EE_VERSIONING_GUID_H
#define JIT_EE_VERSIONING_GUID_H

#include <minipal/guid.h>

constexpr GUID JITEEVersionIdentifier = { /* 4463d6ac-dfcb-4ab0-a941-c53b56089b7c */
0x4463d6ac,
Expand All @@ -50,8 +44,4 @@ constexpr GUID JITEEVersionIdentifier = { /* 4463d6ac-dfcb-4ab0-a941-c53b56089b7
{0xa9, 0x41, 0xc5, 0x3b, 0x56, 0x08, 0x9b, 0x7c}
};

//////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// END JITEEVersionIdentifier
//
//////////////////////////////////////////////////////////////////////////////////////////////////////////
#endif // JIT_EE_VERSIONING_GUID_H
24 changes: 2 additions & 22 deletions src/coreclr/inc/utilcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ using std::nothrow;

#include "contract.h"

#include <minipal/utils.h>
#include <stddef.h>
#include <minipal/guid.h>
#include <dn-u16.h>

#include "clrnt.h"
Expand Down Expand Up @@ -149,14 +150,10 @@ typedef LPSTR LPUTF8;
#endif
#endif

#include <stddef.h> // for offsetof
#include <minipal/utils.h>

#define IS_DIGIT(ch) (((ch) >= W('0')) && ((ch) <= W('9')))
#define DIGIT_TO_INT(ch) ((ch) - W('0'))
#define INT_TO_DIGIT(i) ((WCHAR)(W('0') + (i)))


// Helper will 4 byte align a value, rounding up.
#define ALIGN4BYTE(val) (((val) + 3) & ~0x3)

Expand Down Expand Up @@ -3031,23 +3028,6 @@ class ConfigMethodSet
BYTE m_inited;
};

// 38 characters + 1 null terminating.
#define GUID_STR_BUFFER_LEN (ARRAY_SIZE("{12345678-1234-1234-1234-123456789abc}"))

//*****************************************************************************
// Convert a GUID into a pointer to a string
//*****************************************************************************
int GuidToLPSTR(
REFGUID guid, // [IN] The GUID to convert.
LPSTR szGuid, // [OUT] String into which the GUID is stored
DWORD cchGuid); // [IN] Size in chars of szGuid

template<DWORD N>
int GuidToLPSTR(REFGUID guid, CHAR (&s)[N])
{
return GuidToLPSTR(guid, s, N);
}

//*****************************************************************************
// Convert a pointer to a string into a GUID.
//*****************************************************************************
Expand Down
6 changes: 0 additions & 6 deletions src/coreclr/nativeaot/Runtime/inc/CommonTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ typedef uint32_t ULONG;
typedef int64_t LONGLONG;
typedef uint8_t BYTE;
typedef uint16_t UINT16;
typedef struct _GUID {
uint32_t Data1;
uint16_t Data2;
uint16_t Data3;
uint8_t Data4[8];
} GUID;
#endif // FEATURE_EVENT_TRACE && !_INC_WINDOWS

// Hijack funcs are not called, they are "returned to". And when done, they return to the actual caller.
Expand Down
12 changes: 1 addition & 11 deletions src/coreclr/pal/inc/pal_mstypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#define __PAL_MSTYPES_H__

#include <stdint.h>
#include <minipal/guid.h>

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -316,17 +317,6 @@ typedef union _LARGE_INTEGER {
LONGLONG QuadPart;
} LARGE_INTEGER, *PLARGE_INTEGER;

#ifndef GUID_DEFINED
typedef struct _GUID {
ULONG Data1; // NOTE: diff from Win32, for LP64
USHORT Data2;
USHORT Data3;
UCHAR Data4[ 8 ];
} GUID;
typedef const GUID *LPCGUID;
#define GUID_DEFINED
#endif // !GUID_DEFINED

typedef struct _FILETIME {
DWORD dwLowDateTime;
DWORD dwHighDateTime;
Expand Down
29 changes: 1 addition & 28 deletions src/coreclr/pal/inc/rt/palrt.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,12 @@
// The .NET Foundation licenses this file to you under the MIT license.
//

//
// ===========================================================================
// File: palrt.h
//
// ===========================================================================

/*++


Abstract:

PAL runtime functions. These are functions which are ordinarily
implemented as part of the Win32 API set, but when compiling CoreCLR for
Unix-like systems, are implemented as a runtime library on top of the PAL.

Author:



Revision History:

--*/

#ifndef __PALRT_H__
Expand Down Expand Up @@ -213,19 +198,7 @@ EXTERN_C const GUID GUID_NULL;
typedef GUID *LPGUID;
typedef const GUID FAR *LPCGUID;

#ifdef __cplusplus
extern "C++" {
#if !defined _SYS_GUID_OPERATOR_EQ_ && !defined _NO_SYS_GUID_OPERATOR_EQ_
#define _SYS_GUID_OPERATOR_EQ_
inline int IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
{ return !memcmp(&rguid1, &rguid2, sizeof(GUID)); }
inline int operator==(REFGUID guidOne, REFGUID guidOther)
{ return IsEqualGUID(guidOne,guidOther); }
inline int operator!=(REFGUID guidOne, REFGUID guidOther)
{ return !IsEqualGUID(guidOne,guidOther); }
#endif
};
#endif // __cplusplus
#define IsEqualGUID(guid1, guid2) guid1 == guid2

#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
EXTERN_C const GUID FAR name
Expand Down
3 changes: 2 additions & 1 deletion src/coreclr/scripts/genEventing.py
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,7 @@ def getKeywordsMaskCombined(keywords, keywordsToMask):
def updateclreventsfile(write_xplatheader, target_cpp, runtimeFlavor, is_host_windows, eventpipe_trace_context_typedef, dotnet_trace_context_typedef_windows, user_events_trace_context_typedef, tree, clrallevents, inclusion_list, generatedFileType, user_events):
with open_for_update(clrallevents) as Clrallevents:
Clrallevents.write(stdprolog)
Clrallevents.write('#include <minipal/guid.h>\n\n')
if generatedFileType=="header-impl":
if runtimeFlavor.mono:
Clrallevents.write(getCoreCLRMonoNativeAotTypeAdaptionDefines() + "\n")
Expand Down Expand Up @@ -912,7 +913,7 @@ def updateclreventsfile(write_xplatheader, target_cpp, runtimeFlavor, is_host_wi
Clrallevents.write(dotnet_trace_context_typedef_windows + "\n")
else:
Clrallevents.write("\n")

if not is_host_windows and runtimeFlavor.coreclr:
Clrallevents.write(user_events_trace_context_typedef)

Expand Down
14 changes: 4 additions & 10 deletions src/coreclr/tools/metainfo/mdinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,10 @@ void MDInfo::DisplayScopeInfo()
VWriteLine("ScopeName : %s",ConvertToUtf8(scopeName, scopeNameUtf8, ARRAY_SIZE(scopeNameUtf8)));

if (!(m_DumpFilter & MDInfo::dumpNoLogo))
VWriteLine("MVID : %s",GUIDAsString(mvid, guidString, STRING_BUFFER_LEN));
{
minipal_guid_as_string(mvid, guidString, STRING_BUFFER_LEN);
VWriteLine("MVID : %s", guidString);
}

hr = m_pImport->GetModuleFromScope(&mdm);
if (FAILED(hr)) Error("GetModuleFromScope failed.", hr);
Expand Down Expand Up @@ -2189,15 +2192,6 @@ void MDInfo::DisplayPermissionInfo(mdPermission inPermission, const char *preFix
DisplayCustomAttributes(inPermission, newPreFix);
} // void MDInfo::DisplayPermissionInfo()


// simply prints out the given GUID in standard form

LPCSTR MDInfo::GUIDAsString(GUID inGuid, _Out_writes_(bufLen) LPSTR guidString, ULONG bufLen)
{
GuidToLPSTR(inGuid, guidString, bufLen);
return guidString;
} // LPCSTR MDInfo::GUIDAsString()

#ifdef FEATURE_COMINTEROP
LPCSTR MDInfo::VariantAsString(VARIANT *pVariant, _Out_writes_(bufLen) LPSTR buffer, ULONG bufLen)
{
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/tools/superpmi/superpmi/jitinstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,13 @@ HRESULT JitInstance::StartUp(char* PathToJit, bool copyJit, bool breakOnDebugBre
GUID expected = JITEEVersionIdentifier;
GUID actual = versionId;
LogError("Jit Compiler has wrong version identifier. Expected: %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x. Actual: %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x.",
expected.Data1, expected.Data2, expected.Data3,
expected.Data1, expected.Data2, expected.Data3,
expected.Data4[0], expected.Data4[1], expected.Data4[2], expected.Data4[3],
expected.Data4[4], expected.Data4[5], expected.Data4[6], expected.Data4[7],
actual.Data1, actual.Data2, actual.Data3,
actual.Data1, actual.Data2, actual.Data3,
actual.Data4[0], actual.Data4[1], actual.Data4[2], actual.Data4[3],
actual.Data4[4], actual.Data4[5], actual.Data4[6], actual.Data4[7]);

return -1;
}

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/utilcode/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2649,7 +2649,7 @@ namespace Com
{
STANDARD_VM_CONTRACT;

WCHAR wszClsid[GUID_STR_BUFFER_LEN];
WCHAR wszClsid[MINIPAL_GUID_BUFFER_LEN];
if (GuidToLPWSTR(rclsid, wszClsid) == 0)
return E_UNEXPECTED;

Expand Down
23 changes: 1 addition & 22 deletions src/coreclr/utilcode/util_nodependencies.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,27 +434,6 @@ HRESULT GetDebuggerSettingInfoWorker(_Out_writes_to_opt_(*pcchDebuggerString, *p

#endif //!defined(FEATURE_UTILCODE_NO_DEPENDENCIES) || defined(_DEBUG)


//*****************************************************************************
// Convert a GUID into a pointer to a string
//*****************************************************************************
int
GuidToLPSTR(
REFGUID guid, // The GUID to convert.
_Out_writes_(cchGuid) LPSTR szGuid, // String into which the GUID is stored
DWORD cchGuid) // Count in chars
{
if (cchGuid < GUID_STR_BUFFER_LEN)
return 0;

return sprintf_s(szGuid, cchGuid, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
guid.Data1, guid.Data2, guid.Data3,
guid.Data4[0], guid.Data4[1],
guid.Data4[2], guid.Data4[3],
guid.Data4[4], guid.Data4[5],
guid.Data4[6], guid.Data4[7]) + 1;
}

//*****************************************************************************
// Convert hex value into a wide string of hex digits
//*****************************************************************************
Expand Down Expand Up @@ -508,7 +487,7 @@ GuidToLPWSTR(
// successive fields break the GUID into the form DWORD-WORD-WORD-WORD-WORD.DWORD
// covering the 128-bit GUID. The string includes enclosing braces, which are an OLE convention.

if (cchGuid < GUID_STR_BUFFER_LEN)
if (cchGuid < MINIPAL_GUID_BUFFER_LEN)
return 0;

// {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
Expand Down
8 changes: 4 additions & 4 deletions src/coreclr/vm/assemblybinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ NativeImage* AssemblyBinder::LoadNativeImage(Module* componentModule, LPCUTF8 na
#ifdef FEATURE_READYTORUN
static void MvidMismatchFatalError(GUID mvidActual, GUID mvidExpected, LPCUTF8 simpleName, bool compositeComponent, LPCUTF8 assemblyRequirementName)
{
CHAR assemblyMvidText[GUID_STR_BUFFER_LEN];
GuidToLPSTR(mvidActual, assemblyMvidText);
CHAR assemblyMvidText[MINIPAL_GUID_BUFFER_LEN];
minipal_guid_as_string(mvidActual, assemblyMvidText, MINIPAL_GUID_BUFFER_LEN);

CHAR componentMvidText[GUID_STR_BUFFER_LEN];
GuidToLPSTR(mvidExpected, componentMvidText);
CHAR componentMvidText[MINIPAL_GUID_BUFFER_LEN];
minipal_guid_as_string(mvidExpected, componentMvidText, MINIPAL_GUID_BUFFER_LEN);

SString message;
if (compositeComponent)
Expand Down
Loading
Loading