You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consider renaming COM* types in clr native code to CLR* #86145
Most of these COM* types are holding types for FCalls. The newer naming convention is to use Native suffix. For example, AssemblyNative, MarshalNative, ObjectNative, StreamNative, ... .
Also, we may want to change FCalls to be extern "C" methods, similar to what we have done with QCalls a while back in #60992. It would set us up for convergence with native AOT. FCalls in native AOT have to be extern "C" methods to enable linking managed code with unmanaged runtime using platform linker.
A list of symbols that can be renamed at my site of view:
From that list, the FCall related changes have a mix of real COM interop and just legacy naming. The COM interop related will need some more scrutiny. The exception macros can be changed for sure.
The COMVariant, COMOAVariant, ComAwareWeakReferenceNative and COMDateTime are a bit tricky for now and a mix of real COM types/specifications and just general .NET code. They should be left alone in this initial effort.
Here is what I understand from the code to resolve this issue:
For COM interop related:
ComPlusCall -> CallNative
ComPlusCallInfo -> CallInfoNative
ComPlusCallMethodDesc -> CallMethodDescNative
GenericCLRToCOMCallStub -> GenericCallNativeStub
Should I also rename class like ComPlusMethodFrame to MethodFrameNative ?
For FCallsRelated :
COMDelegate -> DelegateNative
COMModule -> ModuleNative
along with calls like COMDelegate::GetMethodDesc -> ModuleNative_GetMethodDesc as noticed in the PR #60992
I saw inside the solution types already named CRLToCOMWorker, I think it's a good idea to keep it for those usecases:
ComPlusCall -> CRLToCOMCall
ComPlusCallInfo -> CRLToCOMCallInfo
ComPlusCallMethodDesc -> CRLToCOMCallMethodDesc
GenericCLRToCOMCallStub -> GenericCRLToCOMCallStub
Perfect, I'll start to rename all on this and create a PR related
I'd like to contribute to this issue and work on renaming the types as suggested. Is there any specific guidance or parts of the list I should start with?
I noticed some previous discussions regarding the complexity of certain types (like COMPlusThrow), so I can begin with the simpler cases to avoid conflicts. Any advice or confirmation on how to proceed would be greatly appreciated.
I'm afraid this isn't suitable for beginners. Although completing the renaming isn't complex, it's better to have more knowledge of the internal mechanisms of the coreclr code base to understand the naming conventions, and find all references that can be missed by IDE.
I understand that this issue might require deeper knowledge of the CoreCLR codebase. Given that, I’ll take a look at other issues where I can contribute while learning more about the internals.
If you have any suggestions for issues that might be more suitable for someone at my current level, I’d be happy to work on those as well.
Activity
AaronRobinsonMSFT commentedon Jun 1, 2023
There is no reason these can't be changed. Good suggestion.
AaronRobinsonMSFT commentedon Jun 1, 2023
If someone wants to take this up, it would be most appropriate to provide a list of the types and APIs that will be updated.
jkotas commentedon Jun 1, 2023
Most of these
COM*types are holding types for FCalls. The newer naming convention is to useNativesuffix. For example,AssemblyNative,MarshalNative,ObjectNative,StreamNative, ... .Also, we may want to change FCalls to be extern "C" methods, similar to what we have done with QCalls a while back in #60992. It would set us up for convergence with native AOT. FCalls in native AOT have to be extern "C" methods to enable linking managed code with unmanaged runtime using platform linker.
huoyaoyuan commentedon Jun 1, 2023
A list of symbols that can be renamed at my site of view:
COM interop related:
ComPlusCall -> ClrToComCall (the file has been renamed)
ComPlusCallInfo
ComPlusCallMethodDesc etc. Remove the "ComPlus" name.
FCall related:
COMDateTime
COMDelegate
comdependenthandle.h
comdynamic.h (QCall)
COMModule
COMSynchronizable.h
comthreadpool.h
comwaithandle.h
COMCustomAttribute
COMString
gCOM*Funcs in ecalllist.h
COMDouble
COMSingle
COMVariant
COMOAVariant
COMInterlocked
Macros:
COMPlusThrow seires
AaronRobinsonMSFT commentedon Jun 1, 2023
Thanks @huoyaoyuan
From that list, the FCall related changes have a mix of real COM interop and just legacy naming. The COM interop related will need some more scrutiny. The exception macros can be changed for sure.
The
COMVariant,COMOAVariant,ComAwareWeakReferenceNativeandCOMDateTimeare a bit tricky for now and a mix of real COM types/specifications and just general .NET code. They should be left alone in this initial effort.Giviruk commentedon Apr 23, 2024
can I try to do this issue? do I just need to rename the types from the list or something else?
AaronRobinsonMSFT commentedon Apr 23, 2024
@Giviruk Sure. Please note the guidance from #86145 (comment).
huoyaoyuan commentedon Apr 24, 2024
I'd suggest to go with less types at a time, and exclude ones when you feel it's too complex. You can start with searching the usages.
pierrebelin commentedon May 28, 2024
I'd like to work on this one, do you need any help ?
1 remaining item
pierrebelin commentedon May 31, 2024
Here is what I understand from the code to resolve this issue:
For COM interop related:
ComPlusCall -> CallNative
ComPlusCallInfo -> CallInfoNative
ComPlusCallMethodDesc -> CallMethodDescNative
GenericCLRToCOMCallStub -> GenericCallNativeStub
Should I also rename class like
ComPlusMethodFrametoMethodFrameNative?For FCallsRelated :
COMDelegate -> DelegateNative
COMModule -> ModuleNative
along with calls like COMDelegate::GetMethodDesc -> ModuleNative_GetMethodDesc as noticed in the PR #60992
comdependenthandle.h -> dependenthandlenative.h
comdynamic.h -> dynamicwritenative.h with COMDynamicWrite -> DynamicWriteNative
comsynchronizable.h -> synchronizablenative.h
comthreadpool.h -> threadpoolnative.h
comwaithandle.h -> waithandlenative.h
COMDouble -> DoubleNative
COMSingle -> SingleNative
COMInterlocked -> InterlockedNative
COMPlusThrow -> ThrowNative
Am I on the right track? It's only my second issue
huoyaoyuan commentedon May 31, 2024
The
Nativesuffix should only be used for types that serves with corresponding managed type.There should use
ComToClrorClrToCom.Converting should better be a separated PR other than renaming.
These are native-only macros.
CLRThrowshould be better.pierrebelin commentedon May 31, 2024
Thanks !
I saw inside the solution types already named
CRLToCOMWorker, I think it's a good idea to keep it for those usecases:ComPlusCall -> CRLToCOMCall
ComPlusCallInfo -> CRLToCOMCallInfo
ComPlusCallMethodDesc -> CRLToCOMCallMethodDesc
GenericCLRToCOMCallStub -> GenericCRLToCOMCallStub
Perfect, I'll start to rename all on this and create a PR related
huoyaoyuan commentedon May 31, 2024
I still suggest to start with a few cases per PR. Some of these like COMPlusThrow has quite big impact on the whole repo.
pierrebelin commentedon May 31, 2024
No problem, I started with classes with ComPlus of COM interop related
jkotas commentedon Jun 10, 2024
#102922 is not a complete fix for this issue.
syfFerdinand commentedon Oct 14, 2024
Hello everyone,
I'd like to contribute to this issue and work on renaming the types as suggested. Is there any specific guidance or parts of the list I should start with?
I noticed some previous discussions regarding the complexity of certain types (like COMPlusThrow), so I can begin with the simpler cases to avoid conflicts. Any advice or confirmation on how to proceed would be greatly appreciated.
Thank you!
huoyaoyuan commentedon Oct 14, 2024
I'm afraid this isn't suitable for beginners. Although completing the renaming isn't complex, it's better to have more knowledge of the internal mechanisms of the coreclr code base to understand the naming conventions, and find all references that can be missed by IDE.
syfFerdinand commentedon Oct 14, 2024
Thank you for your feedback!
I understand that this issue might require deeper knowledge of the CoreCLR codebase. Given that, I’ll take a look at other issues where I can contribute while learning more about the internals.
If you have any suggestions for issues that might be more suitable for someone at my current level, I’d be happy to work on those as well.
Thanks again for your guidance!
tikap commentedon Mar 14, 2025
As per comment history can the "good first issue" label be removed from this issue?