I'm not aware of any such API, but CorSym.idl defines 2 standard GUIDs (whichare exactly the two possible algorithms that IDiaSourceFile::get_checksumType can return):
/* ------------------------------------------------------------------------- *
* Guids for known Source Hash Algorithms
* ------------------------------------------------------------------------- */
cpp_quote("EXTERN_GUID(CorSym_SourceHash_MD5, 0x406ea660, 0x64cf, 0x4c82, 0xb6, 0xf0, 0x42, 0xd4, 0x81, 0x72, 0xa7, 0x99);")
cpp_quote("EXTERN_GUID(CorSym_SourceHash_SHA1, 0xff1816ec, 0xaa5e, 0x4d10, 0x87, 0xf7, 0x6f, 0x49, 0x63, 0x83, 0x34, 0x60);")
So just checking against one of those guids should be sufficient for your purposes.
I think the reason diasymreader (ISymUnmanaged* APIs) uses a GUID instead of the simple numbers used by DIA (which DiaSymReader is built on top of), is that DiaSymReader can also be used to write PDBs - so there is no central authority for all possible values here (unlike for native PDBs which only Microsoft tools can generate).
Hope this helps, Rick- Marked As Answer byJon LangdonMSFT, OwnerWednesday, September 02, 2009 3:19 AM
-
All RepliesTuesday, September 01, 2009 4:31 AM Rick ByersMSFT, Owner     I'm not aware of any such API, but CorSym.idl defines 2 standard GUIDs (whichare exactly the two possible algorithms that IDiaSourceFile::get_checksumType can return):
/* ------------------------------------------------------------------------- *
* Guids for known Source Hash Algorithms
* ------------------------------------------------------------------------- */
cpp_quote("EXTERN_GUID(CorSym_SourceHash_MD5, 0x406ea660, 0x64cf, 0x4c82, 0xb6, 0xf0, 0x42, 0xd4, 0x81, 0x72, 0xa7, 0x99);")
cpp_quote("EXTERN_GUID(CorSym_SourceHash_SHA1, 0xff1816ec, 0xaa5e, 0x4d10, 0x87, 0xf7, 0x6f, 0x49, 0x63, 0x83, 0x34, 0x60);")
So just checking against one of those guids should be sufficient for your purposes. I think the reason diasymreader (ISymUnmanaged* APIs) uses a GUID instead of the simple numbers used by DIA (which DiaSymReader is built on top of), is that DiaSymReader can also be used to write PDBs - so there is no central authority for all possible values here (unlike for native PDBs which only Microsoft tools can generate). Hope this helps, Rick - Marked As Answer byJon LangdonMSFT, OwnerWednesday, September 02, 2009 3:19 AM
-
Thank you! That is exactly what I need.
DP Thanks,
DP
|